diff --git a/Gemfile b/Gemfile index 9974384..9377ec5 100644 --- a/Gemfile +++ b/Gemfile @@ -50,6 +50,9 @@ gem "bootsnap", require: false # Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images] # gem "image_processing", "~> 1.2" +# vite rails +gem "vite_rails", "~> 3.0" + group :production do gem "mysql2" gem "passenger", ">= 5.0.25", require: "phusion_passenger/rack_handler" @@ -91,7 +94,7 @@ gem "blacklight", "~> 7.35" # See: https://github.com/projectblacklight/blacklight_advanced_search/issues/127 gem "blacklight_advanced_search", git: "https://github.com/ewlarson/blacklight_advanced_search.git", branch: "bl7-fix-gentle-hands" -gem "geoblacklight", "4.1" +gem "geoblacklight", "~> 4.4" gem "geoblacklight_sidecar_images", "~> 1.0" gem "mini_magick", "~> 4.0" gem "sprockets", "< 4.0" diff --git a/Gemfile.lock b/Gemfile.lock index 0138dc4..ff7f0e3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -137,7 +137,7 @@ GEM connection_pool (2.4.1) crass (1.0.6) date (3.3.4) - debug (1.9.1) + debug (1.9.2) irb (~> 1.10) reline (>= 0.3.8) deep_merge (1.2.2) @@ -157,6 +157,7 @@ GEM dotenv-rails (3.1.0) dotenv (= 3.1.0) railties (>= 6.1) + dry-cli (1.0.0) ed25519 (1.3.0) erubi (1.12.0) exception_notification (4.5.0) @@ -186,17 +187,19 @@ GEM rsolr sanitize thor - geoblacklight (4.1.0) - blacklight (~> 7.33) + geoblacklight (4.4.0) + blacklight (~> 7.0) coderay config deprecation - faraday (>= 1.0) - geo_combine (~> 0.8) + faraday (~> 2.0) + geo_combine (~> 0.9) handlebars_assets mime-types - rails (>= 6.1, < 7.1) + rails (>= 6.1, < 7.2) rgeo-geojson + sprockets-rails (~> 3.0) + vite_rails (~> 3.0) geoblacklight_sidecar_images (1.0.0) faraday (>= 2.0) geoblacklight (~> 4.0) @@ -249,7 +252,7 @@ GEM railties (>= 4.2.0) thor (>= 0.14, < 2.0) json (2.7.1) - json-schema (4.2.0) + json-schema (4.3.0) addressable (>= 2.8) kaminari (1.2.2) activesupport (>= 4.1.0) @@ -310,10 +313,10 @@ GEM net-ssh (>= 2.6.5, < 8.0.0) net-sftp (4.0.0) net-ssh (>= 5.0.0, < 8.0.0) - net-smtp (0.4.0.1) + net-smtp (0.5.0) net-protocol - net-ssh (7.2.1) - nio4r (2.7.0) + net-ssh (7.2.3) + nio4r (2.7.1) nokogiri (1.16.3-x86_64-linux) racc (~> 1.4) orm_adapter (0.5.0) @@ -329,11 +332,13 @@ GEM popper_js (1.16.1) psych (5.1.2) stringio - public_suffix (5.0.4) + public_suffix (5.0.5) puma (6.4.2) nio4r (~> 2.0) racc (1.7.3) rack (2.2.9) + rack-proxy (0.7.7) + rack rack-test (2.1.0) rack (>= 1.3) rails (7.0.8.1) @@ -365,16 +370,16 @@ GEM thor (~> 1.0) zeitwerk (~> 2.5) rainbow (3.1.1) - rake (13.1.0) + rake (13.2.0) rchardet (1.8.0) rdoc (6.6.3.1) psych (>= 4.0.0) redis (5.1.0) redis-client (>= 0.17.0) - redis-client (0.21.0) + redis-client (0.21.1) connection_pool regexp_parser (2.9.0) - reline (0.4.3) + reline (0.5.0) io-console (~> 0.5) responders (3.1.1) actionpack (>= 5.2) @@ -440,7 +445,8 @@ GEM minitar retriable ruby-progressbar - sprockets (3.7.2) + sprockets (3.7.3) + base64 concurrent-ruby (~> 1.0) rack (> 1, < 3) sprockets-rails (3.4.2) @@ -448,7 +454,8 @@ GEM activesupport (>= 5.2) sprockets (>= 3.0.0) sqlite3 (1.7.3-x86_64-linux) - sshkit (1.22.0) + sshkit (1.22.1) + base64 mutex_m net-scp (>= 1.1.2) net-sftp (>= 2.1.2) @@ -491,6 +498,13 @@ GEM activesupport (>= 5.2.0, < 8.0) concurrent-ruby (~> 1.0) method_source (~> 1.0) + vite_rails (3.0.17) + railties (>= 5.1, < 8) + vite_ruby (~> 3.0, >= 3.2.2) + vite_ruby (3.5.0) + dry-cli (>= 0.7, < 2) + rack-proxy (~> 0.6, >= 0.6.1) + zeitwerk (~> 2.2) warden (1.2.9) rack (>= 2.0.9) web-console (4.2.1) @@ -536,7 +550,7 @@ DEPENDENCIES ed25519 (>= 1.2, < 2.0) exception_notification (~> 4.5) geo_combine (>= 0.9) - geoblacklight (= 4.1) + geoblacklight (~> 4.4) geoblacklight_sidecar_images (~> 1.0) haml importmap-rails @@ -563,6 +577,7 @@ DEPENDENCIES turbo-rails twitter-typeahead-rails (= 0.11.1) tzinfo-data + vite_rails (~> 3.0) web-console webdrivers whenever (~> 1.0.0) diff --git a/app/javascript/entrypoints/clover.js b/app/javascript/entrypoints/clover.js new file mode 100644 index 0000000..b29d86c --- /dev/null +++ b/app/javascript/entrypoints/clover.js @@ -0,0 +1,5 @@ +import { CloverInitializer } from '@geoblacklight/frontend' + +document.addEventListener('DOMContentLoaded', () => { + new CloverInitializer().run() +}) diff --git a/app/javascript/entrypoints/ol.js b/app/javascript/entrypoints/ol.js new file mode 100644 index 0000000..38a671d --- /dev/null +++ b/app/javascript/entrypoints/ol.js @@ -0,0 +1,6 @@ +import '@geoblacklight/frontend/dist/style.css' +import { OlInitializer } from '@geoblacklight/frontend' + +document.addEventListener('DOMContentLoaded', () => { + new OlInitializer().run() +}) diff --git a/app/views/layouts/blacklight/base.html.erb b/app/views/layouts/blacklight/base.html.erb index 6774e01..684cba6 100644 --- a/app/views/layouts/blacklight/base.html.erb +++ b/app/views/layouts/blacklight/base.html.erb @@ -23,6 +23,13 @@ <%= javascript_include_tag "application", "data-turbo-track": "reload" %> + <%= vite_client_tag %> + <% if openlayers_container? %> + <%= vite_javascript_tag 'ol' %> + <% elsif iiif_manifest_container? %> + <%= vite_javascript_tag 'clover' %> + <% end %> + diff --git a/config/settings.yml b/config/settings.yml index 4d5d62c..16ecf59 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -129,6 +129,8 @@ WEBSERVICES_SHOWN: - 'tiled_map_layer' - 'dynamic_map_layer' - 'image_map_layer' + - 'cog' + - 'pmtiles' # Relationships to display RELATIONSHIPS_SHOWN: @@ -245,3 +247,5 @@ HELP_TEXT: - 'wms' - 'tms' - 'oembed' + - 'pmtiles' + - 'cog' diff --git a/config/vite.json b/config/vite.json new file mode 100644 index 0000000..756db8b --- /dev/null +++ b/config/vite.json @@ -0,0 +1,17 @@ +{ + "all": { + "sourceCodeDir": "app/javascript", + "watchAdditionalPaths": [] + }, + "development": { + "autoBuild": true, + "publicOutputDir": "vite-dev", + "port": 3036 + }, + "test": { + "autoBuild": true, + "publicOutputDir": "vite-test", + "port": 3037 + } + } + \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..a5c2f45 --- /dev/null +++ b/package.json @@ -0,0 +1,11 @@ +{ + "dependencies": { + "@geoblacklight/frontend": "^4.4" + }, + "devDependencies": { + "vite": "^5.1.5", + "vite-plugin-ruby": "^5.0.0", + "vite-plugin-rails": "^0.5.0" + } + } + \ No newline at end of file diff --git a/public/vite-dev/.vite/manifest-assets.json b/public/vite-dev/.vite/manifest-assets.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/public/vite-dev/.vite/manifest-assets.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/public/vite-dev/.vite/manifest-assets.json.br b/public/vite-dev/.vite/manifest-assets.json.br new file mode 100644 index 0000000..d2ed9c0 Binary files /dev/null and b/public/vite-dev/.vite/manifest-assets.json.br differ diff --git a/public/vite-dev/.vite/manifest-assets.json.gz b/public/vite-dev/.vite/manifest-assets.json.gz new file mode 100644 index 0000000..e9e5a38 Binary files /dev/null and b/public/vite-dev/.vite/manifest-assets.json.gz differ diff --git a/public/vite-dev/.vite/manifest.json b/public/vite-dev/.vite/manifest.json new file mode 100644 index 0000000..bde6971 --- /dev/null +++ b/public/vite-dev/.vite/manifest.json @@ -0,0 +1,130 @@ +{ + "../../node_modules/@geoblacklight/frontend/dist/decoder-b0JuKe3x.js": { + "file": "assets/decoder-b0JuKe3x-CaSv2t6h.js", + "name": "decoder-b0JuKe3x", + "src": "../../node_modules/@geoblacklight/frontend/dist/decoder-b0JuKe3x.js", + "isDynamicEntry": true, + "integrity": "sha384-16TFme9yTmIxkkyjFo8gAt0yhcOQ+Jn3OUgtxDzzctA5UBZlVu2Lw0vmcsazFTuQ" + }, + "../../node_modules/@geoblacklight/frontend/dist/deflate-vcCR2g03.js": { + "file": "assets/deflate-vcCR2g03-uJvqLAd5.js", + "name": "deflate-vcCR2g03", + "src": "../../node_modules/@geoblacklight/frontend/dist/deflate-vcCR2g03.js", + "isDynamicEntry": true, + "imports": [ + "_pako.esm-BSHzuB9t-DQSVoCko.js", + "_basedecoder-PFIibI7U-gdlnpIMU.js" + ], + "integrity": "sha384-k0l/vYu09x29flsb2O1nbKvtv1C7n7rSfRmoSLqETyGLHSivCcvsrVDCIDgsWS5d" + }, + "../../node_modules/@geoblacklight/frontend/dist/jpeg-cL5qbLGO.js": { + "file": "assets/jpeg-cL5qbLGO-DsQ9NELO.js", + "name": "jpeg-cL5qbLGO", + "src": "../../node_modules/@geoblacklight/frontend/dist/jpeg-cL5qbLGO.js", + "isDynamicEntry": true, + "imports": [ + "_basedecoder-PFIibI7U-gdlnpIMU.js" + ], + "integrity": "sha384-XUDi9Q/s6wr9i1c9zoCoWy43i3ap+FmRKKkD8mwhr1Nv8Ex6dDcmuppK988b+CDH" + }, + "../../node_modules/@geoblacklight/frontend/dist/lerc-uk49vBKp.js": { + "file": "assets/lerc-uk49vBKp-C2xrmYNa.js", + "name": "lerc-uk49vBKp", + "src": "../../node_modules/@geoblacklight/frontend/dist/lerc-uk49vBKp.js", + "isDynamicEntry": true, + "imports": [ + "_pako.esm-BSHzuB9t-DQSVoCko.js", + "_index-pmp42xxj-DHbdtNrf.js", + "_basedecoder-PFIibI7U-gdlnpIMU.js" + ], + "integrity": "sha384-UmoNL3q+EfEUpSnmymDe/IZM2hOPYfzZWouLth2aGVr+QeDZ0m2hkyhc8Nc7AZVO" + }, + "../../node_modules/@geoblacklight/frontend/dist/lzw-5BnjP5Zu.js": { + "file": "assets/lzw-5BnjP5Zu-Rtm9pMoi.js", + "name": "lzw-5BnjP5Zu", + "src": "../../node_modules/@geoblacklight/frontend/dist/lzw-5BnjP5Zu.js", + "isDynamicEntry": true, + "imports": [ + "_basedecoder-PFIibI7U-gdlnpIMU.js" + ], + "integrity": "sha384-BwT5MhSmyk8s/M+1hjjUFK2iVRFMQiRVe9Y3MT8RrPh+u3FQrJMjlAlz1Gr1BGde" + }, + "../../node_modules/@geoblacklight/frontend/dist/packbits-QLsyzNt2.js": { + "file": "assets/packbits-QLsyzNt2-BPOn6aoD.js", + "name": "packbits-QLsyzNt2", + "src": "../../node_modules/@geoblacklight/frontend/dist/packbits-QLsyzNt2.js", + "isDynamicEntry": true, + "imports": [ + "_basedecoder-PFIibI7U-gdlnpIMU.js" + ], + "integrity": "sha384-s5KDJZyZ6n7H25TD5O9sYB+VJZmYheMjY9VN890oP7Bco8/hqIgzp4XYhJQdk0+h" + }, + "../../node_modules/@geoblacklight/frontend/dist/raw-_eObXrMO.js": { + "file": "assets/raw-_eObXrMO-z93--tm9.js", + "name": "raw-_eObXrMO", + "src": "../../node_modules/@geoblacklight/frontend/dist/raw-_eObXrMO.js", + "isDynamicEntry": true, + "imports": [ + "_basedecoder-PFIibI7U-gdlnpIMU.js" + ], + "integrity": "sha384-MpX9l6+E4I6yXX3BKvK0bY98KcLCpm2mg/wHA3rKb7Fb/4ZWQuKadoNfGG14YSTz" + }, + "../../node_modules/@geoblacklight/frontend/dist/webimage-Hf-HYtMO.js": { + "file": "assets/webimage-Hf-HYtMO-Cer-ofJO.js", + "name": "webimage-Hf-HYtMO", + "src": "../../node_modules/@geoblacklight/frontend/dist/webimage-Hf-HYtMO.js", + "isDynamicEntry": true, + "imports": [ + "_basedecoder-PFIibI7U-gdlnpIMU.js" + ], + "integrity": "sha384-IJZnDVa5u9eyVWlTf52XU6R05xZymUQURDhyUkEQ0zYnwbFspaNP6DSjbiakDodY" + }, + "_basedecoder-PFIibI7U-gdlnpIMU.js": { + "file": "assets/basedecoder-PFIibI7U-gdlnpIMU.js", + "name": "basedecoder-PFIibI7U", + "integrity": "sha384-iu0Q5sffMrWYW50SIciWaM3q4lOWOpYpd6RLb6qeLGxpb/UpnSciLpRulbRswdc4" + }, + "_index-pmp42xxj-DHbdtNrf.js": { + "file": "assets/index-pmp42xxj-DHbdtNrf.js", + "name": "index-pmp42xxj", + "dynamicImports": [ + "../../node_modules/@geoblacklight/frontend/dist/raw-_eObXrMO.js", + "../../node_modules/@geoblacklight/frontend/dist/lzw-5BnjP5Zu.js", + "../../node_modules/@geoblacklight/frontend/dist/jpeg-cL5qbLGO.js", + "../../node_modules/@geoblacklight/frontend/dist/deflate-vcCR2g03.js", + "../../node_modules/@geoblacklight/frontend/dist/packbits-QLsyzNt2.js", + "../../node_modules/@geoblacklight/frontend/dist/lerc-uk49vBKp.js", + "../../node_modules/@geoblacklight/frontend/dist/webimage-Hf-HYtMO.js", + "../../node_modules/@geoblacklight/frontend/dist/decoder-b0JuKe3x.js" + ], + "integrity": "sha384-o50+0E6WvzBgYhVkwISFR86hojzGc4dAN/NEGY9V/EIC95AHaVc0ZDaUUFKARmt7" + }, + "_pako.esm-BSHzuB9t-DQSVoCko.js": { + "file": "assets/pako.esm-BSHzuB9t-DQSVoCko.js", + "name": "pako.esm-BSHzuB9t", + "integrity": "sha384-R6RhceprSqGv4DaVx8YQZEpcrBUrgFIxlt99XxVtqqcu3uC+okJxUkzYnNGJWDRA" + }, + "entrypoints/clover.js": { + "file": "assets/clover-Dn1nVu0D.js", + "name": "entrypoints/clover.js", + "src": "entrypoints/clover.js", + "isEntry": true, + "imports": [ + "_index-pmp42xxj-DHbdtNrf.js" + ], + "integrity": "sha384-auUG40/Ox/wwvyfaEsPCBaAH+qW08lpy1vm3S53mBS4XK0tYyAhn0IYFjj2qGJ6e" + }, + "entrypoints/ol.js": { + "file": "assets/ol-CZCByJ0B.js", + "name": "entrypoints/ol.js", + "src": "entrypoints/ol.js", + "isEntry": true, + "imports": [ + "_index-pmp42xxj-DHbdtNrf.js" + ], + "css": [ + "assets/ol-BxkN_WYY.css" + ], + "integrity": "sha384-0ULbdyNwidvVa1PyrcZlSPr/FcV57RNj0Snng4HaUeaSo++KquvbfKOGF040lPKV" + } +} \ No newline at end of file diff --git a/public/vite-dev/.vite/manifest.json.br b/public/vite-dev/.vite/manifest.json.br new file mode 100644 index 0000000..664e8c1 Binary files /dev/null and b/public/vite-dev/.vite/manifest.json.br differ diff --git a/public/vite-dev/.vite/manifest.json.gz b/public/vite-dev/.vite/manifest.json.gz new file mode 100644 index 0000000..4bb0724 Binary files /dev/null and b/public/vite-dev/.vite/manifest.json.gz differ diff --git a/public/vite-dev/assets/basedecoder-PFIibI7U-gdlnpIMU.js b/public/vite-dev/assets/basedecoder-PFIibI7U-gdlnpIMU.js new file mode 100644 index 0000000..383733d --- /dev/null +++ b/public/vite-dev/assets/basedecoder-PFIibI7U-gdlnpIMU.js @@ -0,0 +1 @@ +function h(i,e){let t=i.length-e,c=0;do{for(let l=e;l>0;l--)i[c+e]+=i[c],c++;t-=e}while(t>0)}function f(i,e,t){let c=0,l=i.length;const n=l/t;for(;l>e;){for(let r=e;r>0;--r)i[c+e]+=i[c],++c;l-=e}const o=i.slice();for(let r=0;r=i.byteLength);++s){let a;if(e===2){switch(l[0]){case 8:a=new Uint8Array(i,s*r*t*o,r*t*o);break;case 16:a=new Uint16Array(i,s*r*t*o,r*t*o/2);break;case 32:a=new Uint32Array(i,s*r*t*o,r*t*o/4);break;default:throw new Error(`Predictor 2 not allowed with ${l[0]} bits per sample.`)}h(a,r)}else e===3&&(a=new Uint8Array(i,s*r*t*o,r*t*o),f(a,r,o))}return i}class w{async decode(e,t){const c=await this.decodeBlock(t),l=e.Predictor||1;if(l!==1){const n=!e.StripOffsets,o=n?e.TileWidth:e.ImageWidth,r=n?e.TileLength:e.RowsPerStrip||e.ImageLength;return d(c,l,o,r,e.BitsPerSample,e.PlanarConfiguration)}return c}}export{w as g}; diff --git a/public/vite-dev/assets/basedecoder-PFIibI7U-gdlnpIMU.js.br b/public/vite-dev/assets/basedecoder-PFIibI7U-gdlnpIMU.js.br new file mode 100644 index 0000000..95cbf6e Binary files /dev/null and b/public/vite-dev/assets/basedecoder-PFIibI7U-gdlnpIMU.js.br differ diff --git a/public/vite-dev/assets/basedecoder-PFIibI7U-gdlnpIMU.js.gz b/public/vite-dev/assets/basedecoder-PFIibI7U-gdlnpIMU.js.gz new file mode 100644 index 0000000..5019464 Binary files /dev/null and b/public/vite-dev/assets/basedecoder-PFIibI7U-gdlnpIMU.js.gz differ diff --git a/public/vite-dev/assets/clover-Dn1nVu0D.js b/public/vite-dev/assets/clover-Dn1nVu0D.js new file mode 100644 index 0000000..a0cdeed --- /dev/null +++ b/public/vite-dev/assets/clover-Dn1nVu0D.js @@ -0,0 +1 @@ +import{C as e}from"./index-pmp42xxj-DHbdtNrf.js";document.addEventListener("DOMContentLoaded",()=>{new e().run()}); diff --git a/public/vite-dev/assets/clover-Dn1nVu0D.js.br b/public/vite-dev/assets/clover-Dn1nVu0D.js.br new file mode 100644 index 0000000..cd21c2d Binary files /dev/null and b/public/vite-dev/assets/clover-Dn1nVu0D.js.br differ diff --git a/public/vite-dev/assets/clover-Dn1nVu0D.js.gz b/public/vite-dev/assets/clover-Dn1nVu0D.js.gz new file mode 100644 index 0000000..5f23706 Binary files /dev/null and b/public/vite-dev/assets/clover-Dn1nVu0D.js.gz differ diff --git a/public/vite-dev/assets/decoder-b0JuKe3x-CaSv2t6h.js b/public/vite-dev/assets/decoder-b0JuKe3x-CaSv2t6h.js new file mode 100644 index 0000000..b19bf68 --- /dev/null +++ b/public/vite-dev/assets/decoder-b0JuKe3x-CaSv2t6h.js @@ -0,0 +1 @@ +const e=Worker;function t(){const A='function A(A,e,t,i,r,I,g){try{var n=A[I](g),a=n.value}catch(A){return void t(A)}n.done?e(a):Promise.resolve(a).then(i,r)}function e(e){return function(){var t=this,i=arguments;return new Promise((function(r,I){var g=e.apply(t,i);function n(e){A(g,r,I,n,a,"next",e)}function a(e){A(g,r,I,n,a,"throw",e)}n(void 0)}))}}function t(A){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},t(A)}var i={exports:{}};!function(A){var e=function(A){var e,i=Object.prototype,r=i.hasOwnProperty,I="function"==typeof Symbol?Symbol:{},g=I.iterator||"@@iterator",n=I.asyncIterator||"@@asyncIterator",a=I.toStringTag||"@@toStringTag";function o(A,e,t){return Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}),A[e]}try{o({},"")}catch(A){o=function(A,e,t){return A[e]=t}}function B(A,e,t,i){var r=e&&e.prototype instanceof h?e:h,I=Object.create(r.prototype),g=new S(i||[]);return I._invoke=function(A,e,t){var i=Q;return function(r,I){if(i===s)throw new Error("Generator is already running");if(i===f){if("throw"===r)throw I;return R()}for(t.method=r,t.arg=I;;){var g=t.delegate;if(g){var n=m(g,t);if(n){if(n===c)continue;return n}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if(i===Q)throw i=f,t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);i=s;var a=C(A,e,t);if("normal"===a.type){if(i=t.done?f:E,a.arg===c)continue;return{value:a.arg,done:t.done}}"throw"===a.type&&(i=f,t.method="throw",t.arg=a.arg)}}}(A,t,g),I}function C(A,e,t){try{return{type:"normal",arg:A.call(e,t)}}catch(A){return{type:"throw",arg:A}}}A.wrap=B;var Q="suspendedStart",E="suspendedYield",s="executing",f="completed",c={};function h(){}function l(){}function u(){}var w={};o(w,g,(function(){return this}));var d=Object.getPrototypeOf,D=d&&d(d(v([])));D&&D!==i&&r.call(D,g)&&(w=D);var y=u.prototype=h.prototype=Object.create(w);function k(A){["next","throw","return"].forEach((function(e){o(A,e,(function(A){return this._invoke(e,A)}))}))}function p(A,e){function i(I,g,n,a){var o=C(A[I],A,g);if("throw"!==o.type){var B=o.arg,Q=B.value;return Q&&"object"===t(Q)&&r.call(Q,"__await")?e.resolve(Q.__await).then((function(A){i("next",A,n,a)}),(function(A){i("throw",A,n,a)})):e.resolve(Q).then((function(A){B.value=A,n(B)}),(function(A){return i("throw",A,n,a)}))}a(o.arg)}var I;this._invoke=function(A,t){function r(){return new e((function(e,r){i(A,t,e,r)}))}return I=I?I.then(r,r):r()}}function m(A,t){var i=A.iterator[t.method];if(i===e){if(t.delegate=null,"throw"===t.method){if(A.iterator.return&&(t.method="return",t.arg=e,m(A,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a \'throw\' method")}return c}var r=C(i,A.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,c;var I=r.arg;return I?I.done?(t[A.resultName]=I.value,t.next=A.nextLoc,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,c):I:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function G(A){var e={tryLoc:A[0]};1 in A&&(e.catchLoc=A[1]),2 in A&&(e.finallyLoc=A[2],e.afterLoc=A[3]),this.tryEntries.push(e)}function F(A){var e=A.completion||{};e.type="normal",delete e.arg,A.completion=e}function S(A){this.tryEntries=[{tryLoc:"root"}],A.forEach(G,this),this.reset(!0)}function v(A){if(A){var t=A[g];if(t)return t.call(A);if("function"==typeof A.next)return A;if(!isNaN(A.length)){var i=-1,I=function t(){for(;++i=0;--I){var g=this.tryEntries[I],n=g.completion;if("root"===g.tryLoc)return i("end");if(g.tryLoc<=this.prev){var a=r.call(g,"catchLoc"),o=r.call(g,"finallyLoc");if(a&&o){if(this.prev=0;--t){var i=this.tryEntries[t];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var t=this.tryEntries[e];if(t.finallyLoc===A)return this.complete(t.completion,t.afterLoc),F(t),c}},catch:function(A){for(var e=this.tryEntries.length-1;e>=0;--e){var t=this.tryEntries[e];if(t.tryLoc===A){var i=t.completion;if("throw"===i.type){var r=i.arg;F(t)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(A,t,i){return this.delegate={iterator:v(A),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=e),c}},A}(A.exports);try{regeneratorRuntime=e}catch(A){"object"===("undefined"==typeof globalThis?"undefined":t(globalThis))?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}(i);var r=i.exports,I=new Map;function g(A,e){Array.isArray(A)||(A=[A]),A.forEach((function(A){return I.set(A,e)}))}function n(A){return a.apply(this,arguments)}function a(){return(a=e(r.mark((function A(e){var t,i;return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(t=I.get(e.Compression)){A.next=3;break}throw new Error("Unknown compression method identifier: ".concat(e.Compression));case 3:return A.next=5,t();case 5:return i=A.sent,A.abrupt("return",new i(e));case 7:case"end":return A.stop()}}),A)})))).apply(this,arguments)}g([void 0,1],(function(){return Promise.resolve().then((function(){return y})).then((function(A){return A.default}))})),g(5,(function(){return Promise.resolve().then((function(){return F})).then((function(A){return A.default}))})),g(6,(function(){throw new Error("old style JPEG compression is not supported.")})),g(7,(function(){return Promise.resolve().then((function(){return N})).then((function(A){return A.default}))})),g([8,32946],(function(){return Promise.resolve().then((function(){return OA})).then((function(A){return A.default}))})),g(32773,(function(){return Promise.resolve().then((function(){return _A})).then((function(A){return A.default}))})),g(34887,(function(){return Promise.resolve().then((function(){return le})).then(function(){var A=e(r.mark((function A(e){return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,e.zstd.init();case 2:return A.abrupt("return",e);case 3:case"end":return A.stop()}}),A)})));return function(e){return A.apply(this,arguments)}}()).then((function(A){return A.default}))})),g(50001,(function(){return Promise.resolve().then((function(){return de})).then((function(A){return A.default}))}));var o=globalThis;function B(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}function C(A,e){for(var t=0;t0;r--)A[i+e]+=A[i],i++;t-=e}while(t>0)}function l(A,e,t){for(var i=0,r=A.length,I=r/t;r>e;){for(var g=e;g>0;--g)A[i+e]+=A[i],++i;r-=e}for(var n=A.slice(),a=0;a=A.byteLength);++o){var B=void 0;if(2===e){switch(r[0]){case 8:B=new Uint8Array(A,o*a*t*n,a*t*n);break;case 16:B=new Uint16Array(A,o*a*t*n,a*t*n/2);break;case 32:B=new Uint32Array(A,o*a*t*n,a*t*n/4);break;default:throw new Error("Predictor 2 not allowed with ".concat(r[0]," bits per sample."))}h(B,a)}else 3===e&&l(B=new Uint8Array(A,o*a*t*n,a*t*n),a,n)}return A}o.addEventListener("message",function(){var A=e(r.mark((function A(e){var t,i,I,g,a,B;return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return t=e.data,i=t.id,I=t.fileDirectory,g=t.buffer,A.next=3,n(I);case 3:return a=A.sent,A.next=6,a.decode(I,g);case 6:B=A.sent,o.postMessage({decoded:B,id:i},[B]);case 8:case"end":return A.stop()}}),A)})));return function(e){return A.apply(this,arguments)}}());var w=function(){function A(){B(this,A)}var t;return Q(A,[{key:"decode",value:(t=e(r.mark((function A(e,t){var i,I,g,n,a;return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this.decodeBlock(t);case 2:if(i=A.sent,1===(I=e.Predictor||1)){A.next=9;break}return g=!e.StripOffsets,n=g?e.TileWidth:e.ImageWidth,a=g?e.TileLength:e.RowsPerStrip||e.ImageLength,A.abrupt("return",u(i,I,n,a,e.BitsPerSample,e.PlanarConfiguration));case 9:return A.abrupt("return",i);case 10:case"end":return A.stop()}}),A,this)}))),function(A,e){return t.apply(this,arguments)})}]),A}();function d(A){var e=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(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var D=function(A){s(t,w);var e=d(t);function t(){return B(this,t),e.apply(this,arguments)}return Q(t,[{key:"decodeBlock",value:function(A){return A}}]),t}(),y=Object.freeze({__proto__:null,default:D});function k(A){var e=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(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}function p(A,e){for(var t=e.length-1;t>=0;t--)A.push(e[t]);return A}function m(A){for(var e=new Uint16Array(4093),t=new Uint8Array(4093),i=0;i<=257;i++)e[i]=4096,t[i]=i;var r=258,I=9,g=0;function n(){r=258,I=9}function a(A){var e=function(A,e,t){var i=e%8,r=Math.floor(e/8),I=8-i,g=e+t-8*(r+1),n=8*(r+2)-(e+t),a=8*(r+2)-e;if(n=Math.max(0,n),r>=A.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),257;var o=A[r]&Math.pow(2,8-i)-1,B=o<<=t-I;if(r+1>>n;B+=C<<=Math.max(0,t-a)}if(g>8&&r+2>>Q}return B}(A,g,I);return g+=I,e}function o(A,i){return t[r]=i,e[r]=A,++r-1}function B(A){for(var i=[],r=A;4096!==r;r=e[r])i.push(t[r]);return i}var C=[];n();for(var Q,E=new Uint8Array(A),s=a(E);257!==s;){if(256===s){for(n(),s=a(E);256===s;)s=a(E);if(257===s)break;if(s>256)throw new Error("corrupted code at scanline ".concat(s));p(C,B(s)),Q=s}else if(s=Math.pow(2,I)&&(12===I?Q=void 0:I++),s=a(E)}return new Uint8Array(C)}var G=function(A){s(t,w);var e=k(t);function t(){return B(this,t),e.apply(this,arguments)}return Q(t,[{key:"decodeBlock",value:function(A){return m(A).buffer}}]),t}(),F=Object.freeze({__proto__:null,default:G});function S(A){var e=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(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var v=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);function R(A,e){for(var t=0,i=[],r=16;r>0&&!A[r-1];)--r;i.push({children:[],index:0});for(var I,g=i[0],n=0;n0;)g=i.pop();for(g.index++,i.push(g);i.length<=n;)i.push(I={children:[],index:0}),g.children[g.index]=I.children,g=I;t++}n+10)return f--,s>>f&1;if(255===(s=A[E++])){var e=A[E++];if(e)throw new Error("unexpected marker: ".concat((s<<8|e).toString(16)))}return f=7,s>>>7}function h(A){for(var e,i=A;null!==(e=c());){if("number"==typeof(i=i[e]))return i;if("object"!==t(i))throw new Error("invalid huffman sequence")}return null}function l(A){for(var e=A,t=0;e>0;){var i=c();if(null===i)return;t=t<<1|i,--e}return t}function u(A){var e=l(A);return e>=1<0)w--;else for(var t=g,i=n;t<=i;){var r=h(A.huffmanTableAC),I=15&r,a=r>>4;if(0===I){if(a<15){w=l(a)+(1<>4,0===C)r<15?(w=l(r)+(1<>4;if(0===g){if(n<15)break;r+=16}else e[v[r+=n]]=u(g),r++}};var L,b,M=0;b=1===U?r[0].blocksPerLine*r[0].blocksPerColumn:B*i.mcusPerColumn;for(var N=I||b;M=65488&&L<=65495))break;E+=2}return E-Q}function L(A,e){var t=[],i=e.blocksPerLine,r=e.blocksPerColumn,I=i<<3,g=new Int32Array(64),n=new Uint8Array(64);function a(A,t,i){var r,I,g,n,a,o,B,C,Q,E,s=e.quantizationTable,f=i;for(E=0;E<64;E++)f[E]=A[E]*s[E];for(E=0;E<8;++E){var c=8*E;0!==f[1+c]||0!==f[2+c]||0!==f[3+c]||0!==f[4+c]||0!==f[5+c]||0!==f[6+c]||0!==f[7+c]?(r=5793*f[0+c]+128>>8,I=5793*f[4+c]+128>>8,g=f[2+c],n=f[6+c],a=2896*(f[1+c]-f[7+c])+128>>8,C=2896*(f[1+c]+f[7+c])+128>>8,o=f[3+c]<<4,Q=r-I+1>>1,r=r+I+1>>1,I=Q,Q=3784*g+1567*n+128>>8,g=1567*g-3784*n+128>>8,n=Q,Q=a-(B=f[5+c]<<4)+1>>1,a=a+B+1>>1,B=Q,Q=C+o+1>>1,o=C-o+1>>1,C=Q,Q=r-n+1>>1,r=r+n+1>>1,n=Q,Q=I-g+1>>1,I=I+g+1>>1,g=Q,Q=2276*a+3406*C+2048>>12,a=3406*a-2276*C+2048>>12,C=Q,Q=799*o+4017*B+2048>>12,o=4017*o-799*B+2048>>12,B=Q,f[0+c]=r+C,f[7+c]=r-C,f[1+c]=I+B,f[6+c]=I-B,f[2+c]=g+o,f[5+c]=g-o,f[3+c]=n+a,f[4+c]=n-a):(Q=5793*f[0+c]+512>>10,f[0+c]=Q,f[1+c]=Q,f[2+c]=Q,f[3+c]=Q,f[4+c]=Q,f[5+c]=Q,f[6+c]=Q,f[7+c]=Q)}for(E=0;E<8;++E){var h=E;0!==f[8+h]||0!==f[16+h]||0!==f[24+h]||0!==f[32+h]||0!==f[40+h]||0!==f[48+h]||0!==f[56+h]?(r=5793*f[0+h]+2048>>12,I=5793*f[32+h]+2048>>12,g=f[16+h],n=f[48+h],a=2896*(f[8+h]-f[56+h])+2048>>12,C=2896*(f[8+h]+f[56+h])+2048>>12,o=f[24+h],Q=r-I+1>>1,r=r+I+1>>1,I=Q,Q=3784*g+1567*n+2048>>12,g=1567*g-3784*n+2048>>12,n=Q,Q=a-(B=f[40+h])+1>>1,a=a+B+1>>1,B=Q,Q=C+o+1>>1,o=C-o+1>>1,C=Q,Q=r-n+1>>1,r=r+n+1>>1,n=Q,Q=I-g+1>>1,I=I+g+1>>1,g=Q,Q=2276*a+3406*C+2048>>12,a=3406*a-2276*C+2048>>12,C=Q,Q=799*o+4017*B+2048>>12,o=4017*o-799*B+2048>>12,B=Q,f[0+h]=r+C,f[56+h]=r-C,f[8+h]=I+B,f[48+h]=I-B,f[16+h]=g+o,f[40+h]=g-o,f[24+h]=n+a,f[32+h]=n-a):(Q=5793*i[E+0]+8192>>14,f[0+h]=Q,f[8+h]=Q,f[16+h]=Q,f[24+h]=Q,f[32+h]=Q,f[40+h]=Q,f[48+h]=Q,f[56+h]=Q)}for(E=0;E<64;++E){var l=128+(f[E]+8>>4);t[E]=l<0?0:l>255?255:l}}for(var o=0;o>4==0)for(var C=0;C<64;C++){B[v[C]]=A[e++]}else{if(o>>4!=1)throw new Error("DQT: invalid table spec");for(var Q=0;Q<64;Q++){B[v[Q]]=t()}}this.quantizationTables[15&o]=B}break;case 65472:case 65473:case 65474:t();for(var E={extended:65473===g,progressive:65474===g,precision:A[e++],scanLines:t(),samplesPerLine:t(),components:{},componentsOrder:[]},s=A[e++],f=void 0,c=0;c>4,l=15&A[e+1],u=A[e+2];E.componentsOrder.push(f),E.components[f]={h:h,v:l,quantizationIdx:u},e+=3}i(E),this.frames.push(E);break;case 65476:for(var w=t(),d=2;d>4==0?this.huffmanTablesDC[15&D]=R(y,m):this.huffmanTablesAC[15&D]=R(y,m)}break;case 65501:t(),this.resetInterval=t();break;case 65498:t();for(var F=A[e++],S=[],L=this.frames[0],b=0;b>4],M.huffmanTableAC=this.huffmanTablesAC[15&N],S.push(M)}var x=A[e++],J=A[e++],q=A[e++],Y=U(A,e,L,S,this.resetInterval,x,J,q>>4,15&q);e+=Y;break;case 65535:255!==A[e]&&e--;break;default:if(255===A[e-3]&&A[e-2]>=192&&A[e-2]<=254){e-=3;break}throw new Error("unknown JPEG marker ".concat(g.toString(16)))}g=t()}}},{key:"getResult",value:function(){var A=this.frames;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(var e=0;e=0;)A[e]=0}x(new Array(576)),x(new Array(60)),x(new Array(512)),x(new Array(256)),x(new Array(29)),x(new Array(30));var J=function(A,e,t,i){for(var r=65535&A|0,I=A>>>16&65535|0,g=0;0!==t;){t-=g=t>2e3?2e3:t;do{I=I+(r=r+e[i++]|0)|0}while(--g);r%=65521,I%=65521}return r|I<<16|0},q=new Uint32Array(function(){for(var A,e=[],t=0;t<256;t++){A=t;for(var i=0;i<8;i++)A=1&A?3988292384^A>>>1:A>>>1;e[t]=A}return e}()),Y=function(A,e,t,i){var r=q,I=i+t;A^=-1;for(var g=i;g>>8^r[255&(A^e[g])];return-1^A},K={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},H={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},O=function(A,e){return Object.prototype.hasOwnProperty.call(A,e)},P=function(A){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var i=e.shift();if(i){if("object"!==t(i))throw new TypeError(i+"must be non-object");for(var r in i)O(i,r)&&(A[r]=i[r])}}return A},T=function(A){for(var e=0,t=0,i=A.length;t=252?6:X>=248?5:X>=240?4:X>=224?3:X>=192?2:1;_[254]=_[254]=1;var Z=function(A){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(A);var e,t,i,r,I,g=A.length,n=0;for(r=0;r>>6,e[I++]=128|63&t):t<65536?(e[I++]=224|t>>>12,e[I++]=128|t>>>6&63,e[I++]=128|63&t):(e[I++]=240|t>>>18,e[I++]=128|t>>>12&63,e[I++]=128|t>>>6&63,e[I++]=128|63&t);return e},j=function(A,e){var t,i,r=e||A.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(A.subarray(0,e));var I=new Array(2*r);for(i=0,t=0;t4)I[i++]=65533,t+=n-1;else{for(g&=2===n?31:3===n?15:7;n>1&&t1?I[i++]=65533:g<65536?I[i++]=g:(g-=65536,I[i++]=55296|g>>10&1023,I[i++]=56320|1023&g)}}}return function(A,e){if(e<65534&&A.subarray&&V)return String.fromCharCode.apply(null,A.length===e?A:A.subarray(0,e));for(var t="",i=0;iA.length&&(e=A.length);for(var t=e-1;t>=0&&128==(192&A[t]);)t--;return t<0||0===t?e:t+_[A[t]]>e?t:e};var z=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},$=function(A,e){var t,i,r,I,g,n,a,o,B,C,Q,E,s,f,c,h,l,u,w,d,D,y,k,p,m=A.state;t=A.next_in,k=A.input,i=t+(A.avail_in-5),r=A.next_out,p=A.output,I=r-(e-A.avail_out),g=r+(A.avail_out-257),n=m.dmax,a=m.wsize,o=m.whave,B=m.wnext,C=m.window,Q=m.hold,E=m.bits,s=m.lencode,f=m.distcode,c=(1<>>=u=l>>>24,E-=u,0===(u=l>>>16&255))p[r++]=65535&l;else{if(!(16&u)){if(0==(64&u)){l=s[(65535&l)+(Q&(1<>>=u,E-=u),E<15&&(Q+=k[t++]<>>=u=l>>>24,E-=u,!(16&(u=l>>>16&255))){if(0==(64&u)){l=f[(65535&l)+(Q&(1<n){A.msg="invalid distance too far back",m.mode=30;break A}if(Q>>>=u,E-=u,d>(u=r-I)){if((u=d-u)>o&&m.sane){A.msg="invalid distance too far back",m.mode=30;break A}if(D=0,y=C,0===B){if(D+=a-u,u2;)p[r++]=y[D++],p[r++]=y[D++],p[r++]=y[D++],w-=3;w&&(p[r++]=y[D++],w>1&&(p[r++]=y[D++]))}else{D=r-d;do{p[r++]=p[D++],p[r++]=p[D++],p[r++]=p[D++],w-=3}while(w>2);w&&(p[r++]=p[D++],w>1&&(p[r++]=p[D++]))}break}}break}}while(t>3,Q&=(1<<(E-=w<<3))-1,A.next_in=t,A.next_out=r,A.avail_in=t=1&&0===v[d];d--);if(D>d&&(D=d),0===d)return r[I++]=20971520,r[I++]=20971520,n.bits=1,0;for(w=1;w0&&(0===A||1!==d))return-1;for(R[1]=0,l=1;l<15;l++)R[l+1]=R[l]+v[l];for(u=0;u852||2===A&&m>592)return 1;for(;;){s=l-k,g[u]E?(f=U[L+g[u]],c=F[S+g[u]]):(f=96,c=0),a=1<>k)+(o-=a)]=s<<24|f<<16|c|0}while(0!==o);for(a=1<>=1;if(0!==a?(G&=a-1,G+=a):G=0,u++,0==--v[l]){if(l===d)break;l=e[t+g[u]]}if(l>D&&(G&C)!==B){for(0===k&&(k=D),Q+=w,p=1<<(y=l-k);y+k852||2===A&&m>592)return 1;r[B=G&C]=D<<24|y<<16|Q-I|0}}return 0!==G&&(r[Q+G]=l-k<<24|64<<16|0),n.bits=D,0},IA=H.Z_FINISH,gA=H.Z_BLOCK,nA=H.Z_TREES,aA=H.Z_OK,oA=H.Z_STREAM_END,BA=H.Z_NEED_DICT,CA=H.Z_STREAM_ERROR,QA=H.Z_DATA_ERROR,EA=H.Z_MEM_ERROR,sA=H.Z_BUF_ERROR,fA=H.Z_DEFLATED,cA=function(A){return(A>>>24&255)+(A>>>8&65280)+((65280&A)<<8)+((255&A)<<24)};function hA(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var lA,uA,wA=function(A){if(!A||!A.state)return CA;var e=A.state;return A.total_in=A.total_out=e.total=0,A.msg="",e.wrap&&(A.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,aA},dA=function(A){if(!A||!A.state)return CA;var e=A.state;return e.wsize=0,e.whave=0,e.wnext=0,wA(A)},DA=function(A,e){var t;if(!A||!A.state)return CA;var i=A.state;return e<0?(t=0,e=-e):(t=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?CA:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=t,i.wbits=e,dA(A))},yA=function(A,e){if(!A)return CA;var t=new hA;A.state=t,t.window=null;var i=DA(A,e);return i!==aA&&(A.state=null),i},kA=!0,pA=function(A){if(kA){lA=new Int32Array(512),uA=new Int32Array(32);for(var e=0;e<144;)A.lens[e++]=8;for(;e<256;)A.lens[e++]=9;for(;e<280;)A.lens[e++]=7;for(;e<288;)A.lens[e++]=8;for(rA(1,A.lens,0,288,lA,0,A.work,{bits:9}),e=0;e<32;)A.lens[e++]=5;rA(2,A.lens,0,32,uA,0,A.work,{bits:5}),kA=!1}A.lencode=lA,A.lenbits=9,A.distcode=uA,A.distbits=5},mA=function(A,e,t,i){var r,I=A.state;return null===I.window&&(I.wsize=1<=I.wsize?(I.window.set(e.subarray(t-I.wsize,t),0),I.wnext=0,I.whave=I.wsize):((r=I.wsize-I.wnext)>i&&(r=i),I.window.set(e.subarray(t-i,t-i+r),I.wnext),(i-=r)?(I.window.set(e.subarray(t-i,t),0),I.wnext=i,I.whave=I.wsize):(I.wnext+=r,I.wnext===I.wsize&&(I.wnext=0),I.whave>>8&255,t.check=Y(t.check,G,2,0),o=0,B=0,t.mode=2;break}if(t.flags=0,t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&o)<<8)+(o>>8))%31){A.msg="incorrect header check",t.mode=30;break}if((15&o)!==fA){A.msg="unknown compression method",t.mode=30;break}if(B-=4,D=8+(15&(o>>>=4)),0===t.wbits)t.wbits=D;else if(D>t.wbits){A.msg="invalid window size",t.mode=30;break}t.dmax=1<>8&1),512&t.flags&&(G[0]=255&o,G[1]=o>>>8&255,t.check=Y(t.check,G,2,0)),o=0,B=0,t.mode=3;case 3:for(;B<32;){if(0===n)break A;n--,o+=i[I++]<>>8&255,G[2]=o>>>16&255,G[3]=o>>>24&255,t.check=Y(t.check,G,4,0)),o=0,B=0,t.mode=4;case 4:for(;B<16;){if(0===n)break A;n--,o+=i[I++]<>8),512&t.flags&&(G[0]=255&o,G[1]=o>>>8&255,t.check=Y(t.check,G,2,0)),o=0,B=0,t.mode=5;case 5:if(1024&t.flags){for(;B<16;){if(0===n)break A;n--,o+=i[I++]<>>8&255,t.check=Y(t.check,G,2,0)),o=0,B=0}else t.head&&(t.head.extra=null);t.mode=6;case 6:if(1024&t.flags&&((E=t.length)>n&&(E=n),E&&(t.head&&(D=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(i.subarray(I,I+E),D)),512&t.flags&&(t.check=Y(t.check,i,E,I)),n-=E,I+=E,t.length-=E),t.length))break A;t.length=0,t.mode=7;case 7:if(2048&t.flags){if(0===n)break A;E=0;do{D=i[I+E++],t.head&&D&&t.length<65536&&(t.head.name+=String.fromCharCode(D))}while(D&&E>9&1,t.head.done=!0),A.adler=t.check=0,t.mode=12;break;case 10:for(;B<32;){if(0===n)break A;n--,o+=i[I++]<>>=7&B,B-=7&B,t.mode=27;break}for(;B<3;){if(0===n)break A;n--,o+=i[I++]<>>=1)){case 0:t.mode=14;break;case 1:if(pA(t),t.mode=20,e===nA){o>>>=2,B-=2;break A}break;case 2:t.mode=17;break;case 3:A.msg="invalid block type",t.mode=30}o>>>=2,B-=2;break;case 14:for(o>>>=7&B,B-=7&B;B<32;){if(0===n)break A;n--,o+=i[I++]<>>16^65535)){A.msg="invalid stored block lengths",t.mode=30;break}if(t.length=65535&o,o=0,B=0,t.mode=15,e===nA)break A;case 15:t.mode=16;case 16:if(E=t.length){if(E>n&&(E=n),E>a&&(E=a),0===E)break A;r.set(i.subarray(I,I+E),g),n-=E,I+=E,a-=E,g+=E,t.length-=E;break}t.mode=12;break;case 17:for(;B<14;){if(0===n)break A;n--,o+=i[I++]<>>=5,B-=5,t.ndist=1+(31&o),o>>>=5,B-=5,t.ncode=4+(15&o),o>>>=4,B-=4,t.nlen>286||t.ndist>30){A.msg="too many length or distance symbols",t.mode=30;break}t.have=0,t.mode=18;case 18:for(;t.have>>=3,B-=3}for(;t.have<19;)t.lens[F[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,k={bits:t.lenbits},y=rA(0,t.lens,0,19,t.lencode,0,t.work,k),t.lenbits=k.bits,y){A.msg="invalid code lengths set",t.mode=30;break}t.have=0,t.mode=19;case 19:for(;t.have>>16&255,l=65535&m,!((c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<>>=c,B-=c,t.lens[t.have++]=l;else{if(16===l){for(p=c+2;B>>=c,B-=c,0===t.have){A.msg="invalid bit length repeat",t.mode=30;break}D=t.lens[t.have-1],E=3+(3&o),o>>>=2,B-=2}else if(17===l){for(p=c+3;B>>=c)),o>>>=3,B-=3}else{for(p=c+7;B>>=c)),o>>>=7,B-=7}if(t.have+E>t.nlen+t.ndist){A.msg="invalid bit length repeat",t.mode=30;break}for(;E--;)t.lens[t.have++]=D}}if(30===t.mode)break;if(0===t.lens[256]){A.msg="invalid code -- missing end-of-block",t.mode=30;break}if(t.lenbits=9,k={bits:t.lenbits},y=rA(1,t.lens,0,t.nlen,t.lencode,0,t.work,k),t.lenbits=k.bits,y){A.msg="invalid literal/lengths set",t.mode=30;break}if(t.distbits=6,t.distcode=t.distdyn,k={bits:t.distbits},y=rA(2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,k),t.distbits=k.bits,y){A.msg="invalid distances set",t.mode=30;break}if(t.mode=20,e===nA)break A;case 20:t.mode=21;case 21:if(n>=6&&a>=258){A.next_out=g,A.avail_out=a,A.next_in=I,A.avail_in=n,t.hold=o,t.bits=B,$(A,Q),g=A.next_out,r=A.output,a=A.avail_out,I=A.next_in,i=A.input,n=A.avail_in,o=t.hold,B=t.bits,12===t.mode&&(t.back=-1);break}for(t.back=0;h=(m=t.lencode[o&(1<>>16&255,l=65535&m,!((c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<>u)])>>>16&255,l=65535&m,!(u+(c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<>>=u,B-=u,t.back+=u}if(o>>>=c,B-=c,t.back+=c,t.length=l,0===h){t.mode=26;break}if(32&h){t.back=-1,t.mode=12;break}if(64&h){A.msg="invalid literal/length code",t.mode=30;break}t.extra=15&h,t.mode=22;case 22:if(t.extra){for(p=t.extra;B>>=t.extra,B-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=23;case 23:for(;h=(m=t.distcode[o&(1<>>16&255,l=65535&m,!((c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<>u)])>>>16&255,l=65535&m,!(u+(c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<>>=u,B-=u,t.back+=u}if(o>>>=c,B-=c,t.back+=c,64&h){A.msg="invalid distance code",t.mode=30;break}t.offset=l,t.extra=15&h,t.mode=24;case 24:if(t.extra){for(p=t.extra;B>>=t.extra,B-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){A.msg="invalid distance too far back",t.mode=30;break}t.mode=25;case 25:if(0===a)break A;if(E=Q-a,t.offset>E){if((E=t.offset-E)>t.whave&&t.sane){A.msg="invalid distance too far back",t.mode=30;break}E>t.wnext?(E-=t.wnext,s=t.wsize-E):s=t.wnext-E,E>t.length&&(E=t.length),f=t.window}else f=r,s=g-t.offset,E=t.length;E>a&&(E=a),a-=E,t.length-=E;do{r[g++]=f[s++]}while(--E);0===t.length&&(t.mode=21);break;case 26:if(0===a)break A;r[g++]=t.length,a--,t.mode=21;break;case 27:if(t.wrap){for(;B<32;){if(0===n)break A;n--,o|=i[I++]<=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||A&&A.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new z,this.strm.avail_out=0;var t=GA.inflateInit2(this.strm,e.windowBits);if(t!==UA)throw new Error(K[t]);if(this.header=new FA,GA.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Z(e.dictionary):"[object ArrayBuffer]"===SA.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=GA.inflateSetDictionary(this.strm,e.dictionary))!==UA))throw new Error(K[t])}function qA(A,e){var t=new JA(e);if(t.push(A),t.err)throw t.msg||K[t.err];return t.result}JA.prototype.push=function(A,e){var t,i,r,I=this.strm,g=this.options.chunkSize,n=this.options.dictionary;if(this.ended)return!1;for(i=e===~~e?e:!0===e?RA:vA,"[object ArrayBuffer]"===SA.call(A)?I.input=new Uint8Array(A):I.input=A,I.next_in=0,I.avail_in=I.input.length;;){for(0===I.avail_out&&(I.output=new Uint8Array(g),I.next_out=0,I.avail_out=g),(t=GA.inflate(I,i))===bA&&n&&((t=GA.inflateSetDictionary(I,n))===UA?t=GA.inflate(I,i):t===NA&&(t=bA));I.avail_in>0&&t===LA&&I.state.wrap>0&&0!==A[I.next_in];)GA.inflateReset(I),t=GA.inflate(I,i);switch(t){case MA:case NA:case bA:case xA:return this.onEnd(t),this.ended=!0,!1}if(r=I.avail_out,I.next_out&&(0===I.avail_out||t===LA))if("string"===this.options.to){var a=W(I.output,I.next_out),o=I.next_out-a,B=j(I.output,a);I.next_out=o,I.avail_out=g-o,o&&I.output.set(I.output.subarray(a,a+o),0),this.onData(B)}else this.onData(I.output.length===I.next_out?I.output:I.output.subarray(0,I.next_out));if(t!==UA||0!==r){if(t===LA)return t=GA.inflateEnd(this.strm),this.onEnd(t),this.ended=!0,!0;if(0===I.avail_in)break}}return!0},JA.prototype.onData=function(A){this.chunks.push(A)},JA.prototype.onEnd=function(A){A===UA&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=T(this.chunks)),this.chunks=[],this.err=A,this.msg=this.strm.msg};var YA={Inflate:JA,inflate:qA,inflateRaw:function(A,e){return(e=e||{}).raw=!0,qA(A,e)},ungzip:qA,constants:H}.inflate;function KA(A){var e=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(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var HA=function(A){s(t,w);var e=KA(t);function t(){return B(this,t),e.apply(this,arguments)}return Q(t,[{key:"decodeBlock",value:function(A){return YA(new Uint8Array(A)).buffer}}]),t}(),OA=Object.freeze({__proto__:null,default:HA});function PA(A){var e=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(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var TA,VA=function(A){s(t,w);var e=PA(t);function t(){return B(this,t),e.apply(this,arguments)}return Q(t,[{key:"decodeBlock",value:function(A){for(var e=new DataView(A),t=[],i=0;i>3],m<<=7&G),c=0;c>3]),128&m?(a&&(a[G]=1),f=f>(g=S.encoding<2?y[k++]:p)?g:f,n[G++]=g):(a&&(a[G]=0),n[G++]=i),m<<=1;G+=F}else if(S.encoding<2)for(h=0;h(g=y[k++])?g:f,n[G++]=g;G+=F}else for(f=f>p?p:f,h=0;h0){var g=new Uint8Array(Math.ceil(i.width*i.height/8)),n=(I=new DataView(A,e,i.mask.numBytes)).getInt16(0,!0),a=2,o=0;do{if(n>0)for(;n--;)g[o++]=I.getUint8(a++);else{var B=I.getUint8(a++);for(n=-n;n--;)g[o++]=B}n=I.getInt16(a,!0),a+=2}while(a0?1:0),s=Q+(i.height%Q>0?1:0);i.pixels.blocks=new Array(E*s);for(var f=0,c=0;c3)throw"Invalid block encoding ("+w.encoding+")";if(2!==w.encoding){if(0!==d&&2!==d){if(d>>=6,w.offsetType=d,2===d)w.offset=I.getInt8(1),l++;else if(1===d)w.offset=I.getInt16(1,!0),l+=2;else{if(0!==d)throw"Invalid block offset type";w.offset=I.getFloat32(1,!0),l+=4}if(1===w.encoding)if(d=I.getUint8(l),l++,w.bitsPerPixel=63&d,d>>=6,w.numValidPixelsType=d,2===d)w.numValidPixels=I.getUint8(l),l++;else if(1===d)w.numValidPixels=I.getUint16(l,!0),l+=2;else{if(0!==d)throw"Invalid valid pixel count type";w.numValidPixels=I.getUint32(l,!0),l+=4}}var D;if(e+=l,3!==w.encoding)if(0===w.encoding){var y=(i.pixels.numBytes-1)/4;if(y!==Math.floor(y))throw"uncompressed block has invalid length";D=new ArrayBuffer(4*y),new Uint8Array(D).set(new Uint8Array(A,e,4*y));var k=new Float32Array(D);w.rawData=k,e+=4*y}else if(1===w.encoding){var p=Math.ceil(w.numValidPixels*w.bitsPerPixel/8),m=Math.ceil(p/4);D=new ArrayBuffer(4*m),new Uint8Array(D).set(new Uint8Array(A,e,p)),w.stuffedData=new Uint32Array(D),e+=p}}else e++}return i.eofOffset=e,i},I=function(A,e,t,i,r,I,g){var n,a,o,B=(1<=e)a=o>>>Q-e&B,Q-=e;else{var f=e-Q;a=(o&B)<>>(Q=32-f)}I[n]=a=t?(o=B>>>f-t&E,f-=t):(o=(B&E)<<(C=t-f)&E,o+=(B=A[s++])>>>(f=32-C)),e[a]=r[o];else for(Q=Math.ceil((n-I)/g),a=0;a=t?(o=B>>>f-t&E,f-=t):(o=(B&E)<<(C=t-f)&E,o+=(B=A[s++])>>>(f=32-C)),e[a]=o=e?(Q=g>>>C-e&n,C-=e):(Q=(g&n)<<(B=e-C)&n,Q+=(g=A[a++])>>>(C=32-B)),E[o]=Q=t?(o=B>>>f&Q,s-=t,f+=t):(o=B>>>f&Q,s=32-(C=t-s),o|=((B=A[E++])&(1<=t?(o=B>>>f&Q,s-=t,f+=t):(o=B>>>f&Q,s=32-(C=t-s),o|=((B=A[E++])&(1<=e?(Q=g>>>E&n,C-=e,E+=e):(Q=g>>>E&n,C=32-(B=e-C),Q|=((g=A[a++])&(1<=t?(I=g>>>B-t&a,B-=t):(I=(g&a)<<(n=t-B)&a,I+=(g=A[o++])>>>(B=32-n)),e[r]=I;return e},C=function(A,e,t,i){var r,I,g,n,a=(1<=t?(I=g>>>C&a,B-=t,C+=t):(I=g>>>C&a,B=32-(n=t-B),I|=((g=A[o++])&(1<=359?359:r;r-=g;do{e+=A[I++]<<8,t+=e+=A[I++]}while(--g);e=(65535&e)+(e>>>16),t=(65535&t)+(t>>>16)}return 1&i&&(t+=e+=A[I]<<8),((t=(65535&t)+(t>>>16))<<16|(e=(65535&e)+(e>>>16)))>>>0},readHeaderInfo:function(A,e){var t=e.ptr,i=new Uint8Array(A,t,6),r={};if(r.fileIdentifierString=String.fromCharCode.apply(null,i),0!==r.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+r.fileIdentifierString;t+=6;var I,g=new DataView(A,t,8),n=g.getInt32(0,!0);if(r.fileVersion=n,t+=4,n>=3&&(r.checksum=g.getUint32(4,!0),t+=4),g=new DataView(A,t,12),r.height=g.getUint32(0,!0),r.width=g.getUint32(4,!0),t+=8,n>=4?(r.numDims=g.getUint32(8,!0),t+=4):r.numDims=1,g=new DataView(A,t,40),r.numValidPixel=g.getUint32(0,!0),r.microBlockSize=g.getInt32(4,!0),r.blobSize=g.getInt32(8,!0),r.imageType=g.getInt32(12,!0),r.maxZError=g.getFloat64(16,!0),r.zMin=g.getFloat64(24,!0),r.zMax=g.getFloat64(32,!0),t+=40,e.headerInfo=r,e.ptr=t,n>=3&&(I=n>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(A,t-I,r.blobSize-14))!==r.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(A,e){var t=e.headerInfo,i=this.getDataTypeArray(t.imageType),r=t.numDims*this.getDataTypeSize(t.imageType),I=this.readSubArray(A,e.ptr,i,r),g=this.readSubArray(A,e.ptr+r,i,r);e.ptr+=2*r;var n,a=!0;for(n=0;n0){t=new Uint8Array(Math.ceil(g/8));var B=(a=new DataView(A,r,o.numBytes)).getInt16(0,!0),C=2,Q=0,E=0;do{if(B>0)for(;B--;)t[Q++]=a.getUint8(C++);else for(E=a.getUint8(C++),B=-B;B--;)t[Q++]=E;B=a.getInt16(C,!0),C+=2}while(C>3],s<<=7&f):s=t[f>>3],128&s&&(i[f]=1);e.pixels.resultMask=i,o.bitset=t,r+=o.numBytes}return e.ptr=r,e.mask=o,!0},readDataOneSweep:function(A,e,t,i){var r,I=e.ptr,g=e.headerInfo,n=g.numDims,a=g.width*g.height,o=g.imageType,B=g.numValidPixel*Q.getDataTypeSize(o)*n,C=e.pixels.resultMask;if(t===Uint8Array)r=new Uint8Array(A,I,B);else{var E=new ArrayBuffer(B);new Uint8Array(E).set(new Uint8Array(A,I,B)),r=new t(E)}if(r.length===a*n)e.pixels.resultPixels=i?Q.swapDimensionOrder(r,a,n,t,!0):r;else{e.pixels.resultPixels=new t(a*n);var s=0,f=0,c=0,h=0;if(n>1){if(i){for(f=0;f=g)return!1;var n=new Uint32Array(g-I);Q.decodeBits(A,e,n);var a,o,B,C,s=[];for(a=I;a0&&(s[o].second=l<>>32-C,32-w>=C?32===(w+=C)&&(w=0,l=u[++d]):(w+=C-32,l=u[++d],s[o].second|=l>>>32-w));var D=0,y=0,k=new E;for(a=0;a=t?t:D;var p,m,G,F,S,v=[];for(a=I;a0)if(p=[C,o],C<=y)for(m=s[o].second<=0;F--)m>>>F&1?(S.right||(S.right=new E),S=S.right):(S.left||(S.left=new E),S=S.left),0!==F||S.val||(S.val=p[1]);return{decodeLut:v,numBitsLUTQick:y,numBitsLUT:D,tree:k,stuffedData:u,srcPtr:d,bitPos:w}},readHuffman:function(A,e,t,i){var r,I,g,n,a,o,B,C,E,s=e.headerInfo.numDims,f=e.headerInfo.height,c=e.headerInfo.width,h=c*f,l=this.readHuffmanTree(A,e),u=l.decodeLut,w=l.tree,d=l.stuffedData,D=l.srcPtr,y=l.bitPos,k=l.numBitsLUTQick,p=l.numBitsLUT,m=0===e.headerInfo.imageType?128:0,G=e.pixels.resultMask,F=0;y>0&&(D++,y=0);var S,v=d[D],R=1===e.encodeMode,U=new t(h*s),L=U;if(s<2||R){for(S=0;S1&&(L=new t(U.buffer,h*S,h),F=0),e.headerInfo.numValidPixel===c*f)for(C=0,o=0;o>>32-k,32-y>>64-y-k),u[a])I=u[a][1],y+=u[a][0];else for(a=n=v<>>32-p,32-y>>64-y-p),r=w,E=0;E>>p-E-1&1?r.right:r.left).left&&!r.right){I=r.val,y=y+E+1;break}y>=32&&(y-=32,v=d[++D]),g=I-m,R?(g+=B>0?F:o>0?L[C-c]:F,g&=255,L[C]=g,F=g):L[C]=g}else for(C=0,o=0;o>>32-k,32-y>>64-y-k),u[a])I=u[a][1],y+=u[a][0];else for(a=n=v<>>32-p,32-y>>64-y-p),r=w,E=0;E>>p-E-1&1?r.right:r.left).left&&!r.right){I=r.val,y=y+E+1;break}y>=32&&(y-=32,v=d[++D]),g=I-m,R?(B>0&&G[C-1]?g+=F:o>0&&G[C-c]?g+=L[C-c]:g+=F,g&=255,L[C]=g,F=g):L[C]=g}}else for(C=0,o=0;o>>32-k,32-y>>64-y-k),u[a])I=u[a][1],y+=u[a][0];else for(a=n=v<>>32-p,32-y>>64-y-p),r=w,E=0;E>>p-E-1&1?r.right:r.left).left&&!r.right){I=r.val,y=y+E+1;break}y>=32&&(y-=32,v=d[++D]),g=I-m,L[C]=g}e.ptr=e.ptr+4*(D+1)+(y>0?4:0),e.pixels.resultPixels=U,s>1&&!i&&(e.pixels.resultPixels=Q.swapDimensionOrder(U,h,s,t))},decodeBits:function(A,e,t,i,r){var I=e.headerInfo,Q=I.fileVersion,E=0,s=A.byteLength-e.ptr>=5?5:A.byteLength-e.ptr,f=new DataView(A,e.ptr,s),c=f.getUint8(0);E++;var h=c>>6,l=0===h?4:3-h,u=(32&c)>0,w=31&c,d=0;if(1===l)d=f.getUint8(E),E++;else if(2===l)d=f.getUint16(E,!0),E+=2;else{if(4!==l)throw"Invalid valid pixel count type";d=f.getUint32(E,!0),E+=4}var D,y,k,p,m,G,F,S,v,R=2*I.maxZError,U=I.numDims>1?I.maxValues[r]:I.zMax;if(u){for(e.counter.lut++,S=f.getUint8(E),E++,p=Math.ceil((S-1)*w/8),m=Math.ceil(p/4),y=new ArrayBuffer(4*m),k=new Uint8Array(y),e.ptr+=E,k.set(new Uint8Array(A,e.ptr,p)),F=new Uint32Array(y),e.ptr+=p,v=0;S-1>>>v;)v++;p=Math.ceil(d*v/8),m=Math.ceil(p/4),y=new ArrayBuffer(4*m),(k=new Uint8Array(y)).set(new Uint8Array(A,e.ptr,p)),D=new Uint32Array(y),e.ptr+=p,G=Q>=3?o(F,w,S-1,i,R,U):n(F,w,S-1,i,R,U),Q>=3?a(D,t,v,d,G):g(D,t,v,d,G)}else e.counter.bitstuffer++,v=w,e.ptr+=E,v>0&&(p=Math.ceil(d*v/8),m=Math.ceil(p/4),y=new ArrayBuffer(4*m),(k=new Uint8Array(y)).set(new Uint8Array(A,e.ptr,p)),D=new Uint32Array(y),e.ptr+=p,Q>=3?null==i?C(D,t,v,d):a(D,t,v,d,!1,i,R,U):null==i?B(D,t,v,d):g(D,t,v,d,!1,i,R,U))},readTiles:function(A,e,t,i){var r=e.headerInfo,I=r.width,g=r.height,n=I*g,a=r.microBlockSize,o=r.imageType,B=Q.getDataTypeSize(o),C=Math.ceil(I/a),E=Math.ceil(g/a);e.pixels.numBlocksY=E,e.pixels.numBlocksX=C,e.pixels.ptr=0;var s,f,c,h,l,u,w,d,D,y,k=0,p=0,m=0,G=0,F=0,S=0,v=0,R=0,U=0,L=0,b=0,M=0,N=0,x=0,J=0,q=new t(a*a),Y=g%a||a,K=I%a||a,H=r.numDims,O=e.pixels.resultMask,P=e.pixels.resultPixels,T=r.fileVersion>=5?14:15,V=r.zMax;for(m=0;m1?(y=P,L=m*I*a+G*a,P=new t(e.pixels.resultPixels.buffer,n*d*B,n),V=r.maxValues[d]):y=null,v=A.byteLength-e.ptr,f={},J=0,R=(s=new DataView(A,e.ptr,Math.min(10,v))).getUint8(0),J++,D=r.fileVersion>=5?4&R:0,U=R>>6&255,(R>>2&T)!=(G*a>>3&T))throw"integrity issue";if(D&&0===d)throw"integrity issue";if((l=3&R)>3)throw e.ptr+=J,"Invalid block encoding ("+l+")";if(2!==l)if(0===l){if(D)throw"integrity issue";if(e.counter.uncompressed++,e.ptr+=J,M=(M=F*S*B)<(N=A.byteLength-e.ptr)?M:N,c=new ArrayBuffer(M%B==0?M:M+B-M%B),new Uint8Array(c).set(new Uint8Array(A,e.ptr,M)),h=new t(c),x=0,O)for(k=0;k1&&!i&&(e.pixels.resultPixels=Q.swapDimensionOrder(e.pixels.resultPixels,n,H,t))},formatFileInfo:function(A){return{fileIdentifierString:A.headerInfo.fileIdentifierString,fileVersion:A.headerInfo.fileVersion,imageType:A.headerInfo.imageType,height:A.headerInfo.height,width:A.headerInfo.width,numValidPixel:A.headerInfo.numValidPixel,microBlockSize:A.headerInfo.microBlockSize,blobSize:A.headerInfo.blobSize,maxZError:A.headerInfo.maxZError,pixelType:Q.getPixelType(A.headerInfo.imageType),eofOffset:A.eofOffset,mask:A.mask?{numBytes:A.mask.numBytes}:null,pixels:{numBlocksX:A.pixels.numBlocksX,numBlocksY:A.pixels.numBlocksY,maxValue:A.headerInfo.zMax,minValue:A.headerInfo.zMin,noDataValue:A.noDataValue}}},constructConstantSurface:function(A,e){var t=A.headerInfo.zMax,i=A.headerInfo.zMin,r=A.headerInfo.maxValues,I=A.headerInfo.numDims,g=A.headerInfo.height*A.headerInfo.width,n=0,a=0,o=0,B=A.pixels.resultMask,C=A.pixels.resultPixels;if(B)if(I>1){if(e)for(n=0;n1&&i!==t)if(e)for(n=0;n=-128&&e<=127;break;case 1:t=e>=0&&e<=255;break;case 2:t=e>=-32768&&e<=32767;break;case 3:t=e>=0&&e<=65536;break;case 4:t=e>=-2147483648&&e<=2147483647;break;case 5:t=e>=0&&e<=4294967296;break;case 6:t=e>=-34027999387901484e22&&e<=34027999387901484e22;break;case 7:t=e>=-17976931348623157e292&&e<=17976931348623157e292;break;default:t=!1}return t},getDataTypeSize:function(A){var e=0;switch(A){case 0:case 1:e=1;break;case 2:case 3:e=2;break;case 4:case 5:case 6:e=4;break;case 7:e=8;break;default:e=A}return e},getDataTypeUsed:function(A,e){var t=A;switch(A){case 2:case 4:t=A-e;break;case 3:case 5:t=A-2*e;break;case 6:t=0===e?A:1===e?2:1;break;case 7:t=0===e?A:A-2*e+1;break;default:t=A}return t},getOnePixel:function(A,e,t,i){var r=0;switch(t){case 0:r=i.getInt8(e);break;case 1:r=i.getUint8(e);break;case 2:r=i.getInt16(e,!0);break;case 3:r=i.getUint16(e,!0);break;case 4:r=i.getInt32(e,!0);break;case 5:r=i.getUInt32(e,!0);break;case 6:r=i.getFloat32(e,!0);break;case 7:r=i.getFloat64(e,!0);break;default:throw"the decoder does not understand this pixel type"}return r},swapDimensionOrder:function(A,e,t,i,r){var I=0,g=0,n=0,a=0,o=A;if(t>1)if(o=new i(e*t),r)for(I=0;I5)throw"unsupported lerc version 2."+g;Q.readMask(A,r),I.numValidPixel===I.width*I.height||r.pixels.resultMask||(r.pixels.resultMask=e.maskData);var a=I.width*I.height;r.pixels.resultPixels=new n(a*I.numDims),r.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var o,B=!e.returnPixelInterleavedDims;if(0!==I.numValidPixel)if(I.zMax===I.zMin)Q.constructConstantSurface(r,B);else if(g>=4&&Q.checkMinMaxRanges(A,r))Q.constructConstantSurface(r,B);else{var C=new DataView(A,r.ptr,2),E=C.getUint8(0);if(r.ptr++,E)Q.readDataOneSweep(A,r,n,B);else if(g>1&&I.imageType<=1&&Math.abs(I.maxZError-.5)<1e-5){var s=C.getUint8(1);if(r.ptr++,r.encodeMode=s,s>2||g<4&&s>1)throw"Invalid Huffman flag "+s;s?Q.readHuffman(A,r,n,B):Q.readTiles(A,r,n,B)}else Q.readTiles(A,r,n,B)}r.eofOffset=r.ptr,e.inputOffset?(o=r.headerInfo.blobSize+e.inputOffset-r.ptr,Math.abs(o)>=1&&(r.eofOffset=e.inputOffset+r.headerInfo.blobSize)):(o=r.headerInfo.blobSize-r.ptr,Math.abs(o)>=1&&(r.eofOffset=r.headerInfo.blobSize));var f={width:I.width,height:I.height,pixelData:r.pixels.resultPixels,minValue:I.zMin,maxValue:I.zMax,validPixelCount:I.numValidPixel,dimCount:I.numDims,dimStats:{minValues:I.minValues,maxValues:I.maxValues},maskData:r.pixels.resultMask};if(r.pixels.resultMask&&Q.isValidPixelValue(I.imageType,t)){var c=r.pixels.resultMask;for(i=0;i1&&(o&&f.push(o),d.fileInfo.mask&&d.fileInfo.mask.numBytes>0&&w++),E++,u.pixels.push(d.pixelData),u.statistics.push({minValue:d.minValue,maxValue:d.maxValue,noDataValue:d.noDataValue,dimStats:d.dimStats})}if(i>1&&w>1){for(Q=u.width*u.height,u.bandMasks=f,(o=new Uint8Array(Q)).set(f[0]),B=1;B1&&void 0!==arguments[1]?arguments[1]:0;if(!jA)throw new Error("ZSTDDecoder: Await .init() before decoding.");var t=A.byteLength,i=jA.exports.malloc(t);WA.set(A,i),e=e||Number(jA.exports.ZSTD_findDecompressedSize(i,t));var r=jA.exports.malloc(e),I=jA.exports.ZSTD_decompress(r,e,i,t),g=WA.slice(r,r+I);return jA.exports.free(i),jA.exports.free(r),g}}]),A}(),ee="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IAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQh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ASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigC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C0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdB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IAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY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wOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEE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",te={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},ie={};for(var re in te)te.hasOwnProperty(re)&&(ie[te[re]]=parseInt(re,10));ie.BitsPerSample,ie.ExtraSamples,ie.SampleFormat,ie.StripByteCounts,ie.StripOffsets,ie.StripRowCounts,ie.TileByteCounts,ie.TileOffsets,ie.SubIFDs;var Ie={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},ge={};for(var ne in Ie)Ie.hasOwnProperty(ne)&&(ge[Ie[ne]]=parseInt(ne,10));var ae=1,oe=0,Be=1,Ce=2,Qe={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"},Ee={};for(var se in Qe)Qe.hasOwnProperty(se)&&(Ee[Qe[se]]=parseInt(se,10));function fe(A){var e=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(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var ce=new Ae,he=function(A){s(t,w);var e=fe(t);function t(A){var i;return B(this,t),(i=e.call(this)).planarConfiguration=void 0!==A.PlanarConfiguration?A.PlanarConfiguration:1,i.samplesPerPixel=void 0!==A.SamplesPerPixel?A.SamplesPerPixel:1,i.addCompression=A.LercParameters[ae],i}return Q(t,[{key:"decodeBlock",value:function(A){switch(this.addCompression){case oe:break;case Be:A=YA(new Uint8Array(A)).buffer;break;case Ce:A=ce.decode(new Uint8Array(A)).buffer;break;default:throw new Error("Unsupported LERC additional compression method identifier: ".concat(this.addCompression))}return zA.decode(A,{returnPixelInterleavedDims:1===this.planarConfiguration}).pixels[0].buffer}}]),t}(),le=Object.freeze({__proto__:null,zstd:ce,default:he});function ue(A){var e=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(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var we=function(A){s(I,w);var t,i=ue(I);function I(){var A;if(B(this,I),A=i.call(this),"undefined"==typeof createImageBitmap)throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if("undefined"==typeof document&&"undefined"==typeof OffscreenCanvas)throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available");return A}return Q(I,[{key:"decode",value:(t=e(r.mark((function A(e,t){var i,I,g,n;return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return i=new Blob([t]),A.next=3,createImageBitmap(i);case 3:return I=A.sent,"undefined"!=typeof document?((g=document.createElement("canvas")).width=I.width,g.height=I.height):g=new OffscreenCanvas(I.width,I.height),(n=g.getContext("2d")).drawImage(I,0,0),A.abrupt("return",n.getImageData(0,0,I.width,I.height).data.buffer);case 8:case"end":return A.stop()}}),A)}))),function(A,e){return t.apply(this,arguments)})}]),I}(),de=Object.freeze({__proto__:null,default:we});';return new e(typeof Buffer<"u"?"data:application/javascript;base64,"+Buffer.from(A,"binary").toString("base64"):URL.createObjectURL(new Blob([A],{type:"application/javascript"})))}export{t as create}; diff --git a/public/vite-dev/assets/decoder-b0JuKe3x-CaSv2t6h.js.br b/public/vite-dev/assets/decoder-b0JuKe3x-CaSv2t6h.js.br new file mode 100644 index 0000000..6ea5e92 Binary files /dev/null and b/public/vite-dev/assets/decoder-b0JuKe3x-CaSv2t6h.js.br differ diff --git a/public/vite-dev/assets/decoder-b0JuKe3x-CaSv2t6h.js.gz b/public/vite-dev/assets/decoder-b0JuKe3x-CaSv2t6h.js.gz new file mode 100644 index 0000000..e887818 Binary files /dev/null and b/public/vite-dev/assets/decoder-b0JuKe3x-CaSv2t6h.js.gz differ diff --git a/public/vite-dev/assets/deflate-vcCR2g03-uJvqLAd5.js b/public/vite-dev/assets/deflate-vcCR2g03-uJvqLAd5.js new file mode 100644 index 0000000..2199483 --- /dev/null +++ b/public/vite-dev/assets/deflate-vcCR2g03-uJvqLAd5.js @@ -0,0 +1 @@ +import{b as e}from"./pako.esm-BSHzuB9t-DQSVoCko.js";import{g as o}from"./basedecoder-PFIibI7U-gdlnpIMU.js";class f extends o{decodeBlock(r){return e(new Uint8Array(r)).buffer}}export{f as default}; diff --git a/public/vite-dev/assets/deflate-vcCR2g03-uJvqLAd5.js.br b/public/vite-dev/assets/deflate-vcCR2g03-uJvqLAd5.js.br new file mode 100644 index 0000000..e4a2a52 Binary files /dev/null and b/public/vite-dev/assets/deflate-vcCR2g03-uJvqLAd5.js.br differ diff --git a/public/vite-dev/assets/deflate-vcCR2g03-uJvqLAd5.js.gz b/public/vite-dev/assets/deflate-vcCR2g03-uJvqLAd5.js.gz new file mode 100644 index 0000000..605b15e Binary files /dev/null and b/public/vite-dev/assets/deflate-vcCR2g03-uJvqLAd5.js.gz differ diff --git a/public/vite-dev/assets/index-pmp42xxj-DHbdtNrf.js b/public/vite-dev/assets/index-pmp42xxj-DHbdtNrf.js new file mode 100644 index 0000000..973f56a --- /dev/null +++ b/public/vite-dev/assets/index-pmp42xxj-DHbdtNrf.js @@ -0,0 +1,314 @@ +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/raw-_eObXrMO-z93--tm9.js","assets/basedecoder-PFIibI7U-gdlnpIMU.js","assets/lzw-5BnjP5Zu-Rtm9pMoi.js","assets/jpeg-cL5qbLGO-DsQ9NELO.js","assets/deflate-vcCR2g03-uJvqLAd5.js","assets/pako.esm-BSHzuB9t-DQSVoCko.js","assets/packbits-QLsyzNt2-BPOn6aoD.js","assets/lerc-uk49vBKp-C2xrmYNa.js","assets/webimage-Hf-HYtMO-Cer-ofJO.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} +const scriptRel="modulepreload",assetsURL=function(ie){return"/vite-dev/"+ie},seen={},__vitePreload=function(Z,ee,ae){let ye=Promise.resolve();if(ee&&ee.length>0){const ve=document.getElementsByTagName("link"),be=document.querySelector("meta[property=csp-nonce]"),Ye=(be==null?void 0:be.nonce)||(be==null?void 0:be.getAttribute("nonce"));ye=Promise.all(ee.map(Ke=>{if(Ke=assetsURL(Ke),Ke in seen)return;seen[Ke]=!0;const Xe=Ke.endsWith(".css"),Je=Xe?'[rel="stylesheet"]':"";if(!!ae)for(let it=ve.length-1;it>=0;it--){const lt=ve[it];if(lt.href===Ke&&(!Xe||lt.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${Ke}"]${Je}`))return;const nt=document.createElement("link");if(nt.rel=Xe?"stylesheet":scriptRel,Xe||(nt.as="script",nt.crossOrigin=""),nt.href=Ke,Ye&&nt.setAttribute("nonce",Ye),document.head.appendChild(nt),Xe)return new Promise((it,lt)=>{nt.addEventListener("load",it),nt.addEventListener("error",()=>lt(new Error(`Unable to preload CSS for ${Ke}`)))})}))}return ye.then(()=>Z()).catch(ve=>{const be=new Event("vite:preloadError",{cancelable:!0});if(be.payload=ve,window.dispatchEvent(be),!be.defaultPrevented)throw ve})};var define_process_env_default={},oP=Object.defineProperty,aP=(ie,Z,ee)=>Z in ie?oP(ie,Z,{enumerable:!0,configurable:!0,writable:!0,value:ee}):ie[Z]=ee,Sc=(ie,Z,ee)=>(aP(ie,typeof Z!="symbol"?Z+"":Z,ee),ee);function _mergeNamespaces(ie,Z){for(var ee=0;eeae[ye]})}}}return Object.freeze(Object.defineProperty(ie,Symbol.toStringTag,{value:"Module"}))}class BaseEvent{constructor(Z){this.propagationStopped,this.defaultPrevented,this.type=Z,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}const ObjectEventType={PROPERTYCHANGE:"propertychange"};class Disposable{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function binarySearch(ie,Z,ee){let ae,ye;ee=ee||ascending;let ve=0,be=ie.length,Ye=!1;for(;ve>1),ye=+ee(ie[ae],Z),ye<0?ve=ae+1:(be=ae,Ye=!ye);return Ye?ve:~ve}function ascending(ie,Z){return ie>Z?1:ieZ?-1:0}function linearFindNearest(ie,Z,ee){if(ie[0]<=Z)return 0;const ae=ie.length;if(Z<=ie[ae-1])return ae-1;if(typeof ee=="function"){for(let ye=1;ye0?ye-1:ye}return ae-1}if(ee>0){for(let ye=1;ye0||ee&&be===0)})}function TRUE(){return!0}function FALSE(){return!1}function VOID(){}function memoizeOne(ie){let Z=!1,ee,ae,ye;return function(){const ve=Array.prototype.slice.call(arguments);return(!Z||this!==ye||!equals$2(ve,ae))&&(Z=!0,ye=this,ae=ve,ee=ie.apply(this,arguments)),ee}}function toPromise(ie){function Z(){let ee;try{ee=ie()}catch(ae){return Promise.reject(ae)}return ee instanceof Promise?ee:Promise.resolve(ee)}return Z()}function clear(ie){for(const Z in ie)delete ie[Z]}function isEmpty$1(ie){let Z;for(Z in ie)return!1;return!Z}class Target extends Disposable{constructor(Z){super(),this.eventTarget_=Z,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(Z,ee){if(!Z||!ee)return;const ae=this.listeners_||(this.listeners_={}),ye=ae[Z]||(ae[Z]=[]);ye.includes(ee)||ye.push(ee)}dispatchEvent(Z){const ee=typeof Z=="string",ae=ee?Z:Z.type,ye=this.listeners_&&this.listeners_[ae];if(!ye)return;const ve=ee?new BaseEvent(Z):Z;ve.target||(ve.target=this.eventTarget_||this);const be=this.dispatching_||(this.dispatching_={}),Ye=this.pendingRemovals_||(this.pendingRemovals_={});ae in be||(be[ae]=0,Ye[ae]=0),++be[ae];let Ke;for(let Xe=0,Je=ye.length;Xe0:!1}removeEventListener(Z,ee){const ae=this.listeners_&&this.listeners_[Z];if(ae){const ye=ae.indexOf(ee);ye!==-1&&(this.pendingRemovals_&&Z in this.pendingRemovals_?(ae[ye]=VOID,++this.pendingRemovals_[Z]):(ae.splice(ye,1),ae.length===0&&delete this.listeners_[Z]))}}}const EventType={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function listen(ie,Z,ee,ae,ye){if(ae&&ae!==ie&&(ee=ee.bind(ae)),ye){const be=ee;ee=function(){ie.removeEventListener(Z,ee),be.apply(this,arguments)}}const ve={target:ie,type:Z,listener:ee};return ie.addEventListener(Z,ee),ve}function listenOnce(ie,Z,ee,ae){return listen(ie,Z,ee,ae,!0)}function unlistenByKey(ie){ie&&ie.target&&(ie.target.removeEventListener(ie.type,ie.listener),clear(ie))}class Observable extends Target{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(EventType.CHANGE)}getRevision(){return this.revision_}onInternal(Z,ee){if(Array.isArray(Z)){const ae=Z.length,ye=new Array(ae);for(let ve=0;ve0;)this.pop()}extend(Z){for(let ee=0,ae=Z.length;eethis.getLength())throw new Error("Index out of bounds: "+Z);this.unique_&&this.assertUnique_(ee),this.array_.splice(Z,0,ee),this.updateLength_(),this.dispatchEvent(new CollectionEvent(CollectionEventType.ADD,ee,Z))}pop(){return this.removeAt(this.getLength()-1)}push(Z){this.unique_&&this.assertUnique_(Z);const ee=this.getLength();return this.insertAt(ee,Z),this.getLength()}remove(Z){const ee=this.array_;for(let ae=0,ye=ee.length;ae=this.getLength())return;const ee=this.array_[Z];return this.array_.splice(Z,1),this.updateLength_(),this.dispatchEvent(new CollectionEvent(CollectionEventType.REMOVE,ee,Z)),ee}setAt(Z,ee){const ae=this.getLength();if(Z>=ae){this.insertAt(Z,ee);return}if(Z<0)throw new Error("Index out of bounds: "+Z);this.unique_&&this.assertUnique_(ee,Z);const ye=this.array_[Z];this.array_[Z]=ee,this.dispatchEvent(new CollectionEvent(CollectionEventType.REMOVE,ye,Z)),this.dispatchEvent(new CollectionEvent(CollectionEventType.ADD,ee,Z))}updateLength_(){this.set(Property$2.LENGTH,this.array_.length)}assertUnique_(Z,ee){for(let ae=0,ye=this.array_.length;aeye&&(Ke=Ke|Relationship.RIGHT),Yeve&&(Ke=Ke|Relationship.ABOVE),Ke===Relationship.UNKNOWN&&(Ke=Relationship.INTERSECTING),Ke}function createEmpty(){return[1/0,1/0,-1/0,-1/0]}function createOrUpdate$2(ie,Z,ee,ae,ye){return ye?(ye[0]=ie,ye[1]=Z,ye[2]=ee,ye[3]=ae,ye):[ie,Z,ee,ae]}function createOrUpdateEmpty(ie){return createOrUpdate$2(1/0,1/0,-1/0,-1/0,ie)}function createOrUpdateFromCoordinate(ie,Z){const ee=ie[0],ae=ie[1];return createOrUpdate$2(ee,ae,ee,ae,Z)}function createOrUpdateFromFlatCoordinates(ie,Z,ee,ae,ye){const ve=createOrUpdateEmpty(ye);return extendFlatCoordinates(ve,ie,Z,ee,ae)}function equals$1(ie,Z){return ie[0]==Z[0]&&ie[2]==Z[2]&&ie[1]==Z[1]&&ie[3]==Z[3]}function extend$1(ie,Z){return Z[0]ie[2]&&(ie[2]=Z[2]),Z[1]ie[3]&&(ie[3]=Z[3]),ie}function extendCoordinate(ie,Z){Z[0]ie[2]&&(ie[2]=Z[0]),Z[1]ie[3]&&(ie[3]=Z[1])}function extendFlatCoordinates(ie,Z,ee,ae,ye){for(;eeZ[0]?ae[0]=ie[0]:ae[0]=Z[0],ie[1]>Z[1]?ae[1]=ie[1]:ae[1]=Z[1],ie[2]=Z[0]&&ie[1]<=Z[3]&&ie[3]>=Z[1]}function isEmpty(ie){return ie[2]=be&&ct<=Ke),!ae&&ve&Relationship.RIGHT&&!(ye&Relationship.RIGHT)&&(ot=it-(nt-Ke)*lt,ae=ot>=Ye&&ot<=Xe),!ae&&ve&Relationship.BELOW&&!(ye&Relationship.BELOW)&&(ct=nt-(it-Ye)/lt,ae=ct>=be&&ct<=Ke),!ae&&ve&Relationship.LEFT&&!(ye&Relationship.LEFT)&&(ot=it-(nt-be)*lt,ae=ot>=Ye&&ot<=Xe)}return ae}function applyTransform(ie,Z,ee,ae){if(isEmpty(ie))return createOrUpdateEmpty(ee);let ye=[];if(ae>1){const Ye=ie[2]-ie[0],Ke=ie[3]-ie[1];for(let Xe=0;Xe1?ee:2,Z===void 0&&(ee>2?Z=ie.slice():Z=new Array(ae));for(let ye=0;yeMAX_SAFE_Y?ve=MAX_SAFE_Y:ve<-MAX_SAFE_Y&&(ve=-MAX_SAFE_Y),Z[ye+1]=ve}return Z}function toEPSG4326(ie,Z,ee){const ae=ie.length;ee=ee>1?ee:2,Z===void 0&&(ee>2?Z=ie.slice():Z=new Array(ae));for(let ye=0;ye1?(ee=ye,ae=ve):Ke>0&&(ee+=be*Ke,ae+=Ye*Ke)}return squaredDistance(ie,Z,ee,ae)}function squaredDistance(ie,Z,ee,ae){const ye=ee-ie,ve=ae-Z;return ye*ye+ve*ve}function solveLinearSystem(ie){const Z=ie.length;for(let ae=0;aeve&&(ve=Ke,ye=Ye)}if(ve===0)return null;const be=ie[ye];ie[ye]=ie[ae],ie[ae]=be;for(let Ye=ae+1;Ye=0;ae--){ee[ae]=ie[ae][Z]/ie[ae][ae];for(let ye=ae-1;ye>=0;ye--)ie[ye][Z]-=ie[ye][ae]*ee[ae]}return ee}function toRadians(ie){return ie*Math.PI/180}function modulo(ie,Z){const ee=ie%Z;return ee*Z<0?ee+Z:ee}function lerp$1(ie,Z,ee){return ie+ee*(Z-ie)}function toFixed(ie,Z){const ee=Math.pow(10,Z);return Math.round(ie*ee)/ee}function floor$1(ie,Z){return Math.floor(toFixed(ie,Z))}function ceil(ie,Z){return Math.ceil(toFixed(ie,Z))}function add(ie,Z){return ie[0]+=+Z[0],ie[1]+=+Z[1],ie}function equals(ie,Z){let ee=!0;for(let ae=ie.length-1;ae>=0;--ae)if(ie[ae]!=Z[ae]){ee=!1;break}return ee}function rotate$2(ie,Z){const ee=Math.cos(Z),ae=Math.sin(Z),ye=ie[0]*ee-ie[1]*ae,ve=ie[1]*ee+ie[0]*ae;return ie[0]=ye,ie[1]=ve,ie}function scale$2(ie,Z){return ie[0]*=Z,ie[1]*=Z,ie}function wrapX$1(ie,Z){if(Z.canWrapX()){const ee=getWidth(Z.getExtent()),ae=getWorldsAway(ie,Z,ee);ae&&(ie[0]-=ae*ee)}return ie}function getWorldsAway(ie,Z,ee){const ae=Z.getExtent();let ye=0;return Z.canWrapX()&&(ie[0]ae[2])&&(ee=ee||getWidth(ae),ye=Math.floor((ie[0]-ae[0])/ee)),ye}const DEFAULT_RADIUS=63710088e-1;function getDistance(ie,Z,ee){ee=ee||DEFAULT_RADIUS;const ae=toRadians(ie[1]),ye=toRadians(Z[1]),ve=(ye-ae)/2,be=toRadians(Z[0]-ie[0])/2,Ye=Math.sin(ve)*Math.sin(ve)+Math.sin(be)*Math.sin(be)*Math.cos(ae)*Math.cos(ye);return 2*ee*Math.atan2(Math.sqrt(Ye),Math.sqrt(1-Ye))}function warn(...ie){console.warn(...ie)}function error(...ie){console.error(...ie)}let showCoordinateWarning=!0;function disableCoordinateWarning(ie){showCoordinateWarning=!(ie===void 0||ie)}function cloneTransform(ie,Z){if(Z!==void 0){for(let ee=0,ae=ie.length;ee=-180&&ie[0]<=180&&ie[1]>=-90&&ie[1]<=90&&(showCoordinateWarning=!1,warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),ie)}function toUserExtent(ie,Z){return userProjection?transformExtent(ie,Z,userProjection):ie}function fromUserExtent(ie,Z){return userProjection?transformExtent(ie,userProjection,Z):ie}function addCommon(){addEquivalentProjections(PROJECTIONS$1),addEquivalentProjections(PROJECTIONS),addEquivalentTransforms(PROJECTIONS,PROJECTIONS$1,fromEPSG4326,toEPSG4326)}addCommon();function transform2D(ie,Z,ee,ae,ye,ve){ve=ve||[];let be=0;for(let Ye=Z;Ye1)rt=ee;else if(nt>0){for(let it=0;itye&&(ye=Xe),ve=Ye,be=Ke}return ye}function arrayMaxSquaredDelta(ie,Z,ee,ae,ye){for(let ve=0,be=ee.length;ve0;){const rt=Xe.pop(),nt=Xe.pop();let it=0;const lt=ie[nt],ct=ie[nt+1],ot=ie[rt],dt=ie[rt+1];for(let ft=nt+ae;ftit&&(Je=ft,it=Yr)}it>ye&&(Ke[(Je-Z)/ae]=1,nt+ae0&&ct>it)&&(lt<0&&ot0&&ot>lt)){Xe=rt,Je=nt;continue}ve[be++]=Xe,ve[be++]=Je,Ye=Xe,Ke=Je,Xe=rt,Je=nt}return ve[be++]=Xe,ve[be++]=Je,be}function quantizeArray(ie,Z,ee,ae,ye,ve,be,Ye){for(let Ke=0,Xe=ee.length;Keve&&(Xe-Ye)*(ve-Ke)-(ye-Ye)*(Je-Ke)>0&&be++:Je<=ve&&(Xe-Ye)*(ve-Ke)-(ye-Ye)*(Je-Ke)<0&&be--,Ye=Xe,Ke=Je}return be!==0}function linearRingsContainsXY(ie,Z,ee,ae,ye,ve){if(ee.length===0||!linearRingContainsXY(ie,Z,ee[0],ae,ye,ve))return!1;for(let be=1,Ye=ee.length;bedt&&(Xe=(Je+rt)/2,linearRingsContainsXY(ie,Z,ee,ae,Xe,lt)&&(ot=Xe,dt=ft)),Je=rt}return isNaN(ot)&&(ot=ye[ve]),be?(be.push(ot,lt,dt),be):[ot,lt,dt]}function getInteriorPointsOfMultiArray(ie,Z,ee,ae,ye){let ve=[];for(let be=0,Ye=ee.length;be=ye[0]&&ve[2]<=ye[2]||ve[1]>=ye[1]&&ve[3]<=ye[3]?!0:forEach(ie,Z,ee,ae,function(be,Ye){return intersectsSegment(ye,be,Ye)}):!1}function intersectsLineStringArray(ie,Z,ee,ae,ye){for(let ve=0,be=ee.length;ve0}function linearRingsAreOriented(ie,Z,ee,ae,ye){ye=ye!==void 0?ye:!1;for(let ve=0,be=ee.length;ve1?be:2,ve=ve||new Array(be);for(let Je=0;Je>1;ye0&&ie[1]>0}function scale(ie,Z,ee){return ee===void 0&&(ee=[0,0]),ee[0]=ie[0]*Z+.5|0,ee[1]=ie[1]*Z+.5|0,ee}function toSize(ie,Z){return Array.isArray(ie)?ie:(Z===void 0?Z=[ie,ie]:(Z[0]=ie,Z[1]=ie),Z)}class ImageStyle{constructor(Z){this.opacity_=Z.opacity,this.rotateWithView_=Z.rotateWithView,this.rotation_=Z.rotation,this.scale_=Z.scale,this.scaleArray_=toSize(Z.scale),this.displacement_=Z.displacement,this.declutterMode_=Z.declutterMode}clone(){const Z=this.getScale();return new ImageStyle({opacity:this.getOpacity(),scale:Array.isArray(Z)?Z.slice():Z,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return abstract()}getImage(Z){return abstract()}getHitDetectionImage(){return abstract()}getPixelRatio(Z){return 1}getImageState(){return abstract()}getImageSize(){return abstract()}getOrigin(){return abstract()}getSize(){return abstract()}setDisplacement(Z){this.displacement_=Z}setOpacity(Z){this.opacity_=Z}setRotateWithView(Z){this.rotateWithView_=Z}setRotation(Z){this.rotation_=Z}setScale(Z){this.scale_=Z,this.scaleArray_=toSize(Z)}listenImageChange(Z){abstract()}load(){abstract()}unlistenImageChange(Z){abstract()}}const HEX_COLOR_RE_=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,NAMED_COLOR_RE_=/^([a-z]*)$|^hsla?\(.*\)$/i;function asString(ie){return typeof ie=="string"?ie:toString(ie)}function fromNamed(ie){const Z=document.createElement("div");if(Z.style.color=ie,Z.style.color!==""){document.body.appendChild(Z);const ee=getComputedStyle(Z).color;return document.body.removeChild(Z),ee}return""}const fromString=function(){const ie={};let Z=0;return function(ee){let ae;if(ie.hasOwnProperty(ee))ae=ie[ee];else{if(Z>=1024){let ye=0;for(const ve in ie)ye++&3||(delete ie[ve],--Z)}ae=fromStringInternal_(ee),ie[ee]=ae,++Z}return ae}}();function asArray(ie){return Array.isArray(ie)?ie:fromString(ie)}function fromStringInternal_(ie){let Z,ee,ae,ye,ve;if(NAMED_COLOR_RE_.exec(ie)&&(ie=fromNamed(ie)),HEX_COLOR_RE_.exec(ie)){const be=ie.length-1;let Ye;be<=4?Ye=1:Ye=2;const Ke=be===4||be===8;Z=parseInt(ie.substr(1+0*Ye,Ye),16),ee=parseInt(ie.substr(1+1*Ye,Ye),16),ae=parseInt(ie.substr(1+2*Ye,Ye),16),Ke?ye=parseInt(ie.substr(1+3*Ye,Ye),16):ye=255,Ye==1&&(Z=(Z<<4)+Z,ee=(ee<<4)+ee,ae=(ae<<4)+ae,Ke&&(ye=(ye<<4)+ye)),ve=[Z,ee,ae,ye/255]}else if(ie.startsWith("rgba("))ve=ie.slice(5,-1).split(",").map(Number),normalize$1(ve);else if(ie.startsWith("rgb("))ve=ie.slice(4,-1).split(",").map(Number),ve.push(1),normalize$1(ve);else throw new Error("Invalid color");return ve}function normalize$1(ie){return ie[0]=clamp$1(ie[0]+.5|0,0,255),ie[1]=clamp$1(ie[1]+.5|0,0,255),ie[2]=clamp$1(ie[2]+.5|0,0,255),ie[3]=clamp$1(ie[3],0,1),ie}function toString(ie){let Z=ie[0];Z!=(Z|0)&&(Z=Z+.5|0);let ee=ie[1];ee!=(ee|0)&&(ee=ee+.5|0);let ae=ie[2];ae!=(ae|0)&&(ae=ae+.5|0);const ye=ie[3]===void 0?1:Math.round(ie[3]*100)/100;return"rgba("+Z+","+ee+","+ae+","+ye+")"}function isStringColor(ie){return NAMED_COLOR_RE_.test(ie)&&(ie=fromNamed(ie)),HEX_COLOR_RE_.test(ie)||ie.startsWith("rgba(")||ie.startsWith("rgb(")}function asColorLike(ie){return Array.isArray(ie)?toString(ie):ie}function createCanvasContext2D(ie,Z,ee,ae){let ye;return ee&&ee.length?ye=ee.shift():WORKER_OFFSCREEN_CANVAS?ye=new OffscreenCanvas(ie||300,Z||300):ye=document.createElement("canvas"),ie&&(ye.width=ie),Z&&(ye.height=Z),ye.getContext("2d",ae)}function releaseCanvas$1(ie){const Z=ie.canvas;Z.width=1,Z.height=1,ie.clearRect(0,0,1,1)}function replaceNode(ie,Z){const ee=Z.parentNode;ee&&ee.replaceChild(ie,Z)}function removeNode(ie){return ie&&ie.parentNode?ie.parentNode.removeChild(ie):null}function removeChildren(ie){for(;ie.lastChild;)ie.removeChild(ie.lastChild)}function replaceChildren(ie,Z){const ee=ie.childNodes;for(let ae=0;;++ae){const ye=ee[ae],ve=Z[ae];if(!ye&&!ve)break;if(ye!==ve){if(!ye){ie.appendChild(ve);continue}if(!ve){ie.removeChild(ye),--ae;continue}ie.insertBefore(ve,ye)}}}const CLASS_HIDDEN="ol-hidden",CLASS_UNSELECTABLE="ol-unselectable",CLASS_UNSUPPORTED="ol-unsupported",CLASS_CONTROL="ol-control",CLASS_COLLAPSED="ol-collapsed",fontRegEx=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),fontRegExMatchIndex=["style","variant","weight","size","lineHeight","family"],getFontParameters=function(ie){const Z=ie.match(fontRegEx);if(!Z)return null;const ee={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let ae=0,ye=fontRegExMatchIndex.length;aeMath.max(ye,measureTextWidth(ie,ve)),0);return ee[Z]=ae,ae}function getTextDimensions(ie,Z){const ee=[],ae=[],ye=[];let ve=0,be=0,Ye=0,Ke=0;for(let Xe=0,Je=Z.length;Xe<=Je;Xe+=2){const rt=Z[Xe];if(rt===` +`||Xe===Je){ve=Math.max(ve,be),ye.push(be),be=0,Ye+=Ke;continue}const nt=Z[Xe+1]||ie.font,it=measureTextWidth(nt,rt);ee.push(it),be+=it;const lt=measureTextHeight(nt);ae.push(lt),Ke=Math.max(Ke,lt)}return{width:ve,height:Ye,widths:ee,heights:ae,lineWidths:ye}}function drawImageOrLabel(ie,Z,ee,ae,ye,ve,be,Ye,Ke,Xe,Je){ie.save(),ee!==1&&(ie.globalAlpha*=ee),Z&&ie.transform.apply(ie,Z),ae.contextInstructions?(ie.translate(Ke,Xe),ie.scale(Je[0],Je[1]),executeLabelInstructions(ae,ie)):Je[0]<0||Je[1]<0?(ie.translate(Ke,Xe),ie.scale(Je[0],Je[1]),ie.drawImage(ae,ye,ve,be,Ye,0,0,be,Ye)):ie.drawImage(ae,ye,ve,be,Ye,Ke,Xe,be*Je[0],Ye*Je[1]),ie.restore()}function executeLabelInstructions(ie,Z){const ee=ie.contextInstructions;for(let ae=0,ye=ee.length;aeit&&(nt=(it+nt)/2,it=nt),lt>ct&&(lt=(ct+lt)/2,ct=lt);let ot=clamp$1(ae[0],nt,it),dt=clamp$1(ae[1],lt,ct);if(be&&ee&&ye){const ft=30*ye;ot+=-ft*Math.log(1+Math.max(0,nt-ae[0])/ft)+ft*Math.log(1+Math.max(0,ae[0]-it)/ft),dt+=-ft*Math.log(1+Math.max(0,lt-ae[1])/ft)+ft*Math.log(1+Math.max(0,ae[1]-ct)/ft)}return[ot,dt]}}function none$1(ie){return ie}function getViewportClampedResolution(ie,Z,ee,ae){const ye=getWidth(Z)/ee[0],ve=getHeight(Z)/ee[1];return ae?Math.min(ie,Math.max(ye,ve)):Math.min(ie,Math.min(ye,ve))}function getSmoothClampedResolution(ie,Z,ee){let ae=Math.min(ie,Z);const ye=50;return ae*=Math.log(1+ye*Math.max(0,ie/Z-1))/ye+1,ee&&(ae=Math.max(ae,ee),ae/=Math.log(1+ye*Math.max(0,ee/ie-1))/ye+1),clamp$1(ae,ee/2,Z*2)}function createSnapToResolutions(ie,Z,ee,ae){return Z=Z!==void 0?Z:!0,function(ye,ve,be,Ye){if(ye!==void 0){const Ke=ie[0],Xe=ie[ie.length-1],Je=ee?getViewportClampedResolution(Ke,ee,be,ae):Ke;if(Ye)return Z?getSmoothClampedResolution(ye,Je,Xe):clamp$1(ye,Xe,Je);const rt=Math.min(Je,ye),nt=Math.floor(linearFindNearest(ie,rt,ve));return ie[nt]>Je&&nt1&&typeof arguments[ee-1]=="function"&&(ae=arguments[ee-1],--ee);let ye=0;for(;ye0}getInteracting(){return this.hints_[ViewHint.INTERACTING]>0}cancelAnimations(){this.setHint(ViewHint.ANIMATING,-this.hints_[ViewHint.ANIMATING]);let Z;for(let ee=0,ae=this.animations_.length;ee=0;--ae){const ye=this.animations_[ae];let ve=!0;for(let be=0,Ye=ye.length;be0?Xe/Ke.duration:1;Je>=1?(Ke.complete=!0,Je=1):ve=!1;const rt=Ke.easing(Je);if(Ke.sourceCenter){const nt=Ke.sourceCenter[0],it=Ke.sourceCenter[1],lt=Ke.targetCenter[0],ct=Ke.targetCenter[1];this.nextCenter_=Ke.targetCenter;const ot=nt+rt*(lt-nt),dt=it+rt*(ct-it);this.targetCenter_=[ot,dt]}if(Ke.sourceResolution&&Ke.targetResolution){const nt=rt===1?Ke.targetResolution:Ke.sourceResolution+rt*(Ke.targetResolution-Ke.sourceResolution);if(Ke.anchor){const it=this.getViewportSize_(this.getRotation()),lt=this.constraints_.resolution(nt,0,it,!0);this.targetCenter_=this.calculateCenterZoom(lt,Ke.anchor)}this.nextResolution_=Ke.targetResolution,this.targetResolution_=nt,this.applyTargetState_(!0)}if(Ke.sourceRotation!==void 0&&Ke.targetRotation!==void 0){const nt=rt===1?modulo(Ke.targetRotation+Math.PI,2*Math.PI)-Math.PI:Ke.sourceRotation+rt*(Ke.targetRotation-Ke.sourceRotation);if(Ke.anchor){const it=this.constraints_.rotation(nt,!0);this.targetCenter_=this.calculateCenterRotate(it,Ke.anchor)}this.nextRotation_=Ke.targetRotation,this.targetRotation_=nt}if(this.applyTargetState_(!0),ee=!0,!Ke.complete)break}if(ve){this.animations_[ae]=null,this.setHint(ViewHint.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const be=ye[0].callback;be&&animationCallback(be,!0)}}this.animations_=this.animations_.filter(Boolean),ee&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(Z,ee){let ae;const ye=this.getCenterInternal();return ye!==void 0&&(ae=[ye[0]-ee[0],ye[1]-ee[1]],rotate$2(ae,Z-this.getRotation()),add(ae,ee)),ae}calculateCenterZoom(Z,ee){let ae;const ye=this.getCenterInternal(),ve=this.getResolution();if(ye!==void 0&&ve!==void 0){const be=ee[0]-Z*(ee[0]-ye[0])/ve,Ye=ee[1]-Z*(ee[1]-ye[1])/ve;ae=[be,Ye]}return ae}getViewportSize_(Z){const ee=this.viewportSize_;if(Z){const ae=ee[0],ye=ee[1];return[Math.abs(ae*Math.cos(Z))+Math.abs(ye*Math.sin(Z)),Math.abs(ae*Math.sin(Z))+Math.abs(ye*Math.cos(Z))]}return ee}setViewportSize(Z){this.viewportSize_=Array.isArray(Z)?Z.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const Z=this.getCenterInternal();return Z&&toUserCoordinate(Z,this.getProjection())}getCenterInternal(){return this.get(ViewProperty.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(Z){return Z!==void 0?(Z[0]=this.hints_[0],Z[1]=this.hints_[1],Z):this.hints_.slice()}calculateExtent(Z){const ee=this.calculateExtentInternal(Z);return toUserExtent(ee,this.getProjection())}calculateExtentInternal(Z){Z=Z||this.getViewportSizeMinusPadding_();const ee=this.getCenterInternal();assert(ee,"The view center is not defined");const ae=this.getResolution();assert(ae!==void 0,"The view resolution is not defined");const ye=this.getRotation();return assert(ye!==void 0,"The view rotation is not defined"),getForViewAndSize(ee,ae,ye,Z)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(Z){this.applyOptions_(this.getUpdatedOptions_({maxZoom:Z}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(Z){this.applyOptions_(this.getUpdatedOptions_({minZoom:Z}))}setConstrainResolution(Z){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:Z}))}getProjection(){return this.projection_}getResolution(){return this.get(ViewProperty.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(Z,ee){return this.getResolutionForExtentInternal(fromUserExtent(Z,this.getProjection()),ee)}getResolutionForExtentInternal(Z,ee){ee=ee||this.getViewportSizeMinusPadding_();const ae=getWidth(Z)/ee[0],ye=getHeight(Z)/ee[1];return Math.max(ae,ye)}getResolutionForValueFunction(Z){Z=Z||2;const ee=this.getConstrainedResolution(this.maxResolution_),ae=this.minResolution_,ye=Math.log(ee/ae)/Math.log(Z);return function(ve){return ee/Math.pow(Z,ve*ye)}}getRotation(){return this.get(ViewProperty.ROTATION)}getValueForResolutionFunction(Z){const ee=Math.log(Z||2),ae=this.getConstrainedResolution(this.maxResolution_),ye=this.minResolution_,ve=Math.log(ae/ye)/ee;return function(be){return Math.log(ae/be)/ee/ve}}getViewportSizeMinusPadding_(Z){let ee=this.getViewportSize_(Z);const ae=this.padding_;return ae&&(ee=[ee[0]-ae[1]-ae[3],ee[1]-ae[0]-ae[2]]),ee}getState(){const Z=this.getProjection(),ee=this.getResolution(),ae=this.getRotation();let ye=this.getCenterInternal();const ve=this.padding_;if(ve){const be=this.getViewportSizeMinusPadding_();ye=calculateCenterOn(ye,this.getViewportSize_(),[be[0]/2+ve[3],be[1]/2+ve[0]],ee,ae)}return{center:ye.slice(0),projection:Z!==void 0?Z:null,resolution:ee,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:ae,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let Z;const ee=this.getResolution();return ee!==void 0&&(Z=this.getZoomForResolution(ee)),Z}getZoomForResolution(Z){let ee=this.minZoom_||0,ae,ye;if(this.resolutions_){const ve=linearFindNearest(this.resolutions_,Z,1);ee=ve,ae=this.resolutions_[ve],ve==this.resolutions_.length-1?ye=2:ye=ae/this.resolutions_[ve+1]}else ae=this.maxResolution_,ye=this.zoomFactor_;return ee+Math.log(ae/Z)/Math.log(ye)}getResolutionForZoom(Z){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;const ee=clamp$1(Math.floor(Z),0,this.resolutions_.length-2),ae=this.resolutions_[ee]/this.resolutions_[ee+1];return this.resolutions_[ee]/Math.pow(ae,clamp$1(Z-ee,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,Z-this.minZoom_)}fit(Z,ee){let ae;if(assert(Array.isArray(Z)||typeof Z.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(Z)){assert(!isEmpty(Z),"Cannot fit empty extent provided as `geometry`");const ye=fromUserExtent(Z,this.getProjection());ae=fromExtent(ye)}else if(Z.getType()==="Circle"){const ye=fromUserExtent(Z.getExtent(),this.getProjection());ae=fromExtent(ye),ae.rotate(this.getRotation(),getCenter(ye))}else{const ye=getUserProjection();ye?ae=Z.clone().transform(ye,this.getProjection()):ae=Z}this.fitInternal(ae,ee)}rotatedExtentForGeometry(Z){const ee=this.getRotation(),ae=Math.cos(ee),ye=Math.sin(-ee),ve=Z.getFlatCoordinates(),be=Z.getStride();let Ye=1/0,Ke=1/0,Xe=-1/0,Je=-1/0;for(let rt=0,nt=ve.length;rt{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(Z){return this.renderer_?this.renderer_.getFeatures(Z):Promise.resolve([])}getData(Z){return!this.renderer_||!this.rendered?null:this.renderer_.getData(Z)}isVisible(Z){let ee;const ae=this.getMapInternal();!Z&&ae&&(Z=ae.getView()),Z instanceof View?ee={viewState:Z.getState(),extent:Z.calculateExtent()}:ee=Z,!ee.layerStatesArray&&ae&&(ee.layerStatesArray=ae.getLayerGroup().getLayerStatesArray());let ye;ee.layerStatesArray?ye=ee.layerStatesArray.find(be=>be.layer===this):ye=this.getLayerState();const ve=this.getExtent();return inView(ye,ee.viewState)&&(!ve||intersects$1(ve,ee.extent))}getAttributions(Z){if(!this.isVisible(Z))return[];let ee;const ae=this.getSource();if(ae&&(ee=ae.getAttributions()),!ee)return[];const ye=Z instanceof View?Z.getViewStateAndExtent():Z;let ve=ee(ye);return Array.isArray(ve)||(ve=[ve]),ve}render(Z,ee){const ae=this.getRenderer();return ae.prepareFrame(Z)?(this.rendered=!0,ae.renderFrame(Z,ee)):null}unrender(){this.rendered=!1}setMapInternal(Z){Z||this.unrender(),this.set(LayerProperty.MAP,Z)}getMapInternal(){return this.get(LayerProperty.MAP)}setMap(Z){this.mapPrecomposeKey_&&(unlistenByKey(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),Z||this.changed(),this.mapRenderKey_&&(unlistenByKey(this.mapRenderKey_),this.mapRenderKey_=null),Z&&(this.mapPrecomposeKey_=listen(Z,RenderEventType.PRECOMPOSE,function(ee){const ae=ee.frameState.layerStatesArray,ye=this.getLayerState(!1);assert(!ae.some(function(ve){return ve.layer===ye.layer}),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),ae.push(ye)},this),this.mapRenderKey_=listen(this,EventType.CHANGE,Z.render,Z),this.changed())}setSource(Z){this.set(LayerProperty.SOURCE,Z)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}}function inView(ie,Z){if(!ie.visible)return!1;const ee=Z.resolution;if(ee=ie.maxResolution)return!1;const ae=Z.zoom;return ae>ie.minZoom&&ae<=ie.maxZoom}function quickselect(ie,Z,ee,ae,ye){quickselectStep(ie,Z,ee||0,ae||ie.length-1,ye||defaultCompare)}function quickselectStep(ie,Z,ee,ae,ye){for(;ae>ee;){if(ae-ee>600){var ve=ae-ee+1,be=Z-ee+1,Ye=Math.log(ve),Ke=.5*Math.exp(2*Ye/3),Xe=.5*Math.sqrt(Ye*Ke*(ve-Ke)/ve)*(be-ve/2<0?-1:1),Je=Math.max(ee,Math.floor(Z-be*Ke/ve+Xe)),rt=Math.min(ae,Math.floor(Z+(ve-be)*Ke/ve+Xe));quickselectStep(ie,Z,Je,rt,ye)}var nt=ie[Z],it=ee,lt=ae;for(swap(ie,ee,Z),ye(ie[ae],nt)>0&&swap(ie,ee,ae);it0;)lt--}ye(ie[ee],nt)===0?swap(ie,ee,lt):(lt++,swap(ie,lt,ae)),lt<=Z&&(ee=lt+1),Z<=lt&&(ae=lt-1)}}function swap(ie,Z,ee){var ae=ie[Z];ie[Z]=ie[ee],ie[ee]=ae}function defaultCompare(ie,Z){return ieZ?1:0}class RBush{constructor(Z=9){this._maxEntries=Math.max(4,Z),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(Z){let ee=this.data;const ae=[];if(!intersects(Z,ee))return ae;const ye=this.toBBox,ve=[];for(;ee;){for(let be=0;be=0&&ve[ee].children.length>this._maxEntries;)this._split(ve,ee),ee--;this._adjustParentBBoxes(ye,ve,ee)}_split(Z,ee){const ae=Z[ee],ye=ae.children.length,ve=this._minEntries;this._chooseSplitAxis(ae,ve,ye);const be=this._chooseSplitIndex(ae,ve,ye),Ye=createNode(ae.children.splice(be,ae.children.length-be));Ye.height=ae.height,Ye.leaf=ae.leaf,calcBBox(ae,this.toBBox),calcBBox(Ye,this.toBBox),ee?Z[ee-1].children.push(Ye):this._splitRoot(ae,Ye)}_splitRoot(Z,ee){this.data=createNode([Z,ee]),this.data.height=Z.height+1,this.data.leaf=!1,calcBBox(this.data,this.toBBox)}_chooseSplitIndex(Z,ee,ae){let ye,ve=1/0,be=1/0;for(let Ye=ee;Ye<=ae-ee;Ye++){const Ke=distBBox(Z,0,Ye,this.toBBox),Xe=distBBox(Z,Ye,ae,this.toBBox),Je=intersectionArea(Ke,Xe),rt=bboxArea(Ke)+bboxArea(Xe);Je=ee;Xe--){const Je=Z.children[Xe];extend(Ye,Z.leaf?ve(Je):Je),Ke+=bboxMargin(Ye)}return Ke}_adjustParentBBoxes(Z,ee,ae){for(let ye=ae;ye>=0;ye--)extend(ee[ye],Z)}_condense(Z){for(let ee=Z.length-1,ae;ee>=0;ee--)Z[ee].children.length===0?ee>0?(ae=Z[ee-1].children,ae.splice(ae.indexOf(Z[ee]),1)):this.clear():calcBBox(Z[ee],this.toBBox)}}function findItem(ie,Z,ee){if(!ee)return Z.indexOf(ie);for(let ae=0;ae=ie.minX&&Z.maxY>=ie.minY}function createNode(ie){return{children:ie,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function multiSelect(ie,Z,ee,ae,ye){const ve=[Z,ee];for(;ve.length;){if(ee=ve.pop(),Z=ve.pop(),ee-Z<=ae)continue;const be=Z+Math.ceil((ee-Z)/ae/2)*ae;quickselect(ie,be,Z,ee,ye),ve.push(Z,be,be,ee)}}function listenImage(ie,Z,ee){const ae=ie;let ye=!0,ve=!1,be=!1;const Ye=[listenOnce(ae,EventType.LOAD,function(){be=!0,ve||Z()})];return ae.src&&IMAGE_DECODE?(ve=!0,ae.decode().then(function(){ye&&Z()}).catch(function(Ke){ye&&(be?Z():ee())})):Ye.push(listenOnce(ae,EventType.ERROR,ee)),function(){ye=!1,Ye.forEach(unlistenByKey)}}function load(ie,Z){return new Promise((ee,ae)=>{function ye(){be(),ee(ie)}function ve(){be(),ae(new Error("Image load error"))}function be(){ie.removeEventListener("load",ye),ie.removeEventListener("error",ve)}ie.addEventListener("load",ye),ie.addEventListener("error",ve),Z&&(ie.src=Z)})}function decodeFallback(ie,Z){return Z&&(ie.src=Z),IMAGE_DECODE?new Promise((ee,ae)=>ie.decode().then(()=>ee(ie),ae)):load(ie)}class IconImageCache{constructor(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let Z=0;for(const ee in this.cache_){const ae=this.cache_[ee];!(Z++&3)&&!ae.hasListener()&&(delete this.cache_[ee],--this.cacheSize_)}}}get(Z,ee,ae){const ye=getKey$1(Z,ee,ae);return ye in this.cache_?this.cache_[ye]:null}set(Z,ee,ae,ye){const ve=getKey$1(Z,ee,ae);this.cache_[ve]=ye,++this.cacheSize_}setSize(Z){this.maxCacheSize_=Z,this.expire()}}function getKey$1(ie,Z,ee){const ae=ee?asString(ee):"null";return Z+":"+ie+":"+ae}const shared=new IconImageCache;let taintedTestContext=null;class IconImage extends Target{constructor(Z,ee,ae,ye,ve){super(),this.hitDetectionImage_=null,this.image_=Z,this.crossOrigin_=ae,this.canvas_={},this.color_=ve,this.imageState_=ye===void 0?ImageState.IDLE:ye,this.size_=Z&&Z.width&&Z.height?[Z.width,Z.height]:null,this.src_=ee,this.tainted_}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===ImageState.LOADED){taintedTestContext||(taintedTestContext=createCanvasContext2D(1,1,void 0,{willReadFrequently:!0})),taintedTestContext.drawImage(this.image_,0,0);try{taintedTestContext.getImageData(0,0,1,1),this.tainted_=!1}catch{taintedTestContext=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(EventType.CHANGE)}handleImageError_(){this.imageState_=ImageState.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=ImageState.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(Z){return this.image_||this.initializeImage_(),this.replaceColor_(Z),this.canvas_[Z]?this.canvas_[Z]:this.image_}getPixelRatio(Z){return this.replaceColor_(Z),this.canvas_[Z]?Z:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const Z=this.size_[0],ee=this.size_[1],ae=createCanvasContext2D(Z,ee);ae.fillRect(0,0,Z,ee),this.hitDetectionImage_=ae.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===ImageState.IDLE){this.image_||this.initializeImage_(),this.imageState_=ImageState.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&decodeFallback(this.image_,this.src_).then(Z=>{this.image_=Z,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(Z){if(!this.color_||this.canvas_[Z]||this.imageState_!==ImageState.LOADED)return;const ee=this.image_,ae=document.createElement("canvas");ae.width=Math.ceil(ee.width*Z),ae.height=Math.ceil(ee.height*Z);const ye=ae.getContext("2d");ye.scale(Z,Z),ye.drawImage(ee,0,0),ye.globalCompositeOperation="multiply",ye.fillStyle=asString(this.color_),ye.fillRect(0,0,ae.width/Z,ae.height/Z),ye.globalCompositeOperation="destination-in",ye.drawImage(ee,0,0),this.canvas_[Z]=ae}}function get(ie,Z,ee,ae,ye){let ve=Z===void 0?void 0:shared.get(Z,ee,ye);return ve||(ve=new IconImage(ie,ie instanceof HTMLImageElement?ie.src||void 0:Z,ee,ae,ye),shared.set(Z,ee,ye,ve)),ve}function calculateScale(ie,Z,ee,ae){return ee!==void 0&&ae!==void 0?[ee/ie,ae/Z]:ee!==void 0?ee/ie:ae!==void 0?ae/Z:1}class Icon extends ImageStyle{constructor(Z){Z=Z||{};const ee=Z.opacity!==void 0?Z.opacity:1,ae=Z.rotation!==void 0?Z.rotation:0,ye=Z.scale!==void 0?Z.scale:1,ve=Z.rotateWithView!==void 0?Z.rotateWithView:!1;super({opacity:ee,rotation:ae,scale:ye,displacement:Z.displacement!==void 0?Z.displacement:[0,0],rotateWithView:ve,declutterMode:Z.declutterMode}),this.anchor_=Z.anchor!==void 0?Z.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=Z.anchorOrigin!==void 0?Z.anchorOrigin:"top-left",this.anchorXUnits_=Z.anchorXUnits!==void 0?Z.anchorXUnits:"fraction",this.anchorYUnits_=Z.anchorYUnits!==void 0?Z.anchorYUnits:"fraction",this.crossOrigin_=Z.crossOrigin!==void 0?Z.crossOrigin:null;const be=Z.img!==void 0?Z.img:null;let Ye=Z.src;assert(!(Ye!==void 0&&be),"`image` and `src` cannot be provided at the same time"),(Ye===void 0||Ye.length===0)&&be&&(Ye=be.src||getUid(be)),assert(Ye!==void 0&&Ye.length>0,"A defined and non-empty `src` or `image` must be provided"),assert(!((Z.width!==void 0||Z.height!==void 0)&&Z.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let Ke;if(Z.src!==void 0?Ke=ImageState.IDLE:be!==void 0&&(be instanceof HTMLImageElement?be.complete?Ke=be.src?ImageState.LOADED:ImageState.IDLE:Ke=ImageState.LOADING:Ke=ImageState.LOADED),this.color_=Z.color!==void 0?asArray(Z.color):null,this.iconImage_=get(be,Ye,this.crossOrigin_,Ke,this.color_),this.offset_=Z.offset!==void 0?Z.offset:[0,0],this.offsetOrigin_=Z.offsetOrigin!==void 0?Z.offsetOrigin:"top-left",this.origin_=null,this.size_=Z.size!==void 0?Z.size:null,Z.width!==void 0||Z.height!==void 0){let Xe,Je;if(Z.size)[Xe,Je]=Z.size;else{const rt=this.getImage(1);if(rt.width&&rt.height)Xe=rt.width,Je=rt.height;else if(rt instanceof HTMLImageElement){this.initialOptions_=Z;const nt=()=>{if(this.unlistenImageChange(nt),!this.initialOptions_)return;const it=this.iconImage_.getSize();this.setScale(calculateScale(it[0],it[1],Z.width,Z.height))};this.listenImageChange(nt);return}}Xe!==void 0&&this.setScale(calculateScale(Xe,Je,Z.width,Z.height))}}clone(){let Z,ee,ae;return this.initialOptions_?(ee=this.initialOptions_.width,ae=this.initialOptions_.height):(Z=this.getScale(),Z=Array.isArray(Z)?Z.slice():Z),new Icon({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Z,width:ee,height:ae,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let Z=this.normalizedAnchor_;if(!Z){Z=this.anchor_;const ye=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!ye)return null;Z=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(Z[0]*=ye[0]),this.anchorYUnits_=="fraction"&&(Z[1]*=ye[1])}if(this.anchorOrigin_!="top-left"){if(!ye)return null;Z===this.anchor_&&(Z=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(Z[0]=-Z[0]+ye[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(Z[1]=-Z[1]+ye[1])}this.normalizedAnchor_=Z}const ee=this.getDisplacement(),ae=this.getScaleArray();return[Z[0]-ee[0]/ae[0],Z[1]+ee[1]/ae[1]]}setAnchor(Z){this.anchor_=Z,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(Z){return this.iconImage_.getImage(Z)}getPixelRatio(Z){return this.iconImage_.getPixelRatio(Z)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let Z=this.offset_;if(this.offsetOrigin_!="top-left"){const ee=this.getSize(),ae=this.iconImage_.getSize();if(!ee||!ae)return null;Z=Z.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(Z[0]=ae[0]-ee[0]-Z[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(Z[1]=ae[1]-ee[1]-Z[1])}return this.origin_=Z,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const Z=this.getScaleArray();if(this.size_)return this.size_[0]*Z[0];if(this.iconImage_.getImageState()==ImageState.LOADED)return this.iconImage_.getSize()[0]*Z[0]}getHeight(){const Z=this.getScaleArray();if(this.size_)return this.size_[1]*Z[1];if(this.iconImage_.getImageState()==ImageState.LOADED)return this.iconImage_.getSize()[1]*Z[1]}setScale(Z){delete this.initialOptions_,super.setScale(Z)}listenImageChange(Z){this.iconImage_.addEventListener(EventType.CHANGE,Z)}load(){this.iconImage_.load()}unlistenImageChange(Z){this.iconImage_.removeEventListener(EventType.CHANGE,Z)}}let numTypes=0;const BooleanType=1<",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",Multiply:"*",Divide:"/",Add:"+",Subtract:"-",Clamp:"clamp",Mod:"%",Pow:"^",Abs:"abs",Floor:"floor",Ceil:"ceil",Round:"round",Sin:"sin",Cos:"cos",Atan:"atan",Sqrt:"sqrt",Match:"match"},parsers={[Ops.Number]:createParser(withArgs(1,1/0,AnyType),NumberType),[Ops.String]:createParser(withArgs(1,1/0,AnyType),StringType),[Ops.Get]:createParser(withGetArgs,AnyType),[Ops.Var]:createParser(withVarArgs,AnyType),[Ops.Resolution]:createParser(withNoArgs,NumberType),[Ops.Any]:createParser(withArgs(2,1/0,BooleanType),BooleanType),[Ops.All]:createParser(withArgs(2,1/0,BooleanType),BooleanType),[Ops.Not]:createParser(withArgs(1,1,BooleanType),BooleanType),[Ops.Equal]:createParser(withArgs(2,2,AnyType),BooleanType),[Ops.NotEqual]:createParser(withArgs(2,2,AnyType),BooleanType),[Ops.GreaterThan]:createParser(withArgs(2,2,AnyType),BooleanType),[Ops.GreaterThanOrEqualTo]:createParser(withArgs(2,2,AnyType),BooleanType),[Ops.LessThan]:createParser(withArgs(2,2,AnyType),BooleanType),[Ops.LessThanOrEqualTo]:createParser(withArgs(2,2,AnyType),BooleanType),[Ops.Multiply]:createParser(withArgs(2,1/0,NumberType),NumberType),[Ops.Divide]:createParser(withArgs(2,2,NumberType),NumberType),[Ops.Add]:createParser(withArgs(2,1/0,NumberType),NumberType),[Ops.Subtract]:createParser(withArgs(2,2,NumberType),NumberType),[Ops.Clamp]:createParser(withArgs(3,3,NumberType),NumberType),[Ops.Mod]:createParser(withArgs(2,2,NumberType),NumberType),[Ops.Pow]:createParser(withArgs(2,2,NumberType),NumberType),[Ops.Abs]:createParser(withArgs(1,1,NumberType),NumberType),[Ops.Floor]:createParser(withArgs(1,1,NumberType),NumberType),[Ops.Ceil]:createParser(withArgs(1,1,NumberType),NumberType),[Ops.Round]:createParser(withArgs(1,1,NumberType),NumberType),[Ops.Sin]:createParser(withArgs(1,1,NumberType),NumberType),[Ops.Cos]:createParser(withArgs(1,1,NumberType),NumberType),[Ops.Atan]:createParser(withArgs(1,2,NumberType),NumberType),[Ops.Sqrt]:createParser(withArgs(1,1,NumberType),NumberType),[Ops.Match]:createParser(withArgs(4,1/0,StringType|NumberType),AnyType)};function withGetArgs(ie,Z){if(ie.length!==2)throw new Error("Expected 1 argument for get operation");const ee=parse$9(ie[1],Z);if(!(ee instanceof LiteralExpression))throw new Error("Expected a literal argument for get operation");if(typeof ee.value!="string")throw new Error("Expected a string argument for get operation");return Z.properties.add(ee.value),[ee]}function withVarArgs(ie,Z){if(ie.length!==2)throw new Error("Expected 1 argument for var operation");const ee=parse$9(ie[1],Z);if(!(ee instanceof LiteralExpression))throw new Error("Expected a literal argument for var operation");if(typeof ee.value!="string")throw new Error("Expected a string argument for get operation");return Z.variables.add(ee.value),[ee]}function withNoArgs(ie,Z){const ee=ie[0];if(ie.length!==1)throw new Error(`Expected no arguments for ${ee} operation`);return[]}function withArgs(ie,Z,ee){return function(ae,ye){const ve=ae[0],be=ae.length-1;if(ie===Z){if(be!==ie){const Ke=ie===1?"":"s";throw new Error(`Expected ${ie} argument${Ke} for operation ${ve}, got ${be}`)}}else if(beZ)throw new Error(`Expected ${ie} to ${Z} arguments for operation ${ve}, got ${be}`);const Ye=new Array(be);for(let Ke=0;Keae.resolution;case Ops.Any:case Ops.All:case Ops.Not:return compileLogicalExpression(ie);case Ops.Equal:case Ops.NotEqual:case Ops.LessThan:case Ops.LessThanOrEqualTo:case Ops.GreaterThan:case Ops.GreaterThanOrEqualTo:return compileComparisonExpression(ie);case Ops.Multiply:case Ops.Divide:case Ops.Add:case Ops.Subtract:case Ops.Clamp:case Ops.Mod:case Ops.Pow:case Ops.Abs:case Ops.Floor:case Ops.Ceil:case Ops.Round:case Ops.Sin:case Ops.Cos:case Ops.Atan:case Ops.Sqrt:return compileNumericExpression(ie);case Ops.Match:return compileMatchExpression(ie);default:throw new Error(`Unsupported operator ${ee}`)}}function compileAssertionExpression(ie,Z){const ee=ie.operator,ae=ie.args.length,ye=new Array(ae);for(let ve=0;ve{for(let be=0;beye.properties[ae];case Ops.Var:return ye=>ye.variables[ae];default:throw new Error(`Unsupported accessor operator ${ie.operator}`)}}function compileComparisonExpression(ie,Z){const ee=ie.operator,ae=compileExpression(ie.args[0]),ye=compileExpression(ie.args[1]);switch(ee){case Ops.Equal:return ve=>ae(ve)===ye(ve);case Ops.NotEqual:return ve=>ae(ve)!==ye(ve);case Ops.LessThan:return ve=>ae(ve)ae(ve)<=ye(ve);case Ops.GreaterThan:return ve=>ae(ve)>ye(ve);case Ops.GreaterThanOrEqualTo:return ve=>ae(ve)>=ye(ve);default:throw new Error(`Unsupported comparison operator ${ee}`)}}function compileLogicalExpression(ie,Z){const ee=ie.operator,ae=ie.args.length,ye=new Array(ae);for(let ve=0;ve{for(let be=0;be{for(let be=0;be!ye[0](ve);default:throw new Error(`Unsupported logical operator ${ee}`)}}function compileNumericExpression(ie,Z){const ee=ie.operator,ae=ie.args.length,ye=new Array(ae);for(let ve=0;ve{let be=1;for(let Ye=0;Yeye[0](ve)/ye[1](ve);case Ops.Add:return ve=>{let be=0;for(let Ye=0;Yeye[0](ve)-ye[1](ve);case Ops.Clamp:return ve=>{const be=ye[0](ve),Ye=ye[1](ve);if(beKe?Ke:be};case Ops.Mod:return ve=>ye[0](ve)%ye[1](ve);case Ops.Pow:return ve=>Math.pow(ye[0](ve),ye[1](ve));case Ops.Abs:return ve=>Math.abs(ye[0](ve));case Ops.Floor:return ve=>Math.floor(ye[0](ve));case Ops.Ceil:return ve=>Math.ceil(ye[0](ve));case Ops.Round:return ve=>Math.round(ye[0](ve));case Ops.Sin:return ve=>Math.sin(ye[0](ve));case Ops.Cos:return ve=>Math.cos(ye[0](ve));case Ops.Atan:return ae===2?ve=>Math.atan2(ye[0](ve),ye[1](ve)):ve=>Math.atan(ye[0](ve));case Ops.Sqrt:return ve=>Math.sqrt(ye[0](ve));default:throw new Error(`Unsupported numeric operator ${ee}`)}}function compileMatchExpression(ie,Z){const ee=ie.args.length,ae=new Array(ee);for(let ye=0;ye{const ve=ae[0](ye);for(let be=1;be4)throw new Error(`Expected a color with 3 or 4 values for ${Z}`);return ee}function requireSizeLike(ie,Z){if(typeof ie=="number")return ie;const ee=requireNumberArray(ie,Z);if(ee.length!==2)throw new Error(`Expected an array of two numbers for ${Z}`);return ee}const Property$1={RENDER_ORDER:"renderOrder"};class BaseVectorLayer extends Layer{constructor(Z){Z=Z||{};const ee=Object.assign({},Z);delete ee.style,delete ee.renderBuffer,delete ee.updateWhileAnimating,delete ee.updateWhileInteracting,super(ee),this.declutter_=Z.declutter!==void 0?Z.declutter:!1,this.renderBuffer_=Z.renderBuffer!==void 0?Z.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(Z.style),this.updateWhileAnimating_=Z.updateWhileAnimating!==void 0?Z.updateWhileAnimating:!1,this.updateWhileInteracting_=Z.updateWhileInteracting!==void 0?Z.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(Z){return super.getFeatures(Z)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(Property$1.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(Z){Z.declutterTree||(Z.declutterTree=new RBush(9)),this.getRenderer().renderDeclutter(Z)}setRenderOrder(Z){this.set(Property$1.RENDER_ORDER,Z)}setStyle(Z){this.style_=toStyleLike(Z),this.styleFunction_=Z===null?void 0:toFunction(this.style_),this.changed()}}function toStyleLike(ie){if(ie===void 0)return createDefaultStyle;if(!ie)return null;if(typeof ie=="function"||ie instanceof Style$1)return ie;if(!Array.isArray(ie))return flatStylesToStyleFunction([ie]);if(ie.length===0)return[];const Z=ie.length,ee=ie[0];if(ee instanceof Style$1){const ae=new Array(Z);for(let ye=0;yeYe&&(this.instructions.push([Instruction.CUSTOM,Ye,Xe,Z,ae,inflateCoordinates]),this.hitDetectionInstructions.push([Instruction.CUSTOM,Ye,Xe,Z,ye||ae,inflateCoordinates]));break;case"Point":Ke=Z.getFlatCoordinates(),this.coordinates.push(Ke[0],Ke[1]),Xe=this.coordinates.length,this.instructions.push([Instruction.CUSTOM,Ye,Xe,Z,ae]),this.hitDetectionInstructions.push([Instruction.CUSTOM,Ye,Xe,Z,ye||ae]);break}this.endGeometry(ee)}beginGeometry(Z,ee){this.beginGeometryInstruction1_=[Instruction.BEGIN_GEOMETRY,ee,0,Z],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Instruction.BEGIN_GEOMETRY,ee,0,Z],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const Z=this.hitDetectionInstructions;Z.reverse();let ee;const ae=Z.length;let ye,ve,be=-1;for(ee=0;eethis.maxLineWidth&&(this.maxLineWidth=ae.lineWidth,this.bufferedMaxExtent_=null)}else ae.strokeStyle=void 0,ae.lineCap=void 0,ae.lineDash=null,ae.lineDashOffset=void 0,ae.lineJoin=void 0,ae.lineWidth=void 0,ae.miterLimit=void 0}createFill(Z){const ee=Z.fillStyle,ae=[Instruction.SET_FILL_STYLE,ee];return typeof ee!="string"&&ae.push(!0),ae}applyStroke(Z){this.instructions.push(this.createStroke(Z))}createStroke(Z){return[Instruction.SET_STROKE_STYLE,Z.strokeStyle,Z.lineWidth*this.pixelRatio,Z.lineCap,Z.lineJoin,Z.miterLimit,this.applyPixelRatio(Z.lineDash),Z.lineDashOffset*this.pixelRatio]}updateFillStyle(Z,ee){const ae=Z.fillStyle;(typeof ae!="string"||Z.currentFillStyle!=ae)&&(ae!==void 0&&this.instructions.push(ee.call(this,Z)),Z.currentFillStyle=ae)}updateStrokeStyle(Z,ee){const ae=Z.strokeStyle,ye=Z.lineCap,ve=Z.lineDash,be=Z.lineDashOffset,Ye=Z.lineJoin,Ke=Z.lineWidth,Xe=Z.miterLimit;(Z.currentStrokeStyle!=ae||Z.currentLineCap!=ye||ve!=Z.currentLineDash&&!equals$2(Z.currentLineDash,ve)||Z.currentLineDashOffset!=be||Z.currentLineJoin!=Ye||Z.currentLineWidth!=Ke||Z.currentMiterLimit!=Xe)&&(ae!==void 0&&ee.call(this,Z),Z.currentStrokeStyle=ae,Z.currentLineCap=ye,Z.currentLineDash=ve,Z.currentLineDashOffset=be,Z.currentLineJoin=Ye,Z.currentLineWidth=Ke,Z.currentMiterLimit=Xe)}endGeometry(Z){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const ee=[Instruction.END_GEOMETRY,Z];this.instructions.push(ee),this.hitDetectionInstructions.push(ee)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=clone(this.maxExtent),this.maxLineWidth>0)){const Z=this.resolution*(this.maxLineWidth+1)/2;buffer$1(this.bufferedMaxExtent_,Z,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class CanvasImageBuilder extends CanvasBuilder{constructor(Z,ee,ae,ye){super(Z,ee,ae,ye),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(Z,ee){if(!this.image_)return;this.beginGeometry(Z,ee);const ae=Z.getFlatCoordinates(),ye=Z.getStride(),ve=this.coordinates.length,be=this.appendFlatPointCoordinates(ae,ye);this.instructions.push([Instruction.DRAW_IMAGE,ve,be,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Instruction.DRAW_IMAGE,ve,be,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(ee)}drawMultiPoint(Z,ee){if(!this.image_)return;this.beginGeometry(Z,ee);const ae=Z.getFlatCoordinates(),ye=Z.getStride(),ve=this.coordinates.length,be=this.appendFlatPointCoordinates(ae,ye);this.instructions.push([Instruction.DRAW_IMAGE,ve,be,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Instruction.DRAW_IMAGE,ve,be,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(ee)}finish(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,super.finish()}setImageStyle(Z,ee){const ae=Z.getAnchor(),ye=Z.getSize(),ve=Z.getOrigin();this.imagePixelRatio_=Z.getPixelRatio(this.pixelRatio),this.anchorX_=ae[0],this.anchorY_=ae[1],this.hitDetectionImage_=Z.getHitDetectionImage(),this.image_=Z.getImage(this.pixelRatio),this.height_=ye[1],this.opacity_=Z.getOpacity(),this.originX_=ve[0],this.originY_=ve[1],this.rotateWithView_=Z.getRotateWithView(),this.rotation_=Z.getRotation(),this.scale_=Z.getScaleArray(),this.width_=ye[0],this.declutterMode_=Z.getDeclutterMode(),this.declutterImageWithText_=ee}}const ImageBuilder=CanvasImageBuilder;class CanvasLineStringBuilder extends CanvasBuilder{constructor(Z,ee,ae,ye){super(Z,ee,ae,ye)}drawFlatCoordinates_(Z,ee,ae,ye){const ve=this.coordinates.length,be=this.appendFlatLineCoordinates(Z,ee,ae,ye,!1,!1),Ye=[Instruction.MOVE_TO_LINE_TO,ve,be];return this.instructions.push(Ye),this.hitDetectionInstructions.push(Ye),ae}drawLineString(Z,ee){const ae=this.state,ye=ae.strokeStyle,ve=ae.lineWidth;if(ye===void 0||ve===void 0)return;this.updateStrokeStyle(ae,this.applyStroke),this.beginGeometry(Z,ee),this.hitDetectionInstructions.push([Instruction.SET_STROKE_STYLE,ae.strokeStyle,ae.lineWidth,ae.lineCap,ae.lineJoin,ae.miterLimit,defaultLineDash,defaultLineDashOffset],beginPathInstruction);const be=Z.getFlatCoordinates(),Ye=Z.getStride();this.drawFlatCoordinates_(be,0,be.length,Ye),this.hitDetectionInstructions.push(strokeInstruction),this.endGeometry(ee)}drawMultiLineString(Z,ee){const ae=this.state,ye=ae.strokeStyle,ve=ae.lineWidth;if(ye===void 0||ve===void 0)return;this.updateStrokeStyle(ae,this.applyStroke),this.beginGeometry(Z,ee),this.hitDetectionInstructions.push([Instruction.SET_STROKE_STYLE,ae.strokeStyle,ae.lineWidth,ae.lineCap,ae.lineJoin,ae.miterLimit,defaultLineDash,defaultLineDashOffset],beginPathInstruction);const be=Z.getEnds(),Ye=Z.getFlatCoordinates(),Ke=Z.getStride();let Xe=0;for(let Je=0,rt=be.length;Je=ie){const lt=(ie-Ye+it)/it,ct=lerp$1(Xe,rt,lt),ot=lerp$1(Je,nt,lt);Ke.push(ct,ot),ve.push(Ke),Ke=[ct,ot],Ye==ie&&(be+=ye),Ye=0}else if(Ye0&&ve.push(Ke),ve}function matchingChunk(ie,Z,ee,ae,ye){let ve=ee,be=ee,Ye=0,Ke=0,Xe=ee,Je,rt,nt,it,lt,ct,ot,dt,ft,gt;for(rt=ee;rtie&&(Ke>Ye&&(Ye=Ke,ve=Xe,be=rt),Ke=0,Xe=rt-ye)),nt=it,ot=ft,dt=gt),lt=mt,ct=Yr}return Ke+=it,Ke>Ye?[Xe,rt]:[ve,be]}const TEXT_ALIGN={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class CanvasTextBuilder extends CanvasBuilder{constructor(Z,ee,ae,ye){super(Z,ee,ae,ye),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[defaultFillStyle]={fillStyle:defaultFillStyle},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterImageWithText_=void 0}finish(){const Z=super.finish();return Z.textStates=this.textStates,Z.fillStates=this.fillStates,Z.strokeStates=this.strokeStates,Z}drawText(Z,ee){const ae=this.textFillState_,ye=this.textStrokeState_,ve=this.textState_;if(this.text_===""||!ve||!ae&&!ye)return;const be=this.coordinates;let Ye=be.length;const Ke=Z.getType();let Xe=null,Je=Z.getStride();if(ve.placement==="line"&&(Ke=="LineString"||Ke=="MultiLineString"||Ke=="Polygon"||Ke=="MultiPolygon")){if(!intersects$1(this.getBufferedMaxExtent(),Z.getExtent()))return;let rt;if(Xe=Z.getFlatCoordinates(),Ke=="LineString")rt=[Xe.length];else if(Ke=="MultiLineString")rt=Z.getEnds();else if(Ke=="Polygon")rt=Z.getEnds().slice(0,1);else if(Ke=="MultiPolygon"){const ct=Z.getEndss();rt=[];for(let ot=0,dt=ct.length;ot{const mt=be[(dt+gt)*2]===Xe[gt*Je]&&be[(dt+gt)*2+1]===Xe[gt*Je+1];return mt||--dt,mt})}this.saveTextStates_(),(ve.backgroundFill||ve.backgroundStroke)&&(this.setFillStrokeStyle(ve.backgroundFill,ve.backgroundStroke),ve.backgroundFill&&this.updateFillStyle(this.state,this.createFill),ve.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(Z,ee);let it=ve.padding;if(it!=defaultPadding&&(ve.scale[0]<0||ve.scale[1]<0)){let dt=ve.padding[0],ft=ve.padding[1],gt=ve.padding[2],mt=ve.padding[3];ve.scale[0]<0&&(ft=-ft,mt=-mt),ve.scale[1]<0&&(dt=-dt,gt=-gt),it=[dt,ft,gt,mt]}const lt=this.pixelRatio;this.instructions.push([Instruction.DRAW_IMAGE,Ye,nt,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,void 0,this.declutterImageWithText_,it==defaultPadding?defaultPadding:it.map(function(dt){return dt*lt}),!!ve.backgroundFill,!!ve.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,rt]);const ct=1/lt,ot=this.state.fillStyle;ve.backgroundFill&&(this.state.fillStyle=defaultFillStyle,this.hitDetectionInstructions.push(this.createFill(this.state))),this.hitDetectionInstructions.push([Instruction.DRAW_IMAGE,Ye,nt,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[ct,ct],NaN,void 0,this.declutterImageWithText_,it,!!ve.backgroundFill,!!ve.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?defaultFillStyle:this.fillKey_,this.textOffsetX_,this.textOffsetY_,rt]),ve.backgroundFill&&(this.state.fillStyle=ot,this.hitDetectionInstructions.push(this.createFill(this.state))),this.endGeometry(ee)}}saveTextStates_(){const Z=this.textStrokeState_,ee=this.textState_,ae=this.textFillState_,ye=this.strokeKey_;Z&&(ye in this.strokeStates||(this.strokeStates[ye]={strokeStyle:Z.strokeStyle,lineCap:Z.lineCap,lineDashOffset:Z.lineDashOffset,lineWidth:Z.lineWidth,lineJoin:Z.lineJoin,miterLimit:Z.miterLimit,lineDash:Z.lineDash}));const ve=this.textKey_;ve in this.textStates||(this.textStates[ve]={font:ee.font,textAlign:ee.textAlign||defaultTextAlign,justify:ee.justify,textBaseline:ee.textBaseline||defaultTextBaseline,scale:ee.scale});const be=this.fillKey_;ae&&(be in this.fillStates||(this.fillStates[be]={fillStyle:ae.fillStyle}))}drawChars_(Z,ee){const ae=this.textStrokeState_,ye=this.textState_,ve=this.strokeKey_,be=this.textKey_,Ye=this.fillKey_;this.saveTextStates_();const Ke=this.pixelRatio,Xe=TEXT_ALIGN[ye.textBaseline],Je=this.textOffsetY_*Ke,rt=this.text_,nt=ae?ae.lineWidth*Math.abs(ye.scale[0])/2:0;this.instructions.push([Instruction.DRAW_CHARS,Z,ee,Xe,ye.overflow,Ye,ye.maxAngle,Ke,Je,ve,nt*Ke,rt,be,1]),this.hitDetectionInstructions.push([Instruction.DRAW_CHARS,Z,ee,Xe,ye.overflow,Ye&&defaultFillStyle,ye.maxAngle,Ke,Je,ve,nt*Ke,rt,be,1/Ke])}setTextStyle(Z,ee){let ae,ye,ve;if(!Z)this.text_="";else{const be=Z.getFill();be?(ye=this.textFillState_,ye||(ye={},this.textFillState_=ye),ye.fillStyle=asColorLike(be.getColor()||defaultFillStyle)):(ye=null,this.textFillState_=ye);const Ye=Z.getStroke();if(!Ye)ve=null,this.textStrokeState_=ve;else{ve=this.textStrokeState_,ve||(ve={},this.textStrokeState_=ve);const lt=Ye.getLineDash(),ct=Ye.getLineDashOffset(),ot=Ye.getWidth(),dt=Ye.getMiterLimit();ve.lineCap=Ye.getLineCap()||defaultLineCap,ve.lineDash=lt?lt.slice():defaultLineDash,ve.lineDashOffset=ct===void 0?defaultLineDashOffset:ct,ve.lineJoin=Ye.getLineJoin()||defaultLineJoin,ve.lineWidth=ot===void 0?defaultLineWidth:ot,ve.miterLimit=dt===void 0?defaultMiterLimit:dt,ve.strokeStyle=asColorLike(Ye.getColor()||defaultStrokeStyle)}ae=this.textState_;const Ke=Z.getFont()||defaultFont;registerFont(Ke);const Xe=Z.getScaleArray();ae.overflow=Z.getOverflow(),ae.font=Ke,ae.maxAngle=Z.getMaxAngle(),ae.placement=Z.getPlacement(),ae.textAlign=Z.getTextAlign(),ae.repeat=Z.getRepeat(),ae.justify=Z.getJustify(),ae.textBaseline=Z.getTextBaseline()||defaultTextBaseline,ae.backgroundFill=Z.getBackgroundFill(),ae.backgroundStroke=Z.getBackgroundStroke(),ae.padding=Z.getPadding()||defaultPadding,ae.scale=Xe===void 0?[1,1]:Xe;const Je=Z.getOffsetX(),rt=Z.getOffsetY(),nt=Z.getRotateWithView(),it=Z.getRotation();this.text_=Z.getText()||"",this.textOffsetX_=Je===void 0?0:Je,this.textOffsetY_=rt===void 0?0:rt,this.textRotateWithView_=nt===void 0?!1:nt,this.textRotation_=it===void 0?0:it,this.strokeKey_=ve?(typeof ve.strokeStyle=="string"?ve.strokeStyle:getUid(ve.strokeStyle))+ve.lineCap+ve.lineDashOffset+"|"+ve.lineWidth+ve.lineJoin+ve.miterLimit+"["+ve.lineDash.join()+"]":"",this.textKey_=ae.font+ae.scale+(ae.textAlign||"?")+(ae.repeat||"?")+(ae.justify||"?")+(ae.textBaseline||"?"),this.fillKey_=ye?typeof ye.fillStyle=="string"?ye.fillStyle:"|"+getUid(ye.fillStyle):""}this.declutterImageWithText_=ee}}const BATCH_CONSTRUCTORS={Circle:PolygonBuilder,Default:CanvasBuilder,Image:ImageBuilder,LineString:LineStringBuilder,Polygon:PolygonBuilder,Text:CanvasTextBuilder};class BuilderGroup{constructor(Z,ee,ae,ye){this.tolerance_=Z,this.maxExtent_=ee,this.pixelRatio_=ye,this.resolution_=ae,this.buildersByZIndex_={}}finish(){const Z={};for(const ee in this.buildersByZIndex_){Z[ee]=Z[ee]||{};const ae=this.buildersByZIndex_[ee];for(const ye in ae){const ve=ae[ye].finish();Z[ee][ye]=ve}}return Z}getBuilder(Z,ee){const ae=Z!==void 0?Z.toString():"0";let ye=this.buildersByZIndex_[ae];ye===void 0&&(ye={},this.buildersByZIndex_[ae]=ye);let ve=ye[ee];if(ve===void 0){const be=BATCH_CONSTRUCTORS[ee];ve=new be(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),ye[ee]=ve}return ve}}class LayerRenderer extends Observable{constructor(Z){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=Z,this.declutterExecutorGroup=null}getFeatures(Z){return abstract()}getData(Z){return null}prepareFrame(Z){return abstract()}renderFrame(Z,ee){return abstract()}loadedTileCallback(Z,ee,ae){Z[ee]||(Z[ee]={}),Z[ee][ae.tileCoord.toString()]=ae}createLoadedTileFinder(Z,ee,ae){return(ye,ve)=>{const be=this.loadedTileCallback.bind(this,ae,ye);return Z.forEachLoadedTile(ee,ye,ve,be)}}forEachFeatureAtCoordinate(Z,ee,ae,ye,ve){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(Z){const ee=Z.target;(ee.getState()===ImageState.LOADED||ee.getState()===ImageState.ERROR)&&this.renderIfReadyAndVisible()}loadImage(Z){let ee=Z.getState();return ee!=ImageState.LOADED&&ee!=ImageState.ERROR&&Z.addEventListener(EventType.CHANGE,this.boundHandleImageChange_),ee==ImageState.IDLE&&(Z.load(),ee=Z.getState()),ee==ImageState.LOADED}renderIfReadyAndVisible(){const Z=this.getLayer();Z&&Z.getVisible()&&Z.getSourceState()==="ready"&&Z.changed()}disposeInternal(){delete this.layer_,super.disposeInternal()}}class RenderEvent extends BaseEvent{constructor(Z,ee,ae,ye){super(Z),this.inversePixelTransform=ee,this.frameState=ae,this.context=ye}}let pixelContext$1=null;function createPixelContext$1(){pixelContext$1=createCanvasContext2D(1,1,void 0,{willReadFrequently:!0})}class CanvasLayerRenderer extends LayerRenderer{constructor(Z){super(Z),this.container=null,this.renderedResolution,this.tempTransform=create$2(),this.pixelTransform=create$2(),this.inversePixelTransform=create$2(),this.context=null,this.containerReused=!1,this.pixelContext_=null,this.frameState=null}getImageData(Z,ee,ae){pixelContext$1||createPixelContext$1(),pixelContext$1.clearRect(0,0,1,1);let ye;try{pixelContext$1.drawImage(Z,ee,ae,1,1,0,0,1,1),ye=pixelContext$1.getImageData(0,0,1,1).data}catch{return pixelContext$1=null,null}return ye}getBackground(Z){let ee=this.getLayer().getBackground();return typeof ee=="function"&&(ee=ee(Z.viewState.resolution)),ee||void 0}useContainer(Z,ee,ae){const ye=this.getLayer().getClassName();let ve,be;if(Z&&Z.className===ye&&(!ae||Z&&Z.style.backgroundColor&&equals$2(asArray(Z.style.backgroundColor),asArray(ae)))){const Ye=Z.firstElementChild;Ye instanceof HTMLCanvasElement&&(be=Ye.getContext("2d"))}if(be&&be.canvas.style.transform===ee?(this.container=Z,this.context=be,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){ve=document.createElement("div"),ve.className=ye;let Ye=ve.style;Ye.position="absolute",Ye.width="100%",Ye.height="100%",be=createCanvasContext2D();const Ke=be.canvas;ve.appendChild(Ke),Ye=Ke.style,Ye.position="absolute",Ye.left="0",Ye.transformOrigin="top left",this.container=ve,this.context=be}!this.containerReused&&ae&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=ae)}clipUnrotated(Z,ee,ae){const ye=getTopLeft(ae),ve=getTopRight(ae),be=getBottomRight(ae),Ye=getBottomLeft(ae);apply(ee.coordinateToPixelTransform,ye),apply(ee.coordinateToPixelTransform,ve),apply(ee.coordinateToPixelTransform,be),apply(ee.coordinateToPixelTransform,Ye);const Ke=this.inversePixelTransform;apply(Ke,ye),apply(Ke,ve),apply(Ke,be),apply(Ke,Ye),Z.save(),Z.beginPath(),Z.moveTo(Math.round(ye[0]),Math.round(ye[1])),Z.lineTo(Math.round(ve[0]),Math.round(ve[1])),Z.lineTo(Math.round(be[0]),Math.round(be[1])),Z.lineTo(Math.round(Ye[0]),Math.round(Ye[1])),Z.clip()}dispatchRenderEvent_(Z,ee,ae){const ye=this.getLayer();if(ye.hasListener(Z)){const ve=new RenderEvent(Z,this.inversePixelTransform,ae,ee);ye.dispatchEvent(ve)}}preRender(Z,ee){this.frameState=ee,this.dispatchRenderEvent_(RenderEventType.PRERENDER,Z,ee)}postRender(Z,ee){this.dispatchRenderEvent_(RenderEventType.POSTRENDER,Z,ee)}getRenderTransform(Z,ee,ae,ye,ve,be,Ye){const Ke=ve/2,Xe=be/2,Je=ye/ee,rt=-Je,nt=-Z[0]+Ye,it=-Z[1];return compose$1(this.tempTransform,Ke,Xe,Je,rt,-ae,nt,it)}disposeInternal(){delete this.frameState,super.disposeInternal()}}function drawTextOnPath(ie,Z,ee,ae,ye,ve,be,Ye,Ke,Xe,Je,rt){let nt=ie[Z],it=ie[Z+1],lt=0,ct=0,ot=0,dt=0;function ft(){lt=nt,ct=it,Z+=ae,nt=ie[Z],it=ie[Z+1],dt+=ot,ot=Math.sqrt((nt-lt)*(nt-lt)+(it-ct)*(it-ct))}do ft();while(Zhi[2]}else ni=mt>ai;const li=Math.PI,ui=[],mi=Qr+ae===Z;Z=Qr,ot=0,dt=Xr,nt=ie[Z],it=ie[Z+1];let ii;if(mi){ft(),ii=Math.atan2(it-ct,nt-lt),ni&&(ii+=ii>0?-li:li);const hi=(ai+mt)/2,ri=(oi+Yr)/2;return ui[0]=[hi,ri,(Jr-ve)/2,ii,ye],ui}ye=ye.replace(/\n/g," ");for(let hi=0,ri=ye.length;hi0?-li:li),ii!==void 0){let Ci=ci-ii;if(Ci+=Ci>li?-2*li:Ci<-li?2*li:0,Math.abs(Ci)>be)return null}ii=ci;const Si=hi;let si=0;for(;hi0&&ie.push(` +`,""),ie.push(Z,""),ie}class Executor{constructor(Z,ee,ae,ye){this.overlaps=ae,this.pixelRatio=ee,this.resolution=Z,this.alignFill_,this.instructions=ye.instructions,this.coordinates=ye.coordinates,this.coordinateCache_={},this.renderedTransform_=create$2(),this.hitDetectionInstructions=ye.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=ye.fillStates||{},this.strokeStates=ye.strokeStates||{},this.textStates=ye.textStates||{},this.widths_={},this.labels_={}}createLabel(Z,ee,ae,ye){const ve=Z+ee+ae+ye;if(this.labels_[ve])return this.labels_[ve];const be=ye?this.strokeStates[ye]:null,Ye=ae?this.fillStates[ae]:null,Ke=this.textStates[ee],Xe=this.pixelRatio,Je=[Ke.scale[0]*Xe,Ke.scale[1]*Xe],rt=Array.isArray(Z),nt=Ke.justify?TEXT_ALIGN[Ke.justify]:horizontalTextAlign(Array.isArray(Z)?Z[0]:Z,Ke.textAlign||defaultTextAlign),it=ye&&be.lineWidth?be.lineWidth:0,lt=rt?Z:Z.split(` +`).reduce(createTextChunks,[]),{width:ct,height:ot,widths:dt,heights:ft,lineWidths:gt}=getTextDimensions(Ke,lt),mt=ct+it,Yr=[],Qr=(mt+2)*Je[0],Xr=(ot+it)*Je[1],Jr={width:Qr<0?Math.floor(Qr):Math.ceil(Qr),height:Xr<0?Math.floor(Xr):Math.ceil(Xr),contextInstructions:Yr};(Je[0]!=1||Je[1]!=1)&&Yr.push("scale",Je),ye&&(Yr.push("strokeStyle",be.strokeStyle),Yr.push("lineWidth",it),Yr.push("lineCap",be.lineCap),Yr.push("lineJoin",be.lineJoin),Yr.push("miterLimit",be.miterLimit),Yr.push("setLineDash",[be.lineDash]),Yr.push("lineDashOffset",be.lineDashOffset)),ae&&Yr.push("fillStyle",Ye.fillStyle),Yr.push("textBaseline","middle"),Yr.push("textAlign","center");const ai=.5-nt;let oi=nt*mt+ai*it;const ni=[],li=[];let ui=0,mi=0,ii=0,hi=0,ri;for(let ci=0,Si=lt.length;ciZ?Z-Xe:ve,mt=be+Je>ee?ee-Je:be,Yr=lt[3]+gt*nt[0]+lt[1],Qr=lt[0]+mt*nt[1]+lt[2],Xr=dt-lt[3],Jr=ft-lt[0];(ct||rt!==0)&&(p1[0]=Xr,p4[0]=Xr,p1[1]=Jr,p2[1]=Jr,p2[0]=Xr+Yr,p3[0]=p2[0],p3[1]=Jr+Qr,p4[1]=p3[1]);let ai;return rt!==0?(ai=compose$1(create$2(),ae,ye,1,1,rt,-ae,-ye),apply(ai,p1),apply(ai,p2),apply(ai,p3),apply(ai,p4),createOrUpdate$2(Math.min(p1[0],p2[0],p3[0],p4[0]),Math.min(p1[1],p2[1],p3[1],p4[1]),Math.max(p1[0],p2[0],p3[0],p4[0]),Math.max(p1[1],p2[1],p3[1],p4[1]),tmpExtent)):createOrUpdate$2(Math.min(Xr,Xr+Yr),Math.min(Jr,Jr+Qr),Math.max(Xr,Xr+Yr),Math.max(Jr,Jr+Qr),tmpExtent),it&&(dt=Math.round(dt),ft=Math.round(ft)),{drawImageX:dt,drawImageY:ft,drawImageW:gt,drawImageH:mt,originX:Xe,originY:Je,declutterBox:{minX:tmpExtent[0],minY:tmpExtent[1],maxX:tmpExtent[2],maxY:tmpExtent[3],value:ot},canvasTransform:ai,scale:nt}}replayImageOrLabel_(Z,ee,ae,ye,ve,be,Ye){const Ke=!!(be||Ye),Xe=ye.declutterBox,Je=Z.canvas,rt=Ye?Ye[2]*ye.scale[0]/2:0;return Xe.minX-rt<=Je.width/ee&&Xe.maxX+rt>=0&&Xe.minY-rt<=Je.height/ee&&Xe.maxY+rt>=0&&(Ke&&this.replayTextBackground_(Z,p1,p2,p3,p4,be,Ye),drawImageOrLabel(Z,ye.canvasTransform,ve,ae,ye.originX,ye.originY,ye.drawImageW,ye.drawImageH,ye.drawImageX,ye.drawImageY,ye.scale)),!0}fill_(Z){if(this.alignFill_){const ee=apply(this.renderedTransform_,[0,0]),ae=512*this.pixelRatio;Z.save(),Z.translate(ee[0]%ae,ee[1]%ae),Z.rotate(this.viewRotation_)}Z.fill(),this.alignFill_&&Z.restore()}setStrokeStyle_(Z,ee){Z.strokeStyle=ee[1],Z.lineWidth=ee[2],Z.lineCap=ee[3],Z.lineJoin=ee[4],Z.miterLimit=ee[5],Z.lineDashOffset=ee[7],Z.setLineDash(ee[6])}drawLabelWithPointPlacement_(Z,ee,ae,ye){const ve=this.textStates[ee],be=this.createLabel(Z,ee,ye,ae),Ye=this.strokeStates[ae],Ke=this.pixelRatio,Xe=horizontalTextAlign(Array.isArray(Z)?Z[0]:Z,ve.textAlign||defaultTextAlign),Je=TEXT_ALIGN[ve.textBaseline||defaultTextBaseline],rt=Ye&&Ye.lineWidth?Ye.lineWidth:0,nt=be.width/Ke-2*ve.scale[0],it=Xe*nt+2*(.5-Xe)*rt,lt=Je*be.height/Ke+2*(.5-Je)*rt;return{label:be,anchorX:it,anchorY:lt}}execute_(Z,ee,ae,ye,ve,be,Ye,Ke){let Xe;this.pixelCoordinates_&&equals$2(ae,this.renderedTransform_)?Xe=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),Xe=transform2D(this.coordinates,0,this.coordinates.length,2,ae,this.pixelCoordinates_),setFromArray(this.renderedTransform_,ae));let Je=0;const rt=ye.length;let nt=0,it,lt,ct,ot,dt,ft,gt,mt,Yr,Qr,Xr,Jr,ai=0,oi=0,ni=null,li=null;const ui=this.coordinateCache_,mi=this.viewRotation_,ii=Math.round(Math.atan2(-ae[1],ae[0])*1e12)/1e12,hi={context:Z,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:mi},ri=this.instructions!=ye||this.overlaps?0:200;let ci,Si,si,Ei;for(;Jeri&&(this.fill_(Z),ai=0),oi>ri&&(Z.stroke(),oi=0),!ai&&!oi&&(Z.beginPath(),ot=NaN,dt=NaN),++Je;break;case Instruction.CIRCLE:nt=yi[1];const Mi=Xe[nt],Ci=Xe[nt+1],Ri=Xe[nt+2],Ni=Xe[nt+3],Ai=Ri-Mi,ki=Ni-Ci,Yi=Math.sqrt(Ai*Ai+ki*ki);Z.moveTo(Mi+Yi,Ci),Z.arc(Mi,Ci,Yi,0,2*Math.PI,!0),++Je;break;case Instruction.CLOSE_PATH:Z.closePath(),++Je;break;case Instruction.CUSTOM:nt=yi[1],it=yi[2];const Ji=yi[3],ls=yi[4],hs=yi.length==6?yi[5]:void 0;hi.geometry=Ji,hi.feature=ci,Je in ui||(ui[Je]=[]);const Kr=ui[Je];hs?hs(Xe,nt,it,2,Kr):(Kr[0]=Xe[nt],Kr[1]=Xe[nt+1],Kr.length=2),ls(Kr,hi),++Je;break;case Instruction.DRAW_IMAGE:nt=yi[1],it=yi[2],mt=yi[3],lt=yi[4],ct=yi[5];let di=yi[6];const wi=yi[7],Ii=yi[8],Di=yi[9],is=yi[10];let Gi=yi[11];const us=yi[12];let Zi=yi[13];const ns=yi[14],Ki=yi[15];if(!mt&&yi.length>=20){Yr=yi[19],Qr=yi[20],Xr=yi[21],Jr=yi[22];const Qi=this.drawLabelWithPointPlacement_(Yr,Qr,Xr,Jr);mt=Qi.label,yi[3]=mt;const ss=yi[23];lt=(Qi.anchorX-ss)*this.pixelRatio,yi[4]=lt;const cs=yi[24];ct=(Qi.anchorY-cs)*this.pixelRatio,yi[5]=ct,di=mt.height,yi[6]=di,Zi=mt.width,yi[13]=Zi}let ds;yi.length>25&&(ds=yi[25]);let as,ms,vs;yi.length>17?(as=yi[16],ms=yi[17],vs=yi[18]):(as=defaultPadding,ms=!1,vs=!1),is&&ii?Gi+=mi:!is&&!ii&&(Gi-=mi);let zs=0;for(;nt0){if(!be||it!=="Image"&&it!=="Text"||be.includes(Yr)){const oi=(nt[Jr]-3)/4,ni=ye-oi%Ye,li=ye-(oi/Ye|0),ui=ve(Yr,Qr,ni*ni+li*li);if(ui)return ui}Je.clearRect(0,0,Ye,Ye);break}}const ct=Object.keys(this.executorsByZIndex_).map(Number);ct.sort(ascending);let ot,dt,ft,gt,mt;for(ot=ct.length-1;ot>=0;--ot){const Yr=ct[ot].toString();for(ft=this.executorsByZIndex_[Yr],dt=ORDER.length-1;dt>=0;--dt)if(it=ORDER[dt],gt=ft[it],gt!==void 0&&(mt=gt.executeHitDetection(Je,Ke,ae,lt,rt),mt))return mt}}getClipCoords(Z){const ee=this.maxExtent_;if(!ee)return null;const ae=ee[0],ye=ee[1],ve=ee[2],be=ee[3],Ye=[ae,ye,ae,be,ve,be,ve,ye];return transform2D(Ye,0,8,2,Z,Ye),Ye}isEmpty(){return isEmpty$1(this.executorsByZIndex_)}execute(Z,ee,ae,ye,ve,be,Ye){const Ke=Object.keys(this.executorsByZIndex_).map(Number);Ke.sort(ascending),this.maxExtent_&&(Z.save(),this.clip(Z,ae)),be=be||ORDER;let Xe,Je,rt,nt,it,lt;for(Ye&&Ke.reverse(),Xe=0,Je=Ke.length;Xeee)break;let Ke=ae[Ye];Ke||(Ke=[],ae[Ye]=Ke),Ke.push(((ie+ve)*Z+(ie+be))*4+3),ve>0&&Ke.push(((ie-ve)*Z+(ie+be))*4+3),be>0&&(Ke.push(((ie+ve)*Z+(ie-be))*4+3),ve>0&&Ke.push(((ie-ve)*Z+(ie-be))*4+3))}const ye=[];for(let ve=0,be=ae.length;vert*this.pixelRatio_),lineDashOffset:(be||defaultLineDashOffset)*this.pixelRatio_,lineJoin:Ye!==void 0?Ye:defaultLineJoin,lineWidth:(Ke!==void 0?Ke:defaultLineWidth)*this.pixelRatio_,miterLimit:Xe!==void 0?Xe:defaultMiterLimit,strokeStyle:asColorLike(ae||defaultStrokeStyle)}}}setImageStyle(Z){let ee;if(!Z||!(ee=Z.getSize())){this.image_=null;return}const ae=Z.getPixelRatio(this.pixelRatio_),ye=Z.getAnchor(),ve=Z.getOrigin();this.image_=Z.getImage(this.pixelRatio_),this.imageAnchorX_=ye[0]*ae,this.imageAnchorY_=ye[1]*ae,this.imageHeight_=ee[1]*ae,this.imageOpacity_=Z.getOpacity(),this.imageOriginX_=ve[0],this.imageOriginY_=ve[1],this.imageRotateWithView_=Z.getRotateWithView(),this.imageRotation_=Z.getRotation();const be=Z.getScaleArray();this.imageScale_=[be[0]*this.pixelRatio_/ae,be[1]*this.pixelRatio_/ae],this.imageWidth_=ee[0]*ae}setTextStyle(Z){if(!Z)this.text_="";else{const ee=Z.getFill();if(!ee)this.textFillState_=null;else{const it=ee.getColor();this.textFillState_={fillStyle:asColorLike(it||defaultFillStyle)}}const ae=Z.getStroke();if(!ae)this.textStrokeState_=null;else{const it=ae.getColor(),lt=ae.getLineCap(),ct=ae.getLineDash(),ot=ae.getLineDashOffset(),dt=ae.getLineJoin(),ft=ae.getWidth(),gt=ae.getMiterLimit();this.textStrokeState_={lineCap:lt!==void 0?lt:defaultLineCap,lineDash:ct||defaultLineDash,lineDashOffset:ot||defaultLineDashOffset,lineJoin:dt!==void 0?dt:defaultLineJoin,lineWidth:ft!==void 0?ft:defaultLineWidth,miterLimit:gt!==void 0?gt:defaultMiterLimit,strokeStyle:asColorLike(it||defaultStrokeStyle)}}const ye=Z.getFont(),ve=Z.getOffsetX(),be=Z.getOffsetY(),Ye=Z.getRotateWithView(),Ke=Z.getRotation(),Xe=Z.getScaleArray(),Je=Z.getText(),rt=Z.getTextAlign(),nt=Z.getTextBaseline();this.textState_={font:ye!==void 0?ye:defaultFont,textAlign:rt!==void 0?rt:defaultTextAlign,textBaseline:nt!==void 0?nt:defaultTextBaseline},this.text_=Je!==void 0?Array.isArray(Je)?Je.reduce((it,lt,ct)=>it+=ct%2?" ":lt,""):Je:"",this.textOffsetX_=ve!==void 0?this.pixelRatio_*ve:0,this.textOffsetY_=be!==void 0?this.pixelRatio_*be:0,this.textRotateWithView_=Ye!==void 0?Ye:!1,this.textRotation_=Ke!==void 0?Ke:0,this.textScale_=[this.pixelRatio_*Xe[0],this.pixelRatio_*Xe[1]]}}}const HIT_DETECT_RESOLUTION=.5;function createHitDetectionImageData(ie,Z,ee,ae,ye,ve,be){const Ye=ie[0]*HIT_DETECT_RESOLUTION,Ke=ie[1]*HIT_DETECT_RESOLUTION,Xe=createCanvasContext2D(Ye,Ke);Xe.imageSmoothingEnabled=!1;const Je=Xe.canvas,rt=new CanvasImmediateRenderer(Xe,HIT_DETECT_RESOLUTION,ye,null,be),nt=ee.length,it=Math.floor((256*256*256-1)/nt),lt={};for(let ot=1;ot<=nt;++ot){const dt=ee[ot-1],ft=dt.getStyleFunction()||ae;if(!ft)continue;let gt=ft(dt,ve);if(!gt)continue;Array.isArray(gt)||(gt=[gt]);const mt=(ot*it).toString(16).padStart(7,"#00000");for(let Yr=0,Qr=gt.length;Yr=200&&Ye.status<300){const Xe=Z.getType();let Je;Xe=="json"||Xe=="text"?Je=Ye.responseText:Xe=="xml"?(Je=Ye.responseXML,Je||(Je=new DOMParser().parseFromString(Ye.responseText,"application/xml"))):Xe=="arraybuffer"&&(Je=Ye.response),Je?ve(Z.readFeatures(Je,{extent:ee,featureProjection:ye}),Z.readProjection(Je)):be()}else be()},Ye.onerror=be,Ye.send()}const TileState={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class Tile extends Target{constructor(Z,ee,ae){super(),ae=ae||{},this.tileCoord=Z,this.state=ee,this.interimTile=null,this.key="",this.transition_=ae.transition===void 0?250:ae.transition,this.transitionStarts_={},this.interpolate=!!ae.interpolate}changed(){this.dispatchEvent(EventType.CHANGE)}release(){this.state===TileState.ERROR&&this.setState(TileState.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getInterimTile(){if(!this.interimTile)return this;let Z=this.interimTile;do{if(Z.getState()==TileState.LOADED)return this.transition_=0,Z;Z=Z.interimTile}while(Z);return this}refreshInterimChain(){if(!this.interimTile)return;let Z=this.interimTile,ee=this;do{if(Z.getState()==TileState.LOADED){Z.interimTile=null;break}else Z.getState()==TileState.LOADING?ee=Z:Z.getState()==TileState.IDLE?ee.interimTile=Z.interimTile:ee=Z;Z=ee.interimTile}while(Z)}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(Z){if(this.state!==TileState.ERROR&&this.state>Z)throw new Error("Tile load sequence violation");this.state=Z,this.changed()}load(){abstract()}getAlpha(Z,ee){if(!this.transition_)return 1;let ae=this.transitionStarts_[Z];if(!ae)ae=ee,this.transitionStarts_[Z]=ae;else if(ae===-1)return 1;const ye=ee-ae+1e3/60;return ye>=this.transition_?1:easeIn(ye/this.transition_)}inTransition(Z){return this.transition_?this.transitionStarts_[Z]!==-1:!1}endTransition(Z){this.transition_&&(this.transitionStarts_[Z]=-1)}}class ImageTile extends Tile{constructor(Z,ee,ae,ye,ve,be){super(Z,ee,be),this.crossOrigin_=ye,this.src_=ae,this.key=ae,this.image_=new Image,ye!==null&&(this.image_.crossOrigin=ye),this.unlisten_=null,this.tileLoadFunction_=ve}getImage(){return this.image_}setImage(Z){this.image_=Z,this.state=TileState.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=TileState.ERROR,this.unlistenImage_(),this.image_=getBlankImage(),this.changed()}handleImageLoad_(){const Z=this.image_;Z.naturalWidth&&Z.naturalHeight?this.state=TileState.LOADED:this.state=TileState.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==TileState.ERROR&&(this.state=TileState.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==TileState.IDLE&&(this.state=TileState.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=listenImage(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}function getBlankImage(){const ie=createCanvasContext2D(1,1);return ie.fillStyle="rgba(0,0,0,0)",ie.fillRect(0,0,1,1),ie.canvas}class Kinetic{constructor(Z,ee,ae){this.decay_=Z,this.minVelocity_=ee,this.delay_=ae,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(Z,ee){this.points_.push(Z,ee,Date.now())}end(){if(this.points_.length<6)return!1;const Z=Date.now()-this.delay_,ee=this.points_.length-3;if(this.points_[ee+2]0&&this.points_[ae+2]>Z;)ae-=3;const ye=this.points_[ee+2]-this.points_[ae+2];if(ye<1e3/60)return!1;const ve=this.points_[ee]-this.points_[ae],be=this.points_[ee+1]-this.points_[ae+1];return this.angle_=Math.atan2(be,ve),this.initialVelocity_=Math.sqrt(ve*ve+be*be)/ye,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}class MapRenderer extends Disposable{constructor(Z){super(),this.map_=Z}dispatchRenderEvent(Z,ee){abstract()}calculateMatrices2D(Z){const ee=Z.viewState,ae=Z.coordinateToPixelTransform,ye=Z.pixelToCoordinateTransform;compose$1(ae,Z.size[0]/2,Z.size[1]/2,1/ee.resolution,-1/ee.resolution,-ee.rotation,-ee.center[0],-ee.center[1]),makeInverse(ye,ae)}forEachFeatureAtCoordinate(Z,ee,ae,ye,ve,be,Ye,Ke){let Xe;const Je=ee.viewState;function rt(mt,Yr,Qr,Xr){return ve.call(be,Yr,mt?Qr:null,Xr)}const nt=Je.projection,it=wrapX$1(Z.slice(),nt),lt=[[0,0]];if(nt.canWrapX()&&ye){const mt=nt.getExtent(),Yr=getWidth(mt);lt.push([-Yr,0],[Yr,0])}const ct=ee.layerStatesArray,ot=ct.length,dt=[],ft=[];for(let mt=0;mt=0;--Yr){const Qr=ct[Yr],Xr=Qr.layer;if(Xr.hasRenderer()&&inView(Qr,Je)&&Ye.call(Ke,Xr)){const Jr=Xr.getRenderer(),ai=Xr.getSource();if(Jr&&ai){const oi=ai.getWrapX()?it:Z,ni=rt.bind(null,Qr.managed);ft[0]=oi[0]+lt[mt][0],ft[1]=oi[1]+lt[mt][1],Xe=Jr.forEachFeatureAtCoordinate(ft,ee,ae,ni,dt)}if(Xe)return Xe}}if(dt.length===0)return;const gt=1/dt.length;return dt.forEach((mt,Yr)=>mt.distanceSq+=Yr*gt),dt.sort((mt,Yr)=>mt.distanceSq-Yr.distanceSq),dt.some(mt=>Xe=mt.callback(mt.feature,mt.layer,mt.geometry)),Xe}hasFeatureAtCoordinate(Z,ee,ae,ye,ve,be){return this.forEachFeatureAtCoordinate(Z,ee,ae,ye,TRUE,this,ve,be)!==void 0}getMap(){return this.map_}renderFrame(Z){abstract()}flushDeclutterItems(Z){}scheduleExpireIconCache(Z){shared.canExpireCache()&&Z.postRenderFunctions.push(expireIconCache)}}function expireIconCache(ie,Z){shared.expire()}class CompositeMapRenderer extends MapRenderer{constructor(Z){super(Z),this.fontChangeListenerKey_=listen(checkedFonts,ObjectEventType.PROPERTYCHANGE,Z.redrawText.bind(Z)),this.element_=document.createElement("div");const ee=this.element_.style;ee.position="absolute",ee.width="100%",ee.height="100%",ee.zIndex="0",this.element_.className=CLASS_UNSELECTABLE+" ol-layers";const ae=Z.getViewport();ae.insertBefore(this.element_,ae.firstChild||null),this.children_=[],this.renderedVisible_=!0,this.declutterLayers_=[]}dispatchRenderEvent(Z,ee){const ae=this.getMap();if(ae.hasListener(Z)){const ye=new RenderEvent(Z,void 0,ee);ae.dispatchEvent(ye)}}disposeInternal(){unlistenByKey(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),super.disposeInternal()}renderFrame(Z){if(!Z){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(Z),this.dispatchRenderEvent(RenderEventType.PRECOMPOSE,Z);const ee=Z.layerStatesArray.sort(function(be,Ye){return be.zIndex-Ye.zIndex}),ae=Z.viewState;this.children_.length=0;const ye=this.declutterLayers_;ye.length=0;let ve=null;for(let be=0,Ye=ee.length;be=0;--ae)ee[ae].renderDeclutter(Z);ee.length=0}}class GroupEvent extends BaseEvent{constructor(Z,ee){super(Z),this.layer=ee}}const Property={LAYERS:"layers"};class LayerGroup extends BaseLayer{constructor(Z){Z=Z||{};const ee=Object.assign({},Z);delete ee.layers;let ae=Z.layers;super(ee),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(Property.LAYERS,this.handleLayersChanged_),ae?Array.isArray(ae)?ae=new Collection(ae.slice(),{unique:!0}):assert(typeof ae.getArray=="function","Expected `layers` to be an array or a `Collection`"):ae=new Collection(void 0,{unique:!0}),this.setLayers(ae)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(unlistenByKey),this.layersListenerKeys_.length=0;const Z=this.getLayers();this.layersListenerKeys_.push(listen(Z,CollectionEventType.ADD,this.handleLayersAdd_,this),listen(Z,CollectionEventType.REMOVE,this.handleLayersRemove_,this));for(const ae in this.listenerKeys_)this.listenerKeys_[ae].forEach(unlistenByKey);clear(this.listenerKeys_);const ee=Z.getArray();for(let ae=0,ye=ee.length;ae{this.clickTimeoutId_=void 0;const ae=new MapBrowserEvent(MapBrowserEventType.SINGLECLICK,this.map_,Z);this.dispatchEvent(ae)},250)}updateActivePointers_(Z){const ee=Z,ae=ee.pointerId;if(ee.type==MapBrowserEventType.POINTERUP||ee.type==MapBrowserEventType.POINTERCANCEL){delete this.trackedTouches_[ae];for(const ye in this.trackedTouches_)if(this.trackedTouches_[ye].target!==ee.target){delete this.trackedTouches_[ye];break}}else(ee.type==MapBrowserEventType.POINTERDOWN||ee.type==MapBrowserEventType.POINTERMOVE)&&(this.trackedTouches_[ae]=ee);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(Z){this.updateActivePointers_(Z);const ee=new MapBrowserEvent(MapBrowserEventType.POINTERUP,this.map_,Z,void 0,void 0,this.activePointers_);this.dispatchEvent(ee),this.emulateClicks_&&!ee.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(Z)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(unlistenByKey),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(Z){return Z.button===0}handlePointerDown_(Z){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(Z);const ee=new MapBrowserEvent(MapBrowserEventType.POINTERDOWN,this.map_,Z,void 0,void 0,this.activePointers_);if(this.dispatchEvent(ee),this.down_=new PointerEvent(Z.type,Z),Object.defineProperty(this.down_,"target",{writable:!1,value:Z.target}),this.dragListenerKeys_.length===0){const ae=this.map_.getOwnerDocument();this.dragListenerKeys_.push(listen(ae,MapBrowserEventType.POINTERMOVE,this.handlePointerMove_,this),listen(ae,MapBrowserEventType.POINTERUP,this.handlePointerUp_,this),listen(this.element_,MapBrowserEventType.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==ae&&this.dragListenerKeys_.push(listen(this.element_.getRootNode(),MapBrowserEventType.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(Z){if(this.isMoving_(Z)){this.updateActivePointers_(Z),this.dragging_=!0;const ee=new MapBrowserEvent(MapBrowserEventType.POINTERDRAG,this.map_,Z,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(ee)}}relayMoveEvent_(Z){this.originalPointerMoveEvent_=Z;const ee=!!(this.down_&&this.isMoving_(Z));this.dispatchEvent(new MapBrowserEvent(MapBrowserEventType.POINTERMOVE,this.map_,Z,ee))}handleTouchMove_(Z){const ee=this.originalPointerMoveEvent_;(!ee||ee.defaultPrevented)&&(typeof Z.cancelable!="boolean"||Z.cancelable===!0)&&Z.preventDefault()}isMoving_(Z){return this.dragging_||Math.abs(Z.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(Z.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(unlistenByKey(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(EventType.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(unlistenByKey(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(unlistenByKey),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const MapEventType={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},MapProperty={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},DROP=1/0;class PriorityQueue{constructor(Z,ee){this.priorityFunction_=Z,this.keyFunction_=ee,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,clear(this.queuedElements_)}dequeue(){const Z=this.elements_,ee=this.priorities_,ae=Z[0];Z.length==1?(Z.length=0,ee.length=0):(Z[0]=Z.pop(),ee[0]=ee.pop(),this.siftUp_(0));const ye=this.keyFunction_(ae);return delete this.queuedElements_[ye],ae}enqueue(Z){assert(!(this.keyFunction_(Z)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const ee=this.priorityFunction_(Z);return ee!=DROP?(this.elements_.push(Z),this.priorities_.push(ee),this.queuedElements_[this.keyFunction_(Z)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(Z){return Z*2+1}getRightChildIndex_(Z){return Z*2+2}getParentIndex_(Z){return Z-1>>1}heapify_(){let Z;for(Z=(this.elements_.length>>1)-1;Z>=0;Z--)this.siftUp_(Z)}isEmpty(){return this.elements_.length===0}isKeyQueued(Z){return Z in this.queuedElements_}isQueued(Z){return this.isKeyQueued(this.keyFunction_(Z))}siftUp_(Z){const ee=this.elements_,ae=this.priorities_,ye=ee.length,ve=ee[Z],be=ae[Z],Ye=Z;for(;Z>1;){const Ke=this.getLeftChildIndex_(Z),Xe=this.getRightChildIndex_(Z),Je=XeZ;){const Ye=this.getParentIndex_(ee);if(ye[Ye]>be)ae[ee]=ae[Ye],ye[ee]=ye[Ye],ee=Ye;else break}ae[ee]=ve,ye[ee]=be}reprioritize(){const Z=this.priorityFunction_,ee=this.elements_,ae=this.priorities_;let ye=0;const ve=ee.length;let be,Ye,Ke;for(Ye=0;Ye0;)ve=this.dequeue()[0],be=ve.getKey(),ye=ve.getState(),ye===TileState.IDLE&&!(be in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[be]=!0,++this.tilesLoading_,++ae,ve.load())}}function getTilePriority(ie,Z,ee,ae,ye){if(!ie||!(ee in ie.wantedTiles)||!ie.wantedTiles[ee][Z.getKey()])return DROP;const ve=ie.viewState.center,be=ae[0]-ve[0],Ye=ae[1]-ve[1];return 65536*Math.log(ye)+Math.sqrt(be*be+Ye*Ye)/ye}class Control extends BaseObject{constructor(Z){super();const ee=Z.element;ee&&!Z.target&&!ee.style.pointerEvents&&(ee.style.pointerEvents="auto"),this.element=ee||null,this.target_=null,this.map_=null,this.listenerKeys=[],Z.render&&(this.render=Z.render),Z.target&&this.setTarget(Z.target)}disposeInternal(){removeNode(this.element),super.disposeInternal()}getMap(){return this.map_}setMap(Z){this.map_&&removeNode(this.element);for(let ee=0,ae=this.listenerKeys.length;eeye.getAttributions(Z)))),ae=!this.getMap().getAllLayers().some(ye=>ye.getSource()&&ye.getSource().getAttributionsCollapsible()===!1);return this.overrideCollapsible_||this.setCollapsible(ae),ee}updateElement_(Z){if(!Z){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const ee=this.collectSourceAttributions_(Z),ae=ee.length>0;if(this.renderedVisible_!=ae&&(this.element.style.display=ae?"":"none",this.renderedVisible_=ae),!equals$2(ee,this.renderedAttributions_)){removeChildren(this.ulElement_);for(let ye=0,ve=ee.length;ye0&&ee%(2*Math.PI)!==0?Z.animate({rotation:0,duration:this.duration_,easing:easeOut}):Z.setRotation(0))}render(Z){const ee=Z.frameState;if(!ee)return;const ae=ee.viewState.rotation;if(ae!=this.rotation_){const ye="rotate("+ae+"rad)";if(this.autoHide_){const ve=this.element.classList.contains(CLASS_HIDDEN);!ve&&ae===0?this.element.classList.add(CLASS_HIDDEN):ve&&ae!==0&&this.element.classList.remove(CLASS_HIDDEN)}this.label_.style.transform=ye}this.rotation_=ae}}const Rotate$1=Rotate;class Zoom extends Control{constructor(Z){Z=Z||{},super({element:document.createElement("div"),target:Z.target});const ee=Z.className!==void 0?Z.className:"ol-zoom",ae=Z.delta!==void 0?Z.delta:1,ye=Z.zoomInClassName!==void 0?Z.zoomInClassName:ee+"-in",ve=Z.zoomOutClassName!==void 0?Z.zoomOutClassName:ee+"-out",be=Z.zoomInLabel!==void 0?Z.zoomInLabel:"+",Ye=Z.zoomOutLabel!==void 0?Z.zoomOutLabel:"–",Ke=Z.zoomInTipLabel!==void 0?Z.zoomInTipLabel:"Zoom in",Xe=Z.zoomOutTipLabel!==void 0?Z.zoomOutTipLabel:"Zoom out",Je=document.createElement("button");Je.className=ye,Je.setAttribute("type","button"),Je.title=Ke,Je.appendChild(typeof be=="string"?document.createTextNode(be):be),Je.addEventListener(EventType.CLICK,this.handleClick_.bind(this,ae),!1);const rt=document.createElement("button");rt.className=ve,rt.setAttribute("type","button"),rt.title=Xe,rt.appendChild(typeof Ye=="string"?document.createTextNode(Ye):Ye),rt.addEventListener(EventType.CLICK,this.handleClick_.bind(this,-ae),!1);const nt=ee+" "+CLASS_UNSELECTABLE+" "+CLASS_CONTROL,it=this.element;it.className=nt,it.appendChild(Je),it.appendChild(rt),this.duration_=Z.duration!==void 0?Z.duration:250}handleClick_(Z,ee){ee.preventDefault(),this.zoomByDelta_(Z)}zoomByDelta_(Z){const ee=this.getMap().getView();if(!ee)return;const ae=ee.getZoom();if(ae!==void 0){const ye=ee.getConstrainedZoom(ae+Z);this.duration_>0?(ee.getAnimating()&&ee.cancelAnimations(),ee.animate({zoom:ye,duration:this.duration_,easing:easeOut})):ee.setZoom(ye)}}}const Zoom$1=Zoom;function defaults$2(ie){ie=ie||{};const Z=new Collection;return(ie.zoom===void 0||ie.zoom)&&Z.push(new Zoom$1(ie.zoomOptions)),(ie.rotate===void 0||ie.rotate)&&Z.push(new Rotate$1(ie.rotateOptions)),(ie.attribution===void 0||ie.attribution)&&Z.push(new Attribution$1(ie.attributionOptions)),Z}const InteractionProperty={ACTIVE:"active"};class Interaction extends BaseObject{constructor(Z){super(),this.on,this.once,this.un,Z&&Z.handleEvent&&(this.handleEvent=Z.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(InteractionProperty.ACTIVE)}getMap(){return this.map_}handleEvent(Z){return!0}setActive(Z){this.set(InteractionProperty.ACTIVE,Z)}setMap(Z){this.map_=Z}}function pan(ie,Z,ee){const ae=ie.getCenterInternal();if(ae){const ye=[ae[0]+Z[0],ae[1]+Z[1]];ie.animateInternal({duration:ee!==void 0?ee:250,easing:linear,center:ie.getConstrainedCenter(ye)})}}function zoomByDelta(ie,Z,ee,ae){const ye=ie.getZoom();if(ye===void 0)return;const ve=ie.getConstrainedZoom(ye+Z),be=ie.getResolutionForZoom(ve);ie.getAnimating()&&ie.cancelAnimations(),ie.animate({resolution:be,anchor:ee,duration:ae!==void 0?ae:250,easing:easeOut})}class DoubleClickZoom extends Interaction{constructor(Z){super(),Z=Z||{},this.delta_=Z.delta?Z.delta:1,this.duration_=Z.duration!==void 0?Z.duration:250}handleEvent(Z){let ee=!1;if(Z.type==MapBrowserEventType.DBLCLICK){const ae=Z.originalEvent,ye=Z.map,ve=Z.coordinate,be=ae.shiftKey?-this.delta_:this.delta_,Ye=ye.getView();zoomByDelta(Ye,be,ve,this.duration_),ae.preventDefault(),ee=!0}return!ee}}const DoubleClickZoom$1=DoubleClickZoom;class PointerInteraction extends Interaction{constructor(Z){Z=Z||{},super(Z),Z.handleDownEvent&&(this.handleDownEvent=Z.handleDownEvent),Z.handleDragEvent&&(this.handleDragEvent=Z.handleDragEvent),Z.handleMoveEvent&&(this.handleMoveEvent=Z.handleMoveEvent),Z.handleUpEvent&&(this.handleUpEvent=Z.handleUpEvent),Z.stopDown&&(this.stopDown=Z.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(Z){return!1}handleDragEvent(Z){}handleEvent(Z){if(!Z.originalEvent)return!0;let ee=!1;if(this.updateTrackedPointers_(Z),this.handlingDownUpSequence){if(Z.type==MapBrowserEventType.POINTERDRAG)this.handleDragEvent(Z),Z.originalEvent.preventDefault();else if(Z.type==MapBrowserEventType.POINTERUP){const ae=this.handleUpEvent(Z);this.handlingDownUpSequence=ae&&this.targetPointers.length>0}}else if(Z.type==MapBrowserEventType.POINTERDOWN){const ae=this.handleDownEvent(Z);this.handlingDownUpSequence=ae,ee=this.stopDown(ae)}else Z.type==MapBrowserEventType.POINTERMOVE&&this.handleMoveEvent(Z);return!ee}handleMoveEvent(Z){}handleUpEvent(Z){return!1}stopDown(Z){return Z}updateTrackedPointers_(Z){Z.activePointers&&(this.targetPointers=Z.activePointers)}}function centroid(ie){const Z=ie.length;let ee=0,ae=0;for(let ye=0;ye0&&this.condition_(Z)){const ee=Z.map.getView();return this.lastCentroid=null,ee.getAnimating()&&ee.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}const DragPan$1=DragPan;class DragRotate extends PointerInteraction{constructor(Z){Z=Z||{},super({stopDown:FALSE}),this.condition_=Z.condition?Z.condition:altShiftKeysOnly,this.lastAngle_=void 0,this.duration_=Z.duration!==void 0?Z.duration:250}handleDragEvent(Z){if(!mouseOnly(Z))return;const ee=Z.map,ae=ee.getView();if(ae.getConstraints().rotation===disable)return;const ye=ee.getSize(),ve=Z.pixel,be=Math.atan2(ye[1]/2-ve[1],ve[0]-ye[0]/2);if(this.lastAngle_!==void 0){const Ye=be-this.lastAngle_;ae.adjustRotationInternal(-Ye)}this.lastAngle_=be}handleUpEvent(Z){return mouseOnly(Z)?(Z.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(Z){return mouseOnly(Z)&&mouseActionButton(Z)&&this.condition_(Z)?(Z.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}class RenderBox extends Disposable{constructor(Z){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+Z,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const Z=this.startPixel_,ee=this.endPixel_,ae="px",ye=this.element_.style;ye.left=Math.min(Z[0],ee[0])+ae,ye.top=Math.min(Z[1],ee[1])+ae,ye.width=Math.abs(ee[0]-Z[0])+ae,ye.height=Math.abs(ee[1]-Z[1])+ae}setMap(Z){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const ee=this.element_.style;ee.left="inherit",ee.top="inherit",ee.width="inherit",ee.height="inherit"}this.map_=Z,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(Z,ee){this.startPixel_=Z,this.endPixel_=ee,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){const Z=this.startPixel_,ee=this.endPixel_,ae=[Z,[Z[0],ee[1]],ee,[ee[0],Z[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);ae[4]=ae[0].slice(),this.geometry_?this.geometry_.setCoordinates([ae]):this.geometry_=new Polygon$1([ae])}getGeometry(){return this.geometry_}}const DragBoxEventType={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class DragBoxEvent extends BaseEvent{constructor(Z,ee,ae){super(Z),this.coordinate=ee,this.mapBrowserEvent=ae}}class DragBox extends PointerInteraction{constructor(Z){super(),this.on,this.once,this.un,Z=Z||{},this.box_=new RenderBox(Z.className||"ol-dragbox"),this.minArea_=Z.minArea!==void 0?Z.minArea:64,Z.onBoxEnd&&(this.onBoxEnd=Z.onBoxEnd),this.startPixel_=null,this.condition_=Z.condition?Z.condition:mouseActionButton,this.boxEndCondition_=Z.boxEndCondition?Z.boxEndCondition:this.defaultBoxEndCondition}defaultBoxEndCondition(Z,ee,ae){const ye=ae[0]-ee[0],ve=ae[1]-ee[1];return ye*ye+ve*ve>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(Z){this.box_.setPixels(this.startPixel_,Z.pixel),this.dispatchEvent(new DragBoxEvent(DragBoxEventType.BOXDRAG,Z.coordinate,Z))}handleUpEvent(Z){this.box_.setMap(null);const ee=this.boxEndCondition_(Z,this.startPixel_,Z.pixel);return ee&&this.onBoxEnd(Z),this.dispatchEvent(new DragBoxEvent(ee?DragBoxEventType.BOXEND:DragBoxEventType.BOXCANCEL,Z.coordinate,Z)),!1}handleDownEvent(Z){return this.condition_(Z)?(this.startPixel_=Z.pixel,this.box_.setMap(Z.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new DragBoxEvent(DragBoxEventType.BOXSTART,Z.coordinate,Z)),!0):!1}onBoxEnd(Z){}}class DragZoom extends DragBox{constructor(Z){Z=Z||{};const ee=Z.condition?Z.condition:shiftKeyOnly;super({condition:ee,className:Z.className||"ol-dragzoom",minArea:Z.minArea}),this.duration_=Z.duration!==void 0?Z.duration:200,this.out_=Z.out!==void 0?Z.out:!1}onBoxEnd(Z){const ee=this.getMap().getView();let ae=this.getGeometry();if(this.out_){const ye=ee.rotatedExtentForGeometry(ae),ve=ee.getResolutionForExtentInternal(ye),be=ee.getResolution()/ve;ae=ae.clone(),ae.scale(be*be)}ee.fitInternal(ae,{duration:this.duration_,easing:easeOut})}}const DragZoom$1=DragZoom,Key={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class KeyboardPan extends Interaction{constructor(Z){super(),Z=Z||{},this.defaultCondition_=function(ee){return noModifierKeys(ee)&&targetNotEditable(ee)},this.condition_=Z.condition!==void 0?Z.condition:this.defaultCondition_,this.duration_=Z.duration!==void 0?Z.duration:100,this.pixelDelta_=Z.pixelDelta!==void 0?Z.pixelDelta:128}handleEvent(Z){let ee=!1;if(Z.type==EventType.KEYDOWN){const ae=Z.originalEvent,ye=ae.key;if(this.condition_(Z)&&(ye==Key.DOWN||ye==Key.LEFT||ye==Key.RIGHT||ye==Key.UP)){const ve=Z.map.getView(),be=ve.getResolution()*this.pixelDelta_;let Ye=0,Ke=0;ye==Key.DOWN?Ke=-be:ye==Key.LEFT?Ye=-be:ye==Key.RIGHT?Ye=be:Ke=be;const Xe=[Ye,Ke];rotate$2(Xe,ve.getRotation()),pan(ve,Xe,this.duration_),ae.preventDefault(),ee=!0}}return!ee}}class KeyboardZoom extends Interaction{constructor(Z){super(),Z=Z||{},this.condition_=Z.condition?Z.condition:function(ee){return!platformModifierKey(ee)&&targetNotEditable(ee)},this.delta_=Z.delta?Z.delta:1,this.duration_=Z.duration!==void 0?Z.duration:100}handleEvent(Z){let ee=!1;if(Z.type==EventType.KEYDOWN||Z.type==EventType.KEYPRESS){const ae=Z.originalEvent,ye=ae.key;if(this.condition_(Z)&&(ye==="+"||ye==="-")){const ve=Z.map,be=ye==="+"?this.delta_:-this.delta_,Ye=ve.getView();zoomByDelta(Ye,be,void 0,this.duration_),ae.preventDefault(),ee=!0}}return!ee}}const KeyboardZoom$1=KeyboardZoom;class MouseWheelZoom extends Interaction{constructor(Z){Z=Z||{},super(Z),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=Z.maxDelta!==void 0?Z.maxDelta:1,this.duration_=Z.duration!==void 0?Z.duration:250,this.timeout_=Z.timeout!==void 0?Z.timeout:80,this.useAnchor_=Z.useAnchor!==void 0?Z.useAnchor:!0,this.constrainResolution_=Z.constrainResolution!==void 0?Z.constrainResolution:!1;const ee=Z.condition?Z.condition:always;this.condition_=Z.onFocusOnly?all(focusWithTabindex,ee):ee,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;const Z=this.getMap();Z&&Z.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}handleEvent(Z){if(!this.condition_(Z)||Z.type!==EventType.WHEEL)return!0;const ee=Z.map,ae=Z.originalEvent;ae.preventDefault(),this.useAnchor_&&(this.lastAnchor_=Z.coordinate);let ye;if(Z.type==EventType.WHEEL&&(ye=ae.deltaY,FIREFOX&&ae.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(ye/=DEVICE_PIXEL_RATIO),ae.deltaMode===WheelEvent.DOM_DELTA_LINE&&(ye*=40)),ye===0)return!1;this.lastDelta_=ye;const ve=Date.now();this.startTime_===void 0&&(this.startTime_=ve),(!this.mode_||ve-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(ye)<4?"trackpad":"wheel");const be=ee.getView();if(this.mode_==="trackpad"&&!(be.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(be.getAnimating()&&be.cancelAnimations(),be.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),be.adjustZoom(-ye/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=ve,!1;this.totalDelta_+=ye;const Ye=Math.max(this.timeout_-(ve-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,ee),Ye),!1}handleWheelZoom_(Z){const ee=Z.getView();ee.getAnimating()&&ee.cancelAnimations();let ae=-clamp$1(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(ee.getConstrainResolution()||this.constrainResolution_)&&(ae=ae?ae>0?1:-1:0),zoomByDelta(ee,ae,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(Z){this.useAnchor_=Z,Z||(this.lastAnchor_=null)}}const MouseWheelZoom$1=MouseWheelZoom;class PinchRotate extends PointerInteraction{constructor(Z){Z=Z||{};const ee=Z;ee.stopDown||(ee.stopDown=FALSE),super(ee),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=Z.threshold!==void 0?Z.threshold:.3,this.duration_=Z.duration!==void 0?Z.duration:250}handleDragEvent(Z){let ee=0;const ae=this.targetPointers[0],ye=this.targetPointers[1],ve=Math.atan2(ye.clientY-ae.clientY,ye.clientX-ae.clientX);if(this.lastAngle_!==void 0){const Ke=ve-this.lastAngle_;this.rotationDelta_+=Ke,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),ee=Ke}this.lastAngle_=ve;const be=Z.map,Ye=be.getView();Ye.getConstraints().rotation!==disable&&(this.anchor_=be.getCoordinateFromPixelInternal(be.getEventPixel(centroid(this.targetPointers))),this.rotating_&&(be.render(),Ye.adjustRotationInternal(ee,this.anchor_)))}handleUpEvent(Z){return this.targetPointers.length<2?(Z.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(Z){if(this.targetPointers.length>=2){const ee=Z.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||ee.getView().beginInteraction(),!0}return!1}}class PinchZoom extends PointerInteraction{constructor(Z){Z=Z||{};const ee=Z;ee.stopDown||(ee.stopDown=FALSE),super(ee),this.anchor_=null,this.duration_=Z.duration!==void 0?Z.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(Z){let ee=1;const ae=this.targetPointers[0],ye=this.targetPointers[1],ve=ae.clientX-ye.clientX,be=ae.clientY-ye.clientY,Ye=Math.sqrt(ve*ve+be*be);this.lastDistance_!==void 0&&(ee=this.lastDistance_/Ye),this.lastDistance_=Ye;const Ke=Z.map,Xe=Ke.getView();ee!=1&&(this.lastScaleDelta_=ee),this.anchor_=Ke.getCoordinateFromPixelInternal(Ke.getEventPixel(centroid(this.targetPointers))),Ke.render(),Xe.adjustResolutionInternal(ee,this.anchor_)}handleUpEvent(Z){if(this.targetPointers.length<2){const ee=Z.map.getView(),ae=this.lastScaleDelta_>1?1:-1;return ee.endInteraction(this.duration_,ae),!1}return!0}handleDownEvent(Z){if(this.targetPointers.length>=2){const ee=Z.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||ee.getView().beginInteraction(),!0}return!1}}const PinchZoom$1=PinchZoom;function defaults$1(ie){ie=ie||{};const Z=new Collection,ee=new Kinetic(-.005,.05,100);return(ie.altShiftDragRotate===void 0||ie.altShiftDragRotate)&&Z.push(new DragRotate),(ie.doubleClickZoom===void 0||ie.doubleClickZoom)&&Z.push(new DoubleClickZoom$1({delta:ie.zoomDelta,duration:ie.zoomDuration})),(ie.dragPan===void 0||ie.dragPan)&&Z.push(new DragPan$1({onFocusOnly:ie.onFocusOnly,kinetic:ee})),(ie.pinchRotate===void 0||ie.pinchRotate)&&Z.push(new PinchRotate),(ie.pinchZoom===void 0||ie.pinchZoom)&&Z.push(new PinchZoom$1({duration:ie.zoomDuration})),(ie.keyboard===void 0||ie.keyboard)&&(Z.push(new KeyboardPan),Z.push(new KeyboardZoom$1({delta:ie.zoomDelta,duration:ie.zoomDuration}))),(ie.mouseWheelZoom===void 0||ie.mouseWheelZoom)&&Z.push(new MouseWheelZoom$1({onFocusOnly:ie.onFocusOnly,duration:ie.zoomDuration})),(ie.shiftDragZoom===void 0||ie.shiftDragZoom)&&Z.push(new DragZoom$1({duration:ie.zoomDuration})),Z}function removeLayerMapProperty(ie){if(ie instanceof Layer){ie.setMapInternal(null);return}ie instanceof LayerGroup&&ie.getLayers().forEach(removeLayerMapProperty)}function setLayerMapProperty(ie,Z){if(ie instanceof Layer){ie.setMapInternal(Z);return}if(ie instanceof LayerGroup){const ee=ie.getLayers().getArray();for(let ae=0,ye=ee.length;aethis.updateSize()),this.controls=Z.controls||defaults$2(),this.interactions=Z.interactions||defaults$1({onFocusOnly:!0}),this.overlays_=Z.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new TileQueue(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(MapProperty.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(MapProperty.VIEW,this.handleViewChanged_),this.addChangeListener(MapProperty.SIZE,this.handleSizeChanged_),this.addChangeListener(MapProperty.TARGET,this.handleTargetChanged_),this.setProperties(Z.values);const ee=this;ie.view&&!(ie.view instanceof View)&&ie.view.then(function(ae){ee.setView(new View(ae))}),this.controls.addEventListener(CollectionEventType.ADD,ae=>{ae.element.setMap(this)}),this.controls.addEventListener(CollectionEventType.REMOVE,ae=>{ae.element.setMap(null)}),this.interactions.addEventListener(CollectionEventType.ADD,ae=>{ae.element.setMap(this)}),this.interactions.addEventListener(CollectionEventType.REMOVE,ae=>{ae.element.setMap(null)}),this.overlays_.addEventListener(CollectionEventType.ADD,ae=>{this.addOverlayInternal_(ae.element)}),this.overlays_.addEventListener(CollectionEventType.REMOVE,ae=>{const ye=ae.element.getId();ye!==void 0&&delete this.overlayIdIndex_[ye.toString()],ae.element.setMap(null)}),this.controls.forEach(ae=>{ae.setMap(this)}),this.interactions.forEach(ae=>{ae.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(ie){this.getControls().push(ie)}addInteraction(ie){this.getInteractions().push(ie)}addLayer(ie){this.getLayerGroup().getLayers().push(ie)}handleLayerAdd_(ie){setLayerMapProperty(ie.layer,this)}addOverlay(ie){this.getOverlays().push(ie)}addOverlayInternal_(ie){const Z=ie.getId();Z!==void 0&&(this.overlayIdIndex_[Z.toString()]=ie),ie.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(ie,Z,ee){if(!this.frameState_||!this.renderer_)return;const ae=this.getCoordinateFromPixelInternal(ie);ee=ee!==void 0?ee:{};const ye=ee.hitTolerance!==void 0?ee.hitTolerance:0,ve=ee.layerFilter!==void 0?ee.layerFilter:TRUE,be=ee.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(ae,this.frameState_,ye,be,Z,null,ve,null)}getFeaturesAtPixel(ie,Z){const ee=[];return this.forEachFeatureAtPixel(ie,function(ae){ee.push(ae)},Z),ee}getAllLayers(){const ie=[];function Z(ee){ee.forEach(function(ae){ae instanceof LayerGroup?Z(ae.getLayers()):ie.push(ae)})}return Z(this.getLayers()),ie}hasFeatureAtPixel(ie,Z){if(!this.frameState_||!this.renderer_)return!1;const ee=this.getCoordinateFromPixelInternal(ie);Z=Z!==void 0?Z:{};const ae=Z.layerFilter!==void 0?Z.layerFilter:TRUE,ye=Z.hitTolerance!==void 0?Z.hitTolerance:0,ve=Z.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(ee,this.frameState_,ye,ve,ae,null)}getEventCoordinate(ie){return this.getCoordinateFromPixel(this.getEventPixel(ie))}getEventCoordinateInternal(ie){return this.getCoordinateFromPixelInternal(this.getEventPixel(ie))}getEventPixel(ie){const Z=this.viewport_.getBoundingClientRect(),ee=this.getSize(),ae=Z.width/ee[0],ye=Z.height/ee[1],ve="changedTouches"in ie?ie.changedTouches[0]:ie;return[(ve.clientX-Z.left)/ae,(ve.clientY-Z.top)/ye]}getTarget(){return this.get(MapProperty.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(ie){return toUserCoordinate(this.getCoordinateFromPixelInternal(ie),this.getView().getProjection())}getCoordinateFromPixelInternal(ie){const Z=this.frameState_;return Z?apply(Z.pixelToCoordinateTransform,ie.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(ie){const Z=this.overlayIdIndex_[ie.toString()];return Z!==void 0?Z:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(MapProperty.LAYERGROUP)}setLayers(ie){const Z=this.getLayerGroup();if(ie instanceof Collection){Z.setLayers(ie);return}const ee=Z.getLayers();ee.clear(),ee.extend(ie)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const ie=this.getLayerGroup().getLayerStatesArray();for(let Z=0,ee=ie.length;Z=0;ye--){const ve=ae[ye];if(!(ve.getMap()!==this||!ve.getActive()||!this.getTargetElement())&&(!ve.handleEvent(ie)||ie.propagationStopped))break}}}handlePostRender(){const ie=this.frameState_,Z=this.tileQueue_;if(!Z.isEmpty()){let ae=this.maxTilesLoading_,ye=ae;if(ie){const ve=ie.viewHints;if(ve[ViewHint.ANIMATING]||ve[ViewHint.INTERACTING]){const be=Date.now()-ie.time>8;ae=be?0:8,ye=be?0:2}}Z.getTilesLoading(){this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(ie){const Z=this.getLayerGroup();Z&&this.handleLayerRemove_(new GroupEvent("removelayer",Z)),this.set(MapProperty.LAYERGROUP,ie)}setSize(ie){this.set(MapProperty.SIZE,ie)}setTarget(ie){this.set(MapProperty.TARGET,ie)}setView(ie){if(!ie||ie instanceof View){this.set(MapProperty.VIEW,ie);return}this.set(MapProperty.VIEW,new View);const Z=this;ie.then(function(ee){Z.setView(new View(ee))})}updateSize(){const ie=this.getTargetElement();let Z;if(ie){const ae=getComputedStyle(ie),ye=ie.offsetWidth-parseFloat(ae.borderLeftWidth)-parseFloat(ae.paddingLeft)-parseFloat(ae.paddingRight)-parseFloat(ae.borderRightWidth),ve=ie.offsetHeight-parseFloat(ae.borderTopWidth)-parseFloat(ae.paddingTop)-parseFloat(ae.paddingBottom)-parseFloat(ae.borderBottomWidth);!isNaN(ye)&&!isNaN(ve)&&(Z=[ye,ve],!hasArea(Z)&&(ie.offsetWidth||ie.offsetHeight||ie.getClientRects().length)&&warn("No map visible because the map container's width or height are 0."))}const ee=this.getSize();Z&&(!ee||!equals$2(Z,ee))&&(this.setSize(Z),this.updateViewportSize_())}updateViewportSize_(){const ie=this.getView();if(ie){let Z;const ee=getComputedStyle(this.viewport_);ee.width&&ee.height&&(Z=[parseInt(ee.width,10),parseInt(ee.height,10)]),ie.setViewportSize(Z)}}};function createOptionsInternal(ie){let Z=null;ie.keyboardEventTarget!==void 0&&(Z=typeof ie.keyboardEventTarget=="string"?document.getElementById(ie.keyboardEventTarget):ie.keyboardEventTarget);const ee={},ae=ie.layers&&typeof ie.layers.getLayers=="function"?ie.layers:new LayerGroup({layers:ie.layers});ee[MapProperty.LAYERGROUP]=ae,ee[MapProperty.TARGET]=ie.target,ee[MapProperty.VIEW]=ie.view instanceof View?ie.view:new View;let ye;ie.controls!==void 0&&(Array.isArray(ie.controls)?ye=new Collection(ie.controls.slice()):(assert(typeof ie.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),ye=ie.controls));let ve;ie.interactions!==void 0&&(Array.isArray(ie.interactions)?ve=new Collection(ie.interactions.slice()):(assert(typeof ie.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),ve=ie.interactions));let be;return ie.overlays!==void 0?Array.isArray(ie.overlays)?be=new Collection(ie.overlays.slice()):(assert(typeof ie.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),be=ie.overlays):be=new Collection,{controls:ye,interactions:ve,keyboardEventTarget:Z,overlays:be,values:ee}}class LRUCache{constructor(Z){this.highWaterMark=Z!==void 0?Z:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(Z){for(;this.canExpireCache();)this.pop()}clear(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}containsKey(Z){return this.entries_.hasOwnProperty(Z)}forEach(Z){let ee=this.oldest_;for(;ee;)Z(ee.value_,ee.key_,this),ee=ee.newer}get(Z,ee){const ae=this.entries_[Z];return assert(ae!==void 0,"Tried to get a value for a key that does not exist in the cache"),ae===this.newest_||(ae===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(ae.newer.older=ae.older,ae.older.newer=ae.newer),ae.newer=null,ae.older=this.newest_,this.newest_.newer=ae,this.newest_=ae),ae.value_}remove(Z){const ee=this.entries_[Z];return assert(ee!==void 0,"Tried to get a value for a key that does not exist in the cache"),ee===this.newest_?(this.newest_=ee.older,this.newest_&&(this.newest_.newer=null)):ee===this.oldest_?(this.oldest_=ee.newer,this.oldest_&&(this.oldest_.older=null)):(ee.newer.older=ee.older,ee.older.newer=ee.newer),delete this.entries_[Z],--this.count_,ee.value_}getCount(){return this.count_}getKeys(){const Z=new Array(this.count_);let ee=0,ae;for(ae=this.newest_;ae;ae=ae.older)Z[ee++]=ae.key_;return Z}getValues(){const Z=new Array(this.count_);let ee=0,ae;for(ae=this.newest_;ae;ae=ae.older)Z[ee++]=ae.value_;return Z}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(Z){if(this.containsKey(Z))return this.entries_[Z].value_}pop(){const Z=this.oldest_;return delete this.entries_[Z.key_],Z.newer&&(Z.newer.older=null),this.oldest_=Z.newer,this.oldest_||(this.newest_=null),--this.count_,Z.value_}replace(Z,ee){this.get(Z),this.entries_[Z].value_=ee}set(Z,ee){assert(!(Z in this.entries_),"Tried to set a value for a key that is used already");const ae={key_:Z,newer:null,older:this.newest_,value_:ee};this.newest_?this.newest_.newer=ae:this.oldest_=ae,this.newest_=ae,this.entries_[Z]=ae,++this.count_}setSize(Z){this.highWaterMark=Z}}function createOrUpdate$1(ie,Z,ee,ae){return ae!==void 0?(ae[0]=ie,ae[1]=Z,ae[2]=ee,ae):[ie,Z,ee]}function getKeyZXY(ie,Z,ee){return ie+"/"+Z+"/"+ee}function getKey(ie){return getKeyZXY(ie[0],ie[1],ie[2])}function getCacheKeyForTileKey(ie){const[Z,ee,ae]=ie.substring(ie.lastIndexOf("/")+1,ie.length).split(",").map(Number);return getKeyZXY(Z,ee,ae)}function fromKey(ie){return ie.split("/").map(Number)}function hash$2(ie){return(ie[1]<ee||ee>Z.getMaxZoom())return!1;const ve=Z.getFullTileRange(ee);return ve?ve.containsXY(ae,ye):!0}class TileCache extends LRUCache{clear(){for(;this.getCount()>0;)this.pop().release();super.clear()}expireCache(Z){for(;this.canExpireCache()&&!(this.peekLast().getKey()in Z);)this.pop().release()}pruneExceptNewestZ(){if(this.getCount()===0)return;const Z=this.peekFirstKey(),ee=fromKey(Z)[0];this.forEach(ae=>{ae.tileCoord[0]!==ee&&(this.remove(getKey(ae.tileCoord)),ae.release())})}}class TileRange{constructor(Z,ee,ae,ye){this.minX=Z,this.maxX=ee,this.minY=ae,this.maxY=ye}contains(Z){return this.containsXY(Z[1],Z[2])}containsTileRange(Z){return this.minX<=Z.minX&&Z.maxX<=this.maxX&&this.minY<=Z.minY&&Z.maxY<=this.maxY}containsXY(Z,ee){return this.minX<=Z&&Z<=this.maxX&&this.minY<=ee&&ee<=this.maxY}equals(Z){return this.minX==Z.minX&&this.minY==Z.minY&&this.maxX==Z.maxX&&this.maxY==Z.maxY}extend(Z){Z.minXthis.maxX&&(this.maxX=Z.maxX),Z.minYthis.maxY&&(this.maxY=Z.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(Z){return this.minX<=Z.maxX&&this.maxX>=Z.minX&&this.minY<=Z.maxY&&this.maxY>=Z.minY}}function createOrUpdate(ie,Z,ee,ae,ye){return ye!==void 0?(ye.minX=ie,ye.maxX=Z,ye.minY=ee,ye.maxY=ae,ye):new TileRange(ie,Z,ee,ae)}const canvasPool$1=[];class VectorRenderTile extends Tile{constructor(Z,ee,ae,ye){super(Z,ee,{transition:0}),this.context_={},this.executorGroups={},this.declutterExecutorGroups={},this.loadingSourceTiles=0,this.hitDetectionImageData={},this.replayState_={},this.sourceTiles=[],this.errorTileKeys={},this.wantedResolution,this.getSourceTiles=ye.bind(void 0,this),this.wrappedTileCoord=ae}getContext(Z){const ee=getUid(Z);return ee in this.context_||(this.context_[ee]=createCanvasContext2D(1,1,canvasPool$1)),this.context_[ee]}hasContext(Z){return getUid(Z)in this.context_}getImage(Z){return this.hasContext(Z)?this.getContext(Z).canvas:null}getReplayState(Z){const ee=getUid(Z);return ee in this.replayState_||(this.replayState_[ee]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[ee]}load(){this.getSourceTiles()}release(){for(const Z in this.context_){const ee=this.context_[Z];releaseCanvas$1(ee),canvasPool$1.push(ee.canvas),delete this.context_[Z]}super.release()}}let VectorTile$1=class extends Tile{constructor(ie,Z,ee,ae,ye,ve){super(ie,Z,ve),this.extent=null,this.format_=ae,this.features_=null,this.loader_,this.projection=null,this.resolution,this.tileLoadFunction_=ye,this.url_=ee,this.key=ee}getFormat(){return this.format_}getFeatures(){return this.features_}load(){this.state==TileState.IDLE&&(this.setState(TileState.LOADING),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))}onLoad(ie,Z){this.setFeatures(ie)}onError(){this.setState(TileState.ERROR)}setFeatures(ie){this.features_=ie,this.setState(TileState.LOADED)}setLoader(ie){this.loader_=ie}};const TileProperty={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class BaseTileLayer extends Layer{constructor(Z){Z=Z||{};const ee=Object.assign({},Z);delete ee.preload,delete ee.useInterimTilesOnError,super(ee),this.on,this.once,this.un,this.setPreload(Z.preload!==void 0?Z.preload:0),this.setUseInterimTilesOnError(Z.useInterimTilesOnError!==void 0?Z.useInterimTilesOnError:!0)}getPreload(){return this.get(TileProperty.PRELOAD)}setPreload(Z){this.set(TileProperty.PRELOAD,Z)}getUseInterimTilesOnError(){return this.get(TileProperty.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(Z){this.set(TileProperty.USE_INTERIM_TILES_ON_ERROR,Z)}getData(Z){return super.getData(Z)}}const ERROR_THRESHOLD=.5,MAX_SUBDIVISION=10,MAX_TRIANGLE_WIDTH=.25;class Triangulation{constructor(Z,ee,ae,ye,ve,be){this.sourceProj_=Z,this.targetProj_=ee;let Ye={};const Ke=getTransform(this.targetProj_,this.sourceProj_);this.transformInv_=function(ft){const gt=ft[0]+"/"+ft[1];return Ye[gt]||(Ye[gt]=Ke(ft)),Ye[gt]},this.maxSourceExtent_=ye,this.errorThresholdSquared_=ve*ve,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!ye&&!!this.sourceProj_.getExtent()&&getWidth(ye)>=getWidth(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?getWidth(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?getWidth(this.targetProj_.getExtent()):null;const Xe=getTopLeft(ae),Je=getTopRight(ae),rt=getBottomRight(ae),nt=getBottomLeft(ae),it=this.transformInv_(Xe),lt=this.transformInv_(Je),ct=this.transformInv_(rt),ot=this.transformInv_(nt),dt=MAX_SUBDIVISION+(be?Math.max(0,Math.ceil(Math.log2(getArea(ae)/(be*be*256*256)))):0);if(this.addQuad_(Xe,Je,rt,nt,it,lt,ct,ot,dt),this.wrapsXInSource_){let ft=1/0;this.triangles_.forEach(function(gt,mt,Yr){ft=Math.min(ft,gt.source[0][0],gt.source[1][0],gt.source[2][0])}),this.triangles_.forEach(gt=>{if(Math.max(gt.source[0][0],gt.source[1][0],gt.source[2][0])-ft>this.sourceWorldWidth_/2){const mt=[[gt.source[0][0],gt.source[0][1]],[gt.source[1][0],gt.source[1][1]],[gt.source[2][0],gt.source[2][1]]];mt[0][0]-ft>this.sourceWorldWidth_/2&&(mt[0][0]-=this.sourceWorldWidth_),mt[1][0]-ft>this.sourceWorldWidth_/2&&(mt[1][0]-=this.sourceWorldWidth_),mt[2][0]-ft>this.sourceWorldWidth_/2&&(mt[2][0]-=this.sourceWorldWidth_);const Yr=Math.min(mt[0][0],mt[1][0],mt[2][0]);Math.max(mt[0][0],mt[1][0],mt[2][0])-Yr.5&&rt<1;let lt=!1;if(Xe>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const ot=boundingExtent([Z,ee,ae,ye]);lt=getWidth(ot)/this.targetWorldWidth_>MAX_TRIANGLE_WIDTH||lt}!it&&this.sourceProj_.isGlobal()&&rt&&(lt=rt>MAX_TRIANGLE_WIDTH||lt)}if(!lt&&this.maxSourceExtent_&&isFinite(Je[0])&&isFinite(Je[1])&&isFinite(Je[2])&&isFinite(Je[3])&&!intersects$1(Je,this.maxSourceExtent_))return;let ct=0;if(!lt&&(!isFinite(ve[0])||!isFinite(ve[1])||!isFinite(be[0])||!isFinite(be[1])||!isFinite(Ye[0])||!isFinite(Ye[1])||!isFinite(Ke[0])||!isFinite(Ke[1]))){if(Xe>0)lt=!0;else if(ct=(!isFinite(ve[0])||!isFinite(ve[1])?8:0)+(!isFinite(be[0])||!isFinite(be[1])?4:0)+(!isFinite(Ye[0])||!isFinite(Ye[1])?2:0)+(!isFinite(Ke[0])||!isFinite(Ke[1])?1:0),ct!=1&&ct!=2&&ct!=4&&ct!=8)return}if(Xe>0){if(!lt){const ot=[(Z[0]+ae[0])/2,(Z[1]+ae[1])/2],dt=this.transformInv_(ot);let ft;it?ft=(modulo(ve[0],nt)+modulo(Ye[0],nt))/2-modulo(dt[0],nt):ft=(ve[0]+Ye[0])/2-dt[0];const gt=(ve[1]+Ye[1])/2-dt[1];lt=ft*ft+gt*gt>this.errorThresholdSquared_}if(lt){if(Math.abs(Z[0]-ae[0])<=Math.abs(Z[1]-ae[1])){const ot=[(ee[0]+ae[0])/2,(ee[1]+ae[1])/2],dt=this.transformInv_(ot),ft=[(ye[0]+Z[0])/2,(ye[1]+Z[1])/2],gt=this.transformInv_(ft);this.addQuad_(Z,ee,ot,ft,ve,be,dt,gt,Xe-1),this.addQuad_(ft,ot,ae,ye,gt,dt,Ye,Ke,Xe-1)}else{const ot=[(Z[0]+ee[0])/2,(Z[1]+ee[1])/2],dt=this.transformInv_(ot),ft=[(ae[0]+ye[0])/2,(ae[1]+ye[1])/2],gt=this.transformInv_(ft);this.addQuad_(Z,ot,ft,ye,ve,dt,gt,Ke,Xe-1),this.addQuad_(ot,ee,ae,ft,dt,be,Ye,gt,Xe-1)}return}}if(it){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}ct&11||this.addTriangle_(Z,ae,ye,ve,Ye,Ke),ct&14||this.addTriangle_(Z,ae,ee,ve,Ye,be),ct&&(ct&13||this.addTriangle_(ee,ye,Z,be,Ke,ve),ct&7||this.addTriangle_(ee,ye,ae,be,Ke,Ye))}calculateSourceExtent(){const Z=createEmpty();return this.triangles_.forEach(function(ee,ae,ye){const ve=ee.source;extendCoordinate(Z,ve[0]),extendCoordinate(Z,ve[1]),extendCoordinate(Z,ve[2])}),Z}getTriangles(){return this.triangles_}}let brokenDiagonalRendering_;const canvasPool=[];function drawTestTriangle(ie,Z,ee,ae,ye){ie.beginPath(),ie.moveTo(0,0),ie.lineTo(Z,ee),ie.lineTo(ae,ye),ie.closePath(),ie.save(),ie.clip(),ie.fillRect(0,0,Math.max(Z,ae)+1,Math.max(ee,ye)),ie.restore()}function verifyBrokenDiagonalRendering(ie,Z){return Math.abs(ie[Z*4]-210)>2||Math.abs(ie[Z*4+3]-.75*255)>2}function isBrokenDiagonalRendering(){if(brokenDiagonalRendering_===void 0){const ie=createCanvasContext2D(6,6,canvasPool);ie.globalCompositeOperation="lighter",ie.fillStyle="rgba(210, 0, 0, 0.75)",drawTestTriangle(ie,4,5,4,0),drawTestTriangle(ie,4,5,0,5);const Z=ie.getImageData(0,0,3,3).data;brokenDiagonalRendering_=verifyBrokenDiagonalRendering(Z,0)||verifyBrokenDiagonalRendering(Z,4)||verifyBrokenDiagonalRendering(Z,8),releaseCanvas$1(ie),canvasPool.push(ie.canvas)}return brokenDiagonalRendering_}function calculateSourceResolution(ie,Z,ee,ae){const ye=transform(ee,Z,ie);let ve=getPointResolution(Z,ae,ee);const be=Z.getMetersPerUnit();be!==void 0&&(ve*=be);const Ye=ie.getMetersPerUnit();Ye!==void 0&&(ve/=Ye);const Ke=ie.getExtent();if(!Ke||containsCoordinate(Ke,ye)){const Xe=getPointResolution(ie,ve,ye)/ve;isFinite(Xe)&&Xe>0&&(ve/=Xe)}return ve}function calculateSourceExtentResolution(ie,Z,ee,ae){const ye=getCenter(ee);let ve=calculateSourceResolution(ie,Z,ye,ae);return(!isFinite(ve)||ve<=0)&&forEachCorner(ee,function(be){return ve=calculateSourceResolution(ie,Z,be,ae),isFinite(ve)&&ve>0}),ve}function render$1(ie,Z,ee,ae,ye,ve,be,Ye,Ke,Xe,Je,rt){const nt=createCanvasContext2D(Math.round(ee*ie),Math.round(ee*Z),canvasPool);if(rt||(nt.imageSmoothingEnabled=!1),Ke.length===0)return nt.canvas;nt.scale(ee,ee);function it(mt){return Math.round(mt*ee)/ee}nt.globalCompositeOperation="lighter";const lt=createEmpty();Ke.forEach(function(mt,Yr,Qr){extend$1(lt,mt.extent)});const ct=getWidth(lt),ot=getHeight(lt),dt=createCanvasContext2D(Math.round(ee*ct/ae),Math.round(ee*ot/ae),canvasPool);rt||(dt.imageSmoothingEnabled=!1);const ft=ee/ae;Ke.forEach(function(mt,Yr,Qr){const Xr=mt.extent[0]-lt[0],Jr=-(mt.extent[3]-lt[3]),ai=getWidth(mt.extent),oi=getHeight(mt.extent);mt.image.width>0&&mt.image.height>0&&dt.drawImage(mt.image,Xe,Xe,mt.image.width-2*Xe,mt.image.height-2*Xe,Xr*ft,Jr*ft,ai*ft,oi*ft)});const gt=getTopLeft(be);return Ye.getTriangles().forEach(function(mt,Yr,Qr){const Xr=mt.source,Jr=mt.target;let ai=Xr[0][0],oi=Xr[0][1],ni=Xr[1][0],li=Xr[1][1],ui=Xr[2][0],mi=Xr[2][1];const ii=it((Jr[0][0]-gt[0])/ve),hi=it(-(Jr[0][1]-gt[1])/ve),ri=it((Jr[1][0]-gt[0])/ve),ci=it(-(Jr[1][1]-gt[1])/ve),Si=it((Jr[2][0]-gt[0])/ve),si=it(-(Jr[2][1]-gt[1])/ve),Ei=ai,yi=oi;ai=0,oi=0,ni-=Ei,li-=yi,ui-=Ei,mi-=yi;const Mi=[[ni,li,0,0,ri-ii],[ui,mi,0,0,Si-ii],[0,0,ni,li,ci-hi],[0,0,ui,mi,si-hi]],Ci=solveLinearSystem(Mi);if(Ci){if(nt.save(),nt.beginPath(),isBrokenDiagonalRendering()||!rt){nt.moveTo(ri,ci);const Ri=4,Ni=ii-ri,Ai=hi-ci;for(let ki=0;ki{ee&&ee.getState()==TileState.LOADED&&Z.push({extent:this.sourceTileGrid_.getTileCoordExtent(ee.tileCoord),image:ee.getImage()})}),this.sourceTiles_.length=0,Z.length===0)this.state=TileState.ERROR;else{const ee=this.wrappedTileCoord_[0],ae=this.targetTileGrid_.getTileSize(ee),ye=typeof ae=="number"?ae:ae[0],ve=typeof ae=="number"?ae:ae[1],be=this.targetTileGrid_.getResolution(ee),Ye=this.sourceTileGrid_.getResolution(this.sourceZ_),Ke=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=render$1(ye,ve,this.pixelRatio_,Ye,this.sourceTileGrid_.getExtent(),be,Ke,this.triangulation_,Z,this.gutter_,this.renderEdges_,this.interpolate),this.state=TileState.LOADED}this.changed()}load(){if(this.state==TileState.IDLE){this.state=TileState.LOADING,this.changed();let Z=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(ee=>{const ae=ee.getState();if(ae==TileState.IDLE||ae==TileState.LOADING){Z++;const ye=listen(ee,EventType.CHANGE,function(ve){const be=ee.getState();(be==TileState.LOADED||be==TileState.ERROR||be==TileState.EMPTY)&&(unlistenByKey(ye),Z--,Z===0&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(ye)}}),Z===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(ee,ae,ye){ee.getState()==TileState.IDLE&&ee.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(unlistenByKey),this.sourcesListenerKeys_=null}release(){this.canvas_&&(releaseCanvas$1(this.canvas_.getContext("2d")),canvasPool.push(this.canvas_),this.canvas_=null),super.release()}}class CanvasTileLayerRenderer extends CanvasLayerRenderer{constructor(Z){super(Z),this.extentChanged=!0,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=createEmpty(),this.tmpTileRange_=new TileRange(0,0,0,0)}isDrawableTile(Z){const ee=this.getLayer(),ae=Z.getState(),ye=ee.getUseInterimTilesOnError();return ae==TileState.LOADED||ae==TileState.EMPTY||ae==TileState.ERROR&&!ye}getTile(Z,ee,ae,ye){const ve=ye.pixelRatio,be=ye.viewState.projection,Ye=this.getLayer();let Ke=Ye.getSource().getTile(Z,ee,ae,ve,be);return Ke.getState()==TileState.ERROR&&Ye.getUseInterimTilesOnError()&&Ye.getPreload()>0&&(this.newTiles_=!0),this.isDrawableTile(Ke)||(Ke=Ke.getInterimTile()),Ke}getData(Z){const ee=this.frameState;if(!ee)return null;const ae=this.getLayer(),ye=apply(ee.pixelToCoordinateTransform,Z.slice()),ve=ae.getExtent();if(ve&&!containsCoordinate(ve,ye))return null;const be=ee.pixelRatio,Ye=ee.viewState.projection,Ke=ee.viewState,Xe=ae.getRenderSource(),Je=Xe.getTileGridForProjection(Ke.projection),rt=Xe.getTilePixelRatio(ee.pixelRatio);for(let nt=Je.getZForResolution(Ke.resolution);nt>=Je.getMinZoom();--nt){const it=Je.getTileCoordForCoordAndZ(ye,nt),lt=Xe.getTile(nt,it[1],it[2],be,Ye);if(!(lt instanceof ImageTile||lt instanceof ReprojTile)||lt instanceof ReprojTile&<.getState()===TileState.EMPTY)return null;if(lt.getState()!==TileState.LOADED)continue;const ct=Je.getOrigin(nt),ot=toSize(Je.getTileSize(nt)),dt=Je.getResolution(nt),ft=Math.floor(rt*((ye[0]-ct[0])/dt-it[1]*ot[0])),gt=Math.floor(rt*((ct[1]-ye[1])/dt-it[2]*ot[1])),mt=Math.round(rt*Xe.getGutterForProjection(Ke.projection));return this.getImageData(lt.getImage(),ft+mt,gt+mt)}return null}loadedTileCallback(Z,ee,ae){return this.isDrawableTile(ae)?super.loadedTileCallback(Z,ee,ae):!1}prepareFrame(Z){return!!this.getLayer().getSource()}renderFrame(Z,ee){const ae=Z.layerStatesArray[Z.layerIndex],ye=Z.viewState,ve=ye.projection,be=ye.resolution,Ye=ye.center,Ke=ye.rotation,Xe=Z.pixelRatio,Je=this.getLayer(),rt=Je.getSource(),nt=rt.getRevision(),it=rt.getTileGridForProjection(ve),lt=it.getZForResolution(be,rt.zDirection),ct=it.getResolution(lt);let ot=Z.extent;const dt=Z.viewState.resolution,ft=rt.getTilePixelRatio(Xe),gt=Math.round(getWidth(ot)/dt*Xe),mt=Math.round(getHeight(ot)/dt*Xe),Yr=ae.extent&&fromUserExtent(ae.extent,ve);Yr&&(ot=getIntersection(ot,fromUserExtent(ae.extent,ve)));const Qr=ct*gt/2/ft,Xr=ct*mt/2/ft,Jr=[Ye[0]-Qr,Ye[1]-Xr,Ye[0]+Qr,Ye[1]+Xr],ai=it.getTileRangeForExtentAndZ(ot,lt),oi={};oi[lt]={};const ni=this.createLoadedTileFinder(rt,ve,oi),li=this.tmpExtent,ui=this.tmpTileRange_;this.newTiles_=!1;const mi=Ke?getRotatedViewport(ye.center,dt,Ke,Z.size):void 0;for(let Mi=ai.minX;Mi<=ai.maxX;++Mi)for(let Ci=ai.minY;Ci<=ai.maxY;++Ci){if(Ke&&!it.tileCoordIntersectsViewport([lt,Mi,Ci],mi))continue;const Ri=this.getTile(lt,Mi,Ci,Z);if(this.isDrawableTile(Ri)){const ki=getUid(this);if(Ri.getState()==TileState.LOADED){oi[lt][Ri.tileCoord.toString()]=Ri;let Yi=Ri.inTransition(ki);Yi&&ae.opacity!==1&&(Ri.endTransition(ki),Yi=!1),!this.newTiles_&&(Yi||!this.renderedTiles.includes(Ri))&&(this.newTiles_=!0)}if(Ri.getAlpha(ki,Z.time)===1)continue}const Ni=it.getTileCoordChildTileRange(Ri.tileCoord,ui,li);let Ai=!1;Ni&&(Ai=ni(lt+1,Ni)),Ai||it.forEachTileCoordParentTileRange(Ri.tileCoord,ni,ui,li)}const ii=ct/be*Xe/ft;compose$1(this.pixelTransform,Z.size[0]/2,Z.size[1]/2,1/Xe,1/Xe,Ke,-gt/2,-mt/2);const hi=toString$1(this.pixelTransform);this.useContainer(ee,hi,this.getBackground(Z));const ri=this.context,ci=ri.canvas;makeInverse(this.inversePixelTransform,this.pixelTransform),compose$1(this.tempTransform,gt/2,mt/2,ii,ii,0,-gt/2,-mt/2),ci.width!=gt||ci.height!=mt?(ci.width=gt,ci.height=mt):this.containerReused||ri.clearRect(0,0,gt,mt),Yr&&this.clipUnrotated(ri,Z,Yr),rt.getInterpolate()||(ri.imageSmoothingEnabled=!1),this.preRender(ri,Z),this.renderedTiles.length=0;let Si=Object.keys(oi).map(Number);Si.sort(ascending);let si,Ei,yi;ae.opacity===1&&(!this.containerReused||rt.getOpaque(Z.viewState.projection))?Si=Si.reverse():(si=[],Ei=[]);for(let Mi=Si.length-1;Mi>=0;--Mi){const Ci=Si[Mi],Ri=rt.getTilePixelSize(Ci,Xe,ve),Ni=it.getResolution(Ci)/ct,Ai=Ri[0]*Ni*ii,ki=Ri[1]*Ni*ii,Yi=it.getTileCoordForCoordAndZ(getTopLeft(Jr),Ci),Ji=it.getTileCoordExtent(Yi),ls=apply(this.tempTransform,[ft*(Ji[0]-Jr[0])/ct,ft*(Jr[3]-Ji[3])/ct]),hs=ft*rt.getGutterForProjection(ve),Kr=oi[Ci];for(const di in Kr){const wi=Kr[di],Ii=wi.tileCoord,Di=Yi[1]-Ii[1],is=Math.round(ls[0]-(Di-1)*Ai),Gi=Yi[2]-Ii[2],us=Math.round(ls[1]-(Gi-1)*ki),Zi=Math.round(ls[0]-Di*Ai),ns=Math.round(ls[1]-Gi*ki),Ki=is-Zi,ds=us-ns,as=lt===Ci,ms=as&&wi.getAlpha(getUid(this),Z.time)!==1;let vs=!1;if(!ms)if(si){yi=[Zi,ns,Zi+Ki,ns,Zi+Ki,ns+ds,Zi,ns+ds];for(let zs=0,Zs=si.length;zs{const Xr=Qr===Yr?ee.declutterTree.all().map(Jr=>Jr.value):null;for(let Jr=0,ai=Qr.length;Jr{const ye=this.getLayer(),ve=getUid(ye),be=ye.getSource(),Ye=this.renderedProjection,Ke=Ye.getExtent(),Xe=this.renderedResolution,Je=be.getTileGridForProjection(Ye),rt=apply(this.renderedPixelToCoordinateTransform_,Z.slice()),nt=Je.getTileCoordForCoordAndResolution(rt,Xe);let it;for(let gt=0,mt=this.renderedTiles.length;gt0){ee([]);return}const lt=Je.getTileCoordExtent(it.wrappedTileCoord),ct=getTopLeft(lt),ot=[(rt[0]-ct[0])/Xe,(ct[1]-rt[1])/Xe],dt=it.getSourceTiles().reduce(function(gt,mt){return gt.concat(mt.getFeatures())},[]);let ft=it.hitDetectionImageData[ve];if(!ft){const gt=toSize(Je.getTileSize(Je.getZForResolution(Xe,be.zDirection))),mt=this.renderedRotation_,Yr=[this.getRenderTransform(Je.getTileCoordCenter(it.wrappedTileCoord),Xe,0,HIT_DETECT_RESOLUTION,gt[0]*HIT_DETECT_RESOLUTION,gt[1]*HIT_DETECT_RESOLUTION,0)];ft=createHitDetectionImageData(gt,Yr,dt,ye.getStyleFunction(),Je.getTileCoordExtent(it.wrappedTileCoord),it.getReplayState(ye).renderedResolution,mt),it.hitDetectionImageData[ve]=ft}ee(hitDetect(ot,dt,ft))})}handleFontsChanged(){const Z=this.getLayer();Z.getVisible()&&this.renderedLayerRevision_!==void 0&&Z.changed()}handleStyleImageChange_(Z){this.renderIfReadyAndVisible()}renderDeclutter(Z){const ee=this.context,ae=ee.globalAlpha;ee.globalAlpha=this.getLayer().getOpacity();const ye=Z.viewHints,ve=!(ye[ViewHint.ANIMATING]||ye[ViewHint.INTERACTING]),be=this.renderedTiles;for(let Ye=0,Ke=be.length;Ye=0;--rt)Je[rt].execute(this.context,1,this.getTileRenderTransform(Xe,Z),Z.viewState.rotation,ve,void 0,Z.declutterTree)}ee.globalAlpha=ae}getTileRenderTransform(Z,ee){const ae=ee.pixelRatio,ye=ee.viewState,ve=ye.center,be=ye.resolution,Ye=ye.rotation,Ke=ee.size,Xe=Math.round(Ke[0]*ae),Je=Math.round(Ke[1]*ae),rt=this.getLayer().getSource().getTileGridForProjection(ee.viewState.projection),nt=Z.tileCoord,it=rt.getTileCoordExtent(Z.wrappedTileCoord),lt=rt.getTileCoordExtent(nt,this.tmpExtent)[0]-it[0];return multiply(scale$3(this.inversePixelTransform.slice(),1/ae,1/ae),this.getRenderTransform(ve,be,Ye,ae,Xe,Je,lt))}postRender(Z,ee){const ae=ee.viewHints,ye=!(ae[ViewHint.ANIMATING]||ae[ViewHint.INTERACTING]);this.renderedPixelToCoordinateTransform_=ee.pixelToCoordinateTransform.slice(),this.renderedRotation_=ee.viewState.rotation;const ve=this.getLayer(),be=ve.getRenderMode(),Ye=Z.globalAlpha;Z.globalAlpha=ve.getOpacity();const Ke=VECTOR_REPLAYS[be],Xe=ee.viewState,Je=Xe.rotation,rt=ve.getSource(),nt=rt.getTileGridForProjection(Xe.projection).getZForResolution(Xe.resolution,rt.zDirection),it=this.renderedTiles,lt=[],ct=[];let ot=!0;for(let dt=it.length-1;dt>=0;--dt){const ft=it[dt];ot=ot&&!ft.getReplayState(ve).dirty;const gt=ft.executorGroups[getUid(ve)].filter(Jr=>Jr.hasExecutors(Ke));if(gt.length===0)continue;const mt=this.getTileRenderTransform(ft,ee),Yr=ft.tileCoord[0];let Qr=!1;const Xr=gt[0].getClipCoords(mt);if(Xr){for(let Jr=0,ai=lt.length;Jr=this.minZoom;){if(this.zoomFactor_===2?(be=Math.floor(be/2),Ye=Math.floor(Ye/2),ve=createOrUpdate(be,be,Ye,Ye,ae)):ve=this.getTileRangeForExtentAndZ(Ke,Xe,ae),ee(Xe,ve))return!0;--Xe}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(Z){return this.origin_?this.origin_:this.origins_[Z]}getResolution(Z){return this.resolutions_[Z]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(Z,ee,ae){if(Z[0]this.maxZoom||ee0?ae:Math.max(ve/ee[0],ye/ee[1]);const be=Z+1,Ye=new Array(be);for(let Ke=0;Keae.highWaterMark&&(ae.highWaterMark=Z)}useTile(Z,ee,ae,ye){}}class TileSourceEvent extends BaseEvent{constructor(Z,ee){super(Z),this.tile=ee}}function createFromTemplate(ie,Z){const ee=/\{z\}/g,ae=/\{x\}/g,ye=/\{y\}/g,ve=/\{-y\}/g;return function(be,Ye,Ke){if(be)return ie.replace(ee,be[0].toString()).replace(ae,be[1].toString()).replace(ye,be[2].toString()).replace(ve,function(){const Xe=be[0],Je=Z.getFullTileRange(Xe);return assert(Je,"The {-y} placeholder requires a tile grid with extent"),(Je.getHeight()-be[2]-1).toString()})}}function createFromTemplates(ie,Z){const ee=ie.length,ae=new Array(ee);for(let ye=0;yethis.getTileInternal(ot,dt,ft,gt,be),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return ct.key=rt,Xe?(ct.interimTile=Xe,ct.refreshInterimChain(),Ye.replace(Je,ct)):Ye.set(Je,ct),ct}getTileInternal(Z,ee,ae,ye,ve){let be=null;const Ye=getKeyZXY(Z,ee,ae),Ke=this.getKey();if(!this.tileCache.containsKey(Ye))be=this.createTile_(Z,ee,ae,ye,ve,Ke),this.tileCache.set(Ye,be);else if(be=this.tileCache.get(Ye),be.key!=Ke){const Xe=be;be=this.createTile_(Z,ee,ae,ye,ve,Ke),Xe.getState()==TileState.IDLE?be.interimTile=Xe.interimTile:be.interimTile=Xe,be.refreshInterimChain(),this.tileCache.replace(Ye,be)}return be}setRenderReprojectionEdges(Z){if(this.renderReprojectionEdges_!=Z){this.renderReprojectionEdges_=Z;for(const ee in this.tileCacheForProjection)this.tileCacheForProjection[ee].clear();this.changed()}}setTileGridForProjection(Z,ee){const ae=get$1(Z);if(ae){const ye=getUid(ae);ye in this.tileGridForProjection||(this.tileGridForProjection[ye]=ee)}}clear(){super.clear();for(const Z in this.tileCacheForProjection)this.tileCacheForProjection[Z].clear()}}function defaultTileLoadFunction(ie,Z){ie.getImage().src=Z}class XYZ extends TileImage{constructor(Z){Z=Z||{};const ee=Z.projection!==void 0?Z.projection:"EPSG:3857",ae=Z.tileGrid!==void 0?Z.tileGrid:createXYZ({extent:extentFromProjection(ee),maxResolution:Z.maxResolution,maxZoom:Z.maxZoom,minZoom:Z.minZoom,tileSize:Z.tileSize});super({attributions:Z.attributions,cacheSize:Z.cacheSize,crossOrigin:Z.crossOrigin,interpolate:Z.interpolate,opaque:Z.opaque,projection:ee,reprojectionErrorThreshold:Z.reprojectionErrorThreshold,tileGrid:ae,tileLoadFunction:Z.tileLoadFunction,tilePixelRatio:Z.tilePixelRatio,tileUrlFunction:Z.tileUrlFunction,url:Z.url,urls:Z.urls,wrapX:Z.wrapX!==void 0?Z.wrapX:!0,transition:Z.transition,attributionsCollapsible:Z.attributionsCollapsible,zDirection:Z.zDirection}),this.gutter_=Z.gutter!==void 0?Z.gutter:0}getGutter(){return this.gutter_}}class GeometryCollection extends Geometry{constructor(Z){super(),this.geometries_=Z||null,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(unlistenByKey),this.changeEventsKeys_.length=0}listenGeometriesChange_(){if(this.geometries_)for(let Z=0,ee=this.geometries_.length;ZPromise.resolve(new Uint8Array(4)),interpolate:Z.interpolate,transition:Z.transition}),this.pixelRatio_=Z.pixelRatio,this.gutter_=Z.gutter,this.reprojData_=null,this.reprojError_=null,this.reprojSize_=void 0,this.sourceTileGrid_=Z.sourceTileGrid,this.targetTileGrid_=Z.targetTileGrid,this.wrappedTileCoord_=Z.wrappedTileCoord||Z.tileCoord,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const ee=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),ae=this.targetTileGrid_.getExtent();let ye=this.sourceTileGrid_.getExtent();const ve=ae?getIntersection(ee,ae):ee;if(getArea(ve)===0){this.state=TileState.EMPTY;return}const be=Z.sourceProj,Ye=be.getExtent();Ye&&(ye?ye=getIntersection(ye,Ye):ye=Ye);const Ke=this.targetTileGrid_.getResolution(this.wrappedTileCoord_[0]),Xe=Z.targetProj,Je=calculateSourceExtentResolution(be,Xe,ve,Ke);if(!isFinite(Je)||Je<=0){this.state=TileState.EMPTY;return}const rt=Z.errorThreshold!==void 0?Z.errorThreshold:ERROR_THRESHOLD;if(this.triangulation_=new Triangulation(be,Xe,ve,ye,Je*rt,Ke),this.triangulation_.getTriangles().length===0){this.state=TileState.EMPTY;return}this.sourceZ_=this.sourceTileGrid_.getZForResolution(Je);let nt=this.triangulation_.calculateSourceExtent();if(ye&&(be.canWrapX()?(nt[1]=clamp$1(nt[1],ye[1],ye[3]),nt[3]=clamp$1(nt[3],ye[1],ye[3])):nt=getIntersection(nt,ye)),!getArea(nt))this.state=TileState.EMPTY;else{const it=this.sourceTileGrid_.getTileRangeForExtentAndZ(nt,this.sourceZ_),lt=Z.getTileFunction;for(let ct=it.minX;ct<=it.maxX;ct++)for(let ot=it.minY;ot<=it.maxY;ot++){const dt=lt(this.sourceZ_,ct,ot,this.pixelRatio_);dt&&this.sourceTiles_.push(dt)}this.sourceTiles_.length===0&&(this.state=TileState.EMPTY)}}getSize(){return this.reprojSize_}getData(){return this.reprojData_}getError(){return this.reprojError_}reproject_(){const Z=[];if(this.sourceTiles_.forEach(ee=>{if(!ee||ee.getState()!==TileState.LOADED)return;const ae=ee.getSize(),ye=this.gutter_;let ve;const be=asArrayLike(ee.getData());be?ve=be:ve=toArray(asImageLike(ee.getData()));const Ye=[ae[0]+2*ye,ae[1]+2*ye],Ke=ve instanceof Float32Array,Xe=Ye[0]*Ye[1],Je=Ke?Float32Array:Uint8Array,rt=new Je(ve.buffer),nt=Je.BYTES_PER_ELEMENT,it=nt*rt.length/Xe,lt=rt.byteLength/Ye[1],ct=Math.floor(lt/nt/Ye[0]),ot=Xe*ct;let dt=rt;if(rt.length!==ot){dt=new Je(ot);let ft=0,gt=0;const mt=Ye[0]*ct;for(let Yr=0;Yr=0;--it){const lt=[];for(let mt=0,Yr=Z.length;mt{const ae=ee.getState();if(ae!==TileState.IDLE&&ae!==TileState.LOADING)return;Z++;const ye=listen(ee,EventType.CHANGE,function(){const ve=ee.getState();(ve==TileState.LOADED||ve==TileState.ERROR||ve==TileState.EMPTY)&&(unlistenByKey(ye),Z--,Z===0&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(ye)}),Z===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(ee){ee.getState()==TileState.IDLE&&ee.load()})}unlistenSources_(){this.sourcesListenerKeys_.forEach(unlistenByKey),this.sourcesListenerKeys_=null}}class DataTileSource extends TileSource{constructor(Z){const ee=Z.projection===void 0?"EPSG:3857":Z.projection;let ae=Z.tileGrid;ae===void 0&&ee&&(ae=createXYZ({extent:extentFromProjection(ee),maxResolution:Z.maxResolution,maxZoom:Z.maxZoom,minZoom:Z.minZoom,tileSize:Z.tileSize})),super({cacheSize:.1,attributions:Z.attributions,attributionsCollapsible:Z.attributionsCollapsible,projection:ee,tileGrid:ae,opaque:Z.opaque,state:Z.state,wrapX:Z.wrapX,transition:Z.transition,interpolate:Z.interpolate}),this.gutter_=Z.gutter!==void 0?Z.gutter:0,this.tileSize_=Z.tileSize?toSize(Z.tileSize):null,this.tileSizes_=null,this.tileLoadingKeys_={},this.loader_=Z.loader,this.handleTileChange_=this.handleTileChange_.bind(this),this.bandCount=Z.bandCount===void 0?4:Z.bandCount,this.tileGridForProjection_={},this.tileCacheForProjection_={}}setTileSizes(Z){this.tileSizes_=Z}getTileSize(Z){if(this.tileSizes_)return this.tileSizes_[Z];if(this.tileSize_)return this.tileSize_;const ee=this.getTileGrid();return ee?toSize(ee.getTileSize(Z)):[256,256]}getGutterForProjection(Z){const ee=this.getProjection();return!ee||equivalent(ee,Z)?this.gutter_:0}setLoader(Z){this.loader_=Z}getReprojTile_(Z,ee,ae,ye,ve){const be=this.getTileCacheForProjection(ye),Ye=getKeyZXY(Z,ee,ae);if(be.containsKey(Ye)){const ot=be.get(Ye);if(ot&&ot.key==this.getKey())return ot}const Ke=this.getTileGrid(),Xe=Math.max.apply(null,Ke.getResolutions().map((ot,dt)=>{const ft=toSize(Ke.getTileSize(dt)),gt=this.getTileSize(dt);return Math.max(gt[0]/ft[0],gt[1]/ft[1])})),Je=this.getTileGridForProjection(ve),rt=this.getTileGridForProjection(ye),nt=[Z,ee,ae],it=this.getTileCoordForTileUrlFunction(nt,ye),lt=Object.assign({sourceProj:ve,sourceTileGrid:Je,targetProj:ye,targetTileGrid:rt,tileCoord:nt,wrappedTileCoord:it,pixelRatio:Xe,gutter:this.getGutterForProjection(ve),getTileFunction:(ot,dt,ft,gt)=>this.getTile(ot,dt,ft,gt,ve)},this.tileOptions),ct=new ReprojDataTile(lt);return ct.key=this.getKey(),ct}getTile(Z,ee,ae,ye,ve){const be=this.getProjection();if(be&&ve&&!equivalent(be,ve))return this.getReprojTile_(Z,ee,ae,ve,be);const Ye=this.getTileSize(Z),Ke=getKeyZXY(Z,ee,ae);if(this.tileCache.containsKey(Ke))return this.tileCache.get(Ke);const Xe=this.loader_;function Je(){return toPromise(function(){return Xe(Z,ee,ae)})}const rt=Object.assign({tileCoord:[Z,ee,ae],loader:Je,size:Ye},this.tileOptions),nt=new DataTile(rt);return nt.key=this.getKey(),nt.addEventListener(EventType.CHANGE,this.handleTileChange_),this.tileCache.set(Ke,nt),nt}handleTileChange_(Z){const ee=Z.target,ae=getUid(ee),ye=ee.getState();let ve;ye==TileState.LOADING?(this.tileLoadingKeys_[ae]=!0,ve=TileEventType.TILELOADSTART):ae in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[ae],ve=ye==TileState.ERROR?TileEventType.TILELOADERROR:ye==TileState.LOADED?TileEventType.TILELOADEND:void 0),ve&&this.dispatchEvent(new TileSourceEvent(ve,ee))}getTileGridForProjection(Z){const ee=this.getProjection();if(this.tileGrid&&(!ee||equivalent(ee,Z)))return this.tileGrid;const ae=getUid(Z);return ae in this.tileGridForProjection_||(this.tileGridForProjection_[ae]=getForProjection(Z)),this.tileGridForProjection_[ae]}setTileGridForProjection(Z,ee){const ae=get$1(Z);if(ae){const ye=getUid(ae);ye in this.tileGridForProjection_||(this.tileGridForProjection_[ye]=ee)}}getTileCacheForProjection(Z){const ee=this.getProjection();if(!ee||equivalent(ee,Z))return this.tileCache;const ae=getUid(Z);return ae in this.tileCacheForProjection_||(this.tileCacheForProjection_[ae]=new TileCache(.1)),this.tileCacheForProjection_[ae]}expireCache(Z,ee){const ae=this.getTileCacheForProjection(Z);this.tileCache.expireCache(this.tileCache==ae?ee:{});for(const ye in this.tileCacheForProjection_){const ve=this.tileCacheForProjection_[ye];ve.expireCache(ve==ae?ee:{})}}clear(){super.clear();for(const Z in this.tileCacheForProjection_)this.tileCacheForProjection_[Z].clear()}}function uncurryThis(ie){return(Z,...ee)=>ReflectApply(ie,Z,ee)}function uncurryThisGetter(ie,Z){return uncurryThis(ReflectGetOwnPropertyDescriptor(ie,Z).get)}const{apply:ReflectApply,construct:ReflectConstruct,defineProperty:ReflectDefineProperty,get:ReflectGet,getOwnPropertyDescriptor:ReflectGetOwnPropertyDescriptor,getPrototypeOf:ReflectGetPrototypeOf,has:ReflectHas,ownKeys:ReflectOwnKeys,set:ReflectSet,setPrototypeOf:ReflectSetPrototypeOf}=Reflect,{iterator:SymbolIterator,species:SymbolSpecies,toStringTag:SymbolToStringTag,for:SymbolFor}=Symbol,NativeObject=Object,{create:ObjectCreate,defineProperty:ObjectDefineProperty,freeze:ObjectFreeze,is:ObjectIs}=NativeObject,NativeArray=Array,ArrayPrototype=NativeArray.prototype,NativeArrayPrototypeSymbolIterator=ArrayPrototype[SymbolIterator],ArrayPrototypeSymbolIterator=uncurryThis(NativeArrayPrototypeSymbolIterator),NativeArrayBuffer=ArrayBuffer,ArrayBufferPrototype=NativeArrayBuffer.prototype;uncurryThisGetter(ArrayBufferPrototype,"byteLength");const NativeSharedArrayBuffer=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:null;NativeSharedArrayBuffer&&uncurryThisGetter(NativeSharedArrayBuffer.prototype,"byteLength");const TypedArray=ReflectGetPrototypeOf(Uint8Array);TypedArray.from;const TypedArrayPrototype=TypedArray.prototype;TypedArrayPrototype[SymbolIterator];uncurryThis(TypedArrayPrototype.keys);uncurryThis(TypedArrayPrototype.values);uncurryThis(TypedArrayPrototype.entries);uncurryThis(TypedArrayPrototype.set);uncurryThis(TypedArrayPrototype.reverse);uncurryThis(TypedArrayPrototype.fill);uncurryThis(TypedArrayPrototype.copyWithin);uncurryThis(TypedArrayPrototype.sort);uncurryThis(TypedArrayPrototype.slice);uncurryThis(TypedArrayPrototype.subarray);uncurryThisGetter(TypedArrayPrototype,"buffer");uncurryThisGetter(TypedArrayPrototype,"byteOffset");uncurryThisGetter(TypedArrayPrototype,"length");uncurryThisGetter(TypedArrayPrototype,SymbolToStringTag);const NativeUint8Array=Uint8Array,NativeUint16Array=Uint16Array,NativeUint32Array=Uint32Array,NativeFloat32Array=Float32Array,ArrayIteratorPrototype=ReflectGetPrototypeOf([][SymbolIterator]()),ArrayIteratorPrototypeNext=uncurryThis(ArrayIteratorPrototype.next),GeneratorPrototypeNext=uncurryThis(function*(){}().next),IteratorPrototype=ReflectGetPrototypeOf(ArrayIteratorPrototype),DataViewPrototype=DataView.prototype,DataViewPrototypeGetUint16=uncurryThis(DataViewPrototype.getUint16),NativeWeakMap=WeakMap,WeakMapPrototype=NativeWeakMap.prototype,WeakMapPrototypeGet=uncurryThis(WeakMapPrototype.get),WeakMapPrototypeSet=uncurryThis(WeakMapPrototype.set),arrayIterators=new NativeWeakMap,SafeIteratorPrototype=ObjectCreate(null,{next:{value:function(){const ie=WeakMapPrototypeGet(arrayIterators,this);return ArrayIteratorPrototypeNext(ie)}},[SymbolIterator]:{value:function(){return this}}});function safeIfNeeded(ie){if(ie[SymbolIterator]===NativeArrayPrototypeSymbolIterator&&ArrayIteratorPrototype.next===ArrayIteratorPrototypeNext)return ie;const Z=ObjectCreate(SafeIteratorPrototype);return WeakMapPrototypeSet(arrayIterators,Z,ArrayPrototypeSymbolIterator(ie)),Z}const generators=new NativeWeakMap,DummyArrayIteratorPrototype=ObjectCreate(IteratorPrototype,{next:{value:function(){const ie=WeakMapPrototypeGet(generators,this);return GeneratorPrototypeNext(ie)},writable:!0,configurable:!0}});for(const ie of ReflectOwnKeys(ArrayIteratorPrototype))ie!=="next"&&ObjectDefineProperty(DummyArrayIteratorPrototype,ie,ReflectGetOwnPropertyDescriptor(ArrayIteratorPrototype,ie));const buffer=new NativeArrayBuffer(4),floatView=new NativeFloat32Array(buffer),uint32View=new NativeUint32Array(buffer),baseTable=new NativeUint16Array(512),shiftTable=new NativeUint8Array(512);for(let ie=0;ie<256;++ie){const Z=ie-127;Z<-27?(baseTable[ie]=0,baseTable[ie|256]=32768,shiftTable[ie]=24,shiftTable[ie|256]=24):Z<-14?(baseTable[ie]=1024>>-Z-14,baseTable[ie|256]=1024>>-Z-14|32768,shiftTable[ie]=-Z-1,shiftTable[ie|256]=-Z-1):Z<=15?(baseTable[ie]=Z+15<<10,baseTable[ie|256]=Z+15<<10|32768,shiftTable[ie]=13,shiftTable[ie|256]=13):Z<128?(baseTable[ie]=31744,baseTable[ie|256]=64512,shiftTable[ie]=24,shiftTable[ie|256]=24):(baseTable[ie]=31744,baseTable[ie|256]=64512,shiftTable[ie]=13,shiftTable[ie|256]=13)}const mantissaTable=new NativeUint32Array(2048);for(let ie=1;ie<1024;++ie){let Z=ie<<13,ee=0;for(;!(Z&8388608);)Z<<=1,ee-=8388608;Z&=-8388609,ee+=947912704,mantissaTable[ie]=Z|ee}for(let ie=1024;ie<2048;++ie)mantissaTable[ie]=939524096+(ie-1024<<13);const exponentTable=new NativeUint32Array(64);for(let ie=1;ie<31;++ie)exponentTable[ie]=ie<<23;exponentTable[31]=1199570944;exponentTable[32]=2147483648;for(let ie=33;ie<63;++ie)exponentTable[ie]=2147483648+(ie-32<<23);exponentTable[63]=3347054592;const offsetTable=new NativeUint16Array(64);for(let ie=1;ie<64;++ie)ie!==32&&(offsetTable[ie]=1024);function convertToNumber(ie){const Z=ie>>10;return uint32View[0]=mantissaTable[offsetTable[Z]+(ie&1023)]+exponentTable[Z],floatView[0]}function getFloat16(ie,Z,...ee){return convertToNumber(DataViewPrototypeGetUint16(ie,Z,...safeIfNeeded(ee)))}var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs$1(ie){return ie&&ie.__esModule&&Object.prototype.hasOwnProperty.call(ie,"default")?ie.default:ie}function getAugmentedNamespace(ie){if(ie.__esModule)return ie;var Z=ie.default;if(typeof Z=="function"){var ee=function ae(){return this instanceof ae?Reflect.construct(Z,arguments,this.constructor):Z.apply(this,arguments)};ee.prototype=Z.prototype}else ee={};return Object.defineProperty(ee,"__esModule",{value:!0}),Object.keys(ie).forEach(function(ae){var ye=Object.getOwnPropertyDescriptor(ie,ae);Object.defineProperty(ee,ae,ye.get?ye:{enumerable:!0,get:function(){return ie[ae]}})}),ee}var getAttribute$2={exports:{}};function getAttribute(ie,Z,ee){const ae=ee&&ee.debug||!1;ae&&console.log("[xml-utils] getting "+Z+" in "+ie);const ye=typeof ie=="object"?ie.outer:ie,ve=ye.slice(0,ye.indexOf(">")+1),be=['"',"'"];for(let Ye=0;Ye/]`,ve);if(ae&&console.log("[xml-utils] start:",be),be===-1)return;const Ye=ie.slice(be+Z.length);let Ke=indexOfMatchEnd(Ye,"^[^<]*[ /]>",0);const Xe=Ke!==-1&&Ye[Ke-1]==="/";if(ae&&console.log("[xml-utils] selfClosing:",Xe),Xe===!1)if(ye){let it=0,lt=1,ct=0;for(;(Ke=indexOfMatchEnd(Ye,"[ /]"+Z+">",it))!==-1;){const ot=Ye.substring(it,Ke+1);if(lt+=countSubstring(ot,"<"+Z+`[ + >]`),ct+=countSubstring(ot,""),ct>=lt)break;it=Ke}}else Ke=indexOfMatchEnd(Ye,"[ /]"+Z+">",0);const Je=be+Z.length+Ke+1;if(ae&&console.log("[xml-utils] end:",Je),Je===-1)return;const rt=ie.slice(be,Je);let nt;return Xe?nt=null:nt=rt.slice(rt.indexOf(">")+1,rt.lastIndexOf("<")),{inner:nt,outer:rt,start:be,end:Je}}findTagByName$2.exports=findTagByName$1;findTagByName$2.exports.default=findTagByName$1;var findTagByNameExports=findTagByName$2.exports;const findTagByName=findTagByNameExports;function findTagsByName(ie,Z,ee){const ae=[],ye=ee&&ee.debug||!1,ve=ee&&typeof ee.nested=="boolean"?ee.nested:!0;let be=ee&&ee.startIndex||0,Ye;for(;Ye=findTagByName(ie,Z,{debug:ye,startIndex:be});)ve?be=Ye.start+1+Z.length:be=Ye.end,ae.push(Ye);return ye&&console.log("findTagsByName found",ae.length,"tags"),ae}findTagsByName$2.exports=findTagsByName;findTagsByName$2.exports.default=findTagsByName;var findTagsByNameExports=findTagsByName$2.exports;const findTagsByName$1=getDefaultExportFromCjs$1(findTagsByNameExports),fieldTagNames={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},fieldTags={};for(const ie in fieldTagNames)fieldTagNames.hasOwnProperty(ie)&&(fieldTags[fieldTagNames[ie]]=parseInt(ie,10));const arrayFields=[fieldTags.BitsPerSample,fieldTags.ExtraSamples,fieldTags.SampleFormat,fieldTags.StripByteCounts,fieldTags.StripOffsets,fieldTags.StripRowCounts,fieldTags.TileByteCounts,fieldTags.TileOffsets,fieldTags.SubIFDs],fieldTypeNames={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},fieldTypes={};for(const ie in fieldTypeNames)fieldTypeNames.hasOwnProperty(ie)&&(fieldTypes[fieldTypeNames[ie]]=parseInt(ie,10));const photometricInterpretations={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9},ExtraSamplesValues={Unspecified:0,Assocalpha:1,Unassalpha:2},LercParameters={Version:0,AddCompression:1},LercAddCompression={None:0,Deflate:1,Zstandard:2},geoKeyNames={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"};function fromWhiteIsZero(ie,Z){const{width:ee,height:ae}=ie,ye=new Uint8Array(ee*ae*3);let ve;for(let be=0,Ye=0;be>24,Ke=ie[ye+2]<<24>>24;let Xe=(be+16)/116,Je=Ye/500+Xe,rt=Xe-Ke/200,nt,it,lt;Je=Xn$1*(Je*Je*Je>.008856?Je*Je*Je:(Je-16/116)/7.787),Xe=Yn$1*(Xe*Xe*Xe>.008856?Xe*Xe*Xe:(Xe-16/116)/7.787),rt=Zn$1*(rt*rt*rt>.008856?rt*rt*rt:(rt-16/116)/7.787),nt=Je*3.2406+Xe*-1.5372+rt*-.4986,it=Je*-.9689+Xe*1.8758+rt*.0415,lt=Je*.0557+Xe*-.204+rt*1.057,nt=nt>.0031308?1.055*nt**(1/2.4)-.055:12.92*nt,it=it>.0031308?1.055*it**(1/2.4)-.055:12.92*it,lt=lt>.0031308?1.055*lt**(1/2.4)-.055:12.92*lt,ae[ve]=Math.max(0,Math.min(1,nt))*255,ae[ve+1]=Math.max(0,Math.min(1,it))*255,ae[ve+2]=Math.max(0,Math.min(1,lt))*255}return ae}const registry=new Map;function addDecoder(ie,Z){Array.isArray(ie)||(ie=[ie]),ie.forEach(ee=>registry.set(ee,Z))}async function getDecoder(ie){const Z=registry.get(ie.Compression);if(!Z)throw new Error(`Unknown compression method identifier: ${ie.Compression}`);const ee=await Z();return new ee(ie)}addDecoder([void 0,1],()=>__vitePreload(()=>import("./raw-_eObXrMO-z93--tm9.js"),__vite__mapDeps([0,1])).then(ie=>ie.default));addDecoder(5,()=>__vitePreload(()=>import("./lzw-5BnjP5Zu-Rtm9pMoi.js"),__vite__mapDeps([2,1])).then(ie=>ie.default));addDecoder(6,()=>{throw new Error("old style JPEG compression is not supported.")});addDecoder(7,()=>__vitePreload(()=>import("./jpeg-cL5qbLGO-DsQ9NELO.js"),__vite__mapDeps([3,1])).then(ie=>ie.default));addDecoder([8,32946],()=>__vitePreload(()=>import("./deflate-vcCR2g03-uJvqLAd5.js"),__vite__mapDeps([4,5,1])).then(ie=>ie.default));addDecoder(32773,()=>__vitePreload(()=>import("./packbits-QLsyzNt2-BPOn6aoD.js"),__vite__mapDeps([6,1])).then(ie=>ie.default));addDecoder(34887,()=>__vitePreload(()=>import("./lerc-uk49vBKp-C2xrmYNa.js"),__vite__mapDeps([7,5,1])).then(async ie=>(await ie.zstd.init(),ie)).then(ie=>ie.default));addDecoder(50001,()=>__vitePreload(()=>import("./webimage-Hf-HYtMO-Cer-ofJO.js"),__vite__mapDeps([8,1])).then(ie=>ie.default));function copyNewSize(ie,Z,ee,ae=1){return new(Object.getPrototypeOf(ie)).constructor(Z*ee*ae)}function resampleNearest(ie,Z,ee,ae,ye){const ve=Z/ae,be=ee/ye;return ie.map(Ye=>{const Ke=copyNewSize(Ye,ae,ye);for(let Xe=0;Xe{const Ke=copyNewSize(Ye,ae,ye);for(let Xe=0;Xe>8-ye-Qr&rt;else if(Qr+ye<=16)Je[mt]=Ye.getUint16(Yr)>>16-ye-Qr&rt;else if(Qr+ye<=24){const Xr=Ye.getUint16(Yr)<<8|Ye.getUint8(Yr+2);Je[mt]=Xr>>24-ye-Qr&rt}else Je[mt]=Ye.getUint32(Yr)>>32-ye-Qr&rt}}}}return Je.buffer}class GeoTIFFImage{constructor(Z,ee,ae,ye,ve,be){this.fileDirectory=Z,this.geoKeys=ee,this.dataView=ae,this.littleEndian=ye,this.tiles=ve?{}:null,this.isTiled=!Z.StripOffsets;const Ye=Z.PlanarConfiguration;if(this.planarConfiguration=typeof Ye>"u"?1:Ye,this.planarConfiguration!==1&&this.planarConfiguration!==2)throw new Error("Invalid planar configuration.");this.source=be}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return typeof this.fileDirectory.SamplesPerPixel<"u"?this.fileDirectory.SamplesPerPixel:1}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:typeof this.fileDirectory.RowsPerStrip<"u"?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBlockWidth(){return this.getTileWidth()}getBlockHeight(Z){return this.isTiled||(Z+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-Z*this.getTileHeight()}getBytesPerPixel(){let Z=0;for(let ee=0;ee=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${Z} is out of range.`);return Math.ceil(this.fileDirectory.BitsPerSample[Z]/8)}getReaderForSample(Z){const ee=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[Z]:1,ae=this.fileDirectory.BitsPerSample[Z];switch(ee){case 1:if(ae<=8)return DataView.prototype.getUint8;if(ae<=16)return DataView.prototype.getUint16;if(ae<=32)return DataView.prototype.getUint32;break;case 2:if(ae<=8)return DataView.prototype.getInt8;if(ae<=16)return DataView.prototype.getInt16;if(ae<=32)return DataView.prototype.getInt32;break;case 3:switch(ae){case 16:return function(ye,ve){return getFloat16(this,ye,ve)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}break}throw Error("Unsupported data format/bitsPerSample")}getSampleFormat(Z=0){return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[Z]:1}getBitsPerSample(Z=0){return this.fileDirectory.BitsPerSample[Z]}getArrayForSample(Z,ee){const ae=this.getSampleFormat(Z),ye=this.getBitsPerSample(Z);return arrayForType(ae,ye,ee)}async getTileOrStrip(Z,ee,ae,ye,ve){const be=Math.ceil(this.getWidth()/this.getTileWidth()),Ye=Math.ceil(this.getHeight()/this.getTileHeight());let Ke;const{tiles:Xe}=this;this.planarConfiguration===1?Ke=ee*be+Z:this.planarConfiguration===2&&(Ke=ae*be*Ye+ee*be+Z);let Je,rt;this.isTiled?(Je=this.fileDirectory.TileOffsets[Ke],rt=this.fileDirectory.TileByteCounts[Ke]):(Je=this.fileDirectory.StripOffsets[Ke],rt=this.fileDirectory.StripByteCounts[Ke]);const nt=(await this.source.fetch([{offset:Je,length:rt}],ve))[0];let it;return Xe===null||!Xe[Ke]?(it=(async()=>{let lt=await ye.decode(this.fileDirectory,nt);const ct=this.getSampleFormat(),ot=this.getBitsPerSample();return needsNormalization(ct,ot)&&(lt=normalizeArray(lt,ct,this.planarConfiguration,this.getSamplesPerPixel(),ot,this.getTileWidth(),this.getBlockHeight(ee))),lt})(),Xe!==null&&(Xe[Ke]=it)):it=Xe[Ke],{x:Z,y:ee,sample:ae,data:await it}}async _readRaster(Z,ee,ae,ye,ve,be,Ye,Ke,Xe){const Je=this.getTileWidth(),rt=this.getTileHeight(),nt=this.getWidth(),it=this.getHeight(),lt=Math.max(Math.floor(Z[0]/Je),0),ct=Math.min(Math.ceil(Z[2]/Je),Math.ceil(nt/Je)),ot=Math.max(Math.floor(Z[1]/rt),0),dt=Math.min(Math.ceil(Z[3]/rt),Math.ceil(it/rt)),ft=Z[2]-Z[0];let gt=this.getBytesPerPixel();const mt=[],Yr=[];for(let Jr=0;Jr{const hi=ii.data,ri=new DataView(hi),ci=this.getBlockHeight(ii.y),Si=ii.y*rt,si=ii.x*Je,Ei=Si+ci,yi=(ii.x+1)*Je,Mi=Yr[li],Ci=Math.min(ci,ci-(Ei-Z[3]),it-Si),Ri=Math.min(Je,Je-(yi-Z[2]),nt-si);for(let Ni=Math.max(0,Z[1]-Si);NiJe[2]||Je[1]>Je[3])throw new Error("Invalid subsets");const rt=Je[2]-Je[0],nt=Je[3]-Je[1],it=rt*nt,lt=this.getSamplesPerPixel();if(!ee||!ee.length)for(let dt=0;dt=lt)return Promise.reject(new RangeError(`Invalid sample index '${ee[dt]}'.`));let ct;if(ae){const dt=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,ft=Math.max.apply(null,this.fileDirectory.BitsPerSample);ct=arrayForType(dt,ft,it*ee.length),Ke&&ct.fill(Ke)}else{ct=[];for(let dt=0;dtXe[2]||Xe[1]>Xe[3])throw new Error("Invalid subsets");const Je=this.fileDirectory.PhotometricInterpretation;if(Je===photometricInterpretations.RGB){let dt=[0,1,2];if(this.fileDirectory.ExtraSamples!==ExtraSamplesValues.Unspecified&&Ye){dt=[];for(let ft=0;ftgetAttribute$1(ve,"sample")===void 0):ye=ye.filter(ve=>Number(getAttribute$1(ve,"sample"))===Z);for(let ve=0;ve[Ye+ye*ct+ve*ot,rt+Ke*ct+Xe*ot]),it=nt.map(ct=>ct[0]),lt=nt.map(ct=>ct[1]);return[Math.min(...it),Math.min(...lt),Math.max(...it),Math.max(...lt)]}else{const ye=this.getOrigin(),ve=this.getResolution(),be=ye[0],Ye=ye[1],Ke=be+ve[0]*ae,Xe=Ye+ve[1]*ee;return[Math.min(be,Ke),Math.min(Ye,Xe),Math.max(be,Ke),Math.max(Ye,Xe)]}}}class DataView64{constructor(Z){this._dataView=new DataView(Z)}get buffer(){return this._dataView.buffer}getUint64(Z,ee){const ae=this.getUint32(Z,ee),ye=this.getUint32(Z+4,ee);let ve;if(ee){if(ve=ae+2**32*ye,!Number.isSafeInteger(ve))throw new Error(`${ve} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return ve}if(ve=2**32*ae+ye,!Number.isSafeInteger(ve))throw new Error(`${ve} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return ve}getInt64(Z,ee){let ae=0;const ye=(this._dataView.getUint8(Z+(ee?7:0))&128)>0;let ve=!0;for(let be=0;be<8;be++){let Ye=this._dataView.getUint8(Z+(ee?be:7-be));ye&&(ve?Ye!==0&&(Ye=~(Ye-1)&255,ve=!1):Ye=~Ye&255),ae+=Ye*256**be}return ye&&(ae=-ae),ae}getUint8(Z,ee){return this._dataView.getUint8(Z,ee)}getInt8(Z,ee){return this._dataView.getInt8(Z,ee)}getUint16(Z,ee){return this._dataView.getUint16(Z,ee)}getInt16(Z,ee){return this._dataView.getInt16(Z,ee)}getUint32(Z,ee){return this._dataView.getUint32(Z,ee)}getInt32(Z,ee){return this._dataView.getInt32(Z,ee)}getFloat16(Z,ee){return getFloat16(this._dataView,Z,ee)}getFloat32(Z,ee){return this._dataView.getFloat32(Z,ee)}getFloat64(Z,ee){return this._dataView.getFloat64(Z,ee)}}class DataSlice{constructor(Z,ee,ae,ye){this._dataView=new DataView(Z),this._sliceOffset=ee,this._littleEndian=ae,this._bigTiff=ye}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(Z,ee){return this.sliceOffset<=Z&&this.sliceTop>=Z+ee}readUint8(Z){return this._dataView.getUint8(Z-this._sliceOffset,this._littleEndian)}readInt8(Z){return this._dataView.getInt8(Z-this._sliceOffset,this._littleEndian)}readUint16(Z){return this._dataView.getUint16(Z-this._sliceOffset,this._littleEndian)}readInt16(Z){return this._dataView.getInt16(Z-this._sliceOffset,this._littleEndian)}readUint32(Z){return this._dataView.getUint32(Z-this._sliceOffset,this._littleEndian)}readInt32(Z){return this._dataView.getInt32(Z-this._sliceOffset,this._littleEndian)}readFloat32(Z){return this._dataView.getFloat32(Z-this._sliceOffset,this._littleEndian)}readFloat64(Z){return this._dataView.getFloat64(Z-this._sliceOffset,this._littleEndian)}readUint64(Z){const ee=this.readUint32(Z),ae=this.readUint32(Z+4);let ye;if(this._littleEndian){if(ye=ee+2**32*ae,!Number.isSafeInteger(ye))throw new Error(`${ye} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return ye}if(ye=2**32*ee+ae,!Number.isSafeInteger(ye))throw new Error(`${ye} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return ye}readInt64(Z){let ee=0;const ae=(this._dataView.getUint8(Z+(this._littleEndian?7:0))&128)>0;let ye=!0;for(let ve=0;ve<8;ve++){let be=this._dataView.getUint8(Z+(this._littleEndian?ve:7-ve));ae&&(ye?be!==0&&(be=~(be-1)&255,ye=!1):be=~be&255),ee+=be*256**ve}return ae&&(ee=-ee),ee}readOffset(Z){return this._bigTiff?this.readUint64(Z):this.readUint32(Z)}}const defaultPoolSize=typeof navigator<"u"&&navigator.hardwareConcurrency||2;class Pool{constructor(Z=defaultPoolSize,ee){this.workers=null,this._awaitingDecoder=null,this.size=Z,this.messageId=0,Z&&(this._awaitingDecoder=ee?Promise.resolve(ee):new Promise(ae=>{__vitePreload(()=>import("./decoder-b0JuKe3x-CaSv2t6h.js"),[]).then(ye=>{ae(ye.create)})}),this._awaitingDecoder.then(ae=>{this._awaitingDecoder=null,this.workers=[];for(let ye=0;yeae.decode(Z,ee)):new Promise(ae=>{const ye=this.workers.find(Ye=>Ye.idle)||this.workers[Math.floor(Math.random()*this.size)];ye.idle=!1;const ve=this.messageId++,be=Ye=>{Ye.data.id===ve&&(ye.idle=!0,ae(Ye.data.decoded),ye.worker.removeEventListener("message",be))};ye.worker.addEventListener("message",be),ye.worker.postMessage({fileDirectory:Z,buffer:ee,id:ve},[ee])})}destroy(){this.workers&&(this.workers.forEach(Z=>{Z.worker.terminate()}),this.workers=null)}}const CRLFCRLF=`\r +\r +`;function itemsToObject(ie){if(typeof Object.fromEntries<"u")return Object.fromEntries(ie);const Z={};for(const[ee,ae]of ie)Z[ee.toLowerCase()]=ae;return Z}function parseHeaders(ie){const Z=ie.split(`\r +`).map(ee=>{const ae=ee.split(":").map(ye=>ye.trim());return ae[0]=ae[0].toLowerCase(),ae});return itemsToObject(Z)}function parseContentType(ie){const[Z,...ee]=ie.split(";").map(ye=>ye.trim()),ae=ee.map(ye=>ye.split("="));return{type:Z,params:itemsToObject(ae)}}function parseContentRange(ie){let Z,ee,ae;return ie&&([,Z,ee,ae]=ie.match(/bytes (\d+)-(\d+)\/(\d+)/),Z=parseInt(Z,10),ee=parseInt(ee,10),ae=parseInt(ae,10)),{start:Z,end:ee,total:ae}}function parseByteRanges(ie,Z){let ee=null;const ae=new TextDecoder("ascii"),ye=[],ve=`--${Z}`,be=`${ve}--`;for(let Ye=0;Ye<10;++Ye)ae.decode(new Uint8Array(ie,Ye,ve.length))===ve&&(ee=Ye);if(ee===null)throw new Error("Could not find initial boundary");for(;eethis.fetchSlice(ae,ee)))}async fetchSlice(Z){throw new Error(`fetching of slice ${Z} not possible, not implemented`)}get fileSize(){return null}async close(){}}class QuickLRU extends Map{constructor(Z={}){if(super(),!(Z.maxSize&&Z.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if(typeof Z.maxAge=="number"&&Z.maxAge===0)throw new TypeError("`maxAge` must be a number greater than 0");this.maxSize=Z.maxSize,this.maxAge=Z.maxAge||Number.POSITIVE_INFINITY,this.onEviction=Z.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_emitEvictions(Z){if(typeof this.onEviction=="function")for(const[ee,ae]of Z)this.onEviction(ee,ae.value)}_deleteIfExpired(Z,ee){return typeof ee.expiry=="number"&&ee.expiry<=Date.now()?(typeof this.onEviction=="function"&&this.onEviction(Z,ee.value),this.delete(Z)):!1}_getOrDeleteIfExpired(Z,ee){if(this._deleteIfExpired(Z,ee)===!1)return ee.value}_getItemValue(Z,ee){return ee.expiry?this._getOrDeleteIfExpired(Z,ee):ee.value}_peek(Z,ee){const ae=ee.get(Z);return this._getItemValue(Z,ae)}_set(Z,ee){this.cache.set(Z,ee),this._size++,this._size>=this.maxSize&&(this._size=0,this._emitEvictions(this.oldCache),this.oldCache=this.cache,this.cache=new Map)}_moveToRecent(Z,ee){this.oldCache.delete(Z),this._set(Z,ee)}*_entriesAscending(){for(const Z of this.oldCache){const[ee,ae]=Z;this.cache.has(ee)||this._deleteIfExpired(ee,ae)===!1&&(yield Z)}for(const Z of this.cache){const[ee,ae]=Z;this._deleteIfExpired(ee,ae)===!1&&(yield Z)}}get(Z){if(this.cache.has(Z)){const ee=this.cache.get(Z);return this._getItemValue(Z,ee)}if(this.oldCache.has(Z)){const ee=this.oldCache.get(Z);if(this._deleteIfExpired(Z,ee)===!1)return this._moveToRecent(Z,ee),ee.value}}set(Z,ee,{maxAge:ae=this.maxAge}={}){const ye=typeof ae=="number"&&ae!==Number.POSITIVE_INFINITY?Date.now()+ae:void 0;return this.cache.has(Z)?this.cache.set(Z,{value:ee,expiry:ye}):this._set(Z,{value:ee,expiry:ye}),this}has(Z){return this.cache.has(Z)?!this._deleteIfExpired(Z,this.cache.get(Z)):this.oldCache.has(Z)?!this._deleteIfExpired(Z,this.oldCache.get(Z)):!1}peek(Z){if(this.cache.has(Z))return this._peek(Z,this.cache);if(this.oldCache.has(Z))return this._peek(Z,this.oldCache)}delete(Z){const ee=this.cache.delete(Z);return ee&&this._size--,this.oldCache.delete(Z)||ee}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}resize(Z){if(!(Z&&Z>0))throw new TypeError("`maxSize` must be a number greater than 0");const ee=[...this._entriesAscending()],ae=ee.length-Z;ae<0?(this.cache=new Map(ee),this.oldCache=new Map,this._size=ee.length):(ae>0&&this._emitEvictions(ee.slice(0,ae)),this.oldCache=new Map(ee.slice(ae)),this.cache=new Map,this._size=0),this.maxSize=Z}*keys(){for(const[Z]of this)yield Z}*values(){for(const[,Z]of this)yield Z}*[Symbol.iterator](){for(const Z of this.cache){const[ee,ae]=Z;this._deleteIfExpired(ee,ae)===!1&&(yield[ee,ae.value])}for(const Z of this.oldCache){const[ee,ae]=Z;this.cache.has(ee)||this._deleteIfExpired(ee,ae)===!1&&(yield[ee,ae.value])}}*entriesDescending(){let Z=[...this.cache];for(let ee=Z.length-1;ee>=0;--ee){const ae=Z[ee],[ye,ve]=ae;this._deleteIfExpired(ye,ve)===!1&&(yield[ye,ve.value])}Z=[...this.oldCache];for(let ee=Z.length-1;ee>=0;--ee){const ae=Z[ee],[ye,ve]=ae;this.cache.has(ye)||this._deleteIfExpired(ye,ve)===!1&&(yield[ye,ve.value])}}*entriesAscending(){for(const[Z,ee]of this._entriesAscending())yield[Z,ee.value]}get size(){if(!this._size)return this.oldCache.size;let Z=0;for(const ee of this.oldCache.keys())this.cache.has(ee)||Z++;return Math.min(this._size+Z,this.maxSize)}entries(){return this.entriesAscending()}forEach(Z,ee=this){for(const[ae,ye]of this.entriesAscending())Z.call(ee,ye,ae,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}}async function wait(ie){return new Promise(Z=>setTimeout(Z,ie))}function zip(ie,Z){const ee=Array.isArray(ie)?ie:Array.from(ie),ae=Array.isArray(Z)?Z:Array.from(Z);return ee.map((ye,ve)=>[ye,ae[ve]])}class AbortError extends Error{constructor(Z){super(Z),Error.captureStackTrace&&Error.captureStackTrace(this,AbortError),this.name="AbortError"}}class CustomAggregateError extends Error{constructor(Z,ee){super(ee),this.errors=Z,this.message=ee,this.name="AggregateError"}}const AggregateError=CustomAggregateError;class Block{constructor(Z,ee,ae=null){this.offset=Z,this.length=ee,this.data=ae}get top(){return this.offset+this.length}}class BlockGroup{constructor(Z,ee,ae){this.offset=Z,this.length=ee,this.blockIds=ae}}class BlockedSource extends BaseSource{constructor(Z,{blockSize:ee=65536,cacheSize:ae=100}={}){super(),this.source=Z,this.blockSize=ee,this.blockCache=new QuickLRU({maxSize:ae,onEviction:(ye,ve)=>{this.evictedBlocks.set(ye,ve)}}),this.evictedBlocks=new Map,this.blockRequests=new Map,this.blockIdsToFetch=new Set,this.abortedBlockIds=new Set}get fileSize(){return this.source.fileSize}async fetch(Z,ee){const ae=[],ye=[],ve=[];this.evictedBlocks.clear();for(const{offset:nt,length:it}of Z){let lt=nt+it;const{fileSize:ct}=this;ct!==null&&(lt=Math.min(lt,ct));const ot=Math.floor(nt/this.blockSize)*this.blockSize;for(let dt=ot;dtthis.abortedBlockIds.has(nt)||!this.blockCache.has(nt));if(Ke.forEach(nt=>this.blockIdsToFetch.add(nt)),Ke.length>0&&ee&&!ee.aborted){this.fetchBlocks(null);for(const nt of Ke){const it=this.blockRequests.get(nt);if(!it)throw new Error(`Block ${nt} is not in the block requests`);Ye.push(it)}await Promise.allSettled(Ye)}if(ee&&ee.aborted)throw new AbortError("Request was aborted");const Xe=ve.map(nt=>this.blockCache.get(nt)||this.evictedBlocks.get(nt)),Je=Xe.filter(nt=>!nt);if(Je.length)throw new AggregateError(Je,"Request failed");const rt=new Map(zip(ve,Xe));return this.readSliceData(Z,rt)}fetchBlocks(Z){if(this.blockIdsToFetch.size>0){const ee=this.groupBlocks(this.blockIdsToFetch),ae=this.source.fetch(ee,Z);for(let ye=0;ye{try{const Ye=(await ae)[ye],Ke=be*this.blockSize,Xe=Ke-Ye.offset,Je=Math.min(Xe+this.blockSize,Ye.data.byteLength),rt=Ye.data.slice(Xe,Je),nt=new Block(Ke,rt.byteLength,rt,be);this.blockCache.set(be,nt),this.abortedBlockIds.delete(be)}catch(Ye){if(Ye.name==="AbortError")Ye.signal=Z,this.blockCache.delete(be),this.abortedBlockIds.add(be);else throw Ye}finally{this.blockRequests.delete(be)}})())}this.blockIdsToFetch.clear()}}groupBlocks(Z){const ee=Array.from(Z).sort((be,Ye)=>be-Ye);if(ee.length===0)return[];let ae=[],ye=null;const ve=[];for(const be of ee)ye===null||ye+1===be?(ae.push(be),ye=be):(ve.push(new BlockGroup(ae[0]*this.blockSize,ae.length*this.blockSize,ae)),ae=[be],ye=be);return ve.push(new BlockGroup(ae[0]*this.blockSize,ae.length*this.blockSize,ae)),ve}readSliceData(Z,ee){return Z.map(ae=>{let ye=ae.offset+ae.length;this.fileSize!==null&&(ye=Math.min(this.fileSize,ye));const ve=Math.floor(ae.offset/this.blockSize),be=Math.floor(ye/this.blockSize),Ye=new ArrayBuffer(ae.length),Ke=new Uint8Array(Ye);for(let Xe=ve;Xe<=be;++Xe){const Je=ee.get(Xe),rt=Je.offset-ae.offset,nt=Je.top-ye;let it=0,lt=0,ct;rt<0?it=-rt:rt>0&&(lt=rt),nt<0?ct=Je.length-it:ct=ye-Je.offset-it;const ot=new Uint8Array(Je.data,it,ct);Ke.set(ot,lt)}return Ye})}}class BaseResponse{get ok(){return this.status>=200&&this.status<=299}get status(){throw new Error("not implemented")}getHeader(Z){throw new Error("not implemented")}async getData(){throw new Error("not implemented")}}class BaseClient{constructor(Z){this.url=Z}async request({headers:Z,signal:ee}={}){throw new Error("request is not implemented")}}class FetchResponse extends BaseResponse{constructor(Z){super(),this.response=Z}get status(){return this.response.status}getHeader(Z){return this.response.headers.get(Z)}async getData(){return this.response.arrayBuffer?await this.response.arrayBuffer():(await this.response.buffer()).buffer}}class FetchClient extends BaseClient{constructor(Z,ee){super(Z),this.credentials=ee}async request({headers:Z,signal:ee}={}){const ae=await fetch(this.url,{headers:Z,credentials:this.credentials,signal:ee});return new FetchResponse(ae)}}class XHRResponse extends BaseResponse{constructor(Z,ee){super(),this.xhr=Z,this.data=ee}get status(){return this.xhr.status}getHeader(Z){return this.xhr.getResponseHeader(Z)}async getData(){return this.data}}class XHRClient extends BaseClient{constructRequest(Z,ee){return new Promise((ae,ye)=>{const ve=new XMLHttpRequest;ve.open("GET",this.url),ve.responseType="arraybuffer";for(const[be,Ye]of Object.entries(Z))ve.setRequestHeader(be,Ye);ve.onload=()=>{const be=ve.response;ae(new XHRResponse(ve,be))},ve.onerror=ye,ve.onabort=()=>ye(new AbortError("Request aborted")),ve.send(),ee&&(ee.aborted&&ve.abort(),ee.addEventListener("abort",()=>ve.abort()))})}async request({headers:Z,signal:ee}={}){return await this.constructRequest(Z,ee)}}const fs={},__viteBrowserExternal=Object.freeze(Object.defineProperty({__proto__:null,default:fs},Symbol.toStringTag,{value:"Module"}));class HttpResponse extends BaseResponse{constructor(Z,ee){super(),this.response=Z,this.dataPromise=ee}get status(){return this.response.statusCode}getHeader(Z){return this.response.headers[Z]}async getData(){return await this.dataPromise}}class HttpClient extends BaseClient{constructor(Z){super(Z),this.parsedUrl=fs.parse(this.url),this.httpApi=(this.parsedUrl.protocol,fs)}constructRequest(Z,ee){return new Promise((ae,ye)=>{const ve=this.httpApi.get({...this.parsedUrl,headers:Z},be=>{const Ye=new Promise(Ke=>{const Xe=[];be.on("data",Je=>{Xe.push(Je)}),be.on("end",()=>{const Je=Buffer.concat(Xe).buffer;Ke(Je)}),be.on("error",ye)});ae(new HttpResponse(be,Ye))});ve.on("error",ye),ee&&(ee.aborted&&ve.destroy(new AbortError("Request aborted")),ee.addEventListener("abort",()=>ve.destroy(new AbortError("Request aborted"))))})}async request({headers:Z,signal:ee}={}){return await this.constructRequest(Z,ee)}}class RemoteSource extends BaseSource{constructor(Z,ee,ae,ye){super(),this.client=Z,this.headers=ee,this.maxRanges=ae,this.allowFullFile=ye,this._fileSize=null}async fetch(Z,ee){return this.maxRanges>=Z.length?this.fetchSlices(Z,ee):(this.maxRanges>0&&Z.length>1,Promise.all(Z.map(ae=>this.fetchSlice(ae,ee))))}async fetchSlices(Z,ee){const ae=await this.client.request({headers:{...this.headers,Range:`bytes=${Z.map(({offset:ye,length:ve})=>`${ye}-${ye+ve}`).join(",")}`},signal:ee});if(ae.ok)if(ae.status===206){const{type:ye,params:ve}=parseContentType(ae.getHeader("content-type"));if(ye==="multipart/byteranges"){const rt=parseByteRanges(await ae.getData(),ve.boundary);return this._fileSize=rt[0].fileSize||null,rt}const be=await ae.getData(),{start:Ye,end:Ke,total:Xe}=parseContentRange(ae.getHeader("content-range"));this._fileSize=Xe||null;const Je=[{data:be,offset:Ye,length:Ke-Ye}];if(Z.length>1){const rt=await Promise.all(Z.slice(1).map(nt=>this.fetchSlice(nt,ee)));return Je.concat(rt)}return Je}else{if(!this.allowFullFile)throw new Error("Server responded with full file");const ye=await ae.getData();return this._fileSize=ye.byteLength,[{data:ye,offset:0,length:ye.byteLength}]}else throw new Error("Error fetching data.")}async fetchSlice(Z,ee){const{offset:ae,length:ye}=Z,ve=await this.client.request({headers:{...this.headers,Range:`bytes=${ae}-${ae+ye}`},signal:ee});if(ve.ok)if(ve.status===206){const be=await ve.getData(),{total:Ye}=parseContentRange(ve.getHeader("content-range"));return this._fileSize=Ye||null,{data:be,offset:ae,length:ye}}else{if(!this.allowFullFile)throw new Error("Server responded with full file");const be=await ve.getData();return this._fileSize=be.byteLength,{data:be,offset:0,length:be.byteLength}}else throw new Error("Error fetching data.")}get fileSize(){return this._fileSize}}function maybeWrapInBlockedSource(ie,{blockSize:Z,cacheSize:ee}){return Z===null?ie:new BlockedSource(ie,{blockSize:Z,cacheSize:ee})}function makeFetchSource(ie,{headers:Z={},credentials:ee,maxRanges:ae=0,allowFullFile:ye=!1,...ve}={}){const be=new FetchClient(ie,ee),Ye=new RemoteSource(be,Z,ae,ye);return maybeWrapInBlockedSource(Ye,ve)}function makeXHRSource(ie,{headers:Z={},maxRanges:ee=0,allowFullFile:ae=!1,...ye}={}){const ve=new XHRClient(ie),be=new RemoteSource(ve,Z,ee,ae);return maybeWrapInBlockedSource(be,ye)}function makeHttpSource(ie,{headers:Z={},maxRanges:ee=0,allowFullFile:ae=!1,...ye}={}){const ve=new HttpClient(ie),be=new RemoteSource(ve,Z,ee,ae);return maybeWrapInBlockedSource(be,ye)}function makeRemoteSource(ie,{forceXHR:Z=!1,...ee}={}){return typeof fetch=="function"&&!Z?makeFetchSource(ie,ee):typeof XMLHttpRequest<"u"?makeXHRSource(ie,ee):makeHttpSource(ie,ee)}class FileReaderSource extends BaseSource{constructor(Z){super(),this.file=Z}async fetchSlice(Z,ee){return new Promise((ae,ye)=>{const ve=this.file.slice(Z.offset,Z.offset+Z.length),be=new FileReader;be.onload=Ye=>ae(Ye.target.result),be.onerror=ye,be.onabort=ye,be.readAsArrayBuffer(ve),ee&&ee.addEventListener("abort",()=>be.abort())})}}function makeFileReaderSource(ie){return new FileReaderSource(ie)}function getFieldTypeLength(ie){switch(ie){case fieldTypes.BYTE:case fieldTypes.ASCII:case fieldTypes.SBYTE:case fieldTypes.UNDEFINED:return 1;case fieldTypes.SHORT:case fieldTypes.SSHORT:return 2;case fieldTypes.LONG:case fieldTypes.SLONG:case fieldTypes.FLOAT:case fieldTypes.IFD:return 4;case fieldTypes.RATIONAL:case fieldTypes.SRATIONAL:case fieldTypes.DOUBLE:case fieldTypes.LONG8:case fieldTypes.SLONG8:case fieldTypes.IFD8:return 8;default:throw new RangeError(`Invalid field type: ${ie}`)}}function parseGeoKeyDirectory(ie){const Z=ie.GeoKeyDirectory;if(!Z)return null;const ee={};for(let ae=4;ae<=Z[3]*4;ae+=4){const ye=geoKeyNames[Z[ae]],ve=Z[ae+1]?fieldTagNames[Z[ae+1]]:null,be=Z[ae+2],Ye=Z[ae+3];let Ke=null;if(!ve)Ke=Ye;else{if(Ke=ie[ve],typeof Ke>"u"||Ke===null)throw new Error(`Could not get value of geoKey '${ye}'.`);typeof Ke=="string"?Ke=Ke.substring(Ye,Ye+be-1):Ke.subarray&&(Ke=Ke.subarray(Ye,Ye+be),be===1&&(Ke=Ke[0]))}ee[ye]=Ke}return ee}function getValues(ie,Z,ee,ae){let ye=null,ve=null;const be=getFieldTypeLength(Z);switch(Z){case fieldTypes.BYTE:case fieldTypes.ASCII:case fieldTypes.UNDEFINED:ye=new Uint8Array(ee),ve=ie.readUint8;break;case fieldTypes.SBYTE:ye=new Int8Array(ee),ve=ie.readInt8;break;case fieldTypes.SHORT:ye=new Uint16Array(ee),ve=ie.readUint16;break;case fieldTypes.SSHORT:ye=new Int16Array(ee),ve=ie.readInt16;break;case fieldTypes.LONG:case fieldTypes.IFD:ye=new Uint32Array(ee),ve=ie.readUint32;break;case fieldTypes.SLONG:ye=new Int32Array(ee),ve=ie.readInt32;break;case fieldTypes.LONG8:case fieldTypes.IFD8:ye=new Array(ee),ve=ie.readUint64;break;case fieldTypes.SLONG8:ye=new Array(ee),ve=ie.readInt64;break;case fieldTypes.RATIONAL:ye=new Uint32Array(ee*2),ve=ie.readUint32;break;case fieldTypes.SRATIONAL:ye=new Int32Array(ee*2),ve=ie.readInt32;break;case fieldTypes.FLOAT:ye=new Float32Array(ee),ve=ie.readFloat32;break;case fieldTypes.DOUBLE:ye=new Float64Array(ee),ve=ie.readFloat64;break;default:throw new RangeError(`Invalid field type: ${Z}`)}if(Z===fieldTypes.RATIONAL||Z===fieldTypes.SRATIONAL)for(let Ye=0;Yelt.getWidth()-ct.getWidth());for(let lt=0;ltot||be&&be>dt)break}}let nt=ee;if(Ye){const[it,lt]=Ke.getOrigin(),[ct,ot]=Xe.getResolution(Ke);nt=[Math.round((Ye[0]-it)/ct),Math.round((Ye[1]-lt)/ot),Math.round((Ye[2]-it)/ct),Math.round((Ye[3]-lt)/ot)],nt=[Math.min(nt[0],nt[2]),Math.min(nt[1],nt[3]),Math.max(nt[0],nt[2]),Math.max(nt[1],nt[3])]}return Xe.readRasters({...Z,window:nt})}}class GeoTIFF extends GeoTIFFBase{constructor(Z,ee,ae,ye,ve={}){super(),this.source=Z,this.littleEndian=ee,this.bigTiff=ae,this.firstIFDOffset=ye,this.cache=ve.cache||!1,this.ifdRequests=[],this.ghostValues=null}async getSlice(Z,ee){const ae=this.bigTiff?4048:1024;return new DataSlice((await this.source.fetch([{offset:Z,length:typeof ee<"u"?ee:ae}]))[0],Z,this.littleEndian,this.bigTiff)}async parseFileDirectoryAt(Z){const ee=this.bigTiff?20:12,ae=this.bigTiff?8:2;let ye=await this.getSlice(Z);const ve=this.bigTiff?ye.readUint64(Z):ye.readUint16(Z),be=ve*ee+(this.bigTiff?16:6);ye.covers(Z,be)||(ye=await this.getSlice(Z,be));const Ye={};let Ke=Z+(this.bigTiff?8:2);for(let rt=0;rt{const ee=await this.ifdRequests[Z-1];if(ee.nextIFDByteOffset===0)throw new GeoTIFFImageIndexError(Z);return this.parseFileDirectoryAt(ee.nextIFDByteOffset)})(),this.ifdRequests[Z]}async getImage(Z=0){const ee=await this.requestIFD(Z);return new GeoTIFFImage(ee.fileDirectory,ee.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source)}async getImageCount(){let Z=0,ee=!0;for(;ee;)try{await this.requestIFD(Z),++Z}catch(ae){if(ae instanceof GeoTIFFImageIndexError)ee=!1;else throw ae}return Z}async getGhostValues(){const Z=this.bigTiff?16:8;if(this.ghostValues)return this.ghostValues;const ee="GDAL_STRUCTURAL_METADATA_SIZE=",ae=ee.length+100;let ye=await this.getSlice(Z,ae);if(ee===getValues(ye,fieldTypes.ASCII,ee.length,Z)){const ve=getValues(ye,fieldTypes.ASCII,ae,Z).split(` +`)[0],be=Number(ve.split("=")[1].split(" ")[0])+ve.length;be>ae&&(ye=await this.getSlice(Z,be));const Ye=getValues(ye,fieldTypes.ASCII,be,Z);this.ghostValues={},Ye.split(` +`).filter(Ke=>Ke.length>0).map(Ke=>Ke.split("=")).forEach(([Ke,Xe])=>{this.ghostValues[Ke]=Xe})}return this.ghostValues}static async fromSource(Z,ee,ae){const ye=(await Z.fetch([{offset:0,length:1024}],ae))[0],ve=new DataView64(ye),be=ve.getUint16(0,0);let Ye;if(be===18761)Ye=!0;else if(be===19789)Ye=!1;else throw new TypeError("Invalid byte order value.");const Ke=ve.getUint16(2,Ye);let Xe;if(Ke===42)Xe=!1;else if(Ke===43){if(Xe=!0,ve.getUint16(4,Ye)!==8)throw new Error("Unsupported offset byte-size.")}else throw new TypeError("Invalid magic number.");const Je=Xe?ve.getUint64(8,Ye):ve.getUint32(4,Ye);return new GeoTIFF(Z,Ye,Xe,Je,ee)}close(){return typeof this.source.close=="function"?this.source.close():!1}}class MultiGeoTIFF extends GeoTIFFBase{constructor(Z,ee){super(),this.mainFile=Z,this.overviewFiles=ee,this.imageFiles=[Z].concat(ee),this.fileDirectoriesPerFile=null,this.fileDirectoriesPerFileParsing=null,this.imageCount=null}async parseFileDirectoriesPerFile(){const Z=[this.mainFile.parseFileDirectoryAt(this.mainFile.firstIFDOffset)].concat(this.overviewFiles.map(ee=>ee.parseFileDirectoryAt(ee.firstIFDOffset)));return this.fileDirectoriesPerFile=await Promise.all(Z),this.fileDirectoriesPerFile}async getImage(Z=0){await this.getImageCount(),await this.parseFileDirectoriesPerFile();let ee=0,ae=0;for(let ye=0;yeee.getImageCount()));return this.imageCounts=await Promise.all(Z),this.imageCount=this.imageCounts.reduce((ee,ae)=>ee+ae,0),this.imageCount}}async function fromUrl(ie,Z={},ee){return GeoTIFF.fromSource(makeRemoteSource(ie,Z),ee)}async function fromBlob(ie,Z){return GeoTIFF.fromSource(makeFileReaderSource(ie),Z)}async function fromUrls(ie,Z=[],ee={},ae){const ye=await GeoTIFF.fromSource(makeRemoteSource(ie,ee),ae),ve=await Promise.all(Z.map(be=>GeoTIFF.fromSource(makeRemoteSource(be,ee))));return new MultiGeoTIFF(ye,ve)}function isMask(ie){return((ie.fileDirectory.NewSubfileType||0)&4)===4}function readRGB(ie,Z){if(!ie)return!1;if(ie===!0)return!0;if(Z.getSamplesPerPixel()!==3)return!1;const ee=Z.fileDirectory.PhotometricInterpretation,ae=photometricInterpretations;return ee===ae.CMYK||ee===ae.YCbCr||ee===ae.CIELab||ee===ae.ICCLab}const STATISTICS_MAXIMUM="STATISTICS_MAXIMUM",STATISTICS_MINIMUM="STATISTICS_MINIMUM",defaultTileSize=256;let workerPool;function getWorkerPool(){return workerPool||(workerPool=new Pool),workerPool}function getBoundingBox(ie){try{return ie.getBoundingBox()}catch{return[0,0,ie.getWidth(),ie.getHeight()]}}function getOrigin(ie){try{return ie.getOrigin().slice(0,2)}catch{return[0,ie.getHeight()]}}function getResolutions(ie,Z){try{return ie.getResolution(Z)}catch{return[Z.getWidth()/ie.getWidth(),Z.getHeight()/ie.getHeight()]}}function getProjection(ie){const Z=ie.geoKeys;if(!Z)return null;if(Z.ProjectedCSTypeGeoKey&&Z.ProjectedCSTypeGeoKey!==32767){const ee="EPSG:"+Z.ProjectedCSTypeGeoKey;let ae=get$1(ee);if(!ae){const ye=fromCode(Z.ProjLinearUnitsGeoKey);ye&&(ae=new Projection({code:ee,units:ye}))}return ae}if(Z.GeographicTypeGeoKey&&Z.GeographicTypeGeoKey!==32767){const ee="EPSG:"+Z.GeographicTypeGeoKey;let ae=get$1(ee);if(!ae){const ye=fromCode(Z.GeogAngularUnitsGeoKey);ye&&(ae=new Projection({code:ee,units:ye}))}return ae}return null}function getImagesForTIFF(ie){return ie.getImageCount().then(function(Z){const ee=new Array(Z);for(let ae=0;aeee*ie)throw new Error(ae)}function getMinForDataType(ie){return ie instanceof Int8Array?-128:ie instanceof Int16Array?-32768:ie instanceof Int32Array?-2147483648:ie instanceof Float32Array?12e-39:0}function getMaxForDataType(ie){return ie instanceof Int8Array?127:ie instanceof Uint8Array||ie instanceof Uint8ClampedArray?255:ie instanceof Int16Array?32767:ie instanceof Uint16Array?65535:ie instanceof Int32Array?2147483647:ie instanceof Uint32Array?4294967295:ie instanceof Float32Array?34e37:255}class GeoTIFFSource extends DataTileSource{constructor(Z){super({state:"loading",tileGrid:null,projection:Z.projection||null,opaque:Z.opaque,transition:Z.transition,interpolate:Z.interpolate!==!1,wrapX:Z.wrapX}),this.sourceInfo_=Z.sources;const ee=this.sourceInfo_.length;this.sourceOptions_=Z.sourceOptions,this.sourceImagery_=new Array(ee),this.sourceMasks_=new Array(ee),this.resolutionFactors_=new Array(ee),this.samplesPerPixel_,this.nodataValues_,this.metadata_,this.normalize_=Z.normalize!==!1,this.addAlpha_=!1,this.error_=null,this.convertToRGB_=Z.convertToRGB||!1,this.setKey(this.sourceInfo_.map(ve=>ve.url).join(","));const ae=this,ye=new Array(ee);for(let ve=0;ve=0;--ae){const ye=ee[ae],ve=getProjection(ye);if(ve){this.projection=ve;break}}}configure_(Z){let ee,ae,ye,ve,be;const Ye=new Array(Z.length),Ke=new Array(Z.length),Xe=new Array(Z.length);let Je=0;const rt=Z.length;for(let ct=0;ct{isMask(Jr)?dt.push(Jr):ot.push(Jr)});const ft=ot.length;if(dt.length>0&&dt.length!==ft)throw new Error(`Expected one mask per image found ${dt.length} masks and ${ft} images`);let gt,mt;const Yr=new Array(ft),Qr=new Array(ft),Xr=new Array(ft);Ke[ct]=new Array(ft),Xe[ct]=new Array(ft);for(let Jr=0;JrXr.length&&(Je=be.length-Xr.length);const Jr=be[be.length-1]/Xr[Xr.length-1];this.resolutionFactors_[ct]=Jr;const ai=Xr.map(ni=>ni*=Jr),oi=`Resolution mismatch for source ${ct}, got [${ai}] but expected [${be}]`;assertEqual(be.slice(Je,be.length),ai,.02,oi,this.viewRejector)}ye?assertEqual(ye.slice(Je,ye.length),Qr,.01,`Tile size mismatch for source ${ct}`,this.viewRejector):ye=Qr,ve?assertEqual(ve.slice(Je,ve.length),Yr,0,`Tile size mismatch for source ${ct}`,this.viewRejector):ve=Yr,this.sourceImagery_[ct]=ot.reverse(),this.sourceMasks_[ct]=dt.reverse()}for(let ct=0,ot=this.sourceImagery_.length;ct{this.uniforms_.push({value:Z.uniforms[be],location:ee.getUniformLocation(this.renderTargetProgram_,be)})})}getGL(){return this.gl_}init(Z){const ee=this.getGL(),ae=[ee.drawingBufferWidth*this.scaleRatio_,ee.drawingBufferHeight*this.scaleRatio_];if(ee.bindFramebuffer(ee.FRAMEBUFFER,this.getFrameBuffer()),ee.bindRenderbuffer(ee.RENDERBUFFER,this.getDepthBuffer()),ee.viewport(0,0,ae[0],ae[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==ae[0]||this.renderTargetTextureSize_[1]!==ae[1]){this.renderTargetTextureSize_=ae;const ye=0,ve=ee.RGBA,be=0,Ye=ee.RGBA,Ke=ee.UNSIGNED_BYTE;ee.bindTexture(ee.TEXTURE_2D,this.renderTargetTexture_),ee.texImage2D(ee.TEXTURE_2D,ye,ve,ae[0],ae[1],be,Ye,Ke,null),ee.texParameteri(ee.TEXTURE_2D,ee.TEXTURE_MIN_FILTER,ee.LINEAR),ee.texParameteri(ee.TEXTURE_2D,ee.TEXTURE_WRAP_S,ee.CLAMP_TO_EDGE),ee.texParameteri(ee.TEXTURE_2D,ee.TEXTURE_WRAP_T,ee.CLAMP_TO_EDGE),ee.framebufferTexture2D(ee.FRAMEBUFFER,ee.COLOR_ATTACHMENT0,ee.TEXTURE_2D,this.renderTargetTexture_,0),ee.renderbufferStorage(ee.RENDERBUFFER,ee.DEPTH_COMPONENT16,ae[0],ae[1]),ee.framebufferRenderbuffer(ee.FRAMEBUFFER,ee.DEPTH_ATTACHMENT,ee.RENDERBUFFER,this.depthBuffer_)}}apply(Z,ee,ae,ye){const ve=this.getGL(),be=Z.size;if(ve.bindFramebuffer(ve.FRAMEBUFFER,ee?ee.getFrameBuffer():null),ve.activeTexture(ve.TEXTURE0),ve.bindTexture(ve.TEXTURE_2D,this.renderTargetTexture_),!ee){const Ke=getUid(ve.canvas);if(!Z.renderTargets[Ke]){const Xe=ve.getContextAttributes();Xe&&Xe.preserveDrawingBuffer&&(ve.clearColor(0,0,0,0),ve.clearDepth(1),ve.clear(ve.COLOR_BUFFER_BIT|ve.DEPTH_BUFFER_BIT)),Z.renderTargets[Ke]=!0}}ve.disable(ve.DEPTH_TEST),ve.enable(ve.BLEND),ve.blendFunc(ve.ONE,ve.ONE_MINUS_SRC_ALPHA),ve.viewport(0,0,ve.drawingBufferWidth,ve.drawingBufferHeight),ve.bindBuffer(ve.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),ve.useProgram(this.renderTargetProgram_),ve.enableVertexAttribArray(this.renderTargetAttribLocation_),ve.vertexAttribPointer(this.renderTargetAttribLocation_,2,ve.FLOAT,!1,0,0),ve.uniform2f(this.renderTargetUniformLocation_,be[0],be[1]),ve.uniform1i(this.renderTargetTextureLocation_,0);const Ye=Z.layerStatesArray[Z.layerIndex].opacity;ve.uniform1f(this.renderTargetOpacityLocation_,Ye),this.applyUniforms(Z),ae&&ae(ve,Z),ve.drawArrays(ve.TRIANGLES,0,6),ye&&ye(ve,Z)}getFrameBuffer(){return this.frameBuffer_}getDepthBuffer(){return this.depthBuffer_}applyUniforms(Z){const ee=this.getGL();let ae,ye=1;this.uniforms_.forEach(function(ve){if(ae=typeof ve.value=="function"?ve.value(Z):ve.value,ae instanceof HTMLCanvasElement||ae instanceof ImageData)ve.texture||(ve.texture=ee.createTexture()),ee.activeTexture(ee[`TEXTURE${ye}`]),ee.bindTexture(ee.TEXTURE_2D,ve.texture),ee.texParameteri(ee.TEXTURE_2D,ee.TEXTURE_MIN_FILTER,ee.LINEAR),ee.texParameteri(ee.TEXTURE_2D,ee.TEXTURE_WRAP_S,ee.CLAMP_TO_EDGE),ee.texParameteri(ee.TEXTURE_2D,ee.TEXTURE_WRAP_T,ee.CLAMP_TO_EDGE),ae instanceof ImageData?ee.texImage2D(ee.TEXTURE_2D,0,ee.RGBA,ee.RGBA,ae.width,ae.height,0,ee.UNSIGNED_BYTE,new Uint8Array(ae.data)):ee.texImage2D(ee.TEXTURE_2D,0,ee.RGBA,ee.RGBA,ee.UNSIGNED_BYTE,ae),ee.uniform1i(ve.location,ye++);else if(Array.isArray(ae))switch(ae.length){case 2:ee.uniform2f(ve.location,ae[0],ae[1]);return;case 3:ee.uniform3f(ve.location,ae[0],ae[1],ae[2]);return;case 4:ee.uniform4f(ve.location,ae[0],ae[1],ae[2],ae[3]);return;default:return}else typeof ae=="number"&&ee.uniform1f(ve.location,ae)})}}function create$1(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function fromTransform(ie,Z){return ie[0]=Z[0],ie[1]=Z[1],ie[4]=Z[2],ie[5]=Z[3],ie[12]=Z[4],ie[13]=Z[5],ie}const DefaultUniform={PROJECTION_MATRIX:"u_projectionMatrix",SCREEN_TO_WORLD_MATRIX:"u_screenToWorldMatrix",TIME:"u_time",ZOOM:"u_zoom",RESOLUTION:"u_resolution",ROTATION:"u_rotation",VIEWPORT_SIZE_PX:"u_viewportSizePx",PIXEL_RATIO:"u_pixelRatio",HIT_DETECTION:"u_hitDetection"},AttributeType={UNSIGNED_BYTE,UNSIGNED_SHORT,UNSIGNED_INT,FLOAT},canvasCache={};function getSharedCanvasCacheKey(ie){return"shared/"+ie}let uniqueCanvasCacheKeyCount=0;function getUniqueCanvasCacheKey(){const ie="unique/"+uniqueCanvasCacheKeyCount;return uniqueCanvasCacheKeyCount+=1,ie}function getOrCreateContext(ie){let Z=canvasCache[ie];if(!Z){const ee=document.createElement("canvas");ee.width=1,ee.height=1,ee.style.position="absolute",ee.style.left="0",Z={users:0,context:getContext(ee)},canvasCache[ie]=Z}return Z.users+=1,Z.context}function releaseCanvas(ie){const Z=canvasCache[ie];if(!Z||(Z.users-=1,Z.users>0))return;const ee=Z.context,ae=ee.getExtension("WEBGL_lose_context");ae&&ae.loseContext();const ye=ee.canvas;ye.width=1,ye.height=1,delete canvasCache[ie]}class WebGLHelper extends Disposable{constructor(Z){super(),Z=Z||{},this.boundHandleWebGLContextLost_=this.handleWebGLContextLost.bind(this),this.boundHandleWebGLContextRestored_=this.handleWebGLContextRestored.bind(this),this.canvasCacheKey_=Z.canvasCacheKey?getSharedCanvasCacheKey(Z.canvasCacheKey):getUniqueCanvasCacheKey(),this.gl_=getOrCreateContext(this.canvasCacheKey_),this.bufferCache_={},this.extensionCache_={},this.currentProgram_=null,this.needsToBeRecreated_=!1;const ee=this.gl_.canvas;ee.addEventListener(ContextEventType.LOST,this.boundHandleWebGLContextLost_),ee.addEventListener(ContextEventType.RESTORED,this.boundHandleWebGLContextRestored_),this.offsetRotateMatrix_=create$2(),this.offsetScaleMatrix_=create$2(),this.tmpMat4_=create$1(),this.uniformLocationsByProgram_={},this.attribLocationsByProgram_={},this.uniforms_=[],Z.uniforms&&this.setUniforms(Z.uniforms),this.postProcessPasses_=Z.postProcesses?Z.postProcesses.map(ae=>new WebGLPostProcessingPass({webGlContext:this.gl_,scaleRatio:ae.scaleRatio,vertexShader:ae.vertexShader,fragmentShader:ae.fragmentShader,uniforms:ae.uniforms})):[new WebGLPostProcessingPass({webGlContext:this.gl_})],this.shaderCompileErrors_=null,this.startTime_=Date.now()}setUniforms(Z){this.uniforms_=[],this.addUniforms(Z)}addUniforms(Z){for(const ee in Z)this.uniforms_.push({name:ee,value:Z[ee]})}canvasCacheKeyMatches(Z){return this.canvasCacheKey_===getSharedCanvasCacheKey(Z)}getExtension(Z){if(Z in this.extensionCache_)return this.extensionCache_[Z];const ee=this.gl_.getExtension(Z);return this.extensionCache_[Z]=ee,ee}bindBuffer(Z){const ee=this.gl_,ae=getUid(Z);let ye=this.bufferCache_[ae];if(!ye){const ve=ee.createBuffer();ye={buffer:Z,webGlBuffer:ve},this.bufferCache_[ae]=ye}ee.bindBuffer(Z.getType(),ye.webGlBuffer)}flushBufferData(Z){const ee=this.gl_;this.bindBuffer(Z),ee.bufferData(Z.getType(),Z.getArray(),Z.getUsage())}deleteBuffer(Z){const ee=this.gl_,ae=getUid(Z),ye=this.bufferCache_[ae];ye&&!ee.isContextLost()&&ee.deleteBuffer(ye.webGlBuffer),delete this.bufferCache_[ae]}disposeInternal(){const Z=this.gl_.canvas;Z.removeEventListener(ContextEventType.LOST,this.boundHandleWebGLContextLost_),Z.removeEventListener(ContextEventType.RESTORED,this.boundHandleWebGLContextRestored_),releaseCanvas(this.canvasCacheKey_),delete this.gl_}prepareDraw(Z,ee,ae){const ye=this.gl_,ve=this.getCanvas(),be=Z.size,Ye=Z.pixelRatio;(ve.width!==be[0]*Ye||ve.height!==be[1]*Ye)&&(ve.width=be[0]*Ye,ve.height=be[1]*Ye,ve.style.width=be[0]+"px",ve.style.height=be[1]+"px");for(let Ke=this.postProcessPasses_.length-1;Ke>=0;Ke--)this.postProcessPasses_[Ke].init(Z);ye.bindTexture(ye.TEXTURE_2D,null),ye.clearColor(0,0,0,0),ye.depthRange(0,1),ye.clearDepth(1),ye.clear(ye.COLOR_BUFFER_BIT|ye.DEPTH_BUFFER_BIT),ye.enable(ye.BLEND),ye.blendFunc(ye.ONE,ee?ye.ZERO:ye.ONE_MINUS_SRC_ALPHA),ae?(ye.enable(ye.DEPTH_TEST),ye.depthFunc(ye.LEQUAL)):ye.disable(ye.DEPTH_TEST)}bindTexture(Z,ee,ae){const ye=this.gl_;ye.activeTexture(ye.TEXTURE0+ee),ye.bindTexture(ye.TEXTURE_2D,Z),ye.uniform1i(this.getUniformLocation(ae),ee)}prepareDrawToRenderTarget(Z,ee,ae,ye){const ve=this.gl_,be=ee.getSize();ve.bindFramebuffer(ve.FRAMEBUFFER,ee.getFramebuffer()),ve.bindRenderbuffer(ve.RENDERBUFFER,ee.getDepthbuffer()),ve.viewport(0,0,be[0],be[1]),ve.bindTexture(ve.TEXTURE_2D,ee.getTexture()),ve.clearColor(0,0,0,0),ve.depthRange(0,1),ve.clearDepth(1),ve.clear(ve.COLOR_BUFFER_BIT|ve.DEPTH_BUFFER_BIT),ve.enable(ve.BLEND),ve.blendFunc(ve.ONE,ae?ve.ZERO:ve.ONE_MINUS_SRC_ALPHA),ye?(ve.enable(ve.DEPTH_TEST),ve.depthFunc(ve.LEQUAL)):ve.disable(ve.DEPTH_TEST)}drawElements(Z,ee){const ae=this.gl_;this.getExtension("OES_element_index_uint");const ye=ae.UNSIGNED_INT,ve=4,be=ee-Z,Ye=Z*ve;ae.drawElements(ae.TRIANGLES,be,ye,Ye)}finalizeDraw(Z,ee,ae){for(let ye=0,ve=this.postProcessPasses_.length;ye{if(ae=typeof ve.value=="function"?ve.value(Z):ve.value,ae instanceof HTMLCanvasElement||ae instanceof HTMLImageElement||ae instanceof ImageData)ve.texture||(ve.prevValue=void 0,ve.texture=ee.createTexture()),this.bindTexture(ve.texture,ye,ve.name),ee.texParameteri(ee.TEXTURE_2D,ee.TEXTURE_MIN_FILTER,ee.LINEAR),ee.texParameteri(ee.TEXTURE_2D,ee.TEXTURE_WRAP_S,ee.CLAMP_TO_EDGE),ee.texParameteri(ee.TEXTURE_2D,ee.TEXTURE_WRAP_T,ee.CLAMP_TO_EDGE),(!(ae instanceof HTMLImageElement)||ae.complete)&&ve.prevValue!==ae&&(ve.prevValue=ae,ee.texImage2D(ee.TEXTURE_2D,0,ee.RGBA,ee.RGBA,ee.UNSIGNED_BYTE,ae)),ye++;else if(Array.isArray(ae)&&ae.length===6)this.setUniformMatrixValue(ve.name,fromTransform(this.tmpMat4_,ae));else if(Array.isArray(ae)&&ae.length<=4)switch(ae.length){case 2:ee.uniform2f(this.getUniformLocation(ve.name),ae[0],ae[1]);return;case 3:ee.uniform3f(this.getUniformLocation(ve.name),ae[0],ae[1],ae[2]);return;case 4:ee.uniform4f(this.getUniformLocation(ve.name),ae[0],ae[1],ae[2],ae[3]);return;default:return}else typeof ae=="number"&&ee.uniform1f(this.getUniformLocation(ve.name),ae)})}useProgram(Z,ee){this.gl_.useProgram(Z),this.currentProgram_=Z,this.applyFrameState(ee),this.applyUniforms(ee)}compileShader(Z,ee){const ae=this.gl_,ye=ae.createShader(ee);return ae.shaderSource(ye,Z),ae.compileShader(ye),ye}getProgram(Z,ee){const ae=this.gl_,ye=this.compileShader(Z,ae.FRAGMENT_SHADER),ve=this.compileShader(ee,ae.VERTEX_SHADER),be=ae.createProgram();if(ae.attachShader(be,ye),ae.attachShader(be,ve),ae.linkProgram(be),!ae.getShaderParameter(ye,ae.COMPILE_STATUS)){const Ye=`Fragment shader compilation failed: ${ae.getShaderInfoLog(ye)}`;throw new Error(Ye)}if(ae.deleteShader(ye),!ae.getShaderParameter(ve,ae.COMPILE_STATUS)){const Ye=`Vertex shader compilation failed: ${ae.getShaderInfoLog(ve)}`;throw new Error(Ye)}if(ae.deleteShader(ve),!ae.getProgramParameter(be,ae.LINK_STATUS)){const Ye=`GL program linking failed: ${ae.getProgramInfoLog(be)}`;throw new Error(Ye)}return be}getUniformLocation(Z){const ee=getUid(this.currentProgram_);return this.uniformLocationsByProgram_[ee]===void 0&&(this.uniformLocationsByProgram_[ee]={}),this.uniformLocationsByProgram_[ee][Z]===void 0&&(this.uniformLocationsByProgram_[ee][Z]=this.gl_.getUniformLocation(this.currentProgram_,Z)),this.uniformLocationsByProgram_[ee][Z]}getAttributeLocation(Z){const ee=getUid(this.currentProgram_);return this.attribLocationsByProgram_[ee]===void 0&&(this.attribLocationsByProgram_[ee]={}),this.attribLocationsByProgram_[ee][Z]===void 0&&(this.attribLocationsByProgram_[ee][Z]=this.gl_.getAttribLocation(this.currentProgram_,Z)),this.attribLocationsByProgram_[ee][Z]}makeProjectionTransform(Z,ee){const ae=Z.size,ye=Z.viewState.rotation,ve=Z.viewState.resolution,be=Z.viewState.center;return compose$1(ee,0,0,2/(ve*ae[0]),2/(ve*ae[1]),-ye,-be[0],-be[1]),ee}setUniformFloatValue(Z,ee){this.gl_.uniform1f(this.getUniformLocation(Z),ee)}setUniformFloatVec2(Z,ee){this.gl_.uniform2fv(this.getUniformLocation(Z),ee)}setUniformFloatVec4(Z,ee){this.gl_.uniform4fv(this.getUniformLocation(Z),ee)}setUniformMatrixValue(Z,ee){this.gl_.uniformMatrix4fv(this.getUniformLocation(Z),!1,ee)}enableAttributeArray_(Z,ee,ae,ye,ve){const be=this.getAttributeLocation(Z);be<0||(this.gl_.enableVertexAttribArray(be),this.gl_.vertexAttribPointer(be,ee,ae,!1,ye,ve))}enableAttributes(Z){const ee=computeAttributesStride(Z);let ae=0;for(let ye=0;ye=ct;--ot){const dt=Xe.getTileRangeForExtentAndZ(ee,ot,this.tempTileRange_),ft=Xe.getResolution(ot);for(let gt=dt.minX;gt<=dt.maxX;++gt)for(let mt=dt.minY;mt<=dt.maxY;++mt){const Yr=createOrUpdate$1(ot,gt,mt,this.tempTileCoord_),Qr=getCacheKey(Ke,Yr);let Xr,Jr;if(it.containsKey(Qr)&&(Xr=it.get(Qr),Jr=Xr.tile),(!Xr||Xr.tile.key!==Ke.getKey())&&(Jr=Ke.getTile(ot,gt,mt,Z.pixelRatio,be.projection)),lookupHasTile(ye,Jr))continue;if(!Xr)Xr=this.createTileRepresentation({tile:Jr,grid:Xe,helper:this.helper,gutter:Je}),it.set(Qr,Xr);else if(this.isDrawableTile_(Jr))Xr.setTile(Jr);else{const oi=Jr.getInterimTile();Xr.setTile(oi)}addTileRepresentationToLookup(ye,Xr,ot);const ai=Jr.getKey();nt[ai]=!0,Jr.getState()===TileState.IDLE&&(Z.tileQueue.isKeyQueued(ai)||Z.tileQueue.enqueue([Jr,rt,Xe.getTileCoordCenter(Yr),ft]))}}}beforeTilesRender(Z,ee){this.helper.prepareDraw(this.frameState,!ee,!0)}renderTile(Z,ee,ae,ye,ve,be,Ye,Ke,Xe,Je,rt){}drawTile_(Z,ee,ae,ye,ve,be,Ye){if(!ee.loaded)return;const Ke=ee.tile.tileCoord,Xe=getKey(Ke),Je=Xe in be?be[Xe]:1,rt=Ye.getResolution(ae),nt=toSize(Ye.getTileSize(ae),this.tempSize_),it=Ye.getOrigin(ae),lt=Ye.getTileCoordExtent(Ke),ct=Je<1?-1:depthForZ(ae);Je<1&&(Z.animate=!0);const ot=Z.viewState,dt=ot.center[0],ft=ot.center[1],gt=nt[0]+2*ye,mt=nt[1]+2*ye,Yr=gt/mt,Qr=(dt-it[0])/(nt[0]*rt),Xr=(it[1]-ft)/(nt[1]*rt),Jr=ot.resolution/rt,ai=Ke[1],oi=Ke[2];reset(this.tileTransform_),scale$3(this.tileTransform_,2/(Z.size[0]*Jr/gt),-2/(Z.size[1]*Jr/gt)),rotate$3(this.tileTransform_,ot.rotation),scale$3(this.tileTransform_,1,1/Yr),translate$1(this.tileTransform_,(nt[0]*(ai-Qr)-ye)/gt,(nt[1]*(oi-Xr)-ye)/mt),this.renderTile(ee,this.tileTransform_,Z,ve,rt,nt,it,lt,ct,ye,Je)}renderFrame(Z){this.frameState=Z,this.renderComplete=!0;const ee=this.helper.getGL();this.preRender(ee,Z);const ae=Z.viewState,ye=this.getLayer(),ve=ye.getRenderSource(),be=ve.getTileGridForProjection(ae.projection),Ye=ve.getGutterForProjection(ae.projection),Ke=getRenderExtent(Z,Z.extent),Xe=be.getZForResolution(ae.resolution,ve.zDirection),Je=newTileRepresentationLookup(),rt=ye.getPreload();if(Z.nextExtent){const Yr=be.getZForResolution(ae.nextResolution,ve.zDirection),Qr=getRenderExtent(Z,Z.nextExtent);this.enqueueTiles(Z,Qr,Yr,Je,rt)}this.enqueueTiles(Z,Ke,Xe,Je,0),rt>0&&setTimeout(()=>{this.enqueueTiles(Z,Ke,Xe-1,Je,rt-1)},0);const nt={},it=getUid(this),lt=Z.time;let ct=!1;for(const Yr of Je.representationsByZ[Xe]){const Qr=Yr.tile;if((Qr instanceof ReprojTile||Qr instanceof ReprojDataTile)&&Qr.getState()===TileState.EMPTY)continue;const Xr=Qr.tileCoord;if(Yr.loaded){const ai=Qr.getAlpha(it,lt);if(ai===1){Qr.endTransition(it);continue}ct=!0;const oi=getKey(Xr);nt[oi]=ai}if(this.renderComplete=!1,this.findAltTiles_(be,Xr,Xe+1,Je))continue;const Jr=be.getMinZoom();for(let ai=Xe-1;ai>=Jr&&!this.findAltTiles_(be,Xr,ai,Je);--ai);}this.beforeTilesRender(Z,ct);const ot=Je.representationsByZ,dt=Object.keys(ot).map(Number).sort(descending);for(let Yr=0,Qr=dt.length;Yree.dispose()),Z.clear()}removeHelper(){this.helper&&this.clearCache(),super.removeHelper()}disposeInternal(){super.disposeInternal(),delete this.frameState}}const Uniforms={...Uniforms$1,TILE_TEXTURE_ARRAY:"u_tileTextures",TEXTURE_PIXEL_WIDTH:"u_texturePixelWidth",TEXTURE_PIXEL_HEIGHT:"u_texturePixelHeight",TEXTURE_RESOLUTION:"u_textureResolution",TEXTURE_ORIGIN_X:"u_textureOriginX",TEXTURE_ORIGIN_Y:"u_textureOriginY"},Attributes={TEXTURE_COORD:"a_textureCoord"},attributeDescriptions=[{name:Attributes.TEXTURE_COORD,size:2,type:AttributeType.FLOAT}];class WebGLTileLayerRenderer extends WebGLBaseTileLayerRenderer{constructor(Z,ee){super(Z,ee),this.program_,this.vertexShader_=ee.vertexShader,this.fragmentShader_=ee.fragmentShader,this.indices_=new WebGLArrayBuffer(ELEMENT_ARRAY_BUFFER,STATIC_DRAW),this.indices_.fromArray([0,1,3,1,2,3]),this.paletteTextures_=ee.paletteTextures||[]}reset(Z){super.reset(Z),this.vertexShader_=Z.vertexShader,this.fragmentShader_=Z.fragmentShader,this.helper&&(this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_))}afterHelperCreated(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.helper.flushBufferData(this.indices_)}createTileRepresentation(Z){return new TileTexture(Z)}beforeTilesRender(Z,ee){super.beforeTilesRender(Z,ee),this.helper.useProgram(this.program_,Z)}renderTile(Z,ee,ae,ye,ve,be,Ye,Ke,Xe,Je,rt){const nt=this.helper.getGL();this.helper.bindBuffer(Z.coords),this.helper.bindBuffer(this.indices_),this.helper.enableAttributes(attributeDescriptions);let it=0;for(;it0&&(mt=Ke,getIntersection(mt,ye,mt)),this.helper.setUniformFloatVec4(Uniforms.RENDER_EXTENT,mt),this.helper.setUniformFloatValue(Uniforms.RESOLUTION,lt.resolution),this.helper.setUniformFloatValue(Uniforms.ZOOM,lt.zoom),this.helper.setUniformFloatValue(Uniforms.TEXTURE_PIXEL_WIDTH,ct),this.helper.setUniformFloatValue(Uniforms.TEXTURE_PIXEL_HEIGHT,ot),this.helper.setUniformFloatValue(Uniforms.TEXTURE_RESOLUTION,ve),this.helper.setUniformFloatValue(Uniforms.TEXTURE_ORIGIN_X,Ye[0]+ft*be[0]*ve-Je*ve),this.helper.setUniformFloatValue(Uniforms.TEXTURE_ORIGIN_Y,Ye[1]-gt*be[1]*ve+Je*ve),this.helper.drawElements(0,this.indices_.getSize())}getData(Z){if(!this.helper.getGL())return null;const ee=this.frameState;if(!ee)return null;const ae=this.getLayer(),ye=apply(ee.pixelToCoordinateTransform,Z.slice()),ve=ee.viewState,be=ae.getExtent();if(be&&!containsCoordinate(fromUserExtent(be,ve.projection),ye))return null;const Ye=ae.getSources(boundingExtent([ye]),ve.resolution);let Ke,Xe,Je;for(Ke=Ye.length-1;Ke>=0;--Ke)if(Xe=Ye[Ke],Xe.getState()==="ready"){if(Je=Xe.getTileGridForProjection(ve.projection),Xe.getWrapX())break;const nt=Je.getExtent();if(!nt||containsCoordinate(nt,ye))break}if(Ke<0)return null;const rt=this.tileRepresentationCache;for(let nt=Je.getZForResolution(ve.resolution);nt>=Je.getMinZoom();--nt){const it=Je.getTileCoordForCoordAndZ(ye,nt),lt=getCacheKey(Xe,it);if(!rt.containsKey(lt))continue;const ct=rt.get(lt),ot=ct.tile;if((ot instanceof ReprojTile||ot instanceof ReprojDataTile)&&ot.getState()===TileState.EMPTY)return null;if(!ct.loaded)continue;const dt=Je.getOrigin(nt),ft=toSize(Je.getTileSize(nt)),gt=Je.getResolution(nt),mt=(ye[0]-dt[0])/gt-it[1]*ft[0],Yr=(dt[1]-ye[1])/gt-it[2]*ft[1];return ct.getPixelData(mt,Yr)}return null}disposeInternal(){const Z=this.helper;Z&&(Z.getGL().deleteProgram(this.program_),delete this.program_,Z.deleteBuffer(this.indices_)),super.disposeInternal(),delete this.indices_}}class PaletteTexture{constructor(Z,ee){this.name=Z,this.data=ee,this.texture_=null}getTexture(Z){if(!this.texture_){const ee=Z.createTexture();Z.bindTexture(Z.TEXTURE_2D,ee),Z.texParameteri(Z.TEXTURE_2D,Z.TEXTURE_WRAP_S,Z.CLAMP_TO_EDGE),Z.texParameteri(Z.TEXTURE_2D,Z.TEXTURE_WRAP_T,Z.CLAMP_TO_EDGE),Z.texParameteri(Z.TEXTURE_2D,Z.TEXTURE_MIN_FILTER,Z.NEAREST),Z.texParameteri(Z.TEXTURE_2D,Z.TEXTURE_MAG_FILTER,Z.NEAREST),Z.texImage2D(Z.TEXTURE_2D,0,Z.RGBA,this.data.length/4,1,0,Z.RGBA,Z.UNSIGNED_BYTE,this.data),this.texture_=ee}return this.texture_}}const ValueTypes={NUMBER:1,STRING:2,COLOR:4,BOOLEAN:8,NUMBER_ARRAY:16,ANY:31,NONE:0};function getTypeFromHint(ie){switch(ie){case"string":return ValueTypes.STRING;case"color":return ValueTypes.COLOR;case"number":return ValueTypes.NUMBER;case"boolean":return ValueTypes.BOOLEAN;case"number[]":return ValueTypes.NUMBER_ARRAY;default:throw new Error(`Unrecognized type hint: ${ie}`)}}const Operators={};function getValueType(ie){if(typeof ie=="number")return ValueTypes.NUMBER;if(typeof ie=="boolean")return ValueTypes.BOOLEAN;if(typeof ie=="string")return isStringColor(ie)?ValueTypes.COLOR|ValueTypes.STRING:ValueTypes.STRING;if(!Array.isArray(ie))throw new Error(`Unhandled value type: ${JSON.stringify(ie)}`);const Z=ie;if(Z.every(function(ae){return typeof ae=="number"}))return Z.length===3||Z.length===4?ValueTypes.COLOR|ValueTypes.NUMBER_ARRAY:ValueTypes.NUMBER_ARRAY;if(typeof Z[0]!="string")throw new Error(`Expected an expression operator but received: ${JSON.stringify(Z)}`);const ee=Operators[Z[0]];if(ee===void 0)throw new Error(`Unrecognized expression operator: ${JSON.stringify(Z)}`);return ee.getReturnType(Z.slice(1))}function isTypeUnique(ie){return Math.log2(ie)%1===0}function printTypes(ie){const Z=[];return(ie&ValueTypes.NUMBER)>0&&Z.push("number"),(ie&ValueTypes.COLOR)>0&&Z.push("color"),(ie&ValueTypes.BOOLEAN)>0&&Z.push("boolean"),(ie&ValueTypes.NUMBER_ARRAY)>0&&Z.push("number[]"),(ie&ValueTypes.STRING)>0&&Z.push("string"),Z.length>0?Z.join(", "):"(no type)"}function computeOperatorFunctionName(ie,Z){return`operator_${ie}_${Object.keys(Z.functions).length}`}function numberToGlsl(ie){const Z=ie.toString();return Z.includes(".")?Z:Z+".0"}function arrayToGlsl(ie){if(ie.length<2||ie.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return`vec${ie.length}(${ie.map(numberToGlsl).join(", ")})`}function colorToGlsl(ie){const Z=asArray(ie),ee=Z.length>3?Z[3]:1;return arrayToGlsl([Z[0]/255*ee,Z[1]/255*ee,Z[2]/255*ee,ee])}const stringToFloatMap={};let stringToFloatCounter=0;function getStringNumberEquivalent(ie){return ie in stringToFloatMap||(stringToFloatMap[ie]=stringToFloatCounter++),stringToFloatMap[ie]}function stringToGlsl(ie){return numberToGlsl(getStringNumberEquivalent(ie))}function expressionToGlsl(ie,Z,ee){const ae=ee!==void 0?ee:ValueTypes.NUMBER;if(Array.isArray(Z)&&typeof Z[0]=="string"){const ve=Operators[Z[0]];if(ve===void 0)throw new Error(`Unrecognized expression operator: ${JSON.stringify(Z)}`);return ve.toGlsl(ie,Z.slice(1),ae)}const ye=getValueType(Z)&ae;if(assertNotEmptyType(Z,ye,""),(ye&ValueTypes.NUMBER)>0)return numberToGlsl(Z);if((ye&ValueTypes.BOOLEAN)>0)return Z.toString();if((ye&ValueTypes.STRING)>0)return stringToGlsl(Z.toString());if((ye&ValueTypes.COLOR)>0)return colorToGlsl(Z);if((ye&ValueTypes.NUMBER_ARRAY)>0)return arrayToGlsl(Z);throw new Error(`Unexpected expression ${Z} (expected type ${printTypes(ae)})`)}function assertNumber(ie){if(!(getValueType(ie)&ValueTypes.NUMBER))throw new Error(`A numeric value was expected, got ${JSON.stringify(ie)} instead`)}function assertNumbers(ie){for(let Z=0;ZZ)throw new Error(`At most ${Z} arguments were expected, got ${ie.length} instead`)}function assertArgsEven(ie){if(ie.length%2!==0)throw new Error(`An even amount of arguments was expected, got ${JSON.stringify(ie)} instead`)}function assertArgsOdd(ie){if(ie.length%2===0)throw new Error(`An odd amount of arguments was expected, got ${JSON.stringify(ie)} instead`)}function assertNotEmptyType(ie,Z,ee){if(Z===ValueTypes.NONE)throw new Error(`No matching type was found for the following expression ${ee}: ${JSON.stringify(ie)}`)}function assertSingleType(ie,Z,ee){if(assertNotEmptyType(ie,Z,ee),!isTypeUnique(Z))throw new Error(`Expected to have a unique type for the following expression ${ee}: ${JSON.stringify(ie)} +Got the following types instead: ${printTypes(Z)}`)}function assertOfType(ie,Z,ee,ae){if((Z&ee)===ValueTypes.NONE)throw new Error(`Expected the ${ae} type of the following expression: ${JSON.stringify(ie)} to be of the following types: ${printTypes(ee)} +Got these types instead: ${printTypes(Z)}`)}Operators.get={getReturnType:function(ie){if(ie.length===2){const Z=ie[1];return getTypeFromHint(Z)}return ValueTypes.ANY},toGlsl:function(ie,Z,ee){assertArgsMinCount(Z,1),assertArgsMaxCount(Z,2),assertString(Z[0]);const ae=ee&Operators.get.getReturnType(Z);assertSingleType(["get",...Z],ae,"");const ye=Z[0].toString(),ve=ie.attributes.find(be=>be.name===ye);if(!ve)ie.attributes.push({name:ye,type:ae});else if(ae!==ve.type)throw new Error(`The following attribute was used in different places with incompatible types: ${ye} +Types were: ${printTypes(ve.type)} and ${printTypes(ae)}`);return(ie.inFragmentShader?"v_":"a_")+ye}};function uniformNameForVariable(ie){return"u_var_"+ie}Operators.var={getReturnType:function(){return ValueTypes.ANY},toGlsl:function(ie,Z,ee){assertArgsCount(Z,1),assertString(Z[0]);const ae=Z[0].toString();if(!ie.style.variables||ie.style.variables[ae]===void 0)throw new Error(`The following variable is missing from the style: ${ae}`);const ye=ie.style.variables[ae],ve=ee&getValueType(ye);assertSingleType(["var",...Z],ve,"");const be=ie.variables.find(Ye=>Ye.name===ae);if(!be)ie.variables.push({name:ae,type:ve});else if(ve!==be.type)throw new Error(`The following variable was used in different places with incompatible types: ${ae} +Types were: ${printTypes(be.type)} and ${printTypes(ve)}`);return uniformNameForVariable(ae)}};const PALETTE_TEXTURE_ARRAY="u_paletteTextures";Operators.palette={getReturnType:function(){return ValueTypes.COLOR},toGlsl:function(ie,Z){assertArgsCount(Z,2),assertNumber(Z[0]);const ee=expressionToGlsl(ie,Z[0]),ae=Z[1];if(!Array.isArray(ae))throw new Error("The second argument of palette must be an array");const ye=ae.length,ve=new Uint8Array(ye*4);for(let Ke=0;Ke{const ve=ye.getType();switch(ve){case"Point":case"LineString":case"Polygon":return ve;case"MultiPoint":case"MultiLineString":case"MultiPolygon":return ve.substring(5);case"Circle":return"Polygon";case"GeometryCollection":return ae(ye.getGeometries()[0])}};return ie.attributes.find(ye=>ye.name===ee)||ie.attributes.push({name:ee,type:ValueTypes.STRING,callback:ye=>ae(ye.getGeometry())}),(ie.inFragmentShader?"v_":"a_")+ee}};Operators["*"]={getReturnType:function(ie){let Z=ValueTypes.NUMBER|ValueTypes.COLOR;for(let ee=0;eeexpressionToGlsl(ie,ye,ae)).join(" * ")})`}};Operators["/"]={getReturnType:function(){return ValueTypes.NUMBER},toGlsl:function(ie,Z){return assertArgsCount(Z,2),assertNumbers(Z),`(${expressionToGlsl(ie,Z[0])} / ${expressionToGlsl(ie,Z[1])})`}};Operators["+"]={getReturnType:function(){return ValueTypes.NUMBER},toGlsl:function(ie,Z){return assertArgsMinCount(Z,2),assertNumbers(Z),`(${Z.map(ee=>expressionToGlsl(ie,ee)).join(" + ")})`}};Operators["-"]={getReturnType:function(){return ValueTypes.NUMBER},toGlsl:function(ie,Z){return assertArgsCount(Z,2),assertNumbers(Z),`(${expressionToGlsl(ie,Z[0])} - ${expressionToGlsl(ie,Z[1])})`}};Operators.clamp={getReturnType:function(){return ValueTypes.NUMBER},toGlsl:function(ie,Z){assertArgsCount(Z,3),assertNumbers(Z);const ee=expressionToGlsl(ie,Z[1]),ae=expressionToGlsl(ie,Z[2]);return`clamp(${expressionToGlsl(ie,Z[0])}, ${ee}, ${ae})`}};Operators["%"]={getReturnType:function(){return ValueTypes.NUMBER},toGlsl:function(ie,Z){return assertArgsCount(Z,2),assertNumbers(Z),`mod(${expressionToGlsl(ie,Z[0])}, ${expressionToGlsl(ie,Z[1])})`}};Operators["^"]={getReturnType:function(){return ValueTypes.NUMBER},toGlsl:function(ie,Z){return assertArgsCount(Z,2),assertNumbers(Z),`pow(${expressionToGlsl(ie,Z[0])}, ${expressionToGlsl(ie,Z[1])})`}};Operators.abs={getReturnType:function(){return ValueTypes.NUMBER},toGlsl:function(ie,Z){return assertArgsCount(Z,1),assertNumbers(Z),`abs(${expressionToGlsl(ie,Z[0])})`}};Operators.floor={getReturnType:function(){return ValueTypes.NUMBER},toGlsl:function(ie,Z){return assertArgsCount(Z,1),assertNumbers(Z),`floor(${expressionToGlsl(ie,Z[0])})`}};Operators.round={getReturnType:function(){return ValueTypes.NUMBER},toGlsl:function(ie,Z){return assertArgsCount(Z,1),assertNumbers(Z),`floor(${expressionToGlsl(ie,Z[0])} + 0.5)`}};Operators.ceil={getReturnType:function(){return ValueTypes.NUMBER},toGlsl:function(ie,Z){return assertArgsCount(Z,1),assertNumbers(Z),`ceil(${expressionToGlsl(ie,Z[0])})`}};Operators.sin={getReturnType:function(){return ValueTypes.NUMBER},toGlsl:function(ie,Z){return assertArgsCount(Z,1),assertNumbers(Z),`sin(${expressionToGlsl(ie,Z[0])})`}};Operators.cos={getReturnType:function(){return ValueTypes.NUMBER},toGlsl:function(ie,Z){return assertArgsCount(Z,1),assertNumbers(Z),`cos(${expressionToGlsl(ie,Z[0])})`}};Operators.atan={getReturnType:function(){return ValueTypes.NUMBER},toGlsl:function(ie,Z){return assertArgsMinCount(Z,1),assertArgsMaxCount(Z,2),assertNumbers(Z),Z.length===2?`atan(${expressionToGlsl(ie,Z[0])}, ${expressionToGlsl(ie,Z[1])})`:`atan(${expressionToGlsl(ie,Z[0])})`}};Operators.sqrt={getReturnType:function(){return ValueTypes.NUMBER},toGlsl:function(ie,Z){return assertArgsCount(Z,1),assertNumbers(Z),`sqrt(${expressionToGlsl(ie,Z[0])})`}};Operators[">"]={getReturnType:function(){return ValueTypes.BOOLEAN},toGlsl:function(ie,Z){return assertArgsCount(Z,2),assertNumbers(Z),`(${expressionToGlsl(ie,Z[0])} > ${expressionToGlsl(ie,Z[1])})`}};Operators[">="]={getReturnType:function(){return ValueTypes.BOOLEAN},toGlsl:function(ie,Z){return assertArgsCount(Z,2),assertNumbers(Z),`(${expressionToGlsl(ie,Z[0])} >= ${expressionToGlsl(ie,Z[1])})`}};Operators["<"]={getReturnType:function(){return ValueTypes.BOOLEAN},toGlsl:function(ie,Z){return assertArgsCount(Z,2),assertNumbers(Z),`(${expressionToGlsl(ie,Z[0])} < ${expressionToGlsl(ie,Z[1])})`}};Operators["<="]={getReturnType:function(){return ValueTypes.BOOLEAN},toGlsl:function(ie,Z){return assertArgsCount(Z,2),assertNumbers(Z),`(${expressionToGlsl(ie,Z[0])} <= ${expressionToGlsl(ie,Z[1])})`}};function getEqualOperator(ie){return{getReturnType:function(){return ValueTypes.BOOLEAN},toGlsl:function(Z,ee){assertArgsCount(ee,2);let ae=ValueTypes.ANY;for(let ye=0;yeexpressionToGlsl(Z,ye,ValueTypes.BOOLEAN)).join(` ${ie} `);return ae=`(${ae})`,ae}}}Operators.all=getDecisionOperator("&&");Operators.any=getDecisionOperator("||");Operators.between={getReturnType:function(){return ValueTypes.BOOLEAN},toGlsl:function(ie,Z){assertArgsCount(Z,3),assertNumbers(Z);const ee=expressionToGlsl(ie,Z[1]),ae=expressionToGlsl(ie,Z[2]),ye=expressionToGlsl(ie,Z[0]);return`(${ye} >= ${ee} && ${ye} <= ${ae})`}};Operators.array={getReturnType:function(){return ValueTypes.NUMBER_ARRAY},toGlsl:function(ie,Z){assertArgsMinCount(Z,2),assertArgsMaxCount(Z,4),assertNumbers(Z);const ee=Z.map(function(ae){return expressionToGlsl(ie,ae)});return`vec${Z.length}(${ee.join(", ")})`}};Operators.color={getReturnType:function(){return ValueTypes.COLOR},toGlsl:function(ie,Z){assertArgsMinCount(Z,3),assertArgsMaxCount(Z,4),assertNumbers(Z);const ee=Z.slice(0,3).map(ae=>`${expressionToGlsl(ie,ae)} / 255.0`);return Z.length===3?`vec4(${ee.join(", ")}, 1.0)`:`(${expressionToGlsl(ie,Z[3])} * vec4(${ee.join(", ")}, 1.0))`}};Operators.interpolate={getReturnType:function(ie){let Z=ValueTypes.COLOR|ValueTypes.NUMBER;for(let ee=3;ee=1;Ke-=2){const Xe=expressionToGlsl(ie,Z[Ke],ae),Je=expressionToGlsl(ie,Z[Ke+1],ye);Ye=`(${ve} == ${Xe} ? ${Je} : ${Ye||be})`}return Ye}};Operators.case={getReturnType:function(ie){let Z=ValueTypes.ANY;for(let ee=1;ee=0;be-=2){const Ye=expressionToGlsl(ie,Z[be],ValueTypes.BOOLEAN),Ke=expressionToGlsl(ie,Z[be+1],ae);ve=`(${Ye} ? ${Ke} : ${ve||ye})`}return ve}};Operators.in={getReturnType:function(ie){return ValueTypes.BOOLEAN},toGlsl:function(ie,Z){assertArgsCount(Z,2);const ee=Z[0];let ae=Z[1];if(!Array.isArray(ae))throw new Error('The "in" operator expects an array literal as its second argument.');if(typeof ae[0]=="string"){if(ae[0]!=="literal")throw new Error('For the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions.');if(!Array.isArray(ae[1]))throw new Error('The "in" operator was provided a literal value which was not an array as second argument.');ae=ae[1]}let ye=getValueType(ee);for(let Ye=0;Ye1&&!ie.variables)throw new Error(`Missing variables in style (expected ${ae.variables})`);for(let rt=0;rt ${Uniforms.RENDER_EXTENT}[2] || + v_mapCoord[1] > ${Uniforms.RENDER_EXTENT}[3] + ) { + discard; + } + + vec4 color = texture2D(${Uniforms.TILE_TEXTURE_ARRAY}[0], v_textureCoord); + + ${ye.join(` +`)} + + gl_FragColor = color; + gl_FragColor.rgb *= gl_FragColor.a; + gl_FragColor *= ${Uniforms.TRANSITION_ALPHA}; + }`;return{vertexShader:ee,fragmentShader:Je,uniforms:ve,paletteTextures:ae.paletteTextures}}class WebGLTileLayer extends BaseTileLayer{constructor(Z){Z=Z?Object.assign({},Z):{};const ee=Z.style||{};delete Z.style;const ae=Z.cacheSize;delete Z.cacheSize,super(Z),this.sources_=Z.sources,this.renderedSource_=null,this.renderedResolution_=NaN,this.style_=ee,this.cacheSize_=ae,this.styleVariables_=this.style_.variables||{},this.addChangeListener(LayerProperty.SOURCE,this.handleSourceUpdate_)}getSources(Z,ee){const ae=this.getSource();return this.sources_?typeof this.sources_=="function"?this.sources_(Z,ee):this.sources_:ae?[ae]:[]}getRenderSource(){return this.renderedSource_||this.getSource()}getSourceState(){const Z=this.getRenderSource();return Z?Z.getState():"undefined"}handleSourceUpdate_(){this.hasRenderer()&&this.getRenderer().clearCache(),this.getSource()&&this.setStyle(this.style_)}getSourceBandCount_(){const Z=Number.MAX_SAFE_INTEGER,ee=this.getSources([-Z,-Z,Z,Z],Z);return ee&&ee.length&&"bandCount"in ee[0]?ee[0].bandCount:4}createRenderer(){const Z=parseStyle(this.style_,this.getSourceBandCount_());return new WebGLTileLayerRenderer(this,{vertexShader:Z.vertexShader,fragmentShader:Z.fragmentShader,uniforms:Z.uniforms,cacheSize:this.cacheSize_,paletteTextures:Z.paletteTextures})}renderSources(Z,ee){const ae=this.getRenderer();let ye;for(let ve=0,be=ee.length;ve{Xe.getState()=="ready"&&(Xe.removeEventListener("change",rt),this.changed())};Xe.addEventListener("change",rt)}ve=ve&&Je=="ready"}const be=this.renderSources(Z,ye);if(this.getRenderer().renderComplete&&ve)return this.renderedResolution_=ae.resolution,be;if(this.renderedResolution_>.5*ae.resolution){const Ye=this.getSources(Z.extent,this.renderedResolution_).filter(Ke=>!ye.includes(Ke));if(Ye.length>0)return this.renderSources(Z,Ye)}return be}setStyle(Z){this.styleVariables_=Z.variables||{},this.style_=Z;const ee=parseStyle(this.style_,this.getSourceBandCount_());this.getRenderer().reset({vertexShader:ee.vertexShader,fragmentShader:ee.fragmentShader,uniforms:ee.uniforms}),this.changed()}updateStyleVariables(Z){Object.assign(this.styleVariables_,Z),this.changed()}}WebGLTileLayer.prototype.dispose;const events=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"],FullScreenEventType={ENTERFULLSCREEN:"enterfullscreen",LEAVEFULLSCREEN:"leavefullscreen"};class FullScreen extends Control{constructor(Z){Z=Z||{},super({element:document.createElement("div"),target:Z.target}),this.on,this.once,this.un,this.keys_=Z.keys!==void 0?Z.keys:!1,this.source_=Z.source,this.isInFullscreen_=!1,this.boundHandleMapTargetChange_=this.handleMapTargetChange_.bind(this),this.cssClassName_=Z.className!==void 0?Z.className:"ol-full-screen",this.documentListeners_=[],this.activeClassName_=Z.activeClassName!==void 0?Z.activeClassName.split(" "):[this.cssClassName_+"-true"],this.inactiveClassName_=Z.inactiveClassName!==void 0?Z.inactiveClassName.split(" "):[this.cssClassName_+"-false"];const ee=Z.label!==void 0?Z.label:"⤢";this.labelNode_=typeof ee=="string"?document.createTextNode(ee):ee;const ae=Z.labelActive!==void 0?Z.labelActive:"×";this.labelActiveNode_=typeof ae=="string"?document.createTextNode(ae):ae;const ye=Z.tipLabel?Z.tipLabel:"Toggle full-screen";this.button_=document.createElement("button"),this.button_.title=ye,this.button_.setAttribute("type","button"),this.button_.appendChild(this.labelNode_),this.button_.addEventListener(EventType.CLICK,this.handleClick_.bind(this),!1),this.setClassName_(this.button_,this.isInFullscreen_),this.element.className=`${this.cssClassName_} ${CLASS_UNSELECTABLE} ${CLASS_CONTROL}`,this.element.appendChild(this.button_)}handleClick_(Z){Z.preventDefault(),this.handleFullScreen_()}handleFullScreen_(){const Z=this.getMap();if(!Z)return;const ee=Z.getOwnerDocument();if(isFullScreenSupported(ee))if(isFullScreen(ee))exitFullScreen(ee);else{let ae;this.source_?ae=typeof this.source_=="string"?ee.getElementById(this.source_):this.source_:ae=Z.getTargetElement(),this.keys_?requestFullScreenWithKeys(ae):requestFullScreen(ae)}}handleFullScreenChange_(){const Z=this.getMap();if(!Z)return;const ee=this.isInFullscreen_;this.isInFullscreen_=isFullScreen(Z.getOwnerDocument()),ee!==this.isInFullscreen_&&(this.setClassName_(this.button_,this.isInFullscreen_),this.isInFullscreen_?(replaceNode(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(FullScreenEventType.ENTERFULLSCREEN)):(replaceNode(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(FullScreenEventType.LEAVEFULLSCREEN)),Z.updateSize())}setClassName_(Z,ee){ee?(Z.classList.remove(...this.inactiveClassName_),Z.classList.add(...this.activeClassName_)):(Z.classList.remove(...this.activeClassName_),Z.classList.add(...this.inactiveClassName_))}setMap(Z){const ee=this.getMap();ee&&ee.removeChangeListener(MapProperty.TARGET,this.boundHandleMapTargetChange_),super.setMap(Z),this.handleMapTargetChange_(),Z&&Z.addChangeListener(MapProperty.TARGET,this.boundHandleMapTargetChange_)}handleMapTargetChange_(){const Z=this.documentListeners_;for(let ae=0,ye=Z.length;ae{const Ye=getCacheKeyForTileKey(be),Ke=ae.peek(Ye);if(Ke){const Xe=Ke.sourceTiles;for(let Je=0,rt=Xe.length;Je{const it=this.tileUrlFunction(nt,Z,ee),lt=this.sourceTileCache.containsKey(it)?this.sourceTileCache.get(it):new this.tileClass(nt,it?TileState.IDLE:TileState.EMPTY,it,this.format_,this.tileLoadFunction);ae.sourceTiles.push(lt);const ct=lt.getState();if(ct{this.handleTileChange(dt);const ft=lt.getState();if(ft===TileState.LOADED||ft===TileState.ERROR){const gt=lt.getKey();gt in ae.errorTileKeys?lt.getState()===TileState.LOADED&&delete ae.errorTileKeys[gt]:ae.loadingSourceTiles--,ft===TileState.ERROR?ae.errorTileKeys[gt]=!0:lt.removeEventListener(EventType.CHANGE,ot),ae.loadingSourceTiles===0&&ae.setState(isEmpty$1(ae.errorTileKeys)?TileState.LOADED:TileState.ERROR)}};lt.addEventListener(EventType.CHANGE,ot),ae.loadingSourceTiles++}ct===TileState.IDLE&&(lt.extent=Xe.getTileCoordExtent(nt),lt.projection=ee,lt.resolution=Xe.getResolution(nt[0]),this.sourceTileCache.set(it,lt),lt.load())}),ae.loadingSourceTiles||ae.setState(ae.sourceTiles.some(nt=>nt.getState()===TileState.ERROR)?TileState.ERROR:TileState.LOADED)}return ae.sourceTiles}getTile(Z,ee,ae,ye,ve){const be=getKeyZXY(Z,ee,ae),Ye=this.getKey();let Ke;if(this.tileCache.containsKey(be)&&(Ke=this.tileCache.get(be),Ke.key===Ye))return Ke;const Xe=[Z,ee,ae];let Je=this.getTileCoordForTileUrlFunction(Xe,ve);const rt=this.getTileGrid().getExtent(),nt=this.getTileGridForProjection(ve);if(Je&&rt){const ct=nt.getTileCoordExtent(Je);buffer$1(ct,-nt.getResolution(Z),ct),intersects$1(rt,ct)||(Je=null)}let it=!0;if(Je!==null){const ct=this.tileGrid,ot=nt.getResolution(Z),dt=ct.getZForResolution(ot,1),ft=nt.getTileCoordExtent(Je);buffer$1(ft,-ot,ft),ct.forEachTileCoord(ft,dt,gt=>{it=it&&!this.tileUrlFunction(gt,ye,ve)})}const lt=new VectorRenderTile(Xe,it?TileState.EMPTY:TileState.IDLE,Je,this.getSourceTiles.bind(this,ye,ve));return lt.key=Ye,Ke?(lt.interimTile=Ke,lt.refreshInterimChain(),this.tileCache.replace(be,lt)):this.tileCache.set(be,lt),lt}getTileGridForProjection(Z){const ee=Z.getCode();let ae=this.tileGrids_[ee];if(!ae){const ye=this.tileGrid,ve=ye.getResolutions().slice(),be=ve.map(function(Xe,Je){return ye.getOrigin(Je)}),Ye=ve.map(function(Xe,Je){return ye.getTileSize(Je)}),Ke=DEFAULT_MAX_ZOOM+1;for(let Xe=ve.length;Xe */ieee754$1.read=function(ie,Z,ee,ae,ye){var ve,be,Ye=ye*8-ae-1,Ke=(1<>1,Je=-7,rt=ee?ye-1:0,nt=ee?-1:1,it=ie[Z+rt];for(rt+=nt,ve=it&(1<<-Je)-1,it>>=-Je,Je+=Ye;Je>0;ve=ve*256+ie[Z+rt],rt+=nt,Je-=8);for(be=ve&(1<<-Je)-1,ve>>=-Je,Je+=ae;Je>0;be=be*256+ie[Z+rt],rt+=nt,Je-=8);if(ve===0)ve=1-Xe;else{if(ve===Ke)return be?NaN:(it?-1:1)*(1/0);be=be+Math.pow(2,ae),ve=ve-Xe}return(it?-1:1)*be*Math.pow(2,ve-ae)};ieee754$1.write=function(ie,Z,ee,ae,ye,ve){var be,Ye,Ke,Xe=ve*8-ye-1,Je=(1<>1,nt=ye===23?Math.pow(2,-24)-Math.pow(2,-77):0,it=ae?0:ve-1,lt=ae?1:-1,ct=Z<0||Z===0&&1/Z<0?1:0;for(Z=Math.abs(Z),isNaN(Z)||Z===1/0?(Ye=isNaN(Z)?1:0,be=Je):(be=Math.floor(Math.log(Z)/Math.LN2),Z*(Ke=Math.pow(2,-be))<1&&(be--,Ke*=2),be+rt>=1?Z+=nt/Ke:Z+=nt*Math.pow(2,1-rt),Z*Ke>=2&&(be++,Ke/=2),be+rt>=Je?(Ye=0,be=Je):be+rt>=1?(Ye=(Z*Ke-1)*Math.pow(2,ye),be=be+rt):(Ye=Z*Math.pow(2,rt-1)*Math.pow(2,ye),be=0));ye>=8;ie[ee+it]=Ye&255,it+=lt,Ye/=256,ye-=8);for(be=be<0;ie[ee+it]=be&255,it+=lt,be/=256,Xe-=8);ie[ee+it-lt]|=ct*128};var pbf=Pbf,ieee754=ieee754$1;function Pbf(ie){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(ie)?ie:new Uint8Array(ie||0),this.pos=0,this.type=0,this.length=this.buf.length}Pbf.Varint=0;Pbf.Fixed64=1;Pbf.Bytes=2;Pbf.Fixed32=5;var SHIFT_LEFT_32=65536*65536,SHIFT_RIGHT_32=1/SHIFT_LEFT_32,TEXT_DECODER_MIN_LENGTH=12,utf8TextDecoder=typeof TextDecoder>"u"?null:new TextDecoder("utf8");Pbf.prototype={destroy:function(){this.buf=null},readFields:function(ie,Z,ee){for(ee=ee||this.length;this.pos>3,ve=this.pos;this.type=ae&7,ie(ye,Z,this),this.pos===ve&&this.skip(ae)}return Z},readMessage:function(ie,Z){return this.readFields(ie,Z,this.readVarint()+this.pos)},readFixed32:function(){var ie=readUInt32(this.buf,this.pos);return this.pos+=4,ie},readSFixed32:function(){var ie=readInt32(this.buf,this.pos);return this.pos+=4,ie},readFixed64:function(){var ie=readUInt32(this.buf,this.pos)+readUInt32(this.buf,this.pos+4)*SHIFT_LEFT_32;return this.pos+=8,ie},readSFixed64:function(){var ie=readUInt32(this.buf,this.pos)+readInt32(this.buf,this.pos+4)*SHIFT_LEFT_32;return this.pos+=8,ie},readFloat:function(){var ie=ieee754.read(this.buf,this.pos,!0,23,4);return this.pos+=4,ie},readDouble:function(){var ie=ieee754.read(this.buf,this.pos,!0,52,8);return this.pos+=8,ie},readVarint:function(ie){var Z=this.buf,ee,ae;return ae=Z[this.pos++],ee=ae&127,ae<128||(ae=Z[this.pos++],ee|=(ae&127)<<7,ae<128)||(ae=Z[this.pos++],ee|=(ae&127)<<14,ae<128)||(ae=Z[this.pos++],ee|=(ae&127)<<21,ae<128)?ee:(ae=Z[this.pos],ee|=(ae&15)<<28,readVarintRemainder$1(ee,ie,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var ie=this.readVarint();return ie%2===1?(ie+1)/-2:ie/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var ie=this.readVarint()+this.pos,Z=this.pos;return this.pos=ie,ie-Z>=TEXT_DECODER_MIN_LENGTH&&utf8TextDecoder?readUtf8TextDecoder(this.buf,Z,ie):readUtf8(this.buf,Z,ie)},readBytes:function(){var ie=this.readVarint()+this.pos,Z=this.buf.subarray(this.pos,ie);return this.pos=ie,Z},readPackedVarint:function(ie,Z){if(this.type!==Pbf.Bytes)return ie.push(this.readVarint(Z));var ee=readPackedEnd(this);for(ie=ie||[];this.pos127;);else if(Z===Pbf.Bytes)this.pos=this.readVarint()+this.pos;else if(Z===Pbf.Fixed32)this.pos+=4;else if(Z===Pbf.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+Z)},writeTag:function(ie,Z){this.writeVarint(ie<<3|Z)},realloc:function(ie){for(var Z=this.length||16;Z268435455||ie<0){writeBigVarint(ie,this);return}this.realloc(4),this.buf[this.pos++]=ie&127|(ie>127?128:0),!(ie<=127)&&(this.buf[this.pos++]=(ie>>>=7)&127|(ie>127?128:0),!(ie<=127)&&(this.buf[this.pos++]=(ie>>>=7)&127|(ie>127?128:0),!(ie<=127)&&(this.buf[this.pos++]=ie>>>7&127)))},writeSVarint:function(ie){this.writeVarint(ie<0?-ie*2-1:ie*2)},writeBoolean:function(ie){this.writeVarint(!!ie)},writeString:function(ie){ie=String(ie),this.realloc(ie.length*4),this.pos++;var Z=this.pos;this.pos=writeUtf8(this.buf,ie,this.pos);var ee=this.pos-Z;ee>=128&&makeRoomForExtraLength(Z,ee,this),this.pos=Z-1,this.writeVarint(ee),this.pos+=ee},writeFloat:function(ie){this.realloc(4),ieee754.write(this.buf,ie,this.pos,!0,23,4),this.pos+=4},writeDouble:function(ie){this.realloc(8),ieee754.write(this.buf,ie,this.pos,!0,52,8),this.pos+=8},writeBytes:function(ie){var Z=ie.length;this.writeVarint(Z),this.realloc(Z);for(var ee=0;ee=128&&makeRoomForExtraLength(ee,ae,this),this.pos=ee-1,this.writeVarint(ae),this.pos+=ae},writeMessage:function(ie,Z,ee){this.writeTag(ie,Pbf.Bytes),this.writeRawMessage(Z,ee)},writePackedVarint:function(ie,Z){Z.length&&this.writeMessage(ie,writePackedVarint,Z)},writePackedSVarint:function(ie,Z){Z.length&&this.writeMessage(ie,writePackedSVarint,Z)},writePackedBoolean:function(ie,Z){Z.length&&this.writeMessage(ie,writePackedBoolean,Z)},writePackedFloat:function(ie,Z){Z.length&&this.writeMessage(ie,writePackedFloat,Z)},writePackedDouble:function(ie,Z){Z.length&&this.writeMessage(ie,writePackedDouble,Z)},writePackedFixed32:function(ie,Z){Z.length&&this.writeMessage(ie,writePackedFixed32,Z)},writePackedSFixed32:function(ie,Z){Z.length&&this.writeMessage(ie,writePackedSFixed32,Z)},writePackedFixed64:function(ie,Z){Z.length&&this.writeMessage(ie,writePackedFixed64,Z)},writePackedSFixed64:function(ie,Z){Z.length&&this.writeMessage(ie,writePackedSFixed64,Z)},writeBytesField:function(ie,Z){this.writeTag(ie,Pbf.Bytes),this.writeBytes(Z)},writeFixed32Field:function(ie,Z){this.writeTag(ie,Pbf.Fixed32),this.writeFixed32(Z)},writeSFixed32Field:function(ie,Z){this.writeTag(ie,Pbf.Fixed32),this.writeSFixed32(Z)},writeFixed64Field:function(ie,Z){this.writeTag(ie,Pbf.Fixed64),this.writeFixed64(Z)},writeSFixed64Field:function(ie,Z){this.writeTag(ie,Pbf.Fixed64),this.writeSFixed64(Z)},writeVarintField:function(ie,Z){this.writeTag(ie,Pbf.Varint),this.writeVarint(Z)},writeSVarintField:function(ie,Z){this.writeTag(ie,Pbf.Varint),this.writeSVarint(Z)},writeStringField:function(ie,Z){this.writeTag(ie,Pbf.Bytes),this.writeString(Z)},writeFloatField:function(ie,Z){this.writeTag(ie,Pbf.Fixed32),this.writeFloat(Z)},writeDoubleField:function(ie,Z){this.writeTag(ie,Pbf.Fixed64),this.writeDouble(Z)},writeBooleanField:function(ie,Z){this.writeVarintField(ie,!!Z)}};function readVarintRemainder$1(ie,Z,ee){var ae=ee.buf,ye,ve;if(ve=ae[ee.pos++],ye=(ve&112)>>4,ve<128||(ve=ae[ee.pos++],ye|=(ve&127)<<3,ve<128)||(ve=ae[ee.pos++],ye|=(ve&127)<<10,ve<128)||(ve=ae[ee.pos++],ye|=(ve&127)<<17,ve<128)||(ve=ae[ee.pos++],ye|=(ve&127)<<24,ve<128)||(ve=ae[ee.pos++],ye|=(ve&1)<<31,ve<128))return toNum$1(ie,ye,Z);throw new Error("Expected varint not more than 10 bytes")}function readPackedEnd(ie){return ie.type===Pbf.Bytes?ie.readVarint()+ie.pos:ie.pos+1}function toNum$1(ie,Z,ee){return ee?Z*4294967296+(ie>>>0):(Z>>>0)*4294967296+(ie>>>0)}function writeBigVarint(ie,Z){var ee,ae;if(ie>=0?(ee=ie%4294967296|0,ae=ie/4294967296|0):(ee=~(-ie%4294967296),ae=~(-ie/4294967296),ee^4294967295?ee=ee+1|0:(ee=0,ae=ae+1|0)),ie>=18446744073709552e3||ie<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");Z.realloc(10),writeBigVarintLow(ee,ae,Z),writeBigVarintHigh(ae,Z)}function writeBigVarintLow(ie,Z,ee){ee.buf[ee.pos++]=ie&127|128,ie>>>=7,ee.buf[ee.pos++]=ie&127|128,ie>>>=7,ee.buf[ee.pos++]=ie&127|128,ie>>>=7,ee.buf[ee.pos++]=ie&127|128,ie>>>=7,ee.buf[ee.pos]=ie&127}function writeBigVarintHigh(ie,Z){var ee=(ie&7)<<4;Z.buf[Z.pos++]|=ee|((ie>>>=3)?128:0),ie&&(Z.buf[Z.pos++]=ie&127|((ie>>>=7)?128:0),ie&&(Z.buf[Z.pos++]=ie&127|((ie>>>=7)?128:0),ie&&(Z.buf[Z.pos++]=ie&127|((ie>>>=7)?128:0),ie&&(Z.buf[Z.pos++]=ie&127|((ie>>>=7)?128:0),ie&&(Z.buf[Z.pos++]=ie&127)))))}function makeRoomForExtraLength(ie,Z,ee){var ae=Z<=16383?1:Z<=2097151?2:Z<=268435455?3:Math.floor(Math.log(Z)/(Math.LN2*7));ee.realloc(ae);for(var ye=ee.pos-1;ye>=ie;ye--)ee.buf[ye+ae]=ee.buf[ye]}function writePackedVarint(ie,Z){for(var ee=0;ee>>8,ie[ee+2]=Z>>>16,ie[ee+3]=Z>>>24}function readInt32(ie,Z){return(ie[Z]|ie[Z+1]<<8|ie[Z+2]<<16)+(ie[Z+3]<<24)}function readUtf8(ie,Z,ee){for(var ae="",ye=Z;ye239?4:ve>223?3:ve>191?2:1;if(ye+Ye>ee)break;var Ke,Xe,Je;Ye===1?ve<128&&(be=ve):Ye===2?(Ke=ie[ye+1],(Ke&192)===128&&(be=(ve&31)<<6|Ke&63,be<=127&&(be=null))):Ye===3?(Ke=ie[ye+1],Xe=ie[ye+2],(Ke&192)===128&&(Xe&192)===128&&(be=(ve&15)<<12|(Ke&63)<<6|Xe&63,(be<=2047||be>=55296&&be<=57343)&&(be=null))):Ye===4&&(Ke=ie[ye+1],Xe=ie[ye+2],Je=ie[ye+3],(Ke&192)===128&&(Xe&192)===128&&(Je&192)===128&&(be=(ve&15)<<18|(Ke&63)<<12|(Xe&63)<<6|Je&63,(be<=65535||be>=1114112)&&(be=null))),be===null?(be=65533,Ye=1):be>65535&&(be-=65536,ae+=String.fromCharCode(be>>>10&1023|55296),be=56320|be&1023),ae+=String.fromCharCode(be),ye+=Ye}return ae}function readUtf8TextDecoder(ie,Z,ee){return utf8TextDecoder.decode(ie.subarray(Z,ee))}function writeUtf8(ie,Z,ee){for(var ae=0,ye,ve;ae55295&&ye<57344)if(ve)if(ye<56320){ie[ee++]=239,ie[ee++]=191,ie[ee++]=189,ve=ye;continue}else ye=ve-55296<<10|ye-56320|65536,ve=null;else{ye>56319||ae+1===Z.length?(ie[ee++]=239,ie[ee++]=191,ie[ee++]=189):ve=ye;continue}else ve&&(ie[ee++]=239,ie[ee++]=191,ie[ee++]=189,ve=null);ye<128?ie[ee++]=ye:(ye<2048?ie[ee++]=ye>>6|192:(ye<65536?ie[ee++]=ye>>12|224:(ie[ee++]=ye>>18|240,ie[ee++]=ye>>12&63|128),ie[ee++]=ye>>6&63|128),ie[ee++]=ye&63|128)}return ee}const PBF=getDefaultExportFromCjs$1(pbf),tmpTransform=create$2();class RenderFeature{constructor(Z,ee,ae,ye,ve){this.styleFunction,this.extent_,this.id_=ve,this.type_=Z,this.flatCoordinates_=ee,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=ae,this.properties_=ye}get(Z){return this.properties_[Z]}getExtent(){return this.extent_||(this.extent_=this.type_==="Point"?createOrUpdateFromCoordinate(this.flatCoordinates_):createOrUpdateFromFlatCoordinates(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const Z=getCenter(this.getExtent());this.flatInteriorPoints_=getInteriorPointOfArray(this.flatCoordinates_,0,this.ends_,2,Z,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const Z=linearRingss(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=getInteriorPointsOfMultiArray(this.flatCoordinates_,0,this.ends_,2,Z)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=interpolatePoint(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const Z=this.flatCoordinates_;let ee=0;const ae=this.ends_;for(let ye=0,ve=ae.length;ye>3}if(Ye--,be===1||be===2)Ke+=Z.readSVarint(),Xe+=Z.readSVarint(),be===1&&Je>rt&&(ye.push(Je),rt=Je),ae.push(Ke,Xe),Je+=2;else if(be===7)Je>rt&&(ae.push(ae[rt],ae[rt+1]),Je+=2);else throw new Error("Invalid command found in the PBF")}Je>rt&&(ye.push(Je),rt=Je)}createFeature_(Z,ee,ae){const ye=ee.type;if(ye===0)return null;let ve;const be=ee.properties;let Ye;this.idProperty_?(Ye=be[this.idProperty_],delete be[this.idProperty_]):Ye=ee.id,be[this.layerName_]=ee.layer.name;const Ke=[],Xe=[];this.readRawGeometry_(Z,ee,Ke,Xe);const Je=getGeometryType(ye,Xe.length);if(this.featureClass_===RenderFeature)ve=new this.featureClass_(Je,Ke,Xe,be,Ye),ve.transform(ae.dataProjection);else{let rt;if(Je=="Polygon"){const lt=inflateEnds(Ke,Xe);rt=lt.length>1?new MultiPolygon$1(Ke,"XY",lt):new Polygon$1(Ke,"XY",Xe)}else rt=Je==="Point"?new Point$1(Ke,"XY"):Je==="LineString"?new LineString$1(Ke,"XY"):Je==="MultiPoint"?new MultiPoint$1(Ke,"XY"):Je==="MultiLineString"?new MultiLineString$1(Ke,"XY",Xe):null;const nt=this.featureClass_;ve=new nt,this.geometryName_&&ve.setGeometryName(this.geometryName_);const it=transformGeometryWithOptions(rt,!1,ae);ve.setGeometry(it),Ye!==void 0&&ve.setId(Ye),ve.setProperties(be,!0)}return ve}getType(){return"arraybuffer"}readFeatures(Z,ee){const ae=this.layers_;ee=this.adaptOptions(ee);const ye=get$1(ee.dataProjection);ye.setWorldExtent(ee.extent),ee.dataProjection=ye;const ve=new PBF(Z),be=ve.readFields(layersPBFReader,{}),Ye=[];for(const Ke in be){if(ae&&!ae.includes(Ke))continue;const Xe=be[Ke],Je=Xe?[0,0,Xe.extent,Xe.extent]:null;ye.setExtent(Je);for(let rt=0,nt=Xe.length;rt>3,ae=ie===1?ee.readString():ie===2?ee.readFloat():ie===3?ee.readDouble():ie===4?ee.readVarint64():ie===5?ee.readVarint():ie===6?ee.readSVarint():ie===7?ee.readBoolean():null;Z.values.push(ae)}}function featurePBFReader(ie,Z,ee){if(ie==1)Z.id=ee.readVarint();else if(ie==2){const ae=ee.readVarint()+ee.pos;for(;ee.posnew Promise((ae,ye)=>{var ve=Ke=>{try{Ye(ee.next(Ke))}catch(Xe){ye(Xe)}},be=Ke=>{try{Ye(ee.throw(Ke))}catch(Xe){ye(Xe)}},Ye=Ke=>Ke.done?ae(Ke.value):Promise.resolve(Ke.value).then(ve,be);Ye((ee=ee.apply(ie,Z)).next())}),u8=Uint8Array,u16=Uint16Array,i32=Int32Array,fleb=new u8([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fdeb=new u8([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),clim=new u8([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),freb=function(ie,Z){for(var ee=new u16(31),ae=0;ae<31;++ae)ee[ae]=Z+=1<>1|(i$2&21845)<<1,x$2=(x$2&52428)>>2|(x$2&13107)<<2,x$2=(x$2&61680)>>4|(x$2&3855)<<4,rev[i$2]=((x$2&65280)>>8|(x$2&255)<<8)>>1;var x$2,i$2,hMap=function(ie,Z,ee){for(var ae=ie.length,ye=0,ve=new u16(Z);ye>Ke]=Xe}else for(Ye=new u16(ae),ye=0;ye>15-ie[ye]);return Ye},flt=new u8(288);for(i$2=0;i$2<144;++i$2)flt[i$2]=8;var i$2;for(i$2=144;i$2<256;++i$2)flt[i$2]=9;var i$2;for(i$2=256;i$2<280;++i$2)flt[i$2]=7;var i$2;for(i$2=280;i$2<288;++i$2)flt[i$2]=8;var i$2,fdt=new u8(32);for(i$2=0;i$2<32;++i$2)fdt[i$2]=5;var i$2,flrm=hMap(flt,9,1),fdrm=hMap(fdt,5,1),max$1=function(ie){for(var Z=ie[0],ee=1;eeZ&&(Z=ie[ee]);return Z},bits=function(ie,Z,ee){var ae=Z/8|0;return(ie[ae]|ie[ae+1]<<8)>>(Z&7)&ee},bits16=function(ie,Z){var ee=Z/8|0;return(ie[ee]|ie[ee+1]<<8|ie[ee+2]<<16)>>(Z&7)},shft=function(ie){return(ie+7)/8|0},slc=function(ie,Z,ee){(Z==null||Z<0)&&(Z=0),(ee==null||ee>ie.length)&&(ee=ie.length);var ae=new u8(ee-Z);return ae.set(ie.subarray(Z,ee)),ae},ec=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],err=function(ie,Z,ee){var ae=new Error(Z||ec[ie]);if(ae.code=ie,Error.captureStackTrace&&Error.captureStackTrace(ae,err),!ee)throw ae;return ae},inflt=function(ie,Z,ee,ae){var ye=ie.length,ve=ae?ae.length:0;if(!ye||Z.f&&!Z.l)return ee||new u8(0);var be=!ee||Z.i!=2,Ye=Z.i;ee||(ee=new u8(ye*3));var Ke=function(Ji){var ls=ee.length;if(Ji>ls){var hs=new u8(Math.max(ls*2,Ji));hs.set(ee),ee=hs}},Xe=Z.f||0,Je=Z.p||0,rt=Z.b||0,nt=Z.l,it=Z.d,lt=Z.m,ct=Z.n,ot=ye*8;do{if(!nt){Xe=bits(ie,Je,1);var dt=bits(ie,Je+1,3);if(Je+=3,dt)if(dt==1)nt=flrm,it=fdrm,lt=9,ct=5;else if(dt==2){var ft=bits(ie,Je,31)+257,gt=bits(ie,Je+10,15)+4,mt=ft+bits(ie,Je+5,31)+1;Je+=14;for(var Yr=new u8(mt),Qr=new u8(19),Xr=0;Xr>4;if(li<16)Yr[Xr++]=li;else{var ui=0,mi=0;for(li==16?(mi=3+bits(ie,Je,3),Je+=2,ui=Yr[Xr-1]):li==17?(mi=3+bits(ie,Je,7),Je+=3):li==18&&(mi=11+bits(ie,Je,127),Je+=7);mi--;)Yr[Xr++]=ui}}var ii=Yr.subarray(0,ft),hi=Yr.subarray(ft);lt=max$1(ii),ct=max$1(hi),nt=hMap(ii,lt,1),it=hMap(hi,ct,1)}else err(1);else{var li=shft(Je)+4,ri=ie[li-4]|ie[li-3]<<8,ci=li+ri;if(ci>ye){Ye&&err(0);break}be&&Ke(rt+ri),ee.set(ie.subarray(li,ci),rt),Z.b=rt+=ri,Z.p=Je=ci*8,Z.f=Xe;continue}if(Je>ot){Ye&&err(0);break}}be&&Ke(rt+131072);for(var Si=(1<>4;if(Je+=ui&15,Je>ot){Ye&&err(0);break}if(ui||err(2),yi<256)ee[rt++]=yi;else if(yi==256){Ei=Je,nt=null;break}else{var Mi=yi-254;if(yi>264){var Xr=yi-257,Ci=fleb[Xr];Mi=bits(ie,Je,(1<>4;Ri||err(3),Je+=Ri&15;var hi=fd[Ni];if(Ni>3){var Ci=fdeb[Ni];hi+=bits16(ie,Je)&(1<ot){Ye&&err(0);break}be&&Ke(rt+131072);var Ai=rt+Mi;if(rt>3&1)+(Z>>4&1);ae>0;ae-=!ie[ee++]);return ee+(Z&2)},gzl=function(ie){var Z=ie.length;return(ie[Z-4]|ie[Z-3]<<8|ie[Z-2]<<16|ie[Z-1]<<24)>>>0},zls=function(ie,Z){return((ie[0]&15)!=8||ie[0]>>4>7||(ie[0]<<8|ie[1])%31)&&err(6,"invalid zlib data"),(ie[1]>>5&1)==+!Z&&err(6,"invalid zlib data: "+(ie[1]&32?"need":"unexpected")+" dictionary"),(ie[1]>>3&4)+2};function inflateSync(ie,Z){return inflt(ie,{i:2},Z&&Z.out,Z&&Z.dictionary)}function gunzipSync(ie,Z){var ee=gzs(ie);return ee+8>ie.length&&err(6,"invalid gzip data"),inflt(ie.subarray(ee,-8),{i:2},Z&&Z.out||new u8(gzl(ie)),Z&&Z.dictionary)}function unzlibSync(ie,Z){return inflt(ie.subarray(zls(ie,Z&&Z.dictionary),-4),{i:2},Z&&Z.out,Z&&Z.dictionary)}function decompressSync(ie,Z){return ie[0]==31&&ie[1]==139&&ie[2]==8?gunzipSync(ie,Z):(ie[0]&15)!=8||ie[0]>>4>7||(ie[0]<<8|ie[1])%31?inflateSync(ie,Z):unzlibSync(ie,Z)}var td=typeof TextDecoder<"u"&&new TextDecoder,tds=0;try{td.decode(et,{stream:!0}),tds=1}catch{}var shift$2=(ie,Z)=>ie*Math.pow(2,Z),unshift=(ie,Z)=>Math.floor(ie/Math.pow(2,Z)),getUint24=(ie,Z)=>shift$2(ie.getUint16(Z+1,!0),8)+ie.getUint8(Z),getUint48=(ie,Z)=>shift$2(ie.getUint32(Z+2,!0),16)+ie.getUint16(Z,!0),compare=(ie,Z,ee,ae,ye)=>{if(ie!=ae.getUint8(ye))return ie-ae.getUint8(ye);const ve=getUint24(ae,ye+1);if(Z!=ve)return Z-ve;const be=getUint24(ae,ye+4);return ee!=be?ee-be:0},queryLeafdir=(ie,Z,ee,ae)=>{const ye=queryView(ie,Z|128,ee,ae);return ye?{z:Z,x:ee,y:ae,offset:ye[0],length:ye[1],is_dir:!0}:null},queryTile=(ie,Z,ee,ae)=>{const ye=queryView(ie,Z,ee,ae);return ye?{z:Z,x:ee,y:ae,offset:ye[0],length:ye[1],is_dir:!1}:null},queryView=(ie,Z,ee,ae)=>{let ye=0,ve=ie.byteLength/17-1;for(;ye<=ve;){const be=ve+ye>>1,Ye=compare(Z,ee,ae,ie,be*17);if(Ye>0)ye=be+1;else if(Ye<0)ve=be-1;else return[getUint48(ie,be*17+7),ie.getUint32(be*17+13,!0)]}return null},entrySort=(ie,Z)=>ie.is_dir&&!Z.is_dir?1:!ie.is_dir&&Z.is_dir?-1:ie.z!==Z.z?ie.z-Z.z:ie.x!==Z.x?ie.x-Z.x:ie.y-Z.y,parseEntry=(ie,Z)=>{const ee=ie.getUint8(Z*17);return{z:ee&127,x:getUint24(ie,Z*17+1),y:getUint24(ie,Z*17+4),offset:getUint48(ie,Z*17+7),length:ie.getUint32(Z*17+13,!0),is_dir:ee>>7===1}},sortDir=ie=>{const Z=[],ee=new DataView(ie);for(let ae=0;ae{ie.sort(entrySort);const Z=new ArrayBuffer(17*ie.length),ee=new Uint8Array(Z);for(let ae=0;ae>8&255,ee[ae*17+3]=ye.x>>16&255,ee[ae*17+4]=ye.y&255,ee[ae*17+5]=ye.y>>8&255,ee[ae*17+6]=ye.y>>16&255,ee[ae*17+7]=ye.offset&255,ee[ae*17+8]=unshift(ye.offset,8)&255,ee[ae*17+9]=unshift(ye.offset,16)&255,ee[ae*17+10]=unshift(ye.offset,24)&255,ee[ae*17+11]=unshift(ye.offset,32)&255,ee[ae*17+12]=unshift(ye.offset,48)&255,ee[ae*17+13]=ye.length&255,ee[ae*17+14]=ye.length>>8&255,ee[ae*17+15]=ye.length>>16&255,ee[ae*17+16]=ye.length>>24&255}return Z},deriveLeaf=(ie,Z)=>{if(ie.byteLength<17)return null;const ee=ie.byteLength/17,ae=parseEntry(ie,ee-1);if(ae.is_dir){const ye=ae.z,ve=Z.z-ye,be=Math.trunc(Z.x/(1<>>0)*4294967296+(ie>>>0)}function readVarintRemainder(ie,Z){const ee=Z.buf;let ae,ye;if(ye=ee[Z.pos++],ae=(ye&112)>>4,ye<128||(ye=ee[Z.pos++],ae|=(ye&127)<<3,ye<128)||(ye=ee[Z.pos++],ae|=(ye&127)<<10,ye<128)||(ye=ee[Z.pos++],ae|=(ye&127)<<17,ye<128)||(ye=ee[Z.pos++],ae|=(ye&127)<<24,ye<128)||(ye=ee[Z.pos++],ae|=(ye&1)<<31,ye<128))return toNum(ie,ae);throw new Error("Expected varint not more than 10 bytes")}function readVarint(ie){const Z=ie.buf;let ee,ae;return ae=Z[ie.pos++],ee=ae&127,ae<128||(ae=Z[ie.pos++],ee|=(ae&127)<<7,ae<128)||(ae=Z[ie.pos++],ee|=(ae&127)<<14,ae<128)||(ae=Z[ie.pos++],ee|=(ae&127)<<21,ae<128)?ee:(ae=Z[ie.pos],ee|=(ae&15)<<28,readVarintRemainder(ee,ie))}function rotate(ie,Z,ee,ae){if(ae==0){ee==1&&(Z[0]=ie-1-Z[0],Z[1]=ie-1-Z[1]);const ye=Z[0];Z[0]=Z[1],Z[1]=ye}}var tzValues=[0,1,5,21,85,341,1365,5461,21845,87381,349525,1398101,5592405,22369621,89478485,357913941,1431655765,5726623061,22906492245,91625968981,366503875925,1466015503701,5864062014805,23456248059221,93824992236885,375299968947541,0x5555555555555];function zxyToTileId(ie,Z,ee){if(ie>26)throw Error("Tile zoom level exceeds max safe number limit (26)");if(Z>Math.pow(2,ie)-1||ee>Math.pow(2,ie)-1)throw Error("tile x/y outside zoom level bounds");const ae=tzValues[ie],ye=Math.pow(2,ie);let ve=0,be=0,Ye=0;const Ke=[Z,ee];let Xe=ye/2;for(;Xe>0;)ve=(Ke[0]&Xe)>0?1:0,be=(Ke[1]&Xe)>0?1:0,Ye+=Xe*Xe*(3*ve^be),rotate(Xe,Ke,ve,be),Xe=Xe/2;return ae+Ye}function defaultDecompress(ie,Z){return __async(this,null,function*(){if(Z===1||Z===0)return ie;if(Z===2){if(typeof globalThis.DecompressionStream>"u")return decompressSync(new Uint8Array(ie));{let ee=new Response(ie).body.pipeThrough(new globalThis.DecompressionStream("gzip"));return new Response(ee).arrayBuffer()}}else throw Error("Compression method not supported")})}var HEADER_SIZE_BYTES=127;function findTile(ie,Z){let ee=0,ae=ie.length-1;for(;ee<=ae;){const ye=ae+ee>>1,ve=Z-ie[ye].tileId;if(ve>0)ee=ye+1;else if(ve<0)ae=ye-1;else return ie[ye]}return ae>=0&&(ie[ae].runLength===0||Z-ie[ae].tileId=300)throw Error("Bad response code: "+ve.status);const be=ve.headers.get("Content-Length");if(ve.status===200&&(!be||+be>Z))throw ae&&ae.abort(),Error("Server returned no content-length header or content-length exceeding request. Check that your storage backend supports HTTP Byte Serving.");return{data:yield ve.arrayBuffer(),etag:ve.headers.get("ETag")||void 0,cacheControl:ve.headers.get("Cache-Control")||void 0,expires:ve.headers.get("Expires")||void 0}})}};function getUint64(ie,Z){const ee=ie.getUint32(Z+4,!0),ae=ie.getUint32(Z+0,!0);return ee*Math.pow(2,32)+ae}function bytesToHeader(ie,Z){const ee=new DataView(ie),ae=ee.getUint8(7);if(ae>3)throw Error(`Archive is spec version ${ae} but this library supports up to spec version 3`);return{specVersion:ae,rootDirectoryOffset:getUint64(ee,8),rootDirectoryLength:getUint64(ee,16),jsonMetadataOffset:getUint64(ee,24),jsonMetadataLength:getUint64(ee,32),leafDirectoryOffset:getUint64(ee,40),leafDirectoryLength:getUint64(ee,48),tileDataOffset:getUint64(ee,56),tileDataLength:getUint64(ee,64),numAddressedTiles:getUint64(ee,72),numTileEntries:getUint64(ee,80),numTileContents:getUint64(ee,88),clustered:ee.getUint8(96)===1,internalCompression:ee.getUint8(97),tileCompression:ee.getUint8(98),tileType:ee.getUint8(99),minZoom:ee.getUint8(100),maxZoom:ee.getUint8(101),minLon:ee.getInt32(102,!0)/1e7,minLat:ee.getInt32(106,!0)/1e7,maxLon:ee.getInt32(110,!0)/1e7,maxLat:ee.getInt32(114,!0)/1e7,centerZoom:ee.getUint8(118),centerLon:ee.getInt32(119,!0)/1e7,centerLat:ee.getInt32(123,!0)/1e7,etag:Z}}function deserializeIndex(ie){const Z={buf:new Uint8Array(ie),pos:0},ee=readVarint(Z),ae=[];let ye=0;for(let ve=0;ve0?ae[ve].offset=ae[ve-1].offset+ae[ve-1].length:ae[ve].offset=be-1}return ae}function detectVersion(ie){const Z=new DataView(ie);return Z.getUint16(2,!0)===2?(console.warn("PMTiles spec version 2 has been deprecated; please see github.com/protomaps/PMTiles for tools to upgrade"),2):Z.getUint16(2,!0)===1?(console.warn("PMTiles spec version 1 has been deprecated; please see github.com/protomaps/PMTiles for tools to upgrade"),1):3}var EtagMismatch=class extends Error{};function getHeaderAndRoot(ie,Z,ee,ae){return __async(this,null,function*(){const ye=yield ie.getBytes(0,16384);if(new DataView(ye.data).getUint16(0,!0)!==19792)throw new Error("Wrong magic number for PMTiles archive");if(detectVersion(ye.data)<3)return[yield v2_default.getHeader(ie)];const ve=ye.data.slice(0,HEADER_SIZE_BYTES);let be=ye.etag;ae&&ye.etag!=ae&&(console.warn("ETag conflict detected; your HTTP server might not support content-based ETag headers. ETags disabled for "+ie.getKey()),be=void 0);const Ye=bytesToHeader(ve,be);if(ee){const Ke=ye.data.slice(Ye.rootDirectoryOffset,Ye.rootDirectoryOffset+Ye.rootDirectoryLength),Xe=ie.getKey()+"|"+(Ye.etag||"")+"|"+Ye.rootDirectoryOffset+"|"+Ye.rootDirectoryLength,Je=deserializeIndex(yield Z(Ke,Ye.internalCompression));return[Ye,[Xe,Je.length,Je]]}return[Ye,void 0]})}function getDirectory(ie,Z,ee,ae,ye){return __async(this,null,function*(){const ve=yield ie.getBytes(ee,ae);if(ye.etag&&ye.etag!==ve.etag)throw new EtagMismatch(ve.etag);const be=yield Z(ve.data,ye.internalCompression),Ye=deserializeIndex(be);if(Ye.length===0)throw new Error("Empty directory is invalid");return Ye})}var SharedPromiseCache=class{constructor(ie=100,Z=!0,ee=defaultDecompress){this.cache=new Map,this.maxCacheEntries=ie,this.counter=1,this.prefetch=Z,this.decompress=ee}getHeader(ie,Z){return __async(this,null,function*(){const ee=ie.getKey();if(this.cache.has(ee))return this.cache.get(ee).lastUsed=this.counter++,yield this.cache.get(ee).data;const ae=new Promise((ye,ve)=>{getHeaderAndRoot(ie,this.decompress,this.prefetch,Z).then(be=>{be[1]&&this.cache.set(be[1][0],{lastUsed:this.counter++,data:Promise.resolve(be[1][2])}),ye(be[0]),this.prune()}).catch(be=>{ve(be)})});return this.cache.set(ee,{lastUsed:this.counter++,data:ae}),ae})}getDirectory(ie,Z,ee,ae){return __async(this,null,function*(){const ye=ie.getKey()+"|"+(ae.etag||"")+"|"+Z+"|"+ee;if(this.cache.has(ye))return this.cache.get(ye).lastUsed=this.counter++,yield this.cache.get(ye).data;const ve=new Promise((be,Ye)=>{getDirectory(ie,this.decompress,Z,ee,ae).then(Ke=>{be(Ke),this.prune()}).catch(Ke=>{Ye(Ke)})});return this.cache.set(ye,{lastUsed:this.counter++,data:ve}),ve})}getArrayBuffer(ie,Z,ee,ae){return __async(this,null,function*(){const ye=ie.getKey()+"|"+(ae.etag||"")+"|"+Z+"|"+ee;if(this.cache.has(ye))return this.cache.get(ye).lastUsed=this.counter++,yield this.cache.get(ye).data;const ve=new Promise((be,Ye)=>{ie.getBytes(Z,ee).then(Ke=>{if(ae.etag&&ae.etag!==Ke.etag)throw new EtagMismatch(Ke.etag);be(Ke.data),this.cache.has(ye),this.prune()}).catch(Ke=>{Ye(Ke)})});return this.cache.set(ye,{lastUsed:this.counter++,data:ve}),ve})}prune(){if(this.cache.size>=this.maxCacheEntries){let ie=1/0,Z;this.cache.forEach((ee,ae)=>{ee.lastUsedve.maxZoom)return;let be=ve.rootDirectoryOffset,Ye=ve.rootDirectoryLength;for(let Ke=0;Ke<=3;Ke++){const Xe=yield this.cache.getDirectory(this.source,be,Ye,ve),Je=findTile(Xe,ye);if(Je)if(Je.runLength>0){const rt=yield this.source.getBytes(ve.tileDataOffset+Je.offset,Je.length,ae);if(ve.etag&&ve.etag!==rt.etag)throw new EtagMismatch(rt.etag);return{data:yield this.decompress(rt.data,ve.tileCompression),cacheControl:rt.cacheControl,expires:rt.expires}}else be=ve.leafDirectoryOffset+Je.offset,Ye=Je.length;else return}throw Error("Maximum directory depth exceeded")})}getZxy(ie,Z,ee,ae){return __async(this,null,function*(){try{return yield this.getZxyAttempt(ie,Z,ee,ae)}catch(ye){if(ye instanceof EtagMismatch)return this.cache.invalidate(this.source,ye.message),yield this.getZxyAttempt(ie,Z,ee,ae);throw ye}})}getMetadataAttempt(){return __async(this,null,function*(){const ie=yield this.cache.getHeader(this.source),Z=yield this.source.getBytes(ie.jsonMetadataOffset,ie.jsonMetadataLength);if(ie.etag&&ie.etag!==Z.etag)throw new EtagMismatch(Z.etag);const ee=yield this.decompress(Z.data,ie.internalCompression),ae=new TextDecoder("utf-8");return JSON.parse(ae.decode(ee))})}getMetadata(){return __async(this,null,function*(){try{return yield this.getMetadataAttempt()}catch(ie){if(ie instanceof EtagMismatch)return this.cache.invalidate(this.source,ie.message),yield this.getMetadataAttempt();throw ie}})}};class PMTilesVectorSource extends VectorTile{constructor(Z){super({...Z,state:"loading",url:"pmtiles://"+Z.url+"/{z}/{x}/{y}",format:new MVT}),Sc(this,"tileLoadFunction",(ae,ye)=>{const ve=new RegExp(/pmtiles:\/\/(.+)\/(\d+)\/(\d+)\/(\d+)/),be=ye.match(ve),Ye=+be[2],Ke=+be[3],Xe=+be[4];ae.setLoader((Je,rt,nt)=>{ae.setState(TileState.LOADING),this.pmtiles_.getZxy(Ye,Ke,Xe).then(it=>{if(it){const lt=ae.getFormat();ae.setFeatures(lt.readFeatures(it.data,{extent:Je,featureProjection:nt})),ae.setState(TileState.LOADED)}else ae.setFeatures([]),ae.setState(TileState.EMPTY)}).catch(it=>{ae.setFeatures([]),ae.setState(TileState.ERROR)})})});const ee=new FetchSource(Z.url,new Headers(Z.headers));this.pmtiles_=new PMTiles(ee),this.pmtiles_.getHeader().then(ae=>{this.tileGrid.minZoom=ae.minZoom,this.tileGrid.maxZoom=ae.maxZoom,this.setTileLoadFunction(this.tileLoadFunction),this.setState("ready")})}}const openLayersBasemaps={darkMatter:{url:"https://{a-d}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png",attribution:'© OpenStreetMap contributors, © Carto',maxZoom:18},positron:{url:"https://{a-d}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",attribution:'© OpenStreetMap contributors, © Carto',maxZoom:18},positronLite:{url:"https://{a-d}.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}.png",attribution:'© OpenStreetMap contributors, © Carto',maxZoom:18},worldAntique:{url:"https://cartocdn_{a-d}.global.ssl.fastly.net/base-antique/{z}/{x}/{y}.png",attribution:'© OpenStreetMap contributors, © Carto',maxZoom:18},worldEco:{url:"https://cartocdn_{a-d}.global.ssl.fastly.net/base-eco/{z}/{x}/{y}.png",attribution:'© OpenStreetMap contributors, © Carto',maxZoom:18},flatBlue:{url:"https://cartocdn_{a-d}.global.ssl.fastly.net/base-flatblue/{z}/{x}/{y}.png",attribution:'© OpenStreetMap contributors, © Carto',maxZoom:18},midnightCommander:{url:"https://cartocdn_{a-d}.global.ssl.fastly.net/base-midnight/{z}/{x}/{y}.png",attribution:'© OpenStreetMap contributors, © Carto',maxZoom:18},openstreetmapHot:{url:"https://{a-c}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png",attribution:'© OpenStreetMap, Tiles courtesy of Humanitarian OpenStreetMap Team',maxZoom:19},openstreetmapStandard:{url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:'© OpenStreetMap contributors',maxZoom:19}};class OlInitializer{constructor(){this.element=document.getElementById("ol-map"),this.element&&(this.data=this.element.dataset,this.extent=new GeoJSON().readFeatures(this.data.mapGeom)[0].getGeometry().getExtent())}run(){if(!this.element)return!1;this.data.protocol==="Pmtiles"?this.initializePmtiles():this.data.protocol==="Cog"&&this.initializeCog()}baseLayer(){const Z=openLayersBasemaps[this.data.basemap];return new TileLayer({source:new XYZ({attributions:Z.attribution,url:Z.url,maxZoom:Z.maxZoom})})}initializePmtiles(){const Z=new VectorTileLayer({declutter:!0,source:new PMTilesVectorSource({url:this.data.url}),style:new Style$1({stroke:new Stroke({color:"#7070B3",width:1}),fill:new Fill({color:"#FFFFFF"}),image:new CircleStyle({radius:7,fill:new Fill({color:"#7070B3"}),stroke:new Stroke({color:"#FFFFFF",width:2})})})});useGeographic();const ee=new Map$1({controls:defaults$2().extend([new FullScreen]),layers:[this.baseLayer(),Z],target:"ol-map"});ee.getView().fit(this.extent,ee.getSize())}initializeCog(){const Z=new GeoTIFFSource({sources:[{url:this.data.url}]});Z.getView().then(ee=>{const ae=new Map$1({controls:defaults$2().extend([new FullScreen]),target:"ol-map",layers:[this.baseLayer(),new WebGLTileLayer({source:Z})],view:new View({center:ee.center})});ae.getView().fit(ee.extent,ae.getSize())})}}var react={exports:{}},react_production_min={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var hasRequiredReact_production_min;function requireReact_production_min(){if(hasRequiredReact_production_min)return react_production_min;hasRequiredReact_production_min=1;var ie=Symbol.for("react.element"),Z=Symbol.for("react.portal"),ee=Symbol.for("react.fragment"),ae=Symbol.for("react.strict_mode"),ye=Symbol.for("react.profiler"),ve=Symbol.for("react.provider"),be=Symbol.for("react.context"),Ye=Symbol.for("react.forward_ref"),Ke=Symbol.for("react.suspense"),Xe=Symbol.for("react.memo"),Je=Symbol.for("react.lazy"),rt=Symbol.iterator;function nt(si){return si===null||typeof si!="object"?null:(si=rt&&si[rt]||si["@@iterator"],typeof si=="function"?si:null)}var it={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},lt=Object.assign,ct={};function ot(si,Ei,yi){this.props=si,this.context=Ei,this.refs=ct,this.updater=yi||it}ot.prototype.isReactComponent={},ot.prototype.setState=function(si,Ei){if(typeof si!="object"&&typeof si!="function"&&si!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,si,Ei,"setState")},ot.prototype.forceUpdate=function(si){this.updater.enqueueForceUpdate(this,si,"forceUpdate")};function dt(){}dt.prototype=ot.prototype;function ft(si,Ei,yi){this.props=si,this.context=Ei,this.refs=ct,this.updater=yi||it}var gt=ft.prototype=new dt;gt.constructor=ft,lt(gt,ot.prototype),gt.isPureReactComponent=!0;var mt=Array.isArray,Yr=Object.prototype.hasOwnProperty,Qr={current:null},Xr={key:!0,ref:!0,__self:!0,__source:!0};function Jr(si,Ei,yi){var Mi,Ci={},Ri=null,Ni=null;if(Ei!=null)for(Mi in Ei.ref!==void 0&&(Ni=Ei.ref),Ei.key!==void 0&&(Ri=""+Ei.key),Ei)Yr.call(Ei,Mi)&&!Xr.hasOwnProperty(Mi)&&(Ci[Mi]=Ei[Mi]);var Ai=arguments.length-2;if(Ai===1)Ci.children=yi;else if(1>>1,yi=ci[Ei];if(0>>1;Eiye(Ri,si))Niye(Ai,Ri)?(ci[Ei]=Ai,ci[Ni]=si,Ei=Ni):(ci[Ei]=Ri,ci[Ci]=si,Ei=Ci);else if(Niye(Ai,si))ci[Ei]=Ai,ci[Ni]=si,Ei=Ni;else break e}}return Si}function ye(ci,Si){var si=ci.sortIndex-Si.sortIndex;return si!==0?si:ci.id-Si.id}if(typeof performance=="object"&&typeof performance.now=="function"){var ve=performance;ie.unstable_now=function(){return ve.now()}}else{var be=Date,Ye=be.now();ie.unstable_now=function(){return be.now()-Ye}}var Ke=[],Xe=[],Je=1,rt=null,nt=3,it=!1,lt=!1,ct=!1,ot=typeof setTimeout=="function"?setTimeout:null,dt=typeof clearTimeout=="function"?clearTimeout:null,ft=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function gt(ci){for(var Si=ee(Xe);Si!==null;){if(Si.callback===null)ae(Xe);else if(Si.startTime<=ci)ae(Xe),Si.sortIndex=Si.expirationTime,Z(Ke,Si);else break;Si=ee(Xe)}}function mt(ci){if(ct=!1,gt(ci),!lt)if(ee(Ke)!==null)lt=!0,hi(Yr);else{var Si=ee(Xe);Si!==null&&ri(mt,Si.startTime-ci)}}function Yr(ci,Si){lt=!1,ct&&(ct=!1,dt(Jr),Jr=-1),it=!0;var si=nt;try{for(gt(Si),rt=ee(Ke);rt!==null&&(!(rt.expirationTime>Si)||ci&&!ni());){var Ei=rt.callback;if(typeof Ei=="function"){rt.callback=null,nt=rt.priorityLevel;var yi=Ei(rt.expirationTime<=Si);Si=ie.unstable_now(),typeof yi=="function"?rt.callback=yi:rt===ee(Ke)&&ae(Ke),gt(Si)}else ae(Ke);rt=ee(Ke)}if(rt!==null)var Mi=!0;else{var Ci=ee(Xe);Ci!==null&&ri(mt,Ci.startTime-Si),Mi=!1}return Mi}finally{rt=null,nt=si,it=!1}}var Qr=!1,Xr=null,Jr=-1,ai=5,oi=-1;function ni(){return!(ie.unstable_now()-oici||125Ei?(ci.sortIndex=si,Z(Xe,ci),ee(Ke)===null&&ci===ee(Xe)&&(ct?(dt(Jr),Jr=-1):ct=!0,ri(mt,si-Ei))):(ci.sortIndex=yi,Z(Ke,ci),lt||it||(lt=!0,hi(Yr))),ci},ie.unstable_shouldYield=ni,ie.unstable_wrapCallback=function(ci){var Si=nt;return function(){var si=nt;nt=Si;try{return ci.apply(this,arguments)}finally{nt=si}}}}(scheduler_production_min)),scheduler_production_min}var hasRequiredScheduler;function requireScheduler(){return hasRequiredScheduler||(hasRequiredScheduler=1,scheduler.exports=requireScheduler_production_min()),scheduler.exports}/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var hasRequiredReactDom_production_min;function requireReactDom_production_min(){if(hasRequiredReactDom_production_min)return reactDom_production_min;hasRequiredReactDom_production_min=1;var ie=reactExports,Z=requireScheduler();function ee(Qe){for(var tt="https://reactjs.org/docs/error-decoder.html?invariant="+Qe,st=1;st"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ke=Object.prototype.hasOwnProperty,Xe=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Je={},rt={};function nt(Qe){return Ke.call(rt,Qe)?!0:Ke.call(Je,Qe)?!1:Xe.test(Qe)?rt[Qe]=!0:(Je[Qe]=!0,!1)}function it(Qe,tt,st,ut){if(st!==null&&st.type===0)return!1;switch(typeof tt){case"function":case"symbol":return!0;case"boolean":return ut?!1:st!==null?!st.acceptsBooleans:(Qe=Qe.toLowerCase().slice(0,5),Qe!=="data-"&&Qe!=="aria-");default:return!1}}function lt(Qe,tt,st,ut){if(tt===null||typeof tt>"u"||it(Qe,tt,st,ut))return!0;if(ut)return!1;if(st!==null)switch(st.type){case 3:return!tt;case 4:return tt===!1;case 5:return isNaN(tt);case 6:return isNaN(tt)||1>tt}return!1}function ct(Qe,tt,st,ut,pt,_r,ti){this.acceptsBooleans=tt===2||tt===3||tt===4,this.attributeName=ut,this.attributeNamespace=pt,this.mustUseProperty=st,this.propertyName=Qe,this.type=tt,this.sanitizeURL=_r,this.removeEmptyString=ti}var ot={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(Qe){ot[Qe]=new ct(Qe,0,!1,Qe,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(Qe){var tt=Qe[0];ot[tt]=new ct(tt,1,!1,Qe[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(Qe){ot[Qe]=new ct(Qe,2,!1,Qe.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(Qe){ot[Qe]=new ct(Qe,2,!1,Qe,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(Qe){ot[Qe]=new ct(Qe,3,!1,Qe.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(Qe){ot[Qe]=new ct(Qe,3,!0,Qe,null,!1,!1)}),["capture","download"].forEach(function(Qe){ot[Qe]=new ct(Qe,4,!1,Qe,null,!1,!1)}),["cols","rows","size","span"].forEach(function(Qe){ot[Qe]=new ct(Qe,6,!1,Qe,null,!1,!1)}),["rowSpan","start"].forEach(function(Qe){ot[Qe]=new ct(Qe,5,!1,Qe.toLowerCase(),null,!1,!1)});var dt=/[\-:]([a-z])/g;function ft(Qe){return Qe[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(Qe){var tt=Qe.replace(dt,ft);ot[tt]=new ct(tt,1,!1,Qe,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(Qe){var tt=Qe.replace(dt,ft);ot[tt]=new ct(tt,1,!1,Qe,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(Qe){var tt=Qe.replace(dt,ft);ot[tt]=new ct(tt,1,!1,Qe,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(Qe){ot[Qe]=new ct(Qe,1,!1,Qe.toLowerCase(),null,!1,!1)}),ot.xlinkHref=new ct("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(Qe){ot[Qe]=new ct(Qe,1,!1,Qe.toLowerCase(),null,!0,!0)});function gt(Qe,tt,st,ut){var pt=ot.hasOwnProperty(tt)?ot[tt]:null;(pt!==null?pt.type!==0:ut||!(2fi||pt[ti]!==_r[fi]){var vi=` +`+pt[ti].replace(" at new "," at ");return Qe.displayName&&vi.includes("")&&(vi=vi.replace("",Qe.displayName)),vi}while(1<=ti&&0<=fi);break}}}finally{Mi=!1,Error.prepareStackTrace=st}return(Qe=Qe?Qe.displayName||Qe.name:"")?yi(Qe):""}function Ri(Qe){switch(Qe.tag){case 5:return yi(Qe.type);case 16:return yi("Lazy");case 13:return yi("Suspense");case 19:return yi("SuspenseList");case 0:case 2:case 15:return Qe=Ci(Qe.type,!1),Qe;case 11:return Qe=Ci(Qe.type.render,!1),Qe;case 1:return Qe=Ci(Qe.type,!0),Qe;default:return""}}function Ni(Qe){if(Qe==null)return null;if(typeof Qe=="function")return Qe.displayName||Qe.name||null;if(typeof Qe=="string")return Qe;switch(Qe){case Xr:return"Fragment";case Qr:return"Portal";case ai:return"Profiler";case Jr:return"StrictMode";case ui:return"Suspense";case mi:return"SuspenseList"}if(typeof Qe=="object")switch(Qe.$$typeof){case ni:return(Qe.displayName||"Context")+".Consumer";case oi:return(Qe._context.displayName||"Context")+".Provider";case li:var tt=Qe.render;return Qe=Qe.displayName,Qe||(Qe=tt.displayName||tt.name||"",Qe=Qe!==""?"ForwardRef("+Qe+")":"ForwardRef"),Qe;case ii:return tt=Qe.displayName||null,tt!==null?tt:Ni(Qe.type)||"Memo";case hi:tt=Qe._payload,Qe=Qe._init;try{return Ni(Qe(tt))}catch{}}return null}function Ai(Qe){var tt=Qe.type;switch(Qe.tag){case 24:return"Cache";case 9:return(tt.displayName||"Context")+".Consumer";case 10:return(tt._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return Qe=tt.render,Qe=Qe.displayName||Qe.name||"",tt.displayName||(Qe!==""?"ForwardRef("+Qe+")":"ForwardRef");case 7:return"Fragment";case 5:return tt;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ni(tt);case 8:return tt===Jr?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof tt=="function")return tt.displayName||tt.name||null;if(typeof tt=="string")return tt}return null}function ki(Qe){switch(typeof Qe){case"boolean":case"number":case"string":case"undefined":return Qe;case"object":return Qe;default:return""}}function Yi(Qe){var tt=Qe.type;return(Qe=Qe.nodeName)&&Qe.toLowerCase()==="input"&&(tt==="checkbox"||tt==="radio")}function Ji(Qe){var tt=Yi(Qe)?"checked":"value",st=Object.getOwnPropertyDescriptor(Qe.constructor.prototype,tt),ut=""+Qe[tt];if(!Qe.hasOwnProperty(tt)&&typeof st<"u"&&typeof st.get=="function"&&typeof st.set=="function"){var pt=st.get,_r=st.set;return Object.defineProperty(Qe,tt,{configurable:!0,get:function(){return pt.call(this)},set:function(ti){ut=""+ti,_r.call(this,ti)}}),Object.defineProperty(Qe,tt,{enumerable:st.enumerable}),{getValue:function(){return ut},setValue:function(ti){ut=""+ti},stopTracking:function(){Qe._valueTracker=null,delete Qe[tt]}}}}function ls(Qe){Qe._valueTracker||(Qe._valueTracker=Ji(Qe))}function hs(Qe){if(!Qe)return!1;var tt=Qe._valueTracker;if(!tt)return!0;var st=tt.getValue(),ut="";return Qe&&(ut=Yi(Qe)?Qe.checked?"true":"false":Qe.value),Qe=ut,Qe!==st?(tt.setValue(Qe),!0):!1}function Kr(Qe){if(Qe=Qe||(typeof document<"u"?document:void 0),typeof Qe>"u")return null;try{return Qe.activeElement||Qe.body}catch{return Qe.body}}function di(Qe,tt){var st=tt.checked;return si({},tt,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:st??Qe._wrapperState.initialChecked})}function wi(Qe,tt){var st=tt.defaultValue==null?"":tt.defaultValue,ut=tt.checked!=null?tt.checked:tt.defaultChecked;st=ki(tt.value!=null?tt.value:st),Qe._wrapperState={initialChecked:ut,initialValue:st,controlled:tt.type==="checkbox"||tt.type==="radio"?tt.checked!=null:tt.value!=null}}function Ii(Qe,tt){tt=tt.checked,tt!=null&>(Qe,"checked",tt,!1)}function Di(Qe,tt){Ii(Qe,tt);var st=ki(tt.value),ut=tt.type;if(st!=null)ut==="number"?(st===0&&Qe.value===""||Qe.value!=st)&&(Qe.value=""+st):Qe.value!==""+st&&(Qe.value=""+st);else if(ut==="submit"||ut==="reset"){Qe.removeAttribute("value");return}tt.hasOwnProperty("value")?Gi(Qe,tt.type,st):tt.hasOwnProperty("defaultValue")&&Gi(Qe,tt.type,ki(tt.defaultValue)),tt.checked==null&&tt.defaultChecked!=null&&(Qe.defaultChecked=!!tt.defaultChecked)}function is(Qe,tt,st){if(tt.hasOwnProperty("value")||tt.hasOwnProperty("defaultValue")){var ut=tt.type;if(!(ut!=="submit"&&ut!=="reset"||tt.value!==void 0&&tt.value!==null))return;tt=""+Qe._wrapperState.initialValue,st||tt===Qe.value||(Qe.value=tt),Qe.defaultValue=tt}st=Qe.name,st!==""&&(Qe.name=""),Qe.defaultChecked=!!Qe._wrapperState.initialChecked,st!==""&&(Qe.name=st)}function Gi(Qe,tt,st){(tt!=="number"||Kr(Qe.ownerDocument)!==Qe)&&(st==null?Qe.defaultValue=""+Qe._wrapperState.initialValue:Qe.defaultValue!==""+st&&(Qe.defaultValue=""+st))}var us=Array.isArray;function Zi(Qe,tt,st,ut){if(Qe=Qe.options,tt){tt={};for(var pt=0;pt"+tt.valueOf().toString()+"",tt=zs.firstChild;Qe.firstChild;)Qe.removeChild(Qe.firstChild);for(;tt.firstChild;)Qe.appendChild(tt.firstChild)}});function Ts(Qe,tt){if(tt){var st=Qe.firstChild;if(st&&st===Qe.lastChild&&st.nodeType===3){st.nodeValue=tt;return}}Qe.textContent=tt}var go={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ha=["Webkit","ms","Moz","O"];Object.keys(go).forEach(function(Qe){Ha.forEach(function(tt){tt=tt+Qe.charAt(0).toUpperCase()+Qe.substring(1),go[tt]=go[Qe]})});function na(Qe,tt,st){return tt==null||typeof tt=="boolean"||tt===""?"":st||typeof tt!="number"||tt===0||go.hasOwnProperty(Qe)&&go[Qe]?(""+tt).trim():tt+"px"}function No(Qe,tt){Qe=Qe.style;for(var st in tt)if(tt.hasOwnProperty(st)){var ut=st.indexOf("--")===0,pt=na(st,tt[st],ut);st==="float"&&(st="cssFloat"),ut?Qe.setProperty(st,pt):Qe[st]=pt}}var ei=si({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Zr(Qe,tt){if(tt){if(ei[Qe]&&(tt.children!=null||tt.dangerouslySetInnerHTML!=null))throw Error(ee(137,Qe));if(tt.dangerouslySetInnerHTML!=null){if(tt.children!=null)throw Error(ee(60));if(typeof tt.dangerouslySetInnerHTML!="object"||!("__html"in tt.dangerouslySetInnerHTML))throw Error(ee(61))}if(tt.style!=null&&typeof tt.style!="object")throw Error(ee(62))}}function pi(Qe,tt){if(Qe.indexOf("-")===-1)return typeof tt.is=="string";switch(Qe){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var gi=null;function $i(Qe){return Qe=Qe.target||Qe.srcElement||window,Qe.correspondingUseElement&&(Qe=Qe.correspondingUseElement),Qe.nodeType===3?Qe.parentNode:Qe}var Vi=null,Bi=null,Ui=null;function es(Qe){if(Qe=al(Qe)){if(typeof Vi!="function")throw Error(ee(280));var tt=Qe.stateNode;tt&&(tt=jl(tt),Vi(Qe.stateNode,Qe.type,tt))}}function Qi(Qe){Bi?Ui?Ui.push(Qe):Ui=[Qe]:Bi=Qe}function ss(){if(Bi){var Qe=Bi,tt=Ui;if(Ui=Bi=null,es(Qe),tt)for(Qe=0;Qe>>=0,Qe===0?32:31-(lp(Qe)/cp|0)|0}var Rl=64,Al=4194304;function Va(Qe){switch(Qe&-Qe){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return Qe&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return Qe&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return Qe}}function Il(Qe,tt){var st=Qe.pendingLanes;if(st===0)return 0;var ut=0,pt=Qe.suspendedLanes,_r=Qe.pingedLanes,ti=st&268435455;if(ti!==0){var fi=ti&~pt;fi!==0?ut=Va(fi):(_r&=ti,_r!==0&&(ut=Va(_r)))}else ti=st&~pt,ti!==0?ut=Va(ti):_r!==0&&(ut=Va(_r));if(ut===0)return 0;if(tt!==0&&tt!==ut&&!(tt&pt)&&(pt=ut&-ut,_r=tt&-tt,pt>=_r||pt===16&&(_r&4194240)!==0))return tt;if(ut&4&&(ut|=st&16),tt=Qe.entangledLanes,tt!==0)for(Qe=Qe.entanglements,tt&=ut;0st;st++)tt.push(Qe);return tt}function za(Qe,tt,st){Qe.pendingLanes|=tt,tt!==536870912&&(Qe.suspendedLanes=0,Qe.pingedLanes=0),Qe=Qe.eventTimes,tt=31-yo(tt),Qe[tt]=st}function fp(Qe,tt){var st=Qe.pendingLanes&~tt;Qe.pendingLanes=tt,Qe.suspendedLanes=0,Qe.pingedLanes=0,Qe.expiredLanes&=tt,Qe.mutableReadLanes&=tt,Qe.entangledLanes&=tt,tt=Qe.entanglements;var ut=Qe.eventTimes;for(Qe=Qe.expirationTimes;0=Ja),kh=" ",Nh=!1;function Fh(Qe,tt){switch(Qe){case"keyup":return Gp.indexOf(tt.keyCode)!==-1;case"keydown":return tt.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bh(Qe){return Qe=Qe.detail,typeof Qe=="object"&&"data"in Qe?Qe.data:null}var ba=!1;function Vp(Qe,tt){switch(Qe){case"compositionend":return Bh(tt);case"keypress":return tt.which!==32?null:(Nh=!0,kh);case"textInput":return Qe=tt.data,Qe===kh&&Nh?null:Qe;default:return null}}function zp(Qe,tt){if(ba)return Qe==="compositionend"||!Yc&&Fh(Qe,tt)?(Qe=Ph(),Ol=Gc=Ho=null,ba=!1,Qe):null;switch(Qe){case"paste":return null;case"keypress":if(!(tt.ctrlKey||tt.altKey||tt.metaKey)||tt.ctrlKey&&tt.altKey){if(tt.char&&1=tt)return{node:st,offset:tt-Qe};Qe=ut}e:{for(;st;){if(st.nextSibling){st=st.nextSibling;break e}st=st.parentNode}st=void 0}st=Wh(st)}}function Kh(Qe,tt){return Qe&&tt?Qe===tt?!0:Qe&&Qe.nodeType===3?!1:tt&&tt.nodeType===3?Kh(Qe,tt.parentNode):"contains"in Qe?Qe.contains(tt):Qe.compareDocumentPosition?!!(Qe.compareDocumentPosition(tt)&16):!1:!1}function qh(){for(var Qe=window,tt=Kr();tt instanceof Qe.HTMLIFrameElement;){try{var st=typeof tt.contentWindow.location.href=="string"}catch{st=!1}if(st)Qe=tt.contentWindow;else break;tt=Kr(Qe.document)}return tt}function Xc(Qe){var tt=Qe&&Qe.nodeName&&Qe.nodeName.toLowerCase();return tt&&(tt==="input"&&(Qe.type==="text"||Qe.type==="search"||Qe.type==="tel"||Qe.type==="url"||Qe.type==="password")||tt==="textarea"||Qe.contentEditable==="true")}function Zp(Qe){var tt=qh(),st=Qe.focusedElem,ut=Qe.selectionRange;if(tt!==st&&st&&st.ownerDocument&&Kh(st.ownerDocument.documentElement,st)){if(ut!==null&&Xc(st)){if(tt=ut.start,Qe=ut.end,Qe===void 0&&(Qe=tt),"selectionStart"in st)st.selectionStart=tt,st.selectionEnd=Math.min(Qe,st.value.length);else if(Qe=(tt=st.ownerDocument||document)&&tt.defaultView||window,Qe.getSelection){Qe=Qe.getSelection();var pt=st.textContent.length,_r=Math.min(ut.start,pt);ut=ut.end===void 0?_r:Math.min(ut.end,pt),!Qe.extend&&_r>ut&&(pt=ut,ut=_r,_r=pt),pt=Yh(st,_r);var ti=Yh(st,ut);pt&&ti&&(Qe.rangeCount!==1||Qe.anchorNode!==pt.node||Qe.anchorOffset!==pt.offset||Qe.focusNode!==ti.node||Qe.focusOffset!==ti.offset)&&(tt=tt.createRange(),tt.setStart(pt.node,pt.offset),Qe.removeAllRanges(),_r>ut?(Qe.addRange(tt),Qe.extend(ti.node,ti.offset)):(tt.setEnd(ti.node,ti.offset),Qe.addRange(tt)))}}for(tt=[],Qe=st;Qe=Qe.parentNode;)Qe.nodeType===1&&tt.push({element:Qe,left:Qe.scrollLeft,top:Qe.scrollTop});for(typeof st.focus=="function"&&st.focus(),st=0;st=document.documentMode,Sa=null,Qc=null,rl=null,Jc=!1;function Xh(Qe,tt,st){var ut=st.window===st?st.document:st.nodeType===9?st:st.ownerDocument;Jc||Sa==null||Sa!==Kr(ut)||(ut=Sa,"selectionStart"in ut&&Xc(ut)?ut={start:ut.selectionStart,end:ut.selectionEnd}:(ut=(ut.ownerDocument&&ut.ownerDocument.defaultView||window).getSelection(),ut={anchorNode:ut.anchorNode,anchorOffset:ut.anchorOffset,focusNode:ut.focusNode,focusOffset:ut.focusOffset}),rl&&tl(rl,ut)||(rl=ut,ut=Hl(Qc,"onSelect"),0Aa||(Qe.current=uu[Aa],uu[Aa]=null,Aa--)}function Es(Qe,tt){Aa++,uu[Aa]=Qe.current,Qe.current=tt}var Wo={},Us=jo(Wo),Ks=jo(!1),aa=Wo;function Ia(Qe,tt){var st=Qe.type.contextTypes;if(!st)return Wo;var ut=Qe.stateNode;if(ut&&ut.__reactInternalMemoizedUnmaskedChildContext===tt)return ut.__reactInternalMemoizedMaskedChildContext;var pt={},_r;for(_r in st)pt[_r]=tt[_r];return ut&&(Qe=Qe.stateNode,Qe.__reactInternalMemoizedUnmaskedChildContext=tt,Qe.__reactInternalMemoizedMaskedChildContext=pt),pt}function qs(Qe){return Qe=Qe.childContextTypes,Qe!=null}function Wl(){Ss(Ks),Ss(Us)}function dd(Qe,tt,st){if(Us.current!==Wo)throw Error(ee(168));Es(Us,tt),Es(Ks,st)}function pd(Qe,tt,st){var ut=Qe.stateNode;if(tt=tt.childContextTypes,typeof ut.getChildContext!="function")return st;ut=ut.getChildContext();for(var pt in ut)if(!(pt in tt))throw Error(ee(108,Ai(Qe)||"Unknown",pt));return si({},st,ut)}function Yl(Qe){return Qe=(Qe=Qe.stateNode)&&Qe.__reactInternalMemoizedMergedChildContext||Wo,aa=Us.current,Es(Us,Qe),Es(Ks,Ks.current),!0}function gd(Qe,tt,st){var ut=Qe.stateNode;if(!ut)throw Error(ee(169));st?(Qe=pd(Qe,tt,aa),ut.__reactInternalMemoizedMergedChildContext=Qe,Ss(Ks),Ss(Us),Es(Us,Qe)):Ss(Ks),Es(Ks,st)}var Po=null,Kl=!1,hu=!1;function md(Qe){Po===null?Po=[Qe]:Po.push(Qe)}function hg(Qe){Kl=!0,md(Qe)}function Yo(){if(!hu&&Po!==null){hu=!0;var Qe=0,tt=ys;try{var st=Po;for(ys=1;Qe>=ti,pt-=ti,Lo=1<<32-yo(tt)+pt|st<os?(Ns=rs,rs=null):Ns=rs.sibling;var gs=Pi(bi,rs,xi[os],Fi);if(gs===null){rs===null&&(rs=Ns);break}Qe&&rs&&gs.alternate===null&&tt(bi,rs),Ti=_r(gs,Ti,os),ts===null?qi=gs:ts.sibling=gs,ts=gs,rs=Ns}if(os===xi.length)return st(bi,rs),xs&&ca(bi,os),qi;if(rs===null){for(;osos?(Ns=rs,rs=null):Ns=rs.sibling;var ra=Pi(bi,rs,gs.value,Fi);if(ra===null){rs===null&&(rs=Ns);break}Qe&&rs&&ra.alternate===null&&tt(bi,rs),Ti=_r(ra,Ti,os),ts===null?qi=ra:ts.sibling=ra,ts=ra,rs=Ns}if(gs.done)return st(bi,rs),xs&&ca(bi,os),qi;if(rs===null){for(;!gs.done;os++,gs=xi.next())gs=Oi(bi,gs.value,Fi),gs!==null&&(Ti=_r(gs,Ti,os),ts===null?qi=gs:ts.sibling=gs,ts=gs);return xs&&ca(bi,os),qi}for(rs=ut(bi,rs);!gs.done;os++,gs=xi.next())gs=Hi(rs,bi,os,gs.value,Fi),gs!==null&&(Qe&&gs.alternate!==null&&rs.delete(gs.key===null?os:gs.key),Ti=_r(gs,Ti,os),ts===null?qi=gs:ts.sibling=gs,ts=gs);return Qe&&rs.forEach(function(jg){return tt(bi,jg)}),xs&&ca(bi,os),qi}function Is(bi,Ti,xi,Fi){if(typeof xi=="object"&&xi!==null&&xi.type===Xr&&xi.key===null&&(xi=xi.props.children),typeof xi=="object"&&xi!==null){switch(xi.$$typeof){case Yr:e:{for(var qi=xi.key,ts=Ti;ts!==null;){if(ts.key===qi){if(qi=xi.type,qi===Xr){if(ts.tag===7){st(bi,ts.sibling),Ti=pt(ts,xi.props.children),Ti.return=bi,bi=Ti;break e}}else if(ts.elementType===qi||typeof qi=="object"&&qi!==null&&qi.$$typeof===hi&&Pd(qi)===ts.type){st(bi,ts.sibling),Ti=pt(ts,xi.props),Ti.ref=ll(bi,ts,xi),Ti.return=bi,bi=Ti;break e}st(bi,ts);break}else tt(bi,ts);ts=ts.sibling}xi.type===Xr?(Ti=va(xi.props.children,bi.mode,Fi,xi.key),Ti.return=bi,bi=Ti):(Fi=_c(xi.type,xi.key,xi.props,null,bi.mode,Fi),Fi.ref=ll(bi,Ti,xi),Fi.return=bi,bi=Fi)}return ti(bi);case Qr:e:{for(ts=xi.key;Ti!==null;){if(Ti.key===ts)if(Ti.tag===4&&Ti.stateNode.containerInfo===xi.containerInfo&&Ti.stateNode.implementation===xi.implementation){st(bi,Ti.sibling),Ti=pt(Ti,xi.children||[]),Ti.return=bi,bi=Ti;break e}else{st(bi,Ti);break}else tt(bi,Ti);Ti=Ti.sibling}Ti=ah(xi,bi.mode,Fi),Ti.return=bi,bi=Ti}return ti(bi);case hi:return ts=xi._init,Is(bi,Ti,ts(xi._payload),Fi)}if(us(xi))return ji(bi,Ti,xi,Fi);if(Si(xi))return Wi(bi,Ti,xi,Fi);ic(bi,xi)}return typeof xi=="string"&&xi!==""||typeof xi=="number"?(xi=""+xi,Ti!==null&&Ti.tag===6?(st(bi,Ti.sibling),Ti=pt(Ti,xi),Ti.return=bi,bi=Ti):(st(bi,Ti),Ti=oh(xi,bi.mode,Fi),Ti.return=bi,bi=Ti),ti(bi)):st(bi,Ti)}return Is}var Ma=Ld(!0),$d=Ld(!1),cl={},Co=jo(cl),ul=jo(cl),hl=jo(cl);function da(Qe){if(Qe===cl)throw Error(ee(174));return Qe}function wu(Qe,tt){switch(Es(hl,tt),Es(ul,Qe),Es(Co,cl),Qe=tt.nodeType,Qe){case 9:case 11:tt=(tt=tt.documentElement)?tt.namespaceURI:vs(null,"");break;default:Qe=Qe===8?tt.parentNode:tt,tt=Qe.namespaceURI||null,Qe=Qe.tagName,tt=vs(tt,Qe)}Ss(Co),Es(Co,tt)}function ka(){Ss(Co),Ss(ul),Ss(hl)}function Dd(Qe){da(hl.current);var tt=da(Co.current),st=vs(tt,Qe.type);tt!==st&&(Es(ul,Qe),Es(Co,st))}function Cu(Qe){ul.current===Qe&&(Ss(Co),Ss(ul))}var ws=jo(0);function sc(Qe){for(var tt=Qe;tt!==null;){if(tt.tag===13){var st=tt.memoizedState;if(st!==null&&(st=st.dehydrated,st===null||st.data==="$?"||st.data==="$!"))return tt}else if(tt.tag===19&&tt.memoizedProps.revealOrder!==void 0){if(tt.flags&128)return tt}else if(tt.child!==null){tt.child.return=tt,tt=tt.child;continue}if(tt===Qe)break;for(;tt.sibling===null;){if(tt.return===null||tt.return===Qe)return null;tt=tt.return}tt.sibling.return=tt.return,tt=tt.sibling}return null}var Ru=[];function Au(){for(var Qe=0;Qest?st:4,Qe(!0);var ut=Iu.transition;Iu.transition={};try{Qe(!1),tt()}finally{ys=st,Iu.transition=ut}}function Qd(){return ho().memoizedState}function gg(Qe,tt,st){var ut=Zo(Qe);if(st={lane:ut,action:st,hasEagerState:!1,eagerState:null,next:null},Jd(Qe))Zd(tt,st);else if(st=Sd(Qe,tt,st,ut),st!==null){var pt=Ws();xo(st,Qe,ut,pt),ef(st,tt,ut)}}function mg(Qe,tt,st){var ut=Zo(Qe),pt={lane:ut,action:st,hasEagerState:!1,eagerState:null,next:null};if(Jd(Qe))Zd(tt,pt);else{var _r=Qe.alternate;if(Qe.lanes===0&&(_r===null||_r.lanes===0)&&(_r=tt.lastRenderedReducer,_r!==null))try{var ti=tt.lastRenderedState,fi=_r(ti,st);if(pt.hasEagerState=!0,pt.eagerState=fi,vo(fi,ti)){var vi=tt.interleaved;vi===null?(pt.next=pt,bu(tt)):(pt.next=vi.next,vi.next=pt),tt.interleaved=pt;return}}catch{}finally{}st=Sd(Qe,tt,pt,ut),st!==null&&(pt=Ws(),xo(st,Qe,ut,pt),ef(st,tt,ut))}}function Jd(Qe){var tt=Qe.alternate;return Qe===Cs||tt!==null&&tt===Cs}function Zd(Qe,tt){dl=ac=!0;var st=Qe.pending;st===null?tt.next=tt:(tt.next=st.next,st.next=tt),Qe.pending=tt}function ef(Qe,tt,st){if(st&4194240){var ut=tt.lanes;ut&=Qe.pendingLanes,st|=ut,tt.lanes=st,kc(Qe,st)}}var uc={readContext:uo,useCallback:Gs,useContext:Gs,useEffect:Gs,useImperativeHandle:Gs,useInsertionEffect:Gs,useLayoutEffect:Gs,useMemo:Gs,useReducer:Gs,useRef:Gs,useState:Gs,useDebugValue:Gs,useDeferredValue:Gs,useTransition:Gs,useMutableSource:Gs,useSyncExternalStore:Gs,useId:Gs,unstable_isNewReconciler:!1},yg={readContext:uo,useCallback:function(Qe,tt){return Ro().memoizedState=[Qe,tt===void 0?null:tt],Qe},useContext:uo,useEffect:Vd,useImperativeHandle:function(Qe,tt,st){return st=st!=null?st.concat([Qe]):null,lc(4194308,4,Wd.bind(null,tt,Qe),st)},useLayoutEffect:function(Qe,tt){return lc(4194308,4,Qe,tt)},useInsertionEffect:function(Qe,tt){return lc(4,2,Qe,tt)},useMemo:function(Qe,tt){var st=Ro();return tt=tt===void 0?null:tt,Qe=Qe(),st.memoizedState=[Qe,tt],Qe},useReducer:function(Qe,tt,st){var ut=Ro();return tt=st!==void 0?st(tt):tt,ut.memoizedState=ut.baseState=tt,Qe={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Qe,lastRenderedState:tt},ut.queue=Qe,Qe=Qe.dispatch=gg.bind(null,Cs,Qe),[ut.memoizedState,Qe]},useRef:function(Qe){var tt=Ro();return Qe={current:Qe},tt.memoizedState=Qe},useState:Gd,useDebugValue:ku,useDeferredValue:function(Qe){return Ro().memoizedState=Qe},useTransition:function(){var Qe=Gd(!1),tt=Qe[0];return Qe=pg.bind(null,Qe[1]),Ro().memoizedState=Qe,[tt,Qe]},useMutableSource:function(){},useSyncExternalStore:function(Qe,tt,st){var ut=Cs,pt=Ro();if(xs){if(st===void 0)throw Error(ee(407));st=st()}else{if(st=tt(),ks===null)throw Error(ee(349));fa&30||kd(ut,tt,st)}pt.memoizedState=st;var _r={value:st,getSnapshot:tt};return pt.queue=_r,Vd(Fd.bind(null,ut,_r,Qe),[Qe]),ut.flags|=2048,ml(9,Nd.bind(null,ut,_r,st,tt),void 0,null),st},useId:function(){var Qe=Ro(),tt=ks.identifierPrefix;if(xs){var st=$o,ut=Lo;st=(ut&~(1<<32-yo(ut)-1)).toString(32)+st,tt=":"+tt+"R"+st,st=pl++,0<\/script>",Qe=Qe.removeChild(Qe.firstChild)):typeof ut.is=="string"?Qe=ti.createElement(st,{is:ut.is}):(Qe=ti.createElement(st),st==="select"&&(ti=Qe,ut.multiple?ti.multiple=!0:ut.size&&(ti.size=ut.size))):Qe=ti.createElementNS(Qe,st),Qe[wo]=tt,Qe[ol]=ut,vf(Qe,tt,!1,!1),tt.stateNode=Qe;e:{switch(ti=pi(st,ut),st){case"dialog":bs("cancel",Qe),bs("close",Qe),pt=ut;break;case"iframe":case"object":case"embed":bs("load",Qe),pt=ut;break;case"video":case"audio":for(pt=0;ptUa&&(tt.flags|=128,ut=!0,yl(_r,!1),tt.lanes=4194304)}else{if(!ut)if(Qe=sc(ti),Qe!==null){if(tt.flags|=128,ut=!0,st=Qe.updateQueue,st!==null&&(tt.updateQueue=st,tt.flags|=4),yl(_r,!0),_r.tail===null&&_r.tailMode==="hidden"&&!ti.alternate&&!xs)return Hs(tt),null}else 2*As()-_r.renderingStartTime>Ua&&st!==1073741824&&(tt.flags|=128,ut=!0,yl(_r,!1),tt.lanes=4194304);_r.isBackwards?(ti.sibling=tt.child,tt.child=ti):(st=_r.last,st!==null?st.sibling=ti:tt.child=ti,_r.last=ti)}return _r.tail!==null?(tt=_r.tail,_r.rendering=tt,_r.tail=tt.sibling,_r.renderingStartTime=As(),tt.sibling=null,st=ws.current,Es(ws,ut?st&1|2:st&1),tt):(Hs(tt),null);case 22:case 23:return nh(),ut=tt.memoizedState!==null,Qe!==null&&Qe.memoizedState!==null!==ut&&(tt.flags|=8192),ut&&tt.mode&1?so&1073741824&&(Hs(tt),tt.subtreeFlags&6&&(tt.flags|=8192)):Hs(tt),null;case 24:return null;case 25:return null}throw Error(ee(156,tt.tag))}function wg(Qe,tt){switch(fu(tt),tt.tag){case 1:return qs(tt.type)&&Wl(),Qe=tt.flags,Qe&65536?(tt.flags=Qe&-65537|128,tt):null;case 3:return ka(),Ss(Ks),Ss(Us),Au(),Qe=tt.flags,Qe&65536&&!(Qe&128)?(tt.flags=Qe&-65537|128,tt):null;case 5:return Cu(tt),null;case 13:if(Ss(ws),Qe=tt.memoizedState,Qe!==null&&Qe.dehydrated!==null){if(tt.alternate===null)throw Error(ee(340));$a()}return Qe=tt.flags,Qe&65536?(tt.flags=Qe&-65537|128,tt):null;case 19:return Ss(ws),null;case 4:return ka(),null;case 10:return Eu(tt.type._context),null;case 22:case 23:return nh(),null;case 24:return null;default:return null}}var fc=!1,Vs=!1,Cg=typeof WeakSet=="function"?WeakSet:Set,zi=null;function Fa(Qe,tt){var st=Qe.ref;if(st!==null)if(typeof st=="function")try{st(null)}catch(ut){Rs(Qe,tt,ut)}else st.current=null}function bf(Qe,tt,st){try{st()}catch(ut){Rs(Qe,tt,ut)}}var Sf=!1;function Rg(Qe,tt){if(iu=$l,Qe=qh(),Xc(Qe)){if("selectionStart"in Qe)var st={start:Qe.selectionStart,end:Qe.selectionEnd};else e:{st=(st=Qe.ownerDocument)&&st.defaultView||window;var ut=st.getSelection&&st.getSelection();if(ut&&ut.rangeCount!==0){st=ut.anchorNode;var pt=ut.anchorOffset,_r=ut.focusNode;ut=ut.focusOffset;try{st.nodeType,_r.nodeType}catch{st=null;break e}var ti=0,fi=-1,vi=-1,_i=0,Li=0,Oi=Qe,Pi=null;t:for(;;){for(var Hi;Oi!==st||pt!==0&&Oi.nodeType!==3||(fi=ti+pt),Oi!==_r||ut!==0&&Oi.nodeType!==3||(vi=ti+ut),Oi.nodeType===3&&(ti+=Oi.nodeValue.length),(Hi=Oi.firstChild)!==null;)Pi=Oi,Oi=Hi;for(;;){if(Oi===Qe)break t;if(Pi===st&&++_i===pt&&(fi=ti),Pi===_r&&++Li===ut&&(vi=ti),(Hi=Oi.nextSibling)!==null)break;Oi=Pi,Pi=Oi.parentNode}Oi=Hi}st=fi===-1||vi===-1?null:{start:fi,end:vi}}else st=null}st=st||{start:0,end:0}}else st=null;for(su={focusedElem:Qe,selectionRange:st},$l=!1,zi=tt;zi!==null;)if(tt=zi,Qe=tt.child,(tt.subtreeFlags&1028)!==0&&Qe!==null)Qe.return=tt,zi=Qe;else for(;zi!==null;){tt=zi;try{var ji=tt.alternate;if(tt.flags&1024)switch(tt.tag){case 0:case 11:case 15:break;case 1:if(ji!==null){var Wi=ji.memoizedProps,Is=ji.memoizedState,bi=tt.stateNode,Ti=bi.getSnapshotBeforeUpdate(tt.elementType===tt.type?Wi:To(tt.type,Wi),Is);bi.__reactInternalSnapshotBeforeUpdate=Ti}break;case 3:var xi=tt.stateNode.containerInfo;xi.nodeType===1?xi.textContent="":xi.nodeType===9&&xi.documentElement&&xi.removeChild(xi.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ee(163))}}catch(Fi){Rs(tt,tt.return,Fi)}if(Qe=tt.sibling,Qe!==null){Qe.return=tt.return,zi=Qe;break}zi=tt.return}return ji=Sf,Sf=!1,ji}function vl(Qe,tt,st){var ut=tt.updateQueue;if(ut=ut!==null?ut.lastEffect:null,ut!==null){var pt=ut=ut.next;do{if((pt.tag&Qe)===Qe){var _r=pt.destroy;pt.destroy=void 0,_r!==void 0&&bf(tt,st,_r)}pt=pt.next}while(pt!==ut)}}function pc(Qe,tt){if(tt=tt.updateQueue,tt=tt!==null?tt.lastEffect:null,tt!==null){var st=tt=tt.next;do{if((st.tag&Qe)===Qe){var ut=st.create;st.destroy=ut()}st=st.next}while(st!==tt)}}function Wu(Qe){var tt=Qe.ref;if(tt!==null){var st=Qe.stateNode;switch(Qe.tag){case 5:Qe=st;break;default:Qe=st}typeof tt=="function"?tt(Qe):tt.current=Qe}}function xf(Qe){var tt=Qe.alternate;tt!==null&&(Qe.alternate=null,xf(tt)),Qe.child=null,Qe.deletions=null,Qe.sibling=null,Qe.tag===5&&(tt=Qe.stateNode,tt!==null&&(delete tt[wo],delete tt[ol],delete tt[cu],delete tt[cg],delete tt[ug])),Qe.stateNode=null,Qe.return=null,Qe.dependencies=null,Qe.memoizedProps=null,Qe.memoizedState=null,Qe.pendingProps=null,Qe.stateNode=null,Qe.updateQueue=null}function _f(Qe){return Qe.tag===5||Qe.tag===3||Qe.tag===4}function wf(Qe){e:for(;;){for(;Qe.sibling===null;){if(Qe.return===null||_f(Qe.return))return null;Qe=Qe.return}for(Qe.sibling.return=Qe.return,Qe=Qe.sibling;Qe.tag!==5&&Qe.tag!==6&&Qe.tag!==18;){if(Qe.flags&2||Qe.child===null||Qe.tag===4)continue e;Qe.child.return=Qe,Qe=Qe.child}if(!(Qe.flags&2))return Qe.stateNode}}function Yu(Qe,tt,st){var ut=Qe.tag;if(ut===5||ut===6)Qe=Qe.stateNode,tt?st.nodeType===8?st.parentNode.insertBefore(Qe,tt):st.insertBefore(Qe,tt):(st.nodeType===8?(tt=st.parentNode,tt.insertBefore(Qe,st)):(tt=st,tt.appendChild(Qe)),st=st._reactRootContainer,st!=null||tt.onclick!==null||(tt.onclick=zl));else if(ut!==4&&(Qe=Qe.child,Qe!==null))for(Yu(Qe,tt,st),Qe=Qe.sibling;Qe!==null;)Yu(Qe,tt,st),Qe=Qe.sibling}function Ku(Qe,tt,st){var ut=Qe.tag;if(ut===5||ut===6)Qe=Qe.stateNode,tt?st.insertBefore(Qe,tt):st.appendChild(Qe);else if(ut!==4&&(Qe=Qe.child,Qe!==null))for(Ku(Qe,tt,st),Qe=Qe.sibling;Qe!==null;)Ku(Qe,tt,st),Qe=Qe.sibling}var Fs=null,bo=!1;function Xo(Qe,tt,st){for(st=st.child;st!==null;)Cf(Qe,tt,st),st=st.sibling}function Cf(Qe,tt,st){if(_o&&typeof _o.onCommitFiberUnmount=="function")try{_o.onCommitFiberUnmount(Cl,st)}catch{}switch(st.tag){case 5:Vs||Fa(st,tt);case 6:var ut=Fs,pt=bo;Fs=null,Xo(Qe,tt,st),Fs=ut,bo=pt,Fs!==null&&(bo?(Qe=Fs,st=st.stateNode,Qe.nodeType===8?Qe.parentNode.removeChild(st):Qe.removeChild(st)):Fs.removeChild(st.stateNode));break;case 18:Fs!==null&&(bo?(Qe=Fs,st=st.stateNode,Qe.nodeType===8?lu(Qe.parentNode,st):Qe.nodeType===1&&lu(Qe,st),qa(Qe)):lu(Fs,st.stateNode));break;case 4:ut=Fs,pt=bo,Fs=st.stateNode.containerInfo,bo=!0,Xo(Qe,tt,st),Fs=ut,bo=pt;break;case 0:case 11:case 14:case 15:if(!Vs&&(ut=st.updateQueue,ut!==null&&(ut=ut.lastEffect,ut!==null))){pt=ut=ut.next;do{var _r=pt,ti=_r.destroy;_r=_r.tag,ti!==void 0&&(_r&2||_r&4)&&bf(st,tt,ti),pt=pt.next}while(pt!==ut)}Xo(Qe,tt,st);break;case 1:if(!Vs&&(Fa(st,tt),ut=st.stateNode,typeof ut.componentWillUnmount=="function"))try{ut.props=st.memoizedProps,ut.state=st.memoizedState,ut.componentWillUnmount()}catch(fi){Rs(st,tt,fi)}Xo(Qe,tt,st);break;case 21:Xo(Qe,tt,st);break;case 22:st.mode&1?(Vs=(ut=Vs)||st.memoizedState!==null,Xo(Qe,tt,st),Vs=ut):Xo(Qe,tt,st);break;default:Xo(Qe,tt,st)}}function Rf(Qe){var tt=Qe.updateQueue;if(tt!==null){Qe.updateQueue=null;var st=Qe.stateNode;st===null&&(st=Qe.stateNode=new Cg),tt.forEach(function(ut){var pt=kg.bind(null,Qe,ut);st.has(ut)||(st.add(ut),ut.then(pt,pt))})}}function So(Qe,tt){var st=tt.deletions;if(st!==null)for(var ut=0;utpt&&(pt=ti),ut&=~_r}if(ut=pt,ut=As()-ut,ut=(120>ut?120:480>ut?480:1080>ut?1080:1920>ut?1920:3e3>ut?3e3:4320>ut?4320:1960*Ig(ut/1960))-ut,10Qe?16:Qe,Jo===null)var ut=!1;else{if(Qe=Jo,Jo=null,Ec=0,ps&6)throw Error(ee(331));var pt=ps;for(ps|=4,zi=Qe.current;zi!==null;){var _r=zi,ti=_r.child;if(zi.flags&16){var fi=_r.deletions;if(fi!==null){for(var vi=0;viAs()-Qu?ma(Qe,0):Xu|=st),Js(Qe,tt)}function Uf(Qe,tt){tt===0&&(Qe.mode&1?(tt=Al,Al<<=1,!(Al&130023424)&&(Al=4194304)):tt=1);var st=Ws();Qe=Do(Qe,tt),Qe!==null&&(za(Qe,tt,st),Js(Qe,st))}function Mg(Qe){var tt=Qe.memoizedState,st=0;tt!==null&&(st=tt.retryLane),Uf(Qe,st)}function kg(Qe,tt){var st=0;switch(Qe.tag){case 13:var ut=Qe.stateNode,pt=Qe.memoizedState;pt!==null&&(st=pt.retryLane);break;case 19:ut=Qe.stateNode;break;default:throw Error(ee(314))}ut!==null&&ut.delete(tt),Uf(Qe,st)}var Gf;Gf=function(Qe,tt,st){if(Qe!==null)if(Qe.memoizedProps!==tt.pendingProps||Ks.current)Xs=!0;else{if(!(Qe.lanes&st)&&!(tt.flags&128))return Xs=!1,xg(Qe,tt,st);Xs=!!(Qe.flags&131072)}else Xs=!1,xs&&tt.flags&1048576&&yd(tt,Xl,tt.index);switch(tt.lanes=0,tt.tag){case 2:var ut=tt.type;dc(Qe,tt),Qe=tt.pendingProps;var pt=Ia(tt,Us.current);Oa(tt,st),pt=Lu(null,tt,ut,Qe,pt,st);var _r=$u();return tt.flags|=1,typeof pt=="object"&&pt!==null&&typeof pt.render=="function"&&pt.$$typeof===void 0?(tt.tag=1,tt.memoizedState=null,tt.updateQueue=null,qs(ut)?(_r=!0,Yl(tt)):_r=!1,tt.memoizedState=pt.state!==null&&pt.state!==void 0?pt.state:null,Su(tt),pt.updater=nc,tt.stateNode=pt,pt._reactInternals=tt,_u(tt,ut,Qe,st),tt=Uu(null,tt,ut,!0,_r,st)):(tt.tag=0,xs&&_r&&du(tt),js(null,tt,pt,st),tt=tt.child),tt;case 16:ut=tt.elementType;e:{switch(dc(Qe,tt),Qe=tt.pendingProps,pt=ut._init,ut=pt(ut._payload),tt.type=ut,pt=tt.tag=Fg(ut),Qe=To(ut,Qe),pt){case 0:tt=Bu(null,tt,ut,Qe,st);break e;case 1:tt=df(null,tt,ut,Qe,st);break e;case 11:tt=af(null,tt,ut,Qe,st);break e;case 14:tt=lf(null,tt,ut,To(ut.type,Qe),st);break e}throw Error(ee(306,ut,""))}return tt;case 0:return ut=tt.type,pt=tt.pendingProps,pt=tt.elementType===ut?pt:To(ut,pt),Bu(Qe,tt,ut,pt,st);case 1:return ut=tt.type,pt=tt.pendingProps,pt=tt.elementType===ut?pt:To(ut,pt),df(Qe,tt,ut,pt,st);case 3:e:{if(ff(tt),Qe===null)throw Error(ee(387));ut=tt.pendingProps,_r=tt.memoizedState,pt=_r.element,xd(Qe,tt),rc(tt,ut,null,st);var ti=tt.memoizedState;if(ut=ti.element,_r.isDehydrated)if(_r={element:ut,isDehydrated:!1,cache:ti.cache,pendingSuspenseBoundaries:ti.pendingSuspenseBoundaries,transitions:ti.transitions},tt.updateQueue.baseState=_r,tt.memoizedState=_r,tt.flags&256){pt=Na(Error(ee(423)),tt),tt=pf(Qe,tt,ut,st,pt);break e}else if(ut!==pt){pt=Na(Error(ee(424)),tt),tt=pf(Qe,tt,ut,st,pt);break e}else for(io=zo(tt.stateNode.containerInfo.firstChild),no=tt,xs=!0,Eo=null,st=$d(tt,null,ut,st),tt.child=st;st;)st.flags=st.flags&-3|4096,st=st.sibling;else{if($a(),ut===pt){tt=Mo(Qe,tt,st);break e}js(Qe,tt,ut,st)}tt=tt.child}return tt;case 5:return Dd(tt),Qe===null&&gu(tt),ut=tt.type,pt=tt.pendingProps,_r=Qe!==null?Qe.memoizedProps:null,ti=pt.children,ou(ut,pt)?ti=null:_r!==null&&ou(ut,_r)&&(tt.flags|=32),hf(Qe,tt),js(Qe,tt,ti,st),tt.child;case 6:return Qe===null&&gu(tt),null;case 13:return gf(Qe,tt,st);case 4:return wu(tt,tt.stateNode.containerInfo),ut=tt.pendingProps,Qe===null?tt.child=Ma(tt,null,ut,st):js(Qe,tt,ut,st),tt.child;case 11:return ut=tt.type,pt=tt.pendingProps,pt=tt.elementType===ut?pt:To(ut,pt),af(Qe,tt,ut,pt,st);case 7:return js(Qe,tt,tt.pendingProps,st),tt.child;case 8:return js(Qe,tt,tt.pendingProps.children,st),tt.child;case 12:return js(Qe,tt,tt.pendingProps.children,st),tt.child;case 10:e:{if(ut=tt.type._context,pt=tt.pendingProps,_r=tt.memoizedProps,ti=pt.value,Es(Jl,ut._currentValue),ut._currentValue=ti,_r!==null)if(vo(_r.value,ti)){if(_r.children===pt.children&&!Ks.current){tt=Mo(Qe,tt,st);break e}}else for(_r=tt.child,_r!==null&&(_r.return=tt);_r!==null;){var fi=_r.dependencies;if(fi!==null){ti=_r.child;for(var vi=fi.firstContext;vi!==null;){if(vi.context===ut){if(_r.tag===1){vi=Oo(-1,st&-st),vi.tag=2;var _i=_r.updateQueue;if(_i!==null){_i=_i.shared;var Li=_i.pending;Li===null?vi.next=vi:(vi.next=Li.next,Li.next=vi),_i.pending=vi}}_r.lanes|=st,vi=_r.alternate,vi!==null&&(vi.lanes|=st),Tu(_r.return,st,tt),fi.lanes|=st;break}vi=vi.next}}else if(_r.tag===10)ti=_r.type===tt.type?null:_r.child;else if(_r.tag===18){if(ti=_r.return,ti===null)throw Error(ee(341));ti.lanes|=st,fi=ti.alternate,fi!==null&&(fi.lanes|=st),Tu(ti,st,tt),ti=_r.sibling}else ti=_r.child;if(ti!==null)ti.return=_r;else for(ti=_r;ti!==null;){if(ti===tt){ti=null;break}if(_r=ti.sibling,_r!==null){_r.return=ti.return,ti=_r;break}ti=ti.return}_r=ti}js(Qe,tt,pt.children,st),tt=tt.child}return tt;case 9:return pt=tt.type,ut=tt.pendingProps.children,Oa(tt,st),pt=uo(pt),ut=ut(pt),tt.flags|=1,js(Qe,tt,ut,st),tt.child;case 14:return ut=tt.type,pt=To(ut,tt.pendingProps),pt=To(ut.type,pt),lf(Qe,tt,ut,pt,st);case 15:return cf(Qe,tt,tt.type,tt.pendingProps,st);case 17:return ut=tt.type,pt=tt.pendingProps,pt=tt.elementType===ut?pt:To(ut,pt),dc(Qe,tt),tt.tag=1,qs(ut)?(Qe=!0,Yl(tt)):Qe=!1,Oa(tt,st),Ad(tt,ut,pt),_u(tt,ut,pt,st),Uu(null,tt,ut,!0,Qe,st);case 19:return yf(Qe,tt,st);case 22:return uf(Qe,tt,st)}throw Error(ee(156,tt.tag))};function Hf(Qe,tt){return mh(Qe,tt)}function Ng(Qe,tt,st,ut){this.tag=Qe,this.key=st,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=tt,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=ut,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function po(Qe,tt,st,ut){return new Ng(Qe,tt,st,ut)}function sh(Qe){return Qe=Qe.prototype,!(!Qe||!Qe.isReactComponent)}function Fg(Qe){if(typeof Qe=="function")return sh(Qe)?1:0;if(Qe!=null){if(Qe=Qe.$$typeof,Qe===li)return 11;if(Qe===ii)return 14}return 2}function ta(Qe,tt){var st=Qe.alternate;return st===null?(st=po(Qe.tag,tt,Qe.key,Qe.mode),st.elementType=Qe.elementType,st.type=Qe.type,st.stateNode=Qe.stateNode,st.alternate=Qe,Qe.alternate=st):(st.pendingProps=tt,st.type=Qe.type,st.flags=0,st.subtreeFlags=0,st.deletions=null),st.flags=Qe.flags&14680064,st.childLanes=Qe.childLanes,st.lanes=Qe.lanes,st.child=Qe.child,st.memoizedProps=Qe.memoizedProps,st.memoizedState=Qe.memoizedState,st.updateQueue=Qe.updateQueue,tt=Qe.dependencies,st.dependencies=tt===null?null:{lanes:tt.lanes,firstContext:tt.firstContext},st.sibling=Qe.sibling,st.index=Qe.index,st.ref=Qe.ref,st}function _c(Qe,tt,st,ut,pt,_r){var ti=2;if(ut=Qe,typeof Qe=="function")sh(Qe)&&(ti=1);else if(typeof Qe=="string")ti=5;else e:switch(Qe){case Xr:return va(st.children,pt,_r,tt);case Jr:ti=8,pt|=8;break;case ai:return Qe=po(12,st,tt,pt|2),Qe.elementType=ai,Qe.lanes=_r,Qe;case ui:return Qe=po(13,st,tt,pt),Qe.elementType=ui,Qe.lanes=_r,Qe;case mi:return Qe=po(19,st,tt,pt),Qe.elementType=mi,Qe.lanes=_r,Qe;case ri:return wc(st,pt,_r,tt);default:if(typeof Qe=="object"&&Qe!==null)switch(Qe.$$typeof){case oi:ti=10;break e;case ni:ti=9;break e;case li:ti=11;break e;case ii:ti=14;break e;case hi:ti=16,ut=null;break e}throw Error(ee(130,Qe==null?Qe:typeof Qe,""))}return tt=po(ti,st,tt,pt),tt.elementType=Qe,tt.type=ut,tt.lanes=_r,tt}function va(Qe,tt,st,ut){return Qe=po(7,Qe,ut,tt),Qe.lanes=st,Qe}function wc(Qe,tt,st,ut){return Qe=po(22,Qe,ut,tt),Qe.elementType=ri,Qe.lanes=st,Qe.stateNode={isHidden:!1},Qe}function oh(Qe,tt,st){return Qe=po(6,Qe,null,tt),Qe.lanes=st,Qe}function ah(Qe,tt,st){return tt=po(4,Qe.children!==null?Qe.children:[],Qe.key,tt),tt.lanes=st,tt.stateNode={containerInfo:Qe.containerInfo,pendingChildren:null,implementation:Qe.implementation},tt}function Bg(Qe,tt,st,ut,pt){this.tag=tt,this.containerInfo=Qe,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Mc(0),this.expirationTimes=Mc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Mc(0),this.identifierPrefix=ut,this.onRecoverableError=pt,this.mutableSourceEagerHydrationData=null}function lh(Qe,tt,st,ut,pt,_r,ti,fi,vi){return Qe=new Bg(Qe,tt,st,fi,vi),tt===1?(tt=1,_r===!0&&(tt|=8)):tt=0,_r=po(3,null,null,tt),Qe.current=_r,_r.stateNode=Qe,_r.memoizedState={element:ut,isDehydrated:st,cache:null,transitions:null,pendingSuspenseBoundaries:null},Su(_r),Qe}function Ug(Qe,tt,st){var ut=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(ie){console.error(ie)}}checkDCE(),reactDom.exports=requireReactDom_production_min();var reactDomExports=reactDom.exports;const $7SXl2$reactdom=getDefaultExportFromCjs$1(reactDomExports);var createRoot,m$2=reactDomExports;createRoot=m$2.createRoot,m$2.hydrateRoot;var __defProp=Object.defineProperty,__defNormalProp=(ie,Z,ee)=>Z in ie?__defProp(ie,Z,{enumerable:!0,configurable:!0,writable:!0,value:ee}):ie[Z]=ee,__publicField=(ie,Z,ee)=>(__defNormalProp(ie,typeof Z!="symbol"?Z+"":Z,ee),ee);const EMPTY=[];Object.freeze(EMPTY);const emptyAnnotationPage={id:"https://iiif-parser/annotation-page",type:"AnnotationPage",behavior:EMPTY,motivation:null,label:null,thumbnail:EMPTY,summary:null,requiredStatement:null,metadata:EMPTY,rights:null,provider:EMPTY,items:EMPTY,seeAlso:EMPTY,homepage:EMPTY,logo:EMPTY,rendering:EMPTY,service:EMPTY},emptyCanvas={id:"https://iiif-parser/empty-canvas",type:"Canvas",label:null,behavior:EMPTY,motivation:null,thumbnail:EMPTY,posterCanvas:null,accompanyingCanvas:null,placeholderCanvas:null,summary:null,requiredStatement:null,metadata:EMPTY,rights:null,navDate:null,provider:EMPTY,items:EMPTY,annotations:EMPTY,seeAlso:EMPTY,homepage:EMPTY,logo:EMPTY,partOf:EMPTY,rendering:EMPTY,service:EMPTY,duration:0,height:0,width:0},emptyCollection={id:"https://iiif-parser/empty-collection",type:"Collection",label:null,viewingDirection:"left-to-right",behavior:EMPTY,motivation:null,thumbnail:EMPTY,posterCanvas:null,accompanyingCanvas:null,placeholderCanvas:null,summary:null,requiredStatement:null,metadata:EMPTY,rights:null,navDate:null,provider:EMPTY,items:EMPTY,annotations:EMPTY,seeAlso:EMPTY,homepage:EMPTY,logo:EMPTY,partOf:EMPTY,rendering:EMPTY,service:EMPTY,services:EMPTY},emptyManifest={id:"https://iiif-parser/empty-manifest",type:"Manifest",annotations:EMPTY,behavior:EMPTY,homepage:EMPTY,items:EMPTY,label:null,logo:EMPTY,metadata:EMPTY,motivation:null,navDate:null,provider:EMPTY,partOf:EMPTY,posterCanvas:null,accompanyingCanvas:null,placeholderCanvas:null,rendering:EMPTY,requiredStatement:null,rights:null,seeAlso:EMPTY,service:EMPTY,services:EMPTY,start:null,structures:EMPTY,summary:null,thumbnail:EMPTY,viewingDirection:"left-to-right"},emptyRange={id:"https://iiif-parser/empty-canvas",type:"Range",label:null,behavior:EMPTY,motivation:null,thumbnail:EMPTY,posterCanvas:null,accompanyingCanvas:null,placeholderCanvas:null,summary:null,requiredStatement:null,metadata:EMPTY,rights:null,navDate:null,provider:EMPTY,items:EMPTY,annotations:EMPTY,seeAlso:EMPTY,homepage:EMPTY,logo:EMPTY,partOf:EMPTY,rendering:EMPTY,service:EMPTY,start:null,supplementary:null,viewingDirection:"left-to-right"},emptyAgent={id:"https://iiif-parser/empty-agent",type:"Agent",label:{},logo:EMPTY,seeAlso:EMPTY,homepage:EMPTY};function ensureArray$1(ie){return Array.isArray(ie)?ie:[ie]}const types$1=["Collection","Manifest","Canvas","AnnotationPage","AnnotationCollection","Annotation","ContentResource","Range","Service","Selector","Agent"];function identifyResource$1(ie){if(typeof ie>"u"||ie===null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(ie))throw new Error("Array is not a valid entity");if(typeof ie!="object")throw new Error(`${typeof ie} is not a valid entity`);if(typeof ie.type=="string"){const Z=types$1.indexOf(ie.type);if(Z!==-1)return types$1[Z]}if(ie.profile)return"Service";throw new Error("Resource type is not known")}class Traverse$1{constructor(Z,ee={}){__publicField(this,"traversals"),__publicField(this,"options"),this.traversals={collection:[],manifest:[],canvas:[],annotationCollection:[],annotationPage:[],annotation:[],contentResource:[],choice:[],range:[],service:[],agent:[],...Z},this.options={allowUndefinedReturn:!1,...ee}}static all(Z){return new Traverse$1({collection:[Z],manifest:[Z],canvas:[Z],annotationCollection:[Z],annotationPage:[Z],annotation:[Z],contentResource:[Z],choice:[Z],range:[Z],service:[Z]})}traverseDescriptive(Z){return Z.thumbnail&&(Z.thumbnail=Z.thumbnail.map(ee=>this.traverseType(ee,this.traversals.contentResource))),Z.provider&&(Z.provider=Z.provider.map(ee=>this.traverseAgent(ee))),Z}traverseLinking(Z){return Z.seeAlso&&(Z.seeAlso=Z.seeAlso.map(ee=>this.traverseType(ee,this.traversals.contentResource))),Z.service&&(Z.service=ensureArray$1(Z.service).map(ee=>this.traverseType(ee,this.traversals.service))),Z.services&&(Z.services=Z.services.map(ee=>this.traverseType(ee,this.traversals.service))),Z.logo&&(Z.logo=Z.logo.map(ee=>this.traverseType(ee,this.traversals.contentResource))),Z.homepage&&(Z.homepage=Z.homepage.map(ee=>this.traverseType(ee,this.traversals.contentResource))),Z.partOf&&(Z.partOf=Z.partOf.map(ee=>typeof ee=="string"||!ee.type?this.traverseType(ee,this.traversals.contentResource):ee.type==="Canvas"?this.traverseType(ee,this.traversals.canvas):ee.type==="AnnotationCollection"?this.traverseType(ee,this.traversals.annotationCollection):ee.type==="Collection"?this.traverseType(ee,this.traversals.collection):this.traverseType(ee,this.traversals.contentResource))),Z.start&&(Z.start=Z.start?this.traverseType(Z.start,this.traversals.canvas):null),Z.rendering&&(Z.rendering=Z.rendering.map(ee=>this.traverseType(ee,this.traversals.contentResource))),Z.supplementary&&(Z.supplementary=Z.supplementary.map(ee=>this.traverseType(ee,this.traversals.contentResource))),Z}traverseCollectionItems(Z){return Z.items&&Z.items.map(ee=>ee.type==="Collection"?this.traverseCollection(ee):this.traverseManifest(ee)),Z}traverseCollection(Z){return this.traverseType(this.traverseDescriptive(this.traverseInlineAnnotationPages(this.traverseLinking(this.traversePosterCanvas(this.traverseCollectionItems(Z))))),this.traversals.collection)}traverseManifestItems(Z){return Z.items&&(Z.items=Z.items.map(ee=>this.traverseCanvas(ee))),Z}traverseManifestStructures(Z){return Z.structures&&(Z.structures=Z.structures.map(ee=>this.traverseRange(ee))),Z}traverseManifest(Z){return this.traverseType(this.traverseInlineAnnotationPages(this.traverseManifestStructures(this.traversePosterCanvas(this.traverseDescriptive(this.traverseLinking(this.traverseManifestItems(Z)))))),this.traversals.manifest)}traverseCanvasItems(Z){return Z.items=(Z.items||[]).map(ee=>this.traverseAnnotationPage(ee)),Z}traverseInlineAnnotationPages(Z){return typeof Z=="string"||!Z||Z.annotations&&(Z.annotations=Z.annotations.map(ee=>this.traverseAnnotationPage(ee))),Z}traverseCanvas(Z){return this.traverseType(this.traverseInlineAnnotationPages(this.traversePosterCanvas(this.traverseDescriptive(this.traverseLinking(this.traverseCanvasItems(Z))))),this.traversals.canvas)}traverseAnnotationPageItems(Z){return Z.items&&(Z.items=Z.items.map(ee=>this.traverseAnnotation(ee))),Z}traverseAnnotationPage(Z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseAnnotationPageItems(Z))),this.traversals.annotationPage)}traverseAnnotationBody(Z){return Array.isArray(Z.body)?Z.body=Z.body.map(ee=>this.traverseContentResource(ee)):Z.body&&(Z.body=this.traverseContentResource(Z.body)),Z}traversePosterCanvas(Z){return Z.posterCanvas&&(Z.posterCanvas=this.traverseCanvas(Z.posterCanvas)),Z.placeholderCanvas&&(Z.placeholderCanvas=this.traverseCanvas(Z.placeholderCanvas)),Z.accompanyingCanvas&&(Z.accompanyingCanvas=this.traverseCanvas(Z.accompanyingCanvas)),Z}traverseAnnotation(Z){return this.traverseType(this.traverseLinking(this.traverseAnnotationBody(Z)),this.traversals.annotation)}traverseContentResourceLinking(Z){return typeof Z=="string"||!Z||Z&&Z.service&&(Z.service=ensureArray$1(Z.service||[]).map(ee=>this.traverseType(ee,this.traversals.service))),Z}traverseContentResource(Z){return Z.type==="Choice"&&(Z.items=Z.items.map(ee=>this.traverseContentResource(ee))),this.traverseType(this.traverseInlineAnnotationPages(this.traverseContentResourceLinking(Z)),this.traversals.contentResource)}traverseRangeRanges(Z){return Z.items&&(Z.items=Z.items.map(ee=>typeof ee=="string"?this.traverseCanvas({id:ee,type:"Canvas"}):ee.type==="Manifest"?this.traverseManifest(ee):this.traverseRange(ee))),Z}traverseRange(Z){return this.traverseType(this.traversePosterCanvas(this.traverseDescriptive(this.traverseLinking(this.traverseRangeRanges(Z)))),this.traversals.range)}traverseAgent(Z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(Z)),this.traversals.agent)}traverseType(Z,ee){return ee.reduce((ae,ye)=>{const ve=ye(ae);return typeof ve>"u"&&!this.options.allowUndefinedReturn?ae:ve},Z)}traverseService(Z){return this.traverseType(Z,this.traversals.service)}traverseUnknown(Z){const ee=identifyResource$1(Z);switch(ee){case"Collection":return this.traverseCollection(Z);case"Manifest":return this.traverseManifest(Z);case"Canvas":return this.traverseCanvas(Z);case"AnnotationPage":return this.traverseAnnotationPage(Z);case"Annotation":return this.traverseAnnotation(Z);case"ContentResource":return this.traverseContentResource(Z);case"Range":return this.traverseRange(Z);case"Service":return this.traverseService(Z);case"Agent":return this.traverseAgent(Z);default:throw new Error(`Unknown or unsupported resource type of ${ee}`)}}}const types=["sc:Collection","sc:Manifest","sc:Canvas","sc:AnnotationList","oa:Annotation","sc:Range","sc:Layer","sc:Sequence","oa:Choice","Service","ContentResource"];function identifyResource(ie){if(typeof ie>"u"||ie===null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(ie))throw new Error("Array is not a valid entity");if(typeof ie!="object")throw new Error(`${typeof ie} is not a valid entity`);if(typeof ie["@type"]=="string"){const Z=types.indexOf(ie["@type"]);if(Z!==-1)return types[Z]}if(ie.profile)return"Service";if(ie.format||ie["@type"])return"ContentResource";throw new Error("Resource type is not known")}class Traverse{constructor(Z,ee={}){__publicField(this,"traversals"),__publicField(this,"options"),this.traversals={collection:[],manifest:[],canvas:[],annotationList:[],sequence:[],annotation:[],contentResource:[],choice:[],range:[],service:[],layer:[],...Z},this.options={convertPropsToArray:!0,mergeMemberProperties:!0,allowUndefinedReturn:!1,...ee}}static all(Z){return new Traverse({collection:[Z],manifest:[Z],canvas:[Z],annotationList:[Z],sequence:[Z],annotation:[Z],contentResource:[Z],choice:[Z],range:[Z],service:[Z],layer:[Z]})}traverseCollection(Z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCollectionItems(Z))),this.traversals.collection)}traverseCollectionItems(Z){if(this.options.mergeMemberProperties){const ee=[...(Z.manifests||[]).map(ae=>typeof ae=="string"?{"@id":ae,"@type":"sc:Manifest"}:ae),...(Z.collections||[]).map(ae=>typeof ae=="string"?{"@id":ae,"@type":"sc:Collection"}:ae),...Z.members||[]];delete Z.collections,delete Z.manifests,Z.members=ee}return Z.manifests&&(Z.manifests=Z.manifests.map(ee=>this.traverseManifest(typeof ee=="string"?{"@id":ee,"@type":"sc:Manifest"}:ee))),Z.collections&&(Z.collections=Z.collections.map(ee=>this.traverseCollection(typeof ee=="string"?{"@id":ee,"@type":"sc:Collection"}:ee))),Z.members&&(Z.members=Z.members.map(ee=>typeof ee=="string"?ee:this.traverseUnknown(ee))),Z}traverseManifest(Z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseManifestItems(Z))),this.traversals.manifest)}traverseManifestItems(Z){return Z.sequences&&(Z.sequences=Z.sequences.map(ee=>this.traverseSequence(ee))),Z.structures&&(Z.structures=Z.structures.map(ee=>this.traverseRange(ee))),Z}traverseSequence(Z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseSequenceItems(Z))),this.traversals.sequence)}traverseSequenceItems(Z){return Z.canvases&&(Z.canvases=Z.canvases.map(ee=>this.traverseCanvas(ee))),Z}traverseCanvas(Z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCanvasItems(Z))),this.traversals.canvas)}traverseCanvasItems(Z){return Z.images&&(Z.images=Z.images.map(ee=>this.traverseAnnotation(ee))),Z.otherContent&&(Z.otherContent=Z.otherContent.map(ee=>this.traverseAnnotationList(ee))),Z}traverseRange(Z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseRangeItems(Z))),this.traversals.range)}traverseRangeItems(Z){if(this.options.mergeMemberProperties){const ee=[...(Z.ranges||[]).map(ae=>typeof ae=="string"?{"@id":ae,"@type":"sc:Range"}:ae),...(Z.canvases||[]).map(ae=>typeof ae=="string"?{"@id":ae,"@type":"sc:Canvas"}:ae),...Z.members||[]];delete Z.ranges,delete Z.canvases,Z.members=ee.length?ee.map(ae=>this.traverseUnknown(ae)):void 0}return Z}traverseAnnotationList(Z){const ee=typeof Z=="string"?{"@id":Z,"@type":"sc:AnnotationList"}:Z;return this.traverseType(this.traverseDescriptive(this.traverseAnnotationListItems(ee)),this.traversals.annotationList)}traverseAnnotationListItems(Z){return Z.resources&&(Z.resources=Z.resources.map(ee=>this.traverseAnnotation(ee))),Z}traverseAnnotation(Z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseAnnotationItems(Z))),this.traversals.annotation)}traverseAnnotationItems(Z){return Z.resource&&(Array.isArray(Z.resource)?Z.resource=Z.resource.map(ee=>this.traverseContentResource(ee)):Z.resource=this.traverseContentResource(Z.resource)),Z.on,Z}traverseLayer(Z){return this.traverseType(this.traverseLinking(this.traverseLayerItems(Z)),this.traversals.layer)}traverseLayerItems(Z){return Z.otherContent&&(Z.otherContent=Z.otherContent.map(ee=>this.traverseAnnotationList(ee))),Z}traverseChoice(Z){return this.traverseType(this.traverseChoiceItems(Z),this.traversals.choice)}traverseChoiceItems(Z){return Z.default&&Z.default!=="rdf:nil"&&(Z.default=this.traverseContentResource(Z.default)),Z.item&&Z.item!=="rdf:nil"&&(Z.item=Z.item.map(ee=>this.traverseContentResource(ee))),Z}traverseService(Z){return this.traverseType(this.traverseLinking(Z),this.traversals.service)}traverseContentResource(Z){return Z["@type"]==="oa:Choice"?this.traverseChoice(Z):this.traverseType(this.traverseDescriptive(this.traverseLinking(Z)),this.traversals.contentResource)}traverseUnknown(Z){if(!Z["@type"]||typeof Z=="string")return Z;switch(identifyResource(Z)){case"sc:Collection":return this.traverseCollection(Z);case"sc:Manifest":return this.traverseManifest(Z);case"sc:Canvas":return this.traverseCanvas(Z);case"sc:Sequence":return this.traverseSequence(Z);case"sc:Range":return this.traverseRange(Z);case"oa:Annotation":return this.traverseAnnotation(Z);case"sc:AnnotationList":return this.traverseAnnotationList(Z);case"sc:Layer":return this.traverseLayer(Z);case"Service":return this.traverseService(Z);case"oa:Choice":return this.traverseChoice(Z);case"ContentResource":return this.traverseContentResource(Z)}return Z.profile?this.traverseService(Z):Z}traverseImageResource(Z){const ee=Array.isArray(Z),ae=Array.isArray(Z)?Z:[Z],ye=[];for(const ve of ae)typeof ve=="string"?ye.push(this.traverseContentResource({"@id":ve,"@type":"dctypes:Image"})):ye.push(this.traverseContentResource(ve));return!ee&&!this.options.convertPropsToArray?ye[0]:ye}traverseDescriptive(Z){return Z.thumbnail&&(Z.thumbnail=this.traverseImageResource(Z.thumbnail)),Z.logo&&(Z.logo=this.traverseImageResource(Z.logo)),Z}traverseOneOrMoreServices(Z){const ee=Array.isArray(Z),ae=Array.isArray(Z)?Z:[Z],ye=[];for(const ve of ae)ye.push(this.traverseService(ve));return!ee&&!this.options.convertPropsToArray?ye[0]:ye}traverseLinking(Z){return Z.related&&(Z.related=this.traverseOneOrManyType(Z.related,this.traversals.contentResource)),Z.rendering&&(Z.rendering=this.traverseOneOrManyType(Z.rendering,this.traversals.contentResource)),Z.service&&(Z.service=this.traverseOneOrMoreServices(Z.service)),Z.seeAlso&&(Z.seeAlso=this.traverseOneOrManyType(Z.seeAlso,this.traversals.contentResource)),Z.within&&(typeof Z.within=="string"||(Z.within=this.traverseOneOrManyType(Z.within,this.traversals.contentResource))),Z.startCanvas&&(typeof Z.startCanvas=="string"?Z.startCanvas=this.traverseType({"@id":Z.startCanvas,"@type":"sc:Canvas"},this.traversals.canvas):Z.startCanvas&&this.traverseType(Z.startCanvas,this.traversals.canvas)),Z.contentLayer&&(typeof Z.contentLayer=="string"?Z.contentLayer=this.traverseLayer({"@id":Z.contentLayer,"@type":"sc:Layer"}):Z.contentLayer=this.traverseLayer(Z.contentLayer)),Z}traverseOneOrManyType(Z,ee){if(!Array.isArray(Z))if(this.options.convertPropsToArray)Z=[Z];else return this.traverseType(Z,ee);return Z.map(ae=>this.traverseType(ae,ee))}traverseType(Z,ee){return ee.reduce((ae,ye)=>{const ve=ye(ae);return typeof ve>"u"&&!this.options.allowUndefinedReturn?ae:ve},Z)}}const STANFORD_IIIF_IMAGE_COMPLIANCE_0="http://library.stanford.edu/iiif/image-api/compliance.html#level0",STANFORD_IIIF_IMAGE_COMPLIANCE_1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",STANFORD_IIIF_IMAGE_COMPLIANCE_2="http://library.stanford.edu/iiif/image-api/compliance.html#level2",STANFORD_IIIF_IMAGE_CONFORMANCE_0="http://library.stanford.edu/iiif/image-api/conformance.html#level0",STANFORD_IIIF_IMAGE_CONFORMANCE_1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",STANFORD_IIIF_IMAGE_CONFORMANCE_2="http://library.stanford.edu/iiif/image-api/conformance.html#level2",STANFORD_IIIF_1_IMAGE_COMPLIANCE_0="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",STANFORD_IIIF_1_IMAGE_COMPLIANCE_1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",STANFORD_IIIF_1_IMAGE_COMPLIANCE_2="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",STANFORD_IIIF_1_IMAGE_CONFORMANCE_0="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",STANFORD_IIIF_1_IMAGE_CONFORMANCE_1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",STANFORD_IIIF_1_IMAGE_CONFORMANCE_2="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",IIIF_1_IMAGE_LEVEL_0="http://iiif.io/api/image/1/level0.json",IIIF_1_IMAGE_LEVEL_0_PROFILE="http://iiif.io/api/image/1/profiles/level0.json",IIIF_1_IMAGE_LEVEL_1="http://iiif.io/api/image/1/level1.json",IIIF_1_IMAGE_LEVEL_1_PROFILE="http://iiif.io/api/image/1/profiles/level1.json",IIIF_1_IMAGE_LEVEL_2="http://iiif.io/api/image/1/level2.json",IIIF_1_IMAGE_LEVEL_2_PROFILE="http://iiif.io/api/image/1/profiles/level2.json",IIIF_2_IMAGE_LEVEL_0="http://iiif.io/api/image/2/level0.json",IIIF_2_IMAGE_LEVEL_0_PROFILE="http://iiif.io/api/image/2/profiles/level0.json",IIIF_2_IMAGE_LEVEL_1="http://iiif.io/api/image/2/level1.json",IIIF_2_IMAGE_LEVEL_1_PROFILE="http://iiif.io/api/image/2/profiles/level1.json",IIIF_2_IMAGE_LEVEL_2="http://iiif.io/api/image/2/level2.json",IIIF_2_IMAGE_LEVEL_2_PROFILE="http://iiif.io/api/image/2/profiles/level2.json",IIIF_3_IMAGE_LEVEL_0="level0",IIIF_3_IMAGE_LEVEL_1="level1",IIIF_3_IMAGE_LEVEL_2="level2",IIIF_2_IMAGE_LEVEL_0_NO_JSON="http://iiif.io/api/image/2/level0",IIIF_2_IMAGE_LEVEL_1_NO_JSON="http://iiif.io/api/image/2/level1",IIIF_2_IMAGE_LEVEL_2_NO_JSON="http://iiif.io/api/image/2/level2",level1Support=[IIIF_2_IMAGE_LEVEL_1_NO_JSON,IIIF_2_IMAGE_LEVEL_2_NO_JSON,STANFORD_IIIF_IMAGE_COMPLIANCE_1,STANFORD_IIIF_IMAGE_COMPLIANCE_2,STANFORD_IIIF_IMAGE_CONFORMANCE_1,STANFORD_IIIF_IMAGE_CONFORMANCE_2,STANFORD_IIIF_1_IMAGE_COMPLIANCE_1,STANFORD_IIIF_1_IMAGE_COMPLIANCE_2,STANFORD_IIIF_1_IMAGE_CONFORMANCE_1,STANFORD_IIIF_1_IMAGE_CONFORMANCE_2,IIIF_1_IMAGE_LEVEL_1,IIIF_1_IMAGE_LEVEL_1_PROFILE,IIIF_1_IMAGE_LEVEL_2,IIIF_1_IMAGE_LEVEL_2_PROFILE,IIIF_2_IMAGE_LEVEL_1,IIIF_2_IMAGE_LEVEL_1_PROFILE,IIIF_2_IMAGE_LEVEL_2,IIIF_2_IMAGE_LEVEL_2_PROFILE,IIIF_3_IMAGE_LEVEL_1,IIIF_3_IMAGE_LEVEL_2],imageServiceProfiles=[IIIF_2_IMAGE_LEVEL_0_NO_JSON,IIIF_2_IMAGE_LEVEL_1_NO_JSON,IIIF_2_IMAGE_LEVEL_2_NO_JSON,STANFORD_IIIF_IMAGE_COMPLIANCE_0,STANFORD_IIIF_IMAGE_COMPLIANCE_1,STANFORD_IIIF_IMAGE_COMPLIANCE_2,STANFORD_IIIF_IMAGE_CONFORMANCE_0,STANFORD_IIIF_IMAGE_CONFORMANCE_1,STANFORD_IIIF_IMAGE_CONFORMANCE_2,STANFORD_IIIF_1_IMAGE_COMPLIANCE_0,STANFORD_IIIF_1_IMAGE_COMPLIANCE_1,STANFORD_IIIF_1_IMAGE_COMPLIANCE_2,STANFORD_IIIF_1_IMAGE_CONFORMANCE_0,STANFORD_IIIF_1_IMAGE_CONFORMANCE_1,STANFORD_IIIF_1_IMAGE_CONFORMANCE_2,IIIF_1_IMAGE_LEVEL_0,IIIF_1_IMAGE_LEVEL_0_PROFILE,IIIF_1_IMAGE_LEVEL_1,IIIF_1_IMAGE_LEVEL_1_PROFILE,IIIF_1_IMAGE_LEVEL_2,IIIF_1_IMAGE_LEVEL_2_PROFILE,IIIF_2_IMAGE_LEVEL_0,IIIF_2_IMAGE_LEVEL_0_PROFILE,IIIF_2_IMAGE_LEVEL_1,IIIF_2_IMAGE_LEVEL_1_PROFILE,IIIF_2_IMAGE_LEVEL_2,IIIF_2_IMAGE_LEVEL_2_PROFILE,IIIF_3_IMAGE_LEVEL_0,IIIF_3_IMAGE_LEVEL_1,IIIF_3_IMAGE_LEVEL_2],configuration={attributionLabel:"Attribution",lang:"none",providerId:"http://example.org/provider",providerName:"Unknown"};function convertLanguageMapping(ie,Z="none"){if(!ie)return{};const ee=Array.isArray(ie)?ie:[ie],ae={};for(const ye of ee){if(typeof ye=="string"){ae[Z]=ae[Z]?ae[Z]:[],ae[Z].push(ye||"");continue}if(!ye["@language"]){ae[Z]=ae[Z]?ae[Z]:[],ae[Z].push(ye["@value"]||"");continue}const ve=ye["@language"];ae[ve]=ae[ve]?ae[ve]:[],ae[ve].push(ye["@value"]||"")}return ae}function getProfile(ie){if(Array.isArray(ie))return getProfile(ie.find(Z=>typeof Z=="string"));if(imageServiceProfiles.indexOf(ie)!==-1)return"level2";if(level1Support.indexOf(ie)!==-1)return"level1";if(typeof ie=="string")return ie}function getTypeFromContext(ie){const Z=Array.isArray(ie)?ie:[ie];for(const ee of Z)switch(ee){case"http://iiif.io/api/image/2/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2":return"ImageService2";case"http://iiif.io/api/image/1/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/context.json":return"ImageService1";case"http://iiif.io/api/annex/openannotation/context.json":return"ImageApiSelector"}}function getTypeFromProfile(ie){switch(ie){case"http://iiif.io/api/image/2/level0.json":case"http://iiif.io/api/image/2/level1.json":case"http://iiif.io/api/image/2/level2.json":return"ImageService2";case"http://iiif.io/api/auth/1/kiosk":case"http://iiif.io/api/auth/1/login":case"http://iiif.io/api/auth/1/clickthrough":case"http://iiif.io/api/auth/1/external":case"http://iiif.io/api/auth/0/kiosk":case"http://iiif.io/api/auth/0/login":case"http://iiif.io/api/auth/0/clickthrough":case"http://iiif.io/api/auth/0/external":return"AuthCookieService1";case"http://iiif.io/api/auth/1/token":case"http://iiif.io/api/auth/0/token":return"AuthTokenService1";case"http://iiif.io/api/auth/1/logout":case"http://iiif.io/api/auth/0/logout":return"AuthLogoutService1";case"http://iiif.io/api/search/1/search":case"http://iiif.io/api/search/0/search":return"SearchService1";case"http://iiif.io/api/search/1/autocomplete":case"http://iiif.io/api/search/0/autocomplete":return"AutoCompleteService1"}}function removePrefix(ie){for(const Z of["sc","oa","dcterms","dctypes","iiif"])if(ie.startsWith(`${Z}:`))return ie.slice(Z.length+1);return ie}const knownTypes=["Collection","Manifest","Annotation","AnnotationPage","Range","Service"];function getNewType(ie){const Z=ie["@id"]||ie.id;let ee=ie["@type"]||ie.type;const ae=ie.profile||void 0,ye=ie["@context"]||void 0;if(ae){const ve=getTypeFromProfile(ae);if(ve)return ve}if(ye){const ve=getTypeFromContext(ye);if(ve)return ve}if(ee){if(Array.isArray(ee)){if(ee.indexOf("oa:CssStylesheet")!==-1)return"CssStylesheet";if(ee.indexOf("cnt:ContentAsText")!==-1)return"TextualBody";ee=ee[0]}for(const ve of["sc","oa","dcterms","dctypes","iiif"])if(ee.startsWith(`${ve}:`)){ee=ee.slice(ve.length+1);break}switch(ee){case"Layer":return"AnnotationCollection";case"AnnotationList":return"AnnotationPage";case"cnt:ContentAsText":return"TextualBody"}}if(ee&&knownTypes.indexOf(ee)!==-1)return ee;if(ie.format){if(ie.format.startsWith("image/"))return"Image";if(ie.format.startsWith("text/")||ie.format==="application/pdf")return"Text";if(ie.format.startsWith("application/"))return"Dataset"}return Z&&(Z.endsWith(".jpg")||Z.endsWith(".png")||Z.endsWith(".jpeg"))?"Image":ee||"unknown"}const licenseRegex=/http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;function extractLicense(ie){const Z=ie.match(licenseRegex);return Z?Z[0]:ie}function fixLicense(ie,Z="Rights/License",ee="none"){let ae=null;const ye=[],ve=Array.isArray(ie)?ie:[ie];for(const be of ve){const Ye=be?extractLicense(be):void 0;if(Ye&&(Ye.indexOf("creativecommons.org")!==-1||Ye.indexOf("rightsstatements.org")!==-1)){Ye.startsWith("https://")?ae=`http://${Ye.slice(8)}`:ae=Ye;continue}Ye&&ye.push({label:{[ee]:[Z]},value:{[ee]:[Ye]}})}return[ae,ye]}const removeContexts=["http://iiif.io/api/presentation/2/context.json","http://iiif.io/api/image/2/context.json","http://iiif.io/api/image/1/context.json","http://library.stanford.edu/iiif/image-api/1.1/context.json","http://iiif.io/api/search/1/context.json","http://iiif.io/api/search/0/context.json","http://iiif.io/api/auth/1/context.json","http://iiif.io/api/auth/0/context.json","http://iiif.io/api/annex/openannotation/context.json"];function fixContext(ie){if(ie){const Z=Array.isArray(ie)?ie:[ie],ee=[];for(const ae of Z)ae==="http://iiif.io/api/presentation/2/context.json"&&ee.push("http://iiif.io/api/presentation/3/context.json"),removeContexts.indexOf(ae)===-1&&ee.push(ae);if(Z.length)return ee.length===1?ee[0]:ee}}function convertMetadata(ie){return ie?ie.map(Z=>({label:convertLanguageMapping(Z.label),value:convertLanguageMapping(Z.value)})):[]}function removeUndefinedProperties(ie){for(const Z in ie)(typeof ie[Z]>"u"||ie[Z]===null)&&delete ie[Z];return ie}let mintedIdCounter=0;function mintNewIdFromResource(ie,Z){const ee=encodeURI(ie.id||ie["@id"]||"").trim();return ee&&Z?`${ee}/${Z}`:ee||(mintedIdCounter++,`http://example.org/${ie["@type"]}${Z?`/${Z}`:""}/${mintedIdCounter}`)}function technicalProperties$2(ie){const Z=[...ie.behavior||[]];ie.viewingHint&&Z.push(ie.viewingHint);let ee;return Array.isArray(ie.motivation)?ee=ie.motivation.map(removePrefix):ie.motivation&&(ee=removePrefix(ie.motivation)),{"@context":ie["@context"]?fixContext(ie["@context"]):void 0,id:(ie["@id"]||mintNewIdFromResource(ie)).trim(),type:getNewType(ie),behavior:Z.length?Z:void 0,height:ie.height?ie.height:void 0,width:ie.width?ie.width:void 0,motivation:ee,viewingDirection:ie.viewingDirection,profile:ie.profile,format:ie.format?ie.format:void 0,duration:void 0,timeMode:void 0}}function descriptiveProperties$2(ie){const[Z,ee]=fixLicense(ie.license),ae=[...ie.metadata?convertMetadata(ie.metadata):[],...ee];return{rights:Z,metadata:ae.length?ae:void 0,label:ie.label?convertLanguageMapping(ie.label):void 0,requiredStatement:ie.attribution?{label:convertLanguageMapping(configuration.attributionLabel),value:convertLanguageMapping(ie.attribution)}:void 0,navDate:ie.navDate,summary:ie.description?convertLanguageMapping(ie.description):void 0,thumbnail:ie.thumbnail}}function parseWithin(ie){if(!ie.within)return;const Z=Array.isArray(ie.within)?ie.within:[ie.within],ee=[];for(const ae of Z)if(typeof ae=="string"){if(ae)switch(ie["@type"]){case"sc:Manifest":ee.push({id:ae,type:"Collection"});break}}else ae["@id"]&&ee.push({id:ae["@id"],type:getNewType(ae)});return ee.length?ee:void 0}function linkingProperties$2(ie){const Z=ie.related?Array.isArray(ie.related)?ie.related:[ie.related]:[],ee=ie.contentLayer;return{provider:ie.logo||Z.length?[{id:configuration.providerId,type:"Agent",homepage:Z.length?[Z[0]]:void 0,logo:ie.logo?Array.isArray(ie.logo)?ie.logo:[ie.logo]:void 0,label:convertLanguageMapping(configuration.providerName)}]:void 0,partOf:parseWithin(ie),rendering:ie.rendering,seeAlso:ie.seeAlso,start:ie.startCanvas,service:ie.service?ensureArray$1(ie.service):void 0,supplementary:ee?[ee]:void 0}}function embeddedContentProperties(ie){return{chars:ie.chars,format:ie.format?ie.format:void 0,language:ie.language}}function upgradeCollection(ie){return removeUndefinedProperties({...technicalProperties$2(ie),...descriptiveProperties$2(ie),...linkingProperties$2(ie),items:ie.members})}function upgradeManifest(ie){const Z=[],ee=[];for(const ye of ie.sequences||[])ye.canvases.length&&Z.push(...ye.canvases),ye.behavior&&ee.push(...ye.behavior);const ae=technicalProperties$2(ie);return ee.length&&(ae.behavior?ae.behavior.push(...ee):ae.behavior=ee),removeUndefinedProperties({...ae,...descriptiveProperties$2(ie),...linkingProperties$2(ie),items:Z,structures:ie.structures})}function upgradeCanvas(ie){return removeUndefinedProperties({...technicalProperties$2(ie),...descriptiveProperties$2(ie),...linkingProperties$2(ie),annotations:ie.otherContent&&ie.otherContent.length?ie.otherContent:void 0,items:ie.images&&ie.images.length?[{id:mintNewIdFromResource(ie,"annotation-page"),type:"AnnotationPage",items:ie.images}]:void 0})}function upgradeAnnotationList(ie){return removeUndefinedProperties({...technicalProperties$2(ie),...descriptiveProperties$2(ie),...linkingProperties$2(ie),items:ie.resources&&ie.resources.length?ie.resources:void 0})}function upgradeSequence(ie){return!ie.canvases||ie.canvases.length===0?{canvases:[],behavior:[]}:{canvases:ie.canvases,behavior:ie.viewingHint?[ie.viewingHint]:[]}}function upgradeAnnotation(ie){function Z(ee){if(Array.isArray(ee)){if(ee.length>1)return{type:"List",items:ee.map(Z)};ee=ee[0]}if(typeof ee=="string")return encodeURI(ee).trim();if("@type"in ee){let ae;if(typeof ee.full=="string")ae=ee.full;else if(ee.full["@type"]==="dctypes:Image")ae={id:ee.full["@id"],type:"Image"};else if(ee.full["@type"]==="sc:Canvas")ae={id:ee.full["@id"],type:"Canvas"};else throw new Error(`Unsupported source type on annotation: ${ee.full["@type"]}`);return{type:"SpecificResource",source:ae,selector:upgradeSelector(ee.selector)}}else return encodeURI(ee["@id"]).trim()}return removeUndefinedProperties({...technicalProperties$2(ie),...descriptiveProperties$2(ie),...linkingProperties$2(ie),target:Z(ie.on),body:Array.isArray(ie.resource)?ie.resource.map(upgradeContentResource):upgradeContentResource(ie.resource)})}function upgradeContentResource(ie){const Z=ie;return removeUndefinedProperties({...technicalProperties$2(Z),...descriptiveProperties$2(Z),...linkingProperties$2(Z),...embeddedContentProperties(Z)})}function upgradeChoice(ie){const Z=[];return ie.default&&ie.default!=="rdf:nil"&&Z.push(ie.default),ie.item&&ie.item!=="rdf:nil"&&Z.push(...ie.item),{...technicalProperties$2(ie),...descriptiveProperties$2(ie),items:Z}}function upgradeRange(ie){return removeUndefinedProperties({...technicalProperties$2(ie),...descriptiveProperties$2(ie),...linkingProperties$2(ie),items:ie.members})}function upgradeService(ie){const{"@id":Z,"@type":ee,"@context":ae,profile:ye,...ve}=ie,be={};return Z&&(be["@id"]=Z),be["@type"]=getNewType(ie),be["@type"]==="unknown"&&(ae&&ae.length&&(be["@context"]=ae),be["@type"]="Service"),ye&&(be.profile=getProfile(ye)),removeUndefinedProperties({...be,...ve})}function upgradeLayer(ie){return removeUndefinedProperties({...technicalProperties$2(ie),...descriptiveProperties$2(ie),...linkingProperties$2(ie)})}const presentation2to3=new Traverse({collection:[upgradeCollection],manifest:[upgradeManifest],canvas:[upgradeCanvas],annotationList:[upgradeAnnotationList],sequence:[upgradeSequence],annotation:[upgradeAnnotation],contentResource:[upgradeContentResource],choice:[upgradeChoice],range:[upgradeRange],service:[upgradeService],layer:[upgradeLayer]});function convertPresentation2(ie){return ie&&ie["@context"]&&(ie["@context"]==="http://iiif.io/api/presentation/2/context.json"||ie["@context"].indexOf("http://iiif.io/api/presentation/2/context.json")!==-1||ie["@context"]==="http://www.shared-canvas.org/ns/context.json")||ie["@context"]==="http://iiif.io/api/image/2/context.json"?presentation2to3.traverseUnknown(ie):ie}function upgradeSelector(ie){if((Array.isArray(ie["@type"])&&ie["@type"].includes("oa:SvgSelector")||ie["@type"]=="oa:SvgSelector")&&("chars"in ie||"value"in ie))return{type:"SvgSelector",value:"chars"in ie?ie.chars:ie.value};if(ie["@type"]==="oa:FragmentSelector")return{type:"FragmentSelector",value:ie.value};if(ie["@type"]==="oa:Choice")return[upgradeSelector(ie.default),...(Array.isArray(ie.item)?ie.item:[ie.item]).map(upgradeSelector)];if(ie["@type"]=="iiif:ImageApiSelector")return{type:"ImageApiSelector",region:"region"in ie?ie.region:void 0,rotation:"rotation"in ie?ie.rotation:void 0};throw new Error(`Unsupported selector type: ${ie["@type"]}`)}function getDefaultEntities$1(){return{Collection:{},Manifest:{},Canvas:{},AnnotationPage:{},AnnotationCollection:{},Annotation:{},ContentResource:{},Range:{},Service:{},Selector:{},Agent:{}}}function getResource(ie,Z){if(typeof ie=="string")return{id:ie,type:Z};if(!ie.id)throw new Error(`Invalid resource does not have an ID (${Z})`);return ie}function mapToEntities(ie){return(Z,ee)=>{const ae=ie[Z]?ie[Z]:{};return ye=>{const ve=getResource(ye,ee||Z);return ve&&ve.id&&Z?(ae[ve.id]=ae[ve.id]?mergeEntities(ae[ve.id],ve):Object.assign({},ve),{id:ve.id,type:Z==="ContentResource"?Z:ve.type}):ve}}}function merge(ie,Z){if(!Z)return ie;if(Array.isArray(ie)){if(!Array.isArray(Z))throw new Error("Cannot merge array with non-array");const ee=[...ie];for(const ae of Z)if(ae!=null)if(Array.isArray(ae))ee.push(ae);else if(typeof ae=="object"&&ae.id&&ae.type){const ye=ee.findIndex(ve=>ve.id===ae.id&&ve.type===ae.type);ye>=0&&(ee[ye]=merge(ee[ye],ae))}else ie.indexOf(ae)===-1&&ee.push(ae);return ee}else if(typeof ie=="object"){if(Array.isArray(Z)||typeof Z!="object")throw new Error("Cannot merge object with non-object");const ee={...ie};for(const[ae,ye]of Object.entries(Z)){const ve=ee[ae];ve===EMPTY||!ve?ee[ae]=ye:ee[ae]=merge(ve,ye)}return ee}else if(ie)return ie;return Z}function mergeEntities(ie,Z){if(typeof ie=="string")return ie;if(Z.id!==ie.id||Z.type!==ie.type)throw new Error("Can only merge entities with identical identifiers and type!");return merge({...ie},Z)}function recordTypeInMapping(ie){return(Z,ee)=>ae=>{const{id:ye,type:ve}=getResource(ae,ee||Z);if(typeof ye>"u")throw new Error("Found invalid entity without an ID.");return Z==="ContentResource"?ie[ye]=Z:ie[ye]=ve,ae}}function hash$1(ie){const Z=JSON.stringify(ie);let ee=5381,ae=Z.length;for(;ae;)ee=ee*33^Z.charCodeAt(--ae);const ye=(ee>>>0).toString(16);return ye.length%2?"0"+ye:ye}function addMissingIdToContentResource(ie){return Z=>typeof Z=="string"?{id:Z,type:ie}:Z.id?Z.type?Z:{type:ie,...Z}:{id:`vault://${hash$1(Z)}`,type:ie,...Z}}function ensureDefaultFields(ie){return Z=>({...ie,...Z})}function ensureArray(ie){return Array.isArray(ie)?ie:[ie]}function ensureArrayOnAnnotation(ie){return ie.body&&(ie.body=ensureArray(ie.body)),ie.seeAlso&&(ie.seeAlso=ensureArray(ie.seeAlso)),ie.body&&(ie.body=ensureArray(ie.body)),ie.audience&&(ie.audience=ensureArray(ie.audience)),ie.accessibility&&(ie.accessibility=ensureArray(ie.accessibility)),ie.motivation&&(ie.motivation=ensureArray(ie.motivation)),ie}function normalize(ie){const Z=convertPresentation2(ie),ee=getDefaultEntities$1(),ae={},ye=mapToEntities(ee),ve=recordTypeInMapping(ae),be=new Traverse$1({collection:[ensureDefaultFields(emptyCollection),ve("Collection"),ye("Collection")],manifest:[ensureDefaultFields(emptyManifest),ve("Manifest"),ye("Manifest")],canvas:[ensureDefaultFields(emptyCanvas),ve("Canvas"),ye("Canvas")],annotationPage:[addMissingIdToContentResource("AnnotationPage"),ensureDefaultFields(emptyAnnotationPage),ve("AnnotationPage"),ye("AnnotationPage")],annotation:[addMissingIdToContentResource("Annotation"),ensureArrayOnAnnotation,ve("Annotation"),ye("Annotation")],contentResource:[addMissingIdToContentResource("ContentResource"),ve("ContentResource"),ye("ContentResource")],range:[ensureDefaultFields(emptyRange),ve("Range","Canvas"),ye("Range","Canvas")],agent:[ensureDefaultFields(emptyAgent),ve("Agent"),ye("Agent")]}).traverseUnknown(Z);return{entities:ee,resource:be,mapping:ae}}const UNSET="__$UNSET$__",UNWRAP="__$UNWRAP$__";function resolveIfExists$1(ie,Z){const ee=ie.requests[Z],ae=ie.mapping[Z];if(!(!ae||ee&&ee.resourceUri&&!ie.entities[ae][ee.resourceUri]))return ie.entities[ae][ee?ee.resourceUri:Z]}function serializedFieldsToObject(ie){const Z={};for(const[ee,ae]of ie){if(ee===UNWRAP&&ae!==UNSET)return ae;ae!==UNSET&&typeof ae<"u"&&ae!==null&&(Z[ee]=ae)}return Z}function serialize(ie,Z,ee){if(!Z.type||!Z.id)throw new Error("Unknown entity");if(!ee[Z.type])throw new Error(`Serializer not found for ${Z.type}`);function ae(ye){const ve=ee[ye.type];if(!ve)return UNSET;const be=resolveIfExists$1(ie,ye.id)||(ye.id&&ye.type?ye:null);if(!be)return UNSET;const Ye=ve(be,ie,{isTopLevel:Z.id===ye.id});let Ke=Ye.next();for(;!Ke.done;){const Xe=Ke.value;let Je=UNSET;if(Xe)if(Array.isArray(Xe)){const rt=[];for(const nt of Xe)rt.push(ae(nt));Je=rt}else Je=ae(Xe);Ke=Ye.next(Je)}return Ke.value===UNSET?UNSET:serializedFieldsToObject(Ke.value)}return ae(Z)}function languageString2to3(ie){if(!ie)return;const Z=Object.keys(ie);if(Z.length!==0){if(Z.length===1){const ee=Z[0];if(!ee)return"";const ae=(ie[ee]||[]).join("");return ee==="@none"||ee==="none"||ee==="en"?ae:{"@language":ee,"@value":ae}}return Z.map(ee=>({"@language":ee,"@value":(ie[ee]||[]).join("")}))}}function parseCanvasTarget(ie){return Array.isArray(ie)?ie.map(Z=>parseCanvasTarget(Z)):typeof ie=="string"?ie:ie.type&&ie.type==="Canvas"?ie.id:ie}function unNestArray(ie,Z=!1){if(ie)return ie.length>1&&!Z?ie:ie[0]||void 0}function convertService(ie){if(ie){if(typeof ie=="string")return{"@id":ie};if("@id"in ie){const Z={...ie};return delete Z["@type"],Z}return{"@context":"http://iiif.io/api/image/2/context.json","@id":ie.id,profile:`http://iiif.io/api/image/2/profiles/${ie.profile}.json`}}}function technicalProperties$1(ie,Z){return[["@id",ie.id],["@type",Z],["format",ie.format],["height",ie.height],["width",ie.width],["viewingDirection",ie.viewingDirection!=="left-to-right"?ie.viewingDirection:void 0]]}function*descriptiveProperties$1(ie){const Z=ie.provider?yield ie.provider[0]:void 0;return[["label",languageString2to3(ie.label)],["metadata",ie.metadata&&ie.metadata.length?ie.metadata.map(ee=>({label:languageString2to3(ee.label)||"",value:languageString2to3(ee.value)||""})):void 0],["description",languageString2to3(ie.summary)],["thumbnail",unNestArray(yield ie.thumbnail)],["navDate",ie.navDate],["logo",Z?unNestArray(Z.logo):void 0],["homepage",Z?Z.homepage:void 0],["attribution",ie.requiredStatement?languageString2to3(ie.requiredStatement.value):void 0]]}function*linkingProperties$1(ie){return[["seeAlso",unNestArray(yield ie.seeAlso)],["service",unNestArray((ie.service||[]).map(convertService))],["rendering",unNestArray(yield ie.rendering)],["startCanvas",ie.start?ie.start.id:void 0]]}const serializeConfigPresentation2={Manifest:function*(ie){return[...technicalProperties$1(ie,"sc:Manifest"),...yield*descriptiveProperties$1(ie),...yield*linkingProperties$1(ie),["sequences",[{"@id":`${ie.id}/sequence0`,"@type":"sc:Sequence",canvases:yield ie.items}]],["structures",yield ie.structures]]},Canvas:function*(ie){const Z=(yield ie.items)[0];return[...technicalProperties$1(ie,"sc:Canvas"),...yield*descriptiveProperties$1(ie),...yield*linkingProperties$1(ie),["images",Z?[Z.resources]:void 0],["annotations",ie.annotations&&ie.annotations.length?unNestArray(yield ie.annotations):void 0]]},AnnotationPage:function*(ie){return[...technicalProperties$1(ie,"sc:AnnotationList"),...yield*descriptiveProperties$1(ie),["resources",ie.items&&ie.items.length?unNestArray(yield ie.items):void 0]]},Annotation:function*(ie){return[["@id",ie.id],["@type","oa:Annotation"],["motivation","sc:painting"],["on",parseCanvasTarget(ie.target)],["resource",unNestArray(yield ie.body,!0)]]},ContentResource:function*(ie){switch(ie.type){case"Image":return[...technicalProperties$1(ie,"dctypes:Image"),...yield*descriptiveProperties$1(ie),...yield*linkingProperties$1(ie)];case"Text":case"Dataset":default:return[...technicalProperties$1(ie,void 0),...yield*descriptiveProperties$1(ie)]}},AnnotationCollection:function*(ie){return[["@id",ie.id],["@type","sc:Layer"],["label",languageString2to3(ie.label)]]},Collection:function*(ie){return[...technicalProperties$1(ie,"sc:Collection"),...yield*descriptiveProperties$1(ie),...yield*linkingProperties$1(ie),["members",yield*ie.items]]},Range:function*(ie){const Z=[],ee=[];if(ie.items)for(const ae of ie.items){const ye=yield ae;Z.push({"@id":ae.id,"@type":ae.type,label:ye?ye.label:void 0,within:ie.id}),ae.type==="Canvas"&&ee.push(ae.id)}return[...technicalProperties$1(ie,"sc:Range"),...yield*descriptiveProperties$1(ie),...yield*linkingProperties$1(ie),["canvases",ee.length===Z.length?ee:void 0],["members",ee.length!==Z.length?Z:void 0]]}};function technicalProperties(ie){var Z;return[["id",(Z=ie.id)!=null&&Z.startsWith("vault://")?void 0:ie.id],["type",ie.type],["format",ie.format],["profile",ie.profile],["height",ie.height],["width",ie.width],["duration",ie.duration||void 0],["viewingDirection",ie.viewingDirection!=="left-to-right"?ie.viewingDirection:void 0],["behavior",ie.behavior&&ie.behavior.length?ie.behavior:void 0],["timeMode",ie.timeMode],["motivation",Array.isArray(ie.motivation)?ie.motivation[0]:ie.motivation]]}function filterEmpty(ie){if(!(!ie||ie.length===0))return ie}function service2compat(ie){if(ie&&ie.type&&ie.type==="ImageService2"){const{id:Z,type:ee,profile:ae,...ye}=ie,ve=typeof ae=="string"?ae:Array.isArray(ae)?ae.find(be=>typeof be=="string"):"";return{"@id":Z,"@type":ee,profile:ve?ve.startsWith("http")?ve:`http://iiif.io/api/image/2/${ve}.json`:"http://iiif.io/api/image/2/level0.json",...ye}}return ie}function filterService2Compat(ie){if(!(!ie||ie.length===0))return ie.map(service2compat)}function*descriptiveProperties(ie){return[["label",ie.label],["metadata",filterEmpty(ie.metadata)],["summary",ie.summary],["requiredStatement",ie.requiredStatement],["rights",ie.rights],["navDate",ie.navDate],["language",ie.language],["thumbnail",filterEmpty(yield ie.thumbnail)],["placeholderCanvas",yield ie.placeholderCanvas],["accompanyingCanvas",yield ie.accompanyingCanvas],["provider",filterEmpty(yield ie.provider)]]}function*linkingProperties(ie){return[["seeAlso",filterEmpty(yield ie.seeAlso)],["service",filterService2Compat(ie.service)],["services",filterService2Compat(ie.services)],["rendering",filterEmpty(yield ie.rendering)],["supplementary",filterEmpty(yield ie.supplementary)],["homepage",filterEmpty(yield ie.homepage)],["logo",filterEmpty(yield ie.logo)],["partOf",filterEmpty(yield ie.partOf)],["start",ie.start]]}const serializeConfigPresentation3={Manifest:function*(ie,Z,{isTopLevel:ee}){return ee?[["@context","http://iiif.io/api/presentation/3/context.json"],...technicalProperties(ie),...yield*descriptiveProperties(ie),...yield*linkingProperties(ie),["items",yield ie.items],["structures",filterEmpty(yield ie.structures)],["annotations",filterEmpty(yield ie.annotations)]]:[...technicalProperties(ie),...yield*descriptiveProperties(ie)]},Canvas:function*(ie){return[...technicalProperties(ie),...yield*descriptiveProperties(ie),...yield*linkingProperties(ie),["items",yield ie.items],["annotations",filterEmpty(yield ie.annotations)]]},Agent:function*(ie){return[["id",ie.id],["type","Agent"],["label",ie.label],...yield*linkingProperties(ie)]},AnnotationPage:function*(ie){return[...Object.entries(ie).map(([Z,ee])=>[Z,Array.isArray(ee)?filterEmpty(ee):ee]).filter(([Z,ee])=>Z!=="items"),...yield*linkingProperties(ie),["items",yield ie.items]]},Service:function*(ie){return[[UNWRAP,service2compat(ie)]]},Annotation:function*(ie){const Z=Object.entries(ie).map(([ae,ye])=>ae==="motivation"?[ae,Array.isArray(ye)?ye[0]:ye]:[ae,Array.isArray(ye)?filterEmpty(ye):ye]).filter(([ae])=>ae!=="body"),ee=yield ie.body;return[...Z,["body",ee.length===1?ee[0]:ee]]},ContentResource:function*(ie){return[...technicalProperties(ie),...yield*descriptiveProperties(ie),...yield*linkingProperties(ie),["annotations",filterEmpty(yield ie.annotations)],["items",filterEmpty(yield ie.items)]]},AnnotationCollection:function*(ie){return[["id",ie.id],["type","AnnotationCollection"],["label",ie.label]]},Collection:function*(ie,Z,{isTopLevel:ee}){return ee?[["@context","http://iiif.io/api/presentation/3/context.json"],...technicalProperties(ie),...yield*descriptiveProperties(ie),...yield*linkingProperties(ie),["items",filterEmpty(yield ie.items)]]:[...technicalProperties(ie),...yield*descriptiveProperties(ie)]},Range:function*(ie){const Z=[];for(const ee of ie.items)ee.type==="Range"?Z.push(yield ee):Z.push(ee);return[...technicalProperties(ie),...yield*descriptiveProperties(ie),...yield*linkingProperties(ie),["items",Z],["annotations",filterEmpty(yield ie.annotations)]]}};function n$1(ie){return ie==null}function t$1(ie){throw new Error("Argument "+ie+" is empty.")}function o$1(ie){return typeof ie=="string"||typeof ie=="symbol"}function u$1(ie){return!o$1(ie)}function a$1(ie){throw new Error("Argument "+ie+" is invalid, it should be an action type of type: string | symbol")}function s$1(ie,Z){return n$1(ie)&&t$1(1),u$1(ie)&&a$1(1),Object.assign(function(){var ee=Z!=null?Z.apply(void 0,arguments):void 0;return Object.assign({type:ie},ee)},{getType:function(){return ie},toString:function(){return ie}})}function y$1(ie,Z,ee){return n$1(ie)&&t$1(1),u$1(ie)&&a$1(1),function(){return s$1(ie,function(){var ae=arguments.length<=0?void 0:arguments[0],ye=arguments.length<=1?void 0:arguments[1];return Z==null&&ee==null||(ae=Z!=null?Z.apply(void 0,arguments):void 0,ye=ee!=null?ee.apply(void 0,arguments):void 0),Object.assign({},ae!==void 0&&{payload:ae},{},ye!==void 0&&{meta:ye})})}}function _typeof(ie){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Z){return typeof Z}:function(Z){return Z&&typeof Symbol=="function"&&Z.constructor===Symbol&&Z!==Symbol.prototype?"symbol":typeof Z},_typeof(ie)}function toPrimitive(ie,Z){if(_typeof(ie)!="object"||!ie)return ie;var ee=ie[Symbol.toPrimitive];if(ee!==void 0){var ae=ee.call(ie,Z||"default");if(_typeof(ae)!="object")return ae;throw new TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)(ie)}function toPropertyKey(ie){var Z=toPrimitive(ie,"string");return _typeof(Z)=="symbol"?Z:String(Z)}function _defineProperty$1(ie,Z,ee){return Z=toPropertyKey(Z),Z in ie?Object.defineProperty(ie,Z,{value:ee,enumerable:!0,configurable:!0,writable:!0}):ie[Z]=ee,ie}function ownKeys$1(ie,Z){var ee=Object.keys(ie);if(Object.getOwnPropertySymbols){var ae=Object.getOwnPropertySymbols(ie);Z&&(ae=ae.filter(function(ye){return Object.getOwnPropertyDescriptor(ie,ye).enumerable})),ee.push.apply(ee,ae)}return ee}function _objectSpread2$1(ie){for(var Z=1;Z"u"&&(ee=Z,Z=void 0),typeof ee<"u"){if(typeof ee!="function")throw new Error(formatProdErrorMessage(1));return ee(createStore$1)(ie,Z)}if(typeof ie!="function")throw new Error(formatProdErrorMessage(2));var ye=ie,ve=Z,be=[],Ye=be,Ke=!1;function Xe(){Ye===be&&(Ye=be.slice())}function Je(){if(Ke)throw new Error(formatProdErrorMessage(3));return ve}function rt(ct){if(typeof ct!="function")throw new Error(formatProdErrorMessage(4));if(Ke)throw new Error(formatProdErrorMessage(5));var ot=!0;return Xe(),Ye.push(ct),function(){if(ot){if(Ke)throw new Error(formatProdErrorMessage(6));ot=!1,Xe();var dt=Ye.indexOf(ct);Ye.splice(dt,1),be=null}}}function nt(ct){if(!isPlainObject$3(ct))throw new Error(formatProdErrorMessage(7));if(typeof ct.type>"u")throw new Error(formatProdErrorMessage(8));if(Ke)throw new Error(formatProdErrorMessage(9));try{Ke=!0,ve=ye(ve,ct)}finally{Ke=!1}for(var ot=be=Ye,dt=0;dt"u")throw new Error(formatProdErrorMessage(12));if(typeof ee(void 0,{type:ActionTypes.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(formatProdErrorMessage(13))})}function combineReducers(ie){for(var Z=Object.keys(ie),ee={},ae=0;ae"u")throw Ke&&Ke.type,new Error(formatProdErrorMessage(14));Je[nt]=ct,Xe=Xe||ct!==lt}return Xe=Xe||ve.length!==Object.keys(Ye).length,Xe?Je:Ye}}function compose(){for(var ie=arguments.length,Z=new Array(ie),ee=0;ee{const{entities:ee,resource:ae,mapping:ye}=normalize(Z);if(ae.id===void 0)return[requestError({id:ie,message:"ID is not defined in resource."})];const ve=[importEntities({entities:ee}),addMappings({mapping:ye})];return ae.id!==ie&&(ve.push(addMapping({id:ie,type:ae.type})),ve.push(requestMismatch({requestId:ie,actualId:ae.id}))),ve.push(requestComplete({id:ie})),ve},safeIsNaN=Number.isNaN||function(ie){return typeof ie=="number"&&ie!==ie};function isEqual(ie,Z){return!!(ie===Z||safeIsNaN(ie)&&safeIsNaN(Z))}function areInputsEqual(ie,Z){if(!Array.isArray(ie)||!Array.isArray(Z))return ie===Z;if(ie.length!==Z.length)return!1;for(let ee=0;ee{const ve=ie.getState(),be=ve.iiif.requests[ae];if(be)switch(be.loadingState){case RESOURCE_ERROR:break;case RESOURCE_LOADING:{let Ye,Ke=!1;try{const Xe=await Promise.race([new Promise((Je,rt)=>{Ke||(Ye=ie.subscribe(()=>{const nt=ie.getState();if(nt.iiif.requests[ae].loadingState===RESOURCE_ERROR){rt();return}if(nt.iiif.requests[ae].loadingState===RESOURCE_READY){const it=resolveIfExists(nt,ae);it?Je(it):rt()}}))}),new Promise((Je,rt)=>setTimeout(()=>{Ke=!0,rt()},ee*60))]);if(Ye&&Ye(),Xe)return Xe}catch{Ye&&Ye();break}break}case RESOURCE_READY:{const Ye=resolveIfExists(ve,ae);if(Ye)return Ye;break}}ie.dispatch(requestResource({id:ae}));try{const Ye=await Z(ae,ye);!Ye.id&&!Ye["@id"]&&(Ye["@type"]&&(Ye["@id"]=ae),Ye.id=ae);const Ke=actionListFromResource(ae,Ye);return ie.dispatch(batchActions({actions:Ke})),resolveIfExists(ie.getState(),ae)}catch(Ye){throw ie.dispatch(requestError({id:ae,message:Ye.toString()})),Ye}}}function getDefaultEntities(){return{Collection:{},Manifest:{},Canvas:{},AnnotationPage:{},AnnotationCollection:{},Annotation:{},ContentResource:{},Range:{},Service:{},Selector:{},Agent:{}}}const mappingReducer=(ie={},Z)=>{switch(Z.type){case ADD_MAPPING:return{...ie,[Z.payload.id]:Z.payload.type};case ADD_MAPPINGS:return{...ie,...Z.payload.mapping};default:return ie}};function isReferenceList(ie,Z,ee,ae){return!(!ie[ee]||!ie[ee][Z]||!ie[ee][Z][ae]||!Array.isArray(ie[ee][Z][ae]))}function quickMerge(ie,Z){const ee={},ae=[];for(const[ye,ve]of Object.entries(ie||{})){ae.push(ye);const be=(Z||{})[ye];if(!be||be.length===0){ee[ye]=ve;continue}ee[ye]=be}for(const[ye,ve]of Object.entries(Z||{}))ae.indexOf(ye)===-1&&(ee[ye]=ve);return ee}const entitiesReducer=(ie=getDefaultEntities(),Z)=>{var ee;switch(Z.type){case MODIFY_ENTITY_FIELD:{if(!ie[Z.payload.type]||!ie[Z.payload.type][Z.payload.id])return ie;const ae=ie[Z.payload.type][Z.payload.id];return typeof ae=="string"?ie:{...ie,[Z.payload.type]:{...ie[Z.payload.type],[Z.payload.id]:{...ae,[Z.payload.key]:Z.payload.value}}}}case REORDER_ENTITY_FIELD:{if(!isReferenceList(ie,Z.payload.id,Z.payload.type,Z.payload.key))return ie;const ae=ie[Z.payload.type][Z.payload.id];if(typeof ae=="string")return ie;const ye=Array.from(ae[Z.payload.key]),[ve]=ye.splice(Z.payload.startIndex,1);return ye.splice(Z.payload.endIndex,0,ve),{...ie,[Z.payload.type]:{...ie[Z.payload.type],[Z.payload.id]:{...ae,[Z.payload.key]:ye}}}}case IMPORT_ENTITIES:{const ae=Object.keys(Z.payload.entities),ye={...ie};for(const ve of ae){const be=Z.payload.entities[ve],Ye={...ie[ve]||{}};let Ke=!1;const Xe=Object.keys(be||{})||[];if(be&&Xe){for(const Je of Xe)Ke=!0,Ye[Je]=ie[ve][Je]?quickMerge(ie[ve][Je],be[Je]):be[Je];Ke&&(ye[ve]=Ye)}}return ye}case ADD_REFERENCE:{if(!isReferenceList(ie,Z.payload.id,Z.payload.type,Z.payload.key))return ie;const ae=ie[Z.payload.type][Z.payload.id],ye=Array.from(ae[Z.payload.key]);return ye.splice(Z.payload.index||ye.length+1,0,Z.payload.reference),{...ie,[Z.payload.type]:{...ie[Z.payload.type],[Z.payload.id]:{...ae,[Z.payload.key]:ye}}}}case REMOVE_REFERENCE:{if(!isReferenceList(ie,Z.payload.id,Z.payload.type,Z.payload.key))return ie;const ae=ie[Z.payload.type][Z.payload.id],ye=Array.from(ae[Z.payload.key]),ve=Z.payload.index||ye.findIndex(be=>be&&be.id===Z.payload.reference.id);return ve===-1||((ee=ye[ve])==null?void 0:ee.id)!==Z.payload.reference.id?ie:(ye.splice(ve,1),{...ie,[Z.payload.type]:{...ie[Z.payload.type],[Z.payload.id]:{...ae,[Z.payload.key]:ye}}})}default:return ie}},requestReducer=(ie={},Z)=>{switch(Z.type){case REQUEST_RESOURCE:case REQUEST_OFFLINE_RESOURCE:return{...ie,[Z.payload.id]:{requestUri:Z.payload.id,loadingState:RESOURCE_LOADING,uriMismatch:!1,resourceUri:Z.payload.id}};case REQUEST_MISMATCH:return{...ie,[Z.payload.requestId]:{...ie[Z.payload.requestId]||{},uriMismatch:!0,resourceUri:Z.payload.actualId},[Z.payload.actualId]:{requestUri:Z.payload.requestId,loadingState:ie[Z.payload.requestId].loadingState,uriMismatch:!0,resourceUri:Z.payload.actualId}};case REQUEST_ERROR:return{...ie,[Z.payload.id]:{...ie[Z.payload.id]||{},loadingState:RESOURCE_ERROR,error:Z.payload.message}};case REQUEST_COMPLETE:return{...ie,[Z.payload.id]:{...ie[Z.payload.id]||{},loadingState:RESOURCE_READY,error:void 0}}}return ie},metaReducer=(ie={},Z)=>{const{id:ee,updateValue:ae,value:ye,meta:ve,key:be}=Z&&Z.payload||{};switch(Z.type){case SET_META_VALUE:return{...ie,[ee]:{...ie[ee]||{},[ve]:{...ie[ee]?ie[ee][ve]||{}:{},[be]:ye}}};case SET_META_VALUE_DYNAMIC:return{...ie,[ee]:{...ie[ee]||{},[ve]:{...ie[ee]?ie[ee][ve]||{}:{},[be]:ie[ee]&&ie[ee][ve]?ae(ie[ee][ve][be]):ae(void 0)}}};case UNSET_META_VALUE:return ie[ee]&&ie[ee][ve]&&ie[ee][ve][be]?{...ie,[ee]:{...ie[ee]||{},[ve]:{...ie[ee]?ie[ee][ve]||{}:{},[be]:void 0}}}:ie;default:return ie}};function createBatchReducer(ie){return(Z,ee)=>ee&&ee.type===BATCH_ACTIONS?ee.payload.actions.reduce(ie,Z):ee&&ee.type===BATCH_IMPORT?ee.payload.state:ie(Z,ee)}const reducers=combineReducers({mapping:mappingReducer,entities:entitiesReducer,requests:requestReducer,meta:metaReducer}),composeEnhancers=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||compose;function createStore(ie={}){const{enableDevtools:Z=!0,iiifStoreName:ee="iiif",defaultState:ae={},extraMiddleware:ye=[],customReducers:ve={}}=ie,be=combineReducers({[ee]:reducers,...ve});return createStore$1(createBatchReducer(be),ae,Z?composeEnhancers(applyMiddleware(...ye)):compose(applyMiddleware(...ye)))}function mitt(ie){return{all:ie=ie||new Map,on:function(Z,ee){var ae=ie.get(Z);ae?ae.push(ee):ie.set(Z,[ee])},off:function(Z,ee){var ae=ie.get(Z);ae&&(ee?ae.splice(ae.indexOf(ee)>>>0,1):ie.set(Z,[]))},emit:function(Z,ee){var ae=ie.get(Z);ae&&ae.slice().map(function(ye){ye(ee)}),(ae=ie.get("*"))&&ae.slice().map(function(ye){ye(Z,ee)})}}}class Vault{constructor(Z,ee){Sc(this,"options"),Sc(this,"store"),Sc(this,"emitter"),Sc(this,"isBatching",!1),Sc(this,"batchQueue",[]),Sc(this,"remoteFetcher"),Sc(this,"staticFetcher"),Sc(this,"defaultFetcher",ae=>fetch(ae).then(ye=>ye.json())),Sc(this,"middleware",ae=>ye=>ve=>{if(ve.type===BATCH_ACTIONS){for(const Ke of ve.payload.actions)this.emitter.emit(Ke.type,{realAction:Ke,state:ae.getState()});const Ye=ye(ve);for(const Ke of ve.payload.actions)this.emitter.emit(`after:${ve.type}`,{action:ve,state:Ye});return Ye}this.emitter.emit(ve.type,{action:ve,state:ae.getState()});const be=ye(ve);return this.emitter.emit(`after:${ve.type}`,{action:ve,state:be}),be}),this.options=Object.assign({reducers:{},middleware:[],defaultState:{},customFetcher:this.defaultFetcher,enableDevtools:!0},Z||{}),this.store=ee||createStore({customReducers:this.options.reducers,extraMiddleware:[...this.options.middleware,this.middleware],defaultState:this.options.defaultState,enableDevtools:this.options.enableDevtools}),this.emitter=mitt(),this.remoteFetcher=createFetchHelper(this.store,this.options.customFetcher),this.staticFetcher=createFetchHelper(this.store,(ae,ye)=>ye)}batch(Z){this.isBatching=!0;try{Z(this),this.store.dispatch(batchActions({actions:this.batchQueue}))}catch(ee){throw this.batchQueue=[],this.isBatching=!1,ee}this.batchQueue=[],this.isBatching=!1}async asyncBatch(Z){this.isBatching=!0;try{await Z(this),this.store.dispatch(batchActions({actions:this.batchQueue}))}catch(ee){throw this.batchQueue=[],this.isBatching=!1,ee}this.batchQueue=[],this.isBatching=!1}modifyEntityField(Z,ee,ae){this.dispatch(entityActions.modifyEntityField({id:Z.id,type:Z.type,key:ee,value:ae}))}dispatch(Z){this.isBatching?this.batchQueue.push(Z):this.store.dispatch(Z)}serialize(Z,ee){return serialize(this.getState().iiif,Z,ee)}toPresentation2(Z){return this.serialize(Z,serializeConfigPresentation2)}toPresentation3(Z){return this.serialize(Z,serializeConfigPresentation3)}hydrate(Z,ee){return this.get(Z,ee,{skipSelfReturn:!1})}get(Z,ee,ae={}){typeof ee!="string"&&(ae=ee||{},ee=void 0);const{skipSelfReturn:ye=!0}=ae||{};if(Array.isArray(Z))return Z.map(Xe=>this.get(Xe,ae));const ve=this.getState();if(typeof Z=="string"){const Xe=ee||ve.iiif.mapping[Z];if(!Xe)return ye?null:{id:Z,type:"unknown"};Z={id:Z,type:Xe}}const be=ee||Z.type,Ye=Z.id,Ke=ve.iiif.entities[be];if(!Ke){const Xe=ve.iiif.requests[Ye];return Xe&&Xe.resourceUri!==Ye?this.get(Xe.resourceUri,ae):ye?null:Z}return Ke[Z.id]||(ye?null:Z)}select(Z){return Z(this.getState())}getStore(){return this.store}getState(){return this.store.getState()}loadManifest(Z,ee){const ae=typeof Z=="string"?Z:Z.id;return this.load(ae,ee)}loadCollection(Z,ee){const ae=typeof Z=="string"?Z:Z.id;return this.load(ae,ee)}load(Z,ee){const ae=typeof Z=="string"?Z:Z.id;return ee?this.staticFetcher(ae,ee):this.remoteFetcher(ae)}areInputsEqual(Z,ee){return areInputsEqual(Z,ee)}subscribe(Z,ee,ae){typeof ae>"u"&&(typeof ee>"u"||ee===!1||ee===!0)&&(ae=ee,ee=Z,Z=ve=>ve);let ye=ae?null:Z(this.store.getState());return ae||ee(ye,this),this.store.subscribe(()=>{const ve=this.store.getState(),be=Z(ve);ye!==be&&!areInputsEqual(ye,be)&&ee(be,this),ye=be})}async ensureLoaded(Z){const ee=typeof Z=="string"?Z:Z.id;this.requestStatus(ee)||await this.load(ee)}requestStatus(Z){return this.select(ee=>ee.iiif.requests[Z])}getResourceMeta(Z,ee){const ae=this.getState().iiif.meta[Z];if(ae)return ee?ae[ee]:ae}setMetaValue([Z,ee,ae],ye){this.dispatch(typeof ye=="function"?metaActions.setMetaValueDynamic({id:Z,meta:ee,key:ae,updateValue:ye}):metaActions.setMetaValue({id:Z,meta:ee,key:ae,value:ye}))}}function _extends$1(){return _extends$1=Object.assign?Object.assign.bind():function(ie){for(var Z=1;Zlt,Object.values(lt));return reactExports.createElement(ct.Provider,{value:ot},it)}function Je(rt,nt){const it=(nt==null?void 0:nt[ie][Ke])||Ye,lt=reactExports.useContext(it);if(lt)return lt;if(be!==void 0)return be;throw new Error(`\`${rt}\` must be used within \`${ve}\``)}return Xe.displayName=ve+"Provider",[Xe,Je]}const ye=()=>{const ve=ee.map(be=>reactExports.createContext(be));return function(be){const Ye=(be==null?void 0:be[ie])||ve;return reactExports.useMemo(()=>({[`__scope${ie}`]:{...be,[ie]:Ye}}),[be,Ye])}};return ye.scopeName=ie,[ae,$c512c27ab02ef895$var$composeContextScopes(ye,...Z)]}function $c512c27ab02ef895$var$composeContextScopes(...ie){const Z=ie[0];if(ie.length===1)return Z;const ee=()=>{const ae=ie.map(ye=>({useScope:ye(),scopeName:ye.scopeName}));return function(ye){const ve=ae.reduce((be,{useScope:Ye,scopeName:Ke})=>{const Xe=Ye(ye)[`__scope${Ke}`];return{...be,...Xe}},{});return reactExports.useMemo(()=>({[`__scope${Z.scopeName}`]:ve}),[ve])}};return ee.scopeName=Z.scopeName,ee}function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(ie){const Z=reactExports.useRef(ie);return reactExports.useEffect(()=>{Z.current=ie}),reactExports.useMemo(()=>(...ee)=>{var ae;return(ae=Z.current)===null||ae===void 0?void 0:ae.call(Z,...ee)},[])}function $71cd76cc60e0454e$export$6f32135080cb4c3({prop:ie,defaultProp:Z,onChange:ee=()=>{}}){const[ae,ye]=$71cd76cc60e0454e$var$useUncontrolledState({defaultProp:Z,onChange:ee}),ve=ie!==void 0,be=ve?ie:ae,Ye=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(ee),Ke=reactExports.useCallback(Xe=>{if(ve){const Je=typeof Xe=="function"?Xe(ie):Xe;Je!==ie&&Ye(Je)}else ye(Xe)},[ve,ie,ye,Ye]);return[be,Ke]}function $71cd76cc60e0454e$var$useUncontrolledState({defaultProp:ie,onChange:Z}){const ee=reactExports.useState(ie),[ae]=ee,ye=reactExports.useRef(ae),ve=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(Z);return reactExports.useEffect(()=>{ye.current!==ae&&(ve(ae),ye.current=ae)},[ae,ye,ve]),ee}const $9f79659886946c16$export$e5c5a5f917a5871c=globalThis!=null&&globalThis.document?reactExports.useLayoutEffect:()=>{};function $6ed0406888f73fc4$var$setRef(ie,Z){typeof ie=="function"?ie(Z):ie!=null&&(ie.current=Z)}function $6ed0406888f73fc4$export$43e446d32b3d21af(...ie){return Z=>ie.forEach(ee=>$6ed0406888f73fc4$var$setRef(ee,Z))}function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...ie){return reactExports.useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...ie),ie)}const $5e63c961fc1ce211$export$8c6ed5c666ac1360=reactExports.forwardRef((ie,Z)=>{const{children:ee,...ae}=ie,ye=reactExports.Children.toArray(ee),ve=ye.find($5e63c961fc1ce211$var$isSlottable);if(ve){const be=ve.props.children,Ye=ye.map(Ke=>Ke===ve?reactExports.Children.count(be)>1?reactExports.Children.only(null):reactExports.isValidElement(be)?be.props.children:null:Ke);return reactExports.createElement($5e63c961fc1ce211$var$SlotClone,_extends$1({},ae,{ref:Z}),reactExports.isValidElement(be)?reactExports.cloneElement(be,void 0,Ye):null)}return reactExports.createElement($5e63c961fc1ce211$var$SlotClone,_extends$1({},ae,{ref:Z}),ee)});$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName="Slot";const $5e63c961fc1ce211$var$SlotClone=reactExports.forwardRef((ie,Z)=>{const{children:ee,...ae}=ie;return reactExports.isValidElement(ee)?reactExports.cloneElement(ee,{...$5e63c961fc1ce211$var$mergeProps(ae,ee.props),ref:Z?$6ed0406888f73fc4$export$43e446d32b3d21af(Z,ee.ref):ee.ref}):reactExports.Children.count(ee)>1?reactExports.Children.only(null):null});$5e63c961fc1ce211$var$SlotClone.displayName="SlotClone";const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45=({children:ie})=>reactExports.createElement(reactExports.Fragment,null,ie);function $5e63c961fc1ce211$var$isSlottable(ie){return reactExports.isValidElement(ie)&&ie.type===$5e63c961fc1ce211$export$d9f1ccf0bdb05d45}function $5e63c961fc1ce211$var$mergeProps(ie,Z){const ee={...Z};for(const ae in Z){const ye=ie[ae],ve=Z[ae];/^on[A-Z]/.test(ae)?ye&&ve?ee[ae]=(...be)=>{ve(...be),ye(...be)}:ye&&(ee[ae]=ye):ae==="style"?ee[ae]={...ye,...ve}:ae==="className"&&(ee[ae]=[ye,ve].filter(Boolean).join(" "))}return{...ie,...ee}}const $8927f6f2acc4f386$var$NODES=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],$8927f6f2acc4f386$export$250ffa63cdc0d034=$8927f6f2acc4f386$var$NODES.reduce((ie,Z)=>{const ee=reactExports.forwardRef((ae,ye)=>{const{asChild:ve,...be}=ae,Ye=ve?$5e63c961fc1ce211$export$8c6ed5c666ac1360:Z;return reactExports.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),reactExports.createElement(Ye,_extends$1({},be,{ref:ye}))});return ee.displayName=`Primitive.${Z}`,{...ie,[Z]:ee}},{});function $8927f6f2acc4f386$export$6d1a0317bde7de7f(ie,Z){ie&&reactDomExports.flushSync(()=>ie.dispatchEvent(Z))}function $fe963b355347cc68$export$3e6543de14f8614f(ie,Z){return reactExports.useReducer((ee,ae)=>Z[ee][ae]??ee,ie)}const $921a889cee6df7e8$export$99c2b779aa4e8b8b=ie=>{const{present:Z,children:ee}=ie,ae=$921a889cee6df7e8$var$usePresence(Z),ye=typeof ee=="function"?ee({present:ae.isPresent}):reactExports.Children.only(ee),ve=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(ae.ref,ye.ref);return typeof ee=="function"||ae.isPresent?reactExports.cloneElement(ye,{ref:ve}):null};$921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName="Presence";function $921a889cee6df7e8$var$usePresence(ie){const[Z,ee]=reactExports.useState(),ae=reactExports.useRef({}),ye=reactExports.useRef(ie),ve=reactExports.useRef("none"),be=ie?"mounted":"unmounted",[Ye,Ke]=$fe963b355347cc68$export$3e6543de14f8614f(be,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return reactExports.useEffect(()=>{const Xe=$921a889cee6df7e8$var$getAnimationName(ae.current);ve.current=Ye==="mounted"?Xe:"none"},[Ye]),$9f79659886946c16$export$e5c5a5f917a5871c(()=>{const Xe=ae.current,Je=ye.current;if(Je!==ie){const rt=ve.current,nt=$921a889cee6df7e8$var$getAnimationName(Xe);ie?Ke("MOUNT"):nt==="none"||(Xe==null?void 0:Xe.display)==="none"?Ke("UNMOUNT"):Ke(Je&&rt!==nt?"ANIMATION_OUT":"UNMOUNT"),ye.current=ie}},[ie,Ke]),$9f79659886946c16$export$e5c5a5f917a5871c(()=>{if(Z){const Xe=rt=>{const nt=$921a889cee6df7e8$var$getAnimationName(ae.current).includes(rt.animationName);rt.target===Z&&nt&&reactDomExports.flushSync(()=>Ke("ANIMATION_END"))},Je=rt=>{rt.target===Z&&(ve.current=$921a889cee6df7e8$var$getAnimationName(ae.current))};return Z.addEventListener("animationstart",Je),Z.addEventListener("animationcancel",Xe),Z.addEventListener("animationend",Xe),()=>{Z.removeEventListener("animationstart",Je),Z.removeEventListener("animationcancel",Xe),Z.removeEventListener("animationend",Xe)}}else Ke("ANIMATION_END")},[Z,Ke]),{isPresent:["mounted","unmountSuspended"].includes(Ye),ref:reactExports.useCallback(Xe=>{Xe&&(ae.current=getComputedStyle(Xe)),ee(Xe)},[])}}function $921a889cee6df7e8$var$getAnimationName(ie){return(ie==null?void 0:ie.animationName)||"none"}const $1746a345f3d73bb7$var$useReactId=$2AODx$react.useId||(()=>{});let $1746a345f3d73bb7$var$count=0;function $1746a345f3d73bb7$export$f680877a34711e37(ie){const[Z,ee]=reactExports.useState($1746a345f3d73bb7$var$useReactId());return $9f79659886946c16$export$e5c5a5f917a5871c(()=>{ie||ee(ae=>ae??String($1746a345f3d73bb7$var$count++))},[ie]),ie||(Z?`radix-${Z}`:"")}const $409067139f391064$var$COLLAPSIBLE_NAME="Collapsible",[$409067139f391064$var$createCollapsibleContext,$409067139f391064$export$952b32dcbe73087a]=$c512c27ab02ef895$export$50c7b4e9d9f19c1($409067139f391064$var$COLLAPSIBLE_NAME),[$409067139f391064$var$CollapsibleProvider,$409067139f391064$var$useCollapsibleContext]=$409067139f391064$var$createCollapsibleContext($409067139f391064$var$COLLAPSIBLE_NAME),$409067139f391064$export$6eb0f7ddcda6131f=reactExports.forwardRef((ie,Z)=>{const{__scopeCollapsible:ee,open:ae,defaultOpen:ye,disabled:ve,onOpenChange:be,...Ye}=ie,[Ke=!1,Xe]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:ae,defaultProp:ye,onChange:be});return reactExports.createElement($409067139f391064$var$CollapsibleProvider,{scope:ee,disabled:ve,contentId:$1746a345f3d73bb7$export$f680877a34711e37(),open:Ke,onOpenToggle:reactExports.useCallback(()=>Xe(Je=>!Je),[Xe])},reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({"data-state":$409067139f391064$var$getState(Ke),"data-disabled":ve?"":void 0},Ye,{ref:Z})))}),$409067139f391064$var$TRIGGER_NAME="CollapsibleTrigger",$409067139f391064$export$c135dce7b15bbbdc=reactExports.forwardRef((ie,Z)=>{const{__scopeCollapsible:ee,...ae}=ie,ye=$409067139f391064$var$useCollapsibleContext($409067139f391064$var$TRIGGER_NAME,ee);return reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button,_extends$1({type:"button","aria-controls":ye.contentId,"aria-expanded":ye.open||!1,"data-state":$409067139f391064$var$getState(ye.open),"data-disabled":ye.disabled?"":void 0,disabled:ye.disabled},ae,{ref:Z,onClick:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onClick,ye.onOpenToggle)}))}),$409067139f391064$var$CONTENT_NAME="CollapsibleContent",$409067139f391064$export$aadde00976f34151=reactExports.forwardRef((ie,Z)=>{const{forceMount:ee,...ae}=ie,ye=$409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME,ie.__scopeCollapsible);return reactExports.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b,{present:ee||ye.open},({present:ve})=>reactExports.createElement($409067139f391064$var$CollapsibleContentImpl,_extends$1({},ae,{ref:Z,present:ve})))}),$409067139f391064$var$CollapsibleContentImpl=reactExports.forwardRef((ie,Z)=>{const{__scopeCollapsible:ee,present:ae,children:ye,...ve}=ie,be=$409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME,ee),[Ye,Ke]=reactExports.useState(ae),Xe=reactExports.useRef(null),Je=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,Xe),rt=reactExports.useRef(0),nt=rt.current,it=reactExports.useRef(0),lt=it.current,ct=be.open||Ye,ot=reactExports.useRef(ct),dt=reactExports.useRef();return reactExports.useEffect(()=>{const ft=requestAnimationFrame(()=>ot.current=!1);return()=>cancelAnimationFrame(ft)},[]),$9f79659886946c16$export$e5c5a5f917a5871c(()=>{const ft=Xe.current;if(ft){dt.current=dt.current||{transitionDuration:ft.style.transitionDuration,animationName:ft.style.animationName},ft.style.transitionDuration="0s",ft.style.animationName="none";const gt=ft.getBoundingClientRect();rt.current=gt.height,it.current=gt.width,ot.current||(ft.style.transitionDuration=dt.current.transitionDuration,ft.style.animationName=dt.current.animationName),Ke(ae)}},[be.open,ae]),reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({"data-state":$409067139f391064$var$getState(be.open),"data-disabled":be.disabled?"":void 0,id:be.contentId,hidden:!ct},ve,{ref:Je,style:{"--radix-collapsible-content-height":nt?`${nt}px`:void 0,"--radix-collapsible-content-width":lt?`${lt}px`:void 0,...ie.style}}),ct&&ye)});function $409067139f391064$var$getState(ie){return ie?"open":"closed"}const $409067139f391064$export$be92b6f5f03c0fe9=$409067139f391064$export$6eb0f7ddcda6131f,$409067139f391064$export$41fb9f06171c75f4=$409067139f391064$export$c135dce7b15bbbdc,$409067139f391064$export$7c6e2c02157bb7d2=$409067139f391064$export$aadde00976f34151,ErrorBoundaryContext=reactExports.createContext(null),initialState={didCatch:!1,error:null};class ErrorBoundary extends reactExports.Component{constructor(Z){super(Z),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=initialState}static getDerivedStateFromError(Z){return{didCatch:!0,error:Z}}resetErrorBoundary(){const{error:Z}=this.state;if(Z!==null){for(var ee,ae,ye=arguments.length,ve=new Array(ye),be=0;be0&&arguments[0]!==void 0?arguments[0]:[],Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return ie.length!==Z.length||ie.some((ee,ae)=>!Object.is(ee,Z[ae]))}var e="colors",t="sizes",r="space",n={gap:r,gridGap:r,columnGap:r,gridColumnGap:r,rowGap:r,gridRowGap:r,inset:r,insetBlock:r,insetBlockEnd:r,insetBlockStart:r,insetInline:r,insetInlineEnd:r,insetInlineStart:r,margin:r,marginTop:r,marginRight:r,marginBottom:r,marginLeft:r,marginBlock:r,marginBlockEnd:r,marginBlockStart:r,marginInline:r,marginInlineEnd:r,marginInlineStart:r,padding:r,paddingTop:r,paddingRight:r,paddingBottom:r,paddingLeft:r,paddingBlock:r,paddingBlockEnd:r,paddingBlockStart:r,paddingInline:r,paddingInlineEnd:r,paddingInlineStart:r,top:r,right:r,bottom:r,left:r,scrollMargin:r,scrollMarginTop:r,scrollMarginRight:r,scrollMarginBottom:r,scrollMarginLeft:r,scrollMarginX:r,scrollMarginY:r,scrollMarginBlock:r,scrollMarginBlockEnd:r,scrollMarginBlockStart:r,scrollMarginInline:r,scrollMarginInlineEnd:r,scrollMarginInlineStart:r,scrollPadding:r,scrollPaddingTop:r,scrollPaddingRight:r,scrollPaddingBottom:r,scrollPaddingLeft:r,scrollPaddingX:r,scrollPaddingY:r,scrollPaddingBlock:r,scrollPaddingBlockEnd:r,scrollPaddingBlockStart:r,scrollPaddingInline:r,scrollPaddingInlineEnd:r,scrollPaddingInlineStart:r,fontSize:"fontSizes",background:e,backgroundColor:e,backgroundImage:e,borderImage:e,border:e,borderBlock:e,borderBlockEnd:e,borderBlockStart:e,borderBottom:e,borderBottomColor:e,borderColor:e,borderInline:e,borderInlineEnd:e,borderInlineStart:e,borderLeft:e,borderLeftColor:e,borderRight:e,borderRightColor:e,borderTop:e,borderTopColor:e,caretColor:e,color:e,columnRuleColor:e,fill:e,outline:e,outlineColor:e,stroke:e,textDecorationColor:e,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:t,minBlockSize:t,maxBlockSize:t,inlineSize:t,minInlineSize:t,maxInlineSize:t,width:t,minWidth:t,maxWidth:t,height:t,minHeight:t,maxHeight:t,flexBasis:t,gridTemplateColumns:t,gridTemplateRows:t,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},i=(ie,Z)=>typeof Z=="function"?{"()":Function.prototype.toString.call(Z)}:Z,o=()=>{const ie=Object.create(null);return(Z,ee,...ae)=>{const ye=(ve=>JSON.stringify(ve,i))(Z);return ye in ie?ie[ye]:ie[ye]=ee(Z,...ae)}},l=Symbol.for("sxs.internal"),s=(ie,Z)=>Object.defineProperties(ie,Object.getOwnPropertyDescriptors(Z)),a=ie=>{for(const Z in ie)return!0;return!1},{hasOwnProperty:c}=Object.prototype,d=ie=>ie.includes("-")?ie:ie.replace(/[A-Z]/g,Z=>"-"+Z.toLowerCase()),g=/\s+(?![^()]*\))/,p=ie=>Z=>ie(...typeof Z=="string"?String(Z).split(g):[Z]),u={appearance:ie=>({WebkitAppearance:ie,appearance:ie}),backfaceVisibility:ie=>({WebkitBackfaceVisibility:ie,backfaceVisibility:ie}),backdropFilter:ie=>({WebkitBackdropFilter:ie,backdropFilter:ie}),backgroundClip:ie=>({WebkitBackgroundClip:ie,backgroundClip:ie}),boxDecorationBreak:ie=>({WebkitBoxDecorationBreak:ie,boxDecorationBreak:ie}),clipPath:ie=>({WebkitClipPath:ie,clipPath:ie}),content:ie=>({content:ie.includes('"')||ie.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(ie)?ie:`"${ie}"`}),hyphens:ie=>({WebkitHyphens:ie,hyphens:ie}),maskImage:ie=>({WebkitMaskImage:ie,maskImage:ie}),maskSize:ie=>({WebkitMaskSize:ie,maskSize:ie}),tabSize:ie=>({MozTabSize:ie,tabSize:ie}),textSizeAdjust:ie=>({WebkitTextSizeAdjust:ie,textSizeAdjust:ie}),userSelect:ie=>({WebkitUserSelect:ie,userSelect:ie}),marginBlock:p((ie,Z)=>({marginBlockStart:ie,marginBlockEnd:Z||ie})),marginInline:p((ie,Z)=>({marginInlineStart:ie,marginInlineEnd:Z||ie})),maxSize:p((ie,Z)=>({maxBlockSize:ie,maxInlineSize:Z||ie})),minSize:p((ie,Z)=>({minBlockSize:ie,minInlineSize:Z||ie})),paddingBlock:p((ie,Z)=>({paddingBlockStart:ie,paddingBlockEnd:Z||ie})),paddingInline:p((ie,Z)=>({paddingInlineStart:ie,paddingInlineEnd:Z||ie}))},h=/([\d.]+)([^]*)/,f=(ie,Z)=>ie.length?ie.reduce((ee,ae)=>(ee.push(...Z.map(ye=>ye.includes("&")?ye.replace(/&/g,/[ +>|~]/.test(ae)&&/&.*&/.test(ye)?`:is(${ae})`:ae):ae+" "+ye)),ee),[]):Z,m$1=(ie,Z)=>ie in b&&typeof Z=="string"?Z.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(ee,ae,ye,ve)=>ae+(ye==="stretch"?`-moz-available${ve};${d(ie)}:${ae}-webkit-fill-available`:`-moz-fit-content${ve};${d(ie)}:${ae}fit-content`)+ve):String(Z),b={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},S$1=ie=>ie?ie+"-":"",k$1=(ie,Z,ee)=>ie.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(ae,ye,ve,be,Ye)=>be=="$"==!!ve?ae:(ye||be=="--"?"calc(":"")+"var(--"+(be==="$"?S$1(Z)+(Ye.includes("$")?"":S$1(ee))+Ye.replace(/\$/g,"-"):Ye)+")"+(ye||be=="--"?"*"+(ye||"")+(ve||"1")+")":"")),y=/\s*,\s*(?![^()]*\))/,B=Object.prototype.toString,$=(ie,Z,ee,ae,ye)=>{let ve,be,Ye;const Ke=(Xe,Je,rt)=>{let nt,it;const lt=ct=>{for(nt in ct){const ft=nt.charCodeAt(0)===64,gt=ft&&Array.isArray(ct[nt])?ct[nt]:[ct[nt]];for(it of gt){const mt=/[A-Z]/.test(dt=nt)?dt:dt.replace(/-[^]/g,Qr=>Qr[1].toUpperCase()),Yr=typeof it=="object"&&it&&it.toString===B&&(!ae.utils[mt]||!Je.length);if(mt in ae.utils&&!Yr){const Qr=ae.utils[mt];if(Qr!==be){be=Qr,lt(Qr(it)),be=null;continue}}else if(mt in u){const Qr=u[mt];if(Qr!==Ye){Ye=Qr,lt(Qr(it)),Ye=null;continue}}if(ft&&(ot=nt.slice(1)in ae.media?"@media "+ae.media[nt.slice(1)]:nt,nt=ot.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(Qr,Xr,Jr,ai,oi,ni)=>{const li=h.test(Xr),ui=.0625*(li?-1:1),[mi,ii]=li?[ai,Xr]:[Xr,ai];return"("+(Jr[0]==="="?"":Jr[0]===">"===li?"max-":"min-")+mi+":"+(Jr[0]!=="="&&Jr.length===1?ii.replace(h,(hi,ri,ci)=>Number(ri)+ui*(Jr===">"?1:-1)+ci):ii)+(oi?") and ("+(oi[0]===">"?"min-":"max-")+mi+":"+(oi.length===1?ni.replace(h,(hi,ri,ci)=>Number(ri)+ui*(oi===">"?-1:1)+ci):ni):"")+")"})),Yr){const Qr=ft?rt.concat(nt):[...rt],Xr=ft?[...Je]:f(Je,nt.split(y));ve!==void 0&&ye(x$1(...ve)),ve=void 0,Ke(it,Xr,Qr)}else ve===void 0&&(ve=[[],Je,rt]),nt=ft||nt.charCodeAt(0)!==36?nt:`--${S$1(ae.prefix)}${nt.slice(1).replace(/\$/g,"-")}`,it=Yr?it:typeof it=="number"?it&&mt in I?String(it)+"px":String(it):k$1(m$1(mt,it??""),ae.prefix,ae.themeMap[mt]),ve[0].push(`${ft?`${nt} `:`${d(nt)}:`}${it}`)}}var ot,dt};lt(Xe),ve!==void 0&&ye(x$1(...ve)),ve=void 0};Ke(ie,Z,ee)},x$1=(ie,Z,ee)=>`${ee.map(ae=>`${ae}{`).join("")}${Z.length?`${Z.join(",")}{`:""}${ie.join(";")}${Z.length?"}":""}${Array(ee.length?ee.length+1:0).join("}")}`,I={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},R$1=ie=>String.fromCharCode(ie+(ie>25?39:97)),z$1=ie=>(Z=>{let ee,ae="";for(ee=Math.abs(Z);ee>52;ee=ee/52|0)ae=R$1(ee%52)+ae;return R$1(ee%52)+ae})(((Z,ee)=>{let ae=ee.length;for(;ae;)Z=33*Z^ee.charCodeAt(--ae);return Z})(5381,JSON.stringify(ie))>>>0),W$1=["themed","global","styled","onevar","resonevar","allvar","inline"],j$1=ie=>{if(ie.href&&!ie.href.startsWith(location.origin))return!1;try{return!!ie.cssRules}catch{return!1}},E=ie=>{let Z;const ee=()=>{const{cssRules:ye}=Z.sheet;return[].map.call(ye,(ve,be)=>{const{cssText:Ye}=ve;let Ke="";if(Ye.startsWith("--sxs"))return"";if(ye[be-1]&&(Ke=ye[be-1].cssText).startsWith("--sxs")){if(!ve.cssRules.length)return"";for(const Xe in Z.rules)if(Z.rules[Xe].group===ve)return`--sxs{--sxs:${[...Z.rules[Xe].cache].join(" ")}}${Ye}`;return ve.cssRules.length?`${Ke}${Ye}`:""}return Ye}).join("")},ae=()=>{if(Z){const{rules:Ye,sheet:Ke}=Z;if(!Ke.deleteRule){for(;Object(Object(Ke.cssRules)[0]).type===3;)Ke.cssRules.splice(0,1);Ke.cssRules=[]}for(const Xe in Ye)delete Ye[Xe]}const ye=Object(ie).styleSheets||[];for(const Ye of ye)if(j$1(Ye)){for(let Ke=0,Xe=Ye.cssRules;Xe[Ke];++Ke){const Je=Object(Xe[Ke]);if(Je.type!==1)continue;const rt=Object(Xe[Ke+1]);if(rt.type!==4)continue;++Ke;const{cssText:nt}=Je;if(!nt.startsWith("--sxs"))continue;const it=nt.slice(14,-3).trim().split(/\s+/),lt=W$1[it[0]];lt&&(Z||(Z={sheet:Ye,reset:ae,rules:{},toString:ee}),Z.rules[lt]={group:rt,index:Ke,cache:new Set(it)})}if(Z)break}if(!Z){const Ye=(Ke,Xe)=>({type:Xe,cssRules:[],insertRule(Je,rt){this.cssRules.splice(rt,0,Ye(Je,{import:3,undefined:1}[(Je.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return Ke==="@media{}"?`@media{${[].map.call(this.cssRules,Je=>Je.cssText).join("")}}`:Ke}});Z={sheet:ie?(ie.head||ie).appendChild(document.createElement("style")).sheet:Ye("","text/css"),rules:{},reset:ae,toString:ee}}const{sheet:ve,rules:be}=Z;for(let Ye=W$1.length-1;Ye>=0;--Ye){const Ke=W$1[Ye];if(!be[Ke]){const Xe=W$1[Ye+1],Je=be[Xe]?be[Xe].index:ve.cssRules.length;ve.insertRule("@media{}",Je),ve.insertRule(`--sxs{--sxs:${Ye}}`,Je),be[Ke]={group:ve.cssRules[Je+1],index:Je,cache:new Set([Ye])}}v(be[Ke])}};return ae(),Z},v=ie=>{const Z=ie.group;let ee=Z.cssRules.length;ie.apply=ae=>{try{Z.insertRule(ae,ee),++ee}catch{}}},T$1=Symbol(),w=o(),M=(ie,Z)=>w(ie,()=>(...ee)=>{let ae={type:null,composers:new Set};for(const ye of ee)if(ye!=null)if(ye[l]){ae.type==null&&(ae.type=ye[l].type);for(const ve of ye[l].composers)ae.composers.add(ve)}else ye.constructor!==Object||ye.$$typeof?ae.type==null&&(ae.type=ye):ae.composers.add(C(ye,ie));return ae.type==null&&(ae.type="span"),ae.composers.size||ae.composers.add(["PJLV",{},[],[],{},[]]),P(ie,ae,Z)}),C=({variants:ie,compoundVariants:Z,defaultVariants:ee,...ae},ye)=>{const ve=`${S$1(ye.prefix)}c-${z$1(ae)}`,be=[],Ye=[],Ke=Object.create(null),Xe=[];for(const nt in ee)Ke[nt]=String(ee[nt]);if(typeof ie=="object"&&ie)for(const nt in ie){Je=Ke,rt=nt,c.call(Je,rt)||(Ke[nt]="undefined");const it=ie[nt];for(const lt in it){const ct={[nt]:String(lt)};String(lt)==="undefined"&&Xe.push(nt);const ot=it[lt],dt=[ct,ot,!a(ot)];be.push(dt)}}var Je,rt;if(typeof Z=="object"&&Z)for(const nt of Z){let{css:it,...lt}=nt;it=typeof it=="object"&&it||{};for(const ot in lt)lt[ot]=String(lt[ot]);const ct=[lt,it,!a(it)];Ye.push(ct)}return[ve,ae,be,Ye,Ke,Xe]},P=(ie,Z,ee)=>{const[ae,ye,ve,be]=L$1(Z.composers),Ye=typeof Z.type=="function"||Z.type.$$typeof?(rt=>{function nt(){for(let it=0;itnt.rules[it]={apply:lt=>nt[T$1].push([it,lt])}),nt})(ee):null,Ke=(Ye||ee).rules,Xe=`.${ae}${ye.length>1?`:where(.${ye.slice(1).join(".")})`:""}`,Je=rt=>{rt=typeof rt=="object"&&rt||A;const{css:nt,...it}=rt,lt={};for(const dt in ve)if(delete it[dt],dt in rt){let ft=rt[dt];typeof ft=="object"&&ft?lt[dt]={"@initial":ve[dt],...ft}:(ft=String(ft),lt[dt]=ft!=="undefined"||be.has(dt)?ft:ve[dt])}else lt[dt]=ve[dt];const ct=new Set([...ye]);for(const[dt,ft,gt,mt]of Z.composers){ee.rules.styled.cache.has(dt)||(ee.rules.styled.cache.add(dt),$(ft,[`.${dt}`],[],ie,Xr=>{Ke.styled.apply(Xr)}));const Yr=O$1(gt,lt,ie.media),Qr=O$1(mt,lt,ie.media,!0);for(const Xr of Yr)if(Xr!==void 0)for(const[Jr,ai,oi]of Xr){const ni=`${dt}-${z$1(ai)}-${Jr}`;ct.add(ni);const li=(oi?ee.rules.resonevar:ee.rules.onevar).cache,ui=oi?Ke.resonevar:Ke.onevar;li.has(ni)||(li.add(ni),$(ai,[`.${ni}`],[],ie,mi=>{ui.apply(mi)}))}for(const Xr of Qr)if(Xr!==void 0)for(const[Jr,ai]of Xr){const oi=`${dt}-${z$1(ai)}-${Jr}`;ct.add(oi),ee.rules.allvar.cache.has(oi)||(ee.rules.allvar.cache.add(oi),$(ai,[`.${oi}`],[],ie,ni=>{Ke.allvar.apply(ni)}))}}if(typeof nt=="object"&&nt){const dt=`${ae}-i${z$1(nt)}-css`;ct.add(dt),ee.rules.inline.cache.has(dt)||(ee.rules.inline.cache.add(dt),$(nt,[`.${dt}`],[],ie,ft=>{Ke.inline.apply(ft)}))}for(const dt of String(rt.className||"").trim().split(/\s+/))dt&&ct.add(dt);const ot=it.className=[...ct].join(" ");return{type:Z.type,className:ot,selector:Xe,props:it,toString:()=>ot,deferredInjector:Ye}};return s(Je,{className:ae,selector:Xe,[l]:Z,toString:()=>(ee.rules.styled.cache.has(ae)||Je(),ae)})},L$1=ie=>{let Z="";const ee=[],ae={},ye=[];for(const[ve,,,,be,Ye]of ie){Z===""&&(Z=ve),ee.push(ve),ye.push(...Ye);for(const Ke in be){const Xe=be[Ke];(ae[Ke]===void 0||Xe!=="undefined"||Ye.includes(Xe))&&(ae[Ke]=Xe)}}return[Z,ee,ae,new Set(ye)]},O$1=(ie,Z,ee,ae)=>{const ye=[];e:for(let[ve,be,Ye]of ie){if(Ye)continue;let Ke,Xe=0,Je=!1;for(Ke in ve){const rt=ve[Ke];let nt=Z[Ke];if(nt!==rt){if(typeof nt!="object"||!nt)continue e;{let it,lt,ct=0;for(const ot in nt){if(rt===String(nt[ot])){if(ot!=="@initial"){const dt=ot.slice(1);(lt=lt||[]).push(dt in ee?ee[dt]:ot.replace(/^@media ?/,"")),Je=!0}Xe+=ct,it=!0}++ct}if(lt&<.length&&(be={["@media "+lt.join(", ")]:be}),!it)continue e}}}(ye[Xe]=ye[Xe]||[]).push([ae?"cv":`${Ke}-${ve[Ke]}`,be,Je])}return ye},A={},N$1=o(),D$1=(ie,Z)=>N$1(ie,()=>(...ee)=>{const ae=()=>{for(let ye of ee){ye=typeof ye=="object"&&ye||{};let ve=z$1(ye);if(!Z.rules.global.cache.has(ve)){if(Z.rules.global.cache.add(ve),"@import"in ye){let be=[].indexOf.call(Z.sheet.cssRules,Z.rules.themed.group)-1;for(let Ye of[].concat(ye["@import"]))Ye=Ye.includes('"')||Ye.includes("'")?Ye:`"${Ye}"`,Z.sheet.insertRule(`@import ${Ye};`,be++);delete ye["@import"]}$(ye,[],[],ie,be=>{Z.rules.global.apply(be)})}}return""};return s(ae,{toString:ae})}),H=o(),V=(ie,Z)=>H(ie,()=>ee=>{const ae=`${S$1(ie.prefix)}k-${z$1(ee)}`,ye=()=>{if(!Z.rules.global.cache.has(ae)){Z.rules.global.cache.add(ae);const ve=[];$(ee,[],[],ie,Ye=>ve.push(Ye));const be=`@keyframes ${ae}{${ve.join("")}}`;Z.rules.global.apply(be)}return ae};return s(ye,{get name(){return ye()},toString:ye})}),G=class{constructor(ie,Z,ee,ae){this.token=ie==null?"":String(ie),this.value=Z==null?"":String(Z),this.scale=ee==null?"":String(ee),this.prefix=ae==null?"":String(ae)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+S$1(this.prefix)+S$1(this.scale)+this.token}toString(){return this.computedValue}},F=o(),J$1=(ie,Z)=>F(ie,()=>(ee,ae)=>{ae=typeof ee=="object"&&ee||Object(ae);const ye=`.${ee=(ee=typeof ee=="string"?ee:"")||`${S$1(ie.prefix)}t-${z$1(ae)}`}`,ve={},be=[];for(const Ke in ae){ve[Ke]={};for(const Xe in ae[Ke]){const Je=`--${S$1(ie.prefix)}${Ke}-${Xe}`,rt=k$1(String(ae[Ke][Xe]),ie.prefix,Ke);ve[Ke][Xe]=new G(Xe,rt,Ke,ie.prefix),be.push(`${Je}:${rt}`)}}const Ye=()=>{if(be.length&&!Z.rules.themed.cache.has(ee)){Z.rules.themed.cache.add(ee);const Ke=`${ae===ie.theme?":root,":""}.${ee}{${be.join(";")}}`;Z.rules.themed.apply(Ke)}return ee};return{...ve,get className(){return Ye()},selector:ye,toString:Ye}}),U=o(),X$1,Y$1=o(),q=ie=>{const Z=(ee=>{let ae=!1;const ye=U(ee,ve=>{ae=!0;const be="prefix"in(ve=typeof ve=="object"&&ve||{})?String(ve.prefix):"",Ye=typeof ve.media=="object"&&ve.media||{},Ke=typeof ve.root=="object"?ve.root||null:globalThis.document||null,Xe=typeof ve.theme=="object"&&ve.theme||{},Je={prefix:be,media:Ye,theme:Xe,themeMap:typeof ve.themeMap=="object"&&ve.themeMap||{...n},utils:typeof ve.utils=="object"&&ve.utils||{}},rt=E(Ke),nt={css:M(Je,rt),globalCss:D$1(Je,rt),keyframes:V(Je,rt),createTheme:J$1(Je,rt),reset(){rt.reset(),nt.theme.toString()},theme:{},sheet:rt,config:Je,prefix:be,getCssText:rt.toString,toString:rt.toString};return String(nt.theme=nt.createTheme(Xe)),nt});return ae||ye.reset(),ye})(ie);return Z.styled=(({config:ee,sheet:ae})=>Y$1(ee,()=>{const ye=M(ee,ae);return(...ve)=>{const be=ye(...ve),Ye=be[l].type,Ke=e$1.forwardRef((Xe,Je)=>{const rt=Xe&&Xe.as||Ye,{props:nt,deferredInjector:it}=be(Xe);return delete nt.as,nt.ref=Je,it?e$1.createElement(e$1.Fragment,null,e$1.createElement(rt,nt),e$1.createElement(it,null)):e$1.createElement(rt,nt)});return Ke.className=be.className,Ke.displayName=`Styled.${Ye.displayName||Ye.name||Ye}`,Ke.selector=be.selector,Ke.toString=()=>be.selector,Ke[l]=be[l],Ke}}))(Z),Z},K$1=()=>X$1||(X$1=q()),Q$1=(...ie)=>K$1().createTheme(...ie);function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(ie){const Z=ie+"CollectionProvider",[ee,ae]=$c512c27ab02ef895$export$50c7b4e9d9f19c1(Z),[ye,ve]=ee(Z,{collectionRef:{current:null},itemMap:new Map}),be=it=>{const{scope:lt,children:ct}=it,ot=e$1.useRef(null),dt=e$1.useRef(new Map).current;return e$1.createElement(ye,{scope:lt,itemMap:dt,collectionRef:ot},ct)},Ye=ie+"CollectionSlot",Ke=e$1.forwardRef((it,lt)=>{const{scope:ct,children:ot}=it,dt=ve(Ye,ct),ft=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(lt,dt.collectionRef);return e$1.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360,{ref:ft},ot)}),Xe=ie+"CollectionItemSlot",Je="data-radix-collection-item",rt=e$1.forwardRef((it,lt)=>{const{scope:ct,children:ot,...dt}=it,ft=e$1.useRef(null),gt=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(lt,ft),mt=ve(Xe,ct);return e$1.useEffect(()=>(mt.itemMap.set(ft,{ref:ft,...dt}),()=>void mt.itemMap.delete(ft))),e$1.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360,{[Je]:"",ref:gt},ot)});function nt(it){const lt=ve(ie+"CollectionConsumer",it);return e$1.useCallback(()=>{const ct=lt.collectionRef.current;if(!ct)return[];const ot=Array.from(ct.querySelectorAll(`[${Je}]`));return Array.from(lt.itemMap.values()).sort((dt,ft)=>ot.indexOf(dt.ref.current)-ot.indexOf(ft.ref.current))},[lt.collectionRef,lt.itemMap])}return[{Provider:be,Slot:Ke,ItemSlot:rt},nt,ae]}const $f631663db3294ace$var$DirectionContext=reactExports.createContext(void 0);function $f631663db3294ace$export$b39126d51d94e6f3(ie){const Z=reactExports.useContext($f631663db3294ace$var$DirectionContext);return ie||Z||"ltr"}const $d7bdfb9eb0fdf311$var$ENTRY_FOCUS="rovingFocusGroup.onEntryFocus",$d7bdfb9eb0fdf311$var$EVENT_OPTIONS={bubbles:!1,cancelable:!0},$d7bdfb9eb0fdf311$var$GROUP_NAME="RovingFocusGroup",[$d7bdfb9eb0fdf311$var$Collection,$d7bdfb9eb0fdf311$var$useCollection,$d7bdfb9eb0fdf311$var$createCollectionScope]=$e02a7d9cb1dc128c$export$c74125a8e3af6bb2($d7bdfb9eb0fdf311$var$GROUP_NAME),[$d7bdfb9eb0fdf311$var$createRovingFocusGroupContext,$d7bdfb9eb0fdf311$export$c7109489551a4f4]=$c512c27ab02ef895$export$50c7b4e9d9f19c1($d7bdfb9eb0fdf311$var$GROUP_NAME,[$d7bdfb9eb0fdf311$var$createCollectionScope]),[$d7bdfb9eb0fdf311$var$RovingFocusProvider,$d7bdfb9eb0fdf311$var$useRovingFocusContext]=$d7bdfb9eb0fdf311$var$createRovingFocusGroupContext($d7bdfb9eb0fdf311$var$GROUP_NAME),$d7bdfb9eb0fdf311$export$8699f7c8af148338=reactExports.forwardRef((ie,Z)=>reactExports.createElement($d7bdfb9eb0fdf311$var$Collection.Provider,{scope:ie.__scopeRovingFocusGroup},reactExports.createElement($d7bdfb9eb0fdf311$var$Collection.Slot,{scope:ie.__scopeRovingFocusGroup},reactExports.createElement($d7bdfb9eb0fdf311$var$RovingFocusGroupImpl,_extends$1({},ie,{ref:Z}))))),$d7bdfb9eb0fdf311$var$RovingFocusGroupImpl=reactExports.forwardRef((ie,Z)=>{const{__scopeRovingFocusGroup:ee,orientation:ae,loop:ye=!1,dir:ve,currentTabStopId:be,defaultCurrentTabStopId:Ye,onCurrentTabStopIdChange:Ke,onEntryFocus:Xe,...Je}=ie,rt=reactExports.useRef(null),nt=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,rt),it=$f631663db3294ace$export$b39126d51d94e6f3(ve),[lt=null,ct]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:be,defaultProp:Ye,onChange:Ke}),[ot,dt]=reactExports.useState(!1),ft=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(Xe),gt=$d7bdfb9eb0fdf311$var$useCollection(ee),mt=reactExports.useRef(!1),[Yr,Qr]=reactExports.useState(0);return reactExports.useEffect(()=>{const Xr=rt.current;if(Xr)return Xr.addEventListener($d7bdfb9eb0fdf311$var$ENTRY_FOCUS,ft),()=>Xr.removeEventListener($d7bdfb9eb0fdf311$var$ENTRY_FOCUS,ft)},[ft]),reactExports.createElement($d7bdfb9eb0fdf311$var$RovingFocusProvider,{scope:ee,orientation:ae,dir:it,loop:ye,currentTabStopId:lt,onItemFocus:reactExports.useCallback(Xr=>ct(Xr),[ct]),onItemShiftTab:reactExports.useCallback(()=>dt(!0),[]),onFocusableItemAdd:reactExports.useCallback(()=>Qr(Xr=>Xr+1),[]),onFocusableItemRemove:reactExports.useCallback(()=>Qr(Xr=>Xr-1),[])},reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({tabIndex:ot||Yr===0?-1:0,"data-orientation":ae},Je,{ref:nt,style:{outline:"none",...ie.style},onMouseDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onMouseDown,()=>{mt.current=!0}),onFocus:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onFocus,Xr=>{const Jr=!mt.current;if(Xr.target===Xr.currentTarget&&Jr&&!ot){const ai=new CustomEvent($d7bdfb9eb0fdf311$var$ENTRY_FOCUS,$d7bdfb9eb0fdf311$var$EVENT_OPTIONS);if(Xr.currentTarget.dispatchEvent(ai),!ai.defaultPrevented){const oi=gt().filter(mi=>mi.focusable),ni=oi.find(mi=>mi.active),li=oi.find(mi=>mi.id===lt),ui=[ni,li,...oi].filter(Boolean).map(mi=>mi.ref.current);$d7bdfb9eb0fdf311$var$focusFirst(ui)}}mt.current=!1}),onBlur:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onBlur,()=>dt(!1))})))}),$d7bdfb9eb0fdf311$var$ITEM_NAME="RovingFocusGroupItem",$d7bdfb9eb0fdf311$export$ab9df7c53fe8454=reactExports.forwardRef((ie,Z)=>{const{__scopeRovingFocusGroup:ee,focusable:ae=!0,active:ye=!1,tabStopId:ve,...be}=ie,Ye=$1746a345f3d73bb7$export$f680877a34711e37(),Ke=ve||Ye,Xe=$d7bdfb9eb0fdf311$var$useRovingFocusContext($d7bdfb9eb0fdf311$var$ITEM_NAME,ee),Je=Xe.currentTabStopId===Ke,rt=$d7bdfb9eb0fdf311$var$useCollection(ee),{onFocusableItemAdd:nt,onFocusableItemRemove:it}=Xe;return reactExports.useEffect(()=>{if(ae)return nt(),()=>it()},[ae,nt,it]),reactExports.createElement($d7bdfb9eb0fdf311$var$Collection.ItemSlot,{scope:ee,id:Ke,focusable:ae,active:ye},reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span,_extends$1({tabIndex:Je?0:-1,"data-orientation":Xe.orientation},be,{ref:Z,onMouseDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onMouseDown,lt=>{ae?Xe.onItemFocus(Ke):lt.preventDefault()}),onFocus:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onFocus,()=>Xe.onItemFocus(Ke)),onKeyDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onKeyDown,lt=>{if(lt.key==="Tab"&<.shiftKey){Xe.onItemShiftTab();return}if(lt.target!==lt.currentTarget)return;const ct=$d7bdfb9eb0fdf311$var$getFocusIntent(lt,Xe.orientation,Xe.dir);if(ct!==void 0){lt.preventDefault();let ot=rt().filter(dt=>dt.focusable).map(dt=>dt.ref.current);if(ct==="last")ot.reverse();else if(ct==="prev"||ct==="next"){ct==="prev"&&ot.reverse();const dt=ot.indexOf(lt.currentTarget);ot=Xe.loop?$d7bdfb9eb0fdf311$var$wrapArray(ot,dt+1):ot.slice(dt+1)}setTimeout(()=>$d7bdfb9eb0fdf311$var$focusFirst(ot))}})})))}),$d7bdfb9eb0fdf311$var$MAP_KEY_TO_FOCUS_INTENT={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function $d7bdfb9eb0fdf311$var$getDirectionAwareKey(ie,Z){return Z!=="rtl"?ie:ie==="ArrowLeft"?"ArrowRight":ie==="ArrowRight"?"ArrowLeft":ie}function $d7bdfb9eb0fdf311$var$getFocusIntent(ie,Z,ee){const ae=$d7bdfb9eb0fdf311$var$getDirectionAwareKey(ie.key,ee);if(!(Z==="vertical"&&["ArrowLeft","ArrowRight"].includes(ae))&&!(Z==="horizontal"&&["ArrowUp","ArrowDown"].includes(ae)))return $d7bdfb9eb0fdf311$var$MAP_KEY_TO_FOCUS_INTENT[ae]}function $d7bdfb9eb0fdf311$var$focusFirst(ie){const Z=document.activeElement;for(const ee of ie)if(ee===Z||(ee.focus(),document.activeElement!==Z))return}function $d7bdfb9eb0fdf311$var$wrapArray(ie,Z){return ie.map((ee,ae)=>ie[(Z+ae)%ie.length])}const $d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9=$d7bdfb9eb0fdf311$export$8699f7c8af148338,$d7bdfb9eb0fdf311$export$6d08773d2e66f8f2=$d7bdfb9eb0fdf311$export$ab9df7c53fe8454,$69cb30bb0017df05$var$TABS_NAME="Tabs",[$69cb30bb0017df05$var$createTabsContext,$69cb30bb0017df05$export$355f5bd209d7b13a]=$c512c27ab02ef895$export$50c7b4e9d9f19c1($69cb30bb0017df05$var$TABS_NAME,[$d7bdfb9eb0fdf311$export$c7109489551a4f4]),$69cb30bb0017df05$var$useRovingFocusGroupScope=$d7bdfb9eb0fdf311$export$c7109489551a4f4(),[$69cb30bb0017df05$var$TabsProvider,$69cb30bb0017df05$var$useTabsContext]=$69cb30bb0017df05$var$createTabsContext($69cb30bb0017df05$var$TABS_NAME),$69cb30bb0017df05$export$b2539bed5023c21c=reactExports.forwardRef((ie,Z)=>{const{__scopeTabs:ee,value:ae,onValueChange:ye,defaultValue:ve,orientation:be="horizontal",dir:Ye,activationMode:Ke="automatic",...Xe}=ie,Je=$f631663db3294ace$export$b39126d51d94e6f3(Ye),[rt,nt]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:ae,onChange:ye,defaultProp:ve});return reactExports.createElement($69cb30bb0017df05$var$TabsProvider,{scope:ee,baseId:$1746a345f3d73bb7$export$f680877a34711e37(),value:rt,onValueChange:nt,orientation:be,dir:Je,activationMode:Ke},reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({dir:Je,"data-orientation":be},Xe,{ref:Z})))}),$69cb30bb0017df05$var$TAB_LIST_NAME="TabsList",$69cb30bb0017df05$export$9712d22edc0d78c1=reactExports.forwardRef((ie,Z)=>{const{__scopeTabs:ee,loop:ae=!0,...ye}=ie,ve=$69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$TAB_LIST_NAME,ee),be=$69cb30bb0017df05$var$useRovingFocusGroupScope(ee);return reactExports.createElement($d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9,_extends$1({asChild:!0},be,{orientation:ve.orientation,dir:ve.dir,loop:ae}),reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({role:"tablist","aria-orientation":ve.orientation},ye,{ref:Z})))}),$69cb30bb0017df05$var$TRIGGER_NAME="TabsTrigger",$69cb30bb0017df05$export$8114b9fdfdf9f3ba=reactExports.forwardRef((ie,Z)=>{const{__scopeTabs:ee,value:ae,disabled:ye=!1,...ve}=ie,be=$69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$TRIGGER_NAME,ee),Ye=$69cb30bb0017df05$var$useRovingFocusGroupScope(ee),Ke=$69cb30bb0017df05$var$makeTriggerId(be.baseId,ae),Xe=$69cb30bb0017df05$var$makeContentId(be.baseId,ae),Je=ae===be.value;return reactExports.createElement($d7bdfb9eb0fdf311$export$6d08773d2e66f8f2,_extends$1({asChild:!0},Ye,{focusable:!ye,active:Je}),reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button,_extends$1({type:"button",role:"tab","aria-selected":Je,"aria-controls":Xe,"data-state":Je?"active":"inactive","data-disabled":ye?"":void 0,disabled:ye,id:Ke},ve,{ref:Z,onMouseDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onMouseDown,rt=>{!ye&&rt.button===0&&rt.ctrlKey===!1?be.onValueChange(ae):rt.preventDefault()}),onKeyDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onKeyDown,rt=>{[" ","Enter"].includes(rt.key)&&be.onValueChange(ae)}),onFocus:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onFocus,()=>{const rt=be.activationMode!=="manual";!Je&&!ye&&rt&&be.onValueChange(ae)})})))}),$69cb30bb0017df05$var$CONTENT_NAME="TabsContent",$69cb30bb0017df05$export$bd905d70e8fd2ebb=reactExports.forwardRef((ie,Z)=>{const{__scopeTabs:ee,value:ae,forceMount:ye,children:ve,...be}=ie,Ye=$69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$CONTENT_NAME,ee),Ke=$69cb30bb0017df05$var$makeTriggerId(Ye.baseId,ae),Xe=$69cb30bb0017df05$var$makeContentId(Ye.baseId,ae),Je=ae===Ye.value,rt=reactExports.useRef(Je);return reactExports.useEffect(()=>{const nt=requestAnimationFrame(()=>rt.current=!1);return()=>cancelAnimationFrame(nt)},[]),reactExports.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b,{present:ye||Je},({present:nt})=>reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({"data-state":Je?"active":"inactive","data-orientation":Ye.orientation,role:"tabpanel","aria-labelledby":Ke,hidden:!nt,id:Xe,tabIndex:0},be,{ref:Z,style:{...ie.style,animationDuration:rt.current?"0s":void 0}}),nt&&ve))});function $69cb30bb0017df05$var$makeTriggerId(ie,Z){return`${ie}-trigger-${Z}`}function $69cb30bb0017df05$var$makeContentId(ie,Z){return`${ie}-content-${Z}`}const $69cb30bb0017df05$export$be92b6f5f03c0fe9=$69cb30bb0017df05$export$b2539bed5023c21c,$69cb30bb0017df05$export$54c2e3dc7acea9f5=$69cb30bb0017df05$export$9712d22edc0d78c1,$69cb30bb0017df05$export$41fb9f06171c75f4=$69cb30bb0017df05$export$8114b9fdfdf9f3ba,$69cb30bb0017df05$export$7c6e2c02157bb7d2=$69cb30bb0017df05$export$bd905d70e8fd2ebb;var lib$5={},Parser$3={},Tokenizer={},decode={},decodeDataHtml={};Object.defineProperty(decodeDataHtml,"__esModule",{value:!0});decodeDataHtml.default=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(function(ie){return ie.charCodeAt(0)}));var decodeDataXml={};Object.defineProperty(decodeDataXml,"__esModule",{value:!0});decodeDataXml.default=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(function(ie){return ie.charCodeAt(0)}));var decode_codepoint={};(function(ie){var Z;Object.defineProperty(ie,"__esModule",{value:!0}),ie.replaceCodePoint=ie.fromCodePoint=void 0;var ee=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);ie.fromCodePoint=(Z=String.fromCodePoint)!==null&&Z!==void 0?Z:function(ve){var be="";return ve>65535&&(ve-=65536,be+=String.fromCharCode(ve>>>10&1023|55296),ve=56320|ve&1023),be+=String.fromCharCode(ve),be};function ae(ve){var be;return ve>=55296&&ve<=57343||ve>1114111?65533:(be=ee.get(ve))!==null&&be!==void 0?be:ve}ie.replaceCodePoint=ae;function ye(ve){return(0,ie.fromCodePoint)(ae(ve))}ie.default=ye})(decode_codepoint);(function(ie){var Z=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(ni,li,ui,mi){mi===void 0&&(mi=ui);var ii=Object.getOwnPropertyDescriptor(li,ui);(!ii||("get"in ii?!li.__esModule:ii.writable||ii.configurable))&&(ii={enumerable:!0,get:function(){return li[ui]}}),Object.defineProperty(ni,mi,ii)}:function(ni,li,ui,mi){mi===void 0&&(mi=ui),ni[mi]=li[ui]}),ee=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(ni,li){Object.defineProperty(ni,"default",{enumerable:!0,value:li})}:function(ni,li){ni.default=li}),ae=commonjsGlobal&&commonjsGlobal.__importStar||function(ni){if(ni&&ni.__esModule)return ni;var li={};if(ni!=null)for(var ui in ni)ui!=="default"&&Object.prototype.hasOwnProperty.call(ni,ui)&&Z(li,ni,ui);return ee(li,ni),li},ye=commonjsGlobal&&commonjsGlobal.__importDefault||function(ni){return ni&&ni.__esModule?ni:{default:ni}};Object.defineProperty(ie,"__esModule",{value:!0}),ie.decodeXML=ie.decodeHTMLStrict=ie.decodeHTMLAttribute=ie.decodeHTML=ie.determineBranch=ie.EntityDecoder=ie.DecodingMode=ie.BinTrieFlags=ie.fromCodePoint=ie.replaceCodePoint=ie.decodeCodePoint=ie.xmlDecodeTree=ie.htmlDecodeTree=void 0;var ve=ye(decodeDataHtml);ie.htmlDecodeTree=ve.default;var be=ye(decodeDataXml);ie.xmlDecodeTree=be.default;var Ye=ae(decode_codepoint);ie.decodeCodePoint=Ye.default;var Ke=decode_codepoint;Object.defineProperty(ie,"replaceCodePoint",{enumerable:!0,get:function(){return Ke.replaceCodePoint}}),Object.defineProperty(ie,"fromCodePoint",{enumerable:!0,get:function(){return Ke.fromCodePoint}});var Xe;(function(ni){ni[ni.NUM=35]="NUM",ni[ni.SEMI=59]="SEMI",ni[ni.EQUALS=61]="EQUALS",ni[ni.ZERO=48]="ZERO",ni[ni.NINE=57]="NINE",ni[ni.LOWER_A=97]="LOWER_A",ni[ni.LOWER_F=102]="LOWER_F",ni[ni.LOWER_X=120]="LOWER_X",ni[ni.LOWER_Z=122]="LOWER_Z",ni[ni.UPPER_A=65]="UPPER_A",ni[ni.UPPER_F=70]="UPPER_F",ni[ni.UPPER_Z=90]="UPPER_Z"})(Xe||(Xe={}));var Je=32,rt;(function(ni){ni[ni.VALUE_LENGTH=49152]="VALUE_LENGTH",ni[ni.BRANCH_LENGTH=16256]="BRANCH_LENGTH",ni[ni.JUMP_TABLE=127]="JUMP_TABLE"})(rt=ie.BinTrieFlags||(ie.BinTrieFlags={}));function nt(ni){return ni>=Xe.ZERO&&ni<=Xe.NINE}function it(ni){return ni>=Xe.UPPER_A&&ni<=Xe.UPPER_F||ni>=Xe.LOWER_A&&ni<=Xe.LOWER_F}function lt(ni){return ni>=Xe.UPPER_A&&ni<=Xe.UPPER_Z||ni>=Xe.LOWER_A&&ni<=Xe.LOWER_Z||nt(ni)}function ct(ni){return ni===Xe.EQUALS||lt(ni)}var ot;(function(ni){ni[ni.EntityStart=0]="EntityStart",ni[ni.NumericStart=1]="NumericStart",ni[ni.NumericDecimal=2]="NumericDecimal",ni[ni.NumericHex=3]="NumericHex",ni[ni.NamedEntity=4]="NamedEntity"})(ot||(ot={}));var dt;(function(ni){ni[ni.Legacy=0]="Legacy",ni[ni.Strict=1]="Strict",ni[ni.Attribute=2]="Attribute"})(dt=ie.DecodingMode||(ie.DecodingMode={}));var ft=function(){function ni(li,ui,mi){this.decodeTree=li,this.emitCodePoint=ui,this.errors=mi,this.state=ot.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=dt.Strict}return ni.prototype.startEntity=function(li){this.decodeMode=li,this.state=ot.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1},ni.prototype.write=function(li,ui){switch(this.state){case ot.EntityStart:return li.charCodeAt(ui)===Xe.NUM?(this.state=ot.NumericStart,this.consumed+=1,this.stateNumericStart(li,ui+1)):(this.state=ot.NamedEntity,this.stateNamedEntity(li,ui));case ot.NumericStart:return this.stateNumericStart(li,ui);case ot.NumericDecimal:return this.stateNumericDecimal(li,ui);case ot.NumericHex:return this.stateNumericHex(li,ui);case ot.NamedEntity:return this.stateNamedEntity(li,ui)}},ni.prototype.stateNumericStart=function(li,ui){return ui>=li.length?-1:(li.charCodeAt(ui)|Je)===Xe.LOWER_X?(this.state=ot.NumericHex,this.consumed+=1,this.stateNumericHex(li,ui+1)):(this.state=ot.NumericDecimal,this.stateNumericDecimal(li,ui))},ni.prototype.addToNumericResult=function(li,ui,mi,ii){if(ui!==mi){var hi=mi-ui;this.result=this.result*Math.pow(ii,hi)+parseInt(li.substr(ui,hi),ii),this.consumed+=hi}},ni.prototype.stateNumericHex=function(li,ui){for(var mi=ui;ui>14;ui>14,hi!==0){if(ri===Xe.SEMI)return this.emitNamedEntityData(this.treeIndex,hi,this.consumed+this.excess);this.decodeMode!==dt.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1},ni.prototype.emitNotTerminatedNamedEntity=function(){var li,ui=this,mi=ui.result,ii=ui.decodeTree,hi=(ii[mi]&rt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(mi,hi,this.consumed),(li=this.errors)===null||li===void 0||li.missingSemicolonAfterCharacterReference(),this.consumed},ni.prototype.emitNamedEntityData=function(li,ui,mi){var ii=this.decodeTree;return this.emitCodePoint(ui===1?ii[li]&~rt.VALUE_LENGTH:ii[li+1],mi),ui===3&&this.emitCodePoint(ii[li+2],mi),mi},ni.prototype.end=function(){var li;switch(this.state){case ot.NamedEntity:return this.result!==0&&(this.decodeMode!==dt.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ot.NumericDecimal:return this.emitNumericEntity(0,2);case ot.NumericHex:return this.emitNumericEntity(0,3);case ot.NumericStart:return(li=this.errors)===null||li===void 0||li.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ot.EntityStart:return 0}},ni}();ie.EntityDecoder=ft;function gt(ni){var li="",ui=new ft(ni,function(mi){return li+=(0,Ye.fromCodePoint)(mi)});return function(mi,ii){for(var hi=0,ri=0;(ri=mi.indexOf("&",ri))>=0;){li+=mi.slice(hi,ri),ui.startEntity(ii);var ci=ui.write(mi,ri+1);if(ci<0){hi=ri+ui.end();break}hi=ri+ci,ri=ci===0?hi+1:hi}var Si=li+mi.slice(hi);return li="",Si}}function mt(ni,li,ui,mi){var ii=(li&rt.BRANCH_LENGTH)>>7,hi=li&rt.JUMP_TABLE;if(ii===0)return hi!==0&&mi===hi?ui:-1;if(hi){var ri=mi-hi;return ri<0||ri>=ii?-1:ni[ui+ri]-1}for(var ci=ui,Si=ci+ii-1;ci<=Si;){var si=ci+Si>>>1,Ei=ni[si];if(Eimi)Si=si-1;else return ni[si+ii]}return-1}ie.determineBranch=mt;var Yr=gt(ve.default),Qr=gt(be.default);function Xr(ni,li){return li===void 0&&(li=dt.Legacy),Yr(ni,li)}ie.decodeHTML=Xr;function Jr(ni){return Yr(ni,dt.Attribute)}ie.decodeHTMLAttribute=Jr;function ai(ni){return Yr(ni,dt.Strict)}ie.decodeHTMLStrict=ai;function oi(ni){return Qr(ni,dt.Strict)}ie.decodeXML=oi})(decode);(function(ie){Object.defineProperty(ie,"__esModule",{value:!0}),ie.QuoteType=void 0;var Z=decode,ee;(function(nt){nt[nt.Tab=9]="Tab",nt[nt.NewLine=10]="NewLine",nt[nt.FormFeed=12]="FormFeed",nt[nt.CarriageReturn=13]="CarriageReturn",nt[nt.Space=32]="Space",nt[nt.ExclamationMark=33]="ExclamationMark",nt[nt.Number=35]="Number",nt[nt.Amp=38]="Amp",nt[nt.SingleQuote=39]="SingleQuote",nt[nt.DoubleQuote=34]="DoubleQuote",nt[nt.Dash=45]="Dash",nt[nt.Slash=47]="Slash",nt[nt.Zero=48]="Zero",nt[nt.Nine=57]="Nine",nt[nt.Semi=59]="Semi",nt[nt.Lt=60]="Lt",nt[nt.Eq=61]="Eq",nt[nt.Gt=62]="Gt",nt[nt.Questionmark=63]="Questionmark",nt[nt.UpperA=65]="UpperA",nt[nt.LowerA=97]="LowerA",nt[nt.UpperF=70]="UpperF",nt[nt.LowerF=102]="LowerF",nt[nt.UpperZ=90]="UpperZ",nt[nt.LowerZ=122]="LowerZ",nt[nt.LowerX=120]="LowerX",nt[nt.OpeningSquareBracket=91]="OpeningSquareBracket"})(ee||(ee={}));var ae;(function(nt){nt[nt.Text=1]="Text",nt[nt.BeforeTagName=2]="BeforeTagName",nt[nt.InTagName=3]="InTagName",nt[nt.InSelfClosingTag=4]="InSelfClosingTag",nt[nt.BeforeClosingTagName=5]="BeforeClosingTagName",nt[nt.InClosingTagName=6]="InClosingTagName",nt[nt.AfterClosingTagName=7]="AfterClosingTagName",nt[nt.BeforeAttributeName=8]="BeforeAttributeName",nt[nt.InAttributeName=9]="InAttributeName",nt[nt.AfterAttributeName=10]="AfterAttributeName",nt[nt.BeforeAttributeValue=11]="BeforeAttributeValue",nt[nt.InAttributeValueDq=12]="InAttributeValueDq",nt[nt.InAttributeValueSq=13]="InAttributeValueSq",nt[nt.InAttributeValueNq=14]="InAttributeValueNq",nt[nt.BeforeDeclaration=15]="BeforeDeclaration",nt[nt.InDeclaration=16]="InDeclaration",nt[nt.InProcessingInstruction=17]="InProcessingInstruction",nt[nt.BeforeComment=18]="BeforeComment",nt[nt.CDATASequence=19]="CDATASequence",nt[nt.InSpecialComment=20]="InSpecialComment",nt[nt.InCommentLike=21]="InCommentLike",nt[nt.BeforeSpecialS=22]="BeforeSpecialS",nt[nt.SpecialStartSequence=23]="SpecialStartSequence",nt[nt.InSpecialTag=24]="InSpecialTag",nt[nt.BeforeEntity=25]="BeforeEntity",nt[nt.BeforeNumericEntity=26]="BeforeNumericEntity",nt[nt.InNamedEntity=27]="InNamedEntity",nt[nt.InNumericEntity=28]="InNumericEntity",nt[nt.InHexEntity=29]="InHexEntity"})(ae||(ae={}));function ye(nt){return nt===ee.Space||nt===ee.NewLine||nt===ee.Tab||nt===ee.FormFeed||nt===ee.CarriageReturn}function ve(nt){return nt===ee.Slash||nt===ee.Gt||ye(nt)}function be(nt){return nt>=ee.Zero&&nt<=ee.Nine}function Ye(nt){return nt>=ee.LowerA&&nt<=ee.LowerZ||nt>=ee.UpperA&&nt<=ee.UpperZ}function Ke(nt){return nt>=ee.UpperA&&nt<=ee.UpperF||nt>=ee.LowerA&&nt<=ee.LowerF}var Xe;(function(nt){nt[nt.NoValue=0]="NoValue",nt[nt.Unquoted=1]="Unquoted",nt[nt.Single=2]="Single",nt[nt.Double=3]="Double"})(Xe=ie.QuoteType||(ie.QuoteType={}));var Je={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101])},rt=function(){function nt(it,lt){var ct=it.xmlMode,ot=ct===void 0?!1:ct,dt=it.decodeEntities,ft=dt===void 0?!0:dt;this.cbs=lt,this.state=ae.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=ae.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.trieIndex=0,this.trieCurrent=0,this.entityResult=0,this.entityExcess=0,this.xmlMode=ot,this.decodeEntities=ft,this.entityTrie=ot?Z.xmlDecodeTree:Z.htmlDecodeTree}return nt.prototype.reset=function(){this.state=ae.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=ae.Text,this.currentSequence=void 0,this.running=!0,this.offset=0},nt.prototype.write=function(it){this.offset+=this.buffer.length,this.buffer=it,this.parse()},nt.prototype.end=function(){this.running&&this.finish()},nt.prototype.pause=function(){this.running=!1},nt.prototype.resume=function(){this.running=!0,this.indexthis.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=ae.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&it===ee.Amp&&(this.state=ae.BeforeEntity)},nt.prototype.stateSpecialStartSequence=function(it){var lt=this.sequenceIndex===this.currentSequence.length,ct=lt?ve(it):(it|32)===this.currentSequence[this.sequenceIndex];if(!ct)this.isSpecial=!1;else if(!lt){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=ae.InTagName,this.stateInTagName(it)},nt.prototype.stateInSpecialTag=function(it){if(this.sequenceIndex===this.currentSequence.length){if(it===ee.Gt||ye(it)){var lt=this.index-this.currentSequence.length;if(this.sectionStart>14)-1;if(!this.allowLegacyEntity()&&it!==ee.Semi)this.trieIndex+=ct;else{var ot=this.index-this.entityExcess+1;ot>this.sectionStart&&this.emitPartial(this.sectionStart,ot),this.entityResult=this.trieIndex,this.trieIndex+=ct,this.entityExcess=0,this.sectionStart=this.index+1,ct===0&&this.emitNamedEntity()}}},nt.prototype.emitNamedEntity=function(){if(this.state=this.baseState,this.entityResult!==0){var it=(this.entityTrie[this.entityResult]&Z.BinTrieFlags.VALUE_LENGTH)>>14;switch(it){case 1:{this.emitCodePoint(this.entityTrie[this.entityResult]&~Z.BinTrieFlags.VALUE_LENGTH);break}case 2:{this.emitCodePoint(this.entityTrie[this.entityResult+1]);break}case 3:this.emitCodePoint(this.entityTrie[this.entityResult+1]),this.emitCodePoint(this.entityTrie[this.entityResult+2])}}},nt.prototype.stateBeforeNumericEntity=function(it){(it|32)===ee.LowerX?(this.entityExcess++,this.state=ae.InHexEntity):(this.state=ae.InNumericEntity,this.stateInNumericEntity(it))},nt.prototype.emitNumericEntity=function(it){var lt=this.index-this.entityExcess-1,ct=lt+2+ +(this.state===ae.InHexEntity);ct!==this.index&&(lt>this.sectionStart&&this.emitPartial(this.sectionStart,lt),this.sectionStart=this.index+Number(it),this.emitCodePoint((0,Z.replaceCodePoint)(this.entityResult))),this.state=this.baseState},nt.prototype.stateInNumericEntity=function(it){it===ee.Semi?this.emitNumericEntity(!0):be(it)?(this.entityResult=this.entityResult*10+(it-ee.Zero),this.entityExcess++):(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--)},nt.prototype.stateInHexEntity=function(it){it===ee.Semi?this.emitNumericEntity(!0):be(it)?(this.entityResult=this.entityResult*16+(it-ee.Zero),this.entityExcess++):Ke(it)?(this.entityResult=this.entityResult*16+((it|32)-ee.LowerA+10),this.entityExcess++):(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--)},nt.prototype.allowLegacyEntity=function(){return!this.xmlMode&&(this.baseState===ae.Text||this.baseState===ae.InSpecialTag)},nt.prototype.cleanup=function(){this.running&&this.sectionStart!==this.index&&(this.state===ae.Text||this.state===ae.InSpecialTag&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===ae.InAttributeValueDq||this.state===ae.InAttributeValueSq||this.state===ae.InAttributeValueNq)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))},nt.prototype.shouldContinue=function(){return this.index0&&be.has(this.stack[this.stack.length-1]);){var Ye=this.stack.pop();(ae=(ee=this.cbs).onclosetag)===null||ae===void 0||ae.call(ee,Ye,!0)}this.isVoidElement(Z)||(this.stack.push(Z),foreignContextElements.has(Z)?this.foreignContext.push(!0):htmlIntegrationElements.has(Z)&&this.foreignContext.push(!1)),(ve=(ye=this.cbs).onopentagname)===null||ve===void 0||ve.call(ye,Z),this.cbs.onopentag&&(this.attribs={})},ie.prototype.endOpenTag=function(Z){var ee,ae;this.startIndex=this.openTagStart,this.attribs&&((ae=(ee=this.cbs).onopentag)===null||ae===void 0||ae.call(ee,this.tagname,this.attribs,Z),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""},ie.prototype.onopentagend=function(Z){this.endIndex=Z,this.endOpenTag(!1),this.startIndex=Z+1},ie.prototype.onclosetag=function(Z,ee){var ae,ye,ve,be,Ye,Ke;this.endIndex=ee;var Xe=this.getSlice(Z,ee);if(this.lowerCaseTagNames&&(Xe=Xe.toLowerCase()),(foreignContextElements.has(Xe)||htmlIntegrationElements.has(Xe))&&this.foreignContext.pop(),this.isVoidElement(Xe))!this.options.xmlMode&&Xe==="br"&&((ye=(ae=this.cbs).onopentagname)===null||ye===void 0||ye.call(ae,"br"),(be=(ve=this.cbs).onopentag)===null||be===void 0||be.call(ve,"br",{},!0),(Ke=(Ye=this.cbs).onclosetag)===null||Ke===void 0||Ke.call(Ye,"br",!1));else{var Je=this.stack.lastIndexOf(Xe);if(Je!==-1)if(this.cbs.onclosetag)for(var rt=this.stack.length-Je;rt--;)this.cbs.onclosetag(this.stack.pop(),rt!==0);else this.stack.length=Je;else!this.options.xmlMode&&Xe==="p"&&(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=ee+1},ie.prototype.onselfclosingtag=function(Z){this.endIndex=Z,this.options.xmlMode||this.options.recognizeSelfClosing||this.foreignContext[this.foreignContext.length-1]?(this.closeCurrentTag(!1),this.startIndex=Z+1):this.onopentagend(Z)},ie.prototype.closeCurrentTag=function(Z){var ee,ae,ye=this.tagname;this.endOpenTag(Z),this.stack[this.stack.length-1]===ye&&((ae=(ee=this.cbs).onclosetag)===null||ae===void 0||ae.call(ee,ye,!Z),this.stack.pop())},ie.prototype.onattribname=function(Z,ee){this.startIndex=Z;var ae=this.getSlice(Z,ee);this.attribname=this.lowerCaseAttributeNames?ae.toLowerCase():ae},ie.prototype.onattribdata=function(Z,ee){this.attribvalue+=this.getSlice(Z,ee)},ie.prototype.onattribentity=function(Z){this.attribvalue+=(0,decode_js_1.fromCodePoint)(Z)},ie.prototype.onattribend=function(Z,ee){var ae,ye;this.endIndex=ee,(ye=(ae=this.cbs).onattribute)===null||ye===void 0||ye.call(ae,this.attribname,this.attribvalue,Z===Tokenizer_js_1.QuoteType.Double?'"':Z===Tokenizer_js_1.QuoteType.Single?"'":Z===Tokenizer_js_1.QuoteType.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""},ie.prototype.getInstructionName=function(Z){var ee=Z.search(reNameEnd),ae=ee<0?Z:Z.substr(0,ee);return this.lowerCaseTagNames&&(ae=ae.toLowerCase()),ae},ie.prototype.ondeclaration=function(Z,ee){this.endIndex=ee;var ae=this.getSlice(Z,ee);if(this.cbs.onprocessinginstruction){var ye=this.getInstructionName(ae);this.cbs.onprocessinginstruction("!".concat(ye),"!".concat(ae))}this.startIndex=ee+1},ie.prototype.onprocessinginstruction=function(Z,ee){this.endIndex=ee;var ae=this.getSlice(Z,ee);if(this.cbs.onprocessinginstruction){var ye=this.getInstructionName(ae);this.cbs.onprocessinginstruction("?".concat(ye),"?".concat(ae))}this.startIndex=ee+1},ie.prototype.oncomment=function(Z,ee,ae){var ye,ve,be,Ye;this.endIndex=ee,(ve=(ye=this.cbs).oncomment)===null||ve===void 0||ve.call(ye,this.getSlice(Z,ee-ae)),(Ye=(be=this.cbs).oncommentend)===null||Ye===void 0||Ye.call(be),this.startIndex=ee+1},ie.prototype.oncdata=function(Z,ee,ae){var ye,ve,be,Ye,Ke,Xe,Je,rt,nt,it;this.endIndex=ee;var lt=this.getSlice(Z,ee-ae);this.options.xmlMode||this.options.recognizeCDATA?((ve=(ye=this.cbs).oncdatastart)===null||ve===void 0||ve.call(ye),(Ye=(be=this.cbs).ontext)===null||Ye===void 0||Ye.call(be,lt),(Xe=(Ke=this.cbs).oncdataend)===null||Xe===void 0||Xe.call(Ke)):((rt=(Je=this.cbs).oncomment)===null||rt===void 0||rt.call(Je,"[CDATA[".concat(lt,"]]")),(it=(nt=this.cbs).oncommentend)===null||it===void 0||it.call(nt)),this.startIndex=ee+1},ie.prototype.onend=function(){var Z,ee;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(var ae=this.stack.length;ae>0;this.cbs.onclosetag(this.stack[--ae],!0));}(ee=(Z=this.cbs).onend)===null||ee===void 0||ee.call(Z)},ie.prototype.reset=function(){var Z,ee,ae,ye;(ee=(Z=this.cbs).onreset)===null||ee===void 0||ee.call(Z),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,(ye=(ae=this.cbs).onparserinit)===null||ye===void 0||ye.call(ae,this),this.buffers.length=0,this.bufferOffset=0,this.writeIndex=0,this.ended=!1},ie.prototype.parseComplete=function(Z){this.reset(),this.end(Z)},ie.prototype.getSlice=function(Z,ee){for(;Z-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();for(var ae=this.buffers[0].slice(Z-this.bufferOffset,ee-this.bufferOffset);ee-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),ae+=this.buffers[0].slice(0,ee-this.bufferOffset);return ae},ie.prototype.shiftBuffer=function(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()},ie.prototype.write=function(Z){var ee,ae;if(this.ended){(ae=(ee=this.cbs).onerror)===null||ae===void 0||ae.call(ee,new Error(".write() after done!"));return}this.buffers.push(Z),this.tokenizer.running&&(this.tokenizer.write(Z),this.writeIndex++)},ie.prototype.end=function(Z){var ee,ae;if(this.ended){(ae=(ee=this.cbs).onerror)===null||ae===void 0||ae.call(ee,new Error(".end() after done!"));return}Z&&this.write(Z),this.ended=!0,this.tokenizer.end()},ie.prototype.pause=function(){this.tokenizer.pause()},ie.prototype.resume=function(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"childNodes",{get:function(){return this.children},set:function(ee){this.children=ee},enumerable:!1,configurable:!0}),Z}(Node$6);node$1.NodeWithChildren=NodeWithChildren;var CDATA=function(ie){__extends(Z,ie);function Z(){var ee=ie!==null&&ie.apply(this,arguments)||this;return ee.type=domelementtype_1$1.ElementType.CDATA,ee}return Object.defineProperty(Z.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),Z}(NodeWithChildren);node$1.CDATA=CDATA;var Document$4=function(ie){__extends(Z,ie);function Z(){var ee=ie!==null&&ie.apply(this,arguments)||this;return ee.type=domelementtype_1$1.ElementType.Root,ee}return Object.defineProperty(Z.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),Z}(NodeWithChildren);node$1.Document=Document$4;var Element$1=function(ie){__extends(Z,ie);function Z(ee,ae,ye,ve){ye===void 0&&(ye=[]),ve===void 0&&(ve=ee==="script"?domelementtype_1$1.ElementType.Script:ee==="style"?domelementtype_1$1.ElementType.Style:domelementtype_1$1.ElementType.Tag);var be=ie.call(this,ye)||this;return be.name=ee,be.attribs=ae,be.type=ve,be}return Object.defineProperty(Z.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"tagName",{get:function(){return this.name},set:function(ee){this.name=ee},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"attributes",{get:function(){var ee=this;return Object.keys(this.attribs).map(function(ae){var ye,ve;return{name:ae,value:ee.attribs[ae],namespace:(ye=ee["x-attribsNamespace"])===null||ye===void 0?void 0:ye[ae],prefix:(ve=ee["x-attribsPrefix"])===null||ve===void 0?void 0:ve[ae]}})},enumerable:!1,configurable:!0}),Z}(NodeWithChildren);node$1.Element=Element$1;function isTag(ie){return(0,domelementtype_1$1.isTag)(ie)}node$1.isTag=isTag;function isCDATA(ie){return ie.type===domelementtype_1$1.ElementType.CDATA}node$1.isCDATA=isCDATA;function isText(ie){return ie.type===domelementtype_1$1.ElementType.Text}node$1.isText=isText;function isComment(ie){return ie.type===domelementtype_1$1.ElementType.Comment}node$1.isComment=isComment;function isDirective(ie){return ie.type===domelementtype_1$1.ElementType.Directive}node$1.isDirective=isDirective;function isDocument(ie){return ie.type===domelementtype_1$1.ElementType.Root}node$1.isDocument=isDocument;function hasChildren(ie){return Object.prototype.hasOwnProperty.call(ie,"children")}node$1.hasChildren=hasChildren;function cloneNode$1(ie,Z){Z===void 0&&(Z=!1);var ee;if(isText(ie))ee=new Text(ie.data);else if(isComment(ie))ee=new Comment$5(ie.data);else if(isTag(ie)){var ae=Z?cloneChildren(ie.children):[],ye=new Element$1(ie.name,__assign$2({},ie.attribs),ae);ae.forEach(function(Ke){return Ke.parent=ye}),ie.namespace!=null&&(ye.namespace=ie.namespace),ie["x-attribsNamespace"]&&(ye["x-attribsNamespace"]=__assign$2({},ie["x-attribsNamespace"])),ie["x-attribsPrefix"]&&(ye["x-attribsPrefix"]=__assign$2({},ie["x-attribsPrefix"])),ee=ye}else if(isCDATA(ie)){var ae=Z?cloneChildren(ie.children):[],ve=new CDATA(ae);ae.forEach(function(Xe){return Xe.parent=ve}),ee=ve}else if(isDocument(ie)){var ae=Z?cloneChildren(ie.children):[],be=new Document$4(ae);ae.forEach(function(Xe){return Xe.parent=be}),ie["x-mode"]&&(be["x-mode"]=ie["x-mode"]),ee=be}else if(isDirective(ie)){var Ye=new ProcessingInstruction(ie.name,ie.data);ie["x-name"]!=null&&(Ye["x-name"]=ie["x-name"],Ye["x-publicId"]=ie["x-publicId"],Ye["x-systemId"]=ie["x-systemId"]),ee=Ye}else throw new Error("Not implemented yet: ".concat(ie.type));return ee.startIndex=ie.startIndex,ee.endIndex=ie.endIndex,ie.sourceCodeLocation!=null&&(ee.sourceCodeLocation=ie.sourceCodeLocation),ee}node$1.cloneNode=cloneNode$1;function cloneChildren(ie){for(var Z=ie.map(function(ae){return cloneNode$1(ae,!0)}),ee=1;ee$\x80-\uFFFF]/g;var Z=new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]);ie.getCodePoint=String.prototype.codePointAt!=null?function(ye,ve){return ye.codePointAt(ve)}:function(ye,ve){return(ye.charCodeAt(ve)&64512)===55296?(ye.charCodeAt(ve)-55296)*1024+ye.charCodeAt(ve+1)-56320+65536:ye.charCodeAt(ve)};function ee(ye){for(var ve="",be=0,Ye;(Ye=ie.xmlReplacer.exec(ye))!==null;){var Ke=Ye.index,Xe=ye.charCodeAt(Ke),Je=Z.get(Xe);Je!==void 0?(ve+=ye.substring(be,Ke)+Je,be=Ke+1):(ve+="".concat(ye.substring(be,Ke),"&#x").concat((0,ie.getCodePoint)(ye,Ke).toString(16),";"),be=ie.xmlReplacer.lastIndex+=+((Xe&64512)===55296))}return ve+ye.substr(be)}ie.encodeXML=ee,ie.escape=ee;function ae(ye,ve){return function(be){for(var Ye,Ke=0,Xe="";Ye=ye.exec(be);)Ke!==Ye.index&&(Xe+=be.substring(Ke,Ye.index)),Xe+=ve.get(Ye[0].charCodeAt(0)),Ke=Ye.index+1;return Xe+be.substring(Ke)}}ie.escapeUTF8=ae(/[&<>'"]/g,Z),ie.escapeAttribute=ae(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),ie.escapeText=ae(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]))})(_escape);var __importDefault$1=commonjsGlobal&&commonjsGlobal.__importDefault||function(ie){return ie&&ie.__esModule?ie:{default:ie}};Object.defineProperty(encode,"__esModule",{value:!0});encode.encodeNonAsciiHTML=encode.encodeHTML=void 0;var encode_html_js_1=__importDefault$1(encodeHtml),escape_js_1=_escape,htmlReplacer=/[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g;function encodeHTML(ie){return encodeHTMLTrieRe(htmlReplacer,ie)}encode.encodeHTML=encodeHTML;function encodeNonAsciiHTML(ie){return encodeHTMLTrieRe(escape_js_1.xmlReplacer,ie)}encode.encodeNonAsciiHTML=encodeNonAsciiHTML;function encodeHTMLTrieRe(ie,Z){for(var ee="",ae=0,ye;(ye=ie.exec(Z))!==null;){var ve=ye.index;ee+=Z.substring(ae,ve);var be=Z.charCodeAt(ve),Ye=encode_html_js_1.default.get(be);if(typeof Ye=="object"){if(ve+10&&(ae+=render(ie.children,Z)),(Z.xmlMode||!singleTag.has(ie.name))&&(ae+=""))),ae}function renderDirective(ie){return"<".concat(ie.data,">")}function renderText(ie,Z){var ee,ae=ie.data||"";return((ee=Z.encodeEntities)!==null&&ee!==void 0?ee:Z.decodeEntities)!==!1&&!(!Z.xmlMode&&ie.parent&&unencodedElements.has(ie.parent.name))&&(ae=Z.xmlMode||Z.encodeEntities!=="utf8"?(0,entities_1.encodeXML)(ae):(0,entities_1.escapeText)(ae)),ae}function renderCdata(ie){return"")}function renderComment(ie){return"")}var __importDefault=commonjsGlobal&&commonjsGlobal.__importDefault||function(ie){return ie&&ie.__esModule?ie:{default:ie}};Object.defineProperty(stringify$5,"__esModule",{value:!0});stringify$5.innerText=stringify$5.textContent=stringify$5.getText=stringify$5.getInnerHTML=stringify$5.getOuterHTML=void 0;var domhandler_1$3=lib$4,dom_serializer_1=__importDefault(lib$1),domelementtype_1=lib$3;function getOuterHTML(ie,Z){return(0,dom_serializer_1.default)(ie,Z)}stringify$5.getOuterHTML=getOuterHTML;function getInnerHTML(ie,Z){return(0,domhandler_1$3.hasChildren)(ie)?ie.children.map(function(ee){return getOuterHTML(ee,Z)}).join(""):""}stringify$5.getInnerHTML=getInnerHTML;function getText(ie){return Array.isArray(ie)?ie.map(getText).join(""):(0,domhandler_1$3.isTag)(ie)?ie.name==="br"?` +`:getText(ie.children):(0,domhandler_1$3.isCDATA)(ie)?getText(ie.children):(0,domhandler_1$3.isText)(ie)?ie.data:""}stringify$5.getText=getText;function textContent(ie){return Array.isArray(ie)?ie.map(textContent).join(""):(0,domhandler_1$3.hasChildren)(ie)&&!(0,domhandler_1$3.isComment)(ie)?textContent(ie.children):(0,domhandler_1$3.isText)(ie)?ie.data:""}stringify$5.textContent=textContent;function innerText(ie){return Array.isArray(ie)?ie.map(innerText).join(""):(0,domhandler_1$3.hasChildren)(ie)&&(ie.type===domelementtype_1.ElementType.Tag||(0,domhandler_1$3.isCDATA)(ie))?innerText(ie.children):(0,domhandler_1$3.isText)(ie)?ie.data:""}stringify$5.innerText=innerText;var traversal={};Object.defineProperty(traversal,"__esModule",{value:!0});traversal.prevElementSibling=traversal.nextElementSibling=traversal.getName=traversal.hasAttrib=traversal.getAttributeValue=traversal.getSiblings=traversal.getParent=traversal.getChildren=void 0;var domhandler_1$2=lib$4;function getChildren(ie){return(0,domhandler_1$2.hasChildren)(ie)?ie.children:[]}traversal.getChildren=getChildren;function getParent(ie){return ie.parent||null}traversal.getParent=getParent;function getSiblings(ie){var Z,ee,ae=getParent(ie);if(ae!=null)return getChildren(ae);for(var ye=[ie],ve=ie.prev,be=ie.next;ve!=null;)ye.unshift(ve),Z=ve,ve=Z.prev;for(;be!=null;)ye.push(be),ee=be,be=ee.next;return ye}traversal.getSiblings=getSiblings;function getAttributeValue(ie,Z){var ee;return(ee=ie.attribs)===null||ee===void 0?void 0:ee[Z]}traversal.getAttributeValue=getAttributeValue;function hasAttrib(ie,Z){return ie.attribs!=null&&Object.prototype.hasOwnProperty.call(ie.attribs,Z)&&ie.attribs[Z]!=null}traversal.hasAttrib=hasAttrib;function getName(ie){return ie.name}traversal.getName=getName;function nextElementSibling(ie){for(var Z,ee=ie.next;ee!==null&&!(0,domhandler_1$2.isTag)(ee);)Z=ee,ee=Z.next;return ee}traversal.nextElementSibling=nextElementSibling;function prevElementSibling(ie){for(var Z,ee=ie.prev;ee!==null&&!(0,domhandler_1$2.isTag)(ee);)Z=ee,ee=Z.prev;return ee}traversal.prevElementSibling=prevElementSibling;var manipulation={};Object.defineProperty(manipulation,"__esModule",{value:!0});manipulation.prepend=manipulation.prependChild=manipulation.append=manipulation.appendChild=manipulation.replaceElement=manipulation.removeElement=void 0;function removeElement(ie){if(ie.prev&&(ie.prev.next=ie.next),ie.next&&(ie.next.prev=ie.prev),ie.parent){var Z=ie.parent.children,ee=Z.lastIndexOf(ie);ee>=0&&Z.splice(ee,1)}ie.next=null,ie.prev=null,ie.parent=null}manipulation.removeElement=removeElement;function replaceElement(ie,Z){var ee=Z.prev=ie.prev;ee&&(ee.next=Z);var ae=Z.next=ie.next;ae&&(ae.prev=Z);var ye=Z.parent=ie.parent;if(ye){var ve=ye.children;ve[ve.lastIndexOf(ie)]=Z,ie.parent=null}}manipulation.replaceElement=replaceElement;function appendChild(ie,Z){if(removeElement(Z),Z.next=null,Z.parent=ie,ie.children.push(Z)>1){var ee=ie.children[ie.children.length-2];ee.next=Z,Z.prev=ee}else Z.prev=null}manipulation.appendChild=appendChild;function append(ie,Z){removeElement(Z);var ee=ie.parent,ae=ie.next;if(Z.next=ae,Z.prev=ie,ie.next=Z,Z.parent=ee,ae){if(ae.prev=Z,ee){var ye=ee.children;ye.splice(ye.lastIndexOf(ae),0,Z)}}else ee&&ee.children.push(Z)}manipulation.append=append;function prependChild(ie,Z){if(removeElement(Z),Z.parent=ie,Z.prev=null,ie.children.unshift(Z)!==1){var ee=ie.children[1];ee.prev=Z,Z.next=ee}else Z.next=null}manipulation.prependChild=prependChild;function prepend(ie,Z){removeElement(Z);var ee=ie.parent;if(ee){var ae=ee.children;ae.splice(ae.indexOf(ie),0,Z)}ie.prev&&(ie.prev.next=Z),Z.parent=ee,Z.prev=ie.prev,Z.next=ie,ie.prev=Z}manipulation.prepend=prepend;var querying={};Object.defineProperty(querying,"__esModule",{value:!0});querying.findAll=querying.existsOne=querying.findOne=querying.findOneChild=querying.find=querying.filter=void 0;var domhandler_1$1=lib$4;function filter$1(ie,Z,ee,ae){return ee===void 0&&(ee=!0),ae===void 0&&(ae=1/0),find(ie,Array.isArray(Z)?Z:[Z],ee,ae)}querying.filter=filter$1;function find(ie,Z,ee,ae){for(var ye=[],ve=[Z],be=[0];;){if(be[0]>=ve[0].length){if(be.length===1)return ye;ve.shift(),be.shift();continue}var Ye=ve[0][be[0]++];if(ie(Ye)&&(ye.push(Ye),--ae<=0))return ye;ee&&(0,domhandler_1$1.hasChildren)(Ye)&&Ye.children.length>0&&(be.unshift(0),ve.unshift(Ye.children))}}querying.find=find;function findOneChild(ie,Z){return Z.find(ie)}querying.findOneChild=findOneChild;function findOne(ie,Z,ee){ee===void 0&&(ee=!0);for(var ae=null,ye=0;ye0&&(ae=findOne(ie,ve.children,!0));else continue}return ae}querying.findOne=findOne;function existsOne(ie,Z){return Z.some(function(ee){return(0,domhandler_1$1.isTag)(ee)&&(ie(ee)||existsOne(ie,ee.children))})}querying.existsOne=existsOne;function findAll(ie,Z){for(var ee=[],ae=[Z],ye=[0];;){if(ye[0]>=ae[0].length){if(ae.length===1)return ee;ae.shift(),ye.shift();continue}var ve=ae[0][ye[0]++];(0,domhandler_1$1.isTag)(ve)&&(ie(ve)&&ee.push(ve),ve.children.length>0&&(ye.unshift(0),ae.unshift(ve.children)))}}querying.findAll=findAll;var legacy={};Object.defineProperty(legacy,"__esModule",{value:!0});legacy.getElementsByTagType=legacy.getElementsByTagName=legacy.getElementById=legacy.getElements=legacy.testElement=void 0;var domhandler_1=lib$4,querying_js_1=querying,Checks={tag_name:function(ie){return typeof ie=="function"?function(Z){return(0,domhandler_1.isTag)(Z)&&ie(Z.name)}:ie==="*"?domhandler_1.isTag:function(Z){return(0,domhandler_1.isTag)(Z)&&Z.name===ie}},tag_type:function(ie){return typeof ie=="function"?function(Z){return ie(Z.type)}:function(Z){return Z.type===ie}},tag_contains:function(ie){return typeof ie=="function"?function(Z){return(0,domhandler_1.isText)(Z)&&ie(Z.data)}:function(Z){return(0,domhandler_1.isText)(Z)&&Z.data===ie}}};function getAttribCheck(ie,Z){return typeof Z=="function"?function(ee){return(0,domhandler_1.isTag)(ee)&&Z(ee.attribs[ie])}:function(ee){return(0,domhandler_1.isTag)(ee)&&ee.attribs[ie]===Z}}function combineFuncs(ie,Z){return function(ee){return ie(ee)||Z(ee)}}function compileTest(ie){var Z=Object.keys(ie).map(function(ee){var ae=ie[ee];return Object.prototype.hasOwnProperty.call(Checks,ee)?Checks[ee](ae):getAttribCheck(ee,ae)});return Z.length===0?null:Z.reduce(combineFuncs)}function testElement(ie,Z){var ee=compileTest(ie);return ee?ee(Z):!0}legacy.testElement=testElement;function getElements(ie,Z,ee,ae){ae===void 0&&(ae=1/0);var ye=compileTest(ie);return ye?(0,querying_js_1.filter)(ye,Z,ee,ae):[]}legacy.getElements=getElements;function getElementById(ie,Z,ee){return ee===void 0&&(ee=!0),Array.isArray(Z)||(Z=[Z]),(0,querying_js_1.findOne)(getAttribCheck("id",ie),Z,ee)}legacy.getElementById=getElementById;function getElementsByTagName(ie,Z,ee,ae){return ee===void 0&&(ee=!0),ae===void 0&&(ae=1/0),(0,querying_js_1.filter)(Checks.tag_name(ie),Z,ee,ae)}legacy.getElementsByTagName=getElementsByTagName;function getElementsByTagType(ie,Z,ee,ae){return ee===void 0&&(ee=!0),ae===void 0&&(ae=1/0),(0,querying_js_1.filter)(Checks.tag_type(ie),Z,ee,ae)}legacy.getElementsByTagType=getElementsByTagType;var helpers={};(function(ie){Object.defineProperty(ie,"__esModule",{value:!0}),ie.uniqueSort=ie.compareDocumentPosition=ie.DocumentPosition=ie.removeSubsets=void 0;var Z=lib$4;function ee(be){for(var Ye=be.length;--Ye>=0;){var Ke=be[Ye];if(Ye>0&&be.lastIndexOf(Ke,Ye-1)>=0){be.splice(Ye,1);continue}for(var Xe=Ke.parent;Xe;Xe=Xe.parent)if(be.includes(Xe)){be.splice(Ye,1);break}}return be}ie.removeSubsets=ee;var ae;(function(be){be[be.DISCONNECTED=1]="DISCONNECTED",be[be.PRECEDING=2]="PRECEDING",be[be.FOLLOWING=4]="FOLLOWING",be[be.CONTAINS=8]="CONTAINS",be[be.CONTAINED_BY=16]="CONTAINED_BY"})(ae=ie.DocumentPosition||(ie.DocumentPosition={}));function ye(be,Ye){var Ke=[],Xe=[];if(be===Ye)return 0;for(var Je=(0,Z.hasChildren)(be)?be:be.parent;Je;)Ke.unshift(Je),Je=Je.parent;for(Je=(0,Z.hasChildren)(Ye)?Ye:Ye.parent;Je;)Xe.unshift(Je),Je=Je.parent;for(var rt=Math.min(Ke.length,Xe.length),nt=0;ntlt.indexOf(ot)?it===Ye?ae.FOLLOWING|ae.CONTAINED_BY:ae.FOLLOWING:it===be?ae.PRECEDING|ae.CONTAINS:ae.PRECEDING}ie.compareDocumentPosition=ye;function ve(be){return be=be.filter(function(Ye,Ke,Xe){return!Xe.includes(Ye,Ke+1)}),be.sort(function(Ye,Ke){var Xe=ye(Ye,Ke);return Xe&ae.PRECEDING?-1:Xe&ae.FOLLOWING?1:0}),be}ie.uniqueSort=ve})(helpers);var feeds={};Object.defineProperty(feeds,"__esModule",{value:!0});feeds.getFeed=void 0;var stringify_js_1=stringify$5,legacy_js_1=legacy;function getFeed(ie){var Z=getOneElement(isValidFeed,ie);return Z?Z.name==="feed"?getAtomFeed(Z):getRssFeed(Z):null}feeds.getFeed=getFeed;function getAtomFeed(ie){var Z,ee=ie.children,ae={type:"atom",items:(0,legacy_js_1.getElementsByTagName)("entry",ee).map(function(be){var Ye,Ke=be.children,Xe={media:getMediaElements(Ke)};addConditionally(Xe,"id","id",Ke),addConditionally(Xe,"title","title",Ke);var Je=(Ye=getOneElement("link",Ke))===null||Ye===void 0?void 0:Ye.attribs.href;Je&&(Xe.link=Je);var rt=fetch$1("summary",Ke)||fetch$1("content",Ke);rt&&(Xe.description=rt);var nt=fetch$1("updated",Ke);return nt&&(Xe.pubDate=new Date(nt)),Xe})};addConditionally(ae,"id","id",ee),addConditionally(ae,"title","title",ee);var ye=(Z=getOneElement("link",ee))===null||Z===void 0?void 0:Z.attribs.href;ye&&(ae.link=ye),addConditionally(ae,"description","subtitle",ee);var ve=fetch$1("updated",ee);return ve&&(ae.updated=new Date(ve)),addConditionally(ae,"author","email",ee,!0),ae}function getRssFeed(ie){var Z,ee,ae=(ee=(Z=getOneElement("channel",ie.children))===null||Z===void 0?void 0:Z.children)!==null&&ee!==void 0?ee:[],ye={type:ie.name.substr(0,3),id:"",items:(0,legacy_js_1.getElementsByTagName)("item",ie.children).map(function(be){var Ye=be.children,Ke={media:getMediaElements(Ye)};addConditionally(Ke,"id","guid",Ye),addConditionally(Ke,"title","title",Ye),addConditionally(Ke,"link","link",Ye),addConditionally(Ke,"description","description",Ye);var Xe=fetch$1("pubDate",Ye)||fetch$1("dc:date",Ye);return Xe&&(Ke.pubDate=new Date(Xe)),Ke})};addConditionally(ye,"title","title",ae),addConditionally(ye,"link","link",ae),addConditionally(ye,"description","description",ae);var ve=fetch$1("lastBuildDate",ae);return ve&&(ye.updated=new Date(ve)),addConditionally(ye,"author","managingEditor",ae,!0),ye}var MEDIA_KEYS_STRING=["url","type","lang"],MEDIA_KEYS_INT=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function getMediaElements(ie){return(0,legacy_js_1.getElementsByTagName)("media:content",ie).map(function(Z){for(var ee=Z.attribs,ae={medium:ee.medium,isDefault:!!ee.isDefault},ye=0,ve=MEDIA_KEYS_STRING;ye{if(typeof ie!="string")throw new TypeError("Expected a string");return ie.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")},isPlainObject$2={};Object.defineProperty(isPlainObject$2,"__esModule",{value:!0});/*! + * is-plain-object + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */function isObject(ie){return Object.prototype.toString.call(ie)==="[object Object]"}function isPlainObject$1(ie){var Z,ee;return isObject(ie)===!1?!1:(Z=ie.constructor,Z===void 0?!0:(ee=Z.prototype,!(isObject(ee)===!1||ee.hasOwnProperty("isPrototypeOf")===!1)))}isPlainObject$2.isPlainObject=isPlainObject$1;var isMergeableObject=function(ie){return isNonNullObject(ie)&&!isSpecial(ie)};function isNonNullObject(ie){return!!ie&&typeof ie=="object"}function isSpecial(ie){var Z=Object.prototype.toString.call(ie);return Z==="[object RegExp]"||Z==="[object Date]"||isReactElement(ie)}var canUseSymbol=typeof Symbol=="function"&&Symbol.for,REACT_ELEMENT_TYPE=canUseSymbol?Symbol.for("react.element"):60103;function isReactElement(ie){return ie.$$typeof===REACT_ELEMENT_TYPE}function emptyTarget(ie){return Array.isArray(ie)?[]:{}}function cloneUnlessOtherwiseSpecified(ie,Z){return Z.clone!==!1&&Z.isMergeableObject(ie)?deepmerge$1(emptyTarget(ie),ie,Z):ie}function defaultArrayMerge(ie,Z,ee){return ie.concat(Z).map(function(ae){return cloneUnlessOtherwiseSpecified(ae,ee)})}function getMergeFunction(ie,Z){if(!Z.customMerge)return deepmerge$1;var ee=Z.customMerge(ie);return typeof ee=="function"?ee:deepmerge$1}function getEnumerableOwnPropertySymbols(ie){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(ie).filter(function(Z){return Object.propertyIsEnumerable.call(ie,Z)}):[]}function getKeys(ie){return Object.keys(ie).concat(getEnumerableOwnPropertySymbols(ie))}function propertyIsOnObject(ie,Z){try{return Z in ie}catch{return!1}}function propertyIsUnsafe(ie,Z){return propertyIsOnObject(ie,Z)&&!(Object.hasOwnProperty.call(ie,Z)&&Object.propertyIsEnumerable.call(ie,Z))}function mergeObject(ie,Z,ee){var ae={};return ee.isMergeableObject(ie)&&getKeys(ie).forEach(function(ye){ae[ye]=cloneUnlessOtherwiseSpecified(ie[ye],ee)}),getKeys(Z).forEach(function(ye){propertyIsUnsafe(ie,ye)||(propertyIsOnObject(ie,ye)&&ee.isMergeableObject(Z[ye])?ae[ye]=getMergeFunction(ye,ee)(ie[ye],Z[ye],ee):ae[ye]=cloneUnlessOtherwiseSpecified(Z[ye],ee))}),ae}function deepmerge$1(ie,Z,ee){ee=ee||{},ee.arrayMerge=ee.arrayMerge||defaultArrayMerge,ee.isMergeableObject=ee.isMergeableObject||isMergeableObject,ee.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var ae=Array.isArray(Z),ye=Array.isArray(ie),ve=ae===ye;return ve?ae?ee.arrayMerge(ie,Z,ee):mergeObject(ie,Z,ee):cloneUnlessOtherwiseSpecified(Z,ee)}deepmerge$1.all=function(ie,Z){if(!Array.isArray(ie))throw new Error("first argument should be an array");return ie.reduce(function(ee,ae){return deepmerge$1(ee,ae,Z)},{})};var deepmerge_1=deepmerge$1,cjs=deepmerge_1,parseSrcset$1={exports:{}};(function(ie){(function(Z,ee){ie.exports?ie.exports=ee():Z.parseSrcset=ee()})(commonjsGlobal,function(){return function(Z){function ee(mt){return mt===" "||mt===" "||mt===` +`||mt==="\f"||mt==="\r"}function ae(mt){var Yr,Qr=mt.exec(Z.substring(ot));if(Qr)return Yr=Qr[0],ot+=Yr.length,Yr}for(var ye=Z.length,ve=/^[ \t\n\r\u000c]+/,be=/^[, \t\n\r\u000c]+/,Ye=/^[^ \t\n\r\u000c]+/,Ke=/[,]+$/,Xe=/^\d+$/,Je=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,rt,nt,it,lt,ct,ot=0,dt=[];;){if(ae(be),ot>=ye)return dt;rt=ae(Ye),nt=[],rt.slice(-1)===","?(rt=rt.replace(Ke,""),gt()):ft()}function ft(){for(ae(ve),it="",lt="in descriptor";;){if(ct=Z.charAt(ot),lt==="in descriptor")if(ee(ct))it&&(nt.push(it),it="",lt="after descriptor");else if(ct===","){ot+=1,it&&nt.push(it),gt();return}else if(ct==="(")it=it+ct,lt="in parens";else if(ct===""){it&&nt.push(it),gt();return}else it=it+ct;else if(lt==="in parens")if(ct===")")it=it+ct,lt="in descriptor";else if(ct===""){nt.push(it),gt();return}else it=it+ct;else if(lt==="after descriptor"&&!ee(ct))if(ct===""){gt();return}else lt="in descriptor",ot-=1;ot+=1}}function gt(){var mt=!1,Yr,Qr,Xr,Jr,ai={},oi,ni,li,ui,mi;for(Jr=0;Jr",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(Z){if(!this.source)return"";let ee=this.source;Z==null&&(Z=pico.isColorSupported),terminalHighlight$1&&Z&&(ee=terminalHighlight$1(ee));let ae=ee.split(/\r?\n/),ye=Math.max(this.line-3,0),ve=Math.min(this.line+2,ae.length),be=String(ve).length,Ye,Ke;if(Z){let{bold:Xe,gray:Je,red:rt}=pico.createColors(!0);Ye=nt=>Xe(rt(nt)),Ke=nt=>Je(nt)}else Ye=Ke=Xe=>Xe;return ae.slice(ye,ve).map((Xe,Je)=>{let rt=ye+1+Je,nt=" "+(" "+rt).slice(-be)+" | ";if(rt===this.line){let it=Ke(nt.replace(/\d/g," "))+Xe.slice(0,this.column-1).replace(/[^\t]/g," ");return Ye(">")+Ke(nt)+Xe+` + `+it+Ye("^")}return" "+Ke(nt)+Xe}).join(` +`)}toString(){let Z=this.showSourceCode();return Z&&(Z=` + +`+Z+` +`),this.name+": "+this.message+Z}};var cssSyntaxError=CssSyntaxError$3;CssSyntaxError$3.default=CssSyntaxError$3;var symbols={};symbols.isClean=Symbol("isClean");symbols.my=Symbol("my");const DEFAULT_RAW={after:` +`,beforeClose:` +`,beforeComment:` +`,beforeDecl:` +`,beforeOpen:" ",beforeRule:` +`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function capitalize(ie){return ie[0].toUpperCase()+ie.slice(1)}let Stringifier$2=class{constructor(ie){this.builder=ie}atrule(ie,Z){let ee="@"+ie.name,ae=ie.params?this.rawValue(ie,"params"):"";if(typeof ie.raws.afterName<"u"?ee+=ie.raws.afterName:ae&&(ee+=" "),ie.nodes)this.block(ie,ee+ae);else{let ye=(ie.raws.between||"")+(Z?";":"");this.builder(ee+ae+ye,ie)}}beforeAfter(ie,Z){let ee;ie.type==="decl"?ee=this.raw(ie,null,"beforeDecl"):ie.type==="comment"?ee=this.raw(ie,null,"beforeComment"):Z==="before"?ee=this.raw(ie,null,"beforeRule"):ee=this.raw(ie,null,"beforeClose");let ae=ie.parent,ye=0;for(;ae&&ae.type!=="root";)ye+=1,ae=ae.parent;if(ee.includes(` +`)){let ve=this.raw(ie,null,"indent");if(ve.length)for(let be=0;be0&&ie.nodes[Z].type==="comment";)Z-=1;let ee=this.raw(ie,"semicolon");for(let ae=0;ae{if(ae=Ye.raws[Z],typeof ae<"u")return!1})}return typeof ae>"u"&&(ae=DEFAULT_RAW[ee]),ve.rawCache[ee]=ae,ae}rawBeforeClose(ie){let Z;return ie.walk(ee=>{if(ee.nodes&&ee.nodes.length>0&&typeof ee.raws.after<"u")return Z=ee.raws.after,Z.includes(` +`)&&(Z=Z.replace(/[^\n]+$/,"")),!1}),Z&&(Z=Z.replace(/\S/g,"")),Z}rawBeforeComment(ie,Z){let ee;return ie.walkComments(ae=>{if(typeof ae.raws.before<"u")return ee=ae.raws.before,ee.includes(` +`)&&(ee=ee.replace(/[^\n]+$/,"")),!1}),typeof ee>"u"?ee=this.raw(Z,null,"beforeDecl"):ee&&(ee=ee.replace(/\S/g,"")),ee}rawBeforeDecl(ie,Z){let ee;return ie.walkDecls(ae=>{if(typeof ae.raws.before<"u")return ee=ae.raws.before,ee.includes(` +`)&&(ee=ee.replace(/[^\n]+$/,"")),!1}),typeof ee>"u"?ee=this.raw(Z,null,"beforeRule"):ee&&(ee=ee.replace(/\S/g,"")),ee}rawBeforeOpen(ie){let Z;return ie.walk(ee=>{if(ee.type!=="decl"&&(Z=ee.raws.between,typeof Z<"u"))return!1}),Z}rawBeforeRule(ie){let Z;return ie.walk(ee=>{if(ee.nodes&&(ee.parent!==ie||ie.first!==ee)&&typeof ee.raws.before<"u")return Z=ee.raws.before,Z.includes(` +`)&&(Z=Z.replace(/[^\n]+$/,"")),!1}),Z&&(Z=Z.replace(/\S/g,"")),Z}rawColon(ie){let Z;return ie.walkDecls(ee=>{if(typeof ee.raws.between<"u")return Z=ee.raws.between.replace(/[^\s:]/g,""),!1}),Z}rawEmptyBody(ie){let Z;return ie.walk(ee=>{if(ee.nodes&&ee.nodes.length===0&&(Z=ee.raws.after,typeof Z<"u"))return!1}),Z}rawIndent(ie){if(ie.raws.indent)return ie.raws.indent;let Z;return ie.walk(ee=>{let ae=ee.parent;if(ae&&ae!==ie&&ae.parent&&ae.parent===ie&&typeof ee.raws.before<"u"){let ye=ee.raws.before.split(` +`);return Z=ye[ye.length-1],Z=Z.replace(/\S/g,""),!1}}),Z}rawSemicolon(ie){let Z;return ie.walk(ee=>{if(ee.nodes&&ee.nodes.length&&ee.last.type==="decl"&&(Z=ee.raws.semicolon,typeof Z<"u"))return!1}),Z}rawValue(ie,Z){let ee=ie[Z],ae=ie.raws[Z];return ae&&ae.value===ee?ae.raw:ee}root(ie){this.body(ie),ie.raws.after&&this.builder(ie.raws.after)}rule(ie){this.block(ie,this.rawValue(ie,"selector")),ie.raws.ownSemicolon&&this.builder(ie.raws.ownSemicolon,ie,"end")}stringify(ie,Z){if(!this[ie.type])throw new Error("Unknown AST node type "+ie.type+". Maybe you need to change PostCSS stringifier.");this[ie.type](ie,Z)}};var stringifier=Stringifier$2;Stringifier$2.default=Stringifier$2;let Stringifier$1=stringifier;function stringify$4(ie,Z){new Stringifier$1(Z).stringify(ie)}var stringify_1=stringify$4;stringify$4.default=stringify$4;let{isClean:isClean$2,my:my$2}=symbols,CssSyntaxError$2=cssSyntaxError,Stringifier=stringifier,stringify$3=stringify_1;function cloneNode(ie,Z){let ee=new ie.constructor;for(let ae in ie){if(!Object.prototype.hasOwnProperty.call(ie,ae)||ae==="proxyCache")continue;let ye=ie[ae],ve=typeof ye;ae==="parent"&&ve==="object"?Z&&(ee[ae]=Z):ae==="source"?ee[ae]=ye:Array.isArray(ye)?ee[ae]=ye.map(be=>cloneNode(be,ee)):(ve==="object"&&ye!==null&&(ye=cloneNode(ye)),ee[ae]=ye)}return ee}let Node$5=class{constructor(ie={}){this.raws={},this[isClean$2]=!1,this[my$2]=!0;for(let Z in ie)if(Z==="nodes"){this.nodes=[];for(let ee of ie[Z])typeof ee.clone=="function"?this.append(ee.clone()):this.append(ee)}else this[Z]=ie[Z]}addToError(ie){if(ie.postcssNode=this,ie.stack&&this.source&&/\n\s{4}at /.test(ie.stack)){let Z=this.source;ie.stack=ie.stack.replace(/\n\s{4}at /,`$&${Z.input.from}:${Z.start.line}:${Z.start.column}$&`)}return ie}after(ie){return this.parent.insertAfter(this,ie),this}assign(ie={}){for(let Z in ie)this[Z]=ie[Z];return this}before(ie){return this.parent.insertBefore(this,ie),this}cleanRaws(ie){delete this.raws.before,delete this.raws.after,ie||delete this.raws.between}clone(ie={}){let Z=cloneNode(this);for(let ee in ie)Z[ee]=ie[ee];return Z}cloneAfter(ie={}){let Z=this.clone(ie);return this.parent.insertAfter(this,Z),Z}cloneBefore(ie={}){let Z=this.clone(ie);return this.parent.insertBefore(this,Z),Z}error(ie,Z={}){if(this.source){let{end:ee,start:ae}=this.rangeBy(Z);return this.source.input.error(ie,{column:ae.column,line:ae.line},{column:ee.column,line:ee.line},Z)}return new CssSyntaxError$2(ie)}getProxyProcessor(){return{get(ie,Z){return Z==="proxyOf"?ie:Z==="root"?()=>ie.root().toProxy():ie[Z]},set(ie,Z,ee){return ie[Z]===ee||(ie[Z]=ee,(Z==="prop"||Z==="value"||Z==="name"||Z==="params"||Z==="important"||Z==="text")&&ie.markDirty()),!0}}}markDirty(){if(this[isClean$2]){this[isClean$2]=!1;let ie=this;for(;ie=ie.parent;)ie[isClean$2]=!1}}next(){if(!this.parent)return;let ie=this.parent.index(this);return this.parent.nodes[ie+1]}positionBy(ie,Z){let ee=this.source.start;if(ie.index)ee=this.positionInside(ie.index,Z);else if(ie.word){Z=this.toString();let ae=Z.indexOf(ie.word);ae!==-1&&(ee=this.positionInside(ae,Z))}return ee}positionInside(ie,Z){let ee=Z||this.toString(),ae=this.source.start.column,ye=this.source.start.line;for(let ve=0;vetypeof Ye=="object"&&Ye.toJSON?Ye.toJSON(null,Z):Ye);else if(typeof be=="object"&&be.toJSON)ee[ve]=be.toJSON(null,Z);else if(ve==="source"){let Ye=Z.get(be.input);Ye==null&&(Ye=ye,Z.set(be.input,ye),ye++),ee[ve]={end:be.end,inputId:Ye,start:be.start}}else ee[ve]=be}return ae&&(ee.inputs=[...Z.keys()].map(ve=>ve.toJSON())),ee}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(ie=stringify$3){ie.stringify&&(ie=ie.stringify);let Z="";return ie(this,ee=>{Z+=ee}),Z}warn(ie,Z,ee){let ae={node:this};for(let ye in ee)ae[ye]=ee[ye];return ie.warn(Z,ae)}get proxyOf(){return this}};var node=Node$5;Node$5.default=Node$5;let Node$4=node,Declaration$4=class extends Node$4{constructor(ie){ie&&typeof ie.value<"u"&&typeof ie.value!="string"&&(ie={...ie,value:String(ie.value)}),super(ie),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};var declaration=Declaration$4;Declaration$4.default=Declaration$4;let urlAlphabet="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",customAlphabet=(ie,Z=21)=>(ee=Z)=>{let ae="",ye=ee;for(;ye--;)ae+=ie[Math.random()*ie.length|0];return ae},nanoid$1=(ie=21)=>{let Z="",ee=ie;for(;ee--;)Z+=urlAlphabet[Math.random()*64|0];return Z};var nonSecure={nanoid:nanoid$1,customAlphabet};let{SourceMapConsumer:SourceMapConsumer$2,SourceMapGenerator:SourceMapGenerator$2}=require$$2,{existsSync,readFileSync}=require$$2,{dirname:dirname$1,join}=require$$2;function fromBase64(ie){return Buffer?Buffer.from(ie,"base64").toString():window.atob(ie)}let PreviousMap$2=class{constructor(ie,Z){if(Z.map===!1)return;this.loadAnnotation(ie),this.inline=this.startWith(this.annotation,"data:");let ee=Z.map?Z.map.prev:void 0,ae=this.loadMap(Z.from,ee);!this.mapFile&&Z.from&&(this.mapFile=Z.from),this.mapFile&&(this.root=dirname$1(this.mapFile)),ae&&(this.text=ae)}consumer(){return this.consumerCache||(this.consumerCache=new SourceMapConsumer$2(this.text)),this.consumerCache}decodeInline(ie){let Z=/^data:application\/json;charset=utf-?8;base64,/,ee=/^data:application\/json;base64,/,ae=/^data:application\/json;charset=utf-?8,/,ye=/^data:application\/json,/;if(ae.test(ie)||ye.test(ie))return decodeURIComponent(ie.substr(RegExp.lastMatch.length));if(Z.test(ie)||ee.test(ie))return fromBase64(ie.substr(RegExp.lastMatch.length));let ve=ie.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+ve)}getAnnotationURL(ie){return ie.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(ie){return typeof ie!="object"?!1:typeof ie.mappings=="string"||typeof ie._mappings=="string"||Array.isArray(ie.sections)}loadAnnotation(ie){let Z=ie.match(/\/\*\s*# sourceMappingURL=/gm);if(!Z)return;let ee=ie.lastIndexOf(Z.pop()),ae=ie.indexOf("*/",ee);ee>-1&&ae>-1&&(this.annotation=this.getAnnotationURL(ie.substring(ee,ae)))}loadFile(ie){if(this.root=dirname$1(ie),existsSync(ie))return this.mapFile=ie,readFileSync(ie,"utf-8").toString().trim()}loadMap(ie,Z){if(Z===!1)return!1;if(Z){if(typeof Z=="string")return Z;if(typeof Z=="function"){let ee=Z(ie);if(ee){let ae=this.loadFile(ee);if(!ae)throw new Error("Unable to load previous source map: "+ee.toString());return ae}}else{if(Z instanceof SourceMapConsumer$2)return SourceMapGenerator$2.fromSourceMap(Z).toString();if(Z instanceof SourceMapGenerator$2)return Z.toString();if(this.isMap(Z))return JSON.stringify(Z);throw new Error("Unsupported previous source map format: "+Z.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let ee=this.annotation;return ie&&(ee=join(dirname$1(ie),ee)),this.loadFile(ee)}}}startWith(ie,Z){return ie?ie.substr(0,Z.length)===Z:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var previousMap=PreviousMap$2;PreviousMap$2.default=PreviousMap$2;let{SourceMapConsumer:SourceMapConsumer$1,SourceMapGenerator:SourceMapGenerator$1}=require$$2,{fileURLToPath,pathToFileURL:pathToFileURL$1}=require$$2,{isAbsolute,resolve:resolve$1}=require$$2,{nanoid}=nonSecure,terminalHighlight=require$$2,CssSyntaxError$1=cssSyntaxError,PreviousMap$1=previousMap,fromOffsetCache=Symbol("fromOffsetCache"),sourceMapAvailable$1=!!(SourceMapConsumer$1&&SourceMapGenerator$1),pathAvailable$1=!!(resolve$1&&isAbsolute),Input$4=class{constructor(ie,Z={}){if(ie===null||typeof ie>"u"||typeof ie=="object"&&!ie.toString)throw new Error(`PostCSS received ${ie} instead of CSS string`);if(this.css=ie.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,Z.from&&(!pathAvailable$1||/^\w+:\/\//.test(Z.from)||isAbsolute(Z.from)?this.file=Z.from:this.file=resolve$1(Z.from)),pathAvailable$1&&sourceMapAvailable$1){let ee=new PreviousMap$1(this.css,Z);if(ee.text){this.map=ee;let ae=ee.consumer().file;!this.file&&ae&&(this.file=this.mapResolve(ae))}}this.file||(this.id=""),this.map&&(this.map.file=this.from)}error(ie,Z,ee,ae={}){let ye,ve,be;if(Z&&typeof Z=="object"){let Ke=Z,Xe=ee;if(typeof Ke.offset=="number"){let Je=this.fromOffset(Ke.offset);Z=Je.line,ee=Je.col}else Z=Ke.line,ee=Ke.column;if(typeof Xe.offset=="number"){let Je=this.fromOffset(Xe.offset);ve=Je.line,be=Je.col}else ve=Xe.line,be=Xe.column}else if(!ee){let Ke=this.fromOffset(Z);Z=Ke.line,ee=Ke.col}let Ye=this.origin(Z,ee,ve,be);return Ye?ye=new CssSyntaxError$1(ie,Ye.endLine===void 0?Ye.line:{column:Ye.column,line:Ye.line},Ye.endLine===void 0?Ye.column:{column:Ye.endColumn,line:Ye.endLine},Ye.source,Ye.file,ae.plugin):ye=new CssSyntaxError$1(ie,ve===void 0?Z:{column:ee,line:Z},ve===void 0?ee:{column:be,line:ve},this.css,this.file,ae.plugin),ye.input={column:ee,endColumn:be,endLine:ve,line:Z,source:this.css},this.file&&(pathToFileURL$1&&(ye.input.url=pathToFileURL$1(this.file).toString()),ye.input.file=this.file),ye}fromOffset(ie){let Z,ee;if(this[fromOffsetCache])ee=this[fromOffsetCache];else{let ye=this.css.split(` +`);ee=new Array(ye.length);let ve=0;for(let be=0,Ye=ye.length;be=Z)ae=ee.length-1;else{let ye=ee.length-2,ve;for(;ae>1),ie=ee[ve+1])ae=ve+1;else{ae=ve;break}}return{col:ie-ee[ae]+1,line:ae+1}}mapResolve(ie){return/^\w+:\/\//.test(ie)?ie:resolve$1(this.map.consumer().sourceRoot||this.map.root||".",ie)}origin(ie,Z,ee,ae){if(!this.map)return!1;let ye=this.map.consumer(),ve=ye.originalPositionFor({column:Z,line:ie});if(!ve.source)return!1;let be;typeof ee=="number"&&(be=ye.originalPositionFor({column:ae,line:ee}));let Ye;isAbsolute(ve.source)?Ye=pathToFileURL$1(ve.source):Ye=new URL(ve.source,this.map.consumer().sourceRoot||pathToFileURL$1(this.map.mapFile));let Ke={column:ve.column,endColumn:be&&be.column,endLine:be&&be.line,line:ve.line,url:Ye.toString()};if(Ye.protocol==="file:")if(fileURLToPath)Ke.file=fileURLToPath(Ye);else throw new Error("file: protocol is not available in this PostCSS build");let Xe=ye.sourceContentFor(ve.source);return Xe&&(Ke.source=Xe),Ke}toJSON(){let ie={};for(let Z of["hasBOM","css","file","id"])this[Z]!=null&&(ie[Z]=this[Z]);return this.map&&(ie.map={...this.map},ie.map.consumerCache&&(ie.map.consumerCache=void 0)),ie}get from(){return this.file||this.id}};var input=Input$4;Input$4.default=Input$4;terminalHighlight&&terminalHighlight.registerInput&&terminalHighlight.registerInput(Input$4);let{SourceMapConsumer,SourceMapGenerator}=require$$2,{dirname,relative,resolve,sep}=require$$2,{pathToFileURL}=require$$2,Input$3=input,sourceMapAvailable=!!(SourceMapConsumer&&SourceMapGenerator),pathAvailable=!!(dirname&&resolve&&relative&&sep),MapGenerator$2=class{constructor(ie,Z,ee,ae){this.stringify=ie,this.mapOpts=ee.map||{},this.root=Z,this.opts=ee,this.css=ae,this.originalCSS=ae,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let ie;this.isInline()?ie="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?ie=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?ie=this.mapOpts.annotation(this.opts.to,this.root):ie=this.outputFile()+".map";let Z=` +`;this.css.includes(`\r +`)&&(Z=`\r +`),this.css+=Z+"/*# sourceMappingURL="+ie+" */"}applyPrevMaps(){for(let ie of this.previous()){let Z=this.toUrl(this.path(ie.file)),ee=ie.root||dirname(ie.file),ae;this.mapOpts.sourcesContent===!1?(ae=new SourceMapConsumer(ie.text),ae.sourcesContent&&(ae.sourcesContent=ae.sourcesContent.map(()=>null))):ae=ie.consumer(),this.map.applySourceMap(ae,Z,this.toUrl(this.path(ee)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let ie;for(let Z=this.root.nodes.length-1;Z>=0;Z--)ie=this.root.nodes[Z],ie.type==="comment"&&ie.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(Z)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),pathAvailable&&sourceMapAvailable&&this.isMap())return this.generateMap();{let ie="";return this.stringify(this.root,Z=>{ie+=Z}),[ie]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let ie=this.previous()[0].consumer();ie.file=this.outputFile(),this.map=SourceMapGenerator.fromSourceMap(ie)}else this.map=new SourceMapGenerator({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):""});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new SourceMapGenerator({file:this.outputFile()});let ie=1,Z=1,ee="",ae={generated:{column:0,line:0},original:{column:0,line:0},source:""},ye,ve;this.stringify(this.root,(be,Ye,Ke)=>{if(this.css+=be,Ye&&Ke!=="end"&&(ae.generated.line=ie,ae.generated.column=Z-1,Ye.source&&Ye.source.start?(ae.source=this.sourcePath(Ye),ae.original.line=Ye.source.start.line,ae.original.column=Ye.source.start.column-1,this.map.addMapping(ae)):(ae.source=ee,ae.original.line=1,ae.original.column=0,this.map.addMapping(ae))),ye=be.match(/\n/g),ye?(ie+=ye.length,ve=be.lastIndexOf(` +`),Z=be.length-ve):Z+=be.length,Ye&&Ke!=="start"){let Xe=Ye.parent||{raws:{}};(!(Ye.type==="decl"||Ye.type==="atrule"&&!Ye.nodes)||Ye!==Xe.last||Xe.raws.semicolon)&&(Ye.source&&Ye.source.end?(ae.source=this.sourcePath(Ye),ae.original.line=Ye.source.end.line,ae.original.column=Ye.source.end.column-1,ae.generated.line=ie,ae.generated.column=Z-2,this.map.addMapping(ae)):(ae.source=ee,ae.original.line=1,ae.original.column=0,ae.generated.line=ie,ae.generated.column=Z-1,this.map.addMapping(ae)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(ie=>ie.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let ie=this.mapOpts.annotation;return typeof ie<"u"&&ie!==!0?!1:this.previous().length?this.previous().some(Z=>Z.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(ie=>ie.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(ie){if(this.mapOpts.absolute||ie.charCodeAt(0)===60||/^\w+:\/\//.test(ie))return ie;let Z=this.memoizedPaths.get(ie);if(Z)return Z;let ee=this.opts.to?dirname(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(ee=dirname(resolve(ee,this.mapOpts.annotation)));let ae=relative(ee,ie);return this.memoizedPaths.set(ie,ae),ae}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(ie=>{if(ie.source&&ie.source.input.map){let Z=ie.source.input.map;this.previousMaps.includes(Z)||this.previousMaps.push(Z)}});else{let ie=new Input$3(this.originalCSS,this.opts);ie.map&&this.previousMaps.push(ie.map)}return this.previousMaps}setSourcesContent(){let ie={};if(this.root)this.root.walk(Z=>{if(Z.source){let ee=Z.source.input.from;if(ee&&!ie[ee]){ie[ee]=!0;let ae=this.usesFileUrls?this.toFileUrl(ee):this.toUrl(this.path(ee));this.map.setSourceContent(ae,Z.source.input.css)}}});else if(this.css){let Z=this.opts.from?this.toUrl(this.path(this.opts.from)):"";this.map.setSourceContent(Z,this.css)}}sourcePath(ie){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(ie.source.input.from):this.toUrl(this.path(ie.source.input.from))}toBase64(ie){return Buffer?Buffer.from(ie).toString("base64"):window.btoa(unescape(encodeURIComponent(ie)))}toFileUrl(ie){let Z=this.memoizedFileURLs.get(ie);if(Z)return Z;if(pathToFileURL){let ee=pathToFileURL(ie).toString();return this.memoizedFileURLs.set(ie,ee),ee}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(ie){let Z=this.memoizedURLs.get(ie);if(Z)return Z;sep==="\\"&&(ie=ie.replace(/\\/g,"/"));let ee=encodeURI(ie).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(ie,ee),ee}};var mapGenerator=MapGenerator$2;let Node$3=node,Comment$4=class extends Node$3{constructor(ie){super(ie),this.type="comment"}};var comment=Comment$4;Comment$4.default=Comment$4;let{isClean:isClean$1,my:my$1}=symbols,Declaration$3=declaration,Comment$3=comment,Node$2=node,parse$8,Rule$4,AtRule$4,Root$6;function cleanSource(ie){return ie.map(Z=>(Z.nodes&&(Z.nodes=cleanSource(Z.nodes)),delete Z.source,Z))}function markDirtyUp(ie){if(ie[isClean$1]=!1,ie.proxyOf.nodes)for(let Z of ie.proxyOf.nodes)markDirtyUp(Z)}let Container$7=class Qf extends Node$2{append(...Z){for(let ee of Z){let ae=this.normalize(ee,this.last);for(let ye of ae)this.proxyOf.nodes.push(ye)}return this.markDirty(),this}cleanRaws(Z){if(super.cleanRaws(Z),this.nodes)for(let ee of this.nodes)ee.cleanRaws(Z)}each(Z){if(!this.proxyOf.nodes)return;let ee=this.getIterator(),ae,ye;for(;this.indexes[ee]Z[ee](...ae.map(ye=>typeof ye=="function"?(ve,be)=>ye(ve.toProxy(),be):ye)):ee==="every"||ee==="some"?ae=>Z[ee]((ye,...ve)=>ae(ye.toProxy(),...ve)):ee==="root"?()=>Z.root().toProxy():ee==="nodes"?Z.nodes.map(ae=>ae.toProxy()):ee==="first"||ee==="last"?Z[ee].toProxy():Z[ee]:Z[ee]},set(Z,ee,ae){return Z[ee]===ae||(Z[ee]=ae,(ee==="name"||ee==="params"||ee==="selector")&&Z.markDirty()),!0}}}index(Z){return typeof Z=="number"?Z:(Z.proxyOf&&(Z=Z.proxyOf),this.proxyOf.nodes.indexOf(Z))}insertAfter(Z,ee){let ae=this.index(Z),ye=this.normalize(ee,this.proxyOf.nodes[ae]).reverse();ae=this.index(Z);for(let be of ye)this.proxyOf.nodes.splice(ae+1,0,be);let ve;for(let be in this.indexes)ve=this.indexes[be],ae"u")throw new Error("Value field is missed in node creation");typeof Z.value!="string"&&(Z.value=String(Z.value)),Z=[new Declaration$3(Z)]}else if(Z.selector)Z=[new Rule$4(Z)];else if(Z.name)Z=[new AtRule$4(Z)];else if(Z.text)Z=[new Comment$3(Z)];else throw new Error("Unknown node type in node creation");return Z.map(ae=>(ae[my$1]||Qf.rebuild(ae),ae=ae.proxyOf,ae.parent&&ae.parent.removeChild(ae),ae[isClean$1]&&markDirtyUp(ae),typeof ae.raws.before>"u"&&ee&&typeof ee.raws.before<"u"&&(ae.raws.before=ee.raws.before.replace(/\S/g,"")),ae.parent=this.proxyOf,ae))}prepend(...Z){Z=Z.reverse();for(let ee of Z){let ae=this.normalize(ee,this.first,"prepend").reverse();for(let ye of ae)this.proxyOf.nodes.unshift(ye);for(let ye in this.indexes)this.indexes[ye]=this.indexes[ye]+ae.length}return this.markDirty(),this}push(Z){return Z.parent=this,this.proxyOf.nodes.push(Z),this}removeAll(){for(let Z of this.proxyOf.nodes)Z.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(Z){Z=this.index(Z),this.proxyOf.nodes[Z].parent=void 0,this.proxyOf.nodes.splice(Z,1);let ee;for(let ae in this.indexes)ee=this.indexes[ae],ee>=Z&&(this.indexes[ae]=ee-1);return this.markDirty(),this}replaceValues(Z,ee,ae){return ae||(ae=ee,ee={}),this.walkDecls(ye=>{ee.props&&!ee.props.includes(ye.prop)||ee.fast&&!ye.value.includes(ee.fast)||(ye.value=ye.value.replace(Z,ae))}),this.markDirty(),this}some(Z){return this.nodes.some(Z)}walk(Z){return this.each((ee,ae)=>{let ye;try{ye=Z(ee,ae)}catch(ve){throw ee.addToError(ve)}return ye!==!1&&ee.walk&&(ye=ee.walk(Z)),ye})}walkAtRules(Z,ee){return ee?Z instanceof RegExp?this.walk((ae,ye)=>{if(ae.type==="atrule"&&Z.test(ae.name))return ee(ae,ye)}):this.walk((ae,ye)=>{if(ae.type==="atrule"&&ae.name===Z)return ee(ae,ye)}):(ee=Z,this.walk((ae,ye)=>{if(ae.type==="atrule")return ee(ae,ye)}))}walkComments(Z){return this.walk((ee,ae)=>{if(ee.type==="comment")return Z(ee,ae)})}walkDecls(Z,ee){return ee?Z instanceof RegExp?this.walk((ae,ye)=>{if(ae.type==="decl"&&Z.test(ae.prop))return ee(ae,ye)}):this.walk((ae,ye)=>{if(ae.type==="decl"&&ae.prop===Z)return ee(ae,ye)}):(ee=Z,this.walk((ae,ye)=>{if(ae.type==="decl")return ee(ae,ye)}))}walkRules(Z,ee){return ee?Z instanceof RegExp?this.walk((ae,ye)=>{if(ae.type==="rule"&&Z.test(ae.selector))return ee(ae,ye)}):this.walk((ae,ye)=>{if(ae.type==="rule"&&ae.selector===Z)return ee(ae,ye)}):(ee=Z,this.walk((ae,ye)=>{if(ae.type==="rule")return ee(ae,ye)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Container$7.registerParse=ie=>{parse$8=ie};Container$7.registerRule=ie=>{Rule$4=ie};Container$7.registerAtRule=ie=>{AtRule$4=ie};Container$7.registerRoot=ie=>{Root$6=ie};var container=Container$7;Container$7.default=Container$7;Container$7.rebuild=ie=>{ie.type==="atrule"?Object.setPrototypeOf(ie,AtRule$4.prototype):ie.type==="rule"?Object.setPrototypeOf(ie,Rule$4.prototype):ie.type==="decl"?Object.setPrototypeOf(ie,Declaration$3.prototype):ie.type==="comment"?Object.setPrototypeOf(ie,Comment$3.prototype):ie.type==="root"&&Object.setPrototypeOf(ie,Root$6.prototype),ie[my$1]=!0,ie.nodes&&ie.nodes.forEach(Z=>{Container$7.rebuild(Z)})};let Container$6=container,LazyResult$4,Processor$3,Document$3=class extends Container$6{constructor(ie){super({type:"document",...ie}),this.nodes||(this.nodes=[])}toResult(ie={}){return new LazyResult$4(new Processor$3,this,ie).stringify()}};Document$3.registerLazyResult=ie=>{LazyResult$4=ie};Document$3.registerProcessor=ie=>{Processor$3=ie};var document$1=Document$3;Document$3.default=Document$3;let Warning$2=class{constructor(ie,Z={}){if(this.type="warning",this.text=ie,Z.node&&Z.node.source){let ee=Z.node.rangeBy(Z);this.line=ee.start.line,this.column=ee.start.column,this.endLine=ee.end.line,this.endColumn=ee.end.column}for(let ee in Z)this[ee]=Z[ee]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var warning=Warning$2;Warning$2.default=Warning$2;let Warning$1=warning,Result$3=class{constructor(ie,Z,ee){this.processor=ie,this.messages=[],this.root=Z,this.opts=ee,this.css=void 0,this.map=void 0}toString(){return this.css}warn(ie,Z={}){Z.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(Z.plugin=this.lastPlugin.postcssPlugin);let ee=new Warning$1(ie,Z);return this.messages.push(ee),ee}warnings(){return this.messages.filter(ie=>ie.type==="warning")}get content(){return this.css}};var result=Result$3;Result$3.default=Result$3;const SINGLE_QUOTE=39,DOUBLE_QUOTE=34,BACKSLASH=92,SLASH=47,NEWLINE=10,SPACE=32,FEED=12,TAB=9,CR=13,OPEN_SQUARE=91,CLOSE_SQUARE=93,OPEN_PARENTHESES=40,CLOSE_PARENTHESES=41,OPEN_CURLY=123,CLOSE_CURLY=125,SEMICOLON=59,ASTERISK=42,COLON=58,AT=64,RE_AT_END=/[\t\n\f\r "#'()/;[\\\]{}]/g,RE_WORD_END=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,RE_BAD_BRACKET=/.[\r\n"'(/\\]/,RE_HEX_ESCAPE=/[\da-f]/i;var tokenize=function(ie,Z={}){let ee=ie.css.valueOf(),ae=Z.ignoreErrors,ye,ve,be,Ye,Ke,Xe,Je,rt,nt,it,lt=ee.length,ct=0,ot=[],dt=[];function ft(){return ct}function gt(Xr){throw ie.error("Unclosed "+Xr,ct)}function mt(){return dt.length===0&&ct>=lt}function Yr(Xr){if(dt.length)return dt.pop();if(ct>=lt)return;let Jr=Xr?Xr.ignoreUnclosed:!1;switch(ye=ee.charCodeAt(ct),ye){case NEWLINE:case SPACE:case TAB:case CR:case FEED:{ve=ct;do ve+=1,ye=ee.charCodeAt(ve);while(ye===SPACE||ye===NEWLINE||ye===TAB||ye===CR||ye===FEED);it=["space",ee.slice(ct,ve)],ct=ve-1;break}case OPEN_SQUARE:case CLOSE_SQUARE:case OPEN_CURLY:case CLOSE_CURLY:case COLON:case SEMICOLON:case CLOSE_PARENTHESES:{let ai=String.fromCharCode(ye);it=[ai,ai,ct];break}case OPEN_PARENTHESES:{if(rt=ot.length?ot.pop()[1]:"",nt=ee.charCodeAt(ct+1),rt==="url"&&nt!==SINGLE_QUOTE&&nt!==DOUBLE_QUOTE&&nt!==SPACE&&nt!==NEWLINE&&nt!==TAB&&nt!==FEED&&nt!==CR){ve=ct;do{if(Xe=!1,ve=ee.indexOf(")",ve+1),ve===-1)if(ae||Jr){ve=ct;break}else gt("bracket");for(Je=ve;ee.charCodeAt(Je-1)===BACKSLASH;)Je-=1,Xe=!Xe}while(Xe);it=["brackets",ee.slice(ct,ve+1),ct,ve],ct=ve}else ve=ee.indexOf(")",ct+1),Ye=ee.slice(ct,ve+1),ve===-1||RE_BAD_BRACKET.test(Ye)?it=["(","(",ct]:(it=["brackets",Ye,ct,ve],ct=ve);break}case SINGLE_QUOTE:case DOUBLE_QUOTE:{be=ye===SINGLE_QUOTE?"'":'"',ve=ct;do{if(Xe=!1,ve=ee.indexOf(be,ve+1),ve===-1)if(ae||Jr){ve=ct+1;break}else gt("string");for(Je=ve;ee.charCodeAt(Je-1)===BACKSLASH;)Je-=1,Xe=!Xe}while(Xe);it=["string",ee.slice(ct,ve+1),ct,ve],ct=ve;break}case AT:{RE_AT_END.lastIndex=ct+1,RE_AT_END.test(ee),RE_AT_END.lastIndex===0?ve=ee.length-1:ve=RE_AT_END.lastIndex-2,it=["at-word",ee.slice(ct,ve+1),ct,ve],ct=ve;break}case BACKSLASH:{for(ve=ct,Ke=!0;ee.charCodeAt(ve+1)===BACKSLASH;)ve+=1,Ke=!Ke;if(ye=ee.charCodeAt(ve+1),Ke&&ye!==SLASH&&ye!==SPACE&&ye!==NEWLINE&&ye!==TAB&&ye!==CR&&ye!==FEED&&(ve+=1,RE_HEX_ESCAPE.test(ee.charAt(ve)))){for(;RE_HEX_ESCAPE.test(ee.charAt(ve+1));)ve+=1;ee.charCodeAt(ve+1)===SPACE&&(ve+=1)}it=["word",ee.slice(ct,ve+1),ct,ve],ct=ve;break}default:{ye===SLASH&&ee.charCodeAt(ct+1)===ASTERISK?(ve=ee.indexOf("*/",ct+2)+1,ve===0&&(ae||Jr?ve=ee.length:gt("comment")),it=["comment",ee.slice(ct,ve+1),ct,ve],ct=ve):(RE_WORD_END.lastIndex=ct+1,RE_WORD_END.test(ee),RE_WORD_END.lastIndex===0?ve=ee.length-1:ve=RE_WORD_END.lastIndex-2,it=["word",ee.slice(ct,ve+1),ct,ve],ot.push(it),ct=ve);break}}return ct++,it}function Qr(Xr){dt.push(Xr)}return{back:Qr,endOfFile:mt,nextToken:Yr,position:ft}};let Container$5=container,AtRule$3=class extends Container$5{constructor(ie){super(ie),this.type="atrule"}append(...ie){return this.proxyOf.nodes||(this.nodes=[]),super.append(...ie)}prepend(...ie){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...ie)}};var atRule=AtRule$3;AtRule$3.default=AtRule$3;Container$5.registerAtRule(AtRule$3);let Container$4=container,LazyResult$3,Processor$2,Root$5=class extends Container$4{constructor(ie){super(ie),this.type="root",this.nodes||(this.nodes=[])}normalize(ie,Z,ee){let ae=super.normalize(ie);if(Z){if(ee==="prepend")this.nodes.length>1?Z.raws.before=this.nodes[1].raws.before:delete Z.raws.before;else if(this.first!==Z)for(let ye of ae)ye.raws.before=Z.raws.before}return ae}removeChild(ie,Z){let ee=this.index(ie);return!Z&&ee===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[ee].raws.before),super.removeChild(ie)}toResult(ie={}){return new LazyResult$3(new Processor$2,this,ie).stringify()}};Root$5.registerLazyResult=ie=>{LazyResult$3=ie};Root$5.registerProcessor=ie=>{Processor$2=ie};var root=Root$5;Root$5.default=Root$5;Container$4.registerRoot(Root$5);let list$2={comma(ie){return list$2.split(ie,[","],!0)},space(ie){let Z=[" ",` +`," "];return list$2.split(ie,Z)},split(ie,Z,ee){let ae=[],ye="",ve=!1,be=0,Ye=!1,Ke="",Xe=!1;for(let Je of ie)Xe?Xe=!1:Je==="\\"?Xe=!0:Ye?Je===Ke&&(Ye=!1):Je==='"'||Je==="'"?(Ye=!0,Ke=Je):Je==="("?be+=1:Je===")"?be>0&&(be-=1):be===0&&Z.includes(Je)&&(ve=!0),ve?(ye!==""&&ae.push(ye.trim()),ye="",ve=!1):ye+=Je;return(ee||ye!=="")&&ae.push(ye.trim()),ae}};var list_1=list$2;list$2.default=list$2;let Container$3=container,list$1=list_1,Rule$3=class extends Container$3{constructor(ie){super(ie),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return list$1.comma(this.selector)}set selectors(ie){let Z=this.selector?this.selector.match(/,\s*/):null,ee=Z?Z[0]:","+this.raw("between","beforeOpen");this.selector=ie.join(ee)}};var rule=Rule$3;Rule$3.default=Rule$3;Container$3.registerRule(Rule$3);let Declaration$2=declaration,tokenizer=tokenize,Comment$2=comment,AtRule$2=atRule,Root$4=root,Rule$2=rule;const SAFE_COMMENT_NEIGHBOR={empty:!0,space:!0};function findLastWithPosition(ie){for(let Z=ie.length-1;Z>=0;Z--){let ee=ie[Z],ae=ee[3]||ee[2];if(ae)return ae}}let Parser$1=class{constructor(ie){this.input=ie,this.root=new Root$4,this.current=this.root,this.spaces="",this.semicolon=!1,this.customProperty=!1,this.createTokenizer(),this.root.source={input:ie,start:{column:1,line:1,offset:0}}}atrule(ie){let Z=new AtRule$2;Z.name=ie[1].slice(1),Z.name===""&&this.unnamedAtrule(Z,ie),this.init(Z,ie[2]);let ee,ae,ye,ve=!1,be=!1,Ye=[],Ke=[];for(;!this.tokenizer.endOfFile();){if(ie=this.tokenizer.nextToken(),ee=ie[0],ee==="("||ee==="["?Ke.push(ee==="("?")":"]"):ee==="{"&&Ke.length>0?Ke.push("}"):ee===Ke[Ke.length-1]&&Ke.pop(),Ke.length===0)if(ee===";"){Z.source.end=this.getPosition(ie[2]),Z.source.end.offset++,this.semicolon=!0;break}else if(ee==="{"){be=!0;break}else if(ee==="}"){if(Ye.length>0){for(ye=Ye.length-1,ae=Ye[ye];ae&&ae[0]==="space";)ae=Ye[--ye];ae&&(Z.source.end=this.getPosition(ae[3]||ae[2]),Z.source.end.offset++)}this.end(ie);break}else Ye.push(ie);else Ye.push(ie);if(this.tokenizer.endOfFile()){ve=!0;break}}Z.raws.between=this.spacesAndCommentsFromEnd(Ye),Ye.length?(Z.raws.afterName=this.spacesAndCommentsFromStart(Ye),this.raw(Z,"params",Ye),ve&&(ie=Ye[Ye.length-1],Z.source.end=this.getPosition(ie[3]||ie[2]),Z.source.end.offset++,this.spaces=Z.raws.between,Z.raws.between="")):(Z.raws.afterName="",Z.params=""),be&&(Z.nodes=[],this.current=Z)}checkMissedSemicolon(ie){let Z=this.colon(ie);if(Z===!1)return;let ee=0,ae;for(let ye=Z-1;ye>=0&&(ae=ie[ye],!(ae[0]!=="space"&&(ee+=1,ee===2)));ye--);throw this.input.error("Missed semicolon",ae[0]==="word"?ae[3]+1:ae[2])}colon(ie){let Z=0,ee,ae,ye;for(let[ve,be]of ie.entries()){if(ee=be,ae=ee[0],ae==="("&&(Z+=1),ae===")"&&(Z-=1),Z===0&&ae===":")if(!ye)this.doubleColon(ee);else{if(ye[0]==="word"&&ye[1]==="progid")continue;return ve}ye=ee}return!1}comment(ie){let Z=new Comment$2;this.init(Z,ie[2]),Z.source.end=this.getPosition(ie[3]||ie[2]),Z.source.end.offset++;let ee=ie[1].slice(2,-2);if(/^\s*$/.test(ee))Z.text="",Z.raws.left=ee,Z.raws.right="";else{let ae=ee.match(/^(\s*)([^]*\S)(\s*)$/);Z.text=ae[2],Z.raws.left=ae[1],Z.raws.right=ae[3]}}createTokenizer(){this.tokenizer=tokenizer(this.input)}decl(ie,Z){let ee=new Declaration$2;this.init(ee,ie[0][2]);let ae=ie[ie.length-1];for(ae[0]===";"&&(this.semicolon=!0,ie.pop()),ee.source.end=this.getPosition(ae[3]||ae[2]||findLastWithPosition(ie)),ee.source.end.offset++;ie[0][0]!=="word";)ie.length===1&&this.unknownWord(ie),ee.raws.before+=ie.shift()[1];for(ee.source.start=this.getPosition(ie[0][2]),ee.prop="";ie.length;){let Ye=ie[0][0];if(Ye===":"||Ye==="space"||Ye==="comment")break;ee.prop+=ie.shift()[1]}ee.raws.between="";let ye;for(;ie.length;)if(ye=ie.shift(),ye[0]===":"){ee.raws.between+=ye[1];break}else ye[0]==="word"&&/\w/.test(ye[1])&&this.unknownWord([ye]),ee.raws.between+=ye[1];(ee.prop[0]==="_"||ee.prop[0]==="*")&&(ee.raws.before+=ee.prop[0],ee.prop=ee.prop.slice(1));let ve=[],be;for(;ie.length&&(be=ie[0][0],!(be!=="space"&&be!=="comment"));)ve.push(ie.shift());this.precheckMissedSemicolon(ie);for(let Ye=ie.length-1;Ye>=0;Ye--){if(ye=ie[Ye],ye[1].toLowerCase()==="!important"){ee.important=!0;let Ke=this.stringFrom(ie,Ye);Ke=this.spacesFromEnd(ie)+Ke,Ke!==" !important"&&(ee.raws.important=Ke);break}else if(ye[1].toLowerCase()==="important"){let Ke=ie.slice(0),Xe="";for(let Je=Ye;Je>0;Je--){let rt=Ke[Je][0];if(Xe.trim().indexOf("!")===0&&rt!=="space")break;Xe=Ke.pop()[1]+Xe}Xe.trim().indexOf("!")===0&&(ee.important=!0,ee.raws.important=Xe,ie=Ke)}if(ye[0]!=="space"&&ye[0]!=="comment")break}ie.some(Ye=>Ye[0]!=="space"&&Ye[0]!=="comment")&&(ee.raws.between+=ve.map(Ye=>Ye[1]).join(""),ve=[]),this.raw(ee,"value",ve.concat(ie),Z),ee.value.includes(":")&&!Z&&this.checkMissedSemicolon(ie)}doubleColon(ie){throw this.input.error("Double colon",{offset:ie[2]},{offset:ie[2]+ie[1].length})}emptyRule(ie){let Z=new Rule$2;this.init(Z,ie[2]),Z.selector="",Z.raws.between="",this.current=Z}end(ie){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(ie[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(ie)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(ie){if(this.spaces+=ie[1],this.current.nodes){let Z=this.current.nodes[this.current.nodes.length-1];Z&&Z.type==="rule"&&!Z.raws.ownSemicolon&&(Z.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(ie){let Z=this.input.fromOffset(ie);return{column:Z.col,line:Z.line,offset:ie}}init(ie,Z){this.current.push(ie),ie.source={input:this.input,start:this.getPosition(Z)},ie.raws.before=this.spaces,this.spaces="",ie.type!=="comment"&&(this.semicolon=!1)}other(ie){let Z=!1,ee=null,ae=!1,ye=null,ve=[],be=ie[1].startsWith("--"),Ye=[],Ke=ie;for(;Ke;){if(ee=Ke[0],Ye.push(Ke),ee==="("||ee==="[")ye||(ye=Ke),ve.push(ee==="("?")":"]");else if(be&&ae&&ee==="{")ye||(ye=Ke),ve.push("}");else if(ve.length===0)if(ee===";")if(ae){this.decl(Ye,be);return}else break;else if(ee==="{"){this.rule(Ye);return}else if(ee==="}"){this.tokenizer.back(Ye.pop()),Z=!0;break}else ee===":"&&(ae=!0);else ee===ve[ve.length-1]&&(ve.pop(),ve.length===0&&(ye=null));Ke=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(Z=!0),ve.length>0&&this.unclosedBracket(ye),Z&&ae){if(!be)for(;Ye.length&&(Ke=Ye[Ye.length-1][0],!(Ke!=="space"&&Ke!=="comment"));)this.tokenizer.back(Ye.pop());this.decl(Ye,be)}else this.unknownWord(Ye)}parse(){let ie;for(;!this.tokenizer.endOfFile();)switch(ie=this.tokenizer.nextToken(),ie[0]){case"space":this.spaces+=ie[1];break;case";":this.freeSemicolon(ie);break;case"}":this.end(ie);break;case"comment":this.comment(ie);break;case"at-word":this.atrule(ie);break;case"{":this.emptyRule(ie);break;default:this.other(ie);break}this.endFile()}precheckMissedSemicolon(){}raw(ie,Z,ee,ae){let ye,ve,be=ee.length,Ye="",Ke=!0,Xe,Je;for(let rt=0;rtnt+it[1],"");ie.raws[Z]={raw:rt,value:Ye}}ie[Z]=Ye}rule(ie){ie.pop();let Z=new Rule$2;this.init(Z,ie[0][2]),Z.raws.between=this.spacesAndCommentsFromEnd(ie),this.raw(Z,"selector",ie),this.current=Z}spacesAndCommentsFromEnd(ie){let Z,ee="";for(;ie.length&&(Z=ie[ie.length-1][0],!(Z!=="space"&&Z!=="comment"));)ee=ie.pop()[1]+ee;return ee}spacesAndCommentsFromStart(ie){let Z,ee="";for(;ie.length&&(Z=ie[0][0],!(Z!=="space"&&Z!=="comment"));)ee+=ie.shift()[1];return ee}spacesFromEnd(ie){let Z,ee="";for(;ie.length&&(Z=ie[ie.length-1][0],Z==="space");)ee=ie.pop()[1]+ee;return ee}stringFrom(ie,Z){let ee="";for(let ae=Z;aecleanMarks(Z)),ie}let postcss$1={},LazyResult$2=class Jf{constructor(Z,ee,ae){this.stringified=!1,this.processed=!1;let ye;if(typeof ee=="object"&&ee!==null&&(ee.type==="root"||ee.type==="document"))ye=cleanMarks(ee);else if(ee instanceof Jf||ee instanceof Result$2)ye=cleanMarks(ee.root),ee.map&&(typeof ae.map>"u"&&(ae.map={}),ae.map.inline||(ae.map.inline=!1),ae.map.prev=ee.map);else{let ve=parse$6;ae.syntax&&(ve=ae.syntax.parse),ae.parser&&(ve=ae.parser),ve.parse&&(ve=ve.parse);try{ye=ve(ee,ae)}catch(be){this.processed=!0,this.error=be}ye&&!ye[my]&&Container$1.rebuild(ye)}this.result=new Result$2(Z,ye,ae),this.helpers={...postcss$1,postcss:postcss$1,result:this.result},this.plugins=this.processor.plugins.map(ve=>typeof ve=="object"&&ve.prepare?{...ve,...ve.prepare(this.result)}:ve)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(Z){return this.async().catch(Z)}finally(Z){return this.async().then(Z,Z)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(Z,ee){let ae=this.result.lastPlugin;try{ee&&ee.addToError(Z),this.error=Z,Z.name==="CssSyntaxError"&&!Z.plugin?(Z.plugin=ae.postcssPlugin,Z.setMessage()):ae.postcssVersion}catch(ye){console&&console.error&&console.error(ye)}return Z}prepareVisitors(){this.listeners={};let Z=(ee,ae,ye)=>{this.listeners[ae]||(this.listeners[ae]=[]),this.listeners[ae].push([ee,ye])};for(let ee of this.plugins)if(typeof ee=="object")for(let ae in ee){if(!PLUGIN_PROPS[ae]&&/^[A-Z]/.test(ae))throw new Error(`Unknown event ${ae} in ${ee.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!NOT_VISITORS[ae])if(typeof ee[ae]=="object")for(let ye in ee[ae])ye==="*"?Z(ee,ae,ee[ae][ye]):Z(ee,ae+"-"+ye.toLowerCase(),ee[ae][ye]);else typeof ee[ae]=="function"&&Z(ee,ae,ee[ae])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let Z=0;Z0;){let ae=this.visitTick(ee);if(isPromise$1(ae))try{await ae}catch(ye){let ve=ee[ee.length-1].node;throw this.handleError(ye,ve)}}}if(this.listeners.OnceExit)for(let[ee,ae]of this.listeners.OnceExit){this.result.lastPlugin=ee;try{if(Z.type==="document"){let ye=Z.nodes.map(ve=>ae(ve,this.helpers));await Promise.all(ye)}else await ae(Z,this.helpers)}catch(ye){throw this.handleError(ye)}}}return this.processed=!0,this.stringify()}runOnRoot(Z){this.result.lastPlugin=Z;try{if(typeof Z=="object"&&Z.Once){if(this.result.root.type==="document"){let ee=this.result.root.nodes.map(ae=>Z.Once(ae,this.helpers));return isPromise$1(ee[0])?Promise.all(ee):ee}return Z.Once(this.result.root,this.helpers)}else if(typeof Z=="function")return Z(this.result.root,this.result)}catch(ee){throw this.handleError(ee)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let Z=this.result.opts,ee=stringify$2;Z.syntax&&(ee=Z.syntax.stringify),Z.stringifier&&(ee=Z.stringifier),ee.stringify&&(ee=ee.stringify);let ae=new MapGenerator$1(ee,this.result.root,this.result.opts).generate();return this.result.css=ae[0],this.result.map=ae[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let Z of this.plugins){let ee=this.runOnRoot(Z);if(isPromise$1(ee))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let Z=this.result.root;for(;!Z[isClean];)Z[isClean]=!0,this.walkSync(Z);if(this.listeners.OnceExit)if(Z.type==="document")for(let ee of Z.nodes)this.visitSync(this.listeners.OnceExit,ee);else this.visitSync(this.listeners.OnceExit,Z)}return this.result}then(Z,ee){return this.async().then(Z,ee)}toString(){return this.css}visitSync(Z,ee){for(let[ae,ye]of Z){this.result.lastPlugin=ae;let ve;try{ve=ye(ee,this.helpers)}catch(be){throw this.handleError(be,ee.proxyOf)}if(ee.type!=="root"&&ee.type!=="document"&&!ee.parent)return!0;if(isPromise$1(ve))throw this.getAsyncError()}}visitTick(Z){let ee=Z[Z.length-1],{node:ae,visitors:ye}=ee;if(ae.type!=="root"&&ae.type!=="document"&&!ae.parent){Z.pop();return}if(ye.length>0&&ee.visitorIndex{ye[isClean]||this.walkSync(ye)});else{let ye=this.listeners[ae];if(ye&&this.visitSync(ye,Z.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};LazyResult$2.registerPostcss=ie=>{postcss$1=ie};var lazyResult=LazyResult$2;LazyResult$2.default=LazyResult$2;Root$3.registerLazyResult(LazyResult$2);Document$2.registerLazyResult(LazyResult$2);let MapGenerator=mapGenerator,stringify$1=stringify_1,parse$5=parse_1;const Result$1=result;let NoWorkResult$1=class{constructor(ie,Z,ee){Z=Z.toString(),this.stringified=!1,this._processor=ie,this._css=Z,this._opts=ee,this._map=void 0;let ae,ye=stringify$1;this.result=new Result$1(this._processor,ae,this._opts),this.result.css=Z;let ve=this;Object.defineProperty(this.result,"root",{get(){return ve.root}});let be=new MapGenerator(ye,ae,this._opts,Z);if(be.isMap()){let[Ye,Ke]=be.generate();Ye&&(this.result.css=Ye),Ke&&(this.result.map=Ke)}else be.clearAnnotation(),this.result.css=be.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(ie){return this.async().catch(ie)}finally(ie){return this.async().then(ie,ie)}sync(){if(this.error)throw this.error;return this.result}then(ie,Z){return this.async().then(ie,Z)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let ie,Z=parse$5;try{ie=Z(this._css,this._opts)}catch(ee){this.error=ee}if(this.error)throw this.error;return this._root=ie,ie}get[Symbol.toStringTag](){return"NoWorkResult"}};var noWorkResult=NoWorkResult$1;NoWorkResult$1.default=NoWorkResult$1;let NoWorkResult=noWorkResult,LazyResult$1=lazyResult,Document$1=document$1,Root$2=root,Processor$1=class{constructor(ie=[]){this.version="8.4.33",this.plugins=this.normalize(ie)}normalize(ie){let Z=[];for(let ee of ie)if(ee.postcss===!0?ee=ee():ee.postcss&&(ee=ee.postcss),typeof ee=="object"&&Array.isArray(ee.plugins))Z=Z.concat(ee.plugins);else if(typeof ee=="object"&&ee.postcssPlugin)Z.push(ee);else if(typeof ee=="function")Z.push(ee);else if(!(typeof ee=="object"&&(ee.parse||ee.stringify)))throw new Error(ee+" is not a PostCSS plugin");return Z}process(ie,Z={}){return!this.plugins.length&&!Z.parser&&!Z.stringifier&&!Z.syntax?new NoWorkResult(this,ie,Z):new LazyResult$1(this,ie,Z)}use(ie){return this.plugins=this.plugins.concat(this.normalize([ie])),this}};var processor=Processor$1;Processor$1.default=Processor$1;Root$2.registerProcessor(Processor$1);Document$1.registerProcessor(Processor$1);let Declaration$1=declaration,PreviousMap=previousMap,Comment$1=comment,AtRule$1=atRule,Input$1=input,Root$1=root,Rule$1=rule;function fromJSON$1(ie,Z){if(Array.isArray(ie))return ie.map(ye=>fromJSON$1(ye));let{inputs:ee,...ae}=ie;if(ee){Z=[];for(let ye of ee){let ve={...ye,__proto__:Input$1.prototype};ve.map&&(ve.map={...ve.map,__proto__:PreviousMap.prototype}),Z.push(ve)}}if(ae.nodes&&(ae.nodes=ie.nodes.map(ye=>fromJSON$1(ye,Z))),ae.source){let{inputId:ye,...ve}=ae.source;ae.source=ve,ye!=null&&(ae.source.input=Z[ye])}if(ae.type==="root")return new Root$1(ae);if(ae.type==="decl")return new Declaration$1(ae);if(ae.type==="rule")return new Rule$1(ae);if(ae.type==="comment")return new Comment$1(ae);if(ae.type==="atrule")return new AtRule$1(ae);throw new Error("Unknown node type: "+ie.type)}var fromJSON_1=fromJSON$1;fromJSON$1.default=fromJSON$1;let CssSyntaxError=cssSyntaxError,Declaration=declaration,LazyResult=lazyResult,Container=container,Processor=processor,stringify=stringify_1,fromJSON=fromJSON_1,Document=document$1,Warning=warning,Comment=comment,AtRule=atRule,Result=result,Input=input,parse$4=parse_1,list=list_1,Rule=rule,Root=root,Node$1=node;function postcss(...ie){return ie.length===1&&Array.isArray(ie[0])&&(ie=ie[0]),new Processor(ie)}postcss.plugin=function(ie,Z){let ee=!1;function ae(...ve){console&&console.warn&&!ee&&(ee=!0,console.warn(ie+`: postcss.plugin was deprecated. Migration guide: +https://evilmartians.com/chronicles/postcss-8-plugin-migration`),define_process_env_default.LANG&&define_process_env_default.LANG.startsWith("cn")&&console.warn(ie+`: 里面 postcss.plugin 被弃用. 迁移指南: +https://www.w3ctech.com/topic/2226`));let be=Z(...ve);return be.postcssPlugin=ie,be.postcssVersion=new Processor().version,be}let ye;return Object.defineProperty(ae,"postcss",{get(){return ye||(ye=ae()),ye}}),ae.process=function(ve,be,Ye){return postcss([ae(Ye)]).process(ve,be)},ae};postcss.stringify=stringify;postcss.parse=parse$4;postcss.fromJSON=fromJSON;postcss.list=list;postcss.comment=ie=>new Comment(ie);postcss.atRule=ie=>new AtRule(ie);postcss.decl=ie=>new Declaration(ie);postcss.rule=ie=>new Rule(ie);postcss.root=ie=>new Root(ie);postcss.document=ie=>new Document(ie);postcss.CssSyntaxError=CssSyntaxError;postcss.Declaration=Declaration;postcss.Container=Container;postcss.Processor=Processor;postcss.Document=Document;postcss.Comment=Comment;postcss.Warning=Warning;postcss.AtRule=AtRule;postcss.Result=Result;postcss.Input=Input;postcss.Rule=Rule;postcss.Root=Root;postcss.Node=Node$1;LazyResult.registerPostcss(postcss);var postcss_1=postcss;postcss.default=postcss;const htmlparser=lib$5,escapeStringRegexp=escapeStringRegexp$1,{isPlainObject}=isPlainObject$2,deepmerge=cjs,parseSrcset=parseSrcsetExports,{parse:postcssParse}=postcss_1,mediaTags=["img","audio","video","picture","svg","object","map","iframe","embed"],vulnerableTags=["script","style"];function each(ie,Z){ie&&Object.keys(ie).forEach(function(ee){Z(ie[ee],ee)})}function has(ie,Z){return{}.hasOwnProperty.call(ie,Z)}function filter(ie,Z){const ee=[];return each(ie,function(ae){Z(ae)&&ee.push(ae)}),ee}function isEmptyObject(ie){for(const Z in ie)if(has(ie,Z))return!1;return!0}function stringifySrcset(ie){return ie.map(function(Z){if(!Z.url)throw new Error("URL missing");return Z.url+(Z.w?` ${Z.w}w`:"")+(Z.h?` ${Z.h}h`:"")+(Z.d?` ${Z.d}x`:"")}).join(", ")}var sanitizeHtml_1=sanitizeHtml;const VALID_HTML_ATTRIBUTE_NAME=/^[^\0\t\n\f\r /<=>]+$/;function sanitizeHtml(ie,Z,ee){if(ie==null)return"";typeof ie=="number"&&(ie=ie.toString());let ae="",ye="";function ve(ii,hi){const ri=this;this.tag=ii,this.attribs=hi||{},this.tagPosition=ae.length,this.text="",this.mediaChildren=[],this.updateParentNodeText=function(){if(ot.length){const ci=ot[ot.length-1];ci.text+=ri.text}},this.updateParentNodeMediaChildren=function(){ot.length&&mediaTags.includes(this.tag)&&ot[ot.length-1].mediaChildren.push(this.tag)}}Z=Object.assign({},sanitizeHtml.defaults,Z),Z.parser=Object.assign({},htmlParserDefaults,Z.parser);const be=function(ii){return Z.allowedTags===!1||(Z.allowedTags||[]).indexOf(ii)>-1};vulnerableTags.forEach(function(ii){be(ii)&&!Z.allowVulnerableTags&&console.warn(` + +⚠️ Your \`allowedTags\` option includes, \`${ii}\`, which is inherently +vulnerable to XSS attacks. Please remove it from \`allowedTags\`. +Or, to disable this warning, add the \`allowVulnerableTags\` option +and ensure you are accounting for this risk. + +`)});const Ye=Z.nonTextTags||["script","style","textarea","option"];let Ke,Xe;Z.allowedAttributes&&(Ke={},Xe={},each(Z.allowedAttributes,function(ii,hi){Ke[hi]=[];const ri=[];ii.forEach(function(ci){typeof ci=="string"&&ci.indexOf("*")>=0?ri.push(escapeStringRegexp(ci).replace(/\\\*/g,".*")):Ke[hi].push(ci)}),ri.length&&(Xe[hi]=new RegExp("^("+ri.join("|")+")$"))}));const Je={},rt={},nt={};each(Z.allowedClasses,function(ii,hi){if(Ke&&(has(Ke,hi)||(Ke[hi]=[]),Ke[hi].push("class")),Je[hi]=ii,Array.isArray(ii)){const ri=[];Je[hi]=[],nt[hi]=[],ii.forEach(function(ci){typeof ci=="string"&&ci.indexOf("*")>=0?ri.push(escapeStringRegexp(ci).replace(/\\\*/g,".*")):ci instanceof RegExp?nt[hi].push(ci):Je[hi].push(ci)}),ri.length&&(rt[hi]=new RegExp("^("+ri.join("|")+")$"))}});const it={};let lt;each(Z.transformTags,function(ii,hi){let ri;typeof ii=="function"?ri=ii:typeof ii=="string"&&(ri=sanitizeHtml.simpleTransform(ii)),hi==="*"?lt=ri:it[hi]=ri});let ct,ot,dt,ft,gt,mt,Yr=!1;Xr();const Qr=new htmlparser.Parser({onopentag:function(ii,hi){if(Z.enforceHtmlBoundary&&ii==="html"&&Xr(),gt){mt++;return}const ri=new ve(ii,hi);ot.push(ri);let ci=!1;const Si=!!ri.text;let si;if(has(it,ii)&&(si=it[ii](ii,hi),ri.attribs=hi=si.attribs,si.text!==void 0&&(ri.innerText=si.text),ii!==si.tagName&&(ri.name=ii=si.tagName,ft[ct]=si.tagName)),lt&&(si=lt(ii,hi),ri.attribs=hi=si.attribs,ii!==si.tagName&&(ri.name=ii=si.tagName,ft[ct]=si.tagName)),(!be(ii)||Z.disallowedTagsMode==="recursiveEscape"&&!isEmptyObject(dt)||Z.nestingLimit!=null&&ct>=Z.nestingLimit)&&(ci=!0,dt[ct]=!0,Z.disallowedTagsMode==="discard"&&Ye.indexOf(ii)!==-1&&(gt=!0,mt=1),dt[ct]=!0),ct++,ci){if(Z.disallowedTagsMode==="discard")return;ye=ae,ae=""}ae+="<"+ii,ii==="script"&&(Z.allowedScriptHostnames||Z.allowedScriptDomains)&&(ri.innerText=""),(!Ke||has(Ke,ii)||Ke["*"])&&each(hi,function(Ei,yi){if(!VALID_HTML_ATTRIBUTE_NAME.test(yi)){delete ri.attribs[yi];return}if(Ei===""&&(Z.nonBooleanAttributes.includes(yi)||Z.nonBooleanAttributes.includes("*"))){delete ri.attribs[yi];return}let Mi=!1;if(!Ke||has(Ke,ii)&&Ke[ii].indexOf(yi)!==-1||Ke["*"]&&Ke["*"].indexOf(yi)!==-1||has(Xe,ii)&&Xe[ii].test(yi)||Xe["*"]&&Xe["*"].test(yi))Mi=!0;else if(Ke&&Ke[ii]){for(const Ci of Ke[ii])if(isPlainObject(Ci)&&Ci.name&&Ci.name===yi){Mi=!0;let Ri="";if(Ci.multiple===!0){const Ni=Ei.split(" ");for(const Ai of Ni)Ci.values.indexOf(Ai)!==-1&&(Ri===""?Ri=Ai:Ri+=" "+Ai)}else Ci.values.indexOf(Ei)>=0&&(Ri=Ei);Ei=Ri}}if(Mi){if(Z.allowedSchemesAppliedToAttributes.indexOf(yi)!==-1&&ai(ii,Ei)){delete ri.attribs[yi];return}if(ii==="script"&&yi==="src"){let Ci=!0;try{const Ri=oi(Ei);if(Z.allowedScriptHostnames||Z.allowedScriptDomains){const Ni=(Z.allowedScriptHostnames||[]).find(function(ki){return ki===Ri.url.hostname}),Ai=(Z.allowedScriptDomains||[]).find(function(ki){return Ri.url.hostname===ki||Ri.url.hostname.endsWith(`.${ki}`)});Ci=Ni||Ai}}catch{Ci=!1}if(!Ci){delete ri.attribs[yi];return}}if(ii==="iframe"&&yi==="src"){let Ci=!0;try{const Ri=oi(Ei);if(Ri.isRelativeUrl)Ci=has(Z,"allowIframeRelativeUrls")?Z.allowIframeRelativeUrls:!Z.allowedIframeHostnames&&!Z.allowedIframeDomains;else if(Z.allowedIframeHostnames||Z.allowedIframeDomains){const Ni=(Z.allowedIframeHostnames||[]).find(function(ki){return ki===Ri.url.hostname}),Ai=(Z.allowedIframeDomains||[]).find(function(ki){return Ri.url.hostname===ki||Ri.url.hostname.endsWith(`.${ki}`)});Ci=Ni||Ai}}catch{Ci=!1}if(!Ci){delete ri.attribs[yi];return}}if(yi==="srcset")try{let Ci=parseSrcset(Ei);if(Ci.forEach(function(Ri){ai("srcset",Ri.url)&&(Ri.evil=!0)}),Ci=filter(Ci,function(Ri){return!Ri.evil}),Ci.length)Ei=stringifySrcset(filter(Ci,function(Ri){return!Ri.evil})),ri.attribs[yi]=Ei;else{delete ri.attribs[yi];return}}catch{delete ri.attribs[yi];return}if(yi==="class"){const Ci=Je[ii],Ri=Je["*"],Ni=rt[ii],Ai=nt[ii],ki=rt["*"],Yi=[Ni,ki].concat(Ai).filter(function(Ji){return Ji});if(Ci&&Ri?Ei=mi(Ei,deepmerge(Ci,Ri),Yi):Ei=mi(Ei,Ci||Ri,Yi),!Ei.length){delete ri.attribs[yi];return}}if(yi==="style"){if(Z.parseStyleAttributes)try{const Ci=postcssParse(ii+" {"+Ei+"}"),Ri=ni(Ci,Z.allowedStyles);if(Ei=li(Ri),Ei.length===0){delete ri.attribs[yi];return}}catch{typeof window<"u"&&console.warn('Failed to parse "'+ii+" {"+Ei+`}", If you're running this in a browser, we recommend to disable style parsing: options.parseStyleAttributes: false, since this only works in a node environment due to a postcss dependency, More info: https://github.com/apostrophecms/sanitize-html/issues/547`),delete ri.attribs[yi];return}else if(Z.allowedStyles)throw new Error("allowedStyles option cannot be used together with parseStyleAttributes: false.")}ae+=" "+yi,Ei&&Ei.length&&(ae+='="'+Jr(Ei,!0)+'"')}else delete ri.attribs[yi]}),Z.selfClosing.indexOf(ii)!==-1?ae+=" />":(ae+=">",ri.innerText&&!Si&&!Z.textFilter&&(ae+=Jr(ri.innerText),Yr=!0)),ci&&(ae=ye+Jr(ae),ye="")},ontext:function(ii){if(gt)return;const hi=ot[ot.length-1];let ri;if(hi&&(ri=hi.tag,ii=hi.innerText!==void 0?hi.innerText:ii),Z.disallowedTagsMode==="discard"&&(ri==="script"||ri==="style"))ae+=ii;else{const ci=Jr(ii,!1);Z.textFilter&&!Yr?ae+=Z.textFilter(ci,ri):Yr||(ae+=ci)}if(ot.length){const ci=ot[ot.length-1];ci.text+=ii}},onclosetag:function(ii,hi){if(gt)if(mt--,!mt)gt=!1;else return;const ri=ot.pop();if(!ri)return;if(ri.tag!==ii){ot.push(ri);return}gt=Z.enforceHtmlBoundary?ii==="html":!1,ct--;const ci=dt[ct];if(ci){if(delete dt[ct],Z.disallowedTagsMode==="discard"){ri.updateParentNodeText();return}ye=ae,ae=""}if(ft[ct]&&(ii=ft[ct],delete ft[ct]),Z.exclusiveFilter&&Z.exclusiveFilter(ri)){ae=ae.substr(0,ri.tagPosition);return}if(ri.updateParentNodeMediaChildren(),ri.updateParentNodeText(),Z.selfClosing.indexOf(ii)!==-1||hi&&!be(ii)&&["escape","recursiveEscape"].indexOf(Z.disallowedTagsMode)>=0){ci&&(ae=ye,ye="");return}ae+="",ci&&(ae=ye+Jr(ae),ye=""),Yr=!1}},Z.parser);return Qr.write(ie),Qr.end(),ae;function Xr(){ae="",ct=0,ot=[],dt={},ft={},gt=!1,mt=0}function Jr(ii,hi){return typeof ii!="string"&&(ii=ii+""),Z.parser.decodeEntities&&(ii=ii.replace(/&/g,"&").replace(//g,">"),hi&&(ii=ii.replace(/"/g,"""))),ii=ii.replace(/&(?![a-zA-Z0-9#]{1,20};)/g,"&").replace(//g,">"),hi&&(ii=ii.replace(/"/g,""")),ii}function ai(ii,hi){for(hi=hi.replace(/[\x00-\x20]+/g,"");;){const Si=hi.indexOf("",Si+4);if(si===-1)break;hi=hi.substring(0,Si)+hi.substring(si+3)}const ri=hi.match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);if(!ri)return hi.match(/^[/\\]{2}/)?!Z.allowProtocolRelative:!1;const ci=ri[1].toLowerCase();return has(Z.allowedSchemesByTag,ii)?Z.allowedSchemesByTag[ii].indexOf(ci)===-1:!Z.allowedSchemes||Z.allowedSchemes.indexOf(ci)===-1}function oi(ii){if(ii=ii.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/,"$1//"),ii.startsWith("relative:"))throw new Error("relative: exploit attempt");let hi="relative://relative-site";for(let ci=0;ci<100;ci++)hi+=`/${ci}`;const ri=new URL(ii,hi);return{isRelativeUrl:ri&&ri.hostname==="relative-site"&&ri.protocol==="relative:",url:ri}}function ni(ii,hi){if(!hi)return ii;const ri=ii.nodes[0];let ci;return hi[ri.selector]&&hi["*"]?ci=deepmerge(hi[ri.selector],hi["*"]):ci=hi[ri.selector]||hi["*"],ci&&(ii.nodes[0].nodes=ri.nodes.reduce(ui(ci),[])),ii}function li(ii){return ii.nodes[0].nodes.reduce(function(hi,ri){return hi.push(`${ri.prop}:${ri.value}${ri.important?" !important":""}`),hi},[]).join(";")}function ui(ii){return function(hi,ri){return has(ii,ri.prop)&&ii[ri.prop].some(function(ci){return ci.test(ri.value)})&&hi.push(ri),hi}}function mi(ii,hi,ri){return hi?(ii=ii.split(/\s+/),ii.filter(function(ci){return hi.indexOf(ci)!==-1||ri.some(function(Si){return Si.test(ci)})}).join(" ")):ii}}const htmlParserDefaults={decodeEntities:!0};sanitizeHtml.defaults={allowedTags:["address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","blockquote","dd","div","dl","dt","figcaption","figure","hr","li","main","ol","p","pre","ul","a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","rb","rp","rt","rtc","ruby","s","samp","small","span","strong","sub","sup","time","u","var","wbr","caption","col","colgroup","table","tbody","td","tfoot","th","thead","tr"],nonBooleanAttributes:["abbr","accept","accept-charset","accesskey","action","allow","alt","as","autocapitalize","autocomplete","blocking","charset","cite","class","color","cols","colspan","content","contenteditable","coords","crossorigin","data","datetime","decoding","dir","dirname","download","draggable","enctype","enterkeyhint","fetchpriority","for","form","formaction","formenctype","formmethod","formtarget","headers","height","hidden","high","href","hreflang","http-equiv","id","imagesizes","imagesrcset","inputmode","integrity","is","itemid","itemprop","itemref","itemtype","kind","label","lang","list","loading","low","max","maxlength","media","method","min","minlength","name","nonce","optimum","pattern","ping","placeholder","popover","popovertarget","popovertargetaction","poster","preload","referrerpolicy","rel","rows","rowspan","sandbox","scope","shape","size","sizes","slot","span","spellcheck","src","srcdoc","srclang","srcset","start","step","style","tabindex","target","title","translate","type","usemap","value","width","wrap","onauxclick","onafterprint","onbeforematch","onbeforeprint","onbeforeunload","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","onhashchange","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onlanguagechange","onload","onloadeddata","onloadedmetadata","onloadstart","onmessage","onmessageerror","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onoffline","ononline","onpagehide","onpageshow","onpaste","onpause","onplay","onplaying","onpopstate","onprogress","onratechange","onreset","onresize","onrejectionhandled","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onstorage","onsubmit","onsuspend","ontimeupdate","ontoggle","onunhandledrejection","onunload","onvolumechange","onwaiting","onwheel"],disallowedTagsMode:"discard",allowedAttributes:{a:["href","name","target"],img:["src","srcset","alt","title","width","height","loading"]},selfClosing:["img","br","hr","area","base","basefont","input","link","meta"],allowedSchemes:["http","https","ftp","mailto","tel"],allowedSchemesByTag:{},allowedSchemesAppliedToAttributes:["href","src","cite"],allowProtocolRelative:!0,enforceHtmlBoundary:!1,parseStyleAttributes:!0};sanitizeHtml.simpleTransform=function(ie,Z,ee){return ee=ee===void 0?!0:ee,Z=Z||{},function(ae,ye){let ve;if(ee)for(ve in Z)ye[ve]=Z[ve];else ye=Z;return{tagName:ie,attribs:ye}}};const at=getDefaultExportFromCjs$1(sanitizeHtml_1);function getDefaultExportFromCjs(ie){return ie&&ie.__esModule&&Object.prototype.hasOwnProperty.call(ie,"default")?ie.default:ie}var urlToolkit={exports:{}};(function(ie,Z){(function(ee){var ae=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,ye=/^(?=([^\/?#]*))\1([^]*)$/,ve=/(?:\/|^)\.(?=\/)/g,be=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,Ye={buildAbsoluteURL:function(Ke,Xe,Je){if(Je=Je||{},Ke=Ke.trim(),Xe=Xe.trim(),!Xe){if(!Je.alwaysNormalize)return Ke;var rt=Ye.parseURL(Ke);if(!rt)throw new Error("Error trying to parse base URL.");return rt.path=Ye.normalizePath(rt.path),Ye.buildURLFromParts(rt)}var nt=Ye.parseURL(Xe);if(!nt)throw new Error("Error trying to parse relative URL.");if(nt.scheme)return Je.alwaysNormalize?(nt.path=Ye.normalizePath(nt.path),Ye.buildURLFromParts(nt)):Xe;var it=Ye.parseURL(Ke);if(!it)throw new Error("Error trying to parse base URL.");if(!it.netLoc&&it.path&&it.path[0]!=="/"){var lt=ye.exec(it.path);it.netLoc=lt[1],it.path=lt[2]}it.netLoc&&!it.path&&(it.path="/");var ct={scheme:it.scheme,netLoc:nt.netLoc,path:null,params:nt.params,query:nt.query,fragment:nt.fragment};if(!nt.netLoc&&(ct.netLoc=it.netLoc,nt.path[0]!=="/"))if(!nt.path)ct.path=it.path,nt.params||(ct.params=it.params,nt.query||(ct.query=it.query));else{var ot=it.path,dt=ot.substring(0,ot.lastIndexOf("/")+1)+nt.path;ct.path=Ye.normalizePath(dt)}return ct.path===null&&(ct.path=Je.alwaysNormalize?Ye.normalizePath(nt.path):nt.path),Ye.buildURLFromParts(ct)},parseURL:function(Ke){var Xe=ae.exec(Ke);return Xe?{scheme:Xe[1]||"",netLoc:Xe[2]||"",path:Xe[3]||"",params:Xe[4]||"",query:Xe[5]||"",fragment:Xe[6]||""}:null},normalizePath:function(Ke){for(Ke=Ke.split("").reverse().join("").replace(ve,"");Ke.length!==(Ke=Ke.replace(be,"")).length;);return Ke.split("").reverse().join("")},buildURLFromParts:function(Ke){return Ke.scheme+Ke.netLoc+Ke.path+Ke.params+Ke.query+Ke.fragment}};ie.exports=Ye})()})(urlToolkit);var urlToolkitExports=urlToolkit.exports;function ownKeys(ie,Z){var ee=Object.keys(ie);if(Object.getOwnPropertySymbols){var ae=Object.getOwnPropertySymbols(ie);Z&&(ae=ae.filter(function(ye){return Object.getOwnPropertyDescriptor(ie,ye).enumerable})),ee.push.apply(ee,ae)}return ee}function _objectSpread2(ie){for(var Z=1;Z`):noop}function exportLoggerFunctions(ie,...Z){Z.forEach(function(ee){exportedLogger[ee]=ie[ee]?ie[ee].bind(ie):consolePrintFn(ee)})}function enableLogs(ie,Z){if(typeof console=="object"&&ie===!0||typeof ie=="object"){exportLoggerFunctions(ie,"debug","log","info","warn","error");try{exportedLogger.log(`Debug logs enabled for "${Z}" in hls.js version 1.5.3`)}catch{exportedLogger=fakeLogger}}else exportedLogger=fakeLogger}const logger=exportedLogger,DECIMAL_RESOLUTION_REGEX=/^(\d+)x(\d+)$/,ATTR_LIST_REGEX=/(.+?)=(".*?"|.*?)(?:,|$)/g;class AttrList{constructor(Z){typeof Z=="string"&&(Z=AttrList.parseAttrList(Z)),_extends(this,Z)}get clientAttrs(){return Object.keys(this).filter(Z=>Z.substring(0,2)==="X-")}decimalInteger(Z){const ee=parseInt(this[Z],10);return ee>Number.MAX_SAFE_INTEGER?1/0:ee}hexadecimalInteger(Z){if(this[Z]){let ee=(this[Z]||"0x").slice(2);ee=(ee.length&1?"0":"")+ee;const ae=new Uint8Array(ee.length/2);for(let ye=0;yeNumber.MAX_SAFE_INTEGER?1/0:ee}decimalFloatingPoint(Z){return parseFloat(this[Z])}optionalFloat(Z,ee){const ae=this[Z];return ae?parseFloat(ae):ee}enumeratedString(Z){return this[Z]}bool(Z){return this[Z]==="YES"}decimalResolution(Z){const ee=DECIMAL_RESOLUTION_REGEX.exec(this[Z]);if(ee!==null)return{width:parseInt(ee[1],10),height:parseInt(ee[2],10)}}static parseAttrList(Z){let ee;const ae={},ye='"';for(ATTR_LIST_REGEX.lastIndex=0;(ee=ATTR_LIST_REGEX.exec(Z))!==null;){let ve=ee[2];ve.indexOf(ye)===0&&ve.lastIndexOf(ye)===ve.length-1&&(ve=ve.slice(1,-1));const be=ee[1].trim();ae[be]=ve}return ae}}function isDateRangeCueAttribute(ie){return ie!=="ID"&&ie!=="CLASS"&&ie!=="START-DATE"&&ie!=="DURATION"&&ie!=="END-DATE"&&ie!=="END-ON-NEXT"}function isSCTE35Attribute(ie){return ie==="SCTE35-OUT"||ie==="SCTE35-IN"}class DateRange{constructor(Z,ee){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,ee){const ae=ee.attr;for(const ye in ae)if(Object.prototype.hasOwnProperty.call(Z,ye)&&Z[ye]!==ae[ye]){logger.warn(`DATERANGE tag attribute: "${ye}" does not match for tags with ID: "${Z.ID}"`),this._badValueForSameId=ye;break}Z=_extends(new AttrList({}),ae,Z)}if(this.attr=Z,this._startDate=new Date(Z["START-DATE"]),"END-DATE"in this.attr){const ae=new Date(this.attr["END-DATE"]);isFiniteNumber(ae.getTime())&&(this._endDate=ae)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const Z=this.duration;return Z!==null?new Date(this._startDate.getTime()+Z*1e3):null}get duration(){if("DURATION"in this.attr){const Z=this.attr.decimalFloatingPoint("DURATION");if(isFiniteNumber(Z))return Z}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&isFiniteNumber(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class LoadStats{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var ElementaryStreamTypes={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class BaseSegment{constructor(Z){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[ElementaryStreamTypes.AUDIO]:null,[ElementaryStreamTypes.VIDEO]:null,[ElementaryStreamTypes.AUDIOVIDEO]:null},this.baseurl=Z}setByteRange(Z,ee){const ae=Z.split("@",2);let ye;ae.length===1?ye=(ee==null?void 0:ee.byteRangeEndOffset)||0:ye=parseInt(ae[1]),this._byteRange=[ye,parseInt(ae[0])+ye]}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=urlToolkitExports.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(Z){this._url=Z}}class Fragment extends BaseSegment{constructor(Z,ee){super(ee),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new LoadStats,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=Z}get decryptdata(){const{levelkeys:Z}=this;if(!Z&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const ee=this.levelkeys.identity;if(ee)this._decryptdata=ee.getDecryptData(this.sn);else{const ae=Object.keys(this.levelkeys);if(ae.length===1)return this._decryptdata=this.levelkeys[ae[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null||!isFiniteNumber(this.programDateTime))return null;const Z=isFiniteNumber(this.duration)?this.duration:0;return this.programDateTime+Z*1e3}get encrypted(){var Z;if((Z=this._decryptdata)!=null&&Z.encrypted)return!0;if(this.levelkeys){const ee=Object.keys(this.levelkeys),ae=ee.length;if(ae>1||ae===1&&this.levelkeys[ee[0]].encrypted)return!0}return!1}setKeyFormat(Z){if(this.levelkeys){const ee=this.levelkeys[Z];ee&&!this._decryptdata&&(this._decryptdata=ee.getDecryptData(this.sn))}}abortRequests(){var Z,ee;(Z=this.loader)==null||Z.abort(),(ee=this.keyLoader)==null||ee.abort()}setElementaryStreamInfo(Z,ee,ae,ye,ve,be=!1){const{elementaryStreams:Ye}=this,Ke=Ye[Z];if(!Ke){Ye[Z]={startPTS:ee,endPTS:ae,startDTS:ye,endDTS:ve,partial:be};return}Ke.startPTS=Math.min(Ke.startPTS,ee),Ke.endPTS=Math.max(Ke.endPTS,ae),Ke.startDTS=Math.min(Ke.startDTS,ye),Ke.endDTS=Math.max(Ke.endDTS,ve)}clearElementaryStreamInfo(){const{elementaryStreams:Z}=this;Z[ElementaryStreamTypes.AUDIO]=null,Z[ElementaryStreamTypes.VIDEO]=null,Z[ElementaryStreamTypes.AUDIOVIDEO]=null}}class Part extends BaseSegment{constructor(Z,ee,ae,ye,ve){super(ae),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new LoadStats,this.duration=Z.decimalFloatingPoint("DURATION"),this.gap=Z.bool("GAP"),this.independent=Z.bool("INDEPENDENT"),this.relurl=Z.enumeratedString("URI"),this.fragment=ee,this.index=ye;const be=Z.enumeratedString("BYTERANGE");be&&this.setByteRange(be,ve),ve&&(this.fragOffset=ve.fragOffset+ve.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:Z}=this;return!!(Z.audio||Z.video||Z.audiovideo)}}const DEFAULT_TARGET_DURATION=10;class LevelDetails{constructor(Z){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=Z}reloaded(Z){if(!Z){this.advanced=!0,this.updated=!0;return}const ee=this.lastPartSn-Z.lastPartSn,ae=this.lastPartIndex-Z.lastPartIndex;this.updated=this.endSN!==Z.endSN||!!ae||!!ee||!this.live,this.advanced=this.endSN>Z.endSN||ee>0||ee===0&&ae>0,this.updated||this.advanced?this.misses=Math.floor(Z.misses*.6):this.misses=Z.misses+1,this.availabilityDelay=Z.availabilityDelay}get hasProgramDateTime(){return this.fragments.length?isFiniteNumber(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||DEFAULT_TARGET_DURATION}get drift(){const Z=this.driftEndTime-this.driftStartTime;return Z>0?(this.driftEnd-this.driftStart)*1e3/Z:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var Z;return(Z=this.partList)!=null&&Z.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var Z;return(Z=this.fragments)!=null&&Z.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var Z;return(Z=this.partList)!=null&&Z.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var Z;return(Z=this.partList)!=null&&Z.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function base64Decode(ie){return Uint8Array.from(atob(ie),Z=>Z.charCodeAt(0))}function getKeyIdBytes(ie){const Z=strToUtf8array(ie).subarray(0,16),ee=new Uint8Array(16);return ee.set(Z,16-Z.length),ee}function changeEndianness(ie){const Z=function(ee,ae,ye){const ve=ee[ae];ee[ae]=ee[ye],ee[ye]=ve};Z(ie,0,3),Z(ie,1,2),Z(ie,4,5),Z(ie,6,7)}function convertDataUriToArrayBytes(ie){const Z=ie.split(":");let ee=null;if(Z[0]==="data"&&Z.length===2){const ae=Z[1].split(";"),ye=ae[ae.length-1].split(",");if(ye.length===2){const ve=ye[0]==="base64",be=ye[1];ve?(ae.splice(-1,1),ee=base64Decode(be)):ee=getKeyIdBytes(be)}}return ee}function strToUtf8array(ie){return Uint8Array.from(unescape(encodeURIComponent(ie)),Z=>Z.charCodeAt(0))}const optionalSelf=typeof self<"u"?self:void 0;var KeySystems={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},KeySystemFormats={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function keySystemFormatToKeySystemDomain(ie){switch(ie){case KeySystemFormats.FAIRPLAY:return KeySystems.FAIRPLAY;case KeySystemFormats.PLAYREADY:return KeySystems.PLAYREADY;case KeySystemFormats.WIDEVINE:return KeySystems.WIDEVINE;case KeySystemFormats.CLEARKEY:return KeySystems.CLEARKEY}}var KeySystemIds={WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function keySystemIdToKeySystemDomain(ie){if(ie===KeySystemIds.WIDEVINE)return KeySystems.WIDEVINE}function keySystemDomainToKeySystemFormat(ie){switch(ie){case KeySystems.FAIRPLAY:return KeySystemFormats.FAIRPLAY;case KeySystems.PLAYREADY:return KeySystemFormats.PLAYREADY;case KeySystems.WIDEVINE:return KeySystemFormats.WIDEVINE;case KeySystems.CLEARKEY:return KeySystemFormats.CLEARKEY}}function getKeySystemsForConfig(ie){const{drmSystems:Z,widevineLicenseUrl:ee}=ie,ae=Z?[KeySystems.FAIRPLAY,KeySystems.WIDEVINE,KeySystems.PLAYREADY,KeySystems.CLEARKEY].filter(ye=>!!Z[ye]):[];return!ae[KeySystems.WIDEVINE]&&ee&&ae.push(KeySystems.WIDEVINE),ae}const requestMediaKeySystemAccess=function(ie){return optionalSelf!=null&&(ie=optionalSelf.navigator)!=null&&ie.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function getSupportedMediaKeySystemConfigurations(ie,Z,ee,ae){let ye;switch(ie){case KeySystems.FAIRPLAY:ye=["cenc","sinf"];break;case KeySystems.WIDEVINE:case KeySystems.PLAYREADY:ye=["cenc"];break;case KeySystems.CLEARKEY:ye=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${ie}`)}return createMediaKeySystemConfigurations(ye,Z,ee,ae)}function createMediaKeySystemConfigurations(ie,Z,ee,ae){return[{initDataTypes:ie,persistentState:ae.persistentState||"optional",distinctiveIdentifier:ae.distinctiveIdentifier||"optional",sessionTypes:ae.sessionTypes||[ae.sessionType||"temporary"],audioCapabilities:Z.map(ye=>({contentType:`audio/mp4; codecs="${ye}"`,robustness:ae.audioRobustness||"",encryptionScheme:ae.audioEncryptionScheme||null})),videoCapabilities:ee.map(ye=>({contentType:`video/mp4; codecs="${ye}"`,robustness:ae.videoRobustness||"",encryptionScheme:ae.videoEncryptionScheme||null}))}]}function sliceUint8(ie,Z,ee){return Uint8Array.prototype.slice?ie.slice(Z,ee):new Uint8Array(Array.prototype.slice.call(ie,Z,ee))}const isHeader$2=(ie,Z)=>Z+10<=ie.length&&ie[Z]===73&&ie[Z+1]===68&&ie[Z+2]===51&&ie[Z+3]<255&&ie[Z+4]<255&&ie[Z+6]<128&&ie[Z+7]<128&&ie[Z+8]<128&&ie[Z+9]<128,isFooter=(ie,Z)=>Z+10<=ie.length&&ie[Z]===51&&ie[Z+1]===68&&ie[Z+2]===73&&ie[Z+3]<255&&ie[Z+4]<255&&ie[Z+6]<128&&ie[Z+7]<128&&ie[Z+8]<128&&ie[Z+9]<128,getID3Data=(ie,Z)=>{const ee=Z;let ae=0;for(;isHeader$2(ie,Z);){ae+=10;const ye=readSize(ie,Z+6);ae+=ye,isFooter(ie,Z+10)&&(ae+=10),Z+=ae}if(ae>0)return ie.subarray(ee,ee+ae)},readSize=(ie,Z)=>{let ee=0;return ee=(ie[Z]&127)<<21,ee|=(ie[Z+1]&127)<<14,ee|=(ie[Z+2]&127)<<7,ee|=ie[Z+3]&127,ee},canParse$2=(ie,Z)=>isHeader$2(ie,Z)&&readSize(ie,Z+6)+10<=ie.length-Z,getTimeStamp=ie=>{const Z=getID3Frames(ie);for(let ee=0;eeie&&ie.key==="PRIV"&&ie.info==="com.apple.streaming.transportStreamTimestamp",getFrameData=ie=>{const Z=String.fromCharCode(ie[0],ie[1],ie[2],ie[3]),ee=readSize(ie,4),ae=10;return{type:Z,size:ee,data:ie.subarray(ae,ae+ee)}},getID3Frames=ie=>{let Z=0;const ee=[];for(;isHeader$2(ie,Z);){const ae=readSize(ie,Z+6);Z+=10;const ye=Z+ae;for(;Z+8ie.type==="PRIV"?decodePrivFrame(ie):ie.type[0]==="W"?decodeURLFrame(ie):decodeTextFrame(ie),decodePrivFrame=ie=>{if(ie.size<2)return;const Z=utf8ArrayToStr(ie.data,!0),ee=new Uint8Array(ie.data.subarray(Z.length+1));return{key:ie.type,info:Z,data:ee.buffer}},decodeTextFrame=ie=>{if(ie.size<2)return;if(ie.type==="TXXX"){let ee=1;const ae=utf8ArrayToStr(ie.data.subarray(ee),!0);ee+=ae.length+1;const ye=utf8ArrayToStr(ie.data.subarray(ee));return{key:ie.type,info:ae,data:ye}}const Z=utf8ArrayToStr(ie.data.subarray(1));return{key:ie.type,data:Z}},decodeURLFrame=ie=>{if(ie.type==="WXXX"){if(ie.size<2)return;let ee=1;const ae=utf8ArrayToStr(ie.data.subarray(ee),!0);ee+=ae.length+1;const ye=utf8ArrayToStr(ie.data.subarray(ee));return{key:ie.type,info:ae,data:ye}}const Z=utf8ArrayToStr(ie.data);return{key:ie.type,data:Z}},readTimeStamp=ie=>{if(ie.data.byteLength===8){const Z=new Uint8Array(ie.data),ee=Z[3]&1;let ae=(Z[4]<<23)+(Z[5]<<15)+(Z[6]<<7)+Z[7];return ae/=45,ee&&(ae+=4772185884e-2),Math.round(ae)}},utf8ArrayToStr=(ie,Z=!1)=>{const ee=getTextDecoder();if(ee){const Xe=ee.decode(ie);if(Z){const Je=Xe.indexOf("\0");return Je!==-1?Xe.substring(0,Je):Xe}return Xe.replace(/\0/g,"")}const ae=ie.length;let ye,ve,be,Ye="",Ke=0;for(;Ke>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:Ye+=String.fromCharCode(ye);break;case 12:case 13:ve=ie[Ke++],Ye+=String.fromCharCode((ye&31)<<6|ve&63);break;case 14:ve=ie[Ke++],be=ie[Ke++],Ye+=String.fromCharCode((ye&15)<<12|(ve&63)<<6|(be&63)<<0);break}}return Ye};let decoder;function getTextDecoder(){if(!navigator.userAgent.includes("PlayStation 4"))return!decoder&&typeof self.TextDecoder<"u"&&(decoder=new self.TextDecoder("utf-8")),decoder}const Hex={hexDump:function(ie){let Z="";for(let ee=0;ee>24,ie[Z+1]=ee>>16&255,ie[Z+2]=ee>>8&255,ie[Z+3]=ee&255}function hasMoofData(ie){const Z=ie.byteLength;for(let ee=0;ee8&&ie[ee+4]===109&&ie[ee+5]===111&&ie[ee+6]===111&&ie[ee+7]===102)return!0;ee=ae>1?ee+ae:Z}return!1}function findBox(ie,Z){const ee=[];if(!Z.length)return ee;const ae=ie.byteLength;for(let ye=0;ye1?ye+ve:ae;if(be===Z[0])if(Z.length===1)ee.push(ie.subarray(ye+8,Ye));else{const Ke=findBox(ie.subarray(ye+8,Ye),Z.slice(1));Ke.length&&push.apply(ee,Ke)}ye=Ye}return ee}function parseSegmentIndex(ie){const Z=[],ee=ie[0];let ae=8;const ye=readUint32(ie,ae);ae+=4;const ve=0,be=0;ee===0?ae+=8:ae+=16,ae+=2;let Ye=ie.length+be;const Ke=readUint16(ie,ae);ae+=2;for(let Xe=0;Xe>>31===1)return logger.warn("SIDX has hierarchical references (not supported)"),null;const it=readUint32(ie,Je);Je+=4,Z.push({referenceSize:nt,subsegmentDuration:it,info:{duration:it/ye,start:Ye,end:Ye+nt-1}}),Ye+=nt,Je+=4,ae=Je}return{earliestPresentationTime:ve,timescale:ye,version:ee,referencesCount:Ke,references:Z}}function parseInitSegment(ie){const Z=[],ee=findBox(ie,["moov","trak"]);for(let ae=0;ae{const ye=readUint32(ae,4),ve=Z[ye];ve&&(ve.default={duration:readUint32(ae,12),flags:readUint32(ae,20)})}),Z}function parseStsd(ie){const Z=ie.subarray(8),ee=Z.subarray(86),ae=bin2str(Z.subarray(4,8));let ye=ae;const ve=ae==="enca"||ae==="encv";if(ve){const be=findBox(Z,[ae])[0].subarray(ae==="enca"?28:78);findBox(be,["sinf"]).forEach(Ye=>{const Ke=findBox(Ye,["schm"])[0];if(Ke){const Xe=bin2str(Ke.subarray(4,8));if(Xe==="cbcs"||Xe==="cenc"){const Je=findBox(Ye,["frma"])[0];Je&&(ye=bin2str(Je))}}})}switch(ye){case"avc1":case"avc2":case"avc3":case"avc4":{const be=findBox(ee,["avcC"])[0];ye+="."+toHex(be[1])+toHex(be[2])+toHex(be[3]);break}case"mp4a":{const be=findBox(Z,[ae])[0],Ye=findBox(be.subarray(28),["esds"])[0];if(Ye&&Ye.length>12){let Ke=4;if(Ye[Ke++]!==3)break;Ke=skipBERInteger(Ye,Ke),Ke+=2;const Xe=Ye[Ke++];if(Xe&128&&(Ke+=2),Xe&64&&(Ke+=Ye[Ke++]),Ye[Ke++]!==4)break;Ke=skipBERInteger(Ye,Ke);const Je=Ye[Ke++];if(Je===64)ye+="."+toHex(Je);else break;if(Ke+=12,Ye[Ke++]!==5)break;Ke=skipBERInteger(Ye,Ke);const rt=Ye[Ke++];let nt=(rt&248)>>3;nt===31&&(nt+=1+((rt&7)<<3)+((Ye[Ke]&224)>>5)),ye+="."+nt}break}case"hvc1":case"hev1":{const be=findBox(ee,["hvcC"])[0],Ye=be[1],Ke=["","A","B","C"][Ye>>6],Xe=Ye&31,Je=readUint32(be,2),rt=(Ye&32)>>5?"H":"L",nt=be[12],it=be.subarray(6,12);ye+="."+Ke+Xe,ye+="."+Je.toString(16).toUpperCase(),ye+="."+rt+nt;let lt="";for(let ct=it.length;ct--;){const ot=it[ct];(ot||lt)&&(lt="."+ot.toString(16).toUpperCase()+lt)}ye+=lt;break}case"dvh1":case"dvhe":{const be=findBox(ee,["dvcC"])[0],Ye=be[2]>>1&127,Ke=be[2]<<5&32|be[3]>>3&31;ye+="."+addLeadingZero(Ye)+"."+addLeadingZero(Ke);break}case"vp09":{const be=findBox(ee,["vpcC"])[0],Ye=be[4],Ke=be[5],Xe=be[6]>>4&15;ye+="."+addLeadingZero(Ye)+"."+addLeadingZero(Ke)+"."+addLeadingZero(Xe);break}case"av01":{const be=findBox(ee,["av1C"])[0],Ye=be[1]>>>5,Ke=be[1]&31,Xe=be[2]>>>7?"H":"M",Je=(be[2]&64)>>6,rt=(be[2]&32)>>5,nt=Ye===2&&Je?rt?12:10:Je?10:8,it=(be[2]&16)>>4,lt=(be[2]&8)>>3,ct=(be[2]&4)>>2,ot=be[2]&3;ye+="."+Ye+"."+addLeadingZero(Ke)+Xe+"."+addLeadingZero(nt)+"."+it+"."+lt+ct+ot+"."+addLeadingZero(1)+"."+addLeadingZero(1)+"."+addLeadingZero(1)+".0";break}}return{codec:ye,encrypted:ve}}function skipBERInteger(ie,Z){const ee=Z+5;for(;ie[Z++]&128&&Z{const ye=findBox(ae,["mdia","minf","stbl","stsd"])[0].subarray(8);let ve=findBox(ye,["enca"]);const be=ve.length>0;be||(ve=findBox(ye,["encv"])),ve.forEach(Ye=>{const Ke=be?Ye.subarray(28):Ye.subarray(78);findBox(Ke,["sinf"]).forEach(Xe=>{const Je=parseSinf(Xe);if(Je){const rt=Je.subarray(8,24);rt.some(nt=>nt!==0)||(logger.log(`[eme] Patching keyId in 'enc${be?"a":"v"}>sinf>>tenc' box: ${Hex.hexDump(rt)} -> ${Hex.hexDump(ee)}`),Je.set(ee,8))}})})}),ie}function parseSinf(ie){const Z=findBox(ie,["schm"])[0];if(Z){const ee=bin2str(Z.subarray(4,8));if(ee==="cbcs"||ee==="cenc")return findBox(ie,["schi","tenc"])[0]}return logger.error("[eme] missing 'schm' box"),null}function getStartDTS(ie,Z){return findBox(Z,["moof","traf"]).reduce((ee,ae)=>{const ye=findBox(ae,["tfdt"])[0],ve=ye[0],be=findBox(ae,["tfhd"]).reduce((Ye,Ke)=>{const Xe=readUint32(Ke,4),Je=ie[Xe];if(Je){let rt=readUint32(ye,4);if(ve===1){if(rt===UINT32_MAX$1)return logger.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),Ye;rt*=UINT32_MAX$1+1,rt+=readUint32(ye,8)}const nt=Je.timescale||9e4,it=rt/nt;if(isFiniteNumber(it)&&(Ye===null||itJe+rt.info.duration||0,0))}return be}return ae||ye}function computeRawDurationFromSamples(ie){const Z=readUint32(ie,0);let ee=8;Z&1&&(ee+=4),Z&4&&(ee+=4);let ae=0;const ye=readUint32(ie,4);for(let ve=0;ve{findBox(ae,["tfhd"]).forEach(ye=>{const ve=readUint32(ye,4),be=ie[ve];if(!be)return;const Ye=be.timescale||9e4;findBox(ae,["tfdt"]).forEach(Ke=>{const Xe=Ke[0],Je=ee*Ye;if(Je){let rt=readUint32(Ke,4);if(Xe===0)rt-=Je,rt=Math.max(rt,0),writeUint32(Ke,4,rt);else{rt*=Math.pow(2,32),rt+=readUint32(Ke,8),rt-=Je,rt=Math.max(rt,0);const nt=Math.floor(rt/(UINT32_MAX$1+1)),it=Math.floor(rt%(UINT32_MAX$1+1));writeUint32(Ke,4,nt),writeUint32(Ke,8,it)}}})})})}function segmentValidRange(ie){const Z={valid:null,remainder:null},ee=findBox(ie,["moof"]);if(ee.length<2)return Z.remainder=ie,Z;const ae=ee[ee.length-1];return Z.valid=sliceUint8(ie,0,ae.byteOffset-8),Z.remainder=sliceUint8(ie,ae.byteOffset-8),Z}function appendUint8Array(ie,Z){const ee=new Uint8Array(ie.length+Z.length);return ee.set(ie),ee.set(Z,ie.length),ee}function parseSamples(ie,Z){const ee=[],ae=Z.samples,ye=Z.timescale,ve=Z.id;let be=!1;return findBox(ae,["moof"]).map(Ye=>{const Ke=Ye.byteOffset-8;findBox(Ye,["traf"]).map(Xe=>{const Je=findBox(Xe,["tfdt"]).map(rt=>{const nt=rt[0];let it=readUint32(rt,4);return nt===1&&(it*=Math.pow(2,32),it+=readUint32(rt,8)),it/ye})[0];return Je!==void 0&&(ie=Je),findBox(Xe,["tfhd"]).map(rt=>{const nt=readUint32(rt,4),it=readUint32(rt,0)&16777215,lt=(it&1)!==0,ct=(it&2)!==0,ot=(it&8)!==0;let dt=0;const ft=(it&16)!==0;let gt=0;const mt=(it&32)!==0;let Yr=8;nt===ve&&(lt&&(Yr+=8),ct&&(Yr+=4),ot&&(dt=readUint32(rt,Yr),Yr+=4),ft&&(gt=readUint32(rt,Yr),Yr+=4),mt&&(Yr+=4),Z.type==="video"&&(be=isHEVC(Z.codec)),findBox(Xe,["trun"]).map(Qr=>{const Xr=Qr[0],Jr=readUint32(Qr,0)&16777215,ai=(Jr&1)!==0;let oi=0;const ni=(Jr&4)!==0,li=(Jr&256)!==0;let ui=0;const mi=(Jr&512)!==0;let ii=0;const hi=(Jr&1024)!==0,ri=(Jr&2048)!==0;let ci=0;const Si=readUint32(Qr,4);let si=8;ai&&(oi=readUint32(Qr,si),si+=4),ni&&(si+=4);let Ei=oi+Ke;for(let yi=0;yi>1&63;return ee===39||ee===40}else return(Z&31)===6}function parseSEIMessageFromNALu(ie,Z,ee,ae){const ye=discardEPB(ie);let ve=0;ve+=Z;let be=0,Ye=0,Ke=0;for(;ve=ye.length)break;Ke=ye[ve++],be+=Ke}while(Ke===255);Ye=0;do{if(ve>=ye.length)break;Ke=ye[ve++],Ye+=Ke}while(Ke===255);const Xe=ye.length-ve;let Je=ve;if(YeXe){logger.error(`Malformed SEI payload. ${Ye} is too small, only ${Xe} bytes left to parse.`);break}if(be===4){if(ye[Je++]===181){const rt=readUint16(ye,Je);if(Je+=2,rt===49){const nt=readUint32(ye,Je);if(Je+=4,nt===1195456820){const it=ye[Je++];if(it===3){const lt=ye[Je++],ct=31<,ot=64<,dt=ot?2+ct*3:0,ft=new Uint8Array(dt);if(ot){ft[0]=lt;for(let gt=1;gt16){const rt=[];for(let lt=0;lt<16;lt++){const ct=ye[Je++].toString(16);rt.push(ct.length==1?"0"+ct:ct),(lt===3||lt===5||lt===7||lt===9)&&rt.push("-")}const nt=Ye-16,it=new Uint8Array(nt);for(let lt=0;lt>24&255,ve[1]=ae>>16&255,ve[2]=ae>>8&255,ve[3]=ae&255,ve.set(ie,4),ye=0,ae=8;ye0?(ve=new Uint8Array(4),Z.length>0&&new DataView(ve.buffer).setUint32(0,Z.length,!1)):ve=new Uint8Array;const be=new Uint8Array(4);return ee&&ee.byteLength>0&&new DataView(be.buffer).setUint32(0,ee.byteLength,!1),mp4Box([112,115,115,104],new Uint8Array([ae,0,0,0]),ie,ve,ye,be,ee||new Uint8Array)}function parsePssh(ie){if(!(ie instanceof ArrayBuffer)||ie.byteLength<32)return null;const Z={version:0,systemId:"",kids:null,data:null},ee=new DataView(ie),ae=ee.getUint32(0);if(ie.byteLength!==ae&&ae>44||ee.getUint32(4)!==1886614376||(Z.version=ee.getUint32(8)>>>24,Z.version>1))return null;Z.systemId=Hex.hexDump(new Uint8Array(ie,12,16));const ye=ee.getUint32(28);if(Z.version===0){if(ae-32=22&&(this.keyId=ee.subarray(ee.length-22,ee.length-6));break;case KeySystemFormats.PLAYREADY:{const ae=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=mp4pssh(ae,null,ee);const ye=new Uint16Array(ee.buffer,ee.byteOffset,ee.byteLength/2),ve=String.fromCharCode.apply(null,Array.from(ye)),be=ve.substring(ve.indexOf("<"),ve.length),Ye=new DOMParser().parseFromString(be,"text/xml").getElementsByTagName("KID")[0];if(Ye){const Ke=Ye.childNodes[0]?Ye.childNodes[0].nodeValue:Ye.getAttribute("VALUE");if(Ke){const Xe=base64Decode(Ke).subarray(0,16);changeEndianness(Xe),this.keyId=Xe}}break}default:{let ae=ee.subarray(0,16);if(ae.length!==16){const ye=new Uint8Array(16);ye.set(ae,16-ae.length),ae=ye}this.keyId=ae;break}}if(!this.keyId||this.keyId.byteLength!==16){let ae=keyUriToKeyIdMap[this.uri];if(!ae){const ye=Object.keys(keyUriToKeyIdMap).length%Number.MAX_SAFE_INTEGER;ae=new Uint8Array(16),new DataView(ae.buffer,12,4).setUint32(0,ye),keyUriToKeyIdMap[this.uri]=ae}this.keyId=ae}return this}}function createInitializationVector(ie){const Z=new Uint8Array(16);for(let ee=12;ee<16;ee++)Z[ee]=ie>>8*(15-ee)&255;return Z}const VARIABLE_REPLACEMENT_REGEX=/\{\$([a-zA-Z0-9-_]+)\}/g;function hasVariableReferences(ie){return VARIABLE_REPLACEMENT_REGEX.test(ie)}function substituteVariablesInAttributes(ie,Z,ee){if(ie.variableList!==null||ie.hasVariableRefs)for(let ae=ee.length;ae--;){const ye=ee[ae],ve=Z[ye];ve&&(Z[ye]=substituteVariables(ie,ve))}}function substituteVariables(ie,Z){if(ie.variableList!==null||ie.hasVariableRefs){const ee=ie.variableList;return Z.replace(VARIABLE_REPLACEMENT_REGEX,ae=>{const ye=ae.substring(2,ae.length-1),ve=ee==null?void 0:ee[ye];return ve===void 0?(ie.playlistParsingError||(ie.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${ye}"`)),ae):ve})}return Z}function addVariableDefinition(ie,Z,ee){let ae=ie.variableList;ae||(ie.variableList=ae={});let ye,ve;if("QUERYPARAM"in Z){ye=Z.QUERYPARAM;try{const be=new self.URL(ee).searchParams;if(be.has(ye))ve=be.get(ye);else throw new Error(`"${ye}" does not match any query parameter in URI: "${ee}"`)}catch(be){ie.playlistParsingError||(ie.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${be.message}`))}}else ye=Z.NAME,ve=Z.VALUE;ye in ae?ie.playlistParsingError||(ie.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${ye}"`)):ae[ye]=ve||""}function importVariableDefinition(ie,Z,ee){const ae=Z.IMPORT;if(ee&&ae in ee){let ye=ie.variableList;ye||(ie.variableList=ye={}),ye[ae]=ee[ae]}else ie.playlistParsingError||(ie.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${ae}"`))}function getMediaSource(ie=!0){return typeof self>"u"?void 0:(ie||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}const sampleEntryCodesISO={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function isCodecType(ie,Z){const ee=sampleEntryCodesISO[Z];return!!ee&&!!ee[ie.slice(0,4)]}function areCodecsMediaSourceSupported(ie,Z,ee=!0){return!ie.split(",").some(ae=>!isCodecMediaSourceSupported(ae,Z,ee))}function isCodecMediaSourceSupported(ie,Z,ee=!0){var ae;const ye=getMediaSource(ee);return(ae=ye==null?void 0:ye.isTypeSupported(mimeTypeForCodec(ie,Z)))!=null?ae:!1}function mimeTypeForCodec(ie,Z){return`${Z}/mp4;codecs="${ie}"`}function videoCodecPreferenceValue(ie){if(ie){const Z=ie.substring(0,4);return sampleEntryCodesISO.video[Z]}return 2}function codecsSetSelectionPreferenceValue(ie){return ie.split(",").reduce((Z,ee)=>{const ae=sampleEntryCodesISO.video[ee];return ae?(ae*2+Z)/(Z?3:2):(sampleEntryCodesISO.audio[ee]+Z)/(Z?2:1)},0)}const CODEC_COMPATIBLE_NAMES={};function getCodecCompatibleNameLower(ie,Z=!0){if(CODEC_COMPATIBLE_NAMES[ie])return CODEC_COMPATIBLE_NAMES[ie];const ee={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"]}[ie];for(let ae=0;aegetCodecCompatibleNameLower(ee.toLowerCase(),Z))}function pickMostCompleteCodecName(ie,Z){return ie&&ie!=="mp4a"?ie:Z}function convertAVC1ToAVCOTI(ie){const Z=ie.split(".");if(Z.length>2){let ee=Z.shift()+".";return ee+=parseInt(Z.shift()).toString(16),ee+=("000"+parseInt(Z.shift()).toString(16)).slice(-4),ee}return ie}const MASTER_PLAYLIST_REGEX=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,MASTER_PLAYLIST_MEDIA_REGEX=/#EXT-X-MEDIA:(.*)/g,IS_MEDIA_PLAYLIST=/^#EXT(?:INF|-X-TARGETDURATION):/m,LEVEL_PLAYLIST_REGEX_FAST=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),LEVEL_PLAYLIST_REGEX_SLOW=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class M3U8Parser{static findGroup(Z,ee){for(let ae=0;ae0&&ve.length({id:Xe.attrs.AUDIO,audioCodec:Xe.audioCodec})),SUBTITLES:be.map(Xe=>({id:Xe.attrs.SUBTITLES,textCodec:Xe.textCodec})),"CLOSED-CAPTIONS":[]};let Ke=0;for(MASTER_PLAYLIST_MEDIA_REGEX.lastIndex=0;(ye=MASTER_PLAYLIST_MEDIA_REGEX.exec(Z))!==null;){const Xe=new AttrList(ye[1]),Je=Xe.TYPE;if(Je){const rt=Ye[Je],nt=ve[Je]||[];ve[Je]=nt,substituteVariablesInAttributes(ae,Xe,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const it=Xe.LANGUAGE,lt=Xe["ASSOC-LANGUAGE"],ct=Xe.CHANNELS,ot=Xe.CHARACTERISTICS,dt=Xe["INSTREAM-ID"],ft={attrs:Xe,bitrate:0,id:Ke++,groupId:Xe["GROUP-ID"]||"",name:Xe.NAME||it||"",type:Je,default:Xe.bool("DEFAULT"),autoselect:Xe.bool("AUTOSELECT"),forced:Xe.bool("FORCED"),lang:it,url:Xe.URI?M3U8Parser.resolve(Xe.URI,ee):""};if(lt&&(ft.assocLang=lt),ct&&(ft.channels=ct),ot&&(ft.characteristics=ot),dt&&(ft.instreamId=dt),rt!=null&&rt.length){const gt=M3U8Parser.findGroup(rt,ft.groupId)||rt[0];assignCodec(ft,gt,"audioCodec"),assignCodec(ft,gt,"textCodec")}nt.push(ft)}}return ve}static parseLevelPlaylist(Z,ee,ae,ye,ve,be){const Ye=new LevelDetails(ee),Ke=Ye.fragments;let Xe=null,Je=0,rt=0,nt=0,it=0,lt=null,ct=new Fragment(ye,ee),ot,dt,ft,gt=-1,mt=!1,Yr=null;for(LEVEL_PLAYLIST_REGEX_FAST.lastIndex=0,Ye.m3u8=Z,Ye.hasVariableRefs=hasVariableReferences(Z);(ot=LEVEL_PLAYLIST_REGEX_FAST.exec(Z))!==null;){mt&&(mt=!1,ct=new Fragment(ye,ee),ct.start=nt,ct.sn=Je,ct.cc=it,ct.level=ae,Xe&&(ct.initSegment=Xe,ct.rawProgramDateTime=Xe.rawProgramDateTime,Xe.rawProgramDateTime=null,Yr&&(ct.setByteRange(Yr),Yr=null)));const ai=ot[1];if(ai){ct.duration=parseFloat(ai);const oi=(" "+ot[2]).slice(1);ct.title=oi||null,ct.tagList.push(oi?["INF",ai,oi]:["INF",ai])}else if(ot[3]){if(isFiniteNumber(ct.duration)){ct.start=nt,ft&&setFragLevelKeys(ct,ft,Ye),ct.sn=Je,ct.level=ae,ct.cc=it,Ke.push(ct);const oi=(" "+ot[3]).slice(1);ct.relurl=substituteVariables(Ye,oi),assignProgramDateTime(ct,lt),lt=ct,nt+=ct.duration,Je++,rt=0,mt=!0}}else if(ot[4]){const oi=(" "+ot[4]).slice(1);lt?ct.setByteRange(oi,lt):ct.setByteRange(oi)}else if(ot[5])ct.rawProgramDateTime=(" "+ot[5]).slice(1),ct.tagList.push(["PROGRAM-DATE-TIME",ct.rawProgramDateTime]),gt===-1&&(gt=Ke.length);else{if(ot=ot[0].match(LEVEL_PLAYLIST_REGEX_SLOW),!ot){logger.warn("No matches on slow regex match for level playlist!");continue}for(dt=1;dt0&&ui.bool("CAN-SKIP-DATERANGES"),Ye.partHoldBack=ui.optionalFloat("PART-HOLD-BACK",0),Ye.holdBack=ui.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const ui=new AttrList(ni);Ye.partTarget=ui.decimalFloatingPoint("PART-TARGET");break}case"PART":{let ui=Ye.partList;ui||(ui=Ye.partList=[]);const mi=rt>0?ui[ui.length-1]:void 0,ii=rt++,hi=new AttrList(ni);substituteVariablesInAttributes(Ye,hi,["BYTERANGE","URI"]);const ri=new Part(hi,ct,ee,ii,mi);ui.push(ri),ct.duration+=ri.duration;break}case"PRELOAD-HINT":{const ui=new AttrList(ni);substituteVariablesInAttributes(Ye,ui,["URI"]),Ye.preloadHint=ui;break}case"RENDITION-REPORT":{const ui=new AttrList(ni);substituteVariablesInAttributes(Ye,ui,["URI"]),Ye.renditionReports=Ye.renditionReports||[],Ye.renditionReports.push(ui);break}default:logger.warn(`line parsed but not handled: ${ot}`);break}}}lt&&!lt.relurl?(Ke.pop(),nt-=lt.duration,Ye.partList&&(Ye.fragmentHint=lt)):Ye.partList&&(assignProgramDateTime(ct,lt),ct.cc=it,Ye.fragmentHint=ct,ft&&setFragLevelKeys(ct,ft,Ye));const Qr=Ke.length,Xr=Ke[0],Jr=Ke[Qr-1];if(nt+=Ye.skippedSegments*Ye.targetduration,nt>0&&Qr&&Jr){Ye.averagetargetduration=nt/Qr;const ai=Jr.sn;Ye.endSN=ai!=="initSegment"?ai:0,Ye.live||(Jr.endList=!0),Xr&&(Ye.startCC=Xr.cc)}else Ye.endSN=0,Ye.startCC=0;return Ye.fragmentHint&&(nt+=Ye.fragmentHint.duration),Ye.totalduration=nt,Ye.endCC=it,gt>0&&backfillProgramDateTimes(Ke,gt),Ye}}function parseKey(ie,Z,ee){var ae,ye;const ve=new AttrList(ie);substituteVariablesInAttributes(ee,ve,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const be=(ae=ve.METHOD)!=null?ae:"",Ye=ve.URI,Ke=ve.hexadecimalInteger("IV"),Xe=ve.KEYFORMATVERSIONS,Je=(ye=ve.KEYFORMAT)!=null?ye:"identity";Ye&&ve.IV&&!Ke&&logger.error(`Invalid IV: ${ve.IV}`);const rt=Ye?M3U8Parser.resolve(Ye,Z):"",nt=(Xe||"1").split("/").map(Number).filter(Number.isFinite);return new LevelKey(be,rt,Je,nt,Ke)}function parseStartTimeOffset(ie){const Z=new AttrList(ie).decimalFloatingPoint("TIME-OFFSET");return isFiniteNumber(Z)?Z:null}function setCodecs(ie,Z){let ee=(ie||"").split(/[ ,]+/).filter(ae=>ae);["video","audio","text"].forEach(ae=>{const ye=ee.filter(ve=>isCodecType(ve,ae));ye.length&&(Z[`${ae}Codec`]=ye.join(","),ee=ee.filter(ve=>ye.indexOf(ve)===-1))}),Z.unknownCodecs=ee}function assignCodec(ie,Z,ee){const ae=Z[ee];ae&&(ie[ee]=ae)}function backfillProgramDateTimes(ie,Z){let ee=ie[Z];for(let ae=Z;ae--;){const ye=ie[ae];if(!ye)return;ye.programDateTime=ee.programDateTime-ye.duration*1e3,ee=ye}}function assignProgramDateTime(ie,Z){ie.rawProgramDateTime?ie.programDateTime=Date.parse(ie.rawProgramDateTime):Z!=null&&Z.programDateTime&&(ie.programDateTime=Z.endProgramDateTime),isFiniteNumber(ie.programDateTime)||(ie.programDateTime=null,ie.rawProgramDateTime=null)}function setInitSegment(ie,Z,ee,ae){ie.relurl=Z.URI,Z.BYTERANGE&&ie.setByteRange(Z.BYTERANGE),ie.level=ee,ie.sn="initSegment",ae&&(ie.levelkeys=ae),ie.initSegment=null}function setFragLevelKeys(ie,Z,ee){ie.levelkeys=Z;const{encryptedFragments:ae}=ee;(!ae.length||ae[ae.length-1].levelkeys!==Z)&&Object.keys(Z).some(ye=>Z[ye].isCommonEncryption)&&ae.push(ie)}var PlaylistContextType={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},PlaylistLevelType={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function mapContextToLevelType(ie){const{type:Z}=ie;switch(Z){case PlaylistContextType.AUDIO_TRACK:return PlaylistLevelType.AUDIO;case PlaylistContextType.SUBTITLE_TRACK:return PlaylistLevelType.SUBTITLE;default:return PlaylistLevelType.MAIN}}function getResponseUrl(ie,Z){let ee=ie.url;return(ee===void 0||ee.indexOf("data:")===0)&&(ee=Z.url),ee}class PlaylistLoader{constructor(Z){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=Z,this.registerListeners()}startLoad(Z){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:Z}=this;Z.on(Events.MANIFEST_LOADING,this.onManifestLoading,this),Z.on(Events.LEVEL_LOADING,this.onLevelLoading,this),Z.on(Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),Z.on(Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:Z}=this;Z.off(Events.MANIFEST_LOADING,this.onManifestLoading,this),Z.off(Events.LEVEL_LOADING,this.onLevelLoading,this),Z.off(Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),Z.off(Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(Z){const ee=this.hls.config,ae=ee.pLoader,ye=ee.loader,ve=ae||ye,be=new ve(ee);return this.loaders[Z.type]=be,be}getInternalLoader(Z){return this.loaders[Z.type]}resetInternalLoader(Z){this.loaders[Z]&&delete this.loaders[Z]}destroyInternalLoaders(){for(const Z in this.loaders){const ee=this.loaders[Z];ee&&ee.destroy(),this.resetInternalLoader(Z)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(Z,ee){const{url:ae}=ee;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:PlaylistContextType.MANIFEST,url:ae,deliveryDirectives:null})}onLevelLoading(Z,ee){const{id:ae,level:ye,pathwayId:ve,url:be,deliveryDirectives:Ye}=ee;this.load({id:ae,level:ye,pathwayId:ve,responseType:"text",type:PlaylistContextType.LEVEL,url:be,deliveryDirectives:Ye})}onAudioTrackLoading(Z,ee){const{id:ae,groupId:ye,url:ve,deliveryDirectives:be}=ee;this.load({id:ae,groupId:ye,level:null,responseType:"text",type:PlaylistContextType.AUDIO_TRACK,url:ve,deliveryDirectives:be})}onSubtitleTrackLoading(Z,ee){const{id:ae,groupId:ye,url:ve,deliveryDirectives:be}=ee;this.load({id:ae,groupId:ye,level:null,responseType:"text",type:PlaylistContextType.SUBTITLE_TRACK,url:ve,deliveryDirectives:be})}load(Z){var ee;const ae=this.hls.config;let ye=this.getInternalLoader(Z);if(ye){const Xe=ye.context;if(Xe&&Xe.url===Z.url&&Xe.level===Z.level){logger.trace("[playlist-loader]: playlist request ongoing");return}logger.log(`[playlist-loader]: aborting previous loader for type: ${Z.type}`),ye.abort()}let ve;if(Z.type===PlaylistContextType.MANIFEST?ve=ae.manifestLoadPolicy.default:ve=_extends({},ae.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),ye=this.createInternalLoader(Z),isFiniteNumber((ee=Z.deliveryDirectives)==null?void 0:ee.part)){let Xe;if(Z.type===PlaylistContextType.LEVEL&&Z.level!==null?Xe=this.hls.levels[Z.level].details:Z.type===PlaylistContextType.AUDIO_TRACK&&Z.id!==null?Xe=this.hls.audioTracks[Z.id].details:Z.type===PlaylistContextType.SUBTITLE_TRACK&&Z.id!==null&&(Xe=this.hls.subtitleTracks[Z.id].details),Xe){const Je=Xe.partTarget,rt=Xe.targetduration;if(Je&&rt){const nt=Math.max(Je*3,rt*.8)*1e3;ve=_extends({},ve,{maxTimeToFirstByteMs:Math.min(nt,ve.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(nt,ve.maxTimeToFirstByteMs)})}}}const be=ve.errorRetry||ve.timeoutRetry||{},Ye={loadPolicy:ve,timeout:ve.maxLoadTimeMs,maxRetry:be.maxNumRetry||0,retryDelay:be.retryDelayMs||0,maxRetryDelay:be.maxRetryDelayMs||0},Ke={onSuccess:(Xe,Je,rt,nt)=>{const it=this.getInternalLoader(rt);this.resetInternalLoader(rt.type);const lt=Xe.data;if(lt.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(Xe,rt,new Error("no EXTM3U delimiter"),nt||null,Je);return}Je.parsing.start=performance.now(),M3U8Parser.isMediaPlaylist(lt)?this.handleTrackOrLevelPlaylist(Xe,Je,rt,nt||null,it):this.handleMasterPlaylist(Xe,Je,rt,nt)},onError:(Xe,Je,rt,nt)=>{this.handleNetworkError(Je,rt,!1,Xe,nt)},onTimeout:(Xe,Je,rt)=>{this.handleNetworkError(Je,rt,!0,void 0,Xe)}};ye.load(Z,Ye,Ke)}handleMasterPlaylist(Z,ee,ae,ye){const ve=this.hls,be=Z.data,Ye=getResponseUrl(Z,ae),Ke=M3U8Parser.parseMasterPlaylist(be,Ye);if(Ke.playlistParsingError){this.handleManifestParsingError(Z,ae,Ke.playlistParsingError,ye,ee);return}const{contentSteering:Xe,levels:Je,sessionData:rt,sessionKeys:nt,startTimeOffset:it,variableList:lt}=Ke;this.variableList=lt;const{AUDIO:ct=[],SUBTITLES:ot,"CLOSED-CAPTIONS":dt}=M3U8Parser.parseMasterPlaylistMedia(be,Ye,Ke);ct.length&&!ct.some(ft=>!ft.url)&&Je[0].audioCodec&&!Je[0].attrs.AUDIO&&(logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),ct.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new AttrList({}),bitrate:0,url:""})),ve.trigger(Events.MANIFEST_LOADED,{levels:Je,audioTracks:ct,subtitles:ot,captions:dt,contentSteering:Xe,url:Ye,stats:ee,networkDetails:ye,sessionData:rt,sessionKeys:nt,startTimeOffset:it,variableList:lt})}handleTrackOrLevelPlaylist(Z,ee,ae,ye,ve){const be=this.hls,{id:Ye,level:Ke,type:Xe}=ae,Je=getResponseUrl(Z,ae),rt=0,nt=isFiniteNumber(Ke)?Ke:isFiniteNumber(Ye)?Ye:0,it=mapContextToLevelType(ae),lt=M3U8Parser.parseLevelPlaylist(Z.data,Je,nt,it,rt,this.variableList);if(Xe===PlaylistContextType.MANIFEST){const ct={attrs:new AttrList({}),bitrate:0,details:lt,name:"",url:Je};be.trigger(Events.MANIFEST_LOADED,{levels:[ct],audioTracks:[],url:Je,stats:ee,networkDetails:ye,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}ee.parsing.end=performance.now(),ae.levelDetails=lt,this.handlePlaylistLoaded(lt,Z,ee,ae,ye,ve)}handleManifestParsingError(Z,ee,ae,ye,ve){this.hls.trigger(Events.ERROR,{type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.MANIFEST_PARSING_ERROR,fatal:ee.type===PlaylistContextType.MANIFEST,url:Z.url,err:ae,error:ae,reason:ae.message,response:Z,context:ee,networkDetails:ye,stats:ve})}handleNetworkError(Z,ee,ae=!1,ye,ve){let be=`A network ${ae?"timeout":"error"+(ye?" (status "+ye.code+")":"")} occurred while loading ${Z.type}`;Z.type===PlaylistContextType.LEVEL?be+=`: ${Z.level} id: ${Z.id}`:(Z.type===PlaylistContextType.AUDIO_TRACK||Z.type===PlaylistContextType.SUBTITLE_TRACK)&&(be+=` id: ${Z.id} group-id: "${Z.groupId}"`);const Ye=new Error(be);logger.warn(`[playlist-loader]: ${be}`);let Ke=ErrorDetails.UNKNOWN,Xe=!1;const Je=this.getInternalLoader(Z);switch(Z.type){case PlaylistContextType.MANIFEST:Ke=ae?ErrorDetails.MANIFEST_LOAD_TIMEOUT:ErrorDetails.MANIFEST_LOAD_ERROR,Xe=!0;break;case PlaylistContextType.LEVEL:Ke=ae?ErrorDetails.LEVEL_LOAD_TIMEOUT:ErrorDetails.LEVEL_LOAD_ERROR,Xe=!1;break;case PlaylistContextType.AUDIO_TRACK:Ke=ae?ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:ErrorDetails.AUDIO_TRACK_LOAD_ERROR,Xe=!1;break;case PlaylistContextType.SUBTITLE_TRACK:Ke=ae?ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:ErrorDetails.SUBTITLE_LOAD_ERROR,Xe=!1;break}Je&&this.resetInternalLoader(Z.type);const rt={type:ErrorTypes.NETWORK_ERROR,details:Ke,fatal:Xe,url:Z.url,loader:Je,context:Z,error:Ye,networkDetails:ee,stats:ve};if(ye){const nt=(ee==null?void 0:ee.url)||Z.url;rt.response=_objectSpread2({url:nt,data:void 0},ye)}this.hls.trigger(Events.ERROR,rt)}handlePlaylistLoaded(Z,ee,ae,ye,ve,be){const Ye=this.hls,{type:Ke,level:Xe,id:Je,groupId:rt,deliveryDirectives:nt}=ye,it=getResponseUrl(ee,ye),lt=mapContextToLevelType(ye),ct=typeof ye.level=="number"&<===PlaylistLevelType.MAIN?Xe:void 0;if(!Z.fragments.length){const dt=new Error("No Segments found in Playlist");Ye.trigger(Events.ERROR,{type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:it,error:dt,reason:dt.message,response:ee,context:ye,level:ct,parent:lt,networkDetails:ve,stats:ae});return}Z.targetduration||(Z.playlistParsingError=new Error("Missing Target Duration"));const ot=Z.playlistParsingError;if(ot){Ye.trigger(Events.ERROR,{type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.LEVEL_PARSING_ERROR,fatal:!1,url:it,error:ot,reason:ot.message,response:ee,context:ye,level:ct,parent:lt,networkDetails:ve,stats:ae});return}switch(Z.live&&be&&(be.getCacheAge&&(Z.ageHeader=be.getCacheAge()||0),(!be.getCacheAge||isNaN(Z.ageHeader))&&(Z.ageHeader=0)),Ke){case PlaylistContextType.MANIFEST:case PlaylistContextType.LEVEL:Ye.trigger(Events.LEVEL_LOADED,{details:Z,level:ct||0,id:Je||0,stats:ae,networkDetails:ve,deliveryDirectives:nt});break;case PlaylistContextType.AUDIO_TRACK:Ye.trigger(Events.AUDIO_TRACK_LOADED,{details:Z,id:Je||0,groupId:rt||"",stats:ae,networkDetails:ve,deliveryDirectives:nt});break;case PlaylistContextType.SUBTITLE_TRACK:Ye.trigger(Events.SUBTITLE_TRACK_LOADED,{details:Z,id:Je||0,groupId:rt||"",stats:ae,networkDetails:ve,deliveryDirectives:nt});break}}}function sendAddTrackEvent(ie,Z){let ee;try{ee=new Event("addtrack")}catch{ee=document.createEvent("Event"),ee.initEvent("addtrack",!1,!1)}ee.track=ie,Z.dispatchEvent(ee)}function addCueToTrack(ie,Z){const ee=ie.mode;if(ee==="disabled"&&(ie.mode="hidden"),ie.cues&&!ie.cues.getCueById(Z.id))try{if(ie.addCue(Z),!ie.cues.getCueById(Z.id))throw new Error(`addCue is failed for: ${Z}`)}catch(ae){logger.debug(`[texttrack-utils]: ${ae}`);try{const ye=new self.TextTrackCue(Z.startTime,Z.endTime,Z.text);ye.id=Z.id,ie.addCue(ye)}catch(ye){logger.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${ye}`)}}ee==="disabled"&&(ie.mode=ee)}function clearCurrentCues(ie){const Z=ie.mode;if(Z==="disabled"&&(ie.mode="hidden"),ie.cues)for(let ee=ie.cues.length;ee--;)ie.removeCue(ie.cues[ee]);Z==="disabled"&&(ie.mode=Z)}function removeCuesInRange(ie,Z,ee,ae){const ye=ie.mode;if(ye==="disabled"&&(ie.mode="hidden"),ie.cues&&ie.cues.length>0){const ve=getCuesInRange(ie.cues,Z,ee);for(let be=0;beie[ee].endTime)return-1;let ae=0,ye=ee;for(;ae<=ye;){const ve=Math.floor((ye+ae)/2);if(Zie[ve].startTime&&ae-1)for(let ve=ye,be=ie.length;ve=Z&&Ye.endTime<=ee)ae.push(Ye);else if(Ye.startTime>ee)return ae}return ae}function filterSubtitleTracks(ie){const Z=[];for(let ee=0;ee"u"))return self.VTTCue||self.TextTrackCue}function createCueWithDataFields(ie,Z,ee,ae,ye){let ve=new ie(Z,ee,"");try{ve.value=ae,ye&&(ve.type=ye)}catch{ve=new ie(Z,ee,JSON.stringify(ye?_objectSpread2({type:ye},ae):ae))}return ve}const MAX_CUE_ENDTIME=(()=>{const ie=getCueClass();try{ie&&new ie(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function dateRangeDateToTimelineSeconds(ie,Z){return ie.getTime()/1e3-Z}function hexToArrayBuffer(ie){return Uint8Array.from(ie.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class ID3TrackController{constructor(Z){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=Z,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:Z}=this;Z.on(Events.MEDIA_ATTACHED,this.onMediaAttached,this),Z.on(Events.MEDIA_DETACHING,this.onMediaDetaching,this),Z.on(Events.MANIFEST_LOADING,this.onManifestLoading,this),Z.on(Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),Z.on(Events.BUFFER_FLUSHING,this.onBufferFlushing,this),Z.on(Events.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:Z}=this;Z.off(Events.MEDIA_ATTACHED,this.onMediaAttached,this),Z.off(Events.MEDIA_DETACHING,this.onMediaDetaching,this),Z.off(Events.MANIFEST_LOADING,this.onManifestLoading,this),Z.off(Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),Z.off(Events.BUFFER_FLUSHING,this.onBufferFlushing,this),Z.off(Events.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(Z,ee){this.media=ee.media}onMediaDetaching(){this.id3Track&&(clearCurrentCues(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(Z){const ee=this.getID3Track(Z.textTracks);return ee.mode="hidden",ee}getID3Track(Z){if(this.media){for(let ee=0;eeMAX_CUE_ENDTIME&&(rt=MAX_CUE_ENDTIME),rt-Je<=0&&(rt=Je+MIN_CUE_DURATION);for(let nt=0;ntJe.type===MetadataSchema.audioId3&&Ke:ye==="video"?Xe=Je=>Je.type===MetadataSchema.emsg&&Ye:Xe=Je=>Je.type===MetadataSchema.audioId3&&Ke||Je.type===MetadataSchema.emsg&&Ye,removeCuesInRange(ve,ee,ae,Xe)}}onLevelUpdated(Z,{details:ee}){if(!this.media||!ee.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:ae,id3Track:ye}=this,{dateRanges:ve}=ee,be=Object.keys(ve);if(ye){const Je=Object.keys(ae).filter(rt=>!be.includes(rt));for(let rt=Je.length;rt--;){const nt=Je[rt];Object.keys(ae[nt].cues).forEach(it=>{ye.removeCue(ae[nt].cues[it])}),delete ae[nt]}}const Ye=ee.fragments[ee.fragments.length-1];if(be.length===0||!isFiniteNumber(Ye==null?void 0:Ye.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const Ke=Ye.programDateTime/1e3-Ye.start,Xe=getCueClass();for(let Je=0;Je{if(Qr!==nt.id){const Xr=ve[Qr];if(Xr.class===nt.class&&Xr.startDate>nt.startDate&&(!Yr||nt.startDatethis.timeupdate(),this.hls=Z,this.config=Z.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:Z,levelDetails:ee}=this;return Z.liveMaxLatencyDuration!==void 0?Z.liveMaxLatencyDuration:ee?Z.liveMaxLatencyDurationCount*ee.targetduration:0}get targetLatency(){const{levelDetails:Z}=this;if(Z===null)return null;const{holdBack:ee,partHoldBack:ae,targetduration:ye}=Z,{liveSyncDuration:ve,liveSyncDurationCount:be,lowLatencyMode:Ye}=this.config,Ke=this.hls.userConfig;let Xe=Ye&&ae||ee;(Ke.liveSyncDuration||Ke.liveSyncDurationCount||Xe===0)&&(Xe=ve!==void 0?ve:be*ye);const Je=ye;return Xe+Math.min(this.stallCount*1,Je)}get liveSyncPosition(){const Z=this.estimateLiveEdge(),ee=this.targetLatency,ae=this.levelDetails;if(Z===null||ee===null||ae===null)return null;const ye=ae.edge,ve=Z-ee-this.edgeStalled,be=ye-ae.totalduration,Ye=ye-(this.config.lowLatencyMode&&ae.partTarget||ae.targetduration);return Math.min(Math.max(be,ve),Ye)}get drift(){const{levelDetails:Z}=this;return Z===null?1:Z.drift}get edgeStalled(){const{levelDetails:Z}=this;if(Z===null)return 0;const ee=(this.config.lowLatencyMode&&Z.partTarget||Z.targetduration)*3;return Math.max(Z.age-ee,0)}get forwardBufferLength(){const{media:Z,levelDetails:ee}=this;if(!Z||!ee)return 0;const ae=Z.buffered.length;return(ae?Z.buffered.end(ae-1):ee.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(Events.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(Events.ERROR,this.onError,this)}onMediaAttached(Z,ee){this.media=ee.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(Z,{details:ee}){this.levelDetails=ee,ee.advanced&&this.timeupdate(),!ee.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(Z,ee){var ae;ee.details===ErrorDetails.BUFFER_STALLED_ERROR&&(this.stallCount++,(ae=this.levelDetails)!=null&&ae.live&&logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:Z,levelDetails:ee}=this;if(!Z||!ee)return;this.currentTime=Z.currentTime;const ae=this.computeLatency();if(ae===null)return;this._latency=ae;const{lowLatencyMode:ye,maxLiveSyncPlaybackRate:ve}=this.config;if(!ye||ve===1||!ee.live)return;const be=this.targetLatency;if(be===null)return;const Ye=ae-be,Ke=Math.min(this.maxLatency,be+ee.targetduration);if(Ye.05&&this.forwardBufferLength>1){const Xe=Math.min(2,Math.max(1,ve)),Je=Math.round(2/(1+Math.exp(-.75*Ye-this.edgeStalled))*20)/20;Z.playbackRate=Math.min(Xe,Math.max(1,Je))}else Z.playbackRate!==1&&Z.playbackRate!==0&&(Z.playbackRate=1)}estimateLiveEdge(){const{levelDetails:Z}=this;return Z===null?null:Z.edge+Z.age}computeLatency(){const Z=this.estimateLiveEdge();return Z===null?null:Z-this.currentTime}}const HdcpLevels=["NONE","TYPE-0","TYPE-1",null];function isHdcpLevel(ie){return HdcpLevels.indexOf(ie)>-1}const VideoRangeValues=["SDR","PQ","HLG"];function isVideoRange(ie){return!!ie&&VideoRangeValues.indexOf(ie)>-1}var HlsSkip={No:"",Yes:"YES",v2:"v2"};function getSkipValue(ie,Z){const{canSkipUntil:ee,canSkipDateRanges:ae,endSN:ye}=ie,ve=Z!==void 0?Z-ye:0;return ee&&ve!!ee).map(ee=>ee.substring(0,4)).join(","),this.addGroupId("audio",Z.attrs.AUDIO),this.addGroupId("text",Z.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(Z){return hasGroup(this._audioGroups,Z)}hasSubtitleGroup(Z){return hasGroup(this._subtitleGroups,Z)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(Z,ee){if(ee){if(Z==="audio"){let ae=this._audioGroups;ae||(ae=this._audioGroups=[]),ae.indexOf(ee)===-1&&ae.push(ee)}else if(Z==="text"){let ae=this._subtitleGroups;ae||(ae=this._subtitleGroups=[]),ae.indexOf(ee)===-1&&ae.push(ee)}}}get urlId(){return 0}set urlId(Z){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var Z;return(Z=this.audioGroups)==null?void 0:Z[0]}get textGroupId(){var Z;return(Z=this.subtitleGroups)==null?void 0:Z[0]}addFallback(){}}function hasGroup(ie,Z){return!Z||!ie?!1:ie.indexOf(Z)!==-1}function updateFromToPTS(ie,Z){const ee=Z.startPTS;if(isFiniteNumber(ee)){let ae=0,ye;Z.sn>ie.sn?(ae=ee-ie.start,ye=ie):(ae=ie.start-ee,ye=Z),ye.duration!==ae&&(ye.duration=ae)}else Z.sn>ie.sn?ie.cc===Z.cc&&ie.minEndPTS?Z.start=ie.start+(ie.minEndPTS-ie.start):Z.start=ie.start+ie.duration:Z.start=Math.max(ie.start-Z.duration,0)}function updateFragPTSDTS(ie,Z,ee,ae,ye,ve){ae-ee<=0&&(logger.warn("Fragment should have a positive duration",Z),ae=ee+Z.duration,ve=ye+Z.duration);let be=ee,Ye=ae;const Ke=Z.startPTS,Xe=Z.endPTS;if(isFiniteNumber(Ke)){const ct=Math.abs(Ke-ee);isFiniteNumber(Z.deltaPTS)?Z.deltaPTS=Math.max(ct,Z.deltaPTS):Z.deltaPTS=ct,be=Math.max(ee,Ke),ee=Math.min(ee,Ke),ye=Math.min(ye,Z.startDTS),Ye=Math.min(ae,Xe),ae=Math.max(ae,Xe),ve=Math.max(ve,Z.endDTS)}const Je=ee-Z.start;Z.start!==0&&(Z.start=ee),Z.duration=ae-Z.start,Z.startPTS=ee,Z.maxStartPTS=be,Z.startDTS=ye,Z.endPTS=ae,Z.minEndPTS=Ye,Z.endDTS=ve;const rt=Z.sn;if(!ie||rtie.endSN)return 0;let nt;const it=rt-ie.startSN,lt=ie.fragments;for(lt[it]=Z,nt=it;nt>0;nt--)updateFromToPTS(lt[nt],lt[nt-1]);for(nt=it;nt=0;Ke--){const Xe=ae[Ke].initSegment;if(Xe){ee=Xe;break}}ie.fragmentHint&&delete ie.fragmentHint.endPTS;let ye=0,ve;if(mapFragmentIntersection(ie,Z,(Ke,Xe)=>{Ke.relurl&&(ye=Ke.cc-Xe.cc),isFiniteNumber(Ke.startPTS)&&isFiniteNumber(Ke.endPTS)&&(Xe.start=Xe.startPTS=Ke.startPTS,Xe.startDTS=Ke.startDTS,Xe.maxStartPTS=Ke.maxStartPTS,Xe.endPTS=Ke.endPTS,Xe.endDTS=Ke.endDTS,Xe.minEndPTS=Ke.minEndPTS,Xe.duration=Ke.endPTS-Ke.startPTS,Xe.duration&&(ve=Xe),Z.PTSKnown=Z.alignedSliding=!0),Xe.elementaryStreams=Ke.elementaryStreams,Xe.loader=Ke.loader,Xe.stats=Ke.stats,Ke.initSegment&&(Xe.initSegment=Ke.initSegment,ee=Ke.initSegment)}),ee&&(Z.fragmentHint?Z.fragments.concat(Z.fragmentHint):Z.fragments).forEach(Ke=>{var Xe;Ke&&(!Ke.initSegment||Ke.initSegment.relurl===((Xe=ee)==null?void 0:Xe.relurl))&&(Ke.initSegment=ee)}),Z.skippedSegments)if(Z.deltaUpdateFailed=Z.fragments.some(Ke=>!Ke),Z.deltaUpdateFailed){logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let Ke=Z.skippedSegments;Ke--;)Z.fragments.shift();Z.startSN=Z.fragments[0].sn,Z.startCC=Z.fragments[0].cc}else Z.canSkipDateRanges&&(Z.dateRanges=mergeDateRanges(ie.dateRanges,Z.dateRanges,Z.recentlyRemovedDateranges));const be=Z.fragments;if(ye){logger.warn("discontinuity sliding from playlist, take drift into account");for(let Ke=0;Ke{Xe.elementaryStreams=Ke.elementaryStreams,Xe.stats=Ke.stats}),ve?updateFragPTSDTS(Z,ve,ve.startPTS,ve.endPTS,ve.startDTS,ve.endDTS):adjustSliding(ie,Z),be.length&&(Z.totalduration=Z.edge-be[0].start),Z.driftStartTime=ie.driftStartTime,Z.driftStart=ie.driftStart;const Ye=Z.advancedDateTime;if(Z.advanced&&Ye){const Ke=Z.edge;Z.driftStart||(Z.driftStartTime=Ye,Z.driftStart=Ke),Z.driftEndTime=Ye,Z.driftEnd=Ke}else Z.driftEndTime=ie.driftEndTime,Z.driftEnd=ie.driftEnd,Z.advancedDateTime=ie.advancedDateTime}function mergeDateRanges(ie,Z,ee){const ae=_extends({},ie);return ee&&ee.forEach(ye=>{delete ae[ye]}),Object.keys(Z).forEach(ye=>{const ve=new DateRange(Z[ye].attr,ae[ye]);ve.isValid?ae[ye]=ve:logger.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(Z[ye].attr)}"`)}),ae}function mapPartIntersection(ie,Z,ee){if(ie&&Z){let ae=0;for(let ye=0,ve=ie.length;ye<=ve;ye++){const be=ie[ye],Ye=Z[ye+ae];be&&Ye&&be.index===Ye.index&&be.fragment.sn===Ye.fragment.sn?ee(be,Ye):ae--}}}function mapFragmentIntersection(ie,Z,ee){const ae=Z.skippedSegments,ye=Math.max(ie.startSN,Z.startSN)-Z.startSN,ve=(ie.fragmentHint?1:0)+(ae?Z.endSN:Math.min(ie.endSN,Z.endSN))-Z.startSN,be=Z.startSN-ie.startSN,Ye=Z.fragmentHint?Z.fragments.concat(Z.fragmentHint):Z.fragments,Ke=ie.fragmentHint?ie.fragments.concat(ie.fragmentHint):ie.fragments;for(let Xe=ye;Xe<=ve;Xe++){const Je=Ke[be+Xe];let rt=Ye[Xe];ae&&!rt&&Xe=ae.length||addSliding(Z,ae[ee].start)}function addSliding(ie,Z){if(Z){const ee=ie.fragments;for(let ae=ie.skippedSegments;aeZ){const ye=ae[ae.length-1].duration*1e3;ye{const{details:ae}=Z;ae!=null&&ae.fragments&&ae.fragments.forEach(ye=>{ye.level=ee})})}function isTimeoutError(ie){switch(ie.details){case ErrorDetails.FRAG_LOAD_TIMEOUT:case ErrorDetails.KEY_LOAD_TIMEOUT:case ErrorDetails.LEVEL_LOAD_TIMEOUT:case ErrorDetails.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function getRetryConfig(ie,Z){const ee=isTimeoutError(Z);return ie.default[`${ee?"timeout":"error"}Retry`]}function getRetryDelay(ie,Z){const ee=ie.backoff==="linear"?1:Math.pow(2,Z);return Math.min(ee*ie.retryDelayMs,ie.maxRetryDelayMs)}function getLoaderConfigWithoutReties(ie){return _objectSpread2(_objectSpread2({},ie),{errorRetry:null,timeoutRetry:null})}function shouldRetry(ie,Z,ee,ae){if(!ie)return!1;const ye=ae==null?void 0:ae.code,ve=Z499)}const BinarySearch={search:function(ie,Z){let ee=0,ae=ie.length-1,ye=null,ve=null;for(;ee<=ae;){ye=(ee+ae)/2|0,ve=ie[ye];const be=Z(ve);if(be>0)ee=ye+1;else if(be<0)ae=ye-1;else return ve}return null}};function findFragmentByPDT(ie,Z,ee){if(Z===null||!Array.isArray(ie)||!ie.length||!isFiniteNumber(Z))return null;const ae=ie[0].programDateTime;if(Z<(ae||0))return null;const ye=ie[ie.length-1].endProgramDateTime;if(Z>=(ye||0))return null;ee=ee||0;for(let ve=0;ve0&&be<15e-7&&(ee+=15e-7)}else ee===0&&Z[0].start===0&&(ye=Z[0]);if(ye&&(!ie||ie.level===ye.level)&&fragmentWithinToleranceTest(ee,ae,ye)===0)return ye;const ve=BinarySearch.search(Z,fragmentWithinToleranceTest.bind(null,ee,ae));return ve&&(ve!==ie||!ye)?ve:ye}function fragmentWithinToleranceTest(ie=0,Z=0,ee){if(ee.start<=ie&&ee.start+ee.duration>ie)return 0;const ae=Math.min(Z,ee.duration+(ee.deltaPTS?ee.deltaPTS:0));return ee.start+ee.duration-ae<=ie?1:ee.start-ae>ie&&ee.start?-1:0}function pdtWithinToleranceTest(ie,Z,ee){const ae=Math.min(Z,ee.duration+(ee.deltaPTS?ee.deltaPTS:0))*1e3;return(ee.endProgramDateTime||0)-ae>ie}function findFragWithCC(ie,Z){return BinarySearch.search(ie,ee=>ee.ccZ?-1:0)}var NetworkErrorAction={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},ErrorActionFlags={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class ErrorController{constructor(Z){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=Z,this.log=logger.log.bind(logger,"[info]:"),this.warn=logger.warn.bind(logger,"[warning]:"),this.error=logger.error.bind(logger,"[error]:"),this.registerListeners()}registerListeners(){const Z=this.hls;Z.on(Events.ERROR,this.onError,this),Z.on(Events.MANIFEST_LOADING,this.onManifestLoading,this),Z.on(Events.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const Z=this.hls;Z&&(Z.off(Events.ERROR,this.onError,this),Z.off(Events.ERROR,this.onErrorOut,this),Z.off(Events.MANIFEST_LOADING,this.onManifestLoading,this),Z.off(Events.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(Z){}stopLoad(){this.playlistError=0}getVariantLevelIndex(Z){return(Z==null?void 0:Z.type)===PlaylistLevelType.MAIN?Z.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(Z,ee){var ae,ye;if(ee.fatal)return;const ve=this.hls,be=ee.context;switch(ee.details){case ErrorDetails.FRAG_LOAD_ERROR:case ErrorDetails.FRAG_LOAD_TIMEOUT:case ErrorDetails.KEY_LOAD_ERROR:case ErrorDetails.KEY_LOAD_TIMEOUT:ee.errorAction=this.getFragRetryOrSwitchAction(ee);return;case ErrorDetails.FRAG_PARSING_ERROR:if((ae=ee.frag)!=null&&ae.gap){ee.errorAction={action:NetworkErrorAction.DoNothing,flags:ErrorActionFlags.None};return}case ErrorDetails.FRAG_GAP:case ErrorDetails.FRAG_DECRYPT_ERROR:{ee.errorAction=this.getFragRetryOrSwitchAction(ee),ee.errorAction.action=NetworkErrorAction.SendAlternateToPenaltyBox;return}case ErrorDetails.LEVEL_EMPTY_ERROR:case ErrorDetails.LEVEL_PARSING_ERROR:{var Ye,Ke;const Xe=ee.parent===PlaylistLevelType.MAIN?ee.level:ve.loadLevel;ee.details===ErrorDetails.LEVEL_EMPTY_ERROR&&(Ye=ee.context)!=null&&(Ke=Ye.levelDetails)!=null&&Ke.live?ee.errorAction=this.getPlaylistRetryOrSwitchAction(ee,Xe):(ee.levelRetry=!1,ee.errorAction=this.getLevelSwitchAction(ee,Xe))}return;case ErrorDetails.LEVEL_LOAD_ERROR:case ErrorDetails.LEVEL_LOAD_TIMEOUT:typeof(be==null?void 0:be.level)=="number"&&(ee.errorAction=this.getPlaylistRetryOrSwitchAction(ee,be.level));return;case ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:case ErrorDetails.SUBTITLE_LOAD_ERROR:case ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:if(be){const Xe=ve.levels[ve.loadLevel];if(Xe&&(be.type===PlaylistContextType.AUDIO_TRACK&&Xe.hasAudioGroup(be.groupId)||be.type===PlaylistContextType.SUBTITLE_TRACK&&Xe.hasSubtitleGroup(be.groupId))){ee.errorAction=this.getPlaylistRetryOrSwitchAction(ee,ve.loadLevel),ee.errorAction.action=NetworkErrorAction.SendAlternateToPenaltyBox,ee.errorAction.flags=ErrorActionFlags.MoveAllAlternatesMatchingHost;return}}return;case ErrorDetails.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const Xe=ve.levels[ve.loadLevel],Je=Xe==null?void 0:Xe.attrs["HDCP-LEVEL"];Je?ee.errorAction={action:NetworkErrorAction.SendAlternateToPenaltyBox,flags:ErrorActionFlags.MoveAllAlternatesMatchingHDCP,hdcpLevel:Je}:this.keySystemError(ee)}return;case ErrorDetails.BUFFER_ADD_CODEC_ERROR:case ErrorDetails.REMUX_ALLOC_ERROR:case ErrorDetails.BUFFER_APPEND_ERROR:ee.errorAction=this.getLevelSwitchAction(ee,(ye=ee.level)!=null?ye:ve.loadLevel);return;case ErrorDetails.INTERNAL_EXCEPTION:case ErrorDetails.BUFFER_APPENDING_ERROR:case ErrorDetails.BUFFER_FULL_ERROR:case ErrorDetails.LEVEL_SWITCH_ERROR:case ErrorDetails.BUFFER_STALLED_ERROR:case ErrorDetails.BUFFER_SEEK_OVER_HOLE:case ErrorDetails.BUFFER_NUDGE_ON_STALL:ee.errorAction={action:NetworkErrorAction.DoNothing,flags:ErrorActionFlags.None};return}ee.type===ErrorTypes.KEY_SYSTEM_ERROR&&this.keySystemError(ee)}keySystemError(Z){const ee=this.getVariantLevelIndex(Z.frag);Z.levelRetry=!1,Z.errorAction=this.getLevelSwitchAction(Z,ee)}getPlaylistRetryOrSwitchAction(Z,ee){const ae=this.hls,ye=getRetryConfig(ae.config.playlistLoadPolicy,Z),ve=this.playlistError++;if(shouldRetry(ye,ve,isTimeoutError(Z),Z.response))return{action:NetworkErrorAction.RetryRequest,flags:ErrorActionFlags.None,retryConfig:ye,retryCount:ve};const be=this.getLevelSwitchAction(Z,ee);return ye&&(be.retryConfig=ye,be.retryCount=ve),be}getFragRetryOrSwitchAction(Z){const ee=this.hls,ae=this.getVariantLevelIndex(Z.frag),ye=ee.levels[ae],{fragLoadPolicy:ve,keyLoadPolicy:be}=ee.config,Ye=getRetryConfig(Z.details.startsWith("key")?be:ve,Z),Ke=ee.levels.reduce((Je,rt)=>Je+rt.fragmentError,0);if(ye&&(Z.details!==ErrorDetails.FRAG_GAP&&ye.fragmentError++,shouldRetry(Ye,Ke,isTimeoutError(Z),Z.response)))return{action:NetworkErrorAction.RetryRequest,flags:ErrorActionFlags.None,retryConfig:Ye,retryCount:Ke};const Xe=this.getLevelSwitchAction(Z,ae);return Ye&&(Xe.retryConfig=Ye,Xe.retryCount=Ke),Xe}getLevelSwitchAction(Z,ee){const ae=this.hls;ee==null&&(ee=ae.loadLevel);const ye=this.hls.levels[ee];if(ye){var ve,be;const Xe=Z.details;ye.loadError++,Xe===ErrorDetails.BUFFER_APPEND_ERROR&&ye.fragmentError++;let Je=-1;const{levels:rt,loadLevel:nt,minAutoLevel:it,maxAutoLevel:lt}=ae;ae.autoLevelEnabled||(ae.loadLevel=-1);const ct=(ve=Z.frag)==null?void 0:ve.type,ot=(ct===PlaylistLevelType.AUDIO&&Xe===ErrorDetails.FRAG_PARSING_ERROR||Z.sourceBufferName==="audio"&&(Xe===ErrorDetails.BUFFER_ADD_CODEC_ERROR||Xe===ErrorDetails.BUFFER_APPEND_ERROR))&&rt.some(({audioCodec:mt})=>ye.audioCodec!==mt),dt=Z.sourceBufferName==="video"&&(Xe===ErrorDetails.BUFFER_ADD_CODEC_ERROR||Xe===ErrorDetails.BUFFER_APPEND_ERROR)&&rt.some(({codecSet:mt,audioCodec:Yr})=>ye.codecSet!==mt&&ye.audioCodec===Yr),{type:ft,groupId:gt}=(be=Z.context)!=null?be:{};for(let mt=rt.length;mt--;){const Yr=(mt+nt)%rt.length;if(Yr!==nt&&Yr>=it&&Yr<=lt&&rt[Yr].loadError===0){var Ye,Ke;const Qr=rt[Yr];if(Xe===ErrorDetails.FRAG_GAP&&Z.frag){const Xr=rt[Yr].details;if(Xr){const Jr=findFragmentByPTS(Z.frag,Xr.fragments,Z.frag.start);if(Jr!=null&&Jr.gap)continue}}else if(ft===PlaylistContextType.AUDIO_TRACK&&Qr.hasAudioGroup(gt)||ft===PlaylistContextType.SUBTITLE_TRACK&&Qr.hasSubtitleGroup(gt)||ct===PlaylistLevelType.AUDIO&&(Ye=ye.audioGroups)!=null&&Ye.some(Xr=>Qr.hasAudioGroup(Xr))||ct===PlaylistLevelType.SUBTITLE&&(Ke=ye.subtitleGroups)!=null&&Ke.some(Xr=>Qr.hasSubtitleGroup(Xr))||ot&&ye.audioCodec===Qr.audioCodec||!ot&&ye.audioCodec!==Qr.audioCodec||dt&&ye.codecSet===Qr.codecSet)continue;Je=Yr;break}}if(Je>-1&&ae.loadLevel!==Je)return Z.levelRetry=!0,this.playlistError=0,{action:NetworkErrorAction.SendAlternateToPenaltyBox,flags:ErrorActionFlags.None,nextAutoLevel:Je}}return{action:NetworkErrorAction.SendAlternateToPenaltyBox,flags:ErrorActionFlags.MoveAllAlternatesMatchingHost}}onErrorOut(Z,ee){var ae;switch((ae=ee.errorAction)==null?void 0:ae.action){case NetworkErrorAction.DoNothing:break;case NetworkErrorAction.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(ee),!ee.errorAction.resolved&&ee.details!==ErrorDetails.FRAG_GAP?ee.fatal=!0:/MediaSource readyState: ended/.test(ee.error.message)&&(this.warn(`MediaSource ended after "${ee.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break}if(ee.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(Z){const ee=this.hls,ae=Z.errorAction;if(!ae)return;const{flags:ye,hdcpLevel:ve,nextAutoLevel:be}=ae;switch(ye){case ErrorActionFlags.None:this.switchLevel(Z,be);break;case ErrorActionFlags.MoveAllAlternatesMatchingHDCP:ve&&(ee.maxHdcpLevel=HdcpLevels[HdcpLevels.indexOf(ve)-1],ae.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${ee.maxHdcpLevel}" or lower`);break}ae.resolved||this.switchLevel(Z,be)}switchLevel(Z,ee){ee!==void 0&&Z.errorAction&&(this.warn(`switching to level ${ee} after ${Z.details}`),this.hls.nextAutoLevel=ee,Z.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}}class BasePlaylistController{constructor(Z,ee){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=logger.log.bind(logger,`${ee}:`),this.warn=logger.warn.bind(logger,`${ee}:`),this.hls=Z}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(Z,ee){const ae=ee==null?void 0:ee.renditionReports;if(ae){let ye=-1;for(let ve=0;ve=0&&Ke>ee.partTarget&&(Ye+=1)}return new HlsUrlParameters(be,Ye>=0?Ye:void 0,HlsSkip.No)}}}loadPlaylist(Z){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(Z){return this.canLoad&&!!Z&&!!Z.url&&(!Z.details||Z.details.live)}shouldReloadPlaylist(Z){return this.timer===-1&&this.requestScheduled===-1&&this.shouldLoadPlaylist(Z)}playlistLoaded(Z,ee,ae){const{details:ye,stats:ve}=ee,be=self.performance.now(),Ye=ve.loading.first?Math.max(0,be-ve.loading.first):0;if(ye.advancedDateTime=Date.now()-Ye,ye.live||ae!=null&&ae.live){if(ye.reloaded(ae),ae&&this.log(`live playlist ${Z} ${ye.advanced?"REFRESHED "+ye.lastPartSn+"-"+ye.lastPartIndex:ye.updated?"UPDATED":"MISSED"}`),ae&&ye.fragments.length>0&&mergeDetails(ae,ye),!this.canLoad||!ye.live)return;let Ke,Xe,Je;if(ye.canBlockReload&&ye.endSN&&ye.advanced){const ot=this.hls.config.lowLatencyMode,dt=ye.lastPartSn,ft=ye.endSN,gt=ye.lastPartIndex,mt=gt!==-1,Yr=dt===ft,Qr=ot?0:gt;mt?(Xe=Yr?ft+1:dt,Je=Yr?Qr:gt+1):Xe=ft+1;const Xr=ye.age,Jr=Xr+ye.ageHeader;let ai=Math.min(Jr-ye.partTarget,ye.targetduration*1.5);if(ai>0){if(ae&&ai>ae.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${ae.tuneInGoal} to: ${ai} with playlist age: ${ye.age}`),ai=0;else{const oi=Math.floor(ai/ye.targetduration);if(Xe+=oi,Je!==void 0){const ni=Math.round(ai%ye.targetduration/ye.partTarget);Je+=ni}this.log(`CDN Tune-in age: ${ye.ageHeader}s last advanced ${Xr.toFixed(2)}s goal: ${ai} skip sn ${oi} to part ${Je}`)}ye.tuneInGoal=ai}if(Ke=this.getDeliveryDirectives(ye,ee.deliveryDirectives,Xe,Je),ot||!Yr){this.loadPlaylist(Ke);return}}else(ye.canBlockReload||ye.canSkipUntil)&&(Ke=this.getDeliveryDirectives(ye,ee.deliveryDirectives,Xe,Je));const rt=this.hls.mainForwardBufferInfo,nt=rt?rt.end-rt.len:0,it=(ye.edge-nt)*1e3,lt=computeReloadInterval(ye,it);ye.updated&&be>this.requestScheduled+lt&&(this.requestScheduled=ve.loading.start),Xe!==void 0&&ye.canBlockReload?this.requestScheduled=ve.loading.first+lt-(ye.partTarget*1e3||1e3):this.requestScheduled===-1||this.requestScheduled+ltthis.loadPlaylist(Ke),ct)}else this.clearTimer()}getDeliveryDirectives(Z,ee,ae,ye){let ve=getSkipValue(Z,ae);return ee!=null&&ee.skip&&Z.deltaUpdateFailed&&(ae=ee.msn,ye=ee.part,ve=HlsSkip.No),new HlsUrlParameters(ae,ye,ve)}checkRetry(Z){const ee=Z.details,ae=isTimeoutError(Z),ye=Z.errorAction,{action:ve,retryCount:be=0,retryConfig:Ye}=ye||{},Ke=!!ye&&!!Ye&&(ve===NetworkErrorAction.RetryRequest||!ye.resolved&&ve===NetworkErrorAction.SendAlternateToPenaltyBox);if(Ke){var Xe;if(this.requestScheduled=-1,be>=Ye.maxNumRetry)return!1;if(ae&&(Xe=Z.context)!=null&&Xe.deliveryDirectives)this.warn(`Retrying playlist loading ${be+1}/${Ye.maxNumRetry} after "${ee}" without delivery-directives`),this.loadPlaylist();else{const Je=getRetryDelay(Ye,be);this.timer=self.setTimeout(()=>this.loadPlaylist(),Je),this.warn(`Retrying playlist loading ${be+1}/${Ye.maxNumRetry} after "${ee}" in ${Je}ms`)}Z.levelRetry=!0,ye.resolved=!0}return Ke}}class EWMA{constructor(Z,ee=0,ae=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=Z,this.alpha_=Z?Math.exp(Math.log(.5)/Z):0,this.estimate_=ee,this.totalWeight_=ae}sample(Z,ee){const ae=Math.pow(this.alpha_,Z);this.estimate_=ee*(1-ae)+ae*this.estimate_,this.totalWeight_+=Z}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const Z=1-Math.pow(this.alpha_,this.totalWeight_);if(Z)return this.estimate_/Z}return this.estimate_}}class EwmaBandWidthEstimator{constructor(Z,ee,ae,ye=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=ae,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new EWMA(Z),this.fast_=new EWMA(ee),this.defaultTTFB_=ye,this.ttfb_=new EWMA(Z)}update(Z,ee){const{slow_:ae,fast_:ye,ttfb_:ve}=this;ae.halfLife!==Z&&(this.slow_=new EWMA(Z,ae.getEstimate(),ae.getTotalWeight())),ye.halfLife!==ee&&(this.fast_=new EWMA(ee,ye.getEstimate(),ye.getTotalWeight())),ve.halfLife!==Z&&(this.ttfb_=new EWMA(Z,ve.getEstimate(),ve.getTotalWeight()))}sample(Z,ee){Z=Math.max(Z,this.minDelayMs_);const ae=8*ee,ye=Z/1e3,ve=ae/ye;this.fast_.sample(ye,ve),this.slow_.sample(ye,ve)}sampleTTFB(Z){const ee=Z/1e3,ae=Math.sqrt(2)*Math.exp(-Math.pow(ee,2)/2);this.ttfb_.sample(ae,Math.max(Z,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}const SUPPORTED_INFO_DEFAULT={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]},SUPPORTED_INFO_CACHE={};function requiresMediaCapabilitiesDecodingInfo(ie,Z,ee,ae,ye,ve){const be=ie.audioCodec?ie.audioGroups:null,Ye=ve==null?void 0:ve.audioCodec,Ke=ve==null?void 0:ve.channels,Xe=Ke?parseInt(Ke):Ye?1/0:2;let Je=null;if(be!=null&&be.length)try{be.length===1&&be[0]?Je=Z.groups[be[0]].channels:Je=be.reduce((rt,nt)=>{if(nt){const it=Z.groups[nt];if(!it)throw new Error(`Audio track group ${nt} not found`);Object.keys(it.channels).forEach(lt=>{rt[lt]=(rt[lt]||0)+it.channels[lt]})}return rt},{2:0})}catch{return!0}return ie.videoCodec!==void 0&&(ie.width>1920&&ie.height>1088||ie.height>1920&&ie.width>1088||ie.frameRate>Math.max(ae,30)||ie.videoRange!=="SDR"&&ie.videoRange!==ee||ie.bitrate>Math.max(ye,8e6))||!!Je&&isFiniteNumber(Xe)&&Object.keys(Je).some(rt=>parseInt(rt)>Xe)}function getMediaDecodingInfoPromise(ie,Z,ee){const ae=ie.videoCodec,ye=ie.audioCodec;if(!ae||!ye||!ee)return Promise.resolve(SUPPORTED_INFO_DEFAULT);const ve={width:ie.width,height:ie.height,bitrate:Math.ceil(Math.max(ie.bitrate*.9,ie.averageBitrate)),framerate:ie.frameRate||30},be=ie.videoRange;be!=="SDR"&&(ve.transferFunction=be.toLowerCase());const Ye=ae.split(",").map(Ke=>({type:"media-source",video:_objectSpread2(_objectSpread2({},ve),{},{contentType:mimeTypeForCodec(Ke,"video")})}));return ye&&ie.audioGroups&&ie.audioGroups.forEach(Ke=>{var Xe;Ke&&((Xe=Z.groups[Ke])==null||Xe.tracks.forEach(Je=>{if(Je.groupId===Ke){const rt=Je.channels||"",nt=parseFloat(rt);isFiniteNumber(nt)&&nt>2&&Ye.push.apply(Ye,ye.split(",").map(it=>({type:"media-source",audio:{contentType:mimeTypeForCodec(it,"audio"),channels:""+nt}})))}}))}),Promise.all(Ye.map(Ke=>{const Xe=getMediaDecodingInfoKey(Ke);return SUPPORTED_INFO_CACHE[Xe]||(SUPPORTED_INFO_CACHE[Xe]=ee.decodingInfo(Ke))})).then(Ke=>({supported:!Ke.some(Xe=>!Xe.supported),configurations:Ye,decodingInfoResults:Ke})).catch(Ke=>({supported:!1,configurations:Ye,decodingInfoResults:[],error:Ke}))}function getMediaDecodingInfoKey(ie){const{audio:Z,video:ee}=ie,ae=ee||Z;if(ae){const ye=ae.contentType.split('"')[1];if(ee)return`r${ee.height}x${ee.width}f${Math.ceil(ee.framerate)}${ee.transferFunction||"sd"}_${ye}_${Math.ceil(ee.bitrate/1e5)}`;if(Z)return`c${Z.channels}${Z.spatialRendering?"s":"n"}_${ye}`}return""}function isHdrSupported(){if(typeof matchMedia=="function"){const ie=matchMedia("(dynamic-range: high)"),Z=matchMedia("bad query");if(ie.media!==Z.media)return ie.matches===!0}return!1}function getVideoSelectionOptions(ie,Z){let ee=!1,ae=[];return ie&&(ee=ie!=="SDR",ae=[ie]),Z&&(ae=Z.allowedVideoRanges||VideoRangeValues.slice(0),ee=Z.preferHDR!==void 0?Z.preferHDR:isHdrSupported(),ee?ae=ae.filter(ye=>ye!=="SDR"):ae=["SDR"]),{preferHDR:ee,allowedVideoRanges:ae}}function getStartCodecTier(ie,Z,ee,ae,ye){const ve=Object.keys(ie),be=ae==null?void 0:ae.channels,Ye=ae==null?void 0:ae.audioCodec,Ke=be&&parseInt(be)===2;let Xe=!0,Je=!1,rt=1/0,nt=1/0,it=1/0,lt=0,ct=[];const{preferHDR:ot,allowedVideoRanges:dt}=getVideoSelectionOptions(Z,ye);for(let mt=ve.length;mt--;){const Yr=ie[ve[mt]];Xe=Yr.channels[2]>0,rt=Math.min(rt,Yr.minHeight),nt=Math.min(nt,Yr.minFramerate),it=Math.min(it,Yr.minBitrate);const Qr=dt.filter(Xr=>Yr.videoRanges[Xr]>0);Qr.length>0&&(Je=!0,ct=Qr)}rt=isFiniteNumber(rt)?rt:0,nt=isFiniteNumber(nt)?nt:0;const ft=Math.max(1080,rt),gt=Math.max(30,nt);return it=isFiniteNumber(it)?it:ee,ee=Math.max(it,ee),Je||(Z=void 0,ct=[]),{codecSet:ve.reduce((mt,Yr)=>{const Qr=ie[Yr];if(Yr===mt)return mt;if(Qr.minBitrate>ee)return logStartCodecCandidateIgnored(Yr,`min bitrate of ${Qr.minBitrate} > current estimate of ${ee}`),mt;if(!Qr.hasDefaultAudio)return logStartCodecCandidateIgnored(Yr,"no renditions with default or auto-select sound found"),mt;if(Ye&&Yr.indexOf(Ye.substring(0,4))%5!==0)return logStartCodecCandidateIgnored(Yr,`audio codec preference "${Ye}" not found`),mt;if(be&&!Ke){if(!Qr.channels[be])return logStartCodecCandidateIgnored(Yr,`no renditions with ${be} channel sound found (channels options: ${Object.keys(Qr.channels)})`),mt}else if((!Ye||Ke)&&Xe&&Qr.channels[2]===0)return logStartCodecCandidateIgnored(Yr,"no renditions with stereo sound found"),mt;return Qr.minHeight>ft?(logStartCodecCandidateIgnored(Yr,`min resolution of ${Qr.minHeight} > maximum of ${ft}`),mt):Qr.minFramerate>gt?(logStartCodecCandidateIgnored(Yr,`min framerate of ${Qr.minFramerate} > maximum of ${gt}`),mt):ct.some(Xr=>Qr.videoRanges[Xr]>0)?Qr.maxScore=codecsSetSelectionPreferenceValue(mt)||Qr.fragmentError>ie[mt].fragmentError)?mt:(lt=Qr.maxScore,Yr):(logStartCodecCandidateIgnored(Yr,`no variants with VIDEO-RANGE of ${JSON.stringify(ct)} found`),mt)},void 0),videoRanges:ct,preferHDR:ot,minFramerate:nt,minBitrate:it}}function logStartCodecCandidateIgnored(ie,Z){logger.log(`[abr] start candidates with "${ie}" ignored because ${Z}`)}function getAudioTracksByGroup(ie){return ie.reduce((Z,ee)=>{let ae=Z.groups[ee.groupId];ae||(ae=Z.groups[ee.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),ae.tracks.push(ee);const ye=ee.channels||"2";return ae.channels[ye]=(ae.channels[ye]||0)+1,ae.hasDefault=ae.hasDefault||ee.default,ae.hasAutoSelect=ae.hasAutoSelect||ee.autoselect,ae.hasDefault&&(Z.hasDefaultAudio=!0),ae.hasAutoSelect&&(Z.hasAutoSelectAudio=!0),Z},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function getCodecTiers(ie,Z,ee,ae){return ie.slice(ee,ae+1).reduce((ye,ve)=>{if(!ve.codecSet)return ye;const be=ve.audioGroups;let Ye=ye[ve.codecSet];Ye||(ye[ve.codecSet]=Ye={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!be,fragmentError:0}),Ye.minBitrate=Math.min(Ye.minBitrate,ve.bitrate);const Ke=Math.min(ve.height,ve.width);return Ye.minHeight=Math.min(Ye.minHeight,Ke),Ye.minFramerate=Math.min(Ye.minFramerate,ve.frameRate),Ye.maxScore=Math.max(Ye.maxScore,ve.score),Ye.fragmentError+=ve.fragmentError,Ye.videoRanges[ve.videoRange]=(Ye.videoRanges[ve.videoRange]||0)+1,be&&be.forEach(Xe=>{if(!Xe)return;const Je=Z.groups[Xe];Ye.hasDefaultAudio=Ye.hasDefaultAudio||Z.hasDefaultAudio?Je.hasDefault:Je.hasAutoSelect||!Z.hasDefaultAudio&&!Z.hasAutoSelectAudio,Object.keys(Je.channels).forEach(rt=>{Ye.channels[rt]=(Ye.channels[rt]||0)+Je.channels[rt]})}),ye},{})}function findMatchingOption(ie,Z,ee){if("attrs"in ie){const ae=Z.indexOf(ie);if(ae!==-1)return ae}for(let ae=0;aeae.indexOf(ye)===-1)}function audioMatchPredicate(ie,Z){const{audioCodec:ee,channels:ae}=ie;return(ee===void 0||(Z.audioCodec||"").substring(0,4)===ee.substring(0,4))&&(ae===void 0||ae===(Z.channels||"2"))}function findClosestLevelWithAudioGroup(ie,Z,ee,ae,ye){const ve=Z[ae],be=Z.reduce((rt,nt,it)=>{const lt=nt.uri;return(rt[lt]||(rt[lt]=[])).push(it),rt},{})[ve.uri];be.length>1&&(ae=Math.max.apply(Math,be));const Ye=ve.videoRange,Ke=ve.frameRate,Xe=ve.codecSet.substring(0,4),Je=searchDownAndUpList(Z,ae,rt=>{if(rt.videoRange!==Ye||rt.frameRate!==Ke||rt.codecSet.substring(0,4)!==Xe)return!1;const nt=rt.audioGroups,it=ee.filter(lt=>!nt||nt.indexOf(lt.groupId)!==-1);return findMatchingOption(ie,it,ye)>-1});return Je>-1?Je:searchDownAndUpList(Z,ae,rt=>{const nt=rt.audioGroups,it=ee.filter(lt=>!nt||nt.indexOf(lt.groupId)!==-1);return findMatchingOption(ie,it,ye)>-1})}function searchDownAndUpList(ie,Z,ee){for(let ae=Z;ae;ae--)if(ee(ie[ae]))return ae;for(let ae=Z+1;ae{const{fragCurrent:ee,partCurrent:ae,hls:ye}=this,{autoLevelEnabled:ve,media:be}=ye;if(!ee||!be)return;const Ye=performance.now(),Ke=ae?ae.stats:ee.stats,Xe=ae?ae.duration:ee.duration,Je=Ye-Ke.loading.start,rt=ye.minAutoLevel;if(Ke.aborted||Ke.loaded&&Ke.loaded===Ke.total||ee.level<=rt){this.clearTimer(),this._nextAutoLevel=-1;return}if(!ve||be.paused||!be.playbackRate||!be.readyState)return;const nt=ye.mainForwardBufferInfo;if(nt===null)return;const it=this.bwEstimator.getEstimateTTFB(),lt=Math.abs(be.playbackRate);if(Je<=Math.max(it,1e3*(Xe/(lt*2))))return;const ct=nt.len/lt,ot=Ke.loading.first?Ke.loading.first-Ke.loading.start:-1,dt=Ke.loaded&&ot>-1,ft=this.getBwEstimate(),gt=ye.levels,mt=gt[ee.level],Yr=Ke.total||Math.max(Ke.loaded,Math.round(Xe*mt.averageBitrate/8));let Qr=dt?Je-ot:Je;Qr<1&&dt&&(Qr=Math.min(Je,Ke.loaded*8/ft));const Xr=dt?Ke.loaded*1e3/Qr:0,Jr=Xr?(Yr-Ke.loaded)/Xr:Yr*8/ft+it/1e3;if(Jr<=ct)return;const ai=Xr?Xr*8:ft;let oi=Number.POSITIVE_INFINITY,ni;for(ni=ee.level-1;ni>rt;ni--){const ui=gt[ni].maxBitrate;if(oi=this.getTimeToLoadFrag(it/1e3,ai,Xe*ui,!gt[ni].details),oi=Jr||oi>Xe*10)return;ye.nextLoadLevel=ye.nextAutoLevel=ni,dt?this.bwEstimator.sample(Je-Math.min(it,ot),Ke.loaded):this.bwEstimator.sampleTTFB(Je);const li=gt[ni].maxBitrate;this.getBwEstimate()*this.hls.config.abrBandWidthUpFactor>li&&this.resetEstimator(li),this.clearTimer(),logger.warn(`[abr] Fragment ${ee.sn}${ae?" part "+ae.index:""} of level ${ee.level} is loading too slowly; + Time to underbuffer: ${ct.toFixed(3)} s + Estimated load time for current fragment: ${Jr.toFixed(3)} s + Estimated load time for down switch fragment: ${oi.toFixed(3)} s + TTFB estimate: ${ot|0} ms + Current BW estimate: ${isFiniteNumber(ft)?ft|0:"Unknown"} bps + New BW estimate: ${this.getBwEstimate()|0} bps + Switching to level ${ni} @ ${li|0} bps`),ye.trigger(Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:ee,part:ae,stats:Ke})},this.hls=Z,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(Z){Z&&(logger.log(`setting initial bwe to ${Z}`),this.hls.config.abrEwmaDefaultEstimate=Z),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const Z=this.hls.config;return new EwmaBandWidthEstimator(Z.abrEwmaSlowVoD,Z.abrEwmaFastVoD,Z.abrEwmaDefaultEstimate)}registerListeners(){const{hls:Z}=this;Z.on(Events.MANIFEST_LOADING,this.onManifestLoading,this),Z.on(Events.FRAG_LOADING,this.onFragLoading,this),Z.on(Events.FRAG_LOADED,this.onFragLoaded,this),Z.on(Events.FRAG_BUFFERED,this.onFragBuffered,this),Z.on(Events.LEVEL_SWITCHING,this.onLevelSwitching,this),Z.on(Events.LEVEL_LOADED,this.onLevelLoaded,this),Z.on(Events.LEVELS_UPDATED,this.onLevelsUpdated,this),Z.on(Events.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),Z.on(Events.ERROR,this.onError,this)}unregisterListeners(){const{hls:Z}=this;Z&&(Z.off(Events.MANIFEST_LOADING,this.onManifestLoading,this),Z.off(Events.FRAG_LOADING,this.onFragLoading,this),Z.off(Events.FRAG_LOADED,this.onFragLoaded,this),Z.off(Events.FRAG_BUFFERED,this.onFragBuffered,this),Z.off(Events.LEVEL_SWITCHING,this.onLevelSwitching,this),Z.off(Events.LEVEL_LOADED,this.onLevelLoaded,this),Z.off(Events.LEVELS_UPDATED,this.onLevelsUpdated,this),Z.off(Events.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),Z.off(Events.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(Z,ee){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(Z,ee){const ae=ee.frag;if(!this.ignoreFragment(ae)){if(!ae.bitrateTest){var ye;this.fragCurrent=ae,this.partCurrent=(ye=ee.part)!=null?ye:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(Z,ee){this.clearTimer()}onError(Z,ee){if(!ee.fatal)switch(ee.details){case ErrorDetails.BUFFER_ADD_CODEC_ERROR:case ErrorDetails.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case ErrorDetails.FRAG_LOAD_TIMEOUT:{const ae=ee.frag,{fragCurrent:ye,partCurrent:ve}=this;if(ae&&ye&&ae.sn===ye.sn&&ae.level===ye.level){const be=performance.now(),Ye=ve?ve.stats:ae.stats,Ke=be-Ye.loading.start,Xe=Ye.loading.first?Ye.loading.first-Ye.loading.start:-1;if(Ye.loaded&&Xe>-1){const Je=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(Ke-Math.min(Je,Xe),Ye.loaded)}else this.bwEstimator.sampleTTFB(Ke)}break}}}getTimeToLoadFrag(Z,ee,ae,ye){const ve=Z+ae/ee,be=ye?this.lastLevelLoadSec:0;return ve+be}onLevelLoaded(Z,ee){const ae=this.hls.config,{loading:ye}=ee.stats,ve=ye.end-ye.start;isFiniteNumber(ve)&&(this.lastLevelLoadSec=ve/1e3),ee.details.live?this.bwEstimator.update(ae.abrEwmaSlowLive,ae.abrEwmaFastLive):this.bwEstimator.update(ae.abrEwmaSlowVoD,ae.abrEwmaFastVoD)}onFragLoaded(Z,{frag:ee,part:ae}){const ye=ae?ae.stats:ee.stats;if(ee.type===PlaylistLevelType.MAIN&&this.bwEstimator.sampleTTFB(ye.loading.first-ye.loading.start),!this.ignoreFragment(ee)){if(this.clearTimer(),ee.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const ve=ae?ae.duration:ee.duration,be=this.hls.levels[ee.level],Ye=(be.loaded?be.loaded.bytes:0)+ye.loaded,Ke=(be.loaded?be.loaded.duration:0)+ve;be.loaded={bytes:Ye,duration:Ke},be.realBitrate=Math.round(8*Ye/Ke)}if(ee.bitrateTest){const ve={stats:ye,frag:ee,part:ae,id:ee.type};this.onFragBuffered(Events.FRAG_BUFFERED,ve),ee.bitrateTest=!1}else this.lastLoadedFragLevel=ee.level}}onFragBuffered(Z,ee){const{frag:ae,part:ye}=ee,ve=ye!=null&&ye.stats.loaded?ye.stats:ae.stats;if(ve.aborted||this.ignoreFragment(ae))return;const be=ve.parsing.end-ve.loading.start-Math.min(ve.loading.first-ve.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(be,ve.loaded),ve.bwEstimate=this.getBwEstimate(),ae.bitrateTest?this.bitrateTestDelay=be/1e3:this.bitrateTestDelay=0}ignoreFragment(Z){return Z.type!==PlaylistLevelType.MAIN||Z.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:Z,minAutoLevel:ee}=this.hls,ae=this.getBwEstimate(),ye=this.hls.config.maxStarvationDelay,ve=this.findBestLevel(ae,ee,Z,0,ye,1,1);if(ve>-1)return ve;const be=this.hls.firstLevel,Ye=Math.min(Math.max(be,ee),Z);return logger.warn(`[abr] Could not find best starting auto level. Defaulting to first in playlist ${be} clamped to ${Ye}`),Ye}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const Z=this.forcedAutoLevel,ee=this.bwEstimator.canEstimate(),ae=this.lastLoadedFragLevel>-1;if(Z!==-1&&(!ee||!ae||this.nextAutoLevelKey===this.getAutoLevelKey()))return Z;const ye=ee&&ae?this.getNextABRAutoLevel():this.firstAutoLevel;if(Z!==-1){const ve=this.hls.levels;if(ve.length>Math.max(Z,ye)&&ve[Z].loadError<=ve[ye].loadError)return Z}return this._nextAutoLevel=ye,this.nextAutoLevelKey=this.getAutoLevelKey(),ye}getAutoLevelKey(){var Z;return`${this.getBwEstimate()}_${(Z=this.hls.mainForwardBufferInfo)==null?void 0:Z.len}`}getNextABRAutoLevel(){const{fragCurrent:Z,partCurrent:ee,hls:ae}=this,{maxAutoLevel:ye,config:ve,minAutoLevel:be,media:Ye}=ae,Ke=ee?ee.duration:Z?Z.duration:0,Xe=Ye&&Ye.playbackRate!==0?Math.abs(Ye.playbackRate):1,Je=this.getBwEstimate(),rt=ae.mainForwardBufferInfo,nt=(rt?rt.len:0)/Xe;let it=ve.abrBandWidthFactor,lt=ve.abrBandWidthUpFactor;if(nt){const gt=this.findBestLevel(Je,be,ye,nt,0,it,lt);if(gt>=0)return gt}let ct=Ke?Math.min(Ke,ve.maxStarvationDelay):ve.maxStarvationDelay;if(!nt){const gt=this.bitrateTestDelay;gt&&(ct=(Ke?Math.min(Ke,ve.maxLoadingDelay):ve.maxLoadingDelay)-gt,logger.info(`[abr] bitrate test took ${Math.round(1e3*gt)}ms, set first fragment max fetchDuration to ${Math.round(1e3*ct)} ms`),it=lt=1)}const ot=this.findBestLevel(Je,be,ye,nt,ct,it,lt);if(logger.info(`[abr] ${nt?"rebuffering expected":"buffer is empty"}, optimal quality level ${ot}`),ot>-1)return ot;const dt=ae.levels[be],ft=ae.levels[ae.loadLevel];return(dt==null?void 0:dt.bitrate)<(ft==null?void 0:ft.bitrate)?be:ae.loadLevel}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(Z,ee,ae,ye,ve,be,Ye){var Ke;const Xe=ye+ve,Je=this.lastLoadedFragLevel,rt=Je===-1?this.hls.firstLevel:Je,{fragCurrent:nt,partCurrent:it}=this,{levels:lt,allAudioTracks:ct,loadLevel:ot,config:dt}=this.hls;if(lt.length===1)return 0;const ft=lt[rt],gt=!!(ft!=null&&(Ke=ft.details)!=null&&Ke.live),mt=ot===-1||Je===-1;let Yr,Qr="SDR",Xr=(ft==null?void 0:ft.frameRate)||0;const{audioPreference:Jr,videoPreference:ai}=dt,oi=this.audioTracksByGroup||(this.audioTracksByGroup=getAudioTracksByGroup(ct));if(mt){if(this.firstSelection!==-1)return this.firstSelection;const ii=this.codecTiers||(this.codecTiers=getCodecTiers(lt,oi,ee,ae)),hi=getStartCodecTier(ii,Qr,Z,Jr,ai),{codecSet:ri,videoRanges:ci,minFramerate:Si,minBitrate:si,preferHDR:Ei}=hi;Yr=ri,Qr=Ei?ci[ci.length-1]:ci[0],Xr=Si,Z=Math.max(Z,si),logger.log(`[abr] picked start tier ${JSON.stringify(hi)}`)}else Yr=ft==null?void 0:ft.codecSet,Qr=ft==null?void 0:ft.videoRange;const ni=it?it.duration:nt?nt.duration:0,li=this.bwEstimator.getEstimateTTFB()/1e3,ui=[];for(let ii=ae;ii>=ee;ii--){var mi;const hi=lt[ii],ri=ii>rt;if(!hi)continue;if(dt.useMediaCapabilities&&!hi.supportedResult&&!hi.supportedPromise){const Mi=navigator.mediaCapabilities;typeof(Mi==null?void 0:Mi.decodingInfo)=="function"&&requiresMediaCapabilitiesDecodingInfo(hi,oi,Qr,Xr,Z,Jr)?(hi.supportedPromise=getMediaDecodingInfoPromise(hi,oi,Mi),hi.supportedPromise.then(Ci=>{hi.supportedResult=Ci;const Ri=this.hls.levels,Ni=Ri.indexOf(hi);Ci.error?logger.warn(`[abr] MediaCapabilities decodingInfo error: "${Ci.error}" for level ${Ni} ${JSON.stringify(Ci)}`):Ci.supported||(logger.warn(`[abr] Unsupported MediaCapabilities decodingInfo result for level ${Ni} ${JSON.stringify(Ci)}`),Ni>-1&&Ri.length>1&&(logger.log(`[abr] Removing unsupported level ${Ni}`),this.hls.removeLevel(Ni)))})):hi.supportedResult=SUPPORTED_INFO_DEFAULT}if(Yr&&hi.codecSet!==Yr||Qr&&hi.videoRange!==Qr||ri&&Xr>hi.frameRate||!ri&&Xr>0&&Xr=ni*2&&ve===0?lt[ii].averageBitrate:lt[ii].maxBitrate,yi=this.getTimeToLoadFrag(li,si,Ei*Si,ci===void 0);if(si>=Ei&&(ii===Je||hi.loadError===0&&hi.fragmentError===0)&&(yi<=li||!isFiniteNumber(yi)||gt&&!this.bitrateTestDelay||yi${ii} adjustedbw(${Math.round(si)})-bitrate=${Math.round(si-Ei)} ttfb:${li.toFixed(1)} avgDuration:${Si.toFixed(1)} maxFetchDuration:${Xe.toFixed(1)} fetchDuration:${yi.toFixed(1)} firstSelection:${mt} codecSet:${Yr} videoRange:${Qr} hls.loadLevel:${ot}`)),mt&&(this.firstSelection=ii),ii}}return-1}set nextAutoLevel(Z){const ee=Math.max(this.hls.minAutoLevel,Z);this._nextAutoLevel!=ee&&(this.nextAutoLevelKey="",this._nextAutoLevel=ee)}}class TaskLoop{constructor(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(Z){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,Z),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}var FragmentState={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class FragmentTracker{constructor(Z){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=Z,this._registerListeners()}_registerListeners(){const{hls:Z}=this;Z.on(Events.BUFFER_APPENDED,this.onBufferAppended,this),Z.on(Events.FRAG_BUFFERED,this.onFragBuffered,this),Z.on(Events.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:Z}=this;Z.off(Events.BUFFER_APPENDED,this.onBufferAppended,this),Z.off(Events.FRAG_BUFFERED,this.onFragBuffered,this),Z.off(Events.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(Z,ee){const ae=this.activePartLists[ee];if(ae)for(let ye=ae.length;ye--;){const ve=ae[ye];if(!ve)break;const be=ve.end;if(ve.start<=Z&&be!==null&&Z<=be)return ve}return this.getBufferedFrag(Z,ee)}getBufferedFrag(Z,ee){const{fragments:ae}=this,ye=Object.keys(ae);for(let ve=ye.length;ve--;){const be=ae[ye[ve]];if((be==null?void 0:be.body.type)===ee&&be.buffered){const Ye=be.body;if(Ye.start<=Z&&Z<=Ye.end)return Ye}}return null}detectEvictedFragments(Z,ee,ae,ye){this.timeRanges&&(this.timeRanges[Z]=ee);const ve=(ye==null?void 0:ye.fragment.sn)||-1;Object.keys(this.fragments).forEach(be=>{const Ye=this.fragments[be];if(!Ye||ve>=Ye.body.sn)return;if(!Ye.buffered&&!Ye.loaded){Ye.body.type===ae&&this.removeFragment(Ye.body);return}const Ke=Ye.range[Z];Ke&&Ke.time.some(Xe=>{const Je=!this.isTimeBuffered(Xe.startPTS,Xe.endPTS,ee);return Je&&this.removeFragment(Ye.body),Je})})}detectPartialFragments(Z){const ee=this.timeRanges,{frag:ae,part:ye}=Z;if(!ee||ae.sn==="initSegment")return;const ve=getFragmentKey(ae),be=this.fragments[ve];if(!be||be.buffered&&ae.gap)return;const Ye=!ae.relurl;Object.keys(ee).forEach(Ke=>{const Xe=ae.elementaryStreams[Ke];if(!Xe)return;const Je=ee[Ke],rt=Ye||Xe.partial===!0;be.range[Ke]=this.getBufferedTimes(ae,ye,rt,Je)}),be.loaded=null,Object.keys(be.range).length?(be.buffered=!0,(be.body.endList=ae.endList||be.body.endList)&&(this.endListFragments[be.body.type]=be),isPartial(be)||this.removeParts(ae.sn-1,ae.type)):this.removeFragment(be.body)}removeParts(Z,ee){const ae=this.activePartLists[ee];ae&&(this.activePartLists[ee]=ae.filter(ye=>ye.fragment.sn>=Z))}fragBuffered(Z,ee){const ae=getFragmentKey(Z);let ye=this.fragments[ae];!ye&&ee&&(ye=this.fragments[ae]={body:Z,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},Z.gap&&(this.hasGaps=!0)),ye&&(ye.loaded=null,ye.buffered=!0)}getBufferedTimes(Z,ee,ae,ye){const ve={time:[],partial:ae},be=Z.start,Ye=Z.end,Ke=Z.minEndPTS||Ye,Xe=Z.maxStartPTS||be;for(let Je=0;Je=rt&&Ke<=nt){ve.time.push({startPTS:Math.max(be,ye.start(Je)),endPTS:Math.min(Ye,ye.end(Je))});break}else if(bert){const it=Math.max(be,ye.start(Je)),lt=Math.min(Ye,ye.end(Je));lt>it&&(ve.partial=!0,ve.time.push({startPTS:it,endPTS:lt}))}else if(Ye<=rt)break}return ve}getPartialFragment(Z){let ee=null,ae,ye,ve,be=0;const{bufferPadding:Ye,fragments:Ke}=this;return Object.keys(Ke).forEach(Xe=>{const Je=Ke[Xe];Je&&isPartial(Je)&&(ye=Je.body.start-Ye,ve=Je.body.end+Ye,Z>=ye&&Z<=ve&&(ae=Math.min(Z-ye,ve-Z),be<=ae&&(ee=Je.body,be=ae)))}),ee}isEndListAppended(Z){const ee=this.endListFragments[Z];return ee!==void 0&&(ee.buffered||isPartial(ee))}getState(Z){const ee=getFragmentKey(Z),ae=this.fragments[ee];return ae?ae.buffered?isPartial(ae)?FragmentState.PARTIAL:FragmentState.OK:FragmentState.APPENDING:FragmentState.NOT_LOADED}isTimeBuffered(Z,ee,ae){let ye,ve;for(let be=0;be=ye&&ee<=ve)return!0;if(ee<=ye)return!1}return!1}onFragLoaded(Z,ee){const{frag:ae,part:ye}=ee;if(ae.sn==="initSegment"||ae.bitrateTest)return;const ve=ye?null:ee,be=getFragmentKey(ae);this.fragments[be]={body:ae,appendedPTS:null,loaded:ve,buffered:!1,range:Object.create(null)}}onBufferAppended(Z,ee){const{frag:ae,part:ye,timeRanges:ve}=ee;if(ae.sn==="initSegment")return;const be=ae.type;if(ye){let Ye=this.activePartLists[be];Ye||(this.activePartLists[be]=Ye=[]),Ye.push(ye)}this.timeRanges=ve,Object.keys(ve).forEach(Ye=>{const Ke=ve[Ye];this.detectEvictedFragments(Ye,Ke,be,ye)})}onFragBuffered(Z,ee){this.detectPartialFragments(ee)}hasFragment(Z){const ee=getFragmentKey(Z);return!!this.fragments[ee]}hasParts(Z){var ee;return!!((ee=this.activePartLists[Z])!=null&&ee.length)}removeFragmentsInRange(Z,ee,ae,ye,ve){ye&&!this.hasGaps||Object.keys(this.fragments).forEach(be=>{const Ye=this.fragments[be];if(!Ye)return;const Ke=Ye.body;Ke.type!==ae||ye&&!Ke.gap||Ke.startZ&&(Ye.buffered||ve)&&this.removeFragment(Ke)})}removeFragment(Z){const ee=getFragmentKey(Z);Z.stats.loaded=0,Z.clearElementaryStreamInfo();const ae=this.activePartLists[Z.type];if(ae){const ye=Z.sn;this.activePartLists[Z.type]=ae.filter(ve=>ve.fragment.sn!==ye)}delete this.fragments[ee],Z.endList&&delete this.endListFragments[Z.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function isPartial(ie){var Z,ee,ae;return ie.buffered&&(ie.body.gap||((Z=ie.range.video)==null?void 0:Z.partial)||((ee=ie.range.audio)==null?void 0:ee.partial)||((ae=ie.range.audiovideo)==null?void 0:ae.partial))}function getFragmentKey(ie){return`${ie.type}_${ie.level}_${ie.sn}`}const noopBuffered={length:0,start:()=>0,end:()=>0};class BufferHelper{static isBuffered(Z,ee){try{if(Z){const ae=BufferHelper.getBuffered(Z);for(let ye=0;ye=ae.start(ye)&&ee<=ae.end(ye))return!0}}catch{}return!1}static bufferInfo(Z,ee,ae){try{if(Z){const ye=BufferHelper.getBuffered(Z),ve=[];let be;for(be=0;bert&&(ye[Je-1].end=Z[Xe].end):ye.push(Z[Xe])}else ye.push(Z[Xe])}else ye=Z;let ve=0,be,Ye=ee,Ke=ee;for(let Xe=0;Xe=Je&&eeee.startCC||ie&&ie.cc{if(this.loader&&this.loader.destroy(),Z.gap)if(Z.tagList.some(it=>it[0]==="GAP")){Ke(createGapLoadError(Z));return}else Z.gap=!1;const Xe=this.loader=Z.loader=ve?new ve(ye):new be(ye),Je=createLoaderContext(Z),rt=getLoaderConfigWithoutReties(ye.fragLoadPolicy.default),nt={loadPolicy:rt,timeout:rt.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Z.sn==="initSegment"?1/0:MIN_CHUNK_SIZE};Z.stats=Xe.stats,Xe.load(Je,nt,{onSuccess:(it,lt,ct,ot)=>{this.resetLoader(Z,Xe);let dt=it.data;ct.resetIV&&Z.decryptdata&&(Z.decryptdata.iv=new Uint8Array(dt.slice(0,16)),dt=dt.slice(16)),Ye({frag:Z,part:null,payload:dt,networkDetails:ot})},onError:(it,lt,ct,ot)=>{this.resetLoader(Z,Xe),Ke(new LoadError({type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:Z,response:_objectSpread2({url:ae,data:void 0},it),error:new Error(`HTTP Error ${it.code} ${it.text}`),networkDetails:ct,stats:ot}))},onAbort:(it,lt,ct)=>{this.resetLoader(Z,Xe),Ke(new LoadError({type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:Z,error:new Error("Aborted"),networkDetails:ct,stats:it}))},onTimeout:(it,lt,ct)=>{this.resetLoader(Z,Xe),Ke(new LoadError({type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:Z,error:new Error(`Timeout after ${nt.timeout}ms`),networkDetails:ct,stats:it}))},onProgress:(it,lt,ct,ot)=>{ee&&ee({frag:Z,part:null,payload:ct,networkDetails:ot})}})})}loadPart(Z,ee,ae){this.abort();const ye=this.config,ve=ye.fLoader,be=ye.loader;return new Promise((Ye,Ke)=>{if(this.loader&&this.loader.destroy(),Z.gap||ee.gap){Ke(createGapLoadError(Z,ee));return}const Xe=this.loader=Z.loader=ve?new ve(ye):new be(ye),Je=createLoaderContext(Z,ee),rt=getLoaderConfigWithoutReties(ye.fragLoadPolicy.default),nt={loadPolicy:rt,timeout:rt.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:MIN_CHUNK_SIZE};ee.stats=Xe.stats,Xe.load(Je,nt,{onSuccess:(it,lt,ct,ot)=>{this.resetLoader(Z,Xe),this.updateStatsFromPart(Z,ee);const dt={frag:Z,part:ee,payload:it.data,networkDetails:ot};ae(dt),Ye(dt)},onError:(it,lt,ct,ot)=>{this.resetLoader(Z,Xe),Ke(new LoadError({type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:Z,part:ee,response:_objectSpread2({url:Je.url,data:void 0},it),error:new Error(`HTTP Error ${it.code} ${it.text}`),networkDetails:ct,stats:ot}))},onAbort:(it,lt,ct)=>{Z.stats.aborted=ee.stats.aborted,this.resetLoader(Z,Xe),Ke(new LoadError({type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:Z,part:ee,error:new Error("Aborted"),networkDetails:ct,stats:it}))},onTimeout:(it,lt,ct)=>{this.resetLoader(Z,Xe),Ke(new LoadError({type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:Z,part:ee,error:new Error(`Timeout after ${nt.timeout}ms`),networkDetails:ct,stats:it}))}})})}updateStatsFromPart(Z,ee){const ae=Z.stats,ye=ee.stats,ve=ye.total;if(ae.loaded+=ye.loaded,ve){const Ke=Math.round(Z.duration/ee.duration),Xe=Math.min(Math.round(ae.loaded/ve),Ke),Je=(Ke-Xe)*Math.round(ae.loaded/Xe);ae.total=ae.loaded+Je}else ae.total=Math.max(ae.loaded,ae.total);const be=ae.loading,Ye=ye.loading;be.start?be.first+=Ye.first-Ye.start:(be.start=Ye.start,be.first=Ye.first),be.end=Ye.end}resetLoader(Z,ee){Z.loader=null,this.loader===ee&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),ee.destroy()}}function createLoaderContext(ie,Z=null){const ee=Z||ie,ae={frag:ie,part:Z,responseType:"arraybuffer",url:ee.url,headers:{},rangeStart:0,rangeEnd:0},ye=ee.byteRangeStartOffset,ve=ee.byteRangeEndOffset;if(isFiniteNumber(ye)&&isFiniteNumber(ve)){var be;let Ye=ye,Ke=ve;if(ie.sn==="initSegment"&&((be=ie.decryptdata)==null?void 0:be.method)==="AES-128"){const Xe=ve-ye;Xe%16&&(Ke=ve+(16-Xe%16)),ye!==0&&(ae.resetIV=!0,Ye=ye-16)}ae.rangeStart=Ye,ae.rangeEnd=Ke}return ae}function createGapLoadError(ie,Z){const ee=new Error(`GAP ${ie.gap?"tag":"attribute"} found`),ae={type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.FRAG_GAP,fatal:!1,frag:ie,error:ee,networkDetails:null};return Z&&(ae.part=Z),(Z||ie).stats.aborted=!0,new LoadError(ae)}class LoadError extends Error{constructor(Z){super(Z.error.message),this.data=void 0,this.data=Z}}class AESCrypto{constructor(Z,ee){this.subtle=void 0,this.aesIV=void 0,this.subtle=Z,this.aesIV=ee}decrypt(Z,ee){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},ee,Z)}}class FastAESKey{constructor(Z,ee){this.subtle=void 0,this.key=void 0,this.subtle=Z,this.key=ee}expandKey(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}function removePadding(ie){const Z=ie.byteLength,ee=Z&&new DataView(ie.buffer).getUint8(Z-1);return ee?sliceUint8(ie,0,Z-ee):ie}class AESDecryptor{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(Z){const ee=new DataView(Z),ae=new Uint32Array(4);for(let ye=0;ye<4;ye++)ae[ye]=ee.getUint32(ye*4);return ae}initTable(){const Z=this.sBox,ee=this.invSBox,ae=this.subMix,ye=ae[0],ve=ae[1],be=ae[2],Ye=ae[3],Ke=this.invSubMix,Xe=Ke[0],Je=Ke[1],rt=Ke[2],nt=Ke[3],it=new Uint32Array(256);let lt=0,ct=0,ot=0;for(ot=0;ot<256;ot++)ot<128?it[ot]=ot<<1:it[ot]=ot<<1^283;for(ot=0;ot<256;ot++){let dt=ct^ct<<1^ct<<2^ct<<3^ct<<4;dt=dt>>>8^dt&255^99,Z[lt]=dt,ee[dt]=lt;const ft=it[lt],gt=it[ft],mt=it[gt];let Yr=it[dt]*257^dt*16843008;ye[lt]=Yr<<24|Yr>>>8,ve[lt]=Yr<<16|Yr>>>16,be[lt]=Yr<<8|Yr>>>24,Ye[lt]=Yr,Yr=mt*16843009^gt*65537^ft*257^lt*16843008,Xe[dt]=Yr<<24|Yr>>>8,Je[dt]=Yr<<16|Yr>>>16,rt[dt]=Yr<<8|Yr>>>24,nt[dt]=Yr,lt?(lt=ft^it[it[it[mt^ft]]],ct^=it[it[ct]]):lt=ct=1}}expandKey(Z){const ee=this.uint8ArrayToUint32Array_(Z);let ae=!0,ye=0;for(;yeye?(this.logOnce("WebCrypto AES decrypt"),new AESCrypto(ye,new Uint8Array(ae)).decrypt(Z.buffer,ve)):Promise.reject(new Error("web crypto not initialized"))).catch(ve=>(logger.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${ve.name}: ${ve.message}`),this.onWebCryptoError(Z,ee,ae)))}onWebCryptoError(Z,ee,ae){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(Z,ee,ae);const ye=this.flush();if(ye)return ye.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(Z){let ee=Z;const ae=Z.length-Z.length%CHUNK_SIZE;return ae!==Z.length&&(ee=sliceUint8(Z,0,ae),this.remainderData=sliceUint8(Z,ae)),ee}logOnce(Z){this.logEnabled&&(logger.log(`[decrypter]: ${Z}`),this.logEnabled=!1)}}const TimeRanges={toString:function(ie){let Z="";const ee=ie.length;for(let ae=0;aeYe.end){const rt=be>Je;(be{if(this.fragContextChanged(Z)){this.warn(`Fragment ${Z.sn}${ve.part?" p: "+ve.part.index:""} of level ${Z.level} was dropped during download.`),this.fragmentTracker.removeFragment(Z);return}Z.stats.chunkCount++,this._handleFragmentLoadProgress(ve)};this._doFragLoad(Z,ee,ae,ye).then(ve=>{if(!ve)return;const be=this.state;if(this.fragContextChanged(Z)){(be===State.FRAG_LOADING||!this.fragCurrent&&be===State.PARSING)&&(this.fragmentTracker.removeFragment(Z),this.state=State.IDLE);return}"payload"in ve&&(this.log(`Loaded fragment ${Z.sn} of level ${Z.level}`),this.hls.trigger(Events.FRAG_LOADED,ve)),this._handleFragmentLoadComplete(ve)}).catch(ve=>{this.state===State.STOPPED||this.state===State.ERROR||(this.warn(ve),this.resetFragmentLoading(Z))})}clearTrackerIfNeeded(Z){var ee;const{fragmentTracker:ae}=this;if(ae.getState(Z)===FragmentState.APPENDING){const ye=Z.type,ve=this.getFwdBufferInfo(this.mediaBuffer,ye),be=Math.max(Z.duration,ve?ve.len:this.config.maxBufferLength);this.reduceMaxBufferLength(be)&&ae.removeFragment(Z)}else((ee=this.mediaBuffer)==null?void 0:ee.buffered.length)===0?ae.removeAllFragments():ae.hasParts(Z.type)&&(ae.detectPartialFragments({frag:Z,part:null,stats:Z.stats,id:Z.type}),ae.getState(Z)===FragmentState.PARTIAL&&ae.removeFragment(Z))}checkLiveUpdate(Z){if(Z.updated&&!Z.live){const ee=Z.fragments[Z.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:ee,part:null,stats:ee.stats,id:ee.type})}Z.fragments[0]||(Z.deltaUpdateFailed=!0)}flushMainBuffer(Z,ee,ae=null){if(!(Z-ee))return;const ye={startOffset:Z,endOffset:ee,type:ae};this.hls.trigger(Events.BUFFER_FLUSHING,ye)}_loadInitSegment(Z,ee){this._doFragLoad(Z,ee).then(ae=>{if(!ae||this.fragContextChanged(Z)||!this.levels)throw new Error("init load aborted");return ae}).then(ae=>{const{hls:ye}=this,{payload:ve}=ae,be=Z.decryptdata;if(ve&&ve.byteLength>0&&be!=null&&be.key&&be.iv&&be.method==="AES-128"){const Ye=self.performance.now();return this.decrypter.decrypt(new Uint8Array(ve),be.key.buffer,be.iv.buffer).catch(Ke=>{throw ye.trigger(Events.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.FRAG_DECRYPT_ERROR,fatal:!1,error:Ke,reason:Ke.message,frag:Z}),Ke}).then(Ke=>{const Xe=self.performance.now();return ye.trigger(Events.FRAG_DECRYPTED,{frag:Z,payload:Ke,stats:{tstart:Ye,tdecrypt:Xe}}),ae.payload=Ke,this.completeInitSegmentLoad(ae)})}return this.completeInitSegmentLoad(ae)}).catch(ae=>{this.state===State.STOPPED||this.state===State.ERROR||(this.warn(ae),this.resetFragmentLoading(Z))})}completeInitSegmentLoad(Z){const{levels:ee}=this;if(!ee)throw new Error("init load aborted, missing levels");const ae=Z.frag.stats;this.state=State.IDLE,Z.frag.data=new Uint8Array(Z.payload),ae.parsing.start=ae.buffering.start=self.performance.now(),ae.parsing.end=ae.buffering.end=self.performance.now(),this.tick()}fragContextChanged(Z){const{fragCurrent:ee}=this;return!Z||!ee||Z.sn!==ee.sn||Z.level!==ee.level}fragBufferedComplete(Z,ee){var ae,ye,ve,be;const Ye=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${Z.type} sn: ${Z.sn}${ee?" part: "+ee.index:""} of ${this.playlistType===PlaylistLevelType.MAIN?"level":"track"} ${Z.level} (frag:[${((ae=Z.startPTS)!=null?ae:NaN).toFixed(3)}-${((ye=Z.endPTS)!=null?ye:NaN).toFixed(3)}] > buffer:${Ye?TimeRanges.toString(BufferHelper.getBuffered(Ye)):"(detached)"})`),Z.sn!=="initSegment"){var Ke;if(Z.type!==PlaylistLevelType.SUBTITLE){const Je=Z.elementaryStreams;if(!Object.keys(Je).some(rt=>!!Je[rt])){this.state=State.IDLE;return}}const Xe=(Ke=this.levels)==null?void 0:Ke[Z.level];Xe!=null&&Xe.fragmentError&&(this.log(`Resetting level fragment error count of ${Xe.fragmentError} on frag buffered`),Xe.fragmentError=0)}this.state=State.IDLE,Ye&&(!this.loadedmetadata&&Z.type==PlaylistLevelType.MAIN&&Ye.buffered.length&&((ve=this.fragCurrent)==null?void 0:ve.sn)===((be=this.fragPrevious)==null?void 0:be.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(Z){const{transmuxer:ee}=this;if(!ee)return;const{frag:ae,part:ye,partsLoaded:ve}=Z,be=!ve||ve.length===0||ve.some(Ke=>!Ke),Ye=new ChunkMetadata(ae.level,ae.sn,ae.stats.chunkCount+1,0,ye?ye.index:-1,!be);ee.flush(Ye)}_handleFragmentLoadProgress(Z){}_doFragLoad(Z,ee,ae=null,ye){var ve;const be=ee==null?void 0:ee.details;if(!this.levels||!be)throw new Error(`frag load aborted, missing level${be?"":" detail"}s`);let Ye=null;if(Z.encrypted&&!((ve=Z.decryptdata)!=null&&ve.key)?(this.log(`Loading key for ${Z.sn} of [${be.startSN}-${be.endSN}], ${this.logPrefix==="[stream-controller]"?"level":"track"} ${Z.level}`),this.state=State.KEY_LOADING,this.fragCurrent=Z,Ye=this.keyLoader.load(Z).then(Je=>{if(!this.fragContextChanged(Je.frag))return this.hls.trigger(Events.KEY_LOADED,Je),this.state===State.KEY_LOADING&&(this.state=State.IDLE),Je}),this.hls.trigger(Events.KEY_LOADING,{frag:Z}),this.fragCurrent===null&&(Ye=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!Z.encrypted&&be.encryptedFragments.length&&this.keyLoader.loadClear(Z,be.encryptedFragments),ae=Math.max(Z.start,ae||0),this.config.lowLatencyMode&&Z.sn!=="initSegment"){const Je=be.partList;if(Je&&ye){ae>Z.end&&be.fragmentHint&&(Z=be.fragmentHint);const rt=this.getNextPart(Je,Z,ae);if(rt>-1){const nt=Je[rt];this.log(`Loading part sn: ${Z.sn} p: ${nt.index} cc: ${Z.cc} of playlist [${be.startSN}-${be.endSN}] parts [0-${rt}-${Je.length-1}] ${this.logPrefix==="[stream-controller]"?"level":"track"}: ${Z.level}, target: ${parseFloat(ae.toFixed(3))}`),this.nextLoadPosition=nt.start+nt.duration,this.state=State.FRAG_LOADING;let it;return Ye?it=Ye.then(lt=>!lt||this.fragContextChanged(lt.frag)?null:this.doFragPartsLoad(Z,nt,ee,ye)).catch(lt=>this.handleFragLoadError(lt)):it=this.doFragPartsLoad(Z,nt,ee,ye).catch(lt=>this.handleFragLoadError(lt)),this.hls.trigger(Events.FRAG_LOADING,{frag:Z,part:nt,targetBufferTime:ae}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):it}else if(!Z.url||this.loadedEndOfParts(Je,ae))return Promise.resolve(null)}}this.log(`Loading fragment ${Z.sn} cc: ${Z.cc} ${be?"of ["+be.startSN+"-"+be.endSN+"] ":""}${this.logPrefix==="[stream-controller]"?"level":"track"}: ${Z.level}, target: ${parseFloat(ae.toFixed(3))}`),isFiniteNumber(Z.sn)&&!this.bitrateTest&&(this.nextLoadPosition=Z.start+Z.duration),this.state=State.FRAG_LOADING;const Ke=this.config.progressive;let Xe;return Ke&&Ye?Xe=Ye.then(Je=>!Je||this.fragContextChanged(Je==null?void 0:Je.frag)?null:this.fragmentLoader.load(Z,ye)).catch(Je=>this.handleFragLoadError(Je)):Xe=Promise.all([this.fragmentLoader.load(Z,Ke?ye:void 0),Ye]).then(([Je])=>(!Ke&&Je&&ye&&ye(Je),Je)).catch(Je=>this.handleFragLoadError(Je)),this.hls.trigger(Events.FRAG_LOADING,{frag:Z,targetBufferTime:ae}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):Xe}doFragPartsLoad(Z,ee,ae,ye){return new Promise((ve,be)=>{var Ye;const Ke=[],Xe=(Ye=ae.details)==null?void 0:Ye.partList,Je=rt=>{this.fragmentLoader.loadPart(Z,rt,ye).then(nt=>{Ke[rt.index]=nt;const it=nt.part;this.hls.trigger(Events.FRAG_LOADED,nt);const lt=getPartWith(ae,Z.sn,rt.index+1)||findPart(Xe,Z.sn,rt.index+1);if(lt)Je(lt);else return ve({frag:Z,part:it,partsLoaded:Ke})}).catch(be)};Je(ee)})}handleFragLoadError(Z){if("data"in Z){const ee=Z.data;Z.data&&ee.details===ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(ee.frag,ee.part):this.hls.trigger(Events.ERROR,ee)}else this.hls.trigger(Events.ERROR,{type:ErrorTypes.OTHER_ERROR,details:ErrorDetails.INTERNAL_EXCEPTION,err:Z,error:Z,fatal:!0});return null}_handleTransmuxerFlush(Z){const ee=this.getCurrentContext(Z);if(!ee||this.state!==State.PARSING){!this.fragCurrent&&this.state!==State.STOPPED&&this.state!==State.ERROR&&(this.state=State.IDLE);return}const{frag:ae,part:ye,level:ve}=ee,be=self.performance.now();ae.stats.parsing.end=be,ye&&(ye.stats.parsing.end=be),this.updateLevelTiming(ae,ye,ve,Z.partial)}getCurrentContext(Z){const{levels:ee,fragCurrent:ae}=this,{level:ye,sn:ve,part:be}=Z;if(!(ee!=null&&ee[ye]))return this.warn(`Levels object was unset while buffering fragment ${ve} of level ${ye}. The current chunk will not be buffered.`),null;const Ye=ee[ye],Ke=be>-1?getPartWith(Ye,ve,be):null,Xe=Ke?Ke.fragment:getFragmentWithSN(Ye,ve,ae);return Xe?(ae&&ae!==Xe&&(Xe.stats=ae.stats),{frag:Xe,part:Ke,level:Ye}):null}bufferFragmentData(Z,ee,ae,ye,ve){var be;if(!Z||this.state!==State.PARSING)return;const{data1:Ye,data2:Ke}=Z;let Xe=Ye;if(Ye&&Ke&&(Xe=appendUint8Array(Ye,Ke)),!((be=Xe)!=null&&be.length))return;const Je={type:Z.type,frag:ee,part:ae,chunkMeta:ye,parent:ee.type,data:Xe};if(this.hls.trigger(Events.BUFFER_APPENDING,Je),Z.dropped&&Z.independent&&!ae){if(ve)return;this.flushBufferGap(ee)}}flushBufferGap(Z){const ee=this.media;if(!ee)return;if(!BufferHelper.isBuffered(ee,ee.currentTime)){this.flushMainBuffer(0,Z.start);return}const ae=ee.currentTime,ye=BufferHelper.bufferInfo(ee,ae,0),ve=Z.duration,be=Math.min(this.config.maxFragLookUpTolerance*2,ve*.25),Ye=Math.max(Math.min(Z.start-be,ye.end-be),ae+be);Z.start-Ye>be&&this.flushMainBuffer(Ye,Z.start)}getFwdBufferInfo(Z,ee){const ae=this.getLoadPosition();return isFiniteNumber(ae)?this.getFwdBufferInfoAtPos(Z,ae,ee):null}getFwdBufferInfoAtPos(Z,ee,ae){const{config:{maxBufferHole:ye}}=this,ve=BufferHelper.bufferInfo(Z,ee,ye);if(ve.len===0&&ve.nextStart!==void 0){const be=this.fragmentTracker.getBufferedFrag(ee,ae);if(be&&ve.nextStart=ae?(ee.maxMaxBufferLength/=2,this.warn(`Reduce max buffer length to ${ee.maxMaxBufferLength}s`),!0):!1}getAppendedFrag(Z,ee=PlaylistLevelType.MAIN){const ae=this.fragmentTracker.getAppendedFrag(Z,PlaylistLevelType.MAIN);return ae&&"fragment"in ae?ae.fragment:ae}getNextFragment(Z,ee){const ae=ee.fragments,ye=ae.length;if(!ye)return null;const{config:ve}=this,be=ae[0].start;let Ye;if(ee.live){const Ke=ve.initialLiveManifestSize;if(yeee}getNextFragmentLoopLoading(Z,ee,ae,ye,ve){const be=Z.gap,Ye=this.getNextFragment(this.nextLoadPosition,ee);if(Ye===null)return Ye;if(Z=Ye,be&&Z&&!Z.gap&&ae.nextStart){const Ke=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,ae.nextStart,ye);if(Ke!==null&&ae.len+Ke.len>=ve)return this.log(`buffer full after gaps in "${ye}" playlist starting at sn: ${Z.sn}`),null}return Z}mapToInitFragWhenRequired(Z){return Z!=null&&Z.initSegment&&!(Z!=null&&Z.initSegment.data)&&!this.bitrateTest?Z.initSegment:Z}getNextPart(Z,ee,ae){let ye=-1,ve=!1,be=!0;for(let Ye=0,Ke=Z.length;Ye-1&&aeae.start&&ae.loaded}getInitialLiveFragment(Z,ee){const ae=this.fragPrevious;let ye=null;if(ae){if(Z.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${ae.programDateTime}`),ye=findFragmentByPDT(ee,ae.endProgramDateTime,this.config.maxFragLookUpTolerance)),!ye){const ve=ae.sn+1;if(ve>=Z.startSN&&ve<=Z.endSN){const be=ee[ve-Z.startSN];ae.cc===be.cc&&(ye=be,this.log(`Live playlist, switching playlist, load frag with next SN: ${ye.sn}`))}ye||(ye=findFragWithCC(ee,ae.cc),ye&&this.log(`Live playlist, switching playlist, load frag with same CC: ${ye.sn}`))}}else{const ve=this.hls.liveSyncPosition;ve!==null&&(ye=this.getFragmentAtPosition(ve,this.bitrateTest?Z.fragmentEnd:Z.edge,Z))}return ye}getFragmentAtPosition(Z,ee,ae){const{config:ye}=this;let{fragPrevious:ve}=this,{fragments:be,endSN:Ye}=ae;const{fragmentHint:Ke}=ae,Xe=ye.maxFragLookUpTolerance,Je=ae.partList,rt=!!(ye.lowLatencyMode&&Je!=null&&Je.length&&Ke);rt&&Ke&&!this.bitrateTest&&(be=be.concat(Ke),Ye=Ke.sn);let nt;if(Zee-Xe?0:Xe;nt=findFragmentByPTS(ve,be,Z,it)}else nt=be[be.length-1];if(nt){const it=nt.sn-ae.startSN,lt=this.fragmentTracker.getState(nt);if((lt===FragmentState.OK||lt===FragmentState.PARTIAL&&nt.gap)&&(ve=nt),ve&&nt.sn===ve.sn&&(!rt||Je[0].fragment.sn>nt.sn)&&ve&&nt.level===ve.level){const ct=be[it+1];nt.sn=be-ee.maxFragLookUpTolerance&&ve<=Ye;if(ye!==null&&ae.duration>ye&&(ve${Z.startSN} prev-sn: ${Ke?Ke.sn:"na"} fragments: ${ye}`),Xe}return ve}waitForCdnTuneIn(Z){return Z.live&&Z.canBlockReload&&Z.partTarget&&Z.tuneInGoal>Math.max(Z.partHoldBack,Z.partTarget*3)}setStartPosition(Z,ee){let ae=this.startPosition;if(ae ${(ye=this.fragCurrent)==null?void 0:ye.url}`);return}const ve=ee.details===ErrorDetails.FRAG_GAP;ve&&this.fragmentTracker.fragBuffered(ae,!0);const be=ee.errorAction,{action:Ye,retryCount:Ke=0,retryConfig:Xe}=be||{};if(be&&Ye===NetworkErrorAction.RetryRequest&&Xe){this.resetStartWhenNotLoaded(this.levelLastLoaded);const Je=getRetryDelay(Xe,Ke);this.warn(`Fragment ${ae.sn} of ${Z} ${ae.level} errored with ${ee.details}, retrying loading ${Ke+1}/${Xe.maxNumRetry} in ${Je}ms`),be.resolved=!0,this.retryDate=self.performance.now()+Je,this.state=State.FRAG_LOADING_WAITING_RETRY}else if(Xe&&be)if(this.resetFragmentErrors(Z),Ke.5;ye&&this.reduceMaxBufferLength(ae.len);const ve=!ye;return ve&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${ee} buffer`),Z.frag&&(this.fragmentTracker.removeFragment(Z.frag),this.nextLoadPosition=Z.frag.start),this.resetLoadingState(),ve}return!1}resetFragmentErrors(Z){Z===PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==State.STOPPED&&(this.state=State.IDLE)}afterBufferFlushed(Z,ee,ae){if(!Z)return;const ye=BufferHelper.getBuffered(Z);this.fragmentTracker.detectEvictedFragments(ee,ye,ae),this.state===State.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=State.IDLE}resetStartWhenNotLoaded(Z){if(!this.loadedmetadata){this.startFragRequested=!1;const ee=Z?Z.details:null;ee!=null&&ee.live?(this.startPosition=-1,this.setStartPosition(ee,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(Z){this.warn(`The loading context changed while buffering fragment ${Z.sn} of level ${Z.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(Z=0){this.fragmentTracker.removeFragmentsInRange(Z,1/0,this.playlistType,!1,!0)}updateLevelTiming(Z,ee,ae,ye){var ve;const be=ae.details;if(!be){this.warn("level.details undefined");return}if(!Object.keys(Z.elementaryStreams).reduce((Ye,Ke)=>{const Xe=Z.elementaryStreams[Ke];if(Xe){const Je=Xe.endPTS-Xe.startPTS;if(Je<=0)return this.warn(`Could not parse fragment ${Z.sn} ${Ke} duration reliably (${Je})`),Ye||!1;const rt=ye?0:updateFragPTSDTS(be,Z,Xe.startPTS,Xe.endPTS,Xe.startDTS,Xe.endDTS);return this.hls.trigger(Events.LEVEL_PTS_UPDATED,{details:be,level:ae,drift:rt,type:Ke,frag:Z,start:Xe.startPTS,end:Xe.endPTS}),!0}return Ye},!1)&&((ve=this.transmuxer)==null?void 0:ve.error)===null){const Ye=new Error(`Found no media in fragment ${Z.sn} of level ${Z.level} resetting transmuxer to fallback to playlist timing`);if(ae.fragmentError===0&&(ae.fragmentError++,Z.gap=!0,this.fragmentTracker.removeFragment(Z),this.fragmentTracker.fragBuffered(Z,!0)),this.warn(Ye.message),this.hls.trigger(Events.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,error:Ye,frag:Z,reason:`Found no media in msn ${Z.sn} of level "${ae.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=State.PARSED,this.hls.trigger(Events.FRAG_PARSED,{frag:Z,part:ee})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(Z){Z.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(Z){const ee=this._state;ee!==Z&&(this._state=Z,this.log(`${ee}->${Z}`))}get state(){return this._state}}class ChunkCache{constructor(){this.chunks=[],this.dataLength=0}push(Z){this.chunks.push(Z),this.dataLength+=Z.length}flush(){const{chunks:Z,dataLength:ee}=this;let ae;if(Z.length)Z.length===1?ae=Z[0]:ae=concatUint8Arrays(Z,ee);else return new Uint8Array(0);return this.reset(),ae}reset(){this.chunks.length=0,this.dataLength=0}}function concatUint8Arrays(ie,Z){const ee=new Uint8Array(Z);let ae=0;for(let ye=0;ye0&&Ye.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:ae,type:MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY});ye{if(isFiniteNumber(ie))return ie*90;const ae=ee?ee.baseTime*9e4/ee.timescale:0;return Z*9e4+ae};function getAudioConfig(ie,Z,ee,ae){let ye,ve,be,Ye;const Ke=navigator.userAgent.toLowerCase(),Xe=ae,Je=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];ye=((Z[ee+2]&192)>>>6)+1;const rt=(Z[ee+2]&60)>>>2;if(rt>Je.length-1){const nt=new Error(`invalid ADTS sampling index:${rt}`);ie.emit(Events.ERROR,Events.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,error:nt,reason:nt.message});return}return be=(Z[ee+2]&1)<<2,be|=(Z[ee+3]&192)>>>6,logger.log(`manifest codec:${ae}, ADTS type:${ye}, samplingIndex:${rt}`),/firefox/i.test(Ke)?rt>=6?(ye=5,Ye=new Array(4),ve=rt-3):(ye=2,Ye=new Array(2),ve=rt):Ke.indexOf("android")!==-1?(ye=2,Ye=new Array(2),ve=rt):(ye=5,Ye=new Array(4),ae&&(ae.indexOf("mp4a.40.29")!==-1||ae.indexOf("mp4a.40.5")!==-1)||!ae&&rt>=6?ve=rt-3:((ae&&ae.indexOf("mp4a.40.2")!==-1&&(rt>=6&&be===1||/vivaldi/i.test(Ke))||!ae&&be===1)&&(ye=2,Ye=new Array(2)),ve=rt)),Ye[0]=ye<<3,Ye[0]|=(rt&14)>>1,Ye[1]|=(rt&1)<<7,Ye[1]|=be<<3,ye===5&&(Ye[1]|=(ve&14)>>1,Ye[2]=(ve&1)<<7,Ye[2]|=8,Ye[3]=0),{config:Ye,samplerate:Je[rt],channelCount:be,codec:"mp4a.40."+ye,manifestCodec:Xe}}function isHeaderPattern$1(ie,Z){return ie[Z]===255&&(ie[Z+1]&246)===240}function getHeaderLength(ie,Z){return ie[Z+1]&1?7:9}function getFullFrameLength(ie,Z){return(ie[Z+3]&3)<<11|ie[Z+4]<<3|(ie[Z+5]&224)>>>5}function canGetFrameLength(ie,Z){return Z+5=ie.length)return!1;const ae=getFullFrameLength(ie,Z);if(ae<=ee)return!1;const ye=Z+ae;return ye===ie.length||isHeader$1(ie,ye)}return!1}function initTrackConfig(ie,Z,ee,ae,ye){if(!ie.samplerate){const ve=getAudioConfig(Z,ee,ae,ye);if(!ve)return;ie.config=ve.config,ie.samplerate=ve.samplerate,ie.channelCount=ve.channelCount,ie.codec=ve.codec,ie.manifestCodec=ve.manifestCodec,logger.log(`parsed codec:${ie.codec}, rate:${ve.samplerate}, channels:${ve.channelCount}`)}}function getFrameDuration(ie){return 1024*9e4/ie}function parseFrameHeader(ie,Z){const ee=getHeaderLength(ie,Z);if(Z+ee<=ie.length){const ae=getFullFrameLength(ie,Z)-ee;if(ae>0)return{headerLength:ee,frameLength:ae}}}function appendFrame$2(ie,Z,ee,ae,ye){const ve=getFrameDuration(ie.samplerate),be=ae+ye*ve,Ye=parseFrameHeader(Z,ee);let Ke;if(Ye){const{frameLength:Je,headerLength:rt}=Ye,nt=rt+Je,it=Math.max(0,ee+nt-Z.length);it?(Ke=new Uint8Array(nt-rt),Ke.set(Z.subarray(ee+rt,Z.length),0)):Ke=Z.subarray(ee+rt,ee+nt);const lt={unit:Ke,pts:be};return it||ie.samples.push(lt),{sample:lt,length:nt,missing:it}}const Xe=Z.length-ee;return Ke=new Uint8Array(Xe),Ke.set(Z.subarray(ee,Z.length),0),{sample:{unit:Ke,pts:be},length:Xe,missing:-1}}let chromeVersion$1=null;const BitratesMap=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],SamplingRateMap=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],SamplesCoefficients=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],BytesInSlot=[0,1,1,4];function appendFrame$1(ie,Z,ee,ae,ye){if(ee+24>Z.length)return;const ve=parseHeader(Z,ee);if(ve&&ee+ve.frameLength<=Z.length){const be=ve.samplesPerFrame*9e4/ve.sampleRate,Ye=ae+ye*be,Ke={unit:Z.subarray(ee,ee+ve.frameLength),pts:Ye,dts:Ye};return ie.config=[],ie.channelCount=ve.channelCount,ie.samplerate=ve.sampleRate,ie.samples.push(Ke),{sample:Ke,length:ve.frameLength,missing:0}}}function parseHeader(ie,Z){const ee=ie[Z+1]>>3&3,ae=ie[Z+1]>>1&3,ye=ie[Z+2]>>4&15,ve=ie[Z+2]>>2&3;if(ee!==1&&ye!==0&&ye!==15&&ve!==3){const be=ie[Z+2]>>1&1,Ye=ie[Z+3]>>6,Ke=ee===3?3-ae:ae===3?3:4,Xe=BitratesMap[Ke*14+ye-1]*1e3,Je=SamplingRateMap[(ee===3?0:ee===2?1:2)*3+ve],rt=Ye===3?1:2,nt=SamplesCoefficients[ee][ae],it=BytesInSlot[ae],lt=nt*8*it,ct=Math.floor(nt*Xe/Je+be)*it;if(chromeVersion$1===null){const ot=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);chromeVersion$1=ot?parseInt(ot[1]):0}return chromeVersion$1&&chromeVersion$1<=87&&ae===2&&Xe>=224e3&&Ye===0&&(ie[Z+3]=ie[Z+3]|128),{sampleRate:Je,channelCount:rt,frameLength:ct,samplesPerFrame:lt}}}function isHeaderPattern(ie,Z){return ie[Z]===255&&(ie[Z+1]&224)===224&&(ie[Z+1]&6)!==0}function isHeader(ie,Z){return Z+1{const be=parseEmsg(ve);if(emsgSchemePattern.test(be.schemeIdUri)){const Ye=isFiniteNumber(be.presentationTime)?be.presentationTime/be.timeScale:ee+be.presentationTimeDelta/be.timeScale;let Ke=be.eventDuration===4294967295?Number.POSITIVE_INFINITY:be.eventDuration/be.timeScale;Ke<=.001&&(Ke=Number.POSITIVE_INFINITY);const Xe=be.payload;ae.samples.push({data:Xe,len:Xe.byteLength,dts:Ye,pts:Ye,type:MetadataSchema.emsg,duration:Ke})}})}return ae}demuxSampleAes(Z,ee,ae){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}}const getAudioBSID=(ie,Z)=>{let ee=0,ae=5;Z+=ae;const ye=new Uint32Array(1),ve=new Uint32Array(1),be=new Uint8Array(1);for(;ae>0;){be[0]=ie[Z];const Ye=Math.min(ae,8),Ke=8-Ye;ve[0]=4278190080>>>24+Ke<>Ke,ee=ee?ee<Z.length||Z[ee]!==11||Z[ee+1]!==119)return-1;const ve=Z[ee+4]>>6;if(ve>=3)return-1;const be=[48e3,44100,32e3][ve],Ye=Z[ee+4]&63,Ke=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][Ye*3+ve]*2;if(ee+Ke>Z.length)return-1;const Xe=Z[ee+6]>>5;let Je=0;Xe===2?Je+=2:(Xe&1&&Xe!==1&&(Je+=2),Xe&4&&(Je+=2));const rt=(Z[ee+6]<<8|Z[ee+7])>>12-Je&1,nt=[2,1,2,3,3,4,4,5][Xe]+rt,it=Z[ee+5]>>3,lt=Z[ee+5]&7,ct=new Uint8Array([ve<<6|it<<1|lt>>2,(lt&3)<<6|Xe<<3|rt<<2|Ye>>4,Ye<<4&224]),ot=1536/be*9e4,dt=ae+ye*ot,ft=Z.subarray(ee,ee+Ke);return ie.config=ct,ie.channelCount=nt,ie.samplerate=be,ie.samples.push({unit:ft,pts:dt}),Ke}class BaseVideoParser{constructor(){this.VideoSample=null}createVideoSample(Z,ee,ae,ye){return{key:Z,frame:!1,pts:ee,dts:ae,units:[],debug:ye,length:0}}getLastNalUnit(Z){var ee;let ae=this.VideoSample,ye;if((!ae||ae.units.length===0)&&(ae=Z[Z.length-1]),(ee=ae)!=null&&ee.units){const ve=ae.units;ye=ve[ve.length-1]}return ye}pushAccessUnit(Z,ee){if(Z.units.length&&Z.frame){if(Z.pts===void 0){const ae=ee.samples,ye=ae.length;if(ye){const ve=ae[ye-1];Z.pts=ve.pts,Z.dts=ve.dts}else{ee.dropped++;return}}ee.samples.push(Z)}Z.debug.length&&logger.log(Z.pts+"/"+Z.dts+":"+Z.debug)}}class ExpGolomb{constructor(Z){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=Z,this.bytesAvailable=Z.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const Z=this.data,ee=this.bytesAvailable,ae=Z.byteLength-ee,ye=new Uint8Array(4),ve=Math.min(4,ee);if(ve===0)throw new Error("no bytes available");ye.set(Z.subarray(ae,ae+ve)),this.word=new DataView(ye.buffer).getUint32(0),this.bitsAvailable=ve*8,this.bytesAvailable-=ve}skipBits(Z){let ee;Z=Math.min(Z,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>Z?(this.word<<=Z,this.bitsAvailable-=Z):(Z-=this.bitsAvailable,ee=Z>>3,Z-=ee<<3,this.bytesAvailable-=ee,this.loadWord(),this.word<<=Z,this.bitsAvailable-=Z)}readBits(Z){let ee=Math.min(this.bitsAvailable,Z);const ae=this.word>>>32-ee;if(Z>32&&logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=ee,this.bitsAvailable>0)this.word<<=ee;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return ee=Z-ee,ee>0&&this.bitsAvailable?ae<>>Z)return this.word<<=Z,this.bitsAvailable-=Z,Z;return this.loadWord(),Z+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const Z=this.skipLZ();return this.readBits(Z+1)-1}readEG(){const Z=this.readUEG();return 1&Z?1+Z>>>1:-1*(Z>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}skipScalingList(Z){let ee=8,ae=8,ye;for(let ve=0;ve{var rt;switch(Je.type){case 1:{let ct=!1;Ke=!0;const ot=Je.data;if(Xe&&ot.length>4){const dt=new ExpGolomb(ot).readSliceType();(dt===2||dt===4||dt===7||dt===9)&&(ct=!0)}if(ct){var nt;(nt=Ye)!=null&&nt.frame&&!Ye.key&&(this.pushAccessUnit(Ye,Z),Ye=this.VideoSample=null)}Ye||(Ye=this.VideoSample=this.createVideoSample(!0,ae.pts,ae.dts,"")),Ye.frame=!0,Ye.key=ct;break}case 5:Ke=!0,(rt=Ye)!=null&&rt.frame&&!Ye.key&&(this.pushAccessUnit(Ye,Z),Ye=this.VideoSample=null),Ye||(Ye=this.VideoSample=this.createVideoSample(!0,ae.pts,ae.dts,"")),Ye.key=!0,Ye.frame=!0;break;case 6:{Ke=!0,parseSEIMessageFromNALu(Je.data,1,ae.pts,ee.samples);break}case 7:{var it,lt;Ke=!0,Xe=!0;const ct=Je.data,ot=new ExpGolomb(ct).readSPS();if(!Z.sps||Z.width!==ot.width||Z.height!==ot.height||((it=Z.pixelRatio)==null?void 0:it[0])!==ot.pixelRatio[0]||((lt=Z.pixelRatio)==null?void 0:lt[1])!==ot.pixelRatio[1]){Z.width=ot.width,Z.height=ot.height,Z.pixelRatio=ot.pixelRatio,Z.sps=[ct],Z.duration=ve;const dt=ct.subarray(1,4);let ft="avc1.";for(let gt=0;gt<3;gt++){let mt=dt[gt].toString(16);mt.length<2&&(mt="0"+mt),ft+=mt}Z.codec=ft}break}case 8:Ke=!0,Z.pps=[Je.data];break;case 9:Ke=!0,Z.audFound=!0,Ye&&this.pushAccessUnit(Ye,Z),Ye=this.VideoSample=this.createVideoSample(!1,ae.pts,ae.dts,"");break;case 12:Ke=!0;break;default:Ke=!1,Ye&&(Ye.debug+="unknown NAL "+Je.type+" ");break}Ye&&Ke&&Ye.units.push(Je)}),ye&&Ye&&(this.pushAccessUnit(Ye,Z),this.VideoSample=null)}parseAVCNALu(Z,ee){const ae=ee.byteLength;let ye=Z.naluState||0;const ve=ye,be=[];let Ye=0,Ke,Xe,Je,rt=-1,nt=0;for(ye===-1&&(rt=0,nt=ee[0]&31,ye=0,Ye=1);Ye=0){const it={data:ee.subarray(rt,Xe),type:nt};be.push(it)}else{const it=this.getLastNalUnit(Z.samples);it&&(ve&&Ye<=4-ve&&it.state&&(it.data=it.data.subarray(0,it.data.byteLength-ve)),Xe>0&&(it.data=appendUint8Array(it.data,ee.subarray(0,Xe)),it.state=0))}Ye=0&&ye>=0){const it={data:ee.subarray(rt,ae),type:nt,state:ye};be.push(it)}if(be.length===0){const it=this.getLastNalUnit(Z.samples);it&&(it.data=appendUint8Array(it.data,ee))}return Z.naluState=ye,be}}class SampleAesDecrypter{constructor(Z,ee,ae){this.keyData=void 0,this.decrypter=void 0,this.keyData=ae,this.decrypter=new Decrypter(ee,{removePKCS7Padding:!1})}decryptBuffer(Z){return this.decrypter.decrypt(Z,this.keyData.key.buffer,this.keyData.iv.buffer)}decryptAacSample(Z,ee,ae){const ye=Z[ee].unit;if(ye.length<=16)return;const ve=ye.subarray(16,ye.length-ye.length%16),be=ve.buffer.slice(ve.byteOffset,ve.byteOffset+ve.length);this.decryptBuffer(be).then(Ye=>{const Ke=new Uint8Array(Ye);ye.set(Ke,16),this.decrypter.isSync()||this.decryptAacSamples(Z,ee+1,ae)})}decryptAacSamples(Z,ee,ae){for(;;ee++){if(ee>=Z.length){ae();return}if(!(Z[ee].unit.length<32)&&(this.decryptAacSample(Z,ee,ae),!this.decrypter.isSync()))return}}getAvcEncryptedData(Z){const ee=Math.floor((Z.length-48)/160)*16+16,ae=new Int8Array(ee);let ye=0;for(let ve=32;ve{ve.data=this.getAvcDecryptedUnit(be,Ke),this.decrypter.isSync()||this.decryptAvcSamples(Z,ee,ae+1,ye)})}decryptAvcSamples(Z,ee,ae,ye){if(Z instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;ee++,ae=0){if(ee>=Z.length){ye();return}const ve=Z[ee].units;for(;!(ae>=ve.length);ae++){const be=ve[ae];if(!(be.data.length<=48||be.type!==1&&be.type!==5)&&(this.decryptAvcSample(Z,ee,ae,ye,be),!this.decrypter.isSync()))return}}}}const PACKET_LENGTH=188;class TSDemuxer{constructor(Z,ee,ae){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=Z,this.config=ee,this.typeSupported=ae,this.videoParser=new AvcVideoParser}static probe(Z){const ee=TSDemuxer.syncOffset(Z);return ee>0&&logger.warn(`MPEG2-TS detected but first sync word found @ offset ${ee}`),ee!==-1}static syncOffset(Z){const ee=Z.length;let ae=Math.min(PACKET_LENGTH*5,ee-PACKET_LENGTH)+1,ye=0;for(;ye1&&(be===0&&Ye>2||Ke+PACKET_LENGTH>ae))return be}else{if(Ye)return-1;break}ye++}return-1}static createTrack(Z,ee){return{container:Z==="video"||Z==="audio"?"video/mp2t":void 0,type:Z,id:RemuxerTrackIdConfig[Z],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:Z==="audio"?ee:void 0}}resetInitSegment(Z,ee,ae,ye){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=TSDemuxer.createTrack("video"),this._audioTrack=TSDemuxer.createTrack("audio",ye),this._id3Track=TSDemuxer.createTrack("id3"),this._txtTrack=TSDemuxer.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=ee,this.videoCodec=ae,this._duration=ye}resetTimeStamp(){}resetContiguity(){const{_audioTrack:Z,_videoTrack:ee,_id3Track:ae}=this;Z&&(Z.pesData=null),ee&&(ee.pesData=null),ae&&(ae.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(Z,ee,ae=!1,ye=!1){ae||(this.sampleAes=null);let ve;const be=this._videoTrack,Ye=this._audioTrack,Ke=this._id3Track,Xe=this._txtTrack;let Je=be.pid,rt=be.pesData,nt=Ye.pid,it=Ke.pid,lt=Ye.pesData,ct=Ke.pesData,ot=null,dt=this.pmtParsed,ft=this._pmtId,gt=Z.length;if(this.remainderData&&(Z=appendUint8Array(this.remainderData,Z),gt=Z.length,this.remainderData=null),gt>4;let ni;if(oi>1){if(ni=Xr+5+Z[Xr+4],ni===Xr+PACKET_LENGTH)continue}else ni=Xr+4;switch(ai){case Je:Jr&&(rt&&(ve=parsePES(rt))&&this.videoParser.parseAVCPES(be,Xe,ve,!1,this._duration),rt={data:[],size:0}),rt&&(rt.data.push(Z.subarray(ni,Xr+PACKET_LENGTH)),rt.size+=Xr+PACKET_LENGTH-ni);break;case nt:if(Jr){if(lt&&(ve=parsePES(lt)))switch(Ye.segmentCodec){case"aac":this.parseAACPES(Ye,ve);break;case"mp3":this.parseMPEGPES(Ye,ve);break;case"ac3":this.parseAC3PES(Ye,ve);break}lt={data:[],size:0}}lt&&(lt.data.push(Z.subarray(ni,Xr+PACKET_LENGTH)),lt.size+=Xr+PACKET_LENGTH-ni);break;case it:Jr&&(ct&&(ve=parsePES(ct))&&this.parseID3PES(Ke,ve),ct={data:[],size:0}),ct&&(ct.data.push(Z.subarray(ni,Xr+PACKET_LENGTH)),ct.size+=Xr+PACKET_LENGTH-ni);break;case 0:Jr&&(ni+=Z[ni]+1),ft=this._pmtId=parsePAT(Z,ni);break;case ft:{Jr&&(ni+=Z[ni]+1);const li=parsePMT(Z,ni,this.typeSupported,ae);Je=li.videoPid,Je>0&&(be.pid=Je,be.segmentCodec=li.segmentVideoCodec),nt=li.audioPid,nt>0&&(Ye.pid=nt,Ye.segmentCodec=li.segmentAudioCodec),it=li.id3Pid,it>0&&(Ke.pid=it),ot!==null&&!dt&&(logger.warn(`MPEG-TS PMT found at ${Xr} after unknown PID '${ot}'. Backtracking to sync byte @${mt} to parse all TS packets.`),ot=null,Xr=mt-188),dt=this.pmtParsed=!0;break}case 17:case 8191:break;default:ot=ai;break}}else Yr++;if(Yr>0){const Xr=new Error(`Found ${Yr} TS packet/s that do not start with 0x47`);this.observer.emit(Events.ERROR,Events.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,error:Xr,reason:Xr.message})}be.pesData=rt,Ye.pesData=lt,Ke.pesData=ct;const Qr={audioTrack:Ye,videoTrack:be,id3Track:Ke,textTrack:Xe};return ye&&this.extractRemainingSamples(Qr),Qr}flush(){const{remainderData:Z}=this;this.remainderData=null;let ee;return Z?ee=this.demux(Z,-1,!1,!0):ee={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(ee),this.sampleAes?this.decrypt(ee,this.sampleAes):ee}extractRemainingSamples(Z){const{audioTrack:ee,videoTrack:ae,id3Track:ye,textTrack:ve}=Z,be=ae.pesData,Ye=ee.pesData,Ke=ye.pesData;let Xe;if(be&&(Xe=parsePES(be))?(this.videoParser.parseAVCPES(ae,ve,Xe,!0,this._duration),ae.pesData=null):ae.pesData=be,Ye&&(Xe=parsePES(Ye))){switch(ee.segmentCodec){case"aac":this.parseAACPES(ee,Xe);break;case"mp3":this.parseMPEGPES(ee,Xe);break;case"ac3":this.parseAC3PES(ee,Xe);break}ee.pesData=null}else Ye!=null&&Ye.size&&logger.log("last AAC PES packet truncated,might overlap between fragments"),ee.pesData=Ye;Ke&&(Xe=parsePES(Ke))?(this.parseID3PES(ye,Xe),ye.pesData=null):ye.pesData=Ke}demuxSampleAes(Z,ee,ae){const ye=this.demux(Z,ae,!0,!this.config.progressive),ve=this.sampleAes=new SampleAesDecrypter(this.observer,this.config,ee);return this.decrypt(ye,ve)}decrypt(Z,ee){return new Promise(ae=>{const{audioTrack:ye,videoTrack:ve}=Z;ye.samples&&ye.segmentCodec==="aac"?ee.decryptAacSamples(ye.samples,0,()=>{ve.samples?ee.decryptAvcSamples(ve.samples,0,0,()=>{ae(Z)}):ae(Z)}):ve.samples&&ee.decryptAvcSamples(ve.samples,0,0,()=>{ae(Z)})})}destroy(){this._duration=0}parseAACPES(Z,ee){let ae=0;const ye=this.aacOverFlow;let ve=ee.data;if(ye){this.aacOverFlow=null;const rt=ye.missing,nt=ye.sample.unit.byteLength;if(rt===-1)ve=appendUint8Array(ye.sample.unit,ve);else{const it=nt-rt;ye.sample.unit.set(ve.subarray(0,rt),it),Z.samples.push(ye.sample),ae=ye.missing}}let be,Ye;for(be=ae,Ye=ve.length;be0;)Ye+=Ke}}parseID3PES(Z,ee){if(ee.pts===void 0){logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const ae=_extends({},ee,{type:this._videoTrack?MetadataSchema.emsg:MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY});Z.samples.push(ae)}}function parsePID(ie,Z){return((ie[Z+1]&31)<<8)+ie[Z+2]}function parsePAT(ie,Z){return(ie[Z+10]&31)<<8|ie[Z+11]}function parsePMT(ie,Z,ee,ae){const ye={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},ve=(ie[Z+1]&15)<<8|ie[Z+2],be=Z+3+ve-4,Ye=(ie[Z+10]&15)<<8|ie[Z+11];for(Z+=12+Ye;Z0){let Je=Z+5,rt=Xe;for(;rt>2;){switch(ie[Je]){case 106:ee.ac3!==!0?logger.log("AC-3 audio found, not supported in this browser for now"):(ye.audioPid=Ke,ye.segmentAudioCodec="ac3");break}const nt=ie[Je+1]+2;Je+=nt,rt-=nt}}break;case 194:case 135:logger.warn("Unsupported EC-3 in M2TS found");break;case 36:logger.warn("Unsupported HEVC in M2TS found");break}Z+=Xe+5}return ye}function logEncryptedSamplesFoundInUnencryptedStream(ie){logger.log(`${ie} with AES-128-CBC encryption found in unencrypted stream`)}function parsePES(ie){let Z=0,ee,ae,ye,ve,be;const Ye=ie.data;if(!ie||ie.size===0)return null;for(;Ye[0].length<19&&Ye.length>1;)Ye[0]=appendUint8Array(Ye[0],Ye[1]),Ye.splice(1,1);if(ee=Ye[0],(ee[0]<<16)+(ee[1]<<8)+ee[2]===1){if(ae=(ee[4]<<8)+ee[5],ae&&ae>ie.size-6)return null;const Ke=ee[7];Ke&192&&(ve=(ee[9]&14)*536870912+(ee[10]&255)*4194304+(ee[11]&254)*16384+(ee[12]&255)*128+(ee[13]&254)/2,Ke&64?(be=(ee[14]&14)*536870912+(ee[15]&255)*4194304+(ee[16]&254)*16384+(ee[17]&255)*128+(ee[18]&254)/2,ve-be>60*9e4&&(logger.warn(`${Math.round((ve-be)/9e4)}s delta between PTS and DTS, align them`),ve=be)):be=ve),ye=ee[8];let Xe=ye+9;if(ie.size<=Xe)return null;ie.size-=Xe;const Je=new Uint8Array(ie.size);for(let rt=0,nt=Ye.length;rtit){Xe-=it;continue}else ee=ee.subarray(Xe),it-=Xe,Xe=0;Je.set(ee,Z),Z+=it}return ae&&(ae-=ye+3),{data:Je,pts:ve,dts:be,len:ae}}return null}class MP3Demuxer extends BaseAudioDemuxer{resetInitSegment(Z,ee,ae,ye){super.resetInitSegment(Z,ee,ae,ye),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:ee,duration:ye,inputTimeScale:9e4,dropped:0}}static probe(Z){if(!Z)return!1;const ee=getID3Data(Z,0);let ae=(ee==null?void 0:ee.length)||0;if(ee&&Z[ae]===11&&Z[ae+1]===119&&getTimeStamp(ee)!==void 0&&getAudioBSID(Z,ae)<=16)return!1;for(let ye=Z.length;ae>24&255,be[1]=ae>>16&255,be[2]=ae>>8&255,be[3]=ae&255,be.set(Z,4),ye=0,ae=8;ye>24&255,Z>>16&255,Z>>8&255,Z&255,ae>>24,ae>>16&255,ae>>8&255,ae&255,ye>>24,ye>>16&255,ye>>8&255,ye&255,85,196,0,0]))}static mdia(Z){return MP4.box(MP4.types.mdia,MP4.mdhd(Z.timescale,Z.duration),MP4.hdlr(Z.type),MP4.minf(Z))}static mfhd(Z){return MP4.box(MP4.types.mfhd,new Uint8Array([0,0,0,0,Z>>24,Z>>16&255,Z>>8&255,Z&255]))}static minf(Z){return Z.type==="audio"?MP4.box(MP4.types.minf,MP4.box(MP4.types.smhd,MP4.SMHD),MP4.DINF,MP4.stbl(Z)):MP4.box(MP4.types.minf,MP4.box(MP4.types.vmhd,MP4.VMHD),MP4.DINF,MP4.stbl(Z))}static moof(Z,ee,ae){return MP4.box(MP4.types.moof,MP4.mfhd(Z),MP4.traf(ae,ee))}static moov(Z){let ee=Z.length;const ae=[];for(;ee--;)ae[ee]=MP4.trak(Z[ee]);return MP4.box.apply(null,[MP4.types.moov,MP4.mvhd(Z[0].timescale,Z[0].duration)].concat(ae).concat(MP4.mvex(Z)))}static mvex(Z){let ee=Z.length;const ae=[];for(;ee--;)ae[ee]=MP4.trex(Z[ee]);return MP4.box.apply(null,[MP4.types.mvex,...ae])}static mvhd(Z,ee){ee*=Z;const ae=Math.floor(ee/(UINT32_MAX+1)),ye=Math.floor(ee%(UINT32_MAX+1)),ve=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,Z>>24&255,Z>>16&255,Z>>8&255,Z&255,ae>>24,ae>>16&255,ae>>8&255,ae&255,ye>>24,ye>>16&255,ye>>8&255,ye&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return MP4.box(MP4.types.mvhd,ve)}static sdtp(Z){const ee=Z.samples||[],ae=new Uint8Array(4+ee.length);let ye,ve;for(ye=0;ye>>8&255),ee.push(be&255),ee=ee.concat(Array.prototype.slice.call(ve));for(ye=0;ye>>8&255),ae.push(be&255),ae=ae.concat(Array.prototype.slice.call(ve));const Ye=MP4.box(MP4.types.avcC,new Uint8Array([1,ee[3],ee[4],ee[5],255,224|Z.sps.length].concat(ee).concat([Z.pps.length]).concat(ae))),Ke=Z.width,Xe=Z.height,Je=Z.pixelRatio[0],rt=Z.pixelRatio[1];return MP4.box(MP4.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,Ke>>8&255,Ke&255,Xe>>8&255,Xe&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),Ye,MP4.box(MP4.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),MP4.box(MP4.types.pasp,new Uint8Array([Je>>24,Je>>16&255,Je>>8&255,Je&255,rt>>24,rt>>16&255,rt>>8&255,rt&255])))}static esds(Z){const ee=Z.config.length;return new Uint8Array([0,0,0,0,3,23+ee,0,1,0,4,15+ee,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([ee]).concat(Z.config).concat([6,1,2]))}static audioStsd(Z){const ee=Z.samplerate;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,Z.channelCount,0,16,0,0,0,0,ee>>8&255,ee&255,0,0])}static mp4a(Z){return MP4.box(MP4.types.mp4a,MP4.audioStsd(Z),MP4.box(MP4.types.esds,MP4.esds(Z)))}static mp3(Z){return MP4.box(MP4.types[".mp3"],MP4.audioStsd(Z))}static ac3(Z){return MP4.box(MP4.types["ac-3"],MP4.audioStsd(Z),MP4.box(MP4.types.dac3,Z.config))}static stsd(Z){return Z.type==="audio"?Z.segmentCodec==="mp3"&&Z.codec==="mp3"?MP4.box(MP4.types.stsd,MP4.STSD,MP4.mp3(Z)):Z.segmentCodec==="ac3"?MP4.box(MP4.types.stsd,MP4.STSD,MP4.ac3(Z)):MP4.box(MP4.types.stsd,MP4.STSD,MP4.mp4a(Z)):MP4.box(MP4.types.stsd,MP4.STSD,MP4.avc1(Z))}static tkhd(Z){const ee=Z.id,ae=Z.duration*Z.timescale,ye=Z.width,ve=Z.height,be=Math.floor(ae/(UINT32_MAX+1)),Ye=Math.floor(ae%(UINT32_MAX+1));return MP4.box(MP4.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,ee>>24&255,ee>>16&255,ee>>8&255,ee&255,0,0,0,0,be>>24,be>>16&255,be>>8&255,be&255,Ye>>24,Ye>>16&255,Ye>>8&255,Ye&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,ye>>8&255,ye&255,0,0,ve>>8&255,ve&255,0,0]))}static traf(Z,ee){const ae=MP4.sdtp(Z),ye=Z.id,ve=Math.floor(ee/(UINT32_MAX+1)),be=Math.floor(ee%(UINT32_MAX+1));return MP4.box(MP4.types.traf,MP4.box(MP4.types.tfhd,new Uint8Array([0,0,0,0,ye>>24,ye>>16&255,ye>>8&255,ye&255])),MP4.box(MP4.types.tfdt,new Uint8Array([1,0,0,0,ve>>24,ve>>16&255,ve>>8&255,ve&255,be>>24,be>>16&255,be>>8&255,be&255])),MP4.trun(Z,ae.length+16+20+8+16+8+8),ae)}static trak(Z){return Z.duration=Z.duration||4294967295,MP4.box(MP4.types.trak,MP4.tkhd(Z),MP4.mdia(Z))}static trex(Z){const ee=Z.id;return MP4.box(MP4.types.trex,new Uint8Array([0,0,0,0,ee>>24,ee>>16&255,ee>>8&255,ee&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(Z,ee){const ae=Z.samples||[],ye=ae.length,ve=12+16*ye,be=new Uint8Array(ve);let Ye,Ke,Xe,Je,rt,nt;for(ee+=8+ve,be.set([Z.type==="video"?1:0,0,15,1,ye>>>24&255,ye>>>16&255,ye>>>8&255,ye&255,ee>>>24&255,ee>>>16&255,ee>>>8&255,ee&255],0),Ye=0;Ye>>24&255,Xe>>>16&255,Xe>>>8&255,Xe&255,Je>>>24&255,Je>>>16&255,Je>>>8&255,Je&255,rt.isLeading<<2|rt.dependsOn,rt.isDependedOn<<6|rt.hasRedundancy<<4|rt.paddingValue<<1|rt.isNonSync,rt.degradPrio&61440,rt.degradPrio&15,nt>>>24&255,nt>>>16&255,nt>>>8&255,nt&255],12+16*Ye);return MP4.box(MP4.types.trun,be)}static initSegment(Z){MP4.types||MP4.init();const ee=MP4.moov(Z);return appendUint8Array(MP4.FTYP,ee)}}MP4.types=void 0;MP4.HDLR_TYPES=void 0;MP4.STTS=void 0;MP4.STSC=void 0;MP4.STCO=void 0;MP4.STSZ=void 0;MP4.VMHD=void 0;MP4.SMHD=void 0;MP4.STSD=void 0;MP4.FTYP=void 0;MP4.DINF=void 0;const MPEG_TS_CLOCK_FREQ_HZ=9e4;function toTimescaleFromBase(ie,Z,ee=1,ae=!1){const ye=ie*Z*ee;return ae?Math.round(ye):ye}function toTimescaleFromScale(ie,Z,ee=1,ae=!1){return toTimescaleFromBase(ie,Z,1/ee,ae)}function toMsFromMpegTsClock(ie,Z=!1){return toTimescaleFromBase(ie,1e3,1/MPEG_TS_CLOCK_FREQ_HZ,Z)}function toMpegTsClockFromTimescale(ie,Z=1){return toTimescaleFromBase(ie,MPEG_TS_CLOCK_FREQ_HZ,1/Z)}const MAX_SILENT_FRAME_DURATION=10*1e3,AAC_SAMPLES_PER_FRAME=1024,MPEG_AUDIO_SAMPLE_PER_FRAME=1152,AC3_SAMPLES_PER_FRAME=1536;let chromeVersion=null,safariWebkitVersion=null;class MP4Remuxer{constructor(Z,ee,ae,ye=""){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=Z,this.config=ee,this.typeSupported=ae,this.ISGenerated=!1,chromeVersion===null){const ve=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);chromeVersion=ve?parseInt(ve[1]):0}if(safariWebkitVersion===null){const ve=navigator.userAgent.match(/Safari\/(\d+)/i);safariWebkitVersion=ve?parseInt(ve[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(Z){logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=Z}resetNextTimestamp(){logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(Z){let ee=!1;const ae=Z.reduce((ye,ve)=>{const be=ve.pts-ye;return be<-4294967296?(ee=!0,normalizePts(ye,ve.pts)):be>0?ye:ve.pts},Z[0].pts);return ee&&logger.debug("PTS rollover detected"),ae}remux(Z,ee,ae,ye,ve,be,Ye,Ke){let Xe,Je,rt,nt,it,lt,ct=ve,ot=ve;const dt=Z.pid>-1,ft=ee.pid>-1,gt=ee.samples.length,mt=Z.samples.length>0,Yr=Ye&>>0||gt>1;if((!dt||mt)&&(!ft||Yr)||this.ISGenerated||Ye){if(this.ISGenerated){var Qr,Xr,Jr,ai;const ui=this.videoTrackConfig;ui&&(ee.width!==ui.width||ee.height!==ui.height||((Qr=ee.pixelRatio)==null?void 0:Qr[0])!==((Xr=ui.pixelRatio)==null?void 0:Xr[0])||((Jr=ee.pixelRatio)==null?void 0:Jr[1])!==((ai=ui.pixelRatio)==null?void 0:ai[1]))&&this.resetInitSegment()}else rt=this.generateIS(Z,ee,ve,be);const oi=this.isVideoContiguous;let ni=-1,li;if(Yr&&(ni=findKeyframeIndex(ee.samples),!oi&&this.config.forceKeyFrameOnDiscontinuity))if(lt=!0,ni>0){logger.warn(`[mp4-remuxer]: Dropped ${ni} out of ${gt} video samples due to a missing keyframe`);const ui=this.getVideoStartPts(ee.samples);ee.samples=ee.samples.slice(ni),ee.dropped+=ni,ot+=(ee.samples[0].pts-ui)/ee.inputTimeScale,li=ot}else ni===-1&&(logger.warn(`[mp4-remuxer]: No keyframe found out of ${gt} video samples`),lt=!1);if(this.ISGenerated){if(mt&&Yr){const ui=this.getVideoStartPts(ee.samples),mi=(normalizePts(Z.samples[0].pts,ui)-ui)/ee.inputTimeScale;ct+=Math.max(0,mi),ot+=Math.max(0,-mi)}if(mt){if(Z.samplerate||(logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),rt=this.generateIS(Z,ee,ve,be)),Je=this.remuxAudio(Z,ct,this.isAudioContiguous,be,ft||Yr||Ke===PlaylistLevelType.AUDIO?ot:void 0),Yr){const ui=Je?Je.endPTS-Je.startPTS:0;ee.inputTimeScale||(logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),rt=this.generateIS(Z,ee,ve,be)),Xe=this.remuxVideo(ee,ot,oi,ui)}}else Yr&&(Xe=this.remuxVideo(ee,ot,oi,0));Xe&&(Xe.firstKeyFrame=ni,Xe.independent=ni!==-1,Xe.firstKeyFramePTS=li)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(ae.samples.length&&(it=flushTextTrackMetadataCueSamples(ae,ve,this._initPTS,this._initDTS)),ye.samples.length&&(nt=flushTextTrackUserdataCueSamples(ye,ve,this._initPTS))),{audio:Je,video:Xe,initSegment:rt,independent:lt,text:nt,id3:it}}generateIS(Z,ee,ae,ye){const ve=Z.samples,be=ee.samples,Ye=this.typeSupported,Ke={},Xe=this._initPTS;let Je=!Xe||ye,rt="audio/mp4",nt,it,lt;if(Je&&(nt=it=1/0),Z.config&&ve.length){switch(Z.timescale=Z.samplerate,Z.segmentCodec){case"mp3":Ye.mpeg?(rt="audio/mpeg",Z.codec=""):Ye.mp3&&(Z.codec="mp3");break;case"ac3":Z.codec="ac-3";break}Ke.audio={id:"audio",container:rt,codec:Z.codec,initSegment:Z.segmentCodec==="mp3"&&Ye.mpeg?new Uint8Array(0):MP4.initSegment([Z]),metadata:{channelCount:Z.channelCount}},Je&&(lt=Z.inputTimeScale,!Xe||lt!==Xe.timescale?nt=it=ve[0].pts-Math.round(lt*ae):Je=!1)}if(ee.sps&&ee.pps&&be.length){if(ee.timescale=ee.inputTimeScale,Ke.video={id:"main",container:"video/mp4",codec:ee.codec,initSegment:MP4.initSegment([ee]),metadata:{width:ee.width,height:ee.height}},Je)if(lt=ee.inputTimeScale,!Xe||lt!==Xe.timescale){const ct=this.getVideoStartPts(be),ot=Math.round(lt*ae);it=Math.min(it,normalizePts(be[0].dts,ct)-ot),nt=Math.min(nt,ct-ot)}else Je=!1;this.videoTrackConfig={width:ee.width,height:ee.height,pixelRatio:ee.pixelRatio}}if(Object.keys(Ke).length)return this.ISGenerated=!0,Je?(this._initPTS={baseTime:nt,timescale:lt},this._initDTS={baseTime:it,timescale:lt}):nt=lt=void 0,{tracks:Ke,initPTS:nt,timescale:lt}}remuxVideo(Z,ee,ae,ye){const ve=Z.inputTimeScale,be=Z.samples,Ye=[],Ke=be.length,Xe=this._initPTS;let Je=this.nextAvcDts,rt=8,nt=this.videoSampleDuration,it,lt,ct=Number.POSITIVE_INFINITY,ot=Number.NEGATIVE_INFINITY,dt=!1;if(!ae||Je===null){const ri=ee*ve,ci=be[0].pts-normalizePts(be[0].dts,be[0].pts);chromeVersion&&Je!==null&&Math.abs(ri-ci-Je)<15e3?ae=!0:Je=ri-ci}const ft=Xe.baseTime*ve/Xe.timescale;for(let ri=0;ri0?ri-1:ri].dts&&(dt=!0)}dt&&be.sort(function(ri,ci){const Si=ri.dts-ci.dts,si=ri.pts-ci.pts;return Si||si}),it=be[0].dts,lt=be[be.length-1].dts;const gt=lt-it,mt=gt?Math.round(gt/(Ke-1)):nt||Z.inputTimeScale/30;if(ae){const ri=it-Je,ci=ri>mt,Si=ri<-1;if((ci||Si)&&(ci?logger.warn(`AVC: ${toMsFromMpegTsClock(ri,!0)} ms (${ri}dts) hole between fragments detected at ${ee.toFixed(3)}`):logger.warn(`AVC: ${toMsFromMpegTsClock(-ri,!0)} ms (${ri}dts) overlapping between fragments detected at ${ee.toFixed(3)}`),!Si||Je>=be[0].pts||chromeVersion)){it=Je;const si=be[0].pts-ri;if(ci)be[0].dts=it,be[0].pts=si;else for(let Ei=0;Eisi);Ei++)be[Ei].dts-=ri,be[Ei].pts-=ri;logger.log(`Video: Initial PTS/DTS adjusted: ${toMsFromMpegTsClock(si,!0)}/${toMsFromMpegTsClock(it,!0)}, delta: ${toMsFromMpegTsClock(ri,!0)} ms`)}}it=Math.max(0,it);let Yr=0,Qr=0,Xr=it;for(let ri=0;ri0?ci.dts-be[ri-1].dts:mt;if(Ei=ri>0?ci.pts-be[ri-1].pts:mt,Mi.stretchShortVideoTrack&&this.nextAudioPts!==null){const Ri=Math.floor(Mi.maxBufferHole*ve),Ni=(ye?ct+ye*ve:this.nextAudioPts)-ci.pts;Ni>Ri?(nt=Ni-Ci,nt<0?nt=Ci:ni=!0,logger.log(`[mp4-remuxer]: It is approximately ${Ni/90} ms to the next segment; using duration ${nt/90} ms for the last video frame.`)):nt=Ci}else nt=Ci}const yi=Math.round(ci.pts-ci.dts);li=Math.min(li,nt),mi=Math.max(mi,nt),ui=Math.min(ui,Ei),ii=Math.max(ii,Ei),Ye.push(new Mp4Sample(ci.key,nt,si,yi))}if(Ye.length){if(chromeVersion){if(chromeVersion<70){const ri=Ye[0].flags;ri.dependsOn=2,ri.isNonSync=0}}else if(safariWebkitVersion&&ii-ui0&&(ye&&Math.abs(ft-dt)<9e3||Math.abs(normalizePts(ct[0].pts-gt,ft)-dt)<20*Je),ct.forEach(function(ii){ii.pts=normalizePts(ii.pts-gt,ft)}),!ae||dt<0){if(ct=ct.filter(ii=>ii.pts>=0),!ct.length)return;ve===0?dt=0:ye&&!lt?dt=Math.max(0,ft):dt=ct[0].pts}if(Z.segmentCodec==="aac"){const ii=this.config.maxAudioFramesDrift;for(let hi=0,ri=dt;hi=ii*Je&&Ei0){Xr+=ot;try{Qr=new Uint8Array(Xr)}catch(Ei){this.observer.emit(Events.ERROR,Events.ERROR,{type:ErrorTypes.MUX_ERROR,details:ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,error:Ei,bytes:Xr,reason:`fail allocating audio mdat ${Xr}`});return}nt||(new DataView(Qr.buffer).setUint32(0,Xr),Qr.set(MP4.types.mdat,4))}else return;Qr.set(ci,ot);const si=ci.byteLength;ot+=si,it.push(new Mp4Sample(!0,Xe,si,0)),Yr=Si}const ai=it.length;if(!ai)return;const oi=it[it.length-1];this.nextAudioPts=dt=Yr+Ke*oi.duration;const ni=nt?new Uint8Array(0):MP4.moof(Z.sequenceNumber++,mt/Ke,_extends({},Z,{samples:it}));Z.samples=[];const li=mt/be,ui=dt/be,mi={data1:ni,data2:Qr,startPTS:li,endPTS:ui,startDTS:li,endDTS:ui,type:"audio",hasAudio:!0,hasVideo:!1,nb:ai};return this.isAudioContiguous=!0,mi}remuxEmptyAudio(Z,ee,ae,ye){const ve=Z.inputTimeScale,be=Z.samplerate?Z.samplerate:ve,Ye=ve/be,Ke=this.nextAudioPts,Xe=this._initDTS,Je=Xe.baseTime*9e4/Xe.timescale,rt=(Ke!==null?Ke:ye.startDTS*ve)+Je,nt=ye.endDTS*ve+Je,it=Ye*AAC_SAMPLES_PER_FRAME,lt=Math.ceil((nt-rt)/it),ct=AAC.getSilentFrame(Z.manifestCodec||Z.codec,Z.channelCount);if(logger.warn("[mp4-remuxer]: remux empty Audio"),!ct){logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}const ot=[];for(let dt=0;dt4294967296;)ie+=ee;return ie}function findKeyframeIndex(ie){for(let Z=0;Zbe.pts-Ye.pts);const ve=ie.samples;return ie.samples=[],{samples:ve}}class Mp4Sample{constructor(Z,ee,ae,ye){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=ee,this.size=ae,this.cts=ye,this.flags={isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:Z?2:1,isNonSync:Z?0:1}}}class PassThroughRemuxer{constructor(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}destroy(){}resetTimeStamp(Z){this.initPTS=Z,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(Z,ee,ae,ye){this.audioCodec=ee,this.videoCodec=ae,this.generateInitSegment(patchEncyptionData(Z,ye)),this.emitInitSegment=!0}generateInitSegment(Z){let{audioCodec:ee,videoCodec:ae}=this;if(!(Z!=null&&Z.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const ye=this.initData=parseInitSegment(Z);ye.audio&&(ee=getParsedTrackCodec(ye.audio,ElementaryStreamTypes.AUDIO)),ye.video&&(ae=getParsedTrackCodec(ye.video,ElementaryStreamTypes.VIDEO));const ve={};ye.audio&&ye.video?ve.audiovideo={container:"video/mp4",codec:ee+","+ae,initSegment:Z,id:"main"}:ye.audio?ve.audio={container:"audio/mp4",codec:ee,initSegment:Z,id:"audio"}:ye.video?ve.video={container:"video/mp4",codec:ae,initSegment:Z,id:"main"}:logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=ve}remux(Z,ee,ae,ye,ve,be){var Ye,Ke;let{initPTS:Xe,lastEndTime:Je}=this;const rt={audio:void 0,video:void 0,text:ye,id3:ae,initSegment:void 0};isFiniteNumber(Je)||(Je=this.lastEndTime=ve||0);const nt=ee.samples;if(!(nt!=null&&nt.length))return rt;const it={initPTS:void 0,timescale:1};let lt=this.initData;if((Ye=lt)!=null&&Ye.length||(this.generateInitSegment(nt),lt=this.initData),!((Ke=lt)!=null&&Ke.length))return logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),rt;this.emitInitSegment&&(it.tracks=this.initTracks,this.emitInitSegment=!1);const ct=getDuration(nt,lt),ot=getStartDTS(lt,nt),dt=ot===null?ve:ot;(isInvalidInitPts(Xe,dt,ve,ct)||it.timescale!==Xe.timescale&&be)&&(it.initPTS=dt-ve,Xe&&Xe.timescale===1&&logger.warn(`Adjusting initPTS by ${it.initPTS-Xe.baseTime}`),this.initPTS=Xe={baseTime:it.initPTS,timescale:1});const ft=Z?dt-Xe.baseTime/Xe.timescale:Je,gt=ft+ct;offsetStartDTS(lt,nt,Xe.baseTime/Xe.timescale),ct>0?this.lastEndTime=gt:(logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const mt=!!lt.audio,Yr=!!lt.video;let Qr="";mt&&(Qr+="audio"),Yr&&(Qr+="video");const Xr={data1:nt,startPTS:ft,startDTS:ft,endPTS:gt,endDTS:gt,type:Qr,hasAudio:mt,hasVideo:Yr,nb:1,dropped:0};return rt.audio=Xr.type==="audio"?Xr:void 0,rt.video=Xr.type!=="audio"?Xr:void 0,rt.initSegment=it,rt.id3=flushTextTrackMetadataCueSamples(ae,ve,Xe,Xe),ye.samples.length&&(rt.text=flushTextTrackUserdataCueSamples(ye,ve,Xe)),rt}}function isInvalidInitPts(ie,Z,ee,ae){if(ie===null)return!0;const ye=Math.max(ae,1),ve=Z-ie.baseTime/ie.timescale;return Math.abs(ve-ee)>ye}function getParsedTrackCodec(ie,Z){const ee=ie==null?void 0:ie.codec;if(ee&&ee.length>4)return ee;if(Z===ElementaryStreamTypes.AUDIO){if(ee==="ec-3"||ee==="ac-3"||ee==="alac")return ee;if(ee==="fLaC"||ee==="Opus")return getCodecCompatibleName(ee,!1);const ae="mp4a.40.5";return logger.info(`Parsed audio codec "${ee}" or audio object type not handled. Using "${ae}"`),ae}return logger.warn(`Unhandled video codec "${ee}"`),ee==="hvc1"||ee==="hev1"?"hvc1.1.6.L120.90":ee==="av01"?"av01.0.04M.08":"avc1.42e01e"}let now;try{now=self.performance.now.bind(self.performance)}catch{logger.debug("Unable to use Performance API on this environment"),now=optionalSelf==null?void 0:optionalSelf.Date.now}const muxConfig=[{demux:MP4Demuxer,remux:PassThroughRemuxer},{demux:TSDemuxer,remux:MP4Remuxer},{demux:AACDemuxer,remux:MP4Remuxer},{demux:MP3Demuxer,remux:MP4Remuxer}];muxConfig.splice(2,0,{demux:AC3Demuxer,remux:MP4Remuxer});class Transmuxer{constructor(Z,ee,ae,ye,ve){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=Z,this.typeSupported=ee,this.config=ae,this.vendor=ye,this.id=ve}configure(Z){this.transmuxConfig=Z,this.decrypter&&this.decrypter.reset()}push(Z,ee,ae,ye){const ve=ae.transmuxing;ve.executeStart=now();let be=new Uint8Array(Z);const{currentTransmuxState:Ye,transmuxConfig:Ke}=this;ye&&(this.currentTransmuxState=ye);const{contiguous:Xe,discontinuity:Je,trackSwitch:rt,accurateTimeOffset:nt,timeOffset:it,initSegmentChange:lt}=ye||Ye,{audioCodec:ct,videoCodec:ot,defaultInitPts:dt,duration:ft,initSegmentData:gt}=Ke,mt=getEncryptionType(be,ee);if(mt&&mt.method==="AES-128"){const Jr=this.getDecrypter();if(Jr.isSync()){let ai=Jr.softwareDecrypt(be,mt.key.buffer,mt.iv.buffer);if(ae.part>-1&&(ai=Jr.flush()),!ai)return ve.executeEnd=now(),emptyResult(ae);be=new Uint8Array(ai)}else return this.decryptionPromise=Jr.webCryptoDecrypt(be,mt.key.buffer,mt.iv.buffer).then(ai=>{const oi=this.push(ai,null,ae);return this.decryptionPromise=null,oi}),this.decryptionPromise}const Yr=this.needsProbing(Je,rt);if(Yr){const Jr=this.configureTransmuxer(be);if(Jr)return logger.warn(`[transmuxer] ${Jr.message}`),this.observer.emit(Events.ERROR,Events.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,error:Jr,reason:Jr.message}),ve.executeEnd=now(),emptyResult(ae)}(Je||rt||lt||Yr)&&this.resetInitSegment(gt,ct,ot,ft,ee),(Je||lt||Yr)&&this.resetInitialTimestamp(dt),Xe||this.resetContiguity();const Qr=this.transmux(be,mt,it,nt,ae),Xr=this.currentTransmuxState;return Xr.contiguous=!0,Xr.discontinuity=!1,Xr.trackSwitch=!1,ve.executeEnd=now(),Qr}flush(Z){const ee=Z.transmuxing;ee.executeStart=now();const{decrypter:ae,currentTransmuxState:ye,decryptionPromise:ve}=this;if(ve)return ve.then(()=>this.flush(Z));const be=[],{timeOffset:Ye}=ye;if(ae){const rt=ae.flush();rt&&be.push(this.push(rt,null,Z))}const{demuxer:Ke,remuxer:Xe}=this;if(!Ke||!Xe)return ee.executeEnd=now(),[emptyResult(Z)];const Je=Ke.flush(Ye);return isPromise(Je)?Je.then(rt=>(this.flushRemux(be,rt,Z),be)):(this.flushRemux(be,Je,Z),be)}flushRemux(Z,ee,ae){const{audioTrack:ye,videoTrack:ve,id3Track:be,textTrack:Ye}=ee,{accurateTimeOffset:Ke,timeOffset:Xe}=this.currentTransmuxState;logger.log(`[transmuxer.ts]: Flushed fragment ${ae.sn}${ae.part>-1?" p: "+ae.part:""} of level ${ae.level}`);const Je=this.remuxer.remux(ye,ve,be,Ye,Xe,Ke,!0,this.id);Z.push({remuxResult:Je,chunkMeta:ae}),ae.transmuxing.executeEnd=now()}resetInitialTimestamp(Z){const{demuxer:ee,remuxer:ae}=this;!ee||!ae||(ee.resetTimeStamp(Z),ae.resetTimeStamp(Z))}resetContiguity(){const{demuxer:Z,remuxer:ee}=this;!Z||!ee||(Z.resetContiguity(),ee.resetNextTimestamp())}resetInitSegment(Z,ee,ae,ye,ve){const{demuxer:be,remuxer:Ye}=this;!be||!Ye||(be.resetInitSegment(Z,ee,ae,ye),Ye.resetInitSegment(Z,ee,ae,ve))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(Z,ee,ae,ye,ve){let be;return ee&&ee.method==="SAMPLE-AES"?be=this.transmuxSampleAes(Z,ee,ae,ye,ve):be=this.transmuxUnencrypted(Z,ae,ye,ve),be}transmuxUnencrypted(Z,ee,ae,ye){const{audioTrack:ve,videoTrack:be,id3Track:Ye,textTrack:Ke}=this.demuxer.demux(Z,ee,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(ve,be,Ye,Ke,ee,ae,!1,this.id),chunkMeta:ye}}transmuxSampleAes(Z,ee,ae,ye,ve){return this.demuxer.demuxSampleAes(Z,ee,ae).then(be=>({remuxResult:this.remuxer.remux(be.audioTrack,be.videoTrack,be.id3Track,be.textTrack,ae,ye,!1,this.id),chunkMeta:ve}))}configureTransmuxer(Z){const{config:ee,observer:ae,typeSupported:ye,vendor:ve}=this;let be;for(let nt=0,it=muxConfig.length;nt0&&(Z==null?void 0:Z.key)!=null&&Z.iv!==null&&Z.method!=null&&(ee=Z),ee}const emptyResult=ie=>({remuxResult:{},chunkMeta:ie});function isPromise(ie){return"then"in ie&&ie.then instanceof Function}class TransmuxConfig{constructor(Z,ee,ae,ye,ve){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=Z,this.videoCodec=ee,this.initSegmentData=ae,this.duration=ye,this.defaultInitPts=ve||null}}class TransmuxState{constructor(Z,ee,ae,ye,ve,be){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=Z,this.contiguous=ee,this.accurateTimeOffset=ae,this.trackSwitch=ye,this.timeOffset=ve,this.initSegmentChange=be}}var eventemitter3={exports:{}};(function(ie){var Z=Object.prototype.hasOwnProperty,ee="~";function ae(){}Object.create&&(ae.prototype=Object.create(null),new ae().__proto__||(ee=!1));function ye(Ke,Xe,Je){this.fn=Ke,this.context=Xe,this.once=Je||!1}function ve(Ke,Xe,Je,rt,nt){if(typeof Je!="function")throw new TypeError("The listener must be a function");var it=new ye(Je,rt||Ke,nt),lt=ee?ee+Xe:Xe;return Ke._events[lt]?Ke._events[lt].fn?Ke._events[lt]=[Ke._events[lt],it]:Ke._events[lt].push(it):(Ke._events[lt]=it,Ke._eventsCount++),Ke}function be(Ke,Xe){--Ke._eventsCount===0?Ke._events=new ae:delete Ke._events[Xe]}function Ye(){this._events=new ae,this._eventsCount=0}Ye.prototype.eventNames=function(){var Ke=[],Xe,Je;if(this._eventsCount===0)return Ke;for(Je in Xe=this._events)Z.call(Xe,Je)&&Ke.push(ee?Je.slice(1):Je);return Object.getOwnPropertySymbols?Ke.concat(Object.getOwnPropertySymbols(Xe)):Ke},Ye.prototype.listeners=function(Ke){var Xe=ee?ee+Ke:Ke,Je=this._events[Xe];if(!Je)return[];if(Je.fn)return[Je.fn];for(var rt=0,nt=Je.length,it=new Array(nt);rt{rt=rt||{},rt.frag=this.frag,rt.id=this.id,Je===Events.ERROR&&(this.error=rt.error),this.hls.trigger(Je,rt)};this.observer=new EventEmitter,this.observer.on(Events.FRAG_DECRYPTED,be),this.observer.on(Events.ERROR,be);const Ye=getMediaSource(ve.preferManagedMediaSource)||{isTypeSupported:()=>!1},Ke={mpeg:Ye.isTypeSupported("audio/mpeg"),mp3:Ye.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:Ye.isTypeSupported('audio/mp4; codecs="ac-3"')},Xe=navigator.vendor;if(this.useWorker&&typeof Worker<"u"&&(ve.workerPath||hasUMDWorker())){try{ve.workerPath?(logger.log(`loading Web Worker ${ve.workerPath} for "${ee}"`),this.workerContext=loadWorker(ve.workerPath)):(logger.log(`injecting Web Worker for "${ee}"`),this.workerContext=injectWorker()),this.onwmsg=rt=>this.onWorkerMessage(rt);const{worker:Je}=this.workerContext;Je.addEventListener("message",this.onwmsg),Je.onerror=rt=>{const nt=new Error(`${rt.message} (${rt.filename}:${rt.lineno})`);ve.enableWorker=!1,logger.warn(`Error in "${ee}" Web Worker, fallback to inline`),this.hls.trigger(Events.ERROR,{type:ErrorTypes.OTHER_ERROR,details:ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:nt})},Je.postMessage({cmd:"init",typeSupported:Ke,vendor:Xe,id:ee,config:JSON.stringify(ve)})}catch(Je){logger.warn(`Error setting up "${ee}" Web Worker, fallback to inline`,Je),this.resetWorker(),this.error=null,this.transmuxer=new Transmuxer(this.observer,Ke,ve,Xe,ee)}return}this.transmuxer=new Transmuxer(this.observer,Ke,ve,Xe,ee)}resetWorker(){if(this.workerContext){const{worker:Z,objectURL:ee}=this.workerContext;ee&&self.URL.revokeObjectURL(ee),Z.removeEventListener("message",this.onwmsg),Z.onerror=null,Z.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const ee=this.transmuxer;ee&&(ee.destroy(),this.transmuxer=null)}const Z=this.observer;Z&&Z.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(Z,ee,ae,ye,ve,be,Ye,Ke,Xe,Je){var rt,nt;Xe.transmuxing.start=self.performance.now();const{transmuxer:it}=this,lt=be?be.start:ve.start,ct=ve.decryptdata,ot=this.frag,dt=!(ot&&ve.cc===ot.cc),ft=!(ot&&Xe.level===ot.level),gt=ot?Xe.sn-ot.sn:-1,mt=this.part?Xe.part-this.part.index:-1,Yr=gt===0&&Xe.id>1&&Xe.id===(ot==null?void 0:ot.stats.chunkCount),Qr=!ft&&(gt===1||gt===0&&(mt===1||Yr&&mt<=0)),Xr=self.performance.now();(ft||gt||ve.stats.parsing.start===0)&&(ve.stats.parsing.start=Xr),be&&(mt||!Qr)&&(be.stats.parsing.start=Xr);const Jr=!(ot&&((rt=ve.initSegment)==null?void 0:rt.url)===((nt=ot.initSegment)==null?void 0:nt.url)),ai=new TransmuxState(dt,Qr,Ke,ft,lt,Jr);if(!Qr||dt||Jr){logger.log(`[transmuxer-interface, ${ve.type}]: Starting new transmux session for sn: ${Xe.sn} p: ${Xe.part} level: ${Xe.level} id: ${Xe.id} + discontinuity: ${dt} + trackSwitch: ${ft} + contiguous: ${Qr} + accurateTimeOffset: ${Ke} + timeOffset: ${lt} + initSegmentChange: ${Jr}`);const oi=new TransmuxConfig(ae,ye,ee,Ye,Je);this.configureTransmuxer(oi)}if(this.frag=ve,this.part=be,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:Z,decryptdata:ct,chunkMeta:Xe,state:ai},Z instanceof ArrayBuffer?[Z]:[]);else if(it){const oi=it.push(Z,ct,Xe,ai);isPromise(oi)?(it.async=!0,oi.then(ni=>{this.handleTransmuxComplete(ni)}).catch(ni=>{this.transmuxerError(ni,Xe,"transmuxer-interface push error")})):(it.async=!1,this.handleTransmuxComplete(oi))}}flush(Z){Z.transmuxing.start=self.performance.now();const{transmuxer:ee}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:Z});else if(ee){let ae=ee.flush(Z);isPromise(ae)||ee.async?(isPromise(ae)||(ae=Promise.resolve(ae)),ae.then(ye=>{this.handleFlushResult(ye,Z)}).catch(ye=>{this.transmuxerError(ye,Z,"transmuxer-interface flush error")})):this.handleFlushResult(ae,Z)}}transmuxerError(Z,ee,ae){this.hls&&(this.error=Z,this.hls.trigger(Events.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:ee,fatal:!1,error:Z,err:Z,reason:ae}))}handleFlushResult(Z,ee){Z.forEach(ae=>{this.handleTransmuxComplete(ae)}),this.onFlush(ee)}onWorkerMessage(Z){const ee=Z.data,ae=this.hls;switch(ee.event){case"init":{var ye;const ve=(ye=this.workerContext)==null?void 0:ye.objectURL;ve&&self.URL.revokeObjectURL(ve);break}case"transmuxComplete":{this.handleTransmuxComplete(ee.data);break}case"flush":{this.onFlush(ee.data);break}case"workerLog":logger[ee.data.logType]&&logger[ee.data.logType](ee.data.message);break;default:{ee.data=ee.data||{},ee.data.frag=this.frag,ee.data.id=this.id,ae.trigger(ee.event,ee.data);break}}}configureTransmuxer(Z){const{transmuxer:ee}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:Z}):ee&&ee.configure(Z)}handleTransmuxComplete(Z){Z.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(Z)}}function subtitleOptionsIdentical(ie,Z){if(ie.length!==Z.length)return!1;for(let ee=0;eeie[ye]!==Z[ye])}function subtitleTrackMatchesTextTrack(ie,Z){return Z.label.toLowerCase()===ie.name.toLowerCase()&&(!Z.language||Z.language.toLowerCase()===(ie.lang||"").toLowerCase())}const TICK_INTERVAL$2=100;class AudioStreamController extends BaseStreamController{constructor(Z,ee,ae){super(Z,ee,ae,"[audio-stream-controller]",PlaylistLevelType.AUDIO),this.videoBuffer=null,this.videoTrackCC=-1,this.waitingVideoCC=-1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null,this.bufferedTrack=null,this.switchingTrack=null}_registerListeners(){const{hls:Z}=this;Z.on(Events.MEDIA_ATTACHED,this.onMediaAttached,this),Z.on(Events.MEDIA_DETACHING,this.onMediaDetaching,this),Z.on(Events.MANIFEST_LOADING,this.onManifestLoading,this),Z.on(Events.LEVEL_LOADED,this.onLevelLoaded,this),Z.on(Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),Z.on(Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),Z.on(Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),Z.on(Events.ERROR,this.onError,this),Z.on(Events.BUFFER_RESET,this.onBufferReset,this),Z.on(Events.BUFFER_CREATED,this.onBufferCreated,this),Z.on(Events.BUFFER_FLUSHING,this.onBufferFlushing,this),Z.on(Events.BUFFER_FLUSHED,this.onBufferFlushed,this),Z.on(Events.INIT_PTS_FOUND,this.onInitPtsFound,this),Z.on(Events.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:Z}=this;Z.off(Events.MEDIA_ATTACHED,this.onMediaAttached,this),Z.off(Events.MEDIA_DETACHING,this.onMediaDetaching,this),Z.off(Events.MANIFEST_LOADING,this.onManifestLoading,this),Z.off(Events.LEVEL_LOADED,this.onLevelLoaded,this),Z.off(Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),Z.off(Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),Z.off(Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),Z.off(Events.ERROR,this.onError,this),Z.off(Events.BUFFER_RESET,this.onBufferReset,this),Z.off(Events.BUFFER_CREATED,this.onBufferCreated,this),Z.off(Events.BUFFER_FLUSHING,this.onBufferFlushing,this),Z.off(Events.BUFFER_FLUSHED,this.onBufferFlushed,this),Z.off(Events.INIT_PTS_FOUND,this.onInitPtsFound,this),Z.off(Events.FRAG_BUFFERED,this.onFragBuffered,this)}onInitPtsFound(Z,{frag:ee,id:ae,initPTS:ye,timescale:ve}){if(ae==="main"){const be=ee.cc;this.initPTS[ee.cc]={baseTime:ye,timescale:ve},this.log(`InitPTS for cc: ${be} found from main: ${ye}`),this.videoTrackCC=be,this.state===State.WAITING_INIT_PTS&&this.tick()}}startLoad(Z){if(!this.levels){this.startPosition=Z,this.state=State.STOPPED;return}const ee=this.lastCurrentTime;this.stopLoad(),this.setInterval(TICK_INTERVAL$2),ee>0&&Z===-1?(this.log(`Override startPosition with lastCurrentTime @${ee.toFixed(3)}`),Z=ee,this.state=State.IDLE):(this.loadedmetadata=!1,this.state=State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=Z,this.tick()}doTick(){switch(this.state){case State.IDLE:this.doTickIdle();break;case State.WAITING_TRACK:{var Z;const{levels:ae,trackId:ye}=this,ve=ae==null||(Z=ae[ye])==null?void 0:Z.details;if(ve){if(this.waitForCdnTuneIn(ve))break;this.state=State.WAITING_INIT_PTS}break}case State.FRAG_LOADING_WAITING_RETRY:{var ee;const ae=performance.now(),ye=this.retryDate;if(!ye||ae>=ye||(ee=this.media)!=null&&ee.seeking){const{levels:ve,trackId:be}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((ve==null?void 0:ve[be])||null),this.state=State.IDLE}break}case State.WAITING_INIT_PTS:{const ae=this.waitingData;if(ae){const{frag:ye,part:ve,cache:be,complete:Ye}=ae;if(this.initPTS[ye.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=State.FRAG_LOADING;const Ke=be.flush(),Xe={frag:ye,part:ve,payload:Ke,networkDetails:null};this._handleFragmentLoadProgress(Xe),Ye&&super._handleFragmentLoadComplete(Xe)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${ye.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const Ke=this.getLoadPosition(),Xe=BufferHelper.bufferInfo(this.mediaBuffer,Ke,this.config.maxBufferHole);fragmentWithinToleranceTest(Xe.end,this.config.maxFragLookUpTolerance,ye)<0&&(this.log(`Waiting fragment cc (${ye.cc}) @ ${ye.start} cancelled because another fragment at ${Xe.end} is needed`),this.clearWaitingFragment())}}else this.state=State.IDLE}}this.onTickEnd()}clearWaitingFragment(){const Z=this.waitingData;Z&&(this.fragmentTracker.removeFragment(Z.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=State.IDLE)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:Z}=this;Z!=null&&Z.readyState&&(this.lastCurrentTime=Z.currentTime)}doTickIdle(){const{hls:Z,levels:ee,media:ae,trackId:ye}=this,ve=Z.config;if(!ae&&(this.startFragRequested||!ve.startFragPrefetch)||!(ee!=null&&ee[ye]))return;const be=ee[ye],Ye=be.details;if(!Ye||Ye.live&&this.levelLastLoaded!==be||this.waitForCdnTuneIn(Ye)){this.state=State.WAITING_TRACK;return}const Ke=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&Ke&&(this.bufferFlushed=!1,this.afterBufferFlushed(Ke,ElementaryStreamTypes.AUDIO,PlaylistLevelType.AUDIO));const Xe=this.getFwdBufferInfo(Ke,PlaylistLevelType.AUDIO);if(Xe===null)return;const{bufferedTrack:Je,switchingTrack:rt}=this;if(!rt&&this._streamEnded(Xe,Ye)){Z.trigger(Events.BUFFER_EOS,{type:"audio"}),this.state=State.ENDED;return}const nt=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,PlaylistLevelType.MAIN),it=Xe.len,lt=this.getMaxBufferLength(nt==null?void 0:nt.len),ct=Ye.fragments,ot=ct[0].start;let dt=this.flushing?this.getLoadPosition():Xe.end;if(rt&&ae){const Yr=this.getLoadPosition();Je&&!mediaAttributesIdentical(rt.attrs,Je.attrs)&&(dt=Yr),Ye.PTSKnown&&Yrot||Xe.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),ae.currentTime=ot+.05)}if(it>=lt&&!rt&&dtnt.end+Ye.targetduration;if(mt||!(nt!=null&&nt.len)&&Xe.len){const Yr=this.getAppendedFrag(ft.start,PlaylistLevelType.MAIN);if(Yr===null||(gt||(gt=!!Yr.gap||!!mt&&nt.len===0),mt&&!gt||gt&&Xe.nextStart&&Xe.nextStartnew Level(ae))}onAudioTrackSwitching(Z,ee){const ae=!!ee.url;this.trackId=ee.id;const{fragCurrent:ye}=this;ye&&(ye.abortRequests(),this.removeUnbufferedFrags(ye.start)),this.resetLoadingState(),ae?this.setInterval(TICK_INTERVAL$2):this.resetTransmuxer(),ae?(this.switchingTrack=ee,this.state=State.IDLE,this.flushAudioIfNeeded(ee)):(this.switchingTrack=null,this.bufferedTrack=ee,this.state=State.STOPPED),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=this.flushing=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(Z,ee){this.mainDetails=ee.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(Events.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(Z,ee){var ae;if(this.mainDetails==null){this.cachedTrackLoadedData=ee;return}const{levels:ye}=this,{details:ve,id:be}=ee;if(!ye){this.warn(`Audio tracks were reset while loading level ${be}`);return}this.log(`Audio track ${be} loaded [${ve.startSN},${ve.endSN}]${ve.lastPartSn?`[part-${ve.lastPartSn}-${ve.lastPartIndex}]`:""},duration:${ve.totalduration}`);const Ye=ye[be];let Ke=0;if(ve.live||(ae=Ye.details)!=null&&ae.live){this.checkLiveUpdate(ve);const Je=this.mainDetails;if(ve.deltaUpdateFailed||!Je)return;if(!Ye.details&&ve.hasProgramDateTime&&Je.hasProgramDateTime)alignMediaPlaylistByPDT(ve,Je),Ke=ve.fragments[0].start;else{var Xe;Ke=this.alignPlaylists(ve,Ye.details,(Xe=this.levelLastLoaded)==null?void 0:Xe.details)}}Ye.details=ve,this.levelLastLoaded=Ye,!this.startFragRequested&&(this.mainDetails||!ve.live)&&this.setStartPosition(Ye.details,Ke),this.state===State.WAITING_TRACK&&!this.waitForCdnTuneIn(ve)&&(this.state=State.IDLE),this.tick()}_handleFragmentLoadProgress(Z){var ee;const{frag:ae,part:ye,payload:ve}=Z,{config:be,trackId:Ye,levels:Ke}=this;if(!Ke){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${ae.sn} of level ${ae.level} will not be buffered`);return}const Xe=Ke[Ye];if(!Xe){this.warn("Audio track is undefined on fragment load progress");return}const Je=Xe.details;if(!Je){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(ae.start);return}const rt=be.defaultAudioCodec||Xe.audioCodec||"mp4a.40.2";let nt=this.transmuxer;nt||(nt=this.transmuxer=new TransmuxerInterface(this.hls,PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const it=this.initPTS[ae.cc],lt=(ee=ae.initSegment)==null?void 0:ee.data;if(it!==void 0){const ct=ye?ye.index:-1,ot=ct!==-1,dt=new ChunkMetadata(ae.level,ae.sn,ae.stats.chunkCount,ve.byteLength,ct,ot);nt.push(ve,lt,rt,"",ae,ye,Je.totalduration,!1,dt,it)}else{this.log(`Unknown video PTS for cc ${ae.cc}, waiting for video PTS before demuxing audio frag ${ae.sn} of [${Je.startSN} ,${Je.endSN}],track ${Ye}`);const{cache:ct}=this.waitingData=this.waitingData||{frag:ae,part:ye,cache:new ChunkCache,complete:!1};ct.push(new Uint8Array(ve)),this.waitingVideoCC=this.videoTrackCC,this.state=State.WAITING_INIT_PTS}}_handleFragmentLoadComplete(Z){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(Z)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(Z,ee){const ae=ee.tracks.audio;ae&&(this.mediaBuffer=ae.buffer||null),ee.tracks.video&&(this.videoBuffer=ee.tracks.video.buffer||null)}onFragBuffered(Z,ee){const{frag:ae,part:ye}=ee;if(ae.type!==PlaylistLevelType.AUDIO){if(!this.loadedmetadata&&ae.type===PlaylistLevelType.MAIN){const ve=this.videoBuffer||this.media;ve&&BufferHelper.getBuffered(ve).length&&(this.loadedmetadata=!0)}return}if(this.fragContextChanged(ae)){this.warn(`Fragment ${ae.sn}${ye?" p: "+ye.index:""} of level ${ae.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(ae.sn!=="initSegment"){this.fragPrevious=ae;const ve=this.switchingTrack;ve&&(this.bufferedTrack=ve,this.switchingTrack=null,this.hls.trigger(Events.AUDIO_TRACK_SWITCHED,_objectSpread2({},ve)))}this.fragBufferedComplete(ae,ye)}onError(Z,ee){var ae;if(ee.fatal){this.state=State.ERROR;return}switch(ee.details){case ErrorDetails.FRAG_GAP:case ErrorDetails.FRAG_PARSING_ERROR:case ErrorDetails.FRAG_DECRYPT_ERROR:case ErrorDetails.FRAG_LOAD_ERROR:case ErrorDetails.FRAG_LOAD_TIMEOUT:case ErrorDetails.KEY_LOAD_ERROR:case ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(PlaylistLevelType.AUDIO,ee);break;case ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:case ErrorDetails.LEVEL_PARSING_ERROR:!ee.levelRetry&&this.state===State.WAITING_TRACK&&((ae=ee.context)==null?void 0:ae.type)===PlaylistContextType.AUDIO_TRACK&&(this.state=State.IDLE);break;case ErrorDetails.BUFFER_APPEND_ERROR:case ErrorDetails.BUFFER_FULL_ERROR:if(!ee.parent||ee.parent!=="audio")return;if(ee.details===ErrorDetails.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(ee)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case ErrorDetails.INTERNAL_EXCEPTION:this.recoverWorkerError(ee);break}}onBufferFlushing(Z,{type:ee}){ee!==ElementaryStreamTypes.VIDEO&&(this.flushing=!0)}onBufferFlushed(Z,{type:ee}){if(ee!==ElementaryStreamTypes.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===State.ENDED&&(this.state=State.IDLE);const ae=this.mediaBuffer||this.media;ae&&(this.afterBufferFlushed(ae,ee,PlaylistLevelType.AUDIO),this.tick())}}_handleTransmuxComplete(Z){var ee;const ae="audio",{hls:ye}=this,{remuxResult:ve,chunkMeta:be}=Z,Ye=this.getCurrentContext(be);if(!Ye){this.resetWhenMissingContext(be);return}const{frag:Ke,part:Xe,level:Je}=Ye,{details:rt}=Je,{audio:nt,text:it,id3:lt,initSegment:ct}=ve;if(this.fragContextChanged(Ke)||!rt){this.fragmentTracker.removeFragment(Ke);return}if(this.state=State.PARSING,this.switchingTrack&&nt&&this.completeAudioSwitch(this.switchingTrack),ct!=null&&ct.tracks){const ot=Ke.initSegment||Ke;this._bufferInitSegment(Je,ct.tracks,ot,be),ye.trigger(Events.FRAG_PARSING_INIT_SEGMENT,{frag:ot,id:ae,tracks:ct.tracks})}if(nt){const{startPTS:ot,endPTS:dt,startDTS:ft,endDTS:gt}=nt;Xe&&(Xe.elementaryStreams[ElementaryStreamTypes.AUDIO]={startPTS:ot,endPTS:dt,startDTS:ft,endDTS:gt}),Ke.setElementaryStreamInfo(ElementaryStreamTypes.AUDIO,ot,dt,ft,gt),this.bufferFragmentData(nt,Ke,Xe,be)}if(lt!=null&&(ee=lt.samples)!=null&&ee.length){const ot=_extends({id:ae,frag:Ke,details:rt},lt);ye.trigger(Events.FRAG_PARSING_METADATA,ot)}if(it){const ot=_extends({id:ae,frag:Ke,details:rt},it);ye.trigger(Events.FRAG_PARSING_USERDATA,ot)}}_bufferInitSegment(Z,ee,ae,ye){if(this.state!==State.PARSING)return;ee.video&&delete ee.video;const ve=ee.audio;if(!ve)return;ve.id="audio";const be=Z.audioCodec;this.log(`Init audio buffer, container:${ve.container}, codecs[level/parsed]=[${be}/${ve.codec}]`),be&&be.split(",").length===1&&(ve.levelCodec=be),this.hls.trigger(Events.BUFFER_CODECS,ee);const Ye=ve.initSegment;if(Ye!=null&&Ye.byteLength){const Ke={type:"audio",frag:ae,part:null,chunkMeta:ye,parent:ae.type,data:Ye};this.hls.trigger(Events.BUFFER_APPENDING,Ke)}this.tickImmediate()}loadFragment(Z,ee,ae){const ye=this.fragmentTracker.getState(Z);if(this.fragCurrent=Z,this.switchingTrack||ye===FragmentState.NOT_LOADED||ye===FragmentState.PARTIAL){var ve;if(Z.sn==="initSegment")this._loadInitSegment(Z,ee);else if((ve=ee.details)!=null&&ve.live&&!this.initPTS[Z.cc]){this.log(`Waiting for video PTS in continuity counter ${Z.cc} of live stream before loading audio fragment ${Z.sn} of level ${this.trackId}`),this.state=State.WAITING_INIT_PTS;const be=this.mainDetails;be&&be.fragments[0].start!==ee.details.fragments[0].start&&alignMediaPlaylistByPDT(ee.details,be)}else this.startFragRequested=!0,super.loadFragment(Z,ee,ae)}else this.clearTrackerIfNeeded(Z)}flushAudioIfNeeded(Z){const{media:ee,bufferedTrack:ae}=this,ye=ae==null?void 0:ae.attrs,ve=Z.attrs;ee&&ye&&(ye.CHANNELS!==ve.CHANNELS||ae.name!==Z.name||ae.lang!==Z.lang)&&(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null)}completeAudioSwitch(Z){const{hls:ee}=this;this.flushAudioIfNeeded(Z),this.bufferedTrack=Z,this.switchingTrack=null,ee.trigger(Events.AUDIO_TRACK_SWITCHED,_objectSpread2({},Z))}}class AudioTrackController extends BasePlaylistController{constructor(Z){super(Z,"[audio-track-controller]"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:Z}=this;Z.on(Events.MANIFEST_LOADING,this.onManifestLoading,this),Z.on(Events.MANIFEST_PARSED,this.onManifestParsed,this),Z.on(Events.LEVEL_LOADING,this.onLevelLoading,this),Z.on(Events.LEVEL_SWITCHING,this.onLevelSwitching,this),Z.on(Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),Z.on(Events.ERROR,this.onError,this)}unregisterListeners(){const{hls:Z}=this;Z.off(Events.MANIFEST_LOADING,this.onManifestLoading,this),Z.off(Events.MANIFEST_PARSED,this.onManifestParsed,this),Z.off(Events.LEVEL_LOADING,this.onLevelLoading,this),Z.off(Events.LEVEL_SWITCHING,this.onLevelSwitching,this),Z.off(Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),Z.off(Events.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(Z,ee){this.tracks=ee.audioTracks||[]}onAudioTrackLoaded(Z,ee){const{id:ae,groupId:ye,details:ve}=ee,be=this.tracksInGroup[ae];if(!be||be.groupId!==ye){this.warn(`Audio track with id:${ae} and group:${ye} not found in active group ${be==null?void 0:be.groupId}`);return}const Ye=be.details;be.details=ee.details,this.log(`Audio track ${ae} "${be.name}" lang:${be.lang} group:${ye} loaded [${ve.startSN}-${ve.endSN}]`),ae===this.trackId&&this.playlistLoaded(ae,ee,Ye)}onLevelLoading(Z,ee){this.switchLevel(ee.level)}onLevelSwitching(Z,ee){this.switchLevel(ee.level)}switchLevel(Z){const ee=this.hls.levels[Z];if(!ee)return;const ae=ee.audioGroups||null,ye=this.groupIds;let ve=this.currentTrack;if(!ae||(ye==null?void 0:ye.length)!==(ae==null?void 0:ae.length)||ae!=null&&ae.some(Ye=>(ye==null?void 0:ye.indexOf(Ye))===-1)){this.groupIds=ae,this.trackId=-1,this.currentTrack=null;const Ye=this.tracks.filter(nt=>!ae||ae.indexOf(nt.groupId)!==-1);if(Ye.length)this.selectDefaultTrack&&!Ye.some(nt=>nt.default)&&(this.selectDefaultTrack=!1),Ye.forEach((nt,it)=>{nt.id=it});else if(!ve&&!this.tracksInGroup.length)return;this.tracksInGroup=Ye;const Ke=this.hls.config.audioPreference;if(!ve&&Ke){const nt=findMatchingOption(Ke,Ye,audioMatchPredicate);if(nt>-1)ve=Ye[nt];else{const it=findMatchingOption(Ke,this.tracks);ve=this.tracks[it]}}let Xe=this.findTrackId(ve);Xe===-1&&ve&&(Xe=this.findTrackId(null));const Je={audioTracks:Ye};this.log(`Updating audio tracks, ${Ye.length} track(s) found in group(s): ${ae==null?void 0:ae.join(",")}`),this.hls.trigger(Events.AUDIO_TRACKS_UPDATED,Je);const rt=this.trackId;if(Xe!==-1&&rt===-1)this.setAudioTrack(Xe);else if(Ye.length&&rt===-1){var be;const nt=new Error(`No audio track selected for current audio group-ID(s): ${(be=this.groupIds)==null?void 0:be.join(",")} track count: ${Ye.length}`);this.warn(nt.message),this.hls.trigger(Events.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:nt})}}else this.shouldReloadPlaylist(ve)&&this.setAudioTrack(this.trackId)}onError(Z,ee){ee.fatal||!ee.context||ee.context.type===PlaylistContextType.AUDIO_TRACK&&ee.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(ee.context.groupId)!==-1)&&(this.requestScheduled=-1,this.checkRetry(ee))}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(Z){this.selectDefaultTrack=!1,this.setAudioTrack(Z)}setAudioOption(Z){const ee=this.hls;if(ee.config.audioPreference=Z,Z){const ae=this.allAudioTracks;if(this.selectDefaultTrack=!1,ae.length){const ye=this.currentTrack;if(ye&&matchesOption(Z,ye,audioMatchPredicate))return ye;const ve=findMatchingOption(Z,this.tracksInGroup,audioMatchPredicate);if(ve>-1){const be=this.tracksInGroup[ve];return this.setAudioTrack(ve),be}else if(ye){let be=ee.loadLevel;be===-1&&(be=ee.firstAutoLevel);const Ye=findClosestLevelWithAudioGroup(Z,ee.levels,ae,be,audioMatchPredicate);if(Ye===-1)return null;ee.nextLoadLevel=Ye}if(Z.channels||Z.audioCodec){const be=findMatchingOption(Z,ae);if(be>-1)return ae[be]}}}return null}setAudioTrack(Z){const ee=this.tracksInGroup;if(Z<0||Z>=ee.length){this.warn(`Invalid audio track id: ${Z}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const ae=this.currentTrack,ye=ee[Z],ve=ye.details&&!ye.details.live;if(Z===this.trackId&&ye===ae&&ve||(this.log(`Switching to audio-track ${Z} "${ye.name}" lang:${ye.lang} group:${ye.groupId} channels:${ye.channels}`),this.trackId=Z,this.currentTrack=ye,this.hls.trigger(Events.AUDIO_TRACK_SWITCHING,_objectSpread2({},ye)),ve))return;const be=this.switchParams(ye.url,ae==null?void 0:ae.details);this.loadPlaylist(be)}findTrackId(Z){const ee=this.tracksInGroup;for(let ae=0;ae=ve[Xe].start&&Ye<=ve[Xe].end){be=ve[Xe];break}const Ke=ae.start+ae.duration;be?be.end=Ke:(be={start:Ye,end:Ke},ve.push(be)),this.fragmentTracker.fragBuffered(ae),this.fragBufferedComplete(ae,null)}onBufferFlushing(Z,ee){const{startOffset:ae,endOffset:ye}=ee;if(ae===0&&ye!==Number.POSITIVE_INFINITY){const ve=ye-1;if(ve<=0)return;ee.endOffsetSubtitles=Math.max(0,ve),this.tracksBuffered.forEach(be=>{for(let Ye=0;Yenew Level(ae));return}this.tracksBuffered=[],this.levels=ee.map(ae=>{const ye=new Level(ae);return this.tracksBuffered[ye.id]=[],ye}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,PlaylistLevelType.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(Z,ee){var ae;if(this.currentTrackId=ee.id,!((ae=this.levels)!=null&&ae.length)||this.currentTrackId===-1){this.clearInterval();return}const ye=this.levels[this.currentTrackId];ye!=null&&ye.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,ye&&this.setInterval(TICK_INTERVAL$1)}onSubtitleTrackLoaded(Z,ee){var ae;const{currentTrackId:ye,levels:ve}=this,{details:be,id:Ye}=ee;if(!ve){this.warn(`Subtitle tracks were reset while loading level ${Ye}`);return}const Ke=ve[ye];if(Ye>=ve.length||Ye!==ye||!Ke)return;this.log(`Subtitle track ${Ye} loaded [${be.startSN},${be.endSN}]${be.lastPartSn?`[part-${be.lastPartSn}-${be.lastPartIndex}]`:""},duration:${be.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let Xe=0;if(be.live||(ae=Ke.details)!=null&&ae.live){const rt=this.mainDetails;if(be.deltaUpdateFailed||!rt)return;const nt=rt.fragments[0];if(!Ke.details)be.hasProgramDateTime&&rt.hasProgramDateTime?(alignMediaPlaylistByPDT(be,rt),Xe=be.fragments[0].start):nt&&(Xe=nt.start,addSliding(be,Xe));else{var Je;Xe=this.alignPlaylists(be,Ke.details,(Je=this.levelLastLoaded)==null?void 0:Je.details),Xe===0&&nt&&(Xe=nt.start,addSliding(be,Xe))}}Ke.details=be,this.levelLastLoaded=Ke,!this.startFragRequested&&(this.mainDetails||!be.live)&&this.setStartPosition(Ke.details,Xe),this.tick(),be.live&&!this.fragCurrent&&this.media&&this.state===State.IDLE&&(findFragmentByPTS(null,be.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),Ke.details=void 0))}_handleFragmentLoadComplete(Z){const{frag:ee,payload:ae}=Z,ye=ee.decryptdata,ve=this.hls;if(!this.fragContextChanged(ee)&&ae&&ae.byteLength>0&&ye!=null&&ye.key&&ye.iv&&ye.method==="AES-128"){const be=performance.now();this.decrypter.decrypt(new Uint8Array(ae),ye.key.buffer,ye.iv.buffer).catch(Ye=>{throw ve.trigger(Events.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.FRAG_DECRYPT_ERROR,fatal:!1,error:Ye,reason:Ye.message,frag:ee}),Ye}).then(Ye=>{const Ke=performance.now();ve.trigger(Events.FRAG_DECRYPTED,{frag:ee,payload:Ye,stats:{tstart:be,tdecrypt:Ke}})}).catch(Ye=>{this.warn(`${Ye.name}: ${Ye.message}`),this.state=State.IDLE})}}doTick(){if(!this.media){this.state=State.IDLE;return}if(this.state===State.IDLE){const{currentTrackId:Z,levels:ee}=this,ae=ee==null?void 0:ee[Z];if(!ae||!ee.length||!ae.details)return;const{config:ye}=this,ve=this.getLoadPosition(),be=BufferHelper.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],ve,ye.maxBufferHole),{end:Ye,len:Ke}=be,Xe=this.getFwdBufferInfo(this.media,PlaylistLevelType.MAIN),Je=ae.details,rt=this.getMaxBufferLength(Xe==null?void 0:Xe.len)+Je.levelTargetDuration;if(Ke>rt)return;const nt=Je.fragments,it=nt.length,lt=Je.edge;let ct=null;const ot=this.fragPrevious;if(Yelt-dt?0:dt;ct=findFragmentByPTS(ot,nt,Math.max(nt[0].start,Ye),ft),!ct&&ot&&ot.start{if(ye=ye>>>0,ye>ve-1)throw new DOMException(`Failed to execute '${ae}' on 'TimeRanges': The index provided (${ye}) is greater than the maximum bound (${ve})`);return Z[ye][ae]};this.buffered={get length(){return Z.length},end(ae){return ee("end",ae,Z.length)},start(ae){return ee("start",ae,Z.length)}}}}class SubtitleTrackController extends BasePlaylistController{constructor(Z){super(Z,"[subtitle-track-controller]"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let ee=null;const ae=filterSubtitleTracks(this.media.textTracks);for(let ve=0;ve-1&&this.toggleTrackModes()}registerListeners(){const{hls:Z}=this;Z.on(Events.MEDIA_ATTACHED,this.onMediaAttached,this),Z.on(Events.MEDIA_DETACHING,this.onMediaDetaching,this),Z.on(Events.MANIFEST_LOADING,this.onManifestLoading,this),Z.on(Events.MANIFEST_PARSED,this.onManifestParsed,this),Z.on(Events.LEVEL_LOADING,this.onLevelLoading,this),Z.on(Events.LEVEL_SWITCHING,this.onLevelSwitching,this),Z.on(Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),Z.on(Events.ERROR,this.onError,this)}unregisterListeners(){const{hls:Z}=this;Z.off(Events.MEDIA_ATTACHED,this.onMediaAttached,this),Z.off(Events.MEDIA_DETACHING,this.onMediaDetaching,this),Z.off(Events.MANIFEST_LOADING,this.onManifestLoading,this),Z.off(Events.MANIFEST_PARSED,this.onManifestParsed,this),Z.off(Events.LEVEL_LOADING,this.onLevelLoading,this),Z.off(Events.LEVEL_SWITCHING,this.onLevelSwitching,this),Z.off(Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),Z.off(Events.ERROR,this.onError,this)}onMediaAttached(Z,ee){this.media=ee.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(Z){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,Z)}onMediaDetaching(){this.media&&(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),filterSubtitleTracks(this.media.textTracks).forEach(Z=>{clearCurrentCues(Z)}),this.subtitleTrack=-1,this.media=null)}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(Z,ee){this.tracks=ee.subtitleTracks}onSubtitleTrackLoaded(Z,ee){const{id:ae,groupId:ye,details:ve}=ee,be=this.tracksInGroup[ae];if(!be||be.groupId!==ye){this.warn(`Subtitle track with id:${ae} and group:${ye} not found in active group ${be==null?void 0:be.groupId}`);return}const Ye=be.details;be.details=ee.details,this.log(`Subtitle track ${ae} "${be.name}" lang:${be.lang} group:${ye} loaded [${ve.startSN}-${ve.endSN}]`),ae===this.trackId&&this.playlistLoaded(ae,ee,Ye)}onLevelLoading(Z,ee){this.switchLevel(ee.level)}onLevelSwitching(Z,ee){this.switchLevel(ee.level)}switchLevel(Z){const ee=this.hls.levels[Z];if(!ee)return;const ae=ee.subtitleGroups||null,ye=this.groupIds;let ve=this.currentTrack;if(!ae||(ye==null?void 0:ye.length)!==(ae==null?void 0:ae.length)||ae!=null&&ae.some(be=>(ye==null?void 0:ye.indexOf(be))===-1)){this.groupIds=ae,this.trackId=-1,this.currentTrack=null;const be=this.tracks.filter(Je=>!ae||ae.indexOf(Je.groupId)!==-1);if(be.length)this.selectDefaultTrack&&!be.some(Je=>Je.default)&&(this.selectDefaultTrack=!1),be.forEach((Je,rt)=>{Je.id=rt});else if(!ve&&!this.tracksInGroup.length)return;this.tracksInGroup=be;const Ye=this.hls.config.subtitlePreference;if(!ve&&Ye){this.selectDefaultTrack=!1;const Je=findMatchingOption(Ye,be);if(Je>-1)ve=be[Je];else{const rt=findMatchingOption(Ye,this.tracks);ve=this.tracks[rt]}}let Ke=this.findTrackId(ve);Ke===-1&&ve&&(Ke=this.findTrackId(null));const Xe={subtitleTracks:be};this.log(`Updating subtitle tracks, ${be.length} track(s) found in "${ae==null?void 0:ae.join(",")}" group-id`),this.hls.trigger(Events.SUBTITLE_TRACKS_UPDATED,Xe),Ke!==-1&&this.trackId===-1&&this.setSubtitleTrack(Ke)}else this.shouldReloadPlaylist(ve)&&this.setSubtitleTrack(this.trackId)}findTrackId(Z){const ee=this.tracksInGroup,ae=this.selectDefaultTrack;for(let ye=0;ye-1){const ve=this.tracksInGroup[ye];return this.setSubtitleTrack(ye),ve}else{if(ae)return null;{const ve=findMatchingOption(Z,ee);if(ve>-1)return ee[ve]}}}}return null}loadPlaylist(Z){super.loadPlaylist();const ee=this.currentTrack;if(this.shouldLoadPlaylist(ee)&&ee){const ae=ee.id,ye=ee.groupId;let ve=ee.url;if(Z)try{ve=Z.addDirectives(ve)}catch(be){this.warn(`Could not construct new URL with HLS Delivery Directives: ${be}`)}this.log(`Loading subtitle playlist for id ${ae}`),this.hls.trigger(Events.SUBTITLE_TRACK_LOADING,{url:ve,id:ae,groupId:ye,deliveryDirectives:Z||null})}}toggleTrackModes(){const{media:Z}=this;if(!Z)return;const ee=filterSubtitleTracks(Z.textTracks),ae=this.currentTrack;let ye;if(ae&&(ye=ee.filter(ve=>subtitleTrackMatchesTextTrack(ae,ve))[0],ye||this.warn(`Unable to find subtitle TextTrack with name "${ae.name}" and language "${ae.lang}"`)),[].slice.call(ee).forEach(ve=>{ve.mode!=="disabled"&&ve!==ye&&(ve.mode="disabled")}),ye){const ve=this.subtitleDisplay?"showing":"hidden";ye.mode!==ve&&(ye.mode=ve)}}setSubtitleTrack(Z){const ee=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=Z;return}if(Z<-1||Z>=ee.length||!isFiniteNumber(Z)){this.warn(`Invalid subtitle track id: ${Z}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const ae=this.currentTrack,ye=ee[Z]||null;if(this.trackId=Z,this.currentTrack=ye,this.toggleTrackModes(),!ye){this.hls.trigger(Events.SUBTITLE_TRACK_SWITCH,{id:Z});return}const ve=!!ye.details&&!ye.details.live;if(Z===this.trackId&&ye===ae&&ve)return;this.log(`Switching to subtitle-track ${Z}`+(ye?` "${ye.name}" lang:${ye.lang} group:${ye.groupId}`:""));const{id:be,groupId:Ye="",name:Ke,type:Xe,url:Je}=ye;this.hls.trigger(Events.SUBTITLE_TRACK_SWITCH,{id:be,groupId:Ye,name:Ke,type:Xe,url:Je});const rt=this.switchParams(ye.url,ae==null?void 0:ae.details);this.loadPlaylist(rt)}}class BufferOperationQueue{constructor(Z){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=Z}append(Z,ee,ae){const ye=this.queues[ee];ye.push(Z),ye.length===1&&!ae&&this.executeNext(ee)}insertAbort(Z,ee){this.queues[ee].unshift(Z),this.executeNext(ee)}appendBlocker(Z){let ee;const ae=new Promise(ve=>{ee=ve}),ye={execute:ee,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(ye,Z),ae}executeNext(Z){const ee=this.queues[Z];if(ee.length){const ae=ee[0];try{ae.execute()}catch(ye){logger.warn(`[buffer-operation-queue]: Exception executing "${Z}" SourceBuffer operation: ${ye}`),ae.onError(ye);const ve=this.buffers[Z];ve!=null&&ve.updating||this.shiftAndExecuteNext(Z)}}}shiftAndExecuteNext(Z){this.queues[Z].shift(),this.executeNext(Z)}current(Z){return this.queues[Z][0]}}const VIDEO_CODEC_PROFILE_REPLACE=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/;class BufferController{constructor(Z){this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendSource=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this.log=void 0,this.warn=void 0,this.error=void 0,this._onEndStreaming=ae=>{this.hls&&this.hls.pauseBuffering()},this._onStartStreaming=ae=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=()=>{const{media:ae,mediaSource:ye}=this;this.log("Media source opened"),ae&&(ae.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(Events.MEDIA_ATTACHED,{media:ae,mediaSource:ye})),ye&&ye.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:ae,_objectUrl:ye}=this;ae!==ye&&logger.error(`Media element src was set while attaching MediaSource (${ye} > ${ae})`)},this.hls=Z;const ee="[buffer-controller]";this.appendSource=Z.config.preferManagedMediaSource,this.log=logger.log.bind(logger,ee),this.warn=logger.warn.bind(logger,ee),this.error=logger.error.bind(logger,ee),this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null,this.hls=null}registerListeners(){const{hls:Z}=this;Z.on(Events.MEDIA_ATTACHING,this.onMediaAttaching,this),Z.on(Events.MEDIA_DETACHING,this.onMediaDetaching,this),Z.on(Events.MANIFEST_LOADING,this.onManifestLoading,this),Z.on(Events.MANIFEST_PARSED,this.onManifestParsed,this),Z.on(Events.BUFFER_RESET,this.onBufferReset,this),Z.on(Events.BUFFER_APPENDING,this.onBufferAppending,this),Z.on(Events.BUFFER_CODECS,this.onBufferCodecs,this),Z.on(Events.BUFFER_EOS,this.onBufferEos,this),Z.on(Events.BUFFER_FLUSHING,this.onBufferFlushing,this),Z.on(Events.LEVEL_UPDATED,this.onLevelUpdated,this),Z.on(Events.FRAG_PARSED,this.onFragParsed,this),Z.on(Events.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:Z}=this;Z.off(Events.MEDIA_ATTACHING,this.onMediaAttaching,this),Z.off(Events.MEDIA_DETACHING,this.onMediaDetaching,this),Z.off(Events.MANIFEST_LOADING,this.onManifestLoading,this),Z.off(Events.MANIFEST_PARSED,this.onManifestParsed,this),Z.off(Events.BUFFER_RESET,this.onBufferReset,this),Z.off(Events.BUFFER_APPENDING,this.onBufferAppending,this),Z.off(Events.BUFFER_CODECS,this.onBufferCodecs,this),Z.off(Events.BUFFER_EOS,this.onBufferEos,this),Z.off(Events.BUFFER_FLUSHING,this.onBufferFlushing,this),Z.off(Events.LEVEL_UPDATED,this.onLevelUpdated,this),Z.off(Events.FRAG_PARSED,this.onFragParsed,this),Z.off(Events.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new BufferOperationQueue(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.appendErrors={audio:0,video:0,audiovideo:0},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(Z,ee){let ae=2;(ee.audio&&!ee.video||!ee.altAudio)&&(ae=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=ae,this.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`)}onMediaAttaching(Z,ee){const ae=this.media=ee.media,ye=getMediaSource(this.appendSource);if(ae&&ye){var ve;const be=this.mediaSource=new ye;this.log(`created media source: ${(ve=be.constructor)==null?void 0:ve.name}`),be.addEventListener("sourceopen",this._onMediaSourceOpen),be.addEventListener("sourceended",this._onMediaSourceEnded),be.addEventListener("sourceclose",this._onMediaSourceClose),be.addEventListener("startstreaming",this._onStartStreaming),be.addEventListener("endstreaming",this._onEndStreaming);const Ye=this._objectUrl=self.URL.createObjectURL(be);if(this.appendSource)try{ae.removeAttribute("src");const Ke=self.ManagedMediaSource;ae.disableRemotePlayback=ae.disableRemotePlayback||Ke&&be instanceof Ke,removeSourceChildren(ae),addSource(ae,Ye),ae.load()}catch{ae.src=Ye}else ae.src=Ye;ae.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:Z,mediaSource:ee,_objectUrl:ae}=this;if(ee){if(this.log("media source detaching"),ee.readyState==="open")try{ee.endOfStream()}catch(ye){this.warn(`onMediaDetaching: ${ye.message} while calling endOfStream`)}this.onBufferReset(),ee.removeEventListener("sourceopen",this._onMediaSourceOpen),ee.removeEventListener("sourceended",this._onMediaSourceEnded),ee.removeEventListener("sourceclose",this._onMediaSourceClose),ee.removeEventListener("startstreaming",this._onStartStreaming),ee.removeEventListener("endstreaming",this._onEndStreaming),Z&&(Z.removeEventListener("emptied",this._onMediaEmptied),ae&&self.URL.revokeObjectURL(ae),this.mediaSrc===ae?(Z.removeAttribute("src"),this.appendSource&&removeSourceChildren(Z),Z.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(Events.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach(Z=>{this.resetBuffer(Z)}),this._initSourceBuffer()}resetBuffer(Z){const ee=this.sourceBuffer[Z];try{if(ee){var ae;this.removeBufferListeners(Z),this.sourceBuffer[Z]=void 0,(ae=this.mediaSource)!=null&&ae.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(ee)}}catch(ye){this.warn(`onBufferReset ${Z}`,ye)}}onBufferCodecs(Z,ee){const ae=this.getSourceBufferTypes().length,ye=Object.keys(ee);if(ye.forEach(be=>{if(ae){const Ke=this.tracks[be];if(Ke&&typeof Ke.buffer.changeType=="function"){var Ye;const{id:Xe,codec:Je,levelCodec:rt,container:nt,metadata:it}=ee[be],lt=pickMostCompleteCodecName(Ke.codec,Ke.levelCodec),ct=lt==null?void 0:lt.replace(VIDEO_CODEC_PROFILE_REPLACE,"$1");let ot=pickMostCompleteCodecName(Je,rt);const dt=(Ye=ot)==null?void 0:Ye.replace(VIDEO_CODEC_PROFILE_REPLACE,"$1");if(ot&&ct!==dt){be.slice(0,5)==="audio"&&(ot=getCodecCompatibleName(ot,this.hls.config.preferManagedMediaSource));const ft=`${nt};codecs=${ot}`;this.appendChangeType(be,ft),this.log(`switching codec ${lt} to ${ot}`),this.tracks[be]={buffer:Ke.buffer,codec:Je,container:nt,levelCodec:rt,metadata:it,id:Xe}}}}else this.pendingTracks[be]=ee[be]}),ae)return;const ve=Math.max(this.bufferCodecEventsExpected-1,0);this.bufferCodecEventsExpected!==ve&&(this.log(`${ve} bufferCodec event(s) expected ${ye.join(",")}`),this.bufferCodecEventsExpected=ve),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()}appendChangeType(Z,ee){const{operationQueue:ae}=this,ye={execute:()=>{const ve=this.sourceBuffer[Z];ve&&(this.log(`changing ${Z} sourceBuffer type to ${ee}`),ve.changeType(ee)),ae.shiftAndExecuteNext(Z)},onStart:()=>{},onComplete:()=>{},onError:ve=>{this.warn(`Failed to change ${Z} SourceBuffer type`,ve)}};ae.append(ye,Z,!!this.pendingTracks[Z])}onBufferAppending(Z,ee){const{hls:ae,operationQueue:ye,tracks:ve}=this,{data:be,type:Ye,frag:Ke,part:Xe,chunkMeta:Je}=ee,rt=Je.buffering[Ye],nt=self.performance.now();rt.start=nt;const it=Ke.stats.buffering,lt=Xe?Xe.stats.buffering:null;it.start===0&&(it.start=nt),lt&<.start===0&&(lt.start=nt);const ct=ve.audio;let ot=!1;Ye==="audio"&&(ct==null?void 0:ct.container)==="audio/mpeg"&&(ot=!this.lastMpegAudioChunk||Je.id===1||this.lastMpegAudioChunk.sn!==Je.sn,this.lastMpegAudioChunk=Je);const dt=Ke.start,ft={execute:()=>{if(rt.executeStart=self.performance.now(),ot){const gt=this.sourceBuffer[Ye];if(gt){const mt=dt-gt.timestampOffset;Math.abs(mt)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${dt} (delta: ${mt}) sn: ${Ke.sn})`),gt.timestampOffset=dt)}}this.appendExecutor(be,Ye)},onStart:()=>{},onComplete:()=>{const gt=self.performance.now();rt.executeEnd=rt.end=gt,it.first===0&&(it.first=gt),lt&<.first===0&&(lt.first=gt);const{sourceBuffer:mt}=this,Yr={};for(const Qr in mt)Yr[Qr]=BufferHelper.getBuffered(mt[Qr]);this.appendErrors[Ye]=0,Ye==="audio"||Ye==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(Events.BUFFER_APPENDED,{type:Ye,frag:Ke,part:Xe,chunkMeta:Je,parent:Ke.type,timeRanges:Yr})},onError:gt=>{const mt={type:ErrorTypes.MEDIA_ERROR,parent:Ke.type,details:ErrorDetails.BUFFER_APPEND_ERROR,sourceBufferName:Ye,frag:Ke,part:Xe,chunkMeta:Je,error:gt,err:gt,fatal:!1};if(gt.code===DOMException.QUOTA_EXCEEDED_ERR)mt.details=ErrorDetails.BUFFER_FULL_ERROR;else{const Yr=++this.appendErrors[Ye];mt.details=ErrorDetails.BUFFER_APPEND_ERROR,this.warn(`Failed ${Yr}/${ae.config.appendErrorMaxRetry} times to append segment in "${Ye}" sourceBuffer`),Yr>=ae.config.appendErrorMaxRetry&&(mt.fatal=!0)}ae.trigger(Events.ERROR,mt)}};ye.append(ft,Ye,!!this.pendingTracks[Ye])}onBufferFlushing(Z,ee){const{operationQueue:ae}=this,ye=ve=>({execute:this.removeExecutor.bind(this,ve,ee.startOffset,ee.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(Events.BUFFER_FLUSHED,{type:ve})},onError:be=>{this.warn(`Failed to remove from ${ve} SourceBuffer`,be)}});ee.type?ae.append(ye(ee.type),ee.type):this.getSourceBufferTypes().forEach(ve=>{ae.append(ye(ve),ve)})}onFragParsed(Z,ee){const{frag:ae,part:ye}=ee,ve=[],be=ye?ye.elementaryStreams:ae.elementaryStreams;be[ElementaryStreamTypes.AUDIOVIDEO]?ve.push("audiovideo"):(be[ElementaryStreamTypes.AUDIO]&&ve.push("audio"),be[ElementaryStreamTypes.VIDEO]&&ve.push("video"));const Ye=()=>{const Ke=self.performance.now();ae.stats.buffering.end=Ke,ye&&(ye.stats.buffering.end=Ke);const Xe=ye?ye.stats:ae.stats;this.hls.trigger(Events.FRAG_BUFFERED,{frag:ae,part:ye,stats:Xe,id:ae.type})};ve.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${ae.type} level: ${ae.level} sn: ${ae.sn}`),this.blockBuffers(Ye,ve)}onFragChanged(Z,ee){this.trimBuffers()}onBufferEos(Z,ee){this.getSourceBufferTypes().reduce((ae,ye)=>{const ve=this.sourceBuffer[ye];return ve&&(!ee.type||ee.type===ye)&&(ve.ending=!0,ve.ended||(ve.ended=!0,this.log(`${ye} sourceBuffer now EOS`))),ae&&!!(!ve||ve.ended)},!0)&&(this.log("Queueing mediaSource.endOfStream()"),this.blockBuffers(()=>{this.getSourceBufferTypes().forEach(ye=>{const ve=this.sourceBuffer[ye];ve&&(ve.ending=!1)});const{mediaSource:ae}=this;if(!ae||ae.readyState!=="open"){ae&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${ae.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),ae.endOfStream()}))}onLevelUpdated(Z,{details:ee}){ee.fragments.length&&(this.details=ee,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}trimBuffers(){const{hls:Z,details:ee,media:ae}=this;if(!ae||ee===null||!this.getSourceBufferTypes().length)return;const ye=Z.config,ve=ae.currentTime,be=ee.levelTargetDuration,Ye=ee.live&&ye.liveBackBufferLength!==null?ye.liveBackBufferLength:ye.backBufferLength;if(isFiniteNumber(Ye)&&Ye>0){const Ke=Math.max(Ye,be),Xe=Math.floor(ve/be)*be-Ke;this.flushBackBuffer(ve,be,Xe)}if(isFiniteNumber(ye.frontBufferFlushThreshold)&&ye.frontBufferFlushThreshold>0){const Ke=Math.max(ye.maxBufferLength,ye.frontBufferFlushThreshold),Xe=Math.max(Ke,be),Je=Math.floor(ve/be)*be+Xe;this.flushFrontBuffer(ve,be,Je)}}flushBackBuffer(Z,ee,ae){const{details:ye,sourceBuffer:ve}=this;this.getSourceBufferTypes().forEach(be=>{const Ye=ve[be];if(Ye){const Ke=BufferHelper.getBuffered(Ye);if(Ke.length>0&&ae>Ke.start(0)){if(this.hls.trigger(Events.BACK_BUFFER_REACHED,{bufferEnd:ae}),ye!=null&&ye.live)this.hls.trigger(Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:ae});else if(Ye.ended&&Ke.end(Ke.length-1)-Z{const be=ye[ve];if(be){const Ye=BufferHelper.getBuffered(be),Ke=Ye.length;if(Ke<2)return;const Xe=Ye.start(Ke-1),Je=Ye.end(Ke-1);if(ae>Xe||Z>=Xe&&Z<=Je)return;if(be.ended&&Z-Je<2*ee){this.log(`Cannot flush ${ve} front buffer while SourceBuffer is in ended state`);return}this.hls.trigger(Events.BUFFER_FLUSHING,{startOffset:Xe,endOffset:1/0,type:ve})}})}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;const{details:Z,hls:ee,media:ae,mediaSource:ye}=this,ve=Z.fragments[0].start+Z.totalduration,be=ae.duration,Ye=isFiniteNumber(ye.duration)?ye.duration:0;Z.live&&ee.config.liveDurationInfinity?(ye.duration=1/0,this.updateSeekableRange(Z)):(ve>Ye&&ve>be||!isFiniteNumber(be))&&(this.log(`Updating Media Source duration to ${ve.toFixed(3)}`),ye.duration=ve)}updateSeekableRange(Z){const ee=this.mediaSource,ae=Z.fragments;if(ae.length&&Z.live&&ee!=null&&ee.setLiveSeekableRange){const ye=Math.max(0,ae[0].start),ve=Math.max(ye,ye+Z.totalduration);this.log(`Media Source duration is set to ${ee.duration}. Setting seekable range to ${ye}-${ve}.`),ee.setLiveSeekableRange(ye,ve)}}checkPendingTracks(){const{bufferCodecEventsExpected:Z,operationQueue:ee,pendingTracks:ae}=this,ye=Object.keys(ae).length;if(ye&&(!Z||ye===2||"audiovideo"in ae)){this.createSourceBuffers(ae),this.pendingTracks={};const ve=this.getSourceBufferTypes();if(ve.length)this.hls.trigger(Events.BUFFER_CREATED,{tracks:this.tracks}),ve.forEach(be=>{ee.executeNext(be)});else{const be=new Error("could not create source buffer for media codec(s)");this.hls.trigger(Events.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:be,reason:be.message})}}}createSourceBuffers(Z){const{sourceBuffer:ee,mediaSource:ae}=this;if(!ae)throw Error("createSourceBuffers called when mediaSource was null");for(const ye in Z)if(!ee[ye]){const ve=Z[ye];if(!ve)throw Error(`source buffer exists for track ${ye}, however track does not`);let be=ve.levelCodec||ve.codec;be&&ye.slice(0,5)==="audio"&&(be=getCodecCompatibleName(be,this.hls.config.preferManagedMediaSource));const Ye=`${ve.container};codecs=${be}`;this.log(`creating sourceBuffer(${Ye})`);try{const Ke=ee[ye]=ae.addSourceBuffer(Ye),Xe=ye;this.addBufferListener(Xe,"updatestart",this._onSBUpdateStart),this.addBufferListener(Xe,"updateend",this._onSBUpdateEnd),this.addBufferListener(Xe,"error",this._onSBUpdateError),this.addBufferListener(Xe,"bufferedchange",(Je,rt)=>{const nt=rt.removedRanges;nt!=null&&nt.length&&this.hls.trigger(Events.BUFFER_FLUSHED,{type:ye})}),this.tracks[ye]={buffer:Ke,codec:be,container:ve.container,levelCodec:ve.levelCodec,metadata:ve.metadata,id:ve.id}}catch(Ke){this.error(`error while trying to add sourceBuffer: ${Ke.message}`),this.hls.trigger(Events.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:Ke,sourceBufferName:ye,mimeType:Ye})}}}get mediaSrc(){var Z;const ee=((Z=this.media)==null?void 0:Z.firstChild)||this.media;return ee==null?void 0:ee.src}_onSBUpdateStart(Z){const{operationQueue:ee}=this;ee.current(Z).onStart()}_onSBUpdateEnd(Z){var ee;if(((ee=this.mediaSource)==null?void 0:ee.readyState)==="closed"){this.resetBuffer(Z);return}const{operationQueue:ae}=this;ae.current(Z).onComplete(),ae.shiftAndExecuteNext(Z)}_onSBUpdateError(Z,ee){var ae;const ye=new Error(`${Z} SourceBuffer error. MediaSource readyState: ${(ae=this.mediaSource)==null?void 0:ae.readyState}`);this.error(`${ye}`,ee),this.hls.trigger(Events.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.BUFFER_APPENDING_ERROR,sourceBufferName:Z,error:ye,fatal:!1});const ve=this.operationQueue.current(Z);ve&&ve.onError(ye)}removeExecutor(Z,ee,ae){const{media:ye,mediaSource:ve,operationQueue:be,sourceBuffer:Ye}=this,Ke=Ye[Z];if(!ye||!ve||!Ke){this.warn(`Attempting to remove from the ${Z} SourceBuffer, but it does not exist`),be.shiftAndExecuteNext(Z);return}const Xe=isFiniteNumber(ye.duration)?ye.duration:1/0,Je=isFiniteNumber(ve.duration)?ve.duration:1/0,rt=Math.max(0,ee),nt=Math.min(ae,Xe,Je);nt>rt&&(!Ke.ending||Ke.ended)?(Ke.ended=!1,this.log(`Removing [${rt},${nt}] from the ${Z} SourceBuffer`),Ke.remove(rt,nt)):be.shiftAndExecuteNext(Z)}appendExecutor(Z,ee){const ae=this.sourceBuffer[ee];if(!ae){if(!this.pendingTracks[ee])throw new Error(`Attempting to append to the ${ee} SourceBuffer, but it does not exist`);return}ae.ended=!1,ae.appendBuffer(Z)}blockBuffers(Z,ee=this.getSourceBufferTypes()){if(!ee.length){this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(Z);return}const{operationQueue:ae}=this,ye=ee.map(ve=>ae.appendBlocker(ve));Promise.all(ye).then(()=>{Z(),ee.forEach(ve=>{const be=this.sourceBuffer[ve];be!=null&&be.updating||ae.shiftAndExecuteNext(ve)})})}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(Z,ee,ae){const ye=this.sourceBuffer[Z];if(!ye)return;const ve=ae.bind(this,Z);this.listeners[Z].push({event:ee,listener:ve}),ye.addEventListener(ee,ve)}removeBufferListeners(Z){const ee=this.sourceBuffer[Z];ee&&this.listeners[Z].forEach(ae=>{ee.removeEventListener(ae.event,ae.listener)})}}function removeSourceChildren(ie){const Z=ie.querySelectorAll("source");[].slice.call(Z).forEach(ee=>{ie.removeChild(ee)})}function addSource(ie,Z){const ee=self.document.createElement("source");ee.type="video/mp4",ee.src=Z,ie.appendChild(ee)}const specialCea608CharsCodes={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},getCharForByte=function(ie){let Z=ie;return specialCea608CharsCodes.hasOwnProperty(ie)&&(Z=specialCea608CharsCodes[ie]),String.fromCharCode(Z)},NR_ROWS=15,NR_COLS=100,rowsLowCh1={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},rowsHighCh1={17:2,18:4,21:6,22:8,23:10,19:13,20:15},rowsLowCh2={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},rowsHighCh2={25:2,26:4,29:6,30:8,31:10,27:13,28:15},backgroundColors=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class CaptionsLogger{constructor(){this.time=null,this.verboseLevel=0}log(Z,ee){if(this.verboseLevel>=Z){const ae=typeof ee=="function"?ee():ee;logger.log(`${this.time} [${Z}] ${ae}`)}}}const numArrayToHexArray=function(ie){const Z=[];for(let ee=0;eeNR_COLS&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=NR_COLS)}moveCursor(Z){const ee=this.pos+Z;if(Z>1)for(let ae=this.pos+1;ae=144&&this.backSpace();const ee=getCharForByte(Z);if(this.pos>=NR_COLS){this.logger.log(0,()=>"Cannot insert "+Z.toString(16)+" ("+ee+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(ee,this.currPenState),this.moveCursor(1)}clearFromPos(Z){let ee;for(ee=Z;ee"pacData = "+JSON.stringify(Z));let ee=Z.row-1;if(this.nrRollUpRows&&ee"bkgData = "+JSON.stringify(Z)),this.backSpace(),this.setPen(Z),this.insertChar(32)}setRollUpRows(Z){this.nrRollUpRows=Z}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const Z=this.currRow+1-this.nrRollUpRows,ee=this.rows.splice(Z,1)[0];ee.clear(),this.rows.splice(this.currRow,0,ee),this.logger.log(2,"Rolling up")}getDisplayText(Z){Z=Z||!1;const ee=[];let ae="",ye=-1;for(let ve=0;ve0&&(Z?ae="["+ee.join(" | ")+"]":ae=ee.join(` +`)),ae}getTextAndFormat(){return this.rows}}class Cea608Channel{constructor(Z,ee,ae){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=Z,this.outputFilter=ee,this.mode=null,this.verbose=0,this.displayedMemory=new CaptionScreen(ae),this.nonDisplayedMemory=new CaptionScreen(ae),this.lastOutputScreen=new CaptionScreen(ae),this.currRollUpRow=this.displayedMemory.rows[NR_ROWS-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=ae}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[NR_ROWS-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(Z){this.outputFilter=Z}setPAC(Z){this.writeScreen.setPAC(Z)}setBkgData(Z){this.writeScreen.setBkgData(Z)}setMode(Z){Z!==this.mode&&(this.mode=Z,this.logger.log(2,()=>"MODE="+Z),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=Z)}insertChars(Z){for(let ae=0;aeee+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(Z){this.logger.log(2,"RU("+Z+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(Z)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const Z=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=Z,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(Z){this.logger.log(2,"TO("+Z+") - Tab Offset"),this.writeScreen.moveCursor(Z)}ccMIDROW(Z){const ee={flash:!1};if(ee.underline=Z%2===1,ee.italics=Z>=46,ee.italics)ee.foreground="white";else{const ae=Math.floor(Z/2)-16,ye=["white","green","blue","cyan","red","yellow","magenta"];ee.foreground=ye[ae]}this.logger.log(2,"MIDROW: "+JSON.stringify(ee)),this.writeScreen.setPen(ee)}outputDataUpdate(Z=!1){const ee=this.logger.time;ee!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=ee:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,ee,this.lastOutputScreen),Z&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:ee),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(Z){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,Z,this.displayedMemory),this.cueStartTime=Z))}}class Cea608Parser{constructor(Z,ee,ae){this.channels=void 0,this.currentChannel=0,this.cmdHistory=createCmdHistory(),this.logger=void 0;const ye=this.logger=new CaptionsLogger;this.channels=[null,new Cea608Channel(Z,ee,ye),new Cea608Channel(Z+1,ae,ye)]}getHandler(Z){return this.channels[Z].getHandler()}setHandler(Z,ee){this.channels[Z].setHandler(ee)}addData(Z,ee){let ae,ye,ve,be=!1;this.logger.time=Z;for(let Ye=0;Ye ("+numArrayToHexArray([ye,ve])+")"),ae=this.parseCmd(ye,ve),ae||(ae=this.parseMidrow(ye,ve)),ae||(ae=this.parsePAC(ye,ve)),ae||(ae=this.parseBackgroundAttributes(ye,ve)),!ae&&(be=this.parseChars(ye,ve),be)){const Ke=this.currentChannel;Ke&&Ke>0?this.channels[Ke].insertChars(be):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!ae&&!be&&this.logger.log(2,"Couldn't parse cleaned data "+numArrayToHexArray([ye,ve])+" orig: "+numArrayToHexArray([ee[Ye],ee[Ye+1]]))}}parseCmd(Z,ee){const{cmdHistory:ae}=this,ye=(Z===20||Z===28||Z===21||Z===29)&&ee>=32&&ee<=47,ve=(Z===23||Z===31)&&ee>=33&&ee<=35;if(!(ye||ve))return!1;if(hasCmdRepeated(Z,ee,ae))return setLastCmd(null,null,ae),this.logger.log(3,"Repeated command ("+numArrayToHexArray([Z,ee])+") is dropped"),!0;const be=Z===20||Z===21||Z===23?1:2,Ye=this.channels[be];return Z===20||Z===21||Z===28||Z===29?ee===32?Ye.ccRCL():ee===33?Ye.ccBS():ee===34?Ye.ccAOF():ee===35?Ye.ccAON():ee===36?Ye.ccDER():ee===37?Ye.ccRU(2):ee===38?Ye.ccRU(3):ee===39?Ye.ccRU(4):ee===40?Ye.ccFON():ee===41?Ye.ccRDC():ee===42?Ye.ccTR():ee===43?Ye.ccRTD():ee===44?Ye.ccEDM():ee===45?Ye.ccCR():ee===46?Ye.ccENM():ee===47&&Ye.ccEOC():Ye.ccTO(ee-32),setLastCmd(Z,ee,ae),this.currentChannel=be,!0}parseMidrow(Z,ee){let ae=0;if((Z===17||Z===25)&&ee>=32&&ee<=47){if(Z===17?ae=1:ae=2,ae!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const ye=this.channels[ae];return ye?(ye.ccMIDROW(ee),this.logger.log(3,"MIDROW ("+numArrayToHexArray([Z,ee])+")"),!0):!1}return!1}parsePAC(Z,ee){let ae;const ye=this.cmdHistory,ve=(Z>=17&&Z<=23||Z>=25&&Z<=31)&&ee>=64&&ee<=127,be=(Z===16||Z===24)&&ee>=64&&ee<=95;if(!(ve||be))return!1;if(hasCmdRepeated(Z,ee,ye))return setLastCmd(null,null,ye),!0;const Ye=Z<=23?1:2;ee>=64&&ee<=95?ae=Ye===1?rowsLowCh1[Z]:rowsLowCh2[Z]:ae=Ye===1?rowsHighCh1[Z]:rowsHighCh2[Z];const Ke=this.channels[Ye];return Ke?(Ke.setPAC(this.interpretPAC(ae,ee)),setLastCmd(Z,ee,ye),this.currentChannel=Ye,!0):!1}interpretPAC(Z,ee){let ae;const ye={color:null,italics:!1,indent:null,underline:!1,row:Z};return ee>95?ae=ee-96:ae=ee-64,ye.underline=(ae&1)===1,ae<=13?ye.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(ae/2)]:ae<=15?(ye.italics=!0,ye.color="white"):ye.indent=Math.floor((ae-16)/2)*4,ye}parseChars(Z,ee){let ae,ye=null,ve=null;if(Z>=25?(ae=2,ve=Z-8):(ae=1,ve=Z),ve>=17&&ve<=19){let be;ve===17?be=ee+80:ve===18?be=ee+112:be=ee+144,this.logger.log(2,"Special char '"+getCharForByte(be)+"' in channel "+ae),ye=[be]}else Z>=32&&Z<=127&&(ye=ee===0?[Z]:[Z,ee]);if(ye){const be=numArrayToHexArray(ye);this.logger.log(3,"Char codes = "+be.join(",")),setLastCmd(Z,ee,this.cmdHistory)}return ye}parseBackgroundAttributes(Z,ee){const ae=(Z===16||Z===24)&&ee>=32&&ee<=47,ye=(Z===23||Z===31)&&ee>=45&&ee<=47;if(!(ae||ye))return!1;let ve;const be={};Z===16||Z===24?(ve=Math.floor((ee-32)/2),be.background=backgroundColors[ve],ee%2===1&&(be.background=be.background+"_semi")):ee===45?be.background="transparent":(be.foreground="black",ee===47&&(be.underline=!0));const Ye=Z<=23?1:2;return this.channels[Ye].setBkgData(be),setLastCmd(Z,ee,this.cmdHistory),!0}reset(){for(let Z=0;ZZ)&&(this.startTime=Z),this.endTime=ee,this.screen=ae,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var VTTCue=function(){if(optionalSelf!=null&&optionalSelf.VTTCue)return self.VTTCue;const ie=["","lr","rl"],Z=["start","middle","end","left","right"];function ee(Ye,Ke){if(typeof Ke!="string"||!Array.isArray(Ye))return!1;const Xe=Ke.toLowerCase();return~Ye.indexOf(Xe)?Xe:!1}function ae(Ye){return ee(ie,Ye)}function ye(Ye){return ee(Z,Ye)}function ve(Ye,...Ke){let Xe=1;for(;Xe100)throw new Error("Position must be between 0 and 100.");Qr=oi,this.hasBeenReset=!0}})),Object.defineProperty(Je,"positionAlign",ve({},rt,{get:function(){return Xr},set:function(oi){const ni=ye(oi);if(!ni)throw new SyntaxError("An invalid or illegal string was specified.");Xr=ni,this.hasBeenReset=!0}})),Object.defineProperty(Je,"size",ve({},rt,{get:function(){return Jr},set:function(oi){if(oi<0||oi>100)throw new Error("Size must be between 0 and 100.");Jr=oi,this.hasBeenReset=!0}})),Object.defineProperty(Je,"align",ve({},rt,{get:function(){return ai},set:function(oi){const ni=ye(oi);if(!ni)throw new SyntaxError("An invalid or illegal string was specified.");ai=ni,this.hasBeenReset=!0}})),Je.displayState=void 0}return be.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},be}();class StringDecoder{decode(Z,ee){if(!Z)return"";if(typeof Z!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(Z))}}function parseTimeStamp(ie){function Z(ae,ye,ve,be){return(ae|0)*3600+(ye|0)*60+(ve|0)+parseFloat(be||0)}const ee=ie.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return ee?parseFloat(ee[2])>59?Z(ee[2],ee[3],0,ee[4]):Z(ee[1],ee[2],ee[3],ee[4]):null}class Settings{constructor(){this.values=Object.create(null)}set(Z,ee){!this.get(Z)&&ee!==""&&(this.values[Z]=ee)}get(Z,ee,ae){return ae?this.has(Z)?this.values[Z]:ee[ae]:this.has(Z)?this.values[Z]:ee}has(Z){return Z in this.values}alt(Z,ee,ae){for(let ye=0;ye=0&&ae<=100)return this.set(Z,ae),!0}return!1}}function parseOptions(ie,Z,ee,ae){const ye=ae?ie.split(ae):[ie];for(const ve in ye){if(typeof ye[ve]!="string")continue;const be=ye[ve].split(ee);if(be.length!==2)continue;const Ye=be[0],Ke=be[1];Z(Ye,Ke)}}const defaults=new VTTCue(0,0,""),center=defaults.align==="middle"?"middle":"center";function parseCue$1(ie,Z,ee){const ae=ie;function ye(){const Ye=parseTimeStamp(ie);if(Ye===null)throw new Error("Malformed timestamp: "+ae);return ie=ie.replace(/^[^\sa-zA-Z-]+/,""),Ye}function ve(Ye,Ke){const Xe=new Settings;parseOptions(Ye,function(nt,it){let lt;switch(nt){case"region":for(let ct=ee.length-1;ct>=0;ct--)if(ee[ct].id===it){Xe.set(nt,ee[ct].region);break}break;case"vertical":Xe.alt(nt,it,["rl","lr"]);break;case"line":lt=it.split(","),Xe.integer(nt,lt[0]),Xe.percent(nt,lt[0])&&Xe.set("snapToLines",!1),Xe.alt(nt,lt[0],["auto"]),lt.length===2&&Xe.alt("lineAlign",lt[1],["start",center,"end"]);break;case"position":lt=it.split(","),Xe.percent(nt,lt[0]),lt.length===2&&Xe.alt("positionAlign",lt[1],["start",center,"end","line-left","line-right","auto"]);break;case"size":Xe.percent(nt,it);break;case"align":Xe.alt(nt,it,["start",center,"end","left","right"]);break}},/:/,/\s/),Ke.region=Xe.get("region",null),Ke.vertical=Xe.get("vertical","");let Je=Xe.get("line","auto");Je==="auto"&&defaults.line===-1&&(Je=-1),Ke.line=Je,Ke.lineAlign=Xe.get("lineAlign","start"),Ke.snapToLines=Xe.get("snapToLines",!0),Ke.size=Xe.get("size",100),Ke.align=Xe.get("align",center);let rt=Xe.get("position","auto");rt==="auto"&&defaults.position===50&&(rt=Ke.align==="start"||Ke.align==="left"?0:Ke.align==="end"||Ke.align==="right"?100:50),Ke.position=rt}function be(){ie=ie.replace(/^\s+/,"")}if(be(),Z.startTime=ye(),be(),ie.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+ae);ie=ie.slice(3),be(),Z.endTime=ye(),be(),ve(ie,Z)}function fixLineBreaks(ie){return ie.replace(//gi,` +`)}class VTTParser{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new StringDecoder,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(Z){const ee=this;Z&&(ee.buffer+=ee.decoder.decode(Z,{stream:!0}));function ae(){let ve=ee.buffer,be=0;for(ve=fixLineBreaks(ve);be")===-1){ee.cue.id=ve;continue}case"CUE":if(!ee.cue){ee.state="BADCUE";continue}try{parseCue$1(ve,ee.cue,ee.regionList)}catch{ee.cue=null,ee.state="BADCUE";continue}ee.state="CUETEXT";continue;case"CUETEXT":{const Ye=ve.indexOf("-->")!==-1;if(!ve||Ye&&(be=!0)){ee.oncue&&ee.cue&&ee.oncue(ee.cue),ee.cue=null,ee.state="ID";continue}if(ee.cue===null)continue;ee.cue.text&&(ee.cue.text+=` +`),ee.cue.text+=ve}continue;case"BADCUE":ve||(ee.state="ID")}}}catch{ee.state==="CUETEXT"&&ee.cue&&ee.oncue&&ee.oncue(ee.cue),ee.cue=null,ee.state=ee.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const Z=this;try{if((Z.cue||Z.state==="HEADER")&&(Z.buffer+=` + +`,Z.parse()),Z.state==="INITIAL"||Z.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(ee){Z.onparsingerror&&Z.onparsingerror(ee)}return Z.onflush&&Z.onflush(),this}}const LINEBREAKS=/\r\n|\n\r|\n|\r/g,startsWith=function(ie,Z,ee=0){return ie.slice(ee,ee+Z.length)===Z},cueString2millis=function(ie){let Z=parseInt(ie.slice(-3));const ee=parseInt(ie.slice(-6,-4)),ae=parseInt(ie.slice(-9,-7)),ye=ie.length>9?parseInt(ie.substring(0,ie.indexOf(":"))):0;if(!isFiniteNumber(Z)||!isFiniteNumber(ee)||!isFiniteNumber(ae)||!isFiniteNumber(ye))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${ie}`);return Z+=1e3*ee,Z+=60*1e3*ae,Z+=60*60*1e3*ye,Z},hash=function(ie){let Z=5381,ee=ie.length;for(;ee;)Z=Z*33^ie.charCodeAt(--ee);return(Z>>>0).toString()};function generateCueId(ie,Z,ee){return hash(ie.toString())+hash(Z.toString())+hash(ee)}const calculateOffset=function(ie,Z,ee){let ae=ie[Z],ye=ie[ae.prevCC];if(!ye||!ye.new&&ae.new){ie.ccOffset=ie.presentationOffset=ae.start,ae.new=!1;return}for(;(ve=ye)!=null&&ve.new;){var ve;ie.ccOffset+=ae.start-ye.start,ae.new=!1,ae=ye,ye=ie[ae.prevCC]}ie.presentationOffset=ee};function parseWebVTT(ie,Z,ee,ae,ye,ve,be){const Ye=new VTTParser,Ke=utf8ArrayToStr(new Uint8Array(ie)).trim().replace(LINEBREAKS,` +`).split(` +`),Xe=[],Je=Z?toMpegTsClockFromTimescale(Z.baseTime,Z.timescale):0;let rt="00:00.000",nt=0,it=0,lt,ct=!0;Ye.oncue=function(ot){const dt=ee[ae];let ft=ee.ccOffset;const gt=(nt-Je)/9e4;if(dt!=null&&dt.new&&(it!==void 0?ft=ee.ccOffset=dt.start:calculateOffset(ee,ae,gt)),gt){if(!Z){lt=new Error("Missing initPTS for VTT MPEGTS");return}ft=gt-ee.presentationOffset}const mt=ot.endTime-ot.startTime,Yr=normalizePts((ot.startTime+ft-it)*9e4,ye*9e4)/9e4;ot.startTime=Math.max(Yr,0),ot.endTime=Math.max(Yr+mt,0);const Qr=ot.text.trim();ot.text=decodeURIComponent(encodeURIComponent(Qr)),ot.id||(ot.id=generateCueId(ot.startTime,ot.endTime,Qr)),ot.endTime>0&&Xe.push(ot)},Ye.onparsingerror=function(ot){lt=ot},Ye.onflush=function(){if(lt){be(lt);return}ve(Xe)},Ke.forEach(ot=>{if(ct)if(startsWith(ot,"X-TIMESTAMP-MAP=")){ct=!1,ot.slice(16).split(",").forEach(dt=>{startsWith(dt,"LOCAL:")?rt=dt.slice(6):startsWith(dt,"MPEGTS:")&&(nt=parseInt(dt.slice(7)))});try{it=cueString2millis(rt)/1e3}catch(dt){lt=dt}return}else ot===""&&(ct=!1);Ye.parse(ot+` +`)}),Ye.flush()}const IMSC1_CODEC="stpp.ttml.im1t",HMSF_REGEX=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,TIME_UNIT_REGEX=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,textAlignToLineAlign={left:"start",center:"center",right:"end",start:"start",end:"end"};function parseIMSC1(ie,Z,ee,ae){const ye=findBox(new Uint8Array(ie),["mdat"]);if(ye.length===0){ae(new Error("Could not parse IMSC1 mdat"));return}const ve=ye.map(Ye=>utf8ArrayToStr(Ye)),be=toTimescaleFromScale(Z.baseTime,1,Z.timescale);try{ve.forEach(Ye=>ee(parseTTML(Ye,be)))}catch(Ye){ae(Ye)}}function parseTTML(ie,Z){const ee=new DOMParser().parseFromString(ie,"text/xml").getElementsByTagName("tt")[0];if(!ee)throw new Error("Invalid ttml");const ae={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},ye=Object.keys(ae).reduce((Xe,Je)=>(Xe[Je]=ee.getAttribute(`ttp:${Je}`)||ae[Je],Xe),{}),ve=ee.getAttribute("xml:space")!=="preserve",be=collectionToDictionary(getElementCollection(ee,"styling","style")),Ye=collectionToDictionary(getElementCollection(ee,"layout","region")),Ke=getElementCollection(ee,"body","[begin]");return[].map.call(Ke,Xe=>{const Je=getTextContent(Xe,ve);if(!Je||!Xe.hasAttribute("begin"))return null;const rt=parseTtmlTime(Xe.getAttribute("begin"),ye),nt=parseTtmlTime(Xe.getAttribute("dur"),ye);let it=parseTtmlTime(Xe.getAttribute("end"),ye);if(rt===null)throw timestampParsingError(Xe);if(it===null){if(nt===null)throw timestampParsingError(Xe);it=rt+nt}const lt=new VTTCue(rt-Z,it-Z,Je);lt.id=generateCueId(lt.startTime,lt.endTime,lt.text);const ct=Ye[Xe.getAttribute("region")],ot=be[Xe.getAttribute("style")],dt=getTtmlStyles(ct,ot,be),{textAlign:ft}=dt;if(ft){const gt=textAlignToLineAlign[ft];gt&&(lt.lineAlign=gt),lt.align=ft}return _extends(lt,dt),lt}).filter(Xe=>Xe!==null)}function getElementCollection(ie,Z,ee){const ae=ie.getElementsByTagName(Z)[0];return ae?[].slice.call(ae.querySelectorAll(ee)):[]}function collectionToDictionary(ie){return ie.reduce((Z,ee)=>{const ae=ee.getAttribute("xml:id");return ae&&(Z[ae]=ee),Z},{})}function getTextContent(ie,Z){return[].slice.call(ie.childNodes).reduce((ee,ae,ye)=>{var ve;return ae.nodeName==="br"&&ye?ee+` +`:(ve=ae.childNodes)!=null&&ve.length?getTextContent(ae,Z):Z?ee+ae.textContent.trim().replace(/\s+/g," "):ee+ae.textContent},"")}function getTtmlStyles(ie,Z,ee){const ae="http://www.w3.org/ns/ttml#styling";let ye=null;const ve=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],be=ie!=null&&ie.hasAttribute("style")?ie.getAttribute("style"):null;return be&&ee.hasOwnProperty(be)&&(ye=ee[be]),ve.reduce((Ye,Ke)=>{const Xe=getAttributeNS(Z,ae,Ke)||getAttributeNS(ie,ae,Ke)||getAttributeNS(ye,ae,Ke);return Xe&&(Ye[Ke]=Xe),Ye},{})}function getAttributeNS(ie,Z,ee){return ie&&ie.hasAttributeNS(Z,ee)?ie.getAttributeNS(Z,ee):null}function timestampParsingError(ie){return new Error(`Could not parse ttml timestamp ${ie}`)}function parseTtmlTime(ie,Z){if(!ie)return null;let ee=parseTimeStamp(ie);return ee===null&&(HMSF_REGEX.test(ie)?ee=parseHoursMinutesSecondsFrames(ie,Z):TIME_UNIT_REGEX.test(ie)&&(ee=parseTimeUnits(ie,Z))),ee}function parseHoursMinutesSecondsFrames(ie,Z){const ee=HMSF_REGEX.exec(ie),ae=(ee[4]|0)+(ee[5]|0)/Z.subFrameRate;return(ee[1]|0)*3600+(ee[2]|0)*60+(ee[3]|0)+ae/Z.frameRate}function parseTimeUnits(ie,Z){const ee=TIME_UNIT_REGEX.exec(ie),ae=Number(ee[1]);switch(ee[2]){case"h":return ae*3600;case"m":return ae*60;case"ms":return ae*1e3;case"f":return ae/Z.frameRate;case"t":return ae/Z.tickRate}return ae}class TimelineController{constructor(Z){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=newVTTCCs(),this.captionsProperties=void 0,this.hls=Z,this.config=Z.config,this.Cues=Z.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},Z.on(Events.MEDIA_ATTACHING,this.onMediaAttaching,this),Z.on(Events.MEDIA_DETACHING,this.onMediaDetaching,this),Z.on(Events.MANIFEST_LOADING,this.onManifestLoading,this),Z.on(Events.MANIFEST_LOADED,this.onManifestLoaded,this),Z.on(Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),Z.on(Events.FRAG_LOADING,this.onFragLoading,this),Z.on(Events.FRAG_LOADED,this.onFragLoaded,this),Z.on(Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),Z.on(Events.FRAG_DECRYPTED,this.onFragDecrypted,this),Z.on(Events.INIT_PTS_FOUND,this.onInitPtsFound,this),Z.on(Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),Z.on(Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:Z}=this;Z.off(Events.MEDIA_ATTACHING,this.onMediaAttaching,this),Z.off(Events.MEDIA_DETACHING,this.onMediaDetaching,this),Z.off(Events.MANIFEST_LOADING,this.onManifestLoading,this),Z.off(Events.MANIFEST_LOADED,this.onManifestLoaded,this),Z.off(Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),Z.off(Events.FRAG_LOADING,this.onFragLoading,this),Z.off(Events.FRAG_LOADED,this.onFragLoaded,this),Z.off(Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),Z.off(Events.FRAG_DECRYPTED,this.onFragDecrypted,this),Z.off(Events.INIT_PTS_FOUND,this.onInitPtsFound,this),Z.off(Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),Z.off(Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){if(this.config.enableCEA708Captions&&(!this.cea608Parser1||!this.cea608Parser2)){const Z=new OutputFilter(this,"textTrack1"),ee=new OutputFilter(this,"textTrack2"),ae=new OutputFilter(this,"textTrack3"),ye=new OutputFilter(this,"textTrack4");this.cea608Parser1=new Cea608Parser(1,Z,ee),this.cea608Parser2=new Cea608Parser(3,ae,ye)}}addCues(Z,ee,ae,ye,ve){let be=!1;for(let Ye=ve.length;Ye--;){const Ke=ve[Ye],Xe=intersection(Ke[0],Ke[1],ee,ae);if(Xe>=0&&(Ke[0]=Math.min(Ke[0],ee),Ke[1]=Math.max(Ke[1],ae),be=!0,Xe/(ae-ee)>.5))return}if(be||ve.push([ee,ae]),this.config.renderTextTracksNatively){const Ye=this.captionsTracks[Z];this.Cues.newCue(Ye,ee,ae,ye)}else{const Ye=this.Cues.newCue(null,ee,ae,ye);this.hls.trigger(Events.CUES_PARSED,{type:"captions",cues:Ye,track:Z})}}onInitPtsFound(Z,{frag:ee,id:ae,initPTS:ye,timescale:ve}){const{unparsedVttFrags:be}=this;ae==="main"&&(this.initPTS[ee.cc]={baseTime:ye,timescale:ve}),be.length&&(this.unparsedVttFrags=[],be.forEach(Ye=>{this.onFragLoaded(Events.FRAG_LOADED,Ye)}))}getExistingTrack(Z,ee){const{media:ae}=this;if(ae)for(let ye=0;ye{clearCurrentCues(Z[ee]),delete Z[ee]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=newVTTCCs(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:Z}=this;if(!Z)return;const ee=Z.textTracks;if(ee)for(let ae=0;aeve.textCodec===IMSC1_CODEC);if(this.config.enableWebVTT||ye&&this.config.enableIMSC1){if(subtitleOptionsIdentical(this.tracks,ae)){this.tracks=ae;return}if(this.textTracks=[],this.tracks=ae,this.config.renderTextTracksNatively){const ve=this.media,be=ve?filterSubtitleTracks(ve.textTracks):null;if(this.tracks.forEach((Ye,Ke)=>{let Xe;if(be){let Je=null;for(let rt=0;rtKe!==null).map(Ke=>Ke.label);Ye.length&&logger.warn(`Media element contains unused subtitle tracks: ${Ye.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const ve=this.tracks.map(be=>({label:be.name,kind:be.type.toLowerCase(),default:be.default,subtitleTrack:be}));this.hls.trigger(Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:ve})}}}onManifestLoaded(Z,ee){this.config.enableCEA708Captions&&ee.captions&&ee.captions.forEach(ae=>{const ye=/(?:CC|SERVICE)([1-4])/.exec(ae.instreamId);if(!ye)return;const ve=`textTrack${ye[1]}`,be=this.captionsProperties[ve];be&&(be.label=ae.name,ae.lang&&(be.languageCode=ae.lang),be.media=ae)})}closedCaptionsForLevel(Z){const ee=this.hls.levels[Z.level];return ee==null?void 0:ee.attrs["CLOSED-CAPTIONS"]}onFragLoading(Z,ee){this.initCea608Parsers();const{cea608Parser1:ae,cea608Parser2:ye,lastCc:ve,lastSn:be,lastPartIndex:Ye}=this;if(!(!this.enabled||!ae||!ye)&&ee.frag.type===PlaylistLevelType.MAIN){var Ke,Xe;const{cc:Je,sn:rt}=ee.frag,nt=(Ke=ee==null||(Xe=ee.part)==null?void 0:Xe.index)!=null?Ke:-1;rt===be+1||rt===be&&nt===Ye+1||Je===ve||(ae.reset(),ye.reset()),this.lastCc=Je,this.lastSn=rt,this.lastPartIndex=nt}}onFragLoaded(Z,ee){const{frag:ae,payload:ye}=ee;if(ae.type===PlaylistLevelType.SUBTITLE)if(ye.byteLength){const ve=ae.decryptdata,be="stats"in ee;if(ve==null||!ve.encrypted||be){const Ye=this.tracks[ae.level],Ke=this.vttCCs;Ke[ae.cc]||(Ke[ae.cc]={start:ae.start,prevCC:this.prevCC,new:!0},this.prevCC=ae.cc),Ye&&Ye.textCodec===IMSC1_CODEC?this._parseIMSC1(ae,ye):this._parseVTTs(ee)}}else this.hls.trigger(Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:ae,error:new Error("Empty subtitle payload")})}_parseIMSC1(Z,ee){const ae=this.hls;parseIMSC1(ee,this.initPTS[Z.cc],ye=>{this._appendCues(ye,Z.level),ae.trigger(Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:Z})},ye=>{logger.log(`Failed to parse IMSC1: ${ye}`),ae.trigger(Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:Z,error:ye})})}_parseVTTs(Z){var ee;const{frag:ae,payload:ye}=Z,{initPTS:ve,unparsedVttFrags:be}=this,Ye=ve.length-1;if(!ve[ae.cc]&&Ye===-1){be.push(Z);return}const Ke=this.hls,Xe=(ee=ae.initSegment)!=null&&ee.data?appendUint8Array(ae.initSegment.data,new Uint8Array(ye)):ye;parseWebVTT(Xe,this.initPTS[ae.cc],this.vttCCs,ae.cc,ae.start,Je=>{this._appendCues(Je,ae.level),Ke.trigger(Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:ae})},Je=>{const rt=Je.message==="Missing initPTS for VTT MPEGTS";rt?be.push(Z):this._fallbackToIMSC1(ae,ye),logger.log(`Failed to parse VTT cue: ${Je}`),!(rt&&Ye>ae.cc)&&Ke.trigger(Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:ae,error:Je})})}_fallbackToIMSC1(Z,ee){const ae=this.tracks[Z.level];ae.textCodec||parseIMSC1(ee,this.initPTS[Z.cc],()=>{ae.textCodec=IMSC1_CODEC,this._parseIMSC1(Z,ee)},()=>{ae.textCodec="wvtt"})}_appendCues(Z,ee){const ae=this.hls;if(this.config.renderTextTracksNatively){const ye=this.textTracks[ee];if(!ye||ye.mode==="disabled")return;Z.forEach(ve=>addCueToTrack(ye,ve))}else{const ye=this.tracks[ee];if(!ye)return;const ve=ye.default?"default":"subtitles"+ee;ae.trigger(Events.CUES_PARSED,{type:"subtitles",cues:Z,track:ve})}}onFragDecrypted(Z,ee){const{frag:ae}=ee;ae.type===PlaylistLevelType.SUBTITLE&&this.onFragLoaded(Events.FRAG_LOADED,ee)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(Z,ee){this.initCea608Parsers();const{cea608Parser1:ae,cea608Parser2:ye}=this;if(!this.enabled||!ae||!ye)return;const{frag:ve,samples:be}=ee;if(!(ve.type===PlaylistLevelType.MAIN&&this.closedCaptionsForLevel(ve)==="NONE"))for(let Ye=0;YeremoveCuesInRange(Ye[Ke],ee,ae))}if(this.config.renderTextTracksNatively&&ee===0&&ye!==void 0){const{textTracks:Ye}=this;Object.keys(Ye).forEach(Ke=>removeCuesInRange(Ye[Ke],ee,ye))}}}extractCea608Data(Z){const ee=[[],[]],ae=Z[0]&31;let ye=2;for(let ve=0;vethis.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=ee.autoLevelCapping}}}getMaxLevel(Z){const ee=this.hls.levels;if(!ee.length)return-1;const ae=ee.filter((ye,ve)=>this.isLevelAllowed(ye)&&ve<=Z);return this.clientRect=null,CapLevelController.getMaxLevelByMediaSize(ae,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const Z=this.media,ee={width:0,height:0};if(Z){const ae=Z.getBoundingClientRect();ee.width=ae.width,ee.height=ae.height,!ee.width&&!ee.height&&(ee.width=ae.right-ae.left||Z.width||0,ee.height=ae.bottom-ae.top||Z.height||0)}return this.clientRect=ee,ee}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let Z=1;if(!this.hls.config.ignoreDevicePixelRatio)try{Z=self.devicePixelRatio}catch{}return Z}isLevelAllowed(Z){return!this.restrictedLevels.some(ee=>Z.bitrate===ee.bitrate&&Z.width===ee.width&&Z.height===ee.height)}static getMaxLevelByMediaSize(Z,ee,ae){if(!(Z!=null&&Z.length))return-1;const ye=(Ye,Ke)=>Ke?Ye.width!==Ke.width||Ye.height!==Ke.height:!0;let ve=Z.length-1;const be=Math.max(ee,ae);for(let Ye=0;Ye=be||Ke.height>=be)&&ye(Ke,Z[Ye+1])){ve=Ye;break}}return ve}}class FPSController{constructor(Z){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=Z,this.registerListeners()}setStreamController(Z){this.streamController=Z}registerListeners(){this.hls.on(Events.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(Events.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(Z,ee){const ae=this.hls.config;if(ae.capLevelOnFPSDrop){const ye=ee.media instanceof self.HTMLVideoElement?ee.media:null;this.media=ye,ye&&typeof ye.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),ae.fpsDroppedMonitoringPeriod)}}checkFPS(Z,ee,ae){const ye=performance.now();if(ee){if(this.lastTime){const ve=ye-this.lastTime,be=ae-this.lastDroppedFrames,Ye=ee-this.lastDecodedFrames,Ke=1e3*be/ve,Xe=this.hls;if(Xe.trigger(Events.FPS_DROP,{currentDropped:be,currentDecoded:Ye,totalDroppedFrames:ae}),Ke>0&&be>Xe.config.fpsDroppedMonitoringThreshold*Ye){let Je=Xe.currentLevel;logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+Je),Je>0&&(Xe.autoLevelCapping===-1||Xe.autoLevelCapping>=Je)&&(Je=Je-1,Xe.trigger(Events.FPS_DROP_LEVEL_CAPPING,{level:Je,droppedLevel:Xe.currentLevel}),Xe.autoLevelCapping=Je,this.streamController.nextLevelSwitch())}}this.lastTime=ye,this.lastDroppedFrames=ae,this.lastDecodedFrames=ee}}checkFPSInterval(){const Z=this.media;if(Z)if(this.isVideoPlaybackQualityAvailable){const ee=Z.getVideoPlaybackQuality();this.checkFPS(Z,ee.totalVideoFrames,ee.droppedVideoFrames)}else this.checkFPS(Z,Z.webkitDecodedFrameCount,Z.webkitDroppedFrameCount)}}const LOGGER_PREFIX="[eme]";class EMEController{constructor(Z){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=EMEController.CDMCleanupPromise?[EMEController.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=logger.debug.bind(logger,LOGGER_PREFIX),this.log=logger.log.bind(logger,LOGGER_PREFIX),this.warn=logger.warn.bind(logger,LOGGER_PREFIX),this.error=logger.error.bind(logger,LOGGER_PREFIX),this.hls=Z,this.config=Z.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const Z=this.config;Z.requestMediaKeySystemAccessFunc=null,Z.licenseXhrSetup=Z.licenseResponseCallback=void 0,Z.drmSystems=Z.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null}registerListeners(){this.hls.on(Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(Events.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(Events.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(Z){const{drmSystems:ee,widevineLicenseUrl:ae}=this.config,ye=ee[Z];if(ye)return ye.licenseUrl;if(Z===KeySystems.WIDEVINE&&ae)return ae;throw new Error(`no license server URL configured for key-system "${Z}"`)}getServerCertificateUrl(Z){const{drmSystems:ee}=this.config,ae=ee[Z];if(ae)return ae.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${Z}"]`)}attemptKeySystemAccess(Z){const ee=this.hls.levels,ae=(be,Ye,Ke)=>!!be&&Ke.indexOf(be)===Ye,ye=ee.map(be=>be.audioCodec).filter(ae),ve=ee.map(be=>be.videoCodec).filter(ae);return ye.length+ve.length===0&&ve.push("avc1.42e01e"),new Promise((be,Ye)=>{const Ke=Xe=>{const Je=Xe.shift();this.getMediaKeysPromise(Je,ye,ve).then(rt=>be({keySystem:Je,mediaKeys:rt})).catch(rt=>{Xe.length?Ke(Xe):rt instanceof EMEKeyError?Ye(rt):Ye(new EMEKeyError({type:ErrorTypes.KEY_SYSTEM_ERROR,details:ErrorDetails.KEY_SYSTEM_NO_ACCESS,error:rt,fatal:!0},rt.message))})};Ke(Z)})}requestMediaKeySystemAccess(Z,ee){const{requestMediaKeySystemAccessFunc:ae}=this.config;if(typeof ae!="function"){let ye=`Configured requestMediaKeySystemAccess is not a function ${ae}`;return requestMediaKeySystemAccess===null&&self.location.protocol==="http:"&&(ye=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(ye))}return ae(Z,ee)}getMediaKeysPromise(Z,ee,ae){const ye=getSupportedMediaKeySystemConfigurations(Z,ee,ae,this.config.drmSystemOptions),ve=this.keySystemAccessPromises[Z];let be=ve==null?void 0:ve.keySystemAccess;if(!be){this.log(`Requesting encrypted media "${Z}" key-system access with config: ${JSON.stringify(ye)}`),be=this.requestMediaKeySystemAccess(Z,ye);const Ye=this.keySystemAccessPromises[Z]={keySystemAccess:be};return be.catch(Ke=>{this.log(`Failed to obtain access to key-system "${Z}": ${Ke}`)}),be.then(Ke=>{this.log(`Access for key-system "${Ke.keySystem}" obtained`);const Xe=this.fetchServerCertificate(Z);return this.log(`Create media-keys for "${Z}"`),Ye.mediaKeys=Ke.createMediaKeys().then(Je=>(this.log(`Media-keys created for "${Z}"`),Xe.then(rt=>rt?this.setMediaKeysServerCertificate(Je,Z,rt):Je))),Ye.mediaKeys.catch(Je=>{this.error(`Failed to create media-keys for "${Z}"}: ${Je}`)}),Ye.mediaKeys})}return be.then(()=>ve.mediaKeys)}createMediaKeySessionContext({decryptdata:Z,keySystem:ee,mediaKeys:ae}){this.log(`Creating key-system session "${ee}" keyId: ${Hex.hexDump(Z.keyId||[])}`);const ye=ae.createSession(),ve={decryptdata:Z,keySystem:ee,mediaKeys:ae,mediaKeysSession:ye,keyStatus:"status-pending"};return this.mediaKeySessions.push(ve),ve}renewKeySession(Z){const ee=Z.decryptdata;if(ee.pssh){const ae=this.createMediaKeySessionContext(Z),ye=this.getKeyIdString(ee),ve="cenc";this.keyIdToKeySessionPromise[ye]=this.generateRequestWithPreferredKeySession(ae,ve,ee.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(Z)}getKeyIdString(Z){if(!Z)throw new Error("Could not read keyId of undefined decryptdata");if(Z.keyId===null)throw new Error("keyId is null");return Hex.hexDump(Z.keyId)}updateKeySession(Z,ee){var ae;const ye=Z.mediaKeysSession;return this.log(`Updating key-session "${ye.sessionId}" for keyID ${Hex.hexDump(((ae=Z.decryptdata)==null?void 0:ae.keyId)||[])} + } (data length: ${ee&&ee.byteLength})`),ye.update(ee)}selectKeySystemFormat(Z){const ee=Object.keys(Z.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${Z.sn} ${Z.type}: ${Z.level}) key formats ${ee.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(ee)),this.keyFormatPromise}getKeyFormatPromise(Z){return new Promise((ee,ae)=>{const ye=getKeySystemsForConfig(this.config),ve=Z.map(keySystemFormatToKeySystemDomain).filter(be=>!!be&&ye.indexOf(be)!==-1);return this.getKeySystemSelectionPromise(ve).then(({keySystem:be})=>{const Ye=keySystemDomainToKeySystemFormat(be);Ye?ee(Ye):ae(new Error(`Unable to find format for key-system "${be}"`))}).catch(ae)})}loadKey(Z){const ee=Z.keyInfo.decryptdata,ae=this.getKeyIdString(ee),ye=`(keyId: ${ae} format: "${ee.keyFormat}" method: ${ee.method} uri: ${ee.uri})`;this.log(`Starting session for key ${ye}`);let ve=this.keyIdToKeySessionPromise[ae];return ve||(ve=this.keyIdToKeySessionPromise[ae]=this.getKeySystemForKeyPromise(ee).then(({keySystem:be,mediaKeys:Ye})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${Z.frag.sn} ${Z.frag.type}: ${Z.frag.level} using key ${ye}`),this.attemptSetMediaKeys(be,Ye).then(()=>{this.throwIfDestroyed();const Ke=this.createMediaKeySessionContext({keySystem:be,mediaKeys:Ye,decryptdata:ee});return this.generateRequestWithPreferredKeySession(Ke,"cenc",ee.pssh,"playlist-key")}))),ve.catch(be=>this.handleError(be))),ve}throwIfDestroyed(Z="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(Z){this.hls&&(this.error(Z.message),Z instanceof EMEKeyError?this.hls.trigger(Events.ERROR,Z.data):this.hls.trigger(Events.ERROR,{type:ErrorTypes.KEY_SYSTEM_ERROR,details:ErrorDetails.KEY_SYSTEM_NO_KEYS,error:Z,fatal:!0}))}getKeySystemForKeyPromise(Z){const ee=this.getKeyIdString(Z),ae=this.keyIdToKeySessionPromise[ee];if(!ae){const ye=keySystemFormatToKeySystemDomain(Z.keyFormat),ve=ye?[ye]:getKeySystemsForConfig(this.config);return this.attemptKeySystemAccess(ve)}return ae}getKeySystemSelectionPromise(Z){if(Z.length||(Z=getKeySystemsForConfig(this.config)),Z.length===0)throw new EMEKeyError({type:ErrorTypes.KEY_SYSTEM_ERROR,details:ErrorDetails.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${JSON.stringify({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(Z)}_onMediaEncrypted(Z){const{initDataType:ee,initData:ae}=Z;if(this.debug(`"${Z.type}" event: init data type: "${ee}"`),ae===null)return;let ye,ve;if(ee==="sinf"&&this.config.drmSystems[KeySystems.FAIRPLAY]){const Je=bin2str(new Uint8Array(ae));try{const rt=base64Decode(JSON.parse(Je).sinf),nt=parseSinf(new Uint8Array(rt));if(!nt)return;ye=nt.subarray(8,24),ve=KeySystems.FAIRPLAY}catch{this.warn('Failed to parse sinf "encrypted" event message initData');return}}else{const Je=parsePssh(ae);if(Je===null)return;Je.version===0&&Je.systemId===KeySystemIds.WIDEVINE&&Je.data&&(ye=Je.data.subarray(8,24)),ve=keySystemIdToKeySystemDomain(Je.systemId)}if(!ve||!ye)return;const be=Hex.hexDump(ye),{keyIdToKeySessionPromise:Ye,mediaKeySessions:Ke}=this;let Xe=Ye[be];for(let Je=0;Jethis.generateRequestWithPreferredKeySession(rt,ee,ae,"encrypted-event-key-match"));break}}Xe||(Xe=Ye[be]=this.getKeySystemSelectionPromise([ve]).then(({keySystem:Je,mediaKeys:rt})=>{var nt;this.throwIfDestroyed();const it=new LevelKey("ISO-23001-7",be,(nt=keySystemDomainToKeySystemFormat(Je))!=null?nt:"");return it.pssh=new Uint8Array(ae),it.keyId=ye,this.attemptSetMediaKeys(Je,rt).then(()=>{this.throwIfDestroyed();const lt=this.createMediaKeySessionContext({decryptdata:it,keySystem:Je,mediaKeys:rt});return this.generateRequestWithPreferredKeySession(lt,ee,ae,"encrypted-event-no-match")})})),Xe.catch(Je=>this.handleError(Je))}_onWaitingForKey(Z){this.log(`"${Z.type}" event`)}attemptSetMediaKeys(Z,ee){const ae=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${Z}"`);const ye=Promise.all(ae).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(ee)});return this.setMediaKeysQueue.push(ye),ye.then(()=>{this.log(`Media-keys set for "${Z}"`),ae.push(ye),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(ve=>ae.indexOf(ve)===-1)})}generateRequestWithPreferredKeySession(Z,ee,ae,ye){var ve,be;const Ye=(ve=this.config.drmSystems)==null||(be=ve[Z.keySystem])==null?void 0:be.generateRequest;if(Ye)try{const lt=Ye.call(this.hls,ee,ae,Z);if(!lt)throw new Error("Invalid response from configured generateRequest filter");ee=lt.initDataType,ae=Z.decryptdata.pssh=lt.initData?new Uint8Array(lt.initData):null}catch(lt){var Ke;if(this.warn(lt.message),(Ke=this.hls)!=null&&Ke.config.debug)throw lt}if(ae===null)return this.log(`Skipping key-session request for "${ye}" (no initData)`),Promise.resolve(Z);const Xe=this.getKeyIdString(Z.decryptdata);this.log(`Generating key-session request for "${ye}": ${Xe} (init data type: ${ee} length: ${ae?ae.byteLength:null})`);const Je=new EventEmitter,rt=Z._onmessage=lt=>{const ct=Z.mediaKeysSession;if(!ct){Je.emit("error",new Error("invalid state"));return}const{messageType:ot,message:dt}=lt;this.log(`"${ot}" message event for session "${ct.sessionId}" message size: ${dt.byteLength}`),ot==="license-request"||ot==="license-renewal"?this.renewLicense(Z,dt).catch(ft=>{this.handleError(ft),Je.emit("error",ft)}):ot==="license-release"?Z.keySystem===KeySystems.FAIRPLAY&&(this.updateKeySession(Z,strToUtf8array("acknowledged")),this.removeSession(Z)):this.warn(`unhandled media key message type "${ot}"`)},nt=Z._onkeystatuseschange=lt=>{if(!Z.mediaKeysSession){Je.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(Z);const ct=Z.keyStatus;Je.emit("keyStatus",ct),ct==="expired"&&(this.warn(`${Z.keySystem} expired for key ${Xe}`),this.renewKeySession(Z))};Z.mediaKeysSession.addEventListener("message",rt),Z.mediaKeysSession.addEventListener("keystatuseschange",nt);const it=new Promise((lt,ct)=>{Je.on("error",ct),Je.on("keyStatus",ot=>{ot.startsWith("usable")?lt():ot==="output-restricted"?ct(new EMEKeyError({type:ErrorTypes.KEY_SYSTEM_ERROR,details:ErrorDetails.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):ot==="internal-error"?ct(new EMEKeyError({type:ErrorTypes.KEY_SYSTEM_ERROR,details:ErrorDetails.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${ot}"`)):ot==="expired"?ct(new Error("key expired while generating request")):this.warn(`unhandled key status change "${ot}"`)})});return Z.mediaKeysSession.generateRequest(ee,ae).then(()=>{var lt;this.log(`Request generated for key-session "${(lt=Z.mediaKeysSession)==null?void 0:lt.sessionId}" keyId: ${Xe}`)}).catch(lt=>{throw new EMEKeyError({type:ErrorTypes.KEY_SYSTEM_ERROR,details:ErrorDetails.KEY_SYSTEM_NO_SESSION,error:lt,fatal:!1},`Error generating key-session request: ${lt}`)}).then(()=>it).catch(lt=>{throw Je.removeAllListeners(),this.removeSession(Z),lt}).then(()=>(Je.removeAllListeners(),Z))}onKeyStatusChange(Z){Z.mediaKeysSession.keyStatuses.forEach((ee,ae)=>{this.log(`key status change "${ee}" for keyStatuses keyId: ${Hex.hexDump("buffer"in ae?new Uint8Array(ae.buffer,ae.byteOffset,ae.byteLength):new Uint8Array(ae))} session keyId: ${Hex.hexDump(new Uint8Array(Z.decryptdata.keyId||[]))} uri: ${Z.decryptdata.uri}`),Z.keyStatus=ee})}fetchServerCertificate(Z){const ee=this.config,ae=ee.loader,ye=new ae(ee),ve=this.getServerCertificateUrl(Z);return ve?(this.log(`Fetching server certificate for "${Z}"`),new Promise((be,Ye)=>{const Ke={responseType:"arraybuffer",url:ve},Xe=ee.certLoadPolicy.default,Je={loadPolicy:Xe,timeout:Xe.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},rt={onSuccess:(nt,it,lt,ct)=>{be(nt.data)},onError:(nt,it,lt,ct)=>{Ye(new EMEKeyError({type:ErrorTypes.KEY_SYSTEM_ERROR,details:ErrorDetails.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:lt,response:_objectSpread2({url:Ke.url,data:void 0},nt)},`"${Z}" certificate request failed (${ve}). Status: ${nt.code} (${nt.text})`))},onTimeout:(nt,it,lt)=>{Ye(new EMEKeyError({type:ErrorTypes.KEY_SYSTEM_ERROR,details:ErrorDetails.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:lt,response:{url:Ke.url,data:void 0}},`"${Z}" certificate request timed out (${ve})`))},onAbort:(nt,it,lt)=>{Ye(new Error("aborted"))}};ye.load(Ke,Je,rt)})):Promise.resolve()}setMediaKeysServerCertificate(Z,ee,ae){return new Promise((ye,ve)=>{Z.setServerCertificate(ae).then(be=>{this.log(`setServerCertificate ${be?"success":"not supported by CDM"} (${ae==null?void 0:ae.byteLength}) on "${ee}"`),ye(Z)}).catch(be=>{ve(new EMEKeyError({type:ErrorTypes.KEY_SYSTEM_ERROR,details:ErrorDetails.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:be,fatal:!0},be.message))})})}renewLicense(Z,ee){return this.requestLicense(Z,new Uint8Array(ee)).then(ae=>this.updateKeySession(Z,new Uint8Array(ae)).catch(ye=>{throw new EMEKeyError({type:ErrorTypes.KEY_SYSTEM_ERROR,details:ErrorDetails.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:ye,fatal:!0},ye.message)}))}unpackPlayReadyKeyMessage(Z,ee){const ae=String.fromCharCode.apply(null,new Uint16Array(ee.buffer));if(!ae.includes("PlayReadyKeyMessage"))return Z.setRequestHeader("Content-Type","text/xml; charset=utf-8"),ee;const ye=new DOMParser().parseFromString(ae,"application/xml"),ve=ye.querySelectorAll("HttpHeader");if(ve.length>0){let Je;for(let rt=0,nt=ve.length;rt in key message");return strToUtf8array(atob(Xe))}setupLicenseXHR(Z,ee,ae,ye){const ve=this.config.licenseXhrSetup;return ve?Promise.resolve().then(()=>{if(!ae.decryptdata)throw new Error("Key removed");return ve.call(this.hls,Z,ee,ae,ye)}).catch(be=>{if(!ae.decryptdata)throw be;return Z.open("POST",ee,!0),ve.call(this.hls,Z,ee,ae,ye)}).then(be=>(Z.readyState||Z.open("POST",ee,!0),{xhr:Z,licenseChallenge:be||ye})):(Z.open("POST",ee,!0),Promise.resolve({xhr:Z,licenseChallenge:ye}))}requestLicense(Z,ee){const ae=this.config.keyLoadPolicy.default;return new Promise((ye,ve)=>{const be=this.getLicenseServerUrl(Z.keySystem);this.log(`Sending license request to URL: ${be}`);const Ye=new XMLHttpRequest;Ye.responseType="arraybuffer",Ye.onreadystatechange=()=>{if(!this.hls||!Z.mediaKeysSession)return ve(new Error("invalid state"));if(Ye.readyState===4)if(Ye.status===200){this._requestLicenseFailureCount=0;let Ke=Ye.response;this.log(`License received ${Ke instanceof ArrayBuffer?Ke.byteLength:Ke}`);const Xe=this.config.licenseResponseCallback;if(Xe)try{Ke=Xe.call(this.hls,Ye,be,Z)}catch(Je){this.error(Je)}ye(Ke)}else{const Ke=ae.errorRetry,Xe=Ke?Ke.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>Xe||Ye.status>=400&&Ye.status<500)ve(new EMEKeyError({type:ErrorTypes.KEY_SYSTEM_ERROR,details:ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:Ye,response:{url:be,data:void 0,code:Ye.status,text:Ye.statusText}},`License Request XHR failed (${be}). Status: ${Ye.status} (${Ye.statusText})`));else{const Je=Xe-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${Je} attempts left`),this.requestLicense(Z,ee).then(ye,ve)}}},Z.licenseXhr&&Z.licenseXhr.readyState!==XMLHttpRequest.DONE&&Z.licenseXhr.abort(),Z.licenseXhr=Ye,this.setupLicenseXHR(Ye,be,Z,ee).then(({xhr:Ke,licenseChallenge:Xe})=>{Z.keySystem==KeySystems.PLAYREADY&&(Xe=this.unpackPlayReadyKeyMessage(Ke,Xe)),Ke.send(Xe)})})}onMediaAttached(Z,ee){if(!this.config.emeEnabled)return;const ae=ee.media;this.media=ae,ae.addEventListener("encrypted",this.onMediaEncrypted),ae.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const Z=this.media,ee=this.mediaKeySessions;Z&&(Z.removeEventListener("encrypted",this.onMediaEncrypted),Z.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},LevelKey.clearKeyUriToKeyIdMap();const ae=ee.length;EMEController.CDMCleanupPromise=Promise.all(ee.map(ye=>this.removeSession(ye)).concat(Z==null?void 0:Z.setMediaKeys(null).catch(ye=>{this.log(`Could not clear media keys: ${ye}`)}))).then(()=>{ae&&(this.log("finished closing key sessions and clearing media keys"),ee.length=0)}).catch(ye=>{this.log(`Could not close sessions and clear media keys: ${ye}`)})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(Z,{sessionKeys:ee}){if(!(!ee||!this.config.emeEnabled)&&!this.keyFormatPromise){const ae=ee.reduce((ye,ve)=>(ye.indexOf(ve.keyFormat)===-1&&ye.push(ve.keyFormat),ye),[]);this.log(`Selecting key-system from session-keys ${ae.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(ae)}}removeSession(Z){const{mediaKeysSession:ee,licenseXhr:ae}=Z;if(ee){this.log(`Remove licenses and keys and close session ${ee.sessionId}`),Z._onmessage&&(ee.removeEventListener("message",Z._onmessage),Z._onmessage=void 0),Z._onkeystatuseschange&&(ee.removeEventListener("keystatuseschange",Z._onkeystatuseschange),Z._onkeystatuseschange=void 0),ae&&ae.readyState!==XMLHttpRequest.DONE&&ae.abort(),Z.mediaKeysSession=Z.decryptdata=Z.licenseXhr=void 0;const ye=this.mediaKeySessions.indexOf(Z);return ye>-1&&this.mediaKeySessions.splice(ye,1),ee.remove().catch(ve=>{this.log(`Could not remove session: ${ve}`)}).then(()=>ee.close()).catch(ve=>{this.log(`Could not close session: ${ve}`)})}}}EMEController.CDMCleanupPromise=void 0;class EMEKeyError extends Error{constructor(Z,ee){super(ee),this.data=void 0,Z.error||(Z.error=new Error(ee)),this.data=Z,Z.err=Z.error}}var CmObjectType;(function(ie){ie.MANIFEST="m",ie.AUDIO="a",ie.VIDEO="v",ie.MUXED="av",ie.INIT="i",ie.CAPTION="c",ie.TIMED_TEXT="tt",ie.KEY="k",ie.OTHER="o"})(CmObjectType||(CmObjectType={}));var CmStreamingFormat;(function(ie){ie.DASH="d",ie.HLS="h",ie.SMOOTH="s",ie.OTHER="o"})(CmStreamingFormat||(CmStreamingFormat={}));var CmcdHeaderField;(function(ie){ie.OBJECT="CMCD-Object",ie.REQUEST="CMCD-Request",ie.SESSION="CMCD-Session",ie.STATUS="CMCD-Status"})(CmcdHeaderField||(CmcdHeaderField={}));const CmcdHeaderMap={[CmcdHeaderField.OBJECT]:["br","d","ot","tb"],[CmcdHeaderField.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[CmcdHeaderField.SESSION]:["cid","pr","sf","sid","st","v"],[CmcdHeaderField.STATUS]:["bs","rtp"]};class SfItem{constructor(Z,ee){this.value=void 0,this.params=void 0,Array.isArray(Z)&&(Z=Z.map(ae=>ae instanceof SfItem?ae:new SfItem(ae))),this.value=Z,this.params=ee}}class SfToken{constructor(Z){this.description=void 0,this.description=Z}}const DICT="Dict";function format(ie){return Array.isArray(ie)?JSON.stringify(ie):ie instanceof Map?"Map{}":ie instanceof Set?"Set{}":typeof ie=="object"?JSON.stringify(ie):String(ie)}function throwError(ie,Z,ee,ae){return new Error(`failed to ${ie} "${format(Z)}" as ${ee}`,{cause:ae})}const BARE_ITEM="Bare Item",BOOLEAN="Boolean",BYTES="Byte Sequence",DECIMAL="Decimal",INTEGER="Integer";function isInvalidInt(ie){return ie<-999999999999999||99999999999999912)throw serializeError(ie,DECIMAL);const ee=Z.toString();return ee.includes(".")?ee:`${ee}.0`}const STRING="String";function serializeString(ie){if(STRING_REGEX.test(ie))throw serializeError(ie,STRING);return`"${ie.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function symbolToStr(ie){return ie.description||ie.toString().slice(7,-1)}function serializeToken(ie){const Z=symbolToStr(ie);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(Z)===!1)throw serializeError(Z,TOKEN);return Z}function serializeBareItem(ie){switch(typeof ie){case"number":if(!isFiniteNumber(ie))throw serializeError(ie,BARE_ITEM);return Number.isInteger(ie)?serializeInteger(ie):serializeDecimal(ie);case"string":return serializeString(ie);case"symbol":return serializeToken(ie);case"boolean":return serializeBoolean(ie);case"object":if(ie instanceof Date)return serializeDate(ie);if(ie instanceof Uint8Array)return serializeByteSequence(ie);if(ie instanceof SfToken)return serializeToken(ie);default:throw serializeError(ie,BARE_ITEM)}}function serializeKey(ie){if(/^[a-z*][a-z0-9\-_.*]*$/.test(ie)===!1)throw serializeError(ie,KEY);return ie}function serializeParams(ie){return ie==null?"":Object.entries(ie).map(([Z,ee])=>ee===!0?`;${serializeKey(Z)}`:`;${serializeKey(Z)}=${serializeBareItem(ee)}`).join("")}function serializeItem(ie){return ie instanceof SfItem?`${serializeBareItem(ie.value)}${serializeParams(ie.params)}`:serializeBareItem(ie)}function serializeInnerList(ie){return`(${ie.value.map(serializeItem).join(" ")})${serializeParams(ie.params)}`}function serializeDict(ie,Z={whitespace:!0}){if(typeof ie!="object")throw serializeError(ie,DICT);const ee=ie instanceof Map?ie.entries():Object.entries(ie),ae=Z!=null&&Z.whitespace?" ":"";return Array.from(ee).map(([ye,ve])=>{ve instanceof SfItem||(ve=new SfItem(ve));let be=serializeKey(ye);return ve.value===!0?be+=serializeParams(ve.params):(be+="=",Array.isArray(ve.value)?be+=serializeInnerList(ve):be+=serializeItem(ve)),be}).join(`,${ae}`)}function encodeSfDict(ie,Z){return serializeDict(ie,Z)}const isTokenField=ie=>ie==="ot"||ie==="sf"||ie==="st",isValid=ie=>typeof ie=="number"?isFiniteNumber(ie):ie!=null&&ie!==""&&ie!==!1;function urlToRelativePath(ie,Z){const ee=new URL(ie),ae=new URL(Z);if(ee.origin!==ae.origin)return ie;const ye=ee.pathname.split("/").slice(1),ve=ae.pathname.split("/").slice(1,-1);for(;ye[0]===ve[0];)ye.shift(),ve.shift();for(;ve.length;)ve.shift(),ye.unshift("..");return ye.join("/")}function uuid(){try{return crypto.randomUUID()}catch{try{const ie=URL.createObjectURL(new Blob),Z=ie.toString();return URL.revokeObjectURL(ie),Z.slice(Z.lastIndexOf("/")+1)}catch{let ie=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,Z=>{const ee=(ie+Math.random()*16)%16|0;return ie=Math.floor(ie/16),(Z=="x"?ee:ee&3|8).toString(16)})}}}const toRounded=ie=>Math.round(ie),toUrlSafe=(ie,Z)=>(Z!=null&&Z.baseUrl&&(ie=urlToRelativePath(ie,Z.baseUrl)),encodeURIComponent(ie)),toHundred=ie=>toRounded(ie/100)*100,CmcdFormatters={br:toRounded,d:toRounded,bl:toHundred,dl:toHundred,mtp:toHundred,nor:toUrlSafe,rtp:toHundred,tb:toRounded};function processCmcd(ie,Z){const ee={};if(ie==null||typeof ie!="object")return ee;const ae=Object.keys(ie).sort(),ye=_extends({},CmcdFormatters,Z==null?void 0:Z.formatters),ve=Z==null?void 0:Z.filter;return ae.forEach(be=>{if(ve!=null&&ve(be))return;let Ye=ie[be];const Ke=ye[be];Ke&&(Ye=Ke(Ye,Z)),!(be==="v"&&Ye===1)&&(be=="pr"&&Ye===1||isValid(Ye)&&(isTokenField(be)&&typeof Ye=="string"&&(Ye=new SfToken(Ye)),ee[be]=Ye))}),ee}function encodeCmcd(ie,Z={}){return ie?encodeSfDict(processCmcd(ie,Z),_extends({whitespace:!1},Z)):""}function toCmcdHeaders(ie,Z={}){if(!ie)return{};const ee=Object.entries(ie),ae=Object.entries(CmcdHeaderMap).concat(Object.entries((Z==null?void 0:Z.customHeaderMap)||{})),ye=ee.reduce((ve,be)=>{var Ye;const[Ke,Xe]=be,Je=((Ye=ae.find(rt=>rt[1].includes(Ke)))==null?void 0:Ye[0])||CmcdHeaderField.REQUEST;return ve[Je]!=null||(ve[Je]={}),ve[Je][Ke]=Xe,ve},{});return Object.entries(ye).reduce((ve,[be,Ye])=>(ve[be]=encodeCmcd(Ye,Z),ve),{})}function appendCmcdHeaders(ie,Z,ee){return _extends(ie,toCmcdHeaders(Z,ee))}const CMCD_PARAM="CMCD";function toCmcdQuery(ie,Z={}){if(!ie)return"";const ee=encodeCmcd(ie,Z);return`${CMCD_PARAM}=${encodeURIComponent(ee)}`}const REGEX=/CMCD=[^&#]+/;function appendCmcdQuery(ie,Z,ee){const ae=toCmcdQuery(Z,ee);if(!ae)return ie;if(REGEX.test(ie))return ie.replace(REGEX,ae);const ye=ie.includes("?")?"&":"?";return`${ie}${ye}${ae}`}class CMCDController{constructor(Z){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=ye=>{try{this.apply(ye,{ot:CmObjectType.MANIFEST,su:!this.initialized})}catch(ve){logger.warn("Could not generate manifest CMCD data.",ve)}},this.applyFragmentData=ye=>{try{const ve=ye.frag,be=this.hls.levels[ve.level],Ye=this.getObjectType(ve),Ke={d:ve.duration*1e3,ot:Ye};(Ye===CmObjectType.VIDEO||Ye===CmObjectType.AUDIO||Ye==CmObjectType.MUXED)&&(Ke.br=be.bitrate/1e3,Ke.tb=this.getTopBandwidth(Ye)/1e3,Ke.bl=this.getBufferLength(Ye)),this.apply(ye,Ke)}catch(ve){logger.warn("Could not generate segment CMCD data.",ve)}},this.hls=Z;const ee=this.config=Z.config,{cmcd:ae}=ee;ae!=null&&(ee.pLoader=this.createPlaylistLoader(),ee.fLoader=this.createFragmentLoader(),this.sid=ae.sessionId||uuid(),this.cid=ae.contentId,this.useHeaders=ae.useHeaders===!0,this.includeKeys=ae.includeKeys,this.registerListeners())}registerListeners(){const Z=this.hls;Z.on(Events.MEDIA_ATTACHED,this.onMediaAttached,this),Z.on(Events.MEDIA_DETACHED,this.onMediaDetached,this),Z.on(Events.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const Z=this.hls;Z.off(Events.MEDIA_ATTACHED,this.onMediaAttached,this),Z.off(Events.MEDIA_DETACHED,this.onMediaDetached,this),Z.off(Events.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=null}onMediaAttached(Z,ee){this.media=ee.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(Z,ee){var ae,ye;this.audioBuffer=(ae=ee.tracks.audio)==null?void 0:ae.buffer,this.videoBuffer=(ye=ee.tracks.video)==null?void 0:ye.buffer}createData(){var Z;return{v:1,sf:CmStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(Z=this.media)==null?void 0:Z.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(Z,ee={}){_extends(ee,this.createData());const ae=ee.ot===CmObjectType.INIT||ee.ot===CmObjectType.VIDEO||ee.ot===CmObjectType.MUXED;this.starved&&ae&&(ee.bs=!0,ee.su=!0,this.starved=!1),ee.su==null&&(ee.su=this.buffering);const{includeKeys:ye}=this;ye&&(ee=Object.keys(ee).reduce((ve,be)=>(ye.includes(be)&&(ve[be]=ee[be]),ve),{})),this.useHeaders?(Z.headers||(Z.headers={}),appendCmcdHeaders(Z.headers,ee)):Z.url=appendCmcdQuery(Z.url,ee)}getObjectType(Z){const{type:ee}=Z;if(ee==="subtitle")return CmObjectType.TIMED_TEXT;if(Z.sn==="initSegment")return CmObjectType.INIT;if(ee==="audio")return CmObjectType.AUDIO;if(ee==="main")return this.hls.audioTracks.length?CmObjectType.VIDEO:CmObjectType.MUXED}getTopBandwidth(Z){let ee=0,ae;const ye=this.hls;if(Z===CmObjectType.AUDIO)ae=ye.audioTracks;else{const ve=ye.maxAutoLevel,be=ve>-1?ve+1:ye.levels.length;ae=ye.levels.slice(0,be)}for(const ve of ae)ve.bitrate>ee&&(ee=ve.bitrate);return ee>0?ee:NaN}getBufferLength(Z){const ee=this.hls.media,ae=Z===CmObjectType.AUDIO?this.audioBuffer:this.videoBuffer;return!ae||!ee?NaN:BufferHelper.bufferInfo(ae,ee.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:Z}=this.config,ee=this.applyPlaylistData,ae=Z||this.config.loader;return class{constructor(ye){this.loader=void 0,this.loader=new ae(ye)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(ye,ve,be){ee(ye),this.loader.load(ye,ve,be)}}}createFragmentLoader(){const{fLoader:Z}=this.config,ee=this.applyFragmentData,ae=Z||this.config.loader;return class{constructor(ye){this.loader=void 0,this.loader=new ae(ye)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(ye,ve,be){ee(ye),this.loader.load(ye,ve,be)}}}}const PATHWAY_PENALTY_DURATION_MS=3e5;class ContentSteeringController{constructor(Z){this.hls=void 0,this.log=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this.pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=Z,this.log=logger.log.bind(logger,"[content-steering]:"),this.registerListeners()}registerListeners(){const Z=this.hls;Z.on(Events.MANIFEST_LOADING,this.onManifestLoading,this),Z.on(Events.MANIFEST_LOADED,this.onManifestLoaded,this),Z.on(Events.MANIFEST_PARSED,this.onManifestParsed,this),Z.on(Events.ERROR,this.onError,this)}unregisterListeners(){const Z=this.hls;Z&&(Z.off(Events.MANIFEST_LOADING,this.onManifestLoading,this),Z.off(Events.MANIFEST_LOADED,this.onManifestLoaded,this),Z.off(Events.MANIFEST_PARSED,this.onManifestParsed,this),Z.off(Events.ERROR,this.onError,this))}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const Z=this.timeToLoad*1e3-(performance.now()-this.updated);if(Z>0){this.scheduleRefresh(this.uri,Z);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(Z){const ee=this.levels;ee&&(this.levels=ee.filter(ae=>ae!==Z))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(Z,ee){const{contentSteering:ae}=ee;ae!==null&&(this.pathwayId=ae.pathwayId,this.uri=ae.uri,this.started&&this.startLoad())}onManifestParsed(Z,ee){this.audioTracks=ee.audioTracks,this.subtitleTracks=ee.subtitleTracks}onError(Z,ee){const{errorAction:ae}=ee;if((ae==null?void 0:ae.action)===NetworkErrorAction.SendAlternateToPenaltyBox&&ae.flags===ErrorActionFlags.MoveAllAlternatesMatchingHost){const ye=this.levels;let ve=this.pathwayPriority,be=this.pathwayId;if(ee.context){const{groupId:Ye,pathwayId:Ke,type:Xe}=ee.context;Ye&&ye?be=this.getPathwayForGroupId(Ye,Xe,be):Ke&&(be=Ke)}be in this.penalizedPathways||(this.penalizedPathways[be]=performance.now()),!ve&&ye&&(ve=ye.reduce((Ye,Ke)=>(Ye.indexOf(Ke.pathwayId)===-1&&Ye.push(Ke.pathwayId),Ye),[])),ve&&ve.length>1&&(this.updatePathwayPriority(ve),ae.resolved=this.pathwayId!==be),ae.resolved||logger.warn(`Could not resolve ${ee.details} ("${ee.error.message}") with content-steering for Pathway: ${be} levels: ${ye&&ye.length} priorities: ${JSON.stringify(ve)} penalized: ${JSON.stringify(this.penalizedPathways)}`)}}filterParsedLevels(Z){this.levels=Z;let ee=this.getLevelsForPathway(this.pathwayId);if(ee.length===0){const ae=Z[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${ae}"`),ee=this.getLevelsForPathway(ae),this.pathwayId=ae}return ee.length!==Z.length?(this.log(`Found ${ee.length}/${Z.length} levels in Pathway "${this.pathwayId}"`),ee):Z}getLevelsForPathway(Z){return this.levels===null?[]:this.levels.filter(ee=>Z===ee.pathwayId)}updatePathwayPriority(Z){this.pathwayPriority=Z;let ee;const ae=this.penalizedPathways,ye=performance.now();Object.keys(ae).forEach(ve=>{ye-ae[ve]>PATHWAY_PENALTY_DURATION_MS&&delete ae[ve]});for(let ve=0;ve0){this.log(`Setting Pathway to "${be}"`),this.pathwayId=be,reassignFragmentLevelIndexes(ee),this.hls.trigger(Events.LEVELS_UPDATED,{levels:ee});const Xe=this.hls.levels[Ye];Ke&&Xe&&this.levels&&(Xe.attrs["STABLE-VARIANT-ID"]!==Ke.attrs["STABLE-VARIANT-ID"]&&Xe.bitrate!==Ke.bitrate&&this.log(`Unstable Pathways change from bitrate ${Ke.bitrate} to ${Xe.bitrate}`),this.hls.nextLoadLevel=Ye);break}}}getPathwayForGroupId(Z,ee,ae){const ye=this.getLevelsForPathway(ae).concat(this.levels||[]);for(let ve=0;ve{const{ID:be,"BASE-ID":Ye,"URI-REPLACEMENT":Ke}=ve;if(ee.some(Je=>Je.pathwayId===be))return;const Xe=this.getLevelsForPathway(Ye).map(Je=>{const rt=new AttrList(Je.attrs);rt["PATHWAY-ID"]=be;const nt=rt.AUDIO&&`${rt.AUDIO}_clone_${be}`,it=rt.SUBTITLES&&`${rt.SUBTITLES}_clone_${be}`;nt&&(ae[rt.AUDIO]=nt,rt.AUDIO=nt),it&&(ye[rt.SUBTITLES]=it,rt.SUBTITLES=it);const lt=performUriReplacement(Je.uri,rt["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",Ke),ct=new Level({attrs:rt,audioCodec:Je.audioCodec,bitrate:Je.bitrate,height:Je.height,name:Je.name,url:lt,videoCodec:Je.videoCodec,width:Je.width});if(Je.audioGroups)for(let ot=1;ot{this.log(`Loaded steering manifest: "${ye}"`);const lt=Je.data;if(lt.VERSION!==1){this.log(`Steering VERSION ${lt.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=lt.TTL;const{"RELOAD-URI":ct,"PATHWAY-CLONES":ot,"PATHWAY-PRIORITY":dt}=lt;if(ct)try{this.uri=new self.URL(ct,ye).href}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${ct}`);return}this.scheduleRefresh(this.uri||nt.url),ot&&this.clonePathways(ot);const ft={steeringManifest:lt,url:ye.toString()};this.hls.trigger(Events.STEERING_MANIFEST_LOADED,ft),dt&&this.updatePathwayPriority(dt)},onError:(Je,rt,nt,it)=>{if(this.log(`Error loading steering manifest: ${Je.code} ${Je.text} (${rt.url})`),this.stopLoad(),Je.code===410){this.enabled=!1,this.log(`Steering manifest ${rt.url} no longer available`);return}let lt=this.timeToLoad*1e3;if(Je.code===429){const ct=this.loader;if(typeof(ct==null?void 0:ct.getResponseHeader)=="function"){const ot=ct.getResponseHeader("Retry-After");ot&&(lt=parseFloat(ot)*1e3)}this.log(`Steering manifest ${rt.url} rate limited`);return}this.scheduleRefresh(this.uri||rt.url,lt)},onTimeout:(Je,rt,nt)=>{this.log(`Timeout loading steering manifest (${rt.url})`),this.scheduleRefresh(this.uri||rt.url)}};this.log(`Requesting steering manifest: ${ye}`),this.loader.load(ve,Ke,Xe)}scheduleRefresh(Z,ee=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var ae;const ye=(ae=this.hls)==null?void 0:ae.media;if(ye&&!ye.ended){this.loadSteeringManifest(Z);return}this.scheduleRefresh(Z,this.timeToLoad*1e3)},ee)}}function cloneRenditionGroups(ie,Z,ee,ae){ie&&Object.keys(Z).forEach(ye=>{const ve=ie.filter(be=>be.groupId===ye).map(be=>{const Ye=_extends({},be);return Ye.details=void 0,Ye.attrs=new AttrList(Ye.attrs),Ye.url=Ye.attrs.URI=performUriReplacement(be.url,be.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",ee),Ye.groupId=Ye.attrs["GROUP-ID"]=Z[ye],Ye.attrs["PATHWAY-ID"]=ae,Ye});ie.push(...ve)})}function performUriReplacement(ie,Z,ee,ae){const{HOST:ye,PARAMS:ve,[ee]:be}=ae;let Ye;Z&&(Ye=be==null?void 0:be[Z],Ye&&(ie=Ye));const Ke=new self.URL(ie);return ye&&!Ye&&(Ke.host=ye),ve&&Object.keys(ve).sort().forEach(Xe=>{Xe&&Ke.searchParams.set(Xe,ve[Xe])}),Ke.href}const AGE_HEADER_LINE_REGEX=/^age:\s*[\d.]+\s*$/im;class XhrLoader{constructor(Z){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=Z&&Z.xhrSetup||null,this.stats=new LoadStats,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null,this.stats=null}abortInternal(){const Z=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),Z&&(Z.onreadystatechange=null,Z.onprogress=null,Z.readyState!==4&&(this.stats.aborted=!0,Z.abort()))}abort(){var Z;this.abortInternal(),(Z=this.callbacks)!=null&&Z.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(Z,ee,ae){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=Z,this.config=ee,this.callbacks=ae,this.loadInternal()}loadInternal(){const{config:Z,context:ee}=this;if(!Z||!ee)return;const ae=this.loader=new self.XMLHttpRequest,ye=this.stats;ye.loading.first=0,ye.loaded=0,ye.aborted=!1;const ve=this.xhrSetup;ve?Promise.resolve().then(()=>{if(!this.stats.aborted)return ve(ae,ee.url)}).catch(be=>(ae.open("GET",ee.url,!0),ve(ae,ee.url))).then(()=>{this.stats.aborted||this.openAndSendXhr(ae,ee,Z)}).catch(be=>{this.callbacks.onError({code:ae.status,text:be.message},ee,ae,ye)}):this.openAndSendXhr(ae,ee,Z)}openAndSendXhr(Z,ee,ae){Z.readyState||Z.open("GET",ee.url,!0);const ye=ee.headers,{maxTimeToFirstByteMs:ve,maxLoadTimeMs:be}=ae.loadPolicy;if(ye)for(const Ye in ye)Z.setRequestHeader(Ye,ye[Ye]);ee.rangeEnd&&Z.setRequestHeader("Range","bytes="+ee.rangeStart+"-"+(ee.rangeEnd-1)),Z.onreadystatechange=this.readystatechange.bind(this),Z.onprogress=this.loadprogress.bind(this),Z.responseType=ee.responseType,self.clearTimeout(this.requestTimeout),ae.timeout=ve&&isFiniteNumber(ve)?ve:be,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),ae.timeout),Z.send()}readystatechange(){const{context:Z,loader:ee,stats:ae}=this;if(!Z||!ee)return;const ye=ee.readyState,ve=this.config;if(!ae.aborted&&ye>=2&&(ae.loading.first===0&&(ae.loading.first=Math.max(self.performance.now(),ae.loading.start),ve.timeout!==ve.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),ve.timeout=ve.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),ve.loadPolicy.maxLoadTimeMs-(ae.loading.first-ae.loading.start)))),ye===4)){self.clearTimeout(this.requestTimeout),ee.onreadystatechange=null,ee.onprogress=null;const be=ee.status,Ye=ee.responseType!=="text";if(be>=200&&be<300&&(Ye&&ee.response||ee.responseText!==null)){ae.loading.end=Math.max(self.performance.now(),ae.loading.first);const Ke=Ye?ee.response:ee.responseText,Xe=ee.responseType==="arraybuffer"?Ke.byteLength:Ke.length;if(ae.loaded=ae.total=Xe,ae.bwEstimate=ae.total*8e3/(ae.loading.end-ae.loading.first),!this.callbacks)return;const Je=this.callbacks.onProgress;if(Je&&Je(ae,Z,Ke,ee),!this.callbacks)return;const rt={url:ee.responseURL,data:Ke,code:be};this.callbacks.onSuccess(rt,ae,Z,ee)}else{const Ke=ve.loadPolicy.errorRetry,Xe=ae.retry,Je={url:Z.url,data:void 0,code:be};shouldRetry(Ke,Xe,!1,Je)?this.retry(Ke):(logger.error(`${be} while loading ${Z.url}`),this.callbacks.onError({code:be,text:ee.statusText},Z,ee,ae))}}}loadtimeout(){var Z;const ee=(Z=this.config)==null?void 0:Z.loadPolicy.timeoutRetry,ae=this.stats.retry;if(shouldRetry(ee,ae,!0))this.retry(ee);else{var ye;logger.warn(`timeout while loading ${(ye=this.context)==null?void 0:ye.url}`);const ve=this.callbacks;ve&&(this.abortInternal(),ve.onTimeout(this.stats,this.context,this.loader))}}retry(Z){const{context:ee,stats:ae}=this;this.retryDelay=getRetryDelay(Z,ae.retry),ae.retry++,logger.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${ee==null?void 0:ee.url}, retrying ${ae.retry}/${Z.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(Z){const ee=this.stats;ee.loaded=Z.loaded,Z.lengthComputable&&(ee.total=Z.total)}getCacheAge(){let Z=null;if(this.loader&&AGE_HEADER_LINE_REGEX.test(this.loader.getAllResponseHeaders())){const ee=this.loader.getResponseHeader("age");Z=ee?parseFloat(ee):null}return Z}getResponseHeader(Z){return this.loader&&new RegExp(`^${Z}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(Z):null}}function fetchSupported(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const BYTERANGE=/(\d+)-(\d+)\/(\d+)/;class FetchLoader{constructor(Z){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=Z.fetchSetup||getRequest,this.controller=new self.AbortController,this.stats=new LoadStats}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var Z;this.abortInternal(),(Z=this.callbacks)!=null&&Z.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(Z,ee,ae){const ye=this.stats;if(ye.loading.start)throw new Error("Loader can only be used once.");ye.loading.start=self.performance.now();const ve=getRequestParameters(Z,this.controller.signal),be=ae.onProgress,Ye=Z.responseType==="arraybuffer",Ke=Ye?"byteLength":"length",{maxTimeToFirstByteMs:Xe,maxLoadTimeMs:Je}=ee.loadPolicy;this.context=Z,this.config=ee,this.callbacks=ae,this.request=this.fetchSetup(Z,ve),self.clearTimeout(this.requestTimeout),ee.timeout=Xe&&isFiniteNumber(Xe)?Xe:Je,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),ae.onTimeout(ye,Z,this.response)},ee.timeout),self.fetch(this.request).then(rt=>{this.response=this.loader=rt;const nt=Math.max(self.performance.now(),ye.loading.start);if(self.clearTimeout(this.requestTimeout),ee.timeout=Je,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),ae.onTimeout(ye,Z,this.response)},Je-(nt-ye.loading.start)),!rt.ok){const{status:it,statusText:lt}=rt;throw new FetchError(lt||"fetch, bad network response",it,rt)}return ye.loading.first=nt,ye.total=getContentLength(rt.headers)||ye.total,be&&isFiniteNumber(ee.highWaterMark)?this.loadProgressively(rt,ye,Z,ee.highWaterMark,be):Ye?rt.arrayBuffer():Z.responseType==="json"?rt.json():rt.text()}).then(rt=>{const nt=this.response;if(!nt)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),ye.loading.end=Math.max(self.performance.now(),ye.loading.first);const it=rt[Ke];it&&(ye.loaded=ye.total=it);const lt={url:nt.url,data:rt,code:nt.status};be&&!isFiniteNumber(ee.highWaterMark)&&be(ye,Z,rt,nt),ae.onSuccess(lt,ye,Z,nt)}).catch(rt=>{if(self.clearTimeout(this.requestTimeout),ye.aborted)return;const nt=rt&&rt.code||0,it=rt?rt.message:null;ae.onError({code:nt,text:it},Z,rt?rt.details:null,ye)})}getCacheAge(){let Z=null;if(this.response){const ee=this.response.headers.get("age");Z=ee?parseFloat(ee):null}return Z}getResponseHeader(Z){return this.response?this.response.headers.get(Z):null}loadProgressively(Z,ee,ae,ye=0,ve){const be=new ChunkCache,Ye=Z.body.getReader(),Ke=()=>Ye.read().then(Xe=>{if(Xe.done)return be.dataLength&&ve(ee,ae,be.flush(),Z),Promise.resolve(new ArrayBuffer(0));const Je=Xe.value,rt=Je.length;return ee.loaded+=rt,rt=ye&&ve(ee,ae,be.flush(),Z)):ve(ee,ae,Je,Z),Ke()}).catch(()=>Promise.reject());return Ke()}}function getRequestParameters(ie,Z){const ee={method:"GET",mode:"cors",credentials:"same-origin",signal:Z,headers:new self.Headers(_extends({},ie.headers))};return ie.rangeEnd&&ee.headers.set("Range","bytes="+ie.rangeStart+"-"+String(ie.rangeEnd-1)),ee}function getByteRangeLength(ie){const Z=BYTERANGE.exec(ie);if(Z)return parseInt(Z[2])-parseInt(Z[1])+1}function getContentLength(ie){const Z=ie.get("Content-Range");if(Z){const ae=getByteRangeLength(Z);if(isFiniteNumber(ae))return ae}const ee=ie.get("Content-Length");if(ee)return parseInt(ee)}function getRequest(ie,Z){return new self.Request(ie.url,Z)}class FetchError extends Error{constructor(Z,ee,ae){super(Z),this.code=void 0,this.details=void 0,this.code=ee,this.details=ae}}const WHITESPACE_CHAR=/\s/,Cues={newCue(ie,Z,ee,ae){const ye=[];let ve,be,Ye,Ke,Xe;const Je=self.VTTCue||self.TextTrackCue;for(let nt=0;nt=16?Ke--:Ke++;const it=fixLineBreaks(Xe.trim()),lt=generateCueId(Z,ee,it);ie!=null&&(rt=ie.cues)!=null&&rt.getCueById(lt)||(be=new Je(Z,ee,it),be.id=lt,be.line=nt+1,be.align="left",be.position=10+Math.min(80,Math.floor(Ke*8/32)*10),ye.push(be))}return ie&&ye.length&&(ye.sort((nt,it)=>nt.line==="auto"||it.line==="auto"?0:nt.line>8&&it.line>8?it.line-nt.line:nt.line-it.line),ye.forEach(nt=>addCueToTrack(ie,nt))),ye}},defaultLoadPolicy={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},hlsDefaultConfig=_objectSpread2(_objectSpread2({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:XhrLoader,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:AbrController,bufferController:BufferController,capLevelController:CapLevelController,errorController:ErrorController,fpsController:FPSController,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,useMediaCapabilities:!0,certLoadPolicy:{default:defaultLoadPolicy},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},timelineConfig()),{},{subtitleStreamController:SubtitleStreamController,subtitleTrackController:SubtitleTrackController,timelineController:TimelineController,audioStreamController:AudioStreamController,audioTrackController:AudioTrackController,emeController:EMEController,cmcdController:CMCDController,contentSteeringController:ContentSteeringController});function timelineConfig(){return{cueHandler:Cues,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function mergeConfig(ie,Z){if((Z.liveSyncDurationCount||Z.liveMaxLatencyDurationCount)&&(Z.liveSyncDuration||Z.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(Z.liveMaxLatencyDurationCount!==void 0&&(Z.liveSyncDurationCount===void 0||Z.liveMaxLatencyDurationCount<=Z.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(Z.liveMaxLatencyDuration!==void 0&&(Z.liveSyncDuration===void 0||Z.liveMaxLatencyDuration<=Z.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const ee=deepCpy(ie),ae=["manifest","level","frag"],ye=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return ae.forEach(ve=>{const be=`${ve==="level"?"playlist":ve}LoadPolicy`,Ye=Z[be]===void 0,Ke=[];ye.forEach(Xe=>{const Je=`${ve}Loading${Xe}`,rt=Z[Je];if(rt!==void 0&&Ye){Ke.push(Je);const nt=ee[be].default;switch(Z[be]={default:nt},Xe){case"TimeOut":nt.maxLoadTimeMs=rt,nt.maxTimeToFirstByteMs=rt;break;case"MaxRetry":nt.errorRetry.maxNumRetry=rt,nt.timeoutRetry.maxNumRetry=rt;break;case"RetryDelay":nt.errorRetry.retryDelayMs=rt,nt.timeoutRetry.retryDelayMs=rt;break;case"MaxRetryTimeout":nt.errorRetry.maxRetryDelayMs=rt,nt.timeoutRetry.maxRetryDelayMs=rt;break}}}),Ke.length&&logger.warn(`hls.js config: "${Ke.join('", "')}" setting(s) are deprecated, use "${be}": ${JSON.stringify(Z[be])}`)}),_objectSpread2(_objectSpread2({},ee),Z)}function deepCpy(ie){return ie&&typeof ie=="object"?Array.isArray(ie)?ie.map(deepCpy):Object.keys(ie).reduce((Z,ee)=>(Z[ee]=deepCpy(ie[ee]),Z),{}):ie}function enableStreamingMode(ie){const Z=ie.loader;Z!==FetchLoader&&Z!==XhrLoader?(logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),ie.progressive=!1):fetchSupported()&&(ie.loader=FetchLoader,ie.progressive=!0,ie.enableSoftwareAES=!0,logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}let chromeOrFirefox;class LevelController extends BasePlaylistController{constructor(Z,ee){super(Z,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=ee,this._registerListeners()}_registerListeners(){const{hls:Z}=this;Z.on(Events.MANIFEST_LOADING,this.onManifestLoading,this),Z.on(Events.MANIFEST_LOADED,this.onManifestLoaded,this),Z.on(Events.LEVEL_LOADED,this.onLevelLoaded,this),Z.on(Events.LEVELS_UPDATED,this.onLevelsUpdated,this),Z.on(Events.FRAG_BUFFERED,this.onFragBuffered,this),Z.on(Events.ERROR,this.onError,this)}_unregisterListeners(){const{hls:Z}=this;Z.off(Events.MANIFEST_LOADING,this.onManifestLoading,this),Z.off(Events.MANIFEST_LOADED,this.onManifestLoaded,this),Z.off(Events.LEVEL_LOADED,this.onLevelLoaded,this),Z.off(Events.LEVELS_UPDATED,this.onLevelsUpdated,this),Z.off(Events.FRAG_BUFFERED,this.onFragBuffered,this),Z.off(Events.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(Z=>{Z.loadError=0,Z.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(Z,ee){this.resetLevels()}onManifestLoaded(Z,ee){const ae=this.hls.config.preferManagedMediaSource,ye=[],ve={},be={};let Ye=!1,Ke=!1,Xe=!1;ee.levels.forEach(Je=>{var rt,nt;const it=Je.attrs;let{audioCodec:lt,videoCodec:ct}=Je;((rt=lt)==null?void 0:rt.indexOf("mp4a.40.34"))!==-1&&(chromeOrFirefox||(chromeOrFirefox=/chrome|firefox/i.test(navigator.userAgent)),chromeOrFirefox&&(Je.audioCodec=lt=void 0)),lt&&(Je.audioCodec=lt=getCodecCompatibleName(lt,ae)),((nt=ct)==null?void 0:nt.indexOf("avc1"))===0&&(ct=Je.videoCodec=convertAVC1ToAVCOTI(ct));const{width:ot,height:dt,unknownCodecs:ft}=Je;if(Ye||(Ye=!!(ot&&dt)),Ke||(Ke=!!ct),Xe||(Xe=!!lt),ft!=null&&ft.length||lt&&!areCodecsMediaSourceSupported(lt,"audio",ae)||ct&&!areCodecsMediaSourceSupported(ct,"video",ae))return;const{CODECS:gt,"FRAME-RATE":mt,"HDCP-LEVEL":Yr,"PATHWAY-ID":Qr,RESOLUTION:Xr,"VIDEO-RANGE":Jr}=it,ai=`${`${Qr||"."}-`}${Je.bitrate}-${Xr}-${mt}-${gt}-${Jr}-${Yr}`;if(ve[ai])if(ve[ai].uri!==Je.url&&!Je.attrs["PATHWAY-ID"]){const oi=be[ai]+=1;Je.attrs["PATHWAY-ID"]=new Array(oi+1).join(".");const ni=new Level(Je);ve[ai]=ni,ye.push(ni)}else ve[ai].addGroupId("audio",it.AUDIO),ve[ai].addGroupId("text",it.SUBTITLES);else{const oi=new Level(Je);ve[ai]=oi,be[ai]=1,ye.push(oi)}}),this.filterAndSortMediaOptions(ye,ee,Ye,Ke,Xe)}filterAndSortMediaOptions(Z,ee,ae,ye,ve){let be=[],Ye=[],Ke=Z;if((ae||ye)&&ve&&(Ke=Ke.filter(({videoCodec:lt,videoRange:ct,width:ot,height:dt})=>(!!lt||!!(ot&&dt))&&isVideoRange(ct))),Ke.length===0){Promise.resolve().then(()=>{if(this.hls){ee.levels.length&&this.warn(`One or more CODECS in variant not supported: ${JSON.stringify(ee.levels[0].attrs)}`);const lt=new Error("no level with compatible codecs found in manifest");this.hls.trigger(Events.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:ee.url,error:lt,reason:lt.message})}});return}if(ee.audioTracks){const{preferManagedMediaSource:lt}=this.hls.config;be=ee.audioTracks.filter(ct=>!ct.audioCodec||areCodecsMediaSourceSupported(ct.audioCodec,"audio",lt)),assignTrackIdsByGroup(be)}ee.subtitles&&(Ye=ee.subtitles,assignTrackIdsByGroup(Ye));const Xe=Ke.slice(0);Ke.sort((lt,ct)=>{if(lt.attrs["HDCP-LEVEL"]!==ct.attrs["HDCP-LEVEL"])return(lt.attrs["HDCP-LEVEL"]||"")>(ct.attrs["HDCP-LEVEL"]||"")?1:-1;if(ae&<.height!==ct.height)return lt.height-ct.height;if(lt.frameRate!==ct.frameRate)return lt.frameRate-ct.frameRate;if(lt.videoRange!==ct.videoRange)return VideoRangeValues.indexOf(lt.videoRange)-VideoRangeValues.indexOf(ct.videoRange);if(lt.videoCodec!==ct.videoCodec){const ot=videoCodecPreferenceValue(lt.videoCodec),dt=videoCodecPreferenceValue(ct.videoCodec);if(ot!==dt)return dt-ot}if(lt.uri===ct.uri&<.codecSet!==ct.codecSet){const ot=codecsSetSelectionPreferenceValue(lt.codecSet),dt=codecsSetSelectionPreferenceValue(ct.codecSet);if(ot!==dt)return dt-ot}return lt.averageBitrate!==ct.averageBitrate?lt.averageBitrate-ct.averageBitrate:0});let Je=Xe[0];if(this.steering&&(Ke=this.steering.filterParsedLevels(Ke),Ke.length!==Xe.length)){for(let lt=0;ltot&&ot===hlsDefaultConfig.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=dt)}break}const nt=ve&&!ye,it={levels:Ke,audioTracks:be,subtitleTracks:Ye,sessionData:ee.sessionData,sessionKeys:ee.sessionKeys,firstLevel:this._firstLevel,stats:ee.stats,audio:ve,video:ye,altAudio:!nt&&be.some(lt=>!!lt.url)};this.hls.trigger(Events.MANIFEST_PARSED,it),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return this._levels.length===0?null:this._levels}get level(){return this.currentLevelIndex}set level(Z){const ee=this._levels;if(ee.length===0)return;if(Z<0||Z>=ee.length){const Je=new Error("invalid level idx"),rt=Z<0;if(this.hls.trigger(Events.ERROR,{type:ErrorTypes.OTHER_ERROR,details:ErrorDetails.LEVEL_SWITCH_ERROR,level:Z,fatal:rt,error:Je,reason:Je.message}),rt)return;Z=Math.min(Z,ee.length-1)}const ae=this.currentLevelIndex,ye=this.currentLevel,ve=ye?ye.attrs["PATHWAY-ID"]:void 0,be=ee[Z],Ye=be.attrs["PATHWAY-ID"];if(this.currentLevelIndex=Z,this.currentLevel=be,ae===Z&&be.details&&ye&&ve===Ye)return;this.log(`Switching to level ${Z} (${be.height?be.height+"p ":""}${be.videoRange?be.videoRange+" ":""}${be.codecSet?be.codecSet+" ":""}@${be.bitrate})${Ye?" with Pathway "+Ye:""} from level ${ae}${ve?" with Pathway "+ve:""}`);const Ke={level:Z,attrs:be.attrs,details:be.details,bitrate:be.bitrate,averageBitrate:be.averageBitrate,maxBitrate:be.maxBitrate,realBitrate:be.realBitrate,width:be.width,height:be.height,codecSet:be.codecSet,audioCodec:be.audioCodec,videoCodec:be.videoCodec,audioGroups:be.audioGroups,subtitleGroups:be.subtitleGroups,loaded:be.loaded,loadError:be.loadError,fragmentError:be.fragmentError,name:be.name,id:be.id,uri:be.uri,url:be.url,urlId:0,audioGroupIds:be.audioGroupIds,textGroupIds:be.textGroupIds};this.hls.trigger(Events.LEVEL_SWITCHING,Ke);const Xe=be.details;if(!Xe||Xe.live){const Je=this.switchParams(be.uri,ye==null?void 0:ye.details);this.loadPlaylist(Je)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(Z){this.manualLevelIndex=Z,this._startLevel===void 0&&(this._startLevel=Z),Z!==-1&&(this.level=Z)}get firstLevel(){return this._firstLevel}set firstLevel(Z){this._firstLevel=Z}get startLevel(){if(this._startLevel===void 0){const Z=this.hls.config.startLevel;return Z!==void 0?Z:this.hls.firstAutoLevel}return this._startLevel}set startLevel(Z){this._startLevel=Z}onError(Z,ee){ee.fatal||!ee.context||ee.context.type===PlaylistContextType.LEVEL&&ee.context.level===this.level&&this.checkRetry(ee)}onFragBuffered(Z,{frag:ee}){if(ee!==void 0&&ee.type===PlaylistLevelType.MAIN){const ae=ee.elementaryStreams;if(!Object.keys(ae).some(ve=>!!ae[ve]))return;const ye=this._levels[ee.level];ye!=null&&ye.loadError&&(this.log(`Resetting level error count of ${ye.loadError} on frag buffered`),ye.loadError=0)}}onLevelLoaded(Z,ee){var ae;const{level:ye,details:ve}=ee,be=this._levels[ye];if(!be){var Ye;this.warn(`Invalid level index ${ye}`),(Ye=ee.deliveryDirectives)!=null&&Ye.skip&&(ve.deltaUpdateFailed=!0);return}ye===this.currentLevelIndex?(be.fragmentError===0&&(be.loadError=0),this.playlistLoaded(ye,ee,be.details)):(ae=ee.deliveryDirectives)!=null&&ae.skip&&(ve.deltaUpdateFailed=!0)}loadPlaylist(Z){super.loadPlaylist();const ee=this.currentLevelIndex,ae=this.currentLevel;if(ae&&this.shouldLoadPlaylist(ae)){let ye=ae.uri;if(Z)try{ye=Z.addDirectives(ye)}catch(be){this.warn(`Could not construct new URL with HLS Delivery Directives: ${be}`)}const ve=ae.attrs["PATHWAY-ID"];this.log(`Loading level index ${ee}${(Z==null?void 0:Z.msn)!==void 0?" at sn "+Z.msn+" part "+Z.part:""} with${ve?" Pathway "+ve:""} ${ye}`),this.clearTimer(),this.hls.trigger(Events.LEVEL_LOADING,{url:ye,level:ee,pathwayId:ae.attrs["PATHWAY-ID"],id:0,deliveryDirectives:Z||null})}}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(Z){this.level=Z,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=Z)}removeLevel(Z){var ee;const ae=this._levels.filter((ye,ve)=>ve!==Z?!0:(this.steering&&this.steering.removeLevel(ye),ye===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,ye.details&&ye.details.fragments.forEach(be=>be.level=-1)),!1));reassignFragmentLevelIndexes(ae),this._levels=ae,this.currentLevelIndex>-1&&(ee=this.currentLevel)!=null&&ee.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.hls.trigger(Events.LEVELS_UPDATED,{levels:ae})}onLevelsUpdated(Z,{levels:ee}){this._levels=ee}checkMaxAutoUpdated(){const{autoLevelCapping:Z,maxAutoLevel:ee,maxHdcpLevel:ae}=this.hls;this._maxAutoLevel!==ee&&(this._maxAutoLevel=ee,this.hls.trigger(Events.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:Z,levels:this.levels,maxAutoLevel:ee,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:ae}))}}function assignTrackIdsByGroup(ie){const Z={};ie.forEach(ee=>{const ae=ee.groupId||"";ee.id=Z[ae]=Z[ae]||0,Z[ae]++})}class KeyLoader{constructor(Z){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=Z}abort(Z){for(const ae in this.keyUriToKeyInfo){const ye=this.keyUriToKeyInfo[ae].loader;if(ye){var ee;if(Z&&Z!==((ee=ye.context)==null?void 0:ee.frag.type))return;ye.abort()}}}detach(){for(const Z in this.keyUriToKeyInfo){const ee=this.keyUriToKeyInfo[Z];(ee.mediaKeySessionContext||ee.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[Z]}}destroy(){this.detach();for(const Z in this.keyUriToKeyInfo){const ee=this.keyUriToKeyInfo[Z].loader;ee&&ee.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(Z,ee=ErrorDetails.KEY_LOAD_ERROR,ae,ye,ve){return new LoadError({type:ErrorTypes.NETWORK_ERROR,details:ee,fatal:!1,frag:Z,response:ve,error:ae,networkDetails:ye})}loadClear(Z,ee){if(this.emeController&&this.config.emeEnabled){const{sn:ae,cc:ye}=Z;for(let ve=0;ve{be.setKeyFormat(Ye)});break}}}}load(Z){return!Z.decryptdata&&Z.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(Z).then(ee=>this.loadInternal(Z,ee)):this.loadInternal(Z)}loadInternal(Z,ee){var ae,ye;ee&&Z.setKeyFormat(ee);const ve=Z.decryptdata;if(!ve){const Xe=new Error(ee?`Expected frag.decryptdata to be defined after setting format ${ee}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(Z,ErrorDetails.KEY_LOAD_ERROR,Xe))}const be=ve.uri;if(!be)return Promise.reject(this.createKeyLoadError(Z,ErrorDetails.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${be}"`)));let Ye=this.keyUriToKeyInfo[be];if((ae=Ye)!=null&&ae.decryptdata.key)return ve.key=Ye.decryptdata.key,Promise.resolve({frag:Z,keyInfo:Ye});if((ye=Ye)!=null&&ye.keyLoadPromise){var Ke;switch((Ke=Ye.mediaKeySessionContext)==null?void 0:Ke.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return Ye.keyLoadPromise.then(Xe=>(ve.key=Xe.keyInfo.decryptdata.key,{frag:Z,keyInfo:Ye}))}}switch(Ye=this.keyUriToKeyInfo[be]={decryptdata:ve,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},ve.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return ve.keyFormat==="identity"?this.loadKeyHTTP(Ye,Z):this.loadKeyEME(Ye,Z);case"AES-128":return this.loadKeyHTTP(Ye,Z);default:return Promise.reject(this.createKeyLoadError(Z,ErrorDetails.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${ve.method}"`)))}}loadKeyEME(Z,ee){const ae={frag:ee,keyInfo:Z};if(this.emeController&&this.config.emeEnabled){const ye=this.emeController.loadKey(ae);if(ye)return(Z.keyLoadPromise=ye.then(ve=>(Z.mediaKeySessionContext=ve,ae))).catch(ve=>{throw Z.keyLoadPromise=null,ve})}return Promise.resolve(ae)}loadKeyHTTP(Z,ee){const ae=this.config,ye=ae.loader,ve=new ye(ae);return ee.keyLoader=Z.loader=ve,Z.keyLoadPromise=new Promise((be,Ye)=>{const Ke={keyInfo:Z,frag:ee,responseType:"arraybuffer",url:Z.decryptdata.uri},Xe=ae.keyLoadPolicy.default,Je={loadPolicy:Xe,timeout:Xe.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},rt={onSuccess:(nt,it,lt,ct)=>{const{frag:ot,keyInfo:dt,url:ft}=lt;if(!ot.decryptdata||dt!==this.keyUriToKeyInfo[ft])return Ye(this.createKeyLoadError(ot,ErrorDetails.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),ct));dt.decryptdata.key=ot.decryptdata.key=new Uint8Array(nt.data),ot.keyLoader=null,dt.loader=null,be({frag:ot,keyInfo:dt})},onError:(nt,it,lt,ct)=>{this.resetLoader(it),Ye(this.createKeyLoadError(ee,ErrorDetails.KEY_LOAD_ERROR,new Error(`HTTP Error ${nt.code} loading key ${nt.text}`),lt,_objectSpread2({url:Ke.url,data:void 0},nt)))},onTimeout:(nt,it,lt)=>{this.resetLoader(it),Ye(this.createKeyLoadError(ee,ErrorDetails.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),lt))},onAbort:(nt,it,lt)=>{this.resetLoader(it),Ye(this.createKeyLoadError(ee,ErrorDetails.INTERNAL_ABORTED,new Error("key loading aborted"),lt))}};ve.load(Ke,Je,rt)})}resetLoader(Z){const{frag:ee,keyInfo:ae,url:ye}=Z,ve=ae.loader;ee.keyLoader===ve&&(ee.keyLoader=null,ae.loader=null),delete this.keyUriToKeyInfo[ye],ve&&ve.destroy()}}function getSourceBuffer(){return self.SourceBuffer||self.WebKitSourceBuffer}function isMSESupported(){if(!getMediaSource())return!1;const ie=getSourceBuffer();return!ie||ie.prototype&&typeof ie.prototype.appendBuffer=="function"&&typeof ie.prototype.remove=="function"}function isSupported(){if(!isMSESupported())return!1;const ie=getMediaSource();return typeof(ie==null?void 0:ie.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(Z=>ie.isTypeSupported(mimeTypeForCodec(Z,"video")))||["mp4a.40.2","fLaC"].some(Z=>ie.isTypeSupported(mimeTypeForCodec(Z,"audio"))))}function changeTypeSupported(){var ie;const Z=getSourceBuffer();return typeof(Z==null||(ie=Z.prototype)==null?void 0:ie.changeType)=="function"}const STALL_MINIMUM_DURATION_MS=250,MAX_START_GAP_JUMP=2,SKIP_BUFFER_HOLE_STEP_SECONDS=.1,SKIP_BUFFER_RANGE_START=.05;class GapController{constructor(Z,ee,ae,ye){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=Z,this.media=ee,this.fragmentTracker=ae,this.hls=ye}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(Z,ee){const{config:ae,media:ye,stalled:ve}=this;if(ye===null)return;const{currentTime:be,seeking:Ye}=ye,Ke=this.seeking&&!Ye,Xe=!this.seeking&&Ye;if(this.seeking=Ye,be!==Z){if(this.moved=!0,Ye||(this.nudgeRetry=0),ve!==null){if(this.stallReported){const ot=self.performance.now()-ve;logger.warn(`playback not stuck anymore @${be}, after ${Math.round(ot)}ms`),this.stallReported=!1}this.stalled=null}return}if(Xe||Ke){this.stalled=null;return}if(ye.paused&&!Ye||ye.ended||ye.playbackRate===0||!BufferHelper.getBuffered(ye).length){this.nudgeRetry=0;return}const Je=BufferHelper.bufferInfo(ye,be,0),rt=Je.nextStart||0;if(Ye){const ot=Je.len>MAX_START_GAP_JUMP,dt=!rt||ee&&ee.start<=be||rt-be>MAX_START_GAP_JUMP&&!this.fragmentTracker.getPartialFragment(be);if(ot||dt)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var nt;if(!(Je.len>0)&&!rt)return;const ot=Math.max(rt,Je.start||0)-be,dt=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,ft=!(dt==null||(nt=dt.details)==null)&&nt.live?dt.details.targetduration*2:MAX_START_GAP_JUMP,gt=this.fragmentTracker.getPartialFragment(be);if(ot>0&&(ot<=ft||gt)){ye.paused||this._trySkipBufferHole(gt);return}}const it=self.performance.now();if(ve===null){this.stalled=it;return}const lt=it-ve;if(!Ye&<>=STALL_MINIMUM_DURATION_MS&&(this._reportStall(Je),!this.media))return;const ct=BufferHelper.bufferInfo(ye,be,ae.maxBufferHole);this._tryFixBufferStall(ct,lt)}_tryFixBufferStall(Z,ee){const{config:ae,fragmentTracker:ye,media:ve}=this;if(ve===null)return;const be=ve.currentTime,Ye=ye.getPartialFragment(be);Ye&&(this._trySkipBufferHole(Ye)||!this.media)||(Z.len>ae.maxBufferHole||Z.nextStart&&Z.nextStart-beae.highBufferWatchdogPeriod*1e3&&(logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(Z){const{hls:ee,media:ae,stallReported:ye}=this;if(!ye&&ae){this.stallReported=!0;const ve=new Error(`Playback stalling at @${ae.currentTime} due to low buffer (${JSON.stringify(Z)})`);logger.warn(ve.message),ee.trigger(Events.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,error:ve,buffer:Z.len})}}_trySkipBufferHole(Z){const{config:ee,hls:ae,media:ye}=this;if(ye===null)return 0;const ve=ye.currentTime,be=BufferHelper.bufferInfo(ye,ve,0),Ye=ve0&&be.len<1&&ye.readyState<3,Je=Ye-ve;if(Je>0&&(Ke||Xe)){if(Je>ee.maxBufferHole){const{fragmentTracker:nt}=this;let it=!1;if(ve===0){const lt=nt.getAppendedFrag(0,PlaylistLevelType.MAIN);lt&&Ye1?(ye=0,this.bitrateTest=!0):ye=ae.firstAutoLevel),this.level=ae.nextLoadLevel=ye,this.loadedmetadata=!1}ee>0&&Z===-1&&(this.log(`Override startPosition with lastCurrentTime @${ee.toFixed(3)}`),Z=ee),this.state=State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=Z,this.tick()}else this._forceStartLoad=!0,this.state=State.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case State.WAITING_LEVEL:{const{levels:ee,level:ae}=this,ye=ee==null?void 0:ee[ae],ve=ye==null?void 0:ye.details;if(ve&&(!ve.live||this.levelLastLoaded===ye)){if(this.waitForCdnTuneIn(ve))break;this.state=State.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=State.IDLE;break}break}case State.FRAG_LOADING_WAITING_RETRY:{var Z;const ee=self.performance.now(),ae=this.retryDate;if(!ae||ee>=ae||(Z=this.media)!=null&&Z.seeking){const{levels:ye,level:ve}=this,be=ye==null?void 0:ye[ve];this.resetStartWhenNotLoaded(be||null),this.state=State.IDLE}}break}this.state===State.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:Z,levelLastLoaded:ee,levels:ae,media:ye}=this,{config:ve,nextLoadLevel:be}=Z;if(ee===null||!ye&&(this.startFragRequested||!ve.startFragPrefetch)||this.altAudio&&this.audioOnly||!(ae!=null&&ae[be]))return;const Ye=ae[be],Ke=this.getMainFwdBufferInfo();if(Ke===null)return;const Xe=this.getLevelDetails();if(Xe&&this._streamEnded(Ke,Xe)){const ot={};this.altAudio&&(ot.type="video"),this.hls.trigger(Events.BUFFER_EOS,ot),this.state=State.ENDED;return}Z.loadLevel!==be&&Z.manualLevel===-1&&this.log(`Adapting to level ${be} from level ${this.level}`),this.level=Z.nextLoadLevel=be;const Je=Ye.details;if(!Je||this.state===State.WAITING_LEVEL||Je.live&&this.levelLastLoaded!==Ye){this.level=be,this.state=State.WAITING_LEVEL;return}const rt=Ke.len,nt=this.getMaxBufferLength(Ye.maxBitrate);if(rt>=nt)return;this.backtrackFragment&&this.backtrackFragment.start>Ke.end&&(this.backtrackFragment=null);const it=this.backtrackFragment?this.backtrackFragment.start:Ke.end;let lt=this.getNextFragment(it,Je);if(this.couldBacktrack&&!this.fragPrevious&<&<.sn!=="initSegment"&&this.fragmentTracker.getState(lt)!==FragmentState.OK){var ct;const ot=((ct=this.backtrackFragment)!=null?ct:lt).sn-Je.startSN,dt=Je.fragments[ot-1];dt&<.cc===dt.cc&&(lt=dt,this.fragmentTracker.removeFragment(dt))}else this.backtrackFragment&&Ke.len&&(this.backtrackFragment=null);if(lt&&this.isLoopLoading(lt,it)){if(!lt.gap){const ot=this.audioOnly&&!this.altAudio?ElementaryStreamTypes.AUDIO:ElementaryStreamTypes.VIDEO,dt=(ot===ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;dt&&this.afterBufferFlushed(dt,ot,PlaylistLevelType.MAIN)}lt=this.getNextFragmentLoopLoading(lt,Je,Ke,PlaylistLevelType.MAIN,nt)}lt&&(lt.initSegment&&!lt.initSegment.data&&!this.bitrateTest&&(lt=lt.initSegment),this.loadFragment(lt,Ye,it))}loadFragment(Z,ee,ae){const ye=this.fragmentTracker.getState(Z);this.fragCurrent=Z,ye===FragmentState.NOT_LOADED||ye===FragmentState.PARTIAL?Z.sn==="initSegment"?this._loadInitSegment(Z,ee):this.bitrateTest?(this.log(`Fragment ${Z.sn} of level ${Z.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(Z,ee)):(this.startFragRequested=!0,super.loadFragment(Z,ee,ae)):this.clearTrackerIfNeeded(Z)}getBufferedFrag(Z){return this.fragmentTracker.getBufferedFrag(Z,PlaylistLevelType.MAIN)}followingBufferedFrag(Z){return Z?this.getBufferedFrag(Z.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:Z,media:ee}=this;if(ee!=null&&ee.readyState){let ae;const ye=this.getAppendedFrag(ee.currentTime);ye&&ye.start>1&&this.flushMainBuffer(0,ye.start-1);const ve=this.getLevelDetails();if(ve!=null&&ve.live){const Ye=this.getMainFwdBufferInfo();if(!Ye||Ye.len{const be=ve.audioCodec;be&&(ae=ae||be.indexOf("mp4a.40.2")!==-1,ye=ye||be.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=ae&&ye&&!changeTypeSupported(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=ee.levels,this.startFragRequested=!1}onLevelLoading(Z,ee){const{levels:ae}=this;if(!ae||this.state!==State.IDLE)return;const ye=ae[ee.level];(!ye.details||ye.details.live&&this.levelLastLoaded!==ye||this.waitForCdnTuneIn(ye.details))&&(this.state=State.WAITING_LEVEL)}onLevelLoaded(Z,ee){var ae;const{levels:ye}=this,ve=ee.level,be=ee.details,Ye=be.totalduration;if(!ye){this.warn(`Levels were reset while loading level ${ve}`);return}this.log(`Level ${ve} loaded [${be.startSN},${be.endSN}]${be.lastPartSn?`[part-${be.lastPartSn}-${be.lastPartIndex}]`:""}, cc [${be.startCC}, ${be.endCC}] duration:${Ye}`);const Ke=ye[ve],Xe=this.fragCurrent;Xe&&(this.state===State.FRAG_LOADING||this.state===State.FRAG_LOADING_WAITING_RETRY)&&Xe.level!==ee.level&&Xe.loader&&this.abortCurrentFrag();let Je=0;if(be.live||(ae=Ke.details)!=null&&ae.live){var rt;if(this.checkLiveUpdate(be),be.deltaUpdateFailed)return;Je=this.alignPlaylists(be,Ke.details,(rt=this.levelLastLoaded)==null?void 0:rt.details)}if(Ke.details=be,this.levelLastLoaded=Ke,this.hls.trigger(Events.LEVEL_UPDATED,{details:be,level:ve}),this.state===State.WAITING_LEVEL){if(this.waitForCdnTuneIn(be))return;this.state=State.IDLE}this.startFragRequested?be.live&&this.synchronizeToLiveEdge(be):this.setStartPosition(be,Je),this.tick()}_handleFragmentLoadProgress(Z){var ee;const{frag:ae,part:ye,payload:ve}=Z,{levels:be}=this;if(!be){this.warn(`Levels were reset while fragment load was in progress. Fragment ${ae.sn} of level ${ae.level} will not be buffered`);return}const Ye=be[ae.level],Ke=Ye.details;if(!Ke){this.warn(`Dropping fragment ${ae.sn} of level ${ae.level} after level details were reset`),this.fragmentTracker.removeFragment(ae);return}const Xe=Ye.videoCodec,Je=Ke.PTSKnown||!Ke.live,rt=(ee=ae.initSegment)==null?void 0:ee.data,nt=this._getAudioCodec(Ye),it=this.transmuxer=this.transmuxer||new TransmuxerInterface(this.hls,PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),lt=ye?ye.index:-1,ct=lt!==-1,ot=new ChunkMetadata(ae.level,ae.sn,ae.stats.chunkCount,ve.byteLength,lt,ct),dt=this.initPTS[ae.cc];it.push(ve,rt,nt,Xe,ae,ye,Ke.totalduration,Je,ot,dt)}onAudioTrackSwitching(Z,ee){const ae=this.altAudio;if(!ee.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const ve=this.fragCurrent;ve&&(this.log("Switching to main audio track, cancel main fragment load"),ve.abortRequests(),this.fragmentTracker.removeFragment(ve)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const ye=this.hls;ae&&(ye.trigger(Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),ye.trigger(Events.AUDIO_TRACK_SWITCHED,ee)}}onAudioTrackSwitched(Z,ee){const ae=ee.id,ye=!!this.hls.audioTracks[ae].url;if(ye){const ve=this.videoBuffer;ve&&this.mediaBuffer!==ve&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=ve)}this.altAudio=ye,this.tick()}onBufferCreated(Z,ee){const ae=ee.tracks;let ye,ve,be=!1;for(const Ye in ae){const Ke=ae[Ye];if(Ke.id==="main"){if(ve=Ye,ye=Ke,Ye==="video"){const Xe=ae[Ye];Xe&&(this.videoBuffer=Xe.buffer)}}else be=!0}be&&ye?(this.log(`Alternate track found, use ${ve}.buffered to schedule main fragment loading`),this.mediaBuffer=ye.buffer):this.mediaBuffer=this.media}onFragBuffered(Z,ee){const{frag:ae,part:ye}=ee;if(ae&&ae.type!==PlaylistLevelType.MAIN)return;if(this.fragContextChanged(ae)){this.warn(`Fragment ${ae.sn}${ye?" p: "+ye.index:""} of level ${ae.level} finished buffering, but was aborted. state: ${this.state}`),this.state===State.PARSED&&(this.state=State.IDLE);return}const ve=ye?ye.stats:ae.stats;this.fragLastKbps=Math.round(8*ve.total/(ve.buffering.end-ve.loading.first)),ae.sn!=="initSegment"&&(this.fragPrevious=ae),this.fragBufferedComplete(ae,ye)}onError(Z,ee){var ae;if(ee.fatal){this.state=State.ERROR;return}switch(ee.details){case ErrorDetails.FRAG_GAP:case ErrorDetails.FRAG_PARSING_ERROR:case ErrorDetails.FRAG_DECRYPT_ERROR:case ErrorDetails.FRAG_LOAD_ERROR:case ErrorDetails.FRAG_LOAD_TIMEOUT:case ErrorDetails.KEY_LOAD_ERROR:case ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(PlaylistLevelType.MAIN,ee);break;case ErrorDetails.LEVEL_LOAD_ERROR:case ErrorDetails.LEVEL_LOAD_TIMEOUT:case ErrorDetails.LEVEL_PARSING_ERROR:!ee.levelRetry&&this.state===State.WAITING_LEVEL&&((ae=ee.context)==null?void 0:ae.type)===PlaylistContextType.LEVEL&&(this.state=State.IDLE);break;case ErrorDetails.BUFFER_APPEND_ERROR:case ErrorDetails.BUFFER_FULL_ERROR:if(!ee.parent||ee.parent!=="main")return;if(ee.details===ErrorDetails.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(ee)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case ErrorDetails.INTERNAL_EXCEPTION:this.recoverWorkerError(ee);break}}checkBuffer(){const{media:Z,gapController:ee}=this;if(!(!Z||!ee||!Z.readyState)){if(this.loadedmetadata||!BufferHelper.getBuffered(Z).length){const ae=this.state!==State.IDLE?this.fragCurrent:null;ee.poll(this.lastCurrentTime,ae)}this.lastCurrentTime=Z.currentTime}}onFragLoadEmergencyAborted(){this.state=State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(Z,{type:ee}){if(ee!==ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){const ae=(ee===ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(ae,ee,PlaylistLevelType.MAIN),this.tick()}}onLevelsUpdated(Z,ee){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level),this.levels=ee.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:Z}=this;if(!Z)return;const ee=Z.currentTime;let ae=this.startPosition;if(ae>=0&&ee0&&(ve{const{hls:ye}=this;if(!ae||this.fragContextChanged(Z))return;ee.fragmentError=0,this.state=State.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const ve=Z.stats;ve.parsing.start=ve.parsing.end=ve.buffering.start=ve.buffering.end=self.performance.now(),ye.trigger(Events.FRAG_LOADED,ae),Z.bitrateTest=!1})}_handleTransmuxComplete(Z){var ee;const ae="main",{hls:ye}=this,{remuxResult:ve,chunkMeta:be}=Z,Ye=this.getCurrentContext(be);if(!Ye){this.resetWhenMissingContext(be);return}const{frag:Ke,part:Xe,level:Je}=Ye,{video:rt,text:nt,id3:it,initSegment:lt}=ve,{details:ct}=Je,ot=this.altAudio?void 0:ve.audio;if(this.fragContextChanged(Ke)){this.fragmentTracker.removeFragment(Ke);return}if(this.state=State.PARSING,lt){if(lt!=null&<.tracks){const gt=Ke.initSegment||Ke;this._bufferInitSegment(Je,lt.tracks,gt,be),ye.trigger(Events.FRAG_PARSING_INIT_SEGMENT,{frag:gt,id:ae,tracks:lt.tracks})}const dt=lt.initPTS,ft=lt.timescale;isFiniteNumber(dt)&&(this.initPTS[Ke.cc]={baseTime:dt,timescale:ft},ye.trigger(Events.INIT_PTS_FOUND,{frag:Ke,id:ae,initPTS:dt,timescale:ft}))}if(rt&&ct&&Ke.sn!=="initSegment"){const dt=ct.fragments[Ke.sn-1-ct.startSN],ft=Ke.sn===ct.startSN,gt=!dt||Ke.cc>dt.cc;if(ve.independent!==!1){const{startPTS:mt,endPTS:Yr,startDTS:Qr,endDTS:Xr}=rt;if(Xe)Xe.elementaryStreams[rt.type]={startPTS:mt,endPTS:Yr,startDTS:Qr,endDTS:Xr};else if(rt.firstKeyFrame&&rt.independent&&be.id===1&&!gt&&(this.couldBacktrack=!0),rt.dropped&&rt.independent){const Jr=this.getMainFwdBufferInfo(),ai=(Jr?Jr.end:this.getLoadPosition())+this.config.maxBufferHole,oi=rt.firstKeyFramePTS?rt.firstKeyFramePTS:mt;if(!ft&&aiMAX_START_GAP_JUMP&&(Ke.gap=!0);Ke.setElementaryStreamInfo(rt.type,mt,Yr,Qr,Xr),this.backtrackFragment&&(this.backtrackFragment=Ke),this.bufferFragmentData(rt,Ke,Xe,be,ft||gt)}else if(ft||gt)Ke.gap=!0;else{this.backtrack(Ke);return}}if(ot){const{startPTS:dt,endPTS:ft,startDTS:gt,endDTS:mt}=ot;Xe&&(Xe.elementaryStreams[ElementaryStreamTypes.AUDIO]={startPTS:dt,endPTS:ft,startDTS:gt,endDTS:mt}),Ke.setElementaryStreamInfo(ElementaryStreamTypes.AUDIO,dt,ft,gt,mt),this.bufferFragmentData(ot,Ke,Xe,be)}if(ct&&it!=null&&(ee=it.samples)!=null&&ee.length){const dt={id:ae,frag:Ke,details:ct,samples:it.samples};ye.trigger(Events.FRAG_PARSING_METADATA,dt)}if(ct&&nt){const dt={id:ae,frag:Ke,details:ct,samples:nt.samples};ye.trigger(Events.FRAG_PARSING_USERDATA,dt)}}_bufferInitSegment(Z,ee,ae,ye){if(this.state!==State.PARSING)return;this.audioOnly=!!ee.audio&&!ee.video,this.altAudio&&!this.audioOnly&&delete ee.audio;const{audio:ve,video:be,audiovideo:Ye}=ee;if(ve){let Ke=Z.audioCodec;const Xe=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(Ke&&(Ke.indexOf("mp4a.40.5")!==-1?Ke="mp4a.40.2":Ke="mp4a.40.5"),ve.metadata.channelCount!==1&&Xe.indexOf("firefox")===-1&&(Ke="mp4a.40.5")),Ke&&Ke.indexOf("mp4a.40.5")!==-1&&Xe.indexOf("android")!==-1&&ve.container!=="audio/mpeg"&&(Ke="mp4a.40.2",this.log(`Android: force audio codec to ${Ke}`)),Z.audioCodec&&Z.audioCodec!==Ke&&this.log(`Swapping manifest audio codec "${Z.audioCodec}" for "${Ke}"`),ve.levelCodec=Ke,ve.id="main",this.log(`Init audio buffer, container:${ve.container}, codecs[selected/level/parsed]=[${Ke||""}/${Z.audioCodec||""}/${ve.codec}]`)}be&&(be.levelCodec=Z.videoCodec,be.id="main",this.log(`Init video buffer, container:${be.container}, codecs[level/parsed]=[${Z.videoCodec||""}/${be.codec}]`)),Ye&&this.log(`Init audiovideo buffer, container:${Ye.container}, codecs[level/parsed]=[${Z.codecs}/${Ye.codec}]`),this.hls.trigger(Events.BUFFER_CODECS,ee),Object.keys(ee).forEach(Ke=>{const Xe=ee[Ke].initSegment;Xe!=null&&Xe.byteLength&&this.hls.trigger(Events.BUFFER_APPENDING,{type:Ke,data:Xe,frag:ae,part:null,chunkMeta:ye,parent:ae.type})}),this.tickImmediate()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,PlaylistLevelType.MAIN)}backtrack(Z){this.couldBacktrack=!0,this.backtrackFragment=Z,this.resetTransmuxer(),this.flushBufferGap(Z),this.fragmentTracker.removeFragment(Z),this.fragPrevious=null,this.nextLoadPosition=Z.start,this.state=State.IDLE}checkFragmentChanged(){const Z=this.media;let ee=null;if(Z&&Z.readyState>1&&Z.seeking===!1){const ae=Z.currentTime;if(BufferHelper.isBuffered(Z,ae)?ee=this.getAppendedFrag(ae):BufferHelper.isBuffered(Z,ae+.1)&&(ee=this.getAppendedFrag(ae+.1)),ee){this.backtrackFragment=null;const ye=this.fragPlaying,ve=ee.level;(!ye||ee.sn!==ye.sn||ye.level!==ve)&&(this.fragPlaying=ee,this.hls.trigger(Events.FRAG_CHANGED,{frag:ee}),(!ye||ye.level!==ve)&&this.hls.trigger(Events.LEVEL_SWITCHED,{level:ve}))}}}get nextLevel(){const Z=this.nextBufferedFrag;return Z?Z.level:-1}get currentFrag(){const Z=this.media;return Z?this.fragPlaying||this.getAppendedFrag(Z.currentTime):null}get currentProgramDateTime(){const Z=this.media;if(Z){const ee=Z.currentTime,ae=this.currentFrag;if(ae&&isFiniteNumber(ee)&&isFiniteNumber(ae.programDateTime)){const ye=ae.programDateTime+(ee-ae.start)*1e3;return new Date(ye)}}return null}get currentLevel(){const Z=this.currentFrag;return Z?Z.level:-1}get nextBufferedFrag(){const Z=this.currentFrag;return Z?this.followingBufferedFrag(Z):null}get forceStartLoad(){return this._forceStartLoad}}class Hls{static get version(){return"1.5.3"}static isMSESupported(){return isMSESupported()}static isSupported(){return isSupported()}static getMediaSource(){return getMediaSource()}static get Events(){return Events}static get ErrorTypes(){return ErrorTypes}static get ErrorDetails(){return ErrorDetails}static get DefaultConfig(){return Hls.defaultConfig?Hls.defaultConfig:hlsDefaultConfig}static set DefaultConfig(Z){Hls.defaultConfig=Z}constructor(Z={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this.started=!1,this._emitter=new EventEmitter,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,this.triggeringException=void 0,enableLogs(Z.debug||!1,"Hls instance");const ee=this.config=mergeConfig(Hls.DefaultConfig,Z);this.userConfig=Z,ee.progressive&&enableStreamingMode(ee);const{abrController:ae,bufferController:ye,capLevelController:ve,errorController:be,fpsController:Ye}=ee,Ke=new be(this),Xe=this.abrController=new ae(this),Je=this.bufferController=new ye(this),rt=this.capLevelController=new ve(this),nt=new Ye(this),it=new PlaylistLoader(this),lt=new ID3TrackController(this),ct=ee.contentSteeringController,ot=ct?new ct(this):null,dt=this.levelController=new LevelController(this,ot),ft=new FragmentTracker(this),gt=new KeyLoader(this.config),mt=this.streamController=new StreamController(this,ft,gt);rt.setStreamController(mt),nt.setStreamController(mt);const Yr=[it,dt,mt];ot&&Yr.splice(1,0,ot),this.networkControllers=Yr;const Qr=[Xe,Je,rt,nt,lt,ft];this.audioTrackController=this.createController(ee.audioTrackController,Yr);const Xr=ee.audioStreamController;Xr&&Yr.push(new Xr(this,ft,gt)),this.subtitleTrackController=this.createController(ee.subtitleTrackController,Yr);const Jr=ee.subtitleStreamController;Jr&&Yr.push(new Jr(this,ft,gt)),this.createController(ee.timelineController,Qr),gt.emeController=this.emeController=this.createController(ee.emeController,Qr),this.cmcdController=this.createController(ee.cmcdController,Qr),this.latencyController=this.createController(LatencyController,Qr),this.coreComponents=Qr,Yr.push(Ke);const ai=Ke.onErrorOut;typeof ai=="function"&&this.on(Events.ERROR,ai,Ke)}createController(Z,ee){if(Z){const ae=new Z(this);return ee&&ee.push(ae),ae}return null}on(Z,ee,ae=this){this._emitter.on(Z,ee,ae)}once(Z,ee,ae=this){this._emitter.once(Z,ee,ae)}removeAllListeners(Z){this._emitter.removeAllListeners(Z)}off(Z,ee,ae=this,ye){this._emitter.off(Z,ee,ae,ye)}listeners(Z){return this._emitter.listeners(Z)}emit(Z,ee,ae){return this._emitter.emit(Z,ee,ae)}trigger(Z,ee){if(this.config.debug)return this.emit(Z,Z,ee);try{return this.emit(Z,Z,ee)}catch(ae){if(logger.error("An internal error happened while handling event "+Z+'. Error message: "'+ae.message+'". Here is a stacktrace:',ae),!this.triggeringException){this.triggeringException=!0;const ye=Z===Events.ERROR;this.trigger(Events.ERROR,{type:ErrorTypes.OTHER_ERROR,details:ErrorDetails.INTERNAL_EXCEPTION,fatal:ye,event:Z,error:ae}),this.triggeringException=!1}}return!1}listenerCount(Z){return this._emitter.listenerCount(Z)}destroy(){logger.log("destroy"),this.trigger(Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(ee=>ee.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(ee=>ee.destroy()),this.coreComponents.length=0;const Z=this.config;Z.xhrSetup=Z.fetchSetup=void 0,this.userConfig=null}attachMedia(Z){logger.log("attachMedia"),this._media=Z,this.trigger(Events.MEDIA_ATTACHING,{media:Z})}detachMedia(){logger.log("detachMedia"),this.trigger(Events.MEDIA_DETACHING,void 0),this._media=null}loadSource(Z){this.stopLoad();const ee=this.media,ae=this.url,ye=this.url=urlToolkitExports.buildAbsoluteURL(self.location.href,Z,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,logger.log(`loadSource:${ye}`),ee&&ae&&(ae!==ye||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(ee)),this.trigger(Events.MANIFEST_LOADING,{url:Z})}startLoad(Z=-1){logger.log(`startLoad(${Z})`),this.started=!0,this.networkControllers.forEach(ee=>{ee.startLoad(Z)})}stopLoad(){logger.log("stopLoad"),this.started=!1,this.networkControllers.forEach(Z=>{Z.stopLoad()})}resumeBuffering(){this.started&&this.networkControllers.forEach(Z=>{"fragmentLoader"in Z&&Z.startLoad(-1)})}pauseBuffering(){this.networkControllers.forEach(Z=>{"fragmentLoader"in Z&&Z.stopLoad()})}swapAudioCodec(){logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){logger.log("recoverMediaError");const Z=this._media;this.detachMedia(),Z&&this.attachMedia(Z)}removeLevel(Z){this.levelController.removeLevel(Z)}get levels(){return this.levelController.levels||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(Z){logger.log(`set currentLevel:${Z}`),this.levelController.manualLevel=Z,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(Z){logger.log(`set nextLevel:${Z}`),this.levelController.manualLevel=Z,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(Z){logger.log(`set loadLevel:${Z}`),this.levelController.manualLevel=Z}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(Z){this.levelController.nextLoadLevel=Z}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(Z){logger.log(`set firstLevel:${Z}`),this.levelController.firstLevel=Z}get startLevel(){const Z=this.levelController.startLevel;return Z===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:Z}set startLevel(Z){logger.log(`set startLevel:${Z}`),Z!==-1&&(Z=Math.max(Z,this.minAutoLevel)),this.levelController.startLevel=Z}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(Z){const ee=!!Z;ee!==this.config.capLevelToPlayerSize&&(ee?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=ee)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:Z}=this.abrController;return Z?Z.getEstimate():NaN}set bandwidthEstimate(Z){this.abrController.resetEstimator(Z)}get ttfbEstimate(){const{bwEstimator:Z}=this.abrController;return Z?Z.getEstimateTTFB():NaN}set autoLevelCapping(Z){this._autoLevelCapping!==Z&&(logger.log(`set autoLevelCapping:${Z}`),this._autoLevelCapping=Z,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(Z){isHdcpLevel(Z)&&this._maxHdcpLevel!==Z&&(this._maxHdcpLevel=Z,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:Z,config:{minAutoBitrate:ee}}=this;if(!Z)return 0;const ae=Z.length;for(let ye=0;ye=ee)return ye;return 0}get maxAutoLevel(){const{levels:Z,autoLevelCapping:ee,maxHdcpLevel:ae}=this;let ye;if(ee===-1&&Z!=null&&Z.length?ye=Z.length-1:ye=ee,ae)for(let ve=ye;ve--;){const be=Z[ve].attrs["HDCP-LEVEL"];if(be&&be<=ae)return ve}return ye}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(Z){this.abrController.nextAutoLevel=Z}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}setAudioOption(Z){var ee;return(ee=this.audioTrackController)==null?void 0:ee.setAudioOption(Z)}setSubtitleOption(Z){var ee;return(ee=this.subtitleTrackController)==null||ee.setSubtitleOption(Z),null}get allAudioTracks(){const Z=this.audioTrackController;return Z?Z.allAudioTracks:[]}get audioTracks(){const Z=this.audioTrackController;return Z?Z.audioTracks:[]}get audioTrack(){const Z=this.audioTrackController;return Z?Z.audioTrack:-1}set audioTrack(Z){const ee=this.audioTrackController;ee&&(ee.audioTrack=Z)}get allSubtitleTracks(){const Z=this.subtitleTrackController;return Z?Z.allSubtitleTracks:[]}get subtitleTracks(){const Z=this.subtitleTrackController;return Z?Z.subtitleTracks:[]}get subtitleTrack(){const Z=this.subtitleTrackController;return Z?Z.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(Z){const ee=this.subtitleTrackController;ee&&(ee.subtitleTrack=Z)}get subtitleDisplay(){const Z=this.subtitleTrackController;return Z?Z.subtitleDisplay:!1}set subtitleDisplay(Z){const ee=this.subtitleTrackController;ee&&(ee.subtitleDisplay=Z)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(Z){this.config.lowLatencyMode=Z}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}Hls.defaultConfig=void 0;let getRandomValues;const rnds8=new Uint8Array(16);function rng(){if(!getRandomValues&&(getRandomValues=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!getRandomValues))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return getRandomValues(rnds8)}const byteToHex=[];for(let ie=0;ie<256;++ie)byteToHex.push((ie+256).toString(16).slice(1));function unsafeStringify(ie,Z=0){return byteToHex[ie[Z+0]]+byteToHex[ie[Z+1]]+byteToHex[ie[Z+2]]+byteToHex[ie[Z+3]]+"-"+byteToHex[ie[Z+4]]+byteToHex[ie[Z+5]]+"-"+byteToHex[ie[Z+6]]+byteToHex[ie[Z+7]]+"-"+byteToHex[ie[Z+8]]+byteToHex[ie[Z+9]]+"-"+byteToHex[ie[Z+10]]+byteToHex[ie[Z+11]]+byteToHex[ie[Z+12]]+byteToHex[ie[Z+13]]+byteToHex[ie[Z+14]]+byteToHex[ie[Z+15]]}const randomUUID=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),native={randomUUID};function v4(ie,Z,ee){if(native.randomUUID&&!Z&&!ie)return native.randomUUID();ie=ie||{};const ae=ie.random||(ie.rng||rng)();if(ae[6]=ae[6]&15|64,ae[8]=ae[8]&63|128,Z){ee=ee||0;for(let ye=0;ye<16;++ye)Z[ee+ye]=ae[ye];return Z}return unsafeStringify(ae)}function $db6c3485150b8e66$export$1ab7ae714698c4b8(ie){const[Z,ee]=reactExports.useState(void 0);return $9f79659886946c16$export$e5c5a5f917a5871c(()=>{if(ie){ee({width:ie.offsetWidth,height:ie.offsetHeight});const ae=new ResizeObserver(ye=>{if(!Array.isArray(ye)||!ye.length)return;const ve=ye[0];let be,Ye;if("borderBoxSize"in ve){const Ke=ve.borderBoxSize,Xe=Array.isArray(Ke)?Ke[0]:Ke;be=Xe.inlineSize,Ye=Xe.blockSize}else be=ie.offsetWidth,Ye=ie.offsetHeight;ee({width:be,height:Ye})});return ae.observe(ie,{box:"border-box"}),()=>ae.unobserve(ie)}else ee(void 0)},[ie]),Z}function $010c2913dbd2fe3d$export$5cae361ad82dce8b(ie){const Z=reactExports.useRef({value:ie,previous:ie});return reactExports.useMemo(()=>(Z.current.value!==ie&&(Z.current.previous=Z.current.value,Z.current.value=ie),Z.current.previous),[ie])}const $ce77a8961b41be9e$var$RADIO_NAME="Radio",[$ce77a8961b41be9e$var$createRadioContext,$ce77a8961b41be9e$export$67d2296460f1b002]=$c512c27ab02ef895$export$50c7b4e9d9f19c1($ce77a8961b41be9e$var$RADIO_NAME),[$ce77a8961b41be9e$var$RadioProvider,$ce77a8961b41be9e$var$useRadioContext]=$ce77a8961b41be9e$var$createRadioContext($ce77a8961b41be9e$var$RADIO_NAME),$ce77a8961b41be9e$export$d7b12c4107be0d61=reactExports.forwardRef((ie,Z)=>{const{__scopeRadio:ee,name:ae,checked:ye=!1,required:ve,disabled:be,value:Ye="on",onCheck:Ke,...Xe}=ie,[Je,rt]=reactExports.useState(null),nt=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,ct=>rt(ct)),it=reactExports.useRef(!1),lt=Je?!!Je.closest("form"):!0;return reactExports.createElement($ce77a8961b41be9e$var$RadioProvider,{scope:ee,checked:ye,disabled:be},reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button,_extends$1({type:"button",role:"radio","aria-checked":ye,"data-state":$ce77a8961b41be9e$var$getState(ye),"data-disabled":be?"":void 0,disabled:be,value:Ye},Xe,{ref:nt,onClick:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onClick,ct=>{ye||Ke==null||Ke(),lt&&(it.current=ct.isPropagationStopped(),it.current||ct.stopPropagation())})})),lt&&reactExports.createElement($ce77a8961b41be9e$var$BubbleInput,{control:Je,bubbles:!it.current,name:ae,value:Ye,checked:ye,required:ve,disabled:be,style:{transform:"translateX(-100%)"}}))}),$ce77a8961b41be9e$var$BubbleInput=ie=>{const{control:Z,checked:ee,bubbles:ae=!0,...ye}=ie,ve=reactExports.useRef(null),be=$010c2913dbd2fe3d$export$5cae361ad82dce8b(ee),Ye=$db6c3485150b8e66$export$1ab7ae714698c4b8(Z);return reactExports.useEffect(()=>{const Ke=ve.current,Xe=window.HTMLInputElement.prototype,Je=Object.getOwnPropertyDescriptor(Xe,"checked").set;if(be!==ee&&Je){const rt=new Event("click",{bubbles:ae});Je.call(Ke,ee),Ke.dispatchEvent(rt)}},[be,ee,ae]),reactExports.createElement("input",_extends$1({type:"radio","aria-hidden":!0,defaultChecked:ee},ye,{tabIndex:-1,ref:ve,style:{...ie.style,...Ye,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function $ce77a8961b41be9e$var$getState(ie){return ie?"checked":"unchecked"}const $f99a8c78507165f7$var$ARROW_KEYS=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],$f99a8c78507165f7$var$RADIO_GROUP_NAME="RadioGroup",[$f99a8c78507165f7$var$createRadioGroupContext,$f99a8c78507165f7$export$c547093f11b76da2]=$c512c27ab02ef895$export$50c7b4e9d9f19c1($f99a8c78507165f7$var$RADIO_GROUP_NAME,[$d7bdfb9eb0fdf311$export$c7109489551a4f4,$ce77a8961b41be9e$export$67d2296460f1b002]),$f99a8c78507165f7$var$useRovingFocusGroupScope=$d7bdfb9eb0fdf311$export$c7109489551a4f4(),$f99a8c78507165f7$var$useRadioScope=$ce77a8961b41be9e$export$67d2296460f1b002(),[$f99a8c78507165f7$var$RadioGroupProvider,$f99a8c78507165f7$var$useRadioGroupContext]=$f99a8c78507165f7$var$createRadioGroupContext($f99a8c78507165f7$var$RADIO_GROUP_NAME),$f99a8c78507165f7$export$a98f0dcb43a68a25=reactExports.forwardRef((ie,Z)=>{const{__scopeRadioGroup:ee,name:ae,defaultValue:ye,value:ve,required:be=!1,disabled:Ye=!1,orientation:Ke,dir:Xe,loop:Je=!0,onValueChange:rt,...nt}=ie,it=$f99a8c78507165f7$var$useRovingFocusGroupScope(ee),lt=$f631663db3294ace$export$b39126d51d94e6f3(Xe),[ct,ot]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:ve,defaultProp:ye,onChange:rt});return reactExports.createElement($f99a8c78507165f7$var$RadioGroupProvider,{scope:ee,name:ae,required:be,disabled:Ye,value:ct,onValueChange:ot},reactExports.createElement($d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9,_extends$1({asChild:!0},it,{orientation:Ke,dir:lt,loop:Je}),reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({role:"radiogroup","aria-required":be,"aria-orientation":Ke,"data-disabled":Ye?"":void 0,dir:lt},nt,{ref:Z}))))}),$f99a8c78507165f7$var$ITEM_NAME="RadioGroupItem",$f99a8c78507165f7$export$9f866c100ef519e4=reactExports.forwardRef((ie,Z)=>{const{__scopeRadioGroup:ee,disabled:ae,...ye}=ie,ve=$f99a8c78507165f7$var$useRadioGroupContext($f99a8c78507165f7$var$ITEM_NAME,ee),be=ve.disabled||ae,Ye=$f99a8c78507165f7$var$useRovingFocusGroupScope(ee),Ke=$f99a8c78507165f7$var$useRadioScope(ee),Xe=reactExports.useRef(null),Je=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,Xe),rt=ve.value===ye.value,nt=reactExports.useRef(!1);return reactExports.useEffect(()=>{const it=ct=>{$f99a8c78507165f7$var$ARROW_KEYS.includes(ct.key)&&(nt.current=!0)},lt=()=>nt.current=!1;return document.addEventListener("keydown",it),document.addEventListener("keyup",lt),()=>{document.removeEventListener("keydown",it),document.removeEventListener("keyup",lt)}},[]),reactExports.createElement($d7bdfb9eb0fdf311$export$6d08773d2e66f8f2,_extends$1({asChild:!0},Ye,{focusable:!be,active:rt}),reactExports.createElement($ce77a8961b41be9e$export$d7b12c4107be0d61,_extends$1({disabled:be,required:ve.required,checked:rt},Ke,ye,{name:ve.name,ref:Je,onCheck:()=>ve.onValueChange(ye.value),onKeyDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(it=>{it.key==="Enter"&&it.preventDefault()}),onFocus:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ye.onFocus,()=>{var it;nt.current&&((it=Xe.current)===null||it===void 0||it.click())})})))}),$f99a8c78507165f7$export$be92b6f5f03c0fe9=$f99a8c78507165f7$export$a98f0dcb43a68a25,$f99a8c78507165f7$export$6d08773d2e66f8f2=$f99a8c78507165f7$export$9f866c100ef519e4;function ParserError(ie,Z){this.message=ie,this.error=Z}ParserError.prototype=Object.create(Error.prototype);const TIMESTAMP_REGEXP=/([0-9]+)?:?([0-9]{2}):([0-9]{2}\.[0-9]{2,3})/;function parse$3(ie,Z){Z||(Z={});const{meta:ee=!1,strict:ae=!0}=Z;if(typeof ie!="string")throw new ParserError("Input must be a string");ie=ie.trim(),ie=ie.replace(/\r\n/g,` +`),ie=ie.replace(/\r/g,` +`);const ye=ie.split(` + +`),ve=ye.shift();if(!ve.startsWith("WEBVTT"))throw new ParserError('Must start with "WEBVTT"');const be=ve.split(` +`),Ye=be[0].replace("WEBVTT","");if(Ye.length>0&&Ye[0]!==" "&&Ye[0]!==" ")throw new ParserError("Header comment must start with space or tab");if(ye.length===0&&be.length===1)return{valid:!0,strict:ae,cues:[],errors:[]};if(!ee&&be.length>1&&be[1]!=="")throw new ParserError("Missing blank line after signature");const{cues:Ke,errors:Xe}=parseCues(ye,ae);if(ae&&Xe.length>0)throw Xe[0];const Je=ee?parseMeta(be):null,rt={valid:Xe.length===0,strict:ae,cues:Ke,errors:Xe};return ee&&(rt.meta=Je),rt}function parseMeta(ie){const Z={};return ie.slice(1).forEach(ee=>{const ae=ee.indexOf(":"),ye=ee.slice(0,ae).trim(),ve=ee.slice(ae+1).trim();Z[ye]=ve}),Object.keys(Z).length>0?Z:null}function parseCues(ie,Z){const ee=[];return{cues:ie.map((ae,ye)=>{try{return parseCue(ae,ye,Z)}catch(ve){return ee.push(ve),null}}).filter(Boolean),errors:ee}}function parseCue(ie,Z,ee){let ae="",ye=0,ve=.01,be="",Ye="";const Ke=ie.split(` +`).filter(Boolean);if(Ke.length>0&&Ke[0].trim().startsWith("NOTE"))return null;if(Ke.length===1&&!Ke[0].includes("-->"))throw new ParserError(`Cue identifier cannot be standalone (cue #${Z})`);if(Ke.length>1&&!(Ke[0].includes("-->")||Ke[1].includes("-->"))){const Je=`Cue identifier needs to be followed by timestamp (cue #${Z})`;throw new ParserError(Je)}Ke.length>1&&Ke[1].includes("-->")&&(ae=Ke.shift());const Xe=typeof Ke[0]=="string"&&Ke[0].split(" --> ");if(Xe.length!==2||!validTimestamp(Xe[0])||!validTimestamp(Xe[1]))throw new ParserError(`Invalid cue timestamp (cue #${Z})`);if(ye=parseTimestamp(Xe[0]),ve=parseTimestamp(Xe[1]),ee){if(ye>ve)throw new ParserError(`Start timestamp greater than end (cue #${Z})`);if(ve<=ye)throw new ParserError(`End must be greater than start (cue #${Z})`)}if(!ee&&ve{if(typeof ae[1]!="string")throw new CompilerError(`Metadata value for "${ae[0]}" must be string`);Z+=`${ae[0]}: ${ae[1]} +`})}let ee=null;return ie.cues.forEach((ae,ye)=>{if(ee&&ee>ae.start)throw new CompilerError(`Cue number ${ye} is not in chronological order`);ee=ae.start,Z+=` +`,Z+=compileCue(ae),Z+=` +`}),Z}function compileCue(ie){if(typeof ie!="object")throw new CompilerError("Cue malformed: not of type object");if(typeof ie.identifier!="string"&&typeof ie.identifier!="number"&&ie.identifier!==null)throw new CompilerError(`Cue malformed: identifier value is not a string. + ${JSON.stringify(ie)}`);if(isNaN(ie.start))throw new CompilerError(`Cue malformed: null start value. + ${JSON.stringify(ie)}`);if(isNaN(ie.end))throw new CompilerError(`Cue malformed: null end value. + ${JSON.stringify(ie)}`);if(ie.start>=ie.end)throw new CompilerError(`Cue malformed: start timestamp greater than end + ${JSON.stringify(ie)}`);if(typeof ie.text!="string")throw new CompilerError(`Cue malformed: null text value. + ${JSON.stringify(ie)}`);if(typeof ie.styles!="string")throw new CompilerError(`Cue malformed: null styles value. + ${JSON.stringify(ie)}`);let Z="";ie.identifier.length>0&&(Z+=`${ie.identifier} +`);const ee=convertTimestamp(ie.start),ae=convertTimestamp(ie.end);return Z+=`${ee} --> ${ae}`,Z+=ie.styles?` ${ie.styles}`:"",Z+=` +${ie.text}`,Z}function convertTimestamp(ie){const Z=pad$1(calculateHours(ie),2),ee=pad$1(calculateMinutes(ie),2),ae=pad$1(calculateSeconds(ie),2),ye=pad$1(calculateMs(ie),3);return`${Z}:${ee}:${ae}.${ye}`}function pad$1(ie,Z){let ee=`${ie}`;for(;ee.length{const Je=Xe===0,rt=Xe===ee.cues.length-1,nt=Ke.start,it=Ke.end,lt=rt?1/0:ee.cues[Xe+1].start,ct=Je?it:it-nt,ot=Je?0:nt-ee.cues[Xe-1].end;be=be+ct+ot,ve&&(ye.push(ve),be+=ve.end-Ye,ve=null),ye.push(Ke);let dt=lt-itZ;if(shouldSegment(Ye,Z,lt,ot)){const ft=segmentDuration(rt,it,Z,be,Ye);ae.push({duration:ft,cues:ye}),Ye+=ft,be=0,ye=[]}else dt=!1;dt&&(ve=Ke)}),ae}function shouldSegment(ie,Z,ee,ae){const ye=alignToSegmentLength(ae,Z);return(ae<=Z||ye+ie=Z}function segmentDuration(ie,Z,ee,ae,ye){let ve=ee;return ae>ee&&(ve=alignToSegmentLength(ae-ee,ee)),ie?ve=parseFloat((Z-ye).toFixed(2)):ve=Math.round(ve),ve}function alignToSegmentLength(ie,Z){return ie+=Z-ie%Z,ie}var segmenter={segment:segment$2};const segment$1=segmenter.segment;function hlsSegment(ie,Z,ee){typeof ee>"u"&&(ee="900000");const ae=segment$1(ie,Z),ye=[];return ae.forEach((ve,be)=>{const Ye=`WEBVTT +X-TIMESTAMP-MAP=MPEGTS:${ee},LOCAL:00:00:00.000 + +${printableCues(ve.cues)} +`,Ke=generateSegmentFilename(be);ye.push({filename:Ke,content:Ye})}),ye}function hlsSegmentPlaylist(ie,Z){const ee=segment$1(ie,Z),ae=printableSegments(ee);return`#EXTM3U +#EXT-X-TARGETDURATION:${Math.round(findLongestSegment(ee))} +#EXT-X-VERSION:3 +#EXT-X-MEDIA-SEQUENCE:0 +#EXT-X-PLAYLIST-TYPE:VOD +${ae} +#EXT-X-ENDLIST +`}function pad(ie,Z){return`${"0".repeat(Math.max(0,Z-ie.toString().length))}${ie}`}function generateSegmentFilename(ie){return`${ie}.vtt`}function printableSegments(ie){const Z=[];return ie.forEach((ee,ae)=>{Z.push(`#EXTINF:${ee.duration.toFixed(5)}, +${generateSegmentFilename(ae)}`)}),Z.join(` +`)}function findLongestSegment(ie){let Z=0;return ie.forEach(ee=>{ee.duration>Z&&(Z=ee.duration)}),Z}function printableCues(ie){const Z=[];return ie.forEach(ee=>{Z.push(printableCue(ee))}),Z.join(` + +`)}function printableCue(ie){const Z=[];ie.identifier&&Z.push(ie.identifier);const ee=printableTimestamp(ie.start),ae=printableTimestamp(ie.end),ye=ie.styles?`${ie.styles}`:"";return Z.push(`${ee} --> ${ae} ${ye}`),Z.push(ie.text),Z.join(` +`)}function printableTimestamp(ie){const Z=(ie%1).toFixed(3);ie=Math.round(ie-Z);const ee=Math.floor(ie/3600),ae=Math.floor((ie-ee*3600)/60),ye=ie-ee*3600-ae*60;return`${`${pad(ee,2)}:`}${pad(ae,2)}:${pad(ye,2)}.${pad(Z*1e3,3)}`}var hls$1={hlsSegment,hlsSegmentPlaylist};const parse$1=parser.parse,compile=compiler.compile,segment=segmenter.segment,hls=hls$1;var nodeWebvtt={parse:parse$1,compile,segment,hls};function $addc16e1bbe58fd0$export$3a72a57244d6e765(ie,Z=globalThis==null?void 0:globalThis.document){const ee=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(ie);reactExports.useEffect(()=>{const ae=ye=>{ye.key==="Escape"&&ee(ye)};return Z.addEventListener("keydown",ae),()=>Z.removeEventListener("keydown",ae)},[ee,Z])}const $5cb92bef7577960e$var$CONTEXT_UPDATE="dismissableLayer.update",$5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE="dismissableLayer.pointerDownOutside",$5cb92bef7577960e$var$FOCUS_OUTSIDE="dismissableLayer.focusOutside";let $5cb92bef7577960e$var$originalBodyPointerEvents;const $5cb92bef7577960e$var$DismissableLayerContext=reactExports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$5cb92bef7577960e$export$177fb62ff3ec1f22=reactExports.forwardRef((ie,Z)=>{var ee;const{disableOutsidePointerEvents:ae=!1,onEscapeKeyDown:ye,onPointerDownOutside:ve,onFocusOutside:be,onInteractOutside:Ye,onDismiss:Ke,...Xe}=ie,Je=reactExports.useContext($5cb92bef7577960e$var$DismissableLayerContext),[rt,nt]=reactExports.useState(null),it=(ee=rt==null?void 0:rt.ownerDocument)!==null&&ee!==void 0?ee:globalThis==null?void 0:globalThis.document,[,lt]=reactExports.useState({}),ct=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,Jr=>nt(Jr)),ot=Array.from(Je.layers),[dt]=[...Je.layersWithOutsidePointerEventsDisabled].slice(-1),ft=ot.indexOf(dt),gt=rt?ot.indexOf(rt):-1,mt=Je.layersWithOutsidePointerEventsDisabled.size>0,Yr=gt>=ft,Qr=$5cb92bef7577960e$var$usePointerDownOutside(Jr=>{const ai=Jr.target,oi=[...Je.branches].some(ni=>ni.contains(ai));!Yr||oi||(ve==null||ve(Jr),Ye==null||Ye(Jr),Jr.defaultPrevented||Ke==null||Ke())},it),Xr=$5cb92bef7577960e$var$useFocusOutside(Jr=>{const ai=Jr.target;[...Je.branches].some(oi=>oi.contains(ai))||(be==null||be(Jr),Ye==null||Ye(Jr),Jr.defaultPrevented||Ke==null||Ke())},it);return $addc16e1bbe58fd0$export$3a72a57244d6e765(Jr=>{gt===Je.layers.size-1&&(ye==null||ye(Jr),!Jr.defaultPrevented&&Ke&&(Jr.preventDefault(),Ke()))},it),reactExports.useEffect(()=>{if(rt)return ae&&(Je.layersWithOutsidePointerEventsDisabled.size===0&&($5cb92bef7577960e$var$originalBodyPointerEvents=it.body.style.pointerEvents,it.body.style.pointerEvents="none"),Je.layersWithOutsidePointerEventsDisabled.add(rt)),Je.layers.add(rt),$5cb92bef7577960e$var$dispatchUpdate(),()=>{ae&&Je.layersWithOutsidePointerEventsDisabled.size===1&&(it.body.style.pointerEvents=$5cb92bef7577960e$var$originalBodyPointerEvents)}},[rt,it,ae,Je]),reactExports.useEffect(()=>()=>{rt&&(Je.layers.delete(rt),Je.layersWithOutsidePointerEventsDisabled.delete(rt),$5cb92bef7577960e$var$dispatchUpdate())},[rt,Je]),reactExports.useEffect(()=>{const Jr=()=>lt({});return document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE,Jr),()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE,Jr)},[]),reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({},Xe,{ref:ct,style:{pointerEvents:mt?Yr?"auto":"none":void 0,...ie.style},onFocusCapture:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onFocusCapture,Xr.onFocusCapture),onBlurCapture:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onBlurCapture,Xr.onBlurCapture),onPointerDownCapture:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onPointerDownCapture,Qr.onPointerDownCapture)}))});function $5cb92bef7577960e$var$usePointerDownOutside(ie,Z=globalThis==null?void 0:globalThis.document){const ee=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(ie),ae=reactExports.useRef(!1),ye=reactExports.useRef(()=>{});return reactExports.useEffect(()=>{const ve=Ye=>{if(Ye.target&&!ae.current){let Ke=function(){$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE,ee,Xe,{discrete:!0})};const Xe={originalEvent:Ye};Ye.pointerType==="touch"?(Z.removeEventListener("click",ye.current),ye.current=Ke,Z.addEventListener("click",ye.current,{once:!0})):Ke()}else Z.removeEventListener("click",ye.current);ae.current=!1},be=window.setTimeout(()=>{Z.addEventListener("pointerdown",ve)},0);return()=>{window.clearTimeout(be),Z.removeEventListener("pointerdown",ve),Z.removeEventListener("click",ye.current)}},[Z,ee]),{onPointerDownCapture:()=>ae.current=!0}}function $5cb92bef7577960e$var$useFocusOutside(ie,Z=globalThis==null?void 0:globalThis.document){const ee=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(ie),ae=reactExports.useRef(!1);return reactExports.useEffect(()=>{const ye=ve=>{ve.target&&!ae.current&&$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE,ee,{originalEvent:ve},{discrete:!1})};return Z.addEventListener("focusin",ye),()=>Z.removeEventListener("focusin",ye)},[Z,ee]),{onFocusCapture:()=>ae.current=!0,onBlurCapture:()=>ae.current=!1}}function $5cb92bef7577960e$var$dispatchUpdate(){const ie=new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);document.dispatchEvent(ie)}function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(ie,Z,ee,{discrete:ae}){const ye=ee.originalEvent.target,ve=new CustomEvent(ie,{bubbles:!1,cancelable:!0,detail:ee});Z&&ye.addEventListener(ie,Z,{once:!0}),ae?$8927f6f2acc4f386$export$6d1a0317bde7de7f(ye,ve):ye.dispatchEvent(ve)}let $3db38b7d1fb3fe6a$var$count=0;function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c(){reactExports.useEffect(()=>{var ie,Z;const ee=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(ie=ee[0])!==null&&ie!==void 0?ie:$3db38b7d1fb3fe6a$var$createFocusGuard()),document.body.insertAdjacentElement("beforeend",(Z=ee[1])!==null&&Z!==void 0?Z:$3db38b7d1fb3fe6a$var$createFocusGuard()),$3db38b7d1fb3fe6a$var$count++,()=>{$3db38b7d1fb3fe6a$var$count===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(ae=>ae.remove()),$3db38b7d1fb3fe6a$var$count--}},[])}function $3db38b7d1fb3fe6a$var$createFocusGuard(){const ie=document.createElement("span");return ie.setAttribute("data-radix-focus-guard",""),ie.tabIndex=0,ie.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",ie}const $d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT="focusScope.autoFocusOnMount",$d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT="focusScope.autoFocusOnUnmount",$d3863c46a17e8a28$var$EVENT_OPTIONS={bubbles:!1,cancelable:!0},$d3863c46a17e8a28$export$20e40289641fbbb6=reactExports.forwardRef((ie,Z)=>{const{loop:ee=!1,trapped:ae=!1,onMountAutoFocus:ye,onUnmountAutoFocus:ve,...be}=ie,[Ye,Ke]=reactExports.useState(null),Xe=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(ye),Je=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(ve),rt=reactExports.useRef(null),nt=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,ct=>Ke(ct)),it=reactExports.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;reactExports.useEffect(()=>{if(ae){let ct=function(gt){if(it.paused||!Ye)return;const mt=gt.target;Ye.contains(mt)?rt.current=mt:$d3863c46a17e8a28$var$focus(rt.current,{select:!0})},ot=function(gt){if(it.paused||!Ye)return;const mt=gt.relatedTarget;mt!==null&&(Ye.contains(mt)||$d3863c46a17e8a28$var$focus(rt.current,{select:!0}))},dt=function(gt){if(document.activeElement===document.body)for(const mt of gt)mt.removedNodes.length>0&&$d3863c46a17e8a28$var$focus(Ye)};document.addEventListener("focusin",ct),document.addEventListener("focusout",ot);const ft=new MutationObserver(dt);return Ye&&ft.observe(Ye,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",ct),document.removeEventListener("focusout",ot),ft.disconnect()}}},[ae,Ye,it.paused]),reactExports.useEffect(()=>{if(Ye){$d3863c46a17e8a28$var$focusScopesStack.add(it);const ct=document.activeElement;if(!Ye.contains(ct)){const ot=new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT,$d3863c46a17e8a28$var$EVENT_OPTIONS);Ye.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT,Xe),Ye.dispatchEvent(ot),ot.defaultPrevented||($d3863c46a17e8a28$var$focusFirst($d3863c46a17e8a28$var$removeLinks($d3863c46a17e8a28$var$getTabbableCandidates(Ye)),{select:!0}),document.activeElement===ct&&$d3863c46a17e8a28$var$focus(Ye))}return()=>{Ye.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT,Xe),setTimeout(()=>{const ot=new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT,$d3863c46a17e8a28$var$EVENT_OPTIONS);Ye.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT,Je),Ye.dispatchEvent(ot),ot.defaultPrevented||$d3863c46a17e8a28$var$focus(ct??document.body,{select:!0}),Ye.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT,Je),$d3863c46a17e8a28$var$focusScopesStack.remove(it)},0)}}},[Ye,Xe,Je,it]);const lt=reactExports.useCallback(ct=>{if(!ee&&!ae||it.paused)return;const ot=ct.key==="Tab"&&!ct.altKey&&!ct.ctrlKey&&!ct.metaKey,dt=document.activeElement;if(ot&&dt){const ft=ct.currentTarget,[gt,mt]=$d3863c46a17e8a28$var$getTabbableEdges(ft);gt&&mt?!ct.shiftKey&&dt===mt?(ct.preventDefault(),ee&&$d3863c46a17e8a28$var$focus(gt,{select:!0})):ct.shiftKey&&dt===gt&&(ct.preventDefault(),ee&&$d3863c46a17e8a28$var$focus(mt,{select:!0})):dt===ft&&ct.preventDefault()}},[ee,ae,it.paused]);return reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({tabIndex:-1},be,{ref:nt,onKeyDown:lt}))});function $d3863c46a17e8a28$var$focusFirst(ie,{select:Z=!1}={}){const ee=document.activeElement;for(const ae of ie)if($d3863c46a17e8a28$var$focus(ae,{select:Z}),document.activeElement!==ee)return}function $d3863c46a17e8a28$var$getTabbableEdges(ie){const Z=$d3863c46a17e8a28$var$getTabbableCandidates(ie),ee=$d3863c46a17e8a28$var$findVisible(Z,ie),ae=$d3863c46a17e8a28$var$findVisible(Z.reverse(),ie);return[ee,ae]}function $d3863c46a17e8a28$var$getTabbableCandidates(ie){const Z=[],ee=document.createTreeWalker(ie,NodeFilter.SHOW_ELEMENT,{acceptNode:ae=>{const ye=ae.tagName==="INPUT"&&ae.type==="hidden";return ae.disabled||ae.hidden||ye?NodeFilter.FILTER_SKIP:ae.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;ee.nextNode();)Z.push(ee.currentNode);return Z}function $d3863c46a17e8a28$var$findVisible(ie,Z){for(const ee of ie)if(!$d3863c46a17e8a28$var$isHidden(ee,{upTo:Z}))return ee}function $d3863c46a17e8a28$var$isHidden(ie,{upTo:Z}){if(getComputedStyle(ie).visibility==="hidden")return!0;for(;ie;){if(Z!==void 0&&ie===Z)return!1;if(getComputedStyle(ie).display==="none")return!0;ie=ie.parentElement}return!1}function $d3863c46a17e8a28$var$isSelectableInput(ie){return ie instanceof HTMLInputElement&&"select"in ie}function $d3863c46a17e8a28$var$focus(ie,{select:Z=!1}={}){if(ie&&ie.focus){const ee=document.activeElement;ie.focus({preventScroll:!0}),ie!==ee&&$d3863c46a17e8a28$var$isSelectableInput(ie)&&Z&&ie.select()}}const $d3863c46a17e8a28$var$focusScopesStack=$d3863c46a17e8a28$var$createFocusScopesStack();function $d3863c46a17e8a28$var$createFocusScopesStack(){let ie=[];return{add(Z){const ee=ie[0];Z!==ee&&(ee==null||ee.pause()),ie=$d3863c46a17e8a28$var$arrayRemove(ie,Z),ie.unshift(Z)},remove(Z){var ee;ie=$d3863c46a17e8a28$var$arrayRemove(ie,Z),(ee=ie[0])===null||ee===void 0||ee.resume()}}}function $d3863c46a17e8a28$var$arrayRemove(ie,Z){const ee=[...ie],ae=ee.indexOf(Z);return ae!==-1&&ee.splice(ae,1),ee}function $d3863c46a17e8a28$var$removeLinks(ie){return ie.filter(Z=>Z.tagName!=="A")}const sides=["top","right","bottom","left"],min=Math.min,max=Math.max,round=Math.round,floor=Math.floor,createCoords=ie=>({x:ie,y:ie}),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"},oppositeAlignmentMap={start:"end",end:"start"};function clamp(ie,Z,ee){return max(ie,min(Z,ee))}function evaluate(ie,Z){return typeof ie=="function"?ie(Z):ie}function getSide(ie){return ie.split("-")[0]}function getAlignment(ie){return ie.split("-")[1]}function getOppositeAxis(ie){return ie==="x"?"y":"x"}function getAxisLength(ie){return ie==="y"?"height":"width"}function getSideAxis(ie){return["top","bottom"].includes(getSide(ie))?"y":"x"}function getAlignmentAxis(ie){return getOppositeAxis(getSideAxis(ie))}function getAlignmentSides(ie,Z,ee){ee===void 0&&(ee=!1);const ae=getAlignment(ie),ye=getAlignmentAxis(ie),ve=getAxisLength(ye);let be=ye==="x"?ae===(ee?"end":"start")?"right":"left":ae==="start"?"bottom":"top";return Z.reference[ve]>Z.floating[ve]&&(be=getOppositePlacement(be)),[be,getOppositePlacement(be)]}function getExpandedPlacements(ie){const Z=getOppositePlacement(ie);return[getOppositeAlignmentPlacement(ie),Z,getOppositeAlignmentPlacement(Z)]}function getOppositeAlignmentPlacement(ie){return ie.replace(/start|end/g,Z=>oppositeAlignmentMap[Z])}function getSideList(ie,Z,ee){const ae=["left","right"],ye=["right","left"],ve=["top","bottom"],be=["bottom","top"];switch(ie){case"top":case"bottom":return ee?Z?ye:ae:Z?ae:ye;case"left":case"right":return Z?ve:be;default:return[]}}function getOppositeAxisPlacements(ie,Z,ee,ae){const ye=getAlignment(ie);let ve=getSideList(getSide(ie),ee==="start",ae);return ye&&(ve=ve.map(be=>be+"-"+ye),Z&&(ve=ve.concat(ve.map(getOppositeAlignmentPlacement)))),ve}function getOppositePlacement(ie){return ie.replace(/left|right|bottom|top/g,Z=>oppositeSideMap[Z])}function expandPaddingObject(ie){return{top:0,right:0,bottom:0,left:0,...ie}}function getPaddingObject(ie){return typeof ie!="number"?expandPaddingObject(ie):{top:ie,right:ie,bottom:ie,left:ie}}function rectToClientRect(ie){return{...ie,top:ie.y,left:ie.x,right:ie.x+ie.width,bottom:ie.y+ie.height}}function computeCoordsFromPlacement(ie,Z,ee){let{reference:ae,floating:ye}=ie;const ve=getSideAxis(Z),be=getAlignmentAxis(Z),Ye=getAxisLength(be),Ke=getSide(Z),Xe=ve==="y",Je=ae.x+ae.width/2-ye.width/2,rt=ae.y+ae.height/2-ye.height/2,nt=ae[Ye]/2-ye[Ye]/2;let it;switch(Ke){case"top":it={x:Je,y:ae.y-ye.height};break;case"bottom":it={x:Je,y:ae.y+ae.height};break;case"right":it={x:ae.x+ae.width,y:rt};break;case"left":it={x:ae.x-ye.width,y:rt};break;default:it={x:ae.x,y:ae.y}}switch(getAlignment(Z)){case"start":it[be]-=nt*(ee&&Xe?-1:1);break;case"end":it[be]+=nt*(ee&&Xe?-1:1);break}return it}const computePosition$1=async(ie,Z,ee)=>{const{placement:ae="bottom",strategy:ye="absolute",middleware:ve=[],platform:be}=ee,Ye=ve.filter(Boolean),Ke=await(be.isRTL==null?void 0:be.isRTL(Z));let Xe=await be.getElementRects({reference:ie,floating:Z,strategy:ye}),{x:Je,y:rt}=computeCoordsFromPlacement(Xe,ae,Ke),nt=ae,it={},lt=0;for(let ct=0;ct({name:"arrow",options:ie,async fn(Z){const{x:ee,y:ae,placement:ye,rects:ve,platform:be,elements:Ye,middlewareData:Ke}=Z,{element:Xe,padding:Je=0}=evaluate(ie,Z)||{};if(Xe==null)return{};const rt=getPaddingObject(Je),nt={x:ee,y:ae},it=getAlignmentAxis(ye),lt=getAxisLength(it),ct=await be.getDimensions(Xe),ot=it==="y",dt=ot?"top":"left",ft=ot?"bottom":"right",gt=ot?"clientHeight":"clientWidth",mt=ve.reference[lt]+ve.reference[it]-nt[it]-ve.floating[lt],Yr=nt[it]-ve.reference[it],Qr=await(be.getOffsetParent==null?void 0:be.getOffsetParent(Xe));let Xr=Qr?Qr[gt]:0;(!Xr||!await(be.isElement==null?void 0:be.isElement(Qr)))&&(Xr=Ye.floating[gt]||ve.floating[lt]);const Jr=mt/2-Yr/2,ai=Xr/2-ct[lt]/2-1,oi=min(rt[dt],ai),ni=min(rt[ft],ai),li=oi,ui=Xr-ct[lt]-ni,mi=Xr/2-ct[lt]/2+Jr,ii=clamp(li,mi,ui),hi=!Ke.arrow&&getAlignment(ye)!=null&&mi!==ii&&ve.reference[lt]/2-(mili<=0)){var ai,oi;const li=(((ai=ve.flip)==null?void 0:ai.index)||0)+1,ui=Yr[li];if(ui)return{data:{index:li,overflows:Jr},reset:{placement:ui}};let mi=(oi=Jr.filter(ii=>ii.overflows[0]<=0).sort((ii,hi)=>ii.overflows[1]-hi.overflows[1])[0])==null?void 0:oi.placement;if(!mi)switch(it){case"bestFit":{var ni;const ii=(ni=Jr.map(hi=>[hi.placement,hi.overflows.filter(ri=>ri>0).reduce((ri,ci)=>ri+ci,0)]).sort((hi,ri)=>hi[1]-ri[1])[0])==null?void 0:ni[0];ii&&(mi=ii);break}case"initialPlacement":mi=Ye;break}if(ye!==mi)return{reset:{placement:mi}}}return{}}}};function getSideOffsets(ie,Z){return{top:ie.top-Z.height,right:ie.right-Z.width,bottom:ie.bottom-Z.height,left:ie.left-Z.width}}function isAnySideFullyClipped(ie){return sides.some(Z=>ie[Z]>=0)}const hide$1=function(ie){return ie===void 0&&(ie={}),{name:"hide",options:ie,async fn(Z){const{rects:ee}=Z,{strategy:ae="referenceHidden",...ye}=evaluate(ie,Z);switch(ae){case"referenceHidden":{const ve=await detectOverflow(Z,{...ye,elementContext:"reference"}),be=getSideOffsets(ve,ee.reference);return{data:{referenceHiddenOffsets:be,referenceHidden:isAnySideFullyClipped(be)}}}case"escaped":{const ve=await detectOverflow(Z,{...ye,altBoundary:!0}),be=getSideOffsets(ve,ee.floating);return{data:{escapedOffsets:be,escaped:isAnySideFullyClipped(be)}}}default:return{}}}}};async function convertValueToCoords(ie,Z){const{placement:ee,platform:ae,elements:ye}=ie,ve=await(ae.isRTL==null?void 0:ae.isRTL(ye.floating)),be=getSide(ee),Ye=getAlignment(ee),Ke=getSideAxis(ee)==="y",Xe=["left","top"].includes(be)?-1:1,Je=ve&&Ke?-1:1,rt=evaluate(Z,ie);let{mainAxis:nt,crossAxis:it,alignmentAxis:lt}=typeof rt=="number"?{mainAxis:rt,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...rt};return Ye&&typeof lt=="number"&&(it=Ye==="end"?lt*-1:lt),Ke?{x:it*Je,y:nt*Xe}:{x:nt*Xe,y:it*Je}}const offset=function(ie){return ie===void 0&&(ie=0),{name:"offset",options:ie,async fn(Z){var ee,ae;const{x:ye,y:ve,placement:be,middlewareData:Ye}=Z,Ke=await convertValueToCoords(Z,ie);return be===((ee=Ye.offset)==null?void 0:ee.placement)&&(ae=Ye.arrow)!=null&&ae.alignmentOffset?{}:{x:ye+Ke.x,y:ve+Ke.y,data:{...Ke,placement:be}}}}},shift$1=function(ie){return ie===void 0&&(ie={}),{name:"shift",options:ie,async fn(Z){const{x:ee,y:ae,placement:ye}=Z,{mainAxis:ve=!0,crossAxis:be=!1,limiter:Ye={fn:ot=>{let{x:dt,y:ft}=ot;return{x:dt,y:ft}}},...Ke}=evaluate(ie,Z),Xe={x:ee,y:ae},Je=await detectOverflow(Z,Ke),rt=getSideAxis(getSide(ye)),nt=getOppositeAxis(rt);let it=Xe[nt],lt=Xe[rt];if(ve){const ot=nt==="y"?"top":"left",dt=nt==="y"?"bottom":"right",ft=it+Je[ot],gt=it-Je[dt];it=clamp(ft,it,gt)}if(be){const ot=rt==="y"?"top":"left",dt=rt==="y"?"bottom":"right",ft=lt+Je[ot],gt=lt-Je[dt];lt=clamp(ft,lt,gt)}const ct=Ye.fn({...Z,[nt]:it,[rt]:lt});return{...ct,data:{x:ct.x-ee,y:ct.y-ae}}}}},limitShift$1=function(ie){return ie===void 0&&(ie={}),{options:ie,fn(Z){const{x:ee,y:ae,placement:ye,rects:ve,middlewareData:be}=Z,{offset:Ye=0,mainAxis:Ke=!0,crossAxis:Xe=!0}=evaluate(ie,Z),Je={x:ee,y:ae},rt=getSideAxis(ye),nt=getOppositeAxis(rt);let it=Je[nt],lt=Je[rt];const ct=evaluate(Ye,Z),ot=typeof ct=="number"?{mainAxis:ct,crossAxis:0}:{mainAxis:0,crossAxis:0,...ct};if(Ke){const gt=nt==="y"?"height":"width",mt=ve.reference[nt]-ve.floating[gt]+ot.mainAxis,Yr=ve.reference[nt]+ve.reference[gt]-ot.mainAxis;itYr&&(it=Yr)}if(Xe){var dt,ft;const gt=nt==="y"?"width":"height",mt=["top","left"].includes(getSide(ye)),Yr=ve.reference[rt]-ve.floating[gt]+(mt&&((dt=be.offset)==null?void 0:dt[rt])||0)+(mt?0:ot.crossAxis),Qr=ve.reference[rt]+ve.reference[gt]+(mt?0:((ft=be.offset)==null?void 0:ft[rt])||0)-(mt?ot.crossAxis:0);ltQr&&(lt=Qr)}return{[nt]:it,[rt]:lt}}}},size$1=function(ie){return ie===void 0&&(ie={}),{name:"size",options:ie,async fn(Z){const{placement:ee,rects:ae,platform:ye,elements:ve}=Z,{apply:be=()=>{},...Ye}=evaluate(ie,Z),Ke=await detectOverflow(Z,Ye),Xe=getSide(ee),Je=getAlignment(ee),rt=getSideAxis(ee)==="y",{width:nt,height:it}=ae.floating;let lt,ct;Xe==="top"||Xe==="bottom"?(lt=Xe,ct=Je===(await(ye.isRTL==null?void 0:ye.isRTL(ve.floating))?"start":"end")?"left":"right"):(ct=Xe,lt=Je==="end"?"top":"bottom");const ot=it-Ke[lt],dt=nt-Ke[ct],ft=!Z.middlewareData.shift;let gt=ot,mt=dt;if(rt){const Qr=nt-Ke.left-Ke.right;mt=Je||ft?min(dt,Qr):Qr}else{const Qr=it-Ke.top-Ke.bottom;gt=Je||ft?min(ot,Qr):Qr}if(ft&&!Je){const Qr=max(Ke.left,0),Xr=max(Ke.right,0),Jr=max(Ke.top,0),ai=max(Ke.bottom,0);rt?mt=nt-2*(Qr!==0||Xr!==0?Qr+Xr:max(Ke.left,Ke.right)):gt=it-2*(Jr!==0||ai!==0?Jr+ai:max(Ke.top,Ke.bottom))}await be({...Z,availableWidth:mt,availableHeight:gt});const Yr=await ye.getDimensions(ve.floating);return nt!==Yr.width||it!==Yr.height?{reset:{rects:!0}}:{}}}};function getNodeName(ie){return isNode(ie)?(ie.nodeName||"").toLowerCase():"#document"}function getWindow(ie){var Z;return(ie==null||(Z=ie.ownerDocument)==null?void 0:Z.defaultView)||window}function getDocumentElement(ie){var Z;return(Z=(isNode(ie)?ie.ownerDocument:ie.document)||window.document)==null?void 0:Z.documentElement}function isNode(ie){return ie instanceof Node||ie instanceof getWindow(ie).Node}function isElement(ie){return ie instanceof Element||ie instanceof getWindow(ie).Element}function isHTMLElement(ie){return ie instanceof HTMLElement||ie instanceof getWindow(ie).HTMLElement}function isShadowRoot(ie){return typeof ShadowRoot>"u"?!1:ie instanceof ShadowRoot||ie instanceof getWindow(ie).ShadowRoot}function isOverflowElement(ie){const{overflow:Z,overflowX:ee,overflowY:ae,display:ye}=getComputedStyle$1(ie);return/auto|scroll|overlay|hidden|clip/.test(Z+ae+ee)&&!["inline","contents"].includes(ye)}function isTableElement(ie){return["table","td","th"].includes(getNodeName(ie))}function isContainingBlock(ie){const Z=isWebKit(),ee=getComputedStyle$1(ie);return ee.transform!=="none"||ee.perspective!=="none"||(ee.containerType?ee.containerType!=="normal":!1)||!Z&&(ee.backdropFilter?ee.backdropFilter!=="none":!1)||!Z&&(ee.filter?ee.filter!=="none":!1)||["transform","perspective","filter"].some(ae=>(ee.willChange||"").includes(ae))||["paint","layout","strict","content"].some(ae=>(ee.contain||"").includes(ae))}function getContainingBlock(ie){let Z=getParentNode(ie);for(;isHTMLElement(Z)&&!isLastTraversableNode(Z);){if(isContainingBlock(Z))return Z;Z=getParentNode(Z)}return null}function isWebKit(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function isLastTraversableNode(ie){return["html","body","#document"].includes(getNodeName(ie))}function getComputedStyle$1(ie){return getWindow(ie).getComputedStyle(ie)}function getNodeScroll(ie){return isElement(ie)?{scrollLeft:ie.scrollLeft,scrollTop:ie.scrollTop}:{scrollLeft:ie.pageXOffset,scrollTop:ie.pageYOffset}}function getParentNode(ie){if(getNodeName(ie)==="html")return ie;const Z=ie.assignedSlot||ie.parentNode||isShadowRoot(ie)&&ie.host||getDocumentElement(ie);return isShadowRoot(Z)?Z.host:Z}function getNearestOverflowAncestor(ie){const Z=getParentNode(ie);return isLastTraversableNode(Z)?ie.ownerDocument?ie.ownerDocument.body:ie.body:isHTMLElement(Z)&&isOverflowElement(Z)?Z:getNearestOverflowAncestor(Z)}function getOverflowAncestors(ie,Z,ee){var ae;Z===void 0&&(Z=[]),ee===void 0&&(ee=!0);const ye=getNearestOverflowAncestor(ie),ve=ye===((ae=ie.ownerDocument)==null?void 0:ae.body),be=getWindow(ye);return ve?Z.concat(be,be.visualViewport||[],isOverflowElement(ye)?ye:[],be.frameElement&&ee?getOverflowAncestors(be.frameElement):[]):Z.concat(ye,getOverflowAncestors(ye,[],ee))}function getCssDimensions(ie){const Z=getComputedStyle$1(ie);let ee=parseFloat(Z.width)||0,ae=parseFloat(Z.height)||0;const ye=isHTMLElement(ie),ve=ye?ie.offsetWidth:ee,be=ye?ie.offsetHeight:ae,Ye=round(ee)!==ve||round(ae)!==be;return Ye&&(ee=ve,ae=be),{width:ee,height:ae,$:Ye}}function unwrapElement(ie){return isElement(ie)?ie:ie.contextElement}function getScale(ie){const Z=unwrapElement(ie);if(!isHTMLElement(Z))return createCoords(1);const ee=Z.getBoundingClientRect(),{width:ae,height:ye,$:ve}=getCssDimensions(Z);let be=(ve?round(ee.width):ee.width)/ae,Ye=(ve?round(ee.height):ee.height)/ye;return(!be||!Number.isFinite(be))&&(be=1),(!Ye||!Number.isFinite(Ye))&&(Ye=1),{x:be,y:Ye}}const noOffsets=createCoords(0);function getVisualOffsets(ie){const Z=getWindow(ie);return!isWebKit()||!Z.visualViewport?noOffsets:{x:Z.visualViewport.offsetLeft,y:Z.visualViewport.offsetTop}}function shouldAddVisualOffsets(ie,Z,ee){return Z===void 0&&(Z=!1),!ee||Z&&ee!==getWindow(ie)?!1:Z}function getBoundingClientRect(ie,Z,ee,ae){Z===void 0&&(Z=!1),ee===void 0&&(ee=!1);const ye=ie.getBoundingClientRect(),ve=unwrapElement(ie);let be=createCoords(1);Z&&(ae?isElement(ae)&&(be=getScale(ae)):be=getScale(ie));const Ye=shouldAddVisualOffsets(ve,ee,ae)?getVisualOffsets(ve):createCoords(0);let Ke=(ye.left+Ye.x)/be.x,Xe=(ye.top+Ye.y)/be.y,Je=ye.width/be.x,rt=ye.height/be.y;if(ve){const nt=getWindow(ve),it=ae&&isElement(ae)?getWindow(ae):ae;let lt=nt.frameElement;for(;lt&&ae&&it!==nt;){const ct=getScale(lt),ot=lt.getBoundingClientRect(),dt=getComputedStyle$1(lt),ft=ot.left+(lt.clientLeft+parseFloat(dt.paddingLeft))*ct.x,gt=ot.top+(lt.clientTop+parseFloat(dt.paddingTop))*ct.y;Ke*=ct.x,Xe*=ct.y,Je*=ct.x,rt*=ct.y,Ke+=ft,Xe+=gt,lt=getWindow(lt).frameElement}}return rectToClientRect({width:Je,height:rt,x:Ke,y:Xe})}const topLayerSelectors=[":popover-open",":modal"];function topLayer(ie){let Z=!1,ee=0,ae=0;function ye(ve){try{Z=Z||ie.matches(ve)}catch{}}if(topLayerSelectors.forEach(ve=>{ye(ve)}),Z){const ve=getContainingBlock(ie);if(ve){const be=ve.getBoundingClientRect();ee=be.x,ae=be.y}}return[Z,ee,ae]}function convertOffsetParentRelativeRectToViewportRelativeRect(ie){let{elements:Z,rect:ee,offsetParent:ae,strategy:ye}=ie;const ve=getDocumentElement(ae),[be]=Z?topLayer(Z.floating):[!1];if(ae===ve||be)return ee;let Ye={scrollLeft:0,scrollTop:0},Ke=createCoords(1);const Xe=createCoords(0),Je=isHTMLElement(ae);if((Je||!Je&&ye!=="fixed")&&((getNodeName(ae)!=="body"||isOverflowElement(ve))&&(Ye=getNodeScroll(ae)),isHTMLElement(ae))){const rt=getBoundingClientRect(ae);Ke=getScale(ae),Xe.x=rt.x+ae.clientLeft,Xe.y=rt.y+ae.clientTop}return{width:ee.width*Ke.x,height:ee.height*Ke.y,x:ee.x*Ke.x-Ye.scrollLeft*Ke.x+Xe.x,y:ee.y*Ke.y-Ye.scrollTop*Ke.y+Xe.y}}function getClientRects(ie){return Array.from(ie.getClientRects())}function getWindowScrollBarX(ie){return getBoundingClientRect(getDocumentElement(ie)).left+getNodeScroll(ie).scrollLeft}function getDocumentRect(ie){const Z=getDocumentElement(ie),ee=getNodeScroll(ie),ae=ie.ownerDocument.body,ye=max(Z.scrollWidth,Z.clientWidth,ae.scrollWidth,ae.clientWidth),ve=max(Z.scrollHeight,Z.clientHeight,ae.scrollHeight,ae.clientHeight);let be=-ee.scrollLeft+getWindowScrollBarX(ie);const Ye=-ee.scrollTop;return getComputedStyle$1(ae).direction==="rtl"&&(be+=max(Z.clientWidth,ae.clientWidth)-ye),{width:ye,height:ve,x:be,y:Ye}}function getViewportRect(ie,Z){const ee=getWindow(ie),ae=getDocumentElement(ie),ye=ee.visualViewport;let ve=ae.clientWidth,be=ae.clientHeight,Ye=0,Ke=0;if(ye){ve=ye.width,be=ye.height;const Xe=isWebKit();(!Xe||Xe&&Z==="fixed")&&(Ye=ye.offsetLeft,Ke=ye.offsetTop)}return{width:ve,height:be,x:Ye,y:Ke}}function getInnerBoundingClientRect(ie,Z){const ee=getBoundingClientRect(ie,!0,Z==="fixed"),ae=ee.top+ie.clientTop,ye=ee.left+ie.clientLeft,ve=isHTMLElement(ie)?getScale(ie):createCoords(1),be=ie.clientWidth*ve.x,Ye=ie.clientHeight*ve.y,Ke=ye*ve.x,Xe=ae*ve.y;return{width:be,height:Ye,x:Ke,y:Xe}}function getClientRectFromClippingAncestor(ie,Z,ee){let ae;if(Z==="viewport")ae=getViewportRect(ie,ee);else if(Z==="document")ae=getDocumentRect(getDocumentElement(ie));else if(isElement(Z))ae=getInnerBoundingClientRect(Z,ee);else{const ye=getVisualOffsets(ie);ae={...Z,x:Z.x-ye.x,y:Z.y-ye.y}}return rectToClientRect(ae)}function hasFixedPositionAncestor(ie,Z){const ee=getParentNode(ie);return ee===Z||!isElement(ee)||isLastTraversableNode(ee)?!1:getComputedStyle$1(ee).position==="fixed"||hasFixedPositionAncestor(ee,Z)}function getClippingElementAncestors(ie,Z){const ee=Z.get(ie);if(ee)return ee;let ae=getOverflowAncestors(ie,[],!1).filter(Ye=>isElement(Ye)&&getNodeName(Ye)!=="body"),ye=null;const ve=getComputedStyle$1(ie).position==="fixed";let be=ve?getParentNode(ie):ie;for(;isElement(be)&&!isLastTraversableNode(be);){const Ye=getComputedStyle$1(be),Ke=isContainingBlock(be);!Ke&&Ye.position==="fixed"&&(ye=null),(ve?!Ke&&!ye:!Ke&&Ye.position==="static"&&ye&&["absolute","fixed"].includes(ye.position)||isOverflowElement(be)&&!Ke&&hasFixedPositionAncestor(ie,be))?ae=ae.filter(Xe=>Xe!==be):ye=Ye,be=getParentNode(be)}return Z.set(ie,ae),ae}function getClippingRect(ie){let{element:Z,boundary:ee,rootBoundary:ae,strategy:ye}=ie;const ve=[...ee==="clippingAncestors"?getClippingElementAncestors(Z,this._c):[].concat(ee),ae],be=ve[0],Ye=ve.reduce((Ke,Xe)=>{const Je=getClientRectFromClippingAncestor(Z,Xe,ye);return Ke.top=max(Je.top,Ke.top),Ke.right=min(Je.right,Ke.right),Ke.bottom=min(Je.bottom,Ke.bottom),Ke.left=max(Je.left,Ke.left),Ke},getClientRectFromClippingAncestor(Z,be,ye));return{width:Ye.right-Ye.left,height:Ye.bottom-Ye.top,x:Ye.left,y:Ye.top}}function getDimensions(ie){const{width:Z,height:ee}=getCssDimensions(ie);return{width:Z,height:ee}}function getRectRelativeToOffsetParent(ie,Z,ee,ae){const ye=isHTMLElement(Z),ve=getDocumentElement(Z),be=ee==="fixed",Ye=getBoundingClientRect(ie,!0,be,Z);let Ke={scrollLeft:0,scrollTop:0};const Xe=createCoords(0);if(ye||!ye&&!be)if((getNodeName(Z)!=="body"||isOverflowElement(ve))&&(Ke=getNodeScroll(Z)),ye){const ct=getBoundingClientRect(Z,!0,be,Z);Xe.x=ct.x+Z.clientLeft,Xe.y=ct.y+Z.clientTop}else ve&&(Xe.x=getWindowScrollBarX(ve));let Je=Ye.left+Ke.scrollLeft-Xe.x,rt=Ye.top+Ke.scrollTop-Xe.y;const[nt,it,lt]=topLayer(ae);return nt&&(Je+=it,rt+=lt,ye&&(Je+=Z.clientLeft,rt+=Z.clientTop)),{x:Je,y:rt,width:Ye.width,height:Ye.height}}function getTrueOffsetParent(ie,Z){return!isHTMLElement(ie)||getComputedStyle$1(ie).position==="fixed"?null:Z?Z(ie):ie.offsetParent}function getOffsetParent(ie,Z){const ee=getWindow(ie);if(!isHTMLElement(ie))return ee;let ae=getTrueOffsetParent(ie,Z);for(;ae&&isTableElement(ae)&&getComputedStyle$1(ae).position==="static";)ae=getTrueOffsetParent(ae,Z);return ae&&(getNodeName(ae)==="html"||getNodeName(ae)==="body"&&getComputedStyle$1(ae).position==="static"&&!isContainingBlock(ae))?ee:ae||getContainingBlock(ie)||ee}const getElementRects=async function(ie){const Z=this.getOffsetParent||getOffsetParent,ee=this.getDimensions;return{reference:getRectRelativeToOffsetParent(ie.reference,await Z(ie.floating),ie.strategy,ie.floating),floating:{x:0,y:0,...await ee(ie.floating)}}};function isRTL(ie){return getComputedStyle$1(ie).direction==="rtl"}const platform={convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement,getClippingRect,getOffsetParent,getElementRects,getClientRects,getDimensions,getScale,isElement,isRTL};function observeMove(ie,Z){let ee=null,ae;const ye=getDocumentElement(ie);function ve(){var Ye;clearTimeout(ae),(Ye=ee)==null||Ye.disconnect(),ee=null}function be(Ye,Ke){Ye===void 0&&(Ye=!1),Ke===void 0&&(Ke=1),ve();const{left:Xe,top:Je,width:rt,height:nt}=ie.getBoundingClientRect();if(Ye||Z(),!rt||!nt)return;const it=floor(Je),lt=floor(ye.clientWidth-(Xe+rt)),ct=floor(ye.clientHeight-(Je+nt)),ot=floor(Xe),dt={rootMargin:-it+"px "+-lt+"px "+-ct+"px "+-ot+"px",threshold:max(0,min(1,Ke))||1};let ft=!0;function gt(mt){const Yr=mt[0].intersectionRatio;if(Yr!==Ke){if(!ft)return be();Yr?be(!1,Yr):ae=setTimeout(()=>{be(!1,1e-7)},100)}ft=!1}try{ee=new IntersectionObserver(gt,{...dt,root:ye.ownerDocument})}catch{ee=new IntersectionObserver(gt,dt)}ee.observe(ie)}return be(!0),ve}function autoUpdate(ie,Z,ee,ae){ae===void 0&&(ae={});const{ancestorScroll:ye=!0,ancestorResize:ve=!0,elementResize:be=typeof ResizeObserver=="function",layoutShift:Ye=typeof IntersectionObserver=="function",animationFrame:Ke=!1}=ae,Xe=unwrapElement(ie),Je=ye||ve?[...Xe?getOverflowAncestors(Xe):[],...getOverflowAncestors(Z)]:[];Je.forEach(dt=>{ye&&dt.addEventListener("scroll",ee,{passive:!0}),ve&&dt.addEventListener("resize",ee)});const rt=Xe&&Ye?observeMove(Xe,ee):null;let nt=-1,it=null;be&&(it=new ResizeObserver(dt=>{let[ft]=dt;ft&&ft.target===Xe&&it&&(it.unobserve(Z),cancelAnimationFrame(nt),nt=requestAnimationFrame(()=>{var gt;(gt=it)==null||gt.observe(Z)})),ee()}),Xe&&!Ke&&it.observe(Xe),it.observe(Z));let lt,ct=Ke?getBoundingClientRect(ie):null;Ke&&ot();function ot(){const dt=getBoundingClientRect(ie);ct&&(dt.x!==ct.x||dt.y!==ct.y||dt.width!==ct.width||dt.height!==ct.height)&&ee(),ct=dt,lt=requestAnimationFrame(ot)}return ee(),()=>{var dt;Je.forEach(ft=>{ye&&ft.removeEventListener("scroll",ee),ve&&ft.removeEventListener("resize",ee)}),rt==null||rt(),(dt=it)==null||dt.disconnect(),it=null,Ke&&cancelAnimationFrame(lt)}}const shift=shift$1,flip=flip$1,size=size$1,hide=hide$1,arrow$1=arrow$2,limitShift=limitShift$1,computePosition=(ie,Z,ee)=>{const ae=new Map,ye={platform,...ee},ve={...ye.platform,_c:ae};return computePosition$1(ie,Z,{...ye,platform:ve})},arrow=ie=>{function Z(ee){return{}.hasOwnProperty.call(ee,"current")}return{name:"arrow",options:ie,fn(ee){const{element:ae,padding:ye}=typeof ie=="function"?ie(ee):ie;return ae&&Z(ae)?ae.current!=null?arrow$1({element:ae.current,padding:ye}).fn(ee):{}:ae?arrow$1({element:ae,padding:ye}).fn(ee):{}}}};var index=typeof document<"u"?reactExports.useLayoutEffect:reactExports.useEffect;function deepEqual(ie,Z){if(ie===Z)return!0;if(typeof ie!=typeof Z)return!1;if(typeof ie=="function"&&ie.toString()===Z.toString())return!0;let ee,ae,ye;if(ie&&Z&&typeof ie=="object"){if(Array.isArray(ie)){if(ee=ie.length,ee!==Z.length)return!1;for(ae=ee;ae--!==0;)if(!deepEqual(ie[ae],Z[ae]))return!1;return!0}if(ye=Object.keys(ie),ee=ye.length,ee!==Object.keys(Z).length)return!1;for(ae=ee;ae--!==0;)if(!{}.hasOwnProperty.call(Z,ye[ae]))return!1;for(ae=ee;ae--!==0;){const ve=ye[ae];if(!(ve==="_owner"&&ie.$$typeof)&&!deepEqual(ie[ve],Z[ve]))return!1}return!0}return ie!==ie&&Z!==Z}function getDPR(ie){return typeof window>"u"?1:(ie.ownerDocument.defaultView||window).devicePixelRatio||1}function roundByDPR(ie,Z){const ee=getDPR(ie);return Math.round(Z*ee)/ee}function useLatestRef(ie){const Z=reactExports.useRef(ie);return index(()=>{Z.current=ie}),Z}function useFloating(ie){ie===void 0&&(ie={});const{placement:Z="bottom",strategy:ee="absolute",middleware:ae=[],platform:ye,elements:{reference:ve,floating:be}={},transform:Ye=!0,whileElementsMounted:Ke,open:Xe}=ie,[Je,rt]=reactExports.useState({x:0,y:0,strategy:ee,placement:Z,middlewareData:{},isPositioned:!1}),[nt,it]=reactExports.useState(ae);deepEqual(nt,ae)||it(ae);const[lt,ct]=reactExports.useState(null),[ot,dt]=reactExports.useState(null),ft=reactExports.useCallback(ri=>{ri!==Qr.current&&(Qr.current=ri,ct(ri))},[]),gt=reactExports.useCallback(ri=>{ri!==Xr.current&&(Xr.current=ri,dt(ri))},[]),mt=ve||lt,Yr=be||ot,Qr=reactExports.useRef(null),Xr=reactExports.useRef(null),Jr=reactExports.useRef(Je),ai=Ke!=null,oi=useLatestRef(Ke),ni=useLatestRef(ye),li=reactExports.useCallback(()=>{if(!Qr.current||!Xr.current)return;const ri={placement:Z,strategy:ee,middleware:nt};ni.current&&(ri.platform=ni.current),computePosition(Qr.current,Xr.current,ri).then(ci=>{const Si={...ci,isPositioned:!0};ui.current&&!deepEqual(Jr.current,Si)&&(Jr.current=Si,reactDomExports.flushSync(()=>{rt(Si)}))})},[nt,Z,ee,ni]);index(()=>{Xe===!1&&Jr.current.isPositioned&&(Jr.current.isPositioned=!1,rt(ri=>({...ri,isPositioned:!1})))},[Xe]);const ui=reactExports.useRef(!1);index(()=>(ui.current=!0,()=>{ui.current=!1}),[]),index(()=>{if(mt&&(Qr.current=mt),Yr&&(Xr.current=Yr),mt&&Yr){if(oi.current)return oi.current(mt,Yr,li);li()}},[mt,Yr,li,oi,ai]);const mi=reactExports.useMemo(()=>({reference:Qr,floating:Xr,setReference:ft,setFloating:gt}),[ft,gt]),ii=reactExports.useMemo(()=>({reference:mt,floating:Yr}),[mt,Yr]),hi=reactExports.useMemo(()=>{const ri={position:ee,left:0,top:0};if(!ii.floating)return ri;const ci=roundByDPR(ii.floating,Je.x),Si=roundByDPR(ii.floating,Je.y);return Ye?{...ri,transform:"translate("+ci+"px, "+Si+"px)",...getDPR(ii.floating)>=1.5&&{willChange:"transform"}}:{position:ee,left:ci,top:Si}},[ee,Ye,ii.floating,Je.x,Je.y]);return reactExports.useMemo(()=>({...Je,update:li,refs:mi,elements:ii,floatingStyles:hi}),[Je,li,mi,ii,hi])}const $7e8f5cd07187803e$export$21b07c8f274aebd5=reactExports.forwardRef((ie,Z)=>{const{children:ee,width:ae=10,height:ye=5,...ve}=ie;return reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.svg,_extends$1({},ve,{ref:Z,width:ae,height:ye,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),ie.asChild?ee:reactExports.createElement("polygon",{points:"0,0 30,0 15,10"}))}),$7e8f5cd07187803e$export$be92b6f5f03c0fe9=$7e8f5cd07187803e$export$21b07c8f274aebd5,$cf1ac5d9fe0e8206$var$POPPER_NAME="Popper",[$cf1ac5d9fe0e8206$var$createPopperContext,$cf1ac5d9fe0e8206$export$722aac194ae923]=$c512c27ab02ef895$export$50c7b4e9d9f19c1($cf1ac5d9fe0e8206$var$POPPER_NAME),[$cf1ac5d9fe0e8206$var$PopperProvider,$cf1ac5d9fe0e8206$var$usePopperContext]=$cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$POPPER_NAME),$cf1ac5d9fe0e8206$export$badac9ada3a0bdf9=ie=>{const{__scopePopper:Z,children:ee}=ie,[ae,ye]=reactExports.useState(null);return reactExports.createElement($cf1ac5d9fe0e8206$var$PopperProvider,{scope:Z,anchor:ae,onAnchorChange:ye},ee)},$cf1ac5d9fe0e8206$var$ANCHOR_NAME="PopperAnchor",$cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d=reactExports.forwardRef((ie,Z)=>{const{__scopePopper:ee,virtualRef:ae,...ye}=ie,ve=$cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$ANCHOR_NAME,ee),be=reactExports.useRef(null),Ye=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,be);return reactExports.useEffect(()=>{ve.onAnchorChange((ae==null?void 0:ae.current)||be.current)}),ae?null:reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({},ye,{ref:Ye}))}),$cf1ac5d9fe0e8206$var$CONTENT_NAME="PopperContent",[$cf1ac5d9fe0e8206$var$PopperContentProvider,$cf1ac5d9fe0e8206$var$useContentContext]=$cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME),$cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc=reactExports.forwardRef((ie,Z)=>{var ee,ae,ye,ve,be,Ye,Ke,Xe;const{__scopePopper:Je,side:rt="bottom",sideOffset:nt=0,align:it="center",alignOffset:lt=0,arrowPadding:ct=0,avoidCollisions:ot=!0,collisionBoundary:dt=[],collisionPadding:ft=0,sticky:gt="partial",hideWhenDetached:mt=!1,updatePositionStrategy:Yr="optimized",onPlaced:Qr,...Xr}=ie,Jr=$cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME,Je),[ai,oi]=reactExports.useState(null),ni=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,wi=>oi(wi)),[li,ui]=reactExports.useState(null),mi=$db6c3485150b8e66$export$1ab7ae714698c4b8(li),ii=(ee=mi==null?void 0:mi.width)!==null&&ee!==void 0?ee:0,hi=(ae=mi==null?void 0:mi.height)!==null&&ae!==void 0?ae:0,ri=rt+(it!=="center"?"-"+it:""),ci=typeof ft=="number"?ft:{top:0,right:0,bottom:0,left:0,...ft},Si=Array.isArray(dt)?dt:[dt],si=Si.length>0,Ei={padding:ci,boundary:Si.filter($cf1ac5d9fe0e8206$var$isNotNull),altBoundary:si},{refs:yi,floatingStyles:Mi,placement:Ci,isPositioned:Ri,middlewareData:Ni}=useFloating({strategy:"fixed",placement:ri,whileElementsMounted:(...wi)=>autoUpdate(...wi,{animationFrame:Yr==="always"}),elements:{reference:Jr.anchor},middleware:[offset({mainAxis:nt+hi,alignmentAxis:lt}),ot&&shift({mainAxis:!0,crossAxis:!1,limiter:gt==="partial"?limitShift():void 0,...Ei}),ot&&flip({...Ei}),size({...Ei,apply:({elements:wi,rects:Ii,availableWidth:Di,availableHeight:is})=>{const{width:Gi,height:us}=Ii.reference,Zi=wi.floating.style;Zi.setProperty("--radix-popper-available-width",`${Di}px`),Zi.setProperty("--radix-popper-available-height",`${is}px`),Zi.setProperty("--radix-popper-anchor-width",`${Gi}px`),Zi.setProperty("--radix-popper-anchor-height",`${us}px`)}}),li&&arrow({element:li,padding:ct}),$cf1ac5d9fe0e8206$var$transformOrigin({arrowWidth:ii,arrowHeight:hi}),mt&&hide({strategy:"referenceHidden",...Ei})]}),[Ai,ki]=$cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(Ci),Yi=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(Qr);$9f79659886946c16$export$e5c5a5f917a5871c(()=>{Ri&&(Yi==null||Yi())},[Ri,Yi]);const Ji=(ye=Ni.arrow)===null||ye===void 0?void 0:ye.x,ls=(ve=Ni.arrow)===null||ve===void 0?void 0:ve.y,hs=((be=Ni.arrow)===null||be===void 0?void 0:be.centerOffset)!==0,[Kr,di]=reactExports.useState();return $9f79659886946c16$export$e5c5a5f917a5871c(()=>{ai&&di(window.getComputedStyle(ai).zIndex)},[ai]),reactExports.createElement("div",{ref:yi.setFloating,"data-radix-popper-content-wrapper":"",style:{...Mi,transform:Ri?Mi.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Kr,"--radix-popper-transform-origin":[(Ye=Ni.transformOrigin)===null||Ye===void 0?void 0:Ye.x,(Ke=Ni.transformOrigin)===null||Ke===void 0?void 0:Ke.y].join(" ")},dir:ie.dir},reactExports.createElement($cf1ac5d9fe0e8206$var$PopperContentProvider,{scope:Je,placedSide:Ai,onArrowChange:ui,arrowX:Ji,arrowY:ls,shouldHideArrow:hs},reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({"data-side":Ai,"data-align":ki},Xr,{ref:ni,style:{...Xr.style,animation:Ri?void 0:"none",opacity:(Xe=Ni.hide)!==null&&Xe!==void 0&&Xe.referenceHidden?0:void 0}}))))}),$cf1ac5d9fe0e8206$var$ARROW_NAME="PopperArrow",$cf1ac5d9fe0e8206$var$OPPOSITE_SIDE={top:"bottom",right:"left",bottom:"top",left:"right"},$cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0=reactExports.forwardRef(function(ie,Z){const{__scopePopper:ee,...ae}=ie,ye=$cf1ac5d9fe0e8206$var$useContentContext($cf1ac5d9fe0e8206$var$ARROW_NAME,ee),ve=$cf1ac5d9fe0e8206$var$OPPOSITE_SIDE[ye.placedSide];return reactExports.createElement("span",{ref:ye.onArrowChange,style:{position:"absolute",left:ye.arrowX,top:ye.arrowY,[ve]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[ye.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[ye.placedSide],visibility:ye.shouldHideArrow?"hidden":void 0}},reactExports.createElement($7e8f5cd07187803e$export$be92b6f5f03c0fe9,_extends$1({},ae,{ref:Z,style:{...ae.style,display:"block"}})))});function $cf1ac5d9fe0e8206$var$isNotNull(ie){return ie!==null}const $cf1ac5d9fe0e8206$var$transformOrigin=ie=>({name:"transformOrigin",options:ie,fn(Z){var ee,ae,ye,ve,be;const{placement:Ye,rects:Ke,middlewareData:Xe}=Z,Je=((ee=Xe.arrow)===null||ee===void 0?void 0:ee.centerOffset)!==0,rt=Je?0:ie.arrowWidth,nt=Je?0:ie.arrowHeight,[it,lt]=$cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(Ye),ct={start:"0%",center:"50%",end:"100%"}[lt],ot=((ae=(ye=Xe.arrow)===null||ye===void 0?void 0:ye.x)!==null&&ae!==void 0?ae:0)+rt/2,dt=((ve=(be=Xe.arrow)===null||be===void 0?void 0:be.y)!==null&&ve!==void 0?ve:0)+nt/2;let ft="",gt="";return it==="bottom"?(ft=Je?ct:`${ot}px`,gt=`${-nt}px`):it==="top"?(ft=Je?ct:`${ot}px`,gt=`${Ke.floating.height+nt}px`):it==="right"?(ft=`${-nt}px`,gt=Je?ct:`${dt}px`):it==="left"&&(ft=`${Ke.floating.width+nt}px`,gt=Je?ct:`${dt}px`),{data:{x:ft,y:gt}}}});function $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(ie){const[Z,ee="center"]=ie.split("-");return[Z,ee]}const $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9=$cf1ac5d9fe0e8206$export$badac9ada3a0bdf9,$cf1ac5d9fe0e8206$export$b688253958b8dfe7=$cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d,$cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2=$cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc,$cf1ac5d9fe0e8206$export$21b07c8f274aebd5=$cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0,$f1701beae083dbae$export$602eac185826482c=reactExports.forwardRef((ie,Z)=>{var ee;const{container:ae=globalThis==null||(ee=globalThis.document)===null||ee===void 0?void 0:ee.body,...ye}=ie;return ae?$7SXl2$reactdom.createPortal(reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({},ye,{ref:Z})),ae):null});var getDefaultParent=function(ie){if(typeof document>"u")return null;var Z=Array.isArray(ie)?ie[0]:ie;return Z.ownerDocument.body},counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={},lockCount=0,unwrapHost=function(ie){return ie&&(ie.host||unwrapHost(ie.parentNode))},correctTargets=function(ie,Z){return Z.map(function(ee){if(ie.contains(ee))return ee;var ae=unwrapHost(ee);return ae&&ie.contains(ae)?ae:(console.error("aria-hidden",ee,"in not contained inside",ie,". Doing nothing"),null)}).filter(function(ee){return!!ee})},applyAttributeToOthers=function(ie,Z,ee,ae){var ye=correctTargets(Z,Array.isArray(ie)?ie:[ie]);markerMap[ee]||(markerMap[ee]=new WeakMap);var ve=markerMap[ee],be=[],Ye=new Set,Ke=new Set(ye),Xe=function(rt){!rt||Ye.has(rt)||(Ye.add(rt),Xe(rt.parentNode))};ye.forEach(Xe);var Je=function(rt){!rt||Ke.has(rt)||Array.prototype.forEach.call(rt.children,function(nt){if(Ye.has(nt))Je(nt);else{var it=nt.getAttribute(ae),lt=it!==null&&it!=="false",ct=(counterMap.get(nt)||0)+1,ot=(ve.get(nt)||0)+1;counterMap.set(nt,ct),ve.set(nt,ot),be.push(nt),ct===1&<&&uncontrolledNodes.set(nt,!0),ot===1&&nt.setAttribute(ee,"true"),lt||nt.setAttribute(ae,"true")}})};return Je(Z),Ye.clear(),lockCount++,function(){be.forEach(function(rt){var nt=counterMap.get(rt)-1,it=ve.get(rt)-1;counterMap.set(rt,nt),ve.set(rt,it),nt||(uncontrolledNodes.has(rt)||rt.removeAttribute(ae),uncontrolledNodes.delete(rt)),it||rt.removeAttribute(ee)}),lockCount--,lockCount||(counterMap=new WeakMap,counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={})}},hideOthers=function(ie,Z,ee){ee===void 0&&(ee="data-aria-hidden");var ae=Array.from(Array.isArray(ie)?ie:[ie]),ye=Z||getDefaultParent(ie);return ye?(ae.push.apply(ae,Array.from(ye.querySelectorAll("[aria-live]"))),applyAttributeToOthers(ae,ye,ee,"aria-hidden")):function(){return null}},__assign=function(){return __assign=Object.assign||function(ie){for(var Z,ee=1,ae=arguments.length;ee"u")return zeroGap;var Z=getOffset(ie),ee=document.documentElement.clientWidth,ae=window.innerWidth;return{left:Z[0],top:Z[1],right:Z[2],gap:Math.max(0,ae-ee+Z[2]-Z[0])}},Style=styleSingleton(),getStyles=function(ie,Z,ee,ae){var ye=ie.left,ve=ie.top,be=ie.right,Ye=ie.gap;return ee===void 0&&(ee="margin"),` + .`.concat(noScrollbarsClassName,` { + overflow: hidden `).concat(ae,`; + padding-right: `).concat(Ye,"px ").concat(ae,`; + } + body { + overflow: hidden `).concat(ae,`; + overscroll-behavior: contain; + `).concat([Z&&"position: relative ".concat(ae,";"),ee==="margin"&&` + padding-left: `.concat(ye,`px; + padding-top: `).concat(ve,`px; + padding-right: `).concat(be,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(Ye,"px ").concat(ae,`; + `),ee==="padding"&&"padding-right: ".concat(Ye,"px ").concat(ae,";")].filter(Boolean).join(""),` + } + + .`).concat(zeroRightClassName,` { + right: `).concat(Ye,"px ").concat(ae,`; + } + + .`).concat(fullWidthClassName,` { + margin-right: `).concat(Ye,"px ").concat(ae,`; + } + + .`).concat(zeroRightClassName," .").concat(zeroRightClassName,` { + right: 0 `).concat(ae,`; + } + + .`).concat(fullWidthClassName," .").concat(fullWidthClassName,` { + margin-right: 0 `).concat(ae,`; + } + + body { + `).concat(removedBarSizeVariable,": ").concat(Ye,`px; + } +`)},RemoveScrollBar=function(ie){var Z=ie.noRelative,ee=ie.noImportant,ae=ie.gapMode,ye=ae===void 0?"margin":ae,ve=reactExports.useMemo(function(){return getGapWidth(ye)},[ye]);return reactExports.createElement(Style,{styles:getStyles(ve,!Z,ye,ee?"":"!important")})},passiveSupported=!1;if(typeof window<"u")try{var options=Object.defineProperty({},"passive",{get:function(){return passiveSupported=!0,!0}});window.addEventListener("test",options,options),window.removeEventListener("test",options,options)}catch{passiveSupported=!1}var nonPassive=passiveSupported?{passive:!1}:!1,alwaysContainsScroll=function(ie){return ie.tagName==="TEXTAREA"},elementCanBeScrolled=function(ie,Z){var ee=window.getComputedStyle(ie);return ee[Z]!=="hidden"&&!(ee.overflowY===ee.overflowX&&!alwaysContainsScroll(ie)&&ee[Z]==="visible")},elementCouldBeVScrolled=function(ie){return elementCanBeScrolled(ie,"overflowY")},elementCouldBeHScrolled=function(ie){return elementCanBeScrolled(ie,"overflowX")},locationCouldBeScrolled=function(ie,Z){var ee=Z;do{typeof ShadowRoot<"u"&&ee instanceof ShadowRoot&&(ee=ee.host);var ae=elementCouldBeScrolled(ie,ee);if(ae){var ye=getScrollVariables(ie,ee),ve=ye[1],be=ye[2];if(ve>be)return!0}ee=ee.parentNode}while(ee&&ee!==document.body);return!1},getVScrollVariables=function(ie){var Z=ie.scrollTop,ee=ie.scrollHeight,ae=ie.clientHeight;return[Z,ee,ae]},getHScrollVariables=function(ie){var Z=ie.scrollLeft,ee=ie.scrollWidth,ae=ie.clientWidth;return[Z,ee,ae]},elementCouldBeScrolled=function(ie,Z){return ie==="v"?elementCouldBeVScrolled(Z):elementCouldBeHScrolled(Z)},getScrollVariables=function(ie,Z){return ie==="v"?getVScrollVariables(Z):getHScrollVariables(Z)},getDirectionFactor=function(ie,Z){return ie==="h"&&Z==="rtl"?-1:1},handleScroll=function(ie,Z,ee,ae,ye){var ve=getDirectionFactor(ie,window.getComputedStyle(Z).direction),be=ve*ae,Ye=ee.target,Ke=Z.contains(Ye),Xe=!1,Je=be>0,rt=0,nt=0;do{var it=getScrollVariables(ie,Ye),lt=it[0],ct=it[1],ot=it[2],dt=ct-ot-ve*lt;(lt||dt)&&elementCouldBeScrolled(ie,Ye)&&(rt+=dt,nt+=lt),Ye=Ye.parentNode}while(!Ke&&Ye!==document.body||Ke&&(Z.contains(Ye)||Z===Ye));return(Je&&(ye&&rt===0||!ye&&be>rt)||!Je&&(ye&&nt===0||!ye&&-be>nt))&&(Xe=!0),Xe},getTouchXY=function(ie){return"changedTouches"in ie?[ie.changedTouches[0].clientX,ie.changedTouches[0].clientY]:[0,0]},getDeltaXY=function(ie){return[ie.deltaX,ie.deltaY]},extractRef=function(ie){return ie&&"current"in ie?ie.current:ie},deltaCompare=function(ie,Z){return ie[0]===Z[0]&&ie[1]===Z[1]},generateStyle=function(ie){return` + .block-interactivity-`.concat(ie,` {pointer-events: none;} + .allow-interactivity-`).concat(ie,` {pointer-events: all;} +`)},idCounter=0,lockStack=[];function RemoveScrollSideCar(ie){var Z=reactExports.useRef([]),ee=reactExports.useRef([0,0]),ae=reactExports.useRef(),ye=reactExports.useState(idCounter++)[0],ve=reactExports.useState(function(){return styleSingleton()})[0],be=reactExports.useRef(ie);reactExports.useEffect(function(){be.current=ie},[ie]),reactExports.useEffect(function(){if(ie.inert){document.body.classList.add("block-interactivity-".concat(ye));var ct=__spreadArray([ie.lockRef.current],(ie.shards||[]).map(extractRef),!0).filter(Boolean);return ct.forEach(function(ot){return ot.classList.add("allow-interactivity-".concat(ye))}),function(){document.body.classList.remove("block-interactivity-".concat(ye)),ct.forEach(function(ot){return ot.classList.remove("allow-interactivity-".concat(ye))})}}},[ie.inert,ie.lockRef.current,ie.shards]);var Ye=reactExports.useCallback(function(ct,ot){if("touches"in ct&&ct.touches.length===2)return!be.current.allowPinchZoom;var dt=getTouchXY(ct),ft=ee.current,gt="deltaX"in ct?ct.deltaX:ft[0]-dt[0],mt="deltaY"in ct?ct.deltaY:ft[1]-dt[1],Yr,Qr=ct.target,Xr=Math.abs(gt)>Math.abs(mt)?"h":"v";if("touches"in ct&&Xr==="h"&&Qr.type==="range")return!1;var Jr=locationCouldBeScrolled(Xr,Qr);if(!Jr)return!0;if(Jr?Yr=Xr:(Yr=Xr==="v"?"h":"v",Jr=locationCouldBeScrolled(Xr,Qr)),!Jr)return!1;if(!ae.current&&"changedTouches"in ct&&(gt||mt)&&(ae.current=Yr),!Yr)return!0;var ai=ae.current||Yr;return handleScroll(ai,ot,ct,ai==="h"?gt:mt,!0)},[]),Ke=reactExports.useCallback(function(ct){var ot=ct;if(!(!lockStack.length||lockStack[lockStack.length-1]!==ve)){var dt="deltaY"in ot?getDeltaXY(ot):getTouchXY(ot),ft=Z.current.filter(function(Yr){return Yr.name===ot.type&&Yr.target===ot.target&&deltaCompare(Yr.delta,dt)})[0];if(ft&&ft.should){ot.cancelable&&ot.preventDefault();return}if(!ft){var gt=(be.current.shards||[]).map(extractRef).filter(Boolean).filter(function(Yr){return Yr.contains(ot.target)}),mt=gt.length>0?Ye(ot,gt[0]):!be.current.noIsolation;mt&&ot.cancelable&&ot.preventDefault()}}},[]),Xe=reactExports.useCallback(function(ct,ot,dt,ft){var gt={name:ct,delta:ot,target:dt,should:ft};Z.current.push(gt),setTimeout(function(){Z.current=Z.current.filter(function(mt){return mt!==gt})},1)},[]),Je=reactExports.useCallback(function(ct){ee.current=getTouchXY(ct),ae.current=void 0},[]),rt=reactExports.useCallback(function(ct){Xe(ct.type,getDeltaXY(ct),ct.target,Ye(ct,ie.lockRef.current))},[]),nt=reactExports.useCallback(function(ct){Xe(ct.type,getTouchXY(ct),ct.target,Ye(ct,ie.lockRef.current))},[]);reactExports.useEffect(function(){return lockStack.push(ve),ie.setCallbacks({onScrollCapture:rt,onWheelCapture:rt,onTouchMoveCapture:nt}),document.addEventListener("wheel",Ke,nonPassive),document.addEventListener("touchmove",Ke,nonPassive),document.addEventListener("touchstart",Je,nonPassive),function(){lockStack=lockStack.filter(function(ct){return ct!==ve}),document.removeEventListener("wheel",Ke,nonPassive),document.removeEventListener("touchmove",Ke,nonPassive),document.removeEventListener("touchstart",Je,nonPassive)}},[]);var it=ie.removeScrollBar,lt=ie.inert;return reactExports.createElement(reactExports.Fragment,null,lt?reactExports.createElement(ve,{styles:generateStyle(ye)}):null,it?reactExports.createElement(RemoveScrollBar,{gapMode:"margin"}):null)}const SideCar=exportSidecar(effectCar,RemoveScrollSideCar);var ReactRemoveScroll=reactExports.forwardRef(function(ie,Z){return reactExports.createElement(RemoveScroll,__assign({},ie,{ref:Z,sideCar:SideCar}))});ReactRemoveScroll.classNames=RemoveScroll.classNames;const $01b9c$RemoveScroll=ReactRemoveScroll,$cb5cc270b50c6fcd$var$POPOVER_NAME="Popover",[$cb5cc270b50c6fcd$var$createPopoverContext,$cb5cc270b50c6fcd$export$c8393c9e73286932]=$c512c27ab02ef895$export$50c7b4e9d9f19c1($cb5cc270b50c6fcd$var$POPOVER_NAME,[$cf1ac5d9fe0e8206$export$722aac194ae923]),$cb5cc270b50c6fcd$var$usePopperScope=$cf1ac5d9fe0e8206$export$722aac194ae923(),[$cb5cc270b50c6fcd$var$PopoverProvider,$cb5cc270b50c6fcd$var$usePopoverContext]=$cb5cc270b50c6fcd$var$createPopoverContext($cb5cc270b50c6fcd$var$POPOVER_NAME),$cb5cc270b50c6fcd$export$5b6b19405a83ff9d=ie=>{const{__scopePopover:Z,children:ee,open:ae,defaultOpen:ye,onOpenChange:ve,modal:be=!1}=ie,Ye=$cb5cc270b50c6fcd$var$usePopperScope(Z),Ke=reactExports.useRef(null),[Xe,Je]=reactExports.useState(!1),[rt=!1,nt]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:ae,defaultProp:ye,onChange:ve});return reactExports.createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9,Ye,reactExports.createElement($cb5cc270b50c6fcd$var$PopoverProvider,{scope:Z,contentId:$1746a345f3d73bb7$export$f680877a34711e37(),triggerRef:Ke,open:rt,onOpenChange:nt,onOpenToggle:reactExports.useCallback(()=>nt(it=>!it),[nt]),hasCustomAnchor:Xe,onCustomAnchorAdd:reactExports.useCallback(()=>Je(!0),[]),onCustomAnchorRemove:reactExports.useCallback(()=>Je(!1),[]),modal:be},ee))},$cb5cc270b50c6fcd$var$TRIGGER_NAME="PopoverTrigger",$cb5cc270b50c6fcd$export$7dacb05d26466c3=reactExports.forwardRef((ie,Z)=>{const{__scopePopover:ee,...ae}=ie,ye=$cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$TRIGGER_NAME,ee),ve=$cb5cc270b50c6fcd$var$usePopperScope(ee),be=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,ye.triggerRef),Ye=reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button,_extends$1({type:"button","aria-haspopup":"dialog","aria-expanded":ye.open,"aria-controls":ye.contentId,"data-state":$cb5cc270b50c6fcd$var$getState(ye.open)},ae,{ref:be,onClick:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onClick,ye.onOpenToggle)}));return ye.hasCustomAnchor?Ye:reactExports.createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7,_extends$1({asChild:!0},ve),Ye)}),$cb5cc270b50c6fcd$var$PORTAL_NAME="PopoverPortal",[$cb5cc270b50c6fcd$var$PortalProvider,$cb5cc270b50c6fcd$var$usePortalContext]=$cb5cc270b50c6fcd$var$createPopoverContext($cb5cc270b50c6fcd$var$PORTAL_NAME,{forceMount:void 0}),$cb5cc270b50c6fcd$var$CONTENT_NAME="PopoverContent",$cb5cc270b50c6fcd$export$d7e1f420b25549ff=reactExports.forwardRef((ie,Z)=>{const ee=$cb5cc270b50c6fcd$var$usePortalContext($cb5cc270b50c6fcd$var$CONTENT_NAME,ie.__scopePopover),{forceMount:ae=ee.forceMount,...ye}=ie,ve=$cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$CONTENT_NAME,ie.__scopePopover);return reactExports.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b,{present:ae||ve.open},ve.modal?reactExports.createElement($cb5cc270b50c6fcd$var$PopoverContentModal,_extends$1({},ye,{ref:Z})):reactExports.createElement($cb5cc270b50c6fcd$var$PopoverContentNonModal,_extends$1({},ye,{ref:Z})))}),$cb5cc270b50c6fcd$var$PopoverContentModal=reactExports.forwardRef((ie,Z)=>{const ee=$cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$CONTENT_NAME,ie.__scopePopover),ae=reactExports.useRef(null),ye=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,ae),ve=reactExports.useRef(!1);return reactExports.useEffect(()=>{const be=ae.current;if(be)return hideOthers(be)},[]),reactExports.createElement($01b9c$RemoveScroll,{as:$5e63c961fc1ce211$export$8c6ed5c666ac1360,allowPinchZoom:!0},reactExports.createElement($cb5cc270b50c6fcd$var$PopoverContentImpl,_extends$1({},ie,{ref:ye,trapFocus:ee.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onCloseAutoFocus,be=>{var Ye;be.preventDefault(),ve.current||(Ye=ee.triggerRef.current)===null||Ye===void 0||Ye.focus()}),onPointerDownOutside:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onPointerDownOutside,be=>{const Ye=be.detail.originalEvent,Ke=Ye.button===0&&Ye.ctrlKey===!0,Xe=Ye.button===2||Ke;ve.current=Xe},{checkForDefaultPrevented:!1}),onFocusOutside:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onFocusOutside,be=>be.preventDefault(),{checkForDefaultPrevented:!1})})))}),$cb5cc270b50c6fcd$var$PopoverContentNonModal=reactExports.forwardRef((ie,Z)=>{const ee=$cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$CONTENT_NAME,ie.__scopePopover),ae=reactExports.useRef(!1),ye=reactExports.useRef(!1);return reactExports.createElement($cb5cc270b50c6fcd$var$PopoverContentImpl,_extends$1({},ie,{ref:Z,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:ve=>{var be;if((be=ie.onCloseAutoFocus)===null||be===void 0||be.call(ie,ve),!ve.defaultPrevented){var Ye;ae.current||(Ye=ee.triggerRef.current)===null||Ye===void 0||Ye.focus(),ve.preventDefault()}ae.current=!1,ye.current=!1},onInteractOutside:ve=>{var be,Ye;(be=ie.onInteractOutside)===null||be===void 0||be.call(ie,ve),ve.defaultPrevented||(ae.current=!0,ve.detail.originalEvent.type==="pointerdown"&&(ye.current=!0));const Ke=ve.target;!((Ye=ee.triggerRef.current)===null||Ye===void 0)&&Ye.contains(Ke)&&ve.preventDefault(),ve.detail.originalEvent.type==="focusin"&&ye.current&&ve.preventDefault()}}))}),$cb5cc270b50c6fcd$var$PopoverContentImpl=reactExports.forwardRef((ie,Z)=>{const{__scopePopover:ee,trapFocus:ae,onOpenAutoFocus:ye,onCloseAutoFocus:ve,disableOutsidePointerEvents:be,onEscapeKeyDown:Ye,onPointerDownOutside:Ke,onFocusOutside:Xe,onInteractOutside:Je,...rt}=ie,nt=$cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$CONTENT_NAME,ee),it=$cb5cc270b50c6fcd$var$usePopperScope(ee);return $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c(),reactExports.createElement($d3863c46a17e8a28$export$20e40289641fbbb6,{asChild:!0,loop:!0,trapped:ae,onMountAutoFocus:ye,onUnmountAutoFocus:ve},reactExports.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22,{asChild:!0,disableOutsidePointerEvents:be,onInteractOutside:Je,onEscapeKeyDown:Ye,onPointerDownOutside:Ke,onFocusOutside:Xe,onDismiss:()=>nt.onOpenChange(!1)},reactExports.createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2,_extends$1({"data-state":$cb5cc270b50c6fcd$var$getState(nt.open),role:"dialog",id:nt.contentId},it,rt,{ref:Z,style:{...rt.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))}),$cb5cc270b50c6fcd$var$CLOSE_NAME="PopoverClose",$cb5cc270b50c6fcd$export$d6ac43ebaa40d53e=reactExports.forwardRef((ie,Z)=>{const{__scopePopover:ee,...ae}=ie,ye=$cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$CLOSE_NAME,ee);return reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button,_extends$1({type:"button"},ae,{ref:Z,onClick:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onClick,()=>ye.onOpenChange(!1))}))}),$cb5cc270b50c6fcd$export$3152841115e061b2=reactExports.forwardRef((ie,Z)=>{const{__scopePopover:ee,...ae}=ie,ye=$cb5cc270b50c6fcd$var$usePopperScope(ee);return reactExports.createElement($cf1ac5d9fe0e8206$export$21b07c8f274aebd5,_extends$1({},ye,ae,{ref:Z}))});function $cb5cc270b50c6fcd$var$getState(ie){return ie?"open":"closed"}const $cb5cc270b50c6fcd$export$be92b6f5f03c0fe9=$cb5cc270b50c6fcd$export$5b6b19405a83ff9d,$cb5cc270b50c6fcd$export$41fb9f06171c75f4=$cb5cc270b50c6fcd$export$7dacb05d26466c3,$cb5cc270b50c6fcd$export$7c6e2c02157bb7d2=$cb5cc270b50c6fcd$export$d7e1f420b25549ff,$cb5cc270b50c6fcd$export$f39c2d165cd861fe=$cb5cc270b50c6fcd$export$d6ac43ebaa40d53e,$cb5cc270b50c6fcd$export$21b07c8f274aebd5=$cb5cc270b50c6fcd$export$3152841115e061b2;function $ae6933e535247d3d$export$7d15b64cf5a3a4c4(ie,[Z,ee]){return Math.min(ee,Math.max(Z,ie))}const $ea1ef594cf570d83$export$439d29a4e110a164=reactExports.forwardRef((ie,Z)=>reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span,_extends$1({},ie,{ref:Z,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...ie.style}}))),$cc7e05a45900e73f$var$OPEN_KEYS=[" ","Enter","ArrowUp","ArrowDown"],$cc7e05a45900e73f$var$SELECTION_KEYS=[" ","Enter"],$cc7e05a45900e73f$var$SELECT_NAME="Select",[$cc7e05a45900e73f$var$Collection,$cc7e05a45900e73f$var$useCollection,$cc7e05a45900e73f$var$createCollectionScope]=$e02a7d9cb1dc128c$export$c74125a8e3af6bb2($cc7e05a45900e73f$var$SELECT_NAME),[$cc7e05a45900e73f$var$createSelectContext,$cc7e05a45900e73f$export$286727a75dc039bd]=$c512c27ab02ef895$export$50c7b4e9d9f19c1($cc7e05a45900e73f$var$SELECT_NAME,[$cc7e05a45900e73f$var$createCollectionScope,$cf1ac5d9fe0e8206$export$722aac194ae923]),$cc7e05a45900e73f$var$usePopperScope=$cf1ac5d9fe0e8206$export$722aac194ae923(),[$cc7e05a45900e73f$var$SelectProvider,$cc7e05a45900e73f$var$useSelectContext]=$cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$SELECT_NAME),[$cc7e05a45900e73f$var$SelectNativeOptionsProvider,$cc7e05a45900e73f$var$useSelectNativeOptionsContext]=$cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$SELECT_NAME),$cc7e05a45900e73f$export$ef9b1a59e592288f=ie=>{const{__scopeSelect:Z,children:ee,open:ae,defaultOpen:ye,onOpenChange:ve,value:be,defaultValue:Ye,onValueChange:Ke,dir:Xe,name:Je,autoComplete:rt,disabled:nt,required:it}=ie,lt=$cc7e05a45900e73f$var$usePopperScope(Z),[ct,ot]=reactExports.useState(null),[dt,ft]=reactExports.useState(null),[gt,mt]=reactExports.useState(!1),Yr=$f631663db3294ace$export$b39126d51d94e6f3(Xe),[Qr=!1,Xr]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:ae,defaultProp:ye,onChange:ve}),[Jr,ai]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:be,defaultProp:Ye,onChange:Ke}),oi=reactExports.useRef(null),ni=ct?!!ct.closest("form"):!0,[li,ui]=reactExports.useState(new Set),mi=Array.from(li).map(ii=>ii.props.value).join(";");return reactExports.createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9,lt,reactExports.createElement($cc7e05a45900e73f$var$SelectProvider,{required:it,scope:Z,trigger:ct,onTriggerChange:ot,valueNode:dt,onValueNodeChange:ft,valueNodeHasChildren:gt,onValueNodeHasChildrenChange:mt,contentId:$1746a345f3d73bb7$export$f680877a34711e37(),value:Jr,onValueChange:ai,open:Qr,onOpenChange:Xr,dir:Yr,triggerPointerDownPosRef:oi,disabled:nt},reactExports.createElement($cc7e05a45900e73f$var$Collection.Provider,{scope:Z},reactExports.createElement($cc7e05a45900e73f$var$SelectNativeOptionsProvider,{scope:ie.__scopeSelect,onNativeOptionAdd:reactExports.useCallback(ii=>{ui(hi=>new Set(hi).add(ii))},[]),onNativeOptionRemove:reactExports.useCallback(ii=>{ui(hi=>{const ri=new Set(hi);return ri.delete(ii),ri})},[])},ee)),ni?reactExports.createElement($cc7e05a45900e73f$var$BubbleSelect,{key:mi,"aria-hidden":!0,required:it,tabIndex:-1,name:Je,autoComplete:rt,value:Jr,onChange:ii=>ai(ii.target.value),disabled:nt},Jr===void 0?reactExports.createElement("option",{value:""}):null,Array.from(li)):null))},$cc7e05a45900e73f$var$TRIGGER_NAME="SelectTrigger",$cc7e05a45900e73f$export$3ac1e88a1c0b9f1=reactExports.forwardRef((ie,Z)=>{const{__scopeSelect:ee,disabled:ae=!1,...ye}=ie,ve=$cc7e05a45900e73f$var$usePopperScope(ee),be=$cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$TRIGGER_NAME,ee),Ye=be.disabled||ae,Ke=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,be.onTriggerChange),Xe=$cc7e05a45900e73f$var$useCollection(ee),[Je,rt,nt]=$cc7e05a45900e73f$var$useTypeaheadSearch(lt=>{const ct=Xe().filter(ft=>!ft.disabled),ot=ct.find(ft=>ft.value===be.value),dt=$cc7e05a45900e73f$var$findNextItem(ct,lt,ot);dt!==void 0&&be.onValueChange(dt.value)}),it=()=>{Ye||(be.onOpenChange(!0),nt())};return reactExports.createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7,_extends$1({asChild:!0},ve),reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button,_extends$1({type:"button",role:"combobox","aria-controls":be.contentId,"aria-expanded":be.open,"aria-required":be.required,"aria-autocomplete":"none",dir:be.dir,"data-state":be.open?"open":"closed",disabled:Ye,"data-disabled":Ye?"":void 0,"data-placeholder":$cc7e05a45900e73f$var$shouldShowPlaceholder(be.value)?"":void 0},ye,{ref:Ke,onClick:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ye.onClick,lt=>{lt.currentTarget.focus()}),onPointerDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ye.onPointerDown,lt=>{const ct=lt.target;ct.hasPointerCapture(lt.pointerId)&&ct.releasePointerCapture(lt.pointerId),lt.button===0&<.ctrlKey===!1&&(it(),be.triggerPointerDownPosRef.current={x:Math.round(lt.pageX),y:Math.round(lt.pageY)},lt.preventDefault())}),onKeyDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ye.onKeyDown,lt=>{const ct=Je.current!=="";!(lt.ctrlKey||lt.altKey||lt.metaKey)&<.key.length===1&&rt(lt.key),!(ct&<.key===" ")&&$cc7e05a45900e73f$var$OPEN_KEYS.includes(lt.key)&&(it(),lt.preventDefault())})})))}),$cc7e05a45900e73f$var$VALUE_NAME="SelectValue",$cc7e05a45900e73f$export$e288731fd71264f0=reactExports.forwardRef((ie,Z)=>{const{__scopeSelect:ee,className:ae,style:ye,children:ve,placeholder:be="",...Ye}=ie,Ke=$cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$VALUE_NAME,ee),{onValueNodeHasChildrenChange:Xe}=Ke,Je=ve!==void 0,rt=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,Ke.onValueNodeChange);return $9f79659886946c16$export$e5c5a5f917a5871c(()=>{Xe(Je)},[Xe,Je]),reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span,_extends$1({},Ye,{ref:rt,style:{pointerEvents:"none"}}),$cc7e05a45900e73f$var$shouldShowPlaceholder(Ke.value)?reactExports.createElement(reactExports.Fragment,null,be):ve)}),$cc7e05a45900e73f$export$99b400cabb58c515=reactExports.forwardRef((ie,Z)=>{const{__scopeSelect:ee,children:ae,...ye}=ie;return reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span,_extends$1({"aria-hidden":!0},ye,{ref:Z}),ae||"▼")}),$cc7e05a45900e73f$export$b2af6c9944296213=ie=>reactExports.createElement($f1701beae083dbae$export$602eac185826482c,_extends$1({asChild:!0},ie)),$cc7e05a45900e73f$var$CONTENT_NAME="SelectContent",$cc7e05a45900e73f$export$c973a4b3cb86a03d=reactExports.forwardRef((ie,Z)=>{const ee=$cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$CONTENT_NAME,ie.__scopeSelect),[ae,ye]=reactExports.useState();if($9f79659886946c16$export$e5c5a5f917a5871c(()=>{ye(new DocumentFragment)},[]),!ee.open){const ve=ae;return ve?reactDomExports.createPortal(reactExports.createElement($cc7e05a45900e73f$var$SelectContentProvider,{scope:ie.__scopeSelect},reactExports.createElement($cc7e05a45900e73f$var$Collection.Slot,{scope:ie.__scopeSelect},reactExports.createElement("div",null,ie.children))),ve):null}return reactExports.createElement($cc7e05a45900e73f$var$SelectContentImpl,_extends$1({},ie,{ref:Z}))}),$cc7e05a45900e73f$var$CONTENT_MARGIN=10,[$cc7e05a45900e73f$var$SelectContentProvider,$cc7e05a45900e73f$var$useSelectContentContext]=$cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$CONTENT_NAME),$cc7e05a45900e73f$var$SelectContentImpl=reactExports.forwardRef((ie,Z)=>{const{__scopeSelect:ee,position:ae="item-aligned",onCloseAutoFocus:ye,onEscapeKeyDown:ve,onPointerDownOutside:be,side:Ye,sideOffset:Ke,align:Xe,alignOffset:Je,arrowPadding:rt,collisionBoundary:nt,collisionPadding:it,sticky:lt,hideWhenDetached:ct,avoidCollisions:ot,...dt}=ie,ft=$cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$CONTENT_NAME,ee),[gt,mt]=reactExports.useState(null),[Yr,Qr]=reactExports.useState(null),Xr=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,Ai=>mt(Ai)),[Jr,ai]=reactExports.useState(null),[oi,ni]=reactExports.useState(null),li=$cc7e05a45900e73f$var$useCollection(ee),[ui,mi]=reactExports.useState(!1),ii=reactExports.useRef(!1);reactExports.useEffect(()=>{if(gt)return hideOthers(gt)},[gt]),$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c();const hi=reactExports.useCallback(Ai=>{const[ki,...Yi]=li().map(hs=>hs.ref.current),[Ji]=Yi.slice(-1),ls=document.activeElement;for(const hs of Ai)if(hs===ls||(hs==null||hs.scrollIntoView({block:"nearest"}),hs===ki&&Yr&&(Yr.scrollTop=0),hs===Ji&&Yr&&(Yr.scrollTop=Yr.scrollHeight),hs==null||hs.focus(),document.activeElement!==ls))return},[li,Yr]),ri=reactExports.useCallback(()=>hi([Jr,gt]),[hi,Jr,gt]);reactExports.useEffect(()=>{ui&&ri()},[ui,ri]);const{onOpenChange:ci,triggerPointerDownPosRef:Si}=ft;reactExports.useEffect(()=>{if(gt){let Ai={x:0,y:0};const ki=Ji=>{var ls,hs,Kr,di;Ai={x:Math.abs(Math.round(Ji.pageX)-((ls=(hs=Si.current)===null||hs===void 0?void 0:hs.x)!==null&&ls!==void 0?ls:0)),y:Math.abs(Math.round(Ji.pageY)-((Kr=(di=Si.current)===null||di===void 0?void 0:di.y)!==null&&Kr!==void 0?Kr:0))}},Yi=Ji=>{Ai.x<=10&&Ai.y<=10?Ji.preventDefault():gt.contains(Ji.target)||ci(!1),document.removeEventListener("pointermove",ki),Si.current=null};return Si.current!==null&&(document.addEventListener("pointermove",ki),document.addEventListener("pointerup",Yi,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ki),document.removeEventListener("pointerup",Yi,{capture:!0})}}},[gt,ci,Si]),reactExports.useEffect(()=>{const Ai=()=>ci(!1);return window.addEventListener("blur",Ai),window.addEventListener("resize",Ai),()=>{window.removeEventListener("blur",Ai),window.removeEventListener("resize",Ai)}},[ci]);const[si,Ei]=$cc7e05a45900e73f$var$useTypeaheadSearch(Ai=>{const ki=li().filter(ls=>!ls.disabled),Yi=ki.find(ls=>ls.ref.current===document.activeElement),Ji=$cc7e05a45900e73f$var$findNextItem(ki,Ai,Yi);Ji&&setTimeout(()=>Ji.ref.current.focus())}),yi=reactExports.useCallback((Ai,ki,Yi)=>{const Ji=!ii.current&&!Yi;(ft.value!==void 0&&ft.value===ki||Ji)&&(ai(Ai),Ji&&(ii.current=!0))},[ft.value]),Mi=reactExports.useCallback(()=>gt==null?void 0:gt.focus(),[gt]),Ci=reactExports.useCallback((Ai,ki,Yi)=>{const Ji=!ii.current&&!Yi;(ft.value!==void 0&&ft.value===ki||Ji)&&ni(Ai)},[ft.value]),Ri=ae==="popper"?$cc7e05a45900e73f$var$SelectPopperPosition:$cc7e05a45900e73f$var$SelectItemAlignedPosition,Ni=Ri===$cc7e05a45900e73f$var$SelectPopperPosition?{side:Ye,sideOffset:Ke,align:Xe,alignOffset:Je,arrowPadding:rt,collisionBoundary:nt,collisionPadding:it,sticky:lt,hideWhenDetached:ct,avoidCollisions:ot}:{};return reactExports.createElement($cc7e05a45900e73f$var$SelectContentProvider,{scope:ee,content:gt,viewport:Yr,onViewportChange:Qr,itemRefCallback:yi,selectedItem:Jr,onItemLeave:Mi,itemTextRefCallback:Ci,focusSelectedItem:ri,selectedItemText:oi,position:ae,isPositioned:ui,searchRef:si},reactExports.createElement($01b9c$RemoveScroll,{as:$5e63c961fc1ce211$export$8c6ed5c666ac1360,allowPinchZoom:!0},reactExports.createElement($d3863c46a17e8a28$export$20e40289641fbbb6,{asChild:!0,trapped:ft.open,onMountAutoFocus:Ai=>{Ai.preventDefault()},onUnmountAutoFocus:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ye,Ai=>{var ki;(ki=ft.trigger)===null||ki===void 0||ki.focus({preventScroll:!0}),Ai.preventDefault()})},reactExports.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:ve,onPointerDownOutside:be,onFocusOutside:Ai=>Ai.preventDefault(),onDismiss:()=>ft.onOpenChange(!1)},reactExports.createElement(Ri,_extends$1({role:"listbox",id:ft.contentId,"data-state":ft.open?"open":"closed",dir:ft.dir,onContextMenu:Ai=>Ai.preventDefault()},dt,Ni,{onPlaced:()=>mi(!0),ref:Xr,style:{display:"flex",flexDirection:"column",outline:"none",...dt.style},onKeyDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(dt.onKeyDown,Ai=>{const ki=Ai.ctrlKey||Ai.altKey||Ai.metaKey;if(Ai.key==="Tab"&&Ai.preventDefault(),!ki&&Ai.key.length===1&&Ei(Ai.key),["ArrowUp","ArrowDown","Home","End"].includes(Ai.key)){let Yi=li().filter(Ji=>!Ji.disabled).map(Ji=>Ji.ref.current);if(["ArrowUp","End"].includes(Ai.key)&&(Yi=Yi.slice().reverse()),["ArrowUp","ArrowDown"].includes(Ai.key)){const Ji=Ai.target,ls=Yi.indexOf(Ji);Yi=Yi.slice(ls+1)}setTimeout(()=>hi(Yi)),Ai.preventDefault()}})}))))))}),$cc7e05a45900e73f$var$SelectItemAlignedPosition=reactExports.forwardRef((ie,Z)=>{const{__scopeSelect:ee,onPlaced:ae,...ye}=ie,ve=$cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$CONTENT_NAME,ee),be=$cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$CONTENT_NAME,ee),[Ye,Ke]=reactExports.useState(null),[Xe,Je]=reactExports.useState(null),rt=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,Xr=>Je(Xr)),nt=$cc7e05a45900e73f$var$useCollection(ee),it=reactExports.useRef(!1),lt=reactExports.useRef(!0),{viewport:ct,selectedItem:ot,selectedItemText:dt,focusSelectedItem:ft}=be,gt=reactExports.useCallback(()=>{if(ve.trigger&&ve.valueNode&&Ye&&Xe&&ct&&ot&&dt){const Xr=ve.trigger.getBoundingClientRect(),Jr=Xe.getBoundingClientRect(),ai=ve.valueNode.getBoundingClientRect(),oi=dt.getBoundingClientRect();if(ve.dir!=="rtl"){const Ji=oi.left-Jr.left,ls=ai.left-Ji,hs=Xr.left-ls,Kr=Xr.width+hs,di=Math.max(Kr,Jr.width),wi=window.innerWidth-$cc7e05a45900e73f$var$CONTENT_MARGIN,Ii=$ae6933e535247d3d$export$7d15b64cf5a3a4c4(ls,[$cc7e05a45900e73f$var$CONTENT_MARGIN,wi-di]);Ye.style.minWidth=Kr+"px",Ye.style.left=Ii+"px"}else{const Ji=Jr.right-oi.right,ls=window.innerWidth-ai.right-Ji,hs=window.innerWidth-Xr.right-ls,Kr=Xr.width+hs,di=Math.max(Kr,Jr.width),wi=window.innerWidth-$cc7e05a45900e73f$var$CONTENT_MARGIN,Ii=$ae6933e535247d3d$export$7d15b64cf5a3a4c4(ls,[$cc7e05a45900e73f$var$CONTENT_MARGIN,wi-di]);Ye.style.minWidth=Kr+"px",Ye.style.right=Ii+"px"}const ni=nt(),li=window.innerHeight-$cc7e05a45900e73f$var$CONTENT_MARGIN*2,ui=ct.scrollHeight,mi=window.getComputedStyle(Xe),ii=parseInt(mi.borderTopWidth,10),hi=parseInt(mi.paddingTop,10),ri=parseInt(mi.borderBottomWidth,10),ci=parseInt(mi.paddingBottom,10),Si=ii+hi+ui+ci+ri,si=Math.min(ot.offsetHeight*5,Si),Ei=window.getComputedStyle(ct),yi=parseInt(Ei.paddingTop,10),Mi=parseInt(Ei.paddingBottom,10),Ci=Xr.top+Xr.height/2-$cc7e05a45900e73f$var$CONTENT_MARGIN,Ri=li-Ci,Ni=ot.offsetHeight/2,Ai=ot.offsetTop+Ni,ki=ii+hi+Ai,Yi=Si-ki;if(ki<=Ci){const Ji=ot===ni[ni.length-1].ref.current;Ye.style.bottom="0px";const ls=Xe.clientHeight-ct.offsetTop-ct.offsetHeight,hs=Math.max(Ri,Ni+(Ji?Mi:0)+ls+ri),Kr=ki+hs;Ye.style.height=Kr+"px"}else{const Ji=ot===ni[0].ref.current;Ye.style.top="0px";const ls=Math.max(Ci,ii+ct.offsetTop+(Ji?yi:0)+Ni)+Yi;Ye.style.height=ls+"px",ct.scrollTop=ki-Ci+ct.offsetTop}Ye.style.margin=`${$cc7e05a45900e73f$var$CONTENT_MARGIN}px 0`,Ye.style.minHeight=si+"px",Ye.style.maxHeight=li+"px",ae==null||ae(),requestAnimationFrame(()=>it.current=!0)}},[nt,ve.trigger,ve.valueNode,Ye,Xe,ct,ot,dt,ve.dir,ae]);$9f79659886946c16$export$e5c5a5f917a5871c(()=>gt(),[gt]);const[mt,Yr]=reactExports.useState();$9f79659886946c16$export$e5c5a5f917a5871c(()=>{Xe&&Yr(window.getComputedStyle(Xe).zIndex)},[Xe]);const Qr=reactExports.useCallback(Xr=>{Xr&<.current===!0&&(gt(),ft==null||ft(),lt.current=!1)},[gt,ft]);return reactExports.createElement($cc7e05a45900e73f$var$SelectViewportProvider,{scope:ee,contentWrapper:Ye,shouldExpandOnScrollRef:it,onScrollButtonChange:Qr},reactExports.createElement("div",{ref:Ke,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:mt}},reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({},ye,{ref:rt,style:{boxSizing:"border-box",maxHeight:"100%",...ye.style}}))))}),$cc7e05a45900e73f$var$SelectPopperPosition=reactExports.forwardRef((ie,Z)=>{const{__scopeSelect:ee,align:ae="start",collisionPadding:ye=$cc7e05a45900e73f$var$CONTENT_MARGIN,...ve}=ie,be=$cc7e05a45900e73f$var$usePopperScope(ee);return reactExports.createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2,_extends$1({},be,ve,{ref:Z,align:ae,collisionPadding:ye,style:{boxSizing:"border-box",...ve.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[$cc7e05a45900e73f$var$SelectViewportProvider,$cc7e05a45900e73f$var$useSelectViewportContext]=$cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$CONTENT_NAME,{}),$cc7e05a45900e73f$var$VIEWPORT_NAME="SelectViewport",$cc7e05a45900e73f$export$9ed6e7b40248d36d=reactExports.forwardRef((ie,Z)=>{const{__scopeSelect:ee,...ae}=ie,ye=$cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$VIEWPORT_NAME,ee),ve=$cc7e05a45900e73f$var$useSelectViewportContext($cc7e05a45900e73f$var$VIEWPORT_NAME,ee),be=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,ye.onViewportChange),Ye=reactExports.useRef(0);return reactExports.createElement(reactExports.Fragment,null,reactExports.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),reactExports.createElement($cc7e05a45900e73f$var$Collection.Slot,{scope:ee},reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({"data-radix-select-viewport":"",role:"presentation"},ae,{ref:be,style:{position:"relative",flex:1,overflow:"auto",...ae.style},onScroll:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ae.onScroll,Ke=>{const Xe=Ke.currentTarget,{contentWrapper:Je,shouldExpandOnScrollRef:rt}=ve;if(rt!=null&&rt.current&&Je){const nt=Math.abs(Ye.current-Xe.scrollTop);if(nt>0){const it=window.innerHeight-$cc7e05a45900e73f$var$CONTENT_MARGIN*2,lt=parseFloat(Je.style.minHeight),ct=parseFloat(Je.style.height),ot=Math.max(lt,ct);if(ot0?gt:0,Je.style.justifyContent="flex-end")}}}Ye.current=Xe.scrollTop})}))))}),$cc7e05a45900e73f$var$GROUP_NAME="SelectGroup",[$cc7e05a45900e73f$var$SelectGroupContextProvider,$cc7e05a45900e73f$var$useSelectGroupContext]=$cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$GROUP_NAME),$cc7e05a45900e73f$export$ee25a334c55de1f4=reactExports.forwardRef((ie,Z)=>{const{__scopeSelect:ee,...ae}=ie,ye=$1746a345f3d73bb7$export$f680877a34711e37();return reactExports.createElement($cc7e05a45900e73f$var$SelectGroupContextProvider,{scope:ee,id:ye},reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({role:"group","aria-labelledby":ye},ae,{ref:Z})))}),$cc7e05a45900e73f$var$LABEL_NAME="SelectLabel",$cc7e05a45900e73f$export$f67338d29bd972f8=reactExports.forwardRef((ie,Z)=>{const{__scopeSelect:ee,...ae}=ie,ye=$cc7e05a45900e73f$var$useSelectGroupContext($cc7e05a45900e73f$var$LABEL_NAME,ee);return reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({id:ye.id},ae,{ref:Z}))}),$cc7e05a45900e73f$var$ITEM_NAME="SelectItem",[$cc7e05a45900e73f$var$SelectItemContextProvider,$cc7e05a45900e73f$var$useSelectItemContext]=$cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$ITEM_NAME),$cc7e05a45900e73f$export$13ef48a934230896=reactExports.forwardRef((ie,Z)=>{const{__scopeSelect:ee,value:ae,disabled:ye=!1,textValue:ve,...be}=ie,Ye=$cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$ITEM_NAME,ee),Ke=$cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$ITEM_NAME,ee),Xe=Ye.value===ae,[Je,rt]=reactExports.useState(ve??""),[nt,it]=reactExports.useState(!1),lt=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,dt=>{var ft;return(ft=Ke.itemRefCallback)===null||ft===void 0?void 0:ft.call(Ke,dt,ae,ye)}),ct=$1746a345f3d73bb7$export$f680877a34711e37(),ot=()=>{ye||(Ye.onValueChange(ae),Ye.onOpenChange(!1))};if(ae==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return reactExports.createElement($cc7e05a45900e73f$var$SelectItemContextProvider,{scope:ee,value:ae,disabled:ye,textId:ct,isSelected:Xe,onItemTextChange:reactExports.useCallback(dt=>{rt(ft=>{var gt;return ft||((gt=dt==null?void 0:dt.textContent)!==null&>!==void 0?gt:"").trim()})},[])},reactExports.createElement($cc7e05a45900e73f$var$Collection.ItemSlot,{scope:ee,value:ae,disabled:ye,textValue:Je},reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({role:"option","aria-labelledby":ct,"data-highlighted":nt?"":void 0,"aria-selected":Xe&&nt,"data-state":Xe?"checked":"unchecked","aria-disabled":ye||void 0,"data-disabled":ye?"":void 0,tabIndex:ye?void 0:-1},be,{ref:lt,onFocus:$e42e1063c40fb3ef$export$b9ecd428b558ff10(be.onFocus,()=>it(!0)),onBlur:$e42e1063c40fb3ef$export$b9ecd428b558ff10(be.onBlur,()=>it(!1)),onPointerUp:$e42e1063c40fb3ef$export$b9ecd428b558ff10(be.onPointerUp,ot),onPointerMove:$e42e1063c40fb3ef$export$b9ecd428b558ff10(be.onPointerMove,dt=>{if(ye){var ft;(ft=Ke.onItemLeave)===null||ft===void 0||ft.call(Ke)}else dt.currentTarget.focus({preventScroll:!0})}),onPointerLeave:$e42e1063c40fb3ef$export$b9ecd428b558ff10(be.onPointerLeave,dt=>{if(dt.currentTarget===document.activeElement){var ft;(ft=Ke.onItemLeave)===null||ft===void 0||ft.call(Ke)}}),onKeyDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(be.onKeyDown,dt=>{var ft;((ft=Ke.searchRef)===null||ft===void 0?void 0:ft.current)!==""&&dt.key===" "||($cc7e05a45900e73f$var$SELECTION_KEYS.includes(dt.key)&&ot(),dt.key===" "&&dt.preventDefault())})}))))}),$cc7e05a45900e73f$var$ITEM_TEXT_NAME="SelectItemText",$cc7e05a45900e73f$export$3572fb0fb821ff49=reactExports.forwardRef((ie,Z)=>{const{__scopeSelect:ee,className:ae,style:ye,...ve}=ie,be=$cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME,ee),Ye=$cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME,ee),Ke=$cc7e05a45900e73f$var$useSelectItemContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME,ee),Xe=$cc7e05a45900e73f$var$useSelectNativeOptionsContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME,ee),[Je,rt]=reactExports.useState(null),nt=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,dt=>rt(dt),Ke.onItemTextChange,dt=>{var ft;return(ft=Ye.itemTextRefCallback)===null||ft===void 0?void 0:ft.call(Ye,dt,Ke.value,Ke.disabled)}),it=Je==null?void 0:Je.textContent,lt=reactExports.useMemo(()=>reactExports.createElement("option",{key:Ke.value,value:Ke.value,disabled:Ke.disabled},it),[Ke.disabled,Ke.value,it]),{onNativeOptionAdd:ct,onNativeOptionRemove:ot}=Xe;return $9f79659886946c16$export$e5c5a5f917a5871c(()=>(ct(lt),()=>ot(lt)),[ct,ot,lt]),reactExports.createElement(reactExports.Fragment,null,reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span,_extends$1({id:Ke.textId},ve,{ref:nt})),Ke.isSelected&&be.valueNode&&!be.valueNodeHasChildren?reactDomExports.createPortal(ve.children,be.valueNode):null)}),$cc7e05a45900e73f$var$ITEM_INDICATOR_NAME="SelectItemIndicator",$cc7e05a45900e73f$export$6b9198de19accfe6=reactExports.forwardRef((ie,Z)=>{const{__scopeSelect:ee,...ae}=ie;return $cc7e05a45900e73f$var$useSelectItemContext($cc7e05a45900e73f$var$ITEM_INDICATOR_NAME,ee).isSelected?reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span,_extends$1({"aria-hidden":!0},ae,{ref:Z})):null}),$cc7e05a45900e73f$var$SCROLL_UP_BUTTON_NAME="SelectScrollUpButton",$cc7e05a45900e73f$export$d8117927658af6d7=reactExports.forwardRef((ie,Z)=>{const ee=$cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$SCROLL_UP_BUTTON_NAME,ie.__scopeSelect),ae=$cc7e05a45900e73f$var$useSelectViewportContext($cc7e05a45900e73f$var$SCROLL_UP_BUTTON_NAME,ie.__scopeSelect),[ye,ve]=reactExports.useState(!1),be=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,ae.onScrollButtonChange);return $9f79659886946c16$export$e5c5a5f917a5871c(()=>{if(ee.viewport&&ee.isPositioned){let Ye=function(){const Xe=Ke.scrollTop>0;ve(Xe)};const Ke=ee.viewport;return Ye(),Ke.addEventListener("scroll",Ye),()=>Ke.removeEventListener("scroll",Ye)}},[ee.viewport,ee.isPositioned]),ye?reactExports.createElement($cc7e05a45900e73f$var$SelectScrollButtonImpl,_extends$1({},ie,{ref:be,onAutoScroll:()=>{const{viewport:Ye,selectedItem:Ke}=ee;Ye&&Ke&&(Ye.scrollTop=Ye.scrollTop-Ke.offsetHeight)}})):null}),$cc7e05a45900e73f$var$SCROLL_DOWN_BUTTON_NAME="SelectScrollDownButton",$cc7e05a45900e73f$export$ff951e476c12189=reactExports.forwardRef((ie,Z)=>{const ee=$cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$SCROLL_DOWN_BUTTON_NAME,ie.__scopeSelect),ae=$cc7e05a45900e73f$var$useSelectViewportContext($cc7e05a45900e73f$var$SCROLL_DOWN_BUTTON_NAME,ie.__scopeSelect),[ye,ve]=reactExports.useState(!1),be=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,ae.onScrollButtonChange);return $9f79659886946c16$export$e5c5a5f917a5871c(()=>{if(ee.viewport&&ee.isPositioned){let Ye=function(){const Xe=Ke.scrollHeight-Ke.clientHeight,Je=Math.ceil(Ke.scrollTop)Ke.removeEventListener("scroll",Ye)}},[ee.viewport,ee.isPositioned]),ye?reactExports.createElement($cc7e05a45900e73f$var$SelectScrollButtonImpl,_extends$1({},ie,{ref:be,onAutoScroll:()=>{const{viewport:Ye,selectedItem:Ke}=ee;Ye&&Ke&&(Ye.scrollTop=Ye.scrollTop+Ke.offsetHeight)}})):null}),$cc7e05a45900e73f$var$SelectScrollButtonImpl=reactExports.forwardRef((ie,Z)=>{const{__scopeSelect:ee,onAutoScroll:ae,...ye}=ie,ve=$cc7e05a45900e73f$var$useSelectContentContext("SelectScrollButton",ee),be=reactExports.useRef(null),Ye=$cc7e05a45900e73f$var$useCollection(ee),Ke=reactExports.useCallback(()=>{be.current!==null&&(window.clearInterval(be.current),be.current=null)},[]);return reactExports.useEffect(()=>()=>Ke(),[Ke]),$9f79659886946c16$export$e5c5a5f917a5871c(()=>{var Xe;const Je=Ye().find(rt=>rt.ref.current===document.activeElement);Je==null||(Xe=Je.ref.current)===null||Xe===void 0||Xe.scrollIntoView({block:"nearest"})},[Ye]),reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({"aria-hidden":!0},ye,{ref:Z,style:{flexShrink:0,...ye.style},onPointerDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ye.onPointerDown,()=>{be.current===null&&(be.current=window.setInterval(ae,50))}),onPointerMove:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ye.onPointerMove,()=>{var Xe;(Xe=ve.onItemLeave)===null||Xe===void 0||Xe.call(ve),be.current===null&&(be.current=window.setInterval(ae,50))}),onPointerLeave:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ye.onPointerLeave,()=>{Ke()})}))});function $cc7e05a45900e73f$var$shouldShowPlaceholder(ie){return ie===""||ie===void 0}const $cc7e05a45900e73f$var$BubbleSelect=reactExports.forwardRef((ie,Z)=>{const{value:ee,...ae}=ie,ye=reactExports.useRef(null),ve=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,ye),be=$010c2913dbd2fe3d$export$5cae361ad82dce8b(ee);return reactExports.useEffect(()=>{const Ye=ye.current,Ke=window.HTMLSelectElement.prototype,Xe=Object.getOwnPropertyDescriptor(Ke,"value").set;if(be!==ee&&Xe){const Je=new Event("change",{bubbles:!0});Xe.call(Ye,ee),Ye.dispatchEvent(Je)}},[be,ee]),reactExports.createElement($ea1ef594cf570d83$export$439d29a4e110a164,{asChild:!0},reactExports.createElement("select",_extends$1({},ae,{ref:ve,defaultValue:ee})))});$cc7e05a45900e73f$var$BubbleSelect.displayName="BubbleSelect";function $cc7e05a45900e73f$var$useTypeaheadSearch(ie){const Z=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(ie),ee=reactExports.useRef(""),ae=reactExports.useRef(0),ye=reactExports.useCallback(be=>{const Ye=ee.current+be;Z(Ye),function Ke(Xe){ee.current=Xe,window.clearTimeout(ae.current),Xe!==""&&(ae.current=window.setTimeout(()=>Ke(""),1e3))}(Ye)},[Z]),ve=reactExports.useCallback(()=>{ee.current="",window.clearTimeout(ae.current)},[]);return reactExports.useEffect(()=>()=>window.clearTimeout(ae.current),[]),[ee,ye,ve]}function $cc7e05a45900e73f$var$findNextItem(ie,Z,ee){const ae=Z.length>1&&Array.from(Z).every(Ye=>Ye===Z[0])?Z[0]:Z,ye=ee?ie.indexOf(ee):-1;let ve=$cc7e05a45900e73f$var$wrapArray(ie,Math.max(ye,0));ae.length===1&&(ve=ve.filter(Ye=>Ye!==ee));const be=ve.find(Ye=>Ye.textValue.toLowerCase().startsWith(ae.toLowerCase()));return be!==ee?be:void 0}function $cc7e05a45900e73f$var$wrapArray(ie,Z){return ie.map((ee,ae)=>ie[(Z+ae)%ie.length])}const $cc7e05a45900e73f$export$be92b6f5f03c0fe9=$cc7e05a45900e73f$export$ef9b1a59e592288f,$cc7e05a45900e73f$export$41fb9f06171c75f4=$cc7e05a45900e73f$export$3ac1e88a1c0b9f1,$cc7e05a45900e73f$export$7c6e2c02157bb7d2=$cc7e05a45900e73f$export$c973a4b3cb86a03d,$cc7e05a45900e73f$export$b04be29aa201d4f5=$cc7e05a45900e73f$export$f67338d29bd972f8,$cc7e05a45900e73f$export$6d08773d2e66f8f2=$cc7e05a45900e73f$export$13ef48a934230896;var openseadragon={exports:{}};(function(module){//! openseadragon 2.4.2 +//! Built on 2020-03-05 +//! Git commit: v2.4.2-0-c450749 +//! http://openseadragon.github.io +//! License: http://openseadragon.github.io/license/ +function OpenSeadragon(ie){return new OpenSeadragon.Viewer(ie)}(function(ie){ie.version={versionStr:"2.4.2",major:parseInt("2",10),minor:parseInt("4",10),revision:parseInt("2",10)};var Z={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object"},ee=Object.prototype.toString,ae=Object.prototype.hasOwnProperty;ie.isFunction=function(ye){return ie.type(ye)==="function"},ie.isArray=Array.isArray||function(ye){return ie.type(ye)==="array"},ie.isWindow=function(ye){return ye&&typeof ye=="object"&&"setInterval"in ye},ie.type=function(ye){return ye==null?String(ye):Z[ee.call(ye)]||"object"},ie.isPlainObject=function(ye){if(!ye||OpenSeadragon.type(ye)!=="object"||ye.nodeType||ie.isWindow(ye)||ye.constructor&&!ae.call(ye,"constructor")&&!ae.call(ye.constructor.prototype,"isPrototypeOf"))return!1;var ve;for(var be in ye)ve=be;return ve===void 0||ae.call(ye,ve)},ie.isEmptyObject=function(ye){for(var ve in ye)return!1;return!0},ie.freezeObject=function(ye){return Object.freeze?ie.freezeObject=Object.freeze:ie.freezeObject=function(ve){return ve},ie.freezeObject(ye)},ie.supportsCanvas=function(){var ye=document.createElement("canvas");return!!(ie.isFunction(ye.getContext)&&ye.getContext("2d"))}(),ie.isCanvasTainted=function(ye){var ve=!1;try{ye.getContext("2d").getImageData(0,0,1,1)}catch{ve=!0}return ve},ie.pixelDensityRatio=function(){if(ie.supportsCanvas){var ye=document.createElement("canvas").getContext("2d"),ve=window.devicePixelRatio||1,be=ye.webkitBackingStorePixelRatio||ye.mozBackingStorePixelRatio||ye.msBackingStorePixelRatio||ye.oBackingStorePixelRatio||ye.backingStorePixelRatio||1;return Math.max(ve,1)/be}else return 1}()})(OpenSeadragon),function($){$.extend=function(){var ie,Z,ee,ae,ye,ve,be=arguments[0]||{},Ye=arguments.length,Ke=!1,Xe=1;for(typeof be=="boolean"&&(Ke=be,be=arguments[1]||{},Xe=2),typeof be!="object"&&!OpenSeadragon.isFunction(be)&&(be={}),Ye===Xe&&(be=this,--Xe);Xe=ee.x&&Z.x=ee.y},getEvent:function(ie){return ie?$.getEvent=function(Z){return Z}:$.getEvent=function(){return window.event},$.getEvent(ie)},getMousePosition:function(ie){if(typeof ie.pageX=="number")$.getMousePosition=function(Z){var ee=new $.Point;return Z=$.getEvent(Z),ee.x=Z.pageX,ee.y=Z.pageY,ee};else if(typeof ie.clientX=="number")$.getMousePosition=function(Z){var ee=new $.Point;return Z=$.getEvent(Z),ee.x=Z.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,ee.y=Z.clientY+document.body.scrollTop+document.documentElement.scrollTop,ee};else throw new Error("Unknown event mouse position, no known technique.");return $.getMousePosition(ie)},getPageScroll:function(){var ie=document.documentElement||{},Z=document.body||{};if(typeof window.pageXOffset=="number")$.getPageScroll=function(){return new $.Point(window.pageXOffset,window.pageYOffset)};else if(Z.scrollLeft||Z.scrollTop)$.getPageScroll=function(){return new $.Point(document.body.scrollLeft,document.body.scrollTop)};else if(ie.scrollLeft||ie.scrollTop)$.getPageScroll=function(){return new $.Point(document.documentElement.scrollLeft,document.documentElement.scrollTop)};else return new $.Point(0,0);return $.getPageScroll()},setPageScroll:function(ie){if(typeof window.scrollTo<"u")$.setPageScroll=function(ae){window.scrollTo(ae.x,ae.y)};else{var Z=$.getPageScroll();if(Z.x===ie.x&&Z.y===ie.y)return;document.body.scrollLeft=ie.x,document.body.scrollTop=ie.y;var ee=$.getPageScroll();if(ee.x!==Z.x&&ee.y!==Z.y){$.setPageScroll=function(ae){document.body.scrollLeft=ae.x,document.body.scrollTop=ae.y};return}if(document.documentElement.scrollLeft=ie.x,document.documentElement.scrollTop=ie.y,ee=$.getPageScroll(),ee.x!==Z.x&&ee.y!==Z.y){$.setPageScroll=function(ae){document.documentElement.scrollLeft=ae.x,document.documentElement.scrollTop=ae.y};return}$.setPageScroll=function(ae){}}return $.setPageScroll(ie)},getWindowSize:function(){var ie=document.documentElement||{},Z=document.body||{};if(typeof window.innerWidth=="number")$.getWindowSize=function(){return new $.Point(window.innerWidth,window.innerHeight)};else if(ie.clientWidth||ie.clientHeight)$.getWindowSize=function(){return new $.Point(document.documentElement.clientWidth,document.documentElement.clientHeight)};else if(Z.clientWidth||Z.clientHeight)$.getWindowSize=function(){return new $.Point(document.body.clientWidth,document.body.clientHeight)};else throw new Error("Unknown window size, no known technique.");return $.getWindowSize()},makeCenteredNode:function(ie){ie=$.getElement(ie);var Z=[$.makeNeutralElement("div"),$.makeNeutralElement("div"),$.makeNeutralElement("div")];return $.extend(Z[0].style,{display:"table",height:"100%",width:"100%"}),$.extend(Z[1].style,{display:"table-row"}),$.extend(Z[2].style,{display:"table-cell",verticalAlign:"middle",textAlign:"center"}),Z[0].appendChild(Z[1]),Z[1].appendChild(Z[2]),Z[2].appendChild(ie),Z[0]},makeNeutralElement:function(ie){var Z=document.createElement(ie),ee=Z.style;return ee.background="transparent none",ee.border="none",ee.margin="0px",ee.padding="0px",ee.position="static",Z},now:function(){return Date.now?$.now=Date.now:$.now=function(){return new Date().getTime()},$.now()},makeTransparentImage:function(ie){return $.makeTransparentImage=function(Z){var ee=$.makeNeutralElement("img");return ee.src=Z,ee},$.Browser.vendor==$.BROWSERS.IE&&$.Browser.version<7&&($.makeTransparentImage=function(Z){var ee=$.makeNeutralElement("img"),ae=null;return ae=$.makeNeutralElement("span"),ae.style.display="inline-block",ee.onload=function(){ae.style.width=ae.style.width||ee.width+"px",ae.style.height=ae.style.height||ee.height+"px",ee.onload=null,ee=null},ee.src=Z,ae.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+Z+"', sizingMethod='scale')",ae}),$.makeTransparentImage(ie)},setElementOpacity:function(ie,Z,ee){var ae,ye;ie=$.getElement(ie),ee&&!$.Browser.alpha&&(Z=Math.round(Z)),$.Browser.opacity?ie.style.opacity=Z<1?Z:"":Z<1?(ae=Math.round(100*Z),ye="alpha(opacity="+ae+")",ie.style.filter=ye):ie.style.filter=""},setElementTouchActionNone:function(ie){ie=$.getElement(ie),typeof ie.style.touchAction<"u"?ie.style.touchAction="none":typeof ie.style.msTouchAction<"u"&&(ie.style.msTouchAction="none")},addClass:function(ie,Z){ie=$.getElement(ie),ie.className?(" "+ie.className+" ").indexOf(" "+Z+" ")===-1&&(ie.className+=" "+Z):ie.className=Z},indexOf:function(ie,Z,ee){return Array.prototype.indexOf?this.indexOf=function(ae,ye,ve){return ae.indexOf(ye,ve)}:this.indexOf=function(ae,ye,ve){var be,Ye=ve||0,Ke;if(!ae)throw new TypeError;if(Ke=ae.length,Ke===0||Ye>=Ke)return-1;for(Ye<0&&(Ye=Ke-Math.abs(Ye)),be=Ye;be=200&&Ye.status<300||Ye.status===0&&be!=="http:"&&be!=="https:"?Z(Ye):($.console.log("AJAX request returned %d: %s",Ye.status,ie),$.isFunction(ee)&&ee(Ye)))};try{if(Ye.open("GET",ie,!0),ve&&(Ye.responseType=ve),ye)for(var Ke in ye)Object.prototype.hasOwnProperty.call(ye,Ke)&&ye[Ke]&&Ye.setRequestHeader(Ke,ye[Ke]);ae&&(Ye.withCredentials=!0),Ye.send(null)}catch(nt){var Xe=nt.message,Je=$.Browser.vendor==$.BROWSERS.IE&&$.Browser.version<10;if(Je&&typeof nt.number<"u"&&nt.number==-2147024891&&(Xe+=` +See http://msdn.microsoft.com/en-us/library/ms537505(v=vs.85).aspx#xdomain`),$.console.log("%s while making AJAX request: %s",nt.name,Xe),Ye.onreadystatechange=function(){},window.XDomainRequest){var rt=new window.XDomainRequest;if(rt){rt.onload=function(it){$.isFunction(Z)&&Z({responseText:rt.responseText,status:200,statusText:"OK"})},rt.onerror=function(it){$.isFunction(ee)&&ee({responseText:rt.responseText,status:444,statusText:"An error happened. Due to an XDomainRequest deficiency we can not extract any information about this error. Upgrade your browser."})};try{rt.open("GET",ie),rt.send()}catch{$.isFunction(ee)&&ee(Ye,nt)}}}else $.isFunction(ee)&&ee(Ye,nt)}return Ye},jsonp:function(ie){var Z,ee=ie.url,ae=document.head||document.getElementsByTagName("head")[0]||document.documentElement,ye=ie.callbackName||"openseadragon"+$.now(),ve=window[ye],be="$1"+ye+"$2",Ye=ie.param||"callback",Ke=ie.callback;ee=ee.replace(/(\=)\?(&|$)|\?\?/i,be),ee+=(/\?/.test(ee)?"&":"?")+Ye+"="+ye,window[ye]=function(Xe){if(ve)window[ye]=ve;else try{delete window[ye]}catch{}Ke&&$.isFunction(Ke)&&Ke(Xe)},Z=document.createElement("script"),(ie.async!==void 0||ie.async!==!1)&&(Z.async="async"),ie.scriptCharset&&(Z.charset=ie.scriptCharset),Z.src=ee,Z.onload=Z.onreadystatechange=function(Xe,Je){(Je||!Z.readyState||/loaded|complete/.test(Z.readyState))&&(Z.onload=Z.onreadystatechange=null,ae&&Z.parentNode&&ae.removeChild(Z),Z=void 0)},ae.insertBefore(Z,ae.firstChild)},createFromDZI:function(){throw"OpenSeadragon.createFromDZI is deprecated, use Viewer.open."},parseXml:function(ie){if(window.DOMParser)$.parseXml=function(Z){var ee=null,ae;return ae=new DOMParser,ee=ae.parseFromString(Z,"text/xml"),ee};else if(window.ActiveXObject)$.parseXml=function(Z){var ee=null;return ee=new ActiveXObject("Microsoft.XMLDOM"),ee.async=!1,ee.loadXML(Z),ee};else throw new Error("Browser doesn't support XML DOM.");return $.parseXml(ie)},parseJSON:function(string){return window.JSON&&window.JSON.parse?$.parseJSON=window.JSON.parse:$.parseJSON=function(string){return eval("("+string+")")},$.parseJSON(string)},imageFormatSupported:function(ie){return ie=ie||"",!!FILEFORMATS[ie.toLowerCase()]}});var nullfunction=function(ie){};$.console=window.console||{log:nullfunction,debug:nullfunction,info:nullfunction,warn:nullfunction,error:nullfunction,assert:nullfunction},$.Browser={vendor:$.BROWSERS.UNKNOWN,version:0,alpha:!0};var FILEFORMATS={bmp:!1,jpeg:!0,jpg:!0,png:!0,tif:!1,wdp:!1},URLPARAMS={};(function(){var ie=navigator.appVersion,Z=navigator.userAgent,ee;switch(navigator.appName){case"Microsoft Internet Explorer":window.attachEvent&&window.ActiveXObject&&($.Browser.vendor=$.BROWSERS.IE,$.Browser.version=parseFloat(Z.substring(Z.indexOf("MSIE")+5,Z.indexOf(";",Z.indexOf("MSIE")))));break;case"Netscape":window.addEventListener&&(Z.indexOf("Firefox")>=0?($.Browser.vendor=$.BROWSERS.FIREFOX,$.Browser.version=parseFloat(Z.substring(Z.indexOf("Firefox")+8))):Z.indexOf("Safari")>=0?($.Browser.vendor=Z.indexOf("Chrome")>=0?$.BROWSERS.CHROME:$.BROWSERS.SAFARI,$.Browser.version=parseFloat(Z.substring(Z.substring(0,Z.indexOf("Safari")).lastIndexOf("/")+1,Z.indexOf("Safari")))):(ee=new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})"),ee.exec(Z)!==null&&($.Browser.vendor=$.BROWSERS.IE,$.Browser.version=parseFloat(RegExp.$1))));break;case"Opera":$.Browser.vendor=$.BROWSERS.OPERA,$.Browser.version=parseFloat(ie);break}var ae=window.location.search.substring(1),ye=ae.split("&"),ve,be,Ye;for(Ye=0;Ye0){var Ke=ve.substring(0,be),Xe=ve.substring(be+1);try{URLPARAMS[Ke]=decodeURIComponent(Xe)}catch{$.console.error("Ignoring malformed URL parameter: %s=%s",Ke,Xe)}}$.Browser.alpha=!($.Browser.vendor==$.BROWSERS.IE&&$.Browser.version<9||$.Browser.vendor==$.BROWSERS.CHROME&&$.Browser.version<2),$.Browser.opacity=!($.Browser.vendor==$.BROWSERS.IE&&$.Browser.version<9)})(),function(ie){var Z=ie.requestAnimationFrame||ie.mozRequestAnimationFrame||ie.webkitRequestAnimationFrame||ie.msRequestAnimationFrame,ee=ie.cancelAnimationFrame||ie.mozCancelAnimationFrame||ie.webkitCancelAnimationFrame||ie.msCancelAnimationFrame;if(Z&&ee)$.requestAnimationFrame=function(){return Z.apply(ie,arguments)},$.cancelAnimationFrame=function(){return ee.apply(ie,arguments)};else{var ae=[],ye=[],ve=0,be;$.requestAnimationFrame=function(Ye){return ae.push([++ve,Ye]),be||(be=setInterval(function(){if(ae.length){var Ke=$.now(),Xe=ye;for(ye=ae,ae=Xe;ye.length;)ye.shift()[1](Ke)}else clearInterval(be),be=void 0},1e3/50)),ve},$.cancelAnimationFrame=function(Ye){var Ke,Xe;for(Ke=0,Xe=ae.length;Ke8||"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",ie.MouseTracker.supportsMouseCapture=function(){var ei=document.createElement("div");return ie.isFunction(ei.setCapture)&&ie.isFunction(ei.releaseCapture)}(),ie.MouseTracker.subscribeEvents=["click","dblclick","keydown","keyup","keypress","focus","blur",ie.MouseTracker.wheelEventName],ie.MouseTracker.wheelEventName=="DOMMouseScroll"&&ie.MouseTracker.subscribeEvents.push("MozMousePixelScroll"),window.PointerEvent&&(window.navigator.pointerEnabled||ie.Browser.vendor!==ie.BROWSERS.IE)?(ie.MouseTracker.havePointerEvents=!0,ie.MouseTracker.subscribeEvents.push("pointerover","pointerout","pointerdown","pointerup","pointermove","pointercancel"),ie.MouseTracker.unprefixedPointerEvents=!0,navigator.maxTouchPoints?ie.MouseTracker.maxTouchPoints=navigator.maxTouchPoints:ie.MouseTracker.maxTouchPoints=0,ie.MouseTracker.haveMouseEnter=!1):window.MSPointerEvent&&window.navigator.msPointerEnabled?(ie.MouseTracker.havePointerEvents=!0,ie.MouseTracker.subscribeEvents.push("MSPointerOver","MSPointerOut","MSPointerDown","MSPointerUp","MSPointerMove","MSPointerCancel"),ie.MouseTracker.unprefixedPointerEvents=!1,navigator.msMaxTouchPoints?ie.MouseTracker.maxTouchPoints=navigator.msMaxTouchPoints:ie.MouseTracker.maxTouchPoints=0,ie.MouseTracker.haveMouseEnter=!1):(ie.MouseTracker.havePointerEvents=!1,ie.Browser.vendor===ie.BROWSERS.IE&&ie.Browser.version<9?(ie.MouseTracker.subscribeEvents.push("mouseenter","mouseleave"),ie.MouseTracker.haveMouseEnter=!0):(ie.MouseTracker.subscribeEvents.push("mouseover","mouseout"),ie.MouseTracker.haveMouseEnter=!1),ie.MouseTracker.subscribeEvents.push("mousedown","mouseup","mousemove"),"ontouchstart"in window&&ie.MouseTracker.subscribeEvents.push("touchstart","touchend","touchmove","touchcancel"),"ongesturestart"in window&&ie.MouseTracker.subscribeEvents.push("gesturestart","gesturechange"),ie.MouseTracker.mousePointerId="legacy-mouse",ie.MouseTracker.maxTouchPoints=10),ie.MouseTracker.GesturePointList=function(ei){this._gPoints=[],this.type=ei,this.buttons=0,this.contacts=0,this.clicks=0,this.captureCount=0},ie.MouseTracker.GesturePointList.prototype={getLength:function(){return this._gPoints.length},asArray:function(){return this._gPoints},add:function(ei){return this._gPoints.push(ei)},removeById:function(ei){var Zr,pi=this._gPoints.length;for(Zr=0;Zr1&&(this.type==="mouse"||this.type==="pen")&&(this.contacts=1)},removeContact:function(){--this.contacts,this.contacts<0&&(this.contacts=0)}};function ae(ei){var Zr=ee[ei.hash],pi,gi=Zr.activePointersLists.length;for(pi=0;pi0&&(ie.removeEvent(ie.MouseTracker.captureElement,"mousemove",Zr.mousemovecaptured,!0),ie.removeEvent(ie.MouseTracker.captureElement,"mouseup",Zr.mouseupcaptured,!0),ie.removeEvent(ie.MouseTracker.captureElement,ie.MouseTracker.unprefixedPointerEvents?"pointermove":"MSPointerMove",Zr.pointermovecaptured,!0),ie.removeEvent(ie.MouseTracker.captureElement,ie.MouseTracker.unprefixedPointerEvents?"pointerup":"MSPointerUp",Zr.pointerupcaptured,!0),ie.removeEvent(ie.MouseTracker.captureElement,"touchmove",Zr.touchmovecaptured,!0),ie.removeEvent(ie.MouseTracker.captureElement,"touchend",Zr.touchendcaptured,!0),Zr.activePointersLists[pi].captureCount=0);for(pi=0;pi0){for(gi=0;gi<$i;gi++)Vi.push(pi.getByIndex(gi));Vi.length>0&&(Zs(ei,Zr,Vi,0),pi.captureCount=1,Ke(ei,pi.type),vs(ei,Zr,Vi))}}function Ci(ei,Zr){var pi,gi,$i,Vi=Zr.changedTouches.length,Bi=[],Ui,es=ei.getActivePointersListByType("touch");for(pi=ie.now(),es.getLength()>Zr.touches.length-Vi&&(ie.console.warn("Tracked touch contact count doesn't match event.touches.length. Removing all tracked touch pointers."),Mi(ei,Zr,es)),gi=0;gi"u")return Mi(ei,Zr,Vi),!1;for(Qi=0;Qi"u"?!0:ee.attachToViewer,this.autoFade=typeof ee.autoFade>"u"?!0:ee.autoFade,this.element=Z,this.anchor=ee.anchor,this.container=ae,this.anchor==ie.ControlAnchor.ABSOLUTE?(this.wrapper=ie.makeNeutralElement("div"),this.wrapper.style.position="absolute",this.wrapper.style.top=typeof ee.top=="number"?ee.top+"px":ee.top,this.wrapper.style.left=typeof ee.left=="number"?ee.left+"px":ee.left,this.wrapper.style.height=typeof ee.height=="number"?ee.height+"px":ee.height,this.wrapper.style.width=typeof ee.width=="number"?ee.width+"px":ee.width,this.wrapper.style.margin="0px",this.wrapper.style.padding="0px",this.element.style.position="relative",this.element.style.top="0px",this.element.style.left="0px",this.element.style.height="100%",this.element.style.width="100%"):(this.wrapper=ie.makeNeutralElement("div"),this.wrapper.style.display="inline-block",this.anchor==ie.ControlAnchor.NONE&&(this.wrapper.style.width=this.wrapper.style.height="100%")),this.wrapper.appendChild(this.element),ee.attachToViewer?this.anchor==ie.ControlAnchor.TOP_RIGHT||this.anchor==ie.ControlAnchor.BOTTOM_RIGHT?this.container.insertBefore(this.wrapper,this.container.firstChild):this.container.appendChild(this.wrapper):ye.appendChild(this.wrapper)},ie.Control.prototype={destroy:function(){this.wrapper.removeChild(this.element),this.container.removeChild(this.wrapper)},isVisible:function(){return this.wrapper.style.display!="none"},setVisible:function(Z){this.wrapper.style.display=Z?this.anchor==ie.ControlAnchor.ABSOLUTE?"block":"inline-block":"none"},setOpacity:function(Z){this.element[ie.SIGNAL]&&ie.Browser.vendor==ie.BROWSERS.IE?ie.setElementOpacity(this.element,Z,!0):ie.setElementOpacity(this.wrapper,Z,!0)}}}(OpenSeadragon),function(ie){ie.ControlDock=function(ee){var ae=["topleft","topright","bottomright","bottomleft"],ye,ve;for(ie.extend(!0,this,{id:"controldock-"+ie.now()+"-"+Math.floor(Math.random()*1e6),container:ie.makeNeutralElement("div"),controls:[]},ee),this.container.onsubmit=function(){return!1},this.element&&(this.element=ie.getElement(this.element),this.element.appendChild(this.container),this.element.style.position="relative",this.container.style.width="100%",this.container.style.height="100%"),ve=0;ve=0)){switch(ae.anchor){case ie.ControlAnchor.TOP_RIGHT:ye=this.controls.topright,ee.style.position="relative",ee.style.paddingRight="0px",ee.style.paddingTop="0px";break;case ie.ControlAnchor.BOTTOM_RIGHT:ye=this.controls.bottomright,ee.style.position="relative",ee.style.paddingRight="0px",ee.style.paddingBottom="0px";break;case ie.ControlAnchor.BOTTOM_LEFT:ye=this.controls.bottomleft,ee.style.position="relative",ee.style.paddingLeft="0px",ee.style.paddingBottom="0px";break;case ie.ControlAnchor.TOP_LEFT:ye=this.controls.topleft,ee.style.position="relative",ee.style.paddingLeft="0px",ee.style.paddingTop="0px";break;case ie.ControlAnchor.ABSOLUTE:ye=this.container,ee.style.margin="0px",ee.style.padding="0px";break;default:case ie.ControlAnchor.NONE:ye=this.container,ee.style.margin="0px",ee.style.padding="0px";break}this.controls.push(new ie.Control(ee,ae,ye)),ee.style.display="inline-block"}},removeControl:function(ee){ee=ie.getElement(ee);var ae=Z(this,ee);return ae>=0&&(this.controls[ae].destroy(),this.controls.splice(ae,1)),this},clearControls:function(){for(;this.controls.length>0;)this.controls.pop().destroy();return this},areControlsEnabled:function(){var ee;for(ee=this.controls.length-1;ee>=0;ee--)if(this.controls[ee].isVisible())return!0;return!1},setControlsEnabled:function(ee){var ae;for(ae=this.controls.length-1;ae>=0;ae--)this.controls[ae].setVisible(ee);return this}};function Z(ee,ae){var ye=ee.controls,ve;for(ve=ye.length-1;ve>=0;ve--)if(ye[ve].element==ae)return ve;return-1}}(OpenSeadragon),function(ie){ie.Placement=ie.freezeObject({CENTER:0,TOP_LEFT:1,TOP:2,TOP_RIGHT:3,RIGHT:4,BOTTOM_RIGHT:5,BOTTOM:6,BOTTOM_LEFT:7,LEFT:8,properties:{0:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!1,isVerticallyCentered:!0,isBottom:!1},1:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!0,isVerticallyCentered:!1,isBottom:!1},2:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!0,isVerticallyCentered:!1,isBottom:!1},3:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!0,isVerticallyCentered:!1,isBottom:!1},4:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!1,isVerticallyCentered:!0,isBottom:!1},5:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!1,isVerticallyCentered:!1,isBottom:!0},6:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!1,isVerticallyCentered:!1,isBottom:!0},7:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!1,isVerticallyCentered:!1,isBottom:!0},8:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!1,isVerticallyCentered:!0,isBottom:!1}}})}(OpenSeadragon),function(ie){var Z={},ee=1;ie.Viewer=function(Kr){var di=arguments,wi=this,Ii;if(ie.isPlainObject(Kr)||(Kr={id:di[0],xmlPath:di.length>1?di[1]:void 0,prefixUrl:di.length>2?di[2]:void 0,controls:di.length>3?di[3]:void 0,overlays:di.length>4?di[4]:void 0}),Kr.config&&(ie.extend(!0,Kr,Kr.config),delete Kr.config),ie.extend(!0,this,{id:Kr.id,hash:Kr.hash||ee++,initialPage:0,element:null,container:null,canvas:null,overlays:[],overlaysContainer:null,previousBody:[],customControls:[],source:null,drawer:null,world:null,viewport:null,navigator:null,collectionViewport:null,collectionDrawer:null,navImages:null,buttons:null,profiler:null},ie.DEFAULT_SETTINGS,Kr),typeof this.hash>"u")throw new Error("A hash must be defined, either by specifying options.id or options.hash.");for(typeof Z[this.hash]<"u"&&ie.console.warn("Hash "+this.hash+" has already been used."),Z[this.hash]={fsBoundsDelta:new ie.Point(1,1),prevContainerSize:null,animating:!1,forceRedraw:!1,mouseInside:!1,group:null,zooming:!1,zoomFactor:null,lastZoomTime:null,fullPage:!1,onfullscreenchange:null},this._sequenceIndex=0,this._firstOpen=!0,this._updateRequestId=null,this._loadQueue=[],this.currentOverlays=[],this._lastScrollTime=ie.now(),ie.EventSource.call(this),this.addHandler("open-failed",function(Di){var is=ie.getString("Errors.OpenFailed",Di.eventSource,Di.message);wi._showMessage(is)}),ie.ControlDock.call(this,Kr),this.xmlPath&&(this.tileSources=[this.xmlPath]),this.element=this.element||document.getElementById(this.id),this.canvas=ie.makeNeutralElement("div"),this.canvas.className="openseadragon-canvas",function(Di){Di.width="100%",Di.height="100%",Di.overflow="hidden",Di.position="absolute",Di.top="0px",Di.left="0px"}(this.canvas.style),ie.setElementTouchActionNone(this.canvas),Kr.tabIndex!==""&&(this.canvas.tabIndex=Kr.tabIndex===void 0?0:Kr.tabIndex),this.container.className="openseadragon-container",function(Di){Di.width="100%",Di.height="100%",Di.position="relative",Di.overflow="hidden",Di.left="0px",Di.top="0px",Di.textAlign="left"}(this.container.style),this.container.insertBefore(this.canvas,this.container.firstChild),this.element.appendChild(this.container),this.bodyWidth=document.body.style.width,this.bodyHeight=document.body.style.height,this.bodyOverflow=document.body.style.overflow,this.docOverflow=document.documentElement.style.overflow,this.innerTracker=new ie.MouseTracker({element:this.canvas,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,keyDownHandler:ie.delegate(this,lt),keyHandler:ie.delegate(this,ct),clickHandler:ie.delegate(this,ot),dblClickHandler:ie.delegate(this,dt),dragHandler:ie.delegate(this,ft),dragEndHandler:ie.delegate(this,gt),enterHandler:ie.delegate(this,mt),exitHandler:ie.delegate(this,Yr),pressHandler:ie.delegate(this,Qr),releaseHandler:ie.delegate(this,Xr),nonPrimaryPressHandler:ie.delegate(this,Jr),nonPrimaryReleaseHandler:ie.delegate(this,ai),scrollHandler:ie.delegate(this,ni),pinchHandler:ie.delegate(this,oi)}),this.outerTracker=new ie.MouseTracker({element:this.container,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,enterHandler:ie.delegate(this,li),exitHandler:ie.delegate(this,ui)}),this.toolbar&&(this.toolbar=new ie.ControlDock({element:this.toolbar})),this.bindStandardControls(),Z[this.hash].prevContainerSize=ae(this.container),this.world=new ie.World({viewer:this}),this.world.addHandler("add-item",function(Di){wi.source=wi.world.getItemAt(0).source,Z[wi.hash].forceRedraw=!0,wi._updateRequestId||(wi._updateRequestId=Ye(wi,mi))}),this.world.addHandler("remove-item",function(Di){wi.world.getItemCount()?wi.source=wi.world.getItemAt(0).source:wi.source=null,Z[wi.hash].forceRedraw=!0}),this.world.addHandler("metrics-change",function(Di){wi.viewport&&wi.viewport._setContentBounds(wi.world.getHomeBounds(),wi.world.getContentFactor())}),this.world.addHandler("item-index-change",function(Di){wi.source=wi.world.getItemAt(0).source}),this.viewport=new ie.Viewport({containerSize:Z[this.hash].prevContainerSize,springStiffness:this.springStiffness,animationTime:this.animationTime,minZoomImageRatio:this.minZoomImageRatio,maxZoomPixelRatio:this.maxZoomPixelRatio,visibilityRatio:this.visibilityRatio,wrapHorizontal:this.wrapHorizontal,wrapVertical:this.wrapVertical,defaultZoomLevel:this.defaultZoomLevel,minZoomLevel:this.minZoomLevel,maxZoomLevel:this.maxZoomLevel,viewer:this,degrees:this.degrees,flipped:this.flipped,navigatorRotate:this.navigatorRotate,homeFillsViewer:this.homeFillsViewer,margins:this.viewportMargins}),this.viewport._setContentBounds(this.world.getHomeBounds(),this.world.getContentFactor()),this.imageLoader=new ie.ImageLoader({jobLimit:this.imageLoaderLimit,timeout:Kr.timeout}),this.tileCache=new ie.TileCache({maxImageCacheCount:this.maxImageCacheCount}),this.drawer=new ie.Drawer({viewer:this,viewport:this.viewport,element:this.canvas,debugGridColor:this.debugGridColor}),this.overlaysContainer=ie.makeNeutralElement("div"),this.canvas.appendChild(this.overlaysContainer),this.drawer.canRotate()||(this.rotateLeft&&(Ii=this.buttons.buttons.indexOf(this.rotateLeft),this.buttons.buttons.splice(Ii,1),this.buttons.element.removeChild(this.rotateLeft.element)),this.rotateRight&&(Ii=this.buttons.buttons.indexOf(this.rotateRight),this.buttons.buttons.splice(Ii,1),this.buttons.element.removeChild(this.rotateRight.element))),this.showNavigator&&(this.navigator=new ie.Navigator({id:this.navigatorId,position:this.navigatorPosition,sizeRatio:this.navigatorSizeRatio,maintainSizeRatio:this.navigatorMaintainSizeRatio,top:this.navigatorTop,left:this.navigatorLeft,width:this.navigatorWidth,height:this.navigatorHeight,autoResize:this.navigatorAutoResize,autoFade:this.navigatorAutoFade,prefixUrl:this.prefixUrl,viewer:this,navigatorRotate:this.navigatorRotate,background:this.navigatorBackground,opacity:this.navigatorOpacity,borderColor:this.navigatorBorderColor,displayRegionColor:this.navigatorDisplayRegionColor,crossOriginPolicy:this.crossOriginPolicy})),this.sequenceMode&&this.bindSequenceControls(),this.tileSources&&this.open(this.tileSources),Ii=0;Ii-1&&Kr.index=0&&Kr=0)return this;var is=ve(this,Di);return this.currentOverlays.push(is),is.drawHTML(this.overlaysContainer,this.viewport),this.raiseEvent("add-overlay",{element:Kr,location:Di.location,placement:Di.placement}),this},updateOverlay:function(Kr,di,wi){var Ii;return Kr=ie.getElement(Kr),Ii=be(this.currentOverlays,Kr),Ii>=0&&(this.currentOverlays[Ii].update(di,wi),Z[this.hash].forceRedraw=!0,this.raiseEvent("update-overlay",{element:Kr,location:di,placement:wi})),this},removeOverlay:function(Kr){var di;return Kr=ie.getElement(Kr),di=be(this.currentOverlays,Kr),di>=0&&(this.currentOverlays[di].destroy(),this.currentOverlays.splice(di,1),Z[this.hash].forceRedraw=!0,this.raiseEvent("remove-overlay",{element:Kr})),this},clearOverlays:function(){for(;this.currentOverlays.length>0;)this.currentOverlays.pop().destroy();return Z[this.hash].forceRedraw=!0,this.raiseEvent("clear-overlay",{}),this},getOverlayById:function(Kr){var di;return Kr=ie.getElement(Kr),di=be(this.currentOverlays,Kr),di>=0?this.currentOverlays[di]:null},_updateSequenceButtons:function(Kr){this.nextButton&&(!this.tileSources||this.tileSources.length-1===Kr?this.navPrevNextWrap||this.nextButton.disable():this.nextButton.enable()),this.previousButton&&(Kr>0?this.previousButton.enable():this.navPrevNextWrap||this.previousButton.disable())},_showMessage:function(Kr){this._hideMessage();var di=ie.makeNeutralElement("div");di.appendChild(document.createTextNode(Kr)),this.messageDiv=ie.makeCenteredNode(di),ie.addClass(this.messageDiv,"openseadragon-message"),this.container.appendChild(this.messageDiv)},_hideMessage:function(){var Kr=this.messageDiv;Kr&&(Kr.parentNode.removeChild(Kr),delete this.messageDiv)},gestureSettingsByDeviceType:function(Kr){switch(Kr){case"mouse":return this.gestureSettingsMouse;case"touch":return this.gestureSettingsTouch;case"pen":return this.gestureSettingsPen;default:return this.gestureSettingsUnknown}},_drawOverlays:function(){var Kr,di=this.currentOverlays.length;for(Kr=0;Kr1&&(this.referenceStrip=new ie.ReferenceStrip({id:this.referenceStripElement,position:this.referenceStripPosition,sizeRatio:this.referenceStripSizeRatio,scroll:this.referenceStripScroll,height:this.referenceStripHeight,width:this.referenceStripWidth,tileSources:this.tileSources,prefixUrl:this.prefixUrl,useCanvas:this.useCanvas,viewer:this}),this.referenceStrip.setFocus(this._sequenceIndex))}else ie.console.warn('Attempting to display a reference strip while "sequenceMode" is off.')}});function ae(Kr){return Kr=ie.getElement(Kr),new ie.Point(Kr.clientWidth===0?1:Kr.clientWidth,Kr.clientHeight===0?1:Kr.clientHeight)}function ye(Kr,di,wi,Ii,Di){var is=Kr;if(ie.type(di)=="string"){if(di.match(/^\s*<.*>\s*$/))di=ie.parseXml(di);else if(di.match(/^\s*[\{\[].*[\}\]]\s*$/))try{var Gi=ie.parseJSON(di);di=Gi}catch{}}function us(Zi,ns){Zi.ready?Ii(Zi):(Zi.addHandler("ready",function(){Ii(Zi)}),Zi.addHandler("open-failed",function(Ki){Di({message:Ki.message,source:ns})}))}setTimeout(function(){if(ie.type(di)=="string")di=new ie.TileSource({url:di,crossOriginPolicy:wi.crossOriginPolicy!==void 0?wi.crossOriginPolicy:Kr.crossOriginPolicy,ajaxWithCredentials:Kr.ajaxWithCredentials,ajaxHeaders:Kr.ajaxHeaders,useCanvas:Kr.useCanvas,success:function(ds){Ii(ds.tileSource)}}),di.addHandler("open-failed",function(ds){Di(ds)});else if(ie.isPlainObject(di)||di.nodeType)if(di.crossOriginPolicy===void 0&&(wi.crossOriginPolicy!==void 0||Kr.crossOriginPolicy!==void 0)&&(di.crossOriginPolicy=wi.crossOriginPolicy!==void 0?wi.crossOriginPolicy:Kr.crossOriginPolicy),di.ajaxWithCredentials===void 0&&(di.ajaxWithCredentials=Kr.ajaxWithCredentials),di.useCanvas===void 0&&(di.useCanvas=Kr.useCanvas),ie.isFunction(di.getTileUrl)){var Zi=new ie.TileSource(di);Zi.getTileUrl=di.getTileUrl,Ii(Zi)}else{var ns=ie.TileSource.determineType(is,di);if(!ns){Di({message:"Unable to load TileSource",source:di});return}var Ki=ns.prototype.configure.apply(is,[di]);us(new ns(Ki),di)}else us(di,di)})}function ve(Kr,di){if(di instanceof ie.Overlay)return di;var wi=null;if(di.element)wi=ie.getElement(di.element);else{var Ii=di.id?di.id:"openseadragon-overlay-"+Math.floor(Math.random()*1e7);wi=ie.getElement(di.id),wi||(wi=document.createElement("a"),wi.href="#/overlay/"+Ii),wi.id=Ii,ie.addClass(wi,di.className?di.className:"openseadragon-overlay")}var Di=di.location,is=di.width,Gi=di.height;if(!Di){var us=di.x,Zi=di.y;if(di.px!==void 0){var ns=Kr.viewport.imageToViewportRectangle(new ie.Rect(di.px,di.py,is||0,Gi||0));us=ns.x,Zi=ns.y,is=is!==void 0?ns.width:void 0,Gi=Gi!==void 0?ns.height:void 0}Di=new ie.Point(us,Zi)}var Ki=di.placement;return Ki&&ie.type(Ki)==="string"&&(Ki=ie.Placement[di.placement.toUpperCase()]),new ie.Overlay({element:wi,location:Di,placement:Ki,onDraw:di.onDraw,checkResize:di.checkResize,width:is,height:Gi,rotationMode:di.rotationMode})}function be(Kr,di){var wi;for(wi=Kr.length-1;wi>=0;wi--)if(Kr[wi].element===di)return wi;return-1}function Ye(Kr,di){return ie.requestAnimationFrame(function(){di(Kr)})}function Ke(Kr){ie.requestAnimationFrame(function(){Je(Kr)})}function Xe(Kr){Kr.autoHideControls&&(Kr.controlsShouldFade=!0,Kr.controlsFadeBeginTime=ie.now()+Kr.controlsFadeDelay,window.setTimeout(function(){Ke(Kr)},Kr.controlsFadeDelay))}function Je(Kr){var di,wi,Ii,Di;if(Kr.controlsShouldFade){for(di=ie.now(),wi=di-Kr.controlsFadeBeginTime,Ii=1-wi/Kr.controlsFadeLength,Ii=Math.min(1,Ii),Ii=Math.max(0,Ii),Di=Kr.controls.length-1;Di>=0;Di--)Kr.controls[Di].autoFade&&Kr.controls[Di].setOpacity(Ii);Ii>0&&Ke(Kr)}}function rt(Kr){var di;for(Kr.controlsShouldFade=!1,di=Kr.controls.length-1;di>=0;di--)Kr.controls[di].setOpacity(1)}function nt(){rt(this)}function it(){Xe(this)}function lt(Kr){var di={originalEvent:Kr.originalEvent,preventDefaultAction:Kr.preventDefaultAction,preventVerticalPan:Kr.preventVerticalPan,preventHorizontalPan:Kr.preventHorizontalPan};if(this.raiseEvent("canvas-key",di),!di.preventDefaultAction&&!Kr.ctrl&&!Kr.alt&&!Kr.meta)switch(Kr.keyCode){case 38:return di.preventVerticalPan||(Kr.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new ie.Point(0,-this.pixelsPerArrowPress))),this.viewport.applyConstraints()),!1;case 40:return di.preventVerticalPan||(Kr.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new ie.Point(0,this.pixelsPerArrowPress))),this.viewport.applyConstraints()),!1;case 37:return di.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new ie.Point(-this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),!1;case 39:return di.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new ie.Point(this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),!1;default:return!0}else return!0}function ct(Kr){var di={originalEvent:Kr.originalEvent,preventDefaultAction:Kr.preventDefaultAction,preventVerticalPan:Kr.preventVerticalPan,preventHorizontalPan:Kr.preventHorizontalPan};if(this.raiseEvent("canvas-key",di),!di.preventDefaultAction&&!Kr.ctrl&&!Kr.alt&&!Kr.meta)switch(Kr.keyCode){case 43:case 61:return this.viewport.zoomBy(1.1),this.viewport.applyConstraints(),!1;case 45:return this.viewport.zoomBy(.9),this.viewport.applyConstraints(),!1;case 48:return this.viewport.goHome(),this.viewport.applyConstraints(),!1;case 119:case 87:return di.preventVerticalPan||(Kr.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new ie.Point(0,-40))),this.viewport.applyConstraints()),!1;case 115:case 83:return di.preventVerticalPan||(Kr.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new ie.Point(0,40))),this.viewport.applyConstraints()),!1;case 97:return di.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new ie.Point(-40,0))),this.viewport.applyConstraints()),!1;case 100:return di.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new ie.Point(40,0))),this.viewport.applyConstraints()),!1;case 114:return this.viewport.flipped?this.viewport.setRotation(ie.positiveModulo(this.viewport.degrees-this.rotationIncrement,360)):this.viewport.setRotation(ie.positiveModulo(this.viewport.degrees+this.rotationIncrement,360)),this.viewport.applyConstraints(),!1;case 82:return this.viewport.flipped?this.viewport.setRotation(ie.positiveModulo(this.viewport.degrees+this.rotationIncrement,360)):this.viewport.setRotation(ie.positiveModulo(this.viewport.degrees-this.rotationIncrement,360)),this.viewport.applyConstraints(),!1;case 102:return this.viewport.toggleFlip(),!1;default:return!0}else return!0}function ot(Kr){var di,wi=document.activeElement==this.canvas;wi||this.canvas.focus(),this.viewport.flipped&&(Kr.position.x=this.viewport.getContainerSize().x-Kr.position.x);var Ii={tracker:Kr.eventSource,position:Kr.position,quick:Kr.quick,shift:Kr.shift,originalEvent:Kr.originalEvent,preventDefaultAction:Kr.preventDefaultAction};this.raiseEvent("canvas-click",Ii),!Ii.preventDefaultAction&&this.viewport&&Kr.quick&&(di=this.gestureSettingsByDeviceType(Kr.pointerType),di.clickToZoom&&(this.viewport.zoomBy(Kr.shift?1/this.zoomPerClick:this.zoomPerClick,di.zoomToRefPoint?this.viewport.pointFromPixel(Kr.position,!0):null),this.viewport.applyConstraints()))}function dt(Kr){var di,wi={tracker:Kr.eventSource,position:Kr.position,shift:Kr.shift,originalEvent:Kr.originalEvent,preventDefaultAction:Kr.preventDefaultAction};this.raiseEvent("canvas-double-click",wi),!wi.preventDefaultAction&&this.viewport&&(di=this.gestureSettingsByDeviceType(Kr.pointerType),di.dblClickToZoom&&(this.viewport.zoomBy(Kr.shift?1/this.zoomPerClick:this.zoomPerClick,di.zoomToRefPoint?this.viewport.pointFromPixel(Kr.position,!0):null),this.viewport.applyConstraints()))}function ft(Kr){var di,wi={tracker:Kr.eventSource,position:Kr.position,delta:Kr.delta,speed:Kr.speed,direction:Kr.direction,shift:Kr.shift,originalEvent:Kr.originalEvent,preventDefaultAction:Kr.preventDefaultAction};if(this.raiseEvent("canvas-drag",wi),!wi.preventDefaultAction&&this.viewport){if(di=this.gestureSettingsByDeviceType(Kr.pointerType),this.panHorizontal||(Kr.delta.x=0),this.panVertical||(Kr.delta.y=0),this.viewport.flipped&&(Kr.delta.x=-Kr.delta.x),this.constrainDuringPan){var Ii=this.viewport.deltaPointsFromPixels(Kr.delta.negate());this.viewport.centerSpringX.target.value+=Ii.x,this.viewport.centerSpringY.target.value+=Ii.y;var Di=this.viewport.getBounds(),is=this.viewport.getConstrainedBounds();this.viewport.centerSpringX.target.value-=Ii.x,this.viewport.centerSpringY.target.value-=Ii.y,Di.x!=is.x&&(Kr.delta.x=0),Di.y!=is.y&&(Kr.delta.y=0)}this.viewport.panBy(this.viewport.deltaPointsFromPixels(Kr.delta.negate()),di.flickEnabled&&!this.constrainDuringPan)}}function gt(Kr){if(!Kr.preventDefaultAction&&this.viewport){var di=this.gestureSettingsByDeviceType(Kr.pointerType);if(di.flickEnabled&&Kr.speed>=di.flickMinSpeed){var wi=0;this.panHorizontal&&(wi=di.flickMomentum*Kr.speed*Math.cos(Kr.direction));var Ii=0;this.panVertical&&(Ii=di.flickMomentum*Kr.speed*Math.sin(Kr.direction));var Di=this.viewport.pixelFromPoint(this.viewport.getCenter(!0)),is=this.viewport.pointFromPixel(new ie.Point(Di.x-wi,Di.y-Ii));this.viewport.panTo(is,!1)}this.viewport.applyConstraints()}this.raiseEvent("canvas-drag-end",{tracker:Kr.eventSource,position:Kr.position,speed:Kr.speed,direction:Kr.direction,shift:Kr.shift,originalEvent:Kr.originalEvent})}function mt(Kr){this.raiseEvent("canvas-enter",{tracker:Kr.eventSource,pointerType:Kr.pointerType,position:Kr.position,buttons:Kr.buttons,pointers:Kr.pointers,insideElementPressed:Kr.insideElementPressed,buttonDownAny:Kr.buttonDownAny,originalEvent:Kr.originalEvent})}function Yr(Kr){window.location!=window.parent.location&&ie.MouseTracker.resetAllMouseTrackers(),this.raiseEvent("canvas-exit",{tracker:Kr.eventSource,pointerType:Kr.pointerType,position:Kr.position,buttons:Kr.buttons,pointers:Kr.pointers,insideElementPressed:Kr.insideElementPressed,buttonDownAny:Kr.buttonDownAny,originalEvent:Kr.originalEvent})}function Qr(Kr){this.raiseEvent("canvas-press",{tracker:Kr.eventSource,pointerType:Kr.pointerType,position:Kr.position,insideElementPressed:Kr.insideElementPressed,insideElementReleased:Kr.insideElementReleased,originalEvent:Kr.originalEvent})}function Xr(Kr){this.raiseEvent("canvas-release",{tracker:Kr.eventSource,pointerType:Kr.pointerType,position:Kr.position,insideElementPressed:Kr.insideElementPressed,insideElementReleased:Kr.insideElementReleased,originalEvent:Kr.originalEvent})}function Jr(Kr){this.raiseEvent("canvas-nonprimary-press",{tracker:Kr.eventSource,position:Kr.position,pointerType:Kr.pointerType,button:Kr.button,buttons:Kr.buttons,originalEvent:Kr.originalEvent})}function ai(Kr){this.raiseEvent("canvas-nonprimary-release",{tracker:Kr.eventSource,position:Kr.position,pointerType:Kr.pointerType,button:Kr.button,buttons:Kr.buttons,originalEvent:Kr.originalEvent})}function oi(Kr){var di,wi,Ii,Di;if(!Kr.preventDefaultAction&&this.viewport&&(di=this.gestureSettingsByDeviceType(Kr.pointerType),di.pinchToZoom&&(wi=this.viewport.pointFromPixel(Kr.center,!0),Ii=this.viewport.pointFromPixel(Kr.lastCenter,!0),Di=Ii.minus(wi),this.panHorizontal||(Di.x=0),this.panVertical||(Di.y=0),this.viewport.zoomBy(Kr.distance/Kr.lastDistance,wi,!0),di.zoomToRefPoint&&this.viewport.panBy(Di,!0),this.viewport.applyConstraints()),di.pinchRotate)){var is=Math.atan2(Kr.gesturePoints[0].currentPos.y-Kr.gesturePoints[1].currentPos.y,Kr.gesturePoints[0].currentPos.x-Kr.gesturePoints[1].currentPos.x),Gi=Math.atan2(Kr.gesturePoints[0].lastPos.y-Kr.gesturePoints[1].lastPos.y,Kr.gesturePoints[0].lastPos.x-Kr.gesturePoints[1].lastPos.x);this.viewport.setRotation(this.viewport.getRotation()+(is-Gi)*(180/Math.PI))}return this.raiseEvent("canvas-pinch",{tracker:Kr.eventSource,gesturePoints:Kr.gesturePoints,lastCenter:Kr.lastCenter,center:Kr.center,lastDistance:Kr.lastDistance,distance:Kr.distance,shift:Kr.shift,originalEvent:Kr.originalEvent}),!1}function ni(Kr){var di,wi,Ii,Di;if(Ii=ie.now(),Di=Ii-this._lastScrollTime,Di>this.minScrollDeltaTime){if(this._lastScrollTime=Ii,this.viewport.flipped&&(Kr.position.x=this.viewport.getContainerSize().x-Kr.position.x),!Kr.preventDefaultAction&&this.viewport&&(di=this.gestureSettingsByDeviceType(Kr.pointerType),di.scrollToZoom&&(wi=Math.pow(this.zoomPerScroll,Kr.scroll),this.viewport.zoomBy(wi,di.zoomToRefPoint?this.viewport.pointFromPixel(Kr.position,!0):null),this.viewport.applyConstraints())),this.raiseEvent("canvas-scroll",{tracker:Kr.eventSource,position:Kr.position,scroll:Kr.scroll,shift:Kr.shift,originalEvent:Kr.originalEvent}),di&&di.scrollToZoom)return!1}else if(di=this.gestureSettingsByDeviceType(Kr.pointerType),di&&di.scrollToZoom)return!1}function li(Kr){Z[this.hash].mouseInside=!0,rt(this),this.raiseEvent("container-enter",{tracker:Kr.eventSource,position:Kr.position,buttons:Kr.buttons,pointers:Kr.pointers,insideElementPressed:Kr.insideElementPressed,buttonDownAny:Kr.buttonDownAny,originalEvent:Kr.originalEvent})}function ui(Kr){Kr.pointers<1&&(Z[this.hash].mouseInside=!1,Z[this.hash].animating||Xe(this)),this.raiseEvent("container-exit",{tracker:Kr.eventSource,position:Kr.position,buttons:Kr.buttons,pointers:Kr.pointers,insideElementPressed:Kr.insideElementPressed,buttonDownAny:Kr.buttonDownAny,originalEvent:Kr.originalEvent})}function mi(Kr){ii(Kr),Kr.isOpen()?Kr._updateRequestId=Ye(Kr,mi):Kr._updateRequestId=!1}function ii(Kr){if(!Kr._opening){if(Kr.autoResize){var di=ae(Kr.container),wi=Z[Kr.hash].prevContainerSize;if(!di.equals(wi)){var Ii=Kr.viewport;if(Kr.preserveImageSizeOnResize){var Di=wi.x/di.x,is=Ii.getZoom()*Di,Gi=Ii.getCenter();Ii.resize(di,!1),Ii.zoomTo(is,null,!0),Ii.panTo(Gi,!0)}else{var us=Ii.getBounds();Ii.resize(di,!0),Ii.fitBoundsWithConstraints(us,!0)}Z[Kr.hash].prevContainerSize=di,Z[Kr.hash].forceRedraw=!0}}var Zi=Kr.viewport.update(),ns=Kr.world.update()||Zi;Zi&&Kr.raiseEvent("viewport-change"),Kr.referenceStrip&&(ns=Kr.referenceStrip.update(Kr.viewport)||ns),!Z[Kr.hash].animating&&ns&&(Kr.raiseEvent("animation-start"),rt(Kr)),(ns||Z[Kr.hash].forceRedraw||Kr.world.needsDraw())&&(hi(Kr),Kr._drawOverlays(),Kr.navigator&&Kr.navigator.update(Kr.viewport),Z[Kr.hash].forceRedraw=!1,ns&&Kr.raiseEvent("animation")),Z[Kr.hash].animating&&!ns&&(Kr.raiseEvent("animation-finish"),Z[Kr.hash].mouseInside||Xe(Kr)),Z[Kr.hash].animating=ns}}function hi(Kr){Kr.imageLoader.clear(),Kr.drawer.clear(),Kr.world.draw(),Kr.raiseEvent("update-viewport",{})}function ri(Kr,di){return Kr?Kr+di:di}function ci(){Z[this.hash].lastZoomTime=ie.now(),Z[this.hash].zoomFactor=this.zoomPerSecond,Z[this.hash].zooming=!0,Ei(this)}function Si(){Z[this.hash].lastZoomTime=ie.now(),Z[this.hash].zoomFactor=1/this.zoomPerSecond,Z[this.hash].zooming=!0,Ei(this)}function si(){Z[this.hash].zooming=!1}function Ei(Kr){ie.requestAnimationFrame(ie.delegate(Kr,yi))}function yi(){var Kr,di,wi;Z[this.hash].zooming&&this.viewport&&(Kr=ie.now(),di=Kr-Z[this.hash].lastZoomTime,wi=Math.pow(Z[this.hash].zoomFactor,di/1e3),this.viewport.zoomBy(wi),this.viewport.applyConstraints(),Z[this.hash].lastZoomTime=Kr,Ei(this))}function Mi(){this.viewport&&(Z[this.hash].zooming=!1,this.viewport.zoomBy(this.zoomPerClick/1),this.viewport.applyConstraints())}function Ci(){this.viewport&&(Z[this.hash].zooming=!1,this.viewport.zoomBy(1/this.zoomPerClick),this.viewport.applyConstraints())}function Ri(){this.buttons.emulateEnter(),this.buttons.emulateExit()}function Ni(){this.viewport&&this.viewport.goHome()}function Ai(){this.isFullPage()&&!ie.isFullScreen()?this.setFullPage(!1):this.setFullScreen(!this.isFullPage()),this.buttons&&this.buttons.emulateExit(),this.fullPageButton.element.focus(),this.viewport&&this.viewport.applyConstraints()}function ki(){if(this.viewport){var Kr=this.viewport.getRotation();this.viewport.flipped?Kr=ie.positiveModulo(Kr+this.rotationIncrement,360):Kr=ie.positiveModulo(Kr-this.rotationIncrement,360),this.viewport.setRotation(Kr)}}function Yi(){if(this.viewport){var Kr=this.viewport.getRotation();this.viewport.flipped?Kr=ie.positiveModulo(Kr-this.rotationIncrement,360):Kr=ie.positiveModulo(Kr+this.rotationIncrement,360),this.viewport.setRotation(Kr)}}function Ji(){this.viewport.toggleFlip()}function ls(){var Kr=this._sequenceIndex-1;this.navPrevNextWrap&&Kr<0&&(Kr+=this.tileSources.length),this.goToPage(Kr)}function hs(){var Kr=this._sequenceIndex+1;this.navPrevNextWrap&&Kr>=this.tileSources.length&&(Kr=0),this.goToPage(Kr)}}(OpenSeadragon),function(ie){ie.Navigator=function(Ye){var Ke=Ye.viewer,Xe=this,Je,rt;Ye.id?(this.element=document.getElementById(Ye.id),Ye.controlOptions={anchor:ie.ControlAnchor.NONE,attachToViewer:!1,autoFade:!1}):(Ye.id="navigator-"+ie.now(),this.element=ie.makeNeutralElement("div"),Ye.controlOptions={anchor:ie.ControlAnchor.TOP_RIGHT,attachToViewer:!0,autoFade:Ye.autoFade},Ye.position&&(Ye.position=="BOTTOM_RIGHT"?Ye.controlOptions.anchor=ie.ControlAnchor.BOTTOM_RIGHT:Ye.position=="BOTTOM_LEFT"?Ye.controlOptions.anchor=ie.ControlAnchor.BOTTOM_LEFT:Ye.position=="TOP_RIGHT"?Ye.controlOptions.anchor=ie.ControlAnchor.TOP_RIGHT:Ye.position=="TOP_LEFT"?Ye.controlOptions.anchor=ie.ControlAnchor.TOP_LEFT:Ye.position=="ABSOLUTE"&&(Ye.controlOptions.anchor=ie.ControlAnchor.ABSOLUTE,Ye.controlOptions.top=Ye.top,Ye.controlOptions.left=Ye.left,Ye.controlOptions.height=Ye.height,Ye.controlOptions.width=Ye.width))),this.element.id=Ye.id,this.element.className+=" navigator",Ye=ie.extend(!0,{sizeRatio:ie.DEFAULT_SETTINGS.navigatorSizeRatio},Ye,{element:this.element,tabIndex:-1,showNavigator:!1,mouseNavEnabled:!1,showNavigationControl:!1,showSequenceControl:!1,immediateRender:!0,blendTime:0,animationTime:0,autoResize:Ye.autoResize,minZoomImageRatio:1,background:Ye.background,opacity:Ye.opacity,borderColor:Ye.borderColor,displayRegionColor:Ye.displayRegionColor}),Ye.minPixelRatio=this.minPixelRatio=Ke.minPixelRatio,ie.setElementTouchActionNone(this.element),this.borderWidth=2,this.fudge=new ie.Point(1,1),this.totalBorderWidths=new ie.Point(this.borderWidth*2,this.borderWidth*2).minus(this.fudge),Ye.controlOptions.anchor!=ie.ControlAnchor.NONE&&function(lt,ct){lt.margin="0px",lt.border=ct+"px solid "+Ye.borderColor,lt.padding="0px",lt.background=Ye.background,lt.opacity=Ye.opacity,lt.overflow="hidden"}(this.element.style,this.borderWidth),this.displayRegion=ie.makeNeutralElement("div"),this.displayRegion.id=this.element.id+"-displayregion",this.displayRegion.className="displayregion",function(lt,ct){lt.position="relative",lt.top="0px",lt.left="0px",lt.fontSize="0px",lt.overflow="hidden",lt.border=ct+"px solid "+Ye.displayRegionColor,lt.margin="0px",lt.padding="0px",lt.background="transparent",lt.float="left",lt.cssFloat="left",lt.styleFloat="left",lt.zIndex=999999999,lt.cursor="default"}(this.displayRegion.style,this.borderWidth),this.displayRegionContainer=ie.makeNeutralElement("div"),this.displayRegionContainer.id=this.element.id+"-displayregioncontainer",this.displayRegionContainer.className="displayregioncontainer",this.displayRegionContainer.style.width="100%",this.displayRegionContainer.style.height="100%",Ke.addControl(this.element,Ye.controlOptions),this._resizeWithViewer=Ye.controlOptions.anchor!=ie.ControlAnchor.ABSOLUTE&&Ye.controlOptions.anchor!=ie.ControlAnchor.NONE,Ye.width&&Ye.height?(this.setWidth(Ye.width),this.setHeight(Ye.height)):this._resizeWithViewer&&(Je=ie.getElementSize(Ke.element),this.element.style.height=Math.round(Je.y*Ye.sizeRatio)+"px",this.element.style.width=Math.round(Je.x*Ye.sizeRatio)+"px",this.oldViewerSize=Je,rt=ie.getElementSize(this.element),this.elementArea=rt.x*rt.y),this.oldContainerSize=new ie.Point(0,0),ie.Viewer.apply(this,[Ye]),this.displayRegionContainer.appendChild(this.displayRegion),this.element.getElementsByTagName("div")[0].appendChild(this.displayRegionContainer);function nt(lt){ve(Xe.displayRegionContainer,lt),ve(Xe.displayRegion,-lt),Xe.viewport.setRotation(lt)}if(Ye.navigatorRotate){var it=Ye.viewer.viewport?Ye.viewer.viewport.getRotation():Ye.viewer.degrees||0;nt(it),Ye.viewer.addHandler("rotate",function(lt){nt(lt.degrees)})}this.innerTracker.destroy(),this.innerTracker=new ie.MouseTracker({element:this.element,dragHandler:ie.delegate(this,ee),clickHandler:ie.delegate(this,Z),releaseHandler:ie.delegate(this,ae),scrollHandler:ie.delegate(this,ye)}),this.addHandler("reset-size",function(){Xe.viewport&&Xe.viewport.goHome(!0)}),Ke.world.addHandler("item-index-change",function(lt){window.setTimeout(function(){var ct=Xe.world.getItemAt(lt.previousIndex);Xe.world.setItemIndex(ct,lt.newIndex)},1)}),Ke.world.addHandler("remove-item",function(lt){var ct=lt.item,ot=Xe._getMatchingItem(ct);ot&&Xe.world.removeItem(ot)}),this.update(Ke.viewport)},ie.extend(ie.Navigator.prototype,ie.EventSource.prototype,ie.Viewer.prototype,{updateSize:function(){if(this.viewport){var Ye=new ie.Point(this.container.clientWidth===0?1:this.container.clientWidth,this.container.clientHeight===0?1:this.container.clientHeight);Ye.equals(this.oldContainerSize)||(this.viewport.resize(Ye,!0),this.viewport.goHome(!0),this.oldContainerSize=Ye,this.drawer.clear(),this.world.draw())}},setWidth:function(Ye){this.width=Ye,this.element.style.width=typeof Ye=="number"?Ye+"px":Ye,this._resizeWithViewer=!1},setHeight:function(Ye){this.height=Ye,this.element.style.height=typeof Ye=="number"?Ye+"px":Ye,this._resizeWithViewer=!1},setFlip:function(Ye){return this.viewport.setFlip(Ye),this.setDisplayTransform(this.viewer.viewport.getFlip()?"scale(-1,1)":"scale(1,1)"),this},setDisplayTransform:function(Ye){be(this.displayRegion,Ye),be(this.canvas,Ye),be(this.element,Ye)},update:function(Ye){var Ke,Xe,Je,rt,nt,it;if(Ke=ie.getElementSize(this.viewer.element),this._resizeWithViewer&&Ke.x&&Ke.y&&!Ke.equals(this.oldViewerSize)&&(this.oldViewerSize=Ke,this.maintainSizeRatio||!this.elementArea?(Xe=Ke.x*this.sizeRatio,Je=Ke.y*this.sizeRatio):(Xe=Math.sqrt(this.elementArea*(Ke.x/Ke.y)),Je=this.elementArea/Xe),this.element.style.width=Math.round(Xe)+"px",this.element.style.height=Math.round(Je)+"px",this.elementArea||(this.elementArea=Xe*Je),this.updateSize()),Ye&&this.viewport){rt=Ye.getBoundsNoRotate(!0),nt=this.viewport.pixelFromPointNoRotate(rt.getTopLeft(),!1),it=this.viewport.pixelFromPointNoRotate(rt.getBottomRight(),!1).minus(this.totalBorderWidths);var lt=this.displayRegion.style;lt.display=this.world.getItemCount()?"block":"none",lt.top=Math.round(nt.y)+"px",lt.left=Math.round(nt.x)+"px";var ct=Math.abs(nt.x-it.x),ot=Math.abs(nt.y-it.y);lt.width=Math.round(Math.max(ct,0))+"px",lt.height=Math.round(Math.max(ot,0))+"px"}},addTiledImage:function(Ye){var Ke=this,Xe=Ye.originalTiledImage;delete Ye.original;var Je=ie.extend({},Ye,{success:function(rt){var nt=rt.item;nt._originalForNavigator=Xe,Ke._matchBounds(nt,Xe,!0);function it(){Ke._matchBounds(nt,Xe)}function lt(){Ke._matchOpacity(nt,Xe)}function ct(){Ke._matchCompositeOperation(nt,Xe)}Xe.addHandler("bounds-change",it),Xe.addHandler("clip-change",it),Xe.addHandler("opacity-change",lt),Xe.addHandler("composite-operation-change",ct)}});return ie.Viewer.prototype.addTiledImage.apply(this,[Je])},_getMatchingItem:function(Ye){for(var Ke=this.world.getItemCount(),Xe,Je=0;Je1||ae.y>1));ee++);return ee-1},getTileAtPoint:function(ee,ae){var ye=ae.x>=0&&ae.x<=1&&ae.y>=0&&ae.y<=1/this.aspectRatio;ie.console.assert(ye,"[TileSource.getTileAtPoint] must be called with a valid point.");var ve=this.dimensions.x*this.getLevelScale(ee),be=ae.x*ve,Ye=ae.y*ve,Ke=Math.floor(be/this.getTileWidth(ee)),Xe=Math.floor(Ye/this.getTileHeight(ee));ae.x>=1&&(Ke=this.getNumTiles(ee).x-1);var Je=1e-15;return ae.y>=1/this.aspectRatio-Je&&(Xe=this.getNumTiles(ee).y-1),new ie.Point(Ke,Xe)},getTileBounds:function(ee,ae,ye,ve){var be=this.dimensions.times(this.getLevelScale(ee)),Ye=this.getTileWidth(ee),Ke=this.getTileHeight(ee),Xe=ae===0?0:Ye*ae-this.tileOverlap,Je=ye===0?0:Ke*ye-this.tileOverlap,rt=Ye+(ae===0?1:2)*this.tileOverlap,nt=Ke+(ye===0?1:2)*this.tileOverlap,it=1/be.x;return rt=Math.min(rt,be.x-Xe),nt=Math.min(nt,be.y-Je),ve?new ie.Rect(0,0,rt,nt):new ie.Rect(Xe*it,Je*it,rt*it,nt*it)},getImageInfo:function(ee){var ae=this,ye,ve,be,Ye,Ke,Xe,Je;ee&&(Ke=ee.split("/"),Xe=Ke[Ke.length-1],Je=Xe.lastIndexOf("."),Je>-1&&(Ke[Ke.length-1]=Xe.slice(0,Je))),ve=function(rt){typeof rt=="string"&&(rt=ie.parseXml(rt));var nt=ie.TileSource.determineType(ae,rt,ee);if(!nt){ae.raiseEvent("open-failed",{message:"Unable to load TileSource",source:ee});return}Ye=nt.prototype.configure.apply(ae,[rt,ee]),Ye.ajaxWithCredentials===void 0&&(Ye.ajaxWithCredentials=ae.ajaxWithCredentials),be=new nt(Ye),ae.ready=!0,ae.raiseEvent("ready",{tileSource:be})},ee.match(/\.js$/)?(ye=ee.split("/").pop().replace(".js",""),ie.jsonp({url:ee,async:!1,callbackName:ye,callback:ve})):ie.makeAjaxRequest({url:ee,withCredentials:this.ajaxWithCredentials,headers:this.ajaxHeaders,success:function(rt){var nt=Z(rt);ve(nt)},error:function(rt,nt){var it;try{it="HTTP "+rt.status+" attempting to load TileSource"}catch{var lt;typeof nt>"u"||!nt.toString?lt="Unknown error":lt=nt.toString(),it=lt+" attempting to load TileSource"}ae.raiseEvent("open-failed",{message:it,source:ee})}})},supports:function(ee,ae){return!1},configure:function(ee,ae){throw new Error("Method not implemented.")},getTileUrl:function(ee,ae,ye){throw new Error("Method not implemented.")},getTileAjaxHeaders:function(ee,ae,ye){return{}},tileExists:function(ee,ae,ye){var ve=this.getNumTiles(ee);return ee>=this.minLevel&&ee<=this.maxLevel&&ae>=0&&ye>=0&&ae=0;nt--)for(it=this.displayRects[nt],lt=it.minLevel;lt<=it.maxLevel;lt++)this._levelRects[lt]||(this._levelRects[lt]=[]),this._levelRects[lt].push(it);ie.TileSource.apply(this,[ct])},ie.extend(ie.DziTileSource.prototype,ie.TileSource.prototype,{supports:function(ae,ye){var ve;return ae.Image?ve=ae.Image.xmlns:ae.documentElement&&(ae.documentElement.localName=="Image"||ae.documentElement.tagName=="Image")&&(ve=ae.documentElement.namespaceURI),ve=(ve||"").toLowerCase(),ve.indexOf("schemas.microsoft.com/deepzoom/2008")!==-1||ve.indexOf("schemas.microsoft.com/deepzoom/2009")!==-1},configure:function(ae,ye){var ve;return ie.isPlainObject(ae)?ve=ee(this,ae):ve=Z(this,ae),ye&&!ve.tilesUrl&&(ve.tilesUrl=ye.replace(/([^\/]+?)(\.(dzi|xml|js)?(\?[^\/]*)?)?\/?$/,"$1_files/"),ye.search(/\.(dzi|xml|js)\?/)!=-1?ve.queryParams=ye.match(/\?.*/):ve.queryParams=""),ve},getTileUrl:function(ae,ye,ve){return[this.tilesUrl,ae,"/",ye,"_",ve,".",this.fileFormat,this.queryParams].join("")},tileExists:function(ae,ye,ve){var be=this._levelRects[ae],Ye,Ke,Xe,Je,rt,nt,it;if(this.minLevel&&aethis.maxLevel)return!1;if(!be||!be.length)return!0;for(it=be.length-1;it>=0;it--)if(Ye=be[it],!(aeYe.maxLevel)&&(Ke=this.getLevelScale(ae),Xe=Ye.x*Ke,Je=Ye.y*Ke,rt=Xe+Ye.width*Ke,nt=Je+Ye.height*Ke,Xe=Math.floor(Xe/this._tileWidth),Je=Math.floor(Je/this._tileWidth),rt=Math.ceil(rt/this._tileWidth),nt=Math.ceil(nt/this._tileWidth),Xe<=ye&&ye0?ve.tileSize=Math.max.apply(null,rt):ve.tileSize=Xe}else this.sizes&&this.sizes.length>0?(this.emulateLegacyImagePyramid=!0,ve.levels=ee(this),ie.extend(!0,ve,{width:ve.levels[ve.levels.length-1].width,height:ve.levels[ve.levels.length-1].height,tileSize:Math.max(ve.height,ve.width),tileOverlap:0,minLevel:0,maxLevel:ve.levels.length-1}),this.levels=ve.levels):ie.console.error("Nothing in the info.json to construct image pyramids from");if(!ve.maxLevel&&!this.emulateLegacyImagePyramid)if(!this.scale_factors)ve.maxLevel=Number(Math.ceil(Math.log(Math.max(this.width,this.height),2)));else{var it=Math.max.apply(null,this.scale_factors);ve.maxLevel=Math.round(Math.log(it)*Math.LOG2E)}ie.TileSource.apply(this,[ve])},ie.extend(ie.IIIFTileSource.prototype,ie.TileSource.prototype,{supports:function(ve,be){return ve.protocol&&ve.protocol=="http://iiif.io/api/image"||ve["@context"]&&(ve["@context"]=="http://library.stanford.edu/iiif/image-api/1.1/context.json"||ve["@context"]=="http://iiif.io/api/image/1/context.json")||ve.profile&&ve.profile.indexOf("http://library.stanford.edu/iiif/image-api/compliance.html")===0||ve.identifier&&ve.width&&ve.height?!0:!!(ve.documentElement&&ve.documentElement.tagName=="info"&&ve.documentElement.namespaceURI=="http://library.stanford.edu/iiif/image-api/ns/")},configure:function(ve,be){if(ie.isPlainObject(ve)){if(!ve["@context"])ve["@context"]="http://iiif.io/api/image/1.0/context.json",ve["@id"]=be.replace("/info.json",""),ve.version=1;else{var Ye=ve["@context"];if(Array.isArray(Ye)){for(var Ke=0;Ke0&&ve>=this.minLevel&&ve<=this.maxLevel&&(be=this.levels[ve].width/this.levels[this.maxLevel].width),be}return ie.TileSource.prototype.getLevelScale.call(this,ve)},getNumTiles:function(ve){if(this.emulateLegacyImagePyramid){var be=this.getLevelScale(ve);return be?new ie.Point(1,1):new ie.Point(0,0)}return ie.TileSource.prototype.getNumTiles.call(this,ve)},getTileAtPoint:function(ve,be){return this.emulateLegacyImagePyramid?new ie.Point(0,0):ie.TileSource.prototype.getTileAtPoint.call(this,ve,be)},getTileUrl:function(ve,be,Ye){if(this.emulateLegacyImagePyramid){var Ke=null;return this.levels.length>0&&ve>=this.minLevel&&ve<=this.maxLevel&&(Ke=this.levels[ve].url),Ke}var Xe="0",Je=Math.pow(.5,this.maxLevel-ve),rt=Math.ceil(this.width*Je),nt=Math.ceil(this.height*Je),it,lt,ct,ot,dt,ft,gt,mt,Yr,Qr,Xr,Jr,ai,oi;return it=this.getTileWidth(ve),lt=this.getTileHeight(ve),ct=Math.ceil(it/Je),ot=Math.ceil(lt/Je),this.version===1?ai="native."+this.tileFormat:ai="default."+this.tileFormat,rt1&&ve.profile[1].supports&&(Xe=ve.profile[1].supports.indexOf("sizeByW")!==-1),ve.version===3&&ve.extraFeatures&&(Xe=ve.extraFeatures.indexOf("sizeByWh")!==-1),!Ke||Xe}function ee(ve){for(var be=[],Ye=0;YeKe?Xe=Ye/256:Xe=Ke/256,be.maxLevel=Math.ceil(Math.log(Xe)/Math.log(2))-1,be.tileSize=256,be.width=Ye,be.height=Ke,ie.TileSource.apply(this,[be])},ie.extend(ie.TmsTileSource.prototype,ie.TileSource.prototype,{supports:function(Z,ee){return Z.type&&Z.type=="tiledmapservice"},configure:function(Z,ee){return Z},getTileUrl:function(Z,ee,ae){var ye=this.getNumTiles(Z).y-1;return this.tilesUrl+Z+"/"+ee+"/"+(ye-ae)+".png"}})}(OpenSeadragon),function(ie){ie.ZoomifyTileSource=function(Z){Z.tileSize=256;var ee={x:Z.width,y:Z.height};for(Z.imageSizes=[{x:Z.width,y:Z.height}],Z.gridSize=[this._getGridSize(Z.width,Z.height,Z.tileSize)];parseInt(ee.x,10)>Z.tileSize||parseInt(ee.y,10)>Z.tileSize;)ee.x=Math.floor(ee.x/2),ee.y=Math.floor(ee.y/2),Z.imageSizes.push({x:ee.x,y:ee.y}),Z.gridSize.push(this._getGridSize(ee.x,ee.y,Z.tileSize));Z.imageSizes.reverse(),Z.gridSize.reverse(),Z.minLevel=0,Z.maxLevel=Z.gridSize.length-1,OpenSeadragon.TileSource.apply(this,[Z])},ie.extend(ie.ZoomifyTileSource.prototype,ie.TileSource.prototype,{_getGridSize:function(Z,ee,ae){return{x:Math.ceil(Z/ae),y:Math.ceil(ee/ae)}},_calculateAbsoluteTileNumber:function(Z,ee,ae){for(var ye=0,ve={},be=0;be0?(be=ve.levels[ve.levels.length-1].width,Ye=ve.levels[ve.levels.length-1].height):(be=0,Ye=0,ie.console.error("No supported image formats found")),ie.extend(!0,ve,{width:be,height:Ye,tileSize:Math.max(Ye,be),tileOverlap:0,minLevel:0,maxLevel:ve.levels.length>0?ve.levels.length-1:0}),ie.TileSource.apply(this,[ve]),this.levels=ve.levels},ie.extend(ie.LegacyTileSource.prototype,ie.TileSource.prototype,{supports:function(ye,ve){return ye.type&&ye.type=="legacy-image-pyramid"||ye.documentElement&&ye.documentElement.getAttribute("type")=="legacy-image-pyramid"},configure:function(ye,ve){var be;return ie.isPlainObject(ye)?be=ae(this,ye):be=ee(this,ye),be},getLevelScale:function(ye){var ve=NaN;return this.levels.length>0&&ye>=this.minLevel&&ye<=this.maxLevel&&(ve=this.levels[ye].width/this.levels[this.maxLevel].width),ve},getNumTiles:function(ye){var ve=this.getLevelScale(ye);return ve?new ie.Point(1,1):new ie.Point(0,0)},getTileUrl:function(ye,ve,be){var Ye=null;return this.levels.length>0&&ye>=this.minLevel&&ye<=this.maxLevel&&(Ye=this.levels[ye].url),Ye}});function Z(ye){var ve=[],be,Ye;for(Ye=0;Ye");return ve.sort(function(Ke,Xe){return Ke.height-Xe.height})}function ee(ye,ve){if(!ve||!ve.documentElement)throw new Error(ie.getString("Errors.Xml"));var be=ve.documentElement,Ye=be.tagName,Ke=null,Xe=[],Je,rt;if(Ye=="image")try{for(Ke={type:be.getAttribute("type"),levels:[]},Xe=be.getElementsByTagName("level"),rt=0;rt=this.minLevel&&Z<=this.maxLevel&&(ee=this.levels[Z].width/this.levels[this.maxLevel].width),ee},getNumTiles:function(Z){var ee=this.getLevelScale(Z);return ee?new ie.Point(1,1):new ie.Point(0,0)},getTileUrl:function(Z,ee,ae){var ye=null;return Z>=this.minLevel&&Z<=this.maxLevel&&(ye=this.levels[Z].url),ye},getContext2D:function(Z,ee,ae){var ye=null;return Z>=this.minLevel&&Z<=this.maxLevel&&(ye=this.levels[Z].context2D),ye},_buildLevels:function(){var Z=[{url:this._image.src,width:Object.prototype.hasOwnProperty.call(this._image,"naturalWidth")?this._image.naturalWidth:this._image.width,height:Object.prototype.hasOwnProperty.call(this._image,"naturalHeight")?this._image.naturalHeight:this._image.height}];if(!this.buildPyramid||!ie.supportsCanvas||!this.useCanvas)return delete this._image,Z;var ee=Object.prototype.hasOwnProperty.call(this._image,"naturalWidth")?this._image.naturalWidth:this._image.width,ae=Object.prototype.hasOwnProperty.call(this._image,"naturalHeight")?this._image.naturalHeight:this._image.height,ye=document.createElement("canvas"),ve=ye.getContext("2d");if(ye.width=ee,ye.height=ae,ve.drawImage(this._image,0,0,ee,ae),Z[0].context2D=ve,delete this._image,ie.isCanvasTainted(ye))return Z;for(;ee>=2&&ae>=2;){ee=Math.floor(ee/2),ae=Math.floor(ae/2);var be=document.createElement("canvas"),Ye=be.getContext("2d");be.width=ee,be.height=ae,Ye.drawImage(ye,0,0,ee,ae),Z.splice(0,0,{context2D:Ye,width:ee,height:ae}),ye=be,ve=Ye}return Z}})}(OpenSeadragon),function(ie){ie.TileSourceCollection=function(Z,ee,ae,ye){ie.console.error("TileSourceCollection is deprecated; use World instead")}}(OpenSeadragon),function(ie){ie.ButtonState={REST:0,GROUP:1,HOVER:2,DOWN:3},ie.Button=function(Ye){var Ke=this;ie.EventSource.call(this),ie.extend(!0,this,{tooltip:null,srcRest:null,srcGroup:null,srcHover:null,srcDown:null,clickTimeThreshold:ie.DEFAULT_SETTINGS.clickTimeThreshold,clickDistThreshold:ie.DEFAULT_SETTINGS.clickDistThreshold,fadeDelay:0,fadeLength:2e3,onPress:null,onRelease:null,onClick:null,onEnter:null,onExit:null,onFocus:null,onBlur:null},Ye),this.element=Ye.element||ie.makeNeutralElement("div"),Ye.element||(this.imgRest=ie.makeTransparentImage(this.srcRest),this.imgGroup=ie.makeTransparentImage(this.srcGroup),this.imgHover=ie.makeTransparentImage(this.srcHover),this.imgDown=ie.makeTransparentImage(this.srcDown),this.imgRest.alt=this.imgGroup.alt=this.imgHover.alt=this.imgDown.alt=this.tooltip,this.element.style.position="relative",ie.setElementTouchActionNone(this.element),this.imgGroup.style.position=this.imgHover.style.position=this.imgDown.style.position="absolute",this.imgGroup.style.top=this.imgHover.style.top=this.imgDown.style.top="0px",this.imgGroup.style.left=this.imgHover.style.left=this.imgDown.style.left="0px",this.imgHover.style.visibility=this.imgDown.style.visibility="hidden",ie.Browser.vendor==ie.BROWSERS.FIREFOX&&ie.Browser.version<3&&(this.imgGroup.style.top=this.imgHover.style.top=this.imgDown.style.top=""),this.element.appendChild(this.imgRest),this.element.appendChild(this.imgGroup),this.element.appendChild(this.imgHover),this.element.appendChild(this.imgDown)),this.addHandler("press",this.onPress),this.addHandler("release",this.onRelease),this.addHandler("click",this.onClick),this.addHandler("enter",this.onEnter),this.addHandler("exit",this.onExit),this.addHandler("focus",this.onFocus),this.addHandler("blur",this.onBlur),this.currentState=ie.ButtonState.GROUP,this.fadeBeginTime=null,this.shouldFade=!1,this.element.style.display="inline-block",this.element.style.position="relative",this.element.title=this.tooltip,this.tracker=new ie.MouseTracker({element:this.element,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,enterHandler:function(Xe){Xe.insideElementPressed?(ve(Ke,ie.ButtonState.DOWN),Ke.raiseEvent("enter",{originalEvent:Xe.originalEvent})):Xe.buttonDownAny||ve(Ke,ie.ButtonState.HOVER)},focusHandler:function(Xe){this.enterHandler(Xe),Ke.raiseEvent("focus",{originalEvent:Xe.originalEvent})},exitHandler:function(Xe){be(Ke,ie.ButtonState.GROUP),Xe.insideElementPressed&&Ke.raiseEvent("exit",{originalEvent:Xe.originalEvent})},blurHandler:function(Xe){this.exitHandler(Xe),Ke.raiseEvent("blur",{originalEvent:Xe.originalEvent})},pressHandler:function(Xe){ve(Ke,ie.ButtonState.DOWN),Ke.raiseEvent("press",{originalEvent:Xe.originalEvent})},releaseHandler:function(Xe){Xe.insideElementPressed&&Xe.insideElementReleased?(be(Ke,ie.ButtonState.HOVER),Ke.raiseEvent("release",{originalEvent:Xe.originalEvent})):Xe.insideElementPressed?be(Ke,ie.ButtonState.GROUP):ve(Ke,ie.ButtonState.HOVER)},clickHandler:function(Xe){Xe.quick&&Ke.raiseEvent("click",{originalEvent:Xe.originalEvent})},keyHandler:function(Xe){return Xe.keyCode===13?(Ke.raiseEvent("click",{originalEvent:Xe.originalEvent}),Ke.raiseEvent("release",{originalEvent:Xe.originalEvent}),!1):!0}}),be(this,ie.ButtonState.REST)},ie.extend(ie.Button.prototype,ie.EventSource.prototype,{notifyGroupEnter:function(){ve(this,ie.ButtonState.GROUP)},notifyGroupExit:function(){be(this,ie.ButtonState.REST)},disable:function(){this.notifyGroupExit(),this.element.disabled=!0,ie.setElementOpacity(this.element,.2,!0)},enable:function(){this.element.disabled=!1,ie.setElementOpacity(this.element,1,!0),this.notifyGroupEnter()}});function Z(Ye){ie.requestAnimationFrame(function(){ee(Ye)})}function ee(Ye){var Ke,Xe,Je;Ye.shouldFade&&(Ke=ie.now(),Xe=Ke-Ye.fadeBeginTime,Je=1-Xe/Ye.fadeLength,Je=Math.min(1,Je),Je=Math.max(0,Je),Ye.imgGroup&&ie.setElementOpacity(Ye.imgGroup,Je,!0),Je>0&&Z(Ye))}function ae(Ye){Ye.shouldFade=!0,Ye.fadeBeginTime=ie.now()+Ye.fadeDelay,window.setTimeout(function(){Z(Ye)},Ye.fadeDelay)}function ye(Ye){Ye.shouldFade=!1,Ye.imgGroup&&ie.setElementOpacity(Ye.imgGroup,1,!0)}function ve(Ye,Ke){Ye.element.disabled||(Ke>=ie.ButtonState.GROUP&&Ye.currentState==ie.ButtonState.REST&&(ye(Ye),Ye.currentState=ie.ButtonState.GROUP),Ke>=ie.ButtonState.HOVER&&Ye.currentState==ie.ButtonState.GROUP&&(Ye.imgHover&&(Ye.imgHover.style.visibility=""),Ye.currentState=ie.ButtonState.HOVER),Ke>=ie.ButtonState.DOWN&&Ye.currentState==ie.ButtonState.HOVER&&(Ye.imgDown&&(Ye.imgDown.style.visibility=""),Ye.currentState=ie.ButtonState.DOWN))}function be(Ye,Ke){Ye.element.disabled||(Ke<=ie.ButtonState.HOVER&&Ye.currentState==ie.ButtonState.DOWN&&(Ye.imgDown&&(Ye.imgDown.style.visibility="hidden"),Ye.currentState=ie.ButtonState.HOVER),Ke<=ie.ButtonState.GROUP&&Ye.currentState==ie.ButtonState.HOVER&&(Ye.imgHover&&(Ye.imgHover.style.visibility="hidden"),Ye.currentState=ie.ButtonState.GROUP),Ke<=ie.ButtonState.REST&&Ye.currentState==ie.ButtonState.GROUP&&(ae(Ye),Ye.currentState=ie.ButtonState.REST))}}(OpenSeadragon),function(ie){ie.ButtonGroup=function(Z){ie.extend(!0,this,{buttons:[],clickTimeThreshold:ie.DEFAULT_SETTINGS.clickTimeThreshold,clickDistThreshold:ie.DEFAULT_SETTINGS.clickDistThreshold,labelText:""},Z);var ee=this.buttons.concat([]),ae=this,ye;if(this.element=Z.element||ie.makeNeutralElement("div"),!Z.group)for(this.element.style.display="inline-block",ye=0;ye=270?(be=this.getTopRight(),this.x=be.x,this.y=be.y,Ye=this.height,this.height=this.width,this.width=Ye,this.degrees-=270):this.degrees>=180?(be=this.getBottomRight(),this.x=be.x,this.y=be.y,this.degrees-=180):this.degrees>=90&&(be=this.getBottomLeft(),this.x=be.x,this.y=be.y,Ye=this.height,this.height=this.width,this.width=Ye,this.degrees-=90)},ie.Rect.fromSummits=function(Z,ee,ae){var ye=Z.distanceTo(ee),ve=Z.distanceTo(ae),be=ee.minus(Z),Ye=Math.atan(be.y/be.x);return be.x<0?Ye+=Math.PI:be.y<0&&(Ye+=2*Math.PI),new ie.Rect(Z.x,Z.y,ye,ve,Ye/Math.PI*180)},ie.Rect.prototype={clone:function(){return new ie.Rect(this.x,this.y,this.width,this.height,this.degrees)},getAspectRatio:function(){return this.width/this.height},getTopLeft:function(){return new ie.Point(this.x,this.y)},getBottomRight:function(){return new ie.Point(this.x+this.width,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getTopRight:function(){return new ie.Point(this.x+this.width,this.y).rotate(this.degrees,this.getTopLeft())},getBottomLeft:function(){return new ie.Point(this.x,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getCenter:function(){return new ie.Point(this.x+this.width/2,this.y+this.height/2).rotate(this.degrees,this.getTopLeft())},getSize:function(){return new ie.Point(this.width,this.height)},equals:function(Z){return Z instanceof ie.Rect&&this.x===Z.x&&this.y===Z.y&&this.width===Z.width&&this.height===Z.height&&this.degrees===Z.degrees},times:function(Z){return new ie.Rect(this.x*Z,this.y*Z,this.width*Z,this.height*Z,this.degrees)},translate:function(Z){return new ie.Rect(this.x+Z.x,this.y+Z.y,this.width,this.height,this.degrees)},union:function(Z){var ee=this.getBoundingBox(),ae=Z.getBoundingBox(),ye=Math.min(ee.x,ae.x),ve=Math.min(ee.y,ae.y),be=Math.max(ee.x+ee.width,ae.x+ae.width),Ye=Math.max(ee.y+ee.height,ae.y+ae.height);return new ie.Rect(ye,ve,be-ye,Ye-ve)},intersection:function(Z){var ee=1e-10,ae=[],ye=this.getTopLeft();Z.containsPoint(ye,ee)&&ae.push(ye);var ve=this.getTopRight();Z.containsPoint(ve,ee)&&ae.push(ve);var be=this.getBottomLeft();Z.containsPoint(be,ee)&&ae.push(be);var Ye=this.getBottomRight();Z.containsPoint(Ye,ee)&&ae.push(Ye);var Ke=Z.getTopLeft();this.containsPoint(Ke,ee)&&ae.push(Ke);var Xe=Z.getTopRight();this.containsPoint(Xe,ee)&&ae.push(Xe);var Je=Z.getBottomLeft();this.containsPoint(Je,ee)&&ae.push(Je);var rt=Z.getBottomRight();this.containsPoint(rt,ee)&&ae.push(rt);for(var nt=this._getSegments(),it=Z._getSegments(),lt=0;ltYr&&(Yr=ai.x),ai.yXr&&(Xr=ai.y)}return new ie.Rect(mt,Qr,Yr-mt,Xr-Qr)},_getSegments:function(){var Z=this.getTopLeft(),ee=this.getTopRight(),ae=this.getBottomLeft(),ye=this.getBottomRight();return[[Z,ee],[ee,ye],[ye,ae],[ae,Z]]},rotate:function(Z,ee){if(Z=ie.positiveModulo(Z,360),Z===0)return this.clone();ee=ee||this.getCenter();var ae=this.getTopLeft().rotate(Z,ee),ye=this.getTopRight().rotate(Z,ee),ve=ye.minus(ae);ve=ve.apply(function(Ye){var Ke=1e-15;return Math.abs(Ye)=-ee&&(Z.x-ye.x)*be.x+(Z.y-ye.y)*be.y<=ee&&(Z.x-ae.x)*Ye.x+(Z.y-ae.y)*Ye.y>=-ee&&(Z.x-ve.x)*Ye.x+(Z.y-ve.y)*Ye.y<=ee},toString:function(){return"["+Math.round(this.x*100)/100+", "+Math.round(this.y*100)/100+", "+Math.round(this.width*100)/100+"x"+Math.round(this.height*100)/100+", "+Math.round(this.degrees*100)/100+"deg]"}}}(OpenSeadragon),function(ie){var Z={};ie.ReferenceStrip=function(Xe){var Je=this,rt=Xe.viewer,nt=ie.getElementSize(rt.element),it,lt,ct;for(Xe.id||(Xe.id="referencestrip-"+ie.now(),this.element=ie.makeNeutralElement("div"),this.element.id=Xe.id,this.element.className="referencestrip"),Xe=ie.extend(!0,{sizeRatio:ie.DEFAULT_SETTINGS.referenceStripSizeRatio,position:ie.DEFAULT_SETTINGS.referenceStripPosition,scroll:ie.DEFAULT_SETTINGS.referenceStripScroll,clickTimeThreshold:ie.DEFAULT_SETTINGS.clickTimeThreshold},Xe,{element:this.element,showNavigator:!1,mouseNavEnabled:!1,showNavigationControl:!1,showSequenceControl:!1}),ie.extend(this,Xe),Z[this.id]={animating:!1},this.minPixelRatio=this.viewer.minPixelRatio,lt=this.element.style,lt.marginTop="0px",lt.marginRight="0px",lt.marginBottom="0px",lt.marginLeft="0px",lt.left="0px",lt.bottom="0px",lt.border="0px",lt.background="#000",lt.position="relative",ie.setElementTouchActionNone(this.element),ie.setElementOpacity(this.element,.8),this.viewer=rt,this.innerTracker=new ie.MouseTracker({element:this.element,dragHandler:ie.delegate(this,ee),scrollHandler:ie.delegate(this,ae),enterHandler:ie.delegate(this,ve),exitHandler:ie.delegate(this,be),keyDownHandler:ie.delegate(this,Ye),keyHandler:ie.delegate(this,Ke)}),Xe.width&&Xe.height?(this.element.style.width=Xe.width+"px",this.element.style.height=Xe.height+"px",rt.addControl(this.element,{anchor:ie.ControlAnchor.BOTTOM_LEFT})):Xe.scroll=="horizontal"?(this.element.style.width=nt.x*Xe.sizeRatio*rt.tileSources.length+12*rt.tileSources.length+"px",this.element.style.height=nt.y*Xe.sizeRatio+"px",rt.addControl(this.element,{anchor:ie.ControlAnchor.BOTTOM_LEFT})):(this.element.style.height=nt.y*Xe.sizeRatio*rt.tileSources.length+12*rt.tileSources.length+"px",this.element.style.width=nt.x*Xe.sizeRatio+"px",rt.addControl(this.element,{anchor:ie.ControlAnchor.TOP_LEFT})),this.panelWidth=nt.x*this.sizeRatio+8,this.panelHeight=nt.y*this.sizeRatio+8,this.panels=[],this.miniViewers={},ct=0;ctlt+rt.x-this.panelWidth?(ot=Math.min(ot,nt-rt.x),this.element.style.marginLeft=-ot+"px",ye(this,rt.x,-ot)):otct+rt.y-this.panelHeight?(ot=Math.min(ot,it-rt.y),this.element.style.marginTop=-ot+"px",ye(this,rt.y,-ot)):ot0?Je>-(nt-lt.x)&&(this.element.style.marginLeft=Je+Xe.delta.x*2+"px",ye(this,lt.x,Je+Xe.delta.x*2)):-Xe.delta.x<0&&Je<0&&(this.element.style.marginLeft=Je+Xe.delta.x*2+"px",ye(this,lt.x,Je+Xe.delta.x*2)):-Xe.delta.y>0?rt>-(it-lt.y)&&(this.element.style.marginTop=rt+Xe.delta.y*2+"px",ye(this,lt.y,rt+Xe.delta.y*2)):-Xe.delta.y<0&&rt<0&&(this.element.style.marginTop=rt+Xe.delta.y*2+"px",ye(this,lt.y,rt+Xe.delta.y*2))),!1}function ae(Xe){var Je=Number(this.element.style.marginLeft.replace("px","")),rt=Number(this.element.style.marginTop.replace("px","")),nt=Number(this.element.style.width.replace("px","")),it=Number(this.element.style.height.replace("px","")),lt=ie.getElementSize(this.viewer.canvas);return this.element&&(this.scroll=="horizontal"?Xe.scroll>0?Je>-(nt-lt.x)&&(this.element.style.marginLeft=Je-Xe.scroll*60+"px",ye(this,lt.x,Je-Xe.scroll*60)):Xe.scroll<0&&Je<0&&(this.element.style.marginLeft=Je-Xe.scroll*60+"px",ye(this,lt.x,Je-Xe.scroll*60)):Xe.scroll<0?rt>lt.y-it&&(this.element.style.marginTop=rt+Xe.scroll*60+"px",ye(this,lt.y,rt+Xe.scroll*60)):Xe.scroll>0&&rt<0&&(this.element.style.marginTop=rt+Xe.scroll*60+"px",ye(this,lt.y,rt+Xe.scroll*60))),!1}function ye(Xe,Je,rt){var nt,it,lt,ct,ot,dt,ft;for(Xe.scroll=="horizontal"?nt=Xe.panelWidth:nt=Xe.panelHeight,it=Math.ceil(Je/nt)+5,lt=Math.ceil((Math.abs(rt)+Je)/nt)+1,it=lt-it,it=it<0?0:it,dt=it;dt1?ae[1].springStiffness:5,animationTime:ae.length>1?ae[1].animationTime:1.5}),ie.console.assert(typeof ee.springStiffness=="number"&&ee.springStiffness!==0,"[OpenSeadragon.Spring] options.springStiffness must be a non-zero number"),ie.console.assert(typeof ee.animationTime=="number"&&ee.animationTime>=0,"[OpenSeadragon.Spring] options.animationTime must be a number greater than or equal to 0"),ee.exponential&&(this._exponential=!0,delete ee.exponential),ie.extend(!0,this,ee),this.current={value:typeof this.initial=="number"?this.initial:this._exponential?0:1,time:ie.now()},ie.console.assert(!this._exponential||this.current.value!==0,"[OpenSeadragon.Spring] value must be non-zero for exponential springs"),this.start={value:this.current.value,time:this.current.time},this.target={value:this.current.value,time:this.current.time},this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},ie.Spring.prototype={resetTo:function(ee){ie.console.assert(!this._exponential||ee!==0,"[OpenSeadragon.Spring.resetTo] target must be non-zero for exponential springs"),this.start.value=this.target.value=this.current.value=ee,this.start.time=this.target.time=this.current.time=ie.now(),this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},springTo:function(ee){ie.console.assert(!this._exponential||ee!==0,"[OpenSeadragon.Spring.springTo] target must be non-zero for exponential springs"),this.start.value=this.current.value,this.start.time=this.current.time,this.target.value=ee,this.target.time=this.start.time+1e3*this.animationTime,this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value))},shiftBy:function(ee){this.start.value+=ee,this.target.value+=ee,this._exponential&&(ie.console.assert(this.target.value!==0&&this.start.value!==0,"[OpenSeadragon.Spring.shiftBy] spring value must be non-zero for exponential springs"),this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value))},setExponential:function(ee){this._exponential=ee,this._exponential&&(ie.console.assert(this.current.value!==0&&this.target.value!==0&&this.start.value!==0,"[OpenSeadragon.Spring.setExponential] spring value must be non-zero for exponential springs"),this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},update:function(){this.current.time=ie.now();var ee,ae;this._exponential?(ee=this.start._logValue,ae=this.target._logValue):(ee=this.start.value,ae=this.target.value);var ye=this.current.time>=this.target.time?ae:ee+(ae-ee)*Z(this.springStiffness,(this.current.time-this.start.time)/(this.target.time-this.start.time)),ve=this.current.value;return this._exponential?this.current.value=Math.exp(ye):this.current.value=ye,ve!=this.current.value},isAtTargetValue:function(){return this.current.value===this.target.value}};function Z(ee,ae){return(1-Math.exp(ee*-ae))/(1-Math.exp(-ee))}}(OpenSeadragon),function(ie){function Z(ae){ie.extend(!0,this,{timeout:ie.DEFAULT_SETTINGS.timeout,jobId:null},ae),this.image=null}Z.prototype={errorMsg:null,start:function(){var ae=this,ye=this.abort;this.image=new Image,this.image.onload=function(){ae.finish(!0)},this.image.onabort=this.image.onerror=function(){ae.errorMsg="Image load aborted",ae.finish(!1)},this.jobId=window.setTimeout(function(){ae.errorMsg="Image load exceeded timeout ("+ae.timeout+" ms)",ae.finish(!1)},this.timeout),this.loadWithAjax?(this.request=ie.makeAjaxRequest({url:this.src,withCredentials:this.ajaxWithCredentials,headers:this.ajaxHeaders,responseType:"arraybuffer",success:function(ve){var be;try{be=new window.Blob([ve.response])}catch(Je){var Ye=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;if(Je.name==="TypeError"&&Ye){var Ke=new Ye;Ke.append(ve.response),be=Ke.getBlob()}}be.size===0&&(ae.errorMsg="Empty image response.",ae.finish(!1));var Xe=(window.URL||window.webkitURL).createObjectURL(be);ae.image.src=Xe},error:function(ve){ae.errorMsg="Image load aborted - XHR error",ae.finish(!1)}}),this.abort=function(){ae.request.abort(),typeof ye=="function"&&ye()}):(this.crossOriginPolicy!==!1&&(this.image.crossOrigin=this.crossOriginPolicy),this.image.src=this.src)},finish:function(ae){this.image.onload=this.image.onerror=this.image.onabort=null,ae||(this.image=null),this.jobId&&window.clearTimeout(this.jobId),this.callback(this)}},ie.ImageLoader=function(ae){ie.extend(!0,this,{jobLimit:ie.DEFAULT_SETTINGS.imageLoaderLimit,timeout:ie.DEFAULT_SETTINGS.timeout,jobQueue:[],jobsInProgress:0},ae)},ie.ImageLoader.prototype={addJob:function(ae){var ye=this,ve=function(Ke){ee(ye,Ke,ae.callback)},be={src:ae.src,loadWithAjax:ae.loadWithAjax,ajaxHeaders:ae.loadWithAjax?ae.ajaxHeaders:null,crossOriginPolicy:ae.crossOriginPolicy,ajaxWithCredentials:ae.ajaxWithCredentials,callback:ve,abort:ae.abort,timeout:this.timeout},Ye=new Z(be);!this.jobLimit||this.jobsInProgress0&&(be=ae.jobQueue.shift(),be.start(),ae.jobsInProgress++),ve(ye.image,ye.errorMsg,ye.request)}}(OpenSeadragon),function(ie){ie.Tile=function(Z,ee,ae,ye,ve,be,Ye,Ke,Xe,Je){this.level=Z,this.x=ee,this.y=ae,this.bounds=ye,this.sourceBounds=Je,this.exists=ve,this.url=be,this.context2D=Ye,this.loadWithAjax=Ke,this.ajaxHeaders=Xe,this.ajaxHeaders?this.cacheKey=this.url+"+"+JSON.stringify(this.ajaxHeaders):this.cacheKey=this.url,this.loaded=!1,this.loading=!1,this.element=null,this.imgElement=null,this.image=null,this.style=null,this.position=null,this.size=null,this.blendStart=null,this.opacity=null,this.squaredDistance=null,this.visibility=null,this.beingDrawn=!1,this.lastTouchTime=0,this.isRightMost=!1,this.isBottomMost=!1},ie.Tile.prototype={toString:function(){return this.level+"/"+this.x+"_"+this.y},_hasTransparencyChannel:function(){return!!this.context2D||this.url.match(".png")},drawHTML:function(Z){if(!this.cacheImageRecord){ie.console.warn("[Tile.drawHTML] attempting to draw tile %s when it's not cached",this.toString());return}if(!this.loaded){ie.console.warn("Attempting to draw tile %s when it's not yet loaded.",this.toString());return}this.element||(this.element=ie.makeNeutralElement("div"),this.imgElement=this.cacheImageRecord.getImage().cloneNode(),this.imgElement.style.msInterpolationMode="nearest-neighbor",this.imgElement.style.width="100%",this.imgElement.style.height="100%",this.style=this.element.style,this.style.position="absolute"),this.element.parentNode!=Z&&Z.appendChild(this.element),this.imgElement.parentNode!=this.element&&this.element.appendChild(this.imgElement),this.style.top=this.position.y+"px",this.style.left=this.position.x+"px",this.style.height=this.size.y+"px",this.style.width=this.size.x+"px",ie.setElementOpacity(this.element,this.opacity)},drawCanvas:function(Z,ee,ae,ye){var ve=this.position.times(ie.pixelDensityRatio),be=this.size.times(ie.pixelDensityRatio),Ye;if(!this.context2D&&!this.cacheImageRecord){ie.console.warn("[Tile.drawCanvas] attempting to draw tile %s when it's not cached",this.toString());return}if(Ye=this.context2D||this.cacheImageRecord.getRenderedContext(),!this.loaded||!Ye){ie.console.warn("Attempting to draw tile %s when it's not yet loaded.",this.toString());return}Z.save(),Z.globalAlpha=this.opacity,typeof ae=="number"&&ae!==1&&(ve=ve.times(ae),be=be.times(ae)),ye instanceof ie.Point&&(ve=ve.plus(ye)),Z.globalAlpha===1&&this._hasTransparencyChannel()&&Z.clearRect(ve.x,ve.y,be.x,be.y),ee({context:Z,tile:this,rendered:Ye});var Ke,Xe;this.sourceBounds?(Ke=Math.min(this.sourceBounds.width,Ye.canvas.width),Xe=Math.min(this.sourceBounds.height,Ye.canvas.height)):(Ke=Ye.canvas.width,Xe=Ye.canvas.height),Z.drawImage(Ye.canvas,0,0,Ke,Xe,ve.x,ve.y,be.x,be.y),Z.restore()},getScaleForEdgeSmoothing:function(){var Z;if(this.cacheImageRecord)Z=this.cacheImageRecord.getRenderedContext();else if(this.context2D)Z=this.context2D;else return ie.console.warn("[Tile.drawCanvas] attempting to get tile scale %s when tile's not cached",this.toString()),1;return Z.canvas.width/(this.size.x*ie.pixelDensityRatio)},getTranslationForEdgeSmoothing:function(Z,ee,ae){var ye=Math.max(1,Math.ceil((ae.x-ee.x)/2)),ve=Math.max(1,Math.ceil((ae.y-ee.y)/2));return new ie.Point(ye,ve).minus(this.position.times(ie.pixelDensityRatio).times(Z||1).apply(function(be){return be%1}))},unload:function(){this.imgElement&&this.imgElement.parentNode&&this.imgElement.parentNode.removeChild(this.imgElement),this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null,this.imgElement=null,this.loaded=!1,this.loading=!1}}}(OpenSeadragon),function(ie){ie.OverlayPlacement=ie.Placement,ie.OverlayRotationMode=ie.freezeObject({NO_ROTATION:1,EXACT:2,BOUNDING_BOX:3}),ie.Overlay=function(Z,ee,ae){var ye;ie.isPlainObject(Z)?ye=Z:ye={element:Z,location:ee,placement:ae},this.element=ye.element,this.style=ye.element.style,this._init(ye)},ie.Overlay.prototype={_init:function(Z){this.location=Z.location,this.placement=Z.placement===void 0?ie.Placement.TOP_LEFT:Z.placement,this.onDraw=Z.onDraw,this.checkResize=Z.checkResize===void 0?!0:Z.checkResize,this.width=Z.width===void 0?null:Z.width,this.height=Z.height===void 0?null:Z.height,this.rotationMode=Z.rotationMode||ie.OverlayRotationMode.EXACT,this.location instanceof ie.Rect&&(this.width=this.location.width,this.height=this.location.height,this.location=this.location.getTopLeft(),this.placement=ie.Placement.TOP_LEFT),this.scales=this.width!==null&&this.height!==null,this.bounds=new ie.Rect(this.location.x,this.location.y,this.width,this.height),this.position=this.location},adjust:function(Z,ee){var ae=ie.Placement.properties[this.placement];ae&&(ae.isHorizontallyCentered?Z.x-=ee.x/2:ae.isRight&&(Z.x-=ee.x),ae.isVerticallyCentered?Z.y-=ee.y/2:ae.isBottom&&(Z.y-=ee.y))},destroy:function(){var Z=this.element,ee=this.style;Z.parentNode&&(Z.parentNode.removeChild(Z),Z.prevElementParent&&(ee.display="none",document.body.appendChild(Z))),this.onDraw=null,ee.top="",ee.left="",ee.position="",this.width!==null&&(ee.width=""),this.height!==null&&(ee.height="");var ae=ie.getCssPropertyWithVendorPrefix("transformOrigin"),ye=ie.getCssPropertyWithVendorPrefix("transform");ae&&ye&&(ee[ae]="",ee[ye]="")},drawHTML:function(Z,ee){var ae=this.element;ae.parentNode!==Z&&(ae.prevElementParent=ae.parentNode,ae.prevNextSibling=ae.nextSibling,Z.appendChild(ae),this.style.position="absolute",this.size=ie.getElementSize(ae));var ye=this._getOverlayPositionAndSize(ee),ve=ye.position,be=this.size=ye.size,Ye=ye.rotate;if(this.onDraw)this.onDraw(ve,be,this.element);else{var Ke=this.style;Ke.left=ve.x+"px",Ke.top=ve.y+"px",this.width!==null&&(Ke.width=be.x+"px"),this.height!==null&&(Ke.height=be.y+"px");var Xe=ie.getCssPropertyWithVendorPrefix("transformOrigin"),Je=ie.getCssPropertyWithVendorPrefix("transform");Xe&&Je&&(Ye?(Ke[Xe]=this._getTransformOrigin(),Ke[Je]="rotate("+Ye+"deg)"):(Ke[Xe]="",Ke[Je]="")),Ke.display!=="none"&&(Ke.display="block")}},_getOverlayPositionAndSize:function(Z){var ee=Z.pixelFromPoint(this.location,!0),ae=this._getSizeInPixels(Z);this.adjust(ee,ae);var ye=0;if(Z.degrees&&this.rotationMode!==ie.OverlayRotationMode.NO_ROTATION)if(this.rotationMode===ie.OverlayRotationMode.BOUNDING_BOX&&this.width!==null&&this.height!==null){var ve=new ie.Rect(ee.x,ee.y,ae.x,ae.y),be=this._getBoundingBox(ve,Z.degrees);ee=be.getTopLeft(),ae=be.getSize()}else ye=Z.degrees;return{position:ee,size:ae,rotate:ye}},_getSizeInPixels:function(Z){var ee=this.size.x,ae=this.size.y;if(this.width!==null||this.height!==null){var ye=Z.deltaPixelsFromPointsNoRotate(new ie.Point(this.width||0,this.height||0),!0);this.width!==null&&(ee=ye.x),this.height!==null&&(ae=ye.y)}if(this.checkResize&&(this.width===null||this.height===null)){var ve=this.size=ie.getElementSize(this.element);this.width===null&&(ee=ve.x),this.height===null&&(ae=ve.y)}return new ie.Point(ee,ae)},_getBoundingBox:function(Z,ee){var ae=this._getPlacementPoint(Z);return Z.rotate(ee,ae).getBoundingBox()},_getPlacementPoint:function(Z){var ee=new ie.Point(Z.x,Z.y),ae=ie.Placement.properties[this.placement];return ae&&(ae.isHorizontallyCentered?ee.x+=Z.width/2:ae.isRight&&(ee.x+=Z.width),ae.isVerticallyCentered?ee.y+=Z.height/2:ae.isBottom&&(ee.y+=Z.height)),ee},_getTransformOrigin:function(){var Z="",ee=ie.Placement.properties[this.placement];return ee&&(ee.isLeft?Z="left":ee.isRight&&(Z="right"),ee.isTop?Z+=" top":ee.isBottom&&(Z+=" bottom")),Z},update:function(Z,ee){var ae=ie.isPlainObject(Z)?Z:{location:Z,placement:ee};this._init({location:ae.location||this.location,placement:ae.placement!==void 0?ae.placement:this.placement,onDraw:ae.onDraw||this.onDraw,checkResize:ae.checkResize||this.checkResize,width:ae.width!==void 0?ae.width:this.width,height:ae.height!==void 0?ae.height:this.height,rotationMode:ae.rotationMode||this.rotationMode})},getBounds:function(Z){ie.console.assert(Z,"A viewport must now be passed to Overlay.getBounds.");var ee=this.width,ae=this.height;if(ee===null||ae===null){var ye=Z.deltaPointsFromPixelsNoRotate(this.size,!0);ee===null&&(ee=ye.x),ae===null&&(ae=ye.y)}var ve=this.location.clone();return this.adjust(ve,new ie.Point(ee,ae)),this._adjustBoundsForRotation(Z,new ie.Rect(ve.x,ve.y,ee,ae))},_adjustBoundsForRotation:function(Z,ee){if(!Z||Z.degrees===0||this.rotationMode===ie.OverlayRotationMode.EXACT)return ee;if(this.rotationMode===ie.OverlayRotationMode.BOUNDING_BOX){if(this.width===null||this.height===null)return ee;var ae=this._getOverlayPositionAndSize(Z);return Z.viewerElementToViewportRectangle(new ie.Rect(ae.position.x,ae.position.y,ae.size.x,ae.size.y))}return ee.rotate(-Z.degrees,this._getPlacementPoint(ee))}}}(OpenSeadragon),function(ie){ie.Drawer=function(Z){ie.console.assert(Z.viewer,"[Drawer] options.viewer is required");var ee=arguments;if(ie.isPlainObject(Z)||(Z={source:ee[0],viewport:ee[1],element:ee[2]}),ie.console.assert(Z.viewport,"[Drawer] options.viewport is required"),ie.console.assert(Z.element,"[Drawer] options.element is required"),Z.source&&ie.console.error("[Drawer] options.source is no longer accepted; use TiledImage instead"),this.viewer=Z.viewer,this.viewport=Z.viewport,this.debugGridColor=typeof Z.debugGridColor=="string"?[Z.debugGridColor]:Z.debugGridColor||ie.DEFAULT_SETTINGS.debugGridColor,Z.opacity&&ie.console.error("[Drawer] options.opacity is no longer accepted; set the opacity on the TiledImage instead"),this.useCanvas=ie.supportsCanvas&&(this.viewer?this.viewer.useCanvas:!0),this.container=ie.getElement(Z.element),this.canvas=ie.makeNeutralElement(this.useCanvas?"canvas":"div"),this.context=this.useCanvas?this.canvas.getContext("2d"):null,this.sketchCanvas=null,this.sketchContext=null,this.element=this.container,this.container.dir="ltr",this.useCanvas){var ae=this._calculateCanvasSize();this.canvas.width=ae.x,this.canvas.height=ae.y}this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.position="absolute",ie.setElementOpacity(this.canvas,this.opacity,!0),this.container.style.textAlign="left",this.container.appendChild(this.canvas),this._imageSmoothingEnabled=!0},ie.Drawer.prototype={addOverlay:function(Z,ee,ae,ye){return ie.console.error("drawer.addOverlay is deprecated. Use viewer.addOverlay instead."),this.viewer.addOverlay(Z,ee,ae,ye),this},updateOverlay:function(Z,ee,ae){return ie.console.error("drawer.updateOverlay is deprecated. Use viewer.updateOverlay instead."),this.viewer.updateOverlay(Z,ee,ae),this},removeOverlay:function(Z){return ie.console.error("drawer.removeOverlay is deprecated. Use viewer.removeOverlay instead."),this.viewer.removeOverlay(Z),this},clearOverlays:function(){return ie.console.error("drawer.clearOverlays is deprecated. Use viewer.clearOverlays instead."),this.viewer.clearOverlays(),this},viewportCoordToDrawerCoord:function(Z){var ee=this.viewport.pixelFromPointNoRotate(Z,!0);return new ie.Point(ee.x*ie.pixelDensityRatio,ee.y*ie.pixelDensityRatio)},clipWithPolygons:function(Z,ee){if(this.useCanvas){var ae=this._getContext(ee);ae.beginPath(),Z.forEach(function(ye){ye.forEach(function(ve,be){ae[be===0?"moveTo":"lineTo"](ve.x,ve.y)})}),ae.clip()}},setOpacity:function(Z){ie.console.error("drawer.setOpacity is deprecated. Use tiledImage.setOpacity instead.");for(var ee=this.viewer.world,ae=0;aeee&&(ee=ye)}return ee},needsUpdate:function(){return ie.console.error("[Drawer.needsUpdate] this function is deprecated. Use World.needsDraw instead."),this.viewer.world.needsDraw()},numTilesLoaded:function(){return ie.console.error("[Drawer.numTilesLoaded] this function is deprecated. Use TileCache.numTilesLoaded instead."),this.viewer.tileCache.numTilesLoaded()},reset:function(){return ie.console.error("[Drawer.reset] this function is deprecated. Use World.resetItems instead."),this.viewer.world.resetItems(),this},update:function(){return ie.console.error("[Drawer.update] this function is deprecated. Use Drawer.clear and World.draw instead."),this.clear(),this.viewer.world.draw(),this},canRotate:function(){return this.useCanvas},destroy:function(){this.canvas.width=1,this.canvas.height=1,this.sketchCanvas=null,this.sketchContext=null},clear:function(){if(this.canvas.innerHTML="",this.useCanvas){var Z=this._calculateCanvasSize();if((this.canvas.width!=Z.x||this.canvas.height!=Z.y)&&(this.canvas.width=Z.x,this.canvas.height=Z.y,this._updateImageSmoothingEnabled(this.context),this.sketchCanvas!==null)){var ee=this._calculateSketchCanvasSize();this.sketchCanvas.width=ee.x,this.sketchCanvas.height=ee.y,this._updateImageSmoothingEnabled(this.sketchContext)}this._clear()}},_clear:function(Z,ee){if(this.useCanvas){var ae=this._getContext(Z);if(ee)ae.clearRect(ee.x,ee.y,ee.width,ee.height);else{var ye=ae.canvas;ae.clearRect(0,0,ye.width,ye.height)}}},viewportToDrawerRectangle:function(Z){var ee=this.viewport.pixelFromPointNoRotate(Z.getTopLeft(),!0),ae=this.viewport.deltaPixelsFromPointsNoRotate(Z.getSize(),!0);return new ie.Rect(ee.x*ie.pixelDensityRatio,ee.y*ie.pixelDensityRatio,ae.x*ie.pixelDensityRatio,ae.y*ie.pixelDensityRatio)},drawTile:function(Z,ee,ae,ye,ve){if(ie.console.assert(Z,"[Drawer.drawTile] tile is required"),ie.console.assert(ee,"[Drawer.drawTile] drawingHandler is required"),this.useCanvas){var be=this._getContext(ae);ye=ye||1,Z.drawCanvas(be,ee,ye,ve)}else Z.drawHTML(this.canvas)},_getContext:function(Z){var ee=this.context;if(Z){if(this.sketchCanvas===null){this.sketchCanvas=document.createElement("canvas");var ae=this._calculateSketchCanvasSize();if(this.sketchCanvas.width=ae.x,this.sketchCanvas.height=ae.y,this.sketchContext=this.sketchCanvas.getContext("2d"),this.viewport.getRotation()===0){var ye=this;this.viewer.addHandler("rotate",function ve(){if(ye.viewport.getRotation()!==0){ye.viewer.removeHandler("rotate",ve);var be=ye._calculateSketchCanvasSize();ye.sketchCanvas.width=be.x,ye.sketchCanvas.height=be.y}})}this._updateImageSmoothingEnabled(this.sketchContext)}ee=this.sketchContext}return ee},saveContext:function(Z){this.useCanvas&&this._getContext(Z).save()},restoreContext:function(Z){this.useCanvas&&this._getContext(Z).restore()},setClip:function(Z,ee){if(this.useCanvas){var ae=this._getContext(ee);ae.beginPath(),ae.rect(Z.x,Z.y,Z.width,Z.height),ae.clip()}},drawRectangle:function(Z,ee,ae){if(this.useCanvas){var ye=this._getContext(ae);ye.save(),ye.fillStyle=ee,ye.fillRect(Z.x,Z.y,Z.width,Z.height),ye.restore()}},blendSketch:function(Z,ee,ae,ye){var ve=Z;if(ie.isPlainObject(ve)||(ve={opacity:Z,scale:ee,translate:ae,compositeOperation:ye}),!(!this.useCanvas||!this.sketchCanvas)){Z=ve.opacity,ye=ve.compositeOperation;var be=ve.bounds;if(this.context.save(),this.context.globalAlpha=Z,ye&&(this.context.globalCompositeOperation=ye),be)be.x<0&&(be.width+=be.x,be.x=0),be.x+be.width>this.canvas.width&&(be.width=this.canvas.width-be.x),be.y<0&&(be.height+=be.y,be.y=0),be.y+be.height>this.canvas.height&&(be.height=this.canvas.height-be.y),this.context.drawImage(this.sketchCanvas,be.x,be.y,be.width,be.height,be.x,be.y,be.width,be.height);else{ee=ve.scale||1,ae=ve.translate;var Ye=ae instanceof ie.Point?ae:new ie.Point(0,0),Ke=0,Xe=0;if(ae){var Je=this.sketchCanvas.width-this.canvas.width,rt=this.sketchCanvas.height-this.canvas.height;Ke=Math.round(Je/2),Xe=Math.round(rt/2)}this.context.drawImage(this.sketchCanvas,Ye.x-Ke*ee,Ye.y-Xe*ee,(this.canvas.width+2*Ke)*ee,(this.canvas.height+2*Xe)*ee,-Ke,-Xe,this.canvas.width+2*Ke,this.canvas.height+2*Xe)}this.context.restore()}},drawDebugInfo:function(Z,ee,ae,ye){if(this.useCanvas){var ve=this.viewer.world.getIndexOfItem(ye)%this.debugGridColor.length,be=this.context;be.save(),be.lineWidth=2*ie.pixelDensityRatio,be.font="small-caps bold "+13*ie.pixelDensityRatio+"px arial",be.strokeStyle=this.debugGridColor[ve],be.fillStyle=this.debugGridColor[ve],this.viewport.degrees!==0&&this._offsetForRotation({degrees:this.viewport.degrees}),ye.getRotation(!0)%360!==0&&this._offsetForRotation({degrees:ye.getRotation(!0),point:ye.viewport.pixelFromPointNoRotate(ye._getRotationPoint(!0),!0)}),ye.viewport.degrees===0&&ye.getRotation(!0)%360===0&&ye._drawer.viewer.viewport.getFlip()&&ye._drawer._flip(),be.strokeRect(Z.position.x*ie.pixelDensityRatio,Z.position.y*ie.pixelDensityRatio,Z.size.x*ie.pixelDensityRatio,Z.size.y*ie.pixelDensityRatio);var Ye=(Z.position.x+Z.size.x/2)*ie.pixelDensityRatio,Ke=(Z.position.y+Z.size.y/2)*ie.pixelDensityRatio;be.translate(Ye,Ke),be.rotate(Math.PI/180*-this.viewport.degrees),be.translate(-Ye,-Ke),Z.x===0&&Z.y===0&&(be.fillText("Zoom: "+this.viewport.getZoom(),Z.position.x*ie.pixelDensityRatio,(Z.position.y-30)*ie.pixelDensityRatio),be.fillText("Pan: "+this.viewport.getBounds().toString(),Z.position.x*ie.pixelDensityRatio,(Z.position.y-20)*ie.pixelDensityRatio)),be.fillText("Level: "+Z.level,(Z.position.x+10)*ie.pixelDensityRatio,(Z.position.y+20)*ie.pixelDensityRatio),be.fillText("Column: "+Z.x,(Z.position.x+10)*ie.pixelDensityRatio,(Z.position.y+30)*ie.pixelDensityRatio),be.fillText("Row: "+Z.y,(Z.position.x+10)*ie.pixelDensityRatio,(Z.position.y+40)*ie.pixelDensityRatio),be.fillText("Order: "+ae+" of "+ee,(Z.position.x+10)*ie.pixelDensityRatio,(Z.position.y+50)*ie.pixelDensityRatio),be.fillText("Size: "+Z.size.toString(),(Z.position.x+10)*ie.pixelDensityRatio,(Z.position.y+60)*ie.pixelDensityRatio),be.fillText("Position: "+Z.position.toString(),(Z.position.x+10)*ie.pixelDensityRatio,(Z.position.y+70)*ie.pixelDensityRatio),this.viewport.degrees!==0&&this._restoreRotationChanges(),ye.getRotation(!0)%360!==0&&this._restoreRotationChanges(),ye.viewport.degrees===0&&ye.getRotation(!0)%360===0&&ye._drawer.viewer.viewport.getFlip()&&ye._drawer._flip(),be.restore()}},debugRect:function(Z){if(this.useCanvas){var ee=this.context;ee.save(),ee.lineWidth=2*ie.pixelDensityRatio,ee.strokeStyle=this.debugGridColor[0],ee.fillStyle=this.debugGridColor[0],ee.strokeRect(Z.x*ie.pixelDensityRatio,Z.y*ie.pixelDensityRatio,Z.width*ie.pixelDensityRatio,Z.height*ie.pixelDensityRatio),ee.restore()}},setImageSmoothingEnabled:function(Z){this.useCanvas&&(this._imageSmoothingEnabled=Z,this._updateImageSmoothingEnabled(this.context),this.viewer.forceRedraw())},_updateImageSmoothingEnabled:function(Z){Z.msImageSmoothingEnabled=this._imageSmoothingEnabled,Z.imageSmoothingEnabled=this._imageSmoothingEnabled},getCanvasSize:function(Z){var ee=this._getContext(Z).canvas;return new ie.Point(ee.width,ee.height)},getCanvasCenter:function(){return new ie.Point(this.canvas.width/2,this.canvas.height/2)},_offsetForRotation:function(Z){var ee=Z.point?Z.point.times(ie.pixelDensityRatio):this.getCanvasCenter(),ae=this._getContext(Z.useSketch);ae.save(),ae.translate(ee.x,ee.y),this.viewer.viewport.flipped?(ae.rotate(Math.PI/180*-Z.degrees),ae.scale(-1,1)):ae.rotate(Math.PI/180*Z.degrees),ae.translate(-ee.x,-ee.y)},_flip:function(Z){Z=Z||{};var ee=Z.point?Z.point.times(ie.pixelDensityRatio):this.getCanvasCenter(),ae=this._getContext(Z.useSketch);ae.translate(ee.x,0),ae.scale(-1,1),ae.translate(-ee.x,0)},_restoreRotationChanges:function(Z){var ee=this._getContext(Z);ee.restore()},_calculateCanvasSize:function(){var Z=ie.pixelDensityRatio,ee=this.viewport.getContainerSize();return{x:Math.round(ee.x*Z),y:Math.round(ee.y*Z)}},_calculateSketchCanvasSize:function(){var Z=this._calculateCanvasSize();if(this.viewport.getRotation()===0)return Z;var ee=Math.ceil(Math.sqrt(Z.x*Z.x+Z.y*Z.y));return{x:ee,y:ee}}}}(OpenSeadragon),function(ie){ie.Viewport=function(Z){var ee=arguments;ee.length&&ee[0]instanceof ie.Point&&(Z={containerSize:ee[0],contentSize:ee[1],config:ee[2]}),Z.config&&(ie.extend(!0,Z,Z.config),delete Z.config),this._margins=ie.extend({left:0,top:0,right:0,bottom:0},Z.margins||{}),delete Z.margins,ie.extend(!0,this,{containerSize:null,contentSize:null,zoomPoint:null,viewer:null,springStiffness:ie.DEFAULT_SETTINGS.springStiffness,animationTime:ie.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:ie.DEFAULT_SETTINGS.minZoomImageRatio,maxZoomPixelRatio:ie.DEFAULT_SETTINGS.maxZoomPixelRatio,visibilityRatio:ie.DEFAULT_SETTINGS.visibilityRatio,wrapHorizontal:ie.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:ie.DEFAULT_SETTINGS.wrapVertical,defaultZoomLevel:ie.DEFAULT_SETTINGS.defaultZoomLevel,minZoomLevel:ie.DEFAULT_SETTINGS.minZoomLevel,maxZoomLevel:ie.DEFAULT_SETTINGS.maxZoomLevel,degrees:ie.DEFAULT_SETTINGS.degrees,flipped:ie.DEFAULT_SETTINGS.flipped,homeFillsViewer:ie.DEFAULT_SETTINGS.homeFillsViewer},Z),this._updateContainerInnerSize(),this.centerSpringX=new ie.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.centerSpringY=new ie.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.zoomSpring=new ie.Spring({exponential:!0,initial:1,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,this._setContentBounds(new ie.Rect(0,0,1,1),1),this.goHome(!0),this.update()},ie.Viewport.prototype={resetContentSize:function(Z){return ie.console.assert(Z,"[Viewport.resetContentSize] contentSize is required"),ie.console.assert(Z instanceof ie.Point,"[Viewport.resetContentSize] contentSize must be an OpenSeadragon.Point"),ie.console.assert(Z.x>0,"[Viewport.resetContentSize] contentSize.x must be greater than 0"),ie.console.assert(Z.y>0,"[Viewport.resetContentSize] contentSize.y must be greater than 0"),this._setContentBounds(new ie.Rect(0,0,1,Z.y/Z.x),Z.x),this},setHomeBounds:function(Z,ee){ie.console.error("[Viewport.setHomeBounds] this function is deprecated; The content bounds should not be set manually."),this._setContentBounds(Z,ee)},_setContentBounds:function(Z,ee){ie.console.assert(Z,"[Viewport._setContentBounds] bounds is required"),ie.console.assert(Z instanceof ie.Rect,"[Viewport._setContentBounds] bounds must be an OpenSeadragon.Rect"),ie.console.assert(Z.width>0,"[Viewport._setContentBounds] bounds.width must be greater than 0"),ie.console.assert(Z.height>0,"[Viewport._setContentBounds] bounds.height must be greater than 0"),this._contentBoundsNoRotate=Z.clone(),this._contentSizeNoRotate=this._contentBoundsNoRotate.getSize().times(ee),this._contentBounds=Z.rotate(this.degrees).getBoundingBox(),this._contentSize=this._contentBounds.getSize().times(ee),this._contentAspectRatio=this._contentSize.x/this._contentSize.y,this.viewer&&this.viewer.raiseEvent("reset-size",{contentSize:this._contentSizeNoRotate.clone(),contentFactor:ee,homeBounds:this._contentBoundsNoRotate.clone(),contentBounds:this._contentBounds.clone()})},getHomeZoom:function(){if(this.defaultZoomLevel)return this.defaultZoomLevel;var Z=this._contentAspectRatio/this.getAspectRatio(),ee;return this.homeFillsViewer?ee=Z>=1?Z:1:ee=Z>=1?1:Z,ee/this._contentBounds.width},getHomeBounds:function(){return this.getHomeBoundsNoRotate().rotate(-this.getRotation())},getHomeBoundsNoRotate:function(){var Z=this._contentBounds.getCenter(),ee=1/this.getHomeZoom(),ae=ee/this.getAspectRatio();return new ie.Rect(Z.x-ee/2,Z.y-ae/2,ee,ae)},goHome:function(Z){return this.viewer&&this.viewer.raiseEvent("home",{immediately:Z}),this.fitBounds(this.getHomeBounds(),Z)},getMinZoom:function(){var Z=this.getHomeZoom(),ee=this.minZoomLevel?this.minZoomLevel:this.minZoomImageRatio*Z;return ee},getMaxZoom:function(){var Z=this.maxZoomLevel;return Z||(Z=this._contentSize.x*this.maxZoomPixelRatio/this._containerInnerSize.x,Z/=this._contentBounds.width),Math.max(Z,this.getHomeZoom())},getAspectRatio:function(){return this._containerInnerSize.x/this._containerInnerSize.y},getContainerSize:function(){return new ie.Point(this.containerSize.x,this.containerSize.y)},getMargins:function(){return ie.extend({},this._margins)},setMargins:function(Z){ie.console.assert(ie.type(Z)==="object","[Viewport.setMargins] margins must be an object"),this._margins=ie.extend({left:0,top:0,right:0,bottom:0},Z),this._updateContainerInnerSize(),this.viewer&&this.viewer.forceRedraw()},getBounds:function(Z){return this.getBoundsNoRotate(Z).rotate(-this.getRotation())},getBoundsNoRotate:function(Z){var ee=this.getCenter(Z),ae=1/this.getZoom(Z),ye=ae/this.getAspectRatio();return new ie.Rect(ee.x-ae/2,ee.y-ye/2,ae,ye)},getBoundsWithMargins:function(Z){return this.getBoundsNoRotateWithMargins(Z).rotate(-this.getRotation(),this.getCenter(Z))},getBoundsNoRotateWithMargins:function(Z){var ee=this.getBoundsNoRotate(Z),ae=this._containerInnerSize.x*this.getZoom(Z);return ee.x-=this._margins.left/ae,ee.y-=this._margins.top/ae,ee.width+=(this._margins.left+this._margins.right)/ae,ee.height+=(this._margins.top+this._margins.bottom)/ae,ee},getCenter:function(Z){var ee=new ie.Point(this.centerSpringX.current.value,this.centerSpringY.current.value),ae=new ie.Point(this.centerSpringX.target.value,this.centerSpringY.target.value),ye,ve,be,Ye,Ke,Xe,Je,rt;return Z?ee:this.zoomPoint?(ye=this.pixelFromPoint(this.zoomPoint,!0),ve=this.getZoom(),be=1/ve,Ye=be/this.getAspectRatio(),Ke=new ie.Rect(ee.x-be/2,ee.y-Ye/2,be,Ye),Xe=this._pixelFromPoint(this.zoomPoint,Ke),Je=Xe.minus(ye),rt=Je.divide(this._containerInnerSize.x*ve),ae.plus(rt)):ae},getZoom:function(Z){return Z?this.zoomSpring.current.value:this.zoomSpring.target.value},_applyZoomConstraints:function(Z){return Math.max(Math.min(Z,this.getMaxZoom()),this.getMinZoom())},_applyBoundaryConstraints:function(Z){var ee=new ie.Rect(Z.x,Z.y,Z.width,Z.height);if(!this.wrapHorizontal){var ae=this.visibilityRatio*ee.width,ye=ee.x+ee.width,ve=this._contentBoundsNoRotate.x+this._contentBoundsNoRotate.width,be=this._contentBoundsNoRotate.x-ye+ae,Ye=ve-ee.x-ae;ae>this._contentBoundsNoRotate.width?ee.x+=(be+Ye)/2:Ye<0?ee.x+=Ye:be>0&&(ee.x+=be)}if(!this.wrapVertical){var Ke=this.visibilityRatio*ee.height,Xe=ee.y+ee.height,Je=this._contentBoundsNoRotate.y+this._contentBoundsNoRotate.height,rt=this._contentBoundsNoRotate.y-Xe+Ke,nt=Je-ee.y-Ke;Ke>this._contentBoundsNoRotate.height?ee.y+=(rt+nt)/2:nt<0?ee.y+=nt:rt>0&&(ee.y+=rt)}return ee},_raiseConstraintsEvent:function(Z){this.viewer&&this.viewer.raiseEvent("constrain",{immediately:Z})},applyConstraints:function(Z){var ee=this.getZoom(),ae=this._applyZoomConstraints(ee);ee!==ae&&this.zoomTo(ae,this.zoomPoint,Z);var ye=this.getBoundsNoRotate(),ve=this._applyBoundaryConstraints(ye);return this._raiseConstraintsEvent(Z),(ye.x!==ve.x||ye.y!==ve.y||Z)&&this.fitBounds(ve.rotate(-this.getRotation()),Z),this},ensureVisible:function(Z){return this.applyConstraints(Z)},_fitBounds:function(Z,ee){ee=ee||{};var ae=ee.immediately||!1,ye=ee.constraints||!1,ve=this.getAspectRatio(),be=Z.getCenter(),Ye=new ie.Rect(Z.x,Z.y,Z.width,Z.height,Z.degrees+this.getRotation()).getBoundingBox();Ye.getAspectRatio()>=ve?Ye.height=Ye.width/ve:Ye.width=Ye.height*ve,Ye.x=be.x-Ye.width/2,Ye.y=be.y-Ye.height/2;var Ke=1/Ye.width;if(ye){var Xe=Ye.getAspectRatio(),Je=this._applyZoomConstraints(Ke);Ke!==Je&&(Ke=Je,Ye.width=1/Ke,Ye.x=be.x-Ye.width/2,Ye.height=Ye.width/Xe,Ye.y=be.y-Ye.height/2),Ye=this._applyBoundaryConstraints(Ye),be=Ye.getCenter(),this._raiseConstraintsEvent(ae)}if(ae)return this.panTo(be,!0),this.zoomTo(Ke,null,!0);this.panTo(this.getCenter(!0),!0),this.zoomTo(this.getZoom(!0),null,!0);var rt=this.getBounds(),nt=this.getZoom();if(nt===0||Math.abs(Ke/nt-1)<1e-8)return this.zoomTo(Ke,!0),this.panTo(be,ae);Ye=Ye.rotate(-this.getRotation());var it=Ye.getTopLeft().times(Ke).minus(rt.getTopLeft().times(nt)).divide(Ke-nt);return this.zoomTo(Ke,it,ae)},fitBounds:function(Z,ee){return this._fitBounds(Z,{immediately:ee,constraints:!1})},fitBoundsWithConstraints:function(Z,ee){return this._fitBounds(Z,{immediately:ee,constraints:!0})},fitVertically:function(Z){var ee=new ie.Rect(this._contentBounds.x+this._contentBounds.width/2,this._contentBounds.y,0,this._contentBounds.height);return this.fitBounds(ee,Z)},fitHorizontally:function(Z){var ee=new ie.Rect(this._contentBounds.x,this._contentBounds.y+this._contentBounds.height/2,this._contentBounds.width,0);return this.fitBounds(ee,Z)},getConstrainedBounds:function(Z){var ee,ae;return ee=this.getBounds(Z),ae=this._applyBoundaryConstraints(ee),ae},panBy:function(Z,ee){var ae=new ie.Point(this.centerSpringX.target.value,this.centerSpringY.target.value);return this.panTo(ae.plus(Z),ee)},panTo:function(Z,ee){return ee?(this.centerSpringX.resetTo(Z.x),this.centerSpringY.resetTo(Z.y)):(this.centerSpringX.springTo(Z.x),this.centerSpringY.springTo(Z.y)),this.viewer&&this.viewer.raiseEvent("pan",{center:Z,immediately:ee}),this},zoomBy:function(Z,ee,ae){return this.zoomTo(this.zoomSpring.target.value*Z,ee,ae)},zoomTo:function(Z,ee,ae){var ye=this;return this.zoomPoint=ee instanceof ie.Point&&!isNaN(ee.x)&&!isNaN(ee.y)?ee:null,ae?this._adjustCenterSpringsForZoomPoint(function(){ye.zoomSpring.resetTo(Z)}):this.zoomSpring.springTo(Z),this.viewer&&this.viewer.raiseEvent("zoom",{zoom:Z,refPoint:ee,immediately:ae}),this},setRotation:function(Z){return!this.viewer||!this.viewer.drawer.canRotate()?this:(this.degrees=ie.positiveModulo(Z,360),this._setContentBounds(this.viewer.world.getHomeBounds(),this.viewer.world.getContentFactor()),this.viewer.forceRedraw(),this.viewer.raiseEvent("rotate",{degrees:Z}),this)},getRotation:function(){return this.degrees},resize:function(Z,ee){var ae=this.getBoundsNoRotate(),ye=ae,ve;return this.containerSize.x=Z.x,this.containerSize.y=Z.y,this._updateContainerInnerSize(),ee&&(ve=Z.x/this.containerSize.x,ye.width=ae.width*ve,ye.height=ye.width/this.getAspectRatio()),this.viewer&&this.viewer.raiseEvent("resize",{newContainerSize:Z,maintain:ee}),this.fitBounds(ye,!0)},_updateContainerInnerSize:function(){this._containerInnerSize=new ie.Point(Math.max(1,this.containerSize.x-(this._margins.left+this._margins.right)),Math.max(1,this.containerSize.y-(this._margins.top+this._margins.bottom)))},update:function(){var Z=this;this._adjustCenterSpringsForZoomPoint(function(){Z.zoomSpring.update()}),this.centerSpringX.update(),this.centerSpringY.update();var ee=this.centerSpringX.current.value!==this._oldCenterX||this.centerSpringY.current.value!==this._oldCenterY||this.zoomSpring.current.value!==this._oldZoom;return this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,ee},_adjustCenterSpringsForZoomPoint:function(Z){if(this.zoomPoint){var ee=this.pixelFromPoint(this.zoomPoint,!0);Z();var ae=this.pixelFromPoint(this.zoomPoint,!0),ye=ae.minus(ee),ve=this.deltaPointsFromPixels(ye,!0);this.centerSpringX.shiftBy(ve.x),this.centerSpringY.shiftBy(ve.y),this.zoomSpring.isAtTargetValue()&&(this.zoomPoint=null)}else Z()},deltaPixelsFromPointsNoRotate:function(Z,ee){return Z.times(this._containerInnerSize.x*this.getZoom(ee))},deltaPixelsFromPoints:function(Z,ee){return this.deltaPixelsFromPointsNoRotate(Z.rotate(this.getRotation()),ee)},deltaPointsFromPixelsNoRotate:function(Z,ee){return Z.divide(this._containerInnerSize.x*this.getZoom(ee))},deltaPointsFromPixels:function(Z,ee){return this.deltaPointsFromPixelsNoRotate(Z,ee).rotate(-this.getRotation())},pixelFromPointNoRotate:function(Z,ee){return this._pixelFromPointNoRotate(Z,this.getBoundsNoRotate(ee))},pixelFromPoint:function(Z,ee){return this._pixelFromPoint(Z,this.getBoundsNoRotate(ee))},_pixelFromPointNoRotate:function(Z,ee){return Z.minus(ee.getTopLeft()).times(this._containerInnerSize.x/ee.width).plus(new ie.Point(this._margins.left,this._margins.top))},_pixelFromPoint:function(Z,ee){return this._pixelFromPointNoRotate(Z.rotate(this.getRotation(),this.getCenter(!0)),ee)},pointFromPixelNoRotate:function(Z,ee){var ae=this.getBoundsNoRotate(ee);return Z.minus(new ie.Point(this._margins.left,this._margins.top)).divide(this._containerInnerSize.x/ae.width).plus(ae.getTopLeft())},pointFromPixel:function(Z,ee){return this.pointFromPixelNoRotate(Z,ee).rotate(-this.getRotation(),this.getCenter(!0))},_viewportToImageDelta:function(Z,ee){var ae=this._contentBoundsNoRotate.width;return new ie.Point(Z*this._contentSizeNoRotate.x/ae,ee*this._contentSizeNoRotate.x/ae)},viewportToImageCoordinates:function(Z,ee){if(Z instanceof ie.Point)return this.viewportToImageCoordinates(Z.x,Z.y);if(this.viewer){var ae=this.viewer.world.getItemCount();if(ae>1)ie.console.error("[Viewport.viewportToImageCoordinates] is not accurate with multi-image; use TiledImage.viewportToImageCoordinates instead.");else if(ae===1){var ye=this.viewer.world.getItemAt(0);return ye.viewportToImageCoordinates(Z,ee,!0)}}return this._viewportToImageDelta(Z-this._contentBoundsNoRotate.x,ee-this._contentBoundsNoRotate.y)},_imageToViewportDelta:function(Z,ee){var ae=this._contentBoundsNoRotate.width;return new ie.Point(Z/this._contentSizeNoRotate.x*ae,ee/this._contentSizeNoRotate.x*ae)},imageToViewportCoordinates:function(Z,ee){if(Z instanceof ie.Point)return this.imageToViewportCoordinates(Z.x,Z.y);if(this.viewer){var ae=this.viewer.world.getItemCount();if(ae>1)ie.console.error("[Viewport.imageToViewportCoordinates] is not accurate with multi-image; use TiledImage.imageToViewportCoordinates instead.");else if(ae===1){var ye=this.viewer.world.getItemAt(0);return ye.imageToViewportCoordinates(Z,ee,!0)}}var ve=this._imageToViewportDelta(Z,ee);return ve.x+=this._contentBoundsNoRotate.x,ve.y+=this._contentBoundsNoRotate.y,ve},imageToViewportRectangle:function(Z,ee,ae,ye){var ve=Z;if(ve instanceof ie.Rect||(ve=new ie.Rect(Z,ee,ae,ye)),this.viewer){var be=this.viewer.world.getItemCount();if(be>1)ie.console.error("[Viewport.imageToViewportRectangle] is not accurate with multi-image; use TiledImage.imageToViewportRectangle instead.");else if(be===1){var Ye=this.viewer.world.getItemAt(0);return Ye.imageToViewportRectangle(Z,ee,ae,ye,!0)}}var Ke=this.imageToViewportCoordinates(ve.x,ve.y),Xe=this._imageToViewportDelta(ve.width,ve.height);return new ie.Rect(Ke.x,Ke.y,Xe.x,Xe.y,ve.degrees)},viewportToImageRectangle:function(Z,ee,ae,ye){var ve=Z;if(ve instanceof ie.Rect||(ve=new ie.Rect(Z,ee,ae,ye)),this.viewer){var be=this.viewer.world.getItemCount();if(be>1)ie.console.error("[Viewport.viewportToImageRectangle] is not accurate with multi-image; use TiledImage.viewportToImageRectangle instead.");else if(be===1){var Ye=this.viewer.world.getItemAt(0);return Ye.viewportToImageRectangle(Z,ee,ae,ye,!0)}}var Ke=this.viewportToImageCoordinates(ve.x,ve.y),Xe=this._viewportToImageDelta(ve.width,ve.height);return new ie.Rect(Ke.x,Ke.y,Xe.x,Xe.y,ve.degrees)},viewerElementToImageCoordinates:function(Z){var ee=this.pointFromPixel(Z,!0);return this.viewportToImageCoordinates(ee)},imageToViewerElementCoordinates:function(Z){var ee=this.imageToViewportCoordinates(Z);return this.pixelFromPoint(ee,!0)},windowToImageCoordinates:function(Z){ie.console.assert(this.viewer,"[Viewport.windowToImageCoordinates] the viewport must have a viewer.");var ee=Z.minus(ie.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(ee)},imageToWindowCoordinates:function(Z){ie.console.assert(this.viewer,"[Viewport.imageToWindowCoordinates] the viewport must have a viewer.");var ee=this.imageToViewerElementCoordinates(Z);return ee.plus(ie.getElementPosition(this.viewer.element))},viewerElementToViewportCoordinates:function(Z){return this.pointFromPixel(Z,!0)},viewportToViewerElementCoordinates:function(Z){return this.pixelFromPoint(Z,!0)},viewerElementToViewportRectangle:function(Z){return ie.Rect.fromSummits(this.pointFromPixel(Z.getTopLeft(),!0),this.pointFromPixel(Z.getTopRight(),!0),this.pointFromPixel(Z.getBottomLeft(),!0))},viewportToViewerElementRectangle:function(Z){return ie.Rect.fromSummits(this.pixelFromPoint(Z.getTopLeft(),!0),this.pixelFromPoint(Z.getTopRight(),!0),this.pixelFromPoint(Z.getBottomLeft(),!0))},windowToViewportCoordinates:function(Z){ie.console.assert(this.viewer,"[Viewport.windowToViewportCoordinates] the viewport must have a viewer.");var ee=Z.minus(ie.getElementPosition(this.viewer.element));return this.viewerElementToViewportCoordinates(ee)},viewportToWindowCoordinates:function(Z){ie.console.assert(this.viewer,"[Viewport.viewportToWindowCoordinates] the viewport must have a viewer.");var ee=this.viewportToViewerElementCoordinates(Z);return ee.plus(ie.getElementPosition(this.viewer.element))},viewportToImageZoom:function(Z){if(this.viewer){var ee=this.viewer.world.getItemCount();if(ee>1)ie.console.error("[Viewport.viewportToImageZoom] is not accurate with multi-image.");else if(ee===1){var ae=this.viewer.world.getItemAt(0);return ae.viewportToImageZoom(Z)}}var ye=this._contentSizeNoRotate.x,ve=this._containerInnerSize.x,be=this._contentBoundsNoRotate.width,Ye=ve/ye*be;return Z*Ye},imageToViewportZoom:function(Z){if(this.viewer){var ee=this.viewer.world.getItemCount();if(ee>1)ie.console.error("[Viewport.imageToViewportZoom] is not accurate with multi-image.");else if(ee===1){var ae=this.viewer.world.getItemAt(0);return ae.imageToViewportZoom(Z)}}var ye=this._contentSizeNoRotate.x,ve=this._containerInnerSize.x,be=this._contentBoundsNoRotate.width,Ye=ye/ve/be;return Z*Ye},toggleFlip:function(){return this.setFlip(!this.getFlip()),this},getFlip:function(){return this.flipped},setFlip:function(Z){return this.flipped===Z?this:(this.flipped=Z,this.viewer.navigator&&this.viewer.navigator.setFlip(this.getFlip()),this.viewer.forceRedraw(),this.viewer.raiseEvent("flip",{flipped:Z}),this)}}}(OpenSeadragon),function(ie){ie.TiledImage=function(ot){var dt=this;ie.console.assert(ot.tileCache,"[TiledImage] options.tileCache is required"),ie.console.assert(ot.drawer,"[TiledImage] options.drawer is required"),ie.console.assert(ot.viewer,"[TiledImage] options.viewer is required"),ie.console.assert(ot.imageLoader,"[TiledImage] options.imageLoader is required"),ie.console.assert(ot.source,"[TiledImage] options.source is required"),ie.console.assert(!ot.clip||ot.clip instanceof ie.Rect,"[TiledImage] options.clip must be an OpenSeadragon.Rect if present"),ie.EventSource.call(this),this._tileCache=ot.tileCache,delete ot.tileCache,this._drawer=ot.drawer,delete ot.drawer,this._imageLoader=ot.imageLoader,delete ot.imageLoader,ot.clip instanceof ie.Rect&&(this._clip=ot.clip.clone()),delete ot.clip;var ft=ot.x||0;delete ot.x;var gt=ot.y||0;delete ot.y,this.normHeight=ot.source.dimensions.y/ot.source.dimensions.x,this.contentAspectX=ot.source.dimensions.x/ot.source.dimensions.y;var mt=1;ot.width?(mt=ot.width,delete ot.width,ot.height&&(ie.console.error("specifying both width and height to a tiledImage is not supported"),delete ot.height)):ot.height&&(mt=ot.height/this.normHeight,delete ot.height);var Yr=ot.fitBounds;delete ot.fitBounds;var Qr=ot.fitBoundsPlacement||OpenSeadragon.Placement.CENTER;delete ot.fitBoundsPlacement;var Xr=ot.degrees||0;delete ot.degrees,ie.extend(!0,this,{viewer:null,tilesMatrix:{},coverage:{},loadingCoverage:{},lastDrawn:[],lastResetTime:0,_midDraw:!1,_needsDraw:!0,_hasOpaqueTile:!1,_tilesLoading:0,springStiffness:ie.DEFAULT_SETTINGS.springStiffness,animationTime:ie.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:ie.DEFAULT_SETTINGS.minZoomImageRatio,wrapHorizontal:ie.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:ie.DEFAULT_SETTINGS.wrapVertical,immediateRender:ie.DEFAULT_SETTINGS.immediateRender,blendTime:ie.DEFAULT_SETTINGS.blendTime,alwaysBlend:ie.DEFAULT_SETTINGS.alwaysBlend,minPixelRatio:ie.DEFAULT_SETTINGS.minPixelRatio,smoothTileEdgesMinZoom:ie.DEFAULT_SETTINGS.smoothTileEdgesMinZoom,iOSDevice:ie.DEFAULT_SETTINGS.iOSDevice,debugMode:ie.DEFAULT_SETTINGS.debugMode,crossOriginPolicy:ie.DEFAULT_SETTINGS.crossOriginPolicy,ajaxWithCredentials:ie.DEFAULT_SETTINGS.ajaxWithCredentials,placeholderFillStyle:ie.DEFAULT_SETTINGS.placeholderFillStyle,opacity:ie.DEFAULT_SETTINGS.opacity,preload:ie.DEFAULT_SETTINGS.preload,compositeOperation:ie.DEFAULT_SETTINGS.compositeOperation},ot),this._preload=this.preload,delete this.preload,this._fullyLoaded=!1,this._xSpring=new ie.Spring({initial:ft,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._ySpring=new ie.Spring({initial:gt,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._scaleSpring=new ie.Spring({initial:mt,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._degreesSpring=new ie.Spring({initial:Xr,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._updateForScale(),Yr&&this.fitBounds(Yr,Qr,!0),this._drawingHandler=function(Jr){dt.viewer.raiseEvent("tile-drawing",ie.extend({tiledImage:dt},Jr))}},ie.extend(ie.TiledImage.prototype,ie.EventSource.prototype,{needsDraw:function(){return this._needsDraw},getFullyLoaded:function(){return this._fullyLoaded},_setFullyLoaded:function(ot){ot!==this._fullyLoaded&&(this._fullyLoaded=ot,this.raiseEvent("fully-loaded-change",{fullyLoaded:this._fullyLoaded}))},reset:function(){this._tileCache.clearTilesFor(this),this.lastResetTime=ie.now(),this._needsDraw=!0},update:function(){var ot=this._xSpring.update(),dt=this._ySpring.update(),ft=this._scaleSpring.update(),gt=this._degreesSpring.update();return ot||dt||ft||gt?(this._updateForScale(),this._needsDraw=!0,!0):!1},draw:function(){this.opacity!==0||this._preload?(this._midDraw=!0,this._updateViewport(),this._midDraw=!1):this._needsDraw=!1},destroy:function(){this.reset()},getBounds:function(ot){return this.getBoundsNoRotate(ot).rotate(this.getRotation(ot),this._getRotationPoint(ot))},getBoundsNoRotate:function(ot){return ot?new ie.Rect(this._xSpring.current.value,this._ySpring.current.value,this._worldWidthCurrent,this._worldHeightCurrent):new ie.Rect(this._xSpring.target.value,this._ySpring.target.value,this._worldWidthTarget,this._worldHeightTarget)},getWorldBounds:function(){return ie.console.error("[TiledImage.getWorldBounds] is deprecated; use TiledImage.getBounds instead"),this.getBounds()},getClippedBounds:function(ot){var dt=this.getBoundsNoRotate(ot);if(this._clip){var ft=ot?this._worldWidthCurrent:this._worldWidthTarget,gt=ft/this.source.dimensions.x,mt=this._clip.times(gt);dt=new ie.Rect(dt.x+mt.x,dt.y+mt.y,mt.width,mt.height)}return dt.rotate(this.getRotation(ot),this._getRotationPoint(ot))},getContentSize:function(){return new ie.Point(this.source.dimensions.x,this.source.dimensions.y)},_viewportToImageDelta:function(ot,dt,ft){var gt=ft?this._scaleSpring.current.value:this._scaleSpring.target.value;return new ie.Point(ot*(this.source.dimensions.x/gt),dt*(this.source.dimensions.y*this.contentAspectX/gt))},viewportToImageCoordinates:function(ot,dt,ft){var gt;return ot instanceof ie.Point?(ft=dt,gt=ot):gt=new ie.Point(ot,dt),gt=gt.rotate(-this.getRotation(ft),this._getRotationPoint(ft)),ft?this._viewportToImageDelta(gt.x-this._xSpring.current.value,gt.y-this._ySpring.current.value):this._viewportToImageDelta(gt.x-this._xSpring.target.value,gt.y-this._ySpring.target.value)},_imageToViewportDelta:function(ot,dt,ft){var gt=ft?this._scaleSpring.current.value:this._scaleSpring.target.value;return new ie.Point(ot/this.source.dimensions.x*gt,dt/this.source.dimensions.y/this.contentAspectX*gt)},imageToViewportCoordinates:function(ot,dt,ft){ot instanceof ie.Point&&(ft=dt,dt=ot.y,ot=ot.x);var gt=this._imageToViewportDelta(ot,dt);return ft?(gt.x+=this._xSpring.current.value,gt.y+=this._ySpring.current.value):(gt.x+=this._xSpring.target.value,gt.y+=this._ySpring.target.value),gt.rotate(this.getRotation(ft),this._getRotationPoint(ft))},imageToViewportRectangle:function(ot,dt,ft,gt,mt){var Yr=ot;Yr instanceof ie.Rect?mt=dt:Yr=new ie.Rect(ot,dt,ft,gt);var Qr=this.imageToViewportCoordinates(Yr.getTopLeft(),mt),Xr=this._imageToViewportDelta(Yr.width,Yr.height,mt);return new ie.Rect(Qr.x,Qr.y,Xr.x,Xr.y,Yr.degrees+this.getRotation(mt))},viewportToImageRectangle:function(ot,dt,ft,gt,mt){var Yr=ot;ot instanceof ie.Rect?mt=dt:Yr=new ie.Rect(ot,dt,ft,gt);var Qr=this.viewportToImageCoordinates(Yr.getTopLeft(),mt),Xr=this._viewportToImageDelta(Yr.width,Yr.height,mt);return new ie.Rect(Qr.x,Qr.y,Xr.x,Xr.y,Yr.degrees-this.getRotation(mt))},viewerElementToImageCoordinates:function(ot){var dt=this.viewport.pointFromPixel(ot,!0);return this.viewportToImageCoordinates(dt)},imageToViewerElementCoordinates:function(ot){var dt=this.imageToViewportCoordinates(ot);return this.viewport.pixelFromPoint(dt,!0)},windowToImageCoordinates:function(ot){var dt=ot.minus(OpenSeadragon.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(dt)},imageToWindowCoordinates:function(ot){var dt=this.imageToViewerElementCoordinates(ot);return dt.plus(OpenSeadragon.getElementPosition(this.viewer.element))},_viewportToTiledImageRectangle:function(ot){var dt=this._scaleSpring.current.value;return ot=ot.rotate(-this.getRotation(!0),this._getRotationPoint(!0)),new ie.Rect((ot.x-this._xSpring.current.value)/dt,(ot.y-this._ySpring.current.value)/dt,ot.width/dt,ot.height/dt,ot.degrees)},viewportToImageZoom:function(ot){var dt=this._scaleSpring.current.value*this.viewport._containerInnerSize.x/this.source.dimensions.x;return dt*ot},imageToViewportZoom:function(ot){var dt=this._scaleSpring.current.value*this.viewport._containerInnerSize.x/this.source.dimensions.x;return ot/dt},setPosition:function(ot,dt){var ft=this._xSpring.target.value===ot.x&&this._ySpring.target.value===ot.y;if(dt){if(ft&&this._xSpring.current.value===ot.x&&this._ySpring.current.value===ot.y)return;this._xSpring.resetTo(ot.x),this._ySpring.resetTo(ot.y),this._needsDraw=!0}else{if(ft)return;this._xSpring.springTo(ot.x),this._ySpring.springTo(ot.y),this._needsDraw=!0}ft||this._raiseBoundsChange()},setWidth:function(ot,dt){this._setScale(ot,dt)},setHeight:function(ot,dt){this._setScale(ot/this.normHeight,dt)},setCroppingPolygons:function(ot){var dt=function(gt){return gt instanceof ie.Point||typeof gt.x=="number"&&typeof gt.y=="number"},ft=function(gt){return gt.map(function(mt){try{if(dt(mt))return{x:mt.x,y:mt.y};throw new Error}catch{throw new Error("A Provided cropping polygon point is not supported")}})};try{if(!ie.isArray(ot))throw new Error("Provided cropping polygon is not an array");this._croppingPolygons=ot.map(function(gt){return ft(gt)})}catch(gt){ie.console.error("[TiledImage.setCroppingPolygons] Cropping polygon format not supported"),ie.console.error(gt),this._croppingPolygons=null}},resetCroppingPolygons:function(){this._croppingPolygons=null},fitBounds:function(ot,dt,ft){dt=dt||ie.Placement.CENTER;var gt=ie.Placement.properties[dt],mt=this.contentAspectX,Yr=0,Qr=0,Xr=1,Jr=1;if(this._clip&&(mt=this._clip.getAspectRatio(),Xr=this._clip.width/this.source.dimensions.x,Jr=this._clip.height/this.source.dimensions.y,ot.getAspectRatio()>mt?(Yr=this._clip.x/this._clip.height*ot.height,Qr=this._clip.y/this._clip.height*ot.height):(Yr=this._clip.x/this._clip.width*ot.width,Qr=this._clip.y/this._clip.width*ot.width)),ot.getAspectRatio()>mt){var ai=ot.height/Jr,oi=0;gt.isHorizontallyCentered?oi=(ot.width-ot.height*mt)/2:gt.isRight&&(oi=ot.width-ot.height*mt),this.setPosition(new ie.Point(ot.x-Yr+oi,ot.y-Qr),ft),this.setHeight(ai,ft)}else{var ni=ot.width/Xr,li=0;gt.isVerticallyCentered?li=(ot.height-ot.width/mt)/2:gt.isBottom&&(li=ot.height-ot.width/mt),this.setPosition(new ie.Point(ot.x-Yr,ot.y-Qr+li),ft),this.setWidth(ni,ft)}},getClip:function(){return this._clip?this._clip.clone():null},setClip:function(ot){ie.console.assert(!ot||ot instanceof ie.Rect,"[TiledImage.setClip] newClip must be an OpenSeadragon.Rect or null"),ot instanceof ie.Rect?this._clip=ot.clone():this._clip=null,this._needsDraw=!0,this.raiseEvent("clip-change")},getOpacity:function(){return this.opacity},setOpacity:function(ot){ot!==this.opacity&&(this.opacity=ot,this._needsDraw=!0,this.raiseEvent("opacity-change",{opacity:this.opacity}))},getPreload:function(){return this._preload},setPreload:function(ot){this._preload=!!ot,this._needsDraw=!0},getRotation:function(ot){return ot?this._degreesSpring.current.value:this._degreesSpring.target.value},setRotation:function(ot,dt){this._degreesSpring.target.value===ot&&this._degreesSpring.isAtTargetValue()||(dt?this._degreesSpring.resetTo(ot):this._degreesSpring.springTo(ot),this._needsDraw=!0,this._raiseBoundsChange())},_getRotationPoint:function(ot){return this.getBoundsNoRotate(ot).getCenter()},getCompositeOperation:function(){return this.compositeOperation},setCompositeOperation:function(ot){ot!==this.compositeOperation&&(this.compositeOperation=ot,this._needsDraw=!0,this.raiseEvent("composite-operation-change",{compositeOperation:this.compositeOperation}))},_setScale:function(ot,dt){var ft=this._scaleSpring.target.value===ot;if(dt){if(ft&&this._scaleSpring.current.value===ot)return;this._scaleSpring.resetTo(ot),this._updateForScale(),this._needsDraw=!0}else{if(ft)return;this._scaleSpring.springTo(ot),this._updateForScale(),this._needsDraw=!0}ft||this._raiseBoundsChange()},_updateForScale:function(){this._worldWidthTarget=this._scaleSpring.target.value,this._worldHeightTarget=this.normHeight*this._scaleSpring.target.value,this._worldWidthCurrent=this._scaleSpring.current.value,this._worldHeightCurrent=this.normHeight*this._scaleSpring.current.value},_raiseBoundsChange:function(){this.raiseEvent("bounds-change")},_isBottomItem:function(){return this.viewer.world.getItemAt(0)===this},_getLevelsInterval:function(){var ot=Math.max(this.source.minLevel,Math.floor(Math.log(this.minZoomImageRatio)/Math.log(2))),dt=this.viewport.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(0),!0).x*this._scaleSpring.current.value,ft=Math.min(Math.abs(this.source.maxLevel),Math.abs(Math.floor(Math.log(dt/this.minPixelRatio)/Math.log(2))));return ft=Math.max(ft,this.source.minLevel||0),ot=Math.min(ot,ft),{lowestLevel:ot,highestLevel:ft}},_updateViewport:function(){for(this._needsDraw=!1,this._tilesLoading=0,this.loadingCoverage={};this.lastDrawn.length>0;){var ot=this.lastDrawn.pop();ot.beingDrawn=!1}var dt=this.viewport,ft=this._viewportToTiledImageRectangle(dt.getBoundsWithMargins(!0));if(!this.wrapHorizontal&&!this.wrapVertical){var gt=this._viewportToTiledImageRectangle(this.getClippedBounds(!0));if(ft=ft.intersection(gt),ft===null)return}for(var mt=this._getLevelsInterval(),Yr=mt.lowestLevel,Qr=mt.highestLevel,Xr=null,Jr=!1,ai=ie.now(),oi=Qr;oi>=Yr;oi--){var ni=!1,li=dt.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(oi),!0).x*this._scaleSpring.current.value;if(oi===Yr||!Jr&&li>=this.minPixelRatio)ni=!0,Jr=!0;else if(!Jr)continue;var ui=dt.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(oi),!1).x*this._scaleSpring.current.value,mi=dt.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(Math.max(this.source.getClosestLevel(),0)),!1).x*this._scaleSpring.current.value,ii=this.immediateRender?1:mi,hi=Math.min(1,(li-.5)/.5),ri=ii/Math.abs(ii-ui);if(Xr=Z(this,Jr,ni,oi,hi,ri,ft,ai,Xr),Xe(this.coverage,oi))break}lt(this,this.lastDrawn),Xr&&!Xr.context2D?(ye(this,Xr,ai),this._needsDraw=!0,this._setFullyLoaded(!1)):this._setFullyLoaded(this._tilesLoading===0)},_getCornerTiles:function(ot,dt,ft){var gt,mt;this.wrapHorizontal?(gt=ie.positiveModulo(dt.x,1),mt=ie.positiveModulo(ft.x,1)):(gt=Math.max(0,dt.x),mt=Math.min(1,ft.x));var Yr,Qr,Xr=1/this.source.aspectRatio;this.wrapVertical?(Yr=ie.positiveModulo(dt.y,Xr),Qr=ie.positiveModulo(ft.y,Xr)):(Yr=Math.max(0,dt.y),Qr=Math.min(Xr,ft.y));var Jr=this.source.getTileAtPoint(ot,new ie.Point(gt,Yr)),ai=this.source.getTileAtPoint(ot,new ie.Point(mt,Qr)),oi=this.source.getNumTiles(ot);return this.wrapHorizontal&&(Jr.x+=oi.x*Math.floor(dt.x),ai.x+=oi.x*Math.floor(ft.x)),this.wrapVertical&&(Jr.y+=oi.y*Math.floor(dt.y/Xr),ai.y+=oi.y*Math.floor(ft.y/Xr)),{topLeft:Jr,bottomRight:ai}}});function Z(ot,dt,ft,gt,mt,Yr,Qr,Xr,Jr){var ai=Qr.getBoundingBox().getTopLeft(),oi=Qr.getBoundingBox().getBottomRight();ot.viewer&&ot.viewer.raiseEvent("update-level",{tiledImage:ot,havedrawn:dt,level:gt,opacity:mt,visibility:Yr,drawArea:Qr,topleft:ai,bottomright:oi,currenttime:Xr,best:Jr}),nt(ot.coverage,gt),nt(ot.loadingCoverage,gt);for(var ni=ot._getCornerTiles(gt,ai,oi),li=ni.topLeft,ui=ni.bottomRight,mi=ot.source.getNumTiles(gt),ii=ot.viewport.pixelFromPoint(ot.viewport.getCenter()),hi=li.x;hi<=ui.x;hi++)for(var ri=li.y;ri<=ui.y;ri++){if(!ot.wrapHorizontal&&!ot.wrapVertical){var ci=ot.source.getTileBounds(gt,hi,ri);if(Qr.intersection(ci)===null)continue}Jr=ee(ot,ft,dt,hi,ri,gt,mt,Yr,ii,mi,Xr,Jr)}return Jr}function ee(ot,dt,ft,gt,mt,Yr,Qr,Xr,Jr,ai,oi,ni){var li=ae(gt,mt,Yr,ot,ot.source,ot.tilesMatrix,oi,ai,ot._worldWidthCurrent,ot._worldHeightCurrent),ui=ft;ot.viewer&&ot.viewer.raiseEvent("update-tile",{tiledImage:ot,tile:li}),rt(ot.coverage,Yr,gt,mt,!1);var mi=li.loaded||li.loading||Je(ot.loadingCoverage,Yr,gt,mt);if(rt(ot.loadingCoverage,Yr,gt,mt,mi),!li.exists||(dt&&!ui&&(Je(ot.coverage,Yr,gt,mt)?rt(ot.coverage,Yr,gt,mt,!0):ui=!0),!ui))return ni;if(Ye(li,ot.source.tileOverlap,ot.viewport,Jr,Xr,ot),!li.loaded)if(li.context2D)be(ot,li);else{var ii=ot._tileCache.getImageRecord(li.cacheKey);if(ii){var hi=ii.getImage();be(ot,li,hi)}}if(li.loaded){var ri=Ke(ot,li,gt,mt,Yr,Qr,oi);ri&&(ot._needsDraw=!0)}else li.loading?ot._tilesLoading++:mi||(ni=it(ni,li));return ni}function ae(ot,dt,ft,gt,mt,Yr,Qr,Xr,Jr,ai){var oi,ni,li,ui,mi,ii,hi,ri,ci;return Yr[ft]||(Yr[ft]={}),Yr[ft][ot]||(Yr[ft][ot]={}),Yr[ft][ot][dt]||(oi=(Xr.x+ot%Xr.x)%Xr.x,ni=(Xr.y+dt%Xr.y)%Xr.y,li=mt.getTileBounds(ft,oi,ni),ui=mt.getTileBounds(ft,oi,ni,!0),mi=mt.tileExists(ft,oi,ni),ii=mt.getTileUrl(ft,oi,ni),gt.loadTilesWithAjax?(hi=mt.getTileAjaxHeaders(ft,oi,ni),ie.isPlainObject(gt.ajaxHeaders)&&(hi=ie.extend({},gt.ajaxHeaders,hi))):hi=null,ri=mt.getContext2D?mt.getContext2D(ft,oi,ni):void 0,li.x+=(ot-oi)/Xr.x,li.y+=ai/Jr*((dt-ni)/Xr.y),ci=new ie.Tile(ft,ot,dt,li,mi,ii,ri,gt.loadTilesWithAjax,hi,ui),oi===Xr.x-1&&(ci.isRightMost=!0),ni===Xr.y-1&&(ci.isBottomMost=!0),Yr[ft][ot][dt]=ci),ci=Yr[ft][ot][dt],ci.lastTouchTime=Qr,ci}function ye(ot,dt,ft){dt.loading=!0,ot._imageLoader.addJob({src:dt.url,loadWithAjax:dt.loadWithAjax,ajaxHeaders:dt.ajaxHeaders,crossOriginPolicy:ot.crossOriginPolicy,ajaxWithCredentials:ot.ajaxWithCredentials,callback:function(gt,mt,Yr){ve(ot,dt,ft,gt,mt,Yr)},abort:function(){dt.loading=!1}})}function ve(ot,dt,ft,gt,mt,Yr){if(!gt){ie.console.log("Tile %s failed to load: %s - error: %s",dt,dt.url,mt),ot.viewer.raiseEvent("tile-load-failed",{tile:dt,tiledImage:ot,time:ft,message:mt,tileRequest:Yr}),dt.loading=!1,dt.exists=!1;return}if(ftot.visibility||dt.visibility==ot.visibility&&dt.squaredDistance1&&Xr>ot.smoothTileEdgesMinZoom&&!ot.iOSDevice&&ot.getRotation(!0)%360===0&&ie.supportsCanvas&&(gt=!0,mt=ft.getScaleForEdgeSmoothing(),Yr=ft.getTranslationForEdgeSmoothing(mt,ot._drawer.getCanvasSize(!1),ot._drawer.getCanvasSize(!0)));var Jr;gt&&(mt||(Jr=ot.viewport.viewportToViewerElementRectangle(ot.getClippedBounds(!0)).getIntegerBoundingBox(),ot._drawer.viewer.viewport.getFlip()&&(ot.viewport.degrees!==0||ot.getRotation(!0)%360!==0)&&(Jr.x=ot._drawer.viewer.container.clientWidth-(Jr.x+Jr.width)),Jr=Jr.times(ie.pixelDensityRatio)),ot._drawer._clear(!0,Jr)),mt||(ot.viewport.degrees!==0&&ot._drawer._offsetForRotation({degrees:ot.viewport.degrees,useSketch:gt}),ot.getRotation(!0)%360!==0&&ot._drawer._offsetForRotation({degrees:ot.getRotation(!0),point:ot.viewport.pixelFromPointNoRotate(ot._getRotationPoint(!0),!0),useSketch:gt}),ot.viewport.degrees===0&&ot.getRotation(!0)%360===0&&ot._drawer.viewer.viewport.getFlip()&&ot._drawer._flip());var ai=!1;if(ot._clip){ot._drawer.saveContext(gt);var oi=ot.imageToViewportRectangle(ot._clip,!0);oi=oi.rotate(-ot.getRotation(!0),ot._getRotationPoint(!0));var ni=ot._drawer.viewportToDrawerRectangle(oi);mt&&(ni=ni.times(mt)),Yr&&(ni=ni.translate(Yr)),ot._drawer.setClip(ni,gt),ai=!0}if(ot._croppingPolygons){ot._drawer.saveContext(gt);try{var li=ot._croppingPolygons.map(function(hi){return hi.map(function(ri){var ci=ot.imageToViewportCoordinates(ri.x,ri.y,!0).rotate(-ot.getRotation(!0),ot._getRotationPoint(!0)),Si=ot._drawer.viewportCoordToDrawerCoord(ci);return mt&&(Si=Si.times(mt)),Si})});ot._drawer.clipWithPolygons(li,gt)}catch(hi){ie.console.error(hi)}ai=!0}if(ot.placeholderFillStyle&&ot._hasOpaqueTile===!1){var ui=ot._drawer.viewportToDrawerRectangle(ot.getBounds(!0));mt&&(ui=ui.times(mt)),Yr&&(ui=ui.translate(Yr));var mi=null;typeof ot.placeholderFillStyle=="function"?mi=ot.placeholderFillStyle(ot,ot._drawer.context):mi=ot.placeholderFillStyle,ot._drawer.drawRectangle(ui,mi,gt)}for(var ii=dt.length-1;ii>=0;ii--)ft=dt[ii],ot._drawer.drawTile(ft,ot._drawingHandler,gt,mt,Yr),ft.beingDrawn=!0,ot.viewer&&ot.viewer.raiseEvent("tile-drawn",{tiledImage:ot,tile:ft});ai&&ot._drawer.restoreContext(gt),mt||(ot.getRotation(!0)%360!==0&&ot._drawer._restoreRotationChanges(gt),ot.viewport.degrees!==0&&ot._drawer._restoreRotationChanges(gt)),gt&&(mt&&(ot.viewport.degrees!==0&&ot._drawer._offsetForRotation({degrees:ot.viewport.degrees,useSketch:!1}),ot.getRotation(!0)%360!==0&&ot._drawer._offsetForRotation({degrees:ot.getRotation(!0),point:ot.viewport.pixelFromPointNoRotate(ot._getRotationPoint(!0),!0),useSketch:!1})),ot._drawer.blendSketch({opacity:ot.opacity,scale:mt,translate:Yr,compositeOperation:ot.compositeOperation,bounds:Jr}),mt&&(ot.getRotation(!0)%360!==0&&ot._drawer._restoreRotationChanges(!1),ot.viewport.degrees!==0&&ot._drawer._restoreRotationChanges(!1))),mt||ot.viewport.degrees===0&&ot.getRotation(!0)%360===0&&ot._drawer.viewer.viewport.getFlip()&&ot._drawer._flip(),ct(ot,dt)}}function ct(ot,dt){if(ot.debugMode)for(var ft=dt.length-1;ft>=0;ft--){var gt=dt[ft];try{ot._drawer.drawDebugInfo(gt,dt.length,ft,ot)}catch(mt){ie.console.error(mt)}}}}(OpenSeadragon),function(ie){var Z=function(ae){ie.console.assert(ae,"[TileCache.cacheTile] options is required"),ie.console.assert(ae.tile,"[TileCache.cacheTile] options.tile is required"),ie.console.assert(ae.tiledImage,"[TileCache.cacheTile] options.tiledImage is required"),this.tile=ae.tile,this.tiledImage=ae.tiledImage},ee=function(ae){ie.console.assert(ae,"[ImageRecord] options is required"),ie.console.assert(ae.image,"[ImageRecord] options.image is required"),this._image=ae.image,this._tiles=[]};ee.prototype={destroy:function(){this._image=null,this._renderedContext=null,this._tiles=null},getImage:function(){return this._image},getRenderedContext:function(){if(!this._renderedContext){var ae=document.createElement("canvas");ae.width=this._image.width,ae.height=this._image.height,this._renderedContext=ae.getContext("2d"),this._renderedContext.drawImage(this._image,0,0),this._image=null}return this._renderedContext},setRenderedContext:function(ae){ie.console.error("ImageRecord.setRenderedContext is deprecated. The rendered context should be created by the ImageRecord itself when calling ImageRecord.getRenderedContext."),this._renderedContext=ae},addTile:function(ae){ie.console.assert(ae,"[ImageRecord.addTile] tile is required"),this._tiles.push(ae)},removeTile:function(ae){for(var ye=0;yethis._maxImageCacheCount){for(var Ye=null,Ke=-1,Xe=null,Je,rt,nt,it,lt,ct,ot=this._tilesLoaded.length-1;ot>=0;ot--)if(ct=this._tilesLoaded[ot],Je=ct.tile,!(Je.level<=ye||Je.beingDrawn)){if(!Ye){Ye=Je,Ke=ot,Xe=ct;continue}it=Je.lastTouchTime,rt=Ye.lastTouchTime,lt=Je.level,nt=Ye.level,(itnt)&&(Ye=Je,Ke=ot,Xe=ct)}Ye&&Ke>=0&&(this._unloadTile(Xe),ve=Ke)}this._tilesLoaded[ve]=new Z({tile:ae.tile,tiledImage:ae.tiledImage})},clearTilesFor:function(ae){ie.console.assert(ae,"[TileCache.clearTilesFor] tiledImage is required");for(var ye,ve=0;ve=this._items.length)throw new Error("Index bigger than number of layers.");ee===ae||ae===-1||(this._items.splice(ae,1),this._items.splice(ee,0,Z),this._needsDraw=!0,this.raiseEvent("item-index-change",{item:Z,previousIndex:ae,newIndex:ee}))},removeItem:function(Z){ie.console.assert(Z,"[World.removeItem] item is required");var ee=ie.indexOf(this._items,Z);ee!==-1&&(Z.removeHandler("bounds-change",this._delegatedFigureSizes),Z.removeHandler("clip-change",this._delegatedFigureSizes),Z.destroy(),this._items.splice(ee,1),this._figureSizes(),this._needsDraw=!0,this._raiseRemoveItem(Z))},removeAll:function(){this.viewer._cancelPendingImages();var Z,ee;for(ee=0;eeit.height?lt=be:lt=be*(it.width/it.height),ct=lt*(it.height/it.width),ot=new ie.Point(Je+(be-lt)/2,rt+(be-ct)/2),nt.setPosition(ot,ee),nt.setWidth(lt,ee),ae==="horizontal"?Je+=Ke:rt+=Ke;this.setAutoRefigureSizes(!0)},_figureSizes:function(){var Z=this._homeBounds?this._homeBounds.clone():null,ee=this._contentSize?this._contentSize.clone():null,ae=this._contentFactor||0;if(!this._items.length)this._homeBounds=new ie.Rect(0,0,1,1),this._contentSize=new ie.Point(1,1),this._contentFactor=1;else{var ye=this._items[0],ve=ye.getBounds();this._contentFactor=ye.getContentSize().x/ve.width;for(var be=ye.getClippedBounds().getBoundingBox(),Ye=be.x,Ke=be.y,Xe=be.x+be.width,Je=be.y+be.height,rt=1;rt{const{__scopeSwitch:ee,name:ae,checked:ye,defaultChecked:ve,required:be,disabled:Ye,value:Ke="on",onCheckedChange:Xe,...Je}=ie,[rt,nt]=reactExports.useState(null),it=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,ft=>nt(ft)),lt=reactExports.useRef(!1),ct=rt?!!rt.closest("form"):!0,[ot=!1,dt]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:ye,defaultProp:ve,onChange:Xe});return reactExports.createElement($6be4966fd9bbc698$var$SwitchProvider,{scope:ee,checked:ot,disabled:Ye},reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button,_extends$1({type:"button",role:"switch","aria-checked":ot,"aria-required":be,"data-state":$6be4966fd9bbc698$var$getState(ot),"data-disabled":Ye?"":void 0,disabled:Ye,value:Ke},Je,{ref:it,onClick:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onClick,ft=>{dt(gt=>!gt),ct&&(lt.current=ft.isPropagationStopped(),lt.current||ft.stopPropagation())})})),ct&&reactExports.createElement($6be4966fd9bbc698$var$BubbleInput,{control:rt,bubbles:!lt.current,name:ae,value:Ke,checked:ot,required:be,disabled:Ye,style:{transform:"translateX(-100%)"}}))}),$6be4966fd9bbc698$var$THUMB_NAME="SwitchThumb",$6be4966fd9bbc698$export$4d07bf653ea69106=reactExports.forwardRef((ie,Z)=>{const{__scopeSwitch:ee,...ae}=ie,ye=$6be4966fd9bbc698$var$useSwitchContext($6be4966fd9bbc698$var$THUMB_NAME,ee);return reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span,_extends$1({"data-state":$6be4966fd9bbc698$var$getState(ye.checked),"data-disabled":ye.disabled?"":void 0},ae,{ref:Z}))}),$6be4966fd9bbc698$var$BubbleInput=ie=>{const{control:Z,checked:ee,bubbles:ae=!0,...ye}=ie,ve=reactExports.useRef(null),be=$010c2913dbd2fe3d$export$5cae361ad82dce8b(ee),Ye=$db6c3485150b8e66$export$1ab7ae714698c4b8(Z);return reactExports.useEffect(()=>{const Ke=ve.current,Xe=window.HTMLInputElement.prototype,Je=Object.getOwnPropertyDescriptor(Xe,"checked").set;if(be!==ee&&Je){const rt=new Event("click",{bubbles:ae});Je.call(Ke,ee),Ke.dispatchEvent(rt)}},[be,ee,ae]),reactExports.createElement("input",_extends$1({type:"checkbox","aria-hidden":!0,defaultChecked:ee},ye,{tabIndex:-1,ref:ve,style:{...ie.style,...Ye,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function $6be4966fd9bbc698$var$getState(ie){return ie?"checked":"unchecked"}const $6be4966fd9bbc698$export$be92b6f5f03c0fe9=$6be4966fd9bbc698$export$b5d5cf8927ab7262,$6be4966fd9bbc698$export$6521433ed15a34db=$6be4966fd9bbc698$export$4d07bf653ea69106,ht=ie=>{const Z=ie.toString().split(":"),ee=Math.ceil(parseInt(Z[0])),ae=Math.ceil(parseInt(Z[1])),ye=xt(Math.ceil(parseInt(Z[2])),2);let ve=`${ee!==0&&ae<10?(ae+"").padStart(2,"0"):ae}:${ye}`;return ee!==0&&(ve=`${ee}:${ve}`),ve},Ee=ie=>{const Z=new Date(ie*1e3).toISOString().substr(11,8);return ht(Z)},we=(ie,Z)=>{if(typeof ie!="object"||ie===null)return Z;for(const ee in Z)typeof Z[ee]=="object"&&Z[ee]!==null&&!Array.isArray(Z[ee])?(ie[ee]||(ie[ee]={}),ie[ee]=we(ie[ee],Z[ee])):ie[ee]=Z[ee];return ie},Ce=(ie,Z)=>Object.hasOwn(ie,Z)?ie[Z].toString():void 0,xt=(ie,Z)=>String(ie).padStart(Z,"0"),j={background:"transparent",canvasBackgroundColor:"#6662",canvasHeight:"61.8vh",ignoreCaptionLabels:[],informationPanel:{open:!0,renderAbout:!0,renderSupplementing:!0,renderToggle:!0},openSeadragon:{},requestHeaders:{"Content-Type":"application/json"},showIIIFBadge:!0,showTitle:!0,withCredentials:!1};var xe;const _={activeCanvas:"",activeManifest:"",collection:{},configOptions:j,customDisplays:[],informationOpen:(xe=j==null?void 0:j.informationPanel)==null?void 0:xe.open,isLoaded:!1,vault:new Vault},Se=e$1.createContext(_),ke=e$1.createContext(_);function vt(ie,Z){switch(Z.type){case"updateActiveCanvas":return Z.canvasId||(Z.canvasId=""),{...ie,activeCanvas:Z.canvasId};case"updateActiveManifest":return{...ie,activeManifest:Z.manifestId};case"updateCollection":return{...ie,collection:Z.collection};case"updateConfigOptions":return{...ie,configOptions:we(ie.configOptions,Z.configOptions)};case"updateInformationOpen":return{...ie,informationOpen:Z.informationOpen};case"updateIsLoaded":return{...ie,isLoaded:Z.isLoaded};default:throw new Error(`Unhandled action type: ${Z.type}`)}}const bt=({initialState:ie=_,children:Z})=>{const[ee,ae]=reactExports.useReducer(vt,ie);return e$1.createElement(Se.Provider,{value:ee},e$1.createElement(ke.Provider,{value:ae},Z))};function k(){const ie=e$1.useContext(Se);if(ie===void 0)throw new Error("useViewerState must be used within a ViewerProvider");return ie}function O(){const ie=e$1.useContext(ke);if(ie===void 0)throw new Error("useViewerDispatch must be used within a ViewerProvider");return ie}const Ie=(ie,Z,ee,ae)=>{var ye,ve;const be={canvas:void 0,accompanyingCanvas:void 0,annotationPage:void 0,annotations:[]},Ye=Ke=>{if(Ke){if(!Ke.body||!Ke.motivation){console.error("Invalid annotation after Hyperion parsing: missing either 'body' or 'motivation'",Ke);return}let Xe=Ke.body;Array.isArray(Xe)&&(Xe=Xe[0]);const Je=ie.get(Xe.id);if(!Je)return;switch(ee){case"painting":return Ke.target===Z.id&&Ke.motivation&&Ke.motivation[0]==="painting"&&ae.includes(Je.type)&&(Ke.body=Je),!!Ke;case"supplementing":return;default:throw new Error("Invalid annotation motivation.")}}};if(be.canvas=ie.get(Z),be.canvas&&(be.annotationPage=ie.get(be.canvas.items[0]),be.accompanyingCanvas=(ye=be.canvas)!=null&&ye.accompanyingCanvas?ie.get((ve=be.canvas)==null?void 0:ve.accompanyingCanvas):void 0),be.annotationPage){const Ke=ie.get(be.annotationPage.items).map(Je=>({body:ie.get(Je.body[0].id),motivation:Je.motivation,type:"Annotation"})),Xe=[];Ke.forEach(Je=>{Je.body.type==="Choice"?Je.body.items.forEach(rt=>Xe.push({...Je,id:rt.id,body:ie.get(rt.id)})):Xe.push(Je)}),be.annotations=Xe.filter(Ye)}return be},D=(ie,Z="en")=>{if(!ie)return"";if(!ie[Z]){const ee=Object.getOwnPropertyNames(ie);if(ee.length>0)return ie[ee[0]]}return ie[Z]},N=(ie,Z)=>{const ee=Ie(ie,{id:Z,type:"Canvas"},"painting",["Image","Sound","Video"]);if(ee.annotations.length!==0&&ee.annotations&&ee.annotations)return ee.annotations.map(ae=>ae==null?void 0:ae.body)},yt=(ie,Z,ee)=>{const ae=ie.get({id:Z,type:"Canvas"});if(!(ae!=null&&ae.annotations)||!ae.annotations[0])return[];const ye=ie.get(ae.annotations[0]),ve=ie.get(ye.items);return Array.isArray(ve)?ve.filter(be=>{var Ye;if(be.body&&(Ye=be.motivation)!=null&&Ye.includes("supplementing")){let Ke=be.body;Array.isArray(Ke)&&(Ke=Ke[0]);const Xe=ie.get(Ke.id);if(Xe.format===ee)return be.body=Xe,be}}).map(be=>be.body):[]},Et=(ie,Z,ee,ae)=>{const ye=[];if(Z.canvas&&Z.canvas.thumbnail.length>0){const ve=ie.get(Z.canvas.thumbnail[0]);ye.push(ve)}if(Z.annotations[0]){if(Z.annotations[0].thumbnail&&Z.annotations[0].thumbnail.length>0){const be=ie.get(Z.annotations[0].thumbnail[0]);ye.push(be)}if(!Z.annotations[0].body)return;const ve=Z.annotations[0].body;ve.type==="Image"&&ye.push(ve)}return ye.length===0?void 0:{id:ye[0].id,format:ye[0].format,type:ye[0].type,width:ee,height:ae}},X=209,wt={colors:{primary:"#1a1d1e",primaryMuted:"#26292b",primaryAlt:"#151718",accent:`hsl(${X} 100% 38.2%)`,accentMuted:`hsl(${X} 80% 61.8%)`,accentAlt:`hsl(${X} 80% 30%)`,secondary:"#FFFFFF",secondaryMuted:"#e6e8eb",secondaryAlt:"#c1c8cd"},fontSizes:{1:"12px",2:"13px",3:"15px",4:"17px",5:"19px",6:"21px",7:"27px",8:"35px",9:"59px"},lineHeights:{1:"12px",2:"13px",3:"15px",4:"17px",5:"19px",6:"21px",7:"27px",8:"35px",9:"59px"},sizes:{1:"5px",2:"10px",3:"15px",4:"20px",5:"25px",6:"35px",7:"45px",8:"65px",9:"80px"},space:{1:"5px",2:"10px",3:"15px",4:"20px",5:"25px",6:"35px",7:"45px",8:"65px",9:"80px"},radii:{1:"4px",2:"6px",3:"8px",4:"12px",round:"50%",pill:"9999px"},transitions:{all:"all 300ms cubic-bezier(0.16, 1, 0.3, 1)"},zIndices:{1:"100",2:"200",3:"300",4:"400",max:"999"}},te={xxs:"(max-width: 349px)",xs:"(max-width: 575px)",sm:"(max-width: 767px)",md:"(max-width: 991px)",lg:"(max-width: 90rem)",xl:"(min-width: calc(90rem + 1px))"},{styled:m,css:ro,keyframes:ne,createTheme:oo}=q({theme:wt,media:te}),Ct=m("div",{display:"flex",flexDirection:"column",alignItems:"center"}),St=m("p",{fontWeight:"bold",fontSize:"x-large"}),kt=m("span",{fontSize:"medium"}),It=({error:ie})=>{const{message:Z}=ie;return e$1.createElement(Ct,{role:"alert"},e$1.createElement(St,{"data-testid":"headline"},"Something went wrong"),Z&&e$1.createElement(kt,null,`Error message: ${Z}`," "))},$e=m("div",{position:"relative",zIndex:"0"}),Ae=m("div",{display:"flex",flexDirection:"row",overflow:"hidden","@sm":{flexDirection:"column"}}),Te=m("div",{display:"flex",flexDirection:"column",flexGrow:"1",flexShrink:"1",width:"61.8%","@sm":{width:"100%"}}),Me=m($409067139f391064$export$41fb9f06171c75f4,{display:"none",border:"none",padding:"0",transition:"$all",opacity:"1",background:"#6663",margin:"1rem 0",borderRadius:"6px","&[data-information-panel='false']":{opacity:"0",marginTop:"-59px"},"@sm":{display:"flex","> span":{display:"flex",flexGrow:"1",fontSize:"0.8333em",justifyContent:"center",padding:"0.5rem",fontFamily:"inherit"}}}),Re=m($409067139f391064$export$7c6e2c02157bb7d2,{width:"100%",display:"flex"}),$t=m("aside",{display:"flex",flexGrow:"1",flexShrink:"0",width:"38.2%",maxHeight:"100%","@sm":{width:"100%"}}),At=m("div",{display:"flex",flexDirection:"column",fontSmooth:"auto",webkitFontSmoothing:"antialiased","> div":{display:"flex",flexDirection:"column",flexGrow:"1",justifyContent:"flex-start","@sm":{[`& ${Ae}`]:{flexGrow:"1"},[`& ${Te}`]:{flexGrow:"0"}}},"@sm":{padding:"0"},"&[data-information-panel-open='true']":{"@sm":{position:"fixed",height:"100%",width:"100%",top:"0",left:"0",zIndex:"2500000000",[`& ${$e}`]:{display:"none"},[`& ${Me}`]:{margin:"1rem"},[`& ${Re}`]:{height:"100%"}}}}),Tt=m($69cb30bb0017df05$export$be92b6f5f03c0fe9,{display:"flex",flexDirection:"column",width:"100%",height:"100%",flexGrow:"1",flexShrink:"0",position:"relative",zIndex:"1",maskImage:"linear-gradient(180deg, rgba(0, 0, 0, 1) calc(100% - 2rem), transparent 100%)","@sm":{marginTop:"0.5rem",boxShadow:"none"}}),Mt=m($69cb30bb0017df05$export$54c2e3dc7acea9f5,{display:"flex",flexGrow:"0",margin:"0 1.618rem",borderBottom:"4px solid #6663","@sm":{margin:"0 1rem"}}),se=m($69cb30bb0017df05$export$41fb9f06171c75f4,{display:"flex",position:"relative",padding:"0.5rem 1rem",background:"none",backgroundColor:"transparent",fontFamily:"inherit",border:"none",opacity:"0.7",fontSize:"1rem",marginRight:"1rem",lineHeight:"1rem",whiteSpace:"nowrap",cursor:"pointer",fontWeight:400,transition:"$all","&::after":{width:"0",height:"4px",content:"",position:"absolute",bottom:"-4px",left:"0",transition:"$all"},"&[data-state='active']":{opacity:"1",fontWeight:700,"&::after":{width:"100%",backgroundColor:"$accent"}}}),ce=m($69cb30bb0017df05$export$7c6e2c02157bb7d2,{display:"flex",flexGrow:"1",flexShrink:"0",position:"absolute",top:"0",left:"0","&[data-state='active']":{width:"100%",height:"calc(100% - 2rem)",padding:"1.618rem 0"}}),Rt=m("div",{position:"relative",height:"100%",width:"100%",overflowY:"scroll"}),zt=m("div",{padding:" 0 1.618rem 2rem",display:"flex",flexDirection:"column",overflow:"scroll",position:"absolute",fontWeight:"400",fontSize:"1rem",zIndex:"0",img:{maxWidth:"100px",maxHeight:"100px",objectFit:"contain",color:"transparent",margin:"0 0 1rem",borderRadius:"3px",backgroundColor:"$secondaryMuted"},video:{display:"none"},"a, a:visited":{color:"$accent"},p:{fontSize:"1rem",lineHeight:"1.45em",margin:"0"},dl:{margin:"0",dt:{fontWeight:"700",margin:"1rem 0 0.25rem"},dd:{margin:"0"}},".manifest-property-title":{fontWeight:"700",margin:"1rem 0 0.25rem"},"ul, ol":{padding:"0",margin:"0",li:{fontSize:"1rem",lineHeight:"1.45em",listStyle:"none",margin:"0.25rem 0 0.25rem"}}}),Lt=m("div",{position:"relative",width:"100%",height:"100%",zIndex:"0"}),ze=(ie,Z="none")=>{if(!ie)return null;if(typeof ie=="string")return[ie];if(!ie[Z]){const ee=Object.getOwnPropertyNames(ie);if(ee.length>0)return ie[ee[0]]}return!ie[Z]||!Array.isArray(ie[Z])?null:ie[Z]},R=(ie,Z="none",ee=", ")=>{const ae=ze(ie,Z);return Array.isArray(ae)?ae.join(`${ee}`):ae};function Ft(ie){return{__html:Pt(ie)}}function T(ie,Z){const ee=Object.keys(ie).filter(ye=>Z.includes(ye)?null:ye),ae=new Object;return ee.forEach(ye=>{ae[ye]=ie[ye]}),ae}function Pt(ie){return at(ie,{allowedAttributes:{a:["href"],img:["alt","src","height","width"]},allowedSchemes:["http","https","mailto"],allowedTags:["a","b","br","i","img","p","small","span","sub","sup"]})}const Vt=m("span",{}),L=ie=>{const{as:Z,label:ee}=ie,ae=T(ie,["as","label"]);return e$1.createElement(Vt,{as:Z,...ae},R(ee,ae.lang))},Bt=(ie,Z="200,",ee="full")=>{Array.isArray(ie)&&(ie=ie[0]);const{id:ae,service:ye}=ie;let ve;if(!ye)return ae;if(Array.isArray(ie.service)&&ie.service.length>0&&(ve=ye[0]),ve){if(ve["@id"])return`${ve["@id"]}/${ee}/${Z}/0/default.jpg`;if(ve.id)return`${ve.id}/${ee}/${Z}/0/default.jpg`}},de=m("img",{objectFit:"cover"}),Ht=ie=>{const Z=reactExports.useRef(null),{contentResource:ee,altAsLabel:ae,region:ye="full"}=ie;let ve;ae&&(ve=R(ae));const be=T(ie,["contentResource","altAsLabel"]),{type:Ye,id:Ke,width:Xe=200,height:Je=200,duration:rt}=ee;reactExports.useEffect(()=>{if(!Ke&&!Z.current||["Image"].includes(Ye)||!Ke.includes("m3u8"))return;const lt=new Hls;return Z.current&&(lt.attachMedia(Z.current),lt.on(Hls.Events.MEDIA_ATTACHED,function(){lt.loadSource(Ke)})),lt.on(Hls.Events.ERROR,function(ct,ot){if(ot.fatal)switch(ot.type){case Hls.ErrorTypes.NETWORK_ERROR:console.error(`fatal ${ct} network error encountered, try to recover`),lt.startLoad();break;case Hls.ErrorTypes.MEDIA_ERROR:console.error(`fatal ${ct} media error encountered, try to recover`),lt.recoverMediaError();break;default:lt.destroy();break}}),()=>{lt&&(lt.detachMedia(),lt.destroy())}},[Ke,Ye]);const nt=reactExports.useCallback(()=>{if(!Z.current)return;let lt=0,ct=30;if(rt&&(ct=rt),!Ke.split("#t=")&&rt&&(lt=rt*.1),Ke.split("#t=").pop()){const dt=Ke.split("#t=").pop();dt&&(lt=parseInt(dt.split(",")[0]))}const ot=Z.current;ot.autoplay=!0,ot.currentTime=lt,setTimeout(()=>nt(),ct*1e3)},[rt,Ke]);reactExports.useEffect(()=>nt(),[nt]);const it=Bt(ee,`${Xe},${Je}`,ye);switch(Ye){case"Image":return e$1.createElement(de,{as:"img",alt:ve,css:{width:Xe,height:Je},key:Ke,src:it,...be});case"Video":return e$1.createElement(de,{as:"video",css:{width:Xe,height:Je},disablePictureInPicture:!0,key:Ke,loop:!0,muted:!0,onPause:nt,ref:Z,src:Ke});default:return console.warn(`Resource type: ${Ye} is not valid or not yet supported in Primitives.`),e$1.createElement(e$1.Fragment,null)}},Ot=m("a",{}),Dt=ie=>{const{children:Z,homepage:ee}=ie,ae=T(ie,["children","homepage"]);return e$1.createElement(e$1.Fragment,null,ee&&ee.map(ye=>{const ve=R(ye.label,ae.lang);return e$1.createElement(Ot,{"aria-label":Z?ve:void 0,href:ye.id,key:ye.id,...ae},Z||ve)}))},Wt={delimiter:", "},re=reactExports.createContext(void 0),Le=()=>{const ie=reactExports.useContext(re);if(ie===void 0)throw new Error("usePrimitivesContext must be used with a PrimitivesProvider");return ie},oe=({children:ie,initialState:Z=Wt})=>{const ee=jt(Z,"delimiter");return e$1.createElement(re.Provider,{value:{delimiter:ee}},ie)},jt=(ie,Z)=>Object.hasOwn(ie,Z)?ie[Z].toString():void 0,Nt=m("span",{}),me=ie=>{const{as:Z,markup:ee}=ie,{delimiter:ae}=Le();if(!ee)return e$1.createElement(e$1.Fragment,null);const ye=T(ie,["as","markup"]),ve=Ft(R(ee,ye.lang,ae));return e$1.createElement(Nt,{as:Z,...ye,dangerouslySetInnerHTML:ve})},Fe=ie=>e$1.useContext(re)?e$1.createElement(me,{...ie}):e$1.createElement(oe,null,e$1.createElement(me,{...ie})),Gt=({as:ie="dd",lang:Z,value:ee})=>e$1.createElement(Fe,{markup:ee,as:ie,lang:Z}),qt=m("span",{}),Ut=({as:ie="dd",customValueContent:Z,lang:ee,value:ae})=>{var ye;const{delimiter:ve}=Le(),be=(ye=ze(ae,ee))==null?void 0:ye.map(Ye=>reactExports.cloneElement(Z,{value:Ye}));return e$1.createElement(qt,{as:ie,lang:ee},be==null?void 0:be.map((Ye,Ke)=>[Ke>0&&`${ve}`,e$1.createElement(reactExports.Fragment,{key:Ke},Ye)]))},Pe=ie=>{var Z;const{item:ee,lang:ae,customValueContent:ye}=ie,{label:ve,value:be}=ee,Ye=(Z=R(ve))==null?void 0:Z.replace(" ","-").toLowerCase();return e$1.createElement("div",{role:"group","data-label":Ye},e$1.createElement(L,{as:"dt",label:ve,lang:ae}),ye?e$1.createElement(Ut,{as:"dd",customValueContent:ye,value:be,lang:ae}):e$1.createElement(Gt,{as:"dd",value:be,lang:ae}))};function _t(ie,Z){const ee=Z.filter(ae=>{const{matchingLabel:ye}=ae,ve=Object.keys(ae.matchingLabel)[0],be=R(ye,ve);if(R(ie,ve)===be)return!0}).map(ae=>ae.Content);if(Array.isArray(ee))return ee[0]}const Zt=m("dl",{}),Xt=ie=>{const{as:Z,customValueContent:ee,metadata:ae}=ie;if(!Array.isArray(ae))return e$1.createElement(e$1.Fragment,null);const ye=Ce(ie,"customValueDelimiter"),ve=T(ie,["as","customValueContent","customValueDelimiter","metadata"]);return e$1.createElement(oe,{...typeof ye=="string"?{initialState:{delimiter:ye}}:void 0},ae.length>0&&e$1.createElement(Zt,{as:Z,...ve},ae.map((be,Ye)=>{const Ke=ee?_t(be.label,ee):void 0;return e$1.createElement(Pe,{customValueContent:Ke,item:be,key:Ye,lang:ve==null?void 0:ve.lang})})))};m("li",{});m("ul",{});const Yt=m("dl",{}),Kt=ie=>{const{as:Z,requiredStatement:ee}=ie;if(!ee)return e$1.createElement(e$1.Fragment,null);const ae=Ce(ie,"customValueDelimiter"),ye=T(ie,["as","customValueDelimiter","requiredStatement"]);return e$1.createElement(oe,{...typeof ae=="string"?{initialState:{delimiter:ae}}:void 0},e$1.createElement(Yt,{as:Z,...ye},e$1.createElement(Pe,{item:ee,lang:ye.lang})))},Jt=m("li",{}),Qt=m("ul",{}),en=ie=>{const{as:Z,seeAlso:ee}=ie,ae=T(ie,["as","seeAlso"]);return e$1.createElement(Qt,{as:Z},ee&&ee.map(ye=>{const ve=R(ye.label,ae.lang);return e$1.createElement(Jt,{key:ye.id},e$1.createElement("a",{href:ye.id,...ae},ve||ye.id))}))},tn=ie=>{const{as:Z,summary:ee}=ie,ae=T(ie,["as","customValueDelimiter","summary"]);return e$1.createElement(Fe,{as:Z,markup:ee,...ae})},Ve=ie=>{const{thumbnail:Z,region:ee}=ie,ae=T(ie,["thumbnail"]);return e$1.createElement(e$1.Fragment,null,Z&&Z.map(ye=>e$1.createElement(Ht,{contentResource:ye,key:ye.id,region:ee,...ae})))},nn=({homepage:ie})=>(ie==null?void 0:ie.length)===0?e$1.createElement(e$1.Fragment,null):e$1.createElement(e$1.Fragment,null,e$1.createElement("span",{className:"manifest-property-title"},"Homepage"),e$1.createElement(Dt,{homepage:ie})),rn=({id:ie,htmlLabel:Z,parent:ee="manifest"})=>e$1.createElement(e$1.Fragment,null,e$1.createElement("span",{className:"manifest-property-title"},Z),e$1.createElement("a",{href:ie,target:"_blank",id:`iiif-${ee}-id`},ie)),on=({metadata:ie,parent:Z="manifest"})=>ie?e$1.createElement(e$1.Fragment,null,e$1.createElement(Xt,{metadata:ie,id:`iiif-${Z}-metadata`})):e$1.createElement(e$1.Fragment,null),an=({requiredStatement:ie,parent:Z="manifest"})=>ie?e$1.createElement(e$1.Fragment,null,e$1.createElement(Kt,{requiredStatement:ie,id:`iiif-${Z}-required-statement`})):e$1.createElement(e$1.Fragment,null),ln=({rights:ie})=>ie?e$1.createElement(e$1.Fragment,null,e$1.createElement("span",{className:"manifest-property-title"},"Rights"),e$1.createElement("a",{href:ie,target:"_blank"},ie)):e$1.createElement(e$1.Fragment,null),sn=({seeAlso:ie})=>(ie==null?void 0:ie.length)===0?e$1.createElement(e$1.Fragment,null):e$1.createElement(e$1.Fragment,null,e$1.createElement("span",{className:"manifest-property-title"},"See Also"),e$1.createElement(en,{seeAlso:ie})),cn=({summary:ie,parent:Z="manifest"})=>ie?e$1.createElement(e$1.Fragment,null,e$1.createElement(tn,{summary:ie,as:"p",id:`iiif-${Z}-summary`})):e$1.createElement(e$1.Fragment,null),dn=({label:ie,thumbnail:Z})=>(Z==null?void 0:Z.length)===0?e$1.createElement(e$1.Fragment,null):e$1.createElement(e$1.Fragment,null,e$1.createElement(Ve,{altAsLabel:ie||{none:["resource"]},thumbnail:Z,style:{backgroundColor:"#6663",objectFit:"cover"}})),mn=()=>{const ie=k(),{activeManifest:Z,vault:ee}=ie,[ae,ye]=reactExports.useState(),[ve,be]=reactExports.useState([]),[Ye,Ke]=reactExports.useState([]),[Xe,Je]=reactExports.useState([]);return reactExports.useEffect(()=>{var rt,nt,it;const lt=ee.get(Z);ye(lt),((rt=lt.homepage)==null?void 0:rt.length)>0&&be(ee.get(lt.homepage)),((nt=lt.seeAlso)==null?void 0:nt.length)>0&&Ke(ee.get(lt.seeAlso)),((it=lt.thumbnail)==null?void 0:it.length)>0&&Je(ee.get(lt.thumbnail))},[Z,ee]),ae?e$1.createElement(Lt,null,e$1.createElement(zt,null,e$1.createElement(dn,{thumbnail:Xe,label:ae.label}),e$1.createElement(cn,{summary:ae.summary}),e$1.createElement(on,{metadata:ae.metadata}),e$1.createElement(an,{requiredStatement:ae.requiredStatement}),e$1.createElement(ln,{rights:ae.rights}),e$1.createElement(nn,{homepage:ve}),e$1.createElement(sn,{seeAlso:Ye}),e$1.createElement(rn,{id:ae.id,htmlLabel:"IIIF Manifest"}))):e$1.createElement(e$1.Fragment,null)},un=()=>{function ie(ye){return ye.map(ve=>{const be=ve.identifier||v4();return{...ve,identifier:be}})}function Z(ye){var ve;const be=[],Ye=[],Ke=ie(ye);for(const Xe of Ke){for(;Ye.length>0&&Ye[Ye.length-1].end<=Xe.start;)Ye.pop();Ye.length>0?(Ye[Ye.length-1].children||(Ye[Ye.length-1].children=[]),(ve=Ye[Ye.length-1].children)==null||ve.push(Xe),Ye.push(Xe)):(be.push(Xe),Ye.push(Xe))}return be}function ee(ye,ve=[]){return ve.some(be=>ye.start>=be.start&&ye.end<=be.end)}function ae(ye=[]){return ye.sort((ve,be)=>ve.start-be.start)}return{addIdentifiersToParsedCues:ie,createNestedCues:Z,isChild:ee,orderCuesByTime:ae}},ue=ne({from:{transform:"rotate(360deg)"},to:{transform:"rotate(0deg)"}}),pn=m($f99a8c78507165f7$export$be92b6f5f03c0fe9,{display:"flex",flexDirection:"column",width:"100%"}),Be=m($f99a8c78507165f7$export$6d08773d2e66f8f2,{position:"relative",cursor:"pointer",display:"flex",width:"100%",justifyContent:"space-between",textAlign:"left",margin:"0",padding:"0.5rem 1.618rem",fontFamily:"inherit",lineHeight:"1.25em",fontSize:"1rem",color:"inherit",border:"none",background:"none","@sm":{padding:"0.5rem 1rem",fontSize:"0.8333rem"},"&::before":{content:"",width:"12px",height:"12px",borderRadius:"12px",position:"absolute",backgroundColor:"$primaryMuted",opacity:"0",left:"8px",marginTop:"3px",boxSizing:"content-box","@sm":{content:"unset"}},"&::after":{content:"",width:"4px",height:"6px",position:"absolute",backgroundColor:"$secondary",opacity:"0",clipPath:"polygon(100% 50%, 0 100%, 0 0)",left:"13px",marginTop:"6px",boxSizing:"content-box","@sm":{content:"unset"}},strong:{marginLeft:"1rem"},"&:hover":{color:"$accent","&::before":{backgroundColor:"$accent",opacity:"1"},"&::after":{content:"",width:"4px",height:"6px",position:"absolute",backgroundColor:"$secondary",clipPath:"polygon(100% 50%, 0 100%, 0 0)",opacity:"1"}},"&[aria-checked='true']":{backgroundColor:"#6663","&::before":{content:"",width:"6px",height:"6px",position:"absolute",backgroundColor:"transparent",border:"3px solid $accentMuted",borderRadius:"12px",left:"8px",marginTop:"4px",opacity:"1",animation:"1s linear infinite",animationName:ue,boxSizing:"content-box","@sm":{content:"unset"}},"&::after":{content:"",width:"6px",height:"6px",position:"absolute",backgroundColor:"transparent",border:"3px solid $accent",clipPath:"polygon(100% 0, 100% 100%, 0 0)",borderRadius:"12px",left:"8px",marginTop:"4px",opacity:"1",animation:"1.5s linear infinite",animationName:ue,boxSizing:"content-box","@sm":{content:"unset"}}}}),fn=({label:ie,start:Z,end:ee})=>{const[ae,ye]=reactExports.useState(!1),ve=document.getElementById("clover-iiif-video");reactExports.useEffect(()=>(ve==null||ve.addEventListener("timeupdate",()=>{const{currentTime:Ye}=ve;ye(Z<=Ye&&Yedocument.removeEventListener("timeupdate",()=>{})),[ee,Z,ve]);const be=()=>{ve&&(ve.pause(),ve.currentTime=Z,ve.play())};return e$1.createElement(Be,{"aria-checked":ae,"data-testid":"information-panel-cue",onClick:be,value:ie},ie,e$1.createElement("strong",null,Ee(Z)))},gn=m("ul",{listStyle:"none",paddingLeft:"1rem",position:"relative","&&:first-child":{paddingLeft:"0"},"& li ul":{[`& ${Be}`]:{backgroundColor:"unset","&::before":{content:"none"},"&::after":{content:"none"}}},"&:first-child":{margin:"0 0 1.618rem"}}),He=({items:ie})=>e$1.createElement(gn,null,ie.map(Z=>{const{text:ee,start:ae,end:ye,children:ve,identifier:be}=Z;return e$1.createElement("li",{key:be},e$1.createElement(fn,{label:ee,start:ae,end:ye}),ve&&e$1.createElement(He,{items:ve}))})),hn=({resource:ie})=>{const[Z,ee]=e$1.useState([]),{id:ae,label:ye}=ie,{createNestedCues:ve,orderCuesByTime:be}=un();return reactExports.useEffect(()=>{ae&&fetch(ae,{headers:{"Content-Type":"text/plain",Accept:"application/json"}}).then(Ye=>Ye.text()).then(Ye=>{const Ke=nodeWebvtt.parse(Ye).cues,Xe=be(Ke),Je=ve(Xe);ee(Je)}).catch(Ye=>console.error(ae,Ye.toString()))},[ae]),e$1.createElement(pn,{"aria-label":`navigate ${D(ye,"en")}`},e$1.createElement(He,{items:Z}))},xn=({activeCanvas:ie,resources:Z})=>{var ee;const ae=k(),{configOptions:ye}=ae,{informationPanel:ve}=ye,[be,Ye]=reactExports.useState(),Ke=(ve==null?void 0:ve.renderAbout)||((ee=ye==null?void 0:ye.informationPanel)==null?void 0:ee.renderAbout),Xe=ve==null?void 0:ve.renderSupplementing;reactExports.useEffect(()=>{Ke?Ye("manifest-about"):Z&&(Z==null?void 0:Z.length)>0&&!Ke&&Ye(Z[0].id)},[ie,Ke,Z]);const Je=rt=>{Ye(rt)};return Z?e$1.createElement(Tt,{"data-testid":"information-panel",defaultValue:be,onValueChange:Je,orientation:"horizontal",value:be,className:"clover-viewer-information-panel"},e$1.createElement(Mt,{"aria-label":"select chapter","data-testid":"information-panel-list"},Ke&&e$1.createElement(se,{value:"manifest-about"},"About"),Xe&&Z&&Z.map(({id:rt,label:nt})=>e$1.createElement(se,{key:rt,value:rt},e$1.createElement(L,{label:nt})))),e$1.createElement(Rt,null,Ke&&e$1.createElement(ce,{value:"manifest-about"},e$1.createElement(mn,null)),Xe&&Z&&Z.map(rt=>e$1.createElement(ce,{key:rt.id,value:rt.id},e$1.createElement(hn,{resource:rt}))))):e$1.createElement(e$1.Fragment,null)},Oe=m("div",{position:"absolute",right:"1rem",top:"1rem",display:"flex",justifyContent:"flex-end",zIndex:"1"}),vn=m("input",{flexGrow:"1",border:"none",backgroundColor:"$secondaryMuted",color:"$primary",marginRight:"1rem",height:"2rem",padding:"0 1rem",borderRadius:"2rem",fontFamily:"inherit",fontSize:"1rem",lineHeight:"1rem",boxShadow:"inset 1px 1px 2px #0003","&::placeholder":{color:"$primaryMuted"}}),Y=m("button",{display:"flex",background:"none",border:"none",width:"2rem !important",height:"2rem !important",padding:"0",margin:"0",fontWeight:"700",borderRadius:"2rem",backgroundColor:"$accent",color:"$secondary",cursor:"pointer",boxSizing:"content-box !important",transition:"$all",svg:{height:"60%",width:"60%",padding:"20%",fill:"$secondary",stroke:"$secondary",opacity:"1",filter:"drop-shadow(5px 5px 5px #000D)",boxSizing:"inherit",transition:"$all"},"&:disabled":{backgroundColor:"transparent",boxShadow:"none",svg:{opacity:"0.25"}}}),bn=m("div",{display:"flex",marginRight:"0.618rem",backgroundColor:"$accentAlt",borderRadius:"2rem",boxShadow:"5px 5px 5px #0003",color:"$secondary",alignItems:"center","> span":{display:"flex",margin:"0 0.5rem",fontSize:"0.7222rem"}}),yn=m("div",{display:"flex",position:"relative",zIndex:"1",width:"100%",padding:"0",transition:"$all",variants:{isToggle:{true:{paddingTop:"2.618rem",[`& ${Oe}`]:{width:"calc(100% - 2rem)","@sm":{width:"calc(100% - 2rem)"}}}}}}),En=(ie,Z)=>{reactExports.useEffect(()=>{function ee(ae){ae.key===ie&&Z()}return window.addEventListener("keyup",ee),()=>window.removeEventListener("keyup",ee)},[])},wn=()=>e$1.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},e$1.createElement("title",null,"Arrow Back"),e$1.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M244 400L100 256l144-144M120 256h292"})),Cn=()=>e$1.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},e$1.createElement("title",null,"Arrow Forward"),e$1.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M268 112l144 144-144 144M392 256H100"})),Sn=()=>e$1.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},e$1.createElement("title",null,"Close"),e$1.createElement("path",{d:"M289.94 256l95-95A24 24 0 00351 127l-95 95-95-95a24 24 0 00-34 34l95 95-95 95a24 24 0 1034 34l95-95 95 95a24 24 0 0034-34z"})),kn=()=>e$1.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},e$1.createElement("title",null,"Search"),e$1.createElement("path",{d:"M456.69 421.39L362.6 327.3a173.81 173.81 0 0034.84-104.58C397.44 126.38 319.06 48 222.72 48S48 126.38 48 222.72s78.38 174.72 174.72 174.72A173.81 173.81 0 00327.3 362.6l94.09 94.09a25 25 0 0035.3-35.3zM97.92 222.72a124.8 124.8 0 11124.8 124.8 124.95 124.95 0 01-124.8-124.8z"})),In=({handleCanvasToggle:ie,handleFilter:Z,activeIndex:ee,canvasLength:ae})=>{const[ye,ve]=reactExports.useState(!1),[be,Ye]=reactExports.useState(!1),[Ke,Xe]=reactExports.useState(!1);reactExports.useEffect(()=>{Xe(ee===0),ee===ae-1?Ye(!0):Ye(!1)},[ee,ae]),En("Escape",()=>{ve(!1),Z("")});const Je=()=>{ve(nt=>!nt),Z("")},rt=nt=>Z(nt.target.value);return e$1.createElement(yn,{isToggle:ye},e$1.createElement(Oe,null,ye&&e$1.createElement(vn,{autoFocus:!0,onChange:rt,placeholder:"Search"}),!ye&&e$1.createElement(bn,null,e$1.createElement(Y,{onClick:()=>ie(-1),disabled:Ke,type:"button"},e$1.createElement(wn,null)),e$1.createElement("span",null,ee+1," of ",ae),e$1.createElement(Y,{onClick:()=>ie(1),disabled:be,type:"button"},e$1.createElement(Cn,null))),e$1.createElement(Y,{onClick:Je,type:"button"},ye?e$1.createElement(Sn,null):e$1.createElement(kn,null))))},$n=m($f99a8c78507165f7$export$be92b6f5f03c0fe9,{display:"flex",flexDirection:"row",flexGrow:"1",padding:"1.618rem",overflowX:"scroll",position:"relative",zIndex:"0"}),An=()=>e$1.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M256 112v288M400 256H112"}),Tn=()=>e$1.createElement(e$1.Fragment,null,e$1.createElement("path",{d:"M232 416a23.88 23.88 0 01-14.2-4.68 8.27 8.27 0 01-.66-.51L125.76 336H56a24 24 0 01-24-24V200a24 24 0 0124-24h69.75l91.37-74.81a8.27 8.27 0 01.66-.51A24 24 0 01256 120v272a24 24 0 01-24 24zm-106.18-80zm-.27-159.86zM320 336a16 16 0 01-14.29-23.19c9.49-18.87 14.3-38 14.3-56.81 0-19.38-4.66-37.94-14.25-56.73a16 16 0 0128.5-14.54C346.19 208.12 352 231.44 352 256c0 23.86-6 47.81-17.7 71.19A16 16 0 01320 336z"}),e$1.createElement("path",{d:"M368 384a16 16 0 01-13.86-24C373.05 327.09 384 299.51 384 256c0-44.17-10.93-71.56-29.82-103.94a16 16 0 0127.64-16.12C402.92 172.11 416 204.81 416 256c0 50.43-13.06 83.29-34.13 120a16 16 0 01-13.87 8z"}),e$1.createElement("path",{d:"M416 432a16 16 0 01-13.39-24.74C429.85 365.47 448 323.76 448 256c0-66.5-18.18-108.62-45.49-151.39a16 16 0 1127-17.22C459.81 134.89 480 181.74 480 256c0 64.75-14.66 113.63-50.6 168.74A16 16 0 01416 432z"})),Mn=()=>e$1.createElement("path",{d:"M289.94 256l95-95A24 24 0 00351 127l-95 95-95-95a24 24 0 00-34 34l95 95-95 95a24 24 0 1034 34l95-95 95 95a24 24 0 0034-34z"}),Rn=()=>e$1.createElement("path",{d:"M416 64H96a64.07 64.07 0 00-64 64v256a64.07 64.07 0 0064 64h320a64.07 64.07 0 0064-64V128a64.07 64.07 0 00-64-64zm-80 64a48 48 0 11-48 48 48.05 48.05 0 0148-48zM96 416a32 32 0 01-32-32v-67.63l94.84-84.3a48.06 48.06 0 0165.8 1.9l64.95 64.81L172.37 416zm352-32a32 32 0 01-32 32H217.63l121.42-121.42a47.72 47.72 0 0161.64-.16L448 333.84z"}),zn=()=>e$1.createElement("path",{d:"M464 384.39a32 32 0 01-13-2.77 15.77 15.77 0 01-2.71-1.54l-82.71-58.22A32 32 0 01352 295.7v-79.4a32 32 0 0113.58-26.16l82.71-58.22a15.77 15.77 0 012.71-1.54 32 32 0 0145 29.24v192.76a32 32 0 01-32 32zM268 400H84a68.07 68.07 0 01-68-68V180a68.07 68.07 0 0168-68h184.48A67.6 67.6 0 01336 179.52V332a68.07 68.07 0 01-68 68z"}),De=m("svg",{display:"inline-flex",variants:{isLarge:{true:{height:"4rem",width:"4rem"}},isMedium:{true:{height:"2rem",width:"2rem"}},isSmall:{true:{height:"1rem",width:"1rem"}}}}),Ln=({children:ie})=>e$1.createElement("title",null,ie),S=ie=>e$1.createElement(De,{...ie,"data-testid":"icon-svg",role:"img",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg"},ie.children);S.Title=Ln;S.Add=An;S.Audio=Tn;S.Close=Mn;S.Image=Rn;S.Video=zn;const Fn=ne({"0%":{opacity:0,transform:"translateY(1rem)"},"100%":{opacity:1,transform:"translateY(0)"}}),Pn=ne({"0%":{opacity:0,transform:"translateY(1rem)"},"100%":{opacity:1,transform:"translateY(0)"}}),We=m($cb5cc270b50c6fcd$export$21b07c8f274aebd5,{fill:"$secondaryAlt"}),Vn=m($cb5cc270b50c6fcd$export$f39c2d165cd861fe,{position:"absolute",right:"0",top:"0",padding:"0.5rem",margin:"0",cursor:"pointer",border:"none",background:"none",fill:"inherit","&:hover":{opacity:"0.75"}}),Bn=m($cb5cc270b50c6fcd$export$7c6e2c02157bb7d2,{border:"none",backgroundColor:"white",fill:"inhrerit",padding:"1rem 2rem 1rem 1rem",width:"auto",minWidth:"200px",maxWidth:"350px",borderRadius:"3px",boxShadow:"5px 5px 13px #0002",animationDuration:"0.3s",animationTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",'&[data-side="top"]':{animationName:Pn},'&[data-side="bottom"]':{animationName:Fn},'&[data-align="end"]':{[`& ${We}`]:{margin:"0 0.7rem"}}}),Hn=m($cb5cc270b50c6fcd$export$41fb9f06171c75f4,{display:"inline-flex",padding:"0.5rem 0",margin:"0 0.5rem 0 0",cursor:"pointer",border:"none",background:"none","> button, > span":{margin:"0"}}),On=m($cb5cc270b50c6fcd$export$be92b6f5f03c0fe9,{boxSizing:"content-box"}),Dn=ie=>e$1.createElement(Hn,{...ie},ie.children),Wn=ie=>e$1.createElement(Bn,{...ie},e$1.createElement(We,null),e$1.createElement(Vn,null,e$1.createElement(S,{isSmall:!0},e$1.createElement(S.Close,null))),ie.children),W=({children:ie})=>e$1.createElement(On,null,ie);W.Trigger=Dn;W.Content=Wn;const J=m("div",{boxSizing:"border-box",display:"inline-flex",alignItems:"center",borderRadius:"5px",padding:"$1",marginBottom:"$2",marginRight:"$2",backgroundColor:"$lightGrey",color:"$richBlack50",textTransform:"uppercase",fontSize:"$2",objectFit:"contain",lineHeight:"1em !important","&:last-child":{marginRight:"0"},[`${De}`]:{position:"absolute",left:"$1",height:"$3",width:"$3"},variants:{isIcon:{true:{position:"relative",paddingLeft:"$5"}}}}),Q=m("span",{display:"flex"}),jn=m("span",{display:"flex",width:"1.2111rem",height:"0.7222rem"}),Nn=m("span",{display:"inline-flex",marginLeft:"5px",marginBottom:"-1px"}),Gn=m($f99a8c78507165f7$export$6d08773d2e66f8f2,{display:"flex",flexShrink:"0",margin:"0 1.618rem 0 0",padding:"0",cursor:"pointer",background:"none",border:"none",fontFamily:"inherit",lineHeight:"1.25em",fontSize:"1rem",textAlign:"left","&:last-child":{marginRight:"1rem"},figure:{margin:"0",width:"161.8px","> div":{position:"relative",display:"flex",backgroundColor:"$secondaryAlt",width:"inherit",height:"100px",overflow:"hidden",borderRadius:"3px",transition:"$all",img:{width:"100%",height:"100%",objectFit:"cover",filter:"blur(0)",transform:"scale3d(1, 1, 1)",transition:"$all",color:"transparent"},[`& ${Q}`]:{position:"absolute",right:"0",bottom:"0",[`& ${J}`]:{margin:"0",paddingLeft:"0",fontSize:"0.7222rem",backgroundColor:"#000d",color:"$secondary",fill:"$secondary",borderBottomLeftRadius:"0",borderTopRightRadius:"0"}}},figcaption:{marginTop:"0.5rem",fontWeight:"400",fontSize:"0.8333rem",display:"-webkit-box",overflow:"hidden",MozBoxOrient:"vertical",WebkitBoxOrient:"vertical",WebkitLineClamp:"5","@sm":{fontSize:"0.8333rem"}}},"&[aria-checked='true']":{figure:{"> div":{backgroundColor:"$primaryAlt","&::before":{position:"absolute",zIndex:"1",color:"$secondaryMuted",content:"Active Item",textTransform:"uppercase",fontWeight:"700",fontSize:"0.6111rem",letterSpacing:"0.03rem",display:"flex",width:"100%",height:"100%",flexDirection:"column",justifyContent:"center",textAlign:"center",textShadow:"5px 5px 5px #0003"},img:{opacity:"0.3",transform:"scale3d(1.1, 1.1, 1.1)",filter:"blur(2px)"},[`& ${Q}`]:{[`& ${J}`]:{backgroundColor:"$accent"}}}},figcaption:{fontWeight:"700"}}}),qn=({type:ie})=>{switch(ie){case"Sound":return e$1.createElement(S.Audio,null);case"Image":return e$1.createElement(S.Image,null);case"Video":return e$1.createElement(S.Video,null);default:return e$1.createElement(S.Image,null)}},Un=({canvas:ie,canvasIndex:Z,isActive:ee,thumbnail:ae,type:ye,handleChange:ve})=>e$1.createElement(Gn,{"aria-checked":ee,"data-testid":"media-thumbnail","data-canvas":Z,onClick:()=>ve(ie.id),value:ie.id},e$1.createElement("figure",null,e$1.createElement("div",null,(ae==null?void 0:ae.id)&&e$1.createElement("img",{src:ae.id,alt:ie!=null&&ie.label?D(ie.label):""}),e$1.createElement(Q,null,e$1.createElement(J,{isIcon:!0,"data-testid":"thumbnail-tag"},e$1.createElement(jn,null),e$1.createElement(S,{"aria-label":ye},e$1.createElement(qn,{type:ye})),["Video","Sound"].includes(ye)&&e$1.createElement(Nn,null,Ee(ie.duration))))),(ie==null?void 0:ie.label)&&e$1.createElement("figcaption",{"data-testid":"fig-caption"},e$1.createElement(L,{label:ie.label})))),_n=ie=>ie.body?ie.body.type:"Image",Zn=({items:ie})=>{const Z=O(),ee=k(),{activeCanvas:ae,vault:ye}=ee,[ve,be]=reactExports.useState(""),[Ye,Ke]=reactExports.useState([]),[Xe,Je]=reactExports.useState(0),rt=e$1.useRef(null),nt="painting",it=ot=>{ae!==ot&&Z({type:"updateActiveCanvas",canvasId:ot})};reactExports.useEffect(()=>{if(!Ye.length){const ot=["Image","Sound","Video"],dt=ie.map(ft=>Ie(ye,ft,nt,ot)).filter(ft=>ft.annotations.length>0);Ke(dt)}},[ie,Ye.length,ye]),reactExports.useEffect(()=>{Ye.forEach((ot,dt)=>{ot!=null&&ot.canvas&&ot.canvas.id===ae&&Je(dt)})},[ae,Ye]),reactExports.useEffect(()=>{const ot=document.querySelector(`[data-canvas="${Xe}"]`);if(ot instanceof HTMLElement&&rt.current){const dt=ot.offsetLeft-rt.current.offsetWidth/2+ot.offsetWidth/2;rt.current.scrollTo({left:dt,behavior:"smooth"})}},[Xe]);const lt=ot=>be(ot),ct=ot=>{const dt=Ye[Xe+ot];dt!=null&&dt.canvas&&it(dt.canvas.id)};return e$1.createElement(e$1.Fragment,null,e$1.createElement(In,{handleFilter:lt,handleCanvasToggle:ct,activeIndex:Xe,canvasLength:Ye.length}),e$1.createElement($n,{"aria-label":"select item","data-testid":"media",ref:rt},Ye.filter(ot=>{var dt;if((dt=ot.canvas)!=null&&dt.label){const ft=D(ot.canvas.label);if(Array.isArray(ft))return ft[0].toLowerCase().includes(ve.toLowerCase())}}).map((ot,dt)=>{var ft,gt;return e$1.createElement(Un,{canvas:ot.canvas,canvasIndex:dt,handleChange:it,isActive:ae===((ft=ot==null?void 0:ot.canvas)==null?void 0:ft.id),key:(gt=ot==null?void 0:ot.canvas)==null?void 0:gt.id,thumbnail:Et(ye,ot,200,200),type:_n(ot.annotations[0])})})))},je=m("button",{background:"none",border:"none",cursor:"zoom-in",width:"100%",height:"100%",margin:"0",padding:"0",transition:"$all","& img":{width:"100%",height:"100%",objectFit:"contain",color:"transparent",transition:"$all"},variants:{isMedia:{true:{cursor:"pointer"}}}}),Ne=m("button",{display:"flex",height:"2rem",width:"2rem",borderRadius:"2rem",padding:"0",margin:"0",fontFamily:"inherit",background:"none",border:"none",color:"white",cursor:"pointer",marginLeft:"0.618rem",backgroundColor:"$primary",filter:"drop-shadow(2px 2px 5px #0003)",transition:"$all",boxSizing:"content-box !important","&:first-child":{marginLeft:"0"},"@xs":{marginBottom:"0.618rem",marginLeft:"0","&:last-child":{marginBottom:"0"}},svg:{height:"60%",width:"60%",padding:"20%",fill:"$secondary",stroke:"$secondary",filter:"drop-shadow(2px 2px 5px #0003)",transition:"$all",boxSizing:"inherit"},"&:hover, &:focus":{backgroundColor:"$accent"},"&#rotateRight":{"&:hover, &:focus":{svg:{rotate:"45deg"}}},"&#rotateLeft":{transform:"scaleX(-1)","&:hover, &:focus":{svg:{rotate:"45deg"}}},"&#reset":{"&:hover, &:focus":{svg:{rotate:"-15deg"}}}}),Ge=m(Ne,{position:"absolute",width:"2rem",top:"1rem",right:"1rem",zIndex:100,display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",transition:"$all",borderRadius:"50%",backgroundColor:"$accent",cursor:"pointer","&:hover, &:focus":{backgroundColor:"$accent !important"},variants:{isInteractive:{true:{"&:hover":{opacity:"1"}},false:{}},isMedia:{true:{cursor:"pointer !important"}}},compoundVariants:[{isInteractive:!1,isMedia:!0,css:{top:"50%",right:"50%",width:"4rem",height:"4rem",transform:"translate(50%,-50%)"}}]}),Xn=m("div",{position:"relative",zIndex:"0",display:"flex",flexDirection:"column",gap:"1rem","&:hover":{[`${Ge}`]:{backgroundColor:"$accent"},[`${je}`]:{backgroundColor:"#6662",img:{filter:"brightness(0.85)"}}}}),Yn=m("div",{}),Kn=m("svg",{height:"19px",color:"$accent",fill:"$accent",stroke:"$accent",display:"flex",margin:"0.25rem 0.85rem"}),Jn=m($cc7e05a45900e73f$export$41fb9f06171c75f4,{fontSize:"1.25rem",fontWeight:"400",fontFamily:"inherit",alignSelf:"flex-start",flexGrow:"1",cursor:"pointer",transition:"$all",border:"1px solid #6663",boxShadow:"2px 2px 5px #0001",borderRadius:"3px",display:"flex",alignItems:"center",paddingLeft:"0.5rem",width:"100%","@sm":{fontSize:"1rem"}}),Qn=m($cc7e05a45900e73f$export$7c6e2c02157bb7d2,{borderRadius:"3px",boxShadow:"3px 3px 8px #0003",backgroundColor:"$secondary",marginTop:"2.25rem",marginLeft:"6px",paddingBottom:"0.25rem",maxHeight:"calc(61.8vh - 2.5rem) !important",borderTopLeftRadius:"0",border:"1px solid $secondaryMuted",maxWidth:"90vw"}),er=m($cc7e05a45900e73f$export$6d08773d2e66f8f2,{display:"flex",alignItems:"center",fontFamily:"inherit",padding:"0.25rem 0.5rem",color:"$primary",fontWeight:"400",fontSize:"0.8333rem",cursor:"pointer",backgroundColor:"$secondary",width:"calc(100% - 1rem)","> span":{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},'&[data-state="checked"]':{fontWeight:"700",color:"$primary !important"},"&:hover":{color:"$accent"},img:{width:"31px",height:"31px",marginRight:"0.5rem",borderRadius:"3px"}}),tr=m($cc7e05a45900e73f$export$b04be29aa201d4f5,{color:"$primaryMuted",fontFamily:"inherit",fontSize:"0.85rem",padding:"0.5rem 1rem 0.5rem 0.5rem",display:"flex",alignItems:"center",marginBottom:"0.25rem",borderRadius:"3px",borderTopLeftRadius:"0",borderBottomLeftRadius:"0",borderBottomRightRadius:"0",backgroundColor:"$secondaryMuted"}),qe=m($cc7e05a45900e73f$export$be92b6f5f03c0fe9,{position:"relative",zIndex:"5",width:"100%"}),K=({direction:ie,title:Z})=>{const ee=()=>e$1.createElement("path",{d:"M414 321.94L274.22 158.82a24 24 0 00-36.44 0L98 321.94c-13.34 15.57-2.28 39.62 18.22 39.62h279.6c20.5 0 31.56-24.05 18.18-39.62z"}),ae=()=>e$1.createElement("path",{d:"M98 190.06l139.78 163.12a24 24 0 0036.44 0L414 190.06c13.34-15.57 2.28-39.62-18.22-39.62h-279.6c-20.5 0-31.56 24.05-18.18 39.62z"});return e$1.createElement(Kn,{xmlns:"http://www.w3.org/2000/svg",focusable:"false",viewBox:"0 0 512 512",role:"img"},e$1.createElement("title",null,Z),ie==="up"&&e$1.createElement(ee,null),ie==="down"&&e$1.createElement(ae,null))},Ue=({children:ie,label:Z,maxHeight:ee,onValueChange:ae,value:ye})=>e$1.createElement(qe,{onValueChange:ae,value:ye},e$1.createElement(Jn,{"data-testid":"select-button"},e$1.createElement($cc7e05a45900e73f$export$e288731fd71264f0,{"data-testid":"select-button-value"}),e$1.createElement($cc7e05a45900e73f$export$99b400cabb58c515,null,e$1.createElement(K,{direction:"down",title:"select"}))),e$1.createElement($cc7e05a45900e73f$export$b2af6c9944296213,null,e$1.createElement(Qn,{css:{maxHeight:`${ee} !important`},"data-testid":"select-content"},e$1.createElement($cc7e05a45900e73f$export$d8117927658af6d7,null,e$1.createElement(K,{direction:"up",title:"scroll up for more"})),e$1.createElement($cc7e05a45900e73f$export$9ed6e7b40248d36d,null,e$1.createElement($cc7e05a45900e73f$export$ee25a334c55de1f4,null,Z&&e$1.createElement(tr,null,e$1.createElement(L,{"data-testid":"select-label",label:Z})),ie)),e$1.createElement($cc7e05a45900e73f$export$ff951e476c12189,null,e$1.createElement(K,{direction:"down",title:"scroll down for more"}))))),_e=ie=>e$1.createElement(er,{...ie},ie.thumbnail&&e$1.createElement(Ve,{thumbnail:ie.thumbnail}),e$1.createElement($cc7e05a45900e73f$export$3572fb0fb821ff49,null,e$1.createElement(L,{label:ie.label})),e$1.createElement($cc7e05a45900e73f$export$6b9198de19accfe6,null)),nr=m("div",{position:"absolute !important",zIndex:"1",top:"1rem",left:"1rem",width:"161.8px",height:"100px",backgroundColor:"#000D",boxShadow:"5px 5px 5px #0002",borderRadius:"3px",".displayregion":{border:" 3px solid $accent !important",boxShadow:"0 0 3px #0006"},"@sm":{width:"123px",height:"76px"},"@xs":{width:"100px",height:"61.8px"}}),rr=m("div",{position:"relative",width:"100%",height:"100%",zIndex:"0"}),or=m("div",{width:"100%",height:"61.8vh",maxHeight:"100vh",background:"black",backgroundSize:"contain",color:"white",position:"relative",zIndex:"1",overflow:"hidden"}),z=({id:ie,label:Z,children:ee})=>e$1.createElement(Ne,{id:ie,"data-testid":"openseadragon-button"},e$1.createElement("svg",{xmlns:"http://www.w3.org/2000/svg","aria-labelledby":`${ie}-svg-title`,"data-testid":"openseadragon-button-svg",focusable:"false",viewBox:"0 0 512 512",role:"img"},e$1.createElement("title",{id:`${ie}-svg-title`},Z),ee)),ar=m("div",{position:"absolute",zIndex:"1",top:"1rem",display:"flex","@xs":{flexDirection:"column",zIndex:"2"},variants:{hasPlaceholder:{true:{right:"3.618rem","@xs":{top:"3.618rem",right:"1rem"}},false:{right:"1rem","@xs":{top:"1rem",right:"1rem"}}}}}),ir=()=>e$1.createElement("path",{strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M256 112v288M400 256H112"}),lr=()=>e$1.createElement("path",{strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M400 256H112"}),sr=()=>e$1.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M432 320v112H320M421.8 421.77L304 304M80 192V80h112M90.2 90.23L208 208M320 80h112v112M421.77 90.2L304 208M192 432H80V320M90.23 421.8L208 304"}),cr=()=>e$1.createElement("path",{d:"M448 440a16 16 0 01-12.61-6.15c-22.86-29.27-44.07-51.86-73.32-67C335 352.88 301 345.59 256 344.23V424a16 16 0 01-27 11.57l-176-168a16 16 0 010-23.14l176-168A16 16 0 01256 88v80.36c74.14 3.41 129.38 30.91 164.35 81.87C449.32 292.44 464 350.9 464 424a16 16 0 01-16 16z"}),pe=()=>e$1.createElement(e$1.Fragment,null,e$1.createElement("path",{fill:"none",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M400 148l-21.12-24.57A191.43 191.43 0 00240 64C134 64 48 150 48 256s86 192 192 192a192.09 192.09 0 00181.07-128"}),e$1.createElement("path",{d:"M464 97.42V208a16 16 0 01-16 16H337.42c-14.26 0-21.4-17.23-11.32-27.31L436.69 86.1C446.77 76 464 83.16 464 97.42z"})),dr=({hasPlaceholder:ie,options:Z})=>e$1.createElement(ar,{"data-testid":"openseadragon-controls",hasPlaceholder:ie,id:"openseadragon-controls"},Z.showZoomControl&&e$1.createElement(e$1.Fragment,null,e$1.createElement(z,{id:"zoomIn",label:"zoom in"},e$1.createElement(ir,null)),e$1.createElement(z,{id:"zoomOut",label:"zoom out"},e$1.createElement(lr,null))),Z.showFullPageControl&&e$1.createElement(z,{id:"fullPage",label:"full page"},e$1.createElement(sr,null)),Z.showRotationControl&&e$1.createElement(e$1.Fragment,null,e$1.createElement(z,{id:"rotateRight",label:"rotate right"},e$1.createElement(pe,null)),e$1.createElement(z,{id:"rotateLeft",label:"rotate left"},e$1.createElement(pe,null))),Z.showHomeControl&&e$1.createElement(z,{id:"reset",label:"reset"},e$1.createElement(cr,null))),mr=ie=>fetch(`${ie.replace(/\/$/,"")}/info.json`).then(Z=>Z.json()).then(Z=>Z).catch(Z=>{console.error(`The IIIF tilesource ${ie.replace(/\/$/,"")}/info.json failed to load: ${Z}`)}),ur=ie=>{let Z,ee;if(Array.isArray(ie)&&(Z=ie[0],Z)){let ae;"@id"in Z?ae=Z["@id"]:ae=Z.id,ee=ae}return ee},pr=({uri:ie,hasPlaceholder:Z,imageType:ee})=>{const[ae,ye]=reactExports.useState(),[ve,be]=reactExports.useState(),Ye=k(),{configOptions:Ke}=Ye,Xe={id:`openseadragon-viewport-${ve}`,loadTilesWithAjax:!0,fullPageButton:"fullPage",homeButton:"reset",rotateLeftButton:"rotateLeft",rotateRightButton:"rotateRight",zoomInButton:"zoomIn",zoomOutButton:"zoomOut",showNavigator:!0,showFullPageControl:!0,showHomeControl:!0,showRotationControl:!0,showZoomControl:!0,navigatorBorderColor:"transparent",navigatorId:`openseadragon-navigator-${ve}`,gestureSettingsMouse:{clickToZoom:!0,dblClickToZoom:!0,pinchToZoom:!0,scrollToZoom:!0},...Ke.openSeadragon,ajaxWithCredentials:Ke.withCredentials};return reactExports.useEffect(()=>{ie!==ae&&(ye(ie),be(v4()))},[ae,ie]),reactExports.useEffect(()=>{if(ae)switch(ee){case"simpleImage":le(Xe).addSimpleImage({url:ae});break;case"tiledImage":mr(ae).then(Je=>le(Xe).addTiledImage({tileSource:Je}));break;default:console.warn(`Unable to render ${ae} in OpenSeadragon as type: "${ee}"`);break}},[ae]),ve?e$1.createElement(or,{css:{backgroundColor:Ke.canvasBackgroundColor,height:Ke.canvasHeight},className:"clover-viewer-osd-wrapper","data-testid":"clover-viewer-osd-wrapper"},e$1.createElement(dr,{hasPlaceholder:Z,options:Xe}),e$1.createElement(nr,{id:`openseadragon-navigator-${ve}`}),e$1.createElement(rr,{id:`openseadragon-viewport-${ve}`})):null},fr=({painting:ie,hasPlaceholder:Z})=>{const[ee,ae]=reactExports.useState(),[ye,ve]=reactExports.useState();return reactExports.useEffect(()=>{Array.isArray(ie==null?void 0:ie.service)&&(ie==null?void 0:ie.service.length)>0?(ae("tiledImage"),ve(ur(ie==null?void 0:ie.service))):(ae("simpleImage"),ve(ie==null?void 0:ie.id))},[ie]),e$1.createElement(pr,{uri:ye,key:ye,hasPlaceholder:Z,imageType:ee})},gr=({isMedia:ie,label:Z,placeholderCanvas:ee,setIsInteractive:ae})=>{const{vault:ye}=k(),ve=N(ye,ee),be=ve?ve[0]:void 0,Ye=Z?D(Z):["placeholder image"];return e$1.createElement(je,{onClick:()=>ae(!0),isMedia:ie,className:"clover-viewer-placeholder"},e$1.createElement("img",{src:(be==null?void 0:be.id)||"",alt:Ye.join(),height:be==null?void 0:be.height,width:be==null?void 0:be.width}))},hr=m("canvas",{position:"absolute",width:"100%",height:"100%",zIndex:"0"}),xr=e$1.forwardRef((ie,Z)=>{const ee=e$1.useRef(null),ae=reactExports.useCallback(()=>{var ve,be;if((ve=Z.current)!=null&&ve.currentTime&&((be=Z.current)==null?void 0:be.currentTime)>0)return;const Ye=Z.current;if(!Ye)return;const Ke=new AudioContext,Xe=Ke.createMediaElementSource(Ye),Je=Ke.createAnalyser(),rt=ee.current;if(!rt)return;rt.width=Ye.offsetWidth,rt.height=Ye.offsetHeight;const nt=rt.getContext("2d");Xe.connect(Je),Je.connect(Ke.destination),Je.fftSize=256;const it=Je.frequencyBinCount,lt=new Uint8Array(it);setInterval(function(){ye(Je,nt,it,lt,rt.width,rt.height)},20)},[Z]);e$1.useEffect(()=>{!Z||!Z.current||(Z.current.onplay=ae)},[ae,Z]);function ye(ve,be,Ye,Ke,Xe,Je){const rt=Xe/Ye*2.6;let nt,it=0;ve.getByteFrequencyData(Ke),be.fillStyle="#000000",be.fillRect(0,0,Xe,Je);for(let lt=0;lt{const ee=D(ie.label,"en");return Array.isArray(ee)&&ee.some(ae=>Z.includes(ae))?null:e$1.createElement("track",{key:ie.id,src:ie.id,label:Array.isArray(ee)?ee[0]:ee,srcLang:"en","data-testid":"player-track"})},yr=({allSources:ie,resources:Z,painting:ee})=>{const[ae,ye]=e$1.useState(0),[ve,be]=e$1.useState(),Ye=e$1.useRef(null),Ke=(ee==null?void 0:ee.type)==="Sound",Xe=k(),{activeCanvas:Je,configOptions:rt,vault:nt}=Xe;return reactExports.useEffect(()=>{if(!ee.id||!Ye.current)return;if(Ye!=null&&Ye.current){const ct=Ye.current;ct.src=ee.id,ct.load()}if(ee.id.split(".").pop()!=="m3u8")return;const it={xhrSetup:function(ct,ot){ct.withCredentials=!!rt.withCredentials}},lt=new Hls(it);return lt.attachMedia(Ye.current),lt.on(Hls.Events.MEDIA_ATTACHED,function(){lt.loadSource(ee.id)}),lt.on(Hls.Events.ERROR,function(ct,ot){if(ot.fatal)switch(ot.type){case Hls.ErrorTypes.NETWORK_ERROR:console.error(`fatal ${ct} network error encountered, try to recover`),lt.startLoad();break;case Hls.ErrorTypes.MEDIA_ERROR:console.error(`fatal ${ct} media error encountered, try to recover`),lt.recoverMediaError();break;default:lt.destroy();break}}),()=>{if(lt&&Ye.current){const ct=Ye.current;lt.detachMedia(),lt.destroy(),ct.currentTime=0}}},[rt.withCredentials,ee.id]),reactExports.useEffect(()=>{var it,lt,ct,ot;const dt=nt.get(Je),ft=(it=dt.accompanyingCanvas)!=null&&it.id?N(nt,(lt=dt.accompanyingCanvas)==null?void 0:lt.id):null,gt=(ct=dt.placeholderCanvas)!=null&&ct.id?N(nt,(ot=dt.placeholderCanvas)==null?void 0:ot.id):null;ft&>?be(ae===0?gt[0].id:ft[0].id):(ft&&be(ft[0].id),gt&&be(gt[0].id))},[Je,ae,nt]),reactExports.useEffect(()=>{if(Ye!=null&&Ye.current){const it=Ye.current;return it==null||it.addEventListener("timeupdate",()=>ye(it.currentTime)),()=>document.removeEventListener("timeupdate",()=>{})}},[]),e$1.createElement(vr,{css:{backgroundColor:rt.canvasBackgroundColor,maxHeight:rt.canvasHeight,position:"relative"},"data-testid":"player-wrapper",className:"clover-viewer-player-wrapper"},e$1.createElement("video",{id:"clover-iiif-video",key:ee.id,ref:Ye,controls:!0,height:ee.height,width:ee.width,crossOrigin:"anonymous",poster:ve,style:{maxHeight:rt.canvasHeight,position:"relative",zIndex:"1"}},ie.map(it=>e$1.createElement("source",{src:it.id,type:it.format,key:it.id})),Z.length>0&&Z.map(it=>e$1.createElement(br,{resource:it,ignoreCaptionLabels:rt.ignoreCaptionLabels||[],key:it.id})),"Sorry, your browser doesn't support embedded videos."),Ke&&e$1.createElement(xr,{ref:Ye}))},Er=()=>e$1.createElement("svg",{xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-svg-title",focusable:"false",viewBox:"0 0 512 512",role:"img"},e$1.createElement("title",{id:"close-svg-title"},"close"),e$1.createElement("path",{d:"M289.94 256l95-95A24 24 0 00351 127l-95 95-95-95a24 24 0 00-34 34l95 95-95 95a24 24 0 1034 34l95-95 95 95a24 24 0 0034-34z"})),wr=({isMedia:ie})=>e$1.createElement("svg",{xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"open-svg-title",focusable:"false",viewBox:"0 0 512 512",role:"img"},e$1.createElement("title",{id:"open-svg-title"},"open"),ie?e$1.createElement("path",{d:"M133 440a35.37 35.37 0 01-17.5-4.67c-12-6.8-19.46-20-19.46-34.33V111c0-14.37 7.46-27.53 19.46-34.33a35.13 35.13 0 0135.77.45l247.85 148.36a36 36 0 010 61l-247.89 148.4A35.5 35.5 0 01133 440z"}):e$1.createElement(e$1.Fragment,null,e$1.createElement("path",{d:"m456.69,421.39l-94.09-94.09c22.65-30.16,34.88-66.86,34.84-104.58,0-96.34-78.38-174.72-174.72-174.72S48,126.38,48,222.72s78.38,174.72,174.72,174.72c37.72.04,74.42-12.19,104.58-34.84l94.09,94.09c10.29,9.2,26.1,8.32,35.3-1.98,8.48-9.49,8.48-23.83,0-33.32Zm-233.97-73.87c-68.89-.08-124.72-55.91-124.8-124.8h0c0-68.93,55.87-124.8,124.8-124.8s124.8,55.87,124.8,124.8-55.87,124.8-124.8,124.8Z"}),e$1.createElement("path",{d:"m279.5,197.76h-3.35s-28.47,0-28.47,0v-31.82c-.77-13.79-12.57-24.33-26.36-23.56-12.71.71-22.85,10.86-23.56,23.56v3.35h0v28.47h-31.82c-13.79.77-24.33,12.57-23.56,26.36.71,12.71,10.86,22.85,23.56,23.56h3.35s28.47,0,28.47,0v31.82c.77,13.79,12.57,24.33,26.36,23.56,12.71-.71,22.85-10.86,23.56-23.56v-3.35h0v-28.47h31.82c13.79-.77,24.33-12.57,23.56-26.36-.71-12.71-10.86-22.85-23.56-23.56Z"}))),Cr=({handleToggle:ie,isInteractive:Z,isMedia:ee})=>e$1.createElement(Ge,{onClick:ie,isInteractive:Z,isMedia:ee,"data-testid":"placeholder-toggle"},Z?e$1.createElement(Er,null):e$1.createElement(wr,{isMedia:ee})),Sr=({activeCanvas:ie,isMedia:Z,painting:ee,resources:ae})=>{var ye,ve,be;const[Ye,Ke]=e$1.useState(0),[Xe,Je]=e$1.useState(!1),{configOptions:rt,customDisplays:nt,vault:it}=k(),lt=it.get(ie),ct=(ye=lt==null?void 0:lt.placeholderCanvas)==null?void 0:ye.id,ot=!!ct,dt=(ee==null?void 0:ee.length)>1,ft=ct&&!Xe&&!Z,gt=()=>Je(!Xe),mt=Xr=>{const Jr=ee.findIndex(ai=>ai.id===Xr);Ke(Jr)},Yr=nt.find(Xr=>{var Jr;let ai=!1;const{canvasId:oi,paintingFormat:ni}=Xr.target;if(Array.isArray(oi)&&oi.length>0&&(ai=oi.includes(ie)),Array.isArray(ni)&&ni.length>0){const li=((Jr=ee[Ye])==null?void 0:Jr.format)||"";ai=!!(li&&ni.includes(li))}return ai}),Qr=(ve=Yr==null?void 0:Yr.display)==null?void 0:ve.component;return e$1.createElement(Xn,{className:"clover-viewer-painting"},e$1.createElement(Yn,{style:{backgroundColor:rt.canvasBackgroundColor,maxHeight:rt.canvasHeight}},ct&&!Z&&e$1.createElement(Cr,{handleToggle:gt,isInteractive:Xe,isMedia:Z}),ft&&!Z&&e$1.createElement(gr,{isMedia:Z,label:lt==null?void 0:lt.label,placeholderCanvas:ct,setIsInteractive:Je}),!ft&&!Yr&&(Z?e$1.createElement(yr,{allSources:ee,painting:ee[Ye],resources:ae}):ee&&e$1.createElement(fr,{painting:ee[Ye],hasPlaceholder:ot,key:ie})),!ft&&Qr&&e$1.createElement(Qr,{id:ie,annotationBody:ee[Ye],...Yr==null?void 0:Yr.display.componentProps})),dt&&e$1.createElement(Ue,{value:(be=ee[Ye])==null?void 0:be.id,onValueChange:mt,maxHeight:"200px"},ee==null?void 0:ee.map(Xr=>e$1.createElement(_e,{value:Xr==null?void 0:Xr.id,key:Xr==null?void 0:Xr.id,label:Xr==null?void 0:Xr.label}))))},kr=({activeCanvas:ie,painting:Z,resources:ee,items:ae,isAudioVideo:ye})=>{const{informationOpen:ve,configOptions:be}=k(),{informationPanel:Ye}=be,Ke=(Ye==null?void 0:Ye.renderAbout)||(Ye==null?void 0:Ye.renderSupplementing)&&ee.length>0;return e$1.createElement(Ae,{className:"clover-viewer-content","data-testid":"clover-viewer-content"},e$1.createElement(Te,null,e$1.createElement(Sr,{activeCanvas:ie,isMedia:ye,painting:Z,resources:ee}),Ke&&e$1.createElement(Me,null,e$1.createElement("span",null,ve?"View Items":"More Information")),ae.length>1&&e$1.createElement($e,{className:"clover-viewer-media-wrapper"},e$1.createElement(Zn,{items:ae,activeItem:0}))),ve&&Ke&&e$1.createElement($t,null,e$1.createElement(Re,null,e$1.createElement(xn,{activeCanvas:ie,resources:ee}))))},Ir=m(W.Trigger,{width:"30px",padding:"5px"}),$r=m(W.Content,{display:"flex",flexDirection:"column",fontSize:"0.8333rem",border:"none",boxShadow:"2px 2px 5px #0003",zIndex:"2",button:{display:"flex",textDecoration:"none",marginBottom:"0.5em",color:"$accentAlt",cursor:"pointer",background:"$secondary",border:"none","&:last-child":{marginBottom:"0"}}}),Ar=m("span",{fontSize:"1.33rem",alignSelf:"flex-start",flexGrow:"0",flexShrink:"1",padding:"1rem","@sm":{fontSize:"1rem"},"&.visually-hidden":{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}}),Tr=m("header",{display:"flex",backgroundColor:"transparent !important",justifyContent:"space-between",alignItems:"flex-start",width:"100%",[`> ${qe}`]:{flexGrow:"1",flexShrink:"0"},form:{flexGrow:"0",flexShrink:"1"}}),Mr=m("div",{display:"flex",alignItems:"flex-end",justifyContent:"flex-end",padding:"1rem",flexShrink:"0",flexGrow:"1"}),Rr=()=>{var ie;const Z=O(),ee=k(),{activeManifest:ae,collection:ye,configOptions:ve,vault:be}=ee,Ye=ve==null?void 0:ve.canvasHeight,Ke=Xe=>{Z({type:"updateActiveManifest",manifestId:Xe})};return e$1.createElement("div",{style:{margin:"0.75rem"}},e$1.createElement(Ue,{label:ye.label,maxHeight:Ye,value:ae,onValueChange:Ke},(ie=ye==null?void 0:ye.items)==null?void 0:ie.map(Xe=>e$1.createElement(_e,{value:Xe.id,key:Xe.id,thumbnail:Xe!=null&&Xe.thumbnail?be.get(Xe==null?void 0:Xe.thumbnail):void 0,label:Xe.label}))))},zr=(ie,Z=2500)=>{const[ee,ae]=reactExports.useState(),ye=reactExports.useCallback(()=>{navigator.clipboard.writeText(ie).then(()=>ae("copied"),()=>ae("failed"))},[ie]);return reactExports.useEffect(()=>{if(!ee)return;const ve=setTimeout(()=>ae(void 0),Z);return()=>clearTimeout(ve)},[ee]),[ee,ye]},Lr=m("span",{display:"flex",alignContent:"center",alignItems:"center",padding:"0.125rem 0.25rem 0",marginTop:"-0.125rem",marginLeft:"0.5rem",backgroundColor:"$accent",color:"$secondary",borderRadius:"3px",fontSize:"0.6111rem",textTransform:"uppercase",lineHeight:"1em"}),Fr=({status:ie})=>ie?e$1.createElement(Lr,{"data-copy-status":ie},ie):null,fe=({textPrompt:ie,textToCopy:Z})=>{const[ee,ae]=zr(Z);return e$1.createElement("button",{onClick:ae},ie," ",e$1.createElement(Fr,{status:ee}))},Pr=()=>{const ie="#ed1d33",Z="#2873ab";return e$1.createElement("svg",{viewBox:"0 0 493.35999 441.33334",id:"iiif-logo",version:"1.1"},e$1.createElement("title",null,"IIIF Manifest Options"),e$1.createElement("g",{transform:"matrix(1.3333333,0,0,-1.3333333,0,441.33333)"},e$1.createElement("g",{transform:"scale(0.1)"},e$1.createElement("path",{style:{fill:Z},d:"M 65.2422,2178.75 775.242,1915 773.992,15 65.2422,276.25 v 1902.5"}),e$1.createElement("path",{style:{fill:Z},d:"m 804.145,2640.09 c 81.441,-240.91 -26.473,-436.2 -241.04,-436.2 -214.558,0 -454.511,195.29 -535.9527,436.2 -81.4335,240.89 26.4805,436.18 241.0387,436.18 214.567,0 454.512,-195.29 535.954,-436.18"}),e$1.createElement("path",{style:{fill:ie},d:"M 1678.58,2178.75 968.578,1915 969.828,15 1678.58,276.25 v 1902.5"}),e$1.createElement("path",{style:{fill:ie},d:"m 935.082,2640.09 c -81.437,-240.91 26.477,-436.2 241.038,-436.2 214.56,0 454.51,195.29 535.96,436.2 81.43,240.89 -26.48,436.18 -241.04,436.18 -214.57,0 -454.52,-195.29 -535.958,-436.18"}),e$1.createElement("path",{style:{fill:Z},d:"m 1860.24,2178.75 710,-263.75 -1.25,-1900 -708.75,261.25 v 1902.5"}),e$1.createElement("path",{style:{fill:Z},d:"m 2603.74,2640.09 c 81.45,-240.91 -26.47,-436.2 -241.03,-436.2 -214.58,0 -454.52,195.29 -535.96,436.2 -81.44,240.89 26.48,436.18 241.03,436.18 214.57,0 454.51,-195.29 535.96,-436.18"}),e$1.createElement("path",{style:{fill:ie},d:"m 3700.24,3310 v -652.5 c 0,0 -230,90 -257.5,-142.5 -2.5,-247.5 0,-336.25 0,-336.25 l 257.5,83.75 V 1690 l -258.61,-92.5 V 262.5 L 2735.24,0 v 2360 c 0,0 -15,850 965,950"}))))},Vr=m($6be4966fd9bbc698$export$be92b6f5f03c0fe9,{all:"unset",height:"2rem",width:"3.236rem",backgroundColor:"#6663",borderRadius:"9999px",position:"relative",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:focus":{boxShadow:"0 0 0 2px $secondaryAlt"},'&[data-state="checked"]':{backgroundColor:"$accent",boxShadow:"inset 2px 2px 5px #0003"}}),Br=m($6be4966fd9bbc698$export$6521433ed15a34db,{display:"block",height:"calc(2rem - 12px)",width:"calc(2rem - 12px)",backgroundColor:"$secondary",borderRadius:"100%",boxShadow:"2px 2px 5px #0001",transition:"$all",transform:"translateX(6px)",willChange:"transform",'&[data-state="checked"]':{transform:"translateX(calc(1.236rem + 6px))"}}),Hr=m("label",{fontSize:"0.8333rem",fontWeight:"400",lineHeight:"1em",userSelect:"none",cursor:"pointer",paddingRight:"0.618rem"}),Or=m("form",{display:"flex",flexShrink:"0",flexGrow:"1",alignItems:"center",marginLeft:"1.618rem"}),Dr=()=>{var ie;const{configOptions:Z}=k(),ee=O(),[ae,ye]=reactExports.useState((ie=Z==null?void 0:Z.informationPanel)==null?void 0:ie.open);return reactExports.useEffect(()=>{ee({type:"updateInformationOpen",informationOpen:ae})},[ae]),e$1.createElement(Or,null,e$1.createElement(Hr,{htmlFor:"information-toggle",css:ae?{opacity:"1"}:{}},"More Information"),e$1.createElement(Vr,{checked:ae,onCheckedChange:()=>ye(!ae),id:"information-toggle","aria-label":"information panel toggle",name:"toggled?"},e$1.createElement(Br,null)))},Ze=ie=>{const Z=()=>window.matchMedia?window.matchMedia(ie).matches:!1,[ee,ae]=reactExports.useState(Z);return reactExports.useEffect(()=>{const ye=()=>ae(Z);return window.addEventListener("resize",ye),()=>window.removeEventListener("resize",ye)}),ee},Wr=({manifestId:ie,manifestLabel:Z})=>{const ee=k(),{collection:ae,configOptions:ye}=ee,{showTitle:ve,showIIIFBadge:be,informationPanel:Ye}=ye,Ke=be||(Ye==null?void 0:Ye.renderToggle),Xe=Ze(te.sm);return e$1.createElement(Tr,{className:"clover-viewer-header"},ae!=null&&ae.items?e$1.createElement(Rr,null):e$1.createElement(Ar,{className:ve?"":"visually-hidden"},ve&&e$1.createElement(L,{label:Z,className:"label"})),Ke&&e$1.createElement(Mr,null,be&&e$1.createElement(W,null,e$1.createElement(Ir,null,e$1.createElement(Pr,null)),e$1.createElement($r,null,(ae==null?void 0:ae.items)&&e$1.createElement("button",{onClick:Je=>{Je.preventDefault(),window.open(ae.id,"_blank")}},"View Collection"),e$1.createElement("button",{onClick:Je=>{Je.preventDefault(),window.open(ie,"_blank")}},"View Manifest")," ",(ae==null?void 0:ae.items)&&e$1.createElement(fe,{textPrompt:"Copy Collection URL",textToCopy:ae.id}),e$1.createElement(fe,{textPrompt:"Copy Manifest URL",textToCopy:ie}))),(Ye==null?void 0:Ye.renderToggle)&&!Xe&&e$1.createElement(Dr,null)))},jr=(ie=!1)=>{const[Z,ee]=reactExports.useState(ie);return reactExports.useLayoutEffect(()=>{if(!Z)return;const ae=document.documentElement.style.overflow;return document.documentElement.style.overflow="hidden",()=>{document.documentElement.style.overflow=ae}},[Z]),reactExports.useEffect(()=>{Z!==ie&&ee(ie)},[ie]),[Z,ee]},Nr=({manifest:ie,theme:Z})=>{var ee;const ae=k(),ye=O(),{activeCanvas:ve,informationOpen:be,vault:Ye,configOptions:Ke}=ae,[Xe,Je]=reactExports.useState(!1),[rt,nt]=reactExports.useState(!1),[it,lt]=reactExports.useState([]),[ct,ot]=reactExports.useState([]),[dt,ft]=jr(!1),gt=Ze(te.sm),mt=reactExports.useCallback(Yr=>{ye({type:"updateInformationOpen",informationOpen:Yr})},[ye]);return reactExports.useEffect(()=>{var Yr;(Yr=Ke==null?void 0:Ke.informationPanel)!=null&&Yr.open&&mt(!gt)},[gt,(ee=Ke==null?void 0:Ke.informationPanel)==null?void 0:ee.open,mt]),reactExports.useEffect(()=>{if(!gt){ft(!1);return}ft(be)},[be,gt,ft]),reactExports.useEffect(()=>{const Yr=N(Ye,ve),Qr=yt(Ye,ve,"text/vtt");Yr&&(nt(["Sound","Video"].indexOf(Yr[0].type)>-1),lt(Yr)),ot(Qr),Je(Qr.length!==0)},[ve,Ye]),e$1.createElement(ErrorBoundary,{FallbackComponent:It},e$1.createElement(At,{className:`${Z} clover-viewer`,css:{background:Ke==null?void 0:Ke.background},"data-body-locked":dt,"data-information-panel":Xe,"data-information-panel-open":be},e$1.createElement($409067139f391064$export$be92b6f5f03c0fe9,{open:be,onOpenChange:mt},e$1.createElement(Wr,{manifestLabel:ie.label,manifestId:ie.id}),e$1.createElement(kr,{activeCanvas:ve,painting:it,resources:ct,items:ie.items,isAudioVideo:rt}))))},ge={ignoreCache:!1,headers:{Accept:"application/json, text/javascript, text/plain"},timeout:5e3,withCredentials:!1};function Gr(ie){return{ok:ie.status>=200&&ie.status<300,status:ie.status,statusText:ie.statusText,headers:ie.getAllResponseHeaders(),data:ie.responseText,json:()=>JSON.parse(ie.responseText)}}function he(ie,Z=null){return{ok:!1,status:ie.status,statusText:ie.statusText,headers:ie.getAllResponseHeaders(),data:Z||ie.statusText,json:()=>JSON.parse(Z||ie.statusText)}}function qr(ie,Z=ge){const ee=Z.headers||ge.headers;return new Promise((ae,ye)=>{const ve=new XMLHttpRequest;ve.open("get",ie),ve.withCredentials=Z.withCredentials,ee&&Object.keys(ee).forEach(be=>ve.setRequestHeader(be,ee[be])),ve.onload=()=>{ae(Gr(ve))},ve.onerror=()=>{ye(he(ve,"Failed to make request."))},ve.ontimeout=()=>{ye(he(ve,"Request took longer than expected."))},ve.send()})}const ao=({canvasIdCallback:ie=()=>{},customDisplays:Z=[],customTheme:ee,iiifContent:ae,id:ye,manifestId:ve,options:be})=>{var Ye;let Ke=ae;return ye&&(Ke=ye),ve&&(Ke=ve),e$1.createElement(bt,{initialState:{..._,customDisplays:Z,informationOpen:!!((Ye=be==null?void 0:be.informationPanel)!=null&&Ye.open),vault:new Vault({customFetcher:Xe=>qr(Xe,{withCredentials:be==null?void 0:be.withCredentials,headers:be==null?void 0:be.requestHeaders}).then(Je=>JSON.parse(Je.data))})}},e$1.createElement(Ur,{iiifContent:Ke,canvasIdCallback:ie,customTheme:ee,options:be}))},Ur=({canvasIdCallback:ie,customTheme:Z,iiifContent:ee,options:ae})=>{const ye=O(),ve=k(),{activeCanvas:be,activeManifest:Ye,isLoaded:Ke,vault:Xe}=ve,[Je,rt]=reactExports.useState(),[nt,it]=reactExports.useState();let lt={};return Z&&(lt=Q$1("custom",Z)),reactExports.useEffect(()=>{ie&&ie(be)},[be,ie]),reactExports.useEffect(()=>{Ye&&Xe.loadManifest(Ye).then(ct=>{it(ct),ye({type:"updateActiveCanvas",canvasId:ct.items[0]&&ct.items[0].id})}).catch(ct=>{console.error(`Manifest failed to load: ${ct}`)}).finally(()=>{ye({type:"updateIsLoaded",isLoaded:!0})})},[Ye,ye,Xe]),reactExports.useEffect(()=>{ye({type:"updateConfigOptions",configOptions:ae}),Xe.load(ee).then(ct=>{rt(ct)}).catch(ct=>{console.error(`The IIIF resource ${ee} failed to load: ${ct}`)})},[ye,ee,ae,Xe]),reactExports.useEffect(()=>{let ct=[];(Je==null?void 0:Je.type)==="Collection"?(ye({type:"updateCollection",collection:Je}),ct=Je.items.filter(ot=>ot.type==="Manifest").map(ot=>ot.id),ct.length>0&&ye({type:"updateActiveManifest",manifestId:ct[0]})):(Je==null?void 0:Je.type)==="Manifest"&&ye({type:"updateActiveManifest",manifestId:Je.id})},[ye,Je]),Ke?!nt||!nt.items?(console.log(`The IIIF manifest ${ee} failed to load.`),e$1.createElement(e$1.Fragment,null)):nt.items.length===0?(console.log(`The IIIF manifest ${ee} does not contain canvases.`),e$1.createElement(e$1.Fragment,null)):e$1.createElement(Nr,{manifest:nt,theme:lt,key:nt.id}):e$1.createElement(e$1.Fragment,null,"Loading")};class CloverInitializer{constructor(){this.element=document.getElementById("clover-viewer"),this.element&&(this.iiif_content=this.element.attributes.iiif_content.value)}run(){if(!this.iiif_content)return!1;createRoot(document.getElementById("clover-viewer")).render(reactExports.createElement(ao,{id:this.iiif_content,options:this.config}))}get config(){return{showTitle:!1,showIIIFBadge:!1,informationPanel:{renderToggle:!1,renderAbout:!1}}}}export{CloverInitializer as C,LercParameters as L,OlInitializer as O,LercAddCompression as a,getDefaultExportFromCjs$1 as g}; diff --git a/public/vite-dev/assets/index-pmp42xxj-DHbdtNrf.js.br b/public/vite-dev/assets/index-pmp42xxj-DHbdtNrf.js.br new file mode 100644 index 0000000..67c4043 Binary files /dev/null and b/public/vite-dev/assets/index-pmp42xxj-DHbdtNrf.js.br differ diff --git a/public/vite-dev/assets/index-pmp42xxj-DHbdtNrf.js.gz b/public/vite-dev/assets/index-pmp42xxj-DHbdtNrf.js.gz new file mode 100644 index 0000000..6d8bb99 Binary files /dev/null and b/public/vite-dev/assets/index-pmp42xxj-DHbdtNrf.js.gz differ diff --git a/public/vite-dev/assets/jpeg-cL5qbLGO-DsQ9NELO.js b/public/vite-dev/assets/jpeg-cL5qbLGO-DsQ9NELO.js new file mode 100644 index 0000000..6dc3b61 --- /dev/null +++ b/public/vite-dev/assets/jpeg-cL5qbLGO-DsQ9NELO.js @@ -0,0 +1 @@ +import{g as oe}from"./basedecoder-PFIibI7U-gdlnpIMU.js";const J=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),$=4017,B=799,Q=3406,W=2276,K=1567,N=3784,j=5793,Z=2896;function ne(F,a){let s=0;const u=[];let D=16;for(;D>0&&!F[D-1];)--D;u.push({children:[],index:0});let y=u[0],P;for(let t=0;t0;)y=u.pop();for(y.index++,u.push(y);u.length<=t;)u.push(P={children:[],index:0}),y.children[y.index]=P.children,y=P;s++}t+10)return b--,c>>b&1;if(c=F[k++],c===255){const l=F[k++];if(l)throw new Error(`unexpected marker: ${(c<<8|l).toString(16)}`)}return b=7,c>>>7}function p(l){let h=l,w;for(;(w=d())!==null;){if(h=h[w],typeof h=="number")return h;if(typeof h!="object")throw new Error("invalid huffman sequence")}return null}function T(l){let h=l,w=0;for(;h>0;){const E=d();if(E===null)return;w=w<<1|E,--h}return w}function x(l){const h=T(l);return h>=1<>4;if(I===0){if(z<15)break;L+=16}else{L+=z;const U=J[L];h[U]=x(I),L++}}}function A(l,h){const w=p(l.huffmanTableDC),E=w===0?0:x(w)<0){n--;return}let w=y;const E=P;for(;w<=E;){const L=p(l.huffmanTableAC),v=L&15,I=L>>4;if(v===0){if(I<15){n=T(I)+(1<>4,U===0)L<15?(n=T(L)+(1<=65488&&Y<=65495)k+=2;else break}return k-i}function ie(F,a){const s=[],{blocksPerLine:u,blocksPerColumn:D}=a,y=u<<3,P=new Int32Array(64),t=new Uint8Array(64);function f(m,o,i){const k=a.quantizationTable;let c,b,d,p,T,x,g,A,r;const n=i;let C;for(C=0;C<64;C++)n[C]=m[C]*k[C];for(C=0;C<8;++C){const e=8*C;if(n[1+e]===0&&n[2+e]===0&&n[3+e]===0&&n[4+e]===0&&n[5+e]===0&&n[6+e]===0&&n[7+e]===0){r=j*n[0+e]+512>>10,n[0+e]=r,n[1+e]=r,n[2+e]=r,n[3+e]=r,n[4+e]=r,n[5+e]=r,n[6+e]=r,n[7+e]=r;continue}c=j*n[0+e]+128>>8,b=j*n[4+e]+128>>8,d=n[2+e],p=n[6+e],T=Z*(n[1+e]-n[7+e])+128>>8,A=Z*(n[1+e]+n[7+e])+128>>8,x=n[3+e]<<4,g=n[5+e]<<4,r=c-b+1>>1,c=c+b+1>>1,b=r,r=d*N+p*K+128>>8,d=d*K-p*N+128>>8,p=r,r=T-g+1>>1,T=T+g+1>>1,g=r,r=A+x+1>>1,x=A-x+1>>1,A=r,r=c-p+1>>1,c=c+p+1>>1,p=r,r=b-d+1>>1,b=b+d+1>>1,d=r,r=T*W+A*Q+2048>>12,T=T*Q-A*W+2048>>12,A=r,r=x*B+g*$+2048>>12,x=x*$-g*B+2048>>12,g=r,n[0+e]=c+A,n[7+e]=c-A,n[1+e]=b+g,n[6+e]=b-g,n[2+e]=d+x,n[5+e]=d-x,n[3+e]=p+T,n[4+e]=p-T}for(C=0;C<8;++C){const e=C;if(n[1*8+e]===0&&n[2*8+e]===0&&n[3*8+e]===0&&n[4*8+e]===0&&n[5*8+e]===0&&n[6*8+e]===0&&n[7*8+e]===0){r=j*i[C+0]+8192>>14,n[0*8+e]=r,n[1*8+e]=r,n[2*8+e]=r,n[3*8+e]=r,n[4*8+e]=r,n[5*8+e]=r,n[6*8+e]=r,n[7*8+e]=r;continue}c=j*n[0*8+e]+2048>>12,b=j*n[4*8+e]+2048>>12,d=n[2*8+e],p=n[6*8+e],T=Z*(n[1*8+e]-n[7*8+e])+2048>>12,A=Z*(n[1*8+e]+n[7*8+e])+2048>>12,x=n[3*8+e],g=n[5*8+e],r=c-b+1>>1,c=c+b+1>>1,b=r,r=d*N+p*K+2048>>12,d=d*K-p*N+2048>>12,p=r,r=T-g+1>>1,T=T+g+1>>1,g=r,r=A+x+1>>1,x=A-x+1>>1,A=r,r=c-p+1>>1,c=c+p+1>>1,p=r,r=b-d+1>>1,b=b+d+1>>1,d=r,r=T*W+A*Q+2048>>12,T=T*Q-A*W+2048>>12,A=r,r=x*B+g*$+2048>>12,x=x*$-g*B+2048>>12,g=r,n[0*8+e]=c+A,n[7*8+e]=c-A,n[1*8+e]=b+g,n[6*8+e]=b-g,n[2*8+e]=d+x,n[5*8+e]=d-x,n[3*8+e]=p+T,n[4*8+e]=p-T}for(C=0;C<64;++C){const e=128+(n[C]+8>>4);e<0?o[C]=0:e>255?o[C]=255:o[C]=e}}for(let m=0;m>4)if(f>>4===1)for(let o=0;o<64;o++){const i=J[o];m[i]=u()}else throw new Error("DQT: invalid table spec");else for(let o=0;o<64;o++){const i=J[o];m[i]=a[s++]}this.quantizationTables[f&15]=m}break}case 65472:case 65473:case 65474:{u();const t={extended:P===65473,progressive:P===65474,precision:a[s++],scanLines:u(),samplesPerLine:u(),components:{},componentsOrder:[]},f=a[s++];let m;for(let o=0;o>4,k=a[s+1]&15,c=a[s+2];t.componentsOrder.push(m),t.components[m]={h:i,v:k,quantizationIdx:c},s+=3}y(t),this.frames.push(t);break}case 65476:{const t=u();for(let f=2;f>4?this.huffmanTablesAC[m&15]=ne(o,k):this.huffmanTablesDC[m&15]=ne(o,k)}break}case 65501:u(),this.resetInterval=u();break;case 65498:{u();const t=a[s++],f=[],m=this.frames[0];for(let b=0;b>4],d.huffmanTableAC=this.huffmanTablesAC[p&15],f.push(d)}const o=a[s++],i=a[s++],k=a[s++],c=ce(a,s,m,f,this.resetInterval,o,i,k>>4,k&15);s+=c;break}case 65535:a[s]!==255&&s--;break;default:if(a[s-3]===255&&a[s-2]>=192&&a[s-2]<=254){s-=3;break}throw new Error(`unknown JPEG marker ${P.toString(16)}`)}P=u()}}getResult(){const{frames:a}=this;if(this.frames.length===0)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(let o=0;o>3],J<<=l&7),f=0;f>3]),J&128?(y&&(y[l]=1),i=c.encoding<2?R[U++]:M,e=e>i?i:e,h[l++]=i):(y&&(y[l]=0),h[l++]=g),J<<=1;l+=F}else if(c.encoding<2)for(k=0;ki?i:e,h[l++]=i;l+=F}else for(e=e>M?M:e,k=0;k0){var C=new Uint8Array(Math.ceil(g.width*g.height/8));B=new DataView(I,a,g.mask.numBytes);var t=B.getInt16(0,!0),o=2,s=0;do{if(t>0)for(;t--;)C[s++]=B.getUint8(o++);else{var n=B.getUint8(o++);for(t=-t;t--;)C[s++]=n}t=B.getInt16(o,!0),o+=2}while(o0?1:0),y=i+(g.height%i>0?1:0);g.pixels.blocks=new Array(h*y);for(var S=0,f=0;f3)throw"Invalid block encoding ("+w.encoding+")";if(w.encoding===2){a++;continue}if(D!==0&&D!==2){if(D>>=6,w.offsetType=D,D===2)w.offset=B.getInt8(1),G++;else if(D===1)w.offset=B.getInt16(1,!0),G+=2;else if(D===0)w.offset=B.getFloat32(1,!0),G+=4;else throw"Invalid block offset type";if(w.encoding===1)if(D=B.getUint8(G),G++,w.bitsPerPixel=D&63,D>>=6,w.numValidPixelsType=D,D===2)w.numValidPixels=B.getUint8(G),G++;else if(D===1)w.numValidPixels=B.getUint16(G,!0),G+=2;else if(D===0)w.numValidPixels=B.getUint32(G,!0),G+=4;else throw"Invalid valid pixel count type"}if(a+=G,w.encoding!==3){var l,F;if(w.encoding===0){var c=(g.pixels.numBytes-1)/4;if(c!==Math.floor(c))throw"uncompressed block has invalid length";l=new ArrayBuffer(c*4),F=new Uint8Array(l),F.set(new Uint8Array(I,a,c*4));var R=new Float32Array(l);w.rawData=R,a+=c*4}else if(w.encoding===1){var U=Math.ceil(w.numValidPixels*w.bitsPerPixel/8),M=Math.ceil(U/4);l=new ArrayBuffer(M*4),F=new Uint8Array(l),F.set(new Uint8Array(I,a,U)),w.stuffedData=new Uint32Array(l),a+=U}}}return g.eofOffset=a,g},A=function(I,a,Q,g,r,B,C){var t=(1<=a)e=i>>>n-a&t,n-=a;else{var S=a-n;e=(i&t)<>>n}B[s]=e=I?(n=e>>>s-I&C,s-=I):(i=I-s,n=(e&C)<>>s),A[o]=Q[n];else for(h=Math.ceil((B-g)/r),o=0;o=I?(n=e>>>s-I&C,s-=I):(i=I-s,n=(e&C)<>>s),A[o]=n=A?(s=n>>>o-A&r,o-=A):(t=A-o,s=(n&r)<>>o),e[C]=s=I?(e=i>>>n&C,s-=I,n+=I):(h=I-s,e=i>>>n&C,i=E[t++],s=32-h,e|=(i&(1<=I?(e=i>>>n&C,s-=I,n+=I):(h=I-s,e=i>>>n&C,i=E[t++],s=32-h,e|=(i&(1<=A?(s=e>>>n&r,o-=A,n+=A):(t=A-o,s=e>>>n&r,e=E[B++],o=32-t,s|=(e&(1<=I?(C=t>>>B-I&Q,B-=I):(o=I-B,C=(t&Q)<>>B),A[r]=C;return A},originalUnstuff2:function(E,A,I,a){var Q=(1<=I?(t=o>>>C&Q,B-=I,C+=I):(s=I-B,t=o>>>C&Q,o=E[g++],B=32-s,t|=(o&(1<=359?359:Q;Q-=r;do A+=E[g++]<<8,I+=A+=E[g++];while(--r);A=(A&65535)+(A>>>16),I=(I&65535)+(I>>>16)}return a&1&&(I+=A+=E[g]<<8),A=(A&65535)+(A>>>16),I=(I&65535)+(I>>>16),(I<<16|A)>>>0},readHeaderInfo:function(E,A){var I=A.ptr,a=new Uint8Array(E,I,6),Q={};if(Q.fileIdentifierString=String.fromCharCode.apply(null,a),Q.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+Q.fileIdentifierString;I+=6;var g=new DataView(E,I,8),r=g.getInt32(0,!0);Q.fileVersion=r,I+=4,r>=3&&(Q.checksum=g.getUint32(4,!0),I+=4),g=new DataView(E,I,12),Q.height=g.getUint32(0,!0),Q.width=g.getUint32(4,!0),I+=8,r>=4?(Q.numDims=g.getUint32(8,!0),I+=4):Q.numDims=1,g=new DataView(E,I,40),Q.numValidPixel=g.getUint32(0,!0),Q.microBlockSize=g.getInt32(4,!0),Q.blobSize=g.getInt32(8,!0),Q.imageType=g.getInt32(12,!0),Q.maxZError=g.getFloat64(16,!0),Q.zMin=g.getFloat64(24,!0),Q.zMax=g.getFloat64(32,!0),I+=40,A.headerInfo=Q,A.ptr=I;var B,C;if(r>=3&&(C=r>=4?52:48,B=this.computeChecksumFletcher32(new Uint8Array(E,I-C,Q.blobSize-14)),B!==Q.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(E,A){var I=A.headerInfo,a=this.getDataTypeArray(I.imageType),Q=I.numDims*this.getDataTypeSize(I.imageType),g=this.readSubArray(E,A.ptr,a,Q),r=this.readSubArray(E,A.ptr+Q,a,Q);A.ptr+=2*Q;var B,C=!0;for(B=0;B0){C=new Uint8Array(Math.ceil(Q/8)),r=new DataView(E,I,B.numBytes);var o=r.getInt16(0,!0),s=2,n=0,e=0;do{if(o>0)for(;o--;)C[n++]=r.getUint8(s++);else for(e=r.getUint8(s++),o=-o;o--;)C[n++]=e;o=r.getInt16(s,!0),s+=2}while(s>3],i<<=h&7):i=C[h>>3],i&128&&(t[h]=1);A.pixels.resultMask=t,B.bitset=C,I+=B.numBytes}return A.ptr=I,A.mask=B,!0},readDataOneSweep:function(E,A,I,a){var Q=A.ptr,g=A.headerInfo,r=g.numDims,B=g.width*g.height,C=g.imageType,t=g.numValidPixel*d.getDataTypeSize(C)*r,o,s=A.pixels.resultMask;if(I===Uint8Array)o=new Uint8Array(E,Q,t);else{var n=new ArrayBuffer(t),e=new Uint8Array(n);e.set(new Uint8Array(E,Q,t)),o=new I(n)}if(o.length===B*r)a?A.pixels.resultPixels=d.swapDimensionOrder(o,B,r,I,!0):A.pixels.resultPixels=o;else{A.pixels.resultPixels=new I(B*r);var i=0,h=0,y=0,S=0;if(r>1){if(a){for(h=0;h=B)return!1;var C=new Uint32Array(B-r);d.decodeBits(E,A,C);var t=[],o,s,n,e;for(o=r;o0&&(t[s].second=G<>>32-e,32-k>=e?(k+=e,k===32&&(k=0,L++,G=f[L])):(k+=e-32,L++,G=f[L],t[s].second|=G>>>32-k));var w=0,D=0,l=new m;for(o=0;o=I?D=I:D=w;var F=[],c,R,U,M,J,q;for(o=r;o0)if(c=[e,s],e<=D)for(R=t[s].second<=0;M--)J=R>>>M&1,J?(q.right||(q.right=new m),q=q.right):(q.left||(q.left=new m),q=q.left),M===0&&!q.val&&(q.val=c[1]);return{decodeLut:F,numBitsLUTQick:D,numBitsLUT:w,tree:l,stuffedData:f,srcPtr:L,bitPos:k}},readHuffman:function(E,A,I,a){var Q=A.headerInfo,g=Q.numDims,r=A.headerInfo.height,B=A.headerInfo.width,C=B*r,t=this.readHuffmanTree(E,A),o=t.decodeLut,s=t.tree,n=t.stuffedData,e=t.srcPtr,i=t.bitPos,h=t.numBitsLUTQick,y=t.numBitsLUT,S=A.headerInfo.imageType===0?128:0,f,k,G,L=A.pixels.resultMask,w,D,l,F,c,R,U,M=0;i>0&&(e++,i=0);var J=n[e],q=A.encodeMode===1,O=new I(C*g),p=O,Y;if(g<2||q){for(Y=0;Y1&&(p=new I(O.buffer,C*Y,C),M=0),A.headerInfo.numValidPixel===B*r)for(R=0,F=0;F>>32-h,D=w,32-i>>64-i-h,D=w),o[D])k=o[D][1],i+=o[D][0];else for(w=J<>>32-y,D=w,32-i>>64-i-y,D=w),f=s,U=0;U>>y-U-1&1,f=l?f.right:f.left,!(f.left||f.right)){k=f.val,i=i+U+1;break}i>=32&&(i-=32,e++,J=n[e]),G=k-S,q?(c>0?G+=M:F>0?G+=p[R-B]:G+=M,G&=255,p[R]=G,M=G):p[R]=G}else for(R=0,F=0;F>>32-h,D=w,32-i>>64-i-h,D=w),o[D])k=o[D][1],i+=o[D][0];else for(w=J<>>32-y,D=w,32-i>>64-i-y,D=w),f=s,U=0;U>>y-U-1&1,f=l?f.right:f.left,!(f.left||f.right)){k=f.val,i=i+U+1;break}i>=32&&(i-=32,e++,J=n[e]),G=k-S,q?(c>0&&L[R-1]?G+=M:F>0&&L[R-B]?G+=p[R-B]:G+=M,G&=255,p[R]=G,M=G):p[R]=G}}else for(R=0,F=0;F>>32-h,D=w,32-i>>64-i-h,D=w),o[D])k=o[D][1],i+=o[D][0];else for(w=J<>>32-y,D=w,32-i>>64-i-y,D=w),f=s,U=0;U>>y-U-1&1,f=l?f.right:f.left,!(f.left||f.right)){k=f.val,i=i+U+1;break}i>=32&&(i-=32,e++,J=n[e]),G=k-S,p[R]=G}A.ptr=A.ptr+(e+1)*4+(i>0?4:0),A.pixels.resultPixels=O,g>1&&!a&&(A.pixels.resultPixels=d.swapDimensionOrder(O,C,g,I))},decodeBits:function(E,A,I,a,Q){{var g=A.headerInfo,r=g.fileVersion,B=0,C=E.byteLength-A.ptr>=5?5:E.byteLength-A.ptr,t=new DataView(E,A.ptr,C),o=t.getUint8(0);B++;var s=o>>6,n=s===0?4:3-s,e=(o&32)>0,i=o&31,h=0;if(n===1)h=t.getUint8(B),B++;else if(n===2)h=t.getUint16(B,!0),B+=2;else if(n===4)h=t.getUint32(B,!0),B+=4;else throw"Invalid valid pixel count type";var y=2*g.maxZError,S,f,k,G,L,w,D,l,F,c=g.numDims>1?g.maxValues[Q]:g.zMax;if(e){for(A.counter.lut++,l=t.getUint8(B),B++,G=Math.ceil((l-1)*i/8),L=Math.ceil(G/4),f=new ArrayBuffer(L*4),k=new Uint8Array(f),A.ptr+=B,k.set(new Uint8Array(E,A.ptr,G)),D=new Uint32Array(f),A.ptr+=G,F=0;l-1>>>F;)F++;G=Math.ceil(h*F/8),L=Math.ceil(G/4),f=new ArrayBuffer(L*4),k=new Uint8Array(f),k.set(new Uint8Array(E,A.ptr,G)),S=new Uint32Array(f),A.ptr+=G,r>=3?w=N.unstuffLUT2(D,i,l-1,a,y,c):w=N.unstuffLUT(D,i,l-1,a,y,c),r>=3?N.unstuff2(S,I,F,h,w):N.unstuff(S,I,F,h,w)}else A.counter.bitstuffer++,F=i,A.ptr+=B,F>0&&(G=Math.ceil(h*F/8),L=Math.ceil(G/4),f=new ArrayBuffer(L*4),k=new Uint8Array(f),k.set(new Uint8Array(E,A.ptr,G)),S=new Uint32Array(f),A.ptr+=G,r>=3?a==null?N.originalUnstuff2(S,I,F,h):N.unstuff2(S,I,F,h,!1,a,y,c):a==null?N.originalUnstuff(S,I,F,h):N.unstuff(S,I,F,h,!1,a,y,c))}},readTiles:function(E,A,I,a){var Q=A.headerInfo,g=Q.width,r=Q.height,B=g*r,C=Q.microBlockSize,t=Q.imageType,o=d.getDataTypeSize(t),s=Math.ceil(g/C),n=Math.ceil(r/C);A.pixels.numBlocksY=n,A.pixels.numBlocksX=s,A.pixels.ptr=0;var e=0,i=0,h=0,y=0,S=0,f=0,k=0,G=0,L=0,w=0,D=0,l=0,F=0,c=0,R=0,U=0,M,J,q,O,p,Y,j=new I(C*C),eA=r%C||C,aA=g%C||C,AA,T,_=Q.numDims,X,H=A.pixels.resultMask,x=A.pixels.resultPixels,oA=Q.fileVersion,CA=oA>=5?14:15,V,IA=Q.zMax,b;for(h=0;h1?(b=x,D=h*g*C+y*C,x=new I(A.pixels.resultPixels.buffer,B*X*o,B),IA=Q.maxValues[X]):b=null,k=E.byteLength-A.ptr,M=new DataView(E,A.ptr,Math.min(10,k)),J={},U=0,G=M.getUint8(0),U++,V=Q.fileVersion>=5?G&4:0,L=G>>6&255,w=G>>2&CA,w!==(y*C>>3&CA)||V&&X===0)throw"integrity issue";if(Y=G&3,Y>3)throw A.ptr+=U,"Invalid block encoding ("+Y+")";if(Y===2){if(V)if(H)for(e=0;e1&&!a&&(A.pixels.resultPixels=d.swapDimensionOrder(A.pixels.resultPixels,B,_,I))},formatFileInfo:function(E){return{fileIdentifierString:E.headerInfo.fileIdentifierString,fileVersion:E.headerInfo.fileVersion,imageType:E.headerInfo.imageType,height:E.headerInfo.height,width:E.headerInfo.width,numValidPixel:E.headerInfo.numValidPixel,microBlockSize:E.headerInfo.microBlockSize,blobSize:E.headerInfo.blobSize,maxZError:E.headerInfo.maxZError,pixelType:d.getPixelType(E.headerInfo.imageType),eofOffset:E.eofOffset,mask:E.mask?{numBytes:E.mask.numBytes}:null,pixels:{numBlocksX:E.pixels.numBlocksX,numBlocksY:E.pixels.numBlocksY,maxValue:E.headerInfo.zMax,minValue:E.headerInfo.zMin,noDataValue:E.noDataValue}}},constructConstantSurface:function(E,A){var I=E.headerInfo.zMax,a=E.headerInfo.zMin,Q=E.headerInfo.maxValues,g=E.headerInfo.numDims,r=E.headerInfo.height*E.headerInfo.width,B=0,C=0,t=0,o=E.pixels.resultMask,s=E.pixels.resultPixels;if(o)if(g>1){if(A)for(B=0;B1&&a!==I)if(A)for(B=0;B=-128&&A<=127;break;case 1:I=A>=0&&A<=255;break;case 2:I=A>=-32768&&A<=32767;break;case 3:I=A>=0&&A<=65536;break;case 4:I=A>=-2147483648&&A<=2147483647;break;case 5:I=A>=0&&A<=4294967296;break;case 6:I=A>=-34027999387901484e22&&A<=34027999387901484e22;break;case 7:I=A>=-17976931348623157e292&&A<=17976931348623157e292;break;default:I=!1}return I},getDataTypeSize:function(E){var A=0;switch(E){case 0:case 1:A=1;break;case 2:case 3:A=2;break;case 4:case 5:case 6:A=4;break;case 7:A=8;break;default:A=E}return A},getDataTypeUsed:function(E,A){var I=E;switch(E){case 2:case 4:I=E-A;break;case 3:case 5:I=E-2*A;break;case 6:A===0?I=E:A===1?I=2:I=1;break;case 7:A===0?I=E:I=E-2*A+1;break;default:I=E;break}return I},getOnePixel:function(E,A,I,a){var Q=0;switch(I){case 0:Q=a.getInt8(A);break;case 1:Q=a.getUint8(A);break;case 2:Q=a.getInt16(A,!0);break;case 3:Q=a.getUint16(A,!0);break;case 4:Q=a.getInt32(A,!0);break;case 5:Q=a.getUInt32(A,!0);break;case 6:Q=a.getFloat32(A,!0);break;case 7:Q=a.getFloat64(A,!0);break;default:throw"the decoder does not understand this pixel type"}return Q},swapDimensionOrder:function(E,A,I,a,Q){var g=0,r=0,B=0,C=0,t=E;if(I>1)if(t=new a(A*I),Q)for(g=0;g5)throw"unsupported lerc version 2."+r;d.readMask(E,Q),g.numValidPixel!==g.width*g.height&&!Q.pixels.resultMask&&(Q.pixels.resultMask=A.maskData);var C=g.width*g.height;Q.pixels.resultPixels=new B(C*g.numDims),Q.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var t=!A.returnPixelInterleavedDims;if(g.numValidPixel!==0)if(g.zMax===g.zMin)d.constructConstantSurface(Q,t);else if(r>=4&&d.checkMinMaxRanges(E,Q))d.constructConstantSurface(Q,t);else{var o=new DataView(E,Q.ptr,2),s=o.getUint8(0);if(Q.ptr++,s)d.readDataOneSweep(E,Q,B,t);else if(r>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var n=o.getUint8(1);if(Q.ptr++,Q.encodeMode=n,n>2||r<4&&n>1)throw"Invalid Huffman flag "+n;n?d.readHuffman(E,Q,B,t):d.readTiles(E,Q,B,t)}else d.readTiles(E,Q,B,t)}Q.eofOffset=Q.ptr;var e;A.inputOffset?(e=Q.headerInfo.blobSize+A.inputOffset-Q.ptr,Math.abs(e)>=1&&(Q.eofOffset=A.inputOffset+Q.headerInfo.blobSize)):(e=Q.headerInfo.blobSize-Q.ptr,Math.abs(e)>=1&&(Q.eofOffset=Q.headerInfo.blobSize));var i={width:g.width,height:g.height,pixelData:Q.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:Q.pixels.resultMask};if(Q.pixels.resultMask&&d.isValidPixelValue(g.imageType,I)){var h=Q.pixels.resultMask;for(a=0;a1&&(C&&r.push(C),s.fileInfo.mask&&s.fileInfo.mask.numBytes>0&&o++),a++,t.pixels.push(s.pixelData),t.statistics.push({minValue:s.minValue,maxValue:s.maxValue,noDataValue:s.noDataValue,dimStats:s.dimStats})}var n,e,i;if(I>1&&o>1){for(i=t.width*t.height,t.bandMasks=r,C=new Uint8Array(i),C.set(r[0]),n=1;nu.arrayBuffer()).then(u=>WebAssembly.instantiate(u,BA)).then(this._init):$=WebAssembly.instantiate(Buffer.from(EA,"base64"),BA).then(this._init),$)}_init(u){K=u.instance,BA.env.emscripten_notify_memory_growth(0)}decode(u,P=0){if(!K)throw new Error("ZSTDDecoder: Await .init() before decoding.");const Z=u.byteLength,v=K.exports.malloc(Z);QA.set(u,v),P=P||Number(K.exports.ZSTD_findDecompressedSize(v,Z));const N=K.exports.malloc(P),d=K.exports.ZSTD_decompress(N,P,v,Z),m=QA.slice(N,N+d);return K.exports.free(v),K.exports.free(N),m}}const EA="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IAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQh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ASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigC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C0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdB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IAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY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wOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEE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",fA=new wA;class lA extends DA{constructor(u){super(),this.planarConfiguration=typeof u.PlanarConfiguration<"u"?u.PlanarConfiguration:1,this.samplesPerPixel=typeof u.SamplesPerPixel<"u"?u.SamplesPerPixel:1,this.addCompression=u.LercParameters[sA.AddCompression]}decodeBlock(u){switch(this.addCompression){case gA.None:break;case gA.Deflate:u=tA(new Uint8Array(u)).buffer;break;case gA.Zstandard:u=fA.decode(new Uint8Array(u)).buffer;break;default:throw new Error(`Unsupported LERC additional compression method identifier: ${this.addCompression}`)}return hA.decode(u,{returnPixelInterleavedDims:this.planarConfiguration===1}).pixels[0].buffer}}export{lA as default,fA as zstd}; diff --git a/public/vite-dev/assets/lerc-uk49vBKp-C2xrmYNa.js.br b/public/vite-dev/assets/lerc-uk49vBKp-C2xrmYNa.js.br new file mode 100644 index 0000000..c07a553 Binary files /dev/null and b/public/vite-dev/assets/lerc-uk49vBKp-C2xrmYNa.js.br differ diff --git a/public/vite-dev/assets/lerc-uk49vBKp-C2xrmYNa.js.gz b/public/vite-dev/assets/lerc-uk49vBKp-C2xrmYNa.js.gz new file mode 100644 index 0000000..9a840c7 Binary files /dev/null and b/public/vite-dev/assets/lerc-uk49vBKp-C2xrmYNa.js.gz differ diff --git a/public/vite-dev/assets/lzw-5BnjP5Zu-Rtm9pMoi.js b/public/vite-dev/assets/lzw-5BnjP5Zu-Rtm9pMoi.js new file mode 100644 index 0000000..ab1e992 --- /dev/null +++ b/public/vite-dev/assets/lzw-5BnjP5Zu-Rtm9pMoi.js @@ -0,0 +1 @@ +import{g as E}from"./basedecoder-PFIibI7U-gdlnpIMU.js";const A=9,y=256,x=257,b=12;function U(f,r,o){const i=r%8,t=Math.floor(r/8),d=8-i,g=r+o-(t+1)*8;let u=8*(t+2)-(r+o);const w=(t+2)*8-r;if(u=Math.max(0,u),t>=f.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),x;let a=f[t]&2**(8-i)-1;a<<=o-d;let s=a;if(t+1>>u;l<<=Math.max(0,o-w),s+=l}if(g>8&&t+2>>l;s+=e}return s}function m(f,r){for(let o=r.length-1;o>=0;o--)f.push(r[o]);return f}function $(f){const r=new Uint16Array(4093),o=new Uint8Array(4093);for(let n=0;n<=257;n++)r[n]=4096,o[n]=n;let i=258,t=A,d=0;function g(){i=258,t=A}function u(n){const h=U(n,d,t);return d+=t,h}function w(n,h){return o[i]=h,r[i]=n,i++,i-1}function a(n){const h=[];for(let p=n;p!==4096;p=r[p])h.push(o[p]);return h}const s=[];g();const l=new Uint8Array(f);let e=u(l),c;for(;e!==x;){if(e===y){for(g(),e=u(l);e===y;)e=u(l);if(e===x)break;if(e>y)throw new Error(`corrupted code at scanline ${e}`);{const n=a(e);m(s,n),c=e}}else if(e=2**t&&(t===b?c=void 0:t++),e=u(l)}return new Uint8Array(s)}class B extends E{decodeBlock(r){return $(r).buffer}}export{B as default}; diff --git a/public/vite-dev/assets/lzw-5BnjP5Zu-Rtm9pMoi.js.br b/public/vite-dev/assets/lzw-5BnjP5Zu-Rtm9pMoi.js.br new file mode 100644 index 0000000..24c911b Binary files /dev/null and b/public/vite-dev/assets/lzw-5BnjP5Zu-Rtm9pMoi.js.br differ diff --git a/public/vite-dev/assets/lzw-5BnjP5Zu-Rtm9pMoi.js.gz b/public/vite-dev/assets/lzw-5BnjP5Zu-Rtm9pMoi.js.gz new file mode 100644 index 0000000..2a8ad5f Binary files /dev/null and b/public/vite-dev/assets/lzw-5BnjP5Zu-Rtm9pMoi.js.gz differ diff --git a/public/vite-dev/assets/ol-BxkN_WYY.css b/public/vite-dev/assets/ol-BxkN_WYY.css new file mode 100644 index 0000000..5f31035 --- /dev/null +++ b/public/vite-dev/assets/ol-BxkN_WYY.css @@ -0,0 +1 @@ +:root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:none}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move} diff --git a/public/vite-dev/assets/ol-BxkN_WYY.css.br b/public/vite-dev/assets/ol-BxkN_WYY.css.br new file mode 100644 index 0000000..0ddb252 Binary files /dev/null and b/public/vite-dev/assets/ol-BxkN_WYY.css.br differ diff --git a/public/vite-dev/assets/ol-BxkN_WYY.css.gz b/public/vite-dev/assets/ol-BxkN_WYY.css.gz new file mode 100644 index 0000000..acbe14e Binary files /dev/null and b/public/vite-dev/assets/ol-BxkN_WYY.css.gz differ diff --git a/public/vite-dev/assets/ol-CZCByJ0B.js b/public/vite-dev/assets/ol-CZCByJ0B.js new file mode 100644 index 0000000..59c9ba4 --- /dev/null +++ b/public/vite-dev/assets/ol-CZCByJ0B.js @@ -0,0 +1 @@ +import{O as e}from"./index-pmp42xxj-DHbdtNrf.js";document.addEventListener("DOMContentLoaded",()=>{new e().run()}); diff --git a/public/vite-dev/assets/ol-CZCByJ0B.js.br b/public/vite-dev/assets/ol-CZCByJ0B.js.br new file mode 100644 index 0000000..3fc12f2 Binary files /dev/null and b/public/vite-dev/assets/ol-CZCByJ0B.js.br differ diff --git a/public/vite-dev/assets/ol-CZCByJ0B.js.gz b/public/vite-dev/assets/ol-CZCByJ0B.js.gz new file mode 100644 index 0000000..8cf6011 Binary files /dev/null and b/public/vite-dev/assets/ol-CZCByJ0B.js.gz differ diff --git a/public/vite-dev/assets/packbits-QLsyzNt2-BPOn6aoD.js b/public/vite-dev/assets/packbits-QLsyzNt2-BPOn6aoD.js new file mode 100644 index 0000000..385d71f --- /dev/null +++ b/public/vite-dev/assets/packbits-QLsyzNt2-BPOn6aoD.js @@ -0,0 +1 @@ +import{g as s}from"./basedecoder-PFIibI7U-gdlnpIMU.js";class c extends s{decodeBlock(l){const o=new DataView(l),r=[];for(let e=0;e=0;)e[a]=0}const ae=3,ne=258,Mt=29,ie=256,re=ie+1+Mt,Ht=30,se=512,oe=new Array((re+2)*2);z(oe);const le=new Array(Ht*2);z(le);const de=new Array(se);z(de);const fe=new Array(ne-ae+1);z(fe);const ce=new Array(Mt);z(ce);const he=new Array(Ht);z(he);const ue=(e,a,t,s)=>{let o=e&65535|0,r=e>>>16&65535|0,c=0;for(;t!==0;){c=t>2e3?2e3:t,t-=c;do o=o+a[s++]|0,r=r+o|0;while(--c);o%=65521,r%=65521}return o|r<<16|0};var it=ue;const we=()=>{let e,a=[];for(var t=0;t<256;t++){e=t;for(var s=0;s<8;s++)e=e&1?3988292384^e>>>1:e>>>1;a[t]=e}return a},be=new Uint32Array(we()),me=(e,a,t,s)=>{const o=be,r=s+t;e^=-1;for(let c=s;c>>8^o[(e^a[c])&255];return e^-1};var T=me,rt={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},ot={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const ke=(e,a)=>Object.prototype.hasOwnProperty.call(e,a);var _e=function(e){const a=Array.prototype.slice.call(arguments,1);for(;a.length;){const t=a.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const s in t)ke(t,s)&&(e[s]=t[s])}}return e},ge=e=>{let a=0;for(let s=0,o=e.length;s=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;L[254]=L[254]=1;var pe=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let a,t,s,o,r,c=e.length,d=0;for(o=0;o>>6,a[r++]=128|t&63):t<65536?(a[r++]=224|t>>>12,a[r++]=128|t>>>6&63,a[r++]=128|t&63):(a[r++]=240|t>>>18,a[r++]=128|t>>>12&63,a[r++]=128|t>>>6&63,a[r++]=128|t&63);return a};const ve=(e,a)=>{if(a<65534&&e.subarray&&Pt)return String.fromCharCode.apply(null,e.length===a?e:e.subarray(0,a));let t="";for(let s=0;s{const t=a||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,a));let s,o;const r=new Array(t*2);for(o=0,s=0;s4){r[o++]=65533,s+=d-1;continue}for(c&=d===2?31:d===3?15:7;d>1&&s1){r[o++]=65533;continue}c<65536?r[o++]=c:(c-=65536,r[o++]=55296|c>>10&1023,r[o++]=56320|c&1023)}return ve(r,o)},xe=(e,a)=>{a=a||e.length,a>e.length&&(a=e.length);let t=a-1;for(;t>=0&&(e[t]&192)===128;)t--;return t<0||t===0?a:t+L[e[t]]>a?t:a},st={string2buf:pe,buf2string:ye,utf8border:xe};function Ee(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Ae=Ee;const j=16209,Re=16191;var Ze=function(e,a){let t,s,o,r,c,d,v,n,i,E,h,l,R,Z,g,m,b,f,w,A,p,_,y,u;const k=e.state;t=e.next_in,y=e.input,s=t+(e.avail_in-5),o=e.next_out,u=e.output,r=o-(a-e.avail_out),c=o+(e.avail_out-257),d=k.dmax,v=k.wsize,n=k.whave,i=k.wnext,E=k.window,h=k.hold,l=k.bits,R=k.lencode,Z=k.distcode,g=(1<>>24,h>>>=f,l-=f,f=b>>>16&255,f===0)u[o++]=b&65535;else if(f&16){w=b&65535,f&=15,f&&(l>>=f,l-=f),l<15&&(h+=y[t++]<>>24,h>>>=f,l-=f,f=b>>>16&255,f&16){if(A=b&65535,f&=15,ld){e.msg="invalid distance too far back",k.mode=j;break t}if(h>>>=f,l-=f,f=o-r,A>f){if(f=A-f,f>n&&k.sane){e.msg="invalid distance too far back",k.mode=j;break t}if(p=0,_=E,i===0){if(p+=v-f,f2;)u[o++]=_[p++],u[o++]=_[p++],u[o++]=_[p++],w-=3;w&&(u[o++]=_[p++],w>1&&(u[o++]=_[p++]))}else{p=o-A;do u[o++]=u[p++],u[o++]=u[p++],u[o++]=u[p++],w-=3;while(w>2);w&&(u[o++]=u[p++],w>1&&(u[o++]=u[p++]))}}else if(f&64){e.msg="invalid distance code",k.mode=j;break t}else{b=Z[(b&65535)+(h&(1<>3,t-=w,l-=w<<3,h&=(1<{const v=d.bits;let n=0,i=0,E=0,h=0,l=0,R=0,Z=0,g=0,m=0,b=0,f,w,A,p,_,y=null,u;const k=new Uint16Array(B+1),S=new Uint16Array(B+1);let I=null,dt,K,P;for(n=0;n<=B;n++)k[n]=0;for(i=0;i=1&&k[h]===0;h--);if(l>h&&(l=h),h===0)return o[r++]=1<<24|64<<16|0,o[r++]=1<<24|64<<16|0,d.bits=1,0;for(E=1;E0&&(e===ht||h!==1))return-1;for(S[1]=0,n=1;nft||e===ut&&m>ct)return 1;for(;;){dt=n-Z,c[i]+1=u?(K=I[c[i]-u],P=y[c[i]-u]):(K=96,P=0),f=1<>Z)+w]=dt<<24|K<<16|P|0;while(w!==0);for(f=1<>=1;if(f!==0?(b&=f-1,b+=f):b=0,i++,--k[n]===0){if(n===h)break;n=a[t+c[i]]}if(n>l&&(b&p)!==A){for(Z===0&&(Z=l),_+=E,R=n-Z,g=1<ft||e===ut&&m>ct)return 1;A=b&p,o[A]=l<<24|R<<16|_-r|0}}return b!==0&&(o[_+b]=n-Z<<24|64<<16|0),d.bits=l,0};var F=Oe;const Ie=0,jt=1,Gt=2,{Z_FINISH:wt,Z_BLOCK:Ce,Z_TREES:G,Z_OK:C,Z_STREAM_END:Ne,Z_NEED_DICT:Be,Z_STREAM_ERROR:D,Z_DATA_ERROR:Yt,Z_MEM_ERROR:Jt,Z_BUF_ERROR:ze,Z_DEFLATED:bt}=ot,$=16180,mt=16181,kt=16182,_t=16183,gt=16184,pt=16185,vt=16186,yt=16187,xt=16188,Et=16189,X=16190,U=16191,Q=16192,At=16193,W=16194,Rt=16195,Zt=16196,St=16197,Dt=16198,Y=16199,J=16200,Tt=16201,Ut=16202,Ot=16203,It=16204,Ct=16205,V=16206,Nt=16207,Bt=16208,x=16209,Xt=16210,$t=16211,Fe=852,Le=592,Me=15,He=Me,zt=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function Ke(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const N=e=>{if(!e)return 1;const a=e.state;return!a||a.strm!==e||a.mode<$||a.mode>$t?1:0},qt=e=>{if(N(e))return D;const a=e.state;return e.total_in=e.total_out=a.total=0,e.msg="",a.wrap&&(e.adler=a.wrap&1),a.mode=$,a.last=0,a.havedict=0,a.flags=-1,a.dmax=32768,a.head=null,a.hold=0,a.bits=0,a.lencode=a.lendyn=new Int32Array(Fe),a.distcode=a.distdyn=new Int32Array(Le),a.sane=1,a.back=-1,C},Qt=e=>{if(N(e))return D;const a=e.state;return a.wsize=0,a.whave=0,a.wnext=0,qt(e)},Wt=(e,a)=>{let t;if(N(e))return D;const s=e.state;return a<0?(t=0,a=-a):(t=(a>>4)+5,a<48&&(a&=15)),a&&(a<8||a>15)?D:(s.window!==null&&s.wbits!==a&&(s.window=null),s.wrap=t,s.wbits=a,Qt(e))},Vt=(e,a)=>{if(!e)return D;const t=new Ke;e.state=t,t.strm=e,t.window=null,t.mode=$;const s=Wt(e,a);return s!==C&&(e.state=null),s},Pe=e=>Vt(e,He);let Ft=!0,tt,et;const je=e=>{if(Ft){tt=new Int32Array(512),et=new Int32Array(32);let a=0;for(;a<144;)e.lens[a++]=8;for(;a<256;)e.lens[a++]=9;for(;a<280;)e.lens[a++]=7;for(;a<288;)e.lens[a++]=8;for(F(jt,e.lens,0,288,tt,0,e.work,{bits:9}),a=0;a<32;)e.lens[a++]=5;F(Gt,e.lens,0,32,et,0,e.work,{bits:5}),Ft=!1}e.lencode=tt,e.lenbits=9,e.distcode=et,e.distbits=5},te=(e,a,t,s)=>{let o;const r=e.state;return r.window===null&&(r.wsize=1<=r.wsize?(r.window.set(a.subarray(t-r.wsize,t),0),r.wnext=0,r.whave=r.wsize):(o=r.wsize-r.wnext,o>s&&(o=s),r.window.set(a.subarray(t-s,t-s+o),r.wnext),s-=o,s?(r.window.set(a.subarray(t-s,t),0),r.wnext=s,r.whave=r.wsize):(r.wnext+=o,r.wnext===r.wsize&&(r.wnext=0),r.whave{let t,s,o,r,c,d,v,n,i,E,h,l,R,Z,g=0,m,b,f,w,A,p,_,y;const u=new Uint8Array(4);let k,S;const I=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(N(e)||!e.output||!e.input&&e.avail_in!==0)return D;t=e.state,t.mode===U&&(t.mode=Q),c=e.next_out,o=e.output,v=e.avail_out,r=e.next_in,s=e.input,d=e.avail_in,n=t.hold,i=t.bits,E=d,h=v,y=C;t:for(;;)switch(t.mode){case $:if(t.wrap===0){t.mode=Q;break}for(;i<16;){if(d===0)break t;d--,n+=s[r++]<>>8&255,t.check=T(t.check,u,2,0),n=0,i=0,t.mode=mt;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((n&255)<<8)+(n>>8))%31){e.msg="incorrect header check",t.mode=x;break}if((n&15)!==bt){e.msg="unknown compression method",t.mode=x;break}if(n>>>=4,i-=4,_=(n&15)+8,t.wbits===0&&(t.wbits=_),_>15||_>t.wbits){e.msg="invalid window size",t.mode=x;break}t.dmax=1<>8&1),t.flags&512&&t.wrap&4&&(u[0]=n&255,u[1]=n>>>8&255,t.check=T(t.check,u,2,0)),n=0,i=0,t.mode=kt;case kt:for(;i<32;){if(d===0)break t;d--,n+=s[r++]<>>8&255,u[2]=n>>>16&255,u[3]=n>>>24&255,t.check=T(t.check,u,4,0)),n=0,i=0,t.mode=_t;case _t:for(;i<16;){if(d===0)break t;d--,n+=s[r++]<>8),t.flags&512&&t.wrap&4&&(u[0]=n&255,u[1]=n>>>8&255,t.check=T(t.check,u,2,0)),n=0,i=0,t.mode=gt;case gt:if(t.flags&1024){for(;i<16;){if(d===0)break t;d--,n+=s[r++]<>>8&255,t.check=T(t.check,u,2,0)),n=0,i=0}else t.head&&(t.head.extra=null);t.mode=pt;case pt:if(t.flags&1024&&(l=t.length,l>d&&(l=d),l&&(t.head&&(_=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(s.subarray(r,r+l),_)),t.flags&512&&t.wrap&4&&(t.check=T(t.check,s,l,r)),d-=l,r+=l,t.length-=l),t.length))break t;t.length=0,t.mode=vt;case vt:if(t.flags&2048){if(d===0)break t;l=0;do _=s[r+l++],t.head&&_&&t.length<65536&&(t.head.name+=String.fromCharCode(_));while(_&&l>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=U;break;case Et:for(;i<32;){if(d===0)break t;d--,n+=s[r++]<>>=i&7,i-=i&7,t.mode=V;break}for(;i<3;){if(d===0)break t;d--,n+=s[r++]<>>=1,i-=1,n&3){case 0:t.mode=At;break;case 1:if(je(t),t.mode=Y,a===G){n>>>=2,i-=2;break t}break;case 2:t.mode=Zt;break;case 3:e.msg="invalid block type",t.mode=x}n>>>=2,i-=2;break;case At:for(n>>>=i&7,i-=i&7;i<32;){if(d===0)break t;d--,n+=s[r++]<>>16^65535)){e.msg="invalid stored block lengths",t.mode=x;break}if(t.length=n&65535,n=0,i=0,t.mode=W,a===G)break t;case W:t.mode=Rt;case Rt:if(l=t.length,l){if(l>d&&(l=d),l>v&&(l=v),l===0)break t;o.set(s.subarray(r,r+l),c),d-=l,r+=l,v-=l,c+=l,t.length-=l;break}t.mode=U;break;case Zt:for(;i<14;){if(d===0)break t;d--,n+=s[r++]<>>=5,i-=5,t.ndist=(n&31)+1,n>>>=5,i-=5,t.ncode=(n&15)+4,n>>>=4,i-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=x;break}t.have=0,t.mode=St;case St:for(;t.have>>=3,i-=3}for(;t.have<19;)t.lens[I[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,k={bits:t.lenbits},y=F(Ie,t.lens,0,19,t.lencode,0,t.work,k),t.lenbits=k.bits,y){e.msg="invalid code lengths set",t.mode=x;break}t.have=0,t.mode=Dt;case Dt:for(;t.have>>24,b=g>>>16&255,f=g&65535,!(m<=i);){if(d===0)break t;d--,n+=s[r++]<>>=m,i-=m,t.lens[t.have++]=f;else{if(f===16){for(S=m+2;i>>=m,i-=m,t.have===0){e.msg="invalid bit length repeat",t.mode=x;break}_=t.lens[t.have-1],l=3+(n&3),n>>>=2,i-=2}else if(f===17){for(S=m+3;i>>=m,i-=m,_=0,l=3+(n&7),n>>>=3,i-=3}else{for(S=m+7;i>>=m,i-=m,_=0,l=11+(n&127),n>>>=7,i-=7}if(t.have+l>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=x;break}for(;l--;)t.lens[t.have++]=_}}if(t.mode===x)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=x;break}if(t.lenbits=9,k={bits:t.lenbits},y=F(jt,t.lens,0,t.nlen,t.lencode,0,t.work,k),t.lenbits=k.bits,y){e.msg="invalid literal/lengths set",t.mode=x;break}if(t.distbits=6,t.distcode=t.distdyn,k={bits:t.distbits},y=F(Gt,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,k),t.distbits=k.bits,y){e.msg="invalid distances set",t.mode=x;break}if(t.mode=Y,a===G)break t;case Y:t.mode=J;case J:if(d>=6&&v>=258){e.next_out=c,e.avail_out=v,e.next_in=r,e.avail_in=d,t.hold=n,t.bits=i,Ze(e,h),c=e.next_out,o=e.output,v=e.avail_out,r=e.next_in,s=e.input,d=e.avail_in,n=t.hold,i=t.bits,t.mode===U&&(t.back=-1);break}for(t.back=0;g=t.lencode[n&(1<>>24,b=g>>>16&255,f=g&65535,!(m<=i);){if(d===0)break t;d--,n+=s[r++]<>w)],m=g>>>24,b=g>>>16&255,f=g&65535,!(w+m<=i);){if(d===0)break t;d--,n+=s[r++]<>>=w,i-=w,t.back+=w}if(n>>>=m,i-=m,t.back+=m,t.length=f,b===0){t.mode=Ct;break}if(b&32){t.back=-1,t.mode=U;break}if(b&64){e.msg="invalid literal/length code",t.mode=x;break}t.extra=b&15,t.mode=Tt;case Tt:if(t.extra){for(S=t.extra;i>>=t.extra,i-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=Ut;case Ut:for(;g=t.distcode[n&(1<>>24,b=g>>>16&255,f=g&65535,!(m<=i);){if(d===0)break t;d--,n+=s[r++]<>w)],m=g>>>24,b=g>>>16&255,f=g&65535,!(w+m<=i);){if(d===0)break t;d--,n+=s[r++]<>>=w,i-=w,t.back+=w}if(n>>>=m,i-=m,t.back+=m,b&64){e.msg="invalid distance code",t.mode=x;break}t.offset=f,t.extra=b&15,t.mode=Ot;case Ot:if(t.extra){for(S=t.extra;i>>=t.extra,i-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=x;break}t.mode=It;case It:if(v===0)break t;if(l=h-v,t.offset>l){if(l=t.offset-l,l>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=x;break}l>t.wnext?(l-=t.wnext,R=t.wsize-l):R=t.wnext-l,l>t.length&&(l=t.length),Z=t.window}else Z=o,R=c-t.offset,l=t.length;l>v&&(l=v),v-=l,t.length-=l;do o[c++]=Z[R++];while(--l);t.length===0&&(t.mode=J);break;case Ct:if(v===0)break t;o[c++]=t.length,v--,t.mode=J;break;case V:if(t.wrap){for(;i<32;){if(d===0)break t;d--,n|=s[r++]<{if(N(e))return D;let a=e.state;return a.window&&(a.window=null),e.state=null,C},Je=(e,a)=>{if(N(e))return D;const t=e.state;return t.wrap&2?(t.head=a,a.done=!1,C):D},Xe=(e,a)=>{const t=a.length;let s,o,r;return N(e)||(s=e.state,s.wrap!==0&&s.mode!==X)?D:s.mode===X&&(o=1,o=it(o,a,t,0),o!==s.check)?Yt:(r=te(e,a,t,t),r?(s.mode=Xt,Jt):(s.havedict=1,C))};var $e=Qt,qe=Wt,Qe=qt,We=Pe,Ve=Vt,ta=Ge,ea=Ye,aa=Je,na=Xe,ia="pako inflate (from Nodeca project)",O={inflateReset:$e,inflateReset2:qe,inflateResetKeep:Qe,inflateInit:We,inflateInit2:Ve,inflate:ta,inflateEnd:ea,inflateGetHeader:aa,inflateSetDictionary:na,inflateInfo:ia};function ra(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var sa=ra;const ee=Object.prototype.toString,{Z_NO_FLUSH:oa,Z_FINISH:la,Z_OK:M,Z_STREAM_END:at,Z_NEED_DICT:nt,Z_STREAM_ERROR:da,Z_DATA_ERROR:Lt,Z_MEM_ERROR:fa}=ot;function H(e){this.options=Kt.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const a=this.options;a.raw&&a.windowBits>=0&&a.windowBits<16&&(a.windowBits=-a.windowBits,a.windowBits===0&&(a.windowBits=-15)),a.windowBits>=0&&a.windowBits<16&&!(e&&e.windowBits)&&(a.windowBits+=32),a.windowBits>15&&a.windowBits<48&&(a.windowBits&15||(a.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ae,this.strm.avail_out=0;let t=O.inflateInit2(this.strm,a.windowBits);if(t!==M)throw new Error(rt[t]);if(this.header=new sa,O.inflateGetHeader(this.strm,this.header),a.dictionary&&(typeof a.dictionary=="string"?a.dictionary=st.string2buf(a.dictionary):ee.call(a.dictionary)==="[object ArrayBuffer]"&&(a.dictionary=new Uint8Array(a.dictionary)),a.raw&&(t=O.inflateSetDictionary(this.strm,a.dictionary),t!==M)))throw new Error(rt[t])}H.prototype.push=function(e,a){const t=this.strm,s=this.options.chunkSize,o=this.options.dictionary;let r,c,d;if(this.ended)return!1;for(a===~~a?c=a:c=a===!0?la:oa,ee.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(s),t.next_out=0,t.avail_out=s),r=O.inflate(t,c),r===nt&&o&&(r=O.inflateSetDictionary(t,o),r===M?r=O.inflate(t,c):r===Lt&&(r=nt));t.avail_in>0&&r===at&&t.state.wrap>0&&e[t.next_in]!==0;)O.inflateReset(t),r=O.inflate(t,c);switch(r){case da:case Lt:case nt:case fa:return this.onEnd(r),this.ended=!0,!1}if(d=t.avail_out,t.next_out&&(t.avail_out===0||r===at))if(this.options.to==="string"){let v=st.utf8border(t.output,t.next_out),n=t.next_out-v,i=st.buf2string(t.output,v);t.next_out=n,t.avail_out=s-n,n&&t.output.set(t.output.subarray(v,v+n),0),this.onData(i)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(r===M&&d===0)){if(r===at)return r=O.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(t.avail_in===0)break}}return!0};H.prototype.onData=function(e){this.chunks.push(e)};H.prototype.onEnd=function(e){e===M&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Kt.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function lt(e,a){const t=new H(a);if(t.push(e),t.err)throw t.msg||rt[t.err];return t.result}function ca(e,a){return a=a||{},a.raw=!0,lt(e,a)}var ha=H,ua=lt,wa=ca,ba=lt,ma=ot,ka={Inflate:ha,inflate:ua,inflateRaw:wa,ungzip:ba,constants:ma};const{Inflate:ga,inflate:_a,inflateRaw:pa,ungzip:va}=ka;var ya=_a;export{ya as b}; diff --git a/public/vite-dev/assets/pako.esm-BSHzuB9t-DQSVoCko.js.br b/public/vite-dev/assets/pako.esm-BSHzuB9t-DQSVoCko.js.br new file mode 100644 index 0000000..d467967 Binary files /dev/null and b/public/vite-dev/assets/pako.esm-BSHzuB9t-DQSVoCko.js.br differ diff --git a/public/vite-dev/assets/pako.esm-BSHzuB9t-DQSVoCko.js.gz b/public/vite-dev/assets/pako.esm-BSHzuB9t-DQSVoCko.js.gz new file mode 100644 index 0000000..84e5a31 Binary files /dev/null and b/public/vite-dev/assets/pako.esm-BSHzuB9t-DQSVoCko.js.gz differ diff --git a/public/vite-dev/assets/raw-_eObXrMO-z93--tm9.js b/public/vite-dev/assets/raw-_eObXrMO-z93--tm9.js new file mode 100644 index 0000000..6c51b92 --- /dev/null +++ b/public/vite-dev/assets/raw-_eObXrMO-z93--tm9.js @@ -0,0 +1 @@ +import{g as d}from"./basedecoder-PFIibI7U-gdlnpIMU.js";class t extends d{decodeBlock(e){return e}}export{t as default}; diff --git a/public/vite-dev/assets/raw-_eObXrMO-z93--tm9.js.br b/public/vite-dev/assets/raw-_eObXrMO-z93--tm9.js.br new file mode 100644 index 0000000..f3509a2 Binary files /dev/null and b/public/vite-dev/assets/raw-_eObXrMO-z93--tm9.js.br differ diff --git a/public/vite-dev/assets/raw-_eObXrMO-z93--tm9.js.gz b/public/vite-dev/assets/raw-_eObXrMO-z93--tm9.js.gz new file mode 100644 index 0000000..46df5ca Binary files /dev/null and b/public/vite-dev/assets/raw-_eObXrMO-z93--tm9.js.gz differ diff --git a/public/vite-dev/assets/webimage-Hf-HYtMO-Cer-ofJO.js b/public/vite-dev/assets/webimage-Hf-HYtMO-Cer-ofJO.js new file mode 100644 index 0000000..65e0974 --- /dev/null +++ b/public/vite-dev/assets/webimage-Hf-HYtMO-Cer-ofJO.js @@ -0,0 +1 @@ +import{g as r}from"./basedecoder-PFIibI7U-gdlnpIMU.js";class d extends r{constructor(){if(super(),typeof createImageBitmap>"u")throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if(typeof document>"u"&&typeof OffscreenCanvas>"u")throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available")}async decode(i,n){const o=new Blob([n]),e=await createImageBitmap(o);let t;typeof document<"u"?(t=document.createElement("canvas"),t.width=e.width,t.height=e.height):t=new OffscreenCanvas(e.width,e.height);const a=t.getContext("2d");return a.drawImage(e,0,0),a.getImageData(0,0,e.width,e.height).data.buffer}}export{d as default}; diff --git a/public/vite-dev/assets/webimage-Hf-HYtMO-Cer-ofJO.js.br b/public/vite-dev/assets/webimage-Hf-HYtMO-Cer-ofJO.js.br new file mode 100644 index 0000000..e96bdaf Binary files /dev/null and b/public/vite-dev/assets/webimage-Hf-HYtMO-Cer-ofJO.js.br differ diff --git a/public/vite-dev/assets/webimage-Hf-HYtMO-Cer-ofJO.js.gz b/public/vite-dev/assets/webimage-Hf-HYtMO-Cer-ofJO.js.gz new file mode 100644 index 0000000..65caeaa Binary files /dev/null and b/public/vite-dev/assets/webimage-Hf-HYtMO-Cer-ofJO.js.gz differ diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..754de27 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from 'vite' +import rails from 'vite-plugin-rails' + +export default defineConfig({ + plugins: [ + rails(), + ] +}) diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..1b81a44 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,1433 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.14.5", "@babel/runtime@^7.9.2": + version "7.24.4" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.4.tgz#de795accd698007a66ba44add6cc86542aff1edd" + integrity sha512-dkxf7+hn8mFBwKjs9bvBlArzLVxVbS8usaPUDd5p2a9JCL9tB8OaOVN1isD4+Xyk4ns89/xeOmbQvgdK7IIVdA== + dependencies: + regenerator-runtime "^0.14.0" + +"@esbuild/aix-ppc64@0.20.2": + version "0.20.2" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz#a70f4ac11c6a1dfc18b8bbb13284155d933b9537" + integrity sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g== + +"@esbuild/android-arm64@0.20.2": + version "0.20.2" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz#db1c9202a5bc92ea04c7b6840f1bbe09ebf9e6b9" + integrity sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg== + +"@esbuild/android-arm@0.20.2": + version "0.20.2" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.20.2.tgz#3b488c49aee9d491c2c8f98a909b785870d6e995" + integrity sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w== + +"@esbuild/android-x64@0.20.2": + version "0.20.2" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.20.2.tgz#3b1628029e5576249d2b2d766696e50768449f98" + integrity sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg== + +"@esbuild/darwin-arm64@0.20.2": + version "0.20.2" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz#6e8517a045ddd86ae30c6608c8475ebc0c4000bb" + integrity sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA== + +"@esbuild/darwin-x64@0.20.2": + version "0.20.2" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz#90ed098e1f9dd8a9381695b207e1cff45540a0d0" + integrity sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA== + +"@esbuild/freebsd-arm64@0.20.2": + version "0.20.2" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz#d71502d1ee89a1130327e890364666c760a2a911" + integrity sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw== + +"@esbuild/freebsd-x64@0.20.2": + version "0.20.2" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz#aa5ea58d9c1dd9af688b8b6f63ef0d3d60cea53c" + integrity sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw== + +"@esbuild/linux-arm64@0.20.2": + version "0.20.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz#055b63725df678379b0f6db9d0fa85463755b2e5" + integrity sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A== + +"@esbuild/linux-arm@0.20.2": + version "0.20.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz#76b3b98cb1f87936fbc37f073efabad49dcd889c" + integrity sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg== + +"@esbuild/linux-ia32@0.20.2": + version "0.20.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz#c0e5e787c285264e5dfc7a79f04b8b4eefdad7fa" + integrity sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig== + +"@esbuild/linux-loong64@0.20.2": + version "0.20.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz#a6184e62bd7cdc63e0c0448b83801001653219c5" + integrity sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ== + +"@esbuild/linux-mips64el@0.20.2": + version "0.20.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz#d08e39ce86f45ef8fc88549d29c62b8acf5649aa" + integrity sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA== + +"@esbuild/linux-ppc64@0.20.2": + version "0.20.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz#8d252f0b7756ffd6d1cbde5ea67ff8fd20437f20" + integrity sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg== + +"@esbuild/linux-riscv64@0.20.2": + version "0.20.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz#19f6dcdb14409dae607f66ca1181dd4e9db81300" + integrity sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg== + +"@esbuild/linux-s390x@0.20.2": + version "0.20.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz#3c830c90f1a5d7dd1473d5595ea4ebb920988685" + integrity sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ== + +"@esbuild/linux-x64@0.20.2": + version "0.20.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz#86eca35203afc0d9de0694c64ec0ab0a378f6fff" + integrity sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw== + +"@esbuild/netbsd-x64@0.20.2": + version "0.20.2" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz#e771c8eb0e0f6e1877ffd4220036b98aed5915e6" + integrity sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ== + +"@esbuild/openbsd-x64@0.20.2": + version "0.20.2" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz#9a795ae4b4e37e674f0f4d716f3e226dd7c39baf" + integrity sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ== + +"@esbuild/sunos-x64@0.20.2": + version "0.20.2" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz#7df23b61a497b8ac189def6e25a95673caedb03f" + integrity sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w== + +"@esbuild/win32-arm64@0.20.2": + version "0.20.2" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz#f1ae5abf9ca052ae11c1bc806fb4c0f519bacf90" + integrity sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ== + +"@esbuild/win32-ia32@0.20.2": + version "0.20.2" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz#241fe62c34d8e8461cd708277813e1d0ba55ce23" + integrity sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ== + +"@esbuild/win32-x64@0.20.2": + version "0.20.2" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz#9c907b21e30a52db959ba4f80bb01a0cc403d5cc" + integrity sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ== + +"@floating-ui/core@^1.0.0": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.6.0.tgz#fa41b87812a16bf123122bf945946bae3fdf7fc1" + integrity sha512-PcF++MykgmTj3CIyOQbKA/hDzOAiqI3mhuoN44WRCopIs1sgoDoU4oty4Jtqaj/y3oDU6fnVSm4QG0a3t5i0+g== + dependencies: + "@floating-ui/utils" "^0.2.1" + +"@floating-ui/dom@^1.6.1": + version "1.6.3" + resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.6.3.tgz#954e46c1dd3ad48e49db9ada7218b0985cee75ef" + integrity sha512-RnDthu3mzPlQ31Ss/BTwQ1zjzIhr3lk1gZB1OC56h/1vEtaXkESrOqL5fQVMfXpwGtRwX+YsZBdyHtJMQnkArw== + dependencies: + "@floating-ui/core" "^1.0.0" + "@floating-ui/utils" "^0.2.0" + +"@floating-ui/react-dom@^2.0.0": + version "2.0.8" + resolved "https://registry.yarnpkg.com/@floating-ui/react-dom/-/react-dom-2.0.8.tgz#afc24f9756d1b433e1fe0d047c24bd4d9cefaa5d" + integrity sha512-HOdqOt3R3OGeTKidaLvJKcgg75S6tibQ3Tif4eyd91QnIJWr0NLvoXFpJA/j8HqkFSL68GDca9AuyWEHlhyClw== + dependencies: + "@floating-ui/dom" "^1.6.1" + +"@floating-ui/utils@^0.2.0", "@floating-ui/utils@^0.2.1": + version "0.2.1" + resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.2.1.tgz#16308cea045f0fc777b6ff20a9f25474dd8293d2" + integrity sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q== + +"@geoblacklight/frontend@^4.4": + version "4.4.6" + resolved "https://registry.yarnpkg.com/@geoblacklight/frontend/-/frontend-4.4.6.tgz#11e688d37b6b2faa086ed2d1e2426c661b1bdade" + integrity sha512-7+Xs6CQTAIjOMDM3ER5AKNqXxUDNanDDgzdEFL4lsf218A0lIMhWL3KbvjRCbd1g34Pn/kqMeA5g83gvC/aSqQ== + dependencies: + "@samvera/clover-iiif" "^2.3.2" + ol "8.1.0" + ol-pmtiles "^0.3.0" + react "^18.2.0" + +"@iiif/parser@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@iiif/parser/-/parser-1.1.2.tgz#20bb2b0b74756ee6f35db4e9b0b0b54173ae6b0e" + integrity sha512-yjbhSWBB+cWHjAgeWlMYgNydMxDGU1BO3JnmgxCclMcfi59JDsKHMXpgZpCNw+svcirBtIMD2u70KPFinr2pUA== + dependencies: + "@iiif/presentation-2" "^1.0.4" + "@iiif/presentation-3" "^1.1.3" + "@types/geojson" "^7946.0.8" + +"@iiif/presentation-2@1.*", "@iiif/presentation-2@1.x", "@iiif/presentation-2@^1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@iiif/presentation-2/-/presentation-2-1.0.4.tgz#1664aee995462fdf66ec8dfbae54fc22b4f79c97" + integrity sha512-hJakpq62VBajesLJrYPtFm6hcn6c/HkKP7CmKZ5atuzu40m0nifWYsqigR1l9sZGvhhHb/DRshPmiW/0GNrJoA== + +"@iiif/presentation-3@1.x", "@iiif/presentation-3@^1.1.3": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@iiif/presentation-3/-/presentation-3-1.1.3.tgz#7f5ea909ae22aa9ce2e9d91cec79f5f1cd0fd6fb" + integrity sha512-Ek+25nkQouo0pXAqCsWYbAeS4jLDEBQA7iul2jzgnvoJrucxDQN2lXyNLgOUDRqpTdSqJ69iz5lm6DLaxil+Nw== + dependencies: + "@types/geojson" "^7946.0.7" + +"@iiif/vault-helpers@^0.10.0": + version "0.10.0" + resolved "https://registry.yarnpkg.com/@iiif/vault-helpers/-/vault-helpers-0.10.0.tgz#0797dc2a79b3f99bdbb65f16db88358dc4c22593" + integrity sha512-gnjTPcZJMIDjwU5K8HYNU8Iix49Awmsr7IhIyxA5ZCqugnLjHvJUOmOvT7q1NRd6ia4+09wxx+EMH0D9mt4cxQ== + dependencies: + "@iiif/presentation-2" "1.x" + "@iiif/presentation-3" "1.x" + optionalDependencies: + abs-svg-path "^0.1.0" + parse-svg-path "^0.1.0" + react-i18next "^11.18.0" + svg-arc-to-cubic-bezier "^3.2.0" + +"@iiif/vault@^0.9.22": + version "0.9.22" + resolved "https://registry.yarnpkg.com/@iiif/vault/-/vault-0.9.22.tgz#299bd3e6df1e4c3ae941d272b298ae65280b69d0" + integrity sha512-HaFX1u9TSZha0i/esZR5sZzydZgjZgITeO0JrT1qXm+qSaB1Oc0PRNzatXW48Xa0q3PPYbBB71zCL1/D1i1i1A== + dependencies: + "@iiif/parser" "^1.1.2" + "@iiif/presentation-2" "1.*" + "@iiif/presentation-3" "^1.1.3" + mitt "^3.0.0" + node-fetch "^3.1.1" + redux "^4.1.2" + tiny-invariant "^1.2.0" + typesafe-actions "^5.1.0" + +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3": + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + +"@petamoriken/float16@^3.4.7": + version "3.8.6" + resolved "https://registry.yarnpkg.com/@petamoriken/float16/-/float16-3.8.6.tgz#580701cb97a510882342333d31c7cbfd9e14b4f4" + integrity sha512-GNJhABTtcmt9al/nqdJPycwFD46ww2+q2zwZzTjY0dFFwUAFRw9zszvEr9osyJRd9krRGy6hUDopWUg9fX7VVw== + +"@radix-ui/number@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/number/-/number-1.0.1.tgz#644161a3557f46ed38a042acf4a770e826021674" + integrity sha512-T5gIdVO2mmPW3NNhjNgEP3cqMXjXL9UbO0BzWcXfvdBs+BohbQxvd/K5hSVKmn9/lbTdsQVKbUcP5WLCwvUbBg== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/primitive@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/primitive/-/primitive-1.0.1.tgz#e46f9958b35d10e9f6dc71c497305c22e3e55dbd" + integrity sha512-yQ8oGX2GVsEYMWGxcovu1uGWPCxV5BFfeeYxqPmuAzUyLT9qmaMXSAhXpb0WrspIeqYzdJpkh2vHModJPgRIaw== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/react-arrow@1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@radix-ui/react-arrow/-/react-arrow-1.0.3.tgz#c24f7968996ed934d57fe6cde5d6ec7266e1d25d" + integrity sha512-wSP+pHsB/jQRaL6voubsQ/ZlrGBHHrOjmBnr19hxYgtS0WvAFwZhK2WP/YY5yF9uKECCEEDGxuLxq1NBK51wFA== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-primitive" "1.0.3" + +"@radix-ui/react-aspect-ratio@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@radix-ui/react-aspect-ratio/-/react-aspect-ratio-1.0.3.tgz#d1a15d6953203e6fd7f5b569fae77c88c1880125" + integrity sha512-fXR5kbMan9oQqMuacfzlGG/SQMcmMlZ4wrvpckv8SgUulD0MMpspxJrxg/Gp/ISV3JfV1AeSWTYK9GvxA4ySwA== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-primitive" "1.0.3" + +"@radix-ui/react-collapsible@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@radix-ui/react-collapsible/-/react-collapsible-1.0.3.tgz#df0e22e7a025439f13f62d4e4a9e92c4a0df5b81" + integrity sha512-UBmVDkmR6IvDsloHVN+3rtx4Mi5TFvylYXpluuv0f37dtaz3H99bp8No0LGXRigVpl3UAT4l9j6bIchh42S/Gg== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/primitive" "1.0.1" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-context" "1.0.1" + "@radix-ui/react-id" "1.0.1" + "@radix-ui/react-presence" "1.0.1" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-use-controllable-state" "1.0.1" + "@radix-ui/react-use-layout-effect" "1.0.1" + +"@radix-ui/react-collection@1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@radix-ui/react-collection/-/react-collection-1.0.3.tgz#9595a66e09026187524a36c6e7e9c7d286469159" + integrity sha512-3SzW+0PW7yBBoQlT8wNcGtaxaD0XSu0uLUFgrtHY08Acx05TaHaOmVLR73c0j/cqpDy53KBMO7s0dx2wmOIDIA== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-context" "1.0.1" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-slot" "1.0.2" + +"@radix-ui/react-compose-refs@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-compose-refs/-/react-compose-refs-1.0.1.tgz#7ed868b66946aa6030e580b1ffca386dd4d21989" + integrity sha512-fDSBgd44FKHa1FRMU59qBMPFcl2PZE+2nmqunj+BWFyYYjnhIDWL2ItDs3rrbJDQOtzt5nIebLCQc4QRfz6LJw== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/react-context@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-context/-/react-context-1.0.1.tgz#fe46e67c96b240de59187dcb7a1a50ce3e2ec00c" + integrity sha512-ebbrdFoYTcuZ0v4wG5tedGnp9tzcV8awzsxYph7gXUyvnNLuTIcCk1q17JEbnVhXAKG9oX3KtchwiMIAYp9NLg== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/react-direction@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-direction/-/react-direction-1.0.1.tgz#9cb61bf2ccf568f3421422d182637b7f47596c9b" + integrity sha512-RXcvnXgyvYvBEOhCBuddKecVkoMiI10Jcm5cTI7abJRAHYfFxeu+FBQs/DvdxSYucxR5mna0dNsL6QFlds5TMA== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/react-dismissable-layer@1.0.5": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.0.5.tgz#3f98425b82b9068dfbab5db5fff3df6ebf48b9d4" + integrity sha512-aJeDjQhywg9LBu2t/At58hCvr7pEm0o2Ke1x33B+MhjNmmZ17sy4KImo0KPLgsnc/zN7GPdce8Cnn0SWvwZO7g== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/primitive" "1.0.1" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-use-callback-ref" "1.0.1" + "@radix-ui/react-use-escape-keydown" "1.0.3" + +"@radix-ui/react-focus-guards@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-focus-guards/-/react-focus-guards-1.0.1.tgz#1ea7e32092216b946397866199d892f71f7f98ad" + integrity sha512-Rect2dWbQ8waGzhMavsIbmSVCgYxkXLxxR3ZvCX79JOglzdEy4JXMb98lq4hPxUbLr77nP0UOGf4rcMU+s1pUA== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/react-focus-scope@1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@radix-ui/react-focus-scope/-/react-focus-scope-1.0.4.tgz#2ac45fce8c5bb33eb18419cdc1905ef4f1906525" + integrity sha512-sL04Mgvf+FmyvZeYfNu1EPAaaxD+aw7cYeIB9L9Fvq8+urhltTRaEo5ysKOpHuKPclsZcSUMKlN05x4u+CINpA== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-use-callback-ref" "1.0.1" + +"@radix-ui/react-form@^0.0.3": + version "0.0.3" + resolved "https://registry.yarnpkg.com/@radix-ui/react-form/-/react-form-0.0.3.tgz#328e7163e723ccc748459d66a2d685d7b4f85d5a" + integrity sha512-kgE+Z/haV6fxE5WqIXj05KkaXa3OkZASoTDy25yX2EIp/x0c54rOH/vFr5nOZTg7n7T1z8bSyXmiVIFP9bbhPQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/primitive" "1.0.1" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-context" "1.0.1" + "@radix-ui/react-id" "1.0.1" + "@radix-ui/react-label" "2.0.2" + "@radix-ui/react-primitive" "1.0.3" + +"@radix-ui/react-id@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-id/-/react-id-1.0.1.tgz#73cdc181f650e4df24f0b6a5b7aa426b912c88c0" + integrity sha512-tI7sT/kqYp8p96yGWY1OAnLHrqDgzHefRBKQ2YAkBS5ja7QLcZ9Z/uY7bEjPUatf8RomoXM8/1sMj1IJaE5UzQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-use-layout-effect" "1.0.1" + +"@radix-ui/react-label@2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@radix-ui/react-label/-/react-label-2.0.2.tgz#9c72f1d334aac996fdc27b48a8bdddd82108fb6d" + integrity sha512-N5ehvlM7qoTLx7nWPodsPYPgMzA5WM8zZChQg8nyFJKnDO5WHdba1vv5/H6IO5LtJMfD2Q3wh1qHFGNtK0w3bQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-primitive" "1.0.3" + +"@radix-ui/react-popover@^1.0.7": + version "1.0.7" + resolved "https://registry.yarnpkg.com/@radix-ui/react-popover/-/react-popover-1.0.7.tgz#23eb7e3327330cb75ec7b4092d685398c1654e3c" + integrity sha512-shtvVnlsxT6faMnK/a7n0wptwBD23xc1Z5mdrtKLwVEfsEMXodS0r5s0/g5P0hX//EKYZS2sxUjqfzlg52ZSnQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/primitive" "1.0.1" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-context" "1.0.1" + "@radix-ui/react-dismissable-layer" "1.0.5" + "@radix-ui/react-focus-guards" "1.0.1" + "@radix-ui/react-focus-scope" "1.0.4" + "@radix-ui/react-id" "1.0.1" + "@radix-ui/react-popper" "1.1.3" + "@radix-ui/react-portal" "1.0.4" + "@radix-ui/react-presence" "1.0.1" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-slot" "1.0.2" + "@radix-ui/react-use-controllable-state" "1.0.1" + aria-hidden "^1.1.1" + react-remove-scroll "2.5.5" + +"@radix-ui/react-popper@1.1.3": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@radix-ui/react-popper/-/react-popper-1.1.3.tgz#24c03f527e7ac348fabf18c89795d85d21b00b42" + integrity sha512-cKpopj/5RHZWjrbF2846jBNacjQVwkP068DfmgrNJXpvVWrOvlAmE9xSiy5OqeE+Gi8D9fP+oDhUnPqNMY8/5w== + dependencies: + "@babel/runtime" "^7.13.10" + "@floating-ui/react-dom" "^2.0.0" + "@radix-ui/react-arrow" "1.0.3" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-context" "1.0.1" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-use-callback-ref" "1.0.1" + "@radix-ui/react-use-layout-effect" "1.0.1" + "@radix-ui/react-use-rect" "1.0.1" + "@radix-ui/react-use-size" "1.0.1" + "@radix-ui/rect" "1.0.1" + +"@radix-ui/react-portal@1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@radix-ui/react-portal/-/react-portal-1.0.4.tgz#df4bfd353db3b1e84e639e9c63a5f2565fb00e15" + integrity sha512-Qki+C/EuGUVCQTOTD5vzJzJuMUlewbzuKyUy+/iHM2uwGiru9gZeBJtHAPKAEkB5KWGi9mP/CHKcY0wt1aW45Q== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-primitive" "1.0.3" + +"@radix-ui/react-presence@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-presence/-/react-presence-1.0.1.tgz#491990ba913b8e2a5db1b06b203cb24b5cdef9ba" + integrity sha512-UXLW4UAbIY5ZjcvzjfRFo5gxva8QirC9hF7wRE4U5gz+TP0DbRk+//qyuAQ1McDxBt1xNMBTaciFGvEmJvAZCg== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-use-layout-effect" "1.0.1" + +"@radix-ui/react-primitive@1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@radix-ui/react-primitive/-/react-primitive-1.0.3.tgz#d49ea0f3f0b2fe3ab1cb5667eb03e8b843b914d0" + integrity sha512-yi58uVyoAcK/Nq1inRY56ZSjKypBNKTa/1mcL8qdl6oJeEaDbOldlzrGn7P6Q3Id5d+SYNGc5AJgc4vGhjs5+g== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-slot" "1.0.2" + +"@radix-ui/react-radio-group@^1.1.3": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@radix-ui/react-radio-group/-/react-radio-group-1.1.3.tgz#3197f5dcce143bcbf961471bf89320735c0212d3" + integrity sha512-x+yELayyefNeKeTx4fjK6j99Fs6c4qKm3aY38G3swQVTN6xMpsrbigC0uHs2L//g8q4qR7qOcww8430jJmi2ag== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/primitive" "1.0.1" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-context" "1.0.1" + "@radix-ui/react-direction" "1.0.1" + "@radix-ui/react-presence" "1.0.1" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-roving-focus" "1.0.4" + "@radix-ui/react-use-controllable-state" "1.0.1" + "@radix-ui/react-use-previous" "1.0.1" + "@radix-ui/react-use-size" "1.0.1" + +"@radix-ui/react-roving-focus@1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@radix-ui/react-roving-focus/-/react-roving-focus-1.0.4.tgz#e90c4a6a5f6ac09d3b8c1f5b5e81aab2f0db1974" + integrity sha512-2mUg5Mgcu001VkGy+FfzZyzbmuUWzgWkj3rvv4yu+mLw03+mTzbxZHvfcGyFp2b8EkQeMkpRQ5FiA2Vr2O6TeQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/primitive" "1.0.1" + "@radix-ui/react-collection" "1.0.3" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-context" "1.0.1" + "@radix-ui/react-direction" "1.0.1" + "@radix-ui/react-id" "1.0.1" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-use-callback-ref" "1.0.1" + "@radix-ui/react-use-controllable-state" "1.0.1" + +"@radix-ui/react-select@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-select/-/react-select-2.0.0.tgz#a3511792a51a7018d6559357323a7f52e0e38887" + integrity sha512-RH5b7af4oHtkcHS7pG6Sgv5rk5Wxa7XI8W5gvB1N/yiuDGZxko1ynvOiVhFM7Cis2A8zxF9bTOUVbRDzPepe6w== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/number" "1.0.1" + "@radix-ui/primitive" "1.0.1" + "@radix-ui/react-collection" "1.0.3" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-context" "1.0.1" + "@radix-ui/react-direction" "1.0.1" + "@radix-ui/react-dismissable-layer" "1.0.5" + "@radix-ui/react-focus-guards" "1.0.1" + "@radix-ui/react-focus-scope" "1.0.4" + "@radix-ui/react-id" "1.0.1" + "@radix-ui/react-popper" "1.1.3" + "@radix-ui/react-portal" "1.0.4" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-slot" "1.0.2" + "@radix-ui/react-use-callback-ref" "1.0.1" + "@radix-ui/react-use-controllable-state" "1.0.1" + "@radix-ui/react-use-layout-effect" "1.0.1" + "@radix-ui/react-use-previous" "1.0.1" + "@radix-ui/react-visually-hidden" "1.0.3" + aria-hidden "^1.1.1" + react-remove-scroll "2.5.5" + +"@radix-ui/react-slot@1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@radix-ui/react-slot/-/react-slot-1.0.2.tgz#a9ff4423eade67f501ffb32ec22064bc9d3099ab" + integrity sha512-YeTpuq4deV+6DusvVUW4ivBgnkHwECUu0BiN43L5UCDFgdhsRUWAghhTF5MbvNTPzmiFOx90asDSUjWuCNapwg== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-compose-refs" "1.0.1" + +"@radix-ui/react-switch@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@radix-ui/react-switch/-/react-switch-1.0.3.tgz#6119f16656a9eafb4424c600fdb36efa5ec5837e" + integrity sha512-mxm87F88HyHztsI7N+ZUmEoARGkC22YVW5CaC+Byc+HRpuvCrOBPTAnXgf+tZ/7i0Sg/eOePGdMhUKhPaQEqow== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/primitive" "1.0.1" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-context" "1.0.1" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-use-controllable-state" "1.0.1" + "@radix-ui/react-use-previous" "1.0.1" + "@radix-ui/react-use-size" "1.0.1" + +"@radix-ui/react-tabs@^1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@radix-ui/react-tabs/-/react-tabs-1.0.4.tgz#993608eec55a5d1deddd446fa9978d2bc1053da2" + integrity sha512-egZfYY/+wRNCflXNHx+dePvnz9FbmssDTJBtgRfDY7e8SE5oIo3Py2eCB1ckAbh1Q7cQ/6yJZThJ++sgbxibog== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/primitive" "1.0.1" + "@radix-ui/react-context" "1.0.1" + "@radix-ui/react-direction" "1.0.1" + "@radix-ui/react-id" "1.0.1" + "@radix-ui/react-presence" "1.0.1" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-roving-focus" "1.0.4" + "@radix-ui/react-use-controllable-state" "1.0.1" + +"@radix-ui/react-use-callback-ref@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.0.1.tgz#f4bb1f27f2023c984e6534317ebc411fc181107a" + integrity sha512-D94LjX4Sp0xJFVaoQOd3OO9k7tpBYNOXdVhkltUbGv2Qb9OXdrg/CpsjlZv7ia14Sylv398LswWBVVu5nqKzAQ== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/react-use-controllable-state@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.0.1.tgz#ecd2ced34e6330caf89a82854aa2f77e07440286" + integrity sha512-Svl5GY5FQeN758fWKrjM6Qb7asvXeiZltlT4U2gVfl8Gx5UAv2sMR0LWo8yhsIZh2oQ0eFdZ59aoOOMV7b47VA== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-use-callback-ref" "1.0.1" + +"@radix-ui/react-use-escape-keydown@1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-1.0.3.tgz#217b840c250541609c66f67ed7bab2b733620755" + integrity sha512-vyL82j40hcFicA+M4Ex7hVkB9vHgSse1ZWomAqV2Je3RleKGO5iM8KMOEtfoSB0PnIelMd2lATjTGMYqN5ylTg== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-use-callback-ref" "1.0.1" + +"@radix-ui/react-use-layout-effect@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.0.1.tgz#be8c7bc809b0c8934acf6657b577daf948a75399" + integrity sha512-v/5RegiJWYdoCvMnITBkNNx6bCj20fiaJnWtRkU18yITptraXjffz5Qbn05uOiQnOvi+dbkznkoaMltz1GnszQ== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/react-use-previous@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-previous/-/react-use-previous-1.0.1.tgz#b595c087b07317a4f143696c6a01de43b0d0ec66" + integrity sha512-cV5La9DPwiQ7S0gf/0qiD6YgNqM5Fk97Kdrlc5yBcrF3jyEZQwm7vYFqMo4IfeHgJXsRaMvLABFtd0OVEmZhDw== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/react-use-rect@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-rect/-/react-use-rect-1.0.1.tgz#fde50b3bb9fd08f4a1cd204572e5943c244fcec2" + integrity sha512-Cq5DLuSiuYVKNU8orzJMbl15TXilTnJKUCltMVQg53BQOF1/C5toAaGrowkgksdBQ9H+SRL23g0HDmg9tvmxXw== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/rect" "1.0.1" + +"@radix-ui/react-use-size@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-size/-/react-use-size-1.0.1.tgz#1c5f5fea940a7d7ade77694bb98116fb49f870b2" + integrity sha512-ibay+VqrgcaI6veAojjofPATwledXiSmX+C0KrBk/xgpX9rBzPV3OsfwlhQdUOFbh+LKQorLYT+xTXW9V8yd0g== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-use-layout-effect" "1.0.1" + +"@radix-ui/react-visually-hidden@1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.0.3.tgz#51aed9dd0fe5abcad7dee2a234ad36106a6984ac" + integrity sha512-D4w41yN5YRKtu464TLnByKzMDG/JlMPHtfZgQAu9v6mNakUqGUI9vUrfQKz8NK41VMm/xbZbh76NUTVtIYqOMA== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-primitive" "1.0.3" + +"@radix-ui/rect@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/rect/-/rect-1.0.1.tgz#bf8e7d947671996da2e30f4904ece343bc4a883f" + integrity sha512-fyrgCaedtvMg9NK3en0pnOYJdtfwxUcNolezkNPUsoX57X8oQk+NkqcvzHXD2uKNij6GXmWU9NDru2IWjrO4BQ== + dependencies: + "@babel/runtime" "^7.13.10" + +"@rollup/rollup-android-arm-eabi@4.14.0": + version "4.14.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.14.0.tgz#57936f50d0335e2e7bfac496d209606fa516add4" + integrity sha512-jwXtxYbRt1V+CdQSy6Z+uZti7JF5irRKF8hlKfEnF/xJpcNGuuiZMBvuoYM+x9sr9iWGnzrlM0+9hvQ1kgkf1w== + +"@rollup/rollup-android-arm64@4.14.0": + version "4.14.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.14.0.tgz#81bba83b37382a2d0e30ceced06c8d3d85138054" + integrity sha512-fI9nduZhCccjzlsA/OuAwtFGWocxA4gqXGTLvOyiF8d+8o0fZUeSztixkYjcGq1fGZY3Tkq4yRvHPFxU+jdZ9Q== + +"@rollup/rollup-darwin-arm64@4.14.0": + version "4.14.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.14.0.tgz#a371bd723a5c4c4a33376da72abfc3938066842b" + integrity sha512-BcnSPRM76/cD2gQC+rQNGBN6GStBs2pl/FpweW8JYuz5J/IEa0Fr4AtrPv766DB/6b2MZ/AfSIOSGw3nEIP8SA== + +"@rollup/rollup-darwin-x64@4.14.0": + version "4.14.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.14.0.tgz#8baf2fda277c9729125017c65651296282412886" + integrity sha512-LDyFB9GRolGN7XI6955aFeI3wCdCUszFWumWU0deHA8VpR3nWRrjG6GtGjBrQxQKFevnUTHKCfPR4IvrW3kCgQ== + +"@rollup/rollup-linux-arm-gnueabihf@4.14.0": + version "4.14.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.14.0.tgz#822830a8f7388d5b81d04c69415408d3bab1079b" + integrity sha512-ygrGVhQP47mRh0AAD0zl6QqCbNsf0eTo+vgwkY6LunBcg0f2Jv365GXlDUECIyoXp1kKwL5WW6rsO429DBY/bA== + +"@rollup/rollup-linux-arm64-gnu@4.14.0": + version "4.14.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.14.0.tgz#e20fbe1bd4414c7119f9e0bba8ad17a6666c8365" + integrity sha512-x+uJ6MAYRlHGe9wi4HQjxpaKHPM3d3JjqqCkeC5gpnnI6OWovLdXTpfa8trjxPLnWKyBsSi5kne+146GAxFt4A== + +"@rollup/rollup-linux-arm64-musl@4.14.0": + version "4.14.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.14.0.tgz#13f475596a62e1924f13fe1c8cf2c40e09a99b47" + integrity sha512-nrRw8ZTQKg6+Lttwqo6a2VxR9tOroa2m91XbdQ2sUUzHoedXlsyvY1fN4xWdqz8PKmf4orDwejxXHjh7YBGUCA== + +"@rollup/rollup-linux-powerpc64le-gnu@4.14.0": + version "4.14.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.14.0.tgz#6a431c441420d1c510a205e08c6673355a0a2ea9" + integrity sha512-xV0d5jDb4aFu84XKr+lcUJ9y3qpIWhttO3Qev97z8DKLXR62LC3cXT/bMZXrjLF9X+P5oSmJTzAhqwUbY96PnA== + +"@rollup/rollup-linux-riscv64-gnu@4.14.0": + version "4.14.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.14.0.tgz#53d9448962c3f9ed7a1672269655476ea2d67567" + integrity sha512-SDDhBQwZX6LPRoPYjAZWyL27LbcBo7WdBFWJi5PI9RPCzU8ijzkQn7tt8NXiXRiFMJCVpkuMkBf4OxSxVMizAw== + +"@rollup/rollup-linux-s390x-gnu@4.14.0": + version "4.14.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.14.0.tgz#95f0c133b324da3e7e5c7d12855e0eb71d21a946" + integrity sha512-RxB/qez8zIDshNJDufYlTT0ZTVut5eCpAZ3bdXDU9yTxBzui3KhbGjROK2OYTTor7alM7XBhssgoO3CZ0XD3qA== + +"@rollup/rollup-linux-x64-gnu@4.14.0": + version "4.14.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.14.0.tgz#820ada75c68ead1acc486e41238ca0d8f8531478" + integrity sha512-C6y6z2eCNCfhZxT9u+jAM2Fup89ZjiG5pIzZIDycs1IwESviLxwkQcFRGLjnDrP+PT+v5i4YFvlcfAs+LnreXg== + +"@rollup/rollup-linux-x64-musl@4.14.0": + version "4.14.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.14.0.tgz#ca74f22e125efbe94c1148d989ef93329b464443" + integrity sha512-i0QwbHYfnOMYsBEyjxcwGu5SMIi9sImDVjDg087hpzXqhBSosxkE7gyIYFHgfFl4mr7RrXksIBZ4DoLoP4FhJg== + +"@rollup/rollup-win32-arm64-msvc@4.14.0": + version "4.14.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.14.0.tgz#269023332297051d037a9593dcba92c10fef726b" + integrity sha512-Fq52EYb0riNHLBTAcL0cun+rRwyZ10S9vKzhGKKgeD+XbwunszSY0rVMco5KbOsTlwovP2rTOkiII/fQ4ih/zQ== + +"@rollup/rollup-win32-ia32-msvc@4.14.0": + version "4.14.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.14.0.tgz#d7701438daf964011fd7ca33e3f13f3ff5129e7b" + integrity sha512-e/PBHxPdJ00O9p5Ui43+vixSgVf4NlLsmV6QneGERJ3lnjIua/kim6PRFe3iDueT1rQcgSkYP8ZBBXa/h4iPvw== + +"@rollup/rollup-win32-x64-msvc@4.14.0": + version "4.14.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.14.0.tgz#0bb7ac3cd1c3292db1f39afdabfd03ccea3a3d34" + integrity sha512-aGg7iToJjdklmxlUlJh/PaPNa4PmqHfyRMLunbL3eaMO0gp656+q1zOKkpJ/CVe9CryJv6tAN1HDoR8cNGzkag== + +"@samvera/clover-iiif@^2.3.2": + version "2.7.0" + resolved "https://registry.yarnpkg.com/@samvera/clover-iiif/-/clover-iiif-2.7.0.tgz#5f8f24629f085a002b3803e190325c909ae0d8f4" + integrity sha512-sO+uAKDhlJ2W3tUd/fAaxbE/e6IpOzcJt43k7zlbT9F0Ov46tIMYW01ZWMhdb74ocGbhzl8bVah8HMk8W9uhtg== + dependencies: + "@iiif/parser" "^1.1.2" + "@iiif/vault" "^0.9.22" + "@iiif/vault-helpers" "^0.10.0" + "@radix-ui/react-aspect-ratio" "^1.0.3" + "@radix-ui/react-collapsible" "^1.0.3" + "@radix-ui/react-form" "^0.0.3" + "@radix-ui/react-popover" "^1.0.7" + "@radix-ui/react-radio-group" "^1.1.3" + "@radix-ui/react-select" "^2.0.0" + "@radix-ui/react-switch" "^1.0.3" + "@radix-ui/react-tabs" "^1.0.4" + "@stitches/react" "^1.2.8" + flexsearch "^0.7.11" + hls.js "^1.5.3" + node-webvtt "^1.9.4" + openseadragon "^2.4.2" + react "^18.2.0" + react-dom "^18.2.0" + react-error-boundary "^4.0.12" + sanitize-html "^2.11.0" + swiper "^9.4.1" + uuid "^9.0.1" + +"@stitches/react@^1.2.8": + version "1.2.8" + resolved "https://registry.yarnpkg.com/@stitches/react/-/react-1.2.8.tgz#954f8008be8d9c65c4e58efa0937f32388ce3a38" + integrity sha512-9g9dWI4gsSVe8bNLlb+lMkBYsnIKCZTmvqvDG+Avnn69XfmHZKiaMrx7cgTaddq7aTPPmXiTsbFcUy0xgI4+wA== + +"@types/estree@1.0.5": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" + integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== + +"@types/geojson@^7946.0.7", "@types/geojson@^7946.0.8": + version "7946.0.14" + resolved "https://registry.yarnpkg.com/@types/geojson/-/geojson-7946.0.14.tgz#319b63ad6df705ee2a65a73ef042c8271e696613" + integrity sha512-WCfD5Ht3ZesJUsONdhvm84dmzWOiOzOAqOncN0++w0lBw1o8OuDNJF2McvvCef/yBqb/HYRahp1BYtODFQ8bRg== + +abs-svg-path@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/abs-svg-path/-/abs-svg-path-0.1.1.tgz#df601c8e8d2ba10d4a76d625e236a9a39c2723bf" + integrity sha512-d8XPSGjfyzlXC3Xx891DJRyZfqk5JU0BJrDQcsWomFIV1/BIzPW5HDH5iDdWpqWaav0YVIEzT1RHTwWr0FFshA== + +aria-hidden@^1.1.1: + version "1.2.4" + resolved "https://registry.yarnpkg.com/aria-hidden/-/aria-hidden-1.2.4.tgz#b78e383fdbc04d05762c78b4a25a501e736c4522" + integrity sha512-y+CcFFwelSXpLZk/7fMB2mUbGtX9lKycf1MWJ7CaTIERyitVlyQx6C+sxcROU2BAJ24OiZyK+8wj2i8AlBoS3A== + dependencies: + tslib "^2.0.0" + +braces@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +commander@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" + integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== + +data-uri-to-buffer@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz#d8feb2b2881e6a4f58c2e08acfd0e2834e26222e" + integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A== + +debug@^4.3, debug@^4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +deepmerge@^4.2.2: + version "4.3.1" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" + integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== + +detect-node-es@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/detect-node-es/-/detect-node-es-1.1.0.tgz#163acdf643330caa0b4cd7c21e7ee7755d6fa493" + integrity sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ== + +dom-serializer@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-2.0.0.tgz#e41b802e1eedf9f6cae183ce5e622d789d7d8e53" + integrity sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg== + dependencies: + domelementtype "^2.3.0" + domhandler "^5.0.2" + entities "^4.2.0" + +domelementtype@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" + integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== + +domhandler@^5.0.2, domhandler@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-5.0.3.tgz#cc385f7f751f1d1fc650c21374804254538c7d31" + integrity sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w== + dependencies: + domelementtype "^2.3.0" + +domutils@^3.0.1: + version "3.1.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-3.1.0.tgz#c47f551278d3dc4b0b1ab8cbb42d751a6f0d824e" + integrity sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA== + dependencies: + dom-serializer "^2.0.0" + domelementtype "^2.3.0" + domhandler "^5.0.3" + +earcut@^2.2.3: + version "2.2.4" + resolved "https://registry.yarnpkg.com/earcut/-/earcut-2.2.4.tgz#6d02fd4d68160c114825d06890a92ecaae60343a" + integrity sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ== + +entities@^4.2.0, entities@^4.4.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" + integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== + +esbuild@^0.20.1: + version "0.20.2" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.20.2.tgz#9d6b2386561766ee6b5a55196c6d766d28c87ea1" + integrity sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g== + optionalDependencies: + "@esbuild/aix-ppc64" "0.20.2" + "@esbuild/android-arm" "0.20.2" + "@esbuild/android-arm64" "0.20.2" + "@esbuild/android-x64" "0.20.2" + "@esbuild/darwin-arm64" "0.20.2" + "@esbuild/darwin-x64" "0.20.2" + "@esbuild/freebsd-arm64" "0.20.2" + "@esbuild/freebsd-x64" "0.20.2" + "@esbuild/linux-arm" "0.20.2" + "@esbuild/linux-arm64" "0.20.2" + "@esbuild/linux-ia32" "0.20.2" + "@esbuild/linux-loong64" "0.20.2" + "@esbuild/linux-mips64el" "0.20.2" + "@esbuild/linux-ppc64" "0.20.2" + "@esbuild/linux-riscv64" "0.20.2" + "@esbuild/linux-s390x" "0.20.2" + "@esbuild/linux-x64" "0.20.2" + "@esbuild/netbsd-x64" "0.20.2" + "@esbuild/openbsd-x64" "0.20.2" + "@esbuild/sunos-x64" "0.20.2" + "@esbuild/win32-arm64" "0.20.2" + "@esbuild/win32-ia32" "0.20.2" + "@esbuild/win32-x64" "0.20.2" + +escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +fast-glob@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" + integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + +fastq@^1.6.0: + version "1.17.1" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.17.1.tgz#2a523f07a4e7b1e81a42b91b8bf2254107753b47" + integrity sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w== + dependencies: + reusify "^1.0.4" + +fetch-blob@^3.1.2, fetch-blob@^3.1.4: + version "3.2.0" + resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.2.0.tgz#f09b8d4bbd45adc6f0c20b7e787e793e309dcce9" + integrity sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ== + dependencies: + node-domexception "^1.0.0" + web-streams-polyfill "^3.0.3" + +fflate@^0.8.0: + version "0.8.2" + resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.8.2.tgz#fc8631f5347812ad6028bbe4a2308b2792aa1dea" + integrity sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A== + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +flexsearch@^0.7.11: + version "0.7.43" + resolved "https://registry.yarnpkg.com/flexsearch/-/flexsearch-0.7.43.tgz#34f89b36278a466ce379c5bf6fb341965ed3f16c" + integrity sha512-c5o/+Um8aqCSOXGcZoqZOm+NqtVwNsvVpWv6lfmSclU954O3wvQKxxK8zj74fPaSJbXpSLTs4PRhh+wnoCXnKg== + +formdata-polyfill@^4.0.10: + version "4.0.10" + resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423" + integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g== + dependencies: + fetch-blob "^3.1.2" + +fsevents@~2.3.2, fsevents@~2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + +geotiff@^2.0.7: + version "2.1.3" + resolved "https://registry.yarnpkg.com/geotiff/-/geotiff-2.1.3.tgz#993f40f2aa6aa65fb1e0451d86dd22ca8e66910c" + integrity sha512-PT6uoF5a1+kbC3tHmZSUsLHBp2QJlHasxxxxPW47QIY1VBKpFB+FcDvX+MxER6UzgLQZ0xDzJ9s48B9JbOCTqA== + dependencies: + "@petamoriken/float16" "^3.4.7" + lerc "^3.0.0" + pako "^2.0.4" + parse-headers "^2.0.2" + quick-lru "^6.1.1" + web-worker "^1.2.0" + xml-utils "^1.0.2" + zstddec "^0.1.0" + +get-nonce@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/get-nonce/-/get-nonce-1.0.1.tgz#fdf3f0278073820d2ce9426c18f07481b1e0cdf3" + integrity sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q== + +glob-parent@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +hls.js@^1.5.3: + version "1.5.7" + resolved "https://registry.yarnpkg.com/hls.js/-/hls.js-1.5.7.tgz#e069e78fe962a422d16aa17a2bfc2f1e2321089d" + integrity sha512-Hnyf7ojTBtXHeOW1/t6wCBJSiK1WpoKF9yg7juxldDx8u3iswrkPt2wbOA/1NiwU4j27DSIVoIEJRAhcdMef/A== + +html-parse-stringify@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz#dfc1017347ce9f77c8141a507f233040c59c55d2" + integrity sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg== + dependencies: + void-elements "3.1.0" + +htmlparser2@^8.0.0: + version "8.0.2" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-8.0.2.tgz#f002151705b383e62433b5cf466f5b716edaec21" + integrity sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA== + dependencies: + domelementtype "^2.3.0" + domhandler "^5.0.3" + domutils "^3.0.1" + entities "^4.4.0" + +ieee754@^1.1.12: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + +invariant@^2.2.4: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== + dependencies: + loose-envify "^1.0.0" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-glob@^4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-plain-object@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" + integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== + +"js-tokens@^3.0.0 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +lerc@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lerc/-/lerc-3.0.0.tgz#36f36fbd4ba46f0abf4833799fff2e7d6865f5cb" + integrity sha512-Rm4J/WaHhRa93nCN2mwWDZFoRVF18G1f47C+kvQWyHGEZxFpTUi73p7lMVSAndyxGt6lJ2/CFbOcf9ra5p8aww== + +loose-envify@^1.0.0, loose-envify@^1.1.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +merge2@^1.3.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + +micromatch@^4.0.4: + version "4.0.5" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== + dependencies: + braces "^3.0.2" + picomatch "^2.3.1" + +mitt@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/mitt/-/mitt-3.0.1.tgz#ea36cf0cc30403601ae074c8f77b7092cdab36d1" + integrity sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw== + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +nanoid@^3.3.7: + version "3.3.7" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8" + integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g== + +node-domexception@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" + integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== + +node-fetch@^3.1.1: + version "3.3.2" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.2.tgz#d1e889bacdf733b4ff3b2b243eb7a12866a0b78b" + integrity sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA== + dependencies: + data-uri-to-buffer "^4.0.0" + fetch-blob "^3.1.4" + formdata-polyfill "^4.0.10" + +node-webvtt@^1.9.4: + version "1.9.4" + resolved "https://registry.yarnpkg.com/node-webvtt/-/node-webvtt-1.9.4.tgz#b71b98f879c6c88ebeda40c358bd45a882ca5d89" + integrity sha512-EjrJdKdxSyd8j4LMLW6s2Ah4yNoeVXp18Ob04CQl1In18xcUmKzEE8pcsxxnFVqanTyjbGYph2VnvtwIXR4EjA== + dependencies: + commander "^7.1.0" + +ol-pmtiles@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/ol-pmtiles/-/ol-pmtiles-0.3.0.tgz#6a39f0000403f30411093cff474313a15b85c71b" + integrity sha512-Ajc5+P6mvjcREOp0rBnTlWOu6wX+pvPlujHd8Fb5K26pGhT3hRMHtJPxhCqyHZT10uNveyNsmH/FJtVo+JCl6Q== + dependencies: + pmtiles "2.11.0" + +ol@8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/ol/-/ol-8.1.0.tgz#6f3259855cb331a6fa9cbf363aa69d37bba7306a" + integrity sha512-cx3SH2plpFS9fM8pp1nCypgQXGJD7Mcb1E3mEySmy5XEw1DUEo+kkNzgtAZz5qupekqi7aU9iBJEjCoMfqvO2Q== + dependencies: + earcut "^2.2.3" + geotiff "^2.0.7" + pbf "3.2.1" + rbush "^3.0.1" + +openseadragon@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/openseadragon/-/openseadragon-2.4.2.tgz#f25d833d0ab9941599d65a3e2b44bec546c9f15c" + integrity sha512-398KbZwRtOYA6OmeWRY4Q0737NTacQ9Q6whmr9Lp1MNQO3p0eBz5LIASRne+4gwequcSM1vcHcjfy3dIndQziw== + +pako@^2.0.4: + version "2.1.0" + resolved "https://registry.yarnpkg.com/pako/-/pako-2.1.0.tgz#266cc37f98c7d883545d11335c00fbd4062c9a86" + integrity sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug== + +parse-headers@^2.0.2: + version "2.0.5" + resolved "https://registry.yarnpkg.com/parse-headers/-/parse-headers-2.0.5.tgz#069793f9356a54008571eb7f9761153e6c770da9" + integrity sha512-ft3iAoLOB/MlwbNXgzy43SWGP6sQki2jQvAyBg/zDFAgr9bfNWZIUj42Kw2eJIl8kEi4PbgE6U1Zau/HwI75HA== + +parse-srcset@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/parse-srcset/-/parse-srcset-1.0.2.tgz#f2bd221f6cc970a938d88556abc589caaaa2bde1" + integrity sha512-/2qh0lav6CmI15FzA3i/2Bzk2zCgQhGMkvhOhKNcBVQ1ldgpbfiNTVslmooUmWJcADi1f1kIeynbDRVzNlfR6Q== + +parse-svg-path@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/parse-svg-path/-/parse-svg-path-0.1.2.tgz#7a7ec0d1eb06fa5325c7d3e009b859a09b5d49eb" + integrity sha512-JyPSBnkTJ0AI8GGJLfMXvKq42cj5c006fnLz6fXy6zfoVjJizi8BNTpu8on8ziI1cKy9d9DGNuY17Ce7wuejpQ== + +pbf@3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/pbf/-/pbf-3.2.1.tgz#b4c1b9e72af966cd82c6531691115cc0409ffe2a" + integrity sha512-ClrV7pNOn7rtmoQVF4TS1vyU0WhYRnP92fzbfF75jAIwpnzdJXf8iTd4CMEqO4yUenH6NDqLiwjqlh6QgZzgLQ== + dependencies: + ieee754 "^1.1.12" + resolve-protobuf-schema "^2.1.0" + +picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== + +picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +pmtiles@2.11.0: + version "2.11.0" + resolved "https://registry.yarnpkg.com/pmtiles/-/pmtiles-2.11.0.tgz#53aac29408e001a73b15b1c8cad0b17c944ab7bd" + integrity sha512-dU9SzzaqmCGpdEuTnIba6bDHT6j09ZJFIXxwGpvkiEnce3ZnBB1VKt6+EOmJGueriweaZLAMTUmKVElU2CBe0g== + dependencies: + fflate "^0.8.0" + +postcss@^8.3.11, postcss@^8.4.38: + version "8.4.38" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.38.tgz#b387d533baf2054288e337066d81c6bee9db9e0e" + integrity sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A== + dependencies: + nanoid "^3.3.7" + picocolors "^1.0.0" + source-map-js "^1.2.0" + +protocol-buffers-schema@^3.3.1: + version "3.6.0" + resolved "https://registry.yarnpkg.com/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz#77bc75a48b2ff142c1ad5b5b90c94cd0fa2efd03" + integrity sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw== + +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + +quick-lru@^6.1.1: + version "6.1.2" + resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-6.1.2.tgz#e9a90524108629be35287d0b864e7ad6ceb3659e" + integrity sha512-AAFUA5O1d83pIHEhJwWCq/RQcRukCkn/NSm2QsTEMle5f2hP0ChI2+3Xb051PZCkLryI/Ir1MVKviT2FIloaTQ== + +quickselect@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/quickselect/-/quickselect-2.0.0.tgz#f19680a486a5eefb581303e023e98faaf25dd018" + integrity sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw== + +rbush@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/rbush/-/rbush-3.0.1.tgz#5fafa8a79b3b9afdfe5008403a720cc1de882ecf" + integrity sha512-XRaVO0YecOpEuIvbhbpTrZgoiI6xBlz6hnlr6EHhd+0x9ase6EmeN+hdwwUaJvLcsFFQ8iWVF1GAK1yB0BWi0w== + dependencies: + quickselect "^2.0.0" + +react-dom@^18.2.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d" + integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g== + dependencies: + loose-envify "^1.1.0" + scheduler "^0.23.0" + +react-error-boundary@^4.0.12: + version "4.0.13" + resolved "https://registry.yarnpkg.com/react-error-boundary/-/react-error-boundary-4.0.13.tgz#80386b7b27b1131c5fbb7368b8c0d983354c7947" + integrity sha512-b6PwbdSv8XeOSYvjt8LpgpKrZ0yGdtZokYwkwV2wlcZbxgopHX/hgPl5VgpnoVOWd868n1hktM8Qm4b+02MiLQ== + dependencies: + "@babel/runtime" "^7.12.5" + +react-i18next@^11.18.0: + version "11.18.6" + resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-11.18.6.tgz#e159c2960c718c1314f1e8fcaa282d1c8b167887" + integrity sha512-yHb2F9BiT0lqoQDt8loZ5gWP331GwctHz9tYQ8A2EIEUu+CcEdjBLQWli1USG3RdWQt3W+jqQLg/d4rrQR96LA== + dependencies: + "@babel/runtime" "^7.14.5" + html-parse-stringify "^3.0.1" + +react-remove-scroll-bar@^2.3.3: + version "2.3.6" + resolved "https://registry.yarnpkg.com/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.6.tgz#3e585e9d163be84a010180b18721e851ac81a29c" + integrity sha512-DtSYaao4mBmX+HDo5YWYdBWQwYIQQshUV/dVxFxK+KM26Wjwp1gZ6rv6OC3oujI6Bfu6Xyg3TwK533AQutsn/g== + dependencies: + react-style-singleton "^2.2.1" + tslib "^2.0.0" + +react-remove-scroll@2.5.5: + version "2.5.5" + resolved "https://registry.yarnpkg.com/react-remove-scroll/-/react-remove-scroll-2.5.5.tgz#1e31a1260df08887a8a0e46d09271b52b3a37e77" + integrity sha512-ImKhrzJJsyXJfBZ4bzu8Bwpka14c/fQt0k+cyFp/PBhTfyDnU5hjOtM4AG/0AMyy8oKzOTR0lDgJIM7pYXI0kw== + dependencies: + react-remove-scroll-bar "^2.3.3" + react-style-singleton "^2.2.1" + tslib "^2.1.0" + use-callback-ref "^1.3.0" + use-sidecar "^1.1.2" + +react-style-singleton@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/react-style-singleton/-/react-style-singleton-2.2.1.tgz#f99e420492b2d8f34d38308ff660b60d0b1205b4" + integrity sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g== + dependencies: + get-nonce "^1.0.0" + invariant "^2.2.4" + tslib "^2.0.0" + +react@^18.2.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" + integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== + dependencies: + loose-envify "^1.1.0" + +redux@^4.1.2: + version "4.2.1" + resolved "https://registry.yarnpkg.com/redux/-/redux-4.2.1.tgz#c08f4306826c49b5e9dc901dee0452ea8fce6197" + integrity sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w== + dependencies: + "@babel/runtime" "^7.9.2" + +regenerator-runtime@^0.14.0: + version "0.14.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" + integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== + +resolve-protobuf-schema@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz#9ca9a9e69cf192bbdaf1006ec1973948aa4a3758" + integrity sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ== + dependencies: + protocol-buffers-schema "^3.3.1" + +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + +rollup-plugin-gzip@^3.1.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/rollup-plugin-gzip/-/rollup-plugin-gzip-3.1.2.tgz#248267c09b23a7a48291625cf668d5511c517c36" + integrity sha512-9xemMyvCjkklgNpu6jCYqQAbvCLJzA2nilkiOGzFuXTUX3cXEFMwIhsIBRF7kTKD/SnZ1tNPcxFm4m4zJ3VfNQ== + +rollup@^4.13.0: + version "4.14.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.14.0.tgz#c3e2cd479f1b2358b65c1f810fa05b51603d7be8" + integrity sha512-Qe7w62TyawbDzB4yt32R0+AbIo6m1/sqO7UPzFS8Z/ksL5mrfhA0v4CavfdmFav3D+ub4QeAgsGEe84DoWe/nQ== + dependencies: + "@types/estree" "1.0.5" + optionalDependencies: + "@rollup/rollup-android-arm-eabi" "4.14.0" + "@rollup/rollup-android-arm64" "4.14.0" + "@rollup/rollup-darwin-arm64" "4.14.0" + "@rollup/rollup-darwin-x64" "4.14.0" + "@rollup/rollup-linux-arm-gnueabihf" "4.14.0" + "@rollup/rollup-linux-arm64-gnu" "4.14.0" + "@rollup/rollup-linux-arm64-musl" "4.14.0" + "@rollup/rollup-linux-powerpc64le-gnu" "4.14.0" + "@rollup/rollup-linux-riscv64-gnu" "4.14.0" + "@rollup/rollup-linux-s390x-gnu" "4.14.0" + "@rollup/rollup-linux-x64-gnu" "4.14.0" + "@rollup/rollup-linux-x64-musl" "4.14.0" + "@rollup/rollup-win32-arm64-msvc" "4.14.0" + "@rollup/rollup-win32-ia32-msvc" "4.14.0" + "@rollup/rollup-win32-x64-msvc" "4.14.0" + fsevents "~2.3.2" + +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + +sanitize-html@^2.11.0: + version "2.13.0" + resolved "https://registry.yarnpkg.com/sanitize-html/-/sanitize-html-2.13.0.tgz#71aedcdb777897985a4ea1877bf4f895a1170dae" + integrity sha512-Xff91Z+4Mz5QiNSLdLWwjgBDm5b1RU6xBT0+12rapjiaR7SwfRdjw8f+6Rir2MXKLrDicRFHdb51hGOAxmsUIA== + dependencies: + deepmerge "^4.2.2" + escape-string-regexp "^4.0.0" + htmlparser2 "^8.0.0" + is-plain-object "^5.0.0" + parse-srcset "^1.0.2" + postcss "^8.3.11" + +scheduler@^0.23.0: + version "0.23.0" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe" + integrity sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw== + dependencies: + loose-envify "^1.1.0" + +source-map-js@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.0.tgz#16b809c162517b5b8c3e7dcd315a2a5c2612b2af" + integrity sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg== + +ssr-window@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/ssr-window/-/ssr-window-4.0.2.tgz#dc6b3ee37be86ac0e3ddc60030f7b3bc9b8553be" + integrity sha512-ISv/Ch+ig7SOtw7G2+qkwfVASzazUnvlDTwypdLoPoySv+6MqlOV10VwPSE6EWkGjhW50lUmghPmpYZXMu/+AQ== + +stimulus-vite-helpers@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/stimulus-vite-helpers/-/stimulus-vite-helpers-3.1.0.tgz#9216d703ac8d74befece4499ea738c18de408842" + integrity sha512-qy9vnNnu6e/1PArEndp456BuSKLQkBgc+vX2pedOHT0N4GSLQY0l5fuQ4ft56xZ8xSWqrfuYSR+GXXIPtoESww== + +svg-arc-to-cubic-bezier@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/svg-arc-to-cubic-bezier/-/svg-arc-to-cubic-bezier-3.2.0.tgz#390c450035ae1c4a0104d90650304c3bc814abe6" + integrity sha512-djbJ/vZKZO+gPoSDThGNpKDO+o+bAeA4XQKovvkNCqnIS2t+S4qnLAGQhyyrulhCFRl1WWzAp0wUDV8PpTVU3g== + +swiper@^9.4.1: + version "9.4.1" + resolved "https://registry.yarnpkg.com/swiper/-/swiper-9.4.1.tgz#2f48bcd6ab4b4fcf4ae93eaee53980531d42fd42" + integrity sha512-1nT2T8EzUpZ0FagEqaN/YAhRj33F2x/lN6cyB0/xoYJDMf8KwTFT3hMOeoB8Tg4o3+P/CKqskP+WX0Df046fqA== + dependencies: + ssr-window "^4.0.2" + +tiny-invariant@^1.2.0: + version "1.3.3" + resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.3.3.tgz#46680b7a873a0d5d10005995eb90a70d74d60127" + integrity sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg== + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +tslib@^2.0.0, tslib@^2.1.0: + version "2.6.2" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" + integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== + +typesafe-actions@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/typesafe-actions/-/typesafe-actions-5.1.0.tgz#9afe8b1e6a323af1fd59e6a57b11b7dd6623d2f1" + integrity sha512-bna6Yi1pRznoo6Bz1cE6btB/Yy8Xywytyfrzu/wc+NFW3ZF0I+2iCGImhBsoYYCOWuICtRO4yHcnDlzgo1AdNg== + +use-callback-ref@^1.3.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/use-callback-ref/-/use-callback-ref-1.3.2.tgz#6134c7f6ff76e2be0b56c809b17a650c942b1693" + integrity sha512-elOQwe6Q8gqZgDA8mrh44qRTQqpIHDcZ3hXTLjBe1i4ph8XpNJnO+aQf3NaG+lriLopI4HMx9VjQLfPQ6vhnoA== + dependencies: + tslib "^2.0.0" + +use-sidecar@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/use-sidecar/-/use-sidecar-1.1.2.tgz#2f43126ba2d7d7e117aa5855e5d8f0276dfe73c2" + integrity sha512-epTbsLuzZ7lPClpz2TyryBfztm7m+28DlEv2ZCQ3MDr5ssiwyOwGH/e5F9CkfWjJ1t4clvI58yF822/GUkjjhw== + dependencies: + detect-node-es "^1.1.0" + tslib "^2.0.0" + +uuid@^9.0.1: + version "9.0.1" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30" + integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== + +vite-plugin-environment@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/vite-plugin-environment/-/vite-plugin-environment-1.1.3.tgz#d01a04abb2f69730a4866c9c9db51d3dab74645b" + integrity sha512-9LBhB0lx+2lXVBEWxFZC+WO7PKEyE/ykJ7EPWCq95NEcCpblxamTbs5Dm3DLBGzwODpJMEnzQywJU8fw6XGGGA== + +vite-plugin-full-reload@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/vite-plugin-full-reload/-/vite-plugin-full-reload-1.1.0.tgz#ca6fa32631024a459ea9e5613dd4c0ff0f3b7995" + integrity sha512-3cObNDzX6DdfhD9E7kf6w2mNunFpD7drxyNgHLw+XwIYAgb+Xt16SEXo0Up4VH+TMf3n+DSVJZtW2POBGcBYAA== + dependencies: + picocolors "^1.0.0" + picomatch "^2.3.1" + +vite-plugin-manifest-sri@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/vite-plugin-manifest-sri/-/vite-plugin-manifest-sri-0.2.0.tgz#cb1cfd11692ee81f5d1194926cbea6d3a38b8599" + integrity sha512-Zt5jt19xTIJ91LOuQTCtNG7rTFc5OziAjBz2H5NdCGqaOD1nxrWExLhcKW+W4/q8/jOPCg/n5ncYEQmqCxiGQQ== + +vite-plugin-rails@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/vite-plugin-rails/-/vite-plugin-rails-0.5.0.tgz#fe29827b6f42abbc6e6537748963bb93871f468c" + integrity sha512-PR3zTHW96X8c7dRsuL2Mu1EAXXeO8fQjQ2KanwIC7EWgBST+D8AKjJyEUAr13IakrIYvd1cM3LcQUcrKmCMePg== + dependencies: + rollup-plugin-gzip "^3.1.0" + vite-plugin-environment "^1.1.3" + vite-plugin-full-reload "^1.1.0" + vite-plugin-manifest-sri "^0.2.0" + vite-plugin-ruby "^5.0.0" + vite-plugin-stimulus-hmr "^3.0.0" + +vite-plugin-ruby@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/vite-plugin-ruby/-/vite-plugin-ruby-5.0.0.tgz#cd891198a7672f2e8402439f53ab9d2b08f6502d" + integrity sha512-c8PjTp21Ah/ttgnNUyu0qvCXZI08Jr9I24oUKg3TRIRhF5GcOZ++6wtlTCrNFd9COEQbpXHxlRIXd/MEg0iZJw== + dependencies: + debug "^4.3.4" + fast-glob "^3.3.2" + +vite-plugin-stimulus-hmr@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/vite-plugin-stimulus-hmr/-/vite-plugin-stimulus-hmr-3.0.0.tgz#60410a69486e86a8c1a769fe4b10039ac5f8d910" + integrity sha512-KElOiZOlaG4XilQQHrzK8M1u5UfK4EFfADJKQYbnmsUMifDOnPR6anVYgHAN95QyWJ67Q/rYWe5BB9M5OxocfQ== + dependencies: + debug "^4.3" + stimulus-vite-helpers "^3.0.0" + +vite@^5.1.5: + version "5.2.8" + resolved "https://registry.yarnpkg.com/vite/-/vite-5.2.8.tgz#a99e09939f1a502992381395ce93efa40a2844aa" + integrity sha512-OyZR+c1CE8yeHw5V5t59aXsUPPVTHMDjEZz8MgguLL/Q7NblxhZUlTu9xSPqlsUO/y+X7dlU05jdhvyycD55DA== + dependencies: + esbuild "^0.20.1" + postcss "^8.4.38" + rollup "^4.13.0" + optionalDependencies: + fsevents "~2.3.3" + +void-elements@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-3.1.0.tgz#614f7fbf8d801f0bb5f0661f5b2f5785750e4f09" + integrity sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w== + +web-streams-polyfill@^3.0.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz#2073b91a2fdb1fbfbd401e7de0ac9f8214cecb4b" + integrity sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw== + +web-worker@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/web-worker/-/web-worker-1.3.0.tgz#e5f2df5c7fe356755a5fb8f8410d4312627e6776" + integrity sha512-BSR9wyRsy/KOValMgd5kMyr3JzpdeoR9KVId8u5GVlTTAtNChlsE4yTxeY7zMdNSyOmoKBv8NH2qeRY9Tg+IaA== + +xml-utils@^1.0.2: + version "1.8.0" + resolved "https://registry.yarnpkg.com/xml-utils/-/xml-utils-1.8.0.tgz#dd9baa161012849b97703d8423d09d9d815a5910" + integrity sha512-1TY5yLw8DApowZAUsWCniNr8HH6Ebt6O7UQvmIwziGKwUNsQx6e+4NkfOvCfnqmYIcPjCeoI6dh1JenPJ9a1hQ== + +zstddec@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/zstddec/-/zstddec-0.1.0.tgz#7050f3f0e0c3978562d0c566b3e5a427d2bad7ec" + integrity sha512-w2NTI8+3l3eeltKAdK8QpiLo/flRAr2p8AGeakfMZOXBxOg9HIu4LVDxBi81sYgVhFhdJjv1OrB5ssI8uFPoLg==