commit 2cc4c267e86c6adaf5f066c570dd2f21db85ed3e Author: onezoroone Date: Wed May 20 11:25:09 2026 +0700 v1.0.0 diff --git a/README.md b/README.md new file mode 100755 index 0000000..1499833 --- /dev/null +++ b/README.md @@ -0,0 +1,50 @@ +# THEME - RIPPLE 2022 - VSMOV CMS + +## Demo + +### Trang Chủ +![Alt text](https://i.ibb.co/M2SMFwf/RIPPLE-INDEX.png "Home Page") + +### Trang Danh Sách Phim +![Alt text](https://i.ibb.co/6JwS6hy/RIPPLE-CATALOG.png "Catalog Page") + +### Trang Thông Tin Phim +![Alt text](https://i.ibb.co/2h0FjyQ/RIPPLE-SINGLE.png "Single Page") + +### Trang Xem Phim +![Alt text](https://i.ibb.co/dD00qPG/RIPPLE-EPISODE.png "Episode Page") + + +## Requirements +https://github.com/vsphim/vsmov-core + +## Install +1. Tại thư mục của Project: `composer require vsmov/vsmov-ripple` +2. Kích hoạt giao diện trong Admin Panel + +## Update +1. Tại thư mục của Project: `composer update vsmov/vsmov-ripple` +2. Re-Activate giao diện trong Admin Panel + +## Note +- Một vài lưu ý quan trọng của các nút chức năng: + + `Activate` và `Re-Activate` sẽ publish toàn bộ file js,css trong themes ra ngoài public của laravel. + + `Reset` reset lại toàn bộ cấu hình của themes + +## Document +### List +- Trang chủ: `display_label|relation|find_by_field|value|limit|show_more_url` + + Ví dụ theo định dạng: `Phim bộ mới||type|series|12|/danh-sach/phim-bo` + + Ví dụ theo định dạng: `Phim lẻ mới||type|single|12|/danh-sach/phim-le` + + Ví dụ theo thể loại: `Phim hành động|categories|slug|hanh-dong|12|/the-loai/hanh-dong` + + Ví dụ theo quốc gia: `Phim hàn quốc|regions|slug|han-quoc|12|/quoc-gia/han-quoc` + + Ví dụ với các field khác: `Phim chiếu rạp||is_shown_in_theater|1|12|/danh-sach/phim-chieu-rap|` + +- Danh sách hot: `Label|relation|find_by_field|value|sort_by_field|sort_algo|limit` + + `Phim sắp chiếu||status|trailer|publish_year|desc|9` + + `Top phim bộ||type|series|view_total|desc|9` + + `Top phim lẻ||type|single|view_total|desc|9` + +### Custom View Blade +- File blade gốc trong Package: `/vendor/hacoidev/vsmov-ripple/resources/views/ripple` +- Copy file cần custom đến: `/resources/views/vendor/themes/ripple` diff --git a/composer.json b/composer.json new file mode 100755 index 0000000..69ec44d --- /dev/null +++ b/composer.json @@ -0,0 +1,32 @@ +{ + "name": "vsmov/vsmov-ripple", + "description": "VsMov's ripple theme", + "type": "library", + "authors": [ + { + "name": "vsmov", + "email": "vsmov.dev@gmail.com" + } + ], + "require": { + "laravel/framework": "^6|^7|^8", + "ckfinder/ckfinder-laravel-package": "v3.5.2.1", + "vsmov/vsmov-core": "^1.0.1" + }, + "license": "MIT", + "autoload": { + "psr-4": { + "VsMov\\Ripple\\": "src/", + "VsMov\\Ripple\\Database\\Factories\\": "database/factories/", + "VsMov\\Ripple\\Database\\Seeders\\": "database/seeders/" + } + }, + "extra": { + "laravel": { + "providers": [ + "VsMov\\Ripple\\RippleServiceProvider" + ] + } + }, + "minimum-stability": "stable" +} diff --git a/resources/assets/css/all.css b/resources/assets/css/all.css new file mode 100644 index 0000000..f031ebc --- /dev/null +++ b/resources/assets/css/all.css @@ -0,0 +1 @@ +/*! tailwindcss v3.3.1 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-feature-settings:normal;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}:root,[data-theme]{background-color:hsla(var(--b1)/var(--tw-bg-opacity,1));color:hsla(var(--bc)/var(--tw-text-opacity,1))}html{-webkit-tap-highlight-color:transparent}:root{--pf:258.89 94.378% 40.941%;--sf:314 100% 37.647%;--af:174 60% 40.784%;--nf:219 14.085% 22.275%;--in:198 93% 60%;--su:158 64% 52%;--wa:43 96% 56%;--er:0 91% 71%;--inc:198 100% 12%;--suc:158 100% 10%;--wac:43 100% 11%;--erc:0 100% 14%;--rounded-box:1rem;--rounded-btn:0.5rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:258.89 94.378% 51.176%;--pc:0 0% 100%;--s:314 100% 47.059%;--sc:0 0% 100%;--a:174 60% 50.98%;--ac:174.71 43.59% 15.294%;--n:219 14.085% 27.843%;--nc:0 0% 100%;--b1:0 0% 100%;--b2:0 0% 94.902%;--b3:180 1.9608% 90%;--bc:215 27.907% 16.863%;color-scheme:light}@media (prefers-color-scheme:dark){:root{--pf:262.35 80.315% 40.157%;--sf:315.75 70.196% 40%;--af:174.69 70.335% 32.784%;--in:198 93% 60%;--su:158 64% 52%;--wa:43 96% 56%;--er:0 91% 71%;--inc:198 100% 12%;--suc:158 100% 10%;--wac:43 100% 11%;--erc:0 100% 14%;--rounded-box:1rem;--rounded-btn:0.5rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:262.35 80.315% 50.196%;--pc:0 0% 100%;--s:315.75 70.196% 50%;--sc:0 0% 100%;--a:174.69 70.335% 40.98%;--ac:0 0% 100%;--n:218.18 18.033% 11.961%;--nf:222.86 17.073% 8.0392%;--nc:220 13.376% 69.216%;--b1:220 17.647% 20%;--b2:220 17.241% 17.059%;--b3:218.57 17.949% 15.294%;--bc:220 13.376% 69.216%;color-scheme:dark}}[data-theme=light]{--pf:258.89 94.378% 40.941%;--sf:314 100% 37.647%;--af:174 60% 40.784%;--nf:219 14.085% 22.275%;--in:198 93% 60%;--su:158 64% 52%;--wa:43 96% 56%;--er:0 91% 71%;--inc:198 100% 12%;--suc:158 100% 10%;--wac:43 100% 11%;--erc:0 100% 14%;--rounded-box:1rem;--rounded-btn:0.5rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:258.89 94.378% 51.176%;--pc:0 0% 100%;--s:314 100% 47.059%;--sc:0 0% 100%;--a:174 60% 50.98%;--ac:174.71 43.59% 15.294%;--n:219 14.085% 27.843%;--nc:0 0% 100%;--b1:0 0% 100%;--b2:0 0% 94.902%;--b3:180 1.9608% 90%;--bc:215 27.907% 16.863%;color-scheme:light}[data-theme=dark]{--pf:262.35 80.315% 40.157%;--sf:315.75 70.196% 40%;--af:174.69 70.335% 32.784%;--in:198 93% 60%;--su:158 64% 52%;--wa:43 96% 56%;--er:0 91% 71%;--inc:198 100% 12%;--suc:158 100% 10%;--wac:43 100% 11%;--erc:0 100% 14%;--rounded-box:1rem;--rounded-btn:0.5rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:262.35 80.315% 50.196%;--pc:0 0% 100%;--s:315.75 70.196% 50%;--sc:0 0% 100%;--a:174.69 70.335% 40.98%;--ac:0 0% 100%;--n:218.18 18.033% 11.961%;--nf:222.86 17.073% 8.0392%;--nc:220 13.376% 69.216%;--b1:220 17.647% 20%;--b2:220 17.241% 17.059%;--b3:218.57 17.949% 15.294%;--bc:220 13.376% 69.216%;color-scheme:dark}[data-theme=cupcake]{--pf:183.03 47.368% 47.216%;--sf:338.25 71.429% 62.431%;--af:39 84.112% 46.431%;--nf:280 46.479% 11.137%;--in:198 93% 60%;--su:158 64% 52%;--wa:43 96% 56%;--er:0 91% 71%;--pc:183.03 100% 11.804%;--sc:338.25 100% 15.608%;--ac:39 100% 11.608%;--nc:280 82.688% 82.784%;--inc:198 100% 12%;--suc:158 100% 10%;--wac:43 100% 11%;--erc:0 100% 14%;--rounded-box:1rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--p:183.03 47.368% 59.02%;--s:338.25 71.429% 78.039%;--a:39 84.112% 58.039%;--n:280 46.479% 13.922%;--b1:24 33.333% 97.059%;--b2:26.667 21.951% 91.961%;--b3:22.5 14.286% 89.02%;--bc:280 46.479% 13.922%;--rounded-btn:1.9rem;--tab-border:2px;--tab-radius:.5rem;color-scheme:light}[data-theme=bumblebee]{--pf:41.124 74.167% 42.353%;--sf:49.901 94.393% 46.431%;--af:240 33.333% 11.294%;--nf:240 33.333% 11.294%;--b2:0 0% 90%;--b3:0 0% 81%;--in:198 93% 60%;--su:158 64% 52%;--wa:43 96% 56%;--er:0 91% 71%;--bc:0 0% 20%;--ac:240 60.274% 82.824%;--nc:240 60.274% 82.824%;--inc:198 100% 12%;--suc:158 100% 10%;--wac:43 100% 11%;--erc:0 100% 14%;--rounded-box:1rem;--rounded-btn:0.5rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:41.124 74.167% 52.941%;--pc:240 33.333% 14.118%;--s:49.901 94.393% 58.039%;--sc:240 33.333% 14.118%;--a:240 33.333% 14.118%;--n:240 33.333% 14.118%;--b1:0 0% 100%;color-scheme:light}[data-theme=emerald]{--pf:141.18 50% 48%;--sf:218.88 96.078% 48%;--af:9.8901 81.25% 44.863%;--nf:219.23 20.312% 20.078%;--b2:0 0% 90%;--b3:0 0% 81%;--in:198 93% 60%;--su:158 64% 52%;--wa:43 96% 56%;--er:0 91% 71%;--inc:198 100% 12%;--suc:158 100% 10%;--wac:43 100% 11%;--erc:0 100% 14%;--rounded-box:1rem;--rounded-btn:0.5rem;--rounded-badge:1.9rem;--btn-text-case:uppercase;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:141.18 50% 60%;--pc:151.11 28.421% 18.627%;--s:218.88 96.078% 60%;--sc:210 20% 98.039%;--a:9.8901 81.25% 56.078%;--ac:210 20% 98.039%;--n:219.23 20.312% 25.098%;--nc:210 20% 98.039%;--b1:0 0% 100%;--bc:219.23 20.312% 25.098%;--animation-btn:0;--animation-input:0;--btn-focus-scale:1;color-scheme:light}[data-theme=corporate]{--pf:229.09 95.652% 51.137%;--sf:214.91 26.316% 47.216%;--af:154.2 49.02% 48%;--nf:233.33 27.273% 10.353%;--b2:0 0% 90%;--b3:0 0% 81%;--in:198 93% 60%;--su:158 64% 52%;--wa:43 96% 56%;--er:0 91% 71%;--pc:229.09 100% 92.784%;--sc:214.91 100% 11.804%;--ac:154.2 100% 12%;--inc:198 100% 12%;--suc:158 100% 10%;--wac:43 100% 11%;--erc:0 100% 14%;--btn-text-case:uppercase;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:229.09 95.652% 63.922%;--s:214.91 26.316% 59.02%;--a:154.2 49.02% 60%;--n:233.33 27.273% 12.941%;--nc:210 38.462% 94.902%;--b1:0 0% 100%;--bc:233.33 27.273% 12.941%;--rounded-box:0.25rem;--rounded-btn:.125rem;--rounded-badge:.125rem;--animation-btn:0;--animation-input:0;--btn-focus-scale:1;color-scheme:light}[data-theme=synthwave]{--pf:320.73 69.62% 55.216%;--sf:197.03 86.592% 51.922%;--af:48 89.041% 45.647%;--nf:253.22 60.825% 15.216%;--b2:253.85 59.091% 23.294%;--b3:253.85 59.091% 20.965%;--pc:320.73 100% 13.804%;--sc:197.03 100% 12.98%;--ac:48 100% 11.412%;--rounded-box:1rem;--rounded-btn:0.5rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:320.73 69.62% 69.02%;--s:197.03 86.592% 64.902%;--a:48 89.041% 57.059%;--n:253.22 60.825% 19.02%;--nc:260 60% 98.039%;--b1:253.85 59.091% 25.882%;--bc:260 60% 98.039%;--in:199.13 86.957% 63.922%;--inc:257.45 63.218% 17.059%;--su:168.1 74.233% 68.039%;--suc:257.45 63.218% 17.059%;--wa:48 89.041% 57.059%;--wac:257.45 63.218% 17.059%;--er:351.85 73.636% 56.863%;--erc:260 60% 98.039%;color-scheme:dark}[data-theme=retro]{--pf:2.6667 73.77% 60.863%;--sf:144.62 27.273% 57.569%;--af:49.024 67.213% 60.863%;--nf:41.667 16.822% 33.569%;--inc:221.21 100% 90.667%;--suc:142.13 100% 87.255%;--wac:32.133 100% 8.7451%;--erc:0 100% 90.118%;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:2.6667 73.77% 76.078%;--pc:345 5.2632% 14.902%;--s:144.62 27.273% 71.961%;--sc:345 5.2632% 14.902%;--a:49.024 67.213% 76.078%;--ac:345 5.2632% 14.902%;--n:41.667 16.822% 41.961%;--nc:45 47.059% 80%;--b1:45 47.059% 80%;--b2:45.283 37.063% 71.961%;--b3:42.188 35.955% 65.098%;--bc:345 5.2632% 14.902%;--in:221.21 83.193% 53.333%;--su:142.13 76.216% 36.275%;--wa:32.133 94.619% 43.725%;--er:0 72.222% 50.588%;--rounded-box:0.4rem;--rounded-btn:0.4rem;--rounded-badge:0.4rem;color-scheme:light}[data-theme=cyberpunk]{--pf:344.78 100% 58.353%;--sf:195.12 80.392% 56%;--af:276 74.324% 56.784%;--nf:57.273 100% 10.353%;--b2:56 100% 45%;--b3:56 100% 40.5%;--in:198 93% 60%;--su:158 64% 52%;--wa:43 96% 56%;--er:0 91% 71%;--bc:56 100% 10%;--pc:344.78 100% 14.588%;--sc:195.12 100% 14%;--ac:276 100% 14.196%;--inc:198 100% 12%;--suc:158 100% 10%;--wac:43 100% 11%;--erc:0 100% 14%;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--p:344.78 100% 72.941%;--s:195.12 80.392% 70%;--a:276 74.324% 70.98%;--n:57.273 100% 12.941%;--nc:56 100% 50%;--b1:56 100% 50%;--rounded-box:0;--rounded-btn:0;--rounded-badge:0;--tab-radius:0;color-scheme:light;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}[data-theme=valentine]{--pf:353.23 73.81% 53.647%;--sf:254.12 86.441% 61.49%;--af:181.41 55.556% 56%;--nf:336 42.857% 38.431%;--b2:318.46 46.429% 80.118%;--b3:318.46 46.429% 72.106%;--pc:353.23 100% 13.412%;--sc:254.12 100% 15.373%;--ac:181.41 100% 14%;--inc:221.21 100% 90.667%;--suc:142.13 100% 87.255%;--wac:32.133 100% 8.7451%;--erc:0 100% 90.118%;--rounded-box:1rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:353.23 73.81% 67.059%;--s:254.12 86.441% 76.863%;--a:181.41 55.556% 70%;--n:336 42.857% 48.039%;--nc:318.46 46.429% 89.02%;--b1:318.46 46.429% 89.02%;--bc:343.64 38.462% 28.039%;--in:221.21 83.193% 53.333%;--su:142.13 76.216% 36.275%;--wa:32.133 94.619% 43.725%;--er:0 72.222% 50.588%;--rounded-btn:1.9rem;color-scheme:light}[data-theme=halloween]{--pf:31.927 89.344% 41.725%;--sf:271.22 45.794% 33.569%;--af:91.071 100% 26.353%;--nf:180 3.5714% 8.7843%;--b2:0 0% 11.647%;--b3:0 0% 10.482%;--bc:0 0% 82.588%;--sc:271.22 100% 88.392%;--ac:91.071 100% 6.5882%;--nc:180 4.8458% 82.196%;--inc:221.21 100% 90.667%;--suc:142.13 100% 87.255%;--wac:32.133 100% 8.7451%;--erc:0 100% 90.118%;--rounded-box:1rem;--rounded-btn:0.5rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:31.927 89.344% 52.157%;--pc:180 7.3171% 8.0392%;--s:271.22 45.794% 41.961%;--a:91.071 100% 32.941%;--n:180 3.5714% 10.98%;--b1:0 0% 12.941%;--in:221.21 83.193% 53.333%;--su:142.13 76.216% 36.275%;--wa:32.133 94.619% 43.725%;--er:0 72.222% 50.588%;color-scheme:dark}[data-theme=garden]{--pf:138.86 15.982% 34.353%;--sf:96.923 37.143% 74.51%;--af:0 67.742% 75.137%;--nf:0 3.9106% 28.078%;--b2:0 4.3478% 81.882%;--b3:0 4.3478% 73.694%;--in:198 93% 60%;--su:158 64% 52%;--wa:43 96% 56%;--er:0 91% 71%;--pc:138.86 100% 88.588%;--inc:198 100% 12%;--suc:158 100% 10%;--wac:43 100% 11%;--erc:0 100% 14%;--rounded-box:1rem;--rounded-btn:0.5rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:138.86 15.982% 42.941%;--s:96.923 37.143% 93.137%;--sc:96 32.468% 15.098%;--a:0 67.742% 93.922%;--ac:0 21.951% 16.078%;--n:0 3.9106% 35.098%;--nc:0 4.3478% 90.98%;--b1:0 4.3478% 90.98%;--bc:0 3.2258% 6.0784%;color-scheme:light}[data-theme=forest]{--pf:141.04 71.963% 33.569%;--sf:140.98 74.694% 38.431%;--af:35.148 68.98% 41.569%;--nf:0 9.6774% 4.8627%;--b2:0 12.195% 7.2353%;--b3:0 12.195% 6.5118%;--in:198 93% 60%;--su:158 64% 52%;--wa:43 96% 56%;--er:0 91% 71%;--bc:0 11.727% 81.608%;--sc:140.98 100% 9.6078%;--ac:35.148 100% 10.392%;--nc:0 6.8894% 81.216%;--inc:198 100% 12%;--suc:158 100% 10%;--wac:43 100% 11%;--erc:0 100% 14%;--rounded-box:1rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:141.04 71.963% 41.961%;--pc:140.66 100% 88.039%;--s:140.98 74.694% 48.039%;--a:35.148 68.98% 51.961%;--n:0 9.6774% 6.0784%;--b1:0 12.195% 8.0392%;--rounded-btn:1.9rem;color-scheme:dark}[data-theme=aqua]{--pf:181.79 92.857% 39.529%;--sf:274.41 30.909% 45.49%;--af:47.059 100% 64%;--nf:205.4 53.725% 40%;--b2:218.61 52.511% 38.647%;--b3:218.61 52.511% 34.782%;--bc:218.61 100% 88.588%;--sc:274.41 100% 91.373%;--ac:47.059 100% 16%;--nc:205.4 100% 90%;--inc:221.21 100% 90.667%;--suc:142.13 100% 87.255%;--wac:32.133 100% 8.7451%;--erc:0 100% 90.118%;--rounded-box:1rem;--rounded-btn:0.5rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:181.79 92.857% 49.412%;--pc:181.41 100% 16.667%;--s:274.41 30.909% 56.863%;--a:47.059 100% 80%;--n:205.4 53.725% 50%;--b1:218.61 52.511% 42.941%;--in:221.21 83.193% 53.333%;--su:142.13 76.216% 36.275%;--wa:32.133 94.619% 43.725%;--er:0 72.222% 50.588%;color-scheme:dark}[data-theme=lofi]{--pf:0 0% 4.0784%;--sf:0 1.9608% 8%;--af:0 0% 11.922%;--nf:0 0% 0%;--btn-text-case:uppercase;--border-btn:1px;--tab-border:1px;--p:0 0% 5.098%;--pc:0 0% 100%;--s:0 1.9608% 10%;--sc:0 0% 100%;--a:0 0% 14.902%;--ac:0 0% 100%;--n:0 0% 0%;--nc:0 0% 100%;--b1:0 0% 100%;--b2:0 0% 94.902%;--b3:0 1.9608% 90%;--bc:0 0% 0%;--in:212.35 100% 47.647%;--inc:0 0% 100%;--su:136.84 72.152% 46.471%;--suc:0 0% 100%;--wa:4.5614 100% 66.471%;--wac:0 0% 100%;--er:325.05 77.6% 49.02%;--erc:0 0% 100%;--rounded-box:0.25rem;--rounded-btn:0.125rem;--rounded-badge:0.125rem;--animation-btn:0;--animation-input:0;--btn-focus-scale:1;--tab-radius:0;color-scheme:light}[data-theme=pastel]{--pf:283.64 21.569% 64%;--sf:351.63 70.492% 70.431%;--af:158.49 54.639% 64.784%;--nf:198.62 43.719% 48.784%;--in:198 93% 60%;--su:158 64% 52%;--wa:43 96% 56%;--er:0 91% 71%;--bc:0 0% 20%;--pc:283.64 59.314% 16%;--sc:351.63 100% 17.608%;--ac:158.49 100% 16.196%;--nc:198.62 100% 12.196%;--inc:198 100% 12%;--suc:158 100% 10%;--wac:43 100% 11%;--erc:0 100% 14%;--rounded-box:1rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:283.64 21.569% 80%;--s:351.63 70.492% 88.039%;--a:158.49 54.639% 80.98%;--n:198.62 43.719% 60.98%;--b1:0 0% 100%;--b2:210 20% 98.039%;--b3:216 12.195% 83.922%;--rounded-btn:1.9rem;color-scheme:light}[data-theme=fantasy]{--pf:296.04 82.813% 20.078%;--sf:200 100% 29.647%;--af:30.894 94.378% 40.941%;--nf:215 27.907% 13.49%;--b2:0 0% 90%;--b3:0 0% 81%;--in:198 93% 60%;--su:158 64% 52%;--wa:43 96% 56%;--er:0 91% 71%;--pc:296.04 100% 85.02%;--sc:200 100% 87.412%;--ac:30.894 100% 10.235%;--nc:215 62.264% 83.373%;--inc:198 100% 12%;--suc:158 100% 10%;--wac:43 100% 11%;--erc:0 100% 14%;--rounded-box:1rem;--rounded-btn:0.5rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:296.04 82.813% 25.098%;--s:200 100% 37.059%;--a:30.894 94.378% 51.176%;--n:215 27.907% 16.863%;--b1:0 0% 100%;--bc:215 27.907% 16.863%;color-scheme:light}[data-theme=wireframe]{--pf:0 0% 57.725%;--sf:0 0% 57.725%;--af:0 0% 57.725%;--nf:0 0% 73.725%;--bc:0 0% 20%;--pc:0 0% 14.431%;--sc:0 0% 14.431%;--ac:0 0% 14.431%;--nc:0 0% 18.431%;--inc:240 100% 90%;--suc:120 100% 85.02%;--wac:60 100% 10%;--erc:0 100% 90%;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--p:0 0% 72.157%;--s:0 0% 72.157%;--a:0 0% 72.157%;--n:0 0% 92.157%;--b1:0 0% 100%;--b2:0 0% 93.333%;--b3:0 0% 86.667%;--in:240 100% 50%;--su:120 100% 25.098%;--wa:60 30.196% 50%;--er:0 100% 50%;--rounded-box:0.2rem;--rounded-btn:0.2rem;--rounded-badge:0.2rem;--tab-radius:0.2rem;color-scheme:light;font-family:Chalkboard,comic sans ms,sanssecondaryerif}[data-theme=black]{--pf:0 1.9608% 16%;--sf:0 1.9608% 16%;--af:0 1.9608% 16%;--bc:0 0% 80%;--pc:0 5.3922% 84%;--sc:0 5.3922% 84%;--ac:0 5.3922% 84%;--nc:0 2.5404% 83.02%;--inc:240 100% 90%;--suc:120 100% 85.02%;--wac:60 100% 10%;--erc:0 100% 90%;--border-btn:1px;--tab-border:1px;--p:0 1.9608% 20%;--s:0 1.9608% 20%;--a:0 1.9608% 20%;--b1:0 0% 0%;--b2:0 0% 5.098%;--b3:0 1.9608% 10%;--n:0 1.2987% 15.098%;--nf:0 1.9608% 20%;--in:240 100% 50%;--su:120 100% 25.098%;--wa:60 100% 50%;--er:0 100% 50%;--rounded-box:0;--rounded-btn:0;--rounded-badge:0;--animation-btn:0;--animation-input:0;--btn-text-case:lowercase;--btn-focus-scale:1;--tab-radius:0;color-scheme:dark}[data-theme=luxury]{--pf:0 0% 80%;--sf:218.4 54.348% 14.431%;--af:318.62 21.805% 20.863%;--nf:270 4.3478% 7.2157%;--pc:0 0% 20%;--sc:218.4 100% 83.608%;--ac:318.62 84.615% 85.216%;--inc:202.35 100% 14%;--suc:89.007 100% 10.392%;--wac:53.906 100% 12.706%;--erc:0 100% 14.353%;--rounded-box:1rem;--rounded-btn:0.5rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:0 0% 100%;--s:218.4 54.348% 18.039%;--a:318.62 21.805% 26.078%;--n:270 4.3478% 9.0196%;--nc:37.083 67.29% 58.039%;--b1:240 10% 3.9216%;--b2:270 4.3478% 9.0196%;--b3:270 2.1739% 18.039%;--bc:37.083 67.29% 58.039%;--in:202.35 100% 70%;--su:89.007 61.633% 51.961%;--wa:53.906 68.817% 63.529%;--er:0 100% 71.765%;color-scheme:dark}[data-theme=dracula]{--pf:325.52 100% 58.98%;--sf:264.71 89.474% 62.118%;--af:31.02 100% 56.941%;--nf:229.57 15.033% 24%;--b2:231.43 14.894% 16.588%;--b3:231.43 14.894% 14.929%;--pc:325.52 100% 14.745%;--sc:264.71 100% 15.529%;--ac:31.02 100% 14.235%;--nc:229.57 70.868% 86%;--inc:190.53 100% 15.373%;--suc:135.18 100% 12.941%;--wac:64.909 100% 15.294%;--erc:0 100% 93.333%;--rounded-box:1rem;--rounded-btn:0.5rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:325.52 100% 73.725%;--s:264.71 89.474% 77.647%;--a:31.02 100% 71.176%;--n:229.57 15.033% 30%;--b1:231.43 14.894% 18.431%;--bc:60 30% 96.078%;--in:190.53 96.61% 76.863%;--su:135.18 94.444% 64.706%;--wa:64.909 91.667% 76.471%;--er:0 100% 66.667%;color-scheme:dark}[data-theme=cmyk]{--pf:202.72 83.251% 48.157%;--sf:335.25 77.67% 47.686%;--af:56.195 100% 47.843%;--nf:0 0% 8.1569%;--b2:0 0% 90%;--b3:0 0% 81%;--bc:0 0% 20%;--pc:202.72 100% 12.039%;--sc:335.25 100% 91.922%;--ac:56.195 100% 11.961%;--nc:0 0% 82.039%;--inc:192.2 100% 10.431%;--suc:291.06 100% 87.608%;--wac:25.027 100% 11.333%;--erc:3.956 100% 91.137%;--rounded-box:1rem;--rounded-btn:0.5rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:202.72 83.251% 60.196%;--s:335.25 77.67% 59.608%;--a:56.195 100% 59.804%;--n:0 0% 10.196%;--b1:0 0% 100%;--in:192.2 48.361% 52.157%;--su:291.06 48.454% 38.039%;--wa:25.027 84.615% 56.667%;--er:3.956 80.531% 55.686%;color-scheme:light}[data-theme=autumn]{--pf:344.23 95.804% 22.431%;--sf:0.44444 63.38% 46.588%;--af:27.477 56.021% 50.039%;--nf:22.105 17.117% 34.824%;--b2:0 0% 85.059%;--b3:0 0% 76.553%;--bc:0 0% 18.902%;--pc:344.23 100% 85.608%;--sc:0.44444 100% 91.647%;--ac:27.477 100% 12.51%;--nc:22.105 100% 88.706%;--inc:186.94 100% 9.9216%;--suc:164.59 100% 8.6275%;--wac:30.141 100% 9.9216%;--erc:353.6 100% 89.765%;--rounded-box:1rem;--rounded-btn:0.5rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:344.23 95.804% 28.039%;--s:0.44444 63.38% 58.235%;--a:27.477 56.021% 62.549%;--n:22.105 17.117% 43.529%;--b1:0 0% 94.51%;--in:186.94 47.826% 49.608%;--su:164.59 33.636% 43.137%;--wa:30.141 84.19% 49.608%;--er:353.6 79.116% 48.824%;color-scheme:light}[data-theme=business]{--pf:210 64.103% 24.471%;--sf:200 12.931% 43.608%;--af:12.515 79.512% 47.843%;--nf:212.73 13.58% 12.706%;--b2:0 0% 11.294%;--b3:0 0% 10.165%;--bc:0 0% 82.51%;--pc:210 100% 86.118%;--sc:200 100% 10.902%;--ac:12.515 100% 11.961%;--nc:212.73 28.205% 83.176%;--inc:199.15 100% 88.353%;--suc:144 100% 11.137%;--wac:39.231 100% 12.078%;--erc:6.3415 100% 88.667%;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:210 64.103% 30.588%;--s:200 12.931% 54.51%;--a:12.515 79.512% 59.804%;--n:212.73 13.58% 15.882%;--b1:0 0% 12.549%;--in:199.15 100% 41.765%;--su:144 30.973% 55.686%;--wa:39.231 64.356% 60.392%;--er:6.3415 55.656% 43.333%;--rounded-box:0.25rem;--rounded-btn:.125rem;--rounded-badge:.125rem;color-scheme:dark}[data-theme=acid]{--pf:302.59 100% 40%;--sf:27.294 100% 40%;--af:72 98.425% 40.157%;--nf:238.42 43.182% 13.804%;--b2:0 0% 88.235%;--b3:0 0% 79.412%;--bc:0 0% 19.608%;--pc:302.59 100% 90%;--sc:27.294 100% 10%;--ac:72 100% 10.039%;--nc:238.42 99.052% 83.451%;--inc:209.85 100% 11.569%;--suc:148.87 100% 11.608%;--wac:52.574 100% 11.451%;--erc:0.78261 100% 89.02%;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:302.59 100% 50%;--s:27.294 100% 50%;--a:72 98.425% 50.196%;--n:238.42 43.182% 17.255%;--b1:0 0% 98.039%;--in:209.85 91.628% 57.843%;--su:148.87 49.533% 58.039%;--wa:52.574 92.661% 57.255%;--er:0.78261 100% 45.098%;--rounded-box:1.25rem;--rounded-btn:1rem;--rounded-badge:1rem;color-scheme:light}[data-theme=lemonade]{--pf:88.8 96.154% 24.471%;--sf:60 80.952% 43.765%;--af:62.553 79.661% 70.745%;--nf:238.42 43.182% 13.804%;--b2:0 0% 90%;--b3:0 0% 81%;--bc:0 0% 20%;--pc:88.8 100% 86.118%;--sc:60 100% 10.941%;--ac:62.553 100% 17.686%;--nc:238.42 99.052% 83.451%;--inc:191.61 79.118% 16.902%;--suc:74.458 100% 15.725%;--wac:50.182 100% 15.059%;--erc:0.98361 100% 16.588%;--rounded-box:1rem;--rounded-btn:0.5rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:88.8 96.154% 30.588%;--s:60 80.952% 54.706%;--a:62.553 79.661% 88.431%;--n:238.42 43.182% 17.255%;--b1:0 0% 100%;--in:191.61 39.241% 84.51%;--su:74.458 76.147% 78.627%;--wa:50.182 87.302% 75.294%;--er:0.98361 70.115% 82.941%;color-scheme:light}[data-theme=night]{--pf:198.44 93.204% 47.686%;--sf:234.45 89.474% 59.137%;--af:328.85 85.621% 56%;--b2:222.22 47.368% 10.059%;--b3:222.22 47.368% 9.0529%;--bc:222.22 65.563% 82.235%;--pc:198.44 100% 11.922%;--sc:234.45 100% 14.784%;--ac:328.85 100% 14%;--nc:217.24 75.772% 83.49%;--inc:198.46 100% 9.6078%;--suc:172.46 100% 10.078%;--wac:40.61 100% 12.706%;--erc:350.94 100% 14.235%;--rounded-box:1rem;--rounded-btn:0.5rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:198.44 93.204% 59.608%;--s:234.45 89.474% 73.922%;--a:328.85 85.621% 70%;--n:217.24 32.584% 17.451%;--nf:217.06 30.357% 21.961%;--b1:222.22 47.368% 11.176%;--in:198.46 90.204% 48.039%;--su:172.46 66.008% 50.392%;--wa:40.61 88.172% 63.529%;--er:350.94 94.558% 71.176%;color-scheme:dark}[data-theme=coffee]{--pf:29.583 66.667% 46.118%;--sf:182.4 24.752% 15.843%;--af:194.19 74.4% 19.608%;--nf:300 20% 4.7059%;--b2:306 18.519% 9.5294%;--b3:306 18.519% 8.5765%;--pc:29.583 100% 11.529%;--sc:182.4 67.237% 83.961%;--ac:194.19 100% 84.902%;--nc:300 13.75% 81.176%;--inc:171.15 100% 13.451%;--suc:92.5 100% 12.471%;--wac:43.125 100% 13.725%;--erc:9.7561 100% 14.941%;--rounded-box:1rem;--rounded-btn:0.5rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:29.583 66.667% 57.647%;--s:182.4 24.752% 19.804%;--a:194.19 74.4% 24.51%;--n:300 20% 5.8824%;--b1:306 18.519% 10.588%;--bc:36.667 8.3333% 42.353%;--in:171.15 36.527% 67.255%;--su:92.5 25% 62.353%;--wa:43.125 100% 68.627%;--er:9.7561 95.349% 74.706%;color-scheme:dark}[data-theme=winter]{--pf:211.79 100% 40.627%;--sf:246.92 47.273% 34.51%;--af:310.41 49.388% 41.569%;--nf:217.02 92.157% 8%;--pc:211.79 100% 90.157%;--sc:246.92 100% 88.627%;--ac:310.41 100% 90.392%;--nc:217.02 100% 82%;--inc:191.54 100% 15.608%;--suc:181.5 100% 13.255%;--wac:32.308 100% 16.706%;--erc:0 100% 14.431%;--rounded-box:1rem;--rounded-btn:0.5rem;--rounded-badge:1.9rem;--animation-btn:0.25s;--animation-input:.2s;--btn-text-case:uppercase;--btn-focus-scale:0.95;--border-btn:1px;--tab-border:1px;--tab-radius:0.5rem;--p:211.79 100% 50.784%;--s:246.92 47.273% 43.137%;--a:310.41 49.388% 51.961%;--n:217.02 92.157% 10%;--b1:0 0% 100%;--b2:216.92 100% 97.451%;--b3:218.82 43.59% 92.353%;--bc:214.29 30.061% 31.961%;--in:191.54 92.857% 78.039%;--su:181.5 46.512% 66.275%;--wa:32.308 61.905% 83.529%;--er:0 63.38% 72.157%;color-scheme:light}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.avatar.placeholder>div{display:flex}.avatar.placeholder>div,.btn{align-items:center;justify-content:center}.btn{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;animation:button-pop var(--animation-btn,.25s) ease-out;background-color:hsl(var(--n)/var(--tw-bg-opacity));border-color:transparent;border-color:hsl(var(--n)/var(--tw-border-opacity));border-radius:var(--rounded-btn,.5rem);border-width:var(--border-btn,1px);color:hsl(var(--nc)/var(--tw-text-opacity));cursor:pointer;display:inline-flex;flex-shrink:0;flex-wrap:wrap;font-size:.875rem;font-weight:600;height:3rem;line-height:1.25rem;line-height:1em;min-height:3rem;padding-left:1rem;padding-right:1rem;text-align:center;text-decoration-line:none;text-transform:uppercase;text-transform:var(--btn-text-case,uppercase);transition-duration:.2s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-user-select:none;-moz-user-select:none;user-select:none}.btn-disabled,.btn[disabled]{pointer-events:none}.btn-circle{border-radius:9999px;height:3rem;padding:0;width:3rem}.btn.loading,.btn.loading:hover{pointer-events:none}.btn.loading:before{animation:spin 2s linear infinite;border-color:transparent currentColor currentColor transparent;border-radius:9999px;border-width:2px;content:"";height:1rem;margin-right:.5rem;width:1rem}@media (prefers-reduced-motion:reduce){.btn.loading:before{animation:spin 10s linear infinite}}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.btn-group>input[type=radio].btn{-webkit-appearance:none;-moz-appearance:none;appearance:none}.btn-group>input[type=radio].btn:before{content:attr(data-title)}.carousel{-ms-overflow-style:none;display:flex;overflow-x:scroll;scroll-behavior:smooth;scroll-snap-type:x mandatory;scrollbar-width:none}.checkbox{--chkbg:var(--bc);--chkfg:var(--b1);--tw-border-opacity:0.2;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-color:hsl(var(--bc)/var(--tw-border-opacity));border-radius:var(--rounded-btn,.5rem);border-width:1px;cursor:pointer;flex-shrink:0;height:1.5rem;width:1.5rem}.dropdown{display:inline-block;position:relative}.dropdown>:focus{outline:2px solid transparent;outline-offset:2px}.dropdown .dropdown-content{--tw-scale-x:.95;--tw-scale-y:.95;opacity:0;position:absolute;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transform-origin:top;transition-duration:.2s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);visibility:hidden;z-index:50}.dropdown.dropdown-hover:hover .dropdown-content,.dropdown.dropdown-open .dropdown-content,.dropdown:not(.dropdown-hover):focus .dropdown-content,.dropdown:not(.dropdown-hover):focus-within .dropdown-content{opacity:1;visibility:visible}.footer{-moz-column-gap:1rem;column-gap:1rem;font-size:.875rem;grid-auto-flow:row;line-height:1.25rem;row-gap:2.5rem;width:100%}.footer,.footer>*{display:grid;place-items:start}.footer>*{gap:.5rem}@media (min-width:48rem){.footer{grid-auto-flow:column}.footer-center{grid-auto-flow:row dense}}.label{align-items:center;display:flex;justify-content:space-between;padding:.5rem .25rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}.input{--tw-border-opacity:0;--tw-bg-opacity:1;background-color:hsl(var(--b1)/var(--tw-bg-opacity));border-color:hsl(var(--bc)/var(--tw-border-opacity));border-radius:var(--rounded-btn,.5rem);border-width:1px;flex-shrink:1;font-size:1rem;height:3rem;line-height:2;line-height:1.5rem;padding-left:1rem;padding-right:1rem}.input-group>.input{isolation:isolate}.input-group>*,.input-group>.input,.input-group>.select,.input-group>.textarea{border-radius:0}.link{cursor:pointer;text-decoration-line:underline}.menu{display:flex;flex-direction:column;flex-wrap:wrap}.menu.horizontal{display:inline-flex;flex-direction:row}.menu.horizontal :where(li){flex-direction:row}:where(.menu li){align-items:stretch;display:flex;flex-direction:column;flex-shrink:0;flex-wrap:wrap;position:relative}.menu :where(li:not(.menu-title))>:where(:not(ul)){display:flex}.menu :where(li:not(.disabled):not(.menu-title))>:where(:not(ul)){align-items:center;cursor:pointer;outline:2px solid transparent;outline-offset:2px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.menu>:where(li>:not(ul):focus){outline:2px solid transparent;outline-offset:2px}.menu>:where(li.disabled>:not(ul):focus){cursor:auto}.menu>:where(li) :where(ul){align-items:stretch;display:flex;flex-direction:column}.menu>:where(li)>:where(ul){border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;border-top-left-radius:inherit;border-top-right-radius:inherit;display:none;left:100%;position:absolute;top:auto}.menu>:where(li:hover)>:where(ul){display:flex}.menu>:where(li:focus)>:where(ul){display:flex}.modal{--tw-bg-opacity:0.4;background-color:hsl(var(--nf,var(--n))/var(--tw-bg-opacity));bottom:0;display:flex;justify-content:center;left:0;opacity:0;overflow-y:hidden;overscroll-behavior:contain;pointer-events:none;position:fixed;right:0;top:0;transition-duration:.2s;transition-property:transform,opacity,visibility;transition-timing-function:cubic-bezier(.4,0,.2,1);visibility:hidden;z-index:999}:where(.modal){align-items:center}.modal-box{--tw-bg-opacity:1;--tw-scale-x:.9;--tw-scale-y:.9;background-color:hsl(var(--b1)/var(--tw-bg-opacity));border-bottom-left-radius:var(--rounded-box,1rem);border-bottom-right-radius:var(--rounded-box,1rem);border-top-left-radius:var(--rounded-box,1rem);border-top-right-radius:var(--rounded-box,1rem);box-shadow:0 25px 50px -12px rgba(0,0,0,.25);max-height:calc(100vh - 5em);max-width:32rem;overflow-y:auto;overscroll-behavior:contain;padding:1.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transition-duration:.2s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);width:91.666667%}.modal-open,.modal-toggle:checked+.modal,.modal:target{opacity:1;pointer-events:auto;visibility:visible}.modal-toggle{-webkit-appearance:none;-moz-appearance:none;appearance:none;height:0;opacity:0;position:fixed;width:0}.rating{display:inline-flex;position:relative}.rating :where(input){--tw-bg-opacity:1;animation:rating-pop var(--animation-input,.25s) ease-out;background-color:hsl(var(--bc)/var(--tw-bg-opacity));border-radius:0;cursor:pointer;height:1.5rem;width:1.5rem}.select{--tw-border-opacity:0;--tw-bg-opacity:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:hsl(var(--b1)/var(--tw-bg-opacity));background-image:linear-gradient(45deg,transparent 50%,currentColor 0),linear-gradient(135deg,currentColor 50%,transparent 0);background-position:calc(100% - 20px) calc(1px + 50%),calc(100% - 16px) calc(1px + 50%);background-repeat:no-repeat;background-size:4px 4px,4px 4px;border-color:hsl(var(--bc)/var(--tw-border-opacity));border-radius:var(--rounded-btn,.5rem);border-width:1px;cursor:pointer;display:inline-flex;flex-shrink:0;font-size:.875rem;font-weight:600;height:3rem;line-height:1.25rem;line-height:2;min-height:3rem;padding-left:1rem;padding-right:2.5rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}.select[multiple]{height:auto}.textarea{--tw-border-opacity:0;--tw-bg-opacity:1;background-color:hsl(var(--b1)/var(--tw-bg-opacity));border-color:hsl(var(--bc)/var(--tw-border-opacity));border-radius:var(--rounded-btn,.5rem);border-width:1px;flex-shrink:1;font-size:.875rem;line-height:1.25rem;line-height:2;min-height:3rem;padding:.5rem 1rem}.btm-nav>* .label{font-size:1rem;line-height:1.5rem}.btn:active:focus,.btn:active:hover{animation:none;transform:scale(var(--btn-focus-scale,.95))}.btn-active,.btn:hover{--tw-border-opacity:1;--tw-bg-opacity:1;background-color:hsl(var(--nf,var(--n))/var(--tw-bg-opacity));border-color:hsl(var(--nf,var(--n))/var(--tw-border-opacity))}.btn:focus-visible{outline:2px solid hsl(var(--nf));outline-offset:2px}.btn.glass.btn-active,.btn.glass:hover{--glass-opacity:25%;--glass-border-opacity:15%}.btn.glass:focus-visible{outline:2px solid currentColor}.btn-disabled,.btn-disabled:hover,.btn[disabled],.btn[disabled]:hover{--tw-border-opacity:0;--tw-bg-opacity:0.2;--tw-text-opacity:0.2;background-color:hsl(var(--n)/var(--tw-bg-opacity));color:hsl(var(--bc)/var(--tw-text-opacity))}.btn.loading.btn-circle:before,.btn.loading.btn-square:before{margin-right:0}.btn.loading.btn-lg:before,.btn.loading.btn-xl:before{height:1.25rem;width:1.25rem}.btn.loading.btn-sm:before,.btn.loading.btn-xs:before{height:.75rem;width:.75rem}.btn-group>.btn-active,.btn-group>input[type=radio]:checked.btn{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:hsl(var(--p)/var(--tw-bg-opacity));border-color:hsl(var(--p)/var(--tw-border-opacity));color:hsl(var(--pc)/var(--tw-text-opacity))}.btn-group>.btn-active:focus-visible,.btn-group>input[type=radio]:checked.btn:focus-visible{outline:2px solid hsl(var(--p))}@keyframes button-pop{0%{transform:scale(var(--btn-focus-scale,.95))}40%{transform:scale(1.02)}to{transform:scale(1)}}.carousel::-webkit-scrollbar{display:none}.checkbox:focus-visible{outline:2px solid hsl(var(--bc));outline-offset:2px}.checkbox:checked,.checkbox[aria-checked=true],.checkbox[checked=true]{--tw-bg-opacity:1;animation:checkmark var(--animation-input,.2s) ease-in-out;background-color:hsl(var(--bc)/var(--tw-bg-opacity));background-image:linear-gradient(-45deg,transparent 65%,hsl(var(--chkbg)) 65.99%),linear-gradient(45deg,transparent 75%,hsl(var(--chkbg)) 75.99%),linear-gradient(-45deg,hsl(var(--chkbg)) 40%,transparent 40.99%),linear-gradient(45deg,hsl(var(--chkbg)) 30%,hsl(var(--chkfg)) 30.99%,hsl(var(--chkfg)) 40%,transparent 40.99%),linear-gradient(-45deg,hsl(var(--chkfg)) 50%,hsl(var(--chkbg)) 50.99%);background-repeat:no-repeat}.checkbox:indeterminate{--tw-bg-opacity:1;animation:checkmark var(--animation-input,.2s) ease-in-out;background-color:hsl(var(--bc)/var(--tw-bg-opacity));background-image:linear-gradient(90deg,transparent 80%,hsl(var(--chkbg)) 80%),linear-gradient(-90deg,transparent 80%,hsl(var(--chkbg)) 80%),linear-gradient(0deg,hsl(var(--chkbg)) 43%,hsl(var(--chkfg)) 43%,hsl(var(--chkfg)) 57%,hsl(var(--chkbg)) 57%);background-repeat:no-repeat}.checkbox:disabled{--tw-bg-opacity:1;background-color:hsl(var(--bc)/var(--tw-bg-opacity));border-color:transparent;cursor:not-allowed;opacity:.2}@keyframes checkmark{0%{background-position-y:5px}50%{background-position-y:-2px}to{background-position-y:0}}[dir=rtl] .checkbox:checked,[dir=rtl] .checkbox[aria-checked=true],[dir=rtl] .checkbox[checked=true]{background-image:linear-gradient(45deg,transparent 65%,hsl(var(--chkbg)) 65.99%),linear-gradient(-45deg,transparent 75%,hsl(var(--chkbg)) 75.99%),linear-gradient(45deg,hsl(var(--chkbg)) 40%,transparent 40.99%),linear-gradient(-45deg,hsl(var(--chkbg)) 30%,hsl(var(--chkfg)) 30.99%,hsl(var(--chkfg)) 40%,transparent 40.99%),linear-gradient(45deg,hsl(var(--chkfg)) 50%,hsl(var(--chkbg)) 50.99%)}.dropdown.dropdown-hover:hover .dropdown-content,.dropdown.dropdown-open .dropdown-content,.dropdown:focus .dropdown-content,.dropdown:focus-within .dropdown-content{--tw-scale-x:1;--tw-scale-y:1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.label a:hover{--tw-text-opacity:1;color:hsl(var(--bc)/var(--tw-text-opacity))}.input[list]::-webkit-calendar-picker-indicator{line-height:1em}.input:focus{outline:2px solid hsla(var(--bc)/.2);outline-offset:2px}.input-disabled,.input[disabled]{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:0.2;background-color:hsl(var(--b2,var(--b1))/var(--tw-bg-opacity));border-color:hsl(var(--b2,var(--b1))/var(--tw-border-opacity));cursor:not-allowed}.input-disabled::-moz-placeholder,.input[disabled]::-moz-placeholder{--tw-placeholder-opacity:0.2;color:hsl(var(--bc)/var(--tw-placeholder-opacity))}.input-disabled::placeholder,.input[disabled]::placeholder{--tw-placeholder-opacity:0.2;color:hsl(var(--bc)/var(--tw-placeholder-opacity))}.link:focus{outline:2px solid transparent;outline-offset:2px}.link:focus-visible{outline:2px solid currentColor;outline-offset:2px}.menu.horizontal>li.bordered>a,.menu.horizontal>li.bordered>button,.menu.horizontal>li.bordered>span{--tw-border-opacity:1;border-bottom-width:4px;border-color:hsl(var(--p)/var(--tw-border-opacity));border-left-width:0}.menu[class*=" p-"]:not(.menu[class*=" p-0"]) li>*,.menu[class*=" px-"]:not(.menu[class*=" px-0"]) li>*,.menu[class^=p-]:not(.menu[class^=p-0]) li>*,.menu[class^=px-]:not(.menu[class^=px-0]) li>*{border-radius:var(--rounded-btn,.5rem)}.menu :where(li.bordered>*){--tw-border-opacity:1;border-color:hsl(var(--p)/var(--tw-border-opacity));border-left-width:4px}.menu :where(li)>:where(:not(ul)){color:currentColor;gap:.75rem;padding:.75rem 1rem}.menu :where(li:not(.menu-title):not(:empty))>:where(:not(ul):focus),.menu :where(li:not(.menu-title):not(:empty))>:where(:not(ul):hover){--tw-bg-opacity:0.1;background-color:hsl(var(--bc)/var(--tw-bg-opacity))}.menu :where(li:not(.menu-title):not(:empty))>:where(:not(ul).active),.menu :where(li:not(.menu-title):not(:empty))>:where(:not(ul):active){--tw-bg-opacity:1;--tw-text-opacity:1;background-color:hsl(var(--p)/var(--tw-bg-opacity));color:hsl(var(--pc)/var(--tw-text-opacity))}.menu :where(li:empty){--tw-bg-opacity:0.1;background-color:hsl(var(--bc)/var(--tw-bg-opacity));height:1px;margin:.5rem 1rem}.menu li.disabled>*{--tw-text-opacity:0.2;color:hsl(var(--bc)/var(--tw-text-opacity));-webkit-user-select:none;-moz-user-select:none;user-select:none}.menu li.disabled>:hover{background-color:transparent}.menu li.hover-bordered a{border-color:transparent;border-left-width:4px}.menu li.hover-bordered a:hover{--tw-border-opacity:1;border-color:hsl(var(--p)/var(--tw-border-opacity))}.menu.compact li>a,.menu.compact li>span{font-size:.875rem;line-height:1.25rem;padding-bottom:.5rem;padding-top:.5rem}.menu .menu-title{font-size:.75rem;font-weight:700;line-height:1rem;opacity:.4}.menu .menu-title>*{padding-bottom:.25rem;padding-top:.25rem}.menu :where(li:not(.disabled))>:where(:not(ul)){outline:2px solid transparent;outline-offset:2px;transition-duration:.2s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.menu>:where(li:first-child){border-bottom-left-radius:unset;border-bottom-right-radius:unset;border-top-left-radius:inherit;border-top-right-radius:inherit}.menu>:where(li:first-child)>:where(:not(ul)){border-bottom-left-radius:unset;border-bottom-right-radius:unset;border-top-left-radius:inherit;border-top-right-radius:inherit}.menu>:where(li:last-child){border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;border-top-left-radius:unset;border-top-right-radius:unset}.menu>:where(li:last-child)>:where(:not(ul)){border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;border-top-left-radius:unset;border-top-right-radius:unset}.menu>:where(li)>:where(ul) :where(li){white-space:nowrap;width:100%}.menu>:where(li)>:where(ul) :where(li) :where(ul){padding-left:1rem}.menu>:where(li)>:where(ul) :where(li)>:where(:not(ul)){white-space:nowrap;width:100%}.menu>:where(li)>:where(ul)>:where(li:first-child){border-bottom-left-radius:unset;border-bottom-right-radius:unset;border-top-left-radius:inherit;border-top-right-radius:inherit}.menu>:where(li)>:where(ul)>:where(li:first-child)>:where(:not(ul)){border-bottom-left-radius:unset;border-bottom-right-radius:unset;border-top-left-radius:inherit;border-top-right-radius:inherit}.menu>:where(li)>:where(ul)>:where(li:last-child){border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;border-top-left-radius:unset;border-top-right-radius:unset}.menu>:where(li)>:where(ul)>:where(li:last-child)>:where(:not(ul)){border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;border-top-left-radius:unset;border-top-right-radius:unset}.mockup-phone .display{border-radius:40px;margin-top:-25px;overflow:hidden}.modal-open .modal-box,.modal-toggle:checked+.modal .modal-box,.modal:target .modal-box{--tw-translate-y:0px;--tw-scale-x:1;--tw-scale-y:1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes progress-loading{50%{left:107%}}@keyframes radiomark{0%{box-shadow:0 0 0 12px hsl(var(--b1)) inset,0 0 0 12px hsl(var(--b1)) inset}50%{box-shadow:0 0 0 3px hsl(var(--b1)) inset,0 0 0 3px hsl(var(--b1)) inset}to{box-shadow:0 0 0 4px hsl(var(--b1)) inset,0 0 0 4px hsl(var(--b1)) inset}}.rating input{-moz-appearance:none;appearance:none;-webkit-appearance:none}.rating .rating-hidden{background-color:transparent;width:.5rem}.rating input:checked~input,.rating input[aria-checked=true]~input{--tw-bg-opacity:0.2}.rating input:focus-visible{transform:translateY(-.125em);transition-duration:.3s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rating input:active:focus{animation:none;transform:translateY(-.125em)}@keyframes rating-pop{0%{transform:translateY(-.125em)}40%{transform:translateY(-.125em)}to{transform:translateY(0)}}.select:focus{outline:2px solid hsla(var(--bc)/.2);outline-offset:2px}.select-disabled,.select[disabled]{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:0.2;background-color:hsl(var(--b2,var(--b1))/var(--tw-bg-opacity));border-color:hsl(var(--b2,var(--b1))/var(--tw-border-opacity));cursor:not-allowed}.select-disabled::-moz-placeholder,.select[disabled]::-moz-placeholder{--tw-placeholder-opacity:0.2;color:hsl(var(--bc)/var(--tw-placeholder-opacity))}.select-disabled::placeholder,.select[disabled]::placeholder{--tw-placeholder-opacity:0.2;color:hsl(var(--bc)/var(--tw-placeholder-opacity))}.select-multiple,.select[multiple],.select[size].select:not([size="1"]){background-image:none;padding-right:1rem}[dir=rtl] .select{background-position:12px calc(1px + 50%),16px calc(1px + 50%)}.textarea:focus{outline:2px solid hsla(var(--bc)/.2);outline-offset:2px}.textarea-disabled,.textarea[disabled]{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:0.2;background-color:hsl(var(--b2,var(--b1))/var(--tw-bg-opacity));border-color:hsl(var(--b2,var(--b1))/var(--tw-border-opacity));cursor:not-allowed}.textarea-disabled::-moz-placeholder,.textarea[disabled]::-moz-placeholder{--tw-placeholder-opacity:0.2;color:hsl(var(--bc)/var(--tw-placeholder-opacity))}.textarea-disabled::placeholder,.textarea[disabled]::placeholder{--tw-placeholder-opacity:0.2;color:hsl(var(--bc)/var(--tw-placeholder-opacity))}@keyframes toast-pop{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}.btn-sm{font-size:.875rem;height:2rem;min-height:2rem;padding-left:.75rem;padding-right:.75rem}.btn-square:where(.btn-sm){height:2rem;padding:0;width:2rem}.btn-circle:where(.btn-xs){border-radius:9999px;height:1.5rem;padding:0;width:1.5rem}.btn-circle:where(.btn-sm){border-radius:9999px;height:2rem;padding:0;width:2rem}.btn-circle:where(.btn-md){border-radius:9999px;height:3rem;padding:0;width:3rem}.btn-circle:where(.btn-lg){border-radius:9999px;height:4rem;padding:0;width:4rem}.btn-group .btn:not(:first-child):not(:last-child){border-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-radius:0;border-top-right-radius:0}.btn-group .btn:first-child:not(:last-child){border-bottom-left-radius:var(--rounded-btn,.5rem);border-bottom-right-radius:0;border-top-left-radius:var(--rounded-btn,.5rem);border-top-right-radius:0;margin-left:-1px;margin-top:0}.btn-group .btn:last-child:not(:first-child){border-bottom-left-radius:0;border-bottom-right-radius:var(--rounded-btn,.5rem);border-top-left-radius:0;border-top-right-radius:var(--rounded-btn,.5rem)}.btn-group-horizontal .btn:not(:first-child):not(:last-child){border-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-radius:0;border-top-right-radius:0}.btn-group-horizontal .btn:first-child:not(:last-child){border-bottom-left-radius:var(--rounded-btn,.5rem);border-bottom-right-radius:0;border-top-left-radius:var(--rounded-btn,.5rem);border-top-right-radius:0;margin-left:-1px;margin-top:0}.btn-group-horizontal .btn:last-child:not(:first-child){border-bottom-left-radius:0;border-bottom-right-radius:var(--rounded-btn,.5rem);border-top-left-radius:0;border-top-right-radius:var(--rounded-btn,.5rem)}.btn-group-vertical .btn:first-child:not(:last-child){border-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--rounded-btn,.5rem);border-top-right-radius:var(--rounded-btn,.5rem);margin-left:0;margin-top:-1px}.btn-group-vertical .btn:last-child:not(:first-child){border-bottom-left-radius:var(--rounded-btn,.5rem);border-bottom-right-radius:var(--rounded-btn,.5rem);border-top-left-radius:0;border-top-right-radius:0}.modal-bottom :where(.modal-box){--tw-translate-y:2.5rem;--tw-scale-x:1;--tw-scale-y:1;border-bottom-left-radius:0;border-bottom-right-radius:0;max-width:none;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));width:100%}.modal-middle :where(.modal-box){--tw-translate-y:0px;--tw-scale-x:.9;--tw-scale-y:.9;border-bottom-left-radius:var(--rounded-box,1rem);border-bottom-right-radius:var(--rounded-box,1rem);max-width:32rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));width:91.666667%}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pointer-events-none{pointer-events:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.-left-\[34\%\]{left:-34%}.bottom-0{bottom:0}.bottom-12{bottom:3rem}.left-0{left:0}.left-1\/3{left:33.333333%}.right-0{right:0}.right-0\.5{right:.125rem}.right-2{right:.5rem}.top-0{top:0}.top-0\.5{top:.125rem}.top-1\/3{top:33.333333%}.top-1\/4{top:25%}.top-2{top:.5rem}.top-\[7\%\]{top:7%}.z-0{z-index:0}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-bottom:.25rem;margin-top:.25rem}.my-2{margin-bottom:.5rem;margin-top:.5rem}.my-3{margin-bottom:.75rem;margin-top:.75rem}.-ml-px{margin-left:-1px}.mb-0{margin-bottom:0}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-5{margin-bottom:1.25rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-3{margin-left:.75rem}.ml-auto{margin-left:auto}.mr-0{margin-right:0}.mr-1{margin-right:.25rem}.mr-6{margin-right:1.5rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-10{margin-top:2.5rem}.mt-2{margin-top:.5rem}.mt-2\.5{margin-top:.625rem}.mt-3{margin-top:.75rem}.mt-6{margin-top:1.5rem}.mt-\[3px\]{margin-top:3px}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-16{height:4rem}.h-20{height:5rem}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-\[56px\]{height:56px}.h-\[fit-content\]{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.w-16{width:4rem}.w-2\/5{width:40%}.w-3{width:.75rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-\[120px\]{width:120px}.w-\[80vw\]{width:80vw}.w-auto{width:auto}.w-full{width:100%}.max-w-md{max-width:28rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-none{flex:none}.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.-rotate-45{--tw-rotate:-45deg}.-rotate-45,.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.content-center{align-content:center}.content-between{align-content:space-between}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse:0;border-left-width:calc(1px*(1 - var(--tw-divide-x-reverse)));border-right-width:calc(1px*var(--tw-divide-x-reverse))}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;white-space:nowrap}.overflow-ellipsis,.truncate{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-b{border-bottom-left-radius:.25rem;border-bottom-right-radius:.25rem}.rounded-l-lg{border-bottom-left-radius:.5rem;border-top-left-radius:.5rem}.rounded-l-md{border-bottom-left-radius:.375rem;border-top-left-radius:.375rem}.rounded-r-md{border-bottom-right-radius:.375rem;border-top-right-radius:.375rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.rounded-bl-none{border-bottom-left-radius:0}.rounded-br-none{border-bottom-right-radius:0}.rounded-tl-none{border-top-left-radius:0}.rounded-tr-none{border-top-right-radius:0}.border,.border-\[1px\]{border-width:1px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-\[\#2b2821\]{--tw-border-opacity:1;border-color:rgb(43 40 33/var(--tw-border-opacity))}.border-\[\#333\]{--tw-border-opacity:1;border-color:rgb(51 51 51/var(--tw-border-opacity))}.border-black{--tw-border-opacity:1;border-color:rgb(0 0 0/var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.border-gray-600{--tw-border-opacity:1;border-color:rgb(75 85 99/var(--tw-border-opacity))}.bg-\[\#111\]{--tw-bg-opacity:1;background-color:rgb(17 17 17/var(--tw-bg-opacity))}.bg-\[\#1511116d\]{background-color:#1511116d}.bg-\[\#151111\]{--tw-bg-opacity:1;background-color:rgb(21 17 17/var(--tw-bg-opacity))}.bg-\[\#1a1a1a\]{--tw-bg-opacity:1;background-color:rgb(26 26 26/var(--tw-bg-opacity))}.bg-\[\#212020\]{--tw-bg-opacity:1;background-color:rgb(33 32 32/var(--tw-bg-opacity))}.bg-\[\#272727\]{--tw-bg-opacity:1;background-color:rgb(39 39 39/var(--tw-bg-opacity))}.bg-\[red\]{--tw-bg-opacity:1;background-color:rgb(255 0 0/var(--tw-bg-opacity))}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}.bg-black\/60{background-color:rgba(0,0,0,.6)}.bg-red-600{--tw-bg-opacity:1;background-color:rgb(220 38 38/var(--tw-bg-opacity))}.bg-sky-500{--tw-bg-opacity:1;background-color:rgb(14 165 233/var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity:0.5}.bg-gradient-to-l{background-image:linear-gradient(to left,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-\[\#151111\]{--tw-gradient-from:#151111 var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(21,17,17,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-cyan-500\/50{--tw-gradient-from:rgba(6,182,212,.5) var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(6,182,212,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-indigo-500{--tw-gradient-from:#6366f1 var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(99,102,241,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-pink-500{--tw-gradient-from:#ec4899 var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(236,72,153,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-red-500{--tw-gradient-from:#ef4444 var(--tw-gradient-from-position);--tw-gradient-from-position: ;--tw-gradient-to:rgba(239,68,68,0) var(--tw-gradient-from-position);--tw-gradient-to-position: ;--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.to-blue-500\/50{--tw-gradient-to:rgba(59,130,246,.5) var(--tw-gradient-to-position);--tw-gradient-to-position: }.to-red-600{--tw-gradient-to:#dc2626 var(--tw-gradient-to-position);--tw-gradient-to-position: }.to-yellow-500{--tw-gradient-to:#eab308 var(--tw-gradient-to-position);--tw-gradient-to-position: }.fill-current{fill:currentColor}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.px-0{padding-left:0;padding-right:0}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-8{padding-left:2rem;padding-right:2rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-2\.5{padding-bottom:.625rem;padding-top:.625rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-8{padding-bottom:2rem;padding-top:2rem}.py-\[2px\]{padding-bottom:2px;padding-top:2px}.py-\[4px\]{padding-bottom:4px;padding-top:4px}.pb-2{padding-bottom:.5rem}.pl-0{padding-left:0}.pl-10{padding-left:2.5rem}.pr-0{padding-right:0}.pr-2{padding-right:.5rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-14{padding-top:3.5rem}.pt-16{padding-top:4rem}.text-left{text-align:left}.text-center{text-align:center}.align-middle{vertical-align:middle}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.text-\[12px\]{font-size:12px}.text-\[9px\]{font-size:9px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-5{line-height:1.25rem}.leading-normal{line-height:1.5}.leading-relaxed{line-height:1.625}.tracking-normal{letter-spacing:0}.text-\[\#44e2ff\]{--tw-text-opacity:1;color:rgb(68 226 255/var(--tw-text-opacity))}.text-\[\#FDB813\]{--tw-text-opacity:1;color:rgb(253 184 19/var(--tw-text-opacity))}.text-\[\#bbb\]{--tw-text-opacity:1;color:rgb(187 187 187/var(--tw-text-opacity))}.text-\[\#ccc\]{--tw-text-opacity:1;color:rgb(204 204 204/var(--tw-text-opacity))}.text-\[\#dacb46\]{--tw-text-opacity:1;color:rgb(218 203 70/var(--tw-text-opacity))}.text-\[\#ddd\]{--tw-text-opacity:1;color:rgb(221 221 221/var(--tw-text-opacity))}.text-gray-100{--tw-text-opacity:1;color:rgb(243 244 246/var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.text-gray-50{--tw-text-opacity:1;color:rgb(249 250 251/var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity))}.text-slate-200{--tw-text-opacity:1;color:rgb(226 232 240/var(--tw-text-opacity))}.text-slate-300{--tw-text-opacity:1;color:rgb(203 213 225/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity))}.text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity))}.no-underline{text-decoration-line:none}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-md{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-150,.transition-all{transition-duration:.15s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.hover\:cursor-pointer:hover{cursor:pointer}.hover\:bg-red-600:hover{--tw-bg-opacity:1;background-color:rgb(220 38 38/var(--tw-bg-opacity))}.hover\:bg-red-600\/80:hover{background-color:rgba(220,38,38,.8)}.hover\:bg-slate-800:hover{--tw-bg-opacity:1;background-color:rgb(30 41 59/var(--tw-bg-opacity))}.hover\:bg-opacity-80:hover{--tw-bg-opacity:0.8}.hover\:text-white:hover{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.hover\:text-yellow-300:hover{--tw-text-opacity:1;color:rgb(253 224 71/var(--tw-text-opacity))}.hover\:text-yellow-400:hover{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity))}.hover\:no-underline:hover{text-decoration-line:none}.focus\:z-10:focus{z-index:10}.focus\:border-blue-500:focus{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity))}.focus\:border-gray-600:focus{--tw-border-opacity:1;border-color:rgb(75 85 99/var(--tw-border-opacity))}.focus\:bg-\[\#2b2821\]:focus{--tw-bg-opacity:1;background-color:rgb(43 40 33/var(--tw-bg-opacity))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-4:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:ring-blue-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity))}.focus\:ring-gray-200:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(229 231 235/var(--tw-ring-opacity))}.focus\:ring-gray-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(107 114 128/var(--tw-ring-opacity))}.active\:bg-gray-100:active{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.active\:text-gray-500:active{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.active\:text-white:active{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.group:hover .group-hover\:block{display:block}.group:hover .group-hover\:scale-110{--tw-scale-x:1.1;--tw-scale-y:1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:bg-opacity-60{--tw-bg-opacity:0.6}.group:hover .group-hover\:opacity-60{opacity:.6}@media (min-width:640px){.sm\:mt-0{margin-top:0}.sm\:w-1\/2{width:50%}.sm\:pr-3{padding-right:.75rem}}@media (min-width:768px){.md\:inset-0{inset:0}.md\:my-0{margin-bottom:0;margin-top:0}.md\:mr-4{margin-right:1rem}.md\:mt-0{margin-top:0}.md\:mt-4{margin-top:1rem}.md\:inline{display:inline}.md\:flex{display:flex}.md\:hidden{display:none}.md\:h-\[96px\]{height:96px}.md\:h-auto{height:auto}.md\:h-full{height:100%}.md\:w-1\/5{width:20%}.md\:w-\[145px\]{width:145px}.md\:w-\[15em\]{width:15em}.md\:w-\[50vw\]{width:50vw}.md\:w-\[fit-content\]{width:-moz-fit-content;width:fit-content}.md\:w-auto{width:auto}.md\:flex-1{flex:1 1 0%}.md\:grow{flex-grow:1}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:justify-between{justify-content:space-between}.md\:p-0{padding:0}.md\:p-2{padding:.5rem}.md\:px-8{padding-left:2rem;padding-right:2rem}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:hover\:text-blue-700:hover{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity))}}@media (min-width:1024px){.lg\:mt-0{margin-top:0}.lg\:flex{display:flex}.lg\:w-1\/4{width:25%}.lg\:w-3\/4{width:75%}.lg\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.lg\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.lg\:pl-3{padding-left:.75rem}}@media (min-width:1280px){.xl\:w-1\/4{width:25%}.xl\:w-3\/4{width:75%}.xl\:w-\[35vw\]{width:35vw}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:px-40{padding-left:10rem;padding-right:10rem}.xl\:text-xl{font-size:1.25rem;line-height:1.75rem}} diff --git a/resources/assets/js/plugins/jquery-raty/fonts/raty.eot b/resources/assets/js/plugins/jquery-raty/fonts/raty.eot new file mode 100755 index 0000000..2faa8e6 Binary files /dev/null and b/resources/assets/js/plugins/jquery-raty/fonts/raty.eot differ diff --git a/resources/assets/js/plugins/jquery-raty/fonts/raty.svg b/resources/assets/js/plugins/jquery-raty/fonts/raty.svg new file mode 100755 index 0000000..8bd28d0 --- /dev/null +++ b/resources/assets/js/plugins/jquery-raty/fonts/raty.svg @@ -0,0 +1,15 @@ + + + +Generated by IcoMoon + + + + + + + + + + + \ No newline at end of file diff --git a/resources/assets/js/plugins/jquery-raty/fonts/raty.ttf b/resources/assets/js/plugins/jquery-raty/fonts/raty.ttf new file mode 100755 index 0000000..fdb5061 Binary files /dev/null and b/resources/assets/js/plugins/jquery-raty/fonts/raty.ttf differ diff --git a/resources/assets/js/plugins/jquery-raty/fonts/raty.woff b/resources/assets/js/plugins/jquery-raty/fonts/raty.woff new file mode 100755 index 0000000..06d1106 Binary files /dev/null and b/resources/assets/js/plugins/jquery-raty/fonts/raty.woff differ diff --git a/resources/assets/js/plugins/jquery-raty/images/cancel-off.png b/resources/assets/js/plugins/jquery-raty/images/cancel-off.png new file mode 100755 index 0000000..4708dae Binary files /dev/null and b/resources/assets/js/plugins/jquery-raty/images/cancel-off.png differ diff --git a/resources/assets/js/plugins/jquery-raty/images/cancel-on.png b/resources/assets/js/plugins/jquery-raty/images/cancel-on.png new file mode 100755 index 0000000..a01f0a3 Binary files /dev/null and b/resources/assets/js/plugins/jquery-raty/images/cancel-on.png differ diff --git a/resources/assets/js/plugins/jquery-raty/images/star-half.png b/resources/assets/js/plugins/jquery-raty/images/star-half.png new file mode 100755 index 0000000..191bc88 Binary files /dev/null and b/resources/assets/js/plugins/jquery-raty/images/star-half.png differ diff --git a/resources/assets/js/plugins/jquery-raty/images/star-off.png b/resources/assets/js/plugins/jquery-raty/images/star-off.png new file mode 100755 index 0000000..7f8b1e1 Binary files /dev/null and b/resources/assets/js/plugins/jquery-raty/images/star-off.png differ diff --git a/resources/assets/js/plugins/jquery-raty/images/star-on.png b/resources/assets/js/plugins/jquery-raty/images/star-on.png new file mode 100755 index 0000000..9f7d095 Binary files /dev/null and b/resources/assets/js/plugins/jquery-raty/images/star-on.png differ diff --git a/resources/assets/js/plugins/jquery-raty/jquery.raty.css b/resources/assets/js/plugins/jquery-raty/jquery.raty.css new file mode 100755 index 0000000..2c81574 --- /dev/null +++ b/resources/assets/js/plugins/jquery-raty/jquery.raty.css @@ -0,0 +1,46 @@ +.cancel-on-png, .cancel-off-png, .star-on-png, .star-off-png, .star-half-png { + font-size: 2em; +} + +@font-face { + font-family: "raty"; + font-style: normal; + font-weight: normal; + src: url("./fonts/raty.eot"); + src: url("./fonts/raty.eot?#iefix") format("embedded-opentype"); + src: url("./fonts/raty.svg#raty") format("svg"); + src: url("./fonts/raty.ttf") format("truetype"); + src: url("./fonts/raty.woff") format("woff"); +} + +.cancel-on-png, .cancel-off-png, .star-on-png, .star-off-png, .star-half-png { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + font-family: "raty"; + font-style: normal; + font-variant: normal; + font-weight: normal; + line-height: 1; + speak: none; + text-transform: none; +} + +.cancel-on-png:before { + content: "\e600"; +} + +.cancel-off-png:before { + content: "\e601"; +} + +.star-on-png:before { + content: "\f005"; +} + +.star-off-png:before { + content: "\f006"; +} + +.star-half-png:before { + content: "\f123"; +} diff --git a/resources/assets/js/plugins/jquery-raty/jquery.raty.js b/resources/assets/js/plugins/jquery-raty/jquery.raty.js new file mode 100755 index 0000000..fa0cf06 --- /dev/null +++ b/resources/assets/js/plugins/jquery-raty/jquery.raty.js @@ -0,0 +1,777 @@ +/*! + * Raty - A Star Rating Plugin + * + * The MIT License + * + * author: Washington Botelho + * github: wbotelhos/raty + * version: 3.1.0 + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + define(['jquery'], factory); + } else if (typeof module === 'object' && module.exports) { + module.exports = factory(require('jquery')); + } else { + factory(root.jQuery); + } +}(this, function($) { + 'use strict'; + + $.raty = { + cancelButton: false, + cancelClass: 'raty-cancel', + cancelHint: 'Cancel this rating!', + cancelOff: 'cancel-off.png', + cancelOn: 'cancel-on.png', + cancelPlace: 'left', + click: undefined, + half: false, + halfShow: true, + hints: ['bad', 'poor', 'regular', 'good', 'gorgeous'], + iconRange: undefined, + iconRangeSame: false, + mouseout: undefined, + mouseover: undefined, + noRatedMsg: 'Not rated yet!', + number: 5, + numberMax: 20, + path: undefined, + precision: false, + readOnly: false, + round: { down: 0.25, full: 0.6, up: 0.76 }, + score: undefined, + scoreName: 'score', + single: false, + space: true, + starHalf: 'star-half.png', + starOff: 'star-off.png', + starOn: 'star-on.png', + starType: 'img', + target: undefined, + targetFormat: '{score}', + targetKeep: false, + targetScore: undefined, + targetText: '', + targetType: 'hint' + }; + + $.fn.raty = function(options) { + return this.each(function() { + var instance = new $.raty.Raty(this, options); + + return instance._create(); + }); + }; + + $.raty.Raty = (function() { + var Raty = function(element, options) { + this.element = element; + this.self = $(element); + this.opt = $.extend(true, {}, $.raty, options, this.self.data()); + }; + + Raty.prototype = { + _create: function() { + this._executeCallbacks(); + this._adjustNumber(); + this._adjustHints(); + + this.opt.score = this._adjustedScore(this.opt.score); + + if (this.opt.starType !== 'img') { + this._adjustStarName(); + } + + this._setPath(); + this._createStars(); + + if (this.opt.cancelButton) { + this._createCancel(); + } + + if (this.opt.precision) { + this._adjustPrecision(); + } + + this._createScore(); + + this._apply(this.opt.score); + this._setTitle(this.opt.score); + this._target(this.opt.score); + + if (this.opt.readOnly) { + this._lock(); + } else { + this.element.style.cursor = 'pointer'; + + this._binds(); + } + + this.self.data('raty', this); + }, + + // TODO: model spec + _adjustedScore: function(score) { + if (score || score === 0) { + return this._between(score, 0, this.opt.number); + } + }, + + _adjustHints: function() { + if (!this.opt.hints) { + this.opt.hints = []; + } + + if (!this.opt.halfShow && !this.opt.half) { + return; + } + + var steps = this.opt.precision ? 10 : 2; + + for (var i = 0; i < this.opt.number; i++) { + var group = this.opt.hints[i]; + + if (Object.prototype.toString.call(group) !== '[object Array]') { + group = [group]; + } + + this.opt.hints[i] = []; + + for (var j = 0; j < steps; j++) { + var hint = group[j]; + var last = group[group.length - 1]; + + if (last === undefined) { + last = null; + } + + this.opt.hints[i][j] = hint === undefined ? last : hint; + } + } + }, + + _adjustNumber: function() { + this.opt.number = this._between(this.opt.number, 1, this.opt.numberMax); + }, + + _adjustPrecision: function() { + this.opt.half = true; + }, + + _adjustStarName: function() { + var replaces = ['cancelOff', 'cancelOn', 'starHalf', 'starOff', 'starOn']; + + this.opt.path = ''; + + for (var i = 0; i < replaces.length; i++) { + this.opt[replaces[i]] = this.opt[replaces[i]].replace('.', '-'); + } + }, + + // TODO: model spec + _apply: function(score) { + this._fill(score); + + if (score) { + if (score > 0) { + this.scoreField.val(score); + } + + this._roundStars(score); + } + }, + + _attributesForIndex: function(i) { + var name = this._nameForIndex(i); + var attributes = { alt: i, src: this.opt.path + this.opt[name] }; + + if (this.opt.starType !== 'img') { + attributes = { 'data-alt': i, 'class': this.opt[name] }; + } + + attributes.title = this._getHint(i); + + return attributes; + }, + + _between: function(value, min, max) { + return Math.min(Math.max(parseFloat(value), min), max); + }, + + // TODO: model spec + _binds: function() { + if (this.cancelButton) { + this._bindOverCancel(); + this._bindClickCancel(); + this._bindOutCancel(); + } + + this._bindOver(); + this._bindClick(); + this._bindOut(); + }, + + // TODO: model spec + _bindClick: function() { + var that = this; + + this.stars.on('click.raty', function(evt) { + if (that.self.data('readonly')) { + return; + } + + var execute = true; + var score = (that.opt.half || that.opt.precision) ? that.self.data('score') : (this.alt || $(this).data('alt')); + + if (that.opt.half && !that.opt.precision) { + score = that._roundHalfScore(score); + } + + if (that.opt.click) { + execute = that.opt.click.call(that.element, +score, evt); + } + + if (execute || execute === undefined) { + that._apply(+score); + } + }); + }, + + // TODO: model spec + _bindClickCancel: function() { + this.cancelButton.on('click.raty', function(evt) { + this.scoreField.removeAttr('value'); + + if (this.opt.click) { + this.opt.click.call(this.element, null, evt); + } + }.bind(this)); + }, + + // TODO: model spec + _bindOut: function() { + this.self.on('mouseleave.raty', function(evt) { + var score = +this.scoreField.val() || undefined; + + this._apply(score); + this._target(score, evt); + this._resetTitle(); + + if (this.opt.mouseout) { + this.opt.mouseout.call(this.element, score, evt); + } + }.bind(this)); + }, + + // TODO: model spec + _bindOutCancel: function() { + var that = this; + + this.cancelButton.on('mouseleave.raty', function(evt) { + var icon = that.opt.cancelOff; + + if (that.opt.starType !== 'img') { + icon = that.opt.cancelClass + ' ' + icon; + } + + that._setIcon(this, icon); + + if (that.opt.mouseout) { + var score = +that.scoreField.val() || undefined; + + that.opt.mouseout.call(that.element, score, evt); + } + }); + }, + + // TODO: model spec + _bindOver: function() { + var that = this; + var action = that.opt.half ? 'mousemove.raty' : 'mouseover.raty'; + + this.stars.on(action, function(evt) { + var score = that._getScoreByPosition(evt, this); + + that._fill(score); + + if (that.opt.half) { + that._roundStars(score, evt); + that._setTitle(score, evt); + + that.self.data('score', score); + } + + that._target(score, evt); + + if (that.opt.mouseover) { + that.opt.mouseover.call(that.element, score, evt); + } + }); + }, + + // TODO: model spec + _bindOverCancel: function() { + var that = this; + + this.cancelButton.on('mouseover.raty', function(evt) { + if (that.self.data('readonly')) { + return; + } + + var starOff = that.opt.path + that.opt.starOff; + var icon = that.opt.cancelOn; + + if (that.opt.starType === 'img') { + that.stars.attr('src', starOff); + } else { + icon = that.opt.cancelClass + ' ' + icon; + + that.stars.attr('class', starOff); + } + + that._setIcon(this, icon); + that._target(null, evt); + + if (that.opt.mouseover) { + that.opt.mouseover.call(that.element, null); + } + }); + }, + + // TODO: model spec + _buildScoreField: function() { + return $('', { name: this.opt.scoreName, type: 'hidden' }).appendTo(this.self); + }, + + // TODO: model spec + _createCancel: function() { + var icon = this.opt.path + this.opt.cancelOff; + var button = $('<' + this.opt.starType + ' />', { title: this.opt.cancelHint, 'class': this.opt.cancelClass }); + + if (this.opt.starType === 'img') { + button.attr({ src: icon, alt: 'x' }); + } else { + // TODO: use $.data + button.attr('data-alt', 'x').addClass(icon); + } + + if (this.opt.cancelPlace === 'left') { + this.self.prepend(' ').prepend(button); + } else { + this.self.append(' ').append(button); + } + + this.cancelButton = button; + }, + + // TODO: model spec + _createScore: function() { + var score = $(this.opt.targetScore); + + this.scoreField = score.length ? score : this._buildScoreField(); + }, + + _createStars: function() { + for (var i = 1; i <= this.opt.number; i++) { + var attributes = this._attributesForIndex(i); + + $('<' + this.opt.starType + ' />', attributes).appendTo(this.element); + + if (this.opt.space && i < this.opt.number) { + this.self.append(' '); + } + } + + this.stars = this.self.children(this.opt.starType); + }, + + // TODO: model spec + _error: function(message) { + $(this).text(message); + + $.error(message); + }, + + _executeCallbacks: function() { + var options = ['number', 'readOnly', 'score', 'scoreName', 'target', 'path']; + + for (var i = 0; i < options.length; i++) { + if (typeof this.opt[options[i]] === 'function') { + var value = this.opt[options[i]].call(this.element); + + if (value) { + this.opt[options[i]] = value; + } else { + delete this.opt[options[i]]; + } + } + } + }, + + // TODO: model spec + _fill: function(score) { + var hash = 0; + + if (this.opt.iconRangeSame && this.opt.iconRange) { + while (hash < this.opt.iconRange.length && this.opt.iconRange[hash].range < score) { + hash++; + } + } + + for (var i = 1; i <= this.stars.length; i++) { + var icon; + var star = this.stars[i - 1]; + var turnOn = this._turnOn(i, score); + + if (this.opt.iconRange && this.opt.iconRange.length > hash) { + var irange = this.opt.iconRange[hash]; + + icon = this._getRangeIcon(irange, turnOn); + + if (i <= irange.range) { + this._setIcon(star, icon); + } + + if (i === irange.range) { + hash++; + } + } else { + icon = this.opt[turnOn ? 'starOn' : 'starOff']; + + this._setIcon(star, icon); + } + } + }, + + _getDecimal: function(number, fractions) { + var decimal = number.toString().split('.')[1]; + var result = 0; + + if (decimal) { + result = parseInt(decimal.slice(0, fractions), 10); + + if (decimal.slice(1, 5) === '9999') { + result++; + } + } + + return result; + }, + + // TODO: model spec + _getRangeIcon: function(irange, turnOn) { + return turnOn ? irange.on || this.opt.starOn : irange.off || this.opt.starOff; + }, + + // TODO: model spec + _getScoreByPosition: function(evt, icon) { + var score = parseInt(icon.alt || icon.getAttribute('data-alt'), 10); + + if (this.opt.half) { + var size = this._getWidth(); + var percent = parseFloat((evt.pageX - $(icon).offset().left) / size); + + score = score - 1 + percent; + } + + return score; + }, + + // TODO: model spec + _getHint: function(score, evt) { + if (score !== 0 && !score) { + return this.opt.noRatedMsg; + } + + var decimal = this._getDecimal(score, 1); + var integer = Math.ceil(score); + var group = this.opt.hints[(integer || 1) - 1]; + var hint = group; + var set = !evt || this.isMove; + + if (this.opt.precision) { + if (set) { + decimal = decimal === 0 ? 9 : decimal - 1; + } + + hint = group[decimal]; + } else if (this.opt.halfShow || this.opt.half) { + decimal = set && decimal === 0 ? 1 : decimal > 5 ? 1 : 0; + + hint = group[decimal]; + } + + return hint === '' ? '' : hint || score; + }, + + // TODO: model spec + _getWidth: function() { + var width = this.stars[0].width || parseFloat(this.stars.eq(0).css('font-size')); + + if (!width) { + this._error('Could not get the icon width!'); + } + + return width; + }, + + // TODO: model spec + _lock: function() { + var hint = this._getHint(this.scoreField.val()); + + this.element.style.cursor = ''; + this.element.title = hint; + + this.scoreField.prop('readonly', true); + this.stars.prop('title', hint); + + if (this.cancelButton) { + this.cancelButton.hide(); + } + + this.self.data('readonly', true); + }, + + _nameForIndex: function(i) { + return this.opt.score && this.opt.score >= i ? 'starOn' : 'starOff'; + }, + + // TODO: model spec + _resetTitle: function() { + for (var i = 0; i < this.opt.number; i++) { + this.stars[i].title = this._getHint(i + 1); + } + }, + + // TODO: model spec + _roundHalfScore: function(score) { + var integer = parseInt(score, 10); + var decimal = this._getDecimal(score, 1); + + if (decimal !== 0) { + decimal = decimal > 5 ? 1 : 0.5; + } + + return integer + decimal; + }, + + // TODO: model spec + _roundStars: function(score, evt) { + var name = this._starName(score, evt); + + if (name) { + var icon = this.opt[name]; + var star = this.stars[Math.ceil(score) - 1]; + + this._setIcon(star, icon); + } // Full down: [x.00 .. x.25] + }, + + // TODO: model spec + _setIcon: function(star, icon) { + star[this.opt.starType === 'img' ? 'src' : 'className'] = this.opt.path + icon; + }, + + _setPath: function() { + this.opt.path = this.opt.path || ''; + + if (this.opt.path && this.opt.path.slice(-1)[0] !== '/') { + this.opt.path += '/'; + } + }, + + // TODO: model spec + _setTarget: function(target, score) { + if (score) { + score = this.opt.targetFormat.toString().replace('{score}', score); + } + + if (target.is(':input')) { + target.val(score); + } else { + target.html(score); + } + }, + + // TODO: model spec + _setTitle: function(score, evt) { + if (score) { + var integer = parseInt(Math.ceil(score), 10); + var star = this.stars[integer - 1]; + + star.title = this._getHint(score, evt); + } + }, + + _starName: function(score, evt) { + var decimal = +(score % 1).toFixed(2); + + if (evt || this.isMove) { + return decimal > 0.5 ? 'starOn' : 'starHalf'; + } + + if (decimal <= this.opt.round.down) { // Down: [x.00 ... x.25] + return; + } + + if (this.opt.halfShow && decimal < this.opt.round.up) { // Half: [x.26 ... x.75] + return 'starHalf'; + } + + if (decimal < this.opt.round.full) { // Off: [x.26 .. x.6] + return 'starOff'; + } + + return 'starOn'; // Up: [x.26 ...] || [x.6 ...] + }, + + // TODO: model spec + _target: function(score, evt) { + if (this.opt.target) { + var target = $(this.opt.target); + + if (!target.length) { + this._error('Target selector invalid or missing!'); + } + + var mouseover = evt && evt.type === 'mouseover'; + + if (score === undefined) { + score = this.opt.targetText; + } else if (score === null) { + score = mouseover ? this.opt.cancelHint : this.opt.targetText; + } else { + if (this.opt.targetType === 'hint') { + score = this._getHint(score, evt); + } else if (this.opt.precision) { + score = parseFloat(score).toFixed(1); + } + + var mousemove = evt && evt.type === 'mousemove'; + + if (!mouseover && !mousemove && !this.opt.targetKeep) { + score = this.opt.targetText; + } + } + + this._setTarget(target, score); + } + }, + + // TODO: model spec + _turnOn: function(i, score) { + return this.opt.single ? (i === score) : (i <= score); + }, + + // TODO: model spec + _unlock: function() { + this.element.style.cursor = 'pointer'; + this.element.removeAttribute('title'); + + this.scoreField.removeAttr('readonly'); + + this.self.data('readonly', false); + + this._resetTitle(); + + if (this.cancelButton) { + this.cancelButton.css('display', ''); + } + }, + + // TODO: model spec + cancel: function(click) { + if (this.self.data('readonly') !== true) { + this[click ? 'click' : 'score'].call(this, null); + + this.scoreField.removeAttr('value'); + } + }, + + // TODO: model spec + click: function(score) { + if (this.self.data('readonly') !== true) { + score = this._adjustedScore(score); + + this._apply(score); + + if (this.opt.click) { + this.opt.click.call(this.element, score, $.Event('click')); + } + + this._target(score); + } + }, + + // TODO: model spec + getScore: function() { + var score = []; + var value ; + + value = this.scoreField.val(); + + score.push(value ? +value : undefined); + + return (score.length > 1) ? score : score[0]; + }, + + // TODO: model spec + move: function(score) { + var integer = parseInt(score, 10); + var decimal = this._getDecimal(score, 1); + + if (integer >= this.opt.number) { + integer = this.opt.number - 1; + decimal = 10; + } + + var width = this._getWidth(); + var steps = width / 10; + var star = $(this.stars[integer]); + var percent = star.offset().left + steps * decimal; + var evt = $.Event('mousemove', { pageX: percent }); + + this.isMove = true; + + star.trigger(evt); + + this.isMove = false; + }, + + // TODO: model spec + readOnly: function(readonly) { + if (this.self.data('readonly') !== readonly) { + if (readonly) { + this.self.off('.raty').children(this.opt.starType).off('.raty'); + + this._lock(); + } else { + this._binds(); + this._unlock(); + } + + this.self.data('readonly', readonly); + } + }, + + // TODO: model spec + score: function() { + return arguments.length ? this.setScore.apply(this, arguments) : this.getScore(); + }, + + setScore: function(score) { + if (this.self.data('readonly') !== true) { + score = this._adjustedScore(score); + + this._apply(score); + this._target(score); + } + } + }; + + return Raty; + })(); +})); diff --git a/resources/assets/player/1s_blank.mp4 b/resources/assets/player/1s_blank.mp4 new file mode 100644 index 0000000..d584a58 Binary files /dev/null and b/resources/assets/player/1s_blank.mp4 differ diff --git a/resources/assets/player/js/p2p-media-loader-core.min.js b/resources/assets/player/js/p2p-media-loader-core.min.js new file mode 100644 index 0000000..2a25b93 --- /dev/null +++ b/resources/assets/player/js/p2p-media-loader-core.min.js @@ -0,0 +1 @@ +require=function e(t,n,r){function i(o,a){if(!n[o]){if(!t[o]){var u="function"==typeof require&&require;if(!a&&u)return u(o,!0);if(s)return s(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var h=n[o]={exports:{}};t[o][0].call(h.exports,function(e){return i(t[o][1][e]||e)},h,h.exports,e,t,n,r)}return n[o].exports}for(var s="function"==typeof require&&require,o=0;or;)this.currentBytesSum-=this.lastBytes.shift().value;this.lastBandwidth.push(new s(this.currentBytesSum/r,t))}getBandwidth(e){for(;0!=this.lastBandwidth.length&&e-this.lastBandwidth[0].timeStamp>i;)this.lastBandwidth.shift();let t=0;for(const e of this.lastBandwidth)e.value>t&&(t=e.value);return t}getSmoothInterval(){return r}getMeasureInterval(){return i}}},{}],2:[function(e,t,n){window.p2pml||(window.p2pml={}),window.p2pml.core=e("./index")},{"./index":"p2p-media-loader-core"}],3:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});const r=e("debug"),i=e("./stringly-typed-event-emitter");n.HttpMediaManager=class extends i.STEEmitter{constructor(e){super(),this.settings=e,this.xhrRequests=new Map,this.failedSegments=new Map,this.debug=r("p2pml:http-media-manager"),this.now=()=>performance.now()}download(e,t){if(this.isDownloading(e))return;this.cleanTimedOutFailedSegments();const n=this.settings.segmentUrlBuilder?this.settings.segmentUrlBuilder(e):e.url;this.debug("http segment download",n),e.requestUrl=n;const r=new XMLHttpRequest;if(r.open("GET",n,!0),r.responseType="arraybuffer",e.range)r.setRequestHeader("Range",e.range),t=void 0;else if(void 0!==t&&this.settings.httpUseRanges){let e=0;for(const n of t)e+=n.byteLength;r.setRequestHeader("Range",`bytes=${e}-`),this.debug("continue download from",e)}else t=void 0;this.setupXhrEvents(r,e,t),this.settings.xhrSetup&&this.settings.xhrSetup(r,n),this.xhrRequests.set(e.id,{xhr:r,segment:e}),r.send()}abort(e){const t=this.xhrRequests.get(e.id);t&&(t.xhr.abort(),this.xhrRequests.delete(e.id),this.debug("http segment abort",e.id))}isDownloading(e){return this.xhrRequests.has(e.id)}isFailed(e){const t=this.failedSegments.get(e.id);return void 0!==t&&t>this.now()}getActiveDownloads(){return this.xhrRequests}getActiveDownloadsCount(){return this.xhrRequests.size}destroy(){this.xhrRequests.forEach(e=>e.xhr.abort()),this.xhrRequests.clear()}setupXhrEvents(e,t,n){let r=0;e.addEventListener("progress",e=>{const t=e.loaded-r;this.emit("bytes-downloaded",t),r=e.loaded}),e.addEventListener("load",async r=>{if(r.target.status<200||r.target.status>=300)return void this.segmentFailure(t,r,e);let i=r.target.response;if(void 0!==n&&206===r.target.status){let e=0;for(const t of n)e+=t.byteLength;const t=new Uint8Array(e+i.byteLength);let r=0;for(const e of n)t.set(new Uint8Array(e),r),r+=e.byteLength;t.set(new Uint8Array(i),r),i=t.buffer}await this.segmentDownloadFinished(t,i,e)}),e.addEventListener("error",n=>{this.segmentFailure(t,n,e)}),e.addEventListener("timeout",n=>{this.segmentFailure(t,n,e)})}async segmentDownloadFinished(e,t,n){if(e.responseUrl=null===n.responseURL?void 0:n.responseURL,this.settings.segmentValidator)try{await this.settings.segmentValidator(Object.assign(Object.assign({},e),{data:t}),"http")}catch(t){return this.debug("segment validator failed",t),void this.segmentFailure(e,t,n)}this.xhrRequests.delete(e.id),this.emit("segment-loaded",e,t)}segmentFailure(e,t,n){e.responseUrl=null===n.responseURL?void 0:n.responseURL,this.xhrRequests.delete(e.id),this.failedSegments.set(e.id,this.now()+this.settings.httpFailedSegmentTimeout),this.emit("segment-error",e,t)}cleanTimedOutFailedSegments(){const e=this.now(),t=[];this.failedSegments.forEach((n,r)=>{nthis.failedSegments.delete(e))}}},{"./stringly-typed-event-emitter":9,debug:"debug"}],4:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});const r=e("debug"),i=e("./loader-interface"),s=e("events"),o=e("./http-media-manager"),a=e("./p2p-media-manager"),u=e("./media-peer"),c=e("./bandwidth-approximator"),h=e("./segments-memory-storage"),l=e("get-browser-rtc"),d={cachedSegmentExpiration:3e5,cachedSegmentsCount:30,useP2P:!0,consumeOnly:!1,requiredSegmentsPriority:1,simultaneousHttpDownloads:2,httpDownloadProbability:.1,httpDownloadProbabilityInterval:1e3,httpDownloadProbabilitySkipIfNoPeers:!1,httpFailedSegmentTimeout:1e4,httpDownloadMaxPriority:20,httpDownloadInitialTimeout:0,httpDownloadInitialTimeoutPerSegment:4e3,httpUseRanges:!1,simultaneousP2PDownloads:3,p2pDownloadMaxPriority:20,p2pSegmentDownloadTimeout:6e4,webRtcMaxMessageSize:65535,trackerAnnounce:["wss://tracker.novage.com.ua","wss://tracker.openwebtorrent.com"],peerRequestsPerAnnounce:10,rtcConfig:e("simple-peer").config};n.HybridLoader=class extends s.EventEmitter{constructor(e={}){super(),this.debug=r("p2pml:hybrid-loader"),this.debugSegments=r("p2pml:hybrid-loader-segments"),this.segmentsQueue=[],this.bandwidthApproximator=new c.BandwidthApproximator,this.httpDownloadInitialTimeoutTimestamp=-1/0,this.processInitialSegmentTimeout=async()=>{if(void 0!==this.httpRandomDownloadInterval){if(void 0!==this.masterSwarmId){const e=await this.segmentsStorage.getSegmentsMap(this.masterSwarmId);this.processSegmentsQueue(e)&&!this.settings.consumeOnly&&this.p2pManager.sendSegmentsMapToAll(this.createSegmentsMap(e))}this.httpDownloadInitialTimeoutTimestamp!==-1/0&&setTimeout(this.processInitialSegmentTimeout,this.settings.httpDownloadInitialTimeoutPerSegment)}},this.downloadRandomSegmentOverHttp=async()=>{if(void 0===this.masterSwarmId||void 0===this.httpRandomDownloadInterval||this.httpDownloadInitialTimeoutTimestamp!==-1/0||this.httpManager.getActiveDownloadsCount()>=this.settings.simultaneousHttpDownloads||this.settings.httpDownloadProbabilitySkipIfNoPeers&&0===this.p2pManager.getPeers().size||this.settings.consumeOnly)return;const e=await this.segmentsStorage.getSegmentsMap(this.masterSwarmId),t=this.p2pManager.getOvrallSegmentsMap(),n=this.segmentsQueue.filter(n=>!this.p2pManager.isDownloading(n)&&!this.httpManager.isDownloading(n)&&!t.has(n.id)&&!this.httpManager.isFailed(n)&&n.priority<=this.settings.httpDownloadMaxPriority&&!e.has(n.id));if(0==n.length)return;if(Math.random()>this.settings.httpDownloadProbability*n.length)return;const r=n[Math.floor(Math.random()*n.length)];this.debugSegments("HTTP download (random)",r.priority,r.url),this.httpManager.download(r),this.p2pManager.sendSegmentsMapToAll(this.createSegmentsMap(e))},this.onPieceBytesDownloaded=(e,t,n)=>{this.bandwidthApproximator.addBytes(t,this.now()),this.emit(i.Events.PieceBytesDownloaded,e,t,n)},this.onPieceBytesUploaded=(e,t,n)=>{this.emit(i.Events.PieceBytesUploaded,e,t,n)},this.onSegmentLoaded=async(e,t,n)=>{if(this.debugSegments("segment loaded",e.id,e.url),void 0===this.masterSwarmId)return;let r;e.data=t,e.downloadBandwidth=this.bandwidthApproximator.getBandwidth(this.now()),await this.segmentsStorage.storeSegment(e),this.emit(i.Events.SegmentLoaded,e,n),r=void 0===r?await this.segmentsStorage.getSegmentsMap(this.masterSwarmId):r,this.processSegmentsQueue(r),this.settings.consumeOnly||this.p2pManager.sendSegmentsMapToAll(this.createSegmentsMap(r))},this.onSegmentError=async(e,t,n)=>{if(this.debugSegments("segment error",e.id,e.url,n,t),this.emit(i.Events.SegmentError,e,t,n),void 0!==this.masterSwarmId){const e=await this.segmentsStorage.getSegmentsMap(this.masterSwarmId);this.processSegmentsQueue(e)&&!this.settings.consumeOnly&&this.p2pManager.sendSegmentsMapToAll(this.createSegmentsMap(e))}},this.onPeerConnect=async e=>{this.emit(i.Events.PeerConnect,e),this.settings.consumeOnly||void 0===this.masterSwarmId||this.p2pManager.sendSegmentsMap(e.id,this.createSegmentsMap(await this.segmentsStorage.getSegmentsMap(this.masterSwarmId)))},this.onPeerClose=e=>{this.emit(i.Events.PeerClose,e)},this.onTrackerUpdate=async e=>{if(this.httpDownloadInitialTimeoutTimestamp!==-1/0&&void 0!==e.incomplete&&e.incomplete<=1&&(this.debugSegments("cancel initial HTTP download timeout - no peers"),this.httpDownloadInitialTimeoutTimestamp=-1/0,void 0!==this.masterSwarmId)){const e=await this.segmentsStorage.getSegmentsMap(this.masterSwarmId);this.processSegmentsQueue(e)&&!this.settings.consumeOnly&&this.p2pManager.sendSegmentsMapToAll(this.createSegmentsMap(e))}},this.settings=Object.assign(Object.assign({},d),e),e.bufferedSegmentsCount&&(void 0===e.p2pDownloadMaxPriority&&(this.settings.p2pDownloadMaxPriority=e.bufferedSegmentsCount),void 0===e.httpDownloadMaxPriority&&(this.settings.p2pDownloadMaxPriority=e.bufferedSegmentsCount),delete this.settings.bufferedSegmentsCount),this.segmentsStorage=void 0===this.settings.segmentsStorage?new h.SegmentsMemoryStorage(this.settings):this.settings.segmentsStorage,this.debug("loader settings",this.settings),this.httpManager=this.createHttpManager(),this.httpManager.on("segment-loaded",this.onSegmentLoaded),this.httpManager.on("segment-error",this.onSegmentError),this.httpManager.on("bytes-downloaded",e=>this.onPieceBytesDownloaded("http",e)),this.p2pManager=this.createP2PManager(),this.p2pManager.on("segment-loaded",this.onSegmentLoaded),this.p2pManager.on("segment-error",this.onSegmentError),this.p2pManager.on("peer-data-updated",async()=>{if(void 0===this.masterSwarmId)return;const e=await this.segmentsStorage.getSegmentsMap(this.masterSwarmId);this.processSegmentsQueue(e)&&!this.settings.consumeOnly&&this.p2pManager.sendSegmentsMapToAll(this.createSegmentsMap(e))}),this.p2pManager.on("bytes-downloaded",(e,t)=>this.onPieceBytesDownloaded("p2p",e,t)),this.p2pManager.on("bytes-uploaded",(e,t)=>this.onPieceBytesUploaded("p2p",e,t)),this.p2pManager.on("peer-connected",this.onPeerConnect),this.p2pManager.on("peer-closed",this.onPeerClose),this.p2pManager.on("tracker-update",this.onTrackerUpdate)}static isSupported(){const e=l();return e&&void 0!==e.RTCPeerConnection.prototype.createDataChannel}createHttpManager(){return new o.HttpMediaManager(this.settings)}createP2PManager(){return new a.P2PMediaManager(this.segmentsStorage,this.settings)}async load(e,t){void 0===this.httpRandomDownloadInterval&&(this.httpRandomDownloadInterval=setInterval(this.downloadRandomSegmentOverHttp,this.settings.httpDownloadProbabilityInterval),this.settings.httpDownloadInitialTimeout>0&&this.settings.httpDownloadInitialTimeoutPerSegment>0&&(this.debugSegments("enable initial HTTP download timeout",this.settings.httpDownloadInitialTimeout,"per segment",this.settings.httpDownloadInitialTimeoutPerSegment),this.httpDownloadInitialTimeoutTimestamp=this.now(),setTimeout(this.processInitialSegmentTimeout,this.settings.httpDownloadInitialTimeoutPerSegment+100))),e.length>0&&(this.masterSwarmId=e[0].masterSwarmId),void 0!==this.masterSwarmId&&this.p2pManager.setStreamSwarmId(t,this.masterSwarmId),this.debug("load segments");let n=!1;for(const t of this.segmentsQueue)e.find(e=>e.url==t.url)||(this.debug("remove segment",t.url),this.httpManager.isDownloading(t)?(n=!0,this.httpManager.abort(t)):this.p2pManager.abort(t),this.emit(i.Events.SegmentAbort,t));if(this.debug.enabled)for(const t of e)this.segmentsQueue.find(e=>e.url==t.url)||this.debug("add segment",t.url);if(this.segmentsQueue=e,void 0===this.masterSwarmId)return;let r=await this.segmentsStorage.getSegmentsMap(this.masterSwarmId);n=this.processSegmentsQueue(r)||n,await this.cleanSegmentsStorage()&&(r=await this.segmentsStorage.getSegmentsMap(this.masterSwarmId),n=!0),n&&!this.settings.consumeOnly&&this.p2pManager.sendSegmentsMapToAll(this.createSegmentsMap(r))}async getSegment(e){return void 0===this.masterSwarmId?void 0:this.segmentsStorage.getSegment(e,this.masterSwarmId)}getSettings(){return this.settings}getDetails(){return{peerId:this.p2pManager.getPeerId()}}async destroy(){void 0!==this.httpRandomDownloadInterval&&(clearInterval(this.httpRandomDownloadInterval),this.httpRandomDownloadInterval=void 0),this.httpDownloadInitialTimeoutTimestamp=-1/0,this.segmentsQueue=[],this.httpManager.destroy(),this.p2pManager.destroy(),this.masterSwarmId=void 0,await this.segmentsStorage.destroy()}processSegmentsQueue(e){if(this.debugSegments("process segments queue. priority",this.segmentsQueue.length>0?this.segmentsQueue[0].priority:0),void 0===this.masterSwarmId||0===this.segmentsQueue.length)return!1;let t,n=!1,r=!0;if(this.httpDownloadInitialTimeoutTimestamp!==-1/0){let t;for(const n of this.segmentsQueue)if(!e.has(n.id)){t=n.priority;break}const n=this.now()-this.httpDownloadInitialTimeoutTimestamp;(r=n>=this.settings.httpDownloadInitialTimeout||void 0!==t&&n>this.settings.httpDownloadInitialTimeoutPerSegment&&t<=0)&&(this.debugSegments("cancel initial HTTP download timeout - timed out"),this.httpDownloadInitialTimeoutTimestamp=-1/0)}for(let i=0;i=this.settings.simultaneousHttpDownloads)for(let e=this.segmentsQueue.length-1;e>i;e--){const t=this.segmentsQueue[e];if(this.httpManager.isDownloading(t)){this.debugSegments("cancel HTTP download",t.priority,t.url),this.httpManager.abort(t);break}}if(this.httpManager.getActiveDownloadsCount()=this.settings.simultaneousP2PDownloads)for(let e=this.segmentsQueue.length-1;e>i;e--){const t=this.segmentsQueue[e];if(this.p2pManager.isDownloading(t)){this.debugSegments("cancel P2P download",t.priority,t.url),this.p2pManager.abort(t);break}}if(this.p2pManager.getActiveDownloadsCount(){const r=this.getStreamSwarmId(e),i=e.sequence;let s=t[r];void 0===s&&(s=["",[]],t[r]=s);const o=s[1];s[0]+=0==o.length?i:`|${i}`,o.push(n)};for(const t of e.values())n(t.segment,u.MediaPeerSegmentStatus.Loaded);for(const e of this.httpManager.getActiveDownloads().values())n(e.segment,u.MediaPeerSegmentStatus.LoadingByHttp);return t}async cleanSegmentsStorage(){return void 0!==this.masterSwarmId&&this.segmentsStorage.clean(this.masterSwarmId,e=>void 0!==this.segmentsQueue.find(t=>t.id===e))}now(){return performance.now()}}},{"./bandwidth-approximator":1,"./http-media-manager":3,"./loader-interface":5,"./media-peer":6,"./p2p-media-manager":7,"./segments-memory-storage":8,debug:"debug",events:"events","get-browser-rtc":18,"simple-peer":44}],5:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(e){e.SegmentLoaded="segment_loaded",e.SegmentError="segment_error",e.SegmentAbort="segment_abort",e.PeerConnect="peer_connect",e.PeerClose="peer_close",e.PieceBytesDownloaded="piece_bytes_downloaded",e.PieceBytesUploaded="piece_bytes_uploaded"}(n.Events||(n.Events={}))},{}],6:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});const r=e("debug"),i=e("./stringly-typed-event-emitter"),s=e("buffer");var o,a;!function(e){e[e.SegmentData=0]="SegmentData",e[e.SegmentAbsent=1]="SegmentAbsent",e[e.SegmentsMap=2]="SegmentsMap",e[e.SegmentRequest=3]="SegmentRequest",e[e.CancelSegmentRequest=4]="CancelSegmentRequest"}(o||(o={})),function(e){e[e.Loaded=0]="Loaded",e[e.LoadingByHttp=1]="LoadingByHttp"}(a=n.MediaPeerSegmentStatus||(n.MediaPeerSegmentStatus={}));class u{constructor(e,t){this.id=e,this.size=t,this.bytesDownloaded=0,this.pieces=[]}}n.MediaPeer=class extends i.STEEmitter{constructor(e,t){super(),this.peer=e,this.settings=t,this.remoteAddress="",this.downloadingSegmentId=null,this.downloadingSegment=null,this.segmentsMap=new Map,this.debug=r("p2pml:media-peer"),this.timer=null,this.onPeerConnect=()=>{this.debug("peer connect",this.id,this),this.remoteAddress=this.peer.remoteAddress,this.emit("connect",this)},this.onPeerClose=()=>{this.debug("peer close",this.id,this),this.terminateSegmentRequest(),this.emit("close",this)},this.onPeerError=e=>{this.debug("peer error",this.id,e,this)},this.onPeerData=e=>{const t=this.getJsonCommand(e);if(null!=t){if(this.downloadingSegment){this.debug("peer segment download is interrupted by a command",this.id,this);const e=this.downloadingSegment.id;return this.terminateSegmentRequest(),void this.emit("segment-error",this,e,"Segment download is interrupted by a command")}switch(this.debug("peer receive command",this.id,t,this),t.c){case o.SegmentsMap:this.segmentsMap=this.createSegmentsMap(t.m),this.emit("data-updated");break;case o.SegmentRequest:this.emit("segment-request",this,t.i);break;case o.SegmentData:this.downloadingSegmentId===t.i&&(this.downloadingSegment=new u(t.i,t.s),this.cancelResponseTimeoutTimer());break;case o.SegmentAbsent:this.downloadingSegmentId===t.i&&(this.terminateSegmentRequest(),this.segmentsMap.delete(t.i),this.emit("segment-absent",this,t.i));break;case o.CancelSegmentRequest:}}else this.receiveSegmentPiece(e)},this.peer.on("connect",this.onPeerConnect),this.peer.on("close",this.onPeerClose),this.peer.on("error",this.onPeerError),this.peer.on("data",this.onPeerData),this.id=e.id}receiveSegmentPiece(e){if(!this.downloadingSegment)return void this.debug("peer segment not requested",this.id,this);this.downloadingSegment.bytesDownloaded+=e.byteLength,this.downloadingSegment.pieces.push(e),this.emit("bytes-downloaded",this,e.byteLength);const t=this.downloadingSegment.id;if(this.downloadingSegment.bytesDownloaded==this.downloadingSegment.size){const e=new Uint8Array(this.downloadingSegment.size);let n=0;for(const t of this.downloadingSegment.pieces)e.set(new Uint8Array(t),n),n+=t.byteLength;this.debug("peer segment download done",this.id,t,this),this.terminateSegmentRequest(),this.emit("segment-loaded",this,t,e.buffer)}else this.downloadingSegment.bytesDownloaded>this.downloadingSegment.size&&(this.debug("peer segment download bytes mismatch",this.id,t,this),this.terminateSegmentRequest(),this.emit("segment-error",this,t,"Too many bytes received for segment"))}getJsonCommand(e){const t=new Uint8Array(e);if(123==t[0]&&34==t[1]&&125==t[e.byteLength-1])try{return JSON.parse((new TextDecoder).decode(e))}catch(e){}return null}createSegmentsMap(e){if(null==e||!(e instanceof Object))return new Map;const t=new Map;for(const n of Object.keys(e)){const r=e[n];if(!(r instanceof Array&&2===r.length&&"string"==typeof r[0]&&r[1]instanceof Array))return new Map;const i=r[0].split("|"),s=r[1];if(i.length!==s.length)return new Map;for(let e=0;e0;){const e=n>=this.settings.webRtcMaxMessageSize?this.settings.webRtcMaxMessageSize:n,r=s.Buffer.from(t,t.byteLength-n,e);this.peer.write(r),n-=e}this.emit("bytes-uploaded",this,t.byteLength)}sendSegmentAbsent(e){this.sendCommand({c:o.SegmentAbsent,i:e})}requestSegment(e){if(this.downloadingSegmentId)throw new Error("A segment is already downloading: "+this.downloadingSegmentId);this.sendCommand({c:o.SegmentRequest,i:e}),this.downloadingSegmentId=e,this.runResponseTimeoutTimer()}cancelSegmentRequest(){let e;if(this.downloadingSegmentId){const t=this.downloadingSegmentId;e=this.downloadingSegment?this.downloadingSegment.pieces:void 0,this.terminateSegmentRequest(),this.sendCommand({c:o.CancelSegmentRequest,i:t})}return e}runResponseTimeoutTimer(){this.timer=setTimeout(()=>{if(this.timer=null,!this.downloadingSegmentId)return;const e=this.downloadingSegmentId;this.cancelSegmentRequest(),this.emit("segment-timeout",this,e)},this.settings.p2pSegmentDownloadTimeout)}cancelResponseTimeoutTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}terminateSegmentRequest(){this.downloadingSegmentId=null,this.downloadingSegment=null,this.cancelResponseTimeoutTimer()}}},{"./stringly-typed-event-emitter":9,buffer:16,debug:"debug"}],7:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});const r=e("debug"),i=e("bittorrent-tracker/client"),s=e("./stringly-typed-event-emitter"),o=e("./media-peer"),a=e("buffer"),u=e("sha.js/sha1"),c=e("./index"),h=2,l=`-WW${c.version.replace(/\d*./g,e=>`0${parseInt(e,10)%100}`.slice(-2)).slice(0,4)}-`;class d{constructor(e,t){this.peerId=e,this.segment=t}}n.P2PMediaManager=class extends s.STEEmitter{constructor(e,t){super(),this.sementsStorage=e,this.settings=t,this.trackerClient=null,this.peers=new Map,this.peerCandidates=new Map,this.peerSegmentRequests=new Map,this.streamSwarmId=null,this.debug=r("p2pml:p2p-media-manager"),this.pendingTrackerClient=null,this.onTrackerError=e=>{this.debug("tracker error",e)},this.onTrackerWarning=e=>{this.debug("tracker warning",e)},this.onTrackerUpdate=e=>{this.debug("tracker update",e),this.emit("tracker-update",e)},this.onTrackerPeer=e=>{if(this.debug("tracker peer",e.id,e),this.peers.has(e.id))return this.debug("tracker peer already connected",e.id,e),void e.destroy();const t=new o.MediaPeer(e,this.settings);t.on("connect",this.onPeerConnect),t.on("close",this.onPeerClose),t.on("data-updated",this.onPeerDataUpdated),t.on("segment-request",this.onSegmentRequest),t.on("segment-loaded",this.onSegmentLoaded),t.on("segment-absent",this.onSegmentAbsent),t.on("segment-error",this.onSegmentError),t.on("segment-timeout",this.onSegmentTimeout),t.on("bytes-downloaded",this.onPieceBytesDownloaded),t.on("bytes-uploaded",this.onPieceBytesUploaded);let n=this.peerCandidates.get(t.id);n||(n=[],this.peerCandidates.set(t.id,n)),n.push(t)},this.onPieceBytesDownloaded=(e,t)=>{this.emit("bytes-downloaded",t,e.id)},this.onPieceBytesUploaded=(e,t)=>{this.emit("bytes-uploaded",t,e.id)},this.onPeerConnect=e=>{if(this.peers.get(e.id))return this.debug("tracker peer already connected (in peer connect)",e.id,e),void e.destroy();this.peers.set(e.id,e);const t=this.peerCandidates.get(e.id);if(t){for(const n of t)n!=e&&n.destroy();this.peerCandidates.delete(e.id)}this.emit("peer-connected",{id:e.id,remoteAddress:e.remoteAddress})},this.onPeerClose=e=>{if(this.peers.get(e.id)!=e){const t=this.peerCandidates.get(e.id);if(!t)return;const n=t.indexOf(e);return-1!=n&&t.splice(n,1),void(0==t.length&&this.peerCandidates.delete(e.id))}for(const[t,n]of this.peerSegmentRequests)n.peerId==e.id&&this.peerSegmentRequests.delete(t);this.peers.delete(e.id),this.emit("peer-data-updated"),this.emit("peer-closed",e.id)},this.onPeerDataUpdated=()=>{this.emit("peer-data-updated")},this.onSegmentRequest=async(e,t)=>{if(void 0===this.masterSwarmId)return;const n=await this.sementsStorage.getSegment(t,this.masterSwarmId);n?e.sendSegmentData(t,n.data):e.sendSegmentAbsent(t)},this.onSegmentLoaded=async(e,t,n)=>{const r=this.peerSegmentRequests.get(t);if(!r)return;const i=r.segment;if(this.settings.segmentValidator)try{await this.settings.segmentValidator(Object.assign(Object.assign({},i),{data:n}),"p2p",e.id)}catch(n){return this.debug("segment validator failed",n),this.peerSegmentRequests.delete(t),this.emit("segment-error",i,n,e.id),void this.onPeerClose(e)}this.peerSegmentRequests.delete(t),this.emit("segment-loaded",i,n,e.id)},this.onSegmentAbsent=(e,t)=>{this.peerSegmentRequests.delete(t),this.emit("peer-data-updated")},this.onSegmentError=(e,t,n)=>{const r=this.peerSegmentRequests.get(t);r&&(this.peerSegmentRequests.delete(t),this.emit("segment-error",r.segment,n,e.id))},this.onSegmentTimeout=(e,t)=>{const n=this.peerSegmentRequests.get(t);n&&(this.peerSegmentRequests.delete(t),e.destroy(),this.peers.delete(n.peerId)&&this.emit("peer-data-updated"))},this.peerId=t.useP2P?function(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let t=l;for(let n=0;n<20-l.length;n++)t+=e.charAt(Math.floor(Math.random()*e.length));return(new TextEncoder).encode(t).buffer}():new ArrayBuffer(0),this.debug.enabled&&this.debug("peer ID",this.getPeerId(),(new TextDecoder).decode(this.peerId))}getPeers(){return this.peers}getPeerId(){return a.Buffer.from(this.peerId).toString("hex")}async setStreamSwarmId(e,t){if(this.streamSwarmId===e)return;this.destroy(!0),this.streamSwarmId=e,this.masterSwarmId=t,this.debug("stream swarm ID",this.streamSwarmId),this.pendingTrackerClient={isDestroyed:!1};const n=this.pendingTrackerClient,r=(new u).update(h+this.streamSwarmId).digest();n.isDestroyed?null!=this.trackerClient&&(this.trackerClient.destroy(),this.trackerClient=null):(this.pendingTrackerClient=null,this.createClient(r))}createClient(e){if(!this.settings.useP2P)return;const t={infoHash:a.Buffer.from(e,0,20),peerId:a.Buffer.from(this.peerId,0,20),announce:this.settings.trackerAnnounce,rtcConfig:this.settings.rtcConfig,port:6881,getAnnounceOpts:()=>({numwant:this.settings.peerRequestsPerAnnounce})};let n=this.trackerClient;this.trackerClient=new i(t),this.trackerClient.on("error",this.onTrackerError),this.trackerClient.on("warning",this.onTrackerWarning),this.trackerClient.on("update",this.onTrackerUpdate),this.trackerClient.on("peer",this.onTrackerPeer),this.trackerClient.start(),null!=n&&(n.destroy(),n=null)}download(e){if(this.isDownloading(e))return!1;const t=[];for(const n of this.peers.values())null==n.getDownloadingSegmentId()&&n.getSegmentsMap().get(e.id)===o.MediaPeerSegmentStatus.Loaded&&t.push(n);if(0===t.length)return!1;const n=t[Math.floor(Math.random()*t.length)];return n.requestSegment(e.id),this.peerSegmentRequests.set(e.id,new d(n.id,e)),!0}abort(e){let t;const n=this.peerSegmentRequests.get(e.id);if(n){const r=this.peers.get(n.peerId);r&&(t=r.cancelSegmentRequest()),this.peerSegmentRequests.delete(e.id)}return t}isDownloading(e){return this.peerSegmentRequests.has(e.id)}getActiveDownloadsCount(){return this.peerSegmentRequests.size}destroy(e=!1){this.streamSwarmId=null,this.trackerClient&&(this.trackerClient.stop(),e?(this.trackerClient.removeAllListeners("error"),this.trackerClient.removeAllListeners("warning"),this.trackerClient.removeAllListeners("update"),this.trackerClient.removeAllListeners("peer")):(this.trackerClient.destroy(),this.trackerClient=null)),this.pendingTrackerClient&&(this.pendingTrackerClient.isDestroyed=!0,this.pendingTrackerClient=null),this.peers.forEach(e=>e.destroy()),this.peers.clear(),this.peerSegmentRequests.clear();for(const e of this.peerCandidates.values())for(const t of e)t.destroy();this.peerCandidates.clear()}sendSegmentsMapToAll(e){this.peers.forEach(t=>t.sendSegmentsMap(e))}sendSegmentsMap(e,t){const n=this.peers.get(e);n&&n.sendSegmentsMap(t)}getOvrallSegmentsMap(){const e=new Map;for(const t of this.peers.values())for(const[n,r]of t.getSegmentsMap())r===o.MediaPeerSegmentStatus.Loaded?e.set(n,o.MediaPeerSegmentStatus.Loaded):e.get(n)||e.set(n,o.MediaPeerSegmentStatus.LoadingByHttp);return e}}},{"./index":"p2p-media-loader-core","./media-peer":6,"./stringly-typed-event-emitter":9,"bittorrent-tracker/client":11,buffer:16,debug:"debug","sha.js/sha1":43}],8:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.SegmentsMemoryStorage=class{constructor(e){this.settings=e,this.cache=new Map}async storeSegment(e){this.cache.set(e.id,{segment:e,lastAccessed:performance.now()})}async getSegmentsMap(e){return this.cache}async getSegment(e,t){const n=this.cache.get(e);if(void 0!==n)return n.lastAccessed=performance.now(),n.segment}async hasSegment(e,t){return this.cache.has(e)}async clean(e,t){const n=[],r=[],i=performance.now();for(const e of this.cache.values())i-e.lastAccessed>this.settings.cachedSegmentExpiration?n.push(e.segment.id):r.push(e);let s=r.length-this.settings.cachedSegmentsCount;if(s>0){r.sort((e,t)=>e.lastAccessed-t.lastAccessed);for(const e of r)if((void 0===t||!t(e.segment.id))&&(n.push(e.segment.id),0==--s))break}return n.forEach(e=>this.cache.delete(e)),n.length>0}async destroy(){this.cache.clear()}}},{}],9:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});const r=e("events");n.STEEmitter=class extends r.EventEmitter{on(e,t){return super.on(e,t)}emit(e,...t){return super.emit(e,...t)}}},{events:"events"}],10:[function(e,t,n){"use strict";n.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},n.toByteArray=function(e){var t,n,r=c(e),o=r[0],a=r[1],u=new s(function(e,t,n){return 3*(t+n)/4-n}(0,o,a)),h=0,l=a>0?o-4:o;for(n=0;n>16&255,u[h++]=t>>8&255,u[h++]=255&t;2===a&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,u[h++]=255&t);1===a&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,u[h++]=t>>8&255,u[h++]=255&t);return u},n.fromByteArray=function(e){for(var t,n=e.length,i=n%3,s=[],o=0,a=n-i;oa?a:o+16383));1===i?(t=e[n-1],s.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],s.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return s.join("")};for(var r=[],i=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function h(e,t,n){for(var i,s,o=[],a=t;a>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],11:[function(e,t,n){(function(n,r){const i=e("debug")("bittorrent-tracker:client"),s=e("events"),o=e("once"),a=e("run-parallel"),u=e("simple-peer"),c=e("uniq"),h=e("./lib/common"),l=e("./lib/client/http-tracker"),d=e("./lib/client/udp-tracker"),f=e("./lib/client/websocket-tracker");class p extends s{constructor(e={}){if(super(),!e.peerId)throw new Error("Option `peerId` is required");if(!e.infoHash)throw new Error("Option `infoHash` is required");if(!e.announce)throw new Error("Option `announce` is required");if(!n.browser&&!e.port)throw new Error("Option `port` is required");this.peerId="string"==typeof e.peerId?e.peerId:e.peerId.toString("hex"),this._peerIdBuffer=r.from(this.peerId,"hex"),this._peerIdBinary=this._peerIdBuffer.toString("binary"),this.infoHash="string"==typeof e.infoHash?e.infoHash.toLowerCase():e.infoHash.toString("hex"),this._infoHashBuffer=r.from(this.infoHash,"hex"),this._infoHashBinary=this._infoHashBuffer.toString("binary"),i("new client %s",this.infoHash),this.destroyed=!1,this._port=e.port,this._getAnnounceOpts=e.getAnnounceOpts,this._rtcConfig=e.rtcConfig,this._userAgent=e.userAgent,this._wrtc="function"==typeof e.wrtc?e.wrtc():e.wrtc;let t="string"==typeof e.announce?[e.announce]:null==e.announce?[]:e.announce;t=t.map(e=>("/"===(e=e.toString())[e.length-1]&&(e=e.substring(0,e.length-1)),e)),t=c(t);const s=!1!==this._wrtc&&(!!this._wrtc||u.WEBRTC_SUPPORT),o=e=>{n.nextTick(()=>{this.emit("warning",e)})};this._trackers=t.map(e=>{let t;try{t=new URL(e)}catch(t){return o(new Error(`Invalid tracker URL: ${e}`)),null}const n=t.port;if(n<0||n>65535)return o(new Error(`Invalid tracker port: ${e}`)),null;const r=t.protocol;return"http:"!==r&&"https:"!==r||"function"!=typeof l?"udp:"===r&&"function"==typeof d?new d(this,e):"ws:"!==r&&"wss:"!==r||!s?(o(new Error(`Unsupported tracker protocol: ${e}`)),null):"ws:"===r&&"undefined"!=typeof window&&"https:"===window.location.protocol?(o(new Error(`Unsupported tracker protocol: ${e}`)),null):new f(this,e):new l(this,e)}).filter(Boolean)}start(e){(e=this._defaultAnnounceOpts(e)).event="started",i("send `start` %o",e),this._announce(e),this._trackers.forEach(e=>{e.setInterval()})}stop(e){(e=this._defaultAnnounceOpts(e)).event="stopped",i("send `stop` %o",e),this._announce(e)}complete(e){e||(e={}),(e=this._defaultAnnounceOpts(e)).event="completed",i("send `complete` %o",e),this._announce(e)}update(e){(e=this._defaultAnnounceOpts(e)).event&&delete e.event,i("send `update` %o",e),this._announce(e)}_announce(e){this._trackers.forEach(t=>{t.announce(e)})}scrape(e){i("send `scrape`"),e||(e={}),this._trackers.forEach(t=>{t.scrape(e)})}setInterval(e){i("setInterval %d",e),this._trackers.forEach(t=>{t.setInterval(e)})}destroy(e){if(this.destroyed)return;this.destroyed=!0,i("destroy");const t=this._trackers.map(e=>t=>{e.destroy(t)});a(t,e),this._trackers=[],this._getAnnounceOpts=null}_defaultAnnounceOpts(e={}){return null==e.numwant&&(e.numwant=h.DEFAULT_ANNOUNCE_PEERS),null==e.uploaded&&(e.uploaded=0),null==e.downloaded&&(e.downloaded=0),this._getAnnounceOpts&&(e=Object.assign({},e,this._getAnnounceOpts())),e}}p.scrape=(e,t)=>{if(t=o(t),!e.infoHash)throw new Error("Option `infoHash` is required");if(!e.announce)throw new Error("Option `announce` is required");const n=Object.assign({},e,{infoHash:Array.isArray(e.infoHash)?e.infoHash[0]:e.infoHash,peerId:r.from("01234567890123456789"),port:6881}),i=new p(n);i.once("error",t),i.once("warning",t);let s=Array.isArray(e.infoHash)?e.infoHash.length:1;const a={};return i.on("scrape",e=>{if(s-=1,a[e.infoHash]=e,0===s){i.destroy();const e=Object.keys(a);1===e.length?t(null,a[e[0]]):t(null,a)}}),e.infoHash=Array.isArray(e.infoHash)?e.infoHash.map(e=>r.from(e,"hex")):r.from(e.infoHash,"hex"),i.scrape({infoHash:e.infoHash}),i},t.exports=p}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/client/http-tracker":15,"./lib/client/udp-tracker":15,"./lib/client/websocket-tracker":13,"./lib/common":14,_process:23,buffer:16,debug:"debug",events:"events",once:22,"run-parallel":40,"simple-peer":44,uniq:47}],12:[function(e,t,n){const r=e("events");t.exports=class extends r{constructor(e,t){super(),this.client=e,this.announceUrl=t,this.interval=null,this.destroyed=!1}setInterval(e){null==e&&(e=this.DEFAULT_ANNOUNCE_INTERVAL),clearInterval(this.interval),e&&(this.interval=setInterval(()=>{this.announce(this.client._defaultAnnounceOpts())},e),this.interval.unref&&this.interval.unref())}}},{events:"events"}],13:[function(e,t,n){const r=e("debug")("bittorrent-tracker:websocket-tracker"),i=e("simple-peer"),s=e("randombytes"),o=e("simple-websocket"),a=e("../common"),u=e("./tracker"),c={},h=1e4,l=18e5,d=12e4,f=5e4;class p extends u{constructor(e,t,n){super(e,t),r("new websocket tracker %s",t),this.peers={},this.socket=null,this.reconnecting=!1,this.retries=0,this.reconnectTimer=null,this.expectingResponse=!1,this._openSocket()}announce(e){if(this.destroyed||this.reconnecting)return;if(!this.socket.connected)return void this.socket.once("connect",()=>{this.announce(e)});const t=Object.assign({},e,{action:"announce",info_hash:this.client._infoHashBinary,peer_id:this.client._peerIdBinary});if(this._trackerId&&(t.trackerid=this._trackerId),"stopped"===e.event||"completed"===e.event)this._send(t);else{const n=Math.min(e.numwant,10);this._generateOffers(n,e=>{t.numwant=n,t.offers=e,this._send(t)})}}scrape(e){if(this.destroyed||this.reconnecting)return;if(!this.socket.connected)return void this.socket.once("connect",()=>{this.scrape(e)});const t={action:"scrape",info_hash:Array.isArray(e.infoHash)&&e.infoHash.length>0?e.infoHash.map(e=>e.toString("binary")):e.infoHash&&e.infoHash.toString("binary")||this.client._infoHashBinary};this._send(t)}destroy(e=g){if(this.destroyed)return e(null);this.destroyed=!0,clearInterval(this.interval),clearTimeout(this.reconnectTimer);for(const e in this.peers){const t=this.peers[e];clearTimeout(t.trackerTimeout),t.destroy()}if(this.peers=null,this.socket&&(this.socket.removeListener("connect",this._onSocketConnectBound),this.socket.removeListener("data",this._onSocketDataBound),this.socket.removeListener("close",this._onSocketCloseBound),this.socket.removeListener("error",this._onSocketErrorBound),this.socket=null),this._onSocketConnectBound=null,this._onSocketErrorBound=null,this._onSocketDataBound=null,this._onSocketCloseBound=null,c[this.announceUrl]&&(c[this.announceUrl].consumers-=1),c[this.announceUrl].consumers>0)return e();let t=c[this.announceUrl];if(delete c[this.announceUrl],t.on("error",g),t.once("close",e),!this.expectingResponse)return r();var n=setTimeout(r,a.DESTROY_TIMEOUT);function r(){n&&(clearTimeout(n),n=null),t.removeListener("data",r),t.destroy(),t=null}t.once("data",r)}_openSocket(){this.destroyed=!1,this.peers||(this.peers={}),this._onSocketConnectBound=()=>{this._onSocketConnect()},this._onSocketErrorBound=e=>{this._onSocketError(e)},this._onSocketDataBound=e=>{this._onSocketData(e)},this._onSocketCloseBound=()=>{this._onSocketClose()},this.socket=c[this.announceUrl],this.socket?(c[this.announceUrl].consumers+=1,this.socket.connected&&this._onSocketConnectBound()):(this.socket=c[this.announceUrl]=new o(this.announceUrl),this.socket.consumers=1,this.socket.once("connect",this._onSocketConnectBound)),this.socket.on("data",this._onSocketDataBound),this.socket.once("close",this._onSocketCloseBound),this.socket.once("error",this._onSocketErrorBound)}_onSocketConnect(){this.destroyed||this.reconnecting&&(this.reconnecting=!1,this.retries=0,this.announce(this.client._defaultAnnounceOpts()))}_onSocketData(e){if(!this.destroyed){this.expectingResponse=!1;try{e=JSON.parse(e)}catch(e){return void this.client.emit("warning",new Error("Invalid tracker response"))}"announce"===e.action?this._onAnnounceResponse(e):"scrape"===e.action?this._onScrapeResponse(e):this._onSocketError(new Error(`invalid action in WS response: ${e.action}`))}}_onAnnounceResponse(e){if(e.info_hash!==this.client._infoHashBinary)return void r("ignoring websocket data from %s for %s (looking for %s: reused socket)",this.announceUrl,a.binaryToHex(e.info_hash),this.client.infoHash);if(e.peer_id&&e.peer_id===this.client._peerIdBinary)return;r("received %s from %s for %s",JSON.stringify(e),this.announceUrl,this.client.infoHash);const t=e["failure reason"];if(t)return this.client.emit("warning",new Error(t));const n=e["warning message"];n&&this.client.emit("warning",new Error(n));const i=e.interval||e["min interval"];i&&this.setInterval(1e3*i);const s=e["tracker id"];if(s&&(this._trackerId=s),null!=e.complete){const t=Object.assign({},e,{announce:this.announceUrl,infoHash:a.binaryToHex(e.info_hash)});this.client.emit("update",t)}let o;if(e.offer&&e.peer_id&&(r("creating peer (from remote offer)"),(o=this._createPeer()).id=a.binaryToHex(e.peer_id),o.once("signal",t=>{const n={action:"announce",info_hash:this.client._infoHashBinary,peer_id:this.client._peerIdBinary,to_peer_id:e.peer_id,answer:t,offer_id:e.offer_id};this._trackerId&&(n.trackerid=this._trackerId),this._send(n)}),o.signal(e.offer),this.client.emit("peer",o)),e.answer&&e.peer_id){const t=a.binaryToHex(e.offer_id);(o=this.peers[t])?(o.id=a.binaryToHex(e.peer_id),o.signal(e.answer),this.client.emit("peer",o),clearTimeout(o.trackerTimeout),o.trackerTimeout=null,delete this.peers[t]):r(`got unexpected answer: ${JSON.stringify(e.answer)}`)}}_onScrapeResponse(e){e=e.files||{};const t=Object.keys(e);0!==t.length?t.forEach(t=>{const n=Object.assign(e[t],{announce:this.announceUrl,infoHash:a.binaryToHex(t)});this.client.emit("scrape",n)}):this.client.emit("warning",new Error("invalid scrape response"))}_onSocketClose(){this.destroyed||(this.destroy(),this._startReconnectTimer())}_onSocketError(e){this.destroyed||(this.destroy(),this.client.emit("warning",e),this._startReconnectTimer())}_startReconnectTimer(){const e=Math.floor(Math.random()*d)+Math.min(Math.pow(2,this.retries)*h,l);this.reconnecting=!0,clearTimeout(this.reconnectTimer),this.reconnectTimer=setTimeout(()=>{this.retries++,this._openSocket()},e),this.reconnectTimer.unref&&this.reconnectTimer.unref(),r("reconnecting socket in %s ms",e)}_send(e){if(this.destroyed)return;this.expectingResponse=!0;const t=JSON.stringify(e);r("send %s",t),this.socket.send(t)}_generateOffers(e,t){const n=this,i=[];r("generating %s offers",e);for(let t=0;t{i.push({offer:t,offer_id:a.hexToBinary(e)}),u()}),t.trackerTimeout=setTimeout(()=>{r("tracker timeout: destroying peer"),t.trackerTimeout=null,delete n.peers[e],t.destroy()},f),t.trackerTimeout.unref&&t.trackerTimeout.unref()}function u(){i.length===e&&(r("generated %s offers",e),t(i))}u()}_createPeer(e){const t=this;e=Object.assign({trickle:!1,config:t.client._rtcConfig,wrtc:t.client._wrtc},e);const n=new i(e);return n.once("error",r),n.once("connect",function e(){n.removeListener("error",r);n.removeListener("connect",e)}),n;function r(e){t.client.emit("warning",new Error(`Connection error: ${e.message}`)),n.destroy()}}}function g(){}p.prototype.DEFAULT_ANNOUNCE_INTERVAL=3e4,p._socketPool=c,t.exports=p},{"../common":14,"./tracker":12,debug:"debug",randombytes:24,"simple-peer":44,"simple-websocket":45}],14:[function(e,t,n){(function(t){n.DEFAULT_ANNOUNCE_PEERS=50,n.MAX_ANNOUNCE_PEERS=82,n.binaryToHex=function(e){return"string"!=typeof e&&(e=String(e)),t.from(e,"binary").toString("hex")},n.hexToBinary=function(e){return"string"!=typeof e&&(e=String(e)),t.from(e,"hex").toString("binary")};var r=e("./common-node");Object.assign(n,r)}).call(this,e("buffer").Buffer)},{"./common-node":15,buffer:16}],15:[function(e,t,n){},{}],16:[function(e,t,n){(function(t){"use strict";var r=e("base64-js"),i=e("ieee754"),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;n.Buffer=t,n.SlowBuffer=function(e){+e!=e&&(e=0);return t.alloc(+e)},n.INSPECT_MAX_BYTES=50;var o=2147483647;function a(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=new Uint8Array(e);return Object.setPrototypeOf(n,t.prototype),n}function t(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return u(e,t,n)}function u(e,n,r){if("string"==typeof e)return function(e,n){"string"==typeof n&&""!==n||(n="utf8");if(!t.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var r=0|f(e,n),i=a(r),s=i.write(e,n);s!==r&&(i=i.slice(0,s));return i}(e,n);if(ArrayBuffer.isView(e))return l(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(q(e,ArrayBuffer)||e&&q(e.buffer,ArrayBuffer))return function(e,n,r){if(n<0||e.byteLength=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function f(e,n){if(t.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var s=!1;;)switch(n){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return j(e).length;default:if(s)return i?-1:U(e).length;n=(""+n).toLowerCase(),s=!0}}function p(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return M(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return k(this,t,n);case"latin1":case"binary":return A(this,t,n);case"base64":return C(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,n,r,i,s){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),H(r=+r)&&(r=s?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(s)return-1;r=e.length-1}else if(r<0){if(!s)return-1;r=0}if("string"==typeof n&&(n=t.from(n,i)),t.isBuffer(n))return 0===n.length?-1:y(e,n,r,i,s);if("number"==typeof n)return n&=255,"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(e,n,r):Uint8Array.prototype.lastIndexOf.call(e,n,r):y(e,[n],r,i,s);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var s,o=1,a=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,a/=2,u/=2,n/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var h=-1;for(s=n;sa&&(n=a-u),s=n;s>=0;s--){for(var l=!0,d=0;di&&(r=i):r=i;var s=t.length;r>s/2&&(r=s/2);for(var o=0;o>8,i=n%256,s.push(i),s.push(r);return s}(t,e.length-n),e,n,r)}function C(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function T(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+l<=n)switch(l){case 1:c<128&&(h=c);break;case 2:128==(192&(s=e[i+1]))&&(u=(31&c)<<6|63&s)>127&&(h=u);break;case 3:s=e[i+1],o=e[i+2],128==(192&s)&&128==(192&o)&&(u=(15&c)<<12|(63&s)<<6|63&o)>2047&&(u<55296||u>57343)&&(h=u);break;case 4:s=e[i+1],o=e[i+2],a=e[i+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(u=(15&c)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&u<1114112&&(h=u)}null===h?(h=65533,l=1):h>65535&&(h-=65536,r.push(h>>>10&1023|55296),h=56320|1023&h),r.push(h),i+=l}return function(e){var t=e.length;if(t<=R)return String.fromCharCode.apply(String,e);var n="",r=0;for(;rt&&(e+=" ... "),""},s&&(t.prototype[s]=t.prototype.inspect),t.prototype.compare=function(e,n,r,i,s){if(q(e,Uint8Array)&&(e=t.from(e,e.offset,e.byteLength)),!t.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===n&&(n=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===s&&(s=this.length),n<0||r>e.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&n>=r)return 0;if(i>=s)return-1;if(n>=r)return 1;if(this===e)return 0;for(var o=(s>>>=0)-(i>>>=0),a=(r>>>=0)-(n>>>=0),u=Math.min(o,a),c=this.slice(i,s),h=e.slice(n,r),l=0;l>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return _(this,e,t,n);case"latin1":case"binary":return v(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;function k(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",s=t;sn)throw new RangeError("Trying to access beyond buffer length")}function x(e,n,r,i,s,o){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>s||ne.length)throw new RangeError("Index out of range")}function O(e,t,n,r,i,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(e,t,n,r,s){return t=+t,n>>>=0,s||O(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function D(e,t,n,r,s){return t=+t,n>>>=0,s||O(e,0,n,8),i.write(e,t,n,r,52,8),n+8}t.prototype.slice=function(e,n){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(n=void 0===n?r:~~n)<0?(n+=r)<0&&(n=0):n>r&&(n=r),n>>=0,t>>>=0,n||P(e,t,this.length);for(var r=this[e],i=1,s=0;++s>>=0,t>>>=0,n||P(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},t.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},t.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},t.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},t.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},t.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},t.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);for(var r=this[e],i=1,s=0;++s=(i*=128)&&(r-=Math.pow(2,8*t)),r},t.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);for(var r=t,i=1,s=this[e+--r];r>0&&(i*=256);)s+=this[e+--r]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},t.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},t.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},t.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},t.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},t.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},t.prototype.readFloatLE=function(e,t){return e>>>=0,t||P(e,4,this.length),i.read(this,e,!0,23,4)},t.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),i.read(this,e,!1,23,4)},t.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),i.read(this,e,!0,52,8)},t.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),i.read(this,e,!1,52,8)},t.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||x(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,s=0;for(this[t]=255&e;++s>>=0,n>>>=0,r)||x(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+n},t.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,1,255,0),this[t]=255&e,t+1},t.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},t.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);x(this,e,t,n,i-1,-i)}var s=0,o=1,a=0;for(this[t]=255&e;++s>0)-a&255;return t+n},t.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);x(this,e,t,n,i-1,-i)}var s=n-1,o=1,a=0;for(this[t+s]=255&e;--s>=0&&(o*=256);)e<0&&0===a&&0!==this[t+s+1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+n},t.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},t.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},t.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeFloatLE=function(e,t,n){return L(this,e,t,!0,n)},t.prototype.writeFloatBE=function(e,t,n){return L(this,e,t,!1,n)},t.prototype.writeDoubleLE=function(e,t,n){return D(this,e,t,!0,n)},t.prototype.writeDoubleBE=function(e,t,n){return D(this,e,t,!1,n)},t.prototype.copy=function(e,n,r,i){if(!t.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),n>=e.length&&(n=e.length),n||(n=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-n=0;--o)e[o+n]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,i),n);return s},t.prototype.fill=function(e,n,r,i){if("string"==typeof e){if("string"==typeof n?(i=n,n=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!t.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){var s=e.charCodeAt(0);("utf8"===i&&s<128||"latin1"===i)&&(e=s)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(n<0||this.length>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=n;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function j(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function F(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function H(e){return e!=e}}).call(this,e("buffer").Buffer)},{"base64-js":10,buffer:16,ieee754:19}],17:[function(e,t,n){t.exports=function(t){function n(e){let t=0;for(let n=0;n{if("%%"===t)return t;a++;const s=r.formatters[i];if("function"==typeof s){const r=e[a];t=s.call(n,r),e.splice(a,1),a--}return t}),r.formatArgs.call(n,e),(n.log||r.log).apply(n,e)}return o.namespace=e,o.enabled=r.enabled(e),o.useColors=r.useColors(),o.color=n(e),o.destroy=i,o.extend=s,"function"==typeof r.init&&r.init(o),r.instances.push(o),o}function i(){const e=r.instances.indexOf(this);return-1!==e&&(r.instances.splice(e,1),!0)}function s(e,t){const n=r(this.namespace+(void 0===t?":":t)+e);return n.log=this.log,n}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return r.debug=r,r.default=r,r.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},r.disable=function(){const e=[...r.names.map(o),...r.skips.map(o).map(e=>"-"+e)].join(",");return r.enable(""),e},r.enable=function(e){let t;r.save(e),r.names=[],r.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(t=0;t{r[e]=t[e]}),r.instances=[],r.names=[],r.skips=[],r.formatters={},r.selectColor=n,r.enable(r.load()),r}},{ms:21}],18:[function(e,t,n){t.exports=function(){if("undefined"==typeof window)return null;var e={RTCPeerConnection:window.RTCPeerConnection||window.mozRTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.RTCSessionDescription||window.mozRTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.RTCIceCandidate||window.mozRTCIceCandidate||window.webkitRTCIceCandidate};return e.RTCPeerConnection?e:null}},{}],19:[function(e,t,n){n.read=function(e,t,n,r,i){var s,o,a=8*i-r-1,u=(1<>1,h=-7,l=n?i-1:0,d=n?-1:1,f=e[t+l];for(l+=d,s=f&(1<<-h)-1,f>>=-h,h+=a;h>0;s=256*s+e[t+l],l+=d,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=r;h>0;o=256*o+e[t+l],l+=d,h-=8);if(0===s)s=1-c;else{if(s===u)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,r),s-=c}return(f?-1:1)*o*Math.pow(2,s-r)},n.write=function(e,t,n,r,i,s){var o,a,u,c=8*s-i-1,h=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:s-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+l>=1?d/u:d*Math.pow(2,1-l))*u>=2&&(o++,u/=2),o+l>=h?(a=0,o=h):o+l>=1?(a=(t*u-1)*Math.pow(2,i),o+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),o=0));i>=8;e[n+f]=255&a,f+=p,a/=256,i-=8);for(o=o<0;e[n+f]=255&o,f+=p,o/=256,c-=8);e[n+f-p]|=128*g}},{}],20:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},{}],21:[function(e,t,n){var r=1e3,i=60*r,s=60*i,o=24*s,a=7*o,u=365.25*o;function c(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}t.exports=function(e,t){t=t||{};var n=typeof e;if("string"===n&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*u;case"weeks":case"week":case"w":return n*a;case"days":case"day":case"d":return n*o;case"hours":case"hour":case"hrs":case"hr":case"h":return n*s;case"minutes":case"minute":case"mins":case"min":case"m":return n*i;case"seconds":case"second":case"secs":case"sec":case"s":return n*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}(e);if("number"===n&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=o)return c(e,t,o,"day");if(t>=s)return c(e,t,s,"hour");if(t>=i)return c(e,t,i,"minute");if(t>=r)return c(e,t,r,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=o)return Math.round(e/o)+"d";if(t>=s)return Math.round(e/s)+"h";if(t>=i)return Math.round(e/i)+"m";if(t>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],22:[function(e,t,n){var r=e("wrappy");function i(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function s(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},n=e.name||"Function wrapped with `once`";return t.onceError=n+" shouldn't be called more than once",t.called=!1,t}t.exports=r(i),t.exports.strict=r(s),i.proto=i(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return i(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return s(this)},configurable:!0})})},{wrappy:49}],23:[function(e,t,n){var r,i,s=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(e){i=a}}();var c,h=[],l=!1,d=-1;function f(){l&&c&&(l=!1,c.length?h=c.concat(h):d=-1,h.length&&p())}function p(){if(!l){var e=u(f);l=!0;for(var t=h.length;t;){for(c=h,h=[];++d1)for(var n=1;ns)throw new RangeError("requested too many random bytes");var r=o.allocUnsafe(e);if(e>0)if(e>i)for(var u=0;u2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),i("ERR_INVALID_ARG_TYPE",function(e,t,n){var r,i,o,a;if("string"==typeof t&&(i="not ",t.substr(!o||o<0?0:+o,i.length)===i)?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))a="The ".concat(e," ").concat(r," ").concat(s(t,"type"));else{var u=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}(e,".")?"property":"argument";a='The "'.concat(e,'" ').concat(u," ").concat(r," ").concat(s(t,"type"))}return a+=". Received type ".concat(typeof n)},TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=r},{}],26:[function(e,t,n){(function(e){"use strict";var n=new Set;t.exports.emitExperimentalWarning=e.emitWarning?function(t){if(!n.has(t)){var r=t+" is an experimental feature. This feature could change at any time";n.add(t),e.emitWarning(r,"ExperimentalWarning")}}:function(){}}).call(this,e("_process"))},{_process:23}],27:[function(e,t,n){(function(n){"use strict";var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=c;var i=e("./_stream_readable"),s=e("./_stream_writable");e("inherits")(c,i);for(var o=r(s.prototype),a=0;a0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=function(e){return a.from(e)}(t)),r)o.endEmitted?e.emit("error",new _):R(e,o,t,!0);else if(o.ended)e.emit("error",new b);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!n?(t=o.decoder.write(t),o.objectMode||0!==t.length?R(e,o,t,!1):P(e,o)):R(e,o,t,!1)}else r||(o.reading=!1,P(e,o));return!o.ended&&(o.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=k?e=k:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function M(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(I,e))}function I(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||e.emit("readable"),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,B(e)}function P(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(x,e,t))}function x(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function L(e){c("readable nexttick read 0"),e.read(0)}function D(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),B(e),t.flowing&&!t.reading&&e.read(0)}function B(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function N(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function U(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(j,t,e))}function j(e,t){c("endReadableNT",e.endEmitted,e.length),e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function F(e,t){for(var n=0,r=e.length;n=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):M(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&U(this),null;var r,i=t.needReadable;return c("need readable",i),(0===t.length||t.length-e0?N(e,t):null)?(t.needReadable=!0,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&U(this)),null!==r&&this.emit("data",r),r},C.prototype._read=function(e){this.emit("error",new w("_read()"))},C.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,t);var o=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?u:m;function a(t,n){c("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,c("cleanup"),e.removeListener("close",p),e.removeListener("finish",g),e.removeListener("drain",h),e.removeListener("error",f),e.removeListener("unpipe",a),r.removeListener("end",u),r.removeListener("end",m),r.removeListener("data",d),l=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||h())}function u(){c("onend"),e.end()}i.endEmitted?n.nextTick(o):r.once("end",o),e.on("unpipe",a);var h=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,B(e))}}(r);e.on("drain",h);var l=!1;function d(t){c("ondata");var n=e.write(t);c("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==F(i.pipes,e))&&!l&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function f(t){c("onerror",t),m(),e.removeListener("error",f),0===s(e,"error")&&e.emit("error",t)}function p(){e.removeListener("finish",g),m()}function g(){c("onfinish"),e.removeListener("close",p),m()}function m(){c("unpipe"),r.unpipe(e)}return r.on("data",d),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",f),e.once("close",p),e.once("finish",g),e.emit("pipe",r),i.flowing||(c("pipe resume"),r.resume()),e},C.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n),this);if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?M(this):i.reading||n.nextTick(L,this))),r},C.prototype.addListener=C.prototype.on,C.prototype.removeListener=function(e,t){var r=o.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(O,this),r},C.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(O,this),t},C.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(D,e,t))}(this,e)),e.paused=!1,this},C.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},C.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",function(){if(c("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){(c("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i)||(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var s=0;s-1))throw new v(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(C.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(C.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),C.prototype._write=function(e,t,n){n(new g("_write()"))},C.prototype._writev=null,C.prototype.end=function(e,t,r){var i=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,r){t.ending=!0,I(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(C.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(C.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),C.prototype.destroy=l.destroy,C.prototype._undestroy=l.undestroy,C.prototype._destroy=function(e,t){t(e)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":25,"./_stream_duplex":27,"./internal/streams/destroy":34,"./internal/streams/state":37,"./internal/streams/stream":38,_process:23,buffer:16,inherits:20,"util-deprecate":48}],32:[function(e,t,n){(function(n){"use strict";var r;function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=e("./end-of-stream"),o=Symbol("lastResolve"),a=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),h=Symbol("lastPromise"),l=Symbol("handlePromise"),d=Symbol("stream");function f(e,t){return{value:e,done:t}}function p(e){var t=e[o];if(null!==t){var n=e[d].read();null!==n&&(e[h]=null,e[o]=null,e[a]=null,t(f(n,!1)))}}function g(e){n.nextTick(p,e)}var m=Object.getPrototypeOf(function(){}),y=Object.setPrototypeOf((i(r={get stream(){return this[d]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(f(void 0,!0));if(this[d].destroyed)return new Promise(function(t,r){n.nextTick(function(){e[u]?r(e[u]):t(f(void 0,!0))})});var r,i=this[h];if(i)r=new Promise(function(e,t){return function(n,r){e.then(function(){t[c]?n(f(void 0,!0)):t[l](n,r)},r)}}(i,this));else{var s=this[d].read();if(null!==s)return Promise.resolve(f(s,!1));r=new Promise(this[l])}return this[h]=r,r}},Symbol.asyncIterator,function(){return this}),i(r,"return",function(){var e=this;return new Promise(function(t,n){e[d].destroy(null,function(e){e?n(e):t(f(void 0,!0))})})}),r),m);t.exports=function(e){var t,n=Object.create(y,(i(t={},d,{value:e,writable:!0}),i(t,o,{value:null,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,c,{value:e._readableState.endEmitted,writable:!0}),i(t,l,{value:function(e,t){var r=n[d].read();r?(n[h]=null,n[o]=null,n[a]=null,e(f(r,!1))):(n[o]=e,n[a]=t)},writable:!0}),t));return n[h]=null,s(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[a];return null!==t&&(n[h]=null,n[o]=null,n[a]=null,t(e)),void(n[u]=e)}var r=n[o];null!==r&&(n[h]=null,n[o]=null,n[a]=null,r(f(void 0,!0))),n[c]=!0}),e.on("readable",g.bind(null,n)),n}}).call(this,e("_process"))},{"./end-of-stream":35,_process:23}],33:[function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=e("buffer").Buffer,s=e("util").inspect,o=s&&s.custom||"inspect";t.exports=function(){function e(){this.head=null,this.tail=null,this.length=0}var t=e.prototype;return t.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},t.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},t.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},t.clear=function(){this.head=this.tail=null,this.length=0},t.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},t.concat=function(e){if(0===this.length)return i.alloc(0);for(var t,n,r,s=i.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,n=s,r=a,i.prototype.copy.call(t,n,r),a+=o.data.length,o=o.next;return s},t.consume=function(e,t){var n;return ei.length?i.length:e;if(s===i.length?r+=i:r+=i.slice(0,e),0===(e-=s)){s===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(s));break}++n}return this.length-=n,r},t._getBuffer=function(e){var t=i.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var s=n.data,o=e>s.length?s.length:e;if(s.copy(t,t.length-e,0,o),0===(e-=o)){o===s.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(o));break}++r}return this.length-=r,t},t[o]=function(e,t){return s(this,function(e){for(var t=1;t0,function(e){h||(h=e),e&&d.forEach(u),s||(d.forEach(u),l(h))})});return n.reduce(c)}},{"../../../errors":25,"./end-of-stream":35}],37:[function(e,t,n){"use strict";var r=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,n,i){var s=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,i,n);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new r(i?n:"highWaterMark",s);return Math.floor(s)}return e.objectMode?16:16384}}},{"../../../errors":25}],38:[function(e,t,n){t.exports=e("events").EventEmitter},{events:"events"}],39:[function(e,t,n){(n=t.exports=e("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js"),n.finished=e("./lib/internal/streams/end-of-stream.js"),n.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":27,"./lib/_stream_passthrough.js":28,"./lib/_stream_readable.js":29,"./lib/_stream_transform.js":30,"./lib/_stream_writable.js":31,"./lib/internal/streams/end-of-stream.js":35,"./lib/internal/streams/pipeline.js":36}],40:[function(e,t,n){(function(e){t.exports=function(t,n){var r,i,s,o=!0;Array.isArray(t)?(r=[],i=t.length):(s=Object.keys(t),r={},i=s.length);function a(t){function i(){n&&n(t,r),n=null}o?e.nextTick(i):i()}function u(e,t,n){r[e]=n,(0==--i||t)&&a(t)}i?s?s.forEach(function(e){t[e](function(t,n){u(e,t,n)})}):t.forEach(function(e,t){e(function(e,n){u(t,e,n)})}):a(null);o=!1}}).call(this,e("_process"))},{_process:23}],41:[function(e,t,n){var r=e("buffer"),i=r.Buffer;function s(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(s(r,n),n.Buffer=o),o.prototype=Object.create(i.prototype),s(i,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},{buffer:16}],42:[function(e,t,n){var r=e("safe-buffer").Buffer;function i(e,t){this._block=r.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=r.from(e,t));for(var n=this._block,i=this._blockSize,s=e.length,o=this._len,a=0;a=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,i=(n-r)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var s=this._hash();return e?s.toString(e):s},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},{"safe-buffer":41}],43:[function(e,t,n){var r=e("inherits"),i=e("./hash"),s=e("safe-buffer").Buffer,o=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function u(){this.init(),this._w=a,i.call(this,64,56)}function c(e){return e<<5|e>>>27}function h(e){return e<<30|e>>>2}function l(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}r(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,i=0|this._b,s=0|this._c,a=0|this._d,u=0|this._e,d=0;d<16;++d)n[d]=e.readInt32BE(4*d);for(;d<80;++d)n[d]=(t=n[d-3]^n[d-8]^n[d-14]^n[d-16])<<1|t>>>31;for(var f=0;f<80;++f){var p=~~(f/20),g=c(r)+l(p,i,s,a)+u+n[f]+o[p]|0;u=a,a=s,s=h(i),i=r,r=g}this._a=r+this._a|0,this._b=i+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=s.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=u},{"./hash":42,inherits:20,"safe-buffer":41}],44:[function(e,t,n){(function(n){t.exports=c;var r=e("debug")("simple-peer"),i=e("get-browser-rtc"),s=e("inherits"),o=e("randombytes"),a=e("readable-stream"),u=5e3;function c(e){var t=this;if(!(t instanceof c))return new c(e);if(t._id=o(4).toString("hex").slice(0,7),t._debug("new peer %o",e),e=Object.assign({allowHalfOpen:!1},e),a.Duplex.call(t,e),t.channelName=e.initiator?e.channelName||o(20).toString("hex"):null,t.initiator=e.initiator||!1,t.channelConfig=e.channelConfig||c.channelConfig,t.config=Object.assign({},c.config,e.config),t.offerOptions=e.offerOptions||{},t.answerOptions=e.answerOptions||{},t.sdpTransform=e.sdpTransform||function(e){return e},t.streams=e.streams||(e.stream?[e.stream]:[]),t.trickle=void 0===e.trickle||e.trickle,t.allowHalfTrickle=void 0!==e.allowHalfTrickle&&e.allowHalfTrickle,t.iceCompleteTimeout=e.iceCompleteTimeout||u,t.destroyed=!1,t._connected=!1,t.remoteAddress=void 0,t.remoteFamily=void 0,t.remotePort=void 0,t.localAddress=void 0,t.localFamily=void 0,t.localPort=void 0,t._wrtc=e.wrtc&&"object"==typeof e.wrtc?e.wrtc:i(),!t._wrtc)throw"undefined"==typeof window?l("No WebRTC support: Specify `opts.wrtc` option in this environment","ERR_WEBRTC_SUPPORT"):l("No WebRTC support: Not a supported browser","ERR_WEBRTC_SUPPORT");t._pcReady=!1,t._channelReady=!1,t._iceComplete=!1,t._iceCompleteTimer=null,t._channel=null,t._pendingCandidates=[],t._isNegotiating=!t.initiator,t._batchedNegotiation=!1,t._queuedNegotiation=!1,t._sendersAwaitingStable=[],t._senderMap=new Map,t._firstStable=!0,t._closingInterval=null,t._remoteTracks=[],t._remoteStreams=[],t._chunk=null,t._cb=null,t._interval=null;try{t._pc=new t._wrtc.RTCPeerConnection(t.config)}catch(e){return void setTimeout(()=>t.destroy(e),0)}t._isReactNativeWebrtc="number"==typeof t._pc._peerConnectionId,t._pc.oniceconnectionstatechange=function(){t._onIceStateChange()},t._pc.onicegatheringstatechange=function(){t._onIceStateChange()},t._pc.onsignalingstatechange=function(){t._onSignalingStateChange()},t._pc.onicecandidate=function(e){t._onIceCandidate(e)},t.initiator?t._setupData({channel:t._pc.createDataChannel(t.channelName,t.channelConfig)}):t._pc.ondatachannel=function(e){t._setupData(e)},t.streams&&t.streams.forEach(function(e){t.addStream(e)}),t._pc.ontrack=function(e){t._onTrack(e)},t.initiator&&t._needsNegotiation(),t._onFinishBound=function(){t._onFinish()},t.once("finish",t._onFinishBound)}function h(e){return e.replace(/a=ice-options:trickle\s\n/g,"")}function l(e,t){var n=new Error(e);return n.code=t,n}s(c,a.Duplex),c.WEBRTC_SUPPORT=!!i(),c.config={iceServers:[{urls:"stun:stun.l.google.com:19302"},{urls:"stun:global.stun.twilio.com:3478?transport=udp"}],sdpSemantics:"unified-plan"},c.channelConfig={},Object.defineProperty(c.prototype,"bufferSize",{get:function(){return this._channel&&this._channel.bufferedAmount||0}}),Object.defineProperty(c.prototype,"connected",{get:function(){return this._connected&&"open"===this._channel.readyState}}),c.prototype.address=function(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}},c.prototype.signal=function(e){var t=this;if(t.destroyed)throw l("cannot signal after peer is destroyed","ERR_SIGNALING");if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e={}}t._debug("signal()"),e.renegotiate&&t.initiator&&(t._debug("got request to renegotiate"),t._needsNegotiation()),e.transceiverRequest&&t.initiator&&(t._debug("got request for transceiver"),t.addTransceiver(e.transceiverRequest.kind,e.transceiverRequest.init)),e.candidate&&(t._pc.localDescription&&t._pc.localDescription.type&&t._pc.remoteDescription&&t._pc.remoteDescription.type?t._addIceCandidate(e.candidate):t._pendingCandidates.push(e.candidate)),e.sdp&&t._pc.setRemoteDescription(new t._wrtc.RTCSessionDescription(e)).then(function(){t.destroyed||(t._pendingCandidates.forEach(function(e){t._addIceCandidate(e)}),t._pendingCandidates=[],"offer"===t._pc.remoteDescription.type&&t._createAnswer())}).catch(function(e){t.destroy(l(e,"ERR_SET_REMOTE_DESCRIPTION"))}),e.sdp||e.candidate||e.renegotiate||e.transceiverRequest||t.destroy(l("signal() called with invalid signal data","ERR_SIGNALING"))},c.prototype._addIceCandidate=function(e){var t=this,n=new t._wrtc.RTCIceCandidate(e);t._pc.addIceCandidate(n).catch(function(e){var r;!n.address||n.address.endsWith(".local")?(r="Ignoring unsupported ICE candidate.",console.warn(r)):t.destroy(l(e,"ERR_ADD_ICE_CANDIDATE"))})},c.prototype.send=function(e){this._channel.send(e)},c.prototype.addTransceiver=function(e,t){if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(e,t),this._needsNegotiation()}catch(e){this.destroy(e)}else this.emit("signal",{transceiverRequest:{kind:e,init:t}})},c.prototype.addStream=function(e){var t=this;t._debug("addStream()"),e.getTracks().forEach(function(n){t.addTrack(n,e)})},c.prototype.addTrack=function(e,t){this._debug("addTrack()");var n=this._senderMap.get(e)||new Map,r=n.get(t);r?r.removed?this.destroy(l("Track has been removed. You should enable/disable tracks that you want to re-add.","ERR_SENDER_REMOVED")):this.destroy(l("Track has already been added to that stream.","ERR_SENDER_ALREADY_ADDED")):(r=this._pc.addTrack(e,t),n.set(t,r),this._senderMap.set(e,n),this._needsNegotiation())},c.prototype.replaceTrack=function(e,t,n){this._debug("replaceTrack()");var r=this._senderMap.get(e),i=r?r.get(n):null;i||this.destroy(l("Cannot replace track that was never added.","ERR_TRACK_NOT_ADDED")),t&&this._senderMap.set(t,r),null!=i.replaceTrack?i.replaceTrack(t):this.destroy(l("replaceTrack is not supported in this browser","ERR_UNSUPPORTED_REPLACETRACK"))},c.prototype.removeTrack=function(e,t){this._debug("removeSender()");var n=this._senderMap.get(e),r=n?n.get(t):null;r||this.destroy(l("Cannot remove track that was never added.","ERR_TRACK_NOT_ADDED"));try{r.removed=!0,this._pc.removeTrack(r)}catch(e){"NS_ERROR_UNEXPECTED"===e.name?this._sendersAwaitingStable.push(r):this.destroy(e)}this._needsNegotiation()},c.prototype.removeStream=function(e){var t=this;t._debug("removeSenders()"),e.getTracks().forEach(function(n){t.removeTrack(n,e)})},c.prototype._needsNegotiation=function(){var e=this;e._debug("_needsNegotiation"),e._batchedNegotiation||(e._batchedNegotiation=!0,setTimeout(function(){e._batchedNegotiation=!1,e._debug("starting batched negotiation"),e.negotiate()},0))},c.prototype.negotiate=function(){var e=this;e.initiator?e._isNegotiating?(e._queuedNegotiation=!0,e._debug("already negotiating, queueing")):(e._debug("start negotiation"),setTimeout(()=>{e._createOffer()},0)):e._isNegotiating||(e._debug("requesting negotiation from initiator"),e.emit("signal",{renegotiate:!0})),e._isNegotiating=!0},c.prototype.destroy=function(e){this._destroy(e,function(){})},c.prototype._destroy=function(e,t){if(!this.destroyed){if(this._debug("destroy (error: %s)",e&&(e.message||e)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this.destroyed=!0,this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&&this.removeListener("finish",this._onFinishBound),this._onFinishBound=null,this._channel){try{this._channel.close()}catch(e){}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch(e){}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,e&&this.emit("error",e),this.emit("close"),t()}},c.prototype._setupData=function(e){var t=this;if(!e.channel)return t.destroy(l("Data channel event is missing `channel` property","ERR_DATA_CHANNEL"));t._channel=e.channel,t._channel.binaryType="arraybuffer","number"==typeof t._channel.bufferedAmountLowThreshold&&(t._channel.bufferedAmountLowThreshold=65536),t.channelName=t._channel.label,t._channel.onmessage=function(e){t._onChannelMessage(e)},t._channel.onbufferedamountlow=function(){t._onChannelBufferedAmountLow()},t._channel.onopen=function(){t._onChannelOpen()},t._channel.onclose=function(){t._onChannelClose()},t._channel.onerror=function(e){t.destroy(l(e,"ERR_DATA_CHANNEL"))};var n=!1;t._closingInterval=setInterval(function(){t._channel&&"closing"===t._channel.readyState?(n&&t._onChannelClose(),n=!0):n=!1},5e3)},c.prototype._read=function(){},c.prototype._write=function(e,t,n){if(this.destroyed)return n(l("cannot write after peer is destroyed","ERR_DATA_CHANNEL"));if(this._connected){try{this.send(e)}catch(e){return this.destroy(l(e,"ERR_DATA_CHANNEL"))}this._channel.bufferedAmount>65536?(this._debug("start backpressure: bufferedAmount %d",this._channel.bufferedAmount),this._cb=n):n(null)}else this._debug("write before connect"),this._chunk=e,this._cb=n},c.prototype._onFinish=function(){var e=this;function t(){setTimeout(function(){e.destroy()},1e3)}e.destroyed||(e._connected?t():e.once("connect",t))},c.prototype._startIceCompleteTimeout=function(){var e=this;e.destroyed||e._iceCompleteTimer||(e._debug("started iceComplete timeout"),e._iceCompleteTimer=setTimeout(function(){e._iceComplete||(e._iceComplete=!0,e._debug("iceComplete timeout completed"),e.emit("iceTimeout"),e.emit("_iceComplete"))},e.iceCompleteTimeout))},c.prototype._createOffer=function(){var e=this;e.destroyed||e._pc.createOffer(e.offerOptions).then(function(t){function n(){if(!e.destroyed){var n=e._pc.localDescription||t;e._debug("signal"),e.emit("signal",{type:n.type,sdp:n.sdp})}}e.destroyed||(e.trickle||e.allowHalfTrickle||(t.sdp=h(t.sdp)),t.sdp=e.sdpTransform(t.sdp),e._pc.setLocalDescription(t).then(function(){if(e._debug("createOffer success"),e.destroyed)return;e.trickle||e._iceComplete?n():e.once("_iceComplete",n)}).catch(function(t){e.destroy(l(t,"ERR_SET_LOCAL_DESCRIPTION"))}))}).catch(function(t){e.destroy(l(t,"ERR_CREATE_OFFER"))})},c.prototype._requestMissingTransceivers=function(){var e=this;e._pc.getTransceivers&&e._pc.getTransceivers().forEach(t=>{t.mid||!t.sender.track||t.requested||(t.requested=!0,e.addTransceiver(t.sender.track.kind))})},c.prototype._createAnswer=function(){var e=this;e.destroyed||e._pc.createAnswer(e.answerOptions).then(function(t){function n(){if(!e.destroyed){var n=e._pc.localDescription||t;e._debug("signal"),e.emit("signal",{type:n.type,sdp:n.sdp}),e.initiator||e._requestMissingTransceivers()}}e.destroyed||(e.trickle||e.allowHalfTrickle||(t.sdp=h(t.sdp)),t.sdp=e.sdpTransform(t.sdp),e._pc.setLocalDescription(t).then(function(){if(e.destroyed)return;e.trickle||e._iceComplete?n():e.once("_iceComplete",n)}).catch(function(t){e.destroy(l(t,"ERR_SET_LOCAL_DESCRIPTION"))}))}).catch(function(t){e.destroy(l(t,"ERR_CREATE_ANSWER"))})},c.prototype._onIceStateChange=function(){if(!this.destroyed){var e=this._pc.iceConnectionState,t=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",e,t),this.emit("iceStateChange",e,t),"connected"!==e&&"completed"!==e||(this._pcReady=!0,this._maybeReady()),"failed"===e&&this.destroy(l("Ice connection failed.","ERR_ICE_CONNECTION_FAILURE")),"closed"===e&&this.destroy(l("Ice connection closed.","ERR_ICE_CONNECTION_CLOSED"))}},c.prototype.getStats=function(e){var t=this;function n(e){return"[object Array]"===Object.prototype.toString.call(e.values)&&e.values.forEach(function(t){Object.assign(e,t)}),e}0===t._pc.getStats.length?t._pc.getStats().then(function(t){var r=[];t.forEach(function(e){r.push(n(e))}),e(null,r)},function(t){e(t)}):t._isReactNativeWebrtc?t._pc.getStats(null,function(t){var r=[];t.forEach(function(e){r.push(n(e))}),e(null,r)},function(t){e(t)}):t._pc.getStats.length>0?t._pc.getStats(function(r){if(!t.destroyed){var i=[];r.result().forEach(function(e){var t={};e.names().forEach(function(n){t[n]=e.stat(n)}),t.id=e.id,t.type=e.type,t.timestamp=e.timestamp,i.push(n(t))}),e(null,i)}},function(t){e(t)}):e(null,[])},c.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady),!e._connected&&!e._connecting&&e._pcReady&&e._channelReady&&(e._connecting=!0,function t(){e.destroyed||e.getStats(function(n,r){if(!e.destroyed){n&&(r=[]);var i={},s={},o={},a=!1;if(r.forEach(function(e){"remotecandidate"!==e.type&&"remote-candidate"!==e.type||(i[e.id]=e),"localcandidate"!==e.type&&"local-candidate"!==e.type||(s[e.id]=e),"candidatepair"!==e.type&&"candidate-pair"!==e.type||(o[e.id]=e)}),r.forEach(function(e){"transport"===e.type&&e.selectedCandidatePairId&&c(o[e.selectedCandidatePairId]),("googCandidatePair"===e.type&&"true"===e.googActiveConnection||("candidatepair"===e.type||"candidate-pair"===e.type)&&e.selected)&&c(e)}),a||Object.keys(o).length&&!Object.keys(s).length){if(e._connecting=!1,e._connected=!0,e._chunk){try{e.send(e._chunk)}catch(n){return e.destroy(l(n,"ERR_DATA_CHANNEL"))}e._chunk=null,e._debug('sent chunk from "write before connect"');var u=e._cb;e._cb=null,u(null)}"number"!=typeof e._channel.bufferedAmountLowThreshold&&(e._interval=setInterval(function(){e._onInterval()},150),e._interval.unref&&e._interval.unref()),e._debug("connect"),e.emit("connect")}else setTimeout(t,100)}function c(t){a=!0;var n=s[t.localCandidateId];n&&(n.ip||n.address)?(e.localAddress=n.ip||n.address,e.localPort=Number(n.port)):n&&n.ipAddress?(e.localAddress=n.ipAddress,e.localPort=Number(n.portNumber)):"string"==typeof t.googLocalAddress&&(n=t.googLocalAddress.split(":"),e.localAddress=n[0],e.localPort=Number(n[1])),e.localAddress&&(e.localFamily=e.localAddress.includes(":")?"IPv6":"IPv4");var r=i[t.remoteCandidateId];r&&(r.ip||r.address)?(e.remoteAddress=r.ip||r.address,e.remotePort=Number(r.port)):r&&r.ipAddress?(e.remoteAddress=r.ipAddress,e.remotePort=Number(r.portNumber)):"string"==typeof t.googRemoteAddress&&(r=t.googRemoteAddress.split(":"),e.remoteAddress=r[0],e.remotePort=Number(r[1])),e.remoteAddress&&(e.remoteFamily=e.remoteAddress.includes(":")?"IPv6":"IPv4"),e._debug("connect local: %s:%s remote: %s:%s",e.localAddress,e.localPort,e.remoteAddress,e.remotePort)}})}())},c.prototype._onInterval=function(){!this._cb||!this._channel||this._channel.bufferedAmount>65536||this._onChannelBufferedAmountLow()},c.prototype._onSignalingStateChange=function(){var e=this;e.destroyed||("stable"!==e._pc.signalingState||e._firstStable||(e._isNegotiating=!1,e._debug("flushing sender queue",e._sendersAwaitingStable),e._sendersAwaitingStable.forEach(function(t){e._pc.removeTrack(t),e._queuedNegotiation=!0}),e._sendersAwaitingStable=[],e._queuedNegotiation&&(e._debug("flushing negotiation queue"),e._queuedNegotiation=!1,e._needsNegotiation()),e._debug("negotiate"),e.emit("negotiate")),e._firstStable=!1,e._debug("signalingStateChange %s",e._pc.signalingState),e.emit("signalingStateChange",e._pc.signalingState))},c.prototype._onIceCandidate=function(e){this.destroyed||(e.candidate&&this.trickle?this.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}}):e.candidate||this._iceComplete||(this._iceComplete=!0,this.emit("_iceComplete")),e.candidate&&this._startIceCompleteTimeout())},c.prototype._onChannelMessage=function(e){if(!this.destroyed){var t=e.data;t instanceof ArrayBuffer&&(t=n.from(t)),this.push(t)}},c.prototype._onChannelBufferedAmountLow=function(){if(!this.destroyed&&this._cb){this._debug("ending backpressure: bufferedAmount %d",this._channel.bufferedAmount);var e=this._cb;this._cb=null,e(null)}},c.prototype._onChannelOpen=function(){this._connected||this.destroyed||(this._debug("on channel open"),this._channelReady=!0,this._maybeReady())},c.prototype._onChannelClose=function(){this.destroyed||(this._debug("on channel close"),this.destroy())},c.prototype._onTrack=function(e){var t=this;t.destroyed||e.streams.forEach(function(n){t._debug("on track"),t.emit("track",e.track,n),t._remoteTracks.push({track:e.track,stream:n}),t._remoteStreams.some(function(e){return e.id===n.id})||(t._remoteStreams.push(n),setTimeout(function(){t.emit("stream",n)},0))})},c.prototype._debug=function(){var e=this,t=[].slice.call(arguments);t[0]="["+e._id+"] "+t[0],r.apply(null,t)}}).call(this,e("buffer").Buffer)},{buffer:16,debug:"debug","get-browser-rtc":18,inherits:20,randombytes:24,"readable-stream":39}],45:[function(e,t,n){(function(n,r){const i=e("debug")("simple-websocket"),s=e("randombytes"),o=e("readable-stream"),a=e("ws"),u="function"!=typeof a?WebSocket:a,c=65536;class h extends o.Duplex{constructor(e={}){if("string"==typeof e&&(e={url:e}),super(e=Object.assign({allowHalfOpen:!1},e)),null==e.url&&null==e.socket)throw new Error("Missing required `url` or `socket` option");if(null!=e.url&&null!=e.socket)throw new Error("Must specify either `url` or `socket` option, not both");if(this._id=s(4).toString("hex").slice(0,7),this._debug("new websocket: %o",e),this.connected=!1,this.destroyed=!1,this._chunk=null,this._cb=null,this._interval=null,e.socket)this.url=e.socket.url,this._ws=e.socket,this.connected=e.socket.readyState===u.OPEN;else{this.url=e.url;try{this._ws="function"==typeof a?new u(e.url,e):new u(e.url)}catch(e){return void n.nextTick(()=>this.destroy(e))}}this._ws.binaryType="arraybuffer",this._ws.onopen=()=>{this._onOpen()},this._ws.onmessage=e=>{this._onMessage(e)},this._ws.onclose=()=>{this._onClose()},this._ws.onerror=()=>{this.destroy(new Error("connection error to "+this.url))},this._onFinishBound=()=>{this._onFinish()},this.once("finish",this._onFinishBound)}send(e){this._ws.send(e)}destroy(e){this._destroy(e,()=>{})}_destroy(e,t){if(!this.destroyed){if(this._debug("destroy (error: %s)",e&&(e.message||e)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this.connected=!1,this.destroyed=!0,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&&this.removeListener("finish",this._onFinishBound),this._onFinishBound=null,this._ws){const t=this._ws,n=()=>{t.onclose=null};if(t.readyState===u.CLOSED)n();else try{t.onclose=n,t.close()}catch(e){n()}t.onopen=null,t.onmessage=null,t.onerror=()=>{}}if(this._ws=null,e){if("undefined"!=typeof DOMException&&e instanceof DOMException){const t=e.code;(e=new Error(e.message)).code=t}this.emit("error",e)}this.emit("close"),t()}}_read(){}_write(e,t,n){if(this.destroyed)return n(new Error("cannot write after socket is destroyed"));if(this.connected){try{this.send(e)}catch(e){return this.destroy(e)}"function"!=typeof a&&this._ws.bufferedAmount>c?(this._debug("start backpressure: bufferedAmount %d",this._ws.bufferedAmount),this._cb=n):n(null)}else this._debug("write before connect"),this._chunk=e,this._cb=n}_onFinish(){if(this.destroyed)return;const e=()=>{setTimeout(()=>this.destroy(),1e3)};this.connected?e():this.once("connect",e)}_onMessage(e){if(this.destroyed)return;let t=e.data;t instanceof ArrayBuffer&&(t=r.from(t)),this.push(t)}_onOpen(){if(!this.connected&&!this.destroyed){if(this.connected=!0,this._chunk){try{this.send(this._chunk)}catch(e){return this.destroy(e)}this._chunk=null,this._debug('sent chunk from "write before connect"');const e=this._cb;this._cb=null,e(null)}"function"!=typeof a&&(this._interval=setInterval(()=>this._onInterval(),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")}}_onInterval(){if(!this._cb||!this._ws||this._ws.bufferedAmount>c)return;this._debug("ending backpressure: bufferedAmount %d",this._ws.bufferedAmount);const e=this._cb;this._cb=null,e(null)}_onClose(){this.destroyed||(this._debug("on close"),this.destroy())}_debug(){const e=[].slice.call(arguments);e[0]="["+this._id+"] "+e[0],i.apply(null,e)}}h.WEBSOCKET_SUPPORT=!!u,t.exports=h}).call(this,e("_process"),e("buffer").Buffer)},{_process:23,buffer:16,debug:"debug",randombytes:24,"readable-stream":39,ws:15}],46:[function(e,t,n){"use strict";var r=e("safe-buffer").Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=h,this.end=l,t=3;break;default:return this.write=d,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function h(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}n.StringDecoder=s,s.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0)return i>0&&(e.lastNeed=i-1),i;if(--r=0)return i>0&&(e.lastNeed=i-2),i;if(--r=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":41}],47:[function(e,t,n){"use strict";t.exports=function(e,t,n){return 0===e.length?e:t?(n||e.sort(t),function(e,t){for(var n=1,r=e.length,i=e[0],s=e[0],o=1;o{"%%"!==e&&(r++,"%c"===e&&(i=r))}),e.splice(i,0,n)},n.save=function(e){try{e?n.storage.setItem("debug",e):n.storage.removeItem("debug")}catch(e){}},n.load=function(){let e;try{e=n.storage.getItem("debug")}catch(e){}!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG);return e},n.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},n.storage=function(){try{return localStorage}catch(e){}}(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.exports=e("./common")(n);const{formatters:i}=t.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,e("_process"))},{"./common":17,_process:23}],events:[function(e,t,n){var r=Object.create||function(e){var t=function(){};return t.prototype=e,new t},i=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return n},s=Function.prototype.bind||function(e){var t=this;return function(){return t.apply(e,arguments)}};function o(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=r(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}t.exports=o,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._maxListeners=void 0;var a,u=10;try{var c={};Object.defineProperty&&Object.defineProperty(c,"x",{value:0}),a=0===c.x}catch(e){a=!1}function h(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function l(e,t,n){if(t)e.call(n);else for(var r=e.length,i=v(e,r),s=0;s0&&a.length>s){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",u.name,u.message)}}else a=o[t]=n,++e._eventsCount;return e}function y(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t1&&(t=arguments[1]),t instanceof Error)throw t;var u=new Error('Unhandled "error" event. ('+t+")");throw u.context=t,u}if(!(n=o[e]))return!1;var c="function"==typeof n;switch(r=arguments.length){case 1:l(n,c,this);break;case 2:d(n,c,this,arguments[1]);break;case 3:f(n,c,this,arguments[1],arguments[2]);break;case 4:p(n,c,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),s=1;s=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,s=o;break}if(s<0)return this;0===s?n.shift():function(e,t){for(var n=t,r=n+1,i=e.length;r=0;s--)this.removeListener(e,t[s]);return this},o.prototype.listeners=function(e){return w(this,e,!0)},o.prototype.rawListeners=function(e){return w(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):_.call(e,t)},o.prototype.listenerCount=_,o.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],"p2p-media-loader-core":[function(e,t,n){"use strict";function r(e){for(var t in e)n.hasOwnProperty(t)||(n[t]=e[t])}Object.defineProperty(n,"__esModule",{value:!0}),n.version="0.6.2",r(e("./loader-interface")),r(e("./hybrid-loader"))},{"./hybrid-loader":4,"./loader-interface":5}]},{},[2]); diff --git a/resources/assets/player/js/p2p-media-loader-hlsjs.min.js b/resources/assets/player/js/p2p-media-loader-hlsjs.min.js new file mode 100644 index 0000000..10be8a9 --- /dev/null +++ b/resources/assets/player/js/p2p-media-loader-hlsjs.min.js @@ -0,0 +1,28 @@ +require=function t(e,r,n){function i(a,o){if(!r[a]){if(!e[a]){var u="function"==typeof require&&require;if(!o&&u)return u(a,!0);if(s)return s(a,!0);var f=new Error("Cannot find module '"+a+"'");throw f.code="MODULE_NOT_FOUND",f}var l=r[a]={exports:{}};e[a][0].call(l.exports,(function(t){return i(e[a][1][t]||t)}),l,l.exports,t,e,r,n)}return r[a].exports}for(var s="function"==typeof require&&require,a=0;ai.Events[t])).forEach((t=>this.loader.on(t,((...e)=>this.emit(t,...e)))))}static isSupported(){return i.HybridLoader.isSupported()}createLoaderClass(){return o.createHlsJsLoaderClass(a.HlsJsLoader,this)}async destroy(){await this.segmentManager.destroy()}getSettings(){return{segments:this.segmentManager.getSettings(),loader:this.loader.getSettings()}}getDetails(){return{loader:this.loader.getDetails()}}setPlayingSegment(t,e,r,n){this.segmentManager.setPlayingSegment(t,e,r,n)}setPlayingSegmentByCurrentTime(t){this.segmentManager.setPlayingSegmentByCurrentTime(t)}}r.Engine=u},{"./hlsjs-loader":4,"./hlsjs-loader-class":3,"./segment-manager":5,events:"events","p2p-media-loader-core":"p2p-media-loader-core"}],3:[function(t,e,r){e.exports.createHlsJsLoaderClass=function(t,e){function r(){this.impl=new t(e.segmentManager),this.stats=this.impl.stats}return r.prototype.load=function(t,e,r){this.context=t,this.impl.load(t,e,r)},r.prototype.abort=function(){this.impl.abort(this.context)},r.prototype.destroy=function(){this.context&&this.impl.abort(this.context)},r.getEngine=function(){return e},r}},{}],4:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.HlsJsLoader=void 0;r.HlsJsLoader=class{constructor(t){this.stats={},this.segmentManager=t}async load(t,e,r){if(t.type)try{const e=await this.segmentManager.loadPlaylist(t.url);this.successPlaylist(e,t,r)}catch(e){this.error(e,t,r)}else if(t.frag)try{const e=await this.segmentManager.loadSegment(t.url,null==t.rangeStart||null==t.rangeEnd?void 0:{offset:t.rangeStart,length:t.rangeEnd-t.rangeStart});void 0!==e.content&&setTimeout((()=>this.successSegment(e.content,e.downloadBandwidth,t,r)),0)}catch(e){setTimeout((()=>this.error(e,t,r)),0)}else console.warn("Unknown load request",t)}abort(t){this.segmentManager.abortSegment(t.url,null==t.rangeStart||null==t.rangeEnd?void 0:{offset:t.rangeStart,length:t.rangeEnd-t.rangeStart})}successPlaylist(t,e,r){const n=performance.now();this.stats.trequest=n-300,this.stats.tfirst=n-200,this.stats.tload=n,this.stats.loaded=t.response.length,r.onSuccess({url:t.responseURL,data:t.response},this.stats,e)}successSegment(t,e,r,n){const i=performance.now(),s=t.byteLength/(void 0===e||e<=0?12500:e);this.stats.trequest=i-1-s,this.stats.tfirst=i-s,this.stats.tload=i,this.stats.loaded=t.byteLength,n.onSuccess({url:r.url,data:t},this.stats,r)}error(t,e,r){r.onError(t,e)}}},{}],5:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.SegmentManager=void 0;const n=t("p2p-media-loader-core"),i=t("m3u8-parser"),s={forwardSegmentCount:20,swarmId:void 0,assetsStorage:void 0};r.SegmentManager=class{constructor(t,e={}){this.masterPlaylist=null,this.variantPlaylists=new Map,this.segmentRequest=null,this.playQueue=[],this.onSegmentLoaded=t=>{this.segmentRequest&&this.segmentRequest.segmentUrl===t.url&&f(this.segmentRequest.segmentByterange)===t.range&&(this.segmentRequest.onSuccess(t.data.slice(0),t.downloadBandwidth),this.segmentRequest=null)},this.onSegmentError=(t,e)=>{this.segmentRequest&&this.segmentRequest.segmentUrl===t.url&&f(this.segmentRequest.segmentByterange)===t.range&&(this.segmentRequest.onError(e),this.segmentRequest=null)},this.onSegmentAbort=t=>{this.segmentRequest&&this.segmentRequest.segmentUrl===t.url&&f(this.segmentRequest.segmentByterange)===t.range&&(this.segmentRequest.onError("Loading aborted: internal abort"),this.segmentRequest=null)},this.settings=Object.assign(Object.assign({},s),e),this.loader=t,this.loader.on(n.Events.SegmentLoaded,this.onSegmentLoaded),this.loader.on(n.Events.SegmentError,this.onSegmentError),this.loader.on(n.Events.SegmentAbort,this.onSegmentAbort)}getSettings(){return this.settings}processPlaylist(t,e,r){const n=new i.Parser;n.push(e),n.end();const s=new a(t,r,n.manifest);if(s.manifest.playlists){this.masterPlaylist=s;for(const[t,e]of this.variantPlaylists){const{streamSwarmId:r,found:n,index:i}=this.getStreamSwarmId(e.requestUrl);n?(e.streamSwarmId=r,e.streamId="V"+i.toString()):this.variantPlaylists.delete(t)}}else{const{streamSwarmId:e,found:r,index:n}=this.getStreamSwarmId(t);(r||null===this.masterPlaylist)&&(s.streamSwarmId=e,s.streamId=null===this.masterPlaylist?void 0:"V"+n.toString(),this.variantPlaylists.set(t,s),this.updateSegments())}}async loadPlaylist(t){const e=this.settings.assetsStorage;let r;if(void 0!==e){let n;n=this.getMasterSwarmId(),void 0===n&&(n=t.split("?")[0]);const i=await e.getAsset(t,void 0,n);void 0!==i?r={responseURL:i.responseUri,response:i.data}:(r=await this.loadContent(t,"text"),e.storeAsset({masterManifestUri:null!==this.masterPlaylist?this.masterPlaylist.requestUrl:t,masterSwarmId:n,requestUri:t,responseUri:r.responseURL,data:r.response}))}else r=await this.loadContent(t,"text");return this.processPlaylist(t,r.response,r.responseURL),r}async loadSegment(t,e){const r=this.getSegmentLocation(t,e),n=f(e);if(!r){let e;const r=this.settings.assetsStorage;if(void 0!==r){let i,s=null!==this.masterPlaylist?this.masterPlaylist.requestUrl:void 0;if(i=this.getMasterSwarmId(),void 0===i&&1===this.variantPlaylists.size&&(i=this.variantPlaylists.values().next().value.requestUrl.split("?")[0]),void 0===s&&1===this.variantPlaylists.size&&(s=this.variantPlaylists.values().next().value.requestUrl),void 0!==i&&void 0!==s){const a=await r.getAsset(t,n,i);if(void 0!==a)e=a.data;else{const a=await this.loadContent(t,"arraybuffer",n);e=a.response,r.storeAsset({masterManifestUri:s,masterSwarmId:i,requestUri:t,requestRange:n,responseUri:a.responseURL,data:e})}}}if(void 0===e){e=(await this.loadContent(t,"arraybuffer",n)).response}return{content:e,downloadBandwidth:0}}const i=(r.playlist.manifest.mediaSequence?r.playlist.manifest.mediaSequence:0)+r.segmentIndex;if(this.playQueue.length>0){this.playQueue[this.playQueue.length-1].segmentSequence!==i-1&&(this.playQueue=[])}this.segmentRequest&&this.segmentRequest.onError("Cancel segment request: simultaneous segment requests are not supported");const s=new Promise(((n,s)=>{this.segmentRequest=new o(t,e,i,r.playlist.requestUrl,((t,e)=>n({content:t,downloadBandwidth:e})),(t=>s(t)))}));return this.playQueue.push({segmentUrl:t,segmentByterange:e,segmentSequence:i}),this.loadSegments(r.playlist,r.segmentIndex,!0),s}setPlayingSegment(t,e,r,n){const i=this.playQueue.findIndex((r=>r.segmentUrl==t&&u(r.segmentByterange,e)));i>=0&&(this.playQueue=this.playQueue.slice(i),this.playQueue[0].playPosition={start:r,duration:n},this.updateSegments())}setPlayingSegmentByCurrentTime(t){if(0===this.playQueue.length||!this.playQueue[0].playPosition)return;const e=this.playQueue[0].playPosition;e.start+e.duration-t<.2&&(this.playQueue=this.playQueue.slice(1),this.updateSegments())}abortSegment(t,e){this.segmentRequest&&this.segmentRequest.segmentUrl===t&&u(this.segmentRequest.segmentByterange,e)&&(this.segmentRequest.onSuccess(void 0,0),this.segmentRequest=null)}async destroy(){this.segmentRequest&&(this.segmentRequest.onError("Loading aborted: object destroyed"),this.segmentRequest=null),this.masterPlaylist=null,this.variantPlaylists.clear(),this.playQueue=[],void 0!==this.settings.assetsStorage&&await this.settings.assetsStorage.destroy(),await this.loader.destroy()}updateSegments(){if(!this.segmentRequest)return;const t=this.getSegmentLocation(this.segmentRequest.segmentUrl,this.segmentRequest.segmentByterange);t&&this.loadSegments(t.playlist,t.segmentIndex,!1)}getSegmentLocation(t,e){for(const r of this.variantPlaylists.values()){const n=r.getSegmentIndex(t,e);if(n>=0)return{playlist:r,segmentIndex:n}}}async loadSegments(t,e,r){const n=[],i=t.manifest.segments,s=t.manifest.mediaSequence?t.manifest.mediaSequence:0;let a=null,o=Math.max(0,this.playQueue.length-1);const u=this.getMasterSwarmId();for(let l=e;l{const s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType=e,r&&s.setRequestHeader("Range",r),s.addEventListener("readystatechange",(()=>{4===s.readyState&&(s.status>=200&&s.status<300?n(s):i(s.statusText))}));const a=this.loader.getSettings().xhrSetup;a&&a(s,t),s.send()}))}};class a{constructor(t,e,r){this.requestUrl=t,this.responseUrl=e,this.manifest=r,this.streamSwarmId=""}getSegmentIndex(t,e){for(let r=0;r-1},e.trigger=function(t){var e=this.listeners[t];if(e)if(2===arguments.length)for(var r=e.length,n=0;n0?a-4:a;for(r=0;r>16&255,u[l++]=e>>8&255,u[l++]=255&e;2===o&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[l++]=255&e);1===o&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e);return u},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,s=[],a=16383,o=0,u=r-i;ou?u:o+a));1===i?(e=t[r-1],s.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],s.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return s.join("")};for(var n=[],i=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,u=a.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t,e,r){for(var i,s,a=[],o=e;o>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],13:[function(t,e,r){(function(e){(function(){ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +"use strict";var e=t("base64-js"),n=t("ieee754");r.Buffer=a,r.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},r.INSPECT_MAX_BYTES=50;var i=2147483647;function s(t){if(t>i)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=a.prototype,e}function a(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return o(t,e,r)}function o(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|g(t,e),n=s(r),i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return l(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(X(t,ArrayBuffer)||t&&X(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function g(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||X(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return j(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return D(t).length;default:if(i)return n?-1:j(t).length;e=(""+e).toLowerCase(),i=!0}}function c(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return P(this,e,r);case"utf8":case"utf-8":return T(this,e,r);case"ascii":return R(this,e,r);case"latin1":case"binary":return U(this,e,r);case"base64":return I(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function d(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function p(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),k(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:y(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,n,i){var s,a=1,o=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,o/=2,u/=2,r/=2}function f(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var l=-1;for(s=r;so&&(r=o-u),s=r;s>=0;s--){for(var h=!0,g=0;gi&&(n=i):n=i;var s=e.length;n>s/2&&(n=s/2);for(var a=0;a>8,i=r%256,s.push(i),s.push(n);return s}(e,t.length-r),t,r,n)}function I(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function T(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:f>223?3:f>191?2:1;if(i+h<=r)switch(h){case 1:f<128&&(l=f);break;case 2:128==(192&(s=t[i+1]))&&(u=(31&f)<<6|63&s)>127&&(l=u);break;case 3:s=t[i+1],a=t[i+2],128==(192&s)&&128==(192&a)&&(u=(15&f)<<12|(63&s)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:s=t[i+1],a=t[i+2],o=t[i+3],128==(192&s)&&128==(192&a)&&128==(192&o)&&(u=(15&f)<<18|(63&s)<<12|(63&a)<<6|63&o)>65535&&u<1114112&&(l=u)}null===l?(l=65533,h=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=h}return function(t){var e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);var r="",n=0;for(;ne&&(t+=" ... "),""},a.prototype.compare=function(t,e,r,n,i){if(X(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var s=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(e>>>=0),u=Math.min(s,o),f=this.slice(n,i),l=t.slice(e,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return b(this,t,e,r);case"ascii":return v(this,t,e,r);case"latin1":case"binary":return w(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function R(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",s=e;sr)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,r,n,i,s){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function x(t,e,r,n,i,s){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(t,e,r,i,s){return e=+e,r>>>=0,s||x(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function L(t,e,r,i,s){return e=+e,r>>>=0,s||x(t,0,r,8),n.write(t,e,r,i,52,8),r+8}a.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||O(t,e,this.length);for(var n=this[t],i=1,s=0;++s>>=0,e>>>=0,r||O(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);for(var n=this[t],i=1,s=0;++s=(i*=128)&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);for(var n=e,i=1,s=this[t+--n];n>0&&(i*=256);)s+=this[t+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*e)),s},a.prototype.readInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||O(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||O(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return t>>>=0,e||O(t,4,this.length),n.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||O(t,4,this.length),n.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||O(t,8,this.length),n.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||O(t,8,this.length),n.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||M(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,s=0;for(this[e]=255&t;++s>>=0,r>>>=0,n)||M(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,s=1;for(this[e+i]=255&t;--i>=0&&(s*=256);)this[e+i]=t/s&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(this,t,e,r,i-1,-i)}var s=0,a=1,o=0;for(this[e]=255&t;++s>0)-o&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(this,t,e,r,i-1,-i)}var s=r-1,a=1,o=0;for(this[e+s]=255&t;--s>=0&&(a*=256);)t<0&&0===o&&0!==this[e+s+1]&&(o=1),this[e+s]=(t/a>>0)-o&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeFloatLE=function(t,e,r){return B(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return B(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return L(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return L(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(!a.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--s)t[s+e]=this[s+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},a.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=e;s55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function D(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function N(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function X(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function k(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":12,buffer:13,ieee754:15}],14:[function(t,e,r){(function(t){(function(){var r;r="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},e.exports=r}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],15:[function(t,e,r){ +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ +r.read=function(t,e,r,n,i){var s,a,o=8*i-n-1,u=(1<>1,l=-7,h=r?i-1:0,g=r?-1:1,c=t[e+h];for(h+=g,s=c&(1<<-l)-1,c>>=-l,l+=o;l>0;s=256*s+t[e+h],h+=g,l-=8);for(a=s&(1<<-l)-1,s>>=-l,l+=n;l>0;a=256*a+t[e+h],h+=g,l-=8);if(0===s)s=1-f;else{if(s===u)return a?NaN:1/0*(c?-1:1);a+=Math.pow(2,n),s-=f}return(c?-1:1)*a*Math.pow(2,s-n)},r.write=function(t,e,r,n,i,s){var a,o,u,f=8*s-i-1,l=(1<>1,g=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,c=n?0:s-1,d=n?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?g/u:g*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(o=0,a=l):a+h>=1?(o=(e*u-1)*Math.pow(2,i),a+=h):(o=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+c]=255&o,c+=d,o/=256,i-=8);for(a=a<0;t[r+c]=255&a,c+=d,a/=256,f-=8);t[r+c-d]|=128*p}},{}],16:[function(t,e,r){ +/*! @name m3u8-parser @version 4.5.2 @license Apache-2.0 */ +"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@babel/runtime/helpers/inheritsLoose"),i=t("@videojs/vhs-utils/cjs/stream.js"),s=t("@babel/runtime/helpers/extends"),a=t("@babel/runtime/helpers/assertThisInitialized"),o=t("@videojs/vhs-utils/cjs/decode-b64-to-uint8-array.js");function u(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var f=u(n),l=u(i),h=u(s),g=u(a),c=u(o),d=function(t){function e(){var e;return(e=t.call(this)||this).buffer="",e}return f.default(e,t),e.prototype.push=function(t){var e;for(this.buffer+=t,e=this.buffer.indexOf("\n");e>-1;e=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,e)),this.buffer=this.buffer.substring(e+1)},e}(l.default),p=function(t){for(var e,r=t.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),n={},i=r.length;i--;)""!==r[i]&&((e=/([^=]*)=(.*)/.exec(r[i]).slice(1))[0]=e[0].replace(/^\s+|\s+$/g,""),e[1]=e[1].replace(/^\s+|\s+$/g,""),e[1]=e[1].replace(/^['"](.*)['"]$/g,"$1"),n[e[0]]=e[1]);return n},y=function(t){function e(){var e;return(e=t.call(this)||this).customParsers=[],e.tagMappers=[],e}f.default(e,t);var r=e.prototype;return r.push=function(t){var e,r,n=this;0!==(t=t.trim()).length&&("#"===t[0]?this.tagMappers.reduce((function(e,r){var n=r(t);return n===t?e:e.concat([n])}),[t]).forEach((function(t){for(var i=0;i0&&(a.duration=t.duration),0===t.duration&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=s},key:function(){if(t.attributes)if("NONE"!==t.attributes.METHOD)if(t.attributes.URI){if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===t.attributes.KEYFORMAT){return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(t.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===t.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==t.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):t.attributes.KEYID&&"0x"===t.attributes.KEYID.substring(0,2)?void(this.manifest.contentProtection={"com.widevine.alpha":{attributes:{schemeIdUri:t.attributes.KEYFORMAT,keyId:t.attributes.KEYID.substring(2)},pssh:c.default(t.attributes.URI.split(",")[1])}}):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}))}t.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),n={method:t.attributes.METHOD||"AES-128",uri:t.attributes.URI},void 0!==t.attributes.IV&&(n.iv=t.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else n=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(t.number)?this.manifest.mediaSequence=t.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+t.number})},"discontinuity-sequence":function(){isFinite(t.number)?(this.manifest.discontinuitySequence=t.number,f=t.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+t.number})},"playlist-type":function(){/VOD|EVENT/.test(t.playlistType)?this.manifest.playlistType=t.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+t.playlist})},map:function(){r={},t.uri&&(r.uri=t.uri),t.byterange&&(r.byterange=t.byterange)},"stream-inf":function(){this.manifest.playlists=s,this.manifest.mediaGroups=this.manifest.mediaGroups||u,t.attributes?(a.attributes||(a.attributes={}),h.default(a.attributes,t.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||u,t.attributes&&t.attributes.TYPE&&t.attributes["GROUP-ID"]&&t.attributes.NAME){var r=this.manifest.mediaGroups[t.attributes.TYPE];r[t.attributes["GROUP-ID"]]=r[t.attributes["GROUP-ID"]]||{},e=r[t.attributes["GROUP-ID"]],(g={default:/yes/i.test(t.attributes.DEFAULT)}).default?g.autoselect=!0:g.autoselect=/yes/i.test(t.attributes.AUTOSELECT),t.attributes.LANGUAGE&&(g.language=t.attributes.LANGUAGE),t.attributes.URI&&(g.uri=t.attributes.URI),t.attributes["INSTREAM-ID"]&&(g.instreamId=t.attributes["INSTREAM-ID"]),t.attributes.CHARACTERISTICS&&(g.characteristics=t.attributes.CHARACTERISTICS),t.attributes.FORCED&&(g.forced=/yes/i.test(t.attributes.FORCED)),e[t.attributes.NAME]=g}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){f+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(s.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=t.dateTimeString,this.manifest.dateTimeObject=t.dateTimeObject),a.dateTimeString=t.dateTimeString,a.dateTimeObject=t.dateTimeObject},targetduration:function(){!isFinite(t.duration)||t.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+t.duration}):this.manifest.targetDuration=t.duration},totalduration:function(){!isFinite(t.duration)||t.duration<0?this.trigger("warn",{message:"ignoring invalid total duration: "+t.duration}):this.manifest.totalDuration=t.duration},start:function(){t.attributes&&!isNaN(t.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:t.attributes["TIME-OFFSET"],precise:t.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){a.cueOut=t.data},"cue-out-cont":function(){a.cueOutCont=t.data},"cue-in":function(){a.cueIn=t.data}}[t.tagType]||o).call(i)},uri:function(){a.uri=t.uri,s.push(a),this.manifest.targetDuration&&!("duration"in a)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),a.duration=this.manifest.targetDuration),n&&(a.key=n),a.timeline=f,r&&(a.map=r),a={}},comment:function(){},custom:function(){t.segment?(a.custom=a.custom||{},a.custom[t.customType]=t.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[t.customType]=t.data)}})[t.type].call(i)})),e}f.default(e,t);var r=e.prototype;return r.push=function(t){this.lineStream.push(t)},r.end=function(){this.lineStream.push("\n")},r.addParser=function(t){this.parseStream.addParser(t)},r.addTagMapper=function(t){this.parseStream.addTagMapper(t)},e}(l.default);r.LineStream=d,r.ParseStream=y,r.Parser=m},{"@babel/runtime/helpers/assertThisInitialized":6,"@babel/runtime/helpers/extends":7,"@babel/runtime/helpers/inheritsLoose":8,"@videojs/vhs-utils/cjs/decode-b64-to-uint8-array.js":10,"@videojs/vhs-utils/cjs/stream.js":11}],"p2p-media-loader-hlsjs":[function(t,e,r){"use strict"; +/** + * @license Apache-2.0 + * Copyright 2018 Novage LLC. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};function s(t){t&&t.config&&t.config.loader&&"function"==typeof t.config.loader.getEngine&&a(t,t.config.loader.getEngine())}function a(t,e){t.on("hlsFragChanged",((t,r)=>{const n=r.frag,i=2!==n.byteRange.length?void 0:{offset:n.byteRange[0],length:n.byteRange[1]-n.byteRange[0]};e.setPlayingSegment(n.url,i,n.start,n.duration)})),t.on("hlsDestroying",(async()=>{await e.destroy()})),t.on("hlsError",((r,n)=>{if("bufferStalledError"===n.details){const r=void 0===t.media?t.el_:t.media;if(void 0===r)return;e.setPlayingSegmentByCurrentTime(r.currentTime)}}))}Object.defineProperty(r,"__esModule",{value:!0}),r.initJwPlayer=r.initMediaElementJsPlayer=r.initVideoJsHlsJsPlugin=r.initVideoJsContribHlsJsPlayer=r.initFlowplayerHlsJsPlayer=r.initClapprPlayer=r.initHlsJsPlayer=r.version=void 0,r.version="0.6.2",i(t("./engine"),r),i(t("./segment-manager"),r),r.initHlsJsPlayer=s,r.initClapprPlayer=function(t){t.on("play",(()=>{const e=t.core.getCurrentPlayback();e._hls&&!e._hls._p2pm_linitialized&&(e._hls._p2pm_linitialized=!0,s(t.core.getCurrentPlayback()._hls))}))},r.initFlowplayerHlsJsPlayer=function(t){t.on("ready",(()=>s(t.engine.hlsjs?t.engine.hlsjs:t.engine.hls)))},r.initVideoJsContribHlsJsPlayer=function(t){t.ready((()=>{const e=t.tech_.options_;e&&e.hlsjsConfig&&e.hlsjsConfig.loader&&"function"==typeof e.hlsjsConfig.loader.getEngine&&a(t.tech_,e.hlsjsConfig.loader.getEngine())}))},r.initVideoJsHlsJsPlugin=function(){null!=videojs&&null!=videojs.Html5Hlsjs&&videojs.Html5Hlsjs.addHook("beforeinitialize",((t,e)=>{e.config&&e.config.loader&&"function"==typeof e.config.loader.getEngine&&a(e,e.config.loader.getEngine())}))},r.initMediaElementJsPlayer=function(t){t.addEventListener("hlsFragChanged",(e=>{const r=t.hlsPlayer;if(r&&r.config&&r.config.loader&&"function"==typeof r.config.loader.getEngine){const t=r.config.loader.getEngine();if(e.data&&e.data.length>1){const r=e.data[1].frag,n=2!==r.byteRange.length?void 0:{offset:r.byteRange[0],length:r.byteRange[1]-r.byteRange[0]};t.setPlayingSegment(r.url,n,r.start,r.duration)}}})),t.addEventListener("hlsDestroying",(async()=>{const e=t.hlsPlayer;if(e&&e.config&&e.config.loader&&"function"==typeof e.config.loader.getEngine){const t=e.config.loader.getEngine();await t.destroy()}})),t.addEventListener("hlsError",(e=>{const r=t.hlsPlayer;if(r&&r.config&&r.config.loader&&"function"==typeof r.config.loader.getEngine&&void 0!==e.data&&"bufferStalledError"===e.data.details){r.config.loader.getEngine().setPlayingSegmentByCurrentTime(r.media.currentTime)}}))},r.initJwPlayer=function(t,e){const r=setInterval((()=>{t.hls&&t.hls.config&&(clearInterval(r),Object.assign(t.hls.config,e),s(t.hls))}),200)}},{"./engine":2,"./segment-manager":5}]},{},[1]); diff --git a/resources/views/ripple/catalog.blade.php b/resources/views/ripple/catalog.blade.php new file mode 100755 index 0000000..f3b8f12 --- /dev/null +++ b/resources/views/ripple/catalog.blade.php @@ -0,0 +1,125 @@ +@extends('themes::ripple.layout') + +@php +$years = Cache::remember('all_years', \Backpack\Settings\app\Models\Setting::get('site_cache_ttl', 5 * 60), function () { + return \VsMov\Core\Models\Movie::select('publish_year') + ->distinct() + ->pluck('publish_year') + ->sortDesc(); +}); +@endphp + +@section('content') + +
+
+ + + + + + + +
+
+ +
+

+ {{ $section_name ?? 'Danh Sách Phim' }} +

+
+ @if (count($data)) + @php + $key_section = 0; + @endphp +
+ @foreach ($data ?? [] as $key => $movie) + @include('themes::ripple.inc.movie_card') + @endforeach +
+ @else +
+

Rất tiếc, không có nội dung nào trùng khớp yêu cầu.

+
+ @endif + + {{ $data->appends(request()->all())->links("themes::ripple.inc.pagination") }} +@endsection diff --git a/resources/views/ripple/episode.blade.php b/resources/views/ripple/episode.blade.php new file mode 100755 index 0000000..7a8fed9 --- /dev/null +++ b/resources/views/ripple/episode.blade.php @@ -0,0 +1,549 @@ +@extends('themes::ripple.layout') + +@section('content') + + +
+
+
+ +
+
+ +
+

+ + Xem phim + {{ $currentMovie->name }} - Tập {{ $episode->name }} + +

+ +

+ {{ $currentMovie->origin_name ?? '' }} + ({{ $currentMovie->publish_year ?? 'Đang cập nhật...' }}) +

+ +
+ @if ($currentMovie->content) +
{!! $currentMovie->content !!}
+ @else +

Đang cập nhật ...

+ @endif +
+
+
+ + @if ($currentMovie->showtimes && $currentMovie->showtimes != '') +
+ + + + Lịch chiếu: {!! $currentMovie->showtimes !!} +
+ @endif + @if ($currentMovie->notify && $currentMovie->notify != '') +
+ + + + Thông báo: {{ strip_tags($currentMovie->notify) }} +
+ @endif + +
+
+
+ +
+
Mẹo: Chọn Server hoặc Nguồn phát khác khi lỗi!
+
+ +
+
+ +
+ @foreach ($currentMovie->episodes->where('slug', $episode->slug)->where('server', $episode->server) as $server) + Nguồn + phát #{{ $loop->index }} + + @endforeach +
+
+
+
+ ({{ $currentMovie->getRatingStar() }} + sao + / + {{ $currentMovie->getRatingCount() }} đánh giá) +
+
+
+ + @foreach ($currentMovie->episodes->groupBy('server') as $server => $data) +
+

+ +

+
+
+ @foreach ($data->sortBy('name', SORT_NATURAL)->groupBy('name') as $name => $item) + + {{ $name }} + + @endforeach +
+
+
+ @endforeach + +
{!! $currentMovie->tags->map(function ($tag) { + return '' . + $tag->name . + ''; + })->implode(', ') !!}
+ +
+
+
+
+ + +
+

+ Có thể bản muốn xem +

+
+ @php + $key_section = 0; + @endphp + @foreach ($movie_related ?? [] as $key => $movie) + @include('themes::ripple.inc.movie_card') + @endforeach +
+
+@endsection + +@section('footer') + @parent + + + + + + + + + {{-- Star Rating Plugins --}} + + + + + + + + + + +@endsection + +@push('scripts') + {!! setting('site_scripts_facebook_sdk') !!} +@endpush diff --git a/resources/views/ripple/inc/movie_card.blade.php b/resources/views/ripple/inc/movie_card.blade.php new file mode 100755 index 0000000..137b783 --- /dev/null +++ b/resources/views/ripple/inc/movie_card.blade.php @@ -0,0 +1,49 @@ + + {{ $movie->name ?? '' }} + + +
{{ $movie->name ?? '' }} +
+
+ {{ $movie->origin_name }} ({{ $movie->publish_year }}) +
+
+ @if ($movie->type == 'series' && $movie->status == 'ongoing') + {{ $movie->episode_current }} + Đang chiếu + @elseif ($movie->type == 'series' && $movie->status == 'completed') +
Trọn Bộ
+ @endif + @if ($movie->status == 'trailer') +
Sắp chiếu
+ @endif + @if ($movie->is_recommended) +
+ + + + + Phim hot +
+ @endif + + +
diff --git a/resources/views/ripple/inc/movie_card_recommend.blade.php b/resources/views/ripple/inc/movie_card_recommend.blade.php new file mode 100755 index 0000000..f973fe0 --- /dev/null +++ b/resources/views/ripple/inc/movie_card_recommend.blade.php @@ -0,0 +1,25 @@ + + {{ $movie->name ?? '' }} + + +
{{ $movie->name ?? '' }} +
+
+ {{ $movie->origin_name }} ({{ $movie->publish_year }}) +
+
+ {{ $movie->episode_current }} + @if ($movie->status == 'ongoing') + Đang chiếu + @endif + +
diff --git a/resources/views/ripple/inc/nav.blade.php b/resources/views/ripple/inc/nav.blade.php new file mode 100755 index 0000000..c2f69e5 --- /dev/null +++ b/resources/views/ripple/inc/nav.blade.php @@ -0,0 +1,84 @@ +@php +$logo = setting('site_logo', ''); +$brand = setting('site_brand', ''); +$title = isset($title) ? $title : setting('site_homepage_title', ''); +@endphp + + diff --git a/resources/views/ripple/inc/pagination.blade.php b/resources/views/ripple/inc/pagination.blade.php new file mode 100644 index 0000000..74e12f7 --- /dev/null +++ b/resources/views/ripple/inc/pagination.blade.php @@ -0,0 +1,107 @@ +@if ($paginator->hasPages()) + +@endif diff --git a/resources/views/ripple/index.blade.php b/resources/views/ripple/index.blade.php new file mode 100755 index 0000000..ae2648e --- /dev/null +++ b/resources/views/ripple/index.blade.php @@ -0,0 +1,119 @@ +@extends('themes::ripple.layout') + +@php +use VsMov\Core\Models\Movie; + +$recommendations = Cache::remember('site.movies.recommendations', setting('site_cache_ttl', 5 * 60), function () { + return Movie::where('is_recommended', true) + ->limit(get_theme_option('recommendations_limit', 10)) + ->get() + ->sortBy([ + function ($a, $b) { + return $a['name'] <=> $b['name']; + }, + ]); +}); + +$data = Cache::remember('site.movies.latest', setting('site_cache_ttl', 5 * 60), function () { + $lists = preg_split('/[\n\r]+/', get_theme_option('latest')); + $data = []; + foreach ($lists as $list) { + if (trim($list)) { + $list = explode('|', $list); + [$label, $relation, $field, $val, $limit, $link] = array_merge($list, ['Phim mới cập nhật', '', 'type', 'series', 8, '/']); + try { + $data[] = [ + 'label' => $label, + 'data' => Movie::when($relation, function ($query) use ($relation, $field, $val) { + $query->whereHas($relation, function ($rel) use ($field, $val) { + $rel->where($field, $val); + }); + }) + ->when(!$relation, function ($query) use ($field, $val) { + $query->where($field, $val); + }) + ->limit($limit) + ->orderBy('updated_at', 'desc') + ->get(), + 'link' => $link ?: '#', + ]; + } catch (\Exception $e) { + } + } + } + return $data; +}); + +@endphp + +@section('content') + @if (count($recommendations)) + + @endif +

{{ $title }}

+ @foreach ($data as $key_section => $item) +
+
+

+ {{ $item['label'] }} +

+ Xem + Thêm + +
+
+ @foreach ($item['data'] ?? [] as $key => $movie) + @include('themes::ripple.inc.movie_card') + @endforeach +
+
+ @endforeach +@endsection + +@push("header") + +@endpush + +@push('scripts') + + +@endpush + diff --git a/resources/views/ripple/layout.blade.php b/resources/views/ripple/layout.blade.php new file mode 100755 index 0000000..afae18e --- /dev/null +++ b/resources/views/ripple/layout.blade.php @@ -0,0 +1,120 @@ +@extends('themes::layout') +@php +$menu = \VsMov\Core\Models\Menu::getTree(); +$tops = Cache::remember('site.movies.tops', setting('site_cache_ttl', 5 * 60), function () { + $lists = preg_split('/[\n\r]+/', get_theme_option('hotest')); + $data = []; + foreach ($lists as $list) { + if (trim($list)) { + $list = explode('|', $list); + [$label, $relation, $field, $val, $sortKey, $alg, $limit] = array_merge($list, ['Phim hot', '', 'type', 'series', 'view_total', 'desc', 4]); + try { + $data[] = [ + 'label' => $label, + 'data' => \VsMov\Core\Models\Movie::when($relation, function ($query) use ($relation, $field, $val) { + $query->whereHas($relation, function ($rel) use ($field, $val) { + $rel->where($field, $val); + }); + }) + ->when(!$relation, function ($query) use ($field, $val) { + $query->where($field, $val); + }) + ->orderBy($sortKey, $alg) + ->limit($limit) + ->get(), + ]; + } catch (\Exception $e) { + # code + } + } + } + + return $data; +}); +@endphp + +@push('header') + +@endpush + +@section('body') + {{-- --}} + @include('themes::ripple.inc.nav') +
+
+
+ @if (get_theme_option('ads_header')) + {!! get_theme_option('ads_header') !!} + @endif +
+
+
+
+ @yield('content') +
+
+
+ @foreach ($tops as $top) +
+
+
+

{{ $top['label'] }}

+
+
+ +
+ @endforeach +
+
+
+
+@endsection + +@section('footer') +
+
+ {!! get_theme_option('footer') !!} +
+
+
+
+ {!! get_theme_option('ads_catfish') !!} +
+
+ + + + + {!! setting('site_scripts_google_analytics') !!} +@endsection diff --git a/resources/views/ripple/single.blade.php b/resources/views/ripple/single.blade.php new file mode 100755 index 0000000..c8a92cb --- /dev/null +++ b/resources/views/ripple/single.blade.php @@ -0,0 +1,298 @@ +@extends('themes::ripple.layout') + +@section('content') + + + @if ($currentMovie->showtimes && $currentMovie->showtimes != '') +
+ + + + Lịch chiếu: {!! $currentMovie->showtimes !!} +
+ @endif + @if ($currentMovie->notify && $currentMovie->notify != '') +
+ + + + Thông báo: {{ strip_tags($currentMovie->notify) }} +
+ @endif +
+
+
+ {{ $currentMovie->name }} - {{ $currentMovie->origin_name }} ({{ $currentMovie->publish_year }}) + @if ($currentMovie->is_copyright) +
bản quyền
+ @endif +
+
+ @if ($currentMovie->trailer_url) + + @endif + @if ($currentMovie->status != 'trailer' && count($currentMovie->episodes) && $currentMovie->episodes[0]['link'] != '') + + + + + Xem phim + + @else +
Đang cập nhật...
+ @endif +
+
+
+
+ + @if ($currentMovie->trailer_url) + + + @endif + +
+
+

+ + {{ $currentMovie->name }} + +

+

+ {{ $currentMovie->origin_name ?? '' }} + ({{ $currentMovie->publish_year ?? 'Đang cập nhật...' }}) +

+
+
+

+ @foreach ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10] as $star) + @if ($currentMovie->getRatingStar() >= $star) + + @else + + @endif + @endforeach +

+

+ ({{ $currentMovie->getRatingStar() }} + sao + / + {{ $currentMovie->getRatingCount() }} đánh giá)

+
+
+
+ +
+
+
Trạng thái:
+
{{ $currentMovie->getStatus() }} +
+
+
Thể loại:
+
+ {!! $currentMovie->categories->map(function ($category) { + return '' . + $category->name . + ''; + })->implode(', ') !!} +

+
Quốc gia:
+
+ {!! $currentMovie->regions->map(function ($region) { + return '' . + $region->name . + ''; + })->implode(', ') !!} +
+
+
Năm:
+
+ {{ $currentMovie->publish_year ?? 'Đang cập nhật...' }} +

+
Đạo diễn:
+
+ {!! $currentMovie->directors->map(function ($director) { + return '' . + $director->name . + ''; + })->implode(', ') !!} +

+
Diễn viên:
+
+ {!! $currentMovie->actors->map(function ($actor) { + return '' . + $actor->name . + ''; + })->implode(', ') !!} +

+
Thời lượng:
+
{{ $currentMovie->episode_time ?? 'Đang cập nhật...' }} +

+
Chất lượng:
+
{{ $currentMovie->quality ?? 'Đang cập nhật...' }}
+
+
Ngôn ngữ:
+
{{ $currentMovie->language ?? 'Đang cập nhật...' }}
+
+
Lượt xem:
+
+ {{ number_format($currentMovie->view_total ?? 0) }} lượt
+
+
+ +
+
+ +
+

Nội dung phim

+
+ @if ($currentMovie->content) +
{!! $currentMovie->content !!}
+ @else +

Đang cập nhật ...

+ @endif +
+ +
+ {!! $currentMovie->tags->map(function ($tag) { + return '' . + $tag->name . + ''; + })->implode(', ') !!} + +
+ +
+
+
+
+ + +
+

+ Có thể bản muốn xem +

+
+ @php + $key_section = 0; + @endphp + @foreach ($movie_related ?? [] as $key => $movie) + @include('themes::ripple.inc.movie_card') + @endforeach +
+
+@endsection + +@push('scripts') + {!! setting('site_scripts_facebook_sdk') !!} +@endpush diff --git a/routes/web.php b/routes/web.php new file mode 100755 index 0000000..a6bebf0 --- /dev/null +++ b/routes/web.php @@ -0,0 +1,57 @@ + array_merge( + (array) config('backpack.base.web_middleware', 'web'), + ), +], function () { + Route::get('/', [RippleController::class, 'index']); + + Route::get(setting('site_routes_category', '/the-loai/{category}'), [RippleController::class, 'getMovieOfCategory']) + ->where(['category' => '.+', 'id' => '[0-9]+']) + ->name('categories.movies.index'); + + Route::get(setting('site_routes_region', '/quoc-gia/{region}'), [RippleController::class, 'getMovieOfRegion']) + ->where(['region' => '.+', 'id' => '[0-9]+']) + ->name('regions.movies.index'); + + Route::get(setting('site_routes_tag', '/tu-khoa/{tag}'), [RippleController::class, 'getMovieOfTag']) + ->where(['tag' => '.+', 'id' => '[0-9]+']) + ->name('tags.movies.index'); + + Route::get(setting('site_routes_types', '/danh-sach/{type}'), [RippleController::class, 'getMovieOfType']) + ->where(['type' => '.+', 'id' => '[0-9]+']) + ->name('types.movies.index'); + + Route::get(setting('site_routes_actors', '/dien-vien/{actor}'), [RippleController::class, 'getMovieOfActor']) + ->where(['actor' => '.+', 'id' => '[0-9]+']) + ->name('actors.movies.index'); + + Route::get(setting('site_routes_directors', '/dao-dien/{director}'), [RippleController::class, 'getMovieOfDirector']) + ->where(['director' => '.+', 'id' => '[0-9]+']) + ->name('directors.movies.index'); + + Route::get(setting('site_routes_episode', '/phim/{movie}/{episode}-{id}'), [RippleController::class, 'getEpisode']) + ->where(['movie' => '.+', 'movie_id' => '[0-9]+', 'episode' => '.+', 'id' => '[0-9]+']) + ->name('episodes.show'); + + Route::post(setting('site_routes_episode', '/phim/{movie}/{episode}-{id}'), [RippleController::class, 'reportEpisode']) + ->where(['movie' => '.+', 'movie_id' => '[0-9]+', 'episode' => '.+', 'id' => '[0-9]+']) + ->name('episodes.report'); + + Route::post(sprintf('/%s/{movie}/{episode}/rate', config('vsmov.routes.movie', 'phim')), [RippleController::class, 'rateMovie']) + ->name('movie.rating'); + + Route::get(setting('site_routes_movie', '/phim/{movie}'), [RippleController::class, 'getMovieOverview']) + ->where(['movie' => '.+', 'id' => '[0-9]+']) + ->name('movies.show'); +}); diff --git a/src/Controllers/RippleController.php b/src/Controllers/RippleController.php new file mode 100755 index 0000000..ca13f68 --- /dev/null +++ b/src/Controllers/RippleController.php @@ -0,0 +1,288 @@ +whereHas('categories', function ($categories) { + $categories->where('id', request('filter')['category']); + }); + })->when(!empty($request['filter']['region']), function ($movie) { + $movie->whereHas('regions', function ($regions) { + $regions->where('id', request('filter')['region']); + }); + })->when(!empty($request['filter']['year']), function ($movie) { + $movie->where('publish_year', request('filter')['year']); + })->when(!empty($request['filter']['type']), function ($movie) { + $movie->where('type', request('filter')['type']); + })->when(!empty($request['search']), function ($query) { + $query->where(function ($query) { + $query->where('name', 'like', '%' . request('search') . '%') + ->orWhere('origin_name', 'like', '%' . request('search') . '%'); + })->orderBy('name', 'desc'); + })->when(!empty($request['filter']['sort']), function ($movie) { + if (request('filter')['sort'] == 'create') { + return $movie->orderBy('created_at', 'desc'); + } + if (request('filter')['sort'] == 'update') { + return $movie->orderBy('updated_at', 'desc'); + } + if (request('filter')['sort'] == 'year') { + return $movie->orderBy('publish_year', 'desc'); + } + if (request('filter')['sort'] == 'view') { + return $movie->orderBy('view_total', 'desc'); + } + })->paginate(); + + return view('themes::ripple.catalog', [ + 'data' => $data, + 'search' => $request['search'], + 'section_name' => "Tìm kiếm phim: $request->search" + ]); + } + return view('themes::ripple.index', [ + 'title' => Setting::get('site_homepage_title') + ]); + } + + public function getMovieOverview(Request $request) + { + /** @var Movie */ + $movie = Movie::fromCache()->find($request->movie ?: $request->id); + + if (is_null($movie)) abort(404); + + $movie->generateSeoTags(); + + $movie->increment('view_total', 1); + $movie->increment('view_day', 1); + $movie->increment('view_week', 1); + $movie->increment('view_month', 1); + + $movie_related_cache_key = 'movie_related:' . $movie->id; + $movie_related = Cache::get($movie_related_cache_key); + if(is_null($movie_related)) { + $movie_related = $movie->categories[0]->movies()->inRandomOrder()->limit(get_theme_option('movie_related_limit', 10))->get(); + Cache::put($movie_related_cache_key, $movie_related, setting('site_cache_ttl', 5 * 60)); + } + + return view('themes::ripple.single', [ + 'currentMovie' => $movie, + 'title' => $movie->getTitle(), + 'movie_related' => $movie_related + ]); + } + + public function getEpisode(Request $request) + { + $movie = Movie::fromCache()->find($request->movie ?: $request->movie_id)->load('episodes'); + + if (is_null($movie)) abort(404); + + /** @var Episode */ + $episode_id = $request->id; + $episode = $movie->episodes->when($episode_id, function ($collection, $episode_id) { + return $collection->where('id', $episode_id); + })->firstWhere('slug', $request->episode); + + if (is_null($episode)) abort(404); + + $episode->generateSeoTags(); + + $movie->increment('view_total', 1); + $movie->increment('view_day', 1); + $movie->increment('view_week', 1); + $movie->increment('view_month', 1); + + $movie_related_cache_key = 'movie_related:' . $movie->id; + $movie_related = Cache::get($movie_related_cache_key); + if(is_null($movie_related)) { + $movie_related = $movie->categories[0]->movies()->inRandomOrder()->limit(get_theme_option('movie_related_limit', 10))->get(); + Cache::put($movie_related_cache_key, $movie_related, setting('site_cache_ttl', 5 * 60)); + } + + return view('themes::ripple.episode', [ + 'currentMovie' => $movie, + 'movie_related' => $movie_related, + 'episode' => $episode, + 'title' => $episode->getTitle() + ]); + } + + public function reportEpisode(Request $request, $movie, $slug, $id) + { + $movie = Movie::fromCache()->find($movie)->load('episodes'); + + $episode = $movie->episodes->when($id, function ($collection, $id) { + return $collection->where('id', $id); + })->firstWhere('slug', $slug); + + $episode->update([ + 'report_message' => request('message', ''), + 'has_report' => true + ]); + + return response([], 204); + } + + public function rateMovie(Request $request, $movie, $slug) + { + $movie = Movie::fromCache()->find($movie)->load('episodes'); + + $movie->refresh()->increment('rating_count', 1, [ + 'rating_star' => $movie->rating_star + ((int) request('rating') - $movie->rating_star) / ($movie->rating_count + 1) + ]); + + return response([], 204); + } + + public function getMovieOfCategory(Request $request) + { + /** @var Category */ + $category = Category::fromCache()->find($request->category ?: $request->id); + + if (is_null($category)) abort(404); + + $category->generateSeoTags(); + + $movies = $category->movies()->orderBy('created_at', 'desc')->paginate(get_theme_option('per_page_limit')); + + return view('themes::ripple.catalog', [ + 'data' => $movies, + 'category' => $category, + 'title' => $category->seo_title ?: $category->getTitle(), + 'section_name' => "Phim thể loại $category->name" + ]); + } + + public function getMovieOfRegion(Request $request) + { + /** @var Region */ + $region = Region::fromCache()->find($request->region ?: $request->id); + + if (is_null($region)) abort(404); + + $region->generateSeoTags(); + + $movies = $region->movies()->orderBy('created_at', 'desc')->paginate(get_theme_option('per_page_limit')); + + return view('themes::ripple.catalog', [ + 'data' => $movies, + 'region' => $region, + 'title' => $region->seo_title ?: $region->getTitle(), + 'section_name' => "Phim quốc gia $region->name" + ]); + } + + public function getMovieOfActor(Request $request) + { + /** @var Actor */ + $actor = Actor::fromCache()->find($request->actor ?: $request->id); + + if (is_null($actor)) abort(404); + + $actor->generateSeoTags(); + + $movies = $actor->movies()->orderBy('created_at', 'desc')->paginate(get_theme_option('per_page_limit')); + + return view('themes::ripple.catalog', [ + 'data' => $movies, + 'person' => $actor, + 'title' => $actor->getTitle(), + 'section_name' => "Diễn viên $actor->name" + ]); + } + + public function getMovieOfDirector(Request $request) + { + /** @var Director */ + $director = Director::fromCache()->find($request->director ?: $request->id); + + if (is_null($director)) abort(404); + + $director->generateSeoTags(); + + $movies = $director->movies()->orderBy('created_at', 'desc')->paginate(get_theme_option('per_page_limit')); + + return view('themes::ripple.catalog', [ + 'data' => $movies, + 'person' => $director, + 'title' => $director->getTitle(), + 'section_name' => "Đạo diễn $director->name" + ]); + } + + public function getMovieOfTag(Request $request) + { + /** @var Tag */ + $tag = Tag::fromCache()->find($request->tag ?: $request->id); + + if (is_null($tag)) abort(404); + + $tag->generateSeoTags(); + + $movies = $tag->movies()->orderBy('created_at', 'desc')->paginate(get_theme_option('per_page_limit')); + return view('themes::ripple.catalog', [ + 'data' => $movies, + 'tag' => $tag, + 'title' => $tag->getTitle(), + 'section_name' => "Tags: $tag->name" + ]); + } + + public function getMovieOfType(Request $request) + { + /** @var Catalog */ + $catalog = Catalog::fromCache()->find($request->type ?: $request->id); + + if (is_null($catalog)) abort(404); + + $catalog->generateSeoTags(); + + $cache_key = 'catalog:' . $catalog->id . ':page:' . ($request['page'] ?: 1); + $movies = Cache::get($cache_key); + if(is_null($movies)) { + $value = explode('|', trim($catalog->value)); + [$relation_config, $field, $val, $sortKey, $alg] = array_merge($value, ['', 'is_copyright', 0, 'created_at', 'desc']); + $relation_config = explode(',', $relation_config); + + [$relation_table, $relation_field, $relation_val] = array_merge($relation_config, ['', '', '']); + try { + $movies = \VsMov\Core\Models\Movie::when($relation_table, function ($query) use ($relation_table, $relation_field, $relation_val, $field, $val) { + $query->whereHas($relation_table, function ($rel) use ($relation_field, $relation_val, $field, $val) { + $rel->where($relation_field, $relation_val)->where(array_combine(explode(",", $field), explode(",", $val))); + }); + })->when(!$relation_table, function ($query) use ($field, $val) { + $query->where(array_combine(explode(",", $field), explode(",", $val))); + }) + ->orderBy($sortKey, $alg) + ->paginate($catalog->paginate); + + Cache::put($cache_key, $movies, setting('site_cache_ttl', 5 * 60)); + } catch (\Exception $e) {} + } + + return view('themes::ripple.catalog', [ + 'data' => $movies, + 'section_name' => "Danh sách $catalog->name" + ]); + } +} diff --git a/src/RippleServiceProvider.php b/src/RippleServiceProvider.php new file mode 100755 index 0000000..a8e2aa7 --- /dev/null +++ b/src/RippleServiceProvider.php @@ -0,0 +1,168 @@ +setupDefaultThemeCustomizer(); + } + + public function boot() + { + $this->loadViewsFrom(__DIR__ . '/../resources/views/', 'themes'); + + $this->publishes([ + __DIR__ . '/../resources/assets' => public_path('themes/ripple') + ], 'ripple-assets'); + } + + protected function setupDefaultThemeCustomizer() + { + config(['themes' => array_merge(config('themes', []), [ + 'ripple' => [ + 'name' => 'Ripple', + 'author' => 'vsmov.dev@gmail.com', + 'package_name' => 'vsmov/vsmov-ripple', + 'publishes' => ['ripple-assets'], + 'preview_image' => '', + 'options' => [ + [ + 'name' => 'recommendations_limit', + 'label' => 'Recommended movies limit', + 'type' => 'number', + 'value' => 10, + 'wrapperAttributes' => [ + 'class' => 'form-group col-md-4', + ], + 'tab' => 'List' + ], + [ + 'name' => 'per_page_limit', + 'label' => 'Pages limit', + 'type' => 'number', + 'value' => 20, + 'wrapperAttributes' => [ + 'class' => 'form-group col-md-4', + ], + 'tab' => 'List' + ], + [ + 'name' => 'movie_related_limit', + 'label' => 'Movies related limit', + 'type' => 'number', + 'value' => 10, + 'wrapperAttributes' => [ + 'class' => 'form-group col-md-4', + ], + 'tab' => 'List' + ], + [ + 'name' => 'latest', + 'label' => 'Danh sách mới cập nhật', + 'type' => 'code', + 'hint' => 'display_label|relation|find_by_field|value|limit|show_more_url', + 'value' => "Phim chiếu rạp||is_shown_in_theater|1|10|/danh-sach/phim-chieu-rap\r\nPhim bộ mới||type|series|10|/danh-sach/phim-bo\r\nPhim lẻ mới||type|single|10|/danh-sach/phim-le", + 'attributes' => [ + 'rows' => 5 + ], + 'tab' => 'List' + ], + [ + 'name' => 'hotest', + 'label' => 'Danh sách hot', + 'type' => 'code', + 'hint' => 'Label|relation|find_by_field|value|sort_by_field|sort_algo|limit', + 'value' => "Top sắp chiếu||status|trailer|publish_year|desc|4\r\nTop phim bộ||type|series|view_total|desc|4\r\nTop phim lẻ||type|single|view_total|desc|4", + 'attributes' => [ + 'rows' => 5 + ], + 'tab' => 'List' + ], + [ + 'name' => 'additional_css', + 'label' => 'Additional CSS', + 'type' => 'code', + 'value' => "", + 'tab' => 'Custom CSS' + ], + [ + 'name' => 'body_attributes', + 'label' => 'Body attributes', + 'type' => 'text', + 'value' => "class='bg-[#1a1a1a] font-sans leading-normal tracking-normal'", + 'tab' => 'Custom CSS' + ], + [ + 'name' => 'additional_header_js', + 'label' => 'Header JS', + 'type' => 'code', + 'value' => "", + 'tab' => 'Custom JS' + ], + [ + 'name' => 'additional_body_js', + 'label' => 'Body JS', + 'type' => 'code', + 'value' => "", + 'tab' => 'Custom JS' + ], + [ + 'name' => 'additional_footer_js', + 'label' => 'Footer JS', + 'type' => 'code', + 'value' => "", + 'tab' => 'Custom JS' + ], + [ + 'name' => 'footer', + 'label' => 'Footer', + 'type' => 'code', + 'value' => << +
+
Giới Thiệu... +

Xem phim online chất lượng cao miễn phí với phụ đề tiếng + việt - thuyết minh - lồng tiếng, có nhiều thể loại phim phong phú, đặc sắc, + nhiều bộ phim hay nhất - mới nhất.

+

Website với giao diện trực quan, thuận tiện, + tốc độ tải nhanh, ít quảng cáo hứa hẹn sẽ đem lại những trải nghiệm tốt cho người dùng. +

+
+
+ + + EOT, + 'tab' => 'Custom HTML' + ], + [ + 'name' => 'ads_header', + 'label' => 'Ads header', + 'type' => 'code', + 'value' => << + EOT, + 'tab' => 'Ads' + ], + [ + 'name' => 'ads_catfish', + 'label' => 'Ads catfish', + 'type' => 'code', + 'value' => << + EOT, + 'tab' => 'Ads' + ] + ], + ] + ])]); + } +} diff --git a/src/screenshot.png b/src/screenshot.png new file mode 100755 index 0000000..899414e Binary files /dev/null and b/src/screenshot.png differ