diff --git a/activitypub/activitypub.go b/activitypub/activitypub.go index e8be9f961..a6aa99be5 100644 --- a/activitypub/activitypub.go +++ b/activitypub/activitypub.go @@ -17,7 +17,6 @@ func Start(datastore *data.Datastore) { persistence.Setup(datastore) workerpool.InitOutboundWorkerPool() inbox.InitInboxWorkerPool() - StartRouter() // Generate the keys for signing federated activity if needed. if data.GetPrivateKey() == "" { diff --git a/activitypub/router.go b/activitypub/router.go deleted file mode 100644 index a7dc81d75..000000000 --- a/activitypub/router.go +++ /dev/null @@ -1,35 +0,0 @@ -package activitypub - -import ( - "net/http" - - "github.com/owncast/owncast/activitypub/controllers" - "github.com/owncast/owncast/router/middleware" -) - -// StartRouter will start the federation specific http router. -func StartRouter() { - // WebFinger - http.HandleFunc("/.well-known/webfinger", controllers.WebfingerHandler) - - // Host Metadata - http.HandleFunc("/.well-known/host-meta", controllers.HostMetaController) - - // Nodeinfo v1 - http.HandleFunc("/.well-known/nodeinfo", controllers.NodeInfoController) - - // x-nodeinfo v2 - http.HandleFunc("/.well-known/x-nodeinfo2", controllers.XNodeInfo2Controller) - - // Nodeinfo v2 - http.HandleFunc("/nodeinfo/2.0", controllers.NodeInfoV2Controller) - - // Instance details - http.HandleFunc("/api/v1/instance", controllers.InstanceV1Controller) - - // Single ActivityPub Actor - http.HandleFunc("/federation/user/", middleware.RequireActivityPubOrRedirect(controllers.ActorHandler)) - - // Single AP object - http.HandleFunc("/federation/", middleware.RequireActivityPubOrRedirect(controllers.ObjectHandler)) -} diff --git a/controllers/auth/indieauth/server.go b/controllers/auth/indieauth/server.go index 92cb4562f..68078e8de 100644 --- a/controllers/auth/indieauth/server.go +++ b/controllers/auth/indieauth/server.go @@ -13,18 +13,18 @@ import ( func HandleAuthEndpoint(w http.ResponseWriter, r *http.Request) { if r.Method == http.MethodGet { // Require the GET request for IndieAuth to be behind admin login. - f := middleware.RequireAdminAuth(handleAuthEndpointGet) + f := middleware.RequireAdminAuth(HandleAuthEndpointGet) f(w, r) return } else if r.Method == http.MethodPost { - handleAuthEndpointPost(w, r) + HandleAuthEndpointPost(w, r) } else { w.WriteHeader(http.StatusMethodNotAllowed) return } } -func handleAuthEndpointGet(w http.ResponseWriter, r *http.Request) { +func HandleAuthEndpointGet(w http.ResponseWriter, r *http.Request) { clientID := r.URL.Query().Get("client_id") redirectURI := r.URL.Query().Get("redirect_uri") codeChallenge := r.URL.Query().Get("code_challenge") @@ -57,7 +57,7 @@ func handleAuthEndpointGet(w http.ResponseWriter, r *http.Request) { http.Redirect(w, r, u.String(), http.StatusTemporaryRedirect) } -func handleAuthEndpointPost(w http.ResponseWriter, r *http.Request) { +func HandleAuthEndpointPost(w http.ResponseWriter, r *http.Request) { if err := r.ParseForm(); err != nil { controllers.WriteSimpleResponse(w, false, err.Error()) return diff --git a/go.mod b/go.mod index 615c2ee00..1050917b9 100644 --- a/go.mod +++ b/go.mod @@ -60,10 +60,12 @@ require github.com/SherClockHolmes/webpush-go v1.3.0 require ( github.com/andybalholm/brotli v1.0.5 // indirect + github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect github.com/aymerick/douceur v0.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-test/deep v1.0.4 // indirect github.com/golang-jwt/jwt v3.2.2+incompatible // indirect + github.com/google/uuid v1.5.0 // indirect github.com/gorilla/css v1.0.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/oschwald/maxminddb-golang v1.11.0 // indirect @@ -77,8 +79,10 @@ require ( github.com/CAFxX/httpcompression v0.0.9 github.com/TwiN/go-away v1.6.13 github.com/andybalholm/cascadia v1.3.2 + github.com/go-chi/chi/v5 v5.0.12 github.com/jellydator/ttlcache/v3 v3.2.0 github.com/mssola/user_agent v0.6.0 + github.com/oapi-codegen/runtime v1.1.1 github.com/stretchr/testify v1.9.0 github.com/yuin/goldmark-emoji v1.0.2 gopkg.in/evanphx/json-patch.v5 v5.9.0 diff --git a/go.sum b/go.sum index 9b5a6e5c7..a51669301 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,6 @@ github.com/CAFxX/httpcompression v0.0.9 h1:0ue2X8dOLEpxTm8tt+OdHcgA+gbDge0OqFQWGKSqgrg= github.com/CAFxX/httpcompression v0.0.9/go.mod h1:XX8oPZA+4IDcfZ0A71Hz0mZsv/YJOgYygkFhizVPilM= +github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= github.com/SherClockHolmes/webpush-go v1.3.0 h1:CAu3FvEE9QS4drc3iKNgpBWFfGqNthKlZhp5QpYnu6k= github.com/SherClockHolmes/webpush-go v1.3.0/go.mod h1:AxRHmJuYwKGG1PVgYzToik1lphQvDnqFYDqimHvwhIw= github.com/TwiN/go-away v1.6.13 h1:aB6l/FPXmA5ds+V7I9zdhxzpsLLUvVtEuS++iU/ZmgE= @@ -12,18 +13,23 @@ github.com/aws/aws-sdk-go v1.50.33 h1:/SKPJ7ZVPCFOYZyTKo5YdjeUEeOn2J2M0qfDTXWAoE github.com/aws/aws-sdk-go v1.50.33/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aws/aws-sdk-go v1.51.17 h1:Cfa40lCdjv9OxC3X1Ks3a6O1Tu3gOANSyKHOSw/zuWU= github.com/aws/aws-sdk-go v1.51.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= +github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= github.com/aws/aws-sdk-go v1.51.23 h1:/3TEdsEE/aHmdKGw2NrOp7Sdea76zfffGkTTSXTsDxY= github.com/aws/aws-sdk-go v1.51.23/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/dave/jennifer v1.3.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/go-chi/chi/v5 v5.0.12 h1:9euLV5sTrTNTRUU9POmDUvfxyj6LAABLUcEWO+JJb4s= +github.com/go-chi/chi/v5 v5.0.12/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-fed/httpsig v0.1.1-0.20190914113940-c2de3672e5b5/go.mod h1:T56HUNYZUQ1AGUzhAYPugZfp36sKApVnGBgKlIY+aIE= github.com/go-fed/httpsig v1.1.0 h1:9M+hb0jkEICD8/cAiNqEB66R87tTINszBRTjwjQzWcI= github.com/go-fed/httpsig v1.1.0/go.mod h1:RCMrTZvN1bJYtofsG4rd5NaO5obxQ5xBkdiS7xsT7bM= @@ -41,6 +47,8 @@ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= +github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= @@ -55,6 +63,7 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGw github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ= github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= +github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= @@ -83,6 +92,8 @@ github.com/nakabonne/tstorage v0.3.6 h1:usp7pTohax8mynnFiUSUQ2QVBCKLCkYx3gmb3+rJ github.com/nakabonne/tstorage v0.3.6/go.mod h1:1xUrK3s1MXSlU6dn96xHerHx/MdO4BGmsAHEUbsaOxU= github.com/nareix/joy5 v0.0.0-20210317075623-2c912ca30590 h1:PnxRU8L8Y2q82vFC2QdNw23Dm2u6WrjecIdpXjiYbXM= github.com/nareix/joy5 v0.0.0-20210317075623-2c912ca30590/go.mod h1:XmAOs6UJXpNXRwKk+KY/nv5kL6xXYXyellk+A1pTlko= +github.com/oapi-codegen/runtime v1.1.1 h1:EXLHh0DXIJnWhdRPN2w4MXAzFyE4CskzhNLUmtpMYro= +github.com/oapi-codegen/runtime v1.1.1/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg= github.com/oschwald/geoip2-golang v1.9.0 h1:uvD3O6fXAXs+usU+UGExshpdP13GAqp4GBrzN7IgKZc= github.com/oschwald/geoip2-golang v1.9.0/go.mod h1:BHK6TvDyATVQhKNbQBdrj9eAvuwOMi2zSFXizL3K81Y= github.com/oschwald/maxminddb-golang v1.11.0 h1:aSXMqYR/EPNjGE8epgqwDay+P30hCBZIveY0WZbAWh0= @@ -124,6 +135,7 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/cobra v0.0.4-0.20190109003409-7547e83b2d85/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/pflag v1.0.4-0.20181223182923-24fa6976df40/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -203,8 +215,6 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= @@ -213,8 +223,8 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= diff --git a/handler/admin.go b/handler/admin.go new file mode 100644 index 000000000..04d1c06e4 --- /dev/null +++ b/handler/admin.go @@ -0,0 +1,306 @@ +package handler + +import ( + "net/http" + + "github.com/owncast/owncast/controllers" + "github.com/owncast/owncast/controllers/admin" + "github.com/owncast/owncast/handler/generated" + "github.com/owncast/owncast/router/middleware" +) + +func (*ServerInterfaceImpl) StatusAdmin(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.Status)(w, r) +} + +func (*ServerInterfaceImpl) StatusAdminOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.Status)(w, r) +} + +func (*ServerInterfaceImpl) DisconnectInboundConnection(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.DisconnectInboundConnection)(w, r) +} + +func (*ServerInterfaceImpl) DisconnectInboundConnectionOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.DisconnectInboundConnection)(w, r) +} + +func (*ServerInterfaceImpl) GetServerConfig(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetServerConfig)(w, r) +} + +func (*ServerInterfaceImpl) GetServerConfigOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetServerConfig)(w, r) +} + +func (*ServerInterfaceImpl) GetViewersOverTime(w http.ResponseWriter, r *http.Request, params generated.GetViewersOverTimeParams) { + middleware.RequireAdminAuth(admin.GetViewersOverTime)(w, r) +} + +func (*ServerInterfaceImpl) GetViewersOverTimeOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetViewersOverTime)(w, r) +} + +func (*ServerInterfaceImpl) GetActiveViewers(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetActiveViewers)(w, r) +} + +func (*ServerInterfaceImpl) GetActiveViewersOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetActiveViewers)(w, r) +} + +func (*ServerInterfaceImpl) GetHardwareStats(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetHardwareStats)(w, r) +} + +func (*ServerInterfaceImpl) GetHardwareStatsOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetHardwareStats)(w, r) +} + +func (*ServerInterfaceImpl) GetConnectedChatClients(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetConnectedChatClients)(w, r) +} + +func (*ServerInterfaceImpl) GetConnectedChatClientsOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetConnectedChatClients)(w, r) +} + +func (*ServerInterfaceImpl) GetChatMessagesAdmin(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetChatMessages)(w, r) +} + +func (*ServerInterfaceImpl) GetChatMessagesAdminOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetChatMessages)(w, r) +} + +func (*ServerInterfaceImpl) UpdateMessageVisibilityAdmin(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.UpdateMessageVisibility)(w, r) +} + +func (*ServerInterfaceImpl) UpdateMessageVisibilityAdminOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.UpdateMessageVisibility)(w, r) +} + +func (*ServerInterfaceImpl) UpdateUserEnabledAdmin(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.UpdateUserEnabled)(w, r) +} + +func (*ServerInterfaceImpl) UpdateUserEnabledAdminOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.UpdateUserEnabled)(w, r) +} + +func (*ServerInterfaceImpl) GetDisabledUsers(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetDisabledUsers)(w, r) +} + +func (*ServerInterfaceImpl) GetDisabledUsersOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetDisabledUsers)(w, r) +} + +func (*ServerInterfaceImpl) BanIPAddress(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.BanIPAddress)(w, r) +} + +func (*ServerInterfaceImpl) BanIPAddressOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.BanIPAddress)(w, r) +} + +func (*ServerInterfaceImpl) UnbanIPAddress(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.UnBanIPAddress)(w, r) +} + +func (*ServerInterfaceImpl) UnbanIPAddressOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.UnBanIPAddress)(w, r) +} + +func (*ServerInterfaceImpl) GetIPAddressBans(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetIPAddressBans)(w, r) +} + +func (*ServerInterfaceImpl) GetIPAddressBansOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetIPAddressBans)(w, r) +} + +func (*ServerInterfaceImpl) UpdateUserModerator(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.UpdateUserModerator)(w, r) +} + +func (*ServerInterfaceImpl) UpdateUserModeratorOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.UpdateUserModerator)(w, r) +} + +func (*ServerInterfaceImpl) GetModerators(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetModerators)(w, r) +} + +func (*ServerInterfaceImpl) GetModeratorsOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetModerators)(w, r) +} + +func (*ServerInterfaceImpl) GetLogs(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetLogs)(w, r) +} + +func (*ServerInterfaceImpl) GetLogsOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetLogs)(w, r) +} + +func (*ServerInterfaceImpl) GetWarnings(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetWarnings)(w, r) +} + +func (*ServerInterfaceImpl) GetWarningsOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetWarnings)(w, r) +} + +func (*ServerInterfaceImpl) GetFollowersAdmin(w http.ResponseWriter, r *http.Request, params generated.GetFollowersAdminParams) { + middleware.RequireAdminAuth(middleware.HandlePagination(controllers.GetFollowers))(w, r) +} + +func (*ServerInterfaceImpl) GetFollowersAdminOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(middleware.HandlePagination(controllers.GetFollowers))(w, r) +} + +func (*ServerInterfaceImpl) GetPendingFollowRequests(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetPendingFollowRequests)(w, r) +} + +func (*ServerInterfaceImpl) GetPendingFollowRequestsOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetPendingFollowRequests)(w, r) +} + +func (*ServerInterfaceImpl) GetBlockedAndRejectedFollowers(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetBlockedAndRejectedFollowers)(w, r) +} + +func (*ServerInterfaceImpl) GetBlockedAndRejectedFollowersOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetBlockedAndRejectedFollowers)(w, r) +} + +func (*ServerInterfaceImpl) ApproveFollower(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.ApproveFollower)(w, r) +} + +func (*ServerInterfaceImpl) ApproveFollowerOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.ApproveFollower)(w, r) +} + +func (*ServerInterfaceImpl) UploadCustomEmoji(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.UploadCustomEmoji)(w, r) +} + +func (*ServerInterfaceImpl) UploadCustomEmojiOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.UploadCustomEmoji)(w, r) +} + +func (*ServerInterfaceImpl) DeleteCustomEmoji(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.DeleteCustomEmoji)(w, r) +} + +func (*ServerInterfaceImpl) DeleteCustomEmojiOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.DeleteCustomEmoji)(w, r) +} + +func (*ServerInterfaceImpl) GetWebhooks(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetWebhooks)(w, r) +} + +func (*ServerInterfaceImpl) GetWebhooksOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetWebhooks)(w, r) +} + +func (*ServerInterfaceImpl) DeleteWebhook(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.DeleteWebhook)(w, r) +} + +func (*ServerInterfaceImpl) DeleteWebhookOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.DeleteWebhook)(w, r) +} + +func (*ServerInterfaceImpl) CreateWebhook(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.CreateWebhook)(w, r) +} + +func (*ServerInterfaceImpl) CreateWebhookOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.CreateWebhook)(w, r) +} + +func (*ServerInterfaceImpl) GetExternalAPIUsers(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetExternalAPIUsers)(w, r) +} + +func (*ServerInterfaceImpl) GetExternalAPIUsersOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetExternalAPIUsers)(w, r) +} + +func (*ServerInterfaceImpl) DeleteExternalAPIUser(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.DeleteExternalAPIUser)(w, r) +} + +func (*ServerInterfaceImpl) DeleteExternalAPIUserOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.DeleteExternalAPIUser)(w, r) +} + +func (*ServerInterfaceImpl) CreateExternalAPIUser(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.CreateExternalAPIUser)(w, r) +} + +func (*ServerInterfaceImpl) CreateExternalAPIUserOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.CreateExternalAPIUser)(w, r) +} + +func (*ServerInterfaceImpl) AutoUpdateOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.AutoUpdateOptions)(w, r) +} + +func (*ServerInterfaceImpl) AutoUpdateOptionsOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.AutoUpdateOptions)(w, r) +} + +func (*ServerInterfaceImpl) AutoUpdateStart(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.AutoUpdateStart)(w, r) +} + +func (*ServerInterfaceImpl) AutoUpdateStartOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.AutoUpdateStart)(w, r) +} + +func (*ServerInterfaceImpl) AutoUpdateForceQuit(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.AutoUpdateForceQuit)(w, r) +} + +func (*ServerInterfaceImpl) AutoUpdateForceQuitOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.AutoUpdateForceQuit)(w, r) +} + +func (*ServerInterfaceImpl) ResetYPRegistration(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.ResetYPRegistration)(w, r) +} + +func (*ServerInterfaceImpl) ResetYPRegistrationOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.ResetYPRegistration)(w, r) +} + +func (*ServerInterfaceImpl) GetVideoPlaybackMetrics(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetVideoPlaybackMetrics)(w, r) +} + +func (*ServerInterfaceImpl) GetVideoPlaybackMetricsOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.GetVideoPlaybackMetrics)(w, r) +} + +func (*ServerInterfaceImpl) SendFederatedMessage(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SendFederatedMessage)(w, r) +} + +func (*ServerInterfaceImpl) SendFederatedMessageOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SendFederatedMessage)(w, r) +} + +func (*ServerInterfaceImpl) GetFederatedActions(w http.ResponseWriter, r *http.Request, params generated.GetFederatedActionsParams) { + middleware.RequireAdminAuth(middleware.HandlePagination(admin.GetFederatedActions))(w, r) +} + +func (*ServerInterfaceImpl) GetFederatedActionsOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(middleware.HandlePagination(admin.GetFederatedActions))(w, r) +} diff --git a/handler/auth.go b/handler/auth.go new file mode 100644 index 000000000..2f47b4b5c --- /dev/null +++ b/handler/auth.go @@ -0,0 +1,34 @@ +package handler + +import ( + "net/http" + + "github.com/owncast/owncast/controllers/auth/fediverse" + "github.com/owncast/owncast/controllers/auth/indieauth" + "github.com/owncast/owncast/handler/generated" + "github.com/owncast/owncast/router/middleware" +) + +func (*ServerInterfaceImpl) StartIndieAuthFlow(w http.ResponseWriter, r *http.Request, params generated.StartIndieAuthFlowParams) { + middleware.RequireUserAccessToken(indieauth.StartAuthFlow)(w, r) +} + +func (*ServerInterfaceImpl) HandleIndieAuthRedirect(w http.ResponseWriter, r *http.Request, params generated.HandleIndieAuthRedirectParams) { + indieauth.HandleRedirect(w, r) +} + +func (*ServerInterfaceImpl) HandleIndieAuthEndpointGet(w http.ResponseWriter, r *http.Request, params generated.HandleIndieAuthEndpointGetParams) { + middleware.RequireAdminAuth(indieauth.HandleAuthEndpointGet)(w, r) +} + +func (*ServerInterfaceImpl) HandleIndieAuthEndpointPost(w http.ResponseWriter, r *http.Request) { + indieauth.HandleAuthEndpointPost(w, r) +} + +func (*ServerInterfaceImpl) RegisterFediverseOTPRequest(w http.ResponseWriter, r *http.Request, params generated.RegisterFediverseOTPRequestParams) { + middleware.RequireUserAccessToken(fediverse.RegisterFediverseOTPRequest)(w, r) +} + +func (*ServerInterfaceImpl) VerifyFediverseOTPRequest(w http.ResponseWriter, r *http.Request) { + fediverse.VerifyFediverseOTPRequest(w, r) +} diff --git a/handler/config.go b/handler/config.go new file mode 100644 index 000000000..6a73fed8b --- /dev/null +++ b/handler/config.go @@ -0,0 +1,368 @@ +package handler + +import ( + "net/http" + + "github.com/owncast/owncast/controllers/admin" + "github.com/owncast/owncast/router/middleware" +) + +func (*ServerInterfaceImpl) SetAdminPassword(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetAdminPassword)(w, r) +} + +func (*ServerInterfaceImpl) SetAdminPasswordOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetAdminPassword)(w, r) +} + +func (*ServerInterfaceImpl) SetStreamKeys(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetStreamKeys)(w, r) +} + +func (*ServerInterfaceImpl) SetStreamKeysOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetStreamKeys)(w, r) +} + +func (*ServerInterfaceImpl) SetExtraPageContent(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetExtraPageContent)(w, r) +} + +func (*ServerInterfaceImpl) SetExtraPageContentOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetExtraPageContent)(w, r) +} + +func (*ServerInterfaceImpl) SetStreamTitle(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetStreamTitle)(w, r) +} + +func (*ServerInterfaceImpl) SetStreamTitleOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetStreamTitle)(w, r) +} + +func (*ServerInterfaceImpl) SetServerName(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetServerName)(w, r) +} + +func (*ServerInterfaceImpl) SetServerNameOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetServerName)(w, r) +} + +func (*ServerInterfaceImpl) SetServerSummary(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetServerSummary)(w, r) +} + +func (*ServerInterfaceImpl) SetServerSummaryOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetServerSummary)(w, r) +} + +func (*ServerInterfaceImpl) SetCustomOfflineMessage(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetCustomOfflineMessage)(w, r) +} + +func (*ServerInterfaceImpl) SetCustomOfflineMessageOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetCustomOfflineMessage)(w, r) +} + +func (*ServerInterfaceImpl) SetServerWelcomeMessage(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetServerWelcomeMessage)(w, r) +} + +func (*ServerInterfaceImpl) SetServerWelcomeMessageOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetServerWelcomeMessage)(w, r) +} + +func (*ServerInterfaceImpl) SetChatDisabled(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetChatDisabled)(w, r) +} + +func (*ServerInterfaceImpl) SetChatDisabledOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetChatDisabled)(w, r) +} + +func (*ServerInterfaceImpl) SetChatJoinMessagesEnabled(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetChatJoinMessagesEnabled)(w, r) +} + +func (*ServerInterfaceImpl) SetChatJoinMessagesEnabledOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetChatJoinMessagesEnabled)(w, r) +} + +func (*ServerInterfaceImpl) SetEnableEstablishedChatUserMode(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetEnableEstablishedChatUserMode)(w, r) +} + +func (*ServerInterfaceImpl) SetEnableEstablishedChatUserModeOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetEnableEstablishedChatUserMode)(w, r) +} + +func (*ServerInterfaceImpl) SetForbiddenUsernameList(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetForbiddenUsernameList)(w, r) +} + +func (*ServerInterfaceImpl) SetForbiddenUsernameListOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetForbiddenUsernameList)(w, r) +} + +func (*ServerInterfaceImpl) SetSuggestedUsernameList(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetSuggestedUsernameList)(w, r) +} + +func (*ServerInterfaceImpl) SetSuggestedUsernameListOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetSuggestedUsernameList)(w, r) +} + +func (*ServerInterfaceImpl) SetChatSpamProtectionEnabled(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetChatSpamProtectionEnabled)(w, r) +} + +func (*ServerInterfaceImpl) SetChatSpamProtectionEnabledOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetChatSpamProtectionEnabled)(w, r) +} + +func (*ServerInterfaceImpl) SetChatSlurFilterEnabled(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetChatSlurFilterEnabled)(w, r) +} + +func (*ServerInterfaceImpl) SetChatSlurFilterEnabledOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetChatSlurFilterEnabled)(w, r) +} + +func (*ServerInterfaceImpl) SetVideoCodec(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetVideoCodec)(w, r) +} + +func (*ServerInterfaceImpl) SetVideoCodecOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetVideoCodec)(w, r) +} + +func (*ServerInterfaceImpl) SetStreamLatencyLevel(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetStreamLatencyLevel)(w, r) +} + +func (*ServerInterfaceImpl) SetStreamLatencyLevelOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetStreamLatencyLevel)(w, r) +} + +func (*ServerInterfaceImpl) SetStreamOutputVariants(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetStreamOutputVariants)(w, r) +} + +func (*ServerInterfaceImpl) SetStreamOutputVariantsOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetStreamOutputVariants)(w, r) +} + +func (*ServerInterfaceImpl) SetCustomColorVariableValues(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetCustomColorVariableValues)(w, r) +} + +func (*ServerInterfaceImpl) SetCustomColorVariableValuesOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetCustomColorVariableValues)(w, r) +} + +func (*ServerInterfaceImpl) SetLogo(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetLogo)(w, r) +} + +func (*ServerInterfaceImpl) SetLogoOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetLogo)(w, r) +} + +func (*ServerInterfaceImpl) SetTags(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetTags)(w, r) +} + +func (*ServerInterfaceImpl) SetTagsOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetTags)(w, r) +} + +func (*ServerInterfaceImpl) SetFfmpegPath(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetFfmpegPath)(w, r) +} + +func (*ServerInterfaceImpl) SetFfmpegPathOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetFfmpegPath)(w, r) +} + +func (*ServerInterfaceImpl) SetWebServerPort(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetWebServerPort)(w, r) +} + +func (*ServerInterfaceImpl) SetWebServerPortOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetWebServerPort)(w, r) +} + +func (*ServerInterfaceImpl) SetWebServerIP(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetWebServerIP)(w, r) +} + +func (*ServerInterfaceImpl) SetWebServerIPOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetWebServerIP)(w, r) +} + +func (*ServerInterfaceImpl) SetRTMPServerPort(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetRTMPServerPort)(w, r) +} + +func (*ServerInterfaceImpl) SetRTMPServerPortOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetRTMPServerPort)(w, r) +} + +func (*ServerInterfaceImpl) SetSocketHostOverride(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetSocketHostOverride)(w, r) +} + +func (*ServerInterfaceImpl) SetSocketHostOverrideOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetSocketHostOverride)(w, r) +} + +func (*ServerInterfaceImpl) SetVideoServingEndpoint(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetVideoServingEndpoint)(w, r) +} + +func (*ServerInterfaceImpl) SetVideoServingEndpointOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetVideoServingEndpoint)(w, r) +} + +func (*ServerInterfaceImpl) SetNSFW(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetNSFW)(w, r) +} + +func (*ServerInterfaceImpl) SetNSFWOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetNSFW)(w, r) +} + +func (*ServerInterfaceImpl) SetDirectoryEnabled(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetDirectoryEnabled)(w, r) +} + +func (*ServerInterfaceImpl) SetDirectoryEnabledOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetDirectoryEnabled)(w, r) +} + +func (*ServerInterfaceImpl) SetSocialHandles(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetSocialHandles)(w, r) +} + +func (*ServerInterfaceImpl) SetSocialHandlesOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetSocialHandles)(w, r) +} + +func (*ServerInterfaceImpl) SetS3Configuration(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetS3Configuration)(w, r) +} + +func (*ServerInterfaceImpl) SetS3ConfigurationOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetS3Configuration)(w, r) +} + +func (*ServerInterfaceImpl) SetServerURL(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetServerURL)(w, r) +} + +func (*ServerInterfaceImpl) SetServerURLOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetServerURL)(w, r) +} + +func (*ServerInterfaceImpl) SetExternalActions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetExternalActions)(w, r) +} + +func (*ServerInterfaceImpl) SetExternalActionsOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetExternalActions)(w, r) +} + +func (*ServerInterfaceImpl) SetCustomStyles(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetCustomStyles)(w, r) +} + +func (*ServerInterfaceImpl) SetCustomStylesOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetCustomStyles)(w, r) +} + +func (*ServerInterfaceImpl) SetCustomJavascript(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetCustomJavascript)(w, r) +} + +func (*ServerInterfaceImpl) SetCustomJavascriptOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetCustomJavascript)(w, r) +} + +func (*ServerInterfaceImpl) SetHideViewerCount(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetHideViewerCount)(w, r) +} + +func (*ServerInterfaceImpl) SetHideViewerCountOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetHideViewerCount)(w, r) +} + +func (*ServerInterfaceImpl) SetDisableSearchIndexing(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetDisableSearchIndexing)(w, r) +} + +func (*ServerInterfaceImpl) SetDisableSearchIndexingOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetDisableSearchIndexing)(w, r) +} + +func (*ServerInterfaceImpl) SetFederationEnabled(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetFederationEnabled)(w, r) +} + +func (*ServerInterfaceImpl) SetFederationEnabledOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetFederationEnabled)(w, r) +} + +func (*ServerInterfaceImpl) SetFederationActivityPrivate(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetFederationActivityPrivate)(w, r) +} + +func (*ServerInterfaceImpl) SetFederationActivityPrivateOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetFederationActivityPrivate)(w, r) +} + +func (*ServerInterfaceImpl) SetFederationShowEngagement(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetFederationShowEngagement)(w, r) +} + +func (*ServerInterfaceImpl) SetFederationShowEngagementOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetFederationShowEngagement)(w, r) +} + +func (*ServerInterfaceImpl) SetFederationUsername(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetFederationUsername)(w, r) +} + +func (*ServerInterfaceImpl) SetFederationUsernameOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetFederationUsername)(w, r) +} + +func (*ServerInterfaceImpl) SetFederationGoLiveMessage(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetFederationGoLiveMessage)(w, r) +} + +func (*ServerInterfaceImpl) SetFederationGoLiveMessageOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetFederationGoLiveMessage)(w, r) +} + +func (*ServerInterfaceImpl) SetFederationBlockDomains(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetFederationBlockDomains)(w, r) +} + +func (*ServerInterfaceImpl) SetFederationBlockDomainsOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetFederationBlockDomains)(w, r) +} + +func (*ServerInterfaceImpl) SetDiscordNotificationConfiguration(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetDiscordNotificationConfiguration)(w, r) +} + +func (*ServerInterfaceImpl) SetDiscordNotificationConfigurationOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetDiscordNotificationConfiguration)(w, r) +} + +func (*ServerInterfaceImpl) SetBrowserNotificationConfiguration(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetBrowserNotificationConfiguration)(w, r) +} + +func (*ServerInterfaceImpl) SetBrowserNotificationConfigurationOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireAdminAuth(admin.SetBrowserNotificationConfiguration)(w, r) +} diff --git a/handler/generated/generated-types.gen.go b/handler/generated/generated-types.gen.go new file mode 100644 index 000000000..3a14dce46 --- /dev/null +++ b/handler/generated/generated-types.gen.go @@ -0,0 +1,1342 @@ +// Package generated provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT. +package generated + +import ( + "encoding/json" + "time" + + "github.com/oapi-codegen/runtime" +) + +const ( + BasicAuthScopes = "BasicAuth.Scopes" + BearerAuthScopes = "BearerAuth.Scopes" +) + +// Defines values for WebhookEventType. +const ( + CHAT WebhookEventType = "CHAT" + CHATACTION WebhookEventType = "CHAT_ACTION" + NAMECHANGE WebhookEventType = "NAME_CHANGE" + PING WebhookEventType = "PING" + PONG WebhookEventType = "PONG" + STREAMSTARTED WebhookEventType = "STREAM_STARTED" + STREAMSTOPPED WebhookEventType = "STREAM_STOPPED" + STREAMTITLEUPDATED WebhookEventType = "STREAM_TITLE_UPDATED" + SYSTEM WebhookEventType = "SYSTEM" + USERJOINED WebhookEventType = "USER_JOINED" + USERPARTED WebhookEventType = "USER_PARTED" + VISIBILITYUPDATE WebhookEventType = "VISIBILITY-UPDATE" +) + +// ActionMessage defines model for ActionMessage. +type ActionMessage struct { + Body *string `json:"body,omitempty"` + Id *string `json:"id,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` + Type *string `json:"type,omitempty"` +} + +// AdminConfigValue defines model for AdminConfigValue. +type AdminConfigValue struct { + Value *AdminConfigValue_Value `json:"value,omitempty"` +} + +// AdminConfigValueValue0 defines model for . +type AdminConfigValueValue0 = string + +// AdminConfigValueValue1 defines model for . +type AdminConfigValueValue1 = bool + +// AdminConfigValueValue2 defines model for . +type AdminConfigValueValue2 = []string + +// AdminConfigValueValue3 defines model for . +type AdminConfigValueValue3 = float32 + +// AdminConfigValue_Value defines model for AdminConfigValue.Value. +type AdminConfigValue_Value struct { + union json.RawMessage +} + +// AdminFederationConfig defines model for AdminFederationConfig. +type AdminFederationConfig struct { + BlockedDomains *[]string `json:"blockedDomains,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + GoLiveMessage *string `json:"goLiveMessage,omitempty"` + IsPrivate *bool `json:"isPrivate,omitempty"` + ShowEngagement *bool `json:"showEngagement,omitempty"` + Username *string `json:"username,omitempty"` +} + +// AdminLog defines model for AdminLog. +type AdminLog struct { + Level *string `json:"level,omitempty"` + Message *string `json:"message,omitempty"` + Time *time.Time `json:"time,omitempty"` +} + +// AdminNotificationsConfig defines model for AdminNotificationsConfig. +type AdminNotificationsConfig struct { + Browser *BrowserNotificationConfiguration `json:"browser,omitempty"` + Discord *DiscordNotificationConfiguration `json:"discord,omitempty"` +} + +// AdminServerConfig defines model for AdminServerConfig. +type AdminServerConfig struct { + AdminPassword *string `json:"adminPassword,omitempty"` + ChatDisabled *bool `json:"chatDisabled,omitempty"` + ChatEstablishedUserMode *bool `json:"chatEstablishedUserMode,omitempty"` + ChatJoinMessagesEnabled *bool `json:"chatJoinMessagesEnabled,omitempty"` + DisableSearchIndexing *bool `json:"disableSearchIndexing,omitempty"` + ExternalActions *[]ExternalAction `json:"externalActions,omitempty"` + Federation *AdminFederationConfig `json:"federation,omitempty"` + FfmpegPath *string `json:"ffmpegPath,omitempty"` + ForbiddenUsernames *[]string `json:"forbiddenUsernames,omitempty"` + HideViewerCount *bool `json:"hideViewerCount,omitempty"` + InstanceDetails *AdminWebConfig `json:"instanceDetails,omitempty"` + Notifications *AdminNotificationsConfig `json:"notifications,omitempty"` + RtmpServerPort *int `json:"rtmpServerPort,omitempty"` + S3 *S3Info `json:"s3,omitempty"` + SocketHostOverride *string `json:"socketHostOverride,omitempty"` + StreamKeyOverridden *bool `json:"streamKeyOverridden,omitempty"` + StreamKeys *[]StreamKey `json:"streamKeys,omitempty"` + SuggestedUsernames *[]string `json:"suggestedUsernames,omitempty"` + SupportedCodecs *[]string `json:"supportedCodecs,omitempty"` + VideoCodec *string `json:"videoCodec,omitempty"` + VideoServingEndpoint *string `json:"videoServingEndpoint,omitempty"` + VideoSettings *AdminVideoSettings `json:"videoSettings,omitempty"` + WebServerIP *string `json:"webServerIP,omitempty"` + WebServerPort *int `json:"webServerPort,omitempty"` + Yp *AdminYPInfo `json:"yp,omitempty"` +} + +// AdminStatus defines model for AdminStatus. +type AdminStatus struct { + Broadcaster *Broadcaster `json:"broadcaster,omitempty"` + CurrentBroadcast *CurrentBroadcast `json:"currentBroadcast,omitempty"` + Health *StreamHealthOverview `json:"health,omitempty"` + Online *bool `json:"online,omitempty"` + OverallPeakViewerCount *int `json:"overallPeakViewerCount,omitempty"` + SessionPeakViewerCount *int `json:"sessionPeakViewerCount,omitempty"` + StreamTitle *string `json:"streamTitle,omitempty"` + VersionNumber *string `json:"versionNumber,omitempty"` + ViewerCount *int `json:"viewerCount,omitempty"` +} + +// AdminVideoSettings defines model for AdminVideoSettings. +type AdminVideoSettings struct { + LatencyLevel *int `json:"latencyLevel,omitempty"` + VideoQualityVariants *[]StreamOutputVariant `json:"videoQualityVariants,omitempty"` +} + +// AdminWebConfig defines model for AdminWebConfig. +type AdminWebConfig struct { + AppearanceVariables *map[string]string `json:"appearanceVariables,omitempty"` + CustomJavascript *string `json:"customJavascript,omitempty"` + CustomStyles *string `json:"customStyles,omitempty"` + ExtraPageContent *string `json:"extraPageContent,omitempty"` + Logo *string `json:"logo,omitempty"` + Name *string `json:"name,omitempty"` + Nsfw *bool `json:"nsfw,omitempty"` + OfflineMessage *string `json:"offlineMessage,omitempty"` + SocialHandles *[]SocialHandle `json:"socialHandles,omitempty"` + StreamTitle *string `json:"streamTitle,omitempty"` + Summary *string `json:"summary,omitempty"` + Tags *[]string `json:"tags,omitempty"` + Version *string `json:"version,omitempty"` + WelcomeMessage *string `json:"welcomeMessage,omitempty"` +} + +// AdminYPInfo defines model for AdminYPInfo. +type AdminYPInfo struct { + Enabled *bool `json:"enabled,omitempty"` + InstanceUrl *string `json:"instanceUrl,omitempty"` +} + +// AnonymousUser defines model for AnonymousUser. +type AnonymousUser struct { + AccessToken *string `json:"accessToken,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Id *string `json:"id,omitempty"` +} + +// AuthenticationConfig defines model for AuthenticationConfig. +type AuthenticationConfig struct { + IndieAuthEnabled *bool `json:"indieAuthEnabled,omitempty"` +} + +// BaseAPIResponse Simple API response +type BaseAPIResponse struct { + Message *string `json:"message,omitempty"` + Success *bool `json:"success,omitempty"` +} + +// Broadcaster defines model for Broadcaster. +type Broadcaster struct { + RemoteAddr *string `json:"remoteAddr,omitempty"` + StreamDetails *InboundStreamDetails `json:"streamDetails,omitempty"` + Time *time.Time `json:"time,omitempty"` +} + +// BrowserConfig defines model for BrowserConfig. +type BrowserConfig struct { + Enabled *bool `json:"enabled,omitempty"` + PublicKey *string `json:"publicKey,omitempty"` +} + +// BrowserNotificationConfiguration defines model for BrowserNotificationConfiguration. +type BrowserNotificationConfiguration struct { + Enabled *bool `json:"enabled,omitempty"` + GoLiveMessage *string `json:"goLiveMessage,omitempty"` +} + +// ChatClient defines model for ChatClient. +type ChatClient struct { + ConnectedAt *time.Time `json:"connectedAt,omitempty"` + Geo *GeoDetails `json:"geo,omitempty"` + MessageCount *int `json:"messageCount,omitempty"` + User *User `json:"user,omitempty"` + UserAgent *string `json:"userAgent,omitempty"` +} + +// ChatClients defines model for ChatClients. +type ChatClients = []ChatClient + +// ChatMessages defines model for ChatMessages. +type ChatMessages = []ChatMessages_Item + +// ChatMessages_Item defines model for ChatMessages.Item. +type ChatMessages_Item struct { + union json.RawMessage +} + +// CollectedMetrics defines model for CollectedMetrics. +type CollectedMetrics struct { + Cpu *[]TimestampedValue `json:"cpu,omitempty"` + Disk *[]TimestampedValue `json:"disk,omitempty"` + Memory *[]TimestampedValue `json:"memory,omitempty"` +} + +// CurrentBroadcast defines model for CurrentBroadcast. +type CurrentBroadcast struct { + LatencyLevel *LatencyLevel `json:"latencyLevel,omitempty"` + OutputSettings *[]StreamOutputVariant `json:"outputSettings,omitempty"` +} + +// DiscordNotificationConfiguration defines model for DiscordNotificationConfiguration. +type DiscordNotificationConfiguration struct { + Enabled *bool `json:"enabled,omitempty"` + GoLiveMessage *string `json:"goLiveMessage,omitempty"` + Webhook *string `json:"webhook,omitempty"` +} + +// Emoji Name and url for an emoji +type Emoji struct { + // Name The name of the emoji + Name *string `json:"name,omitempty"` + + // Url URL for the emoji image + Url *string `json:"url,omitempty"` +} + +// Emojis defines model for Emojis. +type Emojis = []Emoji + +// Error Structure for an error response +type Error struct { + Error *string `json:"error,omitempty"` +} + +// Event defines model for Event. +type Event struct { + Id *string `json:"id,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` + Type *string `json:"type,omitempty"` +} + +// ExternalAPIUser defines model for ExternalAPIUser. +type ExternalAPIUser struct { + AccessToken *string `json:"accessToken,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + DisplayColor *int `json:"displayColor,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Id *string `json:"id,omitempty"` + IsBot *bool `json:"isBot,omitempty"` + LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` + Scopes *[]string `json:"scopes,omitempty"` + Type *string `json:"type,omitempty"` +} + +// ExternalAction defines model for ExternalAction. +type ExternalAction struct { + Color *string `json:"color,omitempty"` + Description *string `json:"description,omitempty"` + Html *string `json:"html,omitempty"` + Icon *string `json:"icon,omitempty"` + OpenExternally *bool `json:"openExternally,omitempty"` + Title *string `json:"title,omitempty"` + Url *string `json:"url,omitempty"` +} + +// FederatedAction defines model for FederatedAction. +type FederatedAction struct { + Body *string `json:"body,omitempty"` + Id *string `json:"id,omitempty"` + Image *string `json:"image,omitempty"` + Link *string `json:"link,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` + Title *string `json:"title,omitempty"` + Type *string `json:"type,omitempty"` +} + +// FederatedActivity defines model for FederatedActivity. +type FederatedActivity struct { + ActorIRI *string `json:"actorIRI,omitempty"` + Iri *string `json:"iri,omitempty"` + Timestamp *time.Time `json:"timestamp,omitempty"` + Type *string `json:"type,omitempty"` +} + +// FederationConfig defines model for FederationConfig. +type FederationConfig struct { + Account *string `json:"account,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + FollowerCount *int `json:"followerCount,omitempty"` +} + +// Follower defines model for Follower. +type Follower struct { + // DisabledAt When this follower was rejected or disabled. + DisabledAt *string `json:"disabledAt,omitempty"` + + // Image The avatar image of the follower. + Image *string `json:"image,omitempty"` + + // Link The IRI of the remote actor. + Link *string `json:"link,omitempty"` + + // Name The display name of the follower. + Name *string `json:"name,omitempty"` + + // Timestamp When this follow request was created. + Timestamp *string `json:"timestamp,omitempty"` + + // Username The account username of the remote actor. + Username *string `json:"username,omitempty"` +} + +// Followers defines model for Followers. +type Followers = []Follower + +// GeoDetails defines model for GeoDetails. +type GeoDetails struct { + CountryCode *string `json:"countryCode,omitempty"` + RegionName *string `json:"regionName,omitempty"` + TimeZone *string `json:"timeZone,omitempty"` +} + +// IPAddress defines model for IPAddress. +type IPAddress struct { + CreatedAt *time.Time `json:"createdAt,omitempty"` + IpAddress *string `json:"ipAddress,omitempty"` + Notes *string `json:"notes,omitempty"` +} + +// InboundStreamDetails defines model for InboundStreamDetails. +type InboundStreamDetails struct { + AudioBitrate *int `json:"audioBitrate,omitempty"` + AudioCodec *string `json:"audioCodec,omitempty"` + Encoder *string `json:"encoder,omitempty"` + Framerate *float32 `json:"framerate,omitempty"` + Height *int `json:"height,omitempty"` + VideoBitrate *int `json:"videoBitrate,omitempty"` + VideoCodec *string `json:"videoCodec,omitempty"` + Width *int `json:"width,omitempty"` +} + +// IndieAuthProfile defines model for IndieAuthProfile. +type IndieAuthProfile struct { + Name *string `json:"name,omitempty"` + Photo *string `json:"photo,omitempty"` + Url *string `json:"url,omitempty"` +} + +// IndieAuthResponse defines model for IndieAuthResponse. +type IndieAuthResponse struct { + Error *string `json:"error,omitempty"` + ErrorDescription *string `json:"errorDescription,omitempty"` + Me *string `json:"me,omitempty"` + Profile *IndieAuthProfile `json:"profile,omitempty"` +} + +// IndieAuthServerProfile defines model for IndieAuthServerProfile. +type IndieAuthServerProfile struct { + Name *string `json:"name,omitempty"` + Photo *string `json:"photo,omitempty"` + Url *string `json:"url,omitempty"` +} + +// IndieAuthServerProfileResponse defines model for IndieAuthServerProfileResponse. +type IndieAuthServerProfileResponse struct { + Error *string `json:"error,omitempty"` + ErrorDescription *string `json:"errorDescription,omitempty"` + Me *string `json:"me,omitempty"` + Profile *IndieAuthServerProfile `json:"profile,omitempty"` +} + +// LatencyLevel defines model for LatencyLevel. +type LatencyLevel struct { + Level *int `json:"level,omitempty"` +} + +// MessageEvent defines model for MessageEvent. +type MessageEvent struct { + Body *string `json:"body,omitempty"` +} + +// MessageVisibilityUpdate defines model for MessageVisibilityUpdate. +type MessageVisibilityUpdate struct { + IdArray *[]string `json:"idArray,omitempty"` + Visible *bool `json:"visible,omitempty"` +} + +// ModerationConnectedClient defines model for ModerationConnectedClient. +type ModerationConnectedClient struct { + ConnectedAt *time.Time `json:"connectedAt,omitempty"` + Geo *string `json:"geo,omitempty"` + Id *int64 `json:"id,omitempty"` + MessageCount *int `json:"messageCount,omitempty"` + UserAgent *string `json:"userAgent,omitempty"` +} + +// ModerationUserDetails defines model for ModerationUserDetails. +type ModerationUserDetails struct { + ConnectedClients *[]ModerationConnectedClient `json:"connectedClients,omitempty"` + Messages *[]UserMessage `json:"messages,omitempty"` + User *User `json:"user,omitempty"` +} + +// NotificationConfig defines model for NotificationConfig. +type NotificationConfig struct { + Browser *BrowserConfig `json:"browser,omitempty"` +} + +// PaginatedFederatedActivity defines model for PaginatedFederatedActivity. +type PaginatedFederatedActivity struct { + Results *FederatedActivity `json:"results,omitempty"` + Total *int `json:"total,omitempty"` +} + +// PaginatedFollowers defines model for PaginatedFollowers. +type PaginatedFollowers struct { + Results *Followers `json:"results,omitempty"` + Total *int `json:"total,omitempty"` +} + +// PlaybackMetrics defines model for PlaybackMetrics. +type PlaybackMetrics struct { + Bandwidth *float64 `json:"bandwidth,omitempty"` + DownloadDuration *float64 `json:"downloadDuration,omitempty"` + Errors *float64 `json:"errors,omitempty"` + Latency *float64 `json:"latency,omitempty"` + QualityVariantChanges *float64 `json:"qualityVariantChanges,omitempty"` +} + +// S3Info defines model for S3Info. +type S3Info struct { + AccessKey *string `json:"accessKey,omitempty"` + Acl *string `json:"acl,omitempty"` + Bucket *string `json:"bucket,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Endpoint *string `json:"endpoint,omitempty"` + ForcePathStyle *bool `json:"forcePathStyle,omitempty"` + PathPrefix *string `json:"pathPrefix,omitempty"` + Region *string `json:"region,omitempty"` + Secret *string `json:"secret,omitempty"` +} + +// SocialHandle defines model for SocialHandle. +type SocialHandle struct { + Icon *string `json:"icon,omitempty"` + Platform *string `json:"platform,omitempty"` + Url *string `json:"url,omitempty"` +} + +// Status Response for status +type Status struct { + LastConnectTime *string `json:"lastConnectTime,omitempty"` + LastDisconnectTime *string `json:"lastDisconnectTime,omitempty"` + Online *bool `json:"online,omitempty"` + ServerTime *string `json:"serverTime,omitempty"` + VersionNumber *string `json:"versionNumber,omitempty"` + ViewerCount *int `json:"viewerCount,omitempty"` +} + +// StreamHealthOverview defines model for StreamHealthOverview. +type StreamHealthOverview struct { + HealthPercentage *int `json:"healthPercentage,omitempty"` + Healthy *bool `json:"healthy,omitempty"` + Message *string `json:"message,omitempty"` + Representation *int `json:"representation,omitempty"` +} + +// StreamKey defines model for StreamKey. +type StreamKey struct { + Comment *string `json:"comment,omitempty"` + Key *string `json:"key,omitempty"` +} + +// StreamOutputVariant defines model for StreamOutputVariant. +type StreamOutputVariant struct { + AudioBitrate *int `json:"audioBitrate,omitempty"` + AudioPassthrough *bool `json:"audioPassthrough,omitempty"` + CpuUsageLevel *int `json:"cpuUsageLevel,omitempty"` + Framerate *int `json:"framerate,omitempty"` + Name *string `json:"name,omitempty"` + ScaledHeight *int `json:"scaledHeight,omitempty"` + ScaledWidth *int `json:"scaledWidth,omitempty"` + VideoBitrate *int `json:"videoBitrate,omitempty"` + VideoPassthrough *bool `json:"videoPassthrough,omitempty"` +} + +// SystemActionEvent defines model for SystemActionEvent. +type SystemActionEvent struct { + Body *string `json:"body,omitempty"` + Id *string `json:"id,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` + Type *string `json:"type,omitempty"` +} + +// SystemMessage defines model for SystemMessage. +type SystemMessage struct { + Body *string `json:"body,omitempty"` + Id *string `json:"id,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` + Type *string `json:"type,omitempty"` +} + +// TimestampedValue defines model for TimestampedValue. +type TimestampedValue struct { + Time *time.Time `json:"time,omitempty"` + Value *float64 `json:"value,omitempty"` +} + +// User defines model for User. +type User struct { + Authenticated *bool `json:"authenticated,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + DisabledAt *string `json:"disabledAt,omitempty"` + DisplayColor *int `json:"displayColor,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Id *string `json:"id,omitempty"` + IsBot *bool `json:"isBot,omitempty"` + NameChangedAt *string `json:"nameChangedAt,omitempty"` + PreviousNames *[]string `json:"previousNames,omitempty"` + Scopes *[]string `json:"scopes,omitempty"` +} + +// UserEvent defines model for UserEvent. +type UserEvent struct { + ClientId *int `json:"clientId,omitempty"` + HiddenAt *string `json:"hiddenAt,omitempty"` + User *User `json:"user,omitempty"` +} + +// UserMessage defines model for UserMessage. +type UserMessage struct { + Body *string `json:"body,omitempty"` + ClientId *int `json:"clientId,omitempty"` + HiddenAt *string `json:"hiddenAt,omitempty"` + Id *string `json:"id,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` + Type *string `json:"type,omitempty"` + User *User `json:"user,omitempty"` +} + +// Users defines model for Users. +type Users = []User + +// VideoVariant defines model for VideoVariant. +type VideoVariant struct { + Index *int `json:"index,omitempty"` + Name *string `json:"name,omitempty"` +} + +// Viewer defines model for Viewer. +type Viewer struct { + ClientID *string `json:"clientID,omitempty"` + FirstSeen *time.Time `json:"firstSeen,omitempty"` + Geo *GeoDetails `json:"geo,omitempty"` + IpAddress *string `json:"ipAddress,omitempty"` + UserAgent *string `json:"userAgent,omitempty"` +} + +// WebConfig defines model for WebConfig. +type WebConfig struct { + AppearanceVariables *map[string]string `json:"appearanceVariables,omitempty"` + Authentication *AuthenticationConfig `json:"authentication,omitempty"` + ChatDisabled *bool `json:"chatDisabled,omitempty"` + CustomStyles *string `json:"customStyles,omitempty"` + ExternalActions *[]ExternalAction `json:"externalActions,omitempty"` + ExtraPageContent *string `json:"extraPageContent,omitempty"` + Federation *FederationConfig `json:"federation,omitempty"` + HideViewerCount *bool `json:"hideViewerCount,omitempty"` + Logo *string `json:"logo,omitempty"` + MaxSocketPayloadSize *int `json:"maxSocketPayloadSize,omitempty"` + Name *string `json:"name,omitempty"` + Notifications *NotificationConfig `json:"notifications,omitempty"` + Nsfw *bool `json:"nsfw,omitempty"` + OfflineMessage *string `json:"offlineMessage,omitempty"` + SocialHandles *[]SocialHandle `json:"socialHandles,omitempty"` + SocketHostOverride *string `json:"socketHostOverride,omitempty"` + StreamTitle *string `json:"streamTitle,omitempty"` + Summary *string `json:"summary,omitempty"` + Tags *[]string `json:"tags,omitempty"` + Version *string `json:"version,omitempty"` +} + +// Webhook defines model for Webhook. +type Webhook struct { + Events *[]WebhookEventType `json:"events,omitempty"` + Id *int `json:"id,omitempty"` + LastUsed *time.Time `json:"lastUsed,omitempty"` + Timestamp *time.Time `json:"timestamp,omitempty"` + Url *string `json:"url,omitempty"` +} + +// WebhookEventType defines model for WebhookEventType. +type WebhookEventType string + +// YPDetails defines model for YPDetails. +type YPDetails struct { + Description *string `json:"description,omitempty"` + LastConnectTime *string `json:"lastConnectTime,omitempty"` + Logo *string `json:"logo,omitempty"` + Name *string `json:"name,omitempty"` + Nsfw *bool `json:"nsfw,omitempty"` + Online *bool `json:"online,omitempty"` + OverallMaxViewerCount *int `json:"overallMaxViewerCount,omitempty"` + SessionMaxViewerCount *int `json:"sessionMaxViewerCount,omitempty"` + Social *[]SocialHandle `json:"social,omitempty"` + StreamTitle *string `json:"streamTitle,omitempty"` + Tags *[]string `json:"tags,omitempty"` + ViewerCount *int `json:"viewerCount,omitempty"` +} + +// AccessToken defines model for AccessToken. +type AccessToken = string + +// IndieAuthClientId defines model for IndieAuthClientId. +type IndieAuthClientId = string + +// IndieAuthCode defines model for IndieAuthCode. +type IndieAuthCode = string + +// IndieAuthCodeChallenge defines model for IndieAuthCodeChallenge. +type IndieAuthCodeChallenge = string + +// IndieAuthRedirectURI defines model for IndieAuthRedirectURI. +type IndieAuthRedirectURI = string + +// IndieAuthState defines model for IndieAuthState. +type IndieAuthState = string + +// Limit The numbers of items to return +type Limit = int + +// Offset The number of items to skip before starting to collect the result set +type Offset = int + +// N400 Simple API response +type N400 = BaseAPIResponse + +// N500 Structure for an error response +type N500 = Error + +// N501 Structure for an error response +type N501 = Error + +// Default Simple API response +type Default = BaseAPIResponse + +// CreateExternalAPIUserJSONBody defines parameters for CreateExternalAPIUser. +type CreateExternalAPIUserJSONBody struct { + Name *string `json:"name,omitempty"` + Scopes *[]string `json:"scopes,omitempty"` +} + +// DeleteExternalAPIUserJSONBody defines parameters for DeleteExternalAPIUser. +type DeleteExternalAPIUserJSONBody struct { + Token *string `json:"token,omitempty"` +} + +// UpdateUserEnabledAdminJSONBody defines parameters for UpdateUserEnabledAdmin. +type UpdateUserEnabledAdminJSONBody struct { + Enabled *bool `json:"enabled,omitempty"` + UserId *string `json:"userId,omitempty"` +} + +// UpdateUserModeratorJSONBody defines parameters for UpdateUserModerator. +type UpdateUserModeratorJSONBody struct { + IsModerator *bool `json:"isModerator,omitempty"` + UserId *string `json:"userId,omitempty"` +} + +// SetCustomColorVariableValuesJSONBody defines parameters for SetCustomColorVariableValues. +type SetCustomColorVariableValuesJSONBody struct { + Value *map[string]string `json:"value,omitempty"` +} + +// SetForbiddenUsernameListJSONBody defines parameters for SetForbiddenUsernameList. +type SetForbiddenUsernameListJSONBody struct { + Value *[]string `json:"value,omitempty"` +} + +// SetSuggestedUsernameListJSONBody defines parameters for SetSuggestedUsernameList. +type SetSuggestedUsernameListJSONBody struct { + Value *[]string `json:"value,omitempty"` +} + +// SetExternalActionsJSONBody defines parameters for SetExternalActions. +type SetExternalActionsJSONBody struct { + Value *[]ExternalAction `json:"value,omitempty"` +} + +// SetBrowserNotificationConfigurationJSONBody defines parameters for SetBrowserNotificationConfiguration. +type SetBrowserNotificationConfigurationJSONBody struct { + Value *BrowserNotificationConfiguration `json:"value,omitempty"` +} + +// SetDiscordNotificationConfigurationJSONBody defines parameters for SetDiscordNotificationConfiguration. +type SetDiscordNotificationConfigurationJSONBody struct { + Value *DiscordNotificationConfiguration `json:"value,omitempty"` +} + +// SetS3ConfigurationJSONBody defines parameters for SetS3Configuration. +type SetS3ConfigurationJSONBody struct { + Value *S3Info `json:"value,omitempty"` +} + +// SetSocialHandlesJSONBody defines parameters for SetSocialHandles. +type SetSocialHandlesJSONBody struct { + Value *[]SocialHandle `json:"value,omitempty"` +} + +// SetStreamKeysJSONBody defines parameters for SetStreamKeys. +type SetStreamKeysJSONBody struct { + Value *[]StreamKey `json:"value,omitempty"` +} + +// SetStreamOutputVariantsJSONBody defines parameters for SetStreamOutputVariants. +type SetStreamOutputVariantsJSONBody struct { + Value *[]StreamOutputVariant `json:"value,omitempty"` +} + +// DeleteCustomEmojiJSONBody defines parameters for DeleteCustomEmoji. +type DeleteCustomEmojiJSONBody struct { + Name *string `json:"name,omitempty"` +} + +// UploadCustomEmojiJSONBody defines parameters for UploadCustomEmoji. +type UploadCustomEmojiJSONBody struct { + // Data Base 64 encoded image data + Data *string `json:"data,omitempty"` + Name *string `json:"name,omitempty"` +} + +// GetFederatedActionsParams defines parameters for GetFederatedActions. +type GetFederatedActionsParams struct { + Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"` + Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` +} + +// GetFollowersAdminParams defines parameters for GetFollowersAdmin. +type GetFollowersAdminParams struct { + Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"` + Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` +} + +// ApproveFollowerJSONBody defines parameters for ApproveFollower. +type ApproveFollowerJSONBody struct { + ActorIRI *string `json:"actorIRI,omitempty"` + Approved *bool `json:"approved,omitempty"` +} + +// GetViewersOverTimeParams defines parameters for GetViewersOverTime. +type GetViewersOverTimeParams struct { + // WindowStart Start date in unix time + WindowStart *string `form:"windowStart,omitempty" json:"windowStart,omitempty"` +} + +// CreateWebhookJSONBody defines parameters for CreateWebhook. +type CreateWebhookJSONBody struct { + Events *[]WebhookEventType `json:"events,omitempty"` + Url *string `json:"url,omitempty"` +} + +// DeleteWebhookJSONBody defines parameters for DeleteWebhook. +type DeleteWebhookJSONBody struct { + Id *int `json:"id,omitempty"` +} + +// RegisterFediverseOTPRequestJSONBody defines parameters for RegisterFediverseOTPRequest. +type RegisterFediverseOTPRequestJSONBody struct { + Account *string `json:"account,omitempty"` +} + +// RegisterFediverseOTPRequestParams defines parameters for RegisterFediverseOTPRequest. +type RegisterFediverseOTPRequestParams struct { + AccessToken AccessToken `form:"accessToken" json:"accessToken"` +} + +// VerifyFediverseOTPRequestJSONBody defines parameters for VerifyFediverseOTPRequest. +type VerifyFediverseOTPRequestJSONBody struct { + Code *string `json:"code,omitempty"` +} + +// StartIndieAuthFlowJSONBody defines parameters for StartIndieAuthFlow. +type StartIndieAuthFlowJSONBody struct { + AuthHost *string `json:"authHost,omitempty"` +} + +// StartIndieAuthFlowParams defines parameters for StartIndieAuthFlow. +type StartIndieAuthFlowParams struct { + AccessToken AccessToken `form:"accessToken" json:"accessToken"` +} + +// HandleIndieAuthRedirectParams defines parameters for HandleIndieAuthRedirect. +type HandleIndieAuthRedirectParams struct { + State IndieAuthState `form:"state" json:"state"` + Code IndieAuthCode `form:"code" json:"code"` +} + +// HandleIndieAuthEndpointGetParams defines parameters for HandleIndieAuthEndpointGet. +type HandleIndieAuthEndpointGetParams struct { + ClientId IndieAuthClientId `form:"client_id" json:"client_id"` + RedirectUri IndieAuthRedirectURI `form:"redirect_uri" json:"redirect_uri"` + CodeChallenge IndieAuthCodeChallenge `form:"code_challenge" json:"code_challenge"` + State IndieAuthState `form:"state" json:"state"` + Code IndieAuthCode `form:"code" json:"code"` +} + +// HandleIndieAuthEndpointPostFormdataBody defines parameters for HandleIndieAuthEndpointPost. +type HandleIndieAuthEndpointPostFormdataBody struct { + ClientId *string `form:"client_id,omitempty" json:"client_id,omitempty"` + Code *string `form:"code,omitempty" json:"code,omitempty"` + CodeVerifier *string `form:"codeVerifier,omitempty" json:"codeVerifier,omitempty"` + RedirectUri *string `form:"redirect_uri,omitempty" json:"redirect_uri,omitempty"` +} + +// GetChatMessagesParams defines parameters for GetChatMessages. +type GetChatMessagesParams struct { + AccessToken AccessToken `form:"accessToken" json:"accessToken"` +} + +// UpdateMessageVisibilityParams defines parameters for UpdateMessageVisibility. +type UpdateMessageVisibilityParams struct { + AccessToken AccessToken `form:"accessToken" json:"accessToken"` +} + +// RegisterAnonymousChatUserJSONBody defines parameters for RegisterAnonymousChatUser. +type RegisterAnonymousChatUserJSONBody struct { + DisplayName *string `json:"displayName,omitempty"` +} + +// RegisterAnonymousChatUserParams defines parameters for RegisterAnonymousChatUser. +type RegisterAnonymousChatUserParams struct { + XForwardedUser *string `json:"X-Forwarded-User,omitempty"` +} + +// UpdateUserEnabledJSONBody defines parameters for UpdateUserEnabled. +type UpdateUserEnabledJSONBody struct { + Enabled *bool `json:"enabled,omitempty"` + UserId *string `json:"userId,omitempty"` +} + +// UpdateUserEnabledParams defines parameters for UpdateUserEnabled. +type UpdateUserEnabledParams struct { + AccessToken AccessToken `form:"accessToken" json:"accessToken"` +} + +// GetFollowersParams defines parameters for GetFollowers. +type GetFollowersParams struct { + Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"` + Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` +} + +// GetUserDetailsParams defines parameters for GetUserDetails. +type GetUserDetailsParams struct { + AccessToken AccessToken `form:"accessToken" json:"accessToken"` +} + +// RegisterForLiveNotificationsJSONBody defines parameters for RegisterForLiveNotifications. +type RegisterForLiveNotificationsJSONBody struct { + // Channel Name of notification channel + Channel *string `json:"channel,omitempty"` + + // Destination Target of the notification in the channel + Destination *string `json:"destination,omitempty"` +} + +// RegisterForLiveNotificationsParams defines parameters for RegisterForLiveNotifications. +type RegisterForLiveNotificationsParams struct { + AccessToken AccessToken `form:"accessToken" json:"accessToken"` +} + +// RemoteFollowJSONBody defines parameters for RemoteFollow. +type RemoteFollowJSONBody struct { + Account *string `json:"account,omitempty"` +} + +// CreateExternalAPIUserJSONRequestBody defines body for CreateExternalAPIUser for application/json ContentType. +type CreateExternalAPIUserJSONRequestBody CreateExternalAPIUserJSONBody + +// DeleteExternalAPIUserJSONRequestBody defines body for DeleteExternalAPIUser for application/json ContentType. +type DeleteExternalAPIUserJSONRequestBody DeleteExternalAPIUserJSONBody + +// UpdateMessageVisibilityAdminJSONRequestBody defines body for UpdateMessageVisibilityAdmin for application/json ContentType. +type UpdateMessageVisibilityAdminJSONRequestBody = MessageVisibilityUpdate + +// BanIPAddressJSONRequestBody defines body for BanIPAddress for application/json ContentType. +type BanIPAddressJSONRequestBody = AdminConfigValue + +// UnbanIPAddressJSONRequestBody defines body for UnbanIPAddress for application/json ContentType. +type UnbanIPAddressJSONRequestBody = AdminConfigValue + +// UpdateUserEnabledAdminJSONRequestBody defines body for UpdateUserEnabledAdmin for application/json ContentType. +type UpdateUserEnabledAdminJSONRequestBody UpdateUserEnabledAdminJSONBody + +// UpdateUserModeratorJSONRequestBody defines body for UpdateUserModerator for application/json ContentType. +type UpdateUserModeratorJSONRequestBody UpdateUserModeratorJSONBody + +// SetAdminPasswordJSONRequestBody defines body for SetAdminPassword for application/json ContentType. +type SetAdminPasswordJSONRequestBody = AdminConfigValue + +// SetCustomColorVariableValuesJSONRequestBody defines body for SetCustomColorVariableValues for application/json ContentType. +type SetCustomColorVariableValuesJSONRequestBody SetCustomColorVariableValuesJSONBody + +// SetChatDisabledJSONRequestBody defines body for SetChatDisabled for application/json ContentType. +type SetChatDisabledJSONRequestBody = AdminConfigValue + +// SetEnableEstablishedChatUserModeJSONRequestBody defines body for SetEnableEstablishedChatUserMode for application/json ContentType. +type SetEnableEstablishedChatUserModeJSONRequestBody = AdminConfigValue + +// SetForbiddenUsernameListJSONRequestBody defines body for SetForbiddenUsernameList for application/json ContentType. +type SetForbiddenUsernameListJSONRequestBody SetForbiddenUsernameListJSONBody + +// SetChatJoinMessagesEnabledJSONRequestBody defines body for SetChatJoinMessagesEnabled for application/json ContentType. +type SetChatJoinMessagesEnabledJSONRequestBody = AdminConfigValue + +// SetChatSlurFilterEnabledJSONRequestBody defines body for SetChatSlurFilterEnabled for application/json ContentType. +type SetChatSlurFilterEnabledJSONRequestBody = AdminConfigValue + +// SetChatSpamProtectionEnabledJSONRequestBody defines body for SetChatSpamProtectionEnabled for application/json ContentType. +type SetChatSpamProtectionEnabledJSONRequestBody = AdminConfigValue + +// SetSuggestedUsernameListJSONRequestBody defines body for SetSuggestedUsernameList for application/json ContentType. +type SetSuggestedUsernameListJSONRequestBody SetSuggestedUsernameListJSONBody + +// SetCustomJavascriptJSONRequestBody defines body for SetCustomJavascript for application/json ContentType. +type SetCustomJavascriptJSONRequestBody = AdminConfigValue + +// SetCustomStylesJSONRequestBody defines body for SetCustomStyles for application/json ContentType. +type SetCustomStylesJSONRequestBody = AdminConfigValue + +// SetDirectoryEnabledJSONRequestBody defines body for SetDirectoryEnabled for application/json ContentType. +type SetDirectoryEnabledJSONRequestBody = AdminConfigValue + +// SetDisableSearchIndexingJSONRequestBody defines body for SetDisableSearchIndexing for application/json ContentType. +type SetDisableSearchIndexingJSONRequestBody = AdminConfigValue + +// SetExternalActionsJSONRequestBody defines body for SetExternalActions for application/json ContentType. +type SetExternalActionsJSONRequestBody SetExternalActionsJSONBody + +// SetFederationBlockDomainsJSONRequestBody defines body for SetFederationBlockDomains for application/json ContentType. +type SetFederationBlockDomainsJSONRequestBody = AdminConfigValue + +// SetFederationEnabledJSONRequestBody defines body for SetFederationEnabled for application/json ContentType. +type SetFederationEnabledJSONRequestBody = AdminConfigValue + +// SetFederationGoLiveMessageJSONRequestBody defines body for SetFederationGoLiveMessage for application/json ContentType. +type SetFederationGoLiveMessageJSONRequestBody = AdminConfigValue + +// SetFederationActivityPrivateJSONRequestBody defines body for SetFederationActivityPrivate for application/json ContentType. +type SetFederationActivityPrivateJSONRequestBody = AdminConfigValue + +// SetFederationShowEngagementJSONRequestBody defines body for SetFederationShowEngagement for application/json ContentType. +type SetFederationShowEngagementJSONRequestBody = AdminConfigValue + +// SetFederationUsernameJSONRequestBody defines body for SetFederationUsername for application/json ContentType. +type SetFederationUsernameJSONRequestBody = AdminConfigValue + +// SetFfmpegPathJSONRequestBody defines body for SetFfmpegPath for application/json ContentType. +type SetFfmpegPathJSONRequestBody = AdminConfigValue + +// SetHideViewerCountJSONRequestBody defines body for SetHideViewerCount for application/json ContentType. +type SetHideViewerCountJSONRequestBody = AdminConfigValue + +// SetLogoJSONRequestBody defines body for SetLogo for application/json ContentType. +type SetLogoJSONRequestBody = AdminConfigValue + +// SetServerNameJSONRequestBody defines body for SetServerName for application/json ContentType. +type SetServerNameJSONRequestBody = AdminConfigValue + +// SetBrowserNotificationConfigurationJSONRequestBody defines body for SetBrowserNotificationConfiguration for application/json ContentType. +type SetBrowserNotificationConfigurationJSONRequestBody SetBrowserNotificationConfigurationJSONBody + +// SetDiscordNotificationConfigurationJSONRequestBody defines body for SetDiscordNotificationConfiguration for application/json ContentType. +type SetDiscordNotificationConfigurationJSONRequestBody SetDiscordNotificationConfigurationJSONBody + +// SetNSFWJSONRequestBody defines body for SetNSFW for application/json ContentType. +type SetNSFWJSONRequestBody = AdminConfigValue + +// SetCustomOfflineMessageJSONRequestBody defines body for SetCustomOfflineMessage for application/json ContentType. +type SetCustomOfflineMessageJSONRequestBody = AdminConfigValue + +// SetExtraPageContentJSONRequestBody defines body for SetExtraPageContent for application/json ContentType. +type SetExtraPageContentJSONRequestBody = AdminConfigValue + +// SetRTMPServerPortJSONRequestBody defines body for SetRTMPServerPort for application/json ContentType. +type SetRTMPServerPortJSONRequestBody = AdminConfigValue + +// SetS3ConfigurationJSONRequestBody defines body for SetS3Configuration for application/json ContentType. +type SetS3ConfigurationJSONRequestBody SetS3ConfigurationJSONBody + +// SetServerSummaryJSONRequestBody defines body for SetServerSummary for application/json ContentType. +type SetServerSummaryJSONRequestBody = AdminConfigValue + +// SetServerURLJSONRequestBody defines body for SetServerURL for application/json ContentType. +type SetServerURLJSONRequestBody = AdminConfigValue + +// SetSocialHandlesJSONRequestBody defines body for SetSocialHandles for application/json ContentType. +type SetSocialHandlesJSONRequestBody SetSocialHandlesJSONBody + +// SetSocketHostOverrideJSONRequestBody defines body for SetSocketHostOverride for application/json ContentType. +type SetSocketHostOverrideJSONRequestBody = AdminConfigValue + +// SetStreamKeysJSONRequestBody defines body for SetStreamKeys for application/json ContentType. +type SetStreamKeysJSONRequestBody SetStreamKeysJSONBody + +// SetStreamTitleJSONRequestBody defines body for SetStreamTitle for application/json ContentType. +type SetStreamTitleJSONRequestBody = AdminConfigValue + +// SetTagsJSONRequestBody defines body for SetTags for application/json ContentType. +type SetTagsJSONRequestBody = AdminConfigValue + +// SetVideoCodecJSONRequestBody defines body for SetVideoCodec for application/json ContentType. +type SetVideoCodecJSONRequestBody = AdminConfigValue + +// SetStreamLatencyLevelJSONRequestBody defines body for SetStreamLatencyLevel for application/json ContentType. +type SetStreamLatencyLevelJSONRequestBody = AdminConfigValue + +// SetStreamOutputVariantsJSONRequestBody defines body for SetStreamOutputVariants for application/json ContentType. +type SetStreamOutputVariantsJSONRequestBody SetStreamOutputVariantsJSONBody + +// SetVideoServingEndpointJSONRequestBody defines body for SetVideoServingEndpoint for application/json ContentType. +type SetVideoServingEndpointJSONRequestBody = AdminConfigValue + +// SetWebServerIPJSONRequestBody defines body for SetWebServerIP for application/json ContentType. +type SetWebServerIPJSONRequestBody = AdminConfigValue + +// SetWebServerPortJSONRequestBody defines body for SetWebServerPort for application/json ContentType. +type SetWebServerPortJSONRequestBody = AdminConfigValue + +// SetServerWelcomeMessageJSONRequestBody defines body for SetServerWelcomeMessage for application/json ContentType. +type SetServerWelcomeMessageJSONRequestBody = AdminConfigValue + +// DeleteCustomEmojiJSONRequestBody defines body for DeleteCustomEmoji for application/json ContentType. +type DeleteCustomEmojiJSONRequestBody DeleteCustomEmojiJSONBody + +// UploadCustomEmojiJSONRequestBody defines body for UploadCustomEmoji for application/json ContentType. +type UploadCustomEmojiJSONRequestBody UploadCustomEmojiJSONBody + +// SendFederatedMessageJSONRequestBody defines body for SendFederatedMessage for application/json ContentType. +type SendFederatedMessageJSONRequestBody = AdminConfigValue + +// ApproveFollowerJSONRequestBody defines body for ApproveFollower for application/json ContentType. +type ApproveFollowerJSONRequestBody ApproveFollowerJSONBody + +// CreateWebhookJSONRequestBody defines body for CreateWebhook for application/json ContentType. +type CreateWebhookJSONRequestBody CreateWebhookJSONBody + +// DeleteWebhookJSONRequestBody defines body for DeleteWebhook for application/json ContentType. +type DeleteWebhookJSONRequestBody DeleteWebhookJSONBody + +// RegisterFediverseOTPRequestJSONRequestBody defines body for RegisterFediverseOTPRequest for application/json ContentType. +type RegisterFediverseOTPRequestJSONRequestBody RegisterFediverseOTPRequestJSONBody + +// VerifyFediverseOTPRequestJSONRequestBody defines body for VerifyFediverseOTPRequest for application/json ContentType. +type VerifyFediverseOTPRequestJSONRequestBody VerifyFediverseOTPRequestJSONBody + +// StartIndieAuthFlowJSONRequestBody defines body for StartIndieAuthFlow for application/json ContentType. +type StartIndieAuthFlowJSONRequestBody StartIndieAuthFlowJSONBody + +// HandleIndieAuthEndpointPostFormdataRequestBody defines body for HandleIndieAuthEndpointPost for application/x-www-form-urlencoded ContentType. +type HandleIndieAuthEndpointPostFormdataRequestBody HandleIndieAuthEndpointPostFormdataBody + +// UpdateMessageVisibilityJSONRequestBody defines body for UpdateMessageVisibility for application/json ContentType. +type UpdateMessageVisibilityJSONRequestBody = MessageVisibilityUpdate + +// RegisterAnonymousChatUserJSONRequestBody defines body for RegisterAnonymousChatUser for application/json ContentType. +type RegisterAnonymousChatUserJSONRequestBody RegisterAnonymousChatUserJSONBody + +// UpdateUserEnabledJSONRequestBody defines body for UpdateUserEnabled for application/json ContentType. +type UpdateUserEnabledJSONRequestBody UpdateUserEnabledJSONBody + +// SendChatActionJSONRequestBody defines body for SendChatAction for application/json ContentType. +type SendChatActionJSONRequestBody = SystemActionEvent + +// ExternalUpdateMessageVisibilityJSONRequestBody defines body for ExternalUpdateMessageVisibility for application/json ContentType. +type ExternalUpdateMessageVisibilityJSONRequestBody = MessageVisibilityUpdate + +// SendIntegrationChatMessageJSONRequestBody defines body for SendIntegrationChatMessage for application/json ContentType. +type SendIntegrationChatMessageJSONRequestBody = UserMessage + +// SendSystemMessageJSONRequestBody defines body for SendSystemMessage for application/json ContentType. +type SendSystemMessageJSONRequestBody = SystemMessage + +// SendSystemMessageToConnectedClientJSONRequestBody defines body for SendSystemMessageToConnectedClient for application/json ContentType. +type SendSystemMessageToConnectedClientJSONRequestBody = SystemMessage + +// ExternalSetStreamTitleJSONRequestBody defines body for ExternalSetStreamTitle for application/json ContentType. +type ExternalSetStreamTitleJSONRequestBody = AdminConfigValue + +// ReportPlaybackMetricsJSONRequestBody defines body for ReportPlaybackMetrics for application/json ContentType. +type ReportPlaybackMetricsJSONRequestBody = PlaybackMetrics + +// RegisterForLiveNotificationsJSONRequestBody defines body for RegisterForLiveNotifications for application/json ContentType. +type RegisterForLiveNotificationsJSONRequestBody RegisterForLiveNotificationsJSONBody + +// RemoteFollowJSONRequestBody defines body for RemoteFollow for application/json ContentType. +type RemoteFollowJSONRequestBody RemoteFollowJSONBody + +// AsAdminConfigValueValue0 returns the union data inside the AdminConfigValue_Value as a AdminConfigValueValue0 +func (t AdminConfigValue_Value) AsAdminConfigValueValue0() (AdminConfigValueValue0, error) { + var body AdminConfigValueValue0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAdminConfigValueValue0 overwrites any union data inside the AdminConfigValue_Value as the provided AdminConfigValueValue0 +func (t *AdminConfigValue_Value) FromAdminConfigValueValue0(v AdminConfigValueValue0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAdminConfigValueValue0 performs a merge with any union data inside the AdminConfigValue_Value, using the provided AdminConfigValueValue0 +func (t *AdminConfigValue_Value) MergeAdminConfigValueValue0(v AdminConfigValueValue0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAdminConfigValueValue1 returns the union data inside the AdminConfigValue_Value as a AdminConfigValueValue1 +func (t AdminConfigValue_Value) AsAdminConfigValueValue1() (AdminConfigValueValue1, error) { + var body AdminConfigValueValue1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAdminConfigValueValue1 overwrites any union data inside the AdminConfigValue_Value as the provided AdminConfigValueValue1 +func (t *AdminConfigValue_Value) FromAdminConfigValueValue1(v AdminConfigValueValue1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAdminConfigValueValue1 performs a merge with any union data inside the AdminConfigValue_Value, using the provided AdminConfigValueValue1 +func (t *AdminConfigValue_Value) MergeAdminConfigValueValue1(v AdminConfigValueValue1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAdminConfigValueValue2 returns the union data inside the AdminConfigValue_Value as a AdminConfigValueValue2 +func (t AdminConfigValue_Value) AsAdminConfigValueValue2() (AdminConfigValueValue2, error) { + var body AdminConfigValueValue2 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAdminConfigValueValue2 overwrites any union data inside the AdminConfigValue_Value as the provided AdminConfigValueValue2 +func (t *AdminConfigValue_Value) FromAdminConfigValueValue2(v AdminConfigValueValue2) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAdminConfigValueValue2 performs a merge with any union data inside the AdminConfigValue_Value, using the provided AdminConfigValueValue2 +func (t *AdminConfigValue_Value) MergeAdminConfigValueValue2(v AdminConfigValueValue2) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAdminConfigValueValue3 returns the union data inside the AdminConfigValue_Value as a AdminConfigValueValue3 +func (t AdminConfigValue_Value) AsAdminConfigValueValue3() (AdminConfigValueValue3, error) { + var body AdminConfigValueValue3 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAdminConfigValueValue3 overwrites any union data inside the AdminConfigValue_Value as the provided AdminConfigValueValue3 +func (t *AdminConfigValue_Value) FromAdminConfigValueValue3(v AdminConfigValueValue3) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAdminConfigValueValue3 performs a merge with any union data inside the AdminConfigValue_Value, using the provided AdminConfigValueValue3 +func (t *AdminConfigValue_Value) MergeAdminConfigValueValue3(v AdminConfigValueValue3) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t AdminConfigValue_Value) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *AdminConfigValue_Value) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsUserMessage returns the union data inside the ChatMessages_Item as a UserMessage +func (t ChatMessages_Item) AsUserMessage() (UserMessage, error) { + var body UserMessage + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromUserMessage overwrites any union data inside the ChatMessages_Item as the provided UserMessage +func (t *ChatMessages_Item) FromUserMessage(v UserMessage) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeUserMessage performs a merge with any union data inside the ChatMessages_Item, using the provided UserMessage +func (t *ChatMessages_Item) MergeUserMessage(v UserMessage) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsSystemMessage returns the union data inside the ChatMessages_Item as a SystemMessage +func (t ChatMessages_Item) AsSystemMessage() (SystemMessage, error) { + var body SystemMessage + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromSystemMessage overwrites any union data inside the ChatMessages_Item as the provided SystemMessage +func (t *ChatMessages_Item) FromSystemMessage(v SystemMessage) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeSystemMessage performs a merge with any union data inside the ChatMessages_Item, using the provided SystemMessage +func (t *ChatMessages_Item) MergeSystemMessage(v SystemMessage) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsActionMessage returns the union data inside the ChatMessages_Item as a ActionMessage +func (t ChatMessages_Item) AsActionMessage() (ActionMessage, error) { + var body ActionMessage + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromActionMessage overwrites any union data inside the ChatMessages_Item as the provided ActionMessage +func (t *ChatMessages_Item) FromActionMessage(v ActionMessage) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeActionMessage performs a merge with any union data inside the ChatMessages_Item, using the provided ActionMessage +func (t *ChatMessages_Item) MergeActionMessage(v ActionMessage) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsFederatedAction returns the union data inside the ChatMessages_Item as a FederatedAction +func (t ChatMessages_Item) AsFederatedAction() (FederatedAction, error) { + var body FederatedAction + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromFederatedAction overwrites any union data inside the ChatMessages_Item as the provided FederatedAction +func (t *ChatMessages_Item) FromFederatedAction(v FederatedAction) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeFederatedAction performs a merge with any union data inside the ChatMessages_Item, using the provided FederatedAction +func (t *ChatMessages_Item) MergeFederatedAction(v FederatedAction) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t ChatMessages_Item) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *ChatMessages_Item) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} diff --git a/handler/generated/generated.gen.go b/handler/generated/generated.gen.go new file mode 100644 index 000000000..1fc4cea8e --- /dev/null +++ b/handler/generated/generated.gen.go @@ -0,0 +1,6297 @@ +// Package generated provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT. +package generated + +import ( + "context" + "fmt" + "net/http" + + "github.com/go-chi/chi/v5" + "github.com/oapi-codegen/runtime" +) + +// ServerInterface represents all server handlers. +type ServerInterface interface { + // Get all access tokens + // (GET /admin/accesstokens) + GetExternalAPIUsers(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/accesstokens) + GetExternalAPIUsersOptions(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/accesstokens/create) + CreateExternalAPIUserOptions(w http.ResponseWriter, r *http.Request) + // Create a single access token + // (POST /admin/accesstokens/create) + CreateExternalAPIUser(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/accesstokens/delete) + DeleteExternalAPIUserOptions(w http.ResponseWriter, r *http.Request) + // Delete a single external API user + // (POST /admin/accesstokens/delete) + DeleteExternalAPIUser(w http.ResponseWriter, r *http.Request) + // Get a detailed list of currently connected chat clients + // (GET /admin/chat/clients) + GetConnectedChatClients(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/chat/clients) + GetConnectedChatClientsOptions(w http.ResponseWriter, r *http.Request) + // Get all chat messages for the admin, unfiltered + // (GET /admin/chat/messages) + GetChatMessagesAdmin(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/chat/messages) + GetChatMessagesAdminOptions(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/chat/messagevisibility) + UpdateMessageVisibilityAdminOptions(w http.ResponseWriter, r *http.Request) + // Update visibility of chat messages + // (POST /admin/chat/messagevisibility) + UpdateMessageVisibilityAdmin(w http.ResponseWriter, r *http.Request) + // Get a list of disabled users + // (GET /admin/chat/users/disabled) + GetDisabledUsers(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/chat/users/disabled) + GetDisabledUsersOptions(w http.ResponseWriter, r *http.Request) + // Get all banned IP addresses + // (GET /admin/chat/users/ipbans) + GetIPAddressBans(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/chat/users/ipbans) + GetIPAddressBansOptions(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/chat/users/ipbans/create) + BanIPAddressOptions(w http.ResponseWriter, r *http.Request) + // Ban an IP address + // (POST /admin/chat/users/ipbans/create) + BanIPAddress(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/chat/users/ipbans/remove) + UnbanIPAddressOptions(w http.ResponseWriter, r *http.Request) + // Remove an IP ban + // (POST /admin/chat/users/ipbans/remove) + UnbanIPAddress(w http.ResponseWriter, r *http.Request) + // Get a list of moderator users + // (GET /admin/chat/users/moderators) + GetModerators(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/chat/users/moderators) + GetModeratorsOptions(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/chat/users/setenabled) + UpdateUserEnabledAdminOptions(w http.ResponseWriter, r *http.Request) + // Enable or disable a user + // (POST /admin/chat/users/setenabled) + UpdateUserEnabledAdmin(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/chat/users/setmoderator) + UpdateUserModeratorOptions(w http.ResponseWriter, r *http.Request) + // Set moderator status for a user + // (POST /admin/chat/users/setmoderator) + UpdateUserModerator(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/adminpass) + SetAdminPasswordOptions(w http.ResponseWriter, r *http.Request) + // Change the current admin password + // (POST /admin/config/adminpass) + SetAdminPassword(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/appearance) + SetCustomColorVariableValuesOptions(w http.ResponseWriter, r *http.Request) + // Set style/color/css values + // (POST /admin/config/appearance) + SetCustomColorVariableValues(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/chat/disable) + SetChatDisabledOptions(w http.ResponseWriter, r *http.Request) + // Disable chat + // (POST /admin/config/chat/disable) + SetChatDisabled(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/chat/establishedusermode) + SetEnableEstablishedChatUserModeOptions(w http.ResponseWriter, r *http.Request) + // Enable/disable chat established user mode + // (POST /admin/config/chat/establishedusermode) + SetEnableEstablishedChatUserMode(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/chat/forbiddenusernames) + SetForbiddenUsernameListOptions(w http.ResponseWriter, r *http.Request) + // Set chat usernames that are not allowed + // (POST /admin/config/chat/forbiddenusernames) + SetForbiddenUsernameList(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/chat/joinmessagesenabled) + SetChatJoinMessagesEnabledOptions(w http.ResponseWriter, r *http.Request) + // Enable chat for user join messages + // (POST /admin/config/chat/joinmessagesenabled) + SetChatJoinMessagesEnabled(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/chat/slurfilterenabled) + SetChatSlurFilterEnabledOptions(w http.ResponseWriter, r *http.Request) + // Set slur filter enabled + // (POST /admin/config/chat/slurfilterenabled) + SetChatSlurFilterEnabled(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/chat/spamprotectionenabled) + SetChatSpamProtectionEnabledOptions(w http.ResponseWriter, r *http.Request) + // Set spam protection enabled + // (POST /admin/config/chat/spamprotectionenabled) + SetChatSpamProtectionEnabled(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/chat/suggestedusernames) + SetSuggestedUsernameListOptions(w http.ResponseWriter, r *http.Request) + // Set the suggested chat usernames that will be assigned automatically + // (POST /admin/config/chat/suggestedusernames) + SetSuggestedUsernameList(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/customjavascript) + SetCustomJavascriptOptions(w http.ResponseWriter, r *http.Request) + // Update custom JavaScript + // (POST /admin/config/customjavascript) + SetCustomJavascript(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/customstyles) + SetCustomStylesOptions(w http.ResponseWriter, r *http.Request) + // Update custom styles + // (POST /admin/config/customstyles) + SetCustomStyles(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/directoryenabled) + SetDirectoryEnabledOptions(w http.ResponseWriter, r *http.Request) + // Update directory enabled + // (POST /admin/config/directoryenabled) + SetDirectoryEnabled(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/disablesearchindexing) + SetDisableSearchIndexingOptions(w http.ResponseWriter, r *http.Request) + // Update search indexing + // (POST /admin/config/disablesearchindexing) + SetDisableSearchIndexing(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/externalactions) + SetExternalActionsOptions(w http.ResponseWriter, r *http.Request) + // Update external action links + // (POST /admin/config/externalactions) + SetExternalActions(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/federation/blockdomains) + SetFederationBlockDomainsOptions(w http.ResponseWriter, r *http.Request) + // Set Federation blocked domains + // (POST /admin/config/federation/blockdomains) + SetFederationBlockDomains(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/federation/enable) + SetFederationEnabledOptions(w http.ResponseWriter, r *http.Request) + // Enable/disable federation features + // (POST /admin/config/federation/enable) + SetFederationEnabled(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/federation/livemessage) + SetFederationGoLiveMessageOptions(w http.ResponseWriter, r *http.Request) + // Set federated go live message + // (POST /admin/config/federation/livemessage) + SetFederationGoLiveMessage(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/federation/private) + SetFederationActivityPrivateOptions(w http.ResponseWriter, r *http.Request) + // Set if federation activities are private + // (POST /admin/config/federation/private) + SetFederationActivityPrivate(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/federation/showengagement) + SetFederationShowEngagementOptions(w http.ResponseWriter, r *http.Request) + // Set if fediverse engagement appears in chat + // (POST /admin/config/federation/showengagement) + SetFederationShowEngagement(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/federation/username) + SetFederationUsernameOptions(w http.ResponseWriter, r *http.Request) + // Set local federated username + // (POST /admin/config/federation/username) + SetFederationUsername(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/ffmpegpath) + SetFfmpegPathOptions(w http.ResponseWriter, r *http.Request) + // Update FFMPEG path + // (POST /admin/config/ffmpegpath) + SetFfmpegPath(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/hideviewercount) + SetHideViewerCountOptions(w http.ResponseWriter, r *http.Request) + // Update hide viewer count + // (POST /admin/config/hideviewercount) + SetHideViewerCount(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/logo) + SetLogoOptions(w http.ResponseWriter, r *http.Request) + // Update logo + // (POST /admin/config/logo) + SetLogo(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/name) + SetServerNameOptions(w http.ResponseWriter, r *http.Request) + // Change the server name + // (POST /admin/config/name) + SetServerName(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/notifications/browser) + SetBrowserNotificationConfigurationOptions(w http.ResponseWriter, r *http.Request) + // Configure Browser notifications + // (POST /admin/config/notifications/browser) + SetBrowserNotificationConfiguration(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/notifications/discord) + SetDiscordNotificationConfigurationOptions(w http.ResponseWriter, r *http.Request) + // Configure Discord notifications + // (POST /admin/config/notifications/discord) + SetDiscordNotificationConfiguration(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/nsfw) + SetNSFWOptions(w http.ResponseWriter, r *http.Request) + // Update NSFW marking + // (POST /admin/config/nsfw) + SetNSFW(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/offlinemessage) + SetCustomOfflineMessageOptions(w http.ResponseWriter, r *http.Request) + // Change the offline message + // (POST /admin/config/offlinemessage) + SetCustomOfflineMessage(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/pagecontent) + SetExtraPageContentOptions(w http.ResponseWriter, r *http.Request) + // Change the extra page content in memory + // (POST /admin/config/pagecontent) + SetExtraPageContent(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/rtmpserverport) + SetRTMPServerPortOptions(w http.ResponseWriter, r *http.Request) + // Update RTMP post + // (POST /admin/config/rtmpserverport) + SetRTMPServerPort(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/s3) + SetS3ConfigurationOptions(w http.ResponseWriter, r *http.Request) + // Update S3 configuration + // (POST /admin/config/s3) + SetS3Configuration(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/serversummary) + SetServerSummaryOptions(w http.ResponseWriter, r *http.Request) + // Change the server summary + // (POST /admin/config/serversummary) + SetServerSummary(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/serverurl) + SetServerURLOptions(w http.ResponseWriter, r *http.Request) + // Update server url + // (POST /admin/config/serverurl) + SetServerURL(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/socialhandles) + SetSocialHandlesOptions(w http.ResponseWriter, r *http.Request) + // Update social handles + // (POST /admin/config/socialhandles) + SetSocialHandles(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/sockethostoverride) + SetSocketHostOverrideOptions(w http.ResponseWriter, r *http.Request) + // Update websocket host override + // (POST /admin/config/sockethostoverride) + SetSocketHostOverride(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/streamkeys) + SetStreamKeysOptions(w http.ResponseWriter, r *http.Request) + // Set an array of valid stream keys + // (POST /admin/config/streamkeys) + SetStreamKeys(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/streamtitle) + SetStreamTitleOptions(w http.ResponseWriter, r *http.Request) + // Change the stream title + // (POST /admin/config/streamtitle) + SetStreamTitle(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/tags) + SetTagsOptions(w http.ResponseWriter, r *http.Request) + // Update server tags + // (POST /admin/config/tags) + SetTags(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/video/codec) + SetVideoCodecOptions(w http.ResponseWriter, r *http.Request) + // Set video codec + // (POST /admin/config/video/codec) + SetVideoCodec(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/video/streamlatencylevel) + SetStreamLatencyLevelOptions(w http.ResponseWriter, r *http.Request) + // Set the number of video segments and duration per segment in a playlist + // (POST /admin/config/video/streamlatencylevel) + SetStreamLatencyLevel(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/video/streamoutputvariants) + SetStreamOutputVariantsOptions(w http.ResponseWriter, r *http.Request) + // Set an array of video output configurations + // (POST /admin/config/video/streamoutputvariants) + SetStreamOutputVariants(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/videoservingendpoint) + SetVideoServingEndpointOptions(w http.ResponseWriter, r *http.Request) + // Update custom video serving endpoint + // (POST /admin/config/videoservingendpoint) + SetVideoServingEndpoint(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/webserverip) + SetWebServerIPOptions(w http.ResponseWriter, r *http.Request) + // Update server IP address + // (POST /admin/config/webserverip) + SetWebServerIP(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/webserverport) + SetWebServerPortOptions(w http.ResponseWriter, r *http.Request) + // Update server port + // (POST /admin/config/webserverport) + SetWebServerPort(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/config/welcomemessage) + SetServerWelcomeMessageOptions(w http.ResponseWriter, r *http.Request) + // Change the welcome message + // (POST /admin/config/welcomemessage) + SetServerWelcomeMessage(w http.ResponseWriter, r *http.Request) + // Disconnect inbound stream + // (GET /admin/disconnect) + DisconnectInboundConnection(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/disconnect) + DisconnectInboundConnectionOptions(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/emoji/delete) + DeleteCustomEmojiOptions(w http.ResponseWriter, r *http.Request) + // Delete custom emoji + // (POST /admin/emoji/delete) + DeleteCustomEmoji(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/emoji/upload) + UploadCustomEmojiOptions(w http.ResponseWriter, r *http.Request) + // Upload custom emoji + // (POST /admin/emoji/upload) + UploadCustomEmoji(w http.ResponseWriter, r *http.Request) + // Get a paginated list of federated activities + // (GET /admin/federation/actions) + GetFederatedActions(w http.ResponseWriter, r *http.Request, params GetFederatedActionsParams) + + // (OPTIONS /admin/federation/actions) + GetFederatedActionsOptions(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/federation/send) + SendFederatedMessageOptions(w http.ResponseWriter, r *http.Request) + // Send a public message to the Fediverse from the server's user + // (POST /admin/federation/send) + SendFederatedMessage(w http.ResponseWriter, r *http.Request) + // Get followers + // (GET /admin/followers) + GetFollowersAdmin(w http.ResponseWriter, r *http.Request, params GetFollowersAdminParams) + + // (OPTIONS /admin/followers) + GetFollowersAdminOptions(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/followers/approve) + ApproveFollowerOptions(w http.ResponseWriter, r *http.Request) + // Set the following state of a follower or follow request + // (POST /admin/followers/approve) + ApproveFollower(w http.ResponseWriter, r *http.Request) + // Get a list of rejected or blocked follows + // (GET /admin/followers/blocked) + GetBlockedAndRejectedFollowers(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/followers/blocked) + GetBlockedAndRejectedFollowersOptions(w http.ResponseWriter, r *http.Request) + // Get a list of pending follow requests + // (GET /admin/followers/pending) + GetPendingFollowRequests(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/followers/pending) + GetPendingFollowRequestsOptions(w http.ResponseWriter, r *http.Request) + // Get the current hardware stats + // (GET /admin/hardwarestats) + GetHardwareStats(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/hardwarestats) + GetHardwareStatsOptions(w http.ResponseWriter, r *http.Request) + // Get all logs + // (GET /admin/logs) + GetLogs(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/logs) + GetLogsOptions(w http.ResponseWriter, r *http.Request) + // Get warning/error logs + // (GET /admin/logs/warnings) + GetWarnings(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/logs/warnings) + GetWarningsOptions(w http.ResponseWriter, r *http.Request) + // Get video playback metrics + // (GET /admin/metrics/video) + GetVideoPlaybackMetrics(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/metrics/video) + GetVideoPlaybackMetricsOptions(w http.ResponseWriter, r *http.Request) + // Endpoint to interface with Prometheus + // (DELETE /admin/prometheus) + DeletePrometheusAPI(w http.ResponseWriter, r *http.Request) + // Endpoint to interface with Prometheus + // (GET /admin/prometheus) + GetPrometheusAPI(w http.ResponseWriter, r *http.Request) + // Endpoint to interface with Prometheus + // (OPTIONS /admin/prometheus) + OptionsPrometheusAPI(w http.ResponseWriter, r *http.Request) + // Endpoint to interface with Prometheus + // (POST /admin/prometheus) + PostPrometheusAPI(w http.ResponseWriter, r *http.Request) + // Endpoint to interface with Prometheus + // (PUT /admin/prometheus) + PutPrometheusAPI(w http.ResponseWriter, r *http.Request) + // Get the current server config + // (GET /admin/serverconfig) + GetServerConfig(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/serverconfig) + GetServerConfigOptions(w http.ResponseWriter, r *http.Request) + // Get current inboard broadcaster + // (GET /admin/status) + StatusAdmin(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/status) + StatusAdminOptions(w http.ResponseWriter, r *http.Request) + // Force quit the server and restart it + // (GET /admin/update/forcequit) + AutoUpdateForceQuit(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/update/forcequit) + AutoUpdateForceQuitOptions(w http.ResponseWriter, r *http.Request) + // Return the auto-update features that are supported for this instance + // (GET /admin/update/options) + AutoUpdateOptions(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/update/options) + AutoUpdateOptionsOptions(w http.ResponseWriter, r *http.Request) + // Begin the auto-update + // (GET /admin/update/start) + AutoUpdateStart(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/update/start) + AutoUpdateStartOptions(w http.ResponseWriter, r *http.Request) + // Get active viewers + // (GET /admin/viewers) + GetActiveViewers(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/viewers) + GetActiveViewersOptions(w http.ResponseWriter, r *http.Request) + // Get viewer count over time + // (GET /admin/viewersOverTime) + GetViewersOverTime(w http.ResponseWriter, r *http.Request, params GetViewersOverTimeParams) + + // (OPTIONS /admin/viewersOverTime) + GetViewersOverTimeOptions(w http.ResponseWriter, r *http.Request) + // Get all the webhooks + // (GET /admin/webhooks) + GetWebhooks(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/webhooks) + GetWebhooksOptions(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/webhooks/create) + CreateWebhookOptions(w http.ResponseWriter, r *http.Request) + // Create a single webhook + // (POST /admin/webhooks/create) + CreateWebhook(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/webhooks/delete) + DeleteWebhookOptions(w http.ResponseWriter, r *http.Request) + // Delete a single webhook + // (POST /admin/webhooks/delete) + DeleteWebhook(w http.ResponseWriter, r *http.Request) + // Reset YP configuration + // (GET /admin/yp/reset) + ResetYPRegistration(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /admin/yp/reset) + ResetYPRegistrationOptions(w http.ResponseWriter, r *http.Request) + // Register a Fediverse OTP request + // (POST /auth/fediverse) + RegisterFediverseOTPRequest(w http.ResponseWriter, r *http.Request, params RegisterFediverseOTPRequestParams) + // Verify Fediverse OTP code + // (POST /auth/fediverse/verify) + VerifyFediverseOTPRequest(w http.ResponseWriter, r *http.Request) + // Begins auth flow + // (POST /auth/indieauth) + StartIndieAuthFlow(w http.ResponseWriter, r *http.Request, params StartIndieAuthFlowParams) + // Handle the redirect from an IndieAuth server to continue the auth flow + // (GET /auth/indieauth/callback) + HandleIndieAuthRedirect(w http.ResponseWriter, r *http.Request, params HandleIndieAuthRedirectParams) + // Handles the IndieAuth auth endpoint + // (GET /auth/provider/indieauth) + HandleIndieAuthEndpointGet(w http.ResponseWriter, r *http.Request, params HandleIndieAuthEndpointGetParams) + // Handles IndieAuth from form submission + // (POST /auth/provider/indieauth) + HandleIndieAuthEndpointPost(w http.ResponseWriter, r *http.Request) + // Gets a list of chat messages + // (GET /chat) + GetChatMessages(w http.ResponseWriter, r *http.Request, params GetChatMessagesParams) + // Update chat message visibility + // (POST /chat/messagevisibility) + UpdateMessageVisibility(w http.ResponseWriter, r *http.Request, params UpdateMessageVisibilityParams) + + // (OPTIONS /chat/register) + RegisterAnonymousChatUserOptions(w http.ResponseWriter, r *http.Request) + // Registers an anonymous chat user + // (POST /chat/register) + RegisterAnonymousChatUser(w http.ResponseWriter, r *http.Request, params RegisterAnonymousChatUserParams) + // Enable/disable a user + // (POST /chat/users/setenabled) + UpdateUserEnabled(w http.ResponseWriter, r *http.Request, params UpdateUserEnabledParams) + // Get the web config + // (GET /config) + GetWebConfig(w http.ResponseWriter, r *http.Request) + // Get list of custom emojis supported in the chat + // (GET /emoji) + GetCustomEmojiList(w http.ResponseWriter, r *http.Request) + // Gets the list of followers + // (GET /followers) + GetFollowers(w http.ResponseWriter, r *http.Request, params GetFollowersParams) + // Get chat history + // (GET /integrations/chat) + ExternalGetChatMessages(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /integrations/chat) + ExternalGetChatMessagesOptions(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /integrations/chat/action) + SendChatActionOptions(w http.ResponseWriter, r *http.Request) + // Send a user action to chat + // (POST /integrations/chat/action) + SendChatAction(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /integrations/chat/messagevisibility) + ExternalUpdateMessageVisibilityOptions(w http.ResponseWriter, r *http.Request) + // Hide chat message + // (POST /integrations/chat/messagevisibility) + ExternalUpdateMessageVisibility(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /integrations/chat/send) + SendIntegrationChatMessageOptions(w http.ResponseWriter, r *http.Request) + // Send a message to chat as a specific 3rd party bot/integration based on its access token + // (POST /integrations/chat/send) + SendIntegrationChatMessage(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /integrations/chat/system) + SendSystemMessageOptions(w http.ResponseWriter, r *http.Request) + // Send a system message to the chat + // (POST /integrations/chat/system) + SendSystemMessage(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /integrations/chat/system/client/{clientId}) + SendSystemMessageToConnectedClientOptions(w http.ResponseWriter, r *http.Request, clientId int) + // Send a system message to a single client + // (POST /integrations/chat/system/client/{clientId}) + SendSystemMessageToConnectedClient(w http.ResponseWriter, r *http.Request, clientId int) + + // (OPTIONS /integrations/chat/user) + SendUserMessageOptions(w http.ResponseWriter, r *http.Request) + // Send a user message to chat + // (POST /integrations/chat/user) + SendUserMessage(w http.ResponseWriter, r *http.Request) + // Connected clients + // (GET /integrations/clients) + ExternalGetConnectedChatClients(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /integrations/clients) + ExternalGetConnectedChatClientsOptions(w http.ResponseWriter, r *http.Request) + + // (OPTIONS /integrations/streamtitle) + ExternalSetStreamTitleOptions(w http.ResponseWriter, r *http.Request) + // Stream title + // (POST /integrations/streamtitle) + ExternalSetStreamTitle(w http.ResponseWriter, r *http.Request) + // Save video playback metrics for future video health recording + // (POST /metrics/playback) + ReportPlaybackMetrics(w http.ResponseWriter, r *http.Request) + // Get a user's details + // (GET /moderation/chat/user/{userId}) + GetUserDetails(w http.ResponseWriter, r *http.Request, userId string, params GetUserDetailsParams) + // Register for notifications + // (POST /notifications/register) + RegisterForLiveNotifications(w http.ResponseWriter, r *http.Request, params RegisterForLiveNotificationsParams) + // Tell the backend you're an active viewer + // (GET /ping) + Ping(w http.ResponseWriter, r *http.Request) + // Request remote follow + // (POST /remotefollow) + RemoteFollow(w http.ResponseWriter, r *http.Request) + // Get all social platforms + // (GET /socialplatforms) + GetAllSocialPlatforms(w http.ResponseWriter, r *http.Request) + // Get the status of the server + // (GET /status) + GetStatus(w http.ResponseWriter, r *http.Request) + // Get a list of video variants available + // (GET /video/variants) + GetVideoStreamOutputVariants(w http.ResponseWriter, r *http.Request) + // Get the YP protocol data + // (GET /yp) + GetYPResponse(w http.ResponseWriter, r *http.Request) +} + +// Unimplemented server implementation that returns http.StatusNotImplemented for each endpoint. + +type Unimplemented struct{} + +// Get all access tokens +// (GET /admin/accesstokens) +func (_ Unimplemented) GetExternalAPIUsers(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/accesstokens) +func (_ Unimplemented) GetExternalAPIUsersOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/accesstokens/create) +func (_ Unimplemented) CreateExternalAPIUserOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Create a single access token +// (POST /admin/accesstokens/create) +func (_ Unimplemented) CreateExternalAPIUser(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/accesstokens/delete) +func (_ Unimplemented) DeleteExternalAPIUserOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Delete a single external API user +// (POST /admin/accesstokens/delete) +func (_ Unimplemented) DeleteExternalAPIUser(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get a detailed list of currently connected chat clients +// (GET /admin/chat/clients) +func (_ Unimplemented) GetConnectedChatClients(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/chat/clients) +func (_ Unimplemented) GetConnectedChatClientsOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get all chat messages for the admin, unfiltered +// (GET /admin/chat/messages) +func (_ Unimplemented) GetChatMessagesAdmin(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/chat/messages) +func (_ Unimplemented) GetChatMessagesAdminOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/chat/messagevisibility) +func (_ Unimplemented) UpdateMessageVisibilityAdminOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Update visibility of chat messages +// (POST /admin/chat/messagevisibility) +func (_ Unimplemented) UpdateMessageVisibilityAdmin(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get a list of disabled users +// (GET /admin/chat/users/disabled) +func (_ Unimplemented) GetDisabledUsers(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/chat/users/disabled) +func (_ Unimplemented) GetDisabledUsersOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get all banned IP addresses +// (GET /admin/chat/users/ipbans) +func (_ Unimplemented) GetIPAddressBans(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/chat/users/ipbans) +func (_ Unimplemented) GetIPAddressBansOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/chat/users/ipbans/create) +func (_ Unimplemented) BanIPAddressOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Ban an IP address +// (POST /admin/chat/users/ipbans/create) +func (_ Unimplemented) BanIPAddress(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/chat/users/ipbans/remove) +func (_ Unimplemented) UnbanIPAddressOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Remove an IP ban +// (POST /admin/chat/users/ipbans/remove) +func (_ Unimplemented) UnbanIPAddress(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get a list of moderator users +// (GET /admin/chat/users/moderators) +func (_ Unimplemented) GetModerators(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/chat/users/moderators) +func (_ Unimplemented) GetModeratorsOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/chat/users/setenabled) +func (_ Unimplemented) UpdateUserEnabledAdminOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Enable or disable a user +// (POST /admin/chat/users/setenabled) +func (_ Unimplemented) UpdateUserEnabledAdmin(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/chat/users/setmoderator) +func (_ Unimplemented) UpdateUserModeratorOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Set moderator status for a user +// (POST /admin/chat/users/setmoderator) +func (_ Unimplemented) UpdateUserModerator(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/adminpass) +func (_ Unimplemented) SetAdminPasswordOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Change the current admin password +// (POST /admin/config/adminpass) +func (_ Unimplemented) SetAdminPassword(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/appearance) +func (_ Unimplemented) SetCustomColorVariableValuesOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Set style/color/css values +// (POST /admin/config/appearance) +func (_ Unimplemented) SetCustomColorVariableValues(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/chat/disable) +func (_ Unimplemented) SetChatDisabledOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Disable chat +// (POST /admin/config/chat/disable) +func (_ Unimplemented) SetChatDisabled(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/chat/establishedusermode) +func (_ Unimplemented) SetEnableEstablishedChatUserModeOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Enable/disable chat established user mode +// (POST /admin/config/chat/establishedusermode) +func (_ Unimplemented) SetEnableEstablishedChatUserMode(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/chat/forbiddenusernames) +func (_ Unimplemented) SetForbiddenUsernameListOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Set chat usernames that are not allowed +// (POST /admin/config/chat/forbiddenusernames) +func (_ Unimplemented) SetForbiddenUsernameList(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/chat/joinmessagesenabled) +func (_ Unimplemented) SetChatJoinMessagesEnabledOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Enable chat for user join messages +// (POST /admin/config/chat/joinmessagesenabled) +func (_ Unimplemented) SetChatJoinMessagesEnabled(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/chat/slurfilterenabled) +func (_ Unimplemented) SetChatSlurFilterEnabledOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Set slur filter enabled +// (POST /admin/config/chat/slurfilterenabled) +func (_ Unimplemented) SetChatSlurFilterEnabled(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/chat/spamprotectionenabled) +func (_ Unimplemented) SetChatSpamProtectionEnabledOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Set spam protection enabled +// (POST /admin/config/chat/spamprotectionenabled) +func (_ Unimplemented) SetChatSpamProtectionEnabled(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/chat/suggestedusernames) +func (_ Unimplemented) SetSuggestedUsernameListOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Set the suggested chat usernames that will be assigned automatically +// (POST /admin/config/chat/suggestedusernames) +func (_ Unimplemented) SetSuggestedUsernameList(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/customjavascript) +func (_ Unimplemented) SetCustomJavascriptOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Update custom JavaScript +// (POST /admin/config/customjavascript) +func (_ Unimplemented) SetCustomJavascript(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/customstyles) +func (_ Unimplemented) SetCustomStylesOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Update custom styles +// (POST /admin/config/customstyles) +func (_ Unimplemented) SetCustomStyles(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/directoryenabled) +func (_ Unimplemented) SetDirectoryEnabledOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Update directory enabled +// (POST /admin/config/directoryenabled) +func (_ Unimplemented) SetDirectoryEnabled(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/disablesearchindexing) +func (_ Unimplemented) SetDisableSearchIndexingOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Update search indexing +// (POST /admin/config/disablesearchindexing) +func (_ Unimplemented) SetDisableSearchIndexing(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/externalactions) +func (_ Unimplemented) SetExternalActionsOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Update external action links +// (POST /admin/config/externalactions) +func (_ Unimplemented) SetExternalActions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/federation/blockdomains) +func (_ Unimplemented) SetFederationBlockDomainsOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Set Federation blocked domains +// (POST /admin/config/federation/blockdomains) +func (_ Unimplemented) SetFederationBlockDomains(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/federation/enable) +func (_ Unimplemented) SetFederationEnabledOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Enable/disable federation features +// (POST /admin/config/federation/enable) +func (_ Unimplemented) SetFederationEnabled(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/federation/livemessage) +func (_ Unimplemented) SetFederationGoLiveMessageOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Set federated go live message +// (POST /admin/config/federation/livemessage) +func (_ Unimplemented) SetFederationGoLiveMessage(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/federation/private) +func (_ Unimplemented) SetFederationActivityPrivateOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Set if federation activities are private +// (POST /admin/config/federation/private) +func (_ Unimplemented) SetFederationActivityPrivate(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/federation/showengagement) +func (_ Unimplemented) SetFederationShowEngagementOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Set if fediverse engagement appears in chat +// (POST /admin/config/federation/showengagement) +func (_ Unimplemented) SetFederationShowEngagement(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/federation/username) +func (_ Unimplemented) SetFederationUsernameOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Set local federated username +// (POST /admin/config/federation/username) +func (_ Unimplemented) SetFederationUsername(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/ffmpegpath) +func (_ Unimplemented) SetFfmpegPathOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Update FFMPEG path +// (POST /admin/config/ffmpegpath) +func (_ Unimplemented) SetFfmpegPath(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/hideviewercount) +func (_ Unimplemented) SetHideViewerCountOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Update hide viewer count +// (POST /admin/config/hideviewercount) +func (_ Unimplemented) SetHideViewerCount(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/logo) +func (_ Unimplemented) SetLogoOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Update logo +// (POST /admin/config/logo) +func (_ Unimplemented) SetLogo(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/name) +func (_ Unimplemented) SetServerNameOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Change the server name +// (POST /admin/config/name) +func (_ Unimplemented) SetServerName(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/notifications/browser) +func (_ Unimplemented) SetBrowserNotificationConfigurationOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Configure Browser notifications +// (POST /admin/config/notifications/browser) +func (_ Unimplemented) SetBrowserNotificationConfiguration(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/notifications/discord) +func (_ Unimplemented) SetDiscordNotificationConfigurationOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Configure Discord notifications +// (POST /admin/config/notifications/discord) +func (_ Unimplemented) SetDiscordNotificationConfiguration(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/nsfw) +func (_ Unimplemented) SetNSFWOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Update NSFW marking +// (POST /admin/config/nsfw) +func (_ Unimplemented) SetNSFW(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/offlinemessage) +func (_ Unimplemented) SetCustomOfflineMessageOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Change the offline message +// (POST /admin/config/offlinemessage) +func (_ Unimplemented) SetCustomOfflineMessage(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/pagecontent) +func (_ Unimplemented) SetExtraPageContentOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Change the extra page content in memory +// (POST /admin/config/pagecontent) +func (_ Unimplemented) SetExtraPageContent(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/rtmpserverport) +func (_ Unimplemented) SetRTMPServerPortOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Update RTMP post +// (POST /admin/config/rtmpserverport) +func (_ Unimplemented) SetRTMPServerPort(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/s3) +func (_ Unimplemented) SetS3ConfigurationOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Update S3 configuration +// (POST /admin/config/s3) +func (_ Unimplemented) SetS3Configuration(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/serversummary) +func (_ Unimplemented) SetServerSummaryOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Change the server summary +// (POST /admin/config/serversummary) +func (_ Unimplemented) SetServerSummary(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/serverurl) +func (_ Unimplemented) SetServerURLOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Update server url +// (POST /admin/config/serverurl) +func (_ Unimplemented) SetServerURL(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/socialhandles) +func (_ Unimplemented) SetSocialHandlesOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Update social handles +// (POST /admin/config/socialhandles) +func (_ Unimplemented) SetSocialHandles(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/sockethostoverride) +func (_ Unimplemented) SetSocketHostOverrideOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Update websocket host override +// (POST /admin/config/sockethostoverride) +func (_ Unimplemented) SetSocketHostOverride(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/streamkeys) +func (_ Unimplemented) SetStreamKeysOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Set an array of valid stream keys +// (POST /admin/config/streamkeys) +func (_ Unimplemented) SetStreamKeys(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/streamtitle) +func (_ Unimplemented) SetStreamTitleOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Change the stream title +// (POST /admin/config/streamtitle) +func (_ Unimplemented) SetStreamTitle(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/tags) +func (_ Unimplemented) SetTagsOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Update server tags +// (POST /admin/config/tags) +func (_ Unimplemented) SetTags(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/video/codec) +func (_ Unimplemented) SetVideoCodecOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Set video codec +// (POST /admin/config/video/codec) +func (_ Unimplemented) SetVideoCodec(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/video/streamlatencylevel) +func (_ Unimplemented) SetStreamLatencyLevelOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Set the number of video segments and duration per segment in a playlist +// (POST /admin/config/video/streamlatencylevel) +func (_ Unimplemented) SetStreamLatencyLevel(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/video/streamoutputvariants) +func (_ Unimplemented) SetStreamOutputVariantsOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Set an array of video output configurations +// (POST /admin/config/video/streamoutputvariants) +func (_ Unimplemented) SetStreamOutputVariants(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/videoservingendpoint) +func (_ Unimplemented) SetVideoServingEndpointOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Update custom video serving endpoint +// (POST /admin/config/videoservingendpoint) +func (_ Unimplemented) SetVideoServingEndpoint(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/webserverip) +func (_ Unimplemented) SetWebServerIPOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Update server IP address +// (POST /admin/config/webserverip) +func (_ Unimplemented) SetWebServerIP(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/webserverport) +func (_ Unimplemented) SetWebServerPortOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Update server port +// (POST /admin/config/webserverport) +func (_ Unimplemented) SetWebServerPort(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/config/welcomemessage) +func (_ Unimplemented) SetServerWelcomeMessageOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Change the welcome message +// (POST /admin/config/welcomemessage) +func (_ Unimplemented) SetServerWelcomeMessage(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Disconnect inbound stream +// (GET /admin/disconnect) +func (_ Unimplemented) DisconnectInboundConnection(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/disconnect) +func (_ Unimplemented) DisconnectInboundConnectionOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/emoji/delete) +func (_ Unimplemented) DeleteCustomEmojiOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Delete custom emoji +// (POST /admin/emoji/delete) +func (_ Unimplemented) DeleteCustomEmoji(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/emoji/upload) +func (_ Unimplemented) UploadCustomEmojiOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Upload custom emoji +// (POST /admin/emoji/upload) +func (_ Unimplemented) UploadCustomEmoji(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get a paginated list of federated activities +// (GET /admin/federation/actions) +func (_ Unimplemented) GetFederatedActions(w http.ResponseWriter, r *http.Request, params GetFederatedActionsParams) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/federation/actions) +func (_ Unimplemented) GetFederatedActionsOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/federation/send) +func (_ Unimplemented) SendFederatedMessageOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Send a public message to the Fediverse from the server's user +// (POST /admin/federation/send) +func (_ Unimplemented) SendFederatedMessage(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get followers +// (GET /admin/followers) +func (_ Unimplemented) GetFollowersAdmin(w http.ResponseWriter, r *http.Request, params GetFollowersAdminParams) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/followers) +func (_ Unimplemented) GetFollowersAdminOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/followers/approve) +func (_ Unimplemented) ApproveFollowerOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Set the following state of a follower or follow request +// (POST /admin/followers/approve) +func (_ Unimplemented) ApproveFollower(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get a list of rejected or blocked follows +// (GET /admin/followers/blocked) +func (_ Unimplemented) GetBlockedAndRejectedFollowers(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/followers/blocked) +func (_ Unimplemented) GetBlockedAndRejectedFollowersOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get a list of pending follow requests +// (GET /admin/followers/pending) +func (_ Unimplemented) GetPendingFollowRequests(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/followers/pending) +func (_ Unimplemented) GetPendingFollowRequestsOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the current hardware stats +// (GET /admin/hardwarestats) +func (_ Unimplemented) GetHardwareStats(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/hardwarestats) +func (_ Unimplemented) GetHardwareStatsOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get all logs +// (GET /admin/logs) +func (_ Unimplemented) GetLogs(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/logs) +func (_ Unimplemented) GetLogsOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get warning/error logs +// (GET /admin/logs/warnings) +func (_ Unimplemented) GetWarnings(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/logs/warnings) +func (_ Unimplemented) GetWarningsOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get video playback metrics +// (GET /admin/metrics/video) +func (_ Unimplemented) GetVideoPlaybackMetrics(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/metrics/video) +func (_ Unimplemented) GetVideoPlaybackMetricsOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Endpoint to interface with Prometheus +// (DELETE /admin/prometheus) +func (_ Unimplemented) DeletePrometheusAPI(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Endpoint to interface with Prometheus +// (GET /admin/prometheus) +func (_ Unimplemented) GetPrometheusAPI(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Endpoint to interface with Prometheus +// (OPTIONS /admin/prometheus) +func (_ Unimplemented) OptionsPrometheusAPI(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Endpoint to interface with Prometheus +// (POST /admin/prometheus) +func (_ Unimplemented) PostPrometheusAPI(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Endpoint to interface with Prometheus +// (PUT /admin/prometheus) +func (_ Unimplemented) PutPrometheusAPI(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the current server config +// (GET /admin/serverconfig) +func (_ Unimplemented) GetServerConfig(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/serverconfig) +func (_ Unimplemented) GetServerConfigOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get current inboard broadcaster +// (GET /admin/status) +func (_ Unimplemented) StatusAdmin(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/status) +func (_ Unimplemented) StatusAdminOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Force quit the server and restart it +// (GET /admin/update/forcequit) +func (_ Unimplemented) AutoUpdateForceQuit(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/update/forcequit) +func (_ Unimplemented) AutoUpdateForceQuitOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Return the auto-update features that are supported for this instance +// (GET /admin/update/options) +func (_ Unimplemented) AutoUpdateOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/update/options) +func (_ Unimplemented) AutoUpdateOptionsOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Begin the auto-update +// (GET /admin/update/start) +func (_ Unimplemented) AutoUpdateStart(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/update/start) +func (_ Unimplemented) AutoUpdateStartOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get active viewers +// (GET /admin/viewers) +func (_ Unimplemented) GetActiveViewers(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/viewers) +func (_ Unimplemented) GetActiveViewersOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get viewer count over time +// (GET /admin/viewersOverTime) +func (_ Unimplemented) GetViewersOverTime(w http.ResponseWriter, r *http.Request, params GetViewersOverTimeParams) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/viewersOverTime) +func (_ Unimplemented) GetViewersOverTimeOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get all the webhooks +// (GET /admin/webhooks) +func (_ Unimplemented) GetWebhooks(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/webhooks) +func (_ Unimplemented) GetWebhooksOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/webhooks/create) +func (_ Unimplemented) CreateWebhookOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Create a single webhook +// (POST /admin/webhooks/create) +func (_ Unimplemented) CreateWebhook(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/webhooks/delete) +func (_ Unimplemented) DeleteWebhookOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Delete a single webhook +// (POST /admin/webhooks/delete) +func (_ Unimplemented) DeleteWebhook(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Reset YP configuration +// (GET /admin/yp/reset) +func (_ Unimplemented) ResetYPRegistration(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /admin/yp/reset) +func (_ Unimplemented) ResetYPRegistrationOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Register a Fediverse OTP request +// (POST /auth/fediverse) +func (_ Unimplemented) RegisterFediverseOTPRequest(w http.ResponseWriter, r *http.Request, params RegisterFediverseOTPRequestParams) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Verify Fediverse OTP code +// (POST /auth/fediverse/verify) +func (_ Unimplemented) VerifyFediverseOTPRequest(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Begins auth flow +// (POST /auth/indieauth) +func (_ Unimplemented) StartIndieAuthFlow(w http.ResponseWriter, r *http.Request, params StartIndieAuthFlowParams) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Handle the redirect from an IndieAuth server to continue the auth flow +// (GET /auth/indieauth/callback) +func (_ Unimplemented) HandleIndieAuthRedirect(w http.ResponseWriter, r *http.Request, params HandleIndieAuthRedirectParams) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Handles the IndieAuth auth endpoint +// (GET /auth/provider/indieauth) +func (_ Unimplemented) HandleIndieAuthEndpointGet(w http.ResponseWriter, r *http.Request, params HandleIndieAuthEndpointGetParams) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Handles IndieAuth from form submission +// (POST /auth/provider/indieauth) +func (_ Unimplemented) HandleIndieAuthEndpointPost(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Gets a list of chat messages +// (GET /chat) +func (_ Unimplemented) GetChatMessages(w http.ResponseWriter, r *http.Request, params GetChatMessagesParams) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Update chat message visibility +// (POST /chat/messagevisibility) +func (_ Unimplemented) UpdateMessageVisibility(w http.ResponseWriter, r *http.Request, params UpdateMessageVisibilityParams) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /chat/register) +func (_ Unimplemented) RegisterAnonymousChatUserOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Registers an anonymous chat user +// (POST /chat/register) +func (_ Unimplemented) RegisterAnonymousChatUser(w http.ResponseWriter, r *http.Request, params RegisterAnonymousChatUserParams) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Enable/disable a user +// (POST /chat/users/setenabled) +func (_ Unimplemented) UpdateUserEnabled(w http.ResponseWriter, r *http.Request, params UpdateUserEnabledParams) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the web config +// (GET /config) +func (_ Unimplemented) GetWebConfig(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get list of custom emojis supported in the chat +// (GET /emoji) +func (_ Unimplemented) GetCustomEmojiList(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Gets the list of followers +// (GET /followers) +func (_ Unimplemented) GetFollowers(w http.ResponseWriter, r *http.Request, params GetFollowersParams) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get chat history +// (GET /integrations/chat) +func (_ Unimplemented) ExternalGetChatMessages(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /integrations/chat) +func (_ Unimplemented) ExternalGetChatMessagesOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /integrations/chat/action) +func (_ Unimplemented) SendChatActionOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Send a user action to chat +// (POST /integrations/chat/action) +func (_ Unimplemented) SendChatAction(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /integrations/chat/messagevisibility) +func (_ Unimplemented) ExternalUpdateMessageVisibilityOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Hide chat message +// (POST /integrations/chat/messagevisibility) +func (_ Unimplemented) ExternalUpdateMessageVisibility(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /integrations/chat/send) +func (_ Unimplemented) SendIntegrationChatMessageOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Send a message to chat as a specific 3rd party bot/integration based on its access token +// (POST /integrations/chat/send) +func (_ Unimplemented) SendIntegrationChatMessage(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /integrations/chat/system) +func (_ Unimplemented) SendSystemMessageOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Send a system message to the chat +// (POST /integrations/chat/system) +func (_ Unimplemented) SendSystemMessage(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /integrations/chat/system/client/{clientId}) +func (_ Unimplemented) SendSystemMessageToConnectedClientOptions(w http.ResponseWriter, r *http.Request, clientId int) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Send a system message to a single client +// (POST /integrations/chat/system/client/{clientId}) +func (_ Unimplemented) SendSystemMessageToConnectedClient(w http.ResponseWriter, r *http.Request, clientId int) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /integrations/chat/user) +func (_ Unimplemented) SendUserMessageOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Send a user message to chat +// (POST /integrations/chat/user) +func (_ Unimplemented) SendUserMessage(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Connected clients +// (GET /integrations/clients) +func (_ Unimplemented) ExternalGetConnectedChatClients(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /integrations/clients) +func (_ Unimplemented) ExternalGetConnectedChatClientsOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// (OPTIONS /integrations/streamtitle) +func (_ Unimplemented) ExternalSetStreamTitleOptions(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Stream title +// (POST /integrations/streamtitle) +func (_ Unimplemented) ExternalSetStreamTitle(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Save video playback metrics for future video health recording +// (POST /metrics/playback) +func (_ Unimplemented) ReportPlaybackMetrics(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get a user's details +// (GET /moderation/chat/user/{userId}) +func (_ Unimplemented) GetUserDetails(w http.ResponseWriter, r *http.Request, userId string, params GetUserDetailsParams) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Register for notifications +// (POST /notifications/register) +func (_ Unimplemented) RegisterForLiveNotifications(w http.ResponseWriter, r *http.Request, params RegisterForLiveNotificationsParams) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Tell the backend you're an active viewer +// (GET /ping) +func (_ Unimplemented) Ping(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Request remote follow +// (POST /remotefollow) +func (_ Unimplemented) RemoteFollow(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get all social platforms +// (GET /socialplatforms) +func (_ Unimplemented) GetAllSocialPlatforms(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the status of the server +// (GET /status) +func (_ Unimplemented) GetStatus(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get a list of video variants available +// (GET /video/variants) +func (_ Unimplemented) GetVideoStreamOutputVariants(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the YP protocol data +// (GET /yp) +func (_ Unimplemented) GetYPResponse(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// ServerInterfaceWrapper converts contexts to parameters. +type ServerInterfaceWrapper struct { + Handler ServerInterface + HandlerMiddlewares []MiddlewareFunc + ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) +} + +type MiddlewareFunc func(http.Handler) http.Handler + +// GetExternalAPIUsers operation middleware +func (siw *ServerInterfaceWrapper) GetExternalAPIUsers(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetExternalAPIUsers(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetExternalAPIUsersOptions operation middleware +func (siw *ServerInterfaceWrapper) GetExternalAPIUsersOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetExternalAPIUsersOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// CreateExternalAPIUserOptions operation middleware +func (siw *ServerInterfaceWrapper) CreateExternalAPIUserOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.CreateExternalAPIUserOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// CreateExternalAPIUser operation middleware +func (siw *ServerInterfaceWrapper) CreateExternalAPIUser(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.CreateExternalAPIUser(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// DeleteExternalAPIUserOptions operation middleware +func (siw *ServerInterfaceWrapper) DeleteExternalAPIUserOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.DeleteExternalAPIUserOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// DeleteExternalAPIUser operation middleware +func (siw *ServerInterfaceWrapper) DeleteExternalAPIUser(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.DeleteExternalAPIUser(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetConnectedChatClients operation middleware +func (siw *ServerInterfaceWrapper) GetConnectedChatClients(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetConnectedChatClients(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetConnectedChatClientsOptions operation middleware +func (siw *ServerInterfaceWrapper) GetConnectedChatClientsOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetConnectedChatClientsOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetChatMessagesAdmin operation middleware +func (siw *ServerInterfaceWrapper) GetChatMessagesAdmin(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetChatMessagesAdmin(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetChatMessagesAdminOptions operation middleware +func (siw *ServerInterfaceWrapper) GetChatMessagesAdminOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetChatMessagesAdminOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// UpdateMessageVisibilityAdminOptions operation middleware +func (siw *ServerInterfaceWrapper) UpdateMessageVisibilityAdminOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.UpdateMessageVisibilityAdminOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// UpdateMessageVisibilityAdmin operation middleware +func (siw *ServerInterfaceWrapper) UpdateMessageVisibilityAdmin(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.UpdateMessageVisibilityAdmin(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetDisabledUsers operation middleware +func (siw *ServerInterfaceWrapper) GetDisabledUsers(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetDisabledUsers(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetDisabledUsersOptions operation middleware +func (siw *ServerInterfaceWrapper) GetDisabledUsersOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetDisabledUsersOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetIPAddressBans operation middleware +func (siw *ServerInterfaceWrapper) GetIPAddressBans(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetIPAddressBans(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetIPAddressBansOptions operation middleware +func (siw *ServerInterfaceWrapper) GetIPAddressBansOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetIPAddressBansOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// BanIPAddressOptions operation middleware +func (siw *ServerInterfaceWrapper) BanIPAddressOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.BanIPAddressOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// BanIPAddress operation middleware +func (siw *ServerInterfaceWrapper) BanIPAddress(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.BanIPAddress(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// UnbanIPAddressOptions operation middleware +func (siw *ServerInterfaceWrapper) UnbanIPAddressOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.UnbanIPAddressOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// UnbanIPAddress operation middleware +func (siw *ServerInterfaceWrapper) UnbanIPAddress(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.UnbanIPAddress(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetModerators operation middleware +func (siw *ServerInterfaceWrapper) GetModerators(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetModerators(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetModeratorsOptions operation middleware +func (siw *ServerInterfaceWrapper) GetModeratorsOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetModeratorsOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// UpdateUserEnabledAdminOptions operation middleware +func (siw *ServerInterfaceWrapper) UpdateUserEnabledAdminOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.UpdateUserEnabledAdminOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// UpdateUserEnabledAdmin operation middleware +func (siw *ServerInterfaceWrapper) UpdateUserEnabledAdmin(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.UpdateUserEnabledAdmin(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// UpdateUserModeratorOptions operation middleware +func (siw *ServerInterfaceWrapper) UpdateUserModeratorOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.UpdateUserModeratorOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// UpdateUserModerator operation middleware +func (siw *ServerInterfaceWrapper) UpdateUserModerator(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.UpdateUserModerator(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetAdminPasswordOptions operation middleware +func (siw *ServerInterfaceWrapper) SetAdminPasswordOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetAdminPasswordOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetAdminPassword operation middleware +func (siw *ServerInterfaceWrapper) SetAdminPassword(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetAdminPassword(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetCustomColorVariableValuesOptions operation middleware +func (siw *ServerInterfaceWrapper) SetCustomColorVariableValuesOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetCustomColorVariableValuesOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetCustomColorVariableValues operation middleware +func (siw *ServerInterfaceWrapper) SetCustomColorVariableValues(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetCustomColorVariableValues(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetChatDisabledOptions operation middleware +func (siw *ServerInterfaceWrapper) SetChatDisabledOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetChatDisabledOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetChatDisabled operation middleware +func (siw *ServerInterfaceWrapper) SetChatDisabled(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetChatDisabled(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetEnableEstablishedChatUserModeOptions operation middleware +func (siw *ServerInterfaceWrapper) SetEnableEstablishedChatUserModeOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetEnableEstablishedChatUserModeOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetEnableEstablishedChatUserMode operation middleware +func (siw *ServerInterfaceWrapper) SetEnableEstablishedChatUserMode(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetEnableEstablishedChatUserMode(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetForbiddenUsernameListOptions operation middleware +func (siw *ServerInterfaceWrapper) SetForbiddenUsernameListOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetForbiddenUsernameListOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetForbiddenUsernameList operation middleware +func (siw *ServerInterfaceWrapper) SetForbiddenUsernameList(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetForbiddenUsernameList(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetChatJoinMessagesEnabledOptions operation middleware +func (siw *ServerInterfaceWrapper) SetChatJoinMessagesEnabledOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetChatJoinMessagesEnabledOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetChatJoinMessagesEnabled operation middleware +func (siw *ServerInterfaceWrapper) SetChatJoinMessagesEnabled(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetChatJoinMessagesEnabled(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetChatSlurFilterEnabledOptions operation middleware +func (siw *ServerInterfaceWrapper) SetChatSlurFilterEnabledOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetChatSlurFilterEnabledOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetChatSlurFilterEnabled operation middleware +func (siw *ServerInterfaceWrapper) SetChatSlurFilterEnabled(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetChatSlurFilterEnabled(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetChatSpamProtectionEnabledOptions operation middleware +func (siw *ServerInterfaceWrapper) SetChatSpamProtectionEnabledOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetChatSpamProtectionEnabledOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetChatSpamProtectionEnabled operation middleware +func (siw *ServerInterfaceWrapper) SetChatSpamProtectionEnabled(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetChatSpamProtectionEnabled(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetSuggestedUsernameListOptions operation middleware +func (siw *ServerInterfaceWrapper) SetSuggestedUsernameListOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetSuggestedUsernameListOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetSuggestedUsernameList operation middleware +func (siw *ServerInterfaceWrapper) SetSuggestedUsernameList(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetSuggestedUsernameList(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetCustomJavascriptOptions operation middleware +func (siw *ServerInterfaceWrapper) SetCustomJavascriptOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetCustomJavascriptOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetCustomJavascript operation middleware +func (siw *ServerInterfaceWrapper) SetCustomJavascript(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetCustomJavascript(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetCustomStylesOptions operation middleware +func (siw *ServerInterfaceWrapper) SetCustomStylesOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetCustomStylesOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetCustomStyles operation middleware +func (siw *ServerInterfaceWrapper) SetCustomStyles(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetCustomStyles(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetDirectoryEnabledOptions operation middleware +func (siw *ServerInterfaceWrapper) SetDirectoryEnabledOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetDirectoryEnabledOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetDirectoryEnabled operation middleware +func (siw *ServerInterfaceWrapper) SetDirectoryEnabled(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetDirectoryEnabled(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetDisableSearchIndexingOptions operation middleware +func (siw *ServerInterfaceWrapper) SetDisableSearchIndexingOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetDisableSearchIndexingOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetDisableSearchIndexing operation middleware +func (siw *ServerInterfaceWrapper) SetDisableSearchIndexing(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetDisableSearchIndexing(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetExternalActionsOptions operation middleware +func (siw *ServerInterfaceWrapper) SetExternalActionsOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetExternalActionsOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetExternalActions operation middleware +func (siw *ServerInterfaceWrapper) SetExternalActions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetExternalActions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetFederationBlockDomainsOptions operation middleware +func (siw *ServerInterfaceWrapper) SetFederationBlockDomainsOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetFederationBlockDomainsOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetFederationBlockDomains operation middleware +func (siw *ServerInterfaceWrapper) SetFederationBlockDomains(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetFederationBlockDomains(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetFederationEnabledOptions operation middleware +func (siw *ServerInterfaceWrapper) SetFederationEnabledOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetFederationEnabledOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetFederationEnabled operation middleware +func (siw *ServerInterfaceWrapper) SetFederationEnabled(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetFederationEnabled(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetFederationGoLiveMessageOptions operation middleware +func (siw *ServerInterfaceWrapper) SetFederationGoLiveMessageOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetFederationGoLiveMessageOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetFederationGoLiveMessage operation middleware +func (siw *ServerInterfaceWrapper) SetFederationGoLiveMessage(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetFederationGoLiveMessage(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetFederationActivityPrivateOptions operation middleware +func (siw *ServerInterfaceWrapper) SetFederationActivityPrivateOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetFederationActivityPrivateOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetFederationActivityPrivate operation middleware +func (siw *ServerInterfaceWrapper) SetFederationActivityPrivate(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetFederationActivityPrivate(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetFederationShowEngagementOptions operation middleware +func (siw *ServerInterfaceWrapper) SetFederationShowEngagementOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetFederationShowEngagementOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetFederationShowEngagement operation middleware +func (siw *ServerInterfaceWrapper) SetFederationShowEngagement(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetFederationShowEngagement(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetFederationUsernameOptions operation middleware +func (siw *ServerInterfaceWrapper) SetFederationUsernameOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetFederationUsernameOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetFederationUsername operation middleware +func (siw *ServerInterfaceWrapper) SetFederationUsername(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetFederationUsername(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetFfmpegPathOptions operation middleware +func (siw *ServerInterfaceWrapper) SetFfmpegPathOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetFfmpegPathOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetFfmpegPath operation middleware +func (siw *ServerInterfaceWrapper) SetFfmpegPath(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetFfmpegPath(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetHideViewerCountOptions operation middleware +func (siw *ServerInterfaceWrapper) SetHideViewerCountOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetHideViewerCountOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetHideViewerCount operation middleware +func (siw *ServerInterfaceWrapper) SetHideViewerCount(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetHideViewerCount(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetLogoOptions operation middleware +func (siw *ServerInterfaceWrapper) SetLogoOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetLogoOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetLogo operation middleware +func (siw *ServerInterfaceWrapper) SetLogo(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetLogo(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetServerNameOptions operation middleware +func (siw *ServerInterfaceWrapper) SetServerNameOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetServerNameOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetServerName operation middleware +func (siw *ServerInterfaceWrapper) SetServerName(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetServerName(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetBrowserNotificationConfigurationOptions operation middleware +func (siw *ServerInterfaceWrapper) SetBrowserNotificationConfigurationOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetBrowserNotificationConfigurationOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetBrowserNotificationConfiguration operation middleware +func (siw *ServerInterfaceWrapper) SetBrowserNotificationConfiguration(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetBrowserNotificationConfiguration(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetDiscordNotificationConfigurationOptions operation middleware +func (siw *ServerInterfaceWrapper) SetDiscordNotificationConfigurationOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetDiscordNotificationConfigurationOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetDiscordNotificationConfiguration operation middleware +func (siw *ServerInterfaceWrapper) SetDiscordNotificationConfiguration(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetDiscordNotificationConfiguration(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetNSFWOptions operation middleware +func (siw *ServerInterfaceWrapper) SetNSFWOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetNSFWOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetNSFW operation middleware +func (siw *ServerInterfaceWrapper) SetNSFW(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetNSFW(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetCustomOfflineMessageOptions operation middleware +func (siw *ServerInterfaceWrapper) SetCustomOfflineMessageOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetCustomOfflineMessageOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetCustomOfflineMessage operation middleware +func (siw *ServerInterfaceWrapper) SetCustomOfflineMessage(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetCustomOfflineMessage(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetExtraPageContentOptions operation middleware +func (siw *ServerInterfaceWrapper) SetExtraPageContentOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetExtraPageContentOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetExtraPageContent operation middleware +func (siw *ServerInterfaceWrapper) SetExtraPageContent(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetExtraPageContent(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetRTMPServerPortOptions operation middleware +func (siw *ServerInterfaceWrapper) SetRTMPServerPortOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetRTMPServerPortOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetRTMPServerPort operation middleware +func (siw *ServerInterfaceWrapper) SetRTMPServerPort(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetRTMPServerPort(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetS3ConfigurationOptions operation middleware +func (siw *ServerInterfaceWrapper) SetS3ConfigurationOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetS3ConfigurationOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetS3Configuration operation middleware +func (siw *ServerInterfaceWrapper) SetS3Configuration(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetS3Configuration(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetServerSummaryOptions operation middleware +func (siw *ServerInterfaceWrapper) SetServerSummaryOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetServerSummaryOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetServerSummary operation middleware +func (siw *ServerInterfaceWrapper) SetServerSummary(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetServerSummary(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetServerURLOptions operation middleware +func (siw *ServerInterfaceWrapper) SetServerURLOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetServerURLOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetServerURL operation middleware +func (siw *ServerInterfaceWrapper) SetServerURL(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetServerURL(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetSocialHandlesOptions operation middleware +func (siw *ServerInterfaceWrapper) SetSocialHandlesOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetSocialHandlesOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetSocialHandles operation middleware +func (siw *ServerInterfaceWrapper) SetSocialHandles(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetSocialHandles(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetSocketHostOverrideOptions operation middleware +func (siw *ServerInterfaceWrapper) SetSocketHostOverrideOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetSocketHostOverrideOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetSocketHostOverride operation middleware +func (siw *ServerInterfaceWrapper) SetSocketHostOverride(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetSocketHostOverride(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetStreamKeysOptions operation middleware +func (siw *ServerInterfaceWrapper) SetStreamKeysOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetStreamKeysOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetStreamKeys operation middleware +func (siw *ServerInterfaceWrapper) SetStreamKeys(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetStreamKeys(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetStreamTitleOptions operation middleware +func (siw *ServerInterfaceWrapper) SetStreamTitleOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetStreamTitleOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetStreamTitle operation middleware +func (siw *ServerInterfaceWrapper) SetStreamTitle(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetStreamTitle(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetTagsOptions operation middleware +func (siw *ServerInterfaceWrapper) SetTagsOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetTagsOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetTags operation middleware +func (siw *ServerInterfaceWrapper) SetTags(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetTags(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetVideoCodecOptions operation middleware +func (siw *ServerInterfaceWrapper) SetVideoCodecOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetVideoCodecOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetVideoCodec operation middleware +func (siw *ServerInterfaceWrapper) SetVideoCodec(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetVideoCodec(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetStreamLatencyLevelOptions operation middleware +func (siw *ServerInterfaceWrapper) SetStreamLatencyLevelOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetStreamLatencyLevelOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetStreamLatencyLevel operation middleware +func (siw *ServerInterfaceWrapper) SetStreamLatencyLevel(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetStreamLatencyLevel(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetStreamOutputVariantsOptions operation middleware +func (siw *ServerInterfaceWrapper) SetStreamOutputVariantsOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetStreamOutputVariantsOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetStreamOutputVariants operation middleware +func (siw *ServerInterfaceWrapper) SetStreamOutputVariants(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetStreamOutputVariants(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetVideoServingEndpointOptions operation middleware +func (siw *ServerInterfaceWrapper) SetVideoServingEndpointOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetVideoServingEndpointOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetVideoServingEndpoint operation middleware +func (siw *ServerInterfaceWrapper) SetVideoServingEndpoint(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetVideoServingEndpoint(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetWebServerIPOptions operation middleware +func (siw *ServerInterfaceWrapper) SetWebServerIPOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetWebServerIPOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetWebServerIP operation middleware +func (siw *ServerInterfaceWrapper) SetWebServerIP(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetWebServerIP(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetWebServerPortOptions operation middleware +func (siw *ServerInterfaceWrapper) SetWebServerPortOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetWebServerPortOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetWebServerPort operation middleware +func (siw *ServerInterfaceWrapper) SetWebServerPort(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetWebServerPort(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetServerWelcomeMessageOptions operation middleware +func (siw *ServerInterfaceWrapper) SetServerWelcomeMessageOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetServerWelcomeMessageOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SetServerWelcomeMessage operation middleware +func (siw *ServerInterfaceWrapper) SetServerWelcomeMessage(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SetServerWelcomeMessage(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// DisconnectInboundConnection operation middleware +func (siw *ServerInterfaceWrapper) DisconnectInboundConnection(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.DisconnectInboundConnection(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// DisconnectInboundConnectionOptions operation middleware +func (siw *ServerInterfaceWrapper) DisconnectInboundConnectionOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.DisconnectInboundConnectionOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// DeleteCustomEmojiOptions operation middleware +func (siw *ServerInterfaceWrapper) DeleteCustomEmojiOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.DeleteCustomEmojiOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// DeleteCustomEmoji operation middleware +func (siw *ServerInterfaceWrapper) DeleteCustomEmoji(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.DeleteCustomEmoji(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// UploadCustomEmojiOptions operation middleware +func (siw *ServerInterfaceWrapper) UploadCustomEmojiOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.UploadCustomEmojiOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// UploadCustomEmoji operation middleware +func (siw *ServerInterfaceWrapper) UploadCustomEmoji(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.UploadCustomEmoji(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetFederatedActions operation middleware +func (siw *ServerInterfaceWrapper) GetFederatedActions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetFederatedActionsParams + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameter("form", true, false, "offset", r.URL.Query(), ¶ms.Offset) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "offset", Err: err}) + return + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameter("form", true, false, "limit", r.URL.Query(), ¶ms.Limit) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "limit", Err: err}) + return + } + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetFederatedActions(w, r, params) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetFederatedActionsOptions operation middleware +func (siw *ServerInterfaceWrapper) GetFederatedActionsOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetFederatedActionsOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SendFederatedMessageOptions operation middleware +func (siw *ServerInterfaceWrapper) SendFederatedMessageOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SendFederatedMessageOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SendFederatedMessage operation middleware +func (siw *ServerInterfaceWrapper) SendFederatedMessage(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SendFederatedMessage(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetFollowersAdmin operation middleware +func (siw *ServerInterfaceWrapper) GetFollowersAdmin(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetFollowersAdminParams + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameter("form", true, false, "offset", r.URL.Query(), ¶ms.Offset) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "offset", Err: err}) + return + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameter("form", true, false, "limit", r.URL.Query(), ¶ms.Limit) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "limit", Err: err}) + return + } + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetFollowersAdmin(w, r, params) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetFollowersAdminOptions operation middleware +func (siw *ServerInterfaceWrapper) GetFollowersAdminOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetFollowersAdminOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// ApproveFollowerOptions operation middleware +func (siw *ServerInterfaceWrapper) ApproveFollowerOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.ApproveFollowerOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// ApproveFollower operation middleware +func (siw *ServerInterfaceWrapper) ApproveFollower(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.ApproveFollower(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetBlockedAndRejectedFollowers operation middleware +func (siw *ServerInterfaceWrapper) GetBlockedAndRejectedFollowers(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetBlockedAndRejectedFollowers(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetBlockedAndRejectedFollowersOptions operation middleware +func (siw *ServerInterfaceWrapper) GetBlockedAndRejectedFollowersOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetBlockedAndRejectedFollowersOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetPendingFollowRequests operation middleware +func (siw *ServerInterfaceWrapper) GetPendingFollowRequests(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetPendingFollowRequests(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetPendingFollowRequestsOptions operation middleware +func (siw *ServerInterfaceWrapper) GetPendingFollowRequestsOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetPendingFollowRequestsOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetHardwareStats operation middleware +func (siw *ServerInterfaceWrapper) GetHardwareStats(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetHardwareStats(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetHardwareStatsOptions operation middleware +func (siw *ServerInterfaceWrapper) GetHardwareStatsOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetHardwareStatsOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetLogs operation middleware +func (siw *ServerInterfaceWrapper) GetLogs(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetLogs(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetLogsOptions operation middleware +func (siw *ServerInterfaceWrapper) GetLogsOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetLogsOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetWarnings operation middleware +func (siw *ServerInterfaceWrapper) GetWarnings(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetWarnings(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetWarningsOptions operation middleware +func (siw *ServerInterfaceWrapper) GetWarningsOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetWarningsOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetVideoPlaybackMetrics operation middleware +func (siw *ServerInterfaceWrapper) GetVideoPlaybackMetrics(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetVideoPlaybackMetrics(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetVideoPlaybackMetricsOptions operation middleware +func (siw *ServerInterfaceWrapper) GetVideoPlaybackMetricsOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetVideoPlaybackMetricsOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// DeletePrometheusAPI operation middleware +func (siw *ServerInterfaceWrapper) DeletePrometheusAPI(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.DeletePrometheusAPI(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetPrometheusAPI operation middleware +func (siw *ServerInterfaceWrapper) GetPrometheusAPI(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetPrometheusAPI(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// OptionsPrometheusAPI operation middleware +func (siw *ServerInterfaceWrapper) OptionsPrometheusAPI(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.OptionsPrometheusAPI(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostPrometheusAPI operation middleware +func (siw *ServerInterfaceWrapper) PostPrometheusAPI(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostPrometheusAPI(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PutPrometheusAPI operation middleware +func (siw *ServerInterfaceWrapper) PutPrometheusAPI(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PutPrometheusAPI(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetServerConfig operation middleware +func (siw *ServerInterfaceWrapper) GetServerConfig(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetServerConfig(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetServerConfigOptions operation middleware +func (siw *ServerInterfaceWrapper) GetServerConfigOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetServerConfigOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// StatusAdmin operation middleware +func (siw *ServerInterfaceWrapper) StatusAdmin(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.StatusAdmin(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// StatusAdminOptions operation middleware +func (siw *ServerInterfaceWrapper) StatusAdminOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.StatusAdminOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// AutoUpdateForceQuit operation middleware +func (siw *ServerInterfaceWrapper) AutoUpdateForceQuit(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.AutoUpdateForceQuit(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// AutoUpdateForceQuitOptions operation middleware +func (siw *ServerInterfaceWrapper) AutoUpdateForceQuitOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.AutoUpdateForceQuitOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// AutoUpdateOptions operation middleware +func (siw *ServerInterfaceWrapper) AutoUpdateOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.AutoUpdateOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// AutoUpdateOptionsOptions operation middleware +func (siw *ServerInterfaceWrapper) AutoUpdateOptionsOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.AutoUpdateOptionsOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// AutoUpdateStart operation middleware +func (siw *ServerInterfaceWrapper) AutoUpdateStart(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.AutoUpdateStart(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// AutoUpdateStartOptions operation middleware +func (siw *ServerInterfaceWrapper) AutoUpdateStartOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.AutoUpdateStartOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetActiveViewers operation middleware +func (siw *ServerInterfaceWrapper) GetActiveViewers(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetActiveViewers(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetActiveViewersOptions operation middleware +func (siw *ServerInterfaceWrapper) GetActiveViewersOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetActiveViewersOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetViewersOverTime operation middleware +func (siw *ServerInterfaceWrapper) GetViewersOverTime(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetViewersOverTimeParams + + // ------------- Optional query parameter "windowStart" ------------- + + err = runtime.BindQueryParameter("form", true, false, "windowStart", r.URL.Query(), ¶ms.WindowStart) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "windowStart", Err: err}) + return + } + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetViewersOverTime(w, r, params) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetViewersOverTimeOptions operation middleware +func (siw *ServerInterfaceWrapper) GetViewersOverTimeOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetViewersOverTimeOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetWebhooks operation middleware +func (siw *ServerInterfaceWrapper) GetWebhooks(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetWebhooks(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetWebhooksOptions operation middleware +func (siw *ServerInterfaceWrapper) GetWebhooksOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetWebhooksOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// CreateWebhookOptions operation middleware +func (siw *ServerInterfaceWrapper) CreateWebhookOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.CreateWebhookOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// CreateWebhook operation middleware +func (siw *ServerInterfaceWrapper) CreateWebhook(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.CreateWebhook(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// DeleteWebhookOptions operation middleware +func (siw *ServerInterfaceWrapper) DeleteWebhookOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.DeleteWebhookOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// DeleteWebhook operation middleware +func (siw *ServerInterfaceWrapper) DeleteWebhook(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.DeleteWebhook(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// ResetYPRegistration operation middleware +func (siw *ServerInterfaceWrapper) ResetYPRegistration(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.ResetYPRegistration(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// ResetYPRegistrationOptions operation middleware +func (siw *ServerInterfaceWrapper) ResetYPRegistrationOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.ResetYPRegistrationOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// RegisterFediverseOTPRequest operation middleware +func (siw *ServerInterfaceWrapper) RegisterFediverseOTPRequest(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + // Parameter object where we will unmarshal all parameters from the context + var params RegisterFediverseOTPRequestParams + + // ------------- Required query parameter "accessToken" ------------- + + if paramValue := r.URL.Query().Get("accessToken"); paramValue != "" { + + } else { + siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "accessToken"}) + return + } + + err = runtime.BindQueryParameter("form", true, true, "accessToken", r.URL.Query(), ¶ms.AccessToken) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "accessToken", Err: err}) + return + } + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.RegisterFediverseOTPRequest(w, r, params) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// VerifyFediverseOTPRequest operation middleware +func (siw *ServerInterfaceWrapper) VerifyFediverseOTPRequest(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.VerifyFediverseOTPRequest(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// StartIndieAuthFlow operation middleware +func (siw *ServerInterfaceWrapper) StartIndieAuthFlow(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + // Parameter object where we will unmarshal all parameters from the context + var params StartIndieAuthFlowParams + + // ------------- Required query parameter "accessToken" ------------- + + if paramValue := r.URL.Query().Get("accessToken"); paramValue != "" { + + } else { + siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "accessToken"}) + return + } + + err = runtime.BindQueryParameter("form", true, true, "accessToken", r.URL.Query(), ¶ms.AccessToken) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "accessToken", Err: err}) + return + } + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.StartIndieAuthFlow(w, r, params) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// HandleIndieAuthRedirect operation middleware +func (siw *ServerInterfaceWrapper) HandleIndieAuthRedirect(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + // Parameter object where we will unmarshal all parameters from the context + var params HandleIndieAuthRedirectParams + + // ------------- Required query parameter "state" ------------- + + if paramValue := r.URL.Query().Get("state"); paramValue != "" { + + } else { + siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "state"}) + return + } + + err = runtime.BindQueryParameter("form", true, true, "state", r.URL.Query(), ¶ms.State) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "state", Err: err}) + return + } + + // ------------- Required query parameter "code" ------------- + + if paramValue := r.URL.Query().Get("code"); paramValue != "" { + + } else { + siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "code"}) + return + } + + err = runtime.BindQueryParameter("form", true, true, "code", r.URL.Query(), ¶ms.Code) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "code", Err: err}) + return + } + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.HandleIndieAuthRedirect(w, r, params) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// HandleIndieAuthEndpointGet operation middleware +func (siw *ServerInterfaceWrapper) HandleIndieAuthEndpointGet(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + ctx = context.WithValue(ctx, BasicAuthScopes, []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params HandleIndieAuthEndpointGetParams + + // ------------- Required query parameter "client_id" ------------- + + if paramValue := r.URL.Query().Get("client_id"); paramValue != "" { + + } else { + siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "client_id"}) + return + } + + err = runtime.BindQueryParameter("form", true, true, "client_id", r.URL.Query(), ¶ms.ClientId) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "client_id", Err: err}) + return + } + + // ------------- Required query parameter "redirect_uri" ------------- + + if paramValue := r.URL.Query().Get("redirect_uri"); paramValue != "" { + + } else { + siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "redirect_uri"}) + return + } + + err = runtime.BindQueryParameter("form", true, true, "redirect_uri", r.URL.Query(), ¶ms.RedirectUri) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "redirect_uri", Err: err}) + return + } + + // ------------- Required query parameter "code_challenge" ------------- + + if paramValue := r.URL.Query().Get("code_challenge"); paramValue != "" { + + } else { + siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "code_challenge"}) + return + } + + err = runtime.BindQueryParameter("form", true, true, "code_challenge", r.URL.Query(), ¶ms.CodeChallenge) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "code_challenge", Err: err}) + return + } + + // ------------- Required query parameter "state" ------------- + + if paramValue := r.URL.Query().Get("state"); paramValue != "" { + + } else { + siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "state"}) + return + } + + err = runtime.BindQueryParameter("form", true, true, "state", r.URL.Query(), ¶ms.State) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "state", Err: err}) + return + } + + // ------------- Required query parameter "code" ------------- + + if paramValue := r.URL.Query().Get("code"); paramValue != "" { + + } else { + siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "code"}) + return + } + + err = runtime.BindQueryParameter("form", true, true, "code", r.URL.Query(), ¶ms.Code) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "code", Err: err}) + return + } + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.HandleIndieAuthEndpointGet(w, r, params) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// HandleIndieAuthEndpointPost operation middleware +func (siw *ServerInterfaceWrapper) HandleIndieAuthEndpointPost(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.HandleIndieAuthEndpointPost(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetChatMessages operation middleware +func (siw *ServerInterfaceWrapper) GetChatMessages(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + // Parameter object where we will unmarshal all parameters from the context + var params GetChatMessagesParams + + // ------------- Required query parameter "accessToken" ------------- + + if paramValue := r.URL.Query().Get("accessToken"); paramValue != "" { + + } else { + siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "accessToken"}) + return + } + + err = runtime.BindQueryParameter("form", true, true, "accessToken", r.URL.Query(), ¶ms.AccessToken) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "accessToken", Err: err}) + return + } + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetChatMessages(w, r, params) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// UpdateMessageVisibility operation middleware +func (siw *ServerInterfaceWrapper) UpdateMessageVisibility(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + // Parameter object where we will unmarshal all parameters from the context + var params UpdateMessageVisibilityParams + + // ------------- Required query parameter "accessToken" ------------- + + if paramValue := r.URL.Query().Get("accessToken"); paramValue != "" { + + } else { + siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "accessToken"}) + return + } + + err = runtime.BindQueryParameter("form", true, true, "accessToken", r.URL.Query(), ¶ms.AccessToken) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "accessToken", Err: err}) + return + } + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.UpdateMessageVisibility(w, r, params) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// RegisterAnonymousChatUserOptions operation middleware +func (siw *ServerInterfaceWrapper) RegisterAnonymousChatUserOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.RegisterAnonymousChatUserOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// RegisterAnonymousChatUser operation middleware +func (siw *ServerInterfaceWrapper) RegisterAnonymousChatUser(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + // Parameter object where we will unmarshal all parameters from the context + var params RegisterAnonymousChatUserParams + + headers := r.Header + + // ------------- Optional header parameter "X-Forwarded-User" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-Forwarded-User")]; found { + var XForwardedUser string + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "X-Forwarded-User", Count: n}) + return + } + + err = runtime.BindStyledParameterWithOptions("simple", "X-Forwarded-User", valueList[0], &XForwardedUser, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: false}) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "X-Forwarded-User", Err: err}) + return + } + + params.XForwardedUser = &XForwardedUser + + } + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.RegisterAnonymousChatUser(w, r, params) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// UpdateUserEnabled operation middleware +func (siw *ServerInterfaceWrapper) UpdateUserEnabled(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + // Parameter object where we will unmarshal all parameters from the context + var params UpdateUserEnabledParams + + // ------------- Required query parameter "accessToken" ------------- + + if paramValue := r.URL.Query().Get("accessToken"); paramValue != "" { + + } else { + siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "accessToken"}) + return + } + + err = runtime.BindQueryParameter("form", true, true, "accessToken", r.URL.Query(), ¶ms.AccessToken) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "accessToken", Err: err}) + return + } + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.UpdateUserEnabled(w, r, params) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetWebConfig operation middleware +func (siw *ServerInterfaceWrapper) GetWebConfig(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetWebConfig(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetCustomEmojiList operation middleware +func (siw *ServerInterfaceWrapper) GetCustomEmojiList(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetCustomEmojiList(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetFollowers operation middleware +func (siw *ServerInterfaceWrapper) GetFollowers(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + // Parameter object where we will unmarshal all parameters from the context + var params GetFollowersParams + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameter("form", true, false, "offset", r.URL.Query(), ¶ms.Offset) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "offset", Err: err}) + return + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameter("form", true, false, "limit", r.URL.Query(), ¶ms.Limit) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "limit", Err: err}) + return + } + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetFollowers(w, r, params) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// ExternalGetChatMessages operation middleware +func (siw *ServerInterfaceWrapper) ExternalGetChatMessages(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BearerAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.ExternalGetChatMessages(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// ExternalGetChatMessagesOptions operation middleware +func (siw *ServerInterfaceWrapper) ExternalGetChatMessagesOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.ExternalGetChatMessagesOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SendChatActionOptions operation middleware +func (siw *ServerInterfaceWrapper) SendChatActionOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SendChatActionOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SendChatAction operation middleware +func (siw *ServerInterfaceWrapper) SendChatAction(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BearerAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SendChatAction(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// ExternalUpdateMessageVisibilityOptions operation middleware +func (siw *ServerInterfaceWrapper) ExternalUpdateMessageVisibilityOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.ExternalUpdateMessageVisibilityOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// ExternalUpdateMessageVisibility operation middleware +func (siw *ServerInterfaceWrapper) ExternalUpdateMessageVisibility(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BearerAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.ExternalUpdateMessageVisibility(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SendIntegrationChatMessageOptions operation middleware +func (siw *ServerInterfaceWrapper) SendIntegrationChatMessageOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SendIntegrationChatMessageOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SendIntegrationChatMessage operation middleware +func (siw *ServerInterfaceWrapper) SendIntegrationChatMessage(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BearerAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SendIntegrationChatMessage(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SendSystemMessageOptions operation middleware +func (siw *ServerInterfaceWrapper) SendSystemMessageOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SendSystemMessageOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SendSystemMessage operation middleware +func (siw *ServerInterfaceWrapper) SendSystemMessage(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BearerAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SendSystemMessage(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SendSystemMessageToConnectedClientOptions operation middleware +func (siw *ServerInterfaceWrapper) SendSystemMessageToConnectedClientOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + // ------------- Path parameter "clientId" ------------- + var clientId int + + err = runtime.BindStyledParameterWithOptions("simple", "clientId", chi.URLParam(r, "clientId"), &clientId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "clientId", Err: err}) + return + } + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SendSystemMessageToConnectedClientOptions(w, r, clientId) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SendSystemMessageToConnectedClient operation middleware +func (siw *ServerInterfaceWrapper) SendSystemMessageToConnectedClient(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + // ------------- Path parameter "clientId" ------------- + var clientId int + + err = runtime.BindStyledParameterWithOptions("simple", "clientId", chi.URLParam(r, "clientId"), &clientId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "clientId", Err: err}) + return + } + + ctx = context.WithValue(ctx, BearerAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SendSystemMessageToConnectedClient(w, r, clientId) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SendUserMessageOptions operation middleware +func (siw *ServerInterfaceWrapper) SendUserMessageOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SendUserMessageOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// SendUserMessage operation middleware +func (siw *ServerInterfaceWrapper) SendUserMessage(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BearerAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.SendUserMessage(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// ExternalGetConnectedChatClients operation middleware +func (siw *ServerInterfaceWrapper) ExternalGetConnectedChatClients(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BearerAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.ExternalGetConnectedChatClients(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// ExternalGetConnectedChatClientsOptions operation middleware +func (siw *ServerInterfaceWrapper) ExternalGetConnectedChatClientsOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.ExternalGetConnectedChatClientsOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// ExternalSetStreamTitleOptions operation middleware +func (siw *ServerInterfaceWrapper) ExternalSetStreamTitleOptions(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.ExternalSetStreamTitleOptions(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// ExternalSetStreamTitle operation middleware +func (siw *ServerInterfaceWrapper) ExternalSetStreamTitle(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, BearerAuthScopes, []string{}) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.ExternalSetStreamTitle(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// ReportPlaybackMetrics operation middleware +func (siw *ServerInterfaceWrapper) ReportPlaybackMetrics(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.ReportPlaybackMetrics(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetUserDetails operation middleware +func (siw *ServerInterfaceWrapper) GetUserDetails(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + // ------------- Path parameter "userId" ------------- + var userId string + + err = runtime.BindStyledParameterWithOptions("simple", "userId", chi.URLParam(r, "userId"), &userId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "userId", Err: err}) + return + } + + // Parameter object where we will unmarshal all parameters from the context + var params GetUserDetailsParams + + // ------------- Required query parameter "accessToken" ------------- + + if paramValue := r.URL.Query().Get("accessToken"); paramValue != "" { + + } else { + siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "accessToken"}) + return + } + + err = runtime.BindQueryParameter("form", true, true, "accessToken", r.URL.Query(), ¶ms.AccessToken) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "accessToken", Err: err}) + return + } + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetUserDetails(w, r, userId, params) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// RegisterForLiveNotifications operation middleware +func (siw *ServerInterfaceWrapper) RegisterForLiveNotifications(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + // Parameter object where we will unmarshal all parameters from the context + var params RegisterForLiveNotificationsParams + + // ------------- Required query parameter "accessToken" ------------- + + if paramValue := r.URL.Query().Get("accessToken"); paramValue != "" { + + } else { + siw.ErrorHandlerFunc(w, r, &RequiredParamError{ParamName: "accessToken"}) + return + } + + err = runtime.BindQueryParameter("form", true, true, "accessToken", r.URL.Query(), ¶ms.AccessToken) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "accessToken", Err: err}) + return + } + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.RegisterForLiveNotifications(w, r, params) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// Ping operation middleware +func (siw *ServerInterfaceWrapper) Ping(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.Ping(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// RemoteFollow operation middleware +func (siw *ServerInterfaceWrapper) RemoteFollow(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.RemoteFollow(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetAllSocialPlatforms operation middleware +func (siw *ServerInterfaceWrapper) GetAllSocialPlatforms(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetAllSocialPlatforms(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetStatus operation middleware +func (siw *ServerInterfaceWrapper) GetStatus(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetStatus(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetVideoStreamOutputVariants operation middleware +func (siw *ServerInterfaceWrapper) GetVideoStreamOutputVariants(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetVideoStreamOutputVariants(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetYPResponse operation middleware +func (siw *ServerInterfaceWrapper) GetYPResponse(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetYPResponse(w, r) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +type UnescapedCookieParamError struct { + ParamName string + Err error +} + +func (e *UnescapedCookieParamError) Error() string { + return fmt.Sprintf("error unescaping cookie parameter '%s'", e.ParamName) +} + +func (e *UnescapedCookieParamError) Unwrap() error { + return e.Err +} + +type UnmarshalingParamError struct { + ParamName string + Err error +} + +func (e *UnmarshalingParamError) Error() string { + return fmt.Sprintf("Error unmarshaling parameter %s as JSON: %s", e.ParamName, e.Err.Error()) +} + +func (e *UnmarshalingParamError) Unwrap() error { + return e.Err +} + +type RequiredParamError struct { + ParamName string +} + +func (e *RequiredParamError) Error() string { + return fmt.Sprintf("Query argument %s is required, but not found", e.ParamName) +} + +type RequiredHeaderError struct { + ParamName string + Err error +} + +func (e *RequiredHeaderError) Error() string { + return fmt.Sprintf("Header parameter %s is required, but not found", e.ParamName) +} + +func (e *RequiredHeaderError) Unwrap() error { + return e.Err +} + +type InvalidParamFormatError struct { + ParamName string + Err error +} + +func (e *InvalidParamFormatError) Error() string { + return fmt.Sprintf("Invalid format for parameter %s: %s", e.ParamName, e.Err.Error()) +} + +func (e *InvalidParamFormatError) Unwrap() error { + return e.Err +} + +type TooManyValuesForParamError struct { + ParamName string + Count int +} + +func (e *TooManyValuesForParamError) Error() string { + return fmt.Sprintf("Expected one value for %s, got %d", e.ParamName, e.Count) +} + +// Handler creates http.Handler with routing matching OpenAPI spec. +func Handler(si ServerInterface) http.Handler { + return HandlerWithOptions(si, ChiServerOptions{}) +} + +type ChiServerOptions struct { + BaseURL string + BaseRouter chi.Router + Middlewares []MiddlewareFunc + ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) +} + +// HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux. +func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler { + return HandlerWithOptions(si, ChiServerOptions{ + BaseRouter: r, + }) +} + +func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler { + return HandlerWithOptions(si, ChiServerOptions{ + BaseURL: baseURL, + BaseRouter: r, + }) +} + +// HandlerWithOptions creates http.Handler with additional options +func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler { + r := options.BaseRouter + + if r == nil { + r = chi.NewRouter() + } + if options.ErrorHandlerFunc == nil { + options.ErrorHandlerFunc = func(w http.ResponseWriter, r *http.Request, err error) { + http.Error(w, err.Error(), http.StatusBadRequest) + } + } + wrapper := ServerInterfaceWrapper{ + Handler: si, + HandlerMiddlewares: options.Middlewares, + ErrorHandlerFunc: options.ErrorHandlerFunc, + } + + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/accesstokens", wrapper.GetExternalAPIUsers) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/accesstokens", wrapper.GetExternalAPIUsersOptions) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/accesstokens/create", wrapper.CreateExternalAPIUserOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/accesstokens/create", wrapper.CreateExternalAPIUser) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/accesstokens/delete", wrapper.DeleteExternalAPIUserOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/accesstokens/delete", wrapper.DeleteExternalAPIUser) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/chat/clients", wrapper.GetConnectedChatClients) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/chat/clients", wrapper.GetConnectedChatClientsOptions) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/chat/messages", wrapper.GetChatMessagesAdmin) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/chat/messages", wrapper.GetChatMessagesAdminOptions) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/chat/messagevisibility", wrapper.UpdateMessageVisibilityAdminOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/chat/messagevisibility", wrapper.UpdateMessageVisibilityAdmin) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/chat/users/disabled", wrapper.GetDisabledUsers) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/chat/users/disabled", wrapper.GetDisabledUsersOptions) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/chat/users/ipbans", wrapper.GetIPAddressBans) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/chat/users/ipbans", wrapper.GetIPAddressBansOptions) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/chat/users/ipbans/create", wrapper.BanIPAddressOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/chat/users/ipbans/create", wrapper.BanIPAddress) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/chat/users/ipbans/remove", wrapper.UnbanIPAddressOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/chat/users/ipbans/remove", wrapper.UnbanIPAddress) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/chat/users/moderators", wrapper.GetModerators) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/chat/users/moderators", wrapper.GetModeratorsOptions) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/chat/users/setenabled", wrapper.UpdateUserEnabledAdminOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/chat/users/setenabled", wrapper.UpdateUserEnabledAdmin) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/chat/users/setmoderator", wrapper.UpdateUserModeratorOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/chat/users/setmoderator", wrapper.UpdateUserModerator) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/adminpass", wrapper.SetAdminPasswordOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/adminpass", wrapper.SetAdminPassword) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/appearance", wrapper.SetCustomColorVariableValuesOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/appearance", wrapper.SetCustomColorVariableValues) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/chat/disable", wrapper.SetChatDisabledOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/chat/disable", wrapper.SetChatDisabled) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/chat/establishedusermode", wrapper.SetEnableEstablishedChatUserModeOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/chat/establishedusermode", wrapper.SetEnableEstablishedChatUserMode) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/chat/forbiddenusernames", wrapper.SetForbiddenUsernameListOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/chat/forbiddenusernames", wrapper.SetForbiddenUsernameList) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/chat/joinmessagesenabled", wrapper.SetChatJoinMessagesEnabledOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/chat/joinmessagesenabled", wrapper.SetChatJoinMessagesEnabled) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/chat/slurfilterenabled", wrapper.SetChatSlurFilterEnabledOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/chat/slurfilterenabled", wrapper.SetChatSlurFilterEnabled) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/chat/spamprotectionenabled", wrapper.SetChatSpamProtectionEnabledOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/chat/spamprotectionenabled", wrapper.SetChatSpamProtectionEnabled) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/chat/suggestedusernames", wrapper.SetSuggestedUsernameListOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/chat/suggestedusernames", wrapper.SetSuggestedUsernameList) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/customjavascript", wrapper.SetCustomJavascriptOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/customjavascript", wrapper.SetCustomJavascript) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/customstyles", wrapper.SetCustomStylesOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/customstyles", wrapper.SetCustomStyles) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/directoryenabled", wrapper.SetDirectoryEnabledOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/directoryenabled", wrapper.SetDirectoryEnabled) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/disablesearchindexing", wrapper.SetDisableSearchIndexingOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/disablesearchindexing", wrapper.SetDisableSearchIndexing) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/externalactions", wrapper.SetExternalActionsOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/externalactions", wrapper.SetExternalActions) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/federation/blockdomains", wrapper.SetFederationBlockDomainsOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/federation/blockdomains", wrapper.SetFederationBlockDomains) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/federation/enable", wrapper.SetFederationEnabledOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/federation/enable", wrapper.SetFederationEnabled) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/federation/livemessage", wrapper.SetFederationGoLiveMessageOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/federation/livemessage", wrapper.SetFederationGoLiveMessage) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/federation/private", wrapper.SetFederationActivityPrivateOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/federation/private", wrapper.SetFederationActivityPrivate) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/federation/showengagement", wrapper.SetFederationShowEngagementOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/federation/showengagement", wrapper.SetFederationShowEngagement) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/federation/username", wrapper.SetFederationUsernameOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/federation/username", wrapper.SetFederationUsername) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/ffmpegpath", wrapper.SetFfmpegPathOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/ffmpegpath", wrapper.SetFfmpegPath) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/hideviewercount", wrapper.SetHideViewerCountOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/hideviewercount", wrapper.SetHideViewerCount) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/logo", wrapper.SetLogoOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/logo", wrapper.SetLogo) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/name", wrapper.SetServerNameOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/name", wrapper.SetServerName) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/notifications/browser", wrapper.SetBrowserNotificationConfigurationOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/notifications/browser", wrapper.SetBrowserNotificationConfiguration) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/notifications/discord", wrapper.SetDiscordNotificationConfigurationOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/notifications/discord", wrapper.SetDiscordNotificationConfiguration) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/nsfw", wrapper.SetNSFWOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/nsfw", wrapper.SetNSFW) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/offlinemessage", wrapper.SetCustomOfflineMessageOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/offlinemessage", wrapper.SetCustomOfflineMessage) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/pagecontent", wrapper.SetExtraPageContentOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/pagecontent", wrapper.SetExtraPageContent) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/rtmpserverport", wrapper.SetRTMPServerPortOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/rtmpserverport", wrapper.SetRTMPServerPort) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/s3", wrapper.SetS3ConfigurationOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/s3", wrapper.SetS3Configuration) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/serversummary", wrapper.SetServerSummaryOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/serversummary", wrapper.SetServerSummary) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/serverurl", wrapper.SetServerURLOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/serverurl", wrapper.SetServerURL) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/socialhandles", wrapper.SetSocialHandlesOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/socialhandles", wrapper.SetSocialHandles) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/sockethostoverride", wrapper.SetSocketHostOverrideOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/sockethostoverride", wrapper.SetSocketHostOverride) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/streamkeys", wrapper.SetStreamKeysOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/streamkeys", wrapper.SetStreamKeys) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/streamtitle", wrapper.SetStreamTitleOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/streamtitle", wrapper.SetStreamTitle) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/tags", wrapper.SetTagsOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/tags", wrapper.SetTags) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/video/codec", wrapper.SetVideoCodecOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/video/codec", wrapper.SetVideoCodec) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/video/streamlatencylevel", wrapper.SetStreamLatencyLevelOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/video/streamlatencylevel", wrapper.SetStreamLatencyLevel) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/video/streamoutputvariants", wrapper.SetStreamOutputVariantsOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/video/streamoutputvariants", wrapper.SetStreamOutputVariants) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/videoservingendpoint", wrapper.SetVideoServingEndpointOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/videoservingendpoint", wrapper.SetVideoServingEndpoint) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/webserverip", wrapper.SetWebServerIPOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/webserverip", wrapper.SetWebServerIP) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/webserverport", wrapper.SetWebServerPortOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/webserverport", wrapper.SetWebServerPort) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/config/welcomemessage", wrapper.SetServerWelcomeMessageOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/config/welcomemessage", wrapper.SetServerWelcomeMessage) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/disconnect", wrapper.DisconnectInboundConnection) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/disconnect", wrapper.DisconnectInboundConnectionOptions) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/emoji/delete", wrapper.DeleteCustomEmojiOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/emoji/delete", wrapper.DeleteCustomEmoji) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/emoji/upload", wrapper.UploadCustomEmojiOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/emoji/upload", wrapper.UploadCustomEmoji) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/federation/actions", wrapper.GetFederatedActions) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/federation/actions", wrapper.GetFederatedActionsOptions) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/federation/send", wrapper.SendFederatedMessageOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/federation/send", wrapper.SendFederatedMessage) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/followers", wrapper.GetFollowersAdmin) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/followers", wrapper.GetFollowersAdminOptions) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/followers/approve", wrapper.ApproveFollowerOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/followers/approve", wrapper.ApproveFollower) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/followers/blocked", wrapper.GetBlockedAndRejectedFollowers) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/followers/blocked", wrapper.GetBlockedAndRejectedFollowersOptions) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/followers/pending", wrapper.GetPendingFollowRequests) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/followers/pending", wrapper.GetPendingFollowRequestsOptions) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/hardwarestats", wrapper.GetHardwareStats) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/hardwarestats", wrapper.GetHardwareStatsOptions) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/logs", wrapper.GetLogs) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/logs", wrapper.GetLogsOptions) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/logs/warnings", wrapper.GetWarnings) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/logs/warnings", wrapper.GetWarningsOptions) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/metrics/video", wrapper.GetVideoPlaybackMetrics) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/metrics/video", wrapper.GetVideoPlaybackMetricsOptions) + }) + r.Group(func(r chi.Router) { + r.Delete(options.BaseURL+"/admin/prometheus", wrapper.DeletePrometheusAPI) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/prometheus", wrapper.GetPrometheusAPI) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/prometheus", wrapper.OptionsPrometheusAPI) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/prometheus", wrapper.PostPrometheusAPI) + }) + r.Group(func(r chi.Router) { + r.Put(options.BaseURL+"/admin/prometheus", wrapper.PutPrometheusAPI) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/serverconfig", wrapper.GetServerConfig) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/serverconfig", wrapper.GetServerConfigOptions) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/status", wrapper.StatusAdmin) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/status", wrapper.StatusAdminOptions) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/update/forcequit", wrapper.AutoUpdateForceQuit) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/update/forcequit", wrapper.AutoUpdateForceQuitOptions) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/update/options", wrapper.AutoUpdateOptions) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/update/options", wrapper.AutoUpdateOptionsOptions) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/update/start", wrapper.AutoUpdateStart) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/update/start", wrapper.AutoUpdateStartOptions) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/viewers", wrapper.GetActiveViewers) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/viewers", wrapper.GetActiveViewersOptions) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/viewersOverTime", wrapper.GetViewersOverTime) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/viewersOverTime", wrapper.GetViewersOverTimeOptions) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/webhooks", wrapper.GetWebhooks) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/webhooks", wrapper.GetWebhooksOptions) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/webhooks/create", wrapper.CreateWebhookOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/webhooks/create", wrapper.CreateWebhook) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/webhooks/delete", wrapper.DeleteWebhookOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/admin/webhooks/delete", wrapper.DeleteWebhook) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/admin/yp/reset", wrapper.ResetYPRegistration) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/admin/yp/reset", wrapper.ResetYPRegistrationOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/auth/fediverse", wrapper.RegisterFediverseOTPRequest) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/auth/fediverse/verify", wrapper.VerifyFediverseOTPRequest) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/auth/indieauth", wrapper.StartIndieAuthFlow) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/auth/indieauth/callback", wrapper.HandleIndieAuthRedirect) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/auth/provider/indieauth", wrapper.HandleIndieAuthEndpointGet) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/auth/provider/indieauth", wrapper.HandleIndieAuthEndpointPost) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/chat", wrapper.GetChatMessages) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/chat/messagevisibility", wrapper.UpdateMessageVisibility) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/chat/register", wrapper.RegisterAnonymousChatUserOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/chat/register", wrapper.RegisterAnonymousChatUser) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/chat/users/setenabled", wrapper.UpdateUserEnabled) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/config", wrapper.GetWebConfig) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/emoji", wrapper.GetCustomEmojiList) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/followers", wrapper.GetFollowers) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/integrations/chat", wrapper.ExternalGetChatMessages) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/integrations/chat", wrapper.ExternalGetChatMessagesOptions) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/integrations/chat/action", wrapper.SendChatActionOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/integrations/chat/action", wrapper.SendChatAction) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/integrations/chat/messagevisibility", wrapper.ExternalUpdateMessageVisibilityOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/integrations/chat/messagevisibility", wrapper.ExternalUpdateMessageVisibility) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/integrations/chat/send", wrapper.SendIntegrationChatMessageOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/integrations/chat/send", wrapper.SendIntegrationChatMessage) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/integrations/chat/system", wrapper.SendSystemMessageOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/integrations/chat/system", wrapper.SendSystemMessage) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/integrations/chat/system/client/{clientId}", wrapper.SendSystemMessageToConnectedClientOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/integrations/chat/system/client/{clientId}", wrapper.SendSystemMessageToConnectedClient) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/integrations/chat/user", wrapper.SendUserMessageOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/integrations/chat/user", wrapper.SendUserMessage) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/integrations/clients", wrapper.ExternalGetConnectedChatClients) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/integrations/clients", wrapper.ExternalGetConnectedChatClientsOptions) + }) + r.Group(func(r chi.Router) { + r.Options(options.BaseURL+"/integrations/streamtitle", wrapper.ExternalSetStreamTitleOptions) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/integrations/streamtitle", wrapper.ExternalSetStreamTitle) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/metrics/playback", wrapper.ReportPlaybackMetrics) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/moderation/chat/user/{userId}", wrapper.GetUserDetails) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/notifications/register", wrapper.RegisterForLiveNotifications) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/ping", wrapper.Ping) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/remotefollow", wrapper.RemoteFollow) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/socialplatforms", wrapper.GetAllSocialPlatforms) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/status", wrapper.GetStatus) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/video/variants", wrapper.GetVideoStreamOutputVariants) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/yp", wrapper.GetYPResponse) + }) + + return r +} diff --git a/handler/handler.go b/handler/handler.go new file mode 100644 index 000000000..97cb1dc52 --- /dev/null +++ b/handler/handler.go @@ -0,0 +1,88 @@ +package handler + +import ( + "net/http" + + "github.com/owncast/owncast/controllers" + "github.com/owncast/owncast/controllers/admin" + "github.com/owncast/owncast/handler/generated" + "github.com/owncast/owncast/router/middleware" + "github.com/owncast/owncast/yp" +) + +type ServerInterfaceImpl struct{} + +// ensure ServerInterfaceImpl implements ServerInterface. +var _ generated.ServerInterface = &ServerInterfaceImpl{} + +func New() *ServerInterfaceImpl { + return &ServerInterfaceImpl{} +} + +func (s *ServerInterfaceImpl) Handler() http.Handler { + return generated.Handler(s) +} + +func (*ServerInterfaceImpl) GetStatus(w http.ResponseWriter, r *http.Request) { + controllers.GetStatus(w, r) +} + +func (*ServerInterfaceImpl) GetCustomEmojiList(w http.ResponseWriter, r *http.Request) { + controllers.GetCustomEmojiList(w, r) +} + +func (*ServerInterfaceImpl) GetChatMessages(w http.ResponseWriter, r *http.Request, params generated.GetChatMessagesParams) { + middleware.RequireUserAccessToken(controllers.GetChatMessages)(w, r) +} + +func (*ServerInterfaceImpl) RegisterAnonymousChatUser(w http.ResponseWriter, r *http.Request, params generated.RegisterAnonymousChatUserParams) { + controllers.RegisterAnonymousChatUser(w, r) +} + +func (*ServerInterfaceImpl) RegisterAnonymousChatUserOptions(w http.ResponseWriter, r *http.Request) { + controllers.RegisterAnonymousChatUser(w, r) +} + +func (*ServerInterfaceImpl) UpdateMessageVisibility(w http.ResponseWriter, r *http.Request, params generated.UpdateMessageVisibilityParams) { + middleware.RequireUserModerationScopeAccesstoken(admin.UpdateMessageVisibility)(w, r) +} + +func (*ServerInterfaceImpl) UpdateUserEnabled(w http.ResponseWriter, r *http.Request, params generated.UpdateUserEnabledParams) { + middleware.RequireUserModerationScopeAccesstoken(admin.UpdateUserEnabled)(w, r) +} + +func (*ServerInterfaceImpl) GetWebConfig(w http.ResponseWriter, r *http.Request) { + controllers.GetWebConfig(w, r) +} + +func (*ServerInterfaceImpl) GetYPResponse(w http.ResponseWriter, r *http.Request) { + yp.GetYPResponse(w, r) +} + +func (*ServerInterfaceImpl) GetAllSocialPlatforms(w http.ResponseWriter, r *http.Request) { + controllers.GetAllSocialPlatforms(w, r) +} + +func (*ServerInterfaceImpl) GetVideoStreamOutputVariants(w http.ResponseWriter, r *http.Request) { + controllers.GetVideoStreamOutputVariants(w, r) +} + +func (*ServerInterfaceImpl) Ping(w http.ResponseWriter, r *http.Request) { + controllers.Ping(w, r) +} + +func (*ServerInterfaceImpl) RemoteFollow(w http.ResponseWriter, r *http.Request) { + controllers.RemoteFollow(w, r) +} + +func (*ServerInterfaceImpl) GetFollowers(w http.ResponseWriter, r *http.Request, params generated.GetFollowersParams) { + middleware.HandlePagination(controllers.GetFollowers)(w, r) +} + +func (*ServerInterfaceImpl) ReportPlaybackMetrics(w http.ResponseWriter, r *http.Request) { + controllers.ReportPlaybackMetrics(w, r) +} + +func (*ServerInterfaceImpl) RegisterForLiveNotifications(w http.ResponseWriter, r *http.Request, params generated.RegisterForLiveNotificationsParams) { + middleware.RequireUserAccessToken(controllers.RegisterForLiveNotifications)(w, r) +} diff --git a/handler/integrations.go b/handler/integrations.go new file mode 100644 index 000000000..1d5ddb09e --- /dev/null +++ b/handler/integrations.go @@ -0,0 +1,123 @@ +package handler + +import ( + "net/http" + + "github.com/owncast/owncast/controllers" + "github.com/owncast/owncast/controllers/admin" + "github.com/owncast/owncast/core/user" + "github.com/owncast/owncast/router/middleware" + "github.com/owncast/owncast/utils" + "github.com/prometheus/client_golang/prometheus/promhttp" +) + +func (*ServerInterfaceImpl) SendSystemMessage(w http.ResponseWriter, r *http.Request) { + middleware.RequireExternalAPIAccessToken(user.ScopeCanSendSystemMessages, admin.SendSystemMessage)(w, r) +} + +func (*ServerInterfaceImpl) SendSystemMessageOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireExternalAPIAccessToken(user.ScopeCanSendSystemMessages, admin.SendSystemMessage)(w, r) +} + +func (*ServerInterfaceImpl) SendSystemMessageToConnectedClient(w http.ResponseWriter, r *http.Request, clientId int) { + // doing this hack to make the new system work with the old system + r.Header[utils.RestURLPatternHeaderKey] = []string{`/api/integrations/chat/system/client/{clientId}`} + middleware.RequireExternalAPIAccessToken(user.ScopeCanSendSystemMessages, admin.SendSystemMessageToConnectedClient)(w, r) +} + +func (*ServerInterfaceImpl) SendSystemMessageToConnectedClientOptions(w http.ResponseWriter, r *http.Request, clientId int) { + middleware.RequireExternalAPIAccessToken(user.ScopeCanSendSystemMessages, admin.SendSystemMessageToConnectedClient)(w, r) +} + +// Deprecated. +func (*ServerInterfaceImpl) SendUserMessage(w http.ResponseWriter, r *http.Request) { + middleware.RequireExternalAPIAccessToken(user.ScopeCanSendChatMessages, admin.SendUserMessage)(w, r) +} + +// Deprecated. +func (*ServerInterfaceImpl) SendUserMessageOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireExternalAPIAccessToken(user.ScopeCanSendChatMessages, admin.SendUserMessage)(w, r) +} + +func (*ServerInterfaceImpl) SendIntegrationChatMessage(w http.ResponseWriter, r *http.Request) { + middleware.RequireExternalAPIAccessToken(user.ScopeCanSendChatMessages, admin.SendIntegrationChatMessage)(w, r) +} + +func (*ServerInterfaceImpl) SendIntegrationChatMessageOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireExternalAPIAccessToken(user.ScopeCanSendChatMessages, admin.SendIntegrationChatMessage)(w, r) +} + +func (*ServerInterfaceImpl) SendChatAction(w http.ResponseWriter, r *http.Request) { + middleware.RequireExternalAPIAccessToken(user.ScopeCanSendSystemMessages, admin.SendChatAction)(w, r) +} + +func (*ServerInterfaceImpl) SendChatActionOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireExternalAPIAccessToken(user.ScopeCanSendSystemMessages, admin.SendChatAction)(w, r) +} + +func (*ServerInterfaceImpl) ExternalUpdateMessageVisibility(w http.ResponseWriter, r *http.Request) { + middleware.RequireExternalAPIAccessToken(user.ScopeHasAdminAccess, admin.ExternalUpdateMessageVisibility)(w, r) +} + +func (*ServerInterfaceImpl) ExternalUpdateMessageVisibilityOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireExternalAPIAccessToken(user.ScopeHasAdminAccess, admin.ExternalUpdateMessageVisibility)(w, r) +} + +func (*ServerInterfaceImpl) ExternalSetStreamTitle(w http.ResponseWriter, r *http.Request) { + middleware.RequireExternalAPIAccessToken(user.ScopeHasAdminAccess, admin.ExternalSetStreamTitle)(w, r) +} + +func (*ServerInterfaceImpl) ExternalSetStreamTitleOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireExternalAPIAccessToken(user.ScopeHasAdminAccess, admin.ExternalSetStreamTitle)(w, r) +} + +func (*ServerInterfaceImpl) ExternalGetChatMessages(w http.ResponseWriter, r *http.Request) { + middleware.RequireExternalAPIAccessToken(user.ScopeHasAdminAccess, controllers.ExternalGetChatMessages)(w, r) +} + +func (*ServerInterfaceImpl) ExternalGetChatMessagesOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireExternalAPIAccessToken(user.ScopeHasAdminAccess, controllers.ExternalGetChatMessages)(w, r) +} + +func (*ServerInterfaceImpl) ExternalGetConnectedChatClients(w http.ResponseWriter, r *http.Request) { + middleware.RequireExternalAPIAccessToken(user.ScopeHasAdminAccess, admin.ExternalGetConnectedChatClients)(w, r) +} + +func (*ServerInterfaceImpl) ExternalGetConnectedChatClientsOptions(w http.ResponseWriter, r *http.Request) { + middleware.RequireExternalAPIAccessToken(user.ScopeHasAdminAccess, admin.ExternalGetConnectedChatClients)(w, r) +} + +func (*ServerInterfaceImpl) GetPrometheusAPI(w http.ResponseWriter, r *http.Request) { + // might need to bring this out of the codegen + middleware.RequireAdminAuth(func(w http.ResponseWriter, r *http.Request) { + promhttp.Handler() + })(w, r) +} + +func (*ServerInterfaceImpl) PostPrometheusAPI(w http.ResponseWriter, r *http.Request) { + // might need to bring this out of the codegen + middleware.RequireAdminAuth(func(w http.ResponseWriter, r *http.Request) { + promhttp.Handler() + })(w, r) +} + +func (*ServerInterfaceImpl) PutPrometheusAPI(w http.ResponseWriter, r *http.Request) { + // might need to bring this out of the codegen + middleware.RequireAdminAuth(func(w http.ResponseWriter, r *http.Request) { + promhttp.Handler() + })(w, r) +} + +func (*ServerInterfaceImpl) DeletePrometheusAPI(w http.ResponseWriter, r *http.Request) { + // might need to bring this out of the codegen + middleware.RequireAdminAuth(func(w http.ResponseWriter, r *http.Request) { + promhttp.Handler() + })(w, r) +} + +func (*ServerInterfaceImpl) OptionsPrometheusAPI(w http.ResponseWriter, r *http.Request) { + // might need to bring this out of the codegen + middleware.RequireAdminAuth(func(w http.ResponseWriter, r *http.Request) { + promhttp.Handler() + })(w, r) +} diff --git a/handler/moderation.go b/handler/moderation.go new file mode 100644 index 000000000..2bfa636be --- /dev/null +++ b/handler/moderation.go @@ -0,0 +1,13 @@ +package handler + +import ( + "net/http" + + "github.com/owncast/owncast/controllers/moderation" + "github.com/owncast/owncast/handler/generated" + "github.com/owncast/owncast/router/middleware" +) + +func (*ServerInterfaceImpl) GetUserDetails(w http.ResponseWriter, r *http.Request, userId string, params generated.GetUserDetailsParams) { + middleware.RequireUserModerationScopeAccesstoken(moderation.GetUserDetails)(w, r) +} diff --git a/main.go b/main.go index a304d9d58..726121556 100644 --- a/main.go +++ b/main.go @@ -105,7 +105,7 @@ func main() { go metrics.Start(core.GetStatus) - if err := router.Start(); err != nil { + if err := router.Start(*enableVerboseLogging); err != nil { log.Fatalln("failed to start/run the router", err) } } diff --git a/router/router.go b/router/router.go index 0c6dfc53b..0a4570227 100644 --- a/router/router.go +++ b/router/router.go @@ -3,420 +3,72 @@ package router import ( "fmt" "net/http" + "strings" "time" "github.com/CAFxX/httpcompression" - "github.com/prometheus/client_golang/prometheus/promhttp" + "github.com/go-chi/chi/v5" + chiMW "github.com/go-chi/chi/v5/middleware" log "github.com/sirupsen/logrus" "golang.org/x/net/http2" "golang.org/x/net/http2/h2c" "github.com/owncast/owncast/activitypub" + apControllers "github.com/owncast/owncast/activitypub/controllers" "github.com/owncast/owncast/config" "github.com/owncast/owncast/controllers" - "github.com/owncast/owncast/controllers/admin" - fediverseauth "github.com/owncast/owncast/controllers/auth/fediverse" - "github.com/owncast/owncast/controllers/auth/indieauth" - "github.com/owncast/owncast/controllers/moderation" "github.com/owncast/owncast/core/chat" "github.com/owncast/owncast/core/data" - "github.com/owncast/owncast/core/user" + "github.com/owncast/owncast/handler" "github.com/owncast/owncast/router/middleware" - "github.com/owncast/owncast/utils" - "github.com/owncast/owncast/yp" ) // Start starts the router for the http, ws, and rtmp. -func Start() error { - // The primary web app. - http.HandleFunc("/", controllers.IndexHandler) +func Start(enableVerboseLogging bool) error { + // @behlers New Router + r := chi.NewRouter() - // The admin web app. - http.HandleFunc("/admin/", middleware.RequireAdminAuth(controllers.IndexHandler)) + // Middlewares + if enableVerboseLogging { + r.Use(chiMW.RequestLogger(&chiMW.DefaultLogFormatter{Logger: log.StandardLogger(), NoColor: true})) + } + r.Use(chiMW.Recoverer) - // Images - http.HandleFunc("/thumbnail.jpg", controllers.GetThumbnail) - http.HandleFunc("/preview.gif", controllers.GetPreview) - http.HandleFunc("/logo", controllers.GetLogo) + addStaticFileEndpoints(r) - // Custom Javascript - http.HandleFunc("/customjavascript", controllers.ServeCustomJavascript) + // websocket + r.HandleFunc("/ws", chat.HandleClientConnection) - // Return a single emoji image. - http.HandleFunc(config.EmojiDir, controllers.GetCustomEmojiImage) - - // return the logo - - // return a logo that's compatible with external social networks - http.HandleFunc("/logo/external", controllers.GetCompatibleLogo) - - // robots.txt - http.HandleFunc("/robots.txt", controllers.GetRobotsDotTxt) - - // status of the system - http.HandleFunc("/api/status", controllers.GetStatus) - - // custom emoji supported in the chat - http.HandleFunc("/api/emoji", controllers.GetCustomEmojiList) - - // chat rest api - http.HandleFunc("/api/chat", middleware.RequireUserAccessToken(controllers.GetChatMessages)) - - // web config api - http.HandleFunc("/api/config", controllers.GetWebConfig) - - // return the YP protocol data - http.HandleFunc("/api/yp", yp.GetYPResponse) - - // list of all social platforms - http.HandleFunc("/api/socialplatforms", controllers.GetAllSocialPlatforms) - - // return the list of video variants available - http.HandleFunc("/api/video/variants", controllers.GetVideoStreamOutputVariants) - - // tell the backend you're an active viewer - http.HandleFunc("/api/ping", controllers.Ping) - - // register a new chat user - http.HandleFunc("/api/chat/register", controllers.RegisterAnonymousChatUser) - - // return remote follow details - http.HandleFunc("/api/remotefollow", controllers.RemoteFollow) - - // return followers - http.HandleFunc("/api/followers", middleware.HandlePagination(controllers.GetFollowers)) - - // save client video playback metrics - http.HandleFunc("/api/metrics/playback", controllers.ReportPlaybackMetrics) - - // Register for notifications - http.HandleFunc("/api/notifications/register", middleware.RequireUserAccessToken(controllers.RegisterForLiveNotifications)) - - // Authenticated admin requests - - // Current inbound broadcaster - http.HandleFunc("/api/admin/status", middleware.RequireAdminAuth(admin.Status)) + // serve files + fs := http.FileServer(http.Dir(config.PublicFilesPath)) + r.Handle("/public/*", http.StripPrefix("/public/", fs)) // Return HLS video - http.HandleFunc("/hls/", controllers.HandleHLSRequest) + r.HandleFunc("/hls/*", controllers.HandleHLSRequest) - // Disconnect inbound stream - http.HandleFunc("/api/admin/disconnect", middleware.RequireAdminAuth(admin.DisconnectInboundConnection)) + // The admin web app. + r.HandleFunc("/admin/*", middleware.RequireAdminAuth(controllers.IndexHandler)) - // Server config - http.HandleFunc("/api/admin/serverconfig", middleware.RequireAdminAuth(admin.GetServerConfig)) + // Single ActivityPub Actor + r.HandleFunc("/federation/user/*", middleware.RequireActivityPubOrRedirect(apControllers.ActorHandler)) - // Get viewer count over time - http.HandleFunc("/api/admin/viewersOverTime", middleware.RequireAdminAuth(admin.GetViewersOverTime)) + // Single AP object + r.HandleFunc("/federation/*", middleware.RequireActivityPubOrRedirect(apControllers.ObjectHandler)) - // Get active viewers - http.HandleFunc("/api/admin/viewers", middleware.RequireAdminAuth(admin.GetActiveViewers)) + // The primary web app. + r.HandleFunc("/*", controllers.IndexHandler) - // Get hardware stats - http.HandleFunc("/api/admin/hardwarestats", middleware.RequireAdminAuth(admin.GetHardwareStats)) - - // Get a a detailed list of currently connected chat clients - http.HandleFunc("/api/admin/chat/clients", middleware.RequireAdminAuth(admin.GetConnectedChatClients)) - - // Get all logs - http.HandleFunc("/api/admin/logs", middleware.RequireAdminAuth(admin.GetLogs)) - - // Get warning/error logs - http.HandleFunc("/api/admin/logs/warnings", middleware.RequireAdminAuth(admin.GetWarnings)) - - // Get all chat messages for the admin, unfiltered. - http.HandleFunc("/api/admin/chat/messages", middleware.RequireAdminAuth(admin.GetChatMessages)) - - // Update chat message visibility - http.HandleFunc("/api/admin/chat/messagevisibility", middleware.RequireAdminAuth(admin.UpdateMessageVisibility)) - - // Enable/disable a user - http.HandleFunc("/api/admin/chat/users/setenabled", middleware.RequireAdminAuth(admin.UpdateUserEnabled)) - - // Ban/unban an IP address - http.HandleFunc("/api/admin/chat/users/ipbans/create", middleware.RequireAdminAuth(admin.BanIPAddress)) - - // Remove an IP address ban - http.HandleFunc("/api/admin/chat/users/ipbans/remove", middleware.RequireAdminAuth(admin.UnBanIPAddress)) - - // Return all the banned IP addresses - http.HandleFunc("/api/admin/chat/users/ipbans", middleware.RequireAdminAuth(admin.GetIPAddressBans)) - - // Get a list of disabled users - http.HandleFunc("/api/admin/chat/users/disabled", middleware.RequireAdminAuth(admin.GetDisabledUsers)) - - // Set moderator status for a user - http.HandleFunc("/api/admin/chat/users/setmoderator", middleware.RequireAdminAuth(admin.UpdateUserModerator)) - - // Get a list of moderator users - http.HandleFunc("/api/admin/chat/users/moderators", middleware.RequireAdminAuth(admin.GetModerators)) - - // return followers - http.HandleFunc("/api/admin/followers", middleware.RequireAdminAuth(middleware.HandlePagination(controllers.GetFollowers))) - - // Get a list of pending follow requests - http.HandleFunc("/api/admin/followers/pending", middleware.RequireAdminAuth(admin.GetPendingFollowRequests)) - - // Get a list of rejected or blocked follows - http.HandleFunc("/api/admin/followers/blocked", middleware.RequireAdminAuth(admin.GetBlockedAndRejectedFollowers)) - - // Set the following state of a follower or follow request. - http.HandleFunc("/api/admin/followers/approve", middleware.RequireAdminAuth(admin.ApproveFollower)) - - // Upload custom emoji - http.HandleFunc("/api/admin/emoji/upload", middleware.RequireAdminAuth(admin.UploadCustomEmoji)) - - // Delete custom emoji - http.HandleFunc("/api/admin/emoji/delete", middleware.RequireAdminAuth(admin.DeleteCustomEmoji)) - - // Update config values - - // Change the current streaming key in memory - http.HandleFunc("/api/admin/config/adminpass", middleware.RequireAdminAuth(admin.SetAdminPassword)) - - // Set an array of valid stream keys - http.HandleFunc("/api/admin/config/streamkeys", middleware.RequireAdminAuth(admin.SetStreamKeys)) - - // Change the extra page content in memory - http.HandleFunc("/api/admin/config/pagecontent", middleware.RequireAdminAuth(admin.SetExtraPageContent)) - - // Stream title - http.HandleFunc("/api/admin/config/streamtitle", middleware.RequireAdminAuth(admin.SetStreamTitle)) - - // Server name - http.HandleFunc("/api/admin/config/name", middleware.RequireAdminAuth(admin.SetServerName)) - - // Server summary - http.HandleFunc("/api/admin/config/serversummary", middleware.RequireAdminAuth(admin.SetServerSummary)) - - // Offline message - http.HandleFunc("/api/admin/config/offlinemessage", middleware.RequireAdminAuth(admin.SetCustomOfflineMessage)) - - // Server welcome message - http.HandleFunc("/api/admin/config/welcomemessage", middleware.RequireAdminAuth(admin.SetServerWelcomeMessage)) - - // Disable chat - http.HandleFunc("/api/admin/config/chat/disable", middleware.RequireAdminAuth(admin.SetChatDisabled)) - - // Disable chat user join messages - http.HandleFunc("/api/admin/config/chat/joinmessagesenabled", middleware.RequireAdminAuth(admin.SetChatJoinMessagesEnabled)) - - // Enable/disable chat established user mode - http.HandleFunc("/api/admin/config/chat/establishedusermode", middleware.RequireAdminAuth(admin.SetEnableEstablishedChatUserMode)) - - // Set chat usernames that are not allowed - http.HandleFunc("/api/admin/config/chat/forbiddenusernames", middleware.RequireAdminAuth(admin.SetForbiddenUsernameList)) - - // Set the suggested chat usernames that will be assigned automatically - http.HandleFunc("/api/admin/config/chat/suggestedusernames", middleware.RequireAdminAuth(admin.SetSuggestedUsernameList)) - - // Enable or disable chat spam protection - http.HandleFunc("/api/admin/config/chat/spamprotectionenabled", middleware.RequireAdminAuth(admin.SetChatSpamProtectionEnabled)) - - http.HandleFunc("/api/admin/config/chat/slurfilterenabled", middleware.RequireAdminAuth(admin.SetChatSlurFilterEnabled)) - - // Set video codec - http.HandleFunc("/api/admin/config/video/codec", middleware.RequireAdminAuth(admin.SetVideoCodec)) - - // Set style/color/css values - http.HandleFunc("/api/admin/config/appearance", middleware.RequireAdminAuth(admin.SetCustomColorVariableValues)) - - // Return all webhooks - http.HandleFunc("/api/admin/webhooks", middleware.RequireAdminAuth(admin.GetWebhooks)) - - // Delete a single webhook - http.HandleFunc("/api/admin/webhooks/delete", middleware.RequireAdminAuth(admin.DeleteWebhook)) - - // Create a single webhook - http.HandleFunc("/api/admin/webhooks/create", middleware.RequireAdminAuth(admin.CreateWebhook)) - - // Get all access tokens - http.HandleFunc("/api/admin/accesstokens", middleware.RequireAdminAuth(admin.GetExternalAPIUsers)) - - // Delete a single access token - http.HandleFunc("/api/admin/accesstokens/delete", middleware.RequireAdminAuth(admin.DeleteExternalAPIUser)) - - // Create a single access token - http.HandleFunc("/api/admin/accesstokens/create", middleware.RequireAdminAuth(admin.CreateExternalAPIUser)) - - // Return the auto-update features that are supported for this instance. - http.HandleFunc("/api/admin/update/options", middleware.RequireAdminAuth(admin.AutoUpdateOptions)) - - // Begin the auto update - http.HandleFunc("/api/admin/update/start", middleware.RequireAdminAuth(admin.AutoUpdateStart)) - - // Force quit the service to restart it - http.HandleFunc("/api/admin/update/forcequit", middleware.RequireAdminAuth(admin.AutoUpdateForceQuit)) - - // Send a system message to chat - http.HandleFunc("/api/integrations/chat/system", middleware.RequireExternalAPIAccessToken(user.ScopeCanSendSystemMessages, admin.SendSystemMessage)) - - // Send a system message to a single client - http.HandleFunc(utils.RestEndpoint("/api/integrations/chat/system/client/{clientId}", middleware.RequireExternalAPIAccessToken(user.ScopeCanSendSystemMessages, admin.SendSystemMessageToConnectedClient))) - - // Send a user message to chat *NO LONGER SUPPORTED - http.HandleFunc("/api/integrations/chat/user", middleware.RequireExternalAPIAccessToken(user.ScopeCanSendChatMessages, admin.SendUserMessage)) - - // Send a message to chat as a specific 3rd party bot/integration based on its access token - http.HandleFunc("/api/integrations/chat/send", middleware.RequireExternalAPIAccessToken(user.ScopeCanSendChatMessages, admin.SendIntegrationChatMessage)) - - // Send a user action to chat - http.HandleFunc("/api/integrations/chat/action", middleware.RequireExternalAPIAccessToken(user.ScopeCanSendSystemMessages, admin.SendChatAction)) - - // Hide chat message - http.HandleFunc("/api/integrations/chat/messagevisibility", middleware.RequireExternalAPIAccessToken(user.ScopeHasAdminAccess, admin.ExternalUpdateMessageVisibility)) - - // Stream title - http.HandleFunc("/api/integrations/streamtitle", middleware.RequireExternalAPIAccessToken(user.ScopeHasAdminAccess, admin.ExternalSetStreamTitle)) - - // Get chat history - http.HandleFunc("/api/integrations/chat", middleware.RequireExternalAPIAccessToken(user.ScopeHasAdminAccess, controllers.ExternalGetChatMessages)) - - // Connected clients - http.HandleFunc("/api/integrations/clients", middleware.RequireExternalAPIAccessToken(user.ScopeHasAdminAccess, admin.ExternalGetConnectedChatClients)) - - // Logo path - http.HandleFunc("/api/admin/config/logo", middleware.RequireAdminAuth(admin.SetLogo)) - - // Server tags - http.HandleFunc("/api/admin/config/tags", middleware.RequireAdminAuth(admin.SetTags)) - - // ffmpeg - http.HandleFunc("/api/admin/config/ffmpegpath", middleware.RequireAdminAuth(admin.SetFfmpegPath)) - - // Server http port - http.HandleFunc("/api/admin/config/webserverport", middleware.RequireAdminAuth(admin.SetWebServerPort)) - - // Server http listen address - http.HandleFunc("/api/admin/config/webserverip", middleware.RequireAdminAuth(admin.SetWebServerIP)) - - // Server rtmp port - http.HandleFunc("/api/admin/config/rtmpserverport", middleware.RequireAdminAuth(admin.SetRTMPServerPort)) - - // Websocket host override - http.HandleFunc("/api/admin/config/sockethostoverride", middleware.RequireAdminAuth(admin.SetSocketHostOverride)) - - // Custom video serving endpoint - http.HandleFunc("/api/admin/config/videoservingendpoint", middleware.RequireAdminAuth(admin.SetVideoServingEndpoint)) - - // Is server marked as NSFW - http.HandleFunc("/api/admin/config/nsfw", middleware.RequireAdminAuth(admin.SetNSFW)) - - // directory enabled - http.HandleFunc("/api/admin/config/directoryenabled", middleware.RequireAdminAuth(admin.SetDirectoryEnabled)) - - // social handles - http.HandleFunc("/api/admin/config/socialhandles", middleware.RequireAdminAuth(admin.SetSocialHandles)) - - // set the number of video segments and duration per segment in a playlist - http.HandleFunc("/api/admin/config/video/streamlatencylevel", middleware.RequireAdminAuth(admin.SetStreamLatencyLevel)) - - // set an array of video output configurations - http.HandleFunc("/api/admin/config/video/streamoutputvariants", middleware.RequireAdminAuth(admin.SetStreamOutputVariants)) - - // set s3 configuration - http.HandleFunc("/api/admin/config/s3", middleware.RequireAdminAuth(admin.SetS3Configuration)) - - // set server url - http.HandleFunc("/api/admin/config/serverurl", middleware.RequireAdminAuth(admin.SetServerURL)) - - // reset the YP registration - http.HandleFunc("/api/admin/yp/reset", middleware.RequireAdminAuth(admin.ResetYPRegistration)) - - // set external action links - http.HandleFunc("/api/admin/config/externalactions", middleware.RequireAdminAuth(admin.SetExternalActions)) - - // set custom style css - http.HandleFunc("/api/admin/config/customstyles", middleware.RequireAdminAuth(admin.SetCustomStyles)) - - // set custom style javascript - http.HandleFunc("/api/admin/config/customjavascript", middleware.RequireAdminAuth(admin.SetCustomJavascript)) - - // Video playback metrics - http.HandleFunc("/api/admin/metrics/video", middleware.RequireAdminAuth(admin.GetVideoPlaybackMetrics)) - - // Is the viewer count hidden from viewers - http.HandleFunc("/api/admin/config/hideviewercount", middleware.RequireAdminAuth(admin.SetHideViewerCount)) - - // set disabling of search indexing - http.HandleFunc("/api/admin/config/disablesearchindexing", middleware.RequireAdminAuth(admin.SetDisableSearchIndexing)) - - // Inline chat moderation actions - - // Update chat message visibility - http.HandleFunc("/api/chat/messagevisibility", middleware.RequireUserModerationScopeAccesstoken(admin.UpdateMessageVisibility)) - - // Enable/disable a user - http.HandleFunc("/api/chat/users/setenabled", middleware.RequireUserModerationScopeAccesstoken(admin.UpdateUserEnabled)) - - // Get a user's details - http.HandleFunc("/api/moderation/chat/user/", middleware.RequireUserModerationScopeAccesstoken(moderation.GetUserDetails)) - - // Configure Federation features - - // enable/disable federation features - http.HandleFunc("/api/admin/config/federation/enable", middleware.RequireAdminAuth(admin.SetFederationEnabled)) - - // set if federation activities are private - http.HandleFunc("/api/admin/config/federation/private", middleware.RequireAdminAuth(admin.SetFederationActivityPrivate)) - - // set if fediverse engagement appears in chat - http.HandleFunc("/api/admin/config/federation/showengagement", middleware.RequireAdminAuth(admin.SetFederationShowEngagement)) - - // set local federated username - http.HandleFunc("/api/admin/config/federation/username", middleware.RequireAdminAuth(admin.SetFederationUsername)) - - // set federated go live message - http.HandleFunc("/api/admin/config/federation/livemessage", middleware.RequireAdminAuth(admin.SetFederationGoLiveMessage)) - - // Federation blocked domains - http.HandleFunc("/api/admin/config/federation/blockdomains", middleware.RequireAdminAuth(admin.SetFederationBlockDomains)) - - // send a public message to the Fediverse from the server's user - http.HandleFunc("/api/admin/federation/send", middleware.RequireAdminAuth(admin.SendFederatedMessage)) - - // Return federated activities - http.HandleFunc("/api/admin/federation/actions", middleware.RequireAdminAuth(middleware.HandlePagination(admin.GetFederatedActions))) - - // Prometheus metrics - http.Handle("/api/admin/prometheus", middleware.RequireAdminAuth(func(rw http.ResponseWriter, r *http.Request) { - promhttp.Handler().ServeHTTP(rw, r) - })) - - // Configure outbound notification channels. - http.HandleFunc("/api/admin/config/notifications/discord", middleware.RequireAdminAuth(admin.SetDiscordNotificationConfiguration)) - http.HandleFunc("/api/admin/config/notifications/browser", middleware.RequireAdminAuth(admin.SetBrowserNotificationConfiguration)) - - // Auth - - // Start auth flow - http.HandleFunc("/api/auth/indieauth", middleware.RequireUserAccessToken(indieauth.StartAuthFlow)) - http.HandleFunc("/api/auth/indieauth/callback", indieauth.HandleRedirect) - http.HandleFunc("/api/auth/provider/indieauth", indieauth.HandleAuthEndpoint) - - http.HandleFunc("/api/auth/fediverse", middleware.RequireUserAccessToken(fediverseauth.RegisterFediverseOTPRequest)) - http.HandleFunc("/api/auth/fediverse/verify", fediverseauth.VerifyFediverseOTPRequest) + // mount the api + r.Mount("/api/", handler.New().Handler()) // ActivityPub has its own router activitypub.Start(data.GetDatastore()) - // websocket - http.HandleFunc("/ws", func(w http.ResponseWriter, r *http.Request) { - chat.HandleClientConnection(w, r) - }) - - // Optional public static files - http.Handle("/public/", http.StripPrefix("/public/", http.FileServer(http.Dir(config.PublicFilesPath)))) - - port := config.WebServerPort - ip := config.WebServerIP - - h2s := &http2.Server{} - // Create a custom mux handler to intercept the /debug/vars endpoint. // This is a hack because Prometheus enables this endpoint by default // due to its use of expvar and we do not want this exposed. - defaultMux := h2c.NewHandler(http.DefaultServeMux, h2s) + h2s := &http2.Server{} + http2Handler := h2c.NewHandler(r, h2s) m := http.NewServeMux() m.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { @@ -427,10 +79,13 @@ func Start() error { // Redirect /embed/chat http.Redirect(w, r, "/embed/chat/readonly", http.StatusTemporaryRedirect) } else { - defaultMux.ServeHTTP(w, r) + http2Handler.ServeHTTP(w, r) } }) + port := config.WebServerPort + ip := config.WebServerIP + compress, _ := httpcompression.DefaultAdapter() // Use the default configuration server := &http.Server{ Addr: fmt.Sprintf("%s:%d", ip, port), @@ -447,3 +102,43 @@ func Start() error { return server.ListenAndServe() } + +func addStaticFileEndpoints(r chi.Router) { + // Images + r.HandleFunc("/thumbnail.jpg", controllers.GetThumbnail) + r.HandleFunc("/preview.gif", controllers.GetPreview) + r.HandleFunc("/logo", controllers.GetLogo) + // return a logo that's compatible with external social networks + r.HandleFunc("/logo/external", controllers.GetCompatibleLogo) + + // Custom Javascript + r.HandleFunc("/customjavascript", controllers.ServeCustomJavascript) + + // robots.txt + r.HandleFunc("/robots.txt", controllers.GetRobotsDotTxt) + + // Return a single emoji image. + emojiDir := config.EmojiDir + if !strings.HasSuffix(emojiDir, "*") { + emojiDir += "*" + } + r.HandleFunc(emojiDir, controllers.GetCustomEmojiImage) + + // WebFinger + r.HandleFunc("/.well-known/webfinger", apControllers.WebfingerHandler) + + // Host Metadata + r.HandleFunc("/.well-known/host-meta", apControllers.HostMetaController) + + // Nodeinfo v1 + r.HandleFunc("/.well-known/nodeinfo", apControllers.NodeInfoController) + + // x-nodeinfo v2 + r.HandleFunc("/.well-known/x-nodeinfo2", apControllers.XNodeInfo2Controller) + + // Nodeinfo v2 + r.HandleFunc("/nodeinfo/2.0", apControllers.NodeInfoV2Controller) + + // Instance details + r.HandleFunc("/api/v1/instance", apControllers.InstanceV1Controller) +} diff --git a/spec/gen-api.sh b/spec/gen-api.sh new file mode 100755 index 000000000..5d7057ef2 --- /dev/null +++ b/spec/gen-api.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +# go install github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen@latest + +# setup +package="generated" +folderPath="handler/generated" +specPath="spec/openapi.yaml" + +# validate scripts are installed +if ! command -v swagger-cli &> /dev/null +then + echo "Please install \`swagger-cli\` before running this script" + exit 1 +fi + +if ! command -v oapi-codegen &> /dev/null +then + echo "Please install \`oapi-codegen\` before running this script" + echo "Hint: run \`go install github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen@latest\` to install" + exit 1 +fi + +# validate schema +swagger-cli validate $specPath +if [ $? -ne 0 ]; +then + echo "Open API specification is not valid" + exit 1 +fi + +# cleanup +rm -r $folderPath +mkdir -p $folderPath + +# codegen +oapi-codegen -generate types -o $folderPath/$package-types.gen.go -package $package $specPath +oapi-codegen -generate "chi-server" -o $folderPath/$package.gen.go -package $package $specPath + +# go +go mod tidy diff --git a/spec/openapi.yaml b/spec/openapi.yaml new file mode 100644 index 000000000..74acefef0 --- /dev/null +++ b/spec/openapi.yaml @@ -0,0 +1,4114 @@ +openapi: 3.1.0 + +info: + version: 0.1.2 + title: Owncast APIs + description: |- + Internal + The APIs required to make the Owncast web interface and internal functionality work. These APIs will never reach stability and will always change as Owncast features and functionality change. This means these endpoints are not good options to build your own tooling and features on top of. You can, however, of course can if that risk is acceptable to you. + + Admin + The APIs used to configure the Owncast server, as well as power the web admin interface. These APIs are protected by the admin password, using HTTP Basic authentication. They should not be used by external tools or integrations as it would require you to give your admin password to a third party. + contact: + name: Gabe Kangas + email: gabek@real-ity.com + url: 'http://owncast.online' + license: + url: 'https://github.com/owncast/owncast/blob/develop/LICENSE' + name: MIT +servers: + - url: 'http://localhost:8080/api' + description: Localhost port 8080 + +paths: + /status: + get: + summary: Get the status of the server + operationId: GetStatus + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: "#/components/schemas/Status" + /emoji: + get: + summary: Get list of custom emojis supported in the chat + operationId: GetCustomEmojiList + responses: + '200': + description: List of valid emojis + content: + application/json: + schema: + $ref: "#/components/schemas/Emojis" + '500': + $ref: "#/components/responses/500" + /chat: + get: + summary: Gets a list of chat messages + operationId: GetChatMessages + parameters: + - $ref: "#/components/parameters/AccessToken" + responses: + '200': + description: List of chat messages + content: + application/json: + schema: + $ref: "#/components/schemas/ChatMessages" + '401': + $ref: "#/components/responses/401" + '501': + $ref: "#/components/responses/501" + /chat/register: + post: + summary: Registers an anonymous chat user + operationId: RegisterAnonymousChatUser + parameters: + - in: header + name: X-Forwarded-User + schema: + type: string + required: false + requestBody: + description: The display name of the new user + required: false + content: + application/json: + schema: + type: object + properties: + displayName: + type: string + responses: + '200': + description: Anonymous user information + content: + application/json: + schema: + $ref: "#/components/schemas/AnonymousUser" + '400': + $ref: "#/components/responses/400" + options: + operationId: RegisterAnonymousChatUserOptions + responses: + '204': + $ref: "#/components/responses/204Options" + /chat/messagevisibility: + post: + summary: Update chat message visibility + operationId: UpdateMessageVisibility + parameters: + - $ref: "#/components/parameters/AccessToken" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/MessageVisibilityUpdate" + responses: + '200': + description: Message visibility updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401" + default: + $ref: "#/components/responses/Default" + /chat/users/setenabled: + post: + summary: Enable/disable a user + operationId: UpdateUserEnabled + parameters: + - $ref: "#/components/parameters/AccessToken" + requestBody: + content: + application/json: + schema: + type: object + properties: + userId: + type: string + enabled: + type: boolean + responses: + '200': + description: User status has been updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401" + default: + $ref: "#/components/responses/Default" + /config: + get: + summary: Get the web config + operationId: GetWebConfig + responses: + '200': + description: The current web config + content: + application/json: + schema: + $ref: "#/components/schemas/WebConfig" + '500': + $ref: "#/components/responses/500" + /yp: + get: + summary: Get the YP protocol data + operationId: GetYPResponse + responses: + '200': + description: The current YP protocol configuration + content: + application/json: + schema: + $ref: "#/components/schemas/YPDetails" + '404': + $ref: "#/components/responses/404" + /socialplatforms: + get: + summary: Get all social platforms + operationId: GetAllSocialPlatforms + responses: + '200': + description: The list of social platforms + content: + application/json: + schema: + type: object + additionalProperties: + $ref: '#/components/schemas/SocialHandle' + '500': + $ref: "#/components/responses/500" + /video/variants: + get: + summary: Get a list of video variants available + operationId: GetVideoStreamOutputVariants + responses: + '200': + description: List of available video variants + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/VideoVariant" + /ping: + get: + summary: Tell the backend you're an active viewer + operationId: Ping + responses: + '200': + description: Added as an active viewer + /remotefollow: + post: + summary: Request remote follow + operationId: RemoteFollow + requestBody: + content: + application/json: + schema: + type: object + properties: + account: + type: string + responses: + '200': + description: Contains redirect URL remote follow follow + content: + application/json: + schema: + type: object + properties: + redirectUrl: + type: string + '400': + $ref: "#/components/responses/400" + /followers: + get: + summary: Gets the list of followers + operationId: GetFollowers + parameters: + - $ref: "#/components/parameters/Offset" + - $ref: "#/components/parameters/Limit" + responses: + '200': + description: Paginated follower count + content: + application/json: + schema: + $ref: "#/components/schemas/PaginatedFollowers" + '400': + $ref: "#/components/responses/400" + /metrics/playback: + post: + summary: Save video playback metrics for future video health recording + operationId: ReportPlaybackMetrics + requestBody: + description: Video metrics to record + content: + application/json: + schema: + $ref: "#/components/schemas/PlaybackMetrics" + responses: + '200': + description: Metrics successfully recorded + '400': + $ref: "#/components/responses/400" + /notifications/register: + post: + summary: Register for notifications + operationId: RegisterForLiveNotifications + parameters: + - $ref: "#/components/parameters/AccessToken" + requestBody: + description: Information for notification + content: + application/json: + schema: + type: object + properties: + channel: + type: string + description: Name of notification channel + destination: + type: string + description: Target of the notification in the channel + responses: + '200': + description: Successfully added notification channel + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401" + /admin/status: + get: + summary: Get current inboard broadcaster + operationId: StatusAdmin + security: + - BasicAuth: [] + responses: + '200': + description: Gives the status of the system + content: + application/json: + schema: + $ref: "#/components/schemas/AdminStatus" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: StatusAdminOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/disconnect: + get: + summary: Disconnect inbound stream + operationId: DisconnectInboundConnection + security: + - BasicAuth: [] + responses: + '200': + description: Contains information about disconnection status + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: DisconnectInboundConnectionOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/serverconfig: + get: + summary: Get the current server config + operationId: GetServerConfig + security: + - BasicAuth: [] + responses: + '200': + description: Current server config + content: + application/json: + schema: + $ref: "#/components/schemas/AdminServerConfig" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: GetServerConfigOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/viewersOverTime: + get: + summary: Get viewer count over time + operationId: GetViewersOverTime + security: + - BasicAuth: [] + parameters: + - in: query + name: windowStart + description: Start date in unix time + schema: + type: string + responses: + '200': + description: Viewer count over time + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/TimestampedValue" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: GetViewersOverTimeOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/viewers: + get: + summary: Get active viewers + operationId: GetActiveViewers + security: + - BasicAuth: [] + responses: + '200': + description: List of active viewers + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Viewer" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: GetActiveViewersOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/hardwarestats: + get: + summary: Get the current hardware stats + operationId: GetHardwareStats + security: + - BasicAuth: [] + responses: + '200': + description: Current hardware stats + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/StreamHealthOverview" + - $ref: "#/components/schemas/CollectedMetrics" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: GetHardwareStatsOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/chat/clients: + get: + summary: Get a detailed list of currently connected chat clients + operationId: GetConnectedChatClients + security: + - BasicAuth: [] + responses: + '200': + description: List of chat clients + content: + application/json: + schema: + $ref: "#/components/schemas/ChatClients" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: GetConnectedChatClientsOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/chat/messages: + get: + summary: Get all chat messages for the admin, unfiltered + operationId: GetChatMessagesAdmin + security: + - BasicAuth: [] + responses: + '200': + description: List of chat messages for the admin + content: + application/json: + schema: + $ref: "#/components/schemas/ChatMessages" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: GetChatMessagesAdminOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/chat/messagevisibility: + post: + summary: Update visibility of chat messages + operationId: UpdateMessageVisibilityAdmin + security: + - BasicAuth: [] + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/MessageVisibilityUpdate" + responses: + '200': + description: Messages updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: UpdateMessageVisibilityAdminOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/chat/users/setenabled: + post: + summary: Enable or disable a user + operationId: UpdateUserEnabledAdmin + security: + - BasicAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + userId: + type: string + enabled: + type: boolean + responses: + '200': + description: Successfully updated the user + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: UpdateUserEnabledAdminOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/chat/users/disabled: + get: + summary: Get a list of disabled users + operationId: GetDisabledUsers + security: + - BasicAuth: [] + responses: + '200': + description: List of disabled users + content: + application/json: + schema: + $ref: "#/components/schemas/Users" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: GetDisabledUsersOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/chat/users/ipbans/create: + post: + summary: Ban an IP address + operationId: BanIPAddress + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: IP was successfully banned + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: BanIPAddressOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/chat/users/ipbans/remove: + post: + summary: Remove an IP ban + operationId: UnbanIPAddress + security: + - BasicAuth: [] + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/AdminConfigValue" + responses: + '200': + description: IP ban was successfully removed + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: UnbanIPAddressOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/chat/users/ipbans: + get: + summary: Get all banned IP addresses + operationId: GetIPAddressBans + security: + - BasicAuth: [] + responses: + '200': + description: List of banned IP addresses + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/IPAddress" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: GetIPAddressBansOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/chat/users/setmoderator: + post: + summary: Set moderator status for a user + operationId: UpdateUserModerator + security: + - BasicAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + userId: + type: string + isModerator: + type: boolean + responses: + '200': + description: Successfully update the moderator status of the user + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: UpdateUserModeratorOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/chat/users/moderators: + get: + summary: Get a list of moderator users + operationId: GetModerators + security: + - BasicAuth: [] + responses: + '200': + description: List of moderator users + content: + application/json: + schema: + $ref: "#/components/schemas/Users" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: GetModeratorsOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/logs: + get: + summary: Get all logs + operationId: GetLogs + security: + - BasicAuth: [] + responses: + '200': + description: List of logs + headers: + 'Access-Control-Allow-Origin': + $ref: "#/components/headers/Access-Control-Allow-Origin" + 'Access-Control-Allow-Credentials': + $ref: "#/components/headers/Access-Control-Allow-Credentials" + 'Access-Control-Allow-Headers': + $ref: "#/components/headers/Access-Control-Allow-Headers" + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/AdminLog" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: GetLogsOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/logs/warnings: + get: + summary: Get warning/error logs + operationId: GetWarnings + security: + - BasicAuth: [] + responses: + '200': + description: List of warnings and errors + headers: + 'Access-Control-Allow-Origin': + $ref: "#/components/headers/Access-Control-Allow-Origin" + 'Access-Control-Allow-Credentials': + $ref: "#/components/headers/Access-Control-Allow-Credentials" + 'Access-Control-Allow-Headers': + $ref: "#/components/headers/Access-Control-Allow-Headers" + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/AdminLog" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: GetWarningsOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/followers: + get: + summary: Get followers + operationId: GetFollowersAdmin + security: + - BasicAuth: [] + parameters: + - $ref: "#/components/parameters/Offset" + - $ref: "#/components/parameters/Limit" + responses: + '200': + description: Paginated follower count + content: + application/json: + schema: + $ref: "#/components/schemas/PaginatedFollowers" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: GetFollowersAdminOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/followers/pending: + get: + summary: Get a list of pending follow requests + operationId: GetPendingFollowRequests + security: + - BasicAuth: [] + responses: + '200': + description: List of pending followers + content: + application/json: + schema: + $ref: "#/components/schemas/Followers" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: GetPendingFollowRequestsOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/followers/blocked: + get: + summary: Get a list of rejected or blocked follows + operationId: GetBlockedAndRejectedFollowers + security: + - BasicAuth: [] + responses: + '200': + description: List of rejected or blocked follows + content: + application/json: + schema: + $ref: "#/components/schemas/Followers" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: GetBlockedAndRejectedFollowersOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/followers/approve: + post: + summary: Set the following state of a follower or follow request + operationId: ApproveFollower + security: + - BasicAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + actorIRI: + type: string + approved: + type: boolean + responses: + '200': + description: List of rejected or blocked follows + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: ApproveFollowerOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/emoji/upload: + post: + summary: Upload custom emoji + operationId: UploadCustomEmoji + security: + - BasicAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + data: + description: Base 64 encoded image data + type: string + responses: + '200': + description: Emoji has been uploaded + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: UploadCustomEmojiOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/emoji/delete: + post: + summary: Delete custom emoji + operationId: DeleteCustomEmoji + security: + - BasicAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + responses: + '200': + description: Emoji has been deleted + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: DeleteCustomEmojiOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/adminpass: + post: + summary: Change the current admin password + operationId: SetAdminPassword + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Admin password has been updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetAdminPasswordOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/streamkeys: + post: + summary: Set an array of valid stream keys + operationId: SetStreamKeys + security: + - BasicAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + value: + type: array + items: + $ref: "#/components/schemas/StreamKey" + responses: + '200': + description: Stream keys have been updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetStreamKeysOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/pagecontent: + post: + summary: Change the extra page content in memory + operationId: SetExtraPageContent + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Page content has been changed + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetExtraPageContentOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/streamtitle: + post: + summary: Change the stream title + operationId: SetStreamTitle + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Stream title has been changed + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetStreamTitleOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/name: + post: + summary: Change the server name + operationId: SetServerName + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Server name has been changed + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetServerNameOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/serversummary: + post: + summary: Change the server summary + operationId: SetServerSummary + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Server summary has been changed + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetServerSummaryOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/offlinemessage: + post: + summary: Change the offline message + operationId: SetCustomOfflineMessage + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Offline message has been changed + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetCustomOfflineMessageOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/welcomemessage: + post: + summary: Change the welcome message + operationId: SetServerWelcomeMessage + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Welcome message has been changed + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetServerWelcomeMessageOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/chat/disable: + post: + summary: Disable chat + operationId: SetChatDisabled + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Chat has been disabled + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetChatDisabledOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/chat/joinmessagesenabled: + post: + summary: Enable chat for user join messages + operationId: SetChatJoinMessagesEnabled + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: User join messages has been enabled + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetChatJoinMessagesEnabledOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/chat/establishedusermode: + post: + summary: Enable/disable chat established user mode + operationId: SetEnableEstablishedChatUserMode + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Chat established user mode updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetEnableEstablishedChatUserModeOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/chat/forbiddenusernames: + post: + summary: Set chat usernames that are not allowed + operationId: SetForbiddenUsernameList + security: + - BasicAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + value: + type: array + items: + type: string + responses: + '200': + description: Forbidden usernames updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetForbiddenUsernameListOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/chat/suggestedusernames: + post: + summary: Set the suggested chat usernames that will be assigned automatically + operationId: SetSuggestedUsernameList + security: + - BasicAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + value: + type: array + items: + type: string + responses: + '200': + description: Suggested usernames updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetSuggestedUsernameListOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/chat/spamprotectionenabled: + post: + summary: Set spam protection enabled + operationId: SetChatSpamProtectionEnabled + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Spam protection enabled updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetChatSpamProtectionEnabledOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/chat/slurfilterenabled: + post: + summary: Set slur filter enabled + operationId: SetChatSlurFilterEnabled + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Slur filter enabled updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetChatSlurFilterEnabledOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/video/codec: + post: + summary: Set video codec + operationId: SetVideoCodec + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Video codec updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetVideoCodecOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/video/streamlatencylevel: + post: + summary: Set the number of video segments and duration per segment in a playlist + operationId: SetStreamLatencyLevel + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Stream latency updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetStreamLatencyLevelOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/video/streamoutputvariants: + post: + summary: Set an array of video output configurations + operationId: SetStreamOutputVariants + security: + - BasicAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + value: + type: array + items: + $ref: '#/components/schemas/StreamOutputVariant' + responses: + '200': + description: Stream Output Variants updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetStreamOutputVariantsOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/appearance: + post: + summary: Set style/color/css values + operationId: SetCustomColorVariableValues + security: + - BasicAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + value: + type: object + additionalProperties: + type: string + responses: + '200': + description: Appearance updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetCustomColorVariableValuesOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/logo: + post: + summary: Update logo + operationId: SetLogo + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Logo updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetLogoOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/tags: + post: + summary: Update server tags + operationId: SetTags + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Tags updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetTagsOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/ffmpegpath: + post: + summary: Update FFMPEG path + operationId: SetFfmpegPath + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Path updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetFfmpegPathOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/webserverport: + post: + summary: Update server port + operationId: SetWebServerPort + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Port updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetWebServerPortOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/webserverip: + post: + summary: Update server IP address + operationId: SetWebServerIP + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: IP Address updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetWebServerIPOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/rtmpserverport: + post: + summary: Update RTMP post + operationId: SetRTMPServerPort + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: RTMP port updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetRTMPServerPortOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/sockethostoverride: + post: + summary: Update websocket host override + operationId: SetSocketHostOverride + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Websocket host override updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetSocketHostOverrideOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/videoservingendpoint: + post: + summary: Update custom video serving endpoint + operationId: SetVideoServingEndpoint + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Video Serving Endpoint updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetVideoServingEndpointOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/nsfw: + post: + summary: Update NSFW marking + operationId: SetNSFW + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: NSFW status updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetNSFWOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/directoryenabled: + post: + summary: Update directory enabled + operationId: SetDirectoryEnabled + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Directory Enabled updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetDirectoryEnabledOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/socialhandles: + post: + summary: Update social handles + operationId: SetSocialHandles + security: + - BasicAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + value: + type: array + items: + $ref: "#/components/schemas/SocialHandle" + responses: + '200': + description: Social handles updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetSocialHandlesOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/s3: + post: + summary: Update S3 configuration + operationId: SetS3Configuration + security: + - BasicAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + value: + $ref: "#/components/schemas/S3Info" + responses: + '200': + description: Directory Enabled updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetS3ConfigurationOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/serverurl: + post: + summary: Update server url + operationId: SetServerURL + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Server URL updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetServerURLOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/externalactions: + post: + summary: Update external action links + operationId: SetExternalActions + security: + - BasicAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + value: + type: array + items: + $ref: "#/components/schemas/ExternalAction" + responses: + '200': + description: External Action Links updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetExternalActionsOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/customstyles: + post: + summary: Update custom styles + operationId: SetCustomStyles + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Custom styles updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetCustomStylesOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/customjavascript: + post: + summary: Update custom JavaScript + operationId: SetCustomJavascript + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Custom JavaScript updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetCustomJavascriptOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/hideviewercount: + post: + summary: Update hide viewer count + operationId: SetHideViewerCount + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Hide viewer count updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetHideViewerCountOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/disablesearchindexing: + post: + summary: Update search indexing + operationId: SetDisableSearchIndexing + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Search Indexing updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetDisableSearchIndexingOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/federation/enable: + post: + summary: Enable/disable federation features + operationId: SetFederationEnabled + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Federation features enabled/disabled + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetFederationEnabledOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/federation/private: + post: + summary: Set if federation activities are private + operationId: SetFederationActivityPrivate + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Private status set + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetFederationActivityPrivateOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/federation/showengagement: + post: + summary: Set if fediverse engagement appears in chat + operationId: SetFederationShowEngagement + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Federation engagement set + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetFederationShowEngagementOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/federation/username: + post: + summary: Set local federated username + operationId: SetFederationUsername + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Federation username set + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetFederationUsernameOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/federation/livemessage: + post: + summary: Set federated go live message + operationId: SetFederationGoLiveMessage + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Federation username set + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetFederationGoLiveMessageOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/federation/blockdomains: + post: + summary: Set Federation blocked domains + operationId: SetFederationBlockDomains + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Federation blocked domains set + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetFederationBlockDomainsOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/notifications/discord: + post: + summary: Configure Discord notifications + operationId: SetDiscordNotificationConfiguration + security: + - BasicAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + value: + $ref: "#/components/schemas/DiscordNotificationConfiguration" + responses: + '200': + description: Discord notification configuration updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetDiscordNotificationConfigurationOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/config/notifications/browser: + post: + summary: Configure Browser notifications + operationId: SetBrowserNotificationConfiguration + security: + - BasicAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + value: + $ref: "#/components/schemas/BrowserNotificationConfiguration" + responses: + '200': + description: Browser notification configuration updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SetBrowserNotificationConfigurationOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/webhooks: + get: + summary: Get all the webhooks + operationId: GetWebhooks + security: + - BasicAuth: [] + responses: + '200': + description: All webhooks + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Webhook" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: GetWebhooksOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/webhooks/delete: + post: + summary: Delete a single webhook + operationId: DeleteWebhook + security: + - BasicAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + id: + type: integer + responses: + '200': + description: Webhook successfully deleted + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: DeleteWebhookOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/webhooks/create: + post: + summary: Create a single webhook + operationId: CreateWebhook + security: + - BasicAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + url: + type: string + events: + type: array + items: + $ref: "#/components/schemas/WebhookEventType" + responses: + '200': + description: The new webhook + content: + application/json: + schema: + $ref: "#/components/schemas/Webhook" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: CreateWebhookOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/accesstokens: + get: + summary: Get all access tokens + operationId: GetExternalAPIUsers + security: + - BasicAuth: [] + responses: + '200': + description: List of external API users + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/ExternalAPIUser" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: GetExternalAPIUsersOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/accesstokens/delete: + post: + summary: Delete a single external API user + operationId: DeleteExternalAPIUser + security: + - BasicAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + token: + type: string + responses: + '200': + description: External API user successfully deleted + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: DeleteExternalAPIUserOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/accesstokens/create: + post: + summary: Create a single access token + operationId: CreateExternalAPIUser + security: + - BasicAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + scopes: + type: array + items: + type: string + responses: + '200': + description: The new external API user + content: + application/json: + schema: + $ref: "#/components/schemas/ExternalAPIUser" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: CreateExternalAPIUserOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/update/options: + get: + summary: Return the auto-update features that are supported for this instance + operationId: AutoUpdateOptions + security: + - BasicAuth: [] + responses: + '200': + description: Current auto-update options + content: + application/json: + schema: + type: object + properties: + supportsUpdate: + type: boolean + canRestart: + type: boolean + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: AutoUpdateOptionsOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/update/start: + get: + summary: Begin the auto-update + operationId: AutoUpdateStart + security: + - BasicAuth: [] + responses: + '200': + description: Console output from update + content: + text/plain: + schema: + type: string + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: AutoUpdateStartOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/update/forcequit: + get: + summary: Force quit the server and restart it + operationId: AutoUpdateForceQuit + security: + - BasicAuth: [] + responses: + '200': + description: Server force restart has been ordered + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: AutoUpdateForceQuitOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/yp/reset: + get: + summary: Reset YP configuration + operationId: ResetYPRegistration + security: + - BasicAuth: [] + responses: + '200': + description: YP Registration has been reset + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: ResetYPRegistrationOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/metrics/video: + get: + summary: Get video playback metrics + operationId: GetVideoPlaybackMetrics + security: + - BasicAuth: [] + responses: + '200': + description: Video playback metrics + content: + application/json: + schema: + type: object + properties: + errors: + type: array + items: + $ref: '#/components/schemas/TimestampedValue' + qualityVariantChanges: + type: array + items: + $ref: '#/components/schemas/TimestampedValue' + highestLatency: + type: array + items: + $ref: '#/components/schemas/TimestampedValue' + medianLatency: + type: array + items: + $ref: '#/components/schemas/TimestampedValue' + lowestLatency: + type: array + items: + $ref: '#/components/schemas/TimestampedValue' + medianSegmentDownloadDuration: + type: array + items: + $ref: '#/components/schemas/TimestampedValue' + maximumSegmentDownloadDuration: + type: array + items: + $ref: '#/components/schemas/TimestampedValue' + minimumSegmentDownloadDuration: + type: array + items: + $ref: '#/components/schemas/TimestampedValue' + minPlayerBitrate: + type: array + items: + $ref: '#/components/schemas/TimestampedValue' + medianPlayerBitrate: + type: array + items: + $ref: '#/components/schemas/TimestampedValue' + maxPlayerBitrate: + type: array + items: + $ref: '#/components/schemas/TimestampedValue' + availableBitrates: + type: array + items: + type: integer + segmentLength: + type: integer + representation: + type: integer + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: GetVideoPlaybackMetricsOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/prometheus: + get: + summary: Endpoint to interface with Prometheus + description: |- + This endpoint interfaces with the Prometheus metrics API. + + Learn more about it on the [Prometheus API docs](https://prometheus.io/docs/prometheus/latest/querying/api/) + operationId: GetPrometheusAPI + post: + summary: Endpoint to interface with Prometheus + description: |- + This endpoint interfaces with the Prometheus metrics API. + + Learn more about it on the [Prometheus API docs](https://prometheus.io/docs/prometheus/latest/querying/api/) + operationId: PostPrometheusAPI + put: + summary: Endpoint to interface with Prometheus + description: |- + This endpoint interfaces with the Prometheus metrics API. + + Learn more about it on the [Prometheus API docs](https://prometheus.io/docs/prometheus/latest/querying/api/) + operationId: PutPrometheusAPI + delete: + summary: Endpoint to interface with Prometheus + description: |- + This endpoint interfaces with the Prometheus metrics API. + + Learn more about it on the [Prometheus API docs](https://prometheus.io/docs/prometheus/latest/querying/api/) + operationId: DeletePrometheusAPI + options: + summary: Endpoint to interface with Prometheus + description: |- + This endpoint interfaces with the Prometheus metrics API. + + Learn more about it on the [Prometheus API docs](https://prometheus.io/docs/prometheus/latest/querying/api/) + operationId: OptionsPrometheusAPI + /admin/federation/send: + post: + summary: Send a public message to the Fediverse from the server's user + operationId: SendFederatedMessage + security: + - BasicAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Message sent + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: SendFederatedMessageOptions + responses: + '204': + $ref: "#/components/responses/204" + /admin/federation/actions: + get: + summary: Get a paginated list of federated activities + operationId: GetFederatedActions + security: + - BasicAuth: [] + parameters: + - $ref: "#/components/parameters/Offset" + - $ref: "#/components/parameters/Limit" + responses: + '200': + description: A paginated list of federated activities + content: + application/json: + schema: + $ref: "#/components/schemas/PaginatedFederatedActivity" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: GetFederatedActionsOptions + responses: + '204': + $ref: "#/components/responses/204" + /integrations/chat/system: + post: + summary: Send a system message to the chat + operationId: SendSystemMessage + security: + - BearerAuth: [] + requestBody: + description: The content of the system message + content: + application/json: + schema: + $ref: "#/components/schemas/SystemMessage" + responses: + '200': + description: Message sent successfully + headers: + 'Access-Control-Allow-Origin': + $ref: "#/components/headers/Access-Control-Allow-Origin" + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401" + '500': + $ref: "#/components/responses/500" + default: + $ref: "#/components/responses/Default" + options: + operationId: SendSystemMessageOptions + responses: + '204': + $ref: "#/components/responses/204" + /integrations/chat/system/client/{clientId}: + post: + summary: Send a system message to a single client + operationId: SendSystemMessageToConnectedClient + security: + - BearerAuth: [] + parameters: + - in: path + name: clientId + required: true + schema: + type: integer + description: The ID of the specified client + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/SystemMessage" + responses: + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401" + '500': + $ref: "#/components/responses/500" + default: + $ref: "#/components/responses/Default" + options: + operationId: SendSystemMessageToConnectedClientOptions + parameters: + - in: path + name: clientId + required: true + schema: + type: integer + description: The ID of the specified client + responses: + '204': + $ref: "#/components/responses/204" + /integrations/chat/user: + post: + deprecated: true + summary: Send a user message to chat + operationId: SendUserMessage + security: + - BearerAuth: [] + responses: + '400': + $ref: "#/components/responses/400" + options: + deprecated: true + operationId: SendUserMessageOptions + responses: + '204': + $ref: "#/components/responses/204" + /integrations/chat/send: + post: + summary: Send a message to chat as a specific 3rd party bot/integration based on its access token + operationId: SendIntegrationChatMessage + security: + - BearerAuth: [] + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/UserMessage" + responses: + '200': + description: Message sent successfully + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401" + '500': + $ref: "#/components/responses/500" + default: + $ref: "#/components/responses/Default" + options: + operationId: SendIntegrationChatMessageOptions + responses: + '204': + $ref: "#/components/responses/204" + /integrations/chat/action: + post: + summary: Send a user action to chat + operationId: SendChatAction + security: + - BearerAuth: [] + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/SystemActionEvent" + responses: + '200': + description: Action sent successfully + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401" + '500': + $ref: "#/components/responses/500" + default: + $ref: "#/components/responses/Default" + options: + operationId: SendChatActionOptions + responses: + '204': + $ref: "#/components/responses/204" + /integrations/chat/messagevisibility: + post: + summary: Hide chat message + operationId: ExternalUpdateMessageVisibility + security: + - BearerAuth: [] + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/MessageVisibilityUpdate" + responses: + '200': + description: Messages updated + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: ExternalUpdateMessageVisibilityOptions + responses: + '204': + $ref: "#/components/responses/204" + /integrations/streamtitle: + post: + summary: Stream title + operationId: ExternalSetStreamTitle + security: + - BearerAuth: [] + requestBody: + $ref: "#/components/requestBodies/AdminConfigValue" + responses: + '200': + description: Stream title has been changed + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: ExternalSetStreamTitleOptions + responses: + '204': + $ref: "#/components/responses/204" + /integrations/chat: + get: + summary: Get chat history + operationId: ExternalGetChatMessages + security: + - BearerAuth: [] + responses: + '200': + description: List of chat messages + content: + application/json: + schema: + $ref: "#/components/schemas/ChatMessages" + '401': + $ref: "#/components/responses/401" + '501': + $ref: "#/components/responses/501" + default: + $ref: "#/components/responses/Default" + options: + operationId: ExternalGetChatMessagesOptions + responses: + '204': + $ref: "#/components/responses/204" + /integrations/clients: + get: + summary: Connected clients + operationId: ExternalGetConnectedChatClients + security: + - BearerAuth: [] + responses: + '200': + description: List of chat clients + content: + application/json: + schema: + $ref: "#/components/schemas/ChatClients" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401BasicAuth" + default: + $ref: "#/components/responses/Default" + options: + operationId: ExternalGetConnectedChatClientsOptions + responses: + '204': + $ref: "#/components/responses/204" + /moderation/chat/user/{userId}: + get: + summary: Get a user's details + operationId: GetUserDetails + parameters: + - in: path + name: userId + schema: + type: string + description: The ID of the user to find + required: true + - $ref: "#/components/parameters/AccessToken" + responses: + '200': + description: User information + content: + application/json: + schema: + $ref: "#/components/schemas/ModerationUserDetails" + '401': + $ref: "#/components/responses/401" + '404': + $ref: "#/components/responses/404" + default: + $ref: "#/components/responses/Default" + /auth/indieauth: + post: + summary: Begins auth flow + operationId: StartIndieAuthFlow + parameters: + - $ref: "#/components/parameters/AccessToken" + requestBody: + content: + application/json: + schema: + type: object + properties: + authHost: + type: string + responses: + '200': + description: Authentication redirect + content: + application/json: + schema: + type: object + properties: + redirect: + type: string + format: url + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401" + default: + $ref: "#/components/responses/Default" + /auth/indieauth/callback: + get: + summary: Handle the redirect from an IndieAuth server to continue the auth flow + operationId: HandleIndieAuthRedirect + parameters: + - $ref: "#/components/parameters/IndieAuthState" + - $ref: "#/components/parameters/IndieAuthCode" + responses: + '307': + description: Redirected to home page + '400': + $ref: "#/components/responses/400" + /auth/provider/indieauth: + get: + summary: Handles the IndieAuth auth endpoint + operationId: HandleIndieAuthEndpointGet + security: + - BasicAuth: [] + parameters: + - $ref: "#/components/parameters/IndieAuthClientId" + - $ref: "#/components/parameters/IndieAuthRedirectURI" + - $ref: "#/components/parameters/IndieAuthCodeChallenge" + - $ref: "#/components/parameters/IndieAuthState" + - $ref: "#/components/parameters/IndieAuthCode" + responses: + '200': + description: IndieAuth flow concluded + content: + application/json: + schema: + $ref: "#/components/schemas/IndieAuthResponse" + '307': + description: Redirected to redirect URI + '400': + $ref: "#/components/responses/400" + '500': + $ref: "#/components/responses/500" + post: + summary: Handles IndieAuth from form submission + operationId: HandleIndieAuthEndpointPost + requestBody: + $ref: "#/components/requestBodies/IndieAuthEndpointForm" + responses: + '200': + description: IndieAuth flow concluded + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/IndieAuthResponse" + - $ref: "#/components/schemas/IndieAuthServerProfileResponse" + '400': + $ref: "#/components/responses/400" + /auth/fediverse: + post: + summary: Register a Fediverse OTP request + operationId: RegisterFediverseOTPRequest + parameters: + - $ref: "#/components/parameters/AccessToken" + requestBody: + content: + application/json: + schema: + type: object + properties: + account: + type: string + responses: + '200': + description: OTP sent + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '401': + $ref: "#/components/responses/401" + /auth/fediverse/verify: + post: + summary: Verify Fediverse OTP code + operationId: VerifyFediverseOTPRequest + requestBody: + content: + application/json: + schema: + type: object + properties: + code: + type: string + responses: + '200': + description: OTP Verified + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '400': + $ref: "#/components/responses/400" + '403': + $ref: "#/components/responses/403" + +components: + schemas: + Error: + type: object + description: Structure for an error response + properties: + error: + type: string + BaseAPIResponse: + type: object + description: Simple API response + properties: + message: + type: string + success: + type: boolean + Status: + type: object + description: Response for status + properties: + serverTime: + type: string + lastConnectTime: + type: string + lastDisconnectTime: + type: string + versionNumber: + type: string + viewerCount: + type: integer + online: + type: boolean + Emojis: + type: array + items: + $ref: "#/components/schemas/Emoji" + Emoji: + type: object + description: Name and url for an emoji + properties: + name: + type: string + description: The name of the emoji + url: + type: string + description: URL for the emoji image + AnonymousUser: + type: object + properties: + id: + type: string + accessToken: + type: string + displayName: + type: string + User: + type: object + properties: + createdAt: + type: string + disabledAt: + type: string + nameChangedAt: + type: string + id: + type: string + displayName: + type: string + previousNames: + type: array + items: + type: string + scopes: + type: array + items: + type: string + displayColor: + type: integer + isBot: + type: boolean + authenticated: + type: boolean + Users: + type: array + items: + $ref: "#/components/schemas/User" + Follower: + type: object + properties: + link: + type: string + description: The IRI of the remote actor. + name: + type: string + description: The display name of the follower. + username: + type: string + description: The account username of the remote actor. + image: + type: string + description: The avatar image of the follower. + timestamp: + type: string + description: When this follow request was created. + disabledAt: + type: string + description: When this follower was rejected or disabled. + Followers: + type: array + items: + $ref: "#/components/schemas/Follower" + PaginatedFollowers: + type: object + properties: + total: + type: integer + results: + $ref: "#/components/schemas/Followers" + Event: + type: object + properties: + timestamp: + type: string + type: + type: string + id: + type: string + UserEvent: + type: object + properties: + user: + $ref: "#/components/schemas/User" + hiddenAt: + type: string + clientId: + type: integer + MessageEvent: + type: object + properties: + body: + type: string + ChatMessages: + type: array + items: + anyOf: + - $ref: "#/components/schemas/UserMessage" + - $ref: "#/components/schemas/SystemMessage" + - $ref: "#/components/schemas/ActionMessage" + - $ref: "#/components/schemas/FederatedAction" + UserMessage: + type: object + allOf: + - $ref: "#/components/schemas/Event" + - $ref: "#/components/schemas/UserEvent" + - $ref: "#/components/schemas/MessageEvent" + SystemMessage: + type: object + allOf: + - $ref: "#/components/schemas/Event" + - $ref: "#/components/schemas/MessageEvent" + SystemActionEvent: + type: object + allOf: + - $ref: "#/components/schemas/Event" + - $ref: "#/components/schemas/MessageEvent" + ActionMessage: + type: object + allOf: + - $ref: "#/components/schemas/Event" + - $ref: "#/components/schemas/MessageEvent" + FederatedAction: + type: object + allOf: + - $ref: "#/components/schemas/Event" + - $ref: "#/components/schemas/MessageEvent" + - type: object + properties: + image: + type: string + link: + type: string + title: + type: string + WebConfig: + type: object + properties: + appearanceVariables: + type: object + additionalProperties: + type: string + name: + type: string + customStyles: + type: string + streamTitle: + type: string + offlineMessage: + type: string + logo: + type: string + version: + type: string + socketHostOverride: + type: string + extraPageContent: + type: string + summary: + type: string + tags: + type: array + items: + type: string + socialHandles: + type: array + items: + $ref: "#/components/schemas/SocialHandle" + externalActions: + type: array + items: + $ref: "#/components/schemas/ExternalAction" + notifications: + $ref: "#/components/schemas/NotificationConfig" + federation: + $ref: "#/components/schemas/FederationConfig" + maxSocketPayloadSize: + type: integer + hideViewerCount: + type: boolean + chatDisabled: + type: boolean + nsfw: + type: boolean + authentication: + $ref: "#/components/schemas/AuthenticationConfig" + SocialHandle: + type: object + properties: + platform: + type: string + url: + type: string + icon: + type: string + ExternalAction: + type: object + properties: + url: + type: string + html: + type: string + title: + type: string + description: + type: string + icon: + type: string + color: + type: string + openExternally: + type: boolean + NotificationConfig: + type: object + properties: + browser: + $ref: "#/components/schemas/BrowserConfig" + BrowserConfig: + type: object + properties: + publicKey: + type: string + enabled: + type: boolean + FederationConfig: + type: object + properties: + account: + type: string + followerCount: + type: integer + enabled: + type: boolean + AuthenticationConfig: + type: object + properties: + indieAuthEnabled: + type: boolean + YPDetails: + type: object + properties: + lastConnectTime: + type: string + name: + type: string + description: + type: string + streamTitle: + type: string + logo: + type: string + tags: + type: array + items: + type: string + social: + type: array + items: + $ref: '#/components/schemas/SocialHandle' + viewerCount: + type: integer + overallMaxViewerCount: + type: integer + sessionMaxViewerCount: + type: integer + nsfw: + type: boolean + online: + type: boolean + VideoVariant: + type: object + properties: + index: + type: integer + name: + type: string + PlaybackMetrics: + type: object + properties: + bandwidth: + type: number + format: double + latency: + type: number + format: double + errors: + type: number + format: double + downloadDuration: + type: number + format: double + qualityVariantChanges: + type: number + format: double + Broadcaster: + type: object + properties: + time: + type: string + format: date-time + remoteAddr: + type: string + streamDetails: + $ref: '#/components/schemas/InboundStreamDetails' + InboundStreamDetails: + type: object + properties: + videoCodec: + type: string + audioCodec: + type: string + encoder: + type: string + width: + type: integer + height: + type: integer + videoBitrate: + type: integer + audioBitrate: + type: integer + framerate: + type: number + format: float + CurrentBroadcast: + type: object + properties: + outputSettings: + type: array + items: + $ref: '#/components/schemas/StreamOutputVariant' + latencyLevel: + $ref: '#/components/schemas/LatencyLevel' + StreamOutputVariant: + type: object + properties: + name: + type: string + videoPassthrough: + type: boolean + audioPassthrough: + type: boolean + videoBitrate: + type: integer + audioBitrate: + type: integer + scaledWidth: + type: integer + scaledHeight: + type: integer + framerate: + type: integer + cpuUsageLevel: + type: integer + LatencyLevel: + type: object + properties: + level: + type: integer + StreamHealthOverview: + type: object + properties: + message: + type: string + healthPercentage: + type: integer + representation: + type: integer + healthy: + type: boolean + BrowserNotificationConfiguration: + type: object + properties: + goLiveMessage: + type: string + enabled: + type: boolean + DiscordNotificationConfiguration: + type: object + properties: + webhook: + type: string + goLiveMessage: + type: string + enabled: + type: boolean + S3Info: + type: object + properties: + endpoint: + type: string + accessKey: + type: string + secret: + type: string + bucket: + type: string + region: + type: string + acl: + type: string + pathPrefix: + type: string + enabled: + type: boolean + forcePathStyle: + type: boolean + StreamKey: + type: object + properties: + key: + type: string + comment: + type: string + TimestampedValue: + type: object + properties: + time: + type: string + format: date-time + value: + type: number + format: double + Viewer: + type: object + properties: + firstSeen: + type: string + format: date-time + geo: + $ref: '#/components/schemas/GeoDetails' + userAgent: + type: string + ipAddress: + type: string + clientID: + type: string + GeoDetails: + type: object + properties: + countryCode: + type: string + regionName: + type: string + timeZone: + type: string + CollectedMetrics: + type: object + properties: + disk: + type: array + items: + $ref: '#/components/schemas/TimestampedValue' + memory: + type: array + items: + $ref: '#/components/schemas/TimestampedValue' + cpu: + type: array + items: + $ref: '#/components/schemas/TimestampedValue' + ChatClient: + type: object + properties: + connectedAt: + type: string + format: date-time + user: + $ref: '#/components/schemas/User' + geo: + $ref: '#/components/schemas/GeoDetails' + userAgent: + type: string + messageCount: + type: integer + ChatClients: + type: array + items: + $ref: "#/components/schemas/ChatClient" + IPAddress: + type: object + properties: + createdAt: + type: string + format: date-time + ipAddress: + type: string + notes: + type: string + Webhook: + type: object + properties: + timestamp: + type: string + format: date-time + lastUsed: + type: string + format: date-time + url: + type: string + events: + type: array + items: + $ref: '#/components/schemas/WebhookEventType' + id: + type: integer + WebhookEventType: + type: string + enum: + - CHAT + - USER_JOINED + - USER_PARTED + - NAME_CHANGE + - VISIBILITY-UPDATE + - PING + - PONG + - STREAM_STARTED + - STREAM_STOPPED + - STREAM_TITLE_UPDATED + - SYSTEM + - CHAT_ACTION + ExternalAPIUser: + type: object + properties: + createdAt: + type: string + format: date-time + lastUsedAt: + type: string + format: date-time + id: + type: string + accessToken: + type: string + displayName: + type: string + type: + type: string + scopes: + type: array + items: + type: string + displayColor: + type: integer + isBot: + type: boolean + MessageVisibilityUpdate: + type: object + properties: + idArray: + type: array + items: + type: string + visible: + type: boolean + ModerationUserDetails: + type: object + properties: + user: + $ref: "#/components/schemas/User" + connectedClients: + type: array + items: + $ref: "#/components/schemas/ModerationConnectedClient" + messages: + type: array + items: + $ref: "#/components/schemas/UserMessage" + ModerationConnectedClient: + type: object + properties: + connectedAt: + type: string + format: date-time + userAgent: + type: string + geo: + type: string + id: + type: integer + format: int64 + messageCount: + type: integer + FederatedActivity: + type: object + properties: + timestamp: + type: string + format: date-time + iri: + type: string + actorIRI: + type: string + type: + type: string + PaginatedFederatedActivity: + type: object + properties: + total: + type: integer + results: + $ref: "#/components/schemas/FederatedActivity" + AdminStatus: + type: object + properties: + broadcaster: + $ref: '#/components/schemas/Broadcaster' + currentBroadcast: + $ref: '#/components/schemas/CurrentBroadcast' + health: + $ref: '#/components/schemas/StreamHealthOverview' + streamTitle: + type: string + versionNumber: + type: string + viewerCount: + type: integer + overallPeakViewerCount: + type: integer + sessionPeakViewerCount: + type: integer + online: + type: boolean + AdminServerConfig: + type: object + properties: + instanceDetails: + $ref: '#/components/schemas/AdminWebConfig' + notifications: + $ref: '#/components/schemas/AdminNotificationsConfig' + yp: + $ref: '#/components/schemas/AdminYPInfo' + ffmpegPath: + type: string + adminPassword: + type: string + socketHostOverride: + type: string + webServerIP: + type: string + videoCodec: + type: string + videoServingEndpoint: + type: string + s3: + $ref: '#/components/schemas/S3Info' + federation: + $ref: '#/components/schemas/AdminFederationConfig' + supportedCodecs: + type: array + items: + type: string + externalActions: + type: array + items: + $ref: '#/components/schemas/ExternalAction' + forbiddenUsernames: + type: array + items: + type: string + suggestedUsernames: + type: array + items: + type: string + streamKeys: + type: array + items: + $ref: '#/components/schemas/StreamKey' + videoSettings: + $ref: '#/components/schemas/AdminVideoSettings' + rtmpServerPort: + type: integer + webServerPort: + type: integer + chatDisabled: + type: boolean + chatJoinMessagesEnabled: + type: boolean + chatEstablishedUserMode: + type: boolean + disableSearchIndexing: + type: boolean + streamKeyOverridden: + type: boolean + hideViewerCount: + type: boolean + AdminWebConfig: + type: object + properties: + appearanceVariables: + type: object + additionalProperties: + type: string + version: + type: string + welcomeMessage: + type: string + offlineMessage: + type: string + logo: + type: string + name: + type: string + extraPageContent: + type: string + streamTitle: + type: string + customStyles: + type: string + customJavascript: + type: string + summary: + type: string + tags: + type: array + items: + type: string + socialHandles: + type: array + items: + $ref: '#/components/schemas/SocialHandle' + nsfw: + type: boolean + AdminNotificationsConfig: + type: object + properties: + browser: + $ref: '#/components/schemas/BrowserNotificationConfiguration' + discord: + $ref: '#/components/schemas/DiscordNotificationConfiguration' + AdminYPInfo: + type: object + properties: + instanceUrl: + type: string + enabled: + type: boolean + AdminFederationConfig: + type: object + properties: + username: + type: string + goLiveMessage: + type: string + blockedDomains: + type: array + items: + type: string + enabled: + type: boolean + isPrivate: + type: boolean + showEngagement: + type: boolean + AdminVideoSettings: + type: object + properties: + videoQualityVariants: + type: array + items: + $ref: '#/components/schemas/StreamOutputVariant' + latencyLevel: + type: integer + AdminLog: + type: object + properties: + time: + type: string + format: date-time + message: + type: string + level: + type: string + AdminConfigValue: + type: object + properties: + value: + oneOf: + - type: string + - type: boolean + - type: array + items: + type: string + - type: number + IndieAuthResponse: + type: object + properties: + me: + type: string + profile: + $ref: "#/components/schemas/IndieAuthProfile" + error: + type: string + errorDescription: + type: string + IndieAuthProfile: + type: object + properties: + name: + type: string + url: + type: string + photo: + type: string + IndieAuthServerProfileResponse: + type: object + properties: + me: + type: string + profile: + $ref: "#/components/schemas/IndieAuthServerProfile" + error: + type: string + errorDescription: + type: string + IndieAuthServerProfile: + type: object + properties: + name: + type: string + url: + type: string + photo: + type: string + + headers: + 'Access-Control-Allow-Origin': + schema: + type: string + 'Access-Control-Allow-Credentials': + schema: + type: string + format: boolean + 'Access-Control-Allow-Headers': + schema: + type: string + 'WWW-Authenticate': + schema: + type: string + 'X-Content-Type-Options': + schema: + type: string + + requestBodies: + AdminConfigValue: + description: A single value that is used in the request + content: + application/json: + schema: + $ref: "#/components/schemas/AdminConfigValue" + IndieAuthEndpointForm: + description: Form submission from IndieAuth + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + code: + type: string + redirect_uri: + type: string + client_id: + type: string + codeVerifier: + type: string + + responses: + Default: + description: Unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '204': + description: No Content + '204Options': + description: No Content + headers: + 'Access-Control-Allow-Origin': + $ref: "#/components/headers/Access-Control-Allow-Origin" + '400': + description: Bad request + content: + application/json: + schema: + $ref: "#/components/schemas/BaseAPIResponse" + '401': + description: Unauthorized + content: + text/plain: + schema: + type: string + '401BasicAuth': + description: Basic auth failure + headers: + 'Access-Control-Allow-Origin': + $ref: "#/components/headers/Access-Control-Allow-Origin" + 'Access-Control-Allow-Credentials': + $ref: "#/components/headers/Access-Control-Allow-Credentials" + 'Access-Control-Allow-Headers': + $ref: "#/components/headers/Access-Control-Allow-Headers" + 'WWW-Authenticate': + $ref: "#/components/headers/WWW-Authenticate" + 'X-Content-Type-Options': + $ref: "#/components/headers/X-Content-Type-Options" + content: + text/plain: + schema: + type: string + '403': + description: Forbidden + '404': + description: Not found + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + '501': + description: Not Implemented + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + parameters: + Offset: + in: query + name: offset + schema: + type: integer + description: The number of items to skip before starting to collect the result set + Limit: + in: query + name: limit + schema: + type: integer + description: The numbers of items to return + AccessToken: + in: query + name: accessToken + schema: + type: string + required: true + IndieAuthClientId: + in: query + name: client_id + schema: + type: string + required: true + IndieAuthRedirectURI: + in: query + name: redirect_uri + schema: + type: string + required: true + IndieAuthCodeChallenge: + in: query + name: code_challenge + schema: + type: string + required: true + IndieAuthState: + in: query + name: state + schema: + type: string + required: true + IndieAuthCode: + in: query + name: code + schema: + type: string + required: true + IndieAuthMe: + in: query + name: me + schema: + type: string + required: true + + securitySchemes: + BasicAuth: + type: http + scheme: basic + BearerAuth: + type: http + scheme: bearer diff --git a/static/web/_next/static/chunks/7122-0f5c94dc81f8bbfc.js b/static/web/_next/static/chunks/7122-0f5c94dc81f8bbfc.js new file mode 100644 index 000000000..2a3a705c4 --- /dev/null +++ b/static/web/_next/static/chunks/7122-0f5c94dc81f8bbfc.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7122,9349,1483,9265,4804,8543,6527,5295],{131:function(e,t,r){"use strict";r.r(t),r.d(t,{TinyColor:function(){return n.C},bounds:function(){return y},convertDecimalToHex:function(){return l.Wl},convertHexToDecimal:function(){return l.T6},default:function(){return g},fromRatio:function(){return f},hslToRgb:function(){return l.ve},hsvToRgb:function(){return l.WE},inputToRGB:function(){return d.uA},isReadable:function(){return u},isValidCSSUnit:function(){return d.ky},legacyRandom:function(){return s},mostReadable:function(){return function e(t,r,o){void 0===o&&(o={includeFallbackColors:!1,level:"AA",size:"small"});for(var l=null,i=0,c=o.includeFallbackColors,f=o.level,s=o.size,d=0;di&&(i=v,l=new n.C(p))}return u(t,l,{level:f,size:s})||!c?l:(o.includeFallbackColors=!1,e(t,["#fff","#000"],o))}},names:function(){return o.R},numberInputToObject:function(){return l.Yt},parseIntFromHex:function(){return l.VD},random:function(){return function e(t){if(void 0===t&&(t={}),void 0!==t.count&&null!==t.count){var r,o,a,u=t.count,l=[];for(t.count=void 0;u>l.length;)t.count=null,t.seed&&(t.seed+=1),l.push(e(t));return t.count=u,l}var i=(r=t.hue,o=t.seed,(a=v(function(e){var t=parseInt(e,10);if(!Number.isNaN(t)&&t<360&&t>0)return[t,t];if("string"==typeof e){var r=y.find(function(t){return t.name===e});if(r){var o=m(r);if(o.hueRange)return o.hueRange}var a=new n.C(e);if(a.isValid){var u=a.toHsv().h;return[u,u]}}return[0,360]}(r),o))<0&&(a=360+a),a),c=function(e,t){if("monochrome"===t.hue)return 0;if("random"===t.luminosity)return v([0,100],t.seed);var r=p(e).saturationRange,n=r[0],o=r[1];switch(t.luminosity){case"bright":n=55;break;case"dark":n=o-10;break;case"light":o=55}return v([n,o],t.seed)}(i,t),f=function(e,t,r){var n=function(e,t){for(var r=p(e).lowerBounds,n=0;n=o&&t<=u){var i=(l-a)/(u-o),c=a-i*o;return i*t+c}}return 0}(e,t),o=100;switch(r.luminosity){case"dark":o=n+20;break;case"light":n=(o+n)/2;break;case"random":n=0,o=100}return v([n,o],r.seed)}(i,c,t),s={h:i,s:c,v:f};return void 0!==t.alpha&&(s.a=t.alpha),new n.C(s)}},readability:function(){return a},rgbToHex:function(){return l.vq},rgbToHsl:function(){return l.lC},rgbToHsv:function(){return l.py},rgbToRgb:function(){return l.rW},rgbaToArgbHex:function(){return l.GC},rgbaToHex:function(){return l.s},stringInputToObject:function(){return d.uz},tinycolor:function(){return n.H},toMsFilter:function(){return i}});var n=r(10274),o=r(48701);function a(e,t){var r=new n.C(e),o=new n.C(t);return(Math.max(r.getLuminance(),o.getLuminance())+.05)/(Math.min(r.getLuminance(),o.getLuminance())+.05)}function u(e,t,r){void 0===r&&(r={level:"AA",size:"small"});var n,o,u=a(e,t);switch((null!==(n=r.level)&&void 0!==n?n:"AA")+(null!==(o=r.size)&&void 0!==o?o:"small")){case"AAsmall":case"AAAlarge":return u>=4.5;case"AAlarge":return u>=3;case"AAAsmall":return u>=7;default:return!1}}var l=r(86500);function i(e,t){var r=new n.C(e),o="#"+(0,l.GC)(r.r,r.g,r.b,r.a),a=o,u=r.gradientType?"GradientType = 1, ":"";if(t){var i=new n.C(t);a="#"+(0,l.GC)(i.r,i.g,i.b,i.a)}return"progid:DXImageTransform.Microsoft.gradient(".concat(u,"startColorstr=").concat(o,",endColorstr=").concat(a,")")}var c=r(90279);function f(e,t){var r={r:(0,c.JX)(e.r),g:(0,c.JX)(e.g),b:(0,c.JX)(e.b)};return void 0!==e.a&&(r.a=Number(e.a)),new n.C(r,t)}function s(){return new n.C({r:Math.random(),g:Math.random(),b:Math.random()})}var d=r(1350);function p(e){e>=334&&e<=360&&(e-=360);for(var t=0;t=r.hueRange[0]&&e<=r.hueRange[1])return r}throw Error("Color not found")}function v(e,t){if(void 0===t)return Math.floor(e[0]+Math.random()*(e[1]+1-e[0]));var r=e[1]||1,n=e[0]||0;return Math.floor(n+(t=(9301*t+49297)%233280)/233280*(r-n))}function m(e){var t=e.lowerBounds[0][0],r=e.lowerBounds[e.lowerBounds.length-1][0],n=e.lowerBounds[e.lowerBounds.length-1][1],o=e.lowerBounds[0][1];return{name:e.name,hueRange:e.hueRange,lowerBounds:e.lowerBounds,saturationRange:[t,r],brightnessRange:[n,o]}}var y=[{name:"monochrome",hueRange:null,lowerBounds:[[0,0],[100,0]]},{name:"red",hueRange:[-26,18],lowerBounds:[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]},{name:"orange",hueRange:[19,46],lowerBounds:[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]},{name:"yellow",hueRange:[47,62],lowerBounds:[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]},{name:"green",hueRange:[63,178],lowerBounds:[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]},{name:"blue",hueRange:[179,257],lowerBounds:[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]},{name:"purple",hueRange:[258,282],lowerBounds:[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]},{name:"pink",hueRange:[283,334],lowerBounds:[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]]}],g=n.H},47035:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"}},99262:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"}},11529:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"}},96570:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"}},94220:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z"}}]},name:"close-circle",theme:"outlined"}},47754:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"}},86233:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"}},86313:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"}},23153:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"}},82597:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"}},67962:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"}},89349:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(20487))&&n.__esModule?n:{default:n};t.default=o,e.exports=o},74804:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(23324))&&n.__esModule?n:{default:n};t.default=o,e.exports=o},75575:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(98951))&&n.__esModule?n:{default:n};t.default=o,e.exports=o},71064:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(21808))&&n.__esModule?n:{default:n};t.default=o,e.exports=o},65295:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(46605))&&n.__esModule?n:{default:n};t.default=o,e.exports=o},16527:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(77624))&&n.__esModule?n:{default:n};t.default=o,e.exports=o},31483:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(75036))&&n.__esModule?n:{default:n};t.default=o,e.exports=o},28543:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(24921))&&n.__esModule?n:{default:n};t.default=o,e.exports=o},8201:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(78250))&&n.__esModule?n:{default:n};t.default=o,e.exports=o},31493:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(5590))&&n.__esModule?n:{default:n};t.default=o,e.exports=o},59265:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(57273))&&n.__esModule?n:{default:n};t.default=o,e.exports=o},20487:function(e,t,r){"use strict";var n=r(64836),o=r(18698);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(42122)),u=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=o(e)&&"function"!=typeof e)return{default:e};var r=c(void 0);if(r&&r.has(e))return r.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&({}).hasOwnProperty.call(e,u)){var l=a?Object.getOwnPropertyDescriptor(e,u):null;l&&(l.get||l.set)?Object.defineProperty(n,u,l):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n}(r(67294)),l=n(r(47035)),i=n(r(3908));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(c=function(e){return e?r:t})(e)}var f=u.forwardRef(function(e,t){return u.createElement(i.default,(0,a.default)((0,a.default)({},e),{},{ref:t,icon:l.default}))});t.default=f},23324:function(e,t,r){"use strict";var n=r(64836),o=r(18698);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(42122)),u=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=o(e)&&"function"!=typeof e)return{default:e};var r=c(void 0);if(r&&r.has(e))return r.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&({}).hasOwnProperty.call(e,u)){var l=a?Object.getOwnPropertyDescriptor(e,u):null;l&&(l.get||l.set)?Object.defineProperty(n,u,l):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n}(r(67294)),l=n(r(99262)),i=n(r(3908));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(c=function(e){return e?r:t})(e)}var f=u.forwardRef(function(e,t){return u.createElement(i.default,(0,a.default)((0,a.default)({},e),{},{ref:t,icon:l.default}))});t.default=f},98951:function(e,t,r){"use strict";var n=r(64836),o=r(18698);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(42122)),u=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=o(e)&&"function"!=typeof e)return{default:e};var r=c(void 0);if(r&&r.has(e))return r.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&({}).hasOwnProperty.call(e,u)){var l=a?Object.getOwnPropertyDescriptor(e,u):null;l&&(l.get||l.set)?Object.defineProperty(n,u,l):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n}(r(67294)),l=n(r(11529)),i=n(r(3908));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(c=function(e){return e?r:t})(e)}var f=u.forwardRef(function(e,t){return u.createElement(i.default,(0,a.default)((0,a.default)({},e),{},{ref:t,icon:l.default}))});t.default=f},21808:function(e,t,r){"use strict";var n=r(64836),o=r(18698);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(42122)),u=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=o(e)&&"function"!=typeof e)return{default:e};var r=c(void 0);if(r&&r.has(e))return r.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&({}).hasOwnProperty.call(e,u)){var l=a?Object.getOwnPropertyDescriptor(e,u):null;l&&(l.get||l.set)?Object.defineProperty(n,u,l):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n}(r(67294)),l=n(r(96570)),i=n(r(3908));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(c=function(e){return e?r:t})(e)}var f=u.forwardRef(function(e,t){return u.createElement(i.default,(0,a.default)((0,a.default)({},e),{},{ref:t,icon:l.default}))});t.default=f},46605:function(e,t,r){"use strict";var n=r(64836),o=r(18698);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(42122)),u=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=o(e)&&"function"!=typeof e)return{default:e};var r=c(void 0);if(r&&r.has(e))return r.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&({}).hasOwnProperty.call(e,u)){var l=a?Object.getOwnPropertyDescriptor(e,u):null;l&&(l.get||l.set)?Object.defineProperty(n,u,l):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n}(r(67294)),l=n(r(94220)),i=n(r(3908));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(c=function(e){return e?r:t})(e)}var f=u.forwardRef(function(e,t){return u.createElement(i.default,(0,a.default)((0,a.default)({},e),{},{ref:t,icon:l.default}))});t.default=f},77624:function(e,t,r){"use strict";var n=r(64836),o=r(18698);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(42122)),u=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=o(e)&&"function"!=typeof e)return{default:e};var r=c(void 0);if(r&&r.has(e))return r.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&({}).hasOwnProperty.call(e,u)){var l=a?Object.getOwnPropertyDescriptor(e,u):null;l&&(l.get||l.set)?Object.defineProperty(n,u,l):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n}(r(67294)),l=n(r(47754)),i=n(r(3908));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(c=function(e){return e?r:t})(e)}var f=u.forwardRef(function(e,t){return u.createElement(i.default,(0,a.default)((0,a.default)({},e),{},{ref:t,icon:l.default}))});t.default=f},75036:function(e,t,r){"use strict";var n=r(64836),o=r(18698);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(42122)),u=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=o(e)&&"function"!=typeof e)return{default:e};var r=c(void 0);if(r&&r.has(e))return r.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&({}).hasOwnProperty.call(e,u)){var l=a?Object.getOwnPropertyDescriptor(e,u):null;l&&(l.get||l.set)?Object.defineProperty(n,u,l):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n}(r(67294)),l=n(r(86233)),i=n(r(3908));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(c=function(e){return e?r:t})(e)}var f=u.forwardRef(function(e,t){return u.createElement(i.default,(0,a.default)((0,a.default)({},e),{},{ref:t,icon:l.default}))});t.default=f},24921:function(e,t,r){"use strict";var n=r(64836),o=r(18698);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(42122)),u=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=o(e)&&"function"!=typeof e)return{default:e};var r=c(void 0);if(r&&r.has(e))return r.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&({}).hasOwnProperty.call(e,u)){var l=a?Object.getOwnPropertyDescriptor(e,u):null;l&&(l.get||l.set)?Object.defineProperty(n,u,l):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n}(r(67294)),l=n(r(86313)),i=n(r(3908));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(c=function(e){return e?r:t})(e)}var f=u.forwardRef(function(e,t){return u.createElement(i.default,(0,a.default)((0,a.default)({},e),{},{ref:t,icon:l.default}))});t.default=f},78250:function(e,t,r){"use strict";var n=r(64836),o=r(18698);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(42122)),u=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=o(e)&&"function"!=typeof e)return{default:e};var r=c(void 0);if(r&&r.has(e))return r.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&({}).hasOwnProperty.call(e,u)){var l=a?Object.getOwnPropertyDescriptor(e,u):null;l&&(l.get||l.set)?Object.defineProperty(n,u,l):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n}(r(67294)),l=n(r(23153)),i=n(r(3908));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(c=function(e){return e?r:t})(e)}var f=u.forwardRef(function(e,t){return u.createElement(i.default,(0,a.default)((0,a.default)({},e),{},{ref:t,icon:l.default}))});t.default=f},5590:function(e,t,r){"use strict";var n=r(64836),o=r(18698);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(42122)),u=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=o(e)&&"function"!=typeof e)return{default:e};var r=c(void 0);if(r&&r.has(e))return r.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&({}).hasOwnProperty.call(e,u)){var l=a?Object.getOwnPropertyDescriptor(e,u):null;l&&(l.get||l.set)?Object.defineProperty(n,u,l):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n}(r(67294)),l=n(r(82597)),i=n(r(3908));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(c=function(e){return e?r:t})(e)}var f=u.forwardRef(function(e,t){return u.createElement(i.default,(0,a.default)((0,a.default)({},e),{},{ref:t,icon:l.default}))});t.default=f},57273:function(e,t,r){"use strict";var n=r(64836),o=r(18698);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(42122)),u=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=o(e)&&"function"!=typeof e)return{default:e};var r=c(void 0);if(r&&r.has(e))return r.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&({}).hasOwnProperty.call(e,u)){var l=a?Object.getOwnPropertyDescriptor(e,u):null;l&&(l.get||l.set)?Object.defineProperty(n,u,l):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n}(r(67294)),l=n(r(67962)),i=n(r(3908));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(c=function(e){return e?r:t})(e)}var f=u.forwardRef(function(e,t){return u.createElement(i.default,(0,a.default)((0,a.default)({},e),{},{ref:t,icon:l.default}))});t.default=f},39964:function(e,t,r){"use strict";var n=r(32456);t.Z=n.Z},36795:function(e,t,r){"use strict";var n=r(8405),o=r(63054),a=n.ZP;a.Header=n.h4,a.Footer=n.$_,a.Content=n.VY,a.Sider=o.Z,a._InternalSiderContext=o.D,t.default=a},94715:function(e,t,r){"use strict";var n=r(39278);t.Z=n.Z},46656:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PresetStatusColorTypes=t.PresetColorTypes=void 0;var n=r(88574);t.PresetStatusColorTypes=(0,n.tuple)("success","processing","error","default","warning"),t.PresetColorTypes=(0,n.tuple)("pink","red","yellow","orange","cyan","green","blue","purple","geekblue","magenta","volcano","gold","lime")},6806:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTransitionName=t.getTransitionDirection=t.default=void 0;var n=r(88574),o=function(){return{height:0,opacity:0}},a=function(e){return{height:e.scrollHeight,opacity:1}},u=function(e,t){return(null==t?void 0:t.deadline)===!0||"height"===t.propertyName};(0,n.tuple)("bottomLeft","bottomRight","topLeft","topRight"),t.getTransitionDirection=function(e){return void 0!==e&&("topLeft"===e||"topRight"===e)?"slide-down":"slide-up"},t.getTransitionName=function(e,t,r){return void 0!==r?r:"".concat(e,"-").concat(t)},t.default={motionName:"ant-motion-collapse",onAppearStart:o,onEnterStart:o,onAppearActive:a,onEnterActive:a,onLeaveStart:function(e){return{height:e?e.offsetHeight:0}},onLeaveActive:o,onAppearEnd:u,onEnterEnd:u,onLeaveEnd:u,motionDeadline:500}},24026:function(e,t,r){"use strict";var n=r(64836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.arrowWidth,r=void 0===t?4:t,n=e.horizontalArrowShift,u=void 0===n?16:n,l=e.verticalArrowShift,f=void 0===l?8:l,s=e.autoAdjustOverflow,d=e.arrowPointAtCenter,p={left:{points:["cr","cl"],offset:[-4,0]},right:{points:["cl","cr"],offset:[4,0]},top:{points:["bc","tc"],offset:[0,-4]},bottom:{points:["tc","bc"],offset:[0,4]},topLeft:{points:["bl","tc"],offset:[-(u+r),-4]},leftTop:{points:["tr","cl"],offset:[-4,-(f+r)]},topRight:{points:["br","tc"],offset:[u+r,-4]},rightTop:{points:["tl","cr"],offset:[4,-(f+r)]},bottomRight:{points:["tr","bc"],offset:[u+r,4]},rightBottom:{points:["bl","cr"],offset:[4,f+r]},bottomLeft:{points:["tl","bc"],offset:[-(u+r),4]},leftBottom:{points:["br","cl"],offset:[-4,f+r]}};return Object.keys(p).forEach(function(e){p[e]=d?(0,o.default)((0,o.default)({},p[e]),{overflow:c(s),targetOffset:i}):(0,o.default)((0,o.default)({},a.placements[e]),{overflow:c(s)}),p[e].ignoreShake=!0}),p},t.getOverflowOptions=c;var o=n(r(10434)),a=r(27066),u={adjustX:1,adjustY:1},l={adjustX:0,adjustY:0},i=[0,0];function c(e){return"boolean"==typeof e?e?u:l:(0,o.default)((0,o.default)({},l),e)}},84243:function(e,t,r){"use strict";var n=r(75263).default;Object.defineProperty(t,"__esModule",{value:!0}),t.cloneElement=function(e,t){return u(e,e,t)},t.isFragment=function(e){return e&&a(e)&&e.type===o.Fragment},t.isValidElement=void 0,t.replaceElement=u;var o=n(r(67294)),a=t.isValidElement=o.isValidElement;function u(e,t,r){return a(e)?o.cloneElement(e,"function"==typeof r?r(e.props||{}):r):t}},88574:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tupleNum=t.tuple=void 0,t.tuple=function(){for(var e=arguments.length,t=Array(e),r=0;r0&&(S=f.createElement(d.default.Provider,{value:N},t)),a&&(S=f.createElement(p.default,{locale:a,_ANT_MARK__:p.ANT_MARK},S)),(w||r)&&(S=f.createElement(i.default.Provider,{value:T},S)),u&&(S=f.createElement(x.SizeContextProvider,{size:u},S)),void 0!==M&&(S=f.createElement(_.DisabledContextProvider,{disabled:M},S)),f.createElement(h.ConfigContext.Provider,{value:E},S)},j=function(e){return f.useEffect(function(){e.direction&&(y.default.config({rtl:"rtl"===e.direction}),g.default.config({rtl:"rtl"===e.direction}))},[e.direction]),f.createElement(v.default,null,function(t,r,n){return f.createElement(h.ConfigConsumer,null,function(t){return f.createElement(M,(0,l.default)({parentContext:t,legacyLocale:n},e))})})};j.ConfigContext=h.ConfigContext,j.SizeContext=x.default,j.config=function(e){var t=e.prefixCls,r=e.iconPrefixCls,a=e.theme;void 0!==t&&(n=t),void 0!==r&&(o=r),a&&(0,b.registerTheme)(n||P,a)},t.default=j},74315:function(e,t,r){"use strict";var n=r(64836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(10434)),a=n(r(55733)),u=n(r(50302)),l={lang:(0,o.default)({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},a.default),timePickerLocale:(0,o.default)({},u.default)};t.default=l},60043:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(67294);t.default=(0,n.createContext)(void 0)},76185:function(e,t,r){"use strict";var n=r(75263).default,o=r(64836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.useLocaleReceiver=t.default=void 0;var a=o(r(10434)),u=n(r(67294)),l=o(r(85523)),i=o(r(29062));t.default=function(e){var t=e.componentName,r=void 0===t?"global":t,n=e.defaultLocale,o=e.children,c=u.useContext(l.default);return o(u.useMemo(function(){var e,t=n||i.default[r],o=null!==(e=null==c?void 0:c[r])&&void 0!==e?e:{};return(0,a.default)((0,a.default)({},t instanceof Function?t():t),o||{})},[r,n,c]),u.useMemo(function(){var e=c&&c.locale;return c&&c.exist&&!e?i.default.locale:e},[c]),c)},t.useLocaleReceiver=function(e,t){var r=u.useContext(l.default);return[u.useMemo(function(){var n,o=t||i.default[e],u=null!==(n=null==r?void 0:r[e])&&void 0!==n?n:{};return(0,a.default)((0,a.default)({},"function"==typeof o?o():o),u||{})},[e,t,r])]}},85523:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=(0,r(67294).createContext)(void 0);t.default=n},29062:function(e,t,r){"use strict";var n=r(64836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(73676));t.default=o.default},12781:function(e,t,r){"use strict";var n=r(75263).default,o=r(64836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ANT_MARK=void 0;var a=o(r(10434)),u=n(r(67294));o(r(44905));var l=r(10075),i=o(r(85523));t.ANT_MARK="internalMark",t.default=function(e){var t=e.locale,r=void 0===t?{}:t,n=e.children;e._ANT_MARK__,u.useEffect(function(){return(0,l.changeConfirmLocale)(r&&r.Modal),function(){(0,l.changeConfirmLocale)()}},[r]);var o=u.useMemo(function(){return(0,a.default)((0,a.default)({},r),{exist:!0})},[r]);return u.createElement(i.default.Provider,{value:o},n)}},73676:function(e,t,r){"use strict";var n=r(64836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(38494)),a=n(r(65849)),u=n(r(74315)),l=n(r(50302)),i="${label} is not a valid ${type}",c={locale:"en",Pagination:o.default,DatePicker:u.default,TimePicker:l.default,Calendar:a.default,global:{placeholder:"Please select"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckall:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand"},PageHeader:{back:"Back"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:i,method:i,array:i,object:i,number:i,date:i,boolean:i,integer:i,float:i,regexp:i,email:i,url:i,hex:i},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"}};t.default=c},99595:function(e,t,r){"use strict";var n=r(75263).default,o=r(64836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return function(){var r,n,o=null,s=(0,l.default)({add:function(e,t){null==o||o.component.add(e,t)}}),d=(0,u.default)(s,2),p=d[0],v=d[1],m=i.useRef({});return m.current.open=function(u){var l=u.prefixCls,i=r("message",l),f=r(),s=u.key||(0,c.getKeyThenIncreaseKey)(),d=new Promise(function(r){var l=function(){return"function"==typeof u.onClose&&u.onClose(),r(!0)};e((0,a.default)((0,a.default)({},u),{prefixCls:i,rootPrefixCls:f,getPopupContainer:n}),function(e){var r=e.prefixCls;o=e.instance,p(t((0,a.default)((0,a.default)({},u),{key:s,onClose:l}),r))})}),v=function(){o&&o.removeNotice(s)};return v.then=function(e,t){return d.then(e,t)},v.promise=d,v},c.typeList.forEach(function(e){return(0,c.attachTypeApi)(m.current,e)}),[m.current,i.createElement(f.ConfigConsumer,{key:"holder"},function(e){return r=e.getPrefixCls,n=e.getPopupContainer,v})]}};var a=o(r(10434)),u=o(r(27424)),l=o(r(66190)),i=n(r(67294)),c=r(83694),f=r(51871)},83694:function(e,t,r){"use strict";var n,o,a,u,l=r(75263).default,i=r(64836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.attachTypeApi=R,t.getInstance=t.default=void 0,t.getKeyThenIncreaseKey=j,t.typeList=void 0;var c=i(r(10434)),f=i(r(38416)),s=i(r(89349)),d=i(r(71064)),p=i(r(31483)),v=i(r(8201)),m=i(r(59265)),y=i(r(93967)),g=i(r(31277)),h=l(r(67294)),b=l(r(51871)),_=i(r(99595)),x=3,C=1,P="",O="move-up",w=!1,M=!1;function j(){return C++}function k(e,t){var r=e.prefixCls,l=e.getPopupContainer,i=(0,b.globalConfig)(),c=i.getPrefixCls,f=i.getRootPrefixCls,s=i.getIconPrefixCls,d=c("message",r||P),p=f(e.rootPrefixCls,d),v=s();if(n){t({prefixCls:d,rootPrefixCls:p,iconPrefixCls:v,instance:n});return}var m={prefixCls:d,transitionName:w?O:"".concat(p,"-").concat(O),style:{top:o},getContainer:a||l,maxCount:u};g.default.newInstance(m,function(e){if(n){t({prefixCls:d,rootPrefixCls:p,iconPrefixCls:v,instance:n});return}n=e,t({prefixCls:d,rootPrefixCls:p,iconPrefixCls:v,instance:e})})}var E={info:v.default,success:s.default,error:d.default,warning:p.default,loading:m.default},T=t.typeList=Object.keys(E);function S(e,t,r){var n=void 0!==e.duration?e.duration:x,o=E[e.type],a=(0,y.default)("".concat(t,"-custom-content"),(0,f.default)((0,f.default)({},"".concat(t,"-").concat(e.type),e.type),"".concat(t,"-rtl"),!0===M));return{key:e.key,duration:n,style:e.style||{},className:e.className,content:h.createElement(b.default,{iconPrefixCls:r},h.createElement("div",{className:a},e.icon||o&&h.createElement(o,null),h.createElement("span",null,e.content))),onClose:e.onClose,onClick:e.onClick}}var N={open:function(e){var t=e.key||j(),r=new Promise(function(r){var n=function(){return"function"==typeof e.onClose&&e.onClose(),r(!0)};k(e,function(r){var o=r.prefixCls,a=r.iconPrefixCls;r.instance.notice(S((0,c.default)((0,c.default)({},e),{key:t,onClose:n}),o,a))})}),o=function(){var r;n&&(n.removeNotice(t),null===(r=e.onClose)||void 0===r||r.call(e))};return o.then=function(e,t){return r.then(e,t)},o.promise=r,o},config:function(e){void 0!==e.top&&(o=e.top,n=null),void 0!==e.duration&&(x=e.duration),void 0!==e.prefixCls&&(P=e.prefixCls),void 0!==e.getContainer&&(a=e.getContainer,n=null),void 0!==e.transitionName&&(O=e.transitionName,n=null,w=!0),void 0!==e.maxCount&&(u=e.maxCount,n=null),void 0!==e.rtl&&(M=e.rtl)},destroy:function(e){n&&(e?(0,n.removeNotice)(e):((0,n.destroy)(),n=null))}};function R(e,t){e[t]=function(r,n,o){return"[object Object]"===Object.prototype.toString.call(r)&&r.content?e.open((0,c.default)((0,c.default)({},r),{type:t})):("function"==typeof n&&(o=n,n=void 0),e.open({content:r,duration:n,type:t,onClose:o}))}}T.forEach(function(e){return R(N,e)}),N.warn=N.warning,N.useMessage=(0,_.default)(k,S),t.getInstance=function(){return null},t.default=N},10075:function(e,t,r){"use strict";var n=r(64836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.changeConfirmLocale=function(e){u=e?(0,o.default)((0,o.default)({},u),e):(0,o.default)({},a.default.Modal)},t.getConfirmLocale=function(){return u};var o=n(r(10434)),a=n(r(73676)),u=(0,o.default)({},a.default.Modal)},8432:function(e,t,r){"use strict";var n=r(75263).default,o=r(64836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return function(){var r,n=null,o=(0,l.default)({add:function(e,t){null==n||n.component.add(e,t)}}),f=(0,u.default)(o,2),s=f[0],d=f[1],p=i.useRef({});return p.current.open=function(o){var u=o.prefixCls,l=r("notification",u);e((0,a.default)((0,a.default)({},o),{prefixCls:l}),function(e){var r=e.prefixCls;n=e.instance,s(t(o,r))})},["success","info","warning","error"].forEach(function(e){p.current[e]=function(t){return p.current.open((0,a.default)((0,a.default)({},t),{type:e}))}}),[p.current,i.createElement(c.ConfigConsumer,{key:"holder"},function(e){return r=e.getPrefixCls,d})]}};var a=o(r(10434)),u=o(r(27424)),l=o(r(66190)),i=n(r(67294)),c=r(51871)},86347:function(e,t,r){"use strict";var n,o,a,u=r(75263).default,l=r(64836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.getInstance=t.default=void 0;var i=l(r(17061)),c=l(r(10434)),f=l(r(38416)),s=l(r(74804)),d=l(r(65295)),p=l(r(16527)),v=l(r(28543)),m=l(r(31493)),y=l(r(93967)),g=l(r(31277)),h=u(r(67294)),b=u(r(51871)),_=l(r(8432)),x={},C=4.5,P=24,O=24,w="",M="topRight",j=!1;function k(e,t){var r=e.placement,o=void 0===r?M:r,u=e.top,l=e.bottom,i=e.getContainer,c=void 0===i?n:i,s=e.prefixCls,d=(0,b.globalConfig)(),p=d.getPrefixCls,v=d.getIconPrefixCls,m=p("notification",s||w),h=v(),_="".concat(m,"-").concat(o),C=x[_];if(C){Promise.resolve(C).then(function(e){t({prefixCls:"".concat(m,"-notice"),iconPrefixCls:h,instance:e})});return}var k=(0,y.default)("".concat(m,"-").concat(o),(0,f.default)({},"".concat(m,"-rtl"),!0===j));x[_]=new Promise(function(e){g.default.newInstance({prefixCls:m,className:k,style:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:P,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:O;switch(e){case"top":t={left:"50%",transform:"translateX(-50%)",right:"auto",top:r,bottom:"auto"};break;case"topLeft":t={left:0,top:r,bottom:"auto"};break;case"topRight":t={right:0,top:r,bottom:"auto"};break;case"bottom":t={left:"50%",transform:"translateX(-50%)",right:"auto",top:"auto",bottom:n};break;case"bottomLeft":t={left:0,top:"auto",bottom:n};break;default:t={right:0,top:"auto",bottom:n}}return t}(o,u,l),getContainer:c,maxCount:a},function(r){e(r),t({prefixCls:"".concat(m,"-notice"),iconPrefixCls:h,instance:r})})})}var E={success:s.default,info:m.default,error:d.default,warning:v.default};function T(e,t,r){var n=e.duration,a=e.icon,u=e.type,l=e.description,i=e.message,c=e.btn,s=e.onClose,d=e.onClick,v=e.key,m=e.style,g=e.className,_=e.closeIcon,x=void 0===_?o:_,P=e.props,O=void 0===n?C:n,w=null;a?w=h.createElement("span",{className:"".concat(t,"-icon")},e.icon):u&&(w=h.createElement(E[u]||null,{className:"".concat(t,"-icon ").concat(t,"-icon-").concat(u)}));var M=void 0===x?h.createElement("span",{className:"".concat(t,"-close-x")},h.createElement(p.default,{className:"".concat(t,"-close-icon")})):x,j=!l&&w?h.createElement("span",{className:"".concat(t,"-message-single-line-auto-margin")}):null;return{content:h.createElement(b.default,{iconPrefixCls:r},h.createElement("div",{className:w?"".concat(t,"-with-icon"):"",role:"alert"},w,h.createElement("div",{className:"".concat(t,"-message")},j,i),h.createElement("div",{className:"".concat(t,"-description")},l),c?h.createElement("span",{className:"".concat(t,"-btn")},c):null)),duration:O,closable:!0,closeIcon:M,onClose:s,onClick:d,key:v,style:m||{},className:(0,y.default)(g,(0,f.default)({},"".concat(t,"-").concat(u),!!u)),props:P}}var S={open:function(e){k(e,function(t){var r=t.prefixCls,n=t.iconPrefixCls;t.instance.notice(T(e,r,n))})},close:function(e){Object.keys(x).forEach(function(t){return Promise.resolve(x[t]).then(function(t){t.removeNotice(e)})})},config:function(e){var t=e.duration,r=e.placement,u=e.bottom,l=e.top,i=e.getContainer,c=e.closeIcon,f=e.prefixCls;void 0!==f&&(w=f),void 0!==t&&(C=t),void 0!==r?M=r:e.rtl&&(M="topLeft"),void 0!==u&&(O=u),void 0!==l&&(P=l),void 0!==i&&(n=i),void 0!==c&&(o=c),void 0!==e.rtl&&(j=e.rtl),void 0!==e.maxCount&&(a=e.maxCount)},destroy:function(){Object.keys(x).forEach(function(e){Promise.resolve(x[e]).then(function(e){e.destroy()}),delete x[e]})}};["success","info","warning","error"].forEach(function(e){S[e]=function(t){return S.open((0,c.default)((0,c.default)({},t),{type:e}))}}),S.warn=S.warning,S.useNotification=(0,_.default)(k,T),t.getInstance=function(e){var t,r,n,o;return t=void 0,r=void 0,n=void 0,o=(0,i.default)().mark(function e(){return(0,i.default)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",null);case 1:case"end":return e.stop()}},e)}),new(n||(n=Promise))(function(e,a){function u(e){try{i(o.next(e))}catch(e){a(e)}}function l(e){try{i(o.throw(e))}catch(e){a(e)}}function i(t){var r;t.done?e(t.value):((r=t.value)instanceof n?r:new n(function(e){e(r)})).then(u,l)}i((o=o.apply(t,r||[])).next())})},t.default=S},52912:function(e,t,r){"use strict";var n=r(75263).default,o=r(64836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.useCompactItemContext=t.default=t.SpaceCompactItemContext=t.NoCompactStyle=void 0;var a=o(r(10434)),u=o(r(38416)),l=o(r(93967)),i=o(r(87477)),c=n(r(67294)),f=r(51871),s=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r},d=t.SpaceCompactItemContext=c.createContext(null);t.useCompactItemContext=function(e,t){var r=c.useContext(d),n=c.useMemo(function(){if(!r)return"";var n=r.compactDirection,o=r.isFirstItem,a=r.isLastItem,i="vertical"===n?"-vertical-":"-";return(0,l.default)((0,u.default)((0,u.default)((0,u.default)((0,u.default)({},"".concat(e,"-compact").concat(i,"item"),!0),"".concat(e,"-compact").concat(i,"first-item"),o),"".concat(e,"-compact").concat(i,"last-item"),a),"".concat(e,"-compact").concat(i,"item-rtl"),"rtl"===t))},[e,t,r]);return{compactSize:null==r?void 0:r.compactSize,compactDirection:null==r?void 0:r.compactDirection,compactItemClassnames:n}},t.NoCompactStyle=function(e){var t=e.children;return c.createElement(d.Provider,{value:null},t)};var p=function(e){var t=e.children,r=s(e,["children"]);return c.createElement(d.Provider,{value:r},t)};t.default=function(e){var t=c.useContext(f.ConfigContext),r=t.getPrefixCls,n=t.direction,o=e.size,v=void 0===o?"middle":o,m=e.direction,y=e.block,g=e.prefixCls,h=e.className,b=e.children,_=s(e,["size","direction","block","prefixCls","className","children"]),x=r("space-compact",g),C=(0,l.default)(x,(0,u.default)((0,u.default)((0,u.default)({},"".concat(x,"-rtl"),"rtl"===n),"".concat(x,"-block"),y),"".concat(x,"-vertical"),"vertical"===m),h),P=c.useContext(d),O=(0,i.default)(b),w=c.useMemo(function(){return O.map(function(e,t){var r=e&&e.key||"".concat(x,"-item-").concat(t);return c.createElement(p,{key:r,compactSize:v,compactDirection:m,isFirstItem:0===t&&(!P||(null==P?void 0:P.isFirstItem)),isLastItem:t===O.length-1&&(!P||(null==P?void 0:P.isLastItem))},e)})},[v,O,P]);return 0===O.length?null:c.createElement("div",(0,a.default)({className:C},_),w)}},50302:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={placeholder:"Select time",rangePlaceholder:["Start time","End time"]}},56795:function(e,t,r){"use strict";var n=r(75263).default,o=r(64836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=o(r(38416)),u=o(r(27424)),l=o(r(10434)),i=o(r(93967)),c=o(r(16491)),f=o(r(39894)),s=n(r(67294)),d=r(51871),p=r(46656),v=r(6806),m=o(r(24026)),y=r(84243);o(r(44905));var g=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r},h=function(e,t){var r={},n=(0,l.default)({},e);return t.forEach(function(t){e&&t in e&&(r[t]=e[t],delete n[t])}),{picked:r,omitted:n}},b=new RegExp("^(".concat(p.PresetColorTypes.join("|"),")(-inverse)?$")),_=s.forwardRef(function(e,t){var r,n,o=s.useContext(d.ConfigContext),p=o.getPopupContainer,_=o.getPrefixCls,x=o.direction,C=(0,f.default)(!1,{value:void 0!==e.open?e.open:e.visible,defaultValue:void 0!==e.defaultOpen?e.defaultOpen:e.defaultVisible}),P=(0,u.default)(C,2),O=P[0],w=P[1],M=function(){var t=e.title,r=e.overlay;return!t&&!r&&0!==t},j=function(){var t=e.builtinPlacements,r=e.arrowPointAtCenter,n=e.autoAdjustOverflow;return t||(0,m.default)({arrowPointAtCenter:void 0!==r&&r,autoAdjustOverflow:void 0===n||n})},k=e.getPopupContainer,E=e.placement,T=e.mouseEnterDelay,S=e.mouseLeaveDelay,N=g(e,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay"]),R=e.prefixCls,L=e.openClassName,A=e.getTooltipContainer,D=e.overlayClassName,I=e.color,W=e.overlayInnerStyle,z=e.children,$=_("tooltip",R),B=_(),F=O;!("open"in e)&&!("visible"in e)&&M()&&(F=!1);var Y=function(e,t){var r=e.type;if((!0===r.__ANT_BUTTON||"button"===e.type)&&e.props.disabled||!0===r.__ANT_SWITCH&&(e.props.disabled||e.props.loading)||!0===r.__ANT_RADIO&&e.props.disabled){var n=h(e.props.style,["position","left","right","top","bottom","float","display","zIndex"]),o=n.picked,a=n.omitted,u=(0,l.default)((0,l.default)({display:"inline-block"},o),{cursor:"not-allowed",width:e.props.block?"100%":void 0}),c=(0,l.default)((0,l.default)({},a),{pointerEvents:"none"}),f=(0,y.cloneElement)(e,{style:c,className:null});return s.createElement("span",{style:u,className:(0,i.default)(e.props.className,"".concat(t,"-disabled-compatible-wrapper"))},f)}return e}((0,y.isValidElement)(z)&&!(0,y.isFragment)(z)?z:s.createElement("span",null,z),$),H=Y.props,V=H.className&&"string"!=typeof H.className?H.className:(0,i.default)(H.className,(0,a.default)({},L||"".concat($,"-open"),!0)),K=(0,i.default)(D,(0,a.default)((0,a.default)({},"".concat($,"-rtl"),"rtl"===x),"".concat($,"-").concat(I),I&&b.test(I))),U=W,G={};return I&&!b.test(I)&&(U=(0,l.default)((0,l.default)({},W),{background:I}),G={"--antd-arrow-background-color":I}),s.createElement(c.default,(0,l.default)({},N,{placement:void 0===E?"top":E,mouseEnterDelay:void 0===T?.1:T,mouseLeaveDelay:void 0===S?.1:S,prefixCls:$,overlayClassName:K,getTooltipContainer:k||A||p,ref:t,builtinPlacements:j(),overlay:(r=e.title,n=e.overlay,0===r?r:n||r||""),visible:F,onVisibleChange:function(t){var r,n;w(!M()&&t),M()||(null===(r=e.onOpenChange)||void 0===r||r.call(e,t),null===(n=e.onVisibleChange)||void 0===n||n.call(e,t))},onPopupAlign:function(e,t){var r=j(),n=Object.keys(r).find(function(e){var n,o;return r[e].points[0]===(null===(n=t.points)||void 0===n?void 0:n[0])&&r[e].points[1]===(null===(o=t.points)||void 0===o?void 0:o[1])});if(n){var o=e.getBoundingClientRect(),a={top:"50%",left:"50%"};/top|Bottom/.test(n)?a.top="".concat(o.height-t.offset[1],"px"):/Top|bottom/.test(n)&&(a.top="".concat(-t.offset[1],"px")),/left|Right/.test(n)?a.left="".concat(o.width-t.offset[0],"px"):/right|Left/.test(n)&&(a.left="".concat(-t.offset[0],"px")),e.style.transformOrigin="".concat(a.left," ").concat(a.top)}},overlayInnerStyle:U,arrowContent:s.createElement("span",{className:"".concat($,"-arrow-content"),style:G}),motion:{motionName:(0,v.getTransitionName)(B,"zoom-big-fast",e.transitionName),motionDeadline:1e3}}),F?(0,y.cloneElement)(Y,{className:V}):Y)});t.default=_},68900:function(e,t,r){"use strict";var n=r(64836),o=r(18698);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(10434)),u=n(r(38416)),l=n(r(56690)),i=n(r(89728)),c=n(r(61655)),f=n(r(26389)),s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!=typeof e)return{default:e};var r=v(void 0);if(r&&r.has(e))return r.get(e);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var l=a?Object.getOwnPropertyDescriptor(e,u):null;l&&(l.get||l.set)?Object.defineProperty(n,u,l):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n}(r(67294)),d=n(r(73935)),p=n(r(93967));function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(v=function(e){return e?r:t})(e)}var m=function(e){(0,c.default)(r,e);var t=(0,f.default)(r);function r(){var e;(0,l.default)(this,r);for(var n=arguments.length,o=Array(n),a=0;a1&&void 0!==arguments[1]?arguments[1]:{},n=[];return o.default.Children.forEach(t,function(t){(null!=t||r.keepEmpty)&&(Array.isArray(t)?n=n.concat(e(t)):(0,a.isFragment)(t)&&t.props?n=n.concat(e(t.props.children,r)):n.push(t))}),n};var o=n(r(67294)),a=r(69424)},71996:function(e,t,r){"use strict";var n=r(75263).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=o.useRef();return t.current=e,o.useCallback(function(){for(var e,r=arguments.length,n=Array(r),o=0;o3&&void 0!==arguments[3]&&arguments[3];return t.length&&n&&void 0===r&&!(0,i.default)(e,t.slice(0,-1))?e:function e(t,r,n,o){if(!r.length)return n;var i,c=(0,l.default)(r),f=c[0],s=c.slice(1);return i=t||"number"!=typeof f?Array.isArray(t)?(0,u.default)(t):(0,a.default)({},t):[],o&&void 0===n&&1===s.length?delete i[f][s[0]]:i[f]=e(i[f],s,n,o),i}(e,t,r,n)}function f(e){return Array.isArray(e)?[]:{}}var s="undefined"==typeof Reflect?Object.keys:Reflect.ownKeys},11163:function(e,t,r){e.exports=r(9090)},63405:function(e,t,r){var n=r(73897);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports},66115:function(e){e.exports=function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},56690:function(e){e.exports=function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},89728:function(e,t,r){var n=r(64062);function o(e,t){for(var r=0;r=0;--o){var a=this.tryEntries[o],l=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var i=u.call(a,"catchLoc"),c=u.call(a,"finallyLoc");if(i&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&u.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:S(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),h}},r}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},6015:function(e){function t(r,n){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},51589:function(e,t,r){var n=r(85372),o=r(13049),a=r(5304),u=r(12218);e.exports=function(e){return n(e)||o(e)||a(e)||u()},e.exports.__esModule=!0,e.exports.default=e.exports},861:function(e,t,r){var n=r(63405),o=r(13049),a=r(5304),u=r(42281);e.exports=function(e){return n(e)||o(e)||a(e)||u()},e.exports.__esModule=!0,e.exports.default=e.exports},35928:function(e,t,r){"use strict";function n(e){return t=>{let r=(e?Math[e]:Math.trunc)(t);return 0===r?0:r}}r.d(t,{u:function(){return n}})},51678:function(e,t,r){"use strict";r.d(t,{_:function(){return o}});var n=r(47296);function o(e,t){return+(0,n.Q)(e)-+(0,n.Q)(t)}},44284:function(e,t,r){"use strict";r.d(t,{c:function(){return a}});var n=r(35928),o=r(51678);function a(e,t,r){let a=(0,o._)(e,t)/1e3;return(0,n.u)(null==r?void 0:r.roundingMethod)(a)}},47296:function(e,t,r){"use strict";function n(e){let t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):new Date("number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?e:NaN)}r.d(t,{Q:function(){return n}})}}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/d6e1aeb5-286b2049d5ea26a0.js b/static/web/_next/static/chunks/d6e1aeb5-286b2049d5ea26a0.js new file mode 100644 index 000000000..903a58c34 --- /dev/null +++ b/static/web/_next/static/chunks/d6e1aeb5-286b2049d5ea26a0.js @@ -0,0 +1,27 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2544],{85215:function(e,t,i){let s,r,n,a,o,l;i.d(t,{Z:function(){return rm}});var h=i(58908),d=i.n(h),u=i(89144),c=i.n(u),p=i(27537),m=i.n(p),g=i(75974),f=i.n(g),_=i(9603),y=i.n(_),v=i(13407),T=i.n(v),b=i(87462),S=i(80779),k=i(42570),C=i(92260),E=i(8485),w=i(60562),x=i(77056),I=i(84221),P=i.n(I),L=i(68925),A=i(86185),D=i(51489),O="8.10.0";let M={},R=function(e,t){return M[e]=M[e]||[],t&&(M[e]=M[e].concat(t)),M[e]},U=function(e,t){let i=R(e).indexOf(t);return!(i<=-1)&&(M[e]=M[e].slice(),M[e].splice(i,1),!0)},B={prefixed:!0},N=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],j=N[0];for(let e=0;e(s,r,n)=>{let a=t.levels[r],o=RegExp(`^(${a})$`),l=e;if("log"!==s&&n.unshift(s.toUpperCase()+":"),i&&(l=`%c${e}`,n.unshift(i)),n.unshift(l+":"),F){F.push([].concat(n));let e=F.length-1e3;F.splice(0,e>0?e:0)}if(!d().console)return;let h=d().console[s];h||"debug"!==s||(h=d().console.info||d().console.log),h&&a&&o.test(s)&&h[Array.isArray(n)?"apply":"call"](d().console,n)},q=function e(t,i=":",s=""){let r,n="info",a=function(...e){r("log",n,e)};return r=$(t,a,s),a.createLogger=(r,n,a)=>{let o=void 0!==n?n:i;return e(`${t} ${o} ${r}`,o,void 0!==a?a:s)},a.createNewLogger=(t,i,s)=>e(t,i,s),a.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},a.level=e=>{if("string"==typeof e){if(!a.levels.hasOwnProperty(e))throw Error(`"${e}" in not a valid log level`);n=e}return n},a.history=()=>F?[].concat(F):[],a.history.filter=e=>(F||[]).filter(t=>RegExp(`.*${e}.*`).test(t[0])),a.history.clear=()=>{F&&(F.length=0)},a.history.disable=()=>{null!==F&&(F.length=0,F=null)},a.history.enable=()=>{null===F&&(F=[])},a.error=(...e)=>r("error",n,e),a.warn=(...e)=>r("warn",n,e),a.debug=(...e)=>r("debug",n,e),a}("VIDEOJS"),H=q.createLogger,V=Object.prototype.toString,z=function(e){return K(e)?Object.keys(e):[]};function W(e,t){z(e).forEach(i=>t(e[i],i))}function G(e,t,i=0){return z(e).reduce((i,s)=>t(i,e[s],s),i)}function K(e){return!!e&&"object"==typeof e}function Q(e){return K(e)&&"[object Object]"===V.call(e)&&e.constructor===Object}function Y(...e){let t={};return e.forEach(e=>{e&&W(e,(e,i)=>{if(!Q(e)){t[i]=e;return}Q(t[i])||(t[i]={}),t[i]=Y(t[i],e)})}),t}function X(e={}){let t=[];for(let i in e)if(e.hasOwnProperty(i)){let s=e[i];t.push(s)}return t}function J(e,t,i,s=!0){let r=i=>Object.defineProperty(e,t,{value:i,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){let e=i();return r(e),e}};return s&&(n.set=r),Object.defineProperty(e,t,n)}var Z=Object.freeze({__proto__:null,each:W,reduce:G,isObject:K,isPlain:Q,merge:Y,values:X,defineLazyProperty:J});let ee=!1,et=null,ei=!1,es=!1,er=!1,en=!1,ea=!1,eo=null,el=null,eh=null,ed=!1,eu=!1,ec=!1,ep=!1,em=!!(eT()&&("ontouchstart"in d()||d().navigator.maxTouchPoints||d().DocumentTouch&&d().document instanceof d().DocumentTouch)),eg=d().navigator&&d().navigator.userAgentData;if(eg&&eg.platform&&eg.brands&&(ei="Android"===eg.platform,er=!!eg.brands.find(e=>"Microsoft Edge"===e.brand),en=!!eg.brands.find(e=>"Chromium"===e.brand),ea=!er&&en,eo=el=(eg.brands.find(e=>"Chromium"===e.brand)||{}).version||null,eu="Windows"===eg.platform),!en){let e=d().navigator&&d().navigator.userAgent||"";ee=/iPod/i.test(e),et=function(){let t=e.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),ei=/Android/i.test(e),r=function(){let t=e.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;let i=t[1]&&parseFloat(t[1]),s=t[2]&&parseFloat(t[2]);return i&&s?parseFloat(t[1]+"."+t[2]):i||null}(),es=/Firefox/i.test(e),er=/Edg/i.test(e),en=/Chrome/i.test(e)||/CriOS/i.test(e),ea=!er&&en,eo=el=function(){let t=e.match(/(Chrome|CriOS)\/(\d+)/);return t&&t[2]?parseFloat(t[2]):null}(),eh=function(){let t=/MSIE\s(\d+)\.\d/.exec(e),i=t&&parseFloat(t[1]);return!i&&/Trident\/7.0/i.test(e)&&/rv:11.0/.test(e)&&(i=11),i}(),ed=/Safari/i.test(e)&&!ea&&!ei&&!er,eu=/Windows/i.test(e),ec=/iPad/i.test(e)||ed&&em&&!/iPhone/i.test(e),ep=/iPhone/i.test(e)&&!ec}let ef=ep||ec||ee,e_=(ed||ef)&&!ea;var ey=Object.freeze({__proto__:null,get IS_IPOD(){return ee},get IOS_VERSION(){return et},get IS_ANDROID(){return ei},get ANDROID_VERSION(){return r},get IS_FIREFOX(){return es},get IS_EDGE(){return er},get IS_CHROMIUM(){return en},get IS_CHROME(){return ea},get CHROMIUM_VERSION(){return eo},get CHROME_VERSION(){return el},get IE_VERSION(){return eh},get IS_SAFARI(){return ed},get IS_WINDOWS(){return eu},get IS_IPAD(){return ec},get IS_IPHONE(){return ep},TOUCH_ENABLED:em,IS_IOS:ef,IS_ANY_SAFARI:e_});function ev(e){return"string"==typeof e&&!!e.trim()}function eT(){return c()===d().document}function eb(e){return K(e)&&1===e.nodeType}function eS(){try{return d().parent!==d().self}catch(e){return!0}}function ek(e){return function(t,i){if(!ev(t))return c()[e](null);ev(i)&&(i=c().querySelector(i));let s=eb(i)?i:c();return s[e]&&s[e](t)}}function eC(e="div",t={},i={},s){let r=c().createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){let i=t[e];"textContent"===e?eE(r,i):(r[e]!==i||"tabIndex"===e)&&(r[e]=i)}),Object.getOwnPropertyNames(i).forEach(function(e){r.setAttribute(e,i[e])}),s&&eV(r,s),r}function eE(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function ew(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function ex(e,t){return!function(e){if(e.indexOf(" ")>=0)throw Error("class has illegal whitespace characters")}(t),e.classList.contains(t)}function eI(e,...t){return e.classList.add(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e}function eP(e,...t){return e?(e.classList.remove(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e):(q.warn("removeClass was called with an element that doesn't exist"),null)}function eL(e,t,i){return"function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=void 0),t.split(/\s+/).forEach(t=>e.classList.toggle(t,i)),e}function eA(e,t){Object.getOwnPropertyNames(t).forEach(function(i){let s=t[i];null==s||!1===s?e.removeAttribute(i):e.setAttribute(i,!0===s?"":s)})}function eD(e){let t={},i=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(e&&e.attributes&&e.attributes.length>0){let s=e.attributes;for(let e=s.length-1;e>=0;e--){let r=s[e].name,n=s[e].value;i.includes(r)&&(n=null!==n),t[r]=n}}return t}function eO(e,t){return e.getAttribute(t)}function eM(e,t,i){e.setAttribute(t,i)}function eR(e,t){e.removeAttribute(t)}function eU(){c().body.focus(),c().onselectstart=function(){return!1}}function eB(){c().onselectstart=function(){return!0}}function eN(e){if(e&&e.getBoundingClientRect&&e.parentNode){let t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach(e=>{void 0!==t[e]&&(i[e]=t[e])}),i.height||(i.height=parseFloat(eQ(e,"height"))),i.width||(i.width=parseFloat(eQ(e,"width"))),i}}function ej(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};let t=e.offsetWidth,i=e.offsetHeight,s=0,r=0;for(;e.offsetParent&&e!==c()[B.fullscreenElement];)s+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;return{left:s,top:r,width:t,height:i}}function eF(e,t){let i={x:0,y:0};if(ef){let t=e;for(;t&&"html"!==t.nodeName.toLowerCase();){let e=eQ(t,"transform");if(/^matrix/.test(e)){let t=e.slice(7,-1).split(/,\s/).map(Number);i.x+=t[4],i.y+=t[5]}else if(/^matrix3d/.test(e)){let t=e.slice(9,-1).split(/,\s/).map(Number);i.x+=t[12],i.y+=t[13]}t=t.parentNode}}let s={},r=ej(t.target),n=ej(e),a=n.width,o=n.height,l=t.offsetY-(n.top-r.top),h=t.offsetX-(n.left-r.left);return t.changedTouches&&(h=t.changedTouches[0].pageX-n.left,l=t.changedTouches[0].pageY+n.top,ef&&(h-=i.x,l-=i.y)),s.y=1-Math.max(0,Math.min(1,l/o)),s.x=Math.max(0,Math.min(1,h/a)),s}function e$(e){return K(e)&&3===e.nodeType}function eq(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function eH(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(e=>("function"==typeof e&&(e=e()),eb(e)||e$(e))?e:"string"==typeof e&&/\S/.test(e)?c().createTextNode(e):void 0).filter(e=>e)}function eV(e,t){return eH(t).forEach(t=>e.appendChild(t)),e}function ez(e,t){return eV(eq(e),t)}function eW(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||"mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons}let eG=ek("querySelector"),eK=ek("querySelectorAll");function eQ(e,t){if(!e||!t)return"";if("function"==typeof d().getComputedStyle){let i;try{i=d().getComputedStyle(e)}catch(e){return""}return i?i.getPropertyValue(t)||i[t]:""}return""}function eY(e){[...c().styleSheets].forEach(t=>{try{let i=[...t.cssRules].map(e=>e.cssText).join(""),s=c().createElement("style");s.textContent=i,e.document.head.appendChild(s)}catch(s){let i=c().createElement("link");i.rel="stylesheet",i.type=t.type,i.media=t.media.mediaText,i.href=t.href,e.document.head.appendChild(i)}})}var eX=Object.freeze({__proto__:null,isReal:eT,isEl:eb,isInFrame:eS,createEl:eC,textContent:eE,prependTo:ew,hasClass:ex,addClass:eI,removeClass:eP,toggleClass:eL,setAttributes:eA,getAttributes:eD,getAttribute:eO,setAttribute:eM,removeAttribute:eR,blockTextSelection:eU,unblockTextSelection:eB,getBoundingClientRect:eN,findPosition:ej,getPointerPosition:eF,isTextNode:e$,emptyEl:eq,normalizeContent:eH,appendContent:eV,insertContent:ez,isSingleLeftClick:eW,$:eG,$$:eK,computedStyle:eQ,copyStyleSheetsToWindow:eY});let eJ=!1,eZ=function(){if(!1===n.options.autoSetup)return;let e=Array.prototype.slice.call(c().getElementsByTagName("video")),t=Array.prototype.slice.call(c().getElementsByTagName("audio")),i=Array.prototype.slice.call(c().getElementsByTagName("video-js")),s=e.concat(t,i);if(s&&s.length>0)for(let e=0,t=s.length;e-1&&(i={passive:!0}),e.addEventListener(t,s.dispatcher,i)}else e.attachEvent&&e.attachEvent("on"+t,s.dispatcher)}}function ti(e,t,i){if(!e8.has(e))return;let s=e8.get(e);if(!s.handlers)return;if(Array.isArray(t))return e6(ti,e,t,i);let r=function(e,t){s.handlers[t]=[],e3(e,t)};if(void 0===t){for(let t in s.handlers)Object.prototype.hasOwnProperty.call(s.handlers||{},t)&&r(e,t);return}let n=s.handlers[t];if(n){if(!i){r(e,t);return}if(i.guid)for(let e=0;e=t&&(e(...s),i=r)}},th=function(e,t,i,s=d()){let r;let n=function(){let n=this,a=arguments,o=function(){r=null,o=null,i||e.apply(n,a)};!r&&i&&e.apply(n,a),s.clearTimeout(r),r=s.setTimeout(o,t)};return n.cancel=()=>{s.clearTimeout(r),r=null},n};var td=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:30,bind_:to,throttle:tl,debounce:th});class tu{on(e,t){let i=this.addEventListener;this.addEventListener=()=>{},tt(this,e,t),this.addEventListener=i}off(e,t){ti(this,e,t)}one(e,t){let i=this.addEventListener;this.addEventListener=()=>{},tr(this,e,t),this.addEventListener=i}any(e,t){let i=this.addEventListener;this.addEventListener=()=>{},tn(this,e,t),this.addEventListener=i}trigger(e){let t=e.type||e;"string"==typeof e&&(e={type:t}),e=e7(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),ts(this,e)}queueTrigger(e){o||(o=new Map);let t=e.type||e,i=o.get(this);i||(i=new Map,o.set(this,i));let s=i.get(t);i.delete(t),d().clearTimeout(s);let r=d().setTimeout(()=>{i.delete(t),0===i.size&&(i=null,o.delete(this)),this.trigger(e)},0);i.set(t,r)}}tu.prototype.allowedEvents_={},tu.prototype.addEventListener=tu.prototype.on,tu.prototype.removeEventListener=tu.prototype.off,tu.prototype.dispatchEvent=tu.prototype.trigger;let tc=e=>"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e,tp=e=>e instanceof tu||!!e.eventBusEl_&&["on","one","off","trigger"].every(t=>"function"==typeof e[t]),tm=(e,t)=>{tp(e)?t():(e.eventedCallbacks||(e.eventedCallbacks=[]),e.eventedCallbacks.push(t))},tg=e=>"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length,tf=(e,t,i)=>{if(!e||!e.nodeName&&!tp(e))throw Error(`Invalid target for ${tc(t)}#${i}; must be a DOM node or evented object.`)},t_=(e,t,i)=>{if(!tg(e))throw Error(`Invalid event type for ${tc(t)}#${i}; must be a non-empty string or array.`)},ty=(e,t,i)=>{if("function"!=typeof e)throw Error(`Invalid listener for ${tc(t)}#${i}; must be a function.`)},tv=(e,t,i)=>{let s,r,n;let a=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return a?(s=e.eventBusEl_,t.length>=3&&t.shift(),[r,n]=t):[s,r,n]=t,tf(s,e,i),t_(r,e,i),ty(n,e,i),{isTargetingSelf:a,target:s,type:r,listener:n=to(e,n)}},tT=(e,t,i,s)=>{tf(e,e,t),e.nodeName?ta[t](e,i,s):e[t](i,s)},tb={on(...e){let{isTargetingSelf:t,target:i,type:s,listener:r}=tv(this,e,"on");if(tT(i,"on",s,r),!t){let e=()=>this.off(i,s,r);e.guid=r.guid;let t=()=>this.off("dispose",e);t.guid=r.guid,tT(this,"on","dispose",e),tT(i,"on","dispose",t)}},one(...e){let{isTargetingSelf:t,target:i,type:s,listener:r}=tv(this,e,"one");if(t)tT(i,"one",s,r);else{let e=(...t)=>{this.off(i,s,e),r.apply(null,t)};e.guid=r.guid,tT(i,"one",s,e)}},any(...e){let{isTargetingSelf:t,target:i,type:s,listener:r}=tv(this,e,"any");if(t)tT(i,"any",s,r);else{let e=(...t)=>{this.off(i,s,e),r.apply(null,t)};e.guid=r.guid,tT(i,"any",s,e)}},off(e,t,i){!e||tg(e)?ti(this.eventBusEl_,e,t):(tf(e,this,"off"),t_(t,this,"off"),ty(i,this,"off"),i=to(this,i),this.off("dispose",i),e.nodeName?(ti(e,t,i),ti(e,"dispose",i)):tp(e)&&(e.off(t,i),e.off("dispose",i)))},trigger(e,t){if(tf(this.eventBusEl_,this,"trigger"),!tg(e&&"string"!=typeof e?e.type:e))throw Error(`Invalid event type for ${tc(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return ts(this.eventBusEl_,e,t)}};function tS(e,t={}){let{eventBusKey:i}=t;if(i){if(!e[i].nodeName)throw Error(`The eventBusKey "${i}" does not refer to an element.`);e.eventBusEl_=e[i]}else e.eventBusEl_=eC("span",{className:"vjs-event-bus"});return Object.assign(e,tb),e.eventedCallbacks&&e.eventedCallbacks.forEach(e=>{e()}),e.on("dispose",()=>{e.off(),[e,e.el_,e.eventBusEl_].forEach(function(e){e&&e8.has(e)&&e8.delete(e)}),d().setTimeout(()=>{e.eventBusEl_=null},0)}),e}let tk={state:{},setState(e){let t;return"function"==typeof e&&(e=e()),W(e,(e,i)=>{this.state[i]!==e&&((t=t||{})[i]={from:this.state[i],to:e}),this.state[i]=e}),t&&tp(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function tC(e,t){return Object.assign(e,tk),e.state=Object.assign({},e.state,t),"function"==typeof e.handleStateChanged&&tp(e)&&e.on("statechanged",e.handleStateChanged),e}let tE=function(e){return"string"!=typeof e?e:e.replace(/./,e=>e.toLowerCase())},tw=function(e){return"string"!=typeof e?e:e.replace(/./,e=>e.toUpperCase())},tx=function(e,t){return tw(e)===tw(t)};var tI=Object.freeze({__proto__:null,toLowerCase:tE,toTitleCase:tw,titleCaseEquals:tx});class tP{constructor(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Y({},this.options_),t=this.options_=Y(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){let t=e&&e.id&&e.id()||"no_player";this.id_=`${t}_component_${e5++}`}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(e=>this.addClass(e)),["on","off","one","any","trigger"].forEach(e=>{this[e]=void 0}),!1!==t.evented&&(tS(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),tC(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,!1!==t.initChildren&&this.initChildren(),this.ready(i),!1!==t.reportTouchActivity&&this.enableTouchActivity()}on(e,t){}off(e,t){}one(e,t){}any(e,t){}trigger(e,t){}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e&&(this.options_=Y(this.options_,e)),this.options_}el(){return this.el_}createEl(e,t,i){return eC(e,t,i)}localize(e,t,i=e){let s=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),n=r&&r[s],a=s&&s.split("-")[0],o=r&&r[a],l=i;return n&&n[e]?l=n[e]:o&&o[e]&&(l=o[e]),t&&(l=l.replace(/\{(\d+)\}/g,function(e,i){let s=t[i-1],r=s;return void 0===s&&(r=e),r})),l}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((e,t)=>e.concat(t),[]);let t=this;for(let i=0;i=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[tw(e.name())]=null,this.childNameIndex_[tE(e.name())]=null;let i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){let e=this.options_.children;if(e){let t;let i=this.options_,s=tP.getComponent("Tech");(t=Array.isArray(e)?e:Object.keys(e)).concat(Object.keys(this.options_).filter(function(e){return!t.some(function(t){return"string"==typeof t?e===t:e===t.name})})).map(t=>{let i,s;return"string"==typeof t?s=e[i=t]||this.options_[i]||{}:(i=t.name,s=t),{name:i,opts:s}}).filter(e=>{let t=tP.getComponent(e.opts.componentClass||tw(e.name));return t&&!s.isTech(t)}).forEach(e=>{let t=e.name,s=e.opts;if(void 0!==i[t]&&(s=i[t]),!1===s)return;!0===s&&(s={}),s.playerOptions=this.options_.playerOptions;let r=this.addChild(t,s);r&&(this[t]=r)})}}buildCSSClass(){return""}ready(e,t=!1){if(e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}t?e.call(this):this.setTimeout(e,1)}}triggerReady(){this.isReady_=!0,this.setTimeout(function(){let e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)}$(e,t){return eG(e,t||this.contentEl())}$$(e,t){return eK(e,t||this.contentEl())}hasClass(e){return ex(this.el_,e)}addClass(...e){eI(this.el_,...e)}removeClass(...e){eP(this.el_,...e)}toggleClass(e,t){eL(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return eO(this.el_,e)}setAttribute(e,t){eM(this.el_,e,t)}removeAttribute(e){eR(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,i){if(void 0!==t){(null===t||t!=t)&&(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:"auto"===t?this.el_.style[e]="":this.el_.style[e]=t+"px",i||this.trigger("componentresize");return}if(!this.el_)return 0;let s=this.el_.style[e],r=s.indexOf("px");return -1!==r?parseInt(s.slice(0,r),10):parseInt(this.el_["offset"+tw(e)],10)}currentDimension(e){let t=0;if("width"!==e&&"height"!==e)throw Error("currentDimension only accepts width or height value");if(0===(t=parseFloat(t=eQ(this.el_,e)))||isNaN(t)){let i=`offset${tw(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(m().isEventKey(e,"Tab")||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e,t=0,i=null;this.on("touchstart",function(s){1===s.touches.length&&(i={pageX:s.touches[0].pageX,pageY:s.touches[0].pageY},t=d().performance.now(),e=!0)}),this.on("touchmove",function(t){if(t.touches.length>1)e=!1;else if(i){let s=t.touches[0].pageX-i.pageX,r=t.touches[0].pageY-i.pageY;Math.sqrt(s*s+r*r)>10&&(e=!1)}});let s=function(){e=!1};this.on("touchleave",s),this.on("touchcancel",s),this.on("touchend",function(s){i=null,!0===e&&d().performance.now()-t<200&&(s.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){let e;if(!this.player()||!this.player().reportUserActivity)return;let t=to(this.player(),this.player().reportUserActivity);this.on("touchstart",function(){t(),this.clearInterval(e),e=this.setInterval(t,250)});let i=function(i){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",i),this.on("touchcancel",i)}setTimeout(e,t){var i;return e=to(this,e),this.clearTimersOnDispose_(),i=d().setTimeout(()=>{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),e()},t),this.setTimeoutIds_.add(i),i}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),d().clearTimeout(e)),e}setInterval(e,t){e=to(this,e),this.clearTimersOnDispose_();let i=d().setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),d().clearInterval(e)),e}requestAnimationFrame(e){var t;return this.clearTimersOnDispose_(),e=to(this,e),t=d().requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){if(this.namedRafs_.has(e))return;this.clearTimersOnDispose_(),t=to(this,t);let i=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,i),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),d().cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((e,i)=>this[t](i))}),this.clearingTimersOnDispose_=!1}))}static registerComponent(e,t){if("string"!=typeof e||!e)throw Error(`Illegal component name, "${e}"; must be a non-empty string.`);let i=tP.getComponent("Tech"),s=i&&i.isTech(t),r=tP===t||tP.prototype.isPrototypeOf(t.prototype);if(s||!r){let t;throw t=s?"techs must be registered using Tech.registerTech()":"must be a Component subclass",Error(`Illegal component, "${e}"; ${t}.`)}e=tw(e),tP.components_||(tP.components_={});let n=tP.getComponent("Player");if("Player"===e&&n&&n.players){let e=n.players,t=Object.keys(e);if(e&&t.length>0&&t.map(t=>e[t]).every(Boolean))throw Error("Can not register Player component after player has been created.")}return tP.components_[e]=t,tP.components_[tE(e)]=t,t}static getComponent(e){if(e&&tP.components_)return tP.components_[e]}}function tL(e,t,i,s){return!function(e,t,i){if("number"!=typeof t||t<0||t>i)throw Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${t}) is non-numeric or out of bounds (0-${i}).`)}(e,s,i.length-1),i[s][t]}function tA(e){let t;return t=void 0===e||0===e.length?{length:0,start(){throw Error("This TimeRanges object is empty")},end(){throw Error("This TimeRanges object is empty")}}:{length:e.length,start:tL.bind(null,"start",0,e),end:tL.bind(null,"end",1,e)},d().Symbol&&d().Symbol.iterator&&(t[d().Symbol.iterator]=()=>(e||[]).values()),t}function tD(e,t){return Array.isArray(e)?tA(e):void 0===e||void 0===t?tA():tA([[e,t]])}tP.registerComponent("Component",tP);let tO=function(e,t){let i=Math.floor((e=e<0?0:e)%60),s=Math.floor(e/60%60),r=Math.floor(e/3600);return(isNaN(e)||e===1/0)&&(r=s=i="-"),s=(((r=r>0||Math.floor(t/3600)>0?r+":":"")||Math.floor(t/60%60)>=10)&&s<10?"0"+s:s)+":",r+s+(i=i<10?"0"+i:i)},tM=tO;function tR(e){tM=e}function tU(){tM=tO}function tB(e,t=e){return tM(e,t)}var tN=Object.freeze({__proto__:null,createTimeRanges:tD,createTimeRange:tD,setFormatTime:tR,resetFormatTime:tU,formatTime:tB});function tj(e,t){let i,s,r=0;if(!t)return 0;e&&e.length||(e=tD(0,0));for(let n=0;nt&&(s=t),r+=s-i;return r/t}function tF(e){if(e instanceof tF)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:K(e)&&("number"==typeof e.code&&(this.code=e.code),Object.assign(this,e)),this.message||(this.message=tF.defaultMessages[this.code]||"")}tF.prototype.code=0,tF.prototype.message="",tF.prototype.status=null,tF.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],tF.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(let e=0;e{})}let tH=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,i,s)=>(e[i]&&(t[i]=e[i]),t),{cues:e.cues&&Array.prototype.map.call(e.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})})};var tV=function(e){let t=e.$$("track"),i=Array.prototype.map.call(t,e=>e.track);return Array.prototype.map.call(t,function(e){let t=tH(e.track);return e.src&&(t.src=e.src),t}).concat(Array.prototype.filter.call(e.textTracks(),function(e){return -1===i.indexOf(e)}).map(tH))};let tz="vjs-modal-dialog";class tW extends tP{constructor(e,t){super(e,t),this.handleKeyDown_=e=>this.handleKeyDown(e),this.close_=e=>this.close(e),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=eC("div",{className:`${tz}-content`},{role:"document"}),this.descEl_=eC("p",{className:`${tz}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),eE(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${tz} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(!this.opened_){let e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,!this.options_.fillAlways&&(this.hasBeenOpened_||this.hasBeenFilled_)||this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}}opened(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;let e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if("boolean"==typeof e){let t=this.closeable_=!!e,i=this.getChild("closeButton");if(t&&!i){let e=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=e,this.on(i,"close",this.close_)}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){let t=this.contentEl(),i=t.parentNode,s=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),ez(t,e),this.trigger("modalfill"),s?i.insertBefore(t,s):i.appendChild(t);let r=this.getChild("closeButton");r&&i.appendChild(r.el_)}empty(){this.trigger("beforemodalempty"),eq(this.contentEl()),this.trigger("modalempty")}content(e){return void 0!==e&&(this.content_=e),this.content_}conditionalFocus_(){let e=c().activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){let t;if(e.stopPropagation(),m().isEventKey(e,"Escape")&&this.closeable()){e.preventDefault(),this.close();return}if(!m().isEventKey(e,"Tab"))return;let i=this.focusableEls_(),s=this.el_.querySelector(":focus");for(let e=0;e(e instanceof d().HTMLAnchorElement||e instanceof d().HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof d().HTMLInputElement||e instanceof d().HTMLSelectElement||e instanceof d().HTMLTextAreaElement||e instanceof d().HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof d().HTMLIFrameElement||e instanceof d().HTMLObjectElement||e instanceof d().HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable"))}}tW.prototype.options_={pauseOnOpen:!0,temporary:!0},tP.registerComponent("ModalDialog",tW);class tG extends tu{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t{this.trigger({track:e,type:"labelchange",target:this})},tp(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,s=this.length;i=0;t--)if(e[t].enabled){tK(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&tK(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,tK(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}let tY=function(e,t){for(let i=0;i=0;t--)if(e[t].selected){tY(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let e=0;e{this.changing_||(this.changing_=!0,tY(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class tJ extends tG{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class tZ{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,i=e.length;tt[e],set(){}});Object.defineProperty(this,"label",{get:()=>i,set(e){e!==i&&(i=e,this.trigger("labelchange"))}})}}let t3=function(e){let t=["protocol","hostname","port","pathname","search","hash","host"],i=c().createElement("a");i.href=e;let s={};for(let e=0;e0&&(d().console&&d().console.groupCollapsed&&d().console.groupCollapsed(`Text Track parsing errors for ${t.src}`),s.forEach(e=>q.error(e)),d().console&&d().console.groupEnd&&d().console.groupEnd()),i.flush()},ii=function(e,t){let i={uri:e},s=t9(e);s&&(i.cors=s);let r="use-credentials"===t.tech_.crossOrigin();r&&(i.withCredentials=r),y()(i,to(this,function(e,i,s){if(e)return q.error(e,i);t.loaded_=!0,"function"!=typeof d().WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],e=>{if("vttjserror"===e.type){q.error(`vttjs failed to load, stopping trying to process ${t.src}`);return}return it(s,t)}):it(s,t)}))};class is extends t5{constructor(e={}){if(!e.tech)throw Error("A tech was not provided.");let t=Y(e,{kind:t4[e.kind]||"subtitles",language:e.language||e.srclang||""}),i=t8[t.mode]||"disabled",s=t.default;("metadata"===t.kind||"chapters"===t.kind)&&(i="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=!1!==this.tech_.preloadTextTracks;let r=new t0(this.cues_),n=new t0(this.activeCues_),a=!1;this.timeupdateHandler=to(this,function(e={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,a&&(this.trigger("cuechange"),a=!1),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}}),this.tech_.one("dispose",()=>{this.stopTracking()}),"disabled"!==i&&this.startTracking(),Object.defineProperties(this,{default:{get:()=>s,set(){}},mode:{get:()=>i,set(e){t8[e]&&i!==e&&(i=e,this.preload_||"disabled"===i||0!==this.cues.length||ii(this.src,this),this.stopTracking(),"disabled"!==i&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?r:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(0===this.cues.length)return n;let e=this.tech_.currentTime(),t=[];for(let i=0,s=this.cues.length;i=e&&t.push(s)}if(a=!1,t.length!==this.activeCues_.length)a=!0;else for(let e=0;ei,set(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class ia extends t5{constructor(e={}){let t=Y(e,{kind:t1[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"selected",{get:()=>i,set(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class io extends tu{constructor(e={}){let t;super();let i=new is(e);this.kind=i.kind,this.src=i.src,this.srclang=i.language,this.label=i.label,this.default=i.default,Object.defineProperties(this,{readyState:{get:()=>t},track:{get:()=>i}}),t=io.NONE,i.addEventListener("loadeddata",()=>{t=io.LOADED,this.trigger({type:"load",target:this})})}}io.prototype.allowedEvents_={load:"load"},io.NONE=0,io.LOADING=1,io.LOADED=2,io.ERROR=3;let il={audio:{ListClass:tQ,TrackClass:ir,capitalName:"Audio"},video:{ListClass:tX,TrackClass:ia,capitalName:"Video"},text:{ListClass:tJ,TrackClass:is,capitalName:"Text"}};Object.keys(il).forEach(function(e){il[e].getterName=`${e}Tracks`,il[e].privateName=`${e}Tracks_`});let ih={remoteText:{ListClass:tJ,TrackClass:is,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:tZ,TrackClass:io,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},id=Object.assign({},il,ih);ih.names=Object.keys(ih),il.names=Object.keys(il),id.names=[].concat(ih.names).concat(il.names);class iu extends tP{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=e=>this.onDurationChange(e),this.trackProgress_=e=>this.trackProgress(e),this.trackCurrentTime_=e=>this.trackCurrentTime(e),this.stopTrackingCurrentTime_=e=>this.stopTrackingCurrentTime(e),this.disposeSourceHandler_=e=>this.disposeSourceHandler(e),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),id.names.forEach(t=>{let i=id[t];e&&e[i.getterName]&&(this[i.privateName]=e[i.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(t=>{!1===e[`native${t}Tracks`]&&(this[`featuresNative${t}Tracks`]=!1)}),!1===e.nativeCaptions||!1===e.nativeTextTracks?this.featuresNativeTextTracks=!1:(!0===e.nativeCaptions||!0===e.nativeTextTracks)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=!1!==e.preloadTextTracks,this.autoRemoteTextTracks_=new id.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(to(this,function(){let e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return tD(0,0)}bufferedPercent(){return tj(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(il.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){(e=[].concat(e)).forEach(e=>{let t=this[`${e}Tracks`]()||[],i=t.length;for(;i--;){let s=t[i];"text"===e&&this.removeRemoteTextTrack(s),t.removeTrack(s)}})}cleanupAutoTextTracks(){let e=this.autoRemoteTextTracks_||[],t=e.length;for(;t--;){let i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return void 0!==e&&(this.error_=new tF(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?tD(0,0):tD()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){il.names.forEach(e=>{let t=il[e],i=()=>{this.trigger(`${e}trackchange`)},s=this[t.getterName]();s.addEventListener("removetrack",i),s.addEventListener("addtrack",i),this.on("dispose",()=>{s.removeEventListener("removetrack",i),s.removeEventListener("addtrack",i)})})}addWebVttScript_(){if(!d().WebVTT){if(c().body.contains(this.el())){if(!this.options_["vtt.js"]&&Q(T())&&Object.keys(T()).length>0){this.trigger("vttjsloaded");return}let e=c().createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),d().WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}}emulateTextTracks(){let e=this.textTracks(),t=this.remoteTextTracks(),i=t=>e.addTrack(t.track),s=t=>e.removeTrack(t.track);t.on("addtrack",i),t.on("removetrack",s),this.addWebVttScript_();let r=()=>this.trigger("texttrackchange"),n=()=>{r();for(let t=0;tthis.autoRemoteTextTracks_.addTrack(i.track)),i}removeRemoteTextTrack(e){let t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){let t=e5++;return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return iu.canPlayType(e.type)}static isTech(e){return e.prototype instanceof iu||e instanceof iu||e===iu}static registerTech(e,t){if(iu.techs_||(iu.techs_={}),!iu.isTech(t))throw Error(`Tech ${e} must be a Tech`);if(!iu.canPlayType)throw Error("Techs must have a static canPlayType method on them");if(!iu.canPlaySource)throw Error("Techs must have a static canPlaySource method on them");return e=tw(e),iu.techs_[e]=t,iu.techs_[tE(e)]=t,"Tech"!==e&&iu.defaultTechOrder_.push(e),t}static getTech(e){return e?iu.techs_&&iu.techs_[e]?iu.techs_[e]:(e=tw(e),d()&&d().videojs&&d().videojs[e])?(q.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),d().videojs[e]):void 0:void 0}}id.names.forEach(function(e){let t=id[e];iu.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}}),iu.prototype.featuresVolumeControl=!0,iu.prototype.featuresMuteControl=!0,iu.prototype.featuresFullscreenResize=!1,iu.prototype.featuresPlaybackRate=!1,iu.prototype.featuresProgressEvents=!1,iu.prototype.featuresSourceset=!1,iu.prototype.featuresTimeupdateEvents=!1,iu.prototype.featuresNativeTextTracks=!1,iu.prototype.featuresVideoFrameCallback=!1,iu.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){let s=e.sourceHandlers;s||(s=e.sourceHandlers=[]),void 0===i&&(i=s.length),s.splice(i,0,t)},e.canPlayType=function(t){let i;let s=e.sourceHandlers||[];for(let e=0;e=0;r--){let n=e[r];n[t]&&n[t](s,i)}}(e,i,o,a),o}let i_={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},iy={setCurrentTime:1,setMuted:1,setVolume:1},iv={play:1,pause:1};function iT(e){return(t,i)=>t===im?im:i[e]?i[e](t):t}let ib={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},iS=function(e=""){return ib[t7(e).toLowerCase()]||""},ik=(e,t)=>{if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;let i=e.cache_.sources.filter(e=>e.src===t);if(i.length)return i[0].type;let s=e.$$("source");for(let e=0;ethis.handleMouseOver(e),this.handleMouseOut_=e=>this.handleMouseOut(e),this.handleClick_=e=>this.handleClick(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.emitTapEvents(),this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&q.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),i=Object.assign({role:"button"},i),this.tabIndex_=t.tabIndex;let s=eC(e,t,i);return this.player_.options_.experimentalSvgIcons||s.appendChild(eC("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(s),s}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=eC("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(void 0===e)return this.controlText_||"Need Text";let i=this.localize(e);this.controlText_=e,eE(this.controlTextEl_,i),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",i)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){m().isEventKey(e,"Space")||m().isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}tP.registerComponent("ClickableComponent",ix);class iI extends ix{constructor(e,t){super(e,t),this.update(),this.update_=e=>this.update(e),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return eC("div",{className:"vjs-poster"})}crossOrigin(e){if(void 0===e)return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;if(null!==e&&"anonymous"!==e&&"use-credentials"!==e){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.$("img")&&(this.$("img").crossOrigin=e)}update(e){let t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){if(!e){this.el_.textContent="";return}this.$("img")||this.el_.appendChild(eC("picture",{className:"vjs-poster",tabIndex:-1},{},eC("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?tq(this.player_.play()):this.player_.pause())}}iI.prototype.crossorigin=iI.prototype.crossOrigin,tP.registerComponent("PosterImage",iI);let iP="#222",iL="#ccc",iA={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function iD(e,t){let i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else if(7===e.length)i=e.slice(1);else throw Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function iO(e,t,i){try{e.style[t]=i}catch(e){return}}function iM(e){return e?`${e}px`:""}class iR extends tP{constructor(e,t,i){super(e,t,i);let s=e=>{this.updateDisplayOverlay(),this.updateDisplay(e)};e.on("loadstart",e=>this.toggleDisplay(e)),e.on("texttrackchange",e=>this.updateDisplay(e)),e.on("loadedmetadata",e=>{this.updateDisplayOverlay(),this.preselectTrack(e)}),e.ready(to(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",s),e.on("playerresize",s);let t=d().screen.orientation||d(),i=d().screen.orientation?"change":"orientationchange";t.addEventListener(i,s),e.on("dispose",()=>t.removeEventListener(i,s));let r=this.options_.playerOptions.tracks||[];for(let e=0;e.1&&(i>s?r=Math.round((e-t*s)/2):n=Math.round((t-e/s)/2)),iO(this.el_,"insetInline",iM(r)),iO(this.el_,"insetBlock",iM(n))}updateDisplayState(e){let t=this.player_.textTrackSettings.getValues(),i=e.activeCues,s=i.length;for(;s--;){let e=i[s];if(!e)continue;let r=e.displayState;if(t.color&&(r.firstChild.style.color=t.color),t.textOpacity&&iO(r.firstChild,"color",iD(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(r.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&iO(r.firstChild,"backgroundColor",iD(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?iO(r,"backgroundColor",iD(t.windowColor,t.windowOpacity)):r.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?r.firstChild.style.textShadow=`2px 2px 3px ${iP}, 2px 2px 4px ${iP}, 2px 2px 5px ${iP}`:"raised"===t.edgeStyle?r.firstChild.style.textShadow=`1px 1px ${iP}, 2px 2px ${iP}, 3px 3px ${iP}`:"depressed"===t.edgeStyle?r.firstChild.style.textShadow=`1px 1px ${iL}, 0 1px ${iL}, -1px -1px ${iP}, 0 -1px ${iP}`:"uniform"===t.edgeStyle&&(r.firstChild.style.textShadow=`0 0 4px ${iP}, 0 0 4px ${iP}, 0 0 4px ${iP}, 0 0 4px ${iP}`)),t.fontPercent&&1!==t.fontPercent){let e=d().parseFloat(r.style.fontSize);r.style.fontSize=e*t.fontPercent+"px",r.style.height="auto",r.style.top="auto"}t.fontFamily&&"default"!==t.fontFamily&&("small-caps"===t.fontFamily?r.firstChild.style.fontVariant="small-caps":r.firstChild.style.fontFamily=iA[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),"function"!=typeof d().WebVTT||e.every(e=>!e.activeCues))return;let t=[];for(let i=0;ithis.handleMouseDown(e))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){let t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e){tq(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}let i=this.player_.getChild("controlBar"),s=i&&i.getChild("playToggle");if(!s){this.player_.tech(!0).focus();return}let r=()=>s.focus();t$(t)?t.then(r,()=>{}):this.setTimeout(r,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}iN.prototype.controlText_="Play Video",tP.registerComponent("BigPlayButton",iN);class ij extends iB{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){m().isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}tP.registerComponent("CloseButton",ij);class iF extends iB{constructor(e,t={}){super(e,t),t.replay=void 0===t.replay||t.replay,this.setIcon("play"),this.on(e,"play",e=>this.handlePlay(e)),this.on(e,"pause",e=>this.handlePause(e)),t.replay&&this.on(e,"ended",e=>this.handleEnded(e))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?tq(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",e=>this.handleSeeked(e))}}iF.prototype.controlText_="Play",tP.registerComponent("PlayToggle",iF);class i$ extends tP{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],e=>this.update(e)),this.updateTextNode_()}createEl(){let e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),i=eC("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)}\u00a0`},{role:"presentation"});return t.appendChild(i),this.contentEl_=eC("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){(this.player_.options_.enableSmoothSeeking||"seeking"!==e.type)&&this.updateContent(e)}updateTextNode_(e=0){e=tB(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let e=this.textNode_;e&&this.contentEl_.firstChild!==e&&(e=null,q.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=c().createTextNode(this.formattedTime_),this.textNode_&&(e?this.contentEl_.replaceChild(this.textNode_,e):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}i$.prototype.labelText_="Time",i$.prototype.controlText_="Time",tP.registerComponent("TimeDisplay",i$);class iq extends i${buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}iq.prototype.labelText_="Current Time",iq.prototype.controlText_="Current Time",tP.registerComponent("CurrentTimeDisplay",iq);class iH extends i${constructor(e,t){super(e,t);let i=e=>this.updateContent(e);this.on(e,"durationchange",i),this.on(e,"loadstart",i),this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){let t=this.player_.duration();this.updateTextNode_(t)}}iH.prototype.labelText_="Duration",iH.prototype.controlText_="Duration",tP.registerComponent("DurationDisplay",iH);class iV extends tP{createEl(){let e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return t.appendChild(i),e.appendChild(t),e}}tP.registerComponent("TimeDivider",iV);class iz extends i${constructor(e,t){super(e,t),this.on(e,"durationchange",e=>this.updateContent(e))}buildCSSClass(){return"vjs-remaining-time"}createEl(){let e=super.createEl();return!1!==this.options_.displayNegative&&e.insertBefore(eC("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){let t;"number"==typeof this.player_.duration()&&(t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t))}}iz.prototype.labelText_="Remaining Time",iz.prototype.controlText_="Remaining Time",tP.registerComponent("RemainingTimeDisplay",iz);class iW extends tP{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",e=>this.updateShowing(e))}createEl(){let e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=eC("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(eC("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")}\u00a0`})),this.contentEl_.appendChild(c().createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}}tP.registerComponent("LiveDisplay",iW);class iG extends iB{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=e=>this.updateLiveEdgeStatus(e),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){let e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=eC("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}function iK(e,t,i){return Math.min(i,Math.max(t,isNaN(e=Number(e))?t:e))}iG.prototype.controlText_="Seek to live, currently playing live",tP.registerComponent("SeekToLive",iG);var iQ=Object.freeze({__proto__:null,clamp:iK});class iY extends tP{constructor(e,t){super(e,t),this.handleMouseDown_=e=>this.handleMouseDown(e),this.handleMouseUp_=e=>this.handleMouseUp(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.handleClick_=e=>this.handleClick(e),this.handleMouseMove_=e=>this.handleMouseMove(e),this.update_=e=>this.update(e),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;let e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},i={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),super.createEl(e,t,i)}handleMouseDown(e){let t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||ea||e.preventDefault(),eU(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){let t=this.bar.el_.ownerDocument;eB(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;let e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{let t=this.vertical()?"height":"width";this.bar.el().style[t]=(100*e).toFixed(2)+"%"})),e}getProgress(){return Number(iK(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){let t=eF(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){m().isEventKey(e,"Left")||m().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):m().isEventKey(e,"Right")||m().isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}tP.registerComponent("Slider",iY);let iX=(e,t)=>iK(e/t*100,0,100).toFixed(2)+"%";class iJ extends tP{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",e=>this.update(e))}createEl(){let e=super.createEl("div",{className:"vjs-load-progress"}),t=eC("span",{className:"vjs-control-text"}),i=eC("span",{textContent:this.localize("Loaded")}),s=c().createTextNode(": ");return this.percentageEl_=eC("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(s),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{let e=this.player_.liveTracker,t=this.player_.buffered(),i=e&&e.isLive()?e.seekableEnd():this.player_.duration(),s=this.player_.bufferedEnd(),r=this.partEls_,n=iX(s,i);this.percent_!==n&&(this.el_.style.width=n,eE(this.percentageEl_,n),this.percent_=n);for(let e=0;et.length;e--)this.el_.removeChild(r[e-1]);r.length=t.length})}}tP.registerComponent("LoadProgressBar",iJ);class iZ extends tP{constructor(e,t){super(e,t),this.update=tl(to(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){let s=ej(this.el_),r=eN(this.player_.el()),n=e.width*t;if(!r||!s)return;let a=e.left-r.left+n,o=e.width-n+(r.right-e.right),l=s.width/2;as.width&&(l=s.width),l=Math.round(l),this.el_.style.right=`-${l}px`,this.write(i)}write(e){eE(this.el_,e)}updateTime(e,t,i,s){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let r;let n=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){let e=this.player_.liveTracker.liveWindow(),i=e-t*e;r=(i<1?"":"-")+tB(i,e)}else r=tB(i,n);this.update(e,t,r),s&&s()})}}tP.registerComponent("TimeTooltip",iZ);class i0 extends tP{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=tl(to(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){let i=this.getChild("timeTooltip");if(!i)return;let s=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,s)}}i0.prototype.options_={children:[]},ef||ei||i0.prototype.options_.children.push("timeTooltip"),tP.registerComponent("PlayProgressBar",i0);class i1 extends tP{constructor(e,t){super(e,t),this.update=tl(to(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){let i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,()=>{this.el_.style.left=`${e.width*t}px`})}}i1.prototype.options_={children:["timeTooltip"]},tP.registerComponent("MouseTimeDisplay",i1);class i2 extends iY{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=to(this,this.update),this.update=tl(this.update_,30),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in c()&&"visibilityState"in c()&&this.on(c(),"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){"hidden"===c().visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,30))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||!this.updateInterval||(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if("hidden"===c().visibilityState)return;let t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{let e=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),i=this.player_.liveTracker,s=this.player_.duration();i&&i.isLive()&&(s=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.percent_=t),(this.currentTime_!==e||this.duration_!==s)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[tB(e,s),tB(s,s)],"{1} of {2}")),this.currentTime_=e,this.duration_=s),this.bar&&this.bar.update(eN(this.el()),this.getProgress())}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){let e;let t=this.getCurrentTime_(),i=this.player_.liveTracker;return i&&i.isLive()?(e=(t-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e}handleMouseDown(e){eW(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){let i;if(!eW(e)||isNaN(this.player_.duration()))return;t||this.player_.scrubbing()||this.player_.scrubbing(!0);let s=this.calculateDistance(e),r=this.player_.liveTracker;if(r&&r.isLive()){if(s>=.99){r.seekToLiveEdge();return}let e=r.seekableStart(),t=r.liveCurrentTime();if((i=e+s*r.liveWindow())>=t&&(i=t),i<=e&&(i=e+.1),i===1/0)return}else(i=s*this.player_.duration())===this.player_.duration()&&(i-=.1);this.userSeek_(i),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();let e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();let e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?tq(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+5)}stepBack(){this.userSeek_(this.player_.currentTime()-5)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){let t=this.player_.liveTracker;if(m().isEventKey(e,"Space")||m().isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(m().isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(m().isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(m()(e))){e.preventDefault(),e.stopPropagation();let i=(m().codes[m()(e)]-m().codes["0"])*10/100;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else m().isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):m().isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in c()&&"visibilityState"in c()&&this.off(c(),"visibilitychange",this.toggleVisibility_),super.dispose()}}i2.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},ef||ei||i2.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),tP.registerComponent("SeekBar",i2);class i4 extends tP{constructor(e,t){super(e,t),this.handleMouseMove=tl(to(this,this.handleMouseMove),30),this.throttledHandleMouseSeek=tl(to(this,this.handleMouseSeek),30),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.handleMouseDownHandler_=e=>this.handleMouseDown(e),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){let t=this.getChild("seekBar");if(!t)return;let i=t.getChild("playProgressBar"),s=t.getChild("mouseTimeDisplay");if(!i&&!s)return;let r=t.el(),n=ej(r),a=eF(r,e).x;a=iK(a,0,1),s&&s.update(n,a),i&&i.update(n,t.getProgress())}handleMouseSeek(e){let t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){let e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&tq(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){let e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){let t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){let t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}i4.prototype.options_={children:["seekBar"]},tP.registerComponent("ProgressControl",i4);class i8 extends iB{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],e=>this.handlePictureInPictureChange(e)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],e=>this.handlePictureInPictureEnabledChange(e)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){if(!("audio"===this.player_.currentType().substring(0,5)||this.player_.audioPosterMode()||this.player_.audioOnlyMode())){this.show();return}this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()}handlePictureInPictureEnabledChange(){c().pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in d()?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){"function"==typeof c().exitPictureInPicture&&super.show()}}i8.prototype.controlText_="Picture-in-Picture",tP.registerComponent("PictureInPictureToggle",i8);class i5 extends iB{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",e=>this.handleFullscreenChange(e)),!1===c()[e.fsApi_.fullscreenEnabled]&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}i5.prototype.controlText_="Fullscreen",tP.registerComponent("FullscreenToggle",i5);let i3=function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})};class i6 extends tP{createEl(){let e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}tP.registerComponent("VolumeLevel",i6);class i7 extends tP{constructor(e,t){super(e,t),this.update=tl(to(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,s){if(!i){let i=eN(this.el_),s=eN(this.player_.el()),r=e.width*t;if(!s||!i)return;let n=e.left-s.left+r,a=e.width-r+(s.right-e.right),o=i.width/2;ni.width&&(o=i.width),this.el_.style.right=`-${o}px`}this.write(`${s}%`)}write(e){eE(this.el_,e)}updateVolume(e,t,i,s,r){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,i,s.toFixed(0)),r&&r()})}}tP.registerComponent("VolumeLevelTooltip",i7);class i9 extends tP{constructor(e,t){super(e,t),this.update=tl(to(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){this.getChild("volumeLevelTooltip").updateVolume(e,t,i,100*t,()=>{i?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}}i9.prototype.options_={children:["volumeLevelTooltip"]},tP.registerComponent("MouseVolumeLevelDisplay",i9);class se extends iY{constructor(e,t){super(e,t),this.on("slideractive",e=>this.updateLastVolume_(e)),this.on(e,"volumechange",e=>this.updateARIAAttributes(e)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){eW(e)&&super.handleMouseDown(e)}handleMouseMove(e){let t=this.getChild("mouseVolumeLevelDisplay");if(t){let i=this.el(),s=eN(i),r=this.vertical(),n=eF(i,e);n=iK(n=r?n.y:n.x,0,1),t.update(s,n,r)}eW(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){let t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(100*this.player_.volume())}updateLastVolume_(){let e=this.player_.volume();this.one("sliderinactive",()=>{0===this.player_.volume()&&this.player_.lastVolume_(e)})}}se.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},ef||ei||se.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),se.prototype.playerEvent="volumechange",tP.registerComponent("VolumeBar",se);class st extends tP{constructor(e,t={}){t.vertical=t.vertical||!1,(void 0===t.volumeBar||Q(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),i3(this,e),this.throttledHandleMouseMove=tl(to(this,this.handleMouseMove),30),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.on("mousedown",e=>this.handleMouseDown(e)),this.on("touchstart",e=>this.handleMouseDown(e)),this.on("mousemove",e=>this.handleMouseMove(e)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){let t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){let t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}st.prototype.options_={children:["volumeBar"]},tP.registerComponent("VolumeControl",st);let si=function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})};class ss extends iB{constructor(e,t){super(e,t),si(this,e),this.on(e,["loadstart","volumechange"],e=>this.update(e))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){let t=this.player_.volume(),i=this.player_.lastVolume_();0===t?(this.player_.volume(i<.1?.1:i),this.player_.muted(!1)):this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){let e=this.player_.volume(),t=3;this.setIcon("volume-high"),ef&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),eP(this.el_,[0,1,2,3].reduce((e,t)=>e+`${t?" ":""}vjs-vol-${t}`,"")),eI(this.el_,`vjs-vol-${t}`)}updateControlText_(){let e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)}}ss.prototype.controlText_="Mute",tP.registerComponent("MuteToggle",ss);class sr extends tP{constructor(e,t={}){void 0!==t.inline?t.inline=t.inline:t.inline=!0,(void 0===t.volumeControl||Q(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=e=>this.handleKeyPress(e),this.on(e,["loadstart"],e=>this.volumePanelState_(e)),this.on(this.muteToggle,"keyup",e=>this.handleKeyPress(e)),this.on(this.volumeControl,"keyup",e=>this.handleVolumeControlKeyUp(e)),this.on("keydown",e=>this.handleKeyPress(e)),this.on("mouseover",e=>this.handleMouseOver(e)),this.on("mouseout",e=>this.handleMouseOut(e)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){m().isEventKey(e,"Esc")&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),tt(c(),"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),ti(c(),"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){m().isEventKey(e,"Esc")&&this.handleMouseOut()}}sr.prototype.options_={children:["muteToggle","volumeControl"]},tP.registerComponent("VolumePanel",sr);class sn extends iB{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime])),this.show()):this.hide()}getSkipForwardTime(){let e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){let t;if(isNaN(this.player_.duration()))return;let i=this.player_.currentTime(),s=this.player_.liveTracker,r=s&&s.isLive()?s.seekableEnd():this.player_.duration();t=i+this.skipTime<=r?i+this.skipTime:r,this.player_.currentTime(t)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}sn.prototype.controlText_="Skip Forward",tP.registerComponent("SkipForward",sn);class sa extends iB{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime])),this.show()):this.hide()}getSkipBackwardTime(){let e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){let t;let i=this.player_.currentTime(),s=this.player_.liveTracker,r=s&&s.isLive()&&s.seekableStart();t=r&&i-this.skipTime<=r?r:i>=this.skipTime?i-this.skipTime:0,this.player_.currentTime(t)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}sa.prototype.controlText_="Skip Backward",tP.registerComponent("SkipBackward",sa);class so extends tP{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",e=>this.handleKeyDown(e)),this.boundHandleBlur_=e=>this.handleBlur(e),this.boundHandleTapClick_=e=>this.handleTapClick(e)}addEventListenerForItem(e){e instanceof tP&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof tP&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){"string"==typeof e&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){let t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){let e=this.options_.contentElType||"ul";this.contentEl_=eC(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");let t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),tt(t,"click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){let t=e.relatedTarget||c().activeElement;if(!this.children().some(e=>e.el()===t)){let e=this.menuButton_;e&&e.buttonPressed_&&t!==e.el().firstChild&&e.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();let t=this.children();if(!Array.isArray(t))return;let i=t.filter(t=>t.el()===e.target)[0];i&&"CaptionSettingsMenuItem"!==i.name()&&this.menuButton_.focus()}}handleKeyDown(e){m().isEventKey(e,"Left")||m().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(m().isEventKey(e,"Right")||m().isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){let t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}tP.registerComponent("Menu",so);class sl extends tP{constructor(e,t={}){super(e,t),this.menuButton_=new iB(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");let i=iB.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;let s=e=>this.handleClick(e);this.handleMenuKeyUp_=e=>this.handleMenuKeyUp(e),this.on(this.menuButton_,"tap",s),this.on(this.menuButton_,"click",s),this.on(this.menuButton_,"keydown",e=>this.handleKeyDown(e)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),tt(c(),"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",e=>this.handleMouseLeave(e)),this.on("keydown",e=>this.handleSubmenuKeyDown(e))}update(){let e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){let e=new so(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){let t=eC("li",{className:"vjs-menu-title",textContent:tw(this.options_.title),tabIndex:-1}),i=new tP(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(let t=0;tm().isEventKey(e,t))||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}tP.registerComponent("MenuItem",su);class sc extends su{constructor(e,t){let i=t.track,s=e.textTracks();t.label=i.label||i.language||"Unknown",t.selected="showing"===i.mode,super(e,t),this.track=i,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);let r=(...e)=>{this.handleTracksChange.apply(this,e)},n=(...e)=>{this.handleSelectedLanguageChange.apply(this,e)};if(e.on(["loadstart","texttrackchange"],r),s.addEventListener("change",r),s.addEventListener("selectedlanguagechange",n),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],r),s.removeEventListener("change",r),s.removeEventListener("selectedlanguagechange",n)}),void 0===s.onchange){let e;this.on(["tap","click"],function(){if("object"!=typeof d().Event)try{e=new(d()).Event("change")}catch(e){}e||(e=c().createEvent("Event")).initEvent("change",!0,!0),s.dispatchEvent(e)})}this.handleTracksChange()}handleClick(e){let t=this.track,i=this.player_.textTracks();if(super.handleClick(e),i)for(let e=0;e-1&&"showing"===s.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(e){let t=this.player().textTracks(),i=!0;for(let e=0,s=t.length;e-1&&"showing"===s.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}tP.registerComponent("OffTextTrackMenuItem",sp);class sm extends sh{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=sc){let i;this.label_&&(i=`${this.label_} off`),e.push(new sp(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;let s=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let i=0;i-1){let i=new t(this.player_,{track:r,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});i.addClass(`vjs-${r.kind}-menu-item`),e.push(i)}}return e}}tP.registerComponent("TextTrackButton",sm);class sg extends su{constructor(e,t){let i=t.track,s=t.cue,r=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=s.text,t.selected=s.startTime<=r&&r{this.items.forEach(e=>{e.selected(this.track_.activeCues[0]===e.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&"chapters"!==e.track.kind)return;let t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){let e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";let e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){let e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){let i=e[t];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(tw(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){let e=[];if(!this.track_)return e;let t=this.track_.cues;if(!t)return e;for(let i=0,s=t.length;i-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(tw(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new sv(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,sb)}}sS.prototype.kinds_=["captions","subtitles"],sS.prototype.controlText_="Subtitles",tP.registerComponent("SubsCapsButton",sS);class sk extends su{constructor(e,t){let i=t.track,s=e.audioTracks();t.label=i.label||i.language||"Unknown",t.selected=i.enabled,super(e,t),this.track=i,this.addClass(`vjs-${i.kind}-menu-item`);let r=(...e)=>{this.handleTracksChange.apply(this,e)};s.addEventListener("change",r),this.on("dispose",()=>{s.removeEventListener("change",r)})}createEl(e,t,i){let s=super.createEl(e,t,i),r=s.querySelector(".vjs-menu-item-text");return["main-desc","description"].indexOf(this.options_.track.kind)>=0&&(r.appendChild(eC("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),r.appendChild(eC("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),s}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){let e=this.player_.audioTracks();for(let t=0;tthis.update(e))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}sE.prototype.contentElType="button",tP.registerComponent("PlaybackRateMenuItem",sE);class sw extends sl{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",e=>this.updateVisibility(e)),this.on(e,"ratechange",e=>this.updateLabel(e)),this.on(e,"playbackrateschange",e=>this.handlePlaybackRateschange(e))}createEl(){let e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=eC("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){let e=this.playbackRates(),t=[];for(let i=e.length-1;i>=0;i--)t.push(new sE(this.player(),{rate:e[i]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){let e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}sw.prototype.controlText_="Playback Rate",tP.registerComponent("PlaybackRateMenuButton",sw);class sx extends tP{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i)}}tP.registerComponent("Spacer",sx);class sI extends sx{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:"\xa0"})}}tP.registerComponent("CustomControlSpacer",sI);class sP extends tP{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}sP.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},tP.registerComponent("ControlBar",sP);class sL extends tW{constructor(e,t){super(e,t),this.on(e,"error",e=>{this.close(),this.open(e)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){let e=this.player().error();return e?this.localize(e.message):""}}sL.prototype.options_=Object.assign({},tW.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),tP.registerComponent("ErrorDisplay",sL);let sA="vjs-text-track-settings",sD=["#000","Black"],sO=["#00F","Blue"],sM=["#0FF","Cyan"],sR=["#0F0","Green"],sU=["#F0F","Magenta"],sB=["#F00","Red"],sN=["#FFF","White"],sj=["#FF0","Yellow"],sF=["1","Opaque"],s$=["0.5","Semi-Transparent"],sq=["0","Transparent"],sH={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[sD,sN,sB,sR,sO,sj,sU,sM]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[sF,s$,sq]},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[sN,sD,sB,sR,sO,sj,sU,sM]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:e=>"1.00"===e?null:Number(e)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[sF,s$]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[sq,s$,sF]}};function sV(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}sH.windowColor.options=sH.backgroundColor.options;class sz extends tW{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.endDialog=eC("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),void 0===t.persistTextTrackSettings&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.on(this.$(".vjs-done-button"),"click",()=>{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),"click",()=>{this.setDefaults(),this.updateDisplay()}),W(sH,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)}),this.options_.persistTextTrackSettings&&this.restoreSettings()}dispose(){this.endDialog=null,super.dispose()}createElSelect_(e,t="",i="label"){let s=sH[e],r=s.id.replace("%s",this.id_),n=[t,r].join(" ").trim(),a=`vjs_select_${e5++}`;return[`<${i} id="${r}"${"label"===i?` for="${a}" class="vjs-label"`:""}>`,this.localize(s.label),``,`").join("")}createElFgColor_(){let e=`captions-text-legend-${this.id_}`;return['
',``,this.localize("Text"),"",'',this.createElSelect_("color",e),"",'',this.createElSelect_("textOpacity",e),"","
"].join("")}createElBgColor_(){let e=`captions-background-${this.id_}`;return['
',``,this.localize("Text Background"),"",'',this.createElSelect_("backgroundColor",e),"",'',this.createElSelect_("backgroundOpacity",e),"","
"].join("")}createElWinColor_(){let e=`captions-window-${this.id_}`;return['
',``,this.localize("Caption Area Background"),"",'',this.createElSelect_("windowColor",e),"",'',this.createElSelect_("windowOpacity",e),"","
"].join("")}createElColors_(){return eC("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})}createElFont_(){return eC("div",{className:"vjs-track-settings-font",innerHTML:['
',this.createElSelect_("fontPercent","","legend"),"
",'
',this.createElSelect_("edgeStyle","","legend"),"
",'
',this.createElSelect_("fontFamily","","legend"),"
"].join("")})}createElControls_(){let e=this.localize("restore all settings to the default values");return eC("div",{className:"vjs-track-settings-controls",innerHTML:[`",``].join("")})}content(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return G(sH,(e,t,i)=>{var s,r;let n=(s=this.$(t.selector),r=t.parser,sV(s.options[s.options.selectedIndex].value,r));return void 0!==n&&(e[i]=n),e},{})}setValues(e){W(sH,(t,i)=>{!function(e,t,i){if(t){for(let s=0;s{let t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(d().localStorage.getItem(sA))}catch(e){q.warn(e)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;let e=this.getValues();try{Object.keys(e).length?d().localStorage.setItem(sA,JSON.stringify(e)):d().localStorage.removeItem(sA)}catch(e){q.warn(e)}}updateDisplay(){let e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}conditionalBlur_(){this.previouslyActiveEl_=null;let e=this.player_.controlBar,t=e&&e.subsCapsButton,i=e&&e.captionsButton;t?t.focus():i&&i.focus()}handleLanguagechange(){this.fill()}}tP.registerComponent("TextTrackSettings",sz);class sW extends tP{constructor(e,t){let i=t.ResizeObserver||d().ResizeObserver;null===t.ResizeObserver&&(i=!1),super(e,Y({createEl:!i,reportTouchActivity:!1},t)),this.ResizeObserver=t.ResizeObserver||d().ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=th(()=>{this.resizeHandler()},100,!1,this),i?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;let e=this.debouncedHandler_,t=this.unloadListener_=function(){ti(this,"resize",e),ti(this,"unload",t),t=null};tt(this.el_.contentWindow,"unload",t),tt(this.el_.contentWindow,"resize",e)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}tP.registerComponent("ResizeManager",sW);let sG={trackingThreshold:20,liveTolerance:15};class sK extends tP{constructor(e,t){super(e,Y(sG,t,{createEl:!1})),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=e=>this.handlePlay(e),this.handleFirstTimeupdate_=e=>this.handleFirstTimeupdate(e),this.handleSeeked_=e=>this.handleSeeked(e),this.seekToLiveEdge_=e=>this.seekToLiveEdge(e),this.reset_(),this.on(this.player_,"durationchange",e=>this.handleDurationchange(e)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){let e=this.player_.seekable();if(!e||!e.length)return;let t=Number(d().performance.now().toFixed(4)),i=-1===this.lastTime_?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;let s=this.liveCurrentTime(),r=this.player_.currentTime(),n=this.player_.paused()||this.seekedBehindLive_||Math.abs(s-r)>this.options_.liveTolerance;this.timeupdateSeen_&&s!==1/0||(n=!1),n!==this.behindLiveEdge_&&(this.behindLiveEdge_=n,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,30),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){let e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){let e=this.player_.seekable(),t=[],i=e?e.length:0;for(;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){let e=this.player_.seekable(),t=[],i=e?e.length:0;for(;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0}liveWindow(){let e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){let e=this.seekableEnd();return -1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return"number"==typeof this.trackingInterval_}seekToLiveEdge(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}tP.registerComponent("LiveTracker",sK);class sQ extends tP{constructor(e,t){super(e,t),this.on("statechanged",e=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:eC("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${e5++}`}),description:eC("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${e5++}`})},eC("div",{className:"vjs-title-bar"},{},X(this.els))}updateDom_(){let e=this.player_.tech_,t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(e=>{let s=this.state[e],r=this.els[e],n=i[e];eq(r),s&&eE(r,s),t&&(t.removeAttribute(n),s&&t.setAttribute(n,r.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){let e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}tP.registerComponent("TitleBar",sQ);let sY=e=>{let t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;let i=e.$$("source"),s=[],r="";if(!i.length)return!1;for(let e=0;e{let i={};for(let s=0;ssJ([e.el(),d().HTMLMediaElement.prototype,d().Element.prototype,sX],"innerHTML"),s0=function(e){let t=e.el();if(t.resetSourceWatch_)return;let i={},s=sZ(e),r=i=>(...s)=>{let r=i.apply(t,s);return sY(e),r};["append","appendChild","insertAdjacentHTML"].forEach(e=>{t[e]&&(i[e]=t[e],t[e]=r(i[e]))}),Object.defineProperty(t,"innerHTML",Y(s,{set:r(s.set)})),t.resetSourceWatch_=()=>{t.resetSourceWatch_=null,Object.keys(i).forEach(e=>{t[e]=i[e]}),Object.defineProperty(t,"innerHTML",s)},e.one("sourceset",t.resetSourceWatch_)},s1=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?t6(d().Element.prototype.getAttribute.call(this,"src")):""},set(e){return d().Element.prototype.setAttribute.call(this,"src",e),e}}),s2=e=>sJ([e.el(),d().HTMLMediaElement.prototype,s1],"src"),s4=function(e){if(!e.featuresSourceset)return;let t=e.el();if(t.resetSourceset_)return;let i=s2(e),s=t.setAttribute,r=t.load;Object.defineProperty(t,"src",Y(i,{set:s=>{let r=i.set.call(t,s);return e.triggerSourceset(t.src),r}})),t.setAttribute=(i,r)=>{let n=s.call(t,i,r);return/src/i.test(i)&&e.triggerSourceset(t.src),n},t.load=()=>{let i=r.call(t);return sY(e)||(e.triggerSourceset(""),s0(e)),i},t.currentSrc?e.triggerSourceset(t.currentSrc):sY(e)||s0(e),t.resetSourceset_=()=>{t.resetSourceset_=null,t.load=r,t.setAttribute=s,Object.defineProperty(t,"src",i),t.resetSourceWatch_&&t.resetSourceWatch_()}};class s8 extends iu{constructor(e,t){super(e,t);let i=e.source,s=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&"VIDEO"===this.el_.tagName,i&&(this.el_.currentSrc!==i.src||e.tag&&3===e.tag.initNetworkState_)?this.setSource(i):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){let e=this.el_.childNodes,t=e.length,i=[];for(;t--;){let r=e[t];"track"===r.nodeName.toLowerCase()&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(r),this.remoteTextTracks().addTrack(r.track),this.textTracks().addTrack(r.track),!s&&!this.el_.hasAttribute("crossorigin")&&t9(r.src)&&(s=!0)):i.push(r))}for(let e=0;e{e=[];for(let i=0;it.removeEventListener("change",i));let s=()=>{for(let t=0;t{t.removeEventListener("change",i),t.removeEventListener("change",s),t.addEventListener("change",s)}),this.on("webkitendfullscreen",()=>{t.removeEventListener("change",i),t.addEventListener("change",i),t.removeEventListener("change",s)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;let i=e.toLowerCase();this[`${i}TracksListeners_`]&&Object.keys(this[`${i}TracksListeners_`]).forEach(e=>{this.el()[`${i}Tracks`].removeEventListener(e,this[`${i}TracksListeners_`][e])}),this[`featuresNative${e}Tracks`]=!t,this[`${i}TracksListeners_`]=null,this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){let t=il[e],i=this.el()[t.getterName],s=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener)return;let r={change:t=>{let i={type:"change",target:s,currentTarget:s,srcElement:s};s.trigger(i),"text"===e&&this[ih.remoteText.getterName]().trigger(i)},addtrack(e){s.addTrack(e.track)},removetrack(e){s.removeTrack(e.track)}},n=function(){let e=[];for(let t=0;t{let t=r[e];i.addEventListener(e,t),this.on("dispose",s=>i.removeEventListener(e,t))}),this.on("loadstart",n),this.on("dispose",e=>this.off("loadstart",n))}proxyNativeTracks_(){il.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){let t=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(t,e),s8.disposeMediaElement(e),e=t}else{e=c().createElement("video");let t=Y({},this.options_.tag&&eD(this.options_.tag));em&&!0===this.options_.nativeControlsForTouch||delete t.controls,eA(e,Object.assign(t,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}void 0!==this.options_.preload&&eM(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);let t=["loop","muted","playsinline","autoplay"];for(let i=0;i=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(e){this.trigger(e)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&e_?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){q(e,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&ei&&ea&&0===this.el_.currentTime){let e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;let e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return"function"==typeof this.el_.webkitEnterFullScreen}enterFullScreen(){let e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)tq(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}},0);else try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(void 0===e)return this.el_.src;this.setSrc(e)}reset(){s8.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,i):super.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);let t=c().createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){let i=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){let t=this.$$("track"),i=t.length;for(;i--;)(e===t[i]||e===t[i].track)&&this.el().removeChild(t[i])}}getVideoPlaybackQuality(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();let e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),d().performance&&(e.creationTime=d().performance.now()),e}}J(s8,"TEST_VID",function(){if(!eT())return;let e=c().createElement("video"),t=c().createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e}),s8.isSupported=function(){try{s8.TEST_VID.volume=.5}catch(e){return!1}return!!(s8.TEST_VID&&s8.TEST_VID.canPlayType)},s8.canPlayType=function(e){return s8.TEST_VID.canPlayType(e)},s8.canPlaySource=function(e,t){return s8.canPlayType(e.type)},s8.canControlVolume=function(){try{let e=s8.TEST_VID.volume;s8.TEST_VID.volume=e/2+.1;let t=e!==s8.TEST_VID.volume;if(t&&ef)return d().setTimeout(()=>{s8&&s8.prototype&&(s8.prototype.featuresVolumeControl=e!==s8.TEST_VID.volume)}),!1;return t}catch(e){return!1}},s8.canMuteVolume=function(){try{let e=s8.TEST_VID.muted;return s8.TEST_VID.muted=!e,s8.TEST_VID.muted?eM(s8.TEST_VID,"muted","muted"):eR(s8.TEST_VID,"muted","muted"),e!==s8.TEST_VID.muted}catch(e){return!1}},s8.canControlPlaybackRate=function(){if(ei&&ea&&el<58)return!1;try{let e=s8.TEST_VID.playbackRate;return s8.TEST_VID.playbackRate=e/2+.1,e!==s8.TEST_VID.playbackRate}catch(e){return!1}},s8.canOverrideAttributes=function(){try{let e=()=>{};Object.defineProperty(c().createElement("video"),"src",{get:e,set:e}),Object.defineProperty(c().createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(c().createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(c().createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},s8.supportsNativeTextTracks=function(){return e_||ef&&ea},s8.supportsNativeVideoTracks=function(){return!!(s8.TEST_VID&&s8.TEST_VID.videoTracks)},s8.supportsNativeAudioTracks=function(){return!!(s8.TEST_VID&&s8.TEST_VID.audioTracks)},s8.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([e,t]){J(s8.prototype,e,()=>s8[t](),!0)}),s8.prototype.featuresVolumeControl=s8.canControlVolume(),s8.prototype.movingMediaElementInDOM=!ef,s8.prototype.featuresFullscreenResize=!0,s8.prototype.featuresProgressEvents=!0,s8.prototype.featuresTimeupdateEvents=!0,s8.prototype.featuresVideoFrameCallback=!!(s8.TEST_VID&&s8.TEST_VID.requestVideoFrameCallback),s8.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},s8.resetMediaElement=function(e){if(!e)return;let t=e.querySelectorAll("source"),i=t.length;for(;i--;)e.removeChild(t[i]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){s8.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){s8.prototype["set"+tw(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(e){s8.prototype[e]=function(){return this.el_[e]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(e){s8.prototype["set"+tw(e)]=function(t){this.el_[e]=t}}),["pause","load","play"].forEach(function(e){s8.prototype[e]=function(){return this.el_[e]()}}),iu.withSourceHandlers(s8),s8.nativeSourceHandler={},s8.nativeSourceHandler.canPlayType=function(e){try{return s8.TEST_VID.canPlayType(e)}catch(e){return""}},s8.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return s8.nativeSourceHandler.canPlayType(e.type);if(e.src){let t=t7(e.src);return s8.nativeSourceHandler.canPlayType(`video/${t}`)}return""},s8.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},s8.nativeSourceHandler.dispose=function(){},s8.registerSourceHandler(s8.nativeSourceHandler),iu.registerTech("Html5",s8);let s5=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],s3={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},s6=["tiny","xsmall","small","medium","large","xlarge","huge"],s7={};s6.forEach(e=>{let t="x"===e.charAt(0)?`x-${e.substring(1)}`:e;s7[e]=`vjs-layout-${t}`});let s9={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class re extends tP{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${e5++}`,(t=Object.assign(re.getTagSettings(e),t)).initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){let i=e.closest("[lang]");i&&(t.language=i.getAttribute("lang"))}if(super(null,t,i),this.boundDocumentFullscreenChange_=e=>this.documentFullscreenChange_(e),this.boundFullWindowOnEscKey_=e=>this.fullWindowOnEscKey(e),this.boundUpdateStyleEl_=e=>this.updateStyleEl_(e),this.boundApplyInitTime_=e=>this.applyInitTime_(e),this.boundUpdateCurrentBreakpoint_=e=>this.updateCurrentBreakpoint_(e),this.boundHandleTechClick_=e=>this.handleTechClick_(e),this.boundHandleTechDoubleClick_=e=>this.handleTechDoubleClick_(e),this.boundHandleTechTouchStart_=e=>this.handleTechTouchStart_(e),this.boundHandleTechTouchMove_=e=>this.handleTechTouchMove_(e),this.boundHandleTechTouchEnd_=e=>this.handleTechTouchEnd_(e),this.boundHandleTechTap_=e=>this.handleTechTap_(e),this.isFullscreen_=!1,this.log=H(this.id_),this.fsApi_=B,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&eD(e),this.language(this.options_.language),t.languages){let e={};Object.getOwnPropertyNames(t.languages).forEach(function(i){e[i.toLowerCase()]=t.languages[i]}),this.languages_=e}else this.languages_=re.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(e=>{if("function"!=typeof this[e])throw Error(`plugin "${e}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),tS(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(tt(c(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);let s=Y(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(e=>{this[e](t.plugins[e])}),t.debug&&this.debug(!0),this.options_.playerOptions=s,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){let e=new(d()).DOMParser().parseFromString('\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n',"image/svg+xml");if(e.querySelector("parsererror"))q.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{let t=e.documentElement;t.style.display="none",this.el_.appendChild(t),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio("audio"===e.nodeName.toLowerCase()),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),em&&this.addClass("vjs-touch-enabled"),ef||this.addClass("vjs-workinghover"),re.players[this.id_]=this;let r=O.split(".")[0];this.addClass(`vjs-v${r}`),this.userActive(!0),this.reportUserActivity(),this.one("play",e=>this.listenForUserActivity_(e)),this.on("keydown",e=>this.handleKeyDown(e)),this.on("languagechange",e=>this.handleLanguagechange(e)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),ti(c(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),ti(c(),"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),re.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),ip[this.id()]=null,id.names.forEach(e=>{let t=this[id[e].getterName]();t&&t.off&&t.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e,t=this.tag,i=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player"),s="video-js"===this.tag.tagName.toLowerCase();i?e=this.el_=t.parentNode:s||(e=this.el_=super.createEl("div"));let r=eD(t);if(s){for(e=this.el_=t,t=this.tag=c().createElement("video");e.children.length;)t.appendChild(e.firstChild);ex(e,"video-js")||eI(e,"video-js"),e.appendChild(t),i=this.playerElIngest_=e,Object.keys(e).forEach(i=>{try{t[i]=e[i]}catch(e){}})}if(t.setAttribute("tabindex","-1"),r.tabindex="-1",ea&&eu&&(t.setAttribute("role","application"),r.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in r&&delete r.width,"height"in r&&delete r.height,Object.getOwnPropertyNames(r).forEach(function(i){s&&"class"===i||e.setAttribute(i,r[i]),s&&t.setAttribute(i,r[i])}),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=e.player=this,this.addClass("vjs-paused"),!0!==d().VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=e2("vjs-styles-dimensions");let e=eG(".vjs-styles-defaults"),t=eG("head");t.insertBefore(this.styleEl_,e?e.nextSibling:t.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);let n=t.getElementsByTagName("a");for(let e=0;e{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){let e,t,i;if(!0===d().VIDEOJS_NO_DYNAMIC_STYLE){let e="number"==typeof this.width_?this.width_:this.options_.width,t="number"==typeof this.height_?this.height_:this.options_.height,i=this.tech_&&this.tech_.el();i&&(e>=0&&(i.width=e),t>=0&&(i.height=t));return}let s=(void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),r=s[1]/s[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/r:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*r,i=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(i),e4(this.styleEl_,` + .${i} { + width: ${e}px; + height: ${t}px; + } + + .${i}.vjs-fluid:not(.vjs-audio-only-mode) { + padding-top: ${100*r}%; + } + `)}loadTech_(e,t){var i,s;this.tech_&&this.unloadTech_();let r=tw(e),n=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==r&&this.tag&&(iu.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=r,this.isReady_=!1;let a=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(a=!1);let o={source:t,autoplay:a,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${n}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};id.names.forEach(e=>{let t=id[e];o[t.getterName]=this[t.privateName]}),Object.assign(o,this.options_[r]),Object.assign(o,this.options_[n]),Object.assign(o,this.options_[e.toLowerCase()]),this.tag&&(o.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(o.startTime=this.cache_.currentTime);let l=iu.getTech(e);if(!l)throw Error(`No Tech named '${r}' exists! '${r}' should be registered using videojs.registerTech()'`);this.tech_=new l(o),this.tech_.ready(to(this,this.handleTechReady_),!0),i=this.textTracksJson_||[],s=this.tech_,i.forEach(function(e){let t=s.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach(e=>t.addCue(e))}),s.textTracks(),s5.forEach(e=>{this.on(this.tech_,e,t=>this[`handleTech${tw(e)}_`](t))}),Object.keys(s3).forEach(e=>{this.on(this.tech_,e,t=>{if(0===this.tech_.playbackRate()&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${s3[e]}_`].bind(this),event:t});return}this[`handleTech${s3[e]}_`](t)})}),this.on(this.tech_,"loadstart",e=>this.handleTechLoadStart_(e)),this.on(this.tech_,"sourceset",e=>this.handleTechSourceset_(e)),this.on(this.tech_,"waiting",e=>this.handleTechWaiting_(e)),this.on(this.tech_,"ended",e=>this.handleTechEnded_(e)),this.on(this.tech_,"seeking",e=>this.handleTechSeeking_(e)),this.on(this.tech_,"play",e=>this.handleTechPlay_(e)),this.on(this.tech_,"pause",e=>this.handleTechPause_(e)),this.on(this.tech_,"durationchange",e=>this.handleTechDurationChange_(e)),this.on(this.tech_,"fullscreenchange",(e,t)=>this.handleTechFullscreenChange_(e,t)),this.on(this.tech_,"fullscreenerror",(e,t)=>this.handleTechFullscreenError_(e,t)),this.on(this.tech_,"enterpictureinpicture",e=>this.handleTechEnterPictureInPicture_(e)),this.on(this.tech_,"leavepictureinpicture",e=>this.handleTechLeavePictureInPicture_(e)),this.on(this.tech_,"error",e=>this.handleTechError_(e)),this.on(this.tech_,"posterchange",e=>this.handleTechPosterChange_(e)),this.on(this.tech_,"textdata",e=>this.handleTechTextData_(e)),this.on(this.tech_,"ratechange",e=>this.handleTechRateChange_(e)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===r&&this.tag||ew(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){id.names.forEach(e=>{let t=id[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=tV(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return void 0===e&&q.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_}version(){return{"video.js":O}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()&&this.hasStarted(!1),this.trigger("loadstart"),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){let t;if(!this.tech_||"string"!=typeof e)return;let i=()=>{let e=this.muted();this.muted(!0);let t=()=>{this.muted(e)};this.playTerminatedQueue_.push(t);let i=this.play();if(t$(i))return i.catch(e=>{throw t(),Error(`Rejection at manualAutoplay. Restoring muted value. ${e||""}`)})};if("any"!==e||this.muted()?t="muted"!==e||this.muted()?this.play():i():t$(t=this.play())&&(t=t.catch(i)),t$(t))return t.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e,i="";"string"!=typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=ik(this,t)),this.cache_.source=Y({},e,{src:t,type:i});let s=this.cache_.sources.filter(e=>e.src&&e.src===t),r=[],n=this.$$("source"),a=[];for(let e=0;ethis.updateSourceCaches_(e),i=this.currentSource().src,s=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(s)&&(!this.lastSource_||this.lastSource_.tech!==s&&this.lastSource_.player!==i)&&(t=()=>{}),t(s),e.src||this.tech_.any(["sourceset","loadstart"],e=>{if("sourceset"===e.type)return;let t=this.techGet_("currentSrc");this.lastSource_.tech=t,this.updateSourceCaches_(t)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");let e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(void 0===this.options_||void 0===this.options_.userActions||void 0===this.options_.userActions.click||!1!==this.options_.userActions.click)&&(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?tq(this.play()):this.pause())}handleTechDoubleClick_(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),t=>t.contains(e.target))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){let t=e.target.player;if(t&&t!==this)return;let i=this.el(),s=c()[this.fsApi_.fullscreenElement]===i;!s&&i.matches&&(s=i.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(s)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){let e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in iy){var i;return i=this.middleware_,this.tech_[e](i.reduce(iT(e),t))}if(e in iv)return ig(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw q(e),e}},!0)}techGet_(e){if(this.tech_&&this.tech_.isReady_){if(e in i_){var t,i;return t=this.middleware_,i=this.tech_,t.reduceRight(iT(e),i[e]())}if(e in iv)return ig(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw q(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t;if("TypeError"===t.name)throw q(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t;throw q(t),t}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=tq){this.playCallbacks_.push(e);let t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),i=!!(e_||ef);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t){this.waitToPlay_=e=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!t&&i&&this.load();return}let s=this.techGet_("play");i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),null===s?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(s)}runPlayTerminatedQueue_(){let e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(e){e()})}runPlayCallbacks_(e){let t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(t){t(e)})}pause(){this.techCall_("pause")}paused(){return!1!==this.techGet_("paused")}played(){return this.techGet_("played")||tD(0,0)}scrubbing(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){if(void 0===e)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e===this.cache_.duration||(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return e&&e.length||(e=tD(0,0)),e}seekable(){let e=this.techGet_("seekable");return e&&e.length||(e=tD(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return tj(this.buffered(),this.duration())}bufferedEnd(){let e=this.buffered(),t=this.duration(),i=e.end(e.length-1);return i>t&&(i=t),i}volume(e){let t;if(void 0!==e){t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),t>0&&this.lastVolume_(t);return}return isNaN(t=parseFloat(this.techGet_("volume")))?1:t}muted(e){if(void 0!==e){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1}defaultMuted(e){return void 0!==e&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(void 0!==e&&0!==e){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(void 0!==e){let t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();let t=this;return new Promise((i,s)=>{function r(){t.off("fullscreenerror",a),t.off("fullscreenchange",n)}function n(){r(),i()}function a(e,t){r(),s(t)}t.one("fullscreenchange",n),t.one("fullscreenerror",a);let o=t.requestFullscreenHelper_(e);o&&(o.then(r,r),o.then(i,s))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0===e||(t=e)),this.fsApi_.requestFullscreen){let e=this.el_[this.fsApi_.requestFullscreen](t);return e&&e.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),e}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){let e=this;return new Promise((t,i)=>{function s(){e.off("fullscreenerror",n),e.off("fullscreenchange",r)}function r(){s(),t()}function n(e,t){s(),i(t)}e.one("fullscreenchange",r),e.one("fullscreenerror",n);let a=e.exitFullscreenHelper_();a&&(a.then(s,s),a.then(t,i))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){let e=c()[this.fsApi_.exitFullscreen]();return e&&tq(e.then(()=>this.isFullscreen(!1))),e}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=c().documentElement.style.overflow,tt(c(),"keydown",this.boundFullWindowOnEscKey_),c().documentElement.style.overflow="hidden",eI(c().body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){m().isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,ti(c(),"keydown",this.boundFullWindowOnEscKey_),c().documentElement.style.overflow=this.docOrigOverflow,eP(c().body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(void 0!==e){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&d().documentPictureInPicture){let e=c().createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(eC("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),d().documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(eY(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger("enterpictureinpicture"),t.addEventListener("pagehide",t=>{let i=t.target.querySelector(".video-js");e.parentNode.replaceChild(i,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in c()&&!1===this.disablePictureInPicture()?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){return d().documentPictureInPicture&&d().documentPictureInPicture.window?(d().documentPictureInPicture.window.close(),Promise.resolve()):"pictureInPictureEnabled"in c()?c().exitPictureInPicture():void 0}handleKeyDown(e){let{userActions:t}=this.options_;t&&t.hotkeys&&((e=>{let t=e.tagName.toLowerCase();return!!e.isContentEditable||("input"===t?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type):-1!==["textarea"].indexOf(t))})(this.el_.ownerDocument.activeElement)||("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e)))}handleHotkeys(e){let{fullscreenKey:t=e=>m().isEventKey(e,"f"),muteKey:i=e=>m().isEventKey(e,"m"),playPauseKey:s=e=>m().isEventKey(e,"k")||m().isEventKey(e,"Space")}=this.options_.userActions?this.options_.userActions.hotkeys:{};if(t.call(this,e)){e.preventDefault(),e.stopPropagation();let t=tP.getComponent("FullscreenToggle");!1!==c()[this.fsApi_.fullscreenEnabled]&&t.prototype.handleClick.call(this,e)}else i.call(this,e)?(e.preventDefault(),e.stopPropagation(),tP.getComponent("MuteToggle").prototype.handleClick.call(this,e)):s.call(this,e)&&(e.preventDefault(),e.stopPropagation(),tP.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let i=0,s=this.options_.techOrder;i[e,iu.getTech(e)]).filter(([e,t])=>t?t.isSupported():(q.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`),!1)),s=function(e,t,i){let s;return e.some(e=>t.some(t=>{if(s=i(e,t))return!0})),s},r=([e,t],i)=>{if(t.canPlaySource(i,this.options_[e.toLowerCase()]))return{source:i,tech:e}};return(t=this.options_.sourceOrder?s(e,i,(e,t)=>r(t,e)):s(i,e,r))||!1}handleSrc_(e,t){if(void 0===e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();let i=iC(e);if(!i.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),!function(e,t,i){e.setTimeout(()=>(function e(t={},i=[],s,r,n=[],a=!1){let[o,...l]=i;if("string"==typeof o)e(t,ic[o],s,r,n,a);else if(o){let i=function(e,t){let i=ip[e.id()],s=null;if(null==i)return s=t(e),ip[e.id()]=[[t,s]],s;for(let e=0;e{if(this.middleware_=s,t||(this.cache_.sources=i),this.updateSourceCaches_(e),this.src_(e))return i.length>1?this.handleSrc_(i.slice(1)):(this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),void this.triggerReady());!function(e,t){e.forEach(e=>e.setTech&&e.setTech(t))}(s,this.tech_)}),i.length>1){let e=()=>{this.error(null),this.handleSrc_(i.slice(1),!0)},t=()=>{this.off("error",e)};this.one("error",e),this.one("playing",t),this.resetRetryOnError_=()=>{this.off("error",e),this.off("playing",t)}}}src(e){return this.handleSrc_(e,!1)}src_(e){let t=this.selectSource([e]);return!t||(tx(t.tech,this.techName_)?this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1})),!1)}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){this.paused()?this.doReset_():tq(this.play().then(()=>this.doReset_()))}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),tp(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);let{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:s}=this.controlBar||{},{seekBar:r}=i||{};e&&e.updateContent(),t&&t.updateContent(),s&&s.updateContent(),r&&(r.update(),r.loadProgressBar&&r.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){let e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(void 0!==e){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){let t;if(void 0===e)return this.options_.autoplay||!1;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return void 0!==e&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){if(void 0!==e){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){let e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(void 0===e)return this.error_||null;if(R("beforeerror").forEach(t=>{let i=t(this,e);if(!(K(i)&&!Array.isArray(i)||"string"==typeof i||"number"==typeof i||null===i)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=i}),this.options_.suppressNotSupportedError&&e&&4===e.code){let t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),this.one("loadstart",function(){this.off(["click","touchstart"],t)});return}if(null===e){this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new tF(e),this.addClass("vjs-error"),q.error(`(CODE:${this.error_.code} ${tF.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),R("error").forEach(e=>e(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(e){e.stopPropagation(),e.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,i,s;let r=to(this,this.reportUserActivity),n=function(t){r(),this.clearInterval(e)};this.on("mousedown",function(){r(),this.clearInterval(e),e=this.setInterval(r,250)}),this.on("mousemove",function(e){(e.screenX!==t||e.screenY!==i)&&(t=e.screenX,i=e.screenY,r())}),this.on("mouseup",n),this.on("mouseleave",n);let a=this.getChild("controlBar");!a||ef||ei||(a.on("mouseenter",function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),a.on("mouseleave",function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r),this.setInterval(function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(s);let e=this.options_.inactivityTimeout;e<=0||(s=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},e))},250)}playbackRate(e){if(void 0!==e){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(void 0!==e){this.isAudio_=!!e;return}return!!this.isAudio_}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");let e=this.children(),t=this.getChild("ControlBar"),i=t&&t.currentHeight();e.forEach(e=>{e!==t&&e.el_&&!e.hasClass("vjs-hidden")&&(e.hide(),this.audioOnlyCache_.hiddenChildren.push(e))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(i),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if("boolean"!=typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){let e=[];return this.isInPictureInPicture()&&e.push(this.exitPictureInPicture()),this.isFullscreen()&&e.push(this.exitFullscreen()),this.audioPosterMode()&&e.push(this.audioPosterMode(!1)),Promise.all(e).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return"boolean"!=typeof e||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e)?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()})}addTextTrack(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),tp(this)&&this.trigger("languagechange"))}languages(){return Y(re.prototype.options_.languages,this.languages_)}toJSON(){let e=Y(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i{this.removeChild(i)}),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;let e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;ithis.addRemoteTextTrack(e,!1)),this.titleBar&&this.titleBar.update({title:h,description:n||s||""}),this.ready(t)}getMedia(){if(!this.cache_.media){let e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),e=>({kind:e.kind,label:e.label,language:e.language,src:e.src}))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:iS(t.poster)}]),t}return Y(this.cache_.media)}static getTagSettings(e){let t={sources:[],tracks:[]},i=eD(e),s=i["data-setup"];if(ex(e,"vjs-fill")&&(i.fill=!0),ex(e,"vjs-fluid")&&(i.fluid=!0),null!==s){let[e,t]=f()(s||"{}");e&&q.error(e),Object.assign(i,t)}if(Object.assign(t,i),e.hasChildNodes()){let i=e.childNodes;for(let e=0,s=i.length;e"number"==typeof e)&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}id.names.forEach(function(e){let t=id[e];re.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}}),re.prototype.crossorigin=re.prototype.crossOrigin,re.players={};let rt=d().navigator;re.prototype.options_={techOrder:iu.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:rt&&(rt.languages&&rt.languages[0]||rt.userLanguage||rt.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,enableSmoothSeeking:!1},s5.forEach(function(e){re.prototype[`handleTech${tw(e)}_`]=function(){return this.trigger(e)}}),tP.registerComponent("Player",re);let ri="plugin",rs="activePlugins_",rr={},rn=e=>rr.hasOwnProperty(e),ra=e=>rn(e)?rr[e]:void 0,ro=(e,t)=>{e[rs]=e[rs]||{},e[rs][t]=!0},rl=(e,t,i)=>{let s=(i?"before":"")+"pluginsetup";e.trigger(s,t),e.trigger(s+":"+t.name,t)},rh=function(e,t){let i=function(){rl(this,{name:e,plugin:t,instance:null},!0);let i=t.apply(this,arguments);return ro(this,e),rl(this,{name:e,plugin:t,instance:i}),i};return Object.keys(t).forEach(function(e){i[e]=t[e]}),i},rd=(e,t)=>(t.prototype.name=e,function(...i){rl(this,{name:e,plugin:t,instance:null},!0);let s=new t(...[this,...i]);return this[e]=()=>s,rl(this,s.getEventHash()),s});class ru{constructor(e){if(this.constructor===ru)throw Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),tS(this),delete this.trigger,tC(this,this.constructor.defaultState),ro(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return ts(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){let{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[rs][e]=!1,this.player=this.state=null,t[e]=rd(e,rr[e])}static isBasic(e){let t="string"==typeof e?ra(e):e;return"function"==typeof t&&!ru.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if("string"!=typeof e)throw Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(rn(e))q.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(re.prototype.hasOwnProperty(e))throw Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if("function"!=typeof t)throw Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return rr[e]=t,e!==ri&&(ru.isBasic(t)?re.prototype[e]=rh(e,t):re.prototype[e]=rd(e,t)),t}static deregisterPlugin(e){if(e===ri)throw Error("Cannot de-register base plugin.");rn(e)&&(delete rr[e],delete re.prototype[e])}static getPlugins(e=Object.keys(rr)){let t;return e.forEach(e=>{let i=ra(e);i&&((t=t||{})[e]=i)}),t}static getPluginVersion(e){let t=ra(e);return t&&t.VERSION||""}}function rc(e,t,i,s){var r;let n;return r=`${t} is deprecated and will be removed in ${e}.0; please use ${i} instead.`,n=!1,function(...e){return n||q.warn(r),n=!0,s.apply(this,e)}}ru.getPlugin=ra,ru.BASE_PLUGIN_NAME=ri,ru.registerPlugin(ri,ru),re.prototype.usingPlugin=function(e){return!!this[rs]&&!0===this[rs][e]},re.prototype.hasPlugin=function(e){return!!rn(e)};let rp=e=>0===e.indexOf("#")?e.slice(1):e;function rm(e,t,i){let s=rm.getPlayer(e);if(s)return t&&q.warn(`Player "${e}" is already initialised. Options will not be applied.`),i&&s.ready(i),s;let r="string"==typeof e?eG("#"+rp(e)):e;if(!eb(r))throw TypeError("The element or ID supplied is not valid. (videojs)");let n="getRootNode"in r&&r.getRootNode() instanceof d().ShadowRoot?r.getRootNode():r.ownerDocument.body;return r.ownerDocument.defaultView&&n.contains(r)||q.warn("The element supplied is not included in the DOM"),!0===(t=t||{}).restoreEl&&(t.restoreEl=(r.parentNode&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),R("beforesetup").forEach(e=>{let i=e(r,Y(t));if(!K(i)||Array.isArray(i)){q.error("please return an object in beforesetup hooks");return}t=Y(t,i)}),s=new(tP.getComponent("Player"))(r,t,i),R("setup").forEach(e=>e(s)),s}if(rm.hooks_=M,rm.hooks=R,rm.hook=function(e,t){R(e,t)},rm.hookOnce=function(e,t){R(e,[].concat(t).map(t=>{let i=(...s)=>(U(e,i),t(...s));return i}))},rm.removeHook=U,!0!==d().VIDEOJS_NO_DYNAMIC_STYLE&&eT()){let e=eG(".vjs-styles-defaults");if(!e){e=e2("vjs-styles-defaults");let t=eG("head");t&&t.insertBefore(e,t.firstChild),e4(e,` + .video-js { + width: 300px; + height: 150px; + } + + .vjs-fluid:not(.vjs-audio-only-mode) { + padding-top: 56.25% + } + `)}}e0(1,rm),rm.VERSION=O,rm.options=re.prototype.options_,rm.getPlayers=()=>re.players,rm.getPlayer=e=>{let t;let i=re.players;if("string"==typeof e){let s=rp(e),r=i[s];if(r)return r;t=eG("#"+s)}else t=e;if(eb(t)){let{player:e,playerId:s}=t;if(e||i[s])return e||i[s]}},rm.getAllPlayers=()=>Object.keys(re.players).map(e=>re.players[e]).filter(Boolean),rm.players=re.players,rm.getComponent=tP.getComponent,rm.registerComponent=(e,t)=>(iu.isTech(t)&&q.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),tP.registerComponent.call(tP,e,t)),rm.getTech=iu.getTech,rm.registerTech=iu.registerTech,rm.use=function(e,t){ic[e]=ic[e]||[],ic[e].push(t)},Object.defineProperty(rm,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(rm.middleware,"TERMINATOR",{value:im,writeable:!1,enumerable:!0}),rm.browser=ey,rm.obj=Z,rm.mergeOptions=rc(9,"videojs.mergeOptions","videojs.obj.merge",Y),rm.defineLazyProperty=rc(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",J),rm.bind=rc(9,"videojs.bind","native Function.prototype.bind",to),rm.registerPlugin=ru.registerPlugin,rm.deregisterPlugin=ru.deregisterPlugin,rm.plugin=(e,t)=>(q.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),ru.registerPlugin(e,t)),rm.getPlugins=ru.getPlugins,rm.getPlugin=ru.getPlugin,rm.getPluginVersion=ru.getPluginVersion,rm.addLanguage=function(e,t){return e=(""+e).toLowerCase(),rm.options.languages=Y(rm.options.languages,{[e]:t}),rm.options.languages[e]},rm.log=q,rm.createLogger=H,rm.time=tN,rm.createTimeRange=rc(9,"videojs.createTimeRange","videojs.time.createTimeRanges",tD),rm.createTimeRanges=rc(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",tD),rm.formatTime=rc(9,"videojs.formatTime","videojs.time.formatTime",tB),rm.setFormatTime=rc(9,"videojs.setFormatTime","videojs.time.setFormatTime",tR),rm.resetFormatTime=rc(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",tU),rm.parseUrl=rc(9,"videojs.parseUrl","videojs.url.parseUrl",t3),rm.isCrossOrigin=rc(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",t9),rm.EventTarget=tu,rm.any=tn,rm.on=tt,rm.one=tr,rm.off=ti,rm.trigger=ts,rm.xhr=y(),rm.TextTrack=is,rm.AudioTrack=ir,rm.VideoTrack=ia,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(e=>{rm[e]=function(){return q.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`),eX[e].apply(null,arguments)}}),rm.computedStyle=rc(9,"videojs.computedStyle","videojs.dom.computedStyle",eQ),rm.dom=eX,rm.fn=td,rm.num=iQ,rm.str=tI,rm.url=ie;/*! @name videojs-contrib-quality-levels @version 4.0.0 @license Apache-2.0 */class rg{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get:()=>t.enabled_(),set(e){t.enabled_(e)}}),t}}class rf extends rm.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get:()=>e.selectedIndex_}),Object.defineProperty(e,"length",{get:()=>e.levels_.length}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;let i=this.levels_.length;return t=new rg(e),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let i=0,s=this.length;ii&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,i=this.length;ts,e.qualityLevels.VERSION=r_,s},rv=function(e){return ry(this,rm.obj.merge({},e))};rm.registerPlugin("qualityLevels",rv),rv.VERSION=r_;/*! @name @videojs/http-streaming @version 3.10.0 @license Apache-2.0 */let rT=S.Z,rb=(e,t)=>t&&t.responseURL&&e!==t.responseURL?t.responseURL:e,rS=e=>rm.log.debug?rm.log.debug.bind(rm,"VHS:",`${e} >`):function(){};function rk(...e){let t=rm.obj||rm;return(t.merge||t.mergeOptions).apply(t,e)}function rC(...e){let t=rm.time||rm;return(t.createTimeRanges||t.createTimeRanges).apply(t,e)}let rE=1/30,rw=1/30*3,rx=function(e,t){let i;let s=[];if(e&&e.length)for(i=0;i=t})},rP=function(e,t){return rx(e,function(e){return e-rE>=t})},rL=function(e){if(e.length<2)return rC();let t=[];for(let i=1;i{let t=[];if(!e||!e.length)return"";for(let i=0;i "+e.end(i));return t.join(", ")},rO=e=>{let t=[];for(let i=0;in)){if(t>r&&t<=n){i+=n-t;continue}i+=n-r}}return i},rB=(e,t)=>{if(!t.preload)return t.duration;let i=0;return(t.parts||[]).forEach(function(e){i+=e.duration}),(t.preloadHints||[]).forEach(function(t){"PART"===t.type&&(i+=e.partTargetDuration)}),i},rN=e=>(e.segments||[]).reduce((e,t,i)=>(t.parts?t.parts.forEach(function(s,r){e.push({duration:s.duration,segmentIndex:i,partIndex:r,part:s,segment:t})}):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e),[]),rj=e=>{let t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},rF=({preloadSegment:e})=>{if(!e)return;let{parts:t,preloadHints:i}=e;return(i||[]).reduce((e,t)=>e+("PART"===t.type?1:0),0)+(t&&t.length?t.length:0)},r$=(e,t)=>{if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;let i=rj(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},rq=function(e,t){let i=0,s=t-e.mediaSequence,r=e.segments[s];if(r){if(void 0!==r.start)return{result:r.start,precise:!0};if(void 0!==r.end)return{result:r.end-r.duration,precise:!0}}for(;s--;){if(void 0!==(r=e.segments[s]).end)return{result:i+r.end,precise:!0};if(i+=rB(e,r),void 0!==r.start)return{result:i+r.start,precise:!0}}return{result:i,precise:!1}},rH=function(e,t){let i,s=0,r=t-e.mediaSequence;for(;rs&&([i,s]=[s,i]),i<0){for(let t=i;tDate.now()},rQ=function(e){return e.excludeUntil&&e.excludeUntil===1/0},rY=function(e){let t=rK(e);return!e.disabled&&!t},rX=function(e,t){return t.attributes&&t.attributes[e]},rJ=(e,t)=>{if(1===e.playlists.length)return!0;let i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter(e=>!!rY(e)&&(e.attributes.BANDWIDTH||0)(!!e||!!t)&&(!!e||!t)&&(!e||!!t)&&(e===t||!!e.id&&!!t.id&&e.id===t.id||!!e.resolvedUri&&!!t.resolvedUri&&e.resolvedUri===t.resolvedUri||!!e.uri&&!!t.uri&&e.uri===t.uri),r0=function(e,t){let i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{},s=!1;for(let e in i){for(let r in i[e])if(s=t(i[e][r]))break;if(s)break}return!!s},r1=e=>{if(!e||!e.playlists||!e.playlists.length)return r0(e,e=>e.playlists&&e.playlists.length||e.uri);for(let t=0;t(0,C.KL)(e))||r0(e,e=>rZ(i,e))))return!1}return!0};var r2={liveEdgeDelay:r$,duration:rz,seekable:function(e,t,i){let s=t||0,r=rG(e,t,!0,i);return null===r?rC():(r0)for(let t=l-1;t>=0;t--){let i=o[t];if(a+=i.duration,n){if(a<0)continue}else if(a+rE<=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:r-rW({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t}}if(l<0){for(let i=l;i<0;i++)if((a-=e.targetDuration)<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t};l=0}for(let t=l;trE,h=0===a,d=s&&a+rE>=0;if(!h&&!d||t===o.length-1){if(n){if(a>0)continue}else if(a-rE>=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:r+rW({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:t}},isEnabled:rY,isDisabled:function(e){return e.disabled},isExcluded:rK,isIncompatible:rQ,playlistEnd:rG,isAes:function(e){for(let t=0;t`${e}-${t}`,r5=(e,t,i)=>`placeholder-uri-${e}-${t}-${i}`,r3=({onwarn:e,oninfo:t,manifestString:i,customTagParsers:s=[],customTagMappers:r=[],llhls:n})=>{let a=new k._b;e&&a.on("warn",e),t&&a.on("info",t),s.forEach(e=>a.addParser(e)),r.forEach(e=>a.addTagMapper(e)),a.push(i),a.end();let o=a.manifest;if(!n&&(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(e){o.hasOwnProperty(e)&&delete o[e]}),o.segments&&o.segments.forEach(function(e){["parts","preloadHints"].forEach(function(t){e.hasOwnProperty(t)&&delete e[t]})})),!o.targetDuration){let t=10;o.segments&&o.segments.length&&(t=o.segments.reduce((e,t)=>Math.max(e,t.duration),0)),e&&e({message:`manifest has no targetDuration defaulting to ${t}`}),o.targetDuration=t}let l=rj(o);if(l.length&&!o.partTargetDuration){let t=l.reduce((e,t)=>Math.max(e,t.duration),0);e&&(e({message:`manifest has no partTargetDuration defaulting to ${t}`}),r4.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),o.partTargetDuration=t}return o},r6=(e,t)=>{e.mediaGroups&&["AUDIO","SUBTITLES"].forEach(i=>{if(e.mediaGroups[i])for(let s in e.mediaGroups[i])for(let r in e.mediaGroups[i][s])t(e.mediaGroups[i][s][r],i,s,r)})},r7=({playlist:e,uri:t,id:i})=>{e.id=i,e.playlistErrors_=0,t&&(e.uri=t),e.attributes=e.attributes||{}},r9=e=>{let t=e.playlists.length;for(;t--;){let i=e.playlists[t];r7({playlist:i,id:r8(t,i.uri)}),i.resolvedUri=rT(e.uri,i.uri),e.playlists[i.id]=i,e.playlists[i.uri]=i,i.attributes.BANDWIDTH||r4.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},ne=e=>{r6(e,t=>{t.uri&&(t.resolvedUri=rT(e.uri,t.uri))})},nt=(e,t)=>{let i=r8(0,t),s={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:d().location.href,resolvedUri:d().location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};return s.playlists[i]=s.playlists[0],s.playlists[t]=s.playlists[0],s},ni=(e,t,i=r5)=>{e.uri=t;for(let t=0;t{if(!t.playlists||!t.playlists.length){if(s&&"AUDIO"===r&&!t.uri)for(let t=0;t(e.set(t.id,t),e),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(null===this.offset_)return[];let e={},t=[];for(let i of(this.pendingDateRanges_.forEach((i,s)=>{if(!this.processedDateRanges_.has(s)&&(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),t.push(i),i.class)){if(e[i.class]){let t=e[i.class].push(i);i.classListIndex=t-1}else e[i.class]=[i],i.classListIndex=0}}),t)){let t=e[i.class]||[];i.endDate?i.endTime=i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&t[i.classListIndex+1]?i.endTime=t[i.classListIndex+1].startTime:i.duration?i.endTime=i.startTime+i.duration:i.plannedDuration?i.endTime=i.startTime+i.plannedDuration:i.endTime=i.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((t,i)=>{t.startDate.getTime(){if(t.endList||!t.serverControl)return e;let i={};if(t.serverControl.canBlockReload){let{preloadSegment:e}=t,s=t.mediaSequence+t.segments.length;if(e){let r=e.parts||[],n=rF(t)-1;n>-1&&n!==r.length-1&&(i._HLS_part=n),(n>-1||r.length)&&s--}i._HLS_msn=s}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){let t=new(d()).URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(e){i.hasOwnProperty(e)&&t.searchParams.set(e,i[e])}),e=t.toString()}return e},na=(e,t)=>{if(!e)return t;let i=rk(e,t);if(e.preloadHints&&!t.preloadHints&&delete i.preloadHints,e.parts&&!t.parts)delete i.parts;else if(e.parts&&t.parts)for(let s=0;s{let s;let r=e.slice(),n=t.slice();i=i||0;let a=[];for(let e=0;e{!e.resolvedUri&&e.uri&&(e.resolvedUri=rT(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=rT(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=rT(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=rT(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach(e=>{e.resolvedUri||(e.resolvedUri=rT(t,e.uri))}),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach(e=>{e.resolvedUri||(e.resolvedUri=rT(t,e.uri))})},nh=function(e){let t=e.segments||[],i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints){for(let e=0;ee===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment,nu=(e,t,i=nd)=>{let s=rk(e,{}),r=s.playlists[t.id];if(!r||i(r,t))return null;t.segments=nh(t);let n=rk(r,t);if(n.preloadSegment&&!t.preloadSegment&&delete n.preloadSegment,r.segments){if(t.skip){t.segments=t.segments||[];for(let e=0;e{nl(e,n.resolvedUri)});for(let e=0;e{if(e.playlists)for(let i=0;i{let i=e.segments||[],s=i[i.length-1],r=s&&s.parts&&s.parts[s.parts.length-1],n=r&&r.duration||s&&s.duration;return t&&n?1e3*n:500*(e.partTargetDuration||e.targetDuration||10)};class np extends nr{constructor(e,t,i={}){if(super(),!e)throw Error("A non-empty playlist URL or object is required");this.logger_=rS("PlaylistLoader");let{withCredentials:s=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=s,this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;let r=t.options_;this.customTagParsers=r&&r.customTagParsers||[],this.customTagMappers=r&&r.customTagMappers||[],this.llhls=r&&r.llhls,this.dateRangesStorage_=new ns,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){let e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);let t=this.dateRangesStorage_.getDateRangesToProcess();t.length&&this.addDateRangesToTextTrack_&&this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if("HAVE_METADATA"!==this.state)return;let e=this.media(),t=rT(this.main.uri,e.uri);this.llhls&&(t=nn(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials},(e,t)=>{if(this.request){if(e)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}playlistRequestError(e,t,i){let{uri:s,id:r}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[r],status:e.status,message:`HLS playlist request error at URL: ${s}.`,responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")}parseManifest_({url:e,manifestString:t}){return r3({onwarn:({message:t})=>this.logger_(`m3u8-parser warn for ${e}: ${t}`),oninfo:({message:t})=>this.logger_(`m3u8-parser info for ${e}: ${t}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}haveMetadata({playlistString:e,playlistObject:t,url:i,id:s}){this.request=null,this.state="HAVE_METADATA";let r=t||this.parseManifest_({url:i,manifestString:e});r.lastRequest=Date.now(),r7({playlist:r,uri:i,id:s});let n=nu(this.main,r);this.targetDuration=r.partTargetDuration||r.targetDuration,this.pendingMedia_=null,n?(this.main=n,this.media_=this.main.playlists[s]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(nc(this.media(),!!n)),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),d().clearTimeout(this.mediaUpdateTimeout),d().clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new ns,this.off()}stopRequest(){if(this.request){let e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.main.playlists[e])throw Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(d().clearTimeout(this.finalRenditionTimeout),t){let t=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=d().setTimeout(this.media.bind(this,e,!1),t);return}let i=this.state,s=!this.media_||e.id!==this.media_.id,r=this.main.playlists[e.id];if(r&&r.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,s&&(this.trigger("mediachanging"),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(nc(e,!0)),s){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},(t,s)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=rb(e.resolvedUri,s),t)return this.playlistRequestError(this.request,e,i);this.haveMetadata({playlistString:s.responseText,url:e.uri,id:e.id}),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}}pause(){this.mediaUpdateTimeout&&(d().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(d().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);let t=this.media();if(e){let e=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=d().setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},e);return}if(!this.started){this.start();return}t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(d().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=d().setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,"object"==typeof this.src){this.src.uri||(this.src.uri=d().location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},(e,t)=>{if(!this.request)return;if(this.request=null,e)return this.error={status:t.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:t.responseText,code:2},"HAVE_NOTHING"===this.state&&(this.started=!1),this.trigger("error");this.src=rb(this.src,t);let i=this.parseManifest_({manifestString:t.responseText,url:this.src});this.setupInitialPlaylist(i)})}srcUri(){return"string"==typeof this.src?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,ni(this.main,this.srcUri()),e.playlists.forEach(e=>{e.segments=nh(e),e.segments.forEach(t=>{nl(t,e.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}let t=this.srcUri()||d().location.href;this.main=nt(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){let i=this.main,s=e.ID,r=i.playlists.length;for(;r--;){let n=i.playlists[r];if(n.attributes["PATHWAY-ID"]===s){let a=n.resolvedUri,o=n.id;if(t){let t=this.createCloneURI_(n.resolvedUri,e),a=r8(s,t),o=this.createCloneAttributes_(s,n.attributes),l=this.createClonePlaylist_(n,a,e,o);i.playlists[r]=l,i.playlists[a]=l,i.playlists[t]=l}else i.playlists.splice(r,1);delete i.playlists[o],delete i.playlists[a]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){let i=this.main,s=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{if(i.mediaGroups[e]&&i.mediaGroups[e][s]){for(let t in i.mediaGroups[e])if(t===s){for(let s in i.mediaGroups[e][t])i.mediaGroups[e][t][s].playlists.forEach((e,t)=>{let s=i.playlists[e.id],r=s.id,n=s.resolvedUri;delete i.playlists[r],delete i.playlists[n]});delete i.mediaGroups[e][t]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){let i=this.main,s=i.playlists.length,r=this.createCloneURI_(t.resolvedUri,e),n=r8(e.ID,r),a=this.createCloneAttributes_(e.ID,t.attributes),o=this.createClonePlaylist_(t,n,e,a);i.playlists[s]=o,i.playlists[n]=o,i.playlists[r]=o,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){let t=e.ID,i=e["BASE-ID"],s=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{if(s.mediaGroups[r]&&!s.mediaGroups[r][t]){for(let n in s.mediaGroups[r])if(n===i)for(let i in s.mediaGroups[r][t]={},s.mediaGroups[r][n]){let a=s.mediaGroups[r][n][i];s.mediaGroups[r][t][i]=(0,b.Z)({},a);let o=s.mediaGroups[r][t][i],l=this.createCloneURI_(a.resolvedUri,e);o.resolvedUri=l,o.uri=l,o.playlists=[],a.playlists.forEach((n,a)=>{let l=s.playlists[n.id],h=r5(r,t,i),d=r8(t,h);if(l&&!s.playlists[d]){let t=this.createClonePlaylist_(l,d,e),i=t.resolvedUri;s.playlists[d]=t,s.playlists[i]=t}o.playlists[a]=this.createClonePlaylist_(n,d,e)})}}})}createClonePlaylist_(e,t,i,s){let r=this.createCloneURI_(e.resolvedUri,i),n={resolvedUri:r,uri:r,id:t};return e.segments&&(n.segments=[]),s&&(n.attributes=s),rk(e,n)}createCloneURI_(e,t){let i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;let s=t["URI-REPLACEMENT"].PARAMS;for(let e of Object.keys(s))i.searchParams.set(e,s[e]);return i.href}createCloneAttributes_(e,t){let i={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(s=>{t[s]&&(i[s]=e)}),i}getKeyIdSet(e){if(e.contentProtection){let t=new Set;for(let i in e.contentProtection){let s=e.contentProtection[i].attributes.keyId;s&&t.add(s.toLowerCase())}return t}}}let{xhr:nm}=rm,ng=function(e,t,i,s){let r="arraybuffer"===e.responseType?e.response:e.responseText;t||!r||(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=r.byteLength||r.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8e3))),i.headers&&(e.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode||(t=Error("XHR Failed with a response of: "+(e&&(r||e.responseText)))),s(t,e)},nf=(e,t)=>{if(!e||!e.size)return;let i=t;return e.forEach(e=>{i=e(i)}),i},n_=(e,t,i,s)=>{e&&e.size&&e.forEach(e=>{e(t,i,s)})},ny=function(){let e=function e(t,i){t=rk({timeout:45e3},t);let s=e.beforeRequest||rm.Vhs.xhr.beforeRequest,r=e._requestCallbackSet||rm.Vhs.xhr._requestCallbackSet||new Set,n=e._responseCallbackSet||rm.Vhs.xhr._responseCallbackSet;s&&"function"==typeof s&&(rm.log.warn("beforeRequest is deprecated, use onRequest instead."),r.add(s));let a=!0===rm.Vhs.xhr.original?nm:rm.Vhs.xhr,o=nf(r,t);r.delete(s);let l=a(o||t,function(e,t){return n_(n,l,e,t),ng(l,e,t,i)}),h=l.abort;return l.abort=function(){return l.aborted=!0,h.apply(l,arguments)},l.uri=t.uri,l.requestTime=Date.now(),l};return e.original=!0,e},nv=function(e){var t;let i={};return e.byterange&&(i.Range="bytes="+(t=e.byterange).offset+"-"+("bigint"==typeof t.offset||"bigint"==typeof t.length?d().BigInt(t.offset)+d().BigInt(t.length)-d().BigInt(1):t.offset+t.length-1)),i},nT=function(e,t){let i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},nb=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},nS=function(e){let t={};return Object.keys(e).forEach(i=>{let s=e[i];(0,w.Au)(s)?t[i]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}:t[i]=s}),t},nk=function(e){let t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},nC=function(e){return e.resolvedUri},nE=e=>{let t=Array.prototype.slice.call(e),i="";for(let e=0;enE(e),textRanges:e=>{let t,i="";for(t=0;t{if(!t.dateTimeObject)return null;let i=t.videoTimingInfo.transmuxerPrependedSeconds,s=t.videoTimingInfo.transmuxedPresentationStart;return new Date(t.dateTimeObject.getTime()+1e3*(e-(s+i)))},nI=e=>e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds,nP=(e,t)=>{let i;try{i=new Date(e)}catch(e){return null}if(!t||!t.segments||0===t.segments.length)return null;let s=t.segments[0];if(inew Date(n.getTime()+1e3*a)?null:(i>new Date(n)&&(s=r),{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:r2.duration(t,t.mediaSequence+t.segments.indexOf(s)),type:s.videoTimingInfo?"accurate":"estimate"})},nL=(e,t)=>{let i;if(!t||!t.segments||0===t.segments.length)return null;let s=0;for(let r=0;rs){if(e>s+.25*r.duration)return null;i=r}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:s-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}},nA=(e,t)=>{let i,s;try{i=new Date(e),s=new Date(t)}catch(e){}let r=i.getTime();return(s.getTime()-r)/1e3},nD=e=>{if(!e.segments||0===e.segments.length)return!1;for(let t=0;t{if(!i)throw Error("getProgramTime: callback must be provided");if(!e||void 0===t)return i({message:"getProgramTime: playlist and time must be provided"});let s=nL(t,e);if(!s)return i({message:"valid programTime was not found"});if("estimate"===s.type)return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:s.estimatedStart});let r={mediaSeconds:t},n=nx(t,s.segment);return n&&(r.programDateTime=n.toISOString()),i(null,r)},nM=({programTime:e,playlist:t,retryCount:i=2,seekTo:s,pauseAfterSeek:r=!0,tech:n,callback:a})=>{if(!a)throw Error("seekToProgramTime: callback must be provided");if(void 0===e||!t||!s)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!t.endList&&!n.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!nD(t))return a({message:"programDateTime tags must be provided in the manifest "+t.resolvedUri});let o=nP(e,t);if(!o)return a({message:`${e} was not found in the stream`});let l=o.segment,h=nA(l.dateTimeObject,e);if("estimate"===o.type)return 0===i?a({message:`${e} is not buffered yet. Try again`}):(s(o.estimatedStart+h),void n.one("seeked",()=>{nM({programTime:e,playlist:t,retryCount:i-1,seekTo:s,pauseAfterSeek:r,tech:n,callback:a})}));let d=l.start+h;n.one("seeked",()=>a(null,n.currentTime())),r&&n.pause(),s(d)},nR=(e,t)=>{if(4===e.readyState)return t()},nU=(e,t,i)=>{let s,r=[],n=!1,a=function(e,t,s,r){return t.abort(),n=!0,i(e,t,s,r)},o=function(e,t){if(n)return;if(e)return a(e,t,"",r);let i=t.responseText.substring(r&&r.byteLength||0,t.responseText.length);if(r=(0,w.lx)(r,(0,w.qX)(i,!0)),s=s||(0,L.c)(r),r.length<10||s&&r.lengtha(e,t,"",r));let o=(0,A.Xm)(r);return"ts"===o&&r.length<188||!o&&r.length<376?nR(t,()=>a(e,t,"",r)):a(null,t,o,r)},l=t({uri:e,beforeSend(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",function({total:t,loaded:i}){return ng(e,null,{statusCode:e.status},o)})}},function(e,t){return ng(l,e,t,o)});return l},{EventTarget:nB}=rm,nN=function(e,t){if(!nd(e,t)||e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length)||!e.sidx&&t.sidx||e.sidx&&!t.sidx||e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(let i=0;i{let r=s.attributes.NAME||i;return`placeholder-uri-${e}-${t}-${r}`},nF=({mainXml:e,srcUrl:t,clientOffset:i,sidxMapping:s,previousManifest:r})=>{let n=(0,x.Qc)(e,{manifestUri:t,clientOffset:i,sidxMapping:s,previousManifest:r});return ni(n,t,nj),n},n$=(e,t)=>{r6(e,(i,s,r,n)=>{n in t.mediaGroups[s][r]||delete e.mediaGroups[s][r][n]})},nq=(e,t,i)=>{let s=!0,r=rk(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let e=0;e{if(e.playlists&&e.playlists.length){let a=e.playlists[0].id,o=nu(r,e.playlists[0],nN);o&&(n in(r=o).mediaGroups[t][i]||(r.mediaGroups[t][i][n]=e),r.mediaGroups[t][i][n].playlists[0]=r.playlists[a],s=!1)}}),n$(r,t),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(s=!1),s)?null:r},nH=(e,t)=>(!!(!e.map&&!t.map)||!!(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length))&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length,nV=(e,t)=>{let i={};for(let s in e){let r=e[s].sidx;if(r){let e=(0,x.mm)(r);if(!t[e])break;nH(t[e].sidxInfo,r)&&(i[e]=t[e])}}return i},nz=(e,t)=>{let i=nV(e.playlists,t);return r6(e,(e,s,r,n)=>{if(e.playlists&&e.playlists.length){let s=e.playlists;i=rk(i,nV(s,t))}}),i};class nW extends nB{constructor(e,t,i={},s){super(),this.mainPlaylistLoader_=s||this,s||(this.isMain_=!0);let{withCredentials:r=!1}=i;if(this.vhs_=t,this.withCredentials=r,this.addMetadataToTextTrack=i.addMetadataToTextTrack,!e)throw Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=rS("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,i){return!this.request||((this.request=null,e)?(this.error="object"!=typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2}:e,i&&(this.state=i),this.trigger("error"),!0):void 0)}addSidxSegments_(e,t,i){let s=e.sidx&&(0,x.mm)(e.sidx);if(!e.sidx||!s||this.mainPlaylistLoader_.sidxMapping_[s]){this.mediaRequest_=d().setTimeout(()=>i(!1),0);return}let r=rb(e.sidx.resolvedUri),n=(r,n)=>{let a;if(this.requestErrored_(r,n,t))return;let o=this.mainPlaylistLoader_.sidxMapping_;try{a=P()((0,w.Ki)(n.response).subarray(8))}catch(e){this.requestErrored_(e,n,t);return}return o[s]={sidxInfo:e.sidx,sidx:a},(0,x.jp)(e,a,e.sidx.resolvedUri),i(!0)};this.request=nU(r,this.vhs_.xhr,(t,i,s,a)=>{if(t)return n(t,i);if(!s||"mp4"!==s)return n({status:i.status,message:`Unsupported ${s||"unknown"} container type for sidx segment at URL: ${r}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},i);let{offset:o,length:l}=e.sidx.byterange;if(a.length>=l+o)return n(t,{response:a.subarray(o,o+l),status:i.status,uri:i.uri});this.request=this.vhs_.xhr({uri:r,responseType:"arraybuffer",headers:nv({byterange:e.sidx.byterange})},n)})}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},d().clearTimeout(this.minimumUpdatePeriodTimeout_),d().clearTimeout(this.mediaRequest_),d().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){let e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw Error("Cannot switch media playlist from "+this.state);let t=this.state;if("string"==typeof e){if(!this.mainPlaylistLoader_.main.playlists[e])throw Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}let i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,i&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,i=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),"HAVE_MAIN_MANIFEST"===e?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),d().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(d().clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)}load(e){d().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;let t=this.media();if(e){let e=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=d().setTimeout(()=>this.load(),e);return}if(!this.started){this.start();return}t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){this.mediaRequest_=d().setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_(),this.hasPendingRequest()||this.media_||this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},(t,i)=>{if(this.requestErrored_(t,i)){"HAVE_NOTHING"===this.state&&(this.started=!1);return}let s=i.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=i.responseText,i.responseHeaders&&i.responseHeaders.date?this.mainLoaded_=Date.parse(i.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=rb(this.mainPlaylistLoader_.srcUrl,i),s){this.handleMain_(),this.syncClientServerClock_(()=>e(i,s));return}return e(i,s)})}syncClientServerClock_(e){let t=(0,x.LG)(this.mainPlaylistLoader_.mainXml_);return null===t?(this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()):"DIRECT"===t.method?(this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:rT(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials},(i,s)=>{let r;if(this.request){if(i)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();r="HEAD"===t.method?s.responseHeaders&&s.responseHeaders.date?Date.parse(s.responseHeaders.date):this.mainLoaded_:Date.parse(s.responseText),this.mainPlaylistLoader_.clientOffset_=r-Date.now(),e()}}))}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;let e=this.mainPlaylistLoader_.main,t=nF({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(t=nq(e,t,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=t||e;let i=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];return i&&i!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=i),(!e||t&&t.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(t),!!t}updateMinimumUpdatePeriodTimeout_(){let e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(d().clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;if(0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!=typeof t||t<=0){t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`);return}this.createMUPTimeout_(t)}createMUPTimeout_(e){let t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=d().setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=nz(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,e=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();let t=this.mainPlaylistLoader_.main.playlists,i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){let e=()=>{this.media().endList||(this.mediaUpdateTimeout=d().setTimeout(()=>{this.trigger("mediaupdatetimeout"),e()},nc(this.media(),!!i)))};e()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){let e=this.mainPlaylistLoader_.main.eventStream.map(e=>({cueTime:e.start,frames:[{data:e.messageData}]}));this.addMetadataToTextTrack("EventStream",e,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){let t=new Set;for(let i in e.contentProtection){let s=e.contentProtection[i].attributes["cenc:default_KID"];s&&t.add(s.replace(/-/g,"").toLowerCase())}return t}}}var nG={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};let nK=e=>{let t=new Uint8Array(new ArrayBuffer(e.length));for(let i=0;i-1)},this.trigger=function(t){var i,s,r,n;if(i=e[t]){if(2==arguments.length)for(s=0,r=i.length;s>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},h=function(){return a(I.ftyp,P,L,P,A)},b=function(e){return a(I.hdlr,D[e])},d=function(e){return a(I.mdat,e)},T=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=255&e.samplerate),a(I.mdhd,t)},v=function(e){return a(I.mdia,T(e),b(e.type),c(e))},u=function(e){return a(I.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},c=function(e){return a(I.minf,"video"===e.type?a(I.vmhd,O):a(I.smhd,M),o(),k(e))},p=function(e,t){for(var i=[],s=t.length;s--;)i[s]=E(t[s]);return a.apply(null,[I.moof,u(e)].concat(i))},m=function(e){for(var t=e.length,i=[];t--;)i[t]=_(e[t]);return a.apply(null,[I.moov,f(4294967295)].concat(i).concat(g(e)))},g=function(e){for(var t=e.length,i=[];t--;)i[t]=w(e[t]);return a.apply(null,[I.mvex].concat(i))},f=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return a(I.mvhd,t)},S=function(e){var t,i,s=e.samples||[],r=new Uint8Array(4+s.length);for(i=0;i>>8),n.push(255&s[t].byteLength),n=n.concat(Array.prototype.slice.call(s[t]));for(t=0;t>>8),o.push(255&r[t].byteLength),o=o.concat(Array.prototype.slice.call(r[t]));if(i=[I.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a(I.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([s.length],n,[r.length],o))),a(I.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var l=e.sarRatio[0],h=e.sarRatio[1];i.push(a(I.pasp,new Uint8Array([(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l,(4278190080&h)>>24,(16711680&h)>>16,(65280&h)>>8,255&h])))}return a.apply(null,i)},t=function(e){return a(I.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),l(e))},y=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return a(I.tkhd,t)},E=function(e){var t,i,s,r,n,o;return(t=a(I.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),n=Math.floor(e.baseMediaDecodeTime/4294967296),o=Math.floor(e.baseMediaDecodeTime%4294967296),i=a(I.tfdt,new Uint8Array([1,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),"audio"===e.type)?(s=x(e,92),a(I.traf,t,i,s)):(r=S(e),s=x(e,r.length+92),a(I.traf,t,i,s,r))},_=function(e){return e.duration=e.duration||4294967295,a(I.trak,y(e),v(e))},w=function(e){var t=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(t[t.length-1]=0),a(I.trex,t)},n=function(e,t){var i=0,s=0,r=0,n=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(s=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(n=8)),[0,0,i|s|r|n,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},r=function(e,t){var i,s,r,o,l,h;for(t+=20+16*(o=e.samples||[]).length,(s=new Uint8Array((r=n(o,t)).length+16*o.length)).set(r),i=r.length,h=0;h>>24,s[i++]=(16711680&l.duration)>>>16,s[i++]=(65280&l.duration)>>>8,s[i++]=255&l.duration,s[i++]=(4278190080&l.size)>>>24,s[i++]=(16711680&l.size)>>>16,s[i++]=(65280&l.size)>>>8,s[i++]=255&l.size,s[i++]=l.flags.isLeading<<2|l.flags.dependsOn,s[i++]=l.flags.isDependedOn<<6|l.flags.hasRedundancy<<4|l.flags.paddingValue<<1|l.flags.isNonSyncSample,s[i++]=61440&l.flags.degradationPriority,s[i++]=15&l.flags.degradationPriority,s[i++]=(4278190080&l.compositionTimeOffset)>>>24,s[i++]=(16711680&l.compositionTimeOffset)>>>16,s[i++]=(65280&l.compositionTimeOffset)>>>8,s[i++]=255&l.compositionTimeOffset;return a(I.trun,s)},s=function(e,t){var i,s,r,o,l,h;for(t+=20+8*(o=e.samples||[]).length,(i=new Uint8Array((r=n(o,t)).length+8*o.length)).set(r),s=r.length,h=0;h>>24,i[s++]=(16711680&l.duration)>>>16,i[s++]=(65280&l.duration)>>>8,i[s++]=255&l.duration,i[s++]=(4278190080&l.size)>>>24,i[s++]=(16711680&l.size)>>>16,i[s++]=(65280&l.size)>>>8,i[s++]=255&l.size;return a(I.trun,i)},x=function(e,t){return"audio"===e.type?s(e,t):r(e,t)};var em=function(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},eg=[33,16,5,32,164,27],ef=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],e_=function(e){for(var t=[];e--;)t.push(0);return t};$=function(e){return 9e4*e},q=function(e,t){return e*t},H=function(e){return e/9e4},V=function(e,t){return e/t},z=function(e,t){return $(V(e,t))},W=function(e,t){return q(H(e),t)},G=function(e,t,i){return H(i?e:e-t)};var ey={ONE_SECOND_IN_TS:9e4,secondsToVideoTs:$,videoTsToSeconds:H,audioTsToVideoTs:z,videoTsToAudioTs:W,metadataTsToSeconds:G},ev=function(){if(!F){var e;F=Object.keys(e={96e3:[eg,[227,64],e_(154),[56]],88200:[eg,[231],e_(170),[56]],64e3:[eg,[248,192],e_(240),[56]],48e3:[eg,[255,192],e_(268),[55,148,128],e_(54),[112]],44100:[eg,[255,192],e_(268),[55,163,128],e_(84),[112]],32e3:[eg,[255,192],e_(268),[55,234],e_(226),[112]],24e3:[eg,[255,192],e_(268),[55,255,128],e_(268),[111,112],e_(126),[224]],16e3:[eg,[255,192],e_(268),[55,255,128],e_(268),[111,255],e_(269),[223,108],e_(195),[1,192]],12e3:[ef,e_(268),[3,127,248],e_(268),[6,255,240],e_(268),[13,255,224],e_(268),[27,253,128],e_(259),[56]],11025:[ef,e_(268),[3,127,248],e_(268),[6,255,240],e_(268),[13,255,224],e_(268),[27,255,192],e_(268),[55,175,128],e_(108),[112]],8e3:[ef,e_(268),[3,121,16],e_(47),[7]]}).reduce(function(t,i){return t[i]=new Uint8Array(e[i].reduce(function(e,t){return e.concat(t)},[])),t},{})}return F},eT=function(e){var t,i=0;for(t=0;t=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},ex.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},ex.prototype.addText=function(e){this.rows[this.rowIdx]+=e},ex.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var eI=function(e,t,i){this.serviceNum=e,this.text="",this.currentWindow=new ex(-1),this.windows=[],this.stream=i,"string"==typeof t&&this.createTextDecoder(t)};eI.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++)this.windows[i]=new ex(i),"function"==typeof t&&(this.windows[i].beforeRowOverflow=t)},eI.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},eI.prototype.createTextDecoder=function(e){if("undefined"==typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+e+" encoding. "+t})}};var eP=function(e){e=e||{},eP.prototype.init.call(this);var t,i=this,s=e.captionServices||{},r={};Object.keys(s).forEach(e=>{t=s[e],/^SERVICE/.test(e)&&(r[e]=t.encoding)}),this.serviceEncodings=r,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?i.new708Packet():null===i.current708Packet&&i.new708Packet(),i.add708Bytes(e)}};eP.prototype=new ec,eP.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},eP.prototype.add708Bytes=function(e){var t=e.ccData;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(t>>>8),this.current708Packet.data.push(255&t)},eP.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,i=null,s=null,r=0,n=t[r++];for(e.seq=n>>6,e.sizeCode=63&n;r>5,s=31&n,7===i&&s>0&&(i=n=t[r++]),this.pushServiceBlock(i,r,s),s>0&&(r+=s-1)},eP.prototype.pushServiceBlock=function(e,t,i){var s,r=t,n=this.current708Packet.data,a=this.services[e];for(a||(a=this.initService(e,r));r("0"+(255&e).toString(16)).slice(-2)).join(""),16)):eE((n?4096:0)|l),d.pendingNewLine&&!d.isEmpty()&&d.newLine(this.getPts(e)),d.pendingNewLine=!1,d.addText(s),e},eP.prototype.multiByteCharacter=function(e,t){var i=this.current708Packet.data,s=i[e+1],r=i[e+2];return ew(s)&&ew(r)&&(e=this.handleText(++e,t,{isMultiByte:!0})),e},eP.prototype.setCurrentWindow=function(e,t){var i=this.current708Packet.data[e];return t.setCurrentWindow(7&i),e},eP.prototype.defineWindow=function(e,t){var i=this.current708Packet.data,s=i[e],r=7&s;t.setCurrentWindow(r);var n=t.currentWindow;return s=i[++e],n.visible=(32&s)>>5,n.rowLock=(16&s)>>4,n.columnLock=(8&s)>>3,n.priority=7&s,s=i[++e],n.relativePositioning=(128&s)>>7,n.anchorVertical=127&s,s=i[++e],n.anchorHorizontal=s,s=i[++e],n.anchorPoint=(240&s)>>4,n.rowCount=15&s,s=i[++e],n.columnCount=63&s,s=i[++e],n.windowStyle=(56&s)>>3,n.penStyle=7&s,n.virtualRowCount=n.rowCount+1,e},eP.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,s=i[e],r=t.currentWindow.winAttr;return s=i[++e],r.fillOpacity=(192&s)>>6,r.fillRed=(48&s)>>4,r.fillGreen=(12&s)>>2,r.fillBlue=3&s,s=i[++e],r.borderType=(192&s)>>6,r.borderRed=(48&s)>>4,r.borderGreen=(12&s)>>2,r.borderBlue=3&s,s=i[++e],r.borderType+=(128&s)>>5,r.wordWrap=(64&s)>>6,r.printDirection=(48&s)>>4,r.scrollDirection=(12&s)>>2,r.justify=3&s,s=i[++e],r.effectSpeed=(240&s)>>4,r.effectDirection=(12&s)>>2,r.displayEffect=3&s,e},eP.prototype.flushDisplayed=function(e,t){for(var i=[],s=0;s<8;s++)t.windows[s].visible&&!t.windows[s].isEmpty()&&i.push(t.windows[s].getText());t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e},eP.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},eP.prototype.displayWindows=function(e,t){var i=this.current708Packet.data[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var r=0;r<8;r++)i&1<>4,r.offset=(12&s)>>2,r.penSize=3&s,s=i[++e],r.italics=(128&s)>>7,r.underline=(64&s)>>6,r.edgeType=(56&s)>>3,r.fontStyle=7&s,e},eP.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,s=i[e],r=t.currentWindow.penColor;return s=i[++e],r.fgOpacity=(192&s)>>6,r.fgRed=(48&s)>>4,r.fgGreen=(12&s)>>2,r.fgBlue=3&s,s=i[++e],r.bgOpacity=(192&s)>>6,r.bgRed=(48&s)>>4,r.bgGreen=(12&s)>>2,r.bgBlue=3&s,s=i[++e],r.edgeRed=(48&s)>>4,r.edgeGreen=(12&s)>>2,r.edgeBlue=3&s,e},eP.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,s=i[e],r=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,s=i[++e],r.row=15&s,s=i[++e],r.column=63&s,e},eP.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,t),this.initService(t.serviceNum,e)};var eL={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},eA=function(e){return null===e?"":String.fromCharCode(e=eL[e]||e)},eD=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],eO=function(){for(var e=[],t=15;t--;)e.push({text:"",indent:0,offset:0});return e},eM=function(e,t){eM.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(e){var t,i,s,r,n;if((t=32639&e.ccData)===this.lastControlCode_){this.lastControlCode_=null;return}if((61440&t)==4096?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),s=t>>>8,r=255&t,t!==this.PADDING_){if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=eO();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=eO();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=eO()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(s,r))n=eA((s=(3&s)<<8)|r),this[this.mode_](e.pts,n),this.column_++;else if(this.isExtCharacter(s,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),n=eA((s=(3&s)<<8)|r),this[this.mode_](e.pts,n),this.column_++;else if(this.isMidRowCode(s,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,(14&r)==14&&this.addFormatting(e.pts,["i"]),(1&r)==1&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(s,r)){let e=3&r;this.nonDisplayed_[this.row_].offset=e,this.column_+=e}else if(this.isPAC(s,r)){var a=eD.indexOf(7968&t);if("rollUp"===this.mode_&&(a-this.rollUpRows_+1<0&&(a=this.rollUpRows_-1),this.setRollUp(e.pts,a)),a!==this.row_&&(this.clearFormatting(e.pts),this.row_=a),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),(16&t)==16){let e=(14&t)>>1;this.column_=4*e,this.nonDisplayed_[this.row_].indent+=e}this.isColorPAC(r)&&(14&r)==14&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(s)&&(0===r&&(r=null),n=eA(s)+eA(r),this[this.mode_](e.pts,n),this.column_+=n.length)}}};eM.prototype=new ec,eM.prototype.flushDisplayed=function(e){let t=e=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+e+"."})},i=[];this.displayed_.forEach((e,s)=>{if(e&&e.text&&e.text.length){try{e.text=e.text.trim()}catch(e){t(s)}e.text.length&&i.push({text:e.text,line:s+1,position:10+Math.min(70,10*e.indent)+2.5*e.offset})}else null==e&&t(s)}),i.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,content:i,stream:this.name_})},eM.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=eO(),this.nonDisplayed_=eO(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},eM.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},eM.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},eM.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},eM.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},eM.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},eM.prototype.isPAC=function(e,t){return e>=this.BASE_&&e=64&&t<=127},eM.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},eM.prototype.isNormalChar=function(e){return e>=32&&e<=127},eM.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=eO(),this.displayed_=eO()),void 0!==t&&t!==this.row_)for(var i=0;i"},"");this[this.mode_](e,i)},eM.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce(function(e,t){return e+""},"");this.formatting_=[],this[this.mode_](e,t)}},eM.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_].text;i+=t,this.nonDisplayed_[this.row_].text=i},eM.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_].text;i+=t,this.displayed_[this.row_].text=i},eM.prototype.shiftRowsUp_=function(){var e;for(e=0;et&&(i=-1);Math.abs(t-e)>4294967296;)e+=8589934592*i;return e},eN=function(e){var t,i;eN.prototype.init.call(this),this.type_=e||eU,this.push=function(e){if("metadata"===e.type){this.trigger("data",e);return}(this.type_===eU||e.type===this.type_)&&(void 0===i&&(i=e.dts),e.dts=eB(e.dts,i),e.pts=eB(e.pts,i),t=e.dts,this.trigger("data",e))},this.flush=function(){i=t,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){i=void 0,t=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};eN.prototype=new ec;var ej=(e,t,i)=>{if(!e)return -1;for(var s=i;s"===e.mimeType?e.url=eq(e.data,s,e.data.length):e.pictureData=e.data.subarray(s,e.data.length)))},"T*":function(e){3===e.data[0]&&(e.value=e$(e.data,1,e.data.length).replace(/\0*$/,""),e.values=e.value.split("\0"))},TXXX:function(e){var t;3===e.data[0]&&-1!==(t=ej(e.data,0,1))&&(e.description=e$(e.data,1,t),e.value=e$(e.data,t+1,e.data.length).replace(/\0*$/,""),e.data=e.value)},"W*":function(e){e.url=eq(e.data,0,e.data.length).replace(/\0.*$/,"")},WXXX:function(e){var t;3===e.data[0]&&-1!==(t=ej(e.data,0,1))&&(e.description=e$(e.data,1,t),e.url=eq(e.data,t+1,e.data.length).replace(/\0.*$/,""))},PRIV:function(e){var t;for(t=0;t>>2;d*=4,d+=3&h[7],o.timeStamp=d,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o)}t.frames.push(o),i+=10+a}while(i>>4>1&&(s+=t[s]+1),0===i.pid)i.type="pat",e(t.subarray(s),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(s),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,s,i]):this.processPes_(t,s,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=eR.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=eR.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}}).prototype=new ec,Y.STREAM_TYPES={h264:27,adts:15},(X=function(){var e,t=this,i=!1,s={data:[],size:0},r={data:[],size:0},n={data:[],size:0},a=function(e,t){var i;let s=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,1===s&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=(4&e[6])!=0,192&(i=e[7])&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8]))},o=function(e,i,s){var r,n=new Uint8Array(e.size),o={type:i},l=0,h=0,d=!1;if(e.data.length&&!(e.size<9)){for(l=0,o.trackId=e.data[0].pid;l>5,h=(l=((3&t[d+6])+1)*1024)*eQ/eY[(60&t[d+2])>>>2],t.byteLength-d>>6&3)+1,channelcount:(1&t[d+2])<<2|(192&t[d+3])>>>6,samplerate:eY[(60&t[d+2])>>>2],samplingfrequencyindex:(60&t[d+2])>>>2,samplesize:16,data:t.subarray(d+7+a,d+n)}),i++,d+=n}"number"==typeof r&&(this.skipWarn_(r,d),r=null),t=t.subarray(d)}},this.flush=function(){i=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}}).prototype=new ec;var eX=J;Z=function(e){var t=e.byteLength,i=0,s=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+s},this.loadWord=function(){var r=e.byteLength-t,n=new Uint8Array(4),a=Math.min(4,t);if(0===a)throw Error("no bytes available");n.set(e.subarray(r,r+a)),i=new DataView(n.buffer).getUint32(0),s=8*a,t-=a},this.skipBits=function(e){var r;s>e||(e-=s,r=Math.floor(e/8),e-=8*r,t-=r,this.loadWord()),i<<=e,s-=e},this.readBits=function(e){var r=Math.min(s,e),n=i>>>32-r;return((s-=r)>0?i<<=r:t>0&&this.loadWord(),(r=e-r)>0)?n<>>e)!=0)return i<<=e,s-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()},(et=function(){var e,t,i=0;et.prototype.init.call(this),this.push=function(s){t?((r=new Uint8Array(t.byteLength+s.data.byteLength)).set(t),r.set(s.data,t.byteLength),t=r):t=s.data;for(var r,n=t.byteLength;i3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new ec,ei={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(ee=function(){var e,t,i,s,r,n,a,o=new et;ee.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,s=e.dts,o.push(e))},o.on("data",function(a){var o={trackId:t,pts:i,dts:s,data:a,nalUnitTypeCode:31&a[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=r(a.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=r(a.subarray(1)),o.config=n(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",o)}),o.on("done",function(){e.trigger("done")}),o.on("partialdone",function(){e.trigger("partialdone")}),o.on("reset",function(){e.trigger("reset")}),o.on("endedtimeline",function(){e.trigger("endedtimeline")}),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},a=function(e,t){var i,s=8,r=8;for(i=0;i=0?i:0,(16&e[t+5])>>4)?i+20:i+10},e1=function(e,t){return e.length-t<10||73!==e[t]||68!==e[t+1]||51!==e[t+2]?t:(t+=e0(e,t),e1(e,t))},e2=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},e4=function(e,t,i){var s,r="";for(s=t;s=t+2&&(255&e[t])==255&&(240&e[t+1])==240&&(22&e[t+1])==16},parseId3TagSize:e0,parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,s=e[t+4]<<3;return 6144&e[t+3]|s|i},parseType:function(e,t){return 73===e[t]&&68===e[t+1]&&51===e[t+2]?"timed-metadata":!0&e[t]&&(240&e[t+1])==240?"audio":null},parseSampleRate:function(e){for(var t=0;t+5>>2]}return null},parseAacTimestamp:function(e){var t,i,s;t=10,64&e[5]&&(t+=4+e2(e.subarray(10,14)));do{if((i=e2(e.subarray(t+4,t+8)))<1)break;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){s=e.subarray(t+10,t+i+10);for(var r=0;r>>2;return a*=4,a+=3&n[7]}break}}t+=10+i}while(t=3;){if(73===e[o]&&68===e[o+1]&&51===e[o+2]){if(e.length-o<10||(a=e8.parseId3TagSize(e,o),o+a>e.length))break;s={type:"timed-metadata",data:e.subarray(o,o+a)},this.trigger("data",s),o+=a;continue}if((255&e[o])==255&&(240&e[o+1])==240){if(e.length-o<7||(a=e8.parseAdtsSize(e,o),o+a>e.length))break;r={type:"audio",data:e.subarray(o,o+a),pts:t,dts:t},this.trigger("data",r),o+=a;continue}o++}e=e.length-o>0?e.subarray(o):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new ec;var e5=es,e3={mdat:d,moof:p,initSegment:function(e){var t,i=h(),s=m(e);return(t=new Uint8Array(i.byteLength+s.byteLength)).set(i),t.set(s,i.byteLength),t}},e6={groupNalsIntoFrames:function(e){var t,i,s=[],r=[];for(t=0,r.byteLength=0,r.nalCount=0,r.duration=0,s.byteLength=0;t1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},generateSampleTable:function(e,t){var i,s,r,n,a=t||0,o=[];for(i=0;iey.ONE_SECOND_IN_TS/2))){for((n=ev()[e.samplerate])||(n=t[0].data),a=0;a=g?m:(e.minSegmentDts=1/0,m.filter(function(t){return t.dts>=g&&(e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),e.minSegmentPts=e.minSegmentDts,!0)})),e.baseMediaDecodeTime=tt.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),p=e7(e,o,n,a),e.samples=e9(o),h=e3.mdat(te(o)),s=[],d=new Uint8Array((l=e3.moof(i,[e])).byteLength+h.byteLength),i++,d.set(l),d.set(h,l.byteLength),tt.clearDtsInfo(e),u=Math.ceil(1024*ts/e.samplerate),o.length&&(c=o.length*u,this.trigger("segmentTimingInfo",th(ey.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+c,o[0].pts+c,p||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+c})),this.trigger("data",{track:e,boxes:d}),this.trigger("done","AudioSegmentStream")},this.reset=function(){tt.clearDtsInfo(e),s=[],this.trigger("reset")}}).prototype=new ec,(er=function(e,t){var i,s,r,n=[],a=[];i=(t=t||{}).firstSequenceNumber||0,er.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){tt.collectDtsInfo(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||s||(s=t.config,e.sps=[t.data],tn.forEach(function(t){e[t]=s[t]},this)),"pic_parameter_set_rbsp"!==t.nalUnitType||r||(r=t.data,e.pps=[t.data]),n.push(t)},this.flush=function(){for(var s,r,o,l,h,d,u,c,p,m=0;n.length&&"access_unit_delimiter_rbsp"!==n[0].nalUnitType;)n.shift();if(0===n.length){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(r=e6.groupNalsIntoFrames(n),(l=e6.groupFramesIntoGops(r))[0][0].keyFrame||((o=this.getGopForFusion_(n[0],e))?(m=o.duration,l.unshift(o),l.byteLength+=o.byteLength,l.nalCount+=o.nalCount,l.pts=o.pts,l.dts=o.dts,l.duration+=o.duration):l=e6.extendFirstKeyFrame(l)),a.length){if(!(s=t.alignGopsAtEnd?this.alignGopsAtEnd_(l):this.alignGopsAtStart_(l))){this.gopCache_.unshift({gop:l.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),n=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}tt.clearDtsInfo(e),l=s}tt.collectDtsInfo(e,l),e.samples=e6.generateSampleTable(l),d=e3.mdat(e6.concatenateNalData(l)),e.baseMediaDecodeTime=tt.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",l.map(function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}})),c=l[0],p=l[l.length-1],this.trigger("segmentTimingInfo",th(e.baseMediaDecodeTime,c.dts,c.pts,p.dts+p.duration,p.pts+p.duration,m)),this.trigger("timingInfo",{start:l[0].pts,end:l[l.length-1].pts+l[l.length-1].duration}),this.gopCache_.unshift({gop:l.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),n=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),u=new Uint8Array((h=e3.moof(i,[e])).byteLength+d.byteLength),i++,u.set(h),u.set(d,h.byteLength),this.trigger("data",{track:e,boxes:u}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),n=[],this.gopCache_.length=0,a.length=0,this.trigger("reset")},this.resetStream_=function(){tt.clearDtsInfo(e),s=void 0,r=void 0},this.getGopForFusion_=function(t){var i,s,r,n,a,o=1/0;for(a=0;a=-1e4&&i<=45e3&&(!s||o>i)&&(s=n,o=i);return s?s.gop:null},this.alignGopsAtStart_=function(e){var t,i,s,r,n,o,l,h;for(n=e.byteLength,o=e.nalCount,l=e.duration,t=i=0;ts.pts){t++;continue}i++,n-=r.byteLength,o-=r.nalCount,l-=r.duration}return 0===i?e:i===e.length?null:((h=e.slice(i)).byteLength=n,h.duration=l,h.nalCount=o,h.pts=h[0].pts,h.dts=h[0].dts,h)},this.alignGopsAtEnd_=function(e){for(t=a.length-1,i=e.length-1,n=null,o=!1;t>=0&&i>=0;){if(s=a[t],r=e[i],s.pts===r.pts){o=!0;break}if(s.pts>r.pts){t--;continue}t===a.length-1&&(n=i),i--}if(!o&&null===n)return null;if(0===(l=o?i:n))return e;var t,i,s,r,n,o,l,h=e.slice(l),d=h.reduce(function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e},{byteLength:0,duration:0,nalCount:0});return h.byteLength=d.byteLength,h.duration=d.duration,h.nalCount=d.nalCount,h.pts=h[0].pts,h.dts=h[0].dts,h},this.alignGopsWith=function(e){a=e}}).prototype=new ec,(eo=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,eo.prototype.init.call(this),this.push=function(e){return e.content||e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):void(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),"audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes)))}}).prototype=new ec,eo.prototype.flush=function(e){var t,i,s,r,n=0,a={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,tn.forEach(function(e){a.info[e]=this.videoTrack[e]},this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,tr.forEach(function(e){a.info[e]=this.audioTrack[e]},this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?a.type=this.pendingTracks[0].type:a.type="combined",this.emittedTracks+=this.pendingTracks.length,s=e3.initSegment(this.pendingTracks),a.initSegment=new Uint8Array(s.byteLength),a.initSegment.set(s),a.data=new Uint8Array(this.pendingBytes),r=0;r=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},eo.prototype.setRemux=function(e){this.remuxTracks=e},(ea=function(e){var t,i,s=this,r=!0;ea.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="aac",r.metadataStream=new eG.MetadataStream,r.aacStream=new e5,r.audioTimestampRolloverStream=new eG.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new eG.TimestampRolloverStream("timed-metadata"),r.adtsStream=new eX,r.coalesceStream=new eo(e,r.metadataStream),r.headOfPipeline=r.aacStream,r.aacStream.pipe(r.audioTimestampRolloverStream).pipe(r.adtsStream),r.aacStream.pipe(r.timedMetadataTimestampRolloverStream).pipe(r.metadataStream).pipe(r.coalesceStream),r.metadataStream.on("timestamp",function(e){r.aacStream.setTimestamp(e.timeStamp)}),r.aacStream.on("data",function(n){"timed-metadata"!==n.type&&"audio"!==n.type||r.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:s.baseMediaDecodeTime},codec:"adts",type:"audio"},r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new en(i,e),r.audioSegmentStream.on("log",s.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",s.trigger.bind(s,"audioTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream),s.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}))}),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),to(this,r)},this.setupTsPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="ts",r.metadataStream=new eG.MetadataStream,r.packetStream=new eG.TransportPacketStream,r.parseStream=new eG.TransportParseStream,r.elementaryStream=new eG.ElementaryStream,r.timestampRolloverStream=new eG.TimestampRolloverStream,r.adtsStream=new eX,r.h264Stream=new eJ,r.captionStream=new eG.CaptionStream(e),r.coalesceStream=new eo(e,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream).pipe(r.timestampRolloverStream),r.timestampRolloverStream.pipe(r.h264Stream),r.timestampRolloverStream.pipe(r.adtsStream),r.timestampRolloverStream.pipe(r.metadataStream).pipe(r.coalesceStream),r.h264Stream.pipe(r.captionStream).pipe(r.coalesceStream),r.elementaryStream.on("data",function(n){var a;if("metadata"===n.type){for(a=n.tracks.length;a--;)t||"video"!==n.tracks[a].type?i||"audio"!==n.tracks[a].type||((i=n.tracks[a]).timelineStartInfo.baseMediaDecodeTime=s.baseMediaDecodeTime):(t=n.tracks[a]).timelineStartInfo.baseMediaDecodeTime=s.baseMediaDecodeTime;t&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new er(t,e),r.videoSegmentStream.on("log",s.getLogTrigger_("videoSegmentStream")),r.videoSegmentStream.on("timelineStartInfo",function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,r.audioSegmentStream.setEarliestDts(t.dts-s.baseMediaDecodeTime))}),r.videoSegmentStream.on("processedGopsInfo",s.trigger.bind(s,"gopInfo")),r.videoSegmentStream.on("segmentTimingInfo",s.trigger.bind(s,"videoSegmentTimingInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",function(e){i&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}),r.videoSegmentStream.on("timingInfo",s.trigger.bind(s,"videoTimingInfo")),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),i&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new en(i,e),r.audioSegmentStream.on("log",s.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",s.trigger.bind(s,"audioTimingInfo")),r.audioSegmentStream.on("segmentTimingInfo",s.trigger.bind(s,"audioSegmentTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream)),s.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t})}}),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("id3Frame",function(e){e.dispatchType=r.metadataStream.dispatchType,s.trigger("id3Frame",e)}),r.coalesceStream.on("caption",this.trigger.bind(this,"caption")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),to(this,r)},this.setBaseMediaDecodeTime=function(s){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=s),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,tt.clearDtsInfo(i),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,tt.clearDtsInfo(t),r.captionStream.reset()),r.timestampRolloverStream&&r.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t,i&&i.coalesceStream&&i.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(i){i.stream=e,t.trigger("log",i)}},this.push=function(e){if(r){var t=ti(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),r=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){r=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new ec;var td=ea,tu=function(e){return e>>>0},tc=function(e){return""+(String.fromCharCode(e[0])+String.fromCharCode(e[1])+String.fromCharCode(e[2])+String.fromCharCode(e[3]))},tp=function(e,t){var i,s,r,n,a,o=[];if(!t.length)return null;for(i=0;i1?i+s:e.byteLength,r===t[0]&&(1===t.length?o.push(e.subarray(i+8,n)):(a=tp(e.subarray(i+8,n),t.slice(1))).length&&(o=o.concat(a))),i=n;return o},tm=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=ep(e.subarray(4)):t.baseMediaDecodeTime=tu(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},tg=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},tf=function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},s=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],n=4&i.flags[2],a=1&i.flags[1],o=2&i.flags[1],l=4&i.flags[1],h=8&i.flags[1],d=s.getUint32(4),u=8;for(r&&(i.dataOffset=s.getInt32(u),u+=4),n&&d&&(t={flags:tg(e.subarray(u,u+4))},u+=4,a&&(t.duration=s.getUint32(u),u+=4),o&&(t.size=s.getUint32(u),u+=4),h&&(1===i.version?t.compositionTimeOffset=s.getInt32(u):t.compositionTimeOffset=s.getUint32(u),u+=4),i.samples.push(t),d--);d--;)t={},a&&(t.duration=s.getUint32(u),u+=4),o&&(t.size=s.getUint32(u),u+=4),l&&(t.flags=tg(e.subarray(u,u+4)),u+=4),h&&(1===i.version?t.compositionTimeOffset=s.getInt32(u):t.compositionTimeOffset=s.getUint32(u),u+=4),i.samples.push(t);return i},t_=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),s={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},r=1&s.flags[2],n=2&s.flags[2],a=8&s.flags[2],o=16&s.flags[2],l=32&s.flags[2],h=65536&s.flags[0],d=131072&s.flags[0];return t=8,r&&(t+=4,s.baseDataOffset=i.getUint32(12),t+=4),n&&(s.sampleDescriptionIndex=i.getUint32(t),t+=4),a&&(s.defaultSampleDuration=i.getUint32(t),t+=4),o&&(s.defaultSampleSize=i.getUint32(t),t+=4),l&&(s.defaultSampleFlags=i.getUint32(t)),h&&(s.durationIsEmpty=!0),!r&&d&&(s.baseDataOffsetIsMoof=!0),s};"undefined"!=typeof window?el=window:void 0!==eu?el=eu:"undefined"!=typeof self?el=self:el={};var ty=el,tv=eS.discardEmulationPreventionBytes,tT=function(e,t){for(var i=e,s=0;s0?tm(l[0]).baseMediaDecodeTime:0,d=tp(n,["trun"]);t===o&&d.length>0&&(i=tb(s,tS(d,h,a),o),r[o]||(r[o]={seiNals:[],logs:[]}),r[o].seiNals=r[o].seiNals.concat(i.seiNals),r[o].logs=r[o].logs.concat(i.logs))}),r},tC=function(e,t,i){if(null===t)return null;var s=tk(e,t)[t]||{};return{seiNals:s.seiNals,logs:s.logs,timescale:i}},tE=function(){var e,t,i,s,r,n,a=!1;this.isInitialized=function(){return a},this.init=function(t){e=new ek,a=!0,n=!!t&&t.isPartial,e.on("data",function(e){e.startTime=e.startPts/s,e.endTime=e.endPts/s,r.captions.push(e),r.captionStreams[e.stream]=!0}),e.on("log",function(e){r.logs.push(e)})},this.isNewInit=function(e,t){return(!e||0!==e.length)&&(!t||"object"!=typeof t||0!==Object.keys(t).length)&&(i!==e[0]||s!==t[i])},this.parse=function(e,n,a){var o;if(!this.isInitialized()||!n||!a)return null;if(this.isNewInit(n,a))s=a[i=n[0]];else if(null===i||!s)return t.push(e),null;for(;t.length>0;){var l=t.shift();this.parse(l,n,a)}return((o=tC(e,i,s))&&o.logs&&(r.logs=r.logs.concat(o.logs)),null!==o&&o.seiNals)?(this.pushNals(o.seiNals),this.flushStream(),r):r.logs.length?{logs:r.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach(function(t){e.push(t)})},this.flushStream=function(){if(!this.isInitialized())return null;n?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={},r.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,s=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},tw=function(e){for(var t=0,i=String.fromCharCode(e[0]),s="";"\0"!==i;)s+=i,i=String.fromCharCode(e[++t]);return s+i},tx=function(e,t){var i="\0"!==t.scheme_id_uri,s=0===e&&tI(t.presentation_time_delta)&&i,r=1===e&&tI(t.presentation_time)&&i;return!(e>1)&&s||r},tI=function(e){return void 0!==e||null!==e},tP=function(e){return("00"+e.toString(16)).slice(-2)},tL=function(e){var t,i,s,r,n,a,o,l=4,h=e[0];if(0===h){t=tw(e.subarray(l)),l+=t.length,i=tw(e.subarray(l)),l+=i.length;var d=new DataView(e.buffer);s=d.getUint32(l),l+=4,n=d.getUint32(l),l+=4,a=d.getUint32(l),l+=4,o=d.getUint32(l),l+=4}else if(1===h){var d=new DataView(e.buffer);s=d.getUint32(l),l+=4,r=ep(e.subarray(l)),l+=8,a=d.getUint32(l),l+=4,o=d.getUint32(l),l+=4,t=tw(e.subarray(l)),l+=t.length,i=tw(e.subarray(l)),l+=i.length}var u={scheme_id_uri:t,value:i,timescale:s||1,presentation_time:r,presentation_time_delta:n,event_duration:a,id:o,message_data:new Uint8Array(e.subarray(l,e.byteLength))};return tx(h,u)?u:void 0},tA=function(e,t,i,s){return e||0===e?e/t:s+i/t},tD=ez.parseId3Frames;eh=function(e,t){var i=tp(t,["moof","traf"]).reduce(function(t,i){let s;var r,n=tp(i,["tfhd"])[0],a=e[tu(n[4]<<24|n[5]<<16|n[6]<<8|n[7])]||9e4,o=tp(i,["tfdt"])[0],l=new DataView(o.buffer,o.byteOffset,o.byteLength);return"bigint"==typeof(r=1===o[0]?ep(o.subarray(4,12)):l.getUint32(4))?s=r/ty.BigInt(a):"number"!=typeof r||isNaN(r)||(s=r/a),s11?(t.codec+=".",t.codec+=tP(h[9]),t.codec+=tP(h[10]),t.codec+=tP(h[11])):t.codec="avc1.4d400d":/^mp4[a,v]$/i.test(t.codec)?"esds"===tc((h=u.subarray(28)).subarray(4,8))&&h.length>20&&0!==h[19]?(t.codec+="."+tP(h[19]),t.codec+="."+tP(h[20]>>>2&63).replace(/^0/,"")):t.codec="mp4a.40.2":t.codec=t.codec.toLowerCase())}var c=tp(e,["mdia","mdhd"])[0];c&&(t.timescale=ed(c)),i.push(t)}),i},tM=function(e){var t=31&e[1];return t<<=8,t|=e[2]},tR=function(e){return!!(64&e[1])},tU=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},tB=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},tN={};tN.ts={parseType:function(e,t){var i=tM(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},parsePat:function(e){var t=tR(e),i=4+tU(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t,i={},s=tR(e),r=4+tU(e);if(s&&(r+=e[r]+1),1&e[r+5]){t=3+((15&e[r+1])<<8|e[r+2])-4;for(var n=12+((15&e[r+10])<<8|e[r+11]);n=e.byteLength)return null;var s=null;return 192&(t=e[i+7])&&((s={}).pts=(14&e[i+9])<<27|(255&e[i+10])<<20|(254&e[i+11])<<12|(255&e[i+12])<<5|(254&e[i+13])>>>3,s.pts*=4,s.pts+=(6&e[i+13])>>>1,s.dts=s.pts,64&t&&(s.dts=(14&e[i+14])<<27|(255&e[i+15])<<20|(254&e[i+16])<<12|(255&e[i+17])<<5|(254&e[i+18])>>>3,s.dts*=4,s.dts+=(6&e[i+18])>>>1)),s},videoPacketContainsKeyFrame:function(e){for(var t=4+tU(e),i=e.subarray(t),s=0,r=0,n=!1;r3&&"slice_layer_without_partitioning_rbsp_idr"===tB(31&i[r+3])&&(n=!0),n}},tN.aac=e8;var tj=ey.ONE_SECOND_IN_TS,tF=function(e,t){for(var i,s=0,r=188;r=0;){if(71===e[o]&&(71===e[l]||l===e.byteLength)){if(s=e.subarray(o,l),"pes"===tN.ts.parseType(s,t.pid)&&(r=tN.ts.parsePesType(s,t.table),n=tN.ts.parsePayloadUnitStartIndicator(s),"audio"===r&&n&&(a=tN.ts.parsePesTime(s))&&(a.type="audio",i.audio.push(a),h=!0)),h)break;o-=188,l-=188;continue}o--,l--}},tq=function(e,t,i){for(var s,r,n,a,o,l,h,d=0,u=188,c=!1,p={data:[],size:0};u=0;){if(71===e[d]&&71===e[u]){if(s=e.subarray(d,u),"pes"===tN.ts.parseType(s,t.pid)&&(r=tN.ts.parsePesType(s,t.table),n=tN.ts.parsePayloadUnitStartIndicator(s),"video"===r&&n&&(a=tN.ts.parsePesTime(s))&&(a.type="video",i.video.push(a),c=!0)),c)break;d-=188,u-=188;continue}d--,u--}},tH=function(e,t){if(e.audio&&e.audio.length){var i=t;(void 0===i||isNaN(i))&&(i=e.audio[0].dts),e.audio.forEach(function(e){e.dts=eB(e.dts,i),e.pts=eB(e.pts,i),e.dtsTime=e.dts/tj,e.ptsTime=e.pts/tj})}if(e.video&&e.video.length){var s=t;if((void 0===s||isNaN(s))&&(s=e.video[0].dts),e.video.forEach(function(e){e.dts=eB(e.dts,s),e.pts=eB(e.pts,s),e.dtsTime=e.dts/tj,e.ptsTime=e.pts/tj}),e.firstKeyFrame){var r=e.firstKeyFrame;r.dts=eB(r.dts,s),r.pts=eB(r.pts,s),r.dtsTime=r.dts/tj,r.ptsTime=r.pts/tj}}},tV=function(e){for(var t,i=!1,s=0,r=null,n=null,a=0,o=0;e.length-o>=3;){switch(tN.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10||(a=tN.aac.parseId3TagSize(e,o))>e.length){i=!0;break}null===n&&(t=e.subarray(o,o+a),n=tN.aac.parseAacTimestamp(t)),o+=a;break;case"audio":if(e.length-o<7||(a=tN.aac.parseAdtsSize(e,o))>e.length){i=!0;break}null===r&&(t=e.subarray(o,o+a),r=tN.aac.parseSampleRate(t)),s++,o+=a;break;default:o++}if(i)return null}if(null===r||null===n)return null;var l=tj/r;return{audio:[{type:"audio",dts:n,pts:n},{type:"audio",dts:n+1024*s*l,pts:n+1024*s*l}]}},tz=function(e){var t={pid:null,table:null},i={};for(var s in tF(e,t),t.table)if(t.table.hasOwnProperty(s))switch(t.table[s]){case eR.H264_STREAM_TYPE:i.video=[],tq(e,t,i),0===i.video.length&&delete i.video;break;case eR.ADTS_STREAM_TYPE:i.audio=[],t$(e,t,i),0===i.audio.length&&delete i.audio}return i},tW=function(e,t){var i;return(i=tN.aac.isLikelyAacData(e)?tV(e):tz(e))&&(i.audio||i.video)?(tH(i,t),i):null};let tG=function(e,t){t.on("data",function(t){let i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};let s=t.data;t.data=s.buffer,e.postMessage({action:"data",segment:t,byteOffset:s.byteOffset,byteLength:s.byteLength},[t.data])}),t.on("done",function(t){e.postMessage({action:"done"})}),t.on("gopInfo",function(t){e.postMessage({action:"gopInfo",gopInfo:t})}),t.on("videoSegmentTimingInfo",function(t){let i={start:{decode:ey.videoTsToSeconds(t.start.dts),presentation:ey.videoTsToSeconds(t.start.pts)},end:{decode:ey.videoTsToSeconds(t.end.dts),presentation:ey.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:ey.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=ey.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})}),t.on("audioSegmentTimingInfo",function(t){let i={start:{decode:ey.videoTsToSeconds(t.start.dts),presentation:ey.videoTsToSeconds(t.start.pts)},end:{decode:ey.videoTsToSeconds(t.end.dts),presentation:ey.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:ey.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=ey.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i})}),t.on("id3Frame",function(t){e.postMessage({action:"id3Frame",id3Frame:t})}),t.on("caption",function(t){e.postMessage({action:"caption",caption:t})}),t.on("trackinfo",function(t){e.postMessage({action:"trackinfo",trackInfo:t})}),t.on("audioTimingInfo",function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:ey.videoTsToSeconds(t.start),end:ey.videoTsToSeconds(t.end)}})}),t.on("videoTimingInfo",function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:ey.videoTsToSeconds(t.start),end:ey.videoTsToSeconds(t.end)}})}),t.on("log",function(t){e.postMessage({action:"log",log:t})})};class tK{constructor(e,t){this.options=t||{},this.self=e,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new td(this.options),tG(this.self,this.transmuxer)}pushMp4Captions(e){this.captionParser||(this.captionParser=new tE,this.captionParser.init());let t=new Uint8Array(e.data,e.byteOffset,e.byteLength),i=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:t.buffer},[t.buffer])}probeMp4StartTime({timescales:e,data:t}){let i=eh(e,t);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:t},[t.buffer])}probeMp4Tracks({data:e}){let t=tO(e);this.self.postMessage({action:"probeMp4Tracks",tracks:t,data:e},[e.buffer])}probeEmsgID3({data:e,offset:t}){let i=function(e,t=0){return tp(e,["emsg"]).map(e=>{var i=tL(new Uint8Array(e)),s=tD(i.message_data);return{cueTime:tA(i.presentation_time,i.timescale,i.presentation_time_delta,t),duration:tA(i.event_duration,i.timescale),frames:s}})}(e,t);this.self.postMessage({action:"probeEmsgID3",id3Frames:i,emsgData:e},[e.buffer])}probeTs({data:e,baseStartTime:t}){let i=tW(e,"number"!=typeof t||isNaN(t)?void 0:t*ey.ONE_SECOND_IN_TS),s=null;i&&((s={hasVideo:i.video&&2===i.video.length||!1,hasAudio:i.audio&&2===i.audio.length||!1}).hasVideo&&(s.videoStart=i.video[0].ptsTime),s.hasAudio&&(s.audioStart=i.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:s,data:e},[e.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(e){let t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}reset(){this.transmuxer.reset()}setTimestampOffset(e){let t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(ey.secondsToVideoTs(t)))}setAudioAppendStart(e){this.transmuxer.setAudioAppendStart(Math.ceil(ey.secondsToVideoTs(e.appendStart)))}setRemux(e){this.transmuxer.setRemux(e.remux)}flush(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}self.onmessage=function(e){if("init"===e.data.action&&e.data.options){this.messageHandlers=new tK(self,e.data.options);return}this.messageHandlers||(this.messageHandlers=new tK(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data)}})));let n1=(e,t,i)=>{let{type:s,initSegment:r,captions:n,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:h}=e.data.segment;t.buffer.push({captions:n,captionStreams:a,metadata:o});let d=e.data.segment.boxes||{data:e.data.segment.data},u={type:s,data:new Uint8Array(d.data,d.data.byteOffset,d.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};void 0!==l&&(u.videoFrameDtsTime=l),void 0!==h&&(u.videoFramePtsTime=h),i(u)},n2=({transmuxedData:e,callback:t})=>{e.buffer=[],t(e)},n4=(e,t)=>{t.gopInfo=e.data.gopInfo},n8=e=>{let{transmuxer:t,bytes:i,audioAppendStart:s,gopsToAlignWith:r,remux:n,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:h,onVideoSegmentTimingInfo:d,onAudioSegmentTimingInfo:u,onId3:c,onCaptions:p,onDone:m,onEndedTimeline:g,onTransmuxerLog:f,isEndOfTimeline:_}=e,y={buffer:[]},v=_;if(t.onmessage=i=>{t.currentTransmux===e&&("data"===i.data.action&&n1(i,y,a),"trackinfo"===i.data.action&&o(i.data.trackInfo),"gopInfo"===i.data.action&&n4(i,y),"audioTimingInfo"===i.data.action&&l(i.data.audioTimingInfo),"videoTimingInfo"===i.data.action&&h(i.data.videoTimingInfo),"videoSegmentTimingInfo"===i.data.action&&d(i.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===i.data.action&&u(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&c([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&p(i.data.caption),"endedtimeline"===i.data.action&&(v=!1,g()),"log"===i.data.action&&f(i.data.log),"transmuxed"!==i.data.type||v||(t.onmessage=null,n2({transmuxedData:y,callback:m}),n5(t)))},s&&t.postMessage({action:"setAudioAppendStart",appendStart:s}),Array.isArray(r)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),void 0!==n&&t.postMessage({action:"setRemux",remux:n}),i.byteLength){let e=i instanceof ArrayBuffer?i:i.buffer,s=i instanceof ArrayBuffer?0:i.byteOffset;t.postMessage({action:"push",data:e,byteOffset:s,byteLength:i.byteLength},[e])}_&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},n5=e=>{e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():n8(e.currentTransmux))},n3=(e,t)=>{e.postMessage({action:t}),n5(e)},n6=(e,t)=>{if(!t.currentTransmux){t.currentTransmux=e,n3(t,e);return}t.transmuxQueue.push(n3.bind(null,t,e))},n7=e=>{if(!e.transmuxer.currentTransmux){e.transmuxer.currentTransmux=e,n8(e);return}e.transmuxer.transmuxQueue.push(e)};var n9={reset:e=>{n6("reset",e)},createTransmuxer:e=>{let t=new n0;t.currentTransmux=null,t.transmuxQueue=[];let i=t.terminate;return t.terminate=()=>(t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)),t.postMessage({action:"init",options:e}),t}};let ae=function(e){let t=e.transmuxer,i=e.endAction||e.action,s=e.callback,r=(0,b.Z)({},e,{endAction:null,transmuxer:null,callback:null}),n=r=>{r.data.action===i&&(t.removeEventListener("message",n),r.data.data&&(r.data.data=new Uint8Array(r.data.data,e.byteOffset||0,e.byteLength||r.data.data.byteLength),e.data&&(e.data=r.data.data)),s(r.data))};if(t.addEventListener("message",n),e.data){let i=e.data instanceof ArrayBuffer;r.byteOffset=i?0:e.data.byteOffset,r.byteLength=e.data.byteLength;let s=[i?e.data:e.data.buffer];t.postMessage(r,s)}else t.postMessage(r)},at={FAILURE:2,TIMEOUT:-101,ABORTED:-102},ai=e=>{e.forEach(e=>{e.abort()})},as=e=>({bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}),ar=e=>{let t=e.target,i={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return i.bytesReceived=e.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8e3),i},an=(e,t)=>t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:at.TIMEOUT,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:at.ABORTED,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:at.FAILURE,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:at.FAILURE,xhr:t}:null,aa=(e,t,i)=>(s,r)=>{let n=r.response,a=an(s,r);if(a)return i(a,e);if(16!==n.byteLength)return i({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:at.FAILURE,xhr:r},e);let o=new DataView(n),l=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]);for(let e=0;e{let i=(0,A.Xm)(e.map.bytes);if("mp4"!==i){let s=e.map.resolvedUri||e.map.uri;return t({internal:!0,message:`Found unsupported ${i||"unknown"} container for initialization segment at URL: ${s}`,code:at.FAILURE})}ae({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:({tracks:i,data:s})=>(e.map.bytes=s,i.forEach(function(t){e.map.tracks=e.map.tracks||{},!e.map.tracks[t.type]&&(e.map.tracks[t.type]=t,"number"==typeof t.id&&t.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[t.id]=t.timescale))}),t(null))})},al=({segment:e,finishProcessingFn:t})=>(i,s)=>{let r=an(i,s);if(r)return t(r,e);let n=new Uint8Array(s.response);if(e.map.key)return e.map.encryptedBytes=n,t(null,e);e.map.bytes=n,ao(e,function(i){if(i)return i.xhr=s,i.status=s.status,t(i,e);t(null,e)})},ah=({segment:e,finishProcessingFn:t,responseType:i})=>(s,r)=>{let n=an(s,r);if(n)return t(n,e);let a="arraybuffer"!==i&&r.responseText?nK(r.responseText.substring(e.lastReachedChar||0)):r.response;return e.stats=as(r),e.key?e.encryptedBytes=new Uint8Array(a):e.bytes=new Uint8Array(a),t(null,e)},ad=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:d,doneFn:u,onTransmuxerLog:c})=>{let p=e.map&&e.map.tracks||{},m=!!(p.audio&&p.video),g=s.bind(null,e,"audio","start"),f=s.bind(null,e,"audio","end"),_=s.bind(null,e,"video","start"),y=s.bind(null,e,"video","end"),v=()=>n7({bytes:t,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,remux:m,onData:t=>{t.type="combined"===t.type?"video":t.type,d(e,t)},onTrackInfo:t=>{i&&(m&&(t.isMuxed=!0),i(e,t))},onAudioTimingInfo:e=>{g&&void 0!==e.start&&(g(e.start),g=null),f&&void 0!==e.end&&f(e.end)},onVideoTimingInfo:e=>{_&&void 0!==e.start&&(_(e.start),_=null),y&&void 0!==e.end&&y(e.end)},onVideoSegmentTimingInfo:e=>{r(e)},onAudioSegmentTimingInfo:e=>{n(e)},onId3:(t,i)=>{a(e,t,i)},onCaptions:t=>{o(e,[t])},isEndOfTimeline:l,onEndedTimeline:()=>{h()},onTransmuxerLog:c,onDone:t=>{u&&(t.type="combined"===t.type?"video":t.type,u(null,e,t))}});ae({action:"probeTs",transmuxer:e.transmuxer,data:t,baseStartTime:e.baseStartTime,callback:s=>{e.bytes=t=s.data;let r=s.result;r&&(i(e,{hasAudio:r.hasAudio,hasVideo:r.hasVideo,isMuxed:m}),i=null),v()}})},au=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:d,doneFn:u,onTransmuxerLog:c})=>{let p=new Uint8Array(t);if((0,A.cz)(p)){e.isFmp4=!0;let{tracks:r}=e.map,n={isFmp4:!0,hasVideo:!!r.video,hasAudio:!!r.audio};r.audio&&r.audio.codec&&"enca"!==r.audio.codec&&(n.audioCodec=r.audio.codec),r.video&&r.video.codec&&"encv"!==r.video.codec&&(n.videoCodec=r.video.codec),r.video&&r.audio&&(n.isMuxed=!0),i(e,n);let l=(t,i)=>{d(e,{data:p,type:n.hasAudio&&!n.isMuxed?"audio":"video"}),i&&i.length&&a(e,i),t&&t.length&&o(e,t),u(null,e,{})};ae({action:"probeMp4StartTime",timescales:e.map.timescales,data:p,transmuxer:e.transmuxer,callback:({data:i,startTime:a})=>{t=i.buffer,e.bytes=p=i,n.hasAudio&&!n.isMuxed&&s(e,"audio","start",a),n.hasVideo&&s(e,"video","start",a),ae({action:"probeEmsgID3",data:p,transmuxer:e.transmuxer,offset:a,callback:({emsgData:i,id3Frames:s})=>{if(t=i.buffer,e.bytes=p=i,!r.video||!i.byteLength||!e.transmuxer){l(void 0,s);return}ae({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:e.transmuxer,data:p,timescales:e.map.timescales,trackIds:[r.video.id],callback:i=>{t=i.data.buffer,e.bytes=p=i.data,i.logs.forEach(function(e){c(rk(e,{stream:"mp4CaptionParser"}))}),l(i.captions,s)}})}})}});return}if(!e.transmuxer){u(null,e,{});return}if(void 0===e.container&&(e.container=(0,A.Xm)(p)),"ts"!==e.container&&"aac"!==e.container){i(e,{hasAudio:!1,hasVideo:!1}),u(null,e,{});return}ad({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:d,doneFn:u,onTransmuxerLog:c})},ac=function({id:e,key:t,encryptedBytes:i,decryptionWorker:s},r){let n;let a=t=>{if(t.data.source===e){s.removeEventListener("message",a);let e=t.data.decrypted;r(new Uint8Array(e.bytes,e.byteOffset,e.byteLength))}};s.addEventListener("message",a),n=t.bytes.slice?t.bytes.slice():new Uint32Array(Array.prototype.slice.call(t.bytes)),s.postMessage(nS({source:e,encrypted:i,key:n,iv:t.iv}),[i.buffer,n.buffer])},ap=({decryptionWorker:e,segment:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:d,doneFn:u,onTransmuxerLog:c})=>{ac({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e},e=>{t.bytes=e,au({segment:t,bytes:t.bytes,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:d,doneFn:u,onTransmuxerLog:c})})},am=({activeXhrs:e,decryptionWorker:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:d,doneFn:u,onTransmuxerLog:c})=>{let p=0,m=!1;return(g,f)=>{if(!m){if(g)return m=!0,ai(e),u(g,f);if((p+=1)===e.length){let p=function(){if(f.encryptedBytes)return ap({decryptionWorker:t,segment:f,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:d,doneFn:u,onTransmuxerLog:c});au({segment:f,bytes:f.bytes,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:d,doneFn:u,onTransmuxerLog:c})};if(f.endOfAllRequests=Date.now(),f.map&&f.map.encryptedBytes&&!f.map.bytes)return ac({decryptionWorker:t,id:f.requestId+"-init",encryptedBytes:f.map.encryptedBytes,key:f.map.key},t=>{f.map.bytes=t,ao(f,t=>{if(t)return ai(e),u(t,f);p()})});p()}}}},ag=({loadendState:e,abortFn:t})=>i=>{i.target.aborted&&t&&!e.calledAbortFn&&(t(),e.calledAbortFn=!0)},af=({segment:e,progressFn:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:h,dataFn:d})=>i=>{if(!i.target.aborted)return e.stats=rk(e.stats,ar(i)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(i,e)},a_=({xhr:e,xhrOptions:t,decryptionWorker:i,segment:s,abortFn:r,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:h,id3Fn:d,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:p,dataFn:m,doneFn:g,onTransmuxerLog:f})=>{let _=[],y=am({activeXhrs:_,decryptionWorker:i,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:h,id3Fn:d,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:p,dataFn:m,doneFn:g,onTransmuxerLog:f});if(s.key&&!s.key.bytes){let i=[s.key];s.map&&!s.map.bytes&&s.map.key&&s.map.key.resolvedUri===s.key.resolvedUri&&i.push(s.map.key);let r=e(rk(t,{uri:s.key.resolvedUri,responseType:"arraybuffer"}),aa(s,i,y));_.push(r)}if(s.map&&!s.map.bytes){if(s.map.key&&(!s.key||s.key.resolvedUri!==s.map.key.resolvedUri)){let i=e(rk(t,{uri:s.map.key.resolvedUri,responseType:"arraybuffer"}),aa(s,[s.map.key],y));_.push(i)}let i=e(rk(t,{uri:s.map.resolvedUri,responseType:"arraybuffer",headers:nv(s.map)}),al({segment:s,finishProcessingFn:y}));_.push(i)}let v=rk(t,{uri:s.part&&s.part.resolvedUri||s.resolvedUri,responseType:"arraybuffer",headers:nv(s)}),T=ah({segment:s,finishProcessingFn:y,responseType:v.responseType}),b=e(v,T);b.addEventListener("progress",af({segment:s,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:h,id3Fn:d,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:p,dataFn:m})),_.push(b);let S={};return _.forEach(e=>{e.addEventListener("loadend",ag({loadendState:S,abortFn:r}))}),()=>ai(_)},ay=rS("CodecUtils"),av=function(e){let t=e.attributes||{};if(t.CODECS)return(0,C.kS)(t.CODECS)},aT=(e,t)=>{let i=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&i.AUDIO&&e.mediaGroups.AUDIO[i.AUDIO]},ab=(e,t)=>{if(!aT(e,t))return!0;let i=t.attributes||{},s=e.mediaGroups.AUDIO[i.AUDIO];for(let e in s)if(!s[e].uri&&!s[e].playlists)return!0;return!1},aS=function(e){let t={};return e.forEach(({mediaType:e,type:i,details:s})=>{t[e]=t[e]||[],t[e].push((0,C.ws)(`${i}${s}`))}),Object.keys(t).forEach(function(e){if(t[e].length>1){ay(`multiple ${e} codecs found as attributes: ${t[e].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),t[e]=null;return}t[e]=t[e][0]}),t},ak=function(e){let t=0;return e.audio&&t++,e.video&&t++,t},aC=function(e,t){let i=t.attributes||{},s=aS(av(t)||[]);if(aT(e,t)&&!s.audio&&!ab(e,t)){let t=aS((0,C.Jg)(e,i.AUDIO)||[]);t.audio&&(s.audio=t.audio)}return s},aE=rS("PlaylistSelector"),aw=function(e){if(!e||!e.playlist)return;let t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})},ax=function(e,t){if(!e)return"";let i=d().getComputedStyle(e);return i?i[t]:""},aI=function(e,t){let i=e.slice();e.sort(function(e,s){let r=t(e,s);return 0===r?i.indexOf(e)-i.indexOf(s):r})},aP=function(e,t){let i,s;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||d().Number.MAX_VALUE,t.attributes.BANDWIDTH&&(s=t.attributes.BANDWIDTH),i-(s=s||d().Number.MAX_VALUE)},aL=function(e,t,i,s,r,n){let a,o,l,h;if(!e)return;let u={bandwidth:t,width:i,height:s,limitRenditionByPlayerDimensions:r},c=e.playlists;r2.isAudioOnly(e)&&(c=n.getAudioTrackPlaylists_(),u.audioOnly=!0);let p=c.map(e=>{let t=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return{bandwidth:e.attributes&&e.attributes.BANDWIDTH||d().Number.MAX_VALUE,width:t,height:i,playlist:e}});aI(p,(e,t)=>e.bandwidth-t.bandwidth);let m=(p=p.filter(e=>!r2.isIncompatible(e.playlist))).filter(e=>r2.isEnabled(e.playlist));m.length||(m=p.filter(e=>!r2.isDisabled(e.playlist)));let g=m.filter(e=>e.bandwidth*nG.BANDWIDTH_VARIANCEe.bandwidth===f.bandwidth)[0];if(!1===r){let e=_||m[0]||p[0];if(e&&e.playlist){let t="sortedPlaylistReps";return _&&(t="bandwidthBestRep"),m[0]&&(t="enabledPlaylistReps"),aE(`choosing ${aw(e)} using ${t} with options`,u),e.playlist}return aE("could not choose a playlist with options",u),null}let y=g.filter(e=>e.width&&e.height);aI(y,(e,t)=>e.width-t.width);let v=y.filter(e=>e.width===i&&e.height===s);f=v[v.length-1];let T=v.filter(e=>e.bandwidth===f.bandwidth)[0];if(T||(f=(o=(a=y.filter(e=>e.width>i||e.height>s)).filter(e=>e.width===a[0].width&&e.height===a[0].height))[o.length-1],l=o.filter(e=>e.bandwidth===f.bandwidth)[0]),n.leastPixelDiffSelector){let e=y.map(e=>(e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-s),e));aI(e,(e,t)=>e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff),h=e[0]}let b=h||l||T||_||m[0]||p[0];if(b&&b.playlist){let e="sortedPlaylistReps";return h?e="leastPixelDiffRep":l?e="resolutionPlusOneRep":T?e="resolutionBestRep":_?e="bandwidthBestRep":m[0]&&(e="enabledPlaylistReps"),aE(`choosing ${aw(b)} using ${e} with options`,u),b.playlist}return aE("could not choose a playlist with options",u),null},aA=function(){let e=this.useDevicePixelRatio&&d().devicePixelRatio||1;return aL(this.playlists.main,this.systemBandwidth,parseInt(ax(this.tech_.el(),"width"),10)*e,parseInt(ax(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_)},aD=function(e){let{main:t,currentTime:i,bandwidth:s,duration:r,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=e,h=t.playlists.filter(e=>!r2.isIncompatible(e)),d=h.filter(r2.isEnabled);d.length||(d=h.filter(e=>!r2.isDisabled(e)));let u=d.filter(r2.hasAttribute.bind(null,"BANDWIDTH")).map(e=>{let t=l.getSyncPoint(e,r,o,i),h=r2.estimateSegmentRequestTime(n,s,e);return{playlist:e,rebufferingImpact:h*(t?1:2)-a}}),c=u.filter(e=>e.rebufferingImpact<=0);return(aI(c,(e,t)=>aP(t.playlist,e.playlist)),c.length)?c[0]:(aI(u,(e,t)=>e.rebufferingImpact-t.rebufferingImpact),u[0]||null)},aO=e=>{let t,i=0;return e.bytes&&(t=new Uint8Array(e.bytes),e.segments.forEach(e=>{t.set(e,i),i+=e.byteLength})),t},aM=function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"});let s=i;/^cc708_/.test(i)&&(s="SERVICE"+i.split("_")[1]);let r=t.textTracks().getTrackById(s);if(r)e[i]=r;else{let r=t.options_.vhs&&t.options_.vhs.captionServices||{},n=i,a=i,o=!1,l=r[s];l&&(n=l.label,a=l.language,o=l.default),e[i]=t.addRemoteTextTrack({kind:"captions",id:s,default:o,label:n,language:a},!1).track}}},aR=function({inbandTextTracks:e,captionArray:t,timestampOffset:i}){if(!t)return;let s=d().WebKitDataCue||d().VTTCue;t.forEach(t=>{let r=t.stream;t.content?t.content.forEach(n=>{let a=new s(t.startTime+i,t.endTime+i,n.text);a.line=n.line,a.align="left",a.position=n.position,a.positionAlign="line-left",e[r].addCue(a)}):e[r].addCue(new s(t.startTime+i,t.endTime+i,t.text))})},aU=function(e){Object.defineProperties(e.frame,{id:{get:()=>(rm.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key)},value:{get:()=>(rm.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data)},privateData:{get:()=>(rm.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data)}})},aB=({inbandTextTracks:e,metadataArray:t,timestampOffset:i,videoDuration:s})=>{if(!t)return;let r=d().WebKitDataCue||d().VTTCue,n=e.metadataTrack_;if(!n||(t.forEach(e=>{let t=e.cueTime+i;!("number"!=typeof t||d().isNaN(t))&&!(t<0)&&t<1/0&&e.frames&&e.frames.length&&e.frames.forEach(e=>{let i=new r(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,aU(i),n.addCue(i)})}),!n.cues||!n.cues.length))return;let a=n.cues,o=[];for(let e=0;e{let i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e},{}),h=Object.keys(l).sort((e,t)=>Number(e)-Number(t));h.forEach((e,t)=>{let i=l[e],r=isFinite(s)?s:e,n=Number(h[t+1])||r;i.forEach(e=>{e.endTime=n})})},aN={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},aj=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),aF=({inbandTextTracks:e,dateRanges:t})=>{let i=e.metadataTrack_;if(!i)return;let s=d().WebKitDataCue||d().VTTCue;t.forEach(e=>{for(let t of Object.keys(e)){if(aj.has(t))continue;let r=new s(e.startTime,e.endTime,"");r.id=e.id,r.type="com.apple.quicktime.HLS",r.value={key:aN[t],data:e[t]},("scte35Out"===t||"scte35In"===t)&&(r.value.data=new Uint8Array(r.value.data.match(/[\da-f]{2}/gi)).buffer),i.addCue(r)}e.processDateRange()})},a$=(e,t,i)=>{!e.metadataTrack_&&(e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,rm.browser.IS_ANY_SAFARI||(e.metadataTrack_.inBandMetadataTrackDispatchType=t))},aq=function(e,t,i){let s,r;if(i&&i.cues)for(s=i.cues.length;s--;)(r=i.cues[s]).startTime>=e&&r.endTime<=t&&i.removeCue(r)},aH=function(e){let t=e.cues;if(!t)return;let i={};for(let s=t.length-1;s>=0;s--){let r=t[s],n=`${r.startTime}-${r.endTime}-${r.text}`;i[n]?e.removeCue(r):i[n]=r}},aV=(e,t,i)=>{let s;if(null==t||!e.length)return[];let r=Math.ceil((t-i+3)*D.ONE_SECOND_IN_TS);for(s=0;sr);s++);return e.slice(s)},az=(e,t,i)=>{if(!t.length)return e;if(i)return t.slice();let s=t[0].pts,r=0;for(;r=s);r++);return e.slice(0,r).concat(t)},aW=(e,t,i,s)=>{let r=Math.ceil((t-s)*D.ONE_SECOND_IN_TS),n=Math.ceil((i-s)*D.ONE_SECOND_IN_TS),a=e.slice(),o=e.length;for(;o--&&!(e[o].pts<=n););if(-1===o)return a;let l=o+1;for(;l--&&!(e[l].pts<=r););return l=Math.max(l,0),a.splice(l,o-l+1),a},aG=function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;let i=Object.keys(e).sort(),s=Object.keys(t).sort();if(i.length!==s.length)return!1;for(let r=0;ri))return n}return 0===s.length?0:s[s.length-1]},aQ=e=>"number"==typeof e&&isFinite(e),aY=1/60,aX=(e,t,i)=>"main"===e&&t&&i?i.hasAudio||i.hasVideo?t.hasVideo&&!i.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&i.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null,aJ=(e,t,i)=>{let s=t-nG.BACK_BUFFER_LENGTH;return e.length&&(s=Math.max(s,e.start(0))),Math.min(t-i,s)},aZ=e=>{let{startOfSegment:t,duration:i,segment:s,part:r,playlist:{mediaSequence:n,id:a,segments:o=[]},mediaIndex:l,partIndex:h,timeline:d}=e,u=o.length-1,c="mediaIndex/partIndex increment";e.getMediaInfoForTime?c=`getMediaInfoForTime (${e.getMediaInfoForTime})`:e.isSyncRequest&&(c="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(c+=` with independent ${e.independent}`);let p="number"==typeof h,m=e.segment.uri?"segment":"pre-segment",g=p?rF({preloadSegment:s})-1:0;return`${m} [${n+l}/${n+u}]`+(p?` part [${h}/${g}]`:"")+` segment start/end [${s.start} => ${s.end}]`+(p?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${t}]`+` duration [${i}]`+` timeline [${d}]`+` selected by [${c}]`+` playlist [${a}]`},a0=e=>`${e}TimingInfo`,a1=({segmentTimeline:e,currentTimeline:t,startOfSegment:i,buffered:s,overrideCheck:r})=>r||e!==t?e{if(t===i)return!1;if("audio"===s){let t=e.lastTimelineChange({type:"main"});return!t||t.to!==i}if("main"===s&&r){let t=e.pendingTimelineChange({type:"audio"});return!t||t.to!==i}return!1},a4=e=>{let t=0;return["video","audio"].forEach(function(i){let s;let r=e[`${i}TimingInfo`];if(!r)return;let{start:n,end:a}=r;"bigint"==typeof n||"bigint"==typeof a?s=d().BigInt(a)-d().BigInt(n):"number"==typeof n&&"number"==typeof a&&(s=a-n),void 0!==s&&s>t&&(t=s)}),"bigint"==typeof t&&t!!e&&Math.round(e)>t+rE,a5=(e,t)=>{if("hls"!==t)return null;let i=a4({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!i)return null;let s=e.playlist.targetDuration,r=a8({segmentDuration:i,maxDuration:2*s}),n=a8({segmentDuration:i,maxDuration:s}),a=`Segment with index ${e.mediaIndex} from playlist ${e.playlist.id} has a duration of ${i} when the reported duration is ${e.duration} and the target duration is ${s}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return r||n?{severity:r?"warn":"info",message:a}:null};class a3 extends rm.EventTarget{constructor(e,t={}){if(super(),!e)throw TypeError("Initialization settings are required");if("function"!=typeof e.currentTime)throw TypeError("No currentTime getter specified");if(!e.mediaSource)throw TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=rS(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(e){e!==this.state_&&(this.logger_(`${this.state_} -> ${e}`),this.state_=e,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}),"main"===this.loaderType_&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}),"audio"===this.loaderType_&&this.timelineChangeController_.on("timelinechange",()=>{this.hasEnoughInfoToLoad_()&&this.processLoadQueue_(),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()})}createTransmuxer_(){return n9.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&d().clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if("WAITING"!==this.state){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,d().clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)}error(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&n9.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){let e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return rC();if("main"===this.loaderType_){let{hasAudio:t,hasVideo:i,isMuxed:s}=e;if(i&&t&&!this.audioDisabled_&&!s)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;let i=nk(e),s=this.initSegments_[i];return t&&!s&&e.bytes&&(this.initSegments_[i]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),s||e}segmentKey(e,t=!1){if(!e)return null;let i=nC(e),s=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!s&&e.bytes&&(this.keyCache_[i]=s={resolvedUri:e.resolvedUri,bytes:e.bytes});let r={resolvedUri:(s||e).resolvedUri};return s&&(r.bytes=s.bytes),r}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),this.playlist_){if("INIT"===this.state&&this.couldBeginLoading_())return this.init_();this.couldBeginLoading_()&&("READY"===this.state||"INIT"===this.state)&&(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;let i=this.playlist_,s=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));let r=null;if(i&&(i.id?r=i.id:i.uri&&(r=i.uri)),this.logger_(`playlist update [${r} => ${e.id||e.uri}]`),this.syncController_.updateMediaSequenceMap(e,this.currentTime_(),this.loaderType_),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri){null!==this.mediaIndex&&(e.endList||"number"!=typeof e.partTargetDuration?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}let n=e.mediaSequence-i.mediaSequence;if(this.logger_(`live window shift [${n}]`),null!==this.mediaIndex){if(this.mediaIndex-=n,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{let e=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!e.parts||!e.parts.length||!e.parts[this.partIndex])){let e=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=e}}}s&&(s.mediaIndex-=n,s.mediaIndex<0?(s.mediaIndex=null,s.partIndex=null):(s.mediaIndex>=0&&(s.segment=e.segments[s.mediaIndex]),s.partIndex>=0&&s.segment.parts&&(s.part=s.segment.parts[s.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){this.checkBufferTimeout_&&(d().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return null===this.checkBufferTimeout_}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.resyncLoader()}resyncLoader(){this.transmuxer_&&n9.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.shouldForceTimestampOffsetAfterResync_=!0,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,i=()=>{},s=!1){if(t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let r=1,n=()=>{0==--r&&i()};for(let i in(s||!this.audioDisabled_)&&(r++,this.sourceUpdater_.removeAudio(e,t,n)),(s||"main"===this.loaderType_)&&(this.gopBuffer_=aW(this.gopBuffer_,e,t,this.timeMapping_),r++,this.sourceUpdater_.removeVideo(e,t,n)),this.inbandTextTracks_)aq(e,t,this.inbandTextTracks_[i]);aq(e,t,this.segmentMetadataTrack_),n()}monitorBuffer_(){this.checkBufferTimeout_&&d().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=d().setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&d().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=d().setTimeout(this.monitorBufferTick_.bind(this),500)}fillBuffer_(){if(this.sourceUpdater_.updating())return;let e=this.chooseNextRequest_();e&&("number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,i=this.partIndex){if(!t||!this.mediaSource_)return!1;let s="number"==typeof e&&t.segments[e],r=e+1===t.segments.length,n=!s||!s.parts||i+1===s.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&r&&n}chooseNextRequest_(){let e=this.buffered_(),t=rR(e)||0,i=rU(e,this.currentTime_()),s=!this.hasPlayed_()&&i>=1,r=i>=this.goalBufferLength_(),n=this.playlist_.segments;if(!n.length||s||r)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);let a={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(a.isSyncRequest)a.mediaIndex=aK(this.currentTimeline_,n,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${a.mediaIndex}`);else if(null!==this.mediaIndex){let e=n[this.mediaIndex],i="number"==typeof this.partIndex?this.partIndex:-1;a.startOfSegment=e.end?e.end:t,e.parts&&e.parts[i+1]?(a.mediaIndex=this.mediaIndex,a.partIndex=i+1):a.mediaIndex=this.mediaIndex+1}else{let{segmentIndex:e,startTime:i,partIndex:s}=r2.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});a.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${t}`:`currentTime ${this.currentTime_()}`,a.mediaIndex=e,a.startOfSegment=i,a.partIndex=s,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${a.mediaIndex} `)}let o=n[a.mediaIndex],l=o&&"number"==typeof a.partIndex&&o.parts&&o.parts[a.partIndex];if(!o||"number"==typeof a.partIndex&&!l)return null;"number"!=typeof a.partIndex&&o.parts&&(a.partIndex=0,l=o.parts[0]);let h=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&l&&!h&&!l.independent){if(0===a.partIndex){let e=n[a.mediaIndex-1],t=e.parts&&e.parts.length&&e.parts[e.parts.length-1];t&&t.independent&&(a.mediaIndex-=1,a.partIndex=e.parts.length-1,a.independent="previous segment")}else o.parts[a.partIndex-1].independent&&(a.partIndex-=1,a.independent="previous part")}let d=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return a.mediaIndex>=n.length-1&&d&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,a.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(a))}generateSegmentInfo_(e){let{independent:t,playlist:i,mediaIndex:s,startOfSegment:r,isSyncRequest:n,partIndex:a,forceTimestampOffset:o,getMediaInfoForTime:l}=e,h=i.segments[s],d="number"==typeof a&&h.parts[a],u={requestId:"segment-loader-"+Math.random(),uri:d&&d.resolvedUri||h.resolvedUri,mediaIndex:s,partIndex:d?a:null,isSyncRequest:n,startOfSegment:r,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:h.timeline,duration:d&&d.duration||h.duration,segment:h,part:d,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:l,independent:t},c=void 0!==o?o:this.isPendingTimestampOffset_;u.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:h.timeline,currentTimeline:this.currentTimeline_,startOfSegment:r,buffered:this.buffered_(),overrideCheck:c});let p=rR(this.sourceUpdater_.audioBuffered());return"number"==typeof p&&(u.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(u.gopsToAlignWith=aV(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),u}timestampOffsetForSegment_(e){return a1(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;let t=this.currentTime_(),i=e.bandwidth,s=this.pendingSegment_.duration,r=r2.estimateSegmentRequestTime(s,i,this.playlist_,e.bytesReceived),n=function(e,t,i=1){return((e.length?e.end(e.length-1):0)-t)/i}(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(r<=n)return;let a=aD({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:s,timeUntilRebuffer:n,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!a)return;let o=r-n-a.rebufferingImpact,l=.5;n<=rE&&(l=1),a.playlist&&a.playlist.uri!==this.playlist_.uri&&!(o{s[e.stream]=s[e.stream]||{startTime:1/0,captions:[],endTime:0};let t=s[e.stream];t.startTime=Math.min(t.startTime,e.startTime+i),t.endTime=Math.max(t.endTime,e.endTime+i),t.captions.push(e)}),Object.keys(s).forEach(e=>{let{startTime:t,endTime:r,captions:n}=s[e],a=this.inbandTextTracks_;this.logger_(`adding cues from ${t} -> ${r} for ${e}`),aM(a,this.vhs_.tech_,e),aq(t,r,a[e]),aR({captionArray:n,inbandTextTracks:a,timestampOffset:i})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,i){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i));return}this.addMetadataToTextTrack(i,t,this.duration_())}}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){let e=this.callQueue_;this.callQueue_=[],e.forEach(e=>e())}processLoadQueue_(){let e=this.loadQueue_;this.loadQueue_=[],e.forEach(e=>e())}hasEnoughInfoToLoad_(){if("audio"!==this.loaderType_)return!0;let e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!a2({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;let e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;let{hasAudio:i,hasVideo:s,isMuxed:r}=t;return!(s&&!e.videoTimingInfo||i&&!this.audioDisabled_&&!r&&!e.audioTimingInfo||a2({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){this.callQueue_.push(this.handleData_.bind(this,e,t));return}let i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[a0(t.type)].start;else{let e;let t=this.getCurrentMediaInfo_(),s="main"===this.loaderType_&&t&&t.hasVideo;s&&(e=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:s,firstVideoFrameTimeForData:e,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:"main"===this.loaderType_});let e=this.chooseNextRequest_();if(e.mediaIndex!==i.mediaIndex||e.partIndex!==i.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}updateAppendInitSegmentStatus(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:s}){if(i){let e=nk(i);if(this.activeInitSegmentId_===e)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=e}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=s,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},s){let r=this.sourceUpdater_.audioBuffered(),n=this.sourceUpdater_.videoBuffered();r.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+rO(r).join(", ")),n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+rO(n).join(", "));let a=r.length?r.start(0):0,o=r.length?r.end(r.length-1):0,l=n.length?n.start(0):0,h=n.length?n.end(n.length-1):0;if(o-a<=1&&h-l<=1){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${rO(r).join(", ")}, video buffer: ${rO(n).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i}));let u=this.currentTime_()-1;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${u}`),this.remove(0,u,()=>{this.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=d().setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:i},s){if(s){if(22===s.code){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",s),this.error(`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:s,bytes:r}){if(!r){let e=[s],t=s.byteLength;i&&(e.unshift(i),t+=i.byteLength),r=aO({bytes:t,segments:e})}this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:r},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:r}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;let s=this.pendingSegment_.segment,r=`${e}TimingInfo`;s[r]||(s[r]={}),s[r].transmuxerPrependedSeconds=i.prependedContentDuration||0,s[r].transmuxedPresentationStart=i.start.presentation,s[r].transmuxedDecodeStart=i.start.decode,s[r].transmuxedPresentationEnd=i.end.presentation,s[r].transmuxedDecodeEnd=i.end.decode,s[r].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){let{type:i,data:s}=t;if(!s||!s.byteLength||"audio"===i&&this.audioDisabled_)return;let r=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:r,data:s})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){this.loadQueue_.push(()=>{let t=(0,b.Z)({},e,{forceTimestampOffset:!0});(0,b.Z)(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));let t=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),s=null!==this.mediaIndex,r=e.timeline!==this.currentTimeline_&&e.timeline>0;this.logger_(`Requesting ${aZ(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=a_({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:i||s&&r,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:t,level:i,stream:s})=>{this.logger_(`${aZ(e)} logged from transmuxer stream ${s} as a ${i}: ${t}`)}})}trimBackBuffer_(e){let t=aJ(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){let t=e.segment,i=e.part,s={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},r=e.playlist.segments[e.mediaIndex-1];if(r&&r.timeline===t.timeline&&(r.videoTimingInfo?s.baseStartTime=r.videoTimingInfo.transmuxedDecodeEnd:r.audioTimingInfo&&(s.baseStartTime=r.audioTimingInfo.transmuxedDecodeEnd)),t.key){let i=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);s.key=this.segmentKey(t.key),s.key.iv=i}return t.map&&(s.map=this.initSegmentForMap(t.map)),s}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e3*e.playlist.targetDuration,n=s&&s.end&&this.currentTime_()-s.end>3*e.playlist.partTargetDuration;if(r||n){this.logger_(`bad ${r?"segment":"part"} ${aZ(e)}`),this.resetEverything();return}null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duratione.toUpperCase())},a9=["video","audio"],oe=(e,t)=>{let i=t[`${e}Buffer`];return i&&i.updating||t.queuePending[e]},ot=(e,t)=>{for(let i=0;i{if(0===t.queue.length)return;let i=0,s=t.queue[i];if("mediaSource"===s.type){t.updating()||"closed"===t.mediaSource.readyState||(t.queue.shift(),s.action(t),s.doneFn&&s.doneFn(),oi("audio",t),oi("video",t));return}if(!("mediaSource"===e||!t.ready()||"closed"===t.mediaSource.readyState||oe(e,t))){if(s.type!==e){if(null===(i=ot(e,t.queue)))return;s=t.queue[i]}if(t.queue.splice(i,1),t.queuePending[e]=s,s.action(e,t),!s.doneFn){t.queuePending[e]=null,oi(e,t);return}}},os=(e,t)=>{let i=t[`${e}Buffer`],s=a7(e);i&&(i.removeEventListener("updateend",t[`on${s}UpdateEnd_`]),i.removeEventListener("error",t[`on${s}Error_`]),t.codecs[e]=null,t[`${e}Buffer`]=null)},or=(e,t)=>e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t),on={appendBuffer:(e,t,i)=>(s,r)=>{let n=r[`${s}Buffer`];if(or(r.mediaSource,n)){r.logger_(`Appending segment ${t.mediaIndex}'s ${e.length} bytes to ${s}Buffer`);try{n.appendBuffer(e)}catch(e){r.logger_(`Error with code ${e.code} `+(22===e.code?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${t.mediaIndex} to ${s}Buffer`),r.queuePending[s]=null,i(e)}}},remove:(e,t)=>(i,s)=>{let r=s[`${i}Buffer`];if(or(s.mediaSource,r)){s.logger_(`Removing ${e} to ${t} from ${i}Buffer`);try{r.remove(e,t)}catch(r){s.logger_(`Remove ${e} to ${t} from ${i}Buffer failed`)}}},timestampOffset:e=>(t,i)=>{let s=i[`${t}Buffer`];or(i.mediaSource,s)&&(i.logger_(`Setting ${t}timestampOffset to ${e}`),s.timestampOffset=e)},callback:e=>(t,i)=>{e()},endOfStream:e=>t=>{if("open"===t.mediaSource.readyState){t.logger_(`Calling mediaSource endOfStream(${e||""})`);try{t.mediaSource.endOfStream(e)}catch(e){rm.log.warn("Failed to call media source endOfStream",e)}}},duration:e=>t=>{t.logger_(`Setting mediaSource duration to ${e}`);try{t.mediaSource.duration=e}catch(e){rm.log.warn("Failed to set media source duration",e)}},abort:()=>(e,t)=>{if("open"!==t.mediaSource.readyState)return;let i=t[`${e}Buffer`];if(or(t.mediaSource,i)){t.logger_(`calling abort on ${e}Buffer`);try{i.abort()}catch(t){rm.log.warn(`Failed to abort on ${e}Buffer`,t)}}},addSourceBuffer:(e,t)=>i=>{let s=a7(e),r=(0,C._5)(t);i.logger_(`Adding ${e}Buffer with codec ${t} to mediaSource`);let n=i.mediaSource.addSourceBuffer(r);n.addEventListener("updateend",i[`on${s}UpdateEnd_`]),n.addEventListener("error",i[`on${s}Error_`]),i.codecs[e]=t,i[`${e}Buffer`]=n},removeSourceBuffer:e=>t=>{let i=t[`${e}Buffer`];if(os(e,t),or(t.mediaSource,i)){t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(i)}catch(t){rm.log.warn(`Failed to removeSourceBuffer ${e}Buffer`,t)}}},changeType:e=>(t,i)=>{let s=i[`${t}Buffer`],r=(0,C._5)(e);if(or(i.mediaSource,s)&&i.codecs[t]!==e){i.logger_(`changing ${t}Buffer codec from ${i.codecs[t]} to ${e}`);try{s.changeType(r),i.codecs[t]=e}catch(e){rm.log.warn(`Failed to changeType on ${t}Buffer`,e)}}}},oa=({type:e,sourceUpdater:t,action:i,doneFn:s,name:r})=>{t.queue.push({type:e,action:i,doneFn:s,name:r}),oi(e,t)},oo=(e,t)=>i=>{if(t.queuePending[e]){let i=t.queuePending[e].doneFn;t.queuePending[e]=null,i&&i(t[`${e}Error_`])}oi(e,t)};class ol extends rm.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>oi("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=rS("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=oo("video",this),this.onAudioUpdateEnd_=oo("audio",this),this.onVideoError_=e=>{this.videoError_=e},this.onAudioError_=e=>{this.audioError_=e},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){oa({type:"mediaSource",sourceUpdater:this,action:on.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){oa({type:e,sourceUpdater:this,action:on.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){rm.log.error("removeSourceBuffer is not supported!");return}oa({type:"mediaSource",sourceUpdater:this,action:on.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!rm.browser.IS_FIREFOX&&d().MediaSource&&d().MediaSource.prototype&&"function"==typeof d().MediaSource.prototype.removeSourceBuffer}static canChangeType(){return d().SourceBuffer&&d().SourceBuffer.prototype&&"function"==typeof d().SourceBuffer.prototype.changeType}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){rm.log.error("changeType is not supported!");return}oa({type:e,sourceUpdater:this,action:on.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||"object"!=typeof e||0===Object.keys(e).length)throw Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{let i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i)})}appendBuffer(e,t){let{segmentInfo:i,type:s,bytes:r}=e;if(this.processedAppend_=!0,"audio"===s&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${r.length} until video append`);return}if(oa({type:s,sourceUpdater:this,action:on.appendBuffer(r,i||{mediaIndex:-1},t),doneFn:t,name:"appendBuffer"}),"video"===s){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;let e=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${e.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,e.forEach(e=>{this.appendBuffer.apply(this,e)})}}audioBuffered(){return or(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:rC()}videoBuffered(){return or(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:rC()}buffered(){let e=or(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=or(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():rA(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=a6){oa({type:"mediaSource",sourceUpdater:this,action:on.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=a6){"string"!=typeof e&&(e=void 0),oa({type:"mediaSource",sourceUpdater:this,action:on.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=a6){if(!this.audioBuffered().length||0===this.audioBuffered().end(0)){i();return}oa({type:"audio",sourceUpdater:this,action:on.remove(e,t),doneFn:i,name:"remove"})}removeVideo(e,t,i=a6){if(!this.videoBuffered().length||0===this.videoBuffered().end(0)){i();return}oa({type:"video",sourceUpdater:this,action:on.remove(e,t),doneFn:i,name:"remove"})}updating(){return!!(oe("audio",this)||oe("video",this))}audioTimestampOffset(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(oa({type:"audio",sourceUpdater:this,action:on.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset!==e&&(oa({type:"video",sourceUpdater:this,action:on.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&oa({type:"audio",sourceUpdater:this,action:on.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&oa({type:"video",sourceUpdater:this,action:on.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),a9.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>os(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}let oh=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e))),od=e=>Array.from(new Uint8Array(e)).map(e=>e.toString(16).padStart(2,"0")).join(""),ou=new Uint8Array("\n\n".split("").map(e=>e.charCodeAt(0)));class oc extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class op extends a3{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.loaderType_="subtitle",this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return rC();let e=this.subtitlesTrack_.cues;return rC([[e[0].startTime,e[e.length-1].startTime]])}initSegmentForMap(e,t=!1){if(!e)return null;let i=nk(e),s=this.initSegments_[i];if(t&&!s&&e.bytes){let t=new Uint8Array(ou.byteLength+e.bytes.byteLength);t.set(e.bytes),t.set(ou,e.bytes.byteLength),this.initSegments_[i]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:t}}return s||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return void 0===e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}remove(e,t){aq(e,t,this.subtitlesTrack_)}fillBuffer_(){let e=this.chooseNextRequest_();if(e){if(null===this.syncController_.timestampOffsetForTimeline(e.timeline)){this.syncController_.one("timestampoffset",()=>{this.state="READY",this.paused()||this.monitorBuffer_()}),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,i){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===at.TIMEOUT&&this.handleTimeout_(),e.code===at.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}let s=this.pendingSegment_;this.saveBandwidthRelatedStats_(s.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");let r=s.segment;if(r.map&&(r.map.bytes=t.map.bytes),s.bytes=t.bytes,"function"!=typeof d().WebVTT&&"function"==typeof this.loadVttJs){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,i),()=>this.stopForError({message:"Error loading vtt.js"}));return}r.requested=!0;try{this.parseVTTCues_(s)}catch(e){this.stopForError({message:e.message});return}if(this.updateTimeMapping_(s,this.syncController_.timelines[s.timeline],this.playlist_),s.cues.length?s.timingInfo={start:s.cues[0].startTime,end:s.cues[s.cues.length-1].endTime}:s.timingInfo={start:s.startOfSegment,end:s.startOfSegment+s.duration},s.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}s.byteLength=s.bytes.byteLength,this.mediaSecondsLoaded+=r.duration,s.cues.forEach(e=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new(d()).VTTCue(e.startTime,e.endTime,e.text):e)}),aH(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t;let i=!1;if("function"!=typeof d().WebVTT)throw new oc;"function"==typeof d().TextDecoder?t=new(d()).TextDecoder("utf8"):(t=d().WebVTT.StringDecoder(),i=!0);let s=new(d()).WebVTT.Parser(d(),d().vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},s.oncue=e.cues.push.bind(e.cues),s.ontimestampmap=t=>{e.timestampmap=t},s.onparsingerror=e=>{rm.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){let t=e.segment.map.bytes;i&&(t=oh(t)),s.parse(t)}let r=e.bytes;i&&(r=oh(r)),s.parse(r),s.flush()}updateTimeMapping_(e,t,i){let s=e.segment;if(!t)return;if(!e.cues.length){s.empty=!0;return}let{MPEGTS:r,LOCAL:n}=e.timestampmap,a=r/D.ONE_SECOND_IN_TS-n+t.mapping;if(e.cues.forEach(e=>{let i=e.endTime-e.startTime,s=0===r?e.startTime+a:this.handleRollover_(e.startTime+a,t.time);e.startTime=Math.max(s,0),e.endTime=Math.max(s+i,0)}),!i.syncInfo){let t=e.cues[0].startTime,r=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(t,r-s.duration)}}}handleRollover_(e,t){let i;if(null===t)return e;let s=e*D.ONE_SECOND_IN_TS,r=t*D.ONE_SECOND_IN_TS;for(i=r4294967296;)s+=i;return s/D.ONE_SECOND_IN_TS}}let om=function(e,t){let i=e.cues;for(let e=0;e=s.adStartTime&&t<=s.adEndTime)return s}return null},og=function(e,t,i=0){let s;if(!e.segments)return;let r=i;for(let i=0;ii!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(e,t,i,s,r,n)=>{if(!n)return null;let a=e.getMediaSequenceMap(n);if(!a||0===a.size||void 0===t.mediaSequence||!Array.isArray(t.segments)||!t.segments.length)return null;let o=t.mediaSequence,l=0;for(let e of t.segments){let t=a.get(o);if(!t)break;if(r>=t.start&&r=e&&r{if(!Object.keys(e.timelineToDatetimeMappings).length)return null;let n=null,a=null,o=rN(t);r=r||0;for(let i=0;i{let n=null,a=null;r=r||0;let o=rN(t);for(let e=0;e=e)&&(a=e,n={time:d,segmentIndex:l.segmentIndex,partIndex:l.partIndex})}}return n}},{name:"Discontinuity",run:(e,t,i,s,r)=>{let n=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length){let i=null;for(let s=0;s=e)&&(i=e,n={time:l.time,segmentIndex:a,partIndex:null})}}}return n}},{name:"Playlist",run:(e,t,i,s,r)=>t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}];class o_ extends rm.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={},this.mediaSequenceStorage_=new Map,this.logger_=rS("SyncController")}getMediaSequenceMap(e){return this.mediaSequenceStorage_.get(e)}updateMediaSequenceMap(e,t,i){let s;if(void 0===e.mediaSequence||!Array.isArray(e.segments)||!e.segments.length)return;let r=this.getMediaSequenceMap(i),n=new Map,a=e.mediaSequence;r?r.has(e.mediaSequence)?s=r.get(e.mediaSequence).start:(this.logger_(`MediaSequence sync for ${i} segment loader - received a gap between playlists. +Fallback base time to: ${t}. +Received media sequence: ${a}. +Current map: `,r),s=t):s=0,this.logger_(`MediaSequence sync for ${i} segment loader. +Received media sequence: ${a}. +base time is ${s} +Current map: `,r),e.segments.forEach(e=>{let t=s,i=t+e.duration;n.set(a,{start:t,end:i}),a++,s=i}),this.mediaSequenceStorage_.set(i,n)}getSyncPoint(e,t,i,s,r){if(t!==1/0)return of.find(({name:e})=>"VOD"===e).run(this,e,t);let n=this.runStrategies_(e,t,i,s,r);if(!n.length)return null;for(let t of n){let{syncPoint:i,strategy:r}=t,{segmentIndex:n,time:a}=i;if(n<0)continue;let o=a+e.segments[n].duration;if(this.logger_(`Strategy: ${r}. Current time: ${s}. selected segment: ${n}. Time: [${a} -> ${o}]}`),s>=a&&s0&&(s.time*=-1),Math.abs(s.time+rW({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:s.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,s,r){let n=[];for(let a=0;a86400){rm.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);return}for(let s=i-1;s>=0;s--){let i=e.segments[s];if(i&&void 0!==i.start){t.syncInfo={mediaSequence:e.mediaSequence+s,time:i.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){let t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){let i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),s=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:s.start}));let r=s.dateTimeObject;s.discontinuity&&t&&r&&(this.timelineToDatetimeMappings[s.timeline]=-(r.getTime()/1e3))}timestampOffsetForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].time}mappingForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){let s,r;let n=e.segment,a=e.part,o=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${o.time}] [mapping: ${o.mapping}]`)),s=e.startOfSegment,r=t.end+o.mapping;else{if(!o)return!1;s=t.start+o.mapping,r=t.end+o.mapping}return a&&(a.start=s,a.end=r),(!n.start||so){let s;s=a<0?i.start-rW({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:r}):i.end+rW({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:r}),this.discontinuities[n]={time:s,accuracy:o}}}}dispose(){this.trigger("dispose"),this.off()}}class oy extends rm.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){return"number"==typeof t&&"number"==typeof i&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){return"number"==typeof t&&"number"==typeof i&&(this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e],this.trigger("timelinechange")),this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}var ov=nX(nJ(nZ(function(){var e,t,s,r=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t){if(2==arguments.length)for(var i=t.length,s=0;s>7)*283)^e]=e;for(t=i=0;!u[t];t^=s||1,i=m[i]||1)for(e=0,n=(n=i^i<<1^i<<2^i<<3^i<<4)>>8^255&n^99,u[t]=n,c[n]=t,o=16843009*p[r=p[s=p[t]]]^65537*r^257*s^16843008*t,a=257*p[n]^16843008*n;e<4;e++)h[e][t]=a=a<<24^a>>>8,d[e][n]=o=o<<24^o>>>8;for(e=0;e<5;e++)h[e]=h[e].slice(0),d[e]=d[e].slice(0);return l},a=null;class o{constructor(e){let t,i,s;a||(a=n()),this._tables=[[a[0][0].slice(),a[0][1].slice(),a[0][2].slice(),a[0][3].slice(),a[0][4].slice()],[a[1][0].slice(),a[1][1].slice(),a[1][2].slice(),a[1][3].slice(),a[1][4].slice()]];let r=this._tables[0][4],o=this._tables[1],l=e.length,h=1;if(4!==l&&6!==l&&8!==l)throw Error("Invalid aes key size");let d=e.slice(0),u=[];for(this._key=[d,u],t=l;t<4*l+28;t++)s=d[t-1],(t%l==0||8===l&&t%l==4)&&(s=r[s>>>24]<<24^r[s>>16&255]<<16^r[s>>8&255]<<8^r[255&s],t%l==0&&(s=s<<8^s>>>24^h<<24,h=h<<1^(h>>7)*283)),d[t]=d[t-l]^s;for(i=0;t;i++,t--)s=d[3&i?t:t-4],t<=4||i<4?u[i]=s:u[i]=o[0][r[s>>>24]]^o[1][r[s>>16&255]]^o[2][r[s>>8&255]]^o[3][r[255&s]]}decrypt(e,t,i,s,r,n){let a,o,l,h;let d=this._key[1],u=e^d[0],c=s^d[1],p=i^d[2],m=t^d[3],g=d.length/4-2,f=4,_=this._tables[1],y=_[0],v=_[1],T=_[2],b=_[3],S=_[4];for(h=0;h>>24]^v[c>>16&255]^T[p>>8&255]^b[255&m]^d[f],o=y[c>>>24]^v[p>>16&255]^T[m>>8&255]^b[255&u]^d[f+1],l=y[p>>>24]^v[m>>16&255]^T[u>>8&255]^b[255&c]^d[f+2],m=y[m>>>24]^v[u>>16&255]^T[c>>8&255]^b[255&p]^d[f+3],f+=4,u=a,c=o,p=l;for(h=0;h<4;h++)r[(3&-h)+n]=S[u>>>24]<<24^S[c>>16&255]<<16^S[p>>8&255]<<8^S[255&m]^d[f++],a=u,u=c,c=p,p=m,m=a}}class l extends r{constructor(){super(r),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}let h=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},d=function(e,t,i){let s,r,n,a,l,d,u,c,p;let m=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),g=new o(Array.prototype.slice.call(t)),f=new Uint8Array(e.byteLength),_=new Int32Array(f.buffer);for(p=0,s=i[0],r=i[1],n=i[2],a=i[3];p{let s=e[i];("function"===ArrayBuffer.isView?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer)?t[i]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}:t[i]=s}),t};self.onmessage=function(e){let t=e.data;new u(new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4),function(e,i){self.postMessage(m({source:t.source,decrypted:i}),[i.buffer])})}})));let oT=e=>{let t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},ob=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},oS=(e,t)=>{t.activePlaylistLoader=e,e.load()},ok=(e,t)=>()=>{let{segmentLoaders:{[e]:i,main:s},mediaTypes:{[e]:r}}=t,n=r.activeTrack(),a=r.getActiveGroup(),o=r.activePlaylistLoader,l=r.lastGroup_;if((!a||!l||a.id!==l.id)&&(r.lastGroup_=a,r.lastTrack_=n,ob(i,r),a&&!a.isMainPlaylist)){if(!a.playlistLoader){o&&s.resetEverything();return}i.resyncLoader(),oS(a.playlistLoader,r)}},oC=(e,t)=>()=>{let{segmentLoaders:{[e]:i},mediaTypes:{[e]:s}}=t;s.lastGroup_=null,i.abort(),i.pause()},oE=(e,t)=>()=>{let{mainPlaylistLoader:i,segmentLoaders:{[e]:s,main:r},mediaTypes:{[e]:n}}=t,a=n.activeTrack(),o=n.getActiveGroup(),l=n.activePlaylistLoader,h=n.lastTrack_;if((!h||!a||h.id!==a.id)&&(n.lastGroup_=o,n.lastTrack_=a,ob(s,n),o)){if(o.isMainPlaylist){if(!a||!h||a.id===h.id)return;let e=t.vhs.playlistController_,s=e.selectPlaylist();if(e.media()===s)return;n.logger_(`track change. Switching main audio from ${h.id} to ${a.id}`),i.pause(),r.resetEverything(),e.fastQualityChange_(s);return}if("AUDIO"===e){if(!o.playlistLoader){r.setAudio(!0),r.resetEverything();return}s.setAudio(!0),r.setAudio(!1)}if(l===o.playlistLoader){oS(o.playlistLoader,n);return}s.track&&s.track(a),s.resetEverything(),oS(o.playlistLoader,n)}},ow={AUDIO:(e,t)=>()=>{let{mediaTypes:{[e]:i},excludePlaylist:s}=t,r=i.activeTrack(),n=i.activeGroup(),a=(n.filter(e=>e.default)[0]||n[0]).id,o=i.tracks[a];if(r===o){s({error:{message:"Problem encountered loading the default audio track."}});return}for(let e in rm.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),i.tracks)i.tracks[e].enabled=i.tracks[e]===o;i.onTrackChanged()},SUBTITLES:(e,t)=>()=>{let{mediaTypes:{[e]:i}}=t;rm.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");let s=i.activeTrack();s&&(s.mode="disabled"),i.onTrackChanged()}},ox={AUDIO:(e,t,i)=>{if(!t)return;let{tech:s,requestOptions:r,segmentLoaders:{[e]:n}}=i;t.on("loadedmetadata",()=>{let e=t.media();n.playlist(e,r),(!s.paused()||e.endList&&"none"!==s.preload())&&n.load()}),t.on("loadedplaylist",()=>{n.playlist(t.media(),r),s.paused()||n.load()}),t.on("error",ow[e](e,i))},SUBTITLES:(e,t,i)=>{let{tech:s,requestOptions:r,segmentLoaders:{[e]:n},mediaTypes:{[e]:a}}=i;t.on("loadedmetadata",()=>{let e=t.media();n.playlist(e,r),n.track(a.activeTrack()),(!s.paused()||e.endList&&"none"!==s.preload())&&n.load()}),t.on("loadedplaylist",()=>{n.playlist(t.media(),r),s.paused()||n.load()}),t.on("error",ow[e](e,i))}},oI={AUDIO:(e,t)=>{let{vhs:i,sourceType:s,segmentLoaders:{[e]:r},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[e]:{groups:o,tracks:l,logger_:h}},mainPlaylistLoader:d}=t,u=r1(d.main);for(let r in(!a[e]||0===Object.keys(a[e]).length)&&(a[e]={main:{default:{default:!0}}},u&&(a[e].main.default.playlists=d.main.playlists)),a[e])for(let c in o[r]||(o[r]=[]),a[e][r]){let p,m=a[e][r][c];if(u?(h(`AUDIO group '${r}' label '${c}' is a main playlist`),m.isMainPlaylist=!0,p=null):p="vhs-json"===s&&m.playlists?new np(m.playlists[0],i,n):m.resolvedUri?new np(m.resolvedUri,i,n):m.playlists&&"dash"===s?new nW(m.playlists[0],i,n,d):null,m=rk({id:c,playlistLoader:p},m),ox[e](e,m.playlistLoader,t),o[r].push(m),void 0===l[c]){let e=new rm.AudioTrack({id:c,kind:oT(m),enabled:!1,language:m.language,default:m.default,label:c});l[c]=e}}r.on("error",ow[e](e,t))},SUBTITLES:(e,t)=>{let{tech:i,vhs:s,sourceType:r,segmentLoaders:{[e]:n},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[e]:{groups:l,tracks:h}},mainPlaylistLoader:d}=t;for(let n in o[e])for(let u in l[n]||(l[n]=[]),o[e][n]){let c;if(!s.options_.useForcedSubtitles&&o[e][n][u].forced)continue;let p=o[e][n][u];if("hls"===r)c=new np(p.resolvedUri,s,a);else if("dash"===r){if(!p.playlists.filter(e=>e.excludeUntil!==1/0).length)return;c=new nW(p.playlists[0],s,a,d)}else"vhs-json"===r&&(c=new np(p.playlists?p.playlists[0]:p.resolvedUri,s,a));if(p=rk({id:u,playlistLoader:c},p),ox[e](e,p.playlistLoader,t),l[n].push(p),void 0===h[u]){let e=i.addRemoteTextTrack({id:u,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:u},!1).track;h[u]=e}}n.on("error",ow[e](e,t))},"CLOSED-CAPTIONS":(e,t)=>{let{tech:i,main:{mediaGroups:s},mediaTypes:{[e]:{groups:r,tracks:n}}}=t;for(let t in s[e])for(let a in r[t]||(r[t]=[]),s[e][t]){let o=s[e][t][a];if(!/^(?:CC|SERVICE)/.test(o.instreamId))continue;let l=i.options_.vhs&&i.options_.vhs.captionServices||{},h={label:a,language:o.language,instreamId:o.instreamId,default:o.default&&o.autoselect};if(l[h.instreamId]&&(h=rk(h,l[h.instreamId])),void 0===h.default&&delete h.default,r[t].push(rk({id:a},o)),void 0===n[a]){let e=i.addRemoteTextTrack({id:h.instreamId,kind:"captions",default:h.default,language:h.language,label:h.label},!1).track;n[a]=e}}}},oP=(e,t)=>{for(let i=0;ii=>{let{mainPlaylistLoader:s,mediaTypes:{[e]:{groups:r}}}=t,n=s.media();if(!n)return null;let a=null;n.attributes[e]&&(a=r[n.attributes[e]]);let o=Object.keys(r);if(!a){if("AUDIO"===e&&o.length>1&&r1(t.main))for(let e=0;ee.id===i.id)[0]||null},oA={AUDIO:(e,t)=>()=>{let{mediaTypes:{[e]:{tracks:i}}}=t;for(let e in i)if(i[e].enabled)return i[e];return null},SUBTITLES:(e,t)=>()=>{let{mediaTypes:{[e]:{tracks:i}}}=t;for(let e in i)if("showing"===i[e].mode||"hidden"===i[e].mode)return i[e];return null}},oD=(e,{mediaTypes:t})=>()=>{let i=t[e].activeTrack();return i?t[e].activeGroup(i):null},oO=e=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{oI[t](t,e)});let{mediaTypes:t,mainPlaylistLoader:i,tech:s,vhs:r,segmentLoaders:{AUDIO:n,main:a}}=e;["AUDIO","SUBTITLES"].forEach(i=>{t[i].activeGroup=oL(i,e),t[i].activeTrack=oA[i](i,e),t[i].onGroupChanged=ok(i,e),t[i].onGroupChanging=oC(i,e),t[i].onTrackChanged=oE(i,e),t[i].getActiveGroup=oD(i,e)});let o=t.AUDIO.activeGroup();if(o){let e=(o.filter(e=>e.default)[0]||o[0]).id;t.AUDIO.tracks[e].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),t.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}i.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanged())}),i.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanging())});let l=()=>{t.AUDIO.onTrackChanged(),s.trigger({type:"usage",name:"vhs-audio-change"})};for(let e in s.audioTracks().addEventListener("change",l),s.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),r.on("dispose",()=>{s.audioTracks().removeEventListener("change",l),s.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),s.clearTracks("audio"),t.AUDIO.tracks)s.audioTracks().addTrack(t.AUDIO.tracks[e])},oM=()=>{let e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:a6,activeTrack:a6,getActiveGroup:a6,onGroupChanged:a6,onTrackChanged:a6,lastTrack_:null,logger_:rS(`MediaGroups[${t}]`)}}),e};class oR{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){1===e&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=rT(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(e=>[e.ID,e])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class oU extends rm.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new oR,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=rS("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";let i=t.serverUri||t.serverURL;if(!i){this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),this.trigger("error");return}if(i.startsWith("data:")){this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1));return}this.steeringManifest.reloadUri=rT(e,i),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){let t=this.steeringManifest.reloadUri;if(!t)return;let i=e?t:this.getRequestURI(t);if(!i){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}this.request_=this.xhr_({uri:i},(e,t)=>{if(e){if(410===t.status){this.logger_(`manifest request 410 ${e}.`),this.logger_(`There will be no more content steering requests to ${i} this session.`),this.excludedSteeringManifestURLs.add(i);return}if(429===t.status){let i=t.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${e}.`),this.logger_(`content steering will retry in ${i} seconds.`),this.startTTLTimeout_(parseInt(i,10));return}this.logger_(`manifest failed to load ${e}.`),this.startTTLTimeout_();return}let s=JSON.parse(this.request_.responseText);this.assignSteeringProperties_(s),this.startTTLTimeout_()})}setProxyServerUrl_(e){let t=new(d()).URL(e),i=new(d()).URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){let t=JSON.parse(d().atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){let t=new(d()).URL(e),i=this.getPathway(),s=this.getBandwidth_();if(i){let e=`_${this.manifestType_}_pathway`;t.searchParams.set(e,i)}if(s){let e=`_${this.manifestType_}_throughput`;t.searchParams.set(e,s)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());let t=(e=>{for(let t of e)if(this.availablePathways_.has(t))return t;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==t&&(this.currentPathway=t,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;let t=e=>this.excludedSteeringManifestURLs.has(e);if(this.proxyServerUrl_){let i=this.setProxyServerUrl_(e);if(!t(i))return i}let i=this.setSteeringParams_(e);return t(i)?null:i}startTTLTimeout_(e=this.steeringManifest.ttl){this.ttlTimeout_=d().setTimeout(()=>{this.requestSteeringManifest()},1e3*e)}clearTTLTimeout_(){d().clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new oR}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(rT(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}let oB=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],oN=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},oj=function({currentPlaylist:e,buffered:t,currentTime:i,nextPlaylist:s,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:a,bufferBasedABR:o,log:l}){if(!s)return rm.log.warn("We received no playlist to switch to. Please check your stream."),!1;let h=`allowing switch ${e&&e.id||"null"} -> ${s.id}`;if(!e)return l(`${h} as current playlist is not set`),!0;if(s.id===e.id)return!1;let d=!!rI(t,i).length;if(!e.endList)return d||"number"!=typeof e.partTargetDuration?(l(`${h} as current playlist is live`),!0):(l(`not ${h} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);let u=rU(t,i),c=o?nG.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:nG.MAX_BUFFER_LOW_WATER_LINE;if(am)&&u>=r){let e=`${h} as forwardBuffer >= bufferLowWaterLine (${u} >= ${r})`;return o&&(e+=` and next bandwidth > current bandwidth (${p} > ${m})`),l(e),!0}return l(`not ${h} as no switching criteria met`),!1};class oF extends rm.EventTarget{constructor(e){super();let{src:t,withCredentials:i,tech:s,bandwidth:r,externVhs:n,useCueTags:a,playlistExclusionDuration:o,enableLowInitialPlaylist:h,sourceType:u,cacheEncryptionKeys:c,bufferBasedABR:p,leastPixelDiffSelector:m,captionServices:g}=e;if(!t)throw Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:f}=e;null==f&&(f=1/0),l=n,this.bufferBasedABR=!!p,this.leastPixelDiffSelector=!!m,this.withCredentials=i,this.tech_=s,this.vhs_=s.vhs,this.sourceType_=u,this.useCueTags_=a,this.playlistExclusionDuration=o,this.maxPlaylistRetries=f,this.enableLowInitialPlaylist=h,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:f,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=oM(),this.mediaSource=new(d()).MediaSource,this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.seekable_=rC(),this.hasPlayed_=!1,this.syncController_=new o_(e),this.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new ov,this.sourceUpdater_=new ol(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new oy,this.keyStatusMap_=new Map;let _={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:g,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:r,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:c,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_="dash"===this.sourceType_?new nW(t,this.vhs_,rk(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new np(t,this.vhs_,rk(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new a3(rk(_,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new a3(rk(_,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new op(rk(_,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((e,t)=>{function i(){s.off("vttjserror",r),e()}function r(){s.off("vttjsloaded",i),t()}s.one("vttjsloaded",i),s.one("vttjserror",r),s.addWebVttScript_()})}),e),this.contentSteeringController_=new oU(this.vhs_.xhr,()=>this.mainSegmentLoader_.bandwidth),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),oB.forEach(e=>{this[e+"_"]=oN.bind(this,e)}),this.logger_=rS("pc"),this.triggeredFmp4Usage=!1,"none"===this.tech_.preload()?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;let y="none"===this.tech_.preload()?"play":"loadstart";this.tech_.one(y,()=>{let e=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-e,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){let e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return -1===e||-1===t?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){let t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,i){let s=this.media(),r=s&&(s.id||s.uri),n=e&&(e.id||e.uri);r&&r!==n&&(this.logger_(`switch media ${r} -> ${n} from ${t}`),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})),this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{let t=this.mediaTypes_[e],i=t?t.activeGroup():null,s=this.contentSteeringController_.getPathway();if(i&&s){let t=(i.length?i[0].playlists:i.playlists).filter(e=>e.attributes.serviceLocation===s);t.length&&this.mediaTypes_[e].activePlaylistLoader.media(t[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=d().setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(d().clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){let e;let t=this.main(),i=t&&t.playlists||[];if(!t||!t.mediaGroups||!t.mediaGroups.AUDIO)return i;let s=t.mediaGroups.AUDIO,r=Object.keys(s);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)e=this.mediaTypes_.AUDIO.activeTrack();else{let t=s.main||r.length&&s[r[0]];for(let i in t)if(t[i].default){e={label:i};break}}if(!e)return i;let n=[];for(let i in s)if(s[i][e.label]){let r=s[i][e.label];if(r.playlists&&r.playlists.length)n.push.apply(n,r.playlists);else if(r.uri)n.push(r);else if(t.playlists.length)for(let e=0;e{let e=this.mainPlaylistLoader_.media(),t=1500*e.targetDuration;rJ(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&"none"!==this.tech_.preload()&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),oO({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){let t;if(this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_(),this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t)||(this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial"),!("vhs-json"===this.sourceType_&&this.initialMedia_.segments)))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on("error",()=>{let e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{let e=this.mainPlaylistLoader_.media(),t=1500*e.targetDuration;rJ(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,"dash"===this.sourceType_&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{let e=this.mainPlaylistLoader_.media();"playlist-unchanged"!==e.lastExcludeReason_&&this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),!this.tech_.paused()&&(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){let i=e.mediaGroups||{},s=!0,r=Object.keys(i.AUDIO);for(let e in i.AUDIO)for(let t in i.AUDIO[e])i.AUDIO[e][t].uri||(s=!1);s&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),l.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),r.length&&Object.keys(i.AUDIO[r[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){let t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),s=this.bufferLowWaterLine(),r=this.bufferHighWaterLine();return oj({buffered:this.tech_.buffered(),currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:s,bufferHighWaterLine:r,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{let e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",e=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:10}))});let e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();let e=this.getCodecsOrExclude_();e&&this.sourceUpdater_.addOrChangeSourceBuffers(e)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(()=>{this.tech_.setCurrentTime(this.tech_.currentTime())})}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();let e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime(){})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;let e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;let t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){let t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;let t=this.syncController_.getExpiredTime(e,this.duration());if(null===t)return!1;let i=l.Playlist.playlistEnd(e,t),s=this.tech_.currentTime(),r=this.tech_.buffered();if(!r.length)return i-s<=rw;let n=r.end(r.length-1);return n-s<=rw&&i-n<=rw}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){let s;if(e=e||this.mainPlaylistLoader_.media(),i=i||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,"open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;let r=this.mainPlaylistLoader_.main.playlists,n=r.filter(rY),a=1===n.length&&n[0]===e;if(1===r.length&&i!==1/0)return rm.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){let t=this.pathwayAttribute_(e),i=1e3*this.contentSteeringController_.steeringManifest.ttl;this.contentSteeringController_.excludePathway(t),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(t)},i);return}let t=!1;r.forEach(i=>{if(i===e)return;let s=i.excludeUntil;void 0!==s&&s!==1/0&&(t=!0,delete i.excludeUntil)}),t&&(rm.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}s=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*i,e.excludeUntil=s,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});let o=this.selectPlaylist();if(!o){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}let l=t.internal?this.logger_:rm.log.warn,h=t.message?" "+t.message:"";l(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${h} Switching to playlist ${o.id}.`),o.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),o.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);let d=o.targetDuration/2*1e3||5e3,u="number"==typeof o.lastRequest&&Date.now()-o.lastRequest<=d;return this.switchMedia_(o,"exclude",a||u)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){let i=[],s="all"===e;(s||"main"===e)&&i.push(this.mainPlaylistLoader_);let r=[];(s||"audio"===e)&&r.push("AUDIO"),(s||"subtitle"===e)&&(r.push("CLOSED-CAPTIONS"),r.push("SUBTITLES")),r.forEach(e=>{let t=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;t&&i.push(t)}),["main","audio","subtitle"].forEach(t=>{let s=this[`${t}SegmentLoader_`];s&&(e===t||"all"===e)&&i.push(s)}),i.forEach(e=>t.forEach(t=>{"function"==typeof e[t]&&e[t]()}))}setCurrentTime(e){let t=rI(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?e:void(this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()):0}duration(){if(!this.mainPlaylistLoader_)return 0;let e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:l.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e,t,i;if(!this.mainPlaylistLoader_)return;let s=this.mainPlaylistLoader_.media();if(!s)return;let r=this.syncController_.getExpiredTime(s,this.duration());if(null===r)return;let n=this.mainPlaylistLoader_.main,a=l.Playlist.seekable(s,r,l.Playlist.liveEdgeDelay(n,s));0!==a.length&&(!this.mediaTypes_.AUDIO.activePlaylistLoader||(s=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null!==(r=this.syncController_.getExpiredTime(s,this.duration()))&&0!==(e=l.Playlist.seekable(s,r,l.Playlist.liveEdgeDelay(n,s))).length))&&(this.seekable_&&this.seekable_.length&&(t=this.seekable_.end(0),i=this.seekable_.start(0)),e?e.start(0)>a.end(0)||a.start(0)>e.end(0)?this.seekable_=a:this.seekable_=rC([[e.start(0)>a.start(0)?e.start(0):a.start(0),e.end(0)0&&(i=Math.max(i,t.end(t.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{let t=this.mediaTypes_[e].groups;for(let e in t)t[e].forEach(e=>{e.playlistLoader&&e.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){let e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!!t&&!!i}getCodecsOrExclude_(){let e;let t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},i=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();t.video=t.main;let s=aC(this.main(),i),r={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(r.video=s.video||t.main.videoCodec||C.xz),t.main.isMuxed&&(r.video+=`,${s.audio||t.main.audioCodec||C.lA}`),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||n)&&(r.audio=s.audio||t.main.audioCodec||t.audio.audioCodec||C.lA,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),!r.audio&&!r.video){this.excludePlaylist({playlistToExclude:i,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}let a=(e,t)=>e?(0,C.p7)(t):(0,C.Hi)(t),o={};if(["video","audio"].forEach(function(i){if(r.hasOwnProperty(i)&&!a(t[i].isFmp4,r[i])){let s=t[i].isFmp4?"browser":"muxer";o[s]=o[s]||[],o[s].push(r[i]),"audio"===i&&(e=s)}}),n&&e&&i.attributes.AUDIO){let t=i.attributes.AUDIO;this.main().playlists.forEach(e=>{(e.attributes&&e.attributes.AUDIO)===t&&e!==i&&(e.excludeUntil=1/0)}),this.logger_(`excluding audio group ${t} as ${e} does not support codec(s): "${r.audio}"`)}if(Object.keys(o).length){let e=Object.keys(o).reduce((e,t)=>(e&&(e+=", "),e+=`${t} does not support codec(s): "${o[t].join(",")}"`),"")+".";this.excludePlaylist({playlistToExclude:i,error:{internal:!0,message:e},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){let e=[];if(["video","audio"].forEach(t=>{let i=((0,C.kS)(this.sourceUpdater_.codecs[t]||"")[0]||{}).type,s=((0,C.kS)(r[t]||"")[0]||{}).type;i&&s&&i.toLowerCase()!==s.toLowerCase()&&e.push(`"${this.sourceUpdater_.codecs[t]}" -> "${r[t]}"`)}),e.length){this.excludePlaylist({playlistToExclude:i,error:{message:`Codec switching not supported: ${e.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return r}tryToCreateSourceBuffers_(){if("open"!==this.mediaSource.readyState||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;let e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);let t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){let e=this.main().playlists,t=[];Object.keys(e).forEach(i=>{let s=e[i];if(-1!==t.indexOf(s.id))return;t.push(s.id);let r=aC(this.main,s),n=[];!r.audio||(0,C.Hi)(r.audio)||(0,C.p7)(r.audio)||n.push(`audio codec ${r.audio}`),!r.video||(0,C.Hi)(r.video)||(0,C.p7)(r.video)||n.push(`video codec ${r.video}`),r.text&&"stpp.ttml.im1t"===r.text&&n.push(`text codec ${r.text}`),n.length&&(s.excludeUntil=1/0,this.logger_(`excluding ${s.id} for unsupported: ${n.join(", ")}`))})}excludeIncompatibleVariants_(e){let t=[],i=this.main().playlists,s=aS((0,C.kS)(e)),r=ak(s),n=s.video&&(0,C.kS)(s.video)[0]||null,a=s.audio&&(0,C.kS)(s.audio)[0]||null;Object.keys(i).forEach(e=>{let s=i[e];if(-1!==t.indexOf(s.id)||s.excludeUntil===1/0)return;t.push(s.id);let o=[],l=aC(this.mainPlaylistLoader_.main,s),h=ak(l);if(l.audio||l.video){if(h!==r&&o.push(`codec count "${h}" !== "${r}"`),!this.sourceUpdater_.canChangeType()){let e=l.video&&(0,C.kS)(l.video)[0]||null,t=l.audio&&(0,C.kS)(l.audio)[0]||null;e&&n&&e.type.toLowerCase()!==n.type.toLowerCase()&&o.push(`video codec "${e.type}" !== "${n.type}"`),t&&a&&t.type.toLowerCase()!==a.type.toLowerCase()&&o.push(`audio codec "${t.type}" !== "${a.type}"`)}o.length&&(s.excludeUntil=1/0,this.logger_(`excluding ${s.id}: ${o.join(" && ")}`))}})}updateAdCues_(e){let t=0,i=this.seekable();i.length&&(t=i.start(0)),og(e,this.cueTagsTrack_,t)}goalBufferLength(){let e=this.tech_.currentTime(),t=nG.GOAL_BUFFER_LENGTH,i=nG.GOAL_BUFFER_LENGTH_RATE,s=Math.max(t,nG.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,s)}bufferLowWaterLine(){let e=this.tech_.currentTime(),t=nG.BUFFER_LOW_WATER_LINE,i=nG.BUFFER_LOW_WATER_LINE_RATE,s=Math.max(t,nG.MAX_BUFFER_LOW_WATER_LINE),r=Math.max(t,nG.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?r:s)}bufferHighWaterLine(){return nG.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){a$(this.inbandTextTracks_,"com.apple.streaming",this.tech_),aF({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){let s=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();a$(this.inbandTextTracks_,e,this.tech_),aB({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:s,videoDuration:i})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){let e=this.main();if(e.contentSteering){for(let t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),"dash"===this.sourceType_&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{let e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{let t=this.contentSteeringController_.getAvailablePathways(),i=[];for(let s of e.playlists){let e=s.attributes.serviceLocation;if(e&&(i.push(e),!t.has(e)))return!0}return!i.length&&!!t.size})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){let e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();let t=this.main().playlists,i=new Set,s=!1;Object.keys(t).forEach(r=>{let n=t[r],a=this.pathwayAttribute_(n),o=a&&e!==a;n.excludeUntil!==1/0||"content-steering"!==n.lastExcludeReason_||o||(delete n.excludeUntil,delete n.lastExcludeReason_,s=!0);let l=!n.excludeUntil&&n.excludeUntil!==1/0;!i.has(n.id)&&o&&l&&(i.add(n.id),n.excludeUntil=1/0,n.lastExcludeReason_="content-steering",this.logger_(`excluding ${n.id} for ${n.lastExcludeReason_}`))}),"DASH"===this.contentSteeringController_.manifestType_&&Object.keys(this.mediaTypes_).forEach(t=>{let i=this.mediaTypes_[t];if(i.activePlaylistLoader){let t=i.activePlaylistLoader.media_;t&&t.attributes.serviceLocation!==e&&(s=!0)}}),s&&this.changeSegmentPathway_()}handlePathwayClones_(){let e=this.main().playlists,t=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(t&&t.size||i&&i.size){for(let[e,s]of t.entries())i.get(e)||(this.mainPlaylistLoader_.updateOrDeleteClone(s),this.contentSteeringController_.excludePathway(e));for(let[s,r]of i.entries()){let i=t.get(s);if(!i){e.filter(e=>e.attributes["PATHWAY-ID"]===r["BASE-ID"]).forEach(e=>{this.mainPlaylistLoader_.addClonePathway(r,e)}),this.contentSteeringController_.addAvailablePathway(s);continue}this.equalPathwayClones_(i,r)||(this.mainPlaylistLoader_.updateOrDeleteClone(r,!0),this.contentSteeringController_.addAvailablePathway(s))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;let i=e["URI-REPLACEMENT"].PARAMS,s=t["URI-REPLACEMENT"].PARAMS;for(let e in i)if(i[e]!==s[e])return!1;for(let e in s)if(i[e]!==s[e])return!1;return!0}changeSegmentPathway_(){let e=this.selectPlaylist();this.pauseLoading(),"DASH"===this.contentSteeringController_.manifestType_&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0,t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(i=>{let s=this.mainPlaylistLoader_.getKeyIdSet(i);s&&s.size&&s.forEach(s=>{let r="usable",n=this.keyStatusMap_.has(s)&&this.keyStatusMap_.get(s)===r,a=i.lastExcludeReason_===t&&i.excludeUntil===1/0;n?n&&a&&(delete i.excludeUntil,delete i.lastExcludeReason_,this.logger_(`enabling playlist ${i.id} because key ID ${s} is ${r}`)):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==t&&(i.excludeUntil=1/0,i.lastExcludeReason_=t,this.logger_(`excluding playlist ${i.id} because the key ID ${s} doesn't exist in the keyStatusMap or is not ${r}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(e=>{let i=e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height<720,s=e.excludeUntil===1/0&&e.lastExcludeReason_===t;i&&s&&(delete e.excludeUntil,rm.log.warn(`enabling non-HD playlist ${e.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){let i=("string"==typeof e?e:od(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${i} added to the keyStatusMap`),this.keyStatusMap_.set(i,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}let o$=(e,t,i)=>s=>{let r=e.main.playlists[t],n=rQ(r),a=rY(r);return void 0===s?a:(s?delete r.disabled:r.disabled=!0,s===a||n||(i(),s?e.trigger("renditionenabled"):e.trigger("renditiondisabled")),s)};class oq{constructor(e,t,i){let{playlistController_:s}=e,r=s.fastQualityChange_.bind(s);if(t.attributes){let e=t.attributes.RESOLUTION;this.width=e&&e.width,this.height=e&&e.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=aC(s.main(),t),this.playlist=t,this.id=i,this.enabled=o$(e.playlists,t.id,r)}}let oH=function(e){e.representations=()=>{let t=e.playlistController_.main(),i=r1(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter(e=>!rQ(e)).map((t,i)=>new oq(e,t,t.id)):[]}},oV=["seeking","seeked","pause","playing","error"];class oz{constructor(e){this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=rS("PlaybackWatcher"),this.logger_("initialize");let t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),s=()=>this.techWaiting_(),r=()=>this.resetTimeUpdate_(),n=this.playlistController_,a=["main","subtitle","audio"],o={};a.forEach(e=>{o[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)},n[`${e}SegmentLoader_`].on("appendsdone",o[e].updateend),n[`${e}SegmentLoader_`].on("playlistupdate",o[e].reset),this.tech_.on(["seeked","seeking"],o[e].reset)});let l=e=>{["main","audio"].forEach(t=>{n[`${t}SegmentLoader_`][e]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),l("off"))},this.clearSeekingAppendCheck_=()=>l("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),l("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",s),this.tech_.on(oV,r),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",s),this.tech_.off(oV,r),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),a.forEach(e=>{n[`${e}SegmentLoader_`].off("appendsdone",o[e].updateend),n[`${e}SegmentLoader_`].off("playlistupdate",o[e].reset),this.tech_.off(["seeked","seeking"],o[e].reset)}),this.checkCurrentTimeTimeout_&&d().clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&d().clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=d().setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){let t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){let t=this.playlistController_,i=t[`${e}SegmentLoader_`],s=i.buffered_(),r=rM(this[`${e}Buffered_`],s);if(this[`${e}Buffered_`]=s,r){this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:rO(s)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),"subtitle"!==e&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;let e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+rw>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){let e;if(!this.tech_.seeking())return!1;let t=this.seekable(),i=this.tech_.currentTime();if(this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1)),this.beforeSeekableWindow_(t,i)){let i=t.start(0);e=i+(i===t.end(0)?0:rw)}if(void 0!==e)return this.logger_(`Trying to seek outside of seekable at time ${i} with seekable range ${rD(t)}. Seeking to ${e}.`),this.tech_.setCurrentTime(e),!0;let s=this.playlistController_.sourceUpdater_,r=this.tech_.buffered(),n=s.audioBuffer?s.audioBuffered():null,a=s.videoBuffer?s.videoBuffered():null,o=this.media(),l=o.partTargetDuration?o.partTargetDuration:(o.targetDuration-rE)*2,h=[n,a];for(let e=0;e ${t.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){let e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){let i=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${i}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}let i=this.tech_.vhs.playlistController_.sourceUpdater_,s=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;let r=rP(s,t);return r.length>0&&(this.logger_(`Stopped at ${t} and seeking to ${r.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}afterSeekableWindow_(e,t,i,s=!1){if(!e.length)return!1;let r=e.end(e.length-1)+rw,n=!i.endList,a="number"==typeof i.partTargetDuration;return n&&(a||s)&&(r=e.end(e.length-1)+3*i.targetDuration),t>r}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:s,end:r}}return null}}let oW={errorInterval:30,getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},oG=function(e,t){let i=0,s=0,r=rk(oW,t);e.ready(()=>{e.trigger({type:"usage",name:"vhs-error-reload-initialized"})});let n=function(){s&&e.currentTime(s)},a=function(t){null!=t&&(s=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",n),e.src(t),e.trigger({type:"usage",name:"vhs-error-reload"}),e.play())},o=function(){if(Date.now()-i<1e3*r.errorInterval){e.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!r.getSource||"function"!=typeof r.getSource){rm.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return i=Date.now(),r.getSource.call(e,a)},l=function(){e.off("loadedmetadata",n),e.off("error",o),e.off("dispose",l)};e.on("error",o),e.on("dispose",l),e.reloadSourceOnError=function(t){l(),oG(e,t)}};var oK="3.10.0";let oQ={PlaylistLoader:np,Playlist:r2,utils:nw,STANDARD_PLAYLIST_SELECTOR:aA,INITIAL_PLAYLIST_SELECTOR:function(){let e=this.playlists.main.playlists.filter(r2.isEnabled);return aI(e,(e,t)=>aP(e,t)),e.filter(e=>!!aC(this.playlists.main,e).video)[0]||null},lastBandwidthSelector:aA,movingAverageBandwidthSelector:function(e){let t=-1,i=-1;if(e<0||e>1)throw Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let s=this.useDevicePixelRatio&&d().devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),aL(this.playlists.main,t,parseInt(ax(this.tech_.el(),"width"),10)*s,parseInt(ax(this.tech_.el(),"height"),10)*s,this.limitRenditionByPlayerDimensions,this.playlistController_)}},comparePlaylistBandwidth:aP,comparePlaylistResolution:function(e,t){let i,s;return(e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||d().Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(s=t.attributes.RESOLUTION.width),i===(s=s||d().Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH)?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-s},xhr:ny()};Object.keys(nG).forEach(e=>{Object.defineProperty(oQ,e,{get:()=>(rm.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),nG[e]),set(t){if(rm.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),"number"!=typeof t||t<0){rm.log.warn(`value of Vhs.${e} must be greater than or equal to 0`);return}nG[e]=t}})});let oY="videojs-vhs",oX=function(e,t){let i=t.media(),s=-1;for(let t=0;t{e.addQualityLevel(t)}),oX(e,t.playlists)};oQ.canPlaySource=function(){return rm.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};let oZ=(e,t,i)=>{if(!e)return e;let s={};t&&t.attributes&&t.attributes.CODECS&&(s=aS((0,C.kS)(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(s.audio=i.attributes.CODECS);let r=(0,C._5)(s.video),n=(0,C._5)(s.audio),a={};for(let i in e)a[i]={},n&&(a[i].audioContentType=n),r&&(a[i].videoContentType=r),t.contentProtection&&t.contentProtection[i]&&t.contentProtection[i].pssh&&(a[i].pssh=t.contentProtection[i].pssh),"string"==typeof e[i]&&(a[i].url=e[i]);return rk(e,a)},o0=(e,t)=>e.reduce((e,i)=>{if(!i.contentProtection)return e;let s=t.reduce((e,t)=>{let s=i.contentProtection[t];return s&&s.pssh&&(e[t]={pssh:s.pssh}),e},{});return Object.keys(s).length&&e.push(s),e},[]),o1=({player:e,sourceKeySystems:t,audioMedia:i,mainPlaylists:s})=>{if(!e.eme.initializeMediaKeys)return Promise.resolve();let r=o0(i?s.concat([i]):s,Object.keys(t)),n=[],a=[];return r.forEach(t=>{a.push(new Promise((t,i)=>{e.tech_.one("keysessioncreated",t)})),n.push(new Promise((i,s)=>{e.eme.initializeMediaKeys({keySystems:t},e=>{if(e){s(e);return}i()})}))}),Promise.race([Promise.all(n),Promise.race(a)])},o2=({player:e,sourceKeySystems:t,media:i,audioMedia:s})=>{let r=oZ(t,i,s);return!!r&&(e.currentSource().keySystems=r,!r||!!e.eme||(rm.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))},o4=()=>{if(!d().localStorage)return null;let e=d().localStorage.getItem(oY);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}},o8=e=>{if(!d().localStorage)return!1;let t=o4();t=t?rk(t,e):e;try{d().localStorage.setItem(oY,JSON.stringify(t))}catch(e){return!1}return t},o5=e=>0===e.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(e.substring(e.indexOf(",")+1)):e,o3=(e,t)=>{e._requestCallbackSet||(e._requestCallbackSet=new Set),e._requestCallbackSet.add(t)},o6=(e,t)=>{e._responseCallbackSet||(e._responseCallbackSet=new Set),e._responseCallbackSet.add(t)},o7=(e,t)=>{e._requestCallbackSet&&(e._requestCallbackSet.delete(t),e._requestCallbackSet.size||delete e._requestCallbackSet)},o9=(e,t)=>{e._responseCallbackSet&&(e._responseCallbackSet.delete(t),e._responseCallbackSet.size||delete e._responseCallbackSet)};oQ.supportsNativeHls=function(){if(!c()||!c().createElement)return!1;let e=c().createElement("video");return!!rm.getTech("Html5").isSupported()&&["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(e.canPlayType(t))})}(),oQ.supportsNativeDash=!!(c()&&c().createElement&&rm.getTech("Html5").isSupported())&&/maybe|probably/i.test(c().createElement("video").canPlayType("application/dash+xml")),oQ.supportsTypeNatively=e=>"hls"===e?oQ.supportsNativeHls:"dash"===e&&oQ.supportsNativeDash,oQ.isSupported=function(){return rm.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},oQ.xhr.onRequest=function(e){o3(oQ.xhr,e)},oQ.xhr.onResponse=function(e){o6(oQ.xhr,e)},oQ.xhr.offRequest=function(e){o7(oQ.xhr,e)},oQ.xhr.offResponse=function(e){o9(oQ.xhr,e)};let le=rm.getComponent("Component");class lt extends le{constructor(e,t,i){if(super(t,i.vhs),"number"==typeof i.initialBandwidth&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=rS("VhsHandler"),t.options_&&t.options_.playerId){let e=rm.getPlayer(t.options_.playerId);this.player_=e}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(c(),["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],e=>{let t=c().fullscreenElement||c().webkitFullscreenElement||c().mozFullScreenElement||c().msFullscreenElement;t&&t.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=rk(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=!1!==this.options_.llhls,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,"number"!=typeof this.options_.playlistExclusionDuration&&(this.options_.playlistExclusionDuration=60),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){let e=o4();e&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=nG.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===nG.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(e=>{void 0!==this.source_[e]&&(this.options_[e]=this.source_[e])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=o5(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=oQ,this.options_.sourceType=(0,E.t)(t),this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)},this.playlistController_=new oF(this.options_);let i=rk({liveRangeSafeTimeDelta:rw},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new oz(i),this.playlistController_.on("error",()=>{let e=rm.players[this.tech_.options_.playerId],t=this.playlistController_.error;"object"!=typeof t||t.code?"string"==typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)});let s=this.options_.bufferBasedABR?oQ.movingAverageBandwidthSelector(.55):oQ.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):s.bind(this),this.playlistController_.selectInitialPlaylist=oQ.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let e=this.playlistController_.mainSegmentLoader_.bandwidth,t=d().navigator.connection||d().navigator.mozConnection||d().navigator.webkitConnection;if(this.options_.useNetworkInformationApi&&t){let i=1e6*t.downlink;e=i>=1e7&&e>=1e7?Math.max(e,i):i}return e},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){return Math.floor(1/(1/(this.bandwidth||1)+(this.throughput>0?1/this.throughput:0)))},set(){rm.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>rO(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>rO(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&o8({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{oH(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=d().URL.createObjectURL(this.playlistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){let e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),o1({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(e=>{this.logger_("error while creating EME key session",e),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){let e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=o2({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",e=>{this.playlistController_.updatePlaylistByKeyStatus(e.keyId,e.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){let e=rm.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{oJ(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{oX(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":oK,"mux.js":"7.0.2","mpd-parser":"1.3.0","m3u8-parser":"7.1.0","aes-decrypter":"4.0.1"}}version(){return this.constructor.version()}canChangeType(){return ol.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&d().URL.revokeObjectURL&&(d().URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return nO({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,s=2){return nM({programTime:e,playlist:this.playlistController_.media(),retryCount:s,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{o3(this.xhr,e)},this.xhr.onResponse=e=>{o6(this.xhr,e)},this.xhr.offRequest=e=>{o7(this.xhr,e)},this.xhr.offResponse=e=>{o9(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}}let li={name:"videojs-http-streaming",VERSION:oK,canHandleSource(e,t={}){let i=rk(rm.options,t);return li.canPlayType(e.type,i)},handleSource(e,t,i={}){let s=rk(rm.options,i);return t.vhs=new lt(e,t,s),t.vhs.xhr=ny(),t.vhs.setupXhrHooks_(),t.vhs.src(e.src,e.type),t.vhs},canPlayType(e,t){let i=(0,E.t)(e);if(!i)return"";let s=li.getOverrideNative(t);return!oQ.supportsTypeNatively(i)||s?"maybe":""},getOverrideNative(e={}){let{vhs:t={}}=e,i=!(rm.browser.IS_ANY_SAFARI||rm.browser.IS_IOS),{overrideNative:s=i}=t;return s}};(0,C.p7)("avc1.4d400d,mp4a.40.2")&&rm.getTech("Html5").registerSourceHandler(li,0),rm.VhsHandler=lt,rm.VhsSourceHandler=li,rm.Vhs=oQ,rm.use||rm.registerComponent("Vhs",oQ),rm.options.vhs=rm.options.vhs||{},rm.getPlugin&&rm.getPlugin("reloadSourceOnError")||rm.registerPlugin("reloadSourceOnError",function(e){oG(this,e)})}}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/main-d53fb6c7e10249a6.js b/static/web/_next/static/chunks/main-d53fb6c7e10249a6.js new file mode 100644 index 000000000..8bb6da00d --- /dev/null +++ b/static/web/_next/static/chunks/main-d53fb6c7e10249a6.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[179],{71191:function(){"use strict";try{self["workbox:window:6.5.4"]&&_()}catch(e){}function e(e,t){return new Promise(function(r){var n=new MessageChannel;n.port1.onmessage=function(e){r(e.data)},e.postMessage(t,[n.port2])})}function t(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=Array(t);r0||!o(t.scriptURL,u.sn.toString())||performance.now()>u.un+6e4?(u.vn=t,e.removeEventListener("updatefound",u.cn)):(u.hn=t,u.an.add(t),u.rn.resolve(t)),++u.tn,t.addEventListener("statechange",u.ln)},u.ln=function(e){var t=u.fn,r=e.target,n=r.state,o=r===u.vn,i={sw:r,isExternal:o,originalEvent:e};!o&&u.mn&&(i.isUpdate=!0),u.dispatchEvent(new a(n,i)),"installed"===n?u.wn=self.setTimeout(function(){"installed"===n&&t.waiting===r&&u.dispatchEvent(new a("waiting",i))},200):"activating"===n&&(clearTimeout(u.wn),o||u.en.resolve(r))},u.dn=function(e){var t=u.hn,r=t!==navigator.serviceWorker.controller;u.dispatchEvent(new a("controlling",{isExternal:r,originalEvent:e,sw:t,isUpdate:u.mn})),r||u.on.resolve(t)},u.gn=(s=function(e){var t=e.data,r=e.ports,n=e.source;return i(u.getSW(),function(){u.an.has(n)&&u.dispatchEvent(new a("message",{data:t,originalEvent:e,ports:r,sw:n}))})},function(){for(var e=[],t=0;t=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}(this.Sn(e.type));!(t=n()).done;)(0,t.value)(e)},t.Sn=function(e){return this.Pn.has(e)||this.Pn.set(e,new Set),this.Pn.get(e)},e}());if("undefined"!=typeof window&&"serviceWorker"in navigator&&"undefined"!=typeof caches){caches.has("start-url").then(function(e){e||caches.open("start-url").then(e=>e.put("/",new Response("",{status:200})))}),window.workbox=new c(window.location.origin+"/sw.js",{scope:"/"}),window.workbox.addEventListener("installed",async({isUpdate:e})=>{if(!e){let e=await caches.open("start-url"),t=await fetch("/"),r=t;t.redirected&&(r=new Response(t.body,{status:200,statusText:"OK",headers:t.headers})),await e.put("/",r)}}),window.workbox.addEventListener("installed",async()=>{let e=window.performance.getEntriesByType("resource").map(e=>e.name).filter(e=>e.startsWith(`${window.location.origin}/_next/data/`)&&e.endsWith(".json")),t=await caches.open("next-data");e.forEach(e=>t.add(e))}),window.workbox.register();{let e=function(e){if(window.navigator.onLine&&"/"===e)return fetch("/").then(function(e){return e.redirected?Promise.resolve():caches.open("start-url").then(t=>t.put("/",e))})},t=history.pushState;history.pushState=function(){t.apply(history,arguments),e(arguments[2])};let r=history.replaceState;history.replaceState=function(){r.apply(history,arguments),e(arguments[2])},window.addEventListener("online",()=>{e(window.location.pathname)})}window.addEventListener("online",()=>{location.reload()})}},84878:function(e,t){"use strict";function r(){return""}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getDeploymentIdQueryOrEmptyString",{enumerable:!0,get:function(){return r}})},40037:function(){"trimStart"in String.prototype||(String.prototype.trimStart=String.prototype.trimLeft),"trimEnd"in String.prototype||(String.prototype.trimEnd=String.prototype.trimRight),"description"in Symbol.prototype||Object.defineProperty(Symbol.prototype,"description",{configurable:!0,get:function(){var e=/\((.*)\)/.exec(this.toString());return e?e[1]:void 0}}),Array.prototype.flat||(Array.prototype.flat=function(e,t){return t=this.concat.apply([],this),e>1&&t.some(Array.isArray)?t.flat(e-1):t},Array.prototype.flatMap=function(e,t){return this.map(e,t).flat()}),Promise.prototype.finally||(Promise.prototype.finally=function(e){if("function"!=typeof e)return this.then(e,e);var t=this.constructor||Promise;return this.then(function(r){return t.resolve(e()).then(function(){return r})},function(r){return t.resolve(e()).then(function(){throw r})})}),Object.fromEntries||(Object.fromEntries=function(e){return Array.from(e).reduce(function(e,t){return e[t[0]]=t[1],e},{})}),Array.prototype.at||(Array.prototype.at=function(e){var t=Math.trunc(e)||0;if(t<0&&(t+=this.length),!(t<0||t>=this.length))return this[t]}),Object.hasOwn||(Object.hasOwn=function(e,t){if(null==e)throw TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(e),t)})},90953:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addBasePath",{enumerable:!0,get:function(){return a}});let n=r(80475),o=r(98364);function a(e,t){return(0,o.normalizePathTrailingSlash)((0,n.addPathPrefix)(e,""))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},11443:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addLocale",{enumerable:!0,get:function(){return n}}),r(98364);let n=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n25){window.location.reload();return}clearTimeout(o),o=setTimeout(t,i>5?5e3:1e3)}r&&r.close();let{hostname:u,port:s}=location,l=function(e){let t=location.protocol;try{t=new URL(e).protocol}catch(e){}return"http:"===t?"ws":"wss"}(e.assetPrefix||""),c=e.assetPrefix.replace(/^\/+/,""),f=l+"://"+u+":"+s+(c?"/"+c:"");c.startsWith("http")&&(f=l+"://"+c.split("://",2)[1]),(r=new window.WebSocket(""+f+e.path)).onopen=function(){i=0,window.console.log("[HMR] connected")},r.onerror=a,r.onclose=a,r.onmessage=function(e){let t=JSON.parse(e.data);for(let e of n)e(t)}}()}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},13656:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"detectDomainLocale",{enumerable:!0,get:function(){return r}});let r=function(){for(var e=arguments.length,t=Array(e),r=0;r{let t={};e.forEach(e=>{if("link"===e.type&&e.props["data-optimized-fonts"]){if(document.querySelector('style[data-href="'+e.props["data-href"]+'"]'))return;e.props.href=e.props["data-href"],e.props["data-href"]=void 0}let r=t[e.type]||[];r.push(e),t[e.type]=r});let n=t.title?t.title[0]:null,o="";if(n){let{children:e}=n.props;o="string"==typeof e?e:Array.isArray(e)?e.join(""):""}o!==document.title&&(document.title=o),["meta","base","link","style","script"].forEach(e=>{r(e,t[e]||[])})}}}r=(e,t)=>{let r=document.getElementsByTagName("head")[0],n=r.querySelector("meta[name=next-head-count]"),i=Number(n.content),u=[];for(let t=0,r=n.previousElementSibling;t{for(let t=0,r=u.length;t{var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),l.forEach(e=>r.insertBefore(e,n)),n.content=(i-u.length+l.length).toString()},("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},17796:function(e,t,r){"use strict";let n,o,a,i,u,s,l,c,f,d,h,p;Object.defineProperty(t,"__esModule",{value:!0});let m=r(61757);Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{emitter:function(){return V},hydrate:function(){return ed},initialize:function(){return Y},router:function(){return n},version:function(){return z}});let g=r(38754),y=r(85893);r(40037);let v=g._(r(67294)),b=g._(r(20745)),P=r(89253),E=g._(r(4818)),S=r(9953),w=r(69683),j=r(38164),O=r(18260),R=r(61224),T=r(57201),x=r(40290),M=g._(r(1546)),I=g._(r(72717)),A=g._(r(81931)),C=r(48936),L=r(9090),N=r(80676),k=r(54938),D=r(28300),U=r(79142),F=r(15320),B=r(30679),H=r(51083),W=g._(r(44572)),q=g._(r(83790)),G=g._(r(28177)),z="14.2.2",V=(0,E.default)(),X=e=>[].slice.call(e),$=!1;class K extends v.default.Component{componentDidCatch(e,t){this.props.fn(e,t)}componentDidMount(){this.scrollToHash(),n.isSsr&&(o.isFallback||o.nextExport&&((0,j.isDynamicRoute)(n.pathname)||location.search||$)||o.props&&o.props.__N_SSG&&(location.search||$))&&n.replace(n.pathname+"?"+String((0,O.assign)((0,O.urlQueryToSearchParams)(n.query),new URLSearchParams(location.search))),a,{_h:1,shallow:!o.isFallback&&!$}).catch(e=>{if(!e.cancelled)throw e})}componentDidUpdate(){this.scrollToHash()}scrollToHash(){let{hash:e}=location;if(!(e=e&&e.substring(1)))return;let t=document.getElementById(e);t&&setTimeout(()=>t.scrollIntoView(),0)}render(){return this.props.children}}async function Y(e){void 0===e&&(e={}),q.default.onSpanEnd(G.default),o=JSON.parse(document.getElementById("__NEXT_DATA__").textContent),window.__NEXT_DATA__=o,p=o.defaultLocale;let t=o.assetPrefix||"";if(self.__next_set_public_path__(""+t+"/_next/"),(0,R.setConfig)({serverRuntimeConfig:{},publicRuntimeConfig:o.runtimeConfig||{}}),a=(0,T.getURL)(),(0,U.hasBasePath)(a)&&(a=(0,D.removeBasePath)(a)),o.scriptLoader){let{initScriptLoader:e}=r(32892);e(o.scriptLoader)}i=new I.default(o.buildId,t);let l=e=>{let[t,r]=e;return i.routeLoader.onEntrypoint(t,r)};return window.__NEXT_P&&window.__NEXT_P.map(e=>setTimeout(()=>l(e),0)),window.__NEXT_P=[],window.__NEXT_P.push=l,(s=(0,M.default)()).getIsSsr=()=>n.isSsr,u=document.getElementById("__next"),{assetPrefix:t}}function J(e,t){return(0,y.jsx)(e,{...t})}function Q(e){var t;let{children:r}=e,o=v.default.useMemo(()=>(0,B.adaptForAppRouterInstance)(n),[]);return(0,y.jsx)(K,{fn:e=>ee({App:f,err:e}).catch(e=>console.error("Error rendering page: ",e)),children:(0,y.jsx)(F.AppRouterContext.Provider,{value:o,children:(0,y.jsx)(H.SearchParamsContext.Provider,{value:(0,B.adaptForSearchParams)(n),children:(0,y.jsx)(B.PathnameContextProviderAdapter,{router:n,isAutoExport:null!=(t=self.__NEXT_DATA__.autoExport)&&t,children:(0,y.jsx)(H.PathParamsContext.Provider,{value:(0,B.adaptForPathParams)(n),children:(0,y.jsx)(S.RouterContext.Provider,{value:(0,L.makePublicRouterInstance)(n),children:(0,y.jsx)(P.HeadManagerContext.Provider,{value:s,children:(0,y.jsx)(k.ImageConfigContext.Provider,{value:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image/",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0},children:r})})})})})})})})}let Z=e=>t=>{let r={...t,Component:h,err:o.err,router:n};return(0,y.jsx)(Q,{children:J(e,r)})};function ee(e){let{App:t,err:u}=e;return console.error(u),console.error("A client-side exception has occurred, see here for more info: https://nextjs.org/docs/messages/client-side-exception-occurred"),i.loadPage("/_error").then(n=>{let{page:o,styleSheets:a}=n;return(null==l?void 0:l.Component)===o?Promise.resolve().then(()=>m._(r(26971))).then(n=>Promise.resolve().then(()=>m._(r(16958))).then(r=>(t=r.default,e.App=t,n))).then(e=>({ErrorComponent:e.default,styleSheets:[]})):{ErrorComponent:o,styleSheets:a}}).then(r=>{var i;let{ErrorComponent:s,styleSheets:l}=r,c=Z(t),f={Component:s,AppTree:c,router:n,ctx:{err:u,pathname:o.page,query:o.query,asPath:a,AppTree:c}};return Promise.resolve((null==(i=e.props)?void 0:i.err)?e.props:(0,T.loadGetInitialProps)(t,f)).then(t=>ec({...e,err:u,Component:s,styleSheets:l,props:t}))})}function et(e){let{callback:t}=e;return v.default.useLayoutEffect(()=>t(),[t]),null}let er={navigationStart:"navigationStart",beforeRender:"beforeRender",afterRender:"afterRender",afterHydrate:"afterHydrate",routeChange:"routeChange"},en={hydration:"Next.js-hydration",beforeHydration:"Next.js-before-hydration",routeChangeToRender:"Next.js-route-change-to-render",render:"Next.js-render"},eo=null,ea=!0;function ei(){[er.beforeRender,er.afterHydrate,er.afterRender,er.routeChange].forEach(e=>performance.clearMarks(e))}function eu(){T.ST&&(performance.mark(er.afterHydrate),performance.getEntriesByName(er.beforeRender,"mark").length&&(performance.measure(en.beforeHydration,er.navigationStart,er.beforeRender),performance.measure(en.hydration,er.beforeRender,er.afterHydrate)),d&&performance.getEntriesByName(en.hydration).forEach(d),ei())}function es(){if(!T.ST)return;performance.mark(er.afterRender);let e=performance.getEntriesByName(er.routeChange,"mark");e.length&&(performance.getEntriesByName(er.beforeRender,"mark").length&&(performance.measure(en.routeChangeToRender,e[0].name,er.beforeRender),performance.measure(en.render,er.beforeRender,er.afterRender),d&&(performance.getEntriesByName(en.render).forEach(d),performance.getEntriesByName(en.routeChangeToRender).forEach(d))),ei(),[en.routeChangeToRender,en.render].forEach(e=>performance.clearMeasures(e)))}function el(e){let{callbacks:t,children:r}=e;return v.default.useLayoutEffect(()=>t.forEach(e=>e()),[t]),v.default.useEffect(()=>{(0,A.default)(d)},[]),r}function ec(e){let t,{App:r,Component:o,props:a,err:i}=e,s="initial"in e?void 0:e.styleSheets;o=o||l.Component;let f={...a=a||l.props,Component:o,err:i,router:n};l=f;let d=!1,h=new Promise((e,r)=>{c&&c(),t=()=>{c=null,e()},c=()=>{d=!0,c=null;let e=Error("Cancel rendering route");e.cancelled=!0,r(e)}});function p(){t()}!function(){if(!s)return;let e=new Set(X(document.querySelectorAll("style[data-n-href]")).map(e=>e.getAttribute("data-n-href"))),t=document.querySelector("noscript[data-n-css]"),r=null==t?void 0:t.getAttribute("data-n-css");s.forEach(t=>{let{href:n,text:o}=t;if(!e.has(n)){let e=document.createElement("style");e.setAttribute("data-n-href",n),e.setAttribute("media","x"),r&&e.setAttribute("nonce",r),document.head.appendChild(e),e.appendChild(document.createTextNode(o))}})}();let m=(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(et,{callback:function(){if(s&&!d){let e=new Set(s.map(e=>e.href)),t=X(document.querySelectorAll("style[data-n-href]")),r=t.map(e=>e.getAttribute("data-n-href"));for(let n=0;n{let{href:t}=e,r=document.querySelector('style[data-n-href="'+t+'"]');r&&(n.parentNode.insertBefore(r,n.nextSibling),n=r)}),X(document.querySelectorAll("link[data-n-p]")).forEach(e=>{e.parentNode.removeChild(e)})}if(e.scroll){let{x:t,y:r}=e.scroll;(0,w.handleSmoothScroll)(()=>{window.scrollTo(t,r)})}}}),(0,y.jsxs)(Q,{children:[J(r,f),(0,y.jsx)(x.Portal,{type:"next-route-announcer",children:(0,y.jsx)(C.RouteAnnouncer,{})})]})]});return!function(e,t){T.ST&&performance.mark(er.beforeRender);let r=t(ea?eu:es);eo?(0,v.default.startTransition)(()=>{eo.render(r)}):(eo=b.default.hydrateRoot(e,r,{onRecoverableError:W.default}),ea=!1)}(u,e=>(0,y.jsx)(el,{callbacks:[e,p],children:(0,y.jsx)(v.default.StrictMode,{children:m})})),h}async function ef(e){if(e.err&&(void 0===e.Component||!e.isHydratePass)){await ee(e);return}try{await ec(e)}catch(r){let t=(0,N.getProperError)(r);if(t.cancelled)throw t;await ee({...e,err:t})}}async function ed(e){let t=o.err;try{let e=await i.routeLoader.whenEntrypoint("/_app");if("error"in e)throw e.error;let{component:t,exports:r}=e;f=t,r&&r.reportWebVitals&&(d=e=>{let t,{id:n,name:o,startTime:a,value:i,duration:u,entryType:s,entries:l,attribution:c}=e,f=Date.now()+"-"+(Math.floor(Math.random()*(9e12-1))+1e12);l&&l.length&&(t=l[0].startTime);let d={id:n||f,name:o,startTime:a||t,value:null==i?u:i,label:"mark"===s||"measure"===s?"custom":"web-vital"};c&&(d.attribution=c),r.reportWebVitals(d)});let n=await i.routeLoader.whenEntrypoint(o.page);if("error"in n)throw n.error;h=n.component}catch(e){t=(0,N.getProperError)(e)}window.__NEXT_PRELOADREADY&&await window.__NEXT_PRELOADREADY(o.dynamicIds),n=(0,L.createRouter)(o.page,o.query,a,{initialProps:o.props,pageLoader:i,App:f,Component:h,wrapApp:Z,err:t,isFallback:!!o.isFallback,subscription:(e,t,r)=>ef(Object.assign({},e,{App:t,scroll:r})),locale:o.locale,locales:o.locales,defaultLocale:p,domainLocales:o.domainLocales,isPreview:o.isPreview}),$=await n._initialMatchesMiddlewarePromise;let r={App:f,initial:!0,Component:h,props:o.props,err:t,isHydratePass:!0};(null==e?void 0:e.beforeRender)&&await e.beforeRender(),ef(r)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4768:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(28626);let n=r(17796);window.next={version:n.version,get router(){return n.router},emitter:n.emitter},(0,n.initialize)({}).then(()=>(0,n.hydrate)()).catch(console.error),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},98364:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizePathTrailingSlash",{enumerable:!0,get:function(){return a}});let n=r(29362),o=r(42107),a=e=>{if(!e.startsWith("/"))return e;let{pathname:t,query:r,hash:a}=(0,o.parsePath)(e);return/\.[^/]+\/?$/.test(t)?""+(0,n.removeTrailingSlash)(t)+r+a:t.endsWith("/")?""+t+r+a:t+"/"+r+a};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},44572:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let n=r(73467);function o(e){let t="function"==typeof reportError?reportError:e=>{window.console.error(e)};(0,n.isBailoutToCSRError)(e)||t(e)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},72717:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return d}});let n=r(38754),o=r(90953),a=r(44321),i=n._(r(28211)),u=r(11443),s=r(38164),l=r(40505),c=r(29362),f=r(97270);r(45960);class d{getPageList(){return(0,f.getClientBuildManifest)().then(e=>e.sortedPages)}getMiddleware(){return window.__MIDDLEWARE_MATCHERS=[],window.__MIDDLEWARE_MATCHERS}getDataHref(e){let{asPath:t,href:r,locale:n}=e,{pathname:f,query:d,search:h}=(0,l.parseRelativeUrl)(r),{pathname:p}=(0,l.parseRelativeUrl)(t),m=(0,c.removeTrailingSlash)(f);if("/"!==m[0])throw Error('Route name should start with a "/", got "'+m+'"');return(e=>{let t=(0,i.default)((0,c.removeTrailingSlash)((0,u.addLocale)(e,n)),".json");return(0,o.addBasePath)("/_next/data/"+this.buildId+t+h,!0)})(e.skipInterpolation?p:(0,s.isDynamicRoute)(m)?(0,a.interpolateAs)(f,p,d).result:m)}_isSsg(e){return this.promisedSsgManifest.then(t=>t.has(e))}loadPage(e){return this.routeLoader.loadRoute(e).then(e=>{if("component"in e)return{page:e.component,mod:e.exports,styleSheets:e.styles.map(e=>({href:e.href,text:e.content}))};throw e.error})}prefetch(e){return this.routeLoader.prefetch(e)}constructor(e,t){this.routeLoader=(0,f.createRouteLoader)(t),this.buildId=e,this.assetPrefix=t,this.promisedSsgManifest=new Promise(e=>{window.__SSG_MANIFEST?e(window.__SSG_MANIFEST):window.__SSG_MANIFEST_CB=()=>{e(window.__SSG_MANIFEST)}})}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},81931:function(e,t,r){"use strict";let n;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return u}});let o=["CLS","FCP","FID","INP","LCP","TTFB"];location.href;let a=!1;function i(e){n&&n(e)}let u=e=>{if(n=e,!a)for(let e of(a=!0,o))try{let t;t||(t=r(78018)),t["on"+e](i)}catch(t){console.warn("Failed to track "+e+" web-vital",t)}};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},40290:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Portal",{enumerable:!0,get:function(){return a}});let n=r(67294),o=r(73935),a=e=>{let{children:t,type:r}=e,[a,i]=(0,n.useState)(null);return(0,n.useEffect)(()=>{let e=document.createElement(r);return document.body.appendChild(e),i(e),()=>{document.body.removeChild(e)}},[r]),a?(0,o.createPortal)(t,a):null};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},28300:function(e,t,r){"use strict";function n(e){return e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeBasePath",{enumerable:!0,get:function(){return n}}),r(79142),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},14569:function(e,t,r){"use strict";function n(e,t){return e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeLocale",{enumerable:!0,get:function(){return n}}),r(42107),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},33815:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{cancelIdleCallback:function(){return n},requestIdleCallback:function(){return r}});let r="undefined"!=typeof self&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(e){let t=Date.now();return self.setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},n="undefined"!=typeof self&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(e){return clearTimeout(e)};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},71401:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"resolveHref",{enumerable:!0,get:function(){return f}});let n=r(18260),o=r(27420),a=r(13061),i=r(57201),u=r(98364),s=r(2045),l=r(95722),c=r(44321);function f(e,t,r){let f;let d="string"==typeof t?t:(0,o.formatWithValidation)(t),h=d.match(/^[a-zA-Z]{1,}:\/\//),p=h?d.slice(h[0].length):d;if((p.split("?",1)[0]||"").match(/(\/\/|\\)/)){console.error("Invalid href '"+d+"' passed to next/router in page: '"+e.pathname+"'. Repeated forward-slashes (//) or backslashes \\ are not valid in the href.");let t=(0,i.normalizeRepeatedSlashes)(p);d=(h?h[0]:"")+t}if(!(0,s.isLocalURL)(d))return r?[d]:d;try{f=new URL(d.startsWith("#")?e.asPath:e.pathname,"http://n")}catch(e){f=new URL("/","http://n")}try{let e=new URL(d,f);e.pathname=(0,u.normalizePathTrailingSlash)(e.pathname);let t="";if((0,l.isDynamicRoute)(e.pathname)&&e.searchParams&&r){let r=(0,n.searchParamsToUrlQuery)(e.searchParams),{result:i,params:u}=(0,c.interpolateAs)(e.pathname,e.pathname,r);i&&(t=(0,o.formatWithValidation)({pathname:i,hash:e.hash,query:(0,a.omit)(r,u)}))}let i=e.origin===f.origin?e.href.slice(e.origin.length):e.href;return r?[i,t||i]:i}catch(e){return r?[d]:d}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},48936:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{RouteAnnouncer:function(){return s},default:function(){return l}});let n=r(38754),o=r(85893),a=n._(r(67294)),i=r(9090),u={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",top:0,width:"1px",whiteSpace:"nowrap",wordWrap:"normal"},s=()=>{let{asPath:e}=(0,i.useRouter)(),[t,r]=a.default.useState(""),n=a.default.useRef(e);return a.default.useEffect(()=>{if(n.current!==e){if(n.current=e,document.title)r(document.title);else{var t;let n=document.querySelector("h1");r((null!=(t=null==n?void 0:n.innerText)?t:null==n?void 0:n.textContent)||e)}}},[e]),(0,o.jsx)("p",{"aria-live":"assertive",id:"__next-route-announcer__",role:"alert",style:u,children:t})},l=s;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},97270:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{createRouteLoader:function(){return m},getClientBuildManifest:function(){return h},isAssetError:function(){return l},markAssetError:function(){return s}}),r(38754),r(28211);let n=r(11220),o=r(33815),a=r(84878);function i(e,t,r){let n,o=t.get(e);if(o)return"future"in o?o.future:Promise.resolve(o);let a=new Promise(e=>{n=e});return t.set(e,o={resolve:n,future:a}),r?r().then(e=>(n(e),e)).catch(r=>{throw t.delete(e),r}):a}let u=Symbol("ASSET_LOAD_ERROR");function s(e){return Object.defineProperty(e,u,{})}function l(e){return e&&u in e}let c=function(e){try{return e=document.createElement("link"),!!window.MSInputMethodContext&&!!document.documentMode||e.relList.supports("prefetch")}catch(e){return!1}}(),f=()=>(0,a.getDeploymentIdQueryOrEmptyString)();function d(e,t,r){return new Promise((n,a)=>{let i=!1;e.then(e=>{i=!0,n(e)}).catch(a),(0,o.requestIdleCallback)(()=>setTimeout(()=>{i||a(r)},t))})}function h(){return self.__BUILD_MANIFEST?Promise.resolve(self.__BUILD_MANIFEST):d(new Promise(e=>{let t=self.__BUILD_MANIFEST_CB;self.__BUILD_MANIFEST_CB=()=>{e(self.__BUILD_MANIFEST),t&&t()}}),3800,s(Error("Failed to load client build manifest")))}function p(e,t){return h().then(r=>{if(!(t in r))throw s(Error("Failed to lookup route: "+t));let o=r[t].map(t=>e+"/_next/"+encodeURI(t));return{scripts:o.filter(e=>e.endsWith(".js")).map(e=>(0,n.__unsafeCreateTrustedScriptURL)(e)+f()),css:o.filter(e=>e.endsWith(".css")).map(e=>e+f())}})}function m(e){let t=new Map,r=new Map,n=new Map,a=new Map;function u(e){{var t;let n=r.get(e.toString());return n||(document.querySelector('script[src^="'+e+'"]')?Promise.resolve():(r.set(e.toString(),n=new Promise((r,n)=>{(t=document.createElement("script")).onload=r,t.onerror=()=>n(s(Error("Failed to load script: "+e))),t.crossOrigin=void 0,t.src=e,document.body.appendChild(t)})),n))}}function l(e){let t=n.get(e);return t||n.set(e,t=fetch(e,{credentials:"same-origin"}).then(t=>{if(!t.ok)throw Error("Failed to load stylesheet: "+e);return t.text().then(t=>({href:e,content:t}))}).catch(e=>{throw s(e)})),t}return{whenEntrypoint:e=>i(e,t),onEntrypoint(e,r){(r?Promise.resolve().then(()=>r()).then(e=>({component:e&&e.default||e,exports:e}),e=>({error:e})):Promise.resolve(void 0)).then(r=>{let n=t.get(e);n&&"resolve"in n?r&&(t.set(e,r),n.resolve(r)):(r?t.set(e,r):t.delete(e),a.delete(e))})},loadRoute(r,n){return i(r,a,()=>{let o;return d(p(e,r).then(e=>{let{scripts:n,css:o}=e;return Promise.all([t.has(r)?[]:Promise.all(n.map(u)),Promise.all(o.map(l))])}).then(e=>this.whenEntrypoint(r).then(t=>({entrypoint:t,styles:e[1]}))),3800,s(Error("Route did not complete loading: "+r))).then(e=>{let{entrypoint:t,styles:r}=e,n=Object.assign({styles:r},t);return"error"in t?t:n}).catch(e=>{if(n)throw e;return{error:e}}).finally(()=>null==o?void 0:o())})},prefetch(t){let r;return(r=navigator.connection)&&(r.saveData||/2g/.test(r.effectiveType))?Promise.resolve():p(e,t).then(e=>Promise.all(c?e.scripts.map(e=>{var t,r,n;return t=e.toString(),r="script",new Promise((e,o)=>{if(document.querySelector('\n link[rel="prefetch"][href^="'+t+'"],\n link[rel="preload"][href^="'+t+'"],\n script[src^="'+t+'"]'))return e();n=document.createElement("link"),r&&(n.as=r),n.rel="prefetch",n.crossOrigin=void 0,n.onload=e,n.onerror=()=>o(s(Error("Failed to prefetch: "+t))),n.href=t,document.head.appendChild(n)})}):[])).then(()=>{(0,o.requestIdleCallback)(()=>this.loadRoute(t,!0).catch(()=>{}))}).catch(()=>{})}}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9090:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{Router:function(){return a.default},createRouter:function(){return m},default:function(){return h},makePublicRouterInstance:function(){return g},useRouter:function(){return p},withRouter:function(){return s.default}});let n=r(38754),o=n._(r(67294)),a=n._(r(79554)),i=r(9953),u=n._(r(80676)),s=n._(r(89780)),l={router:null,readyCallbacks:[],ready(e){if(this.router)return e();this.readyCallbacks.push(e)}},c=["pathname","route","query","asPath","components","isFallback","basePath","locale","locales","defaultLocale","isReady","isPreview","isLocaleDomain","domainLocales"],f=["push","replace","reload","back","prefetch","beforePopState"];function d(){if(!l.router)throw Error('No router instance found.\nYou should only use "next/router" on the client side of your app.\n');return l.router}Object.defineProperty(l,"events",{get:()=>a.default.events}),c.forEach(e=>{Object.defineProperty(l,e,{get:()=>d()[e]})}),f.forEach(e=>{l[e]=function(){for(var t=arguments.length,r=Array(t),n=0;n{l.ready(()=>{a.default.events.on(e,function(){for(var t=arguments.length,r=Array(t),n=0;ne()),l.readyCallbacks=[],l.router}function g(e){let t={};for(let r of c){if("object"==typeof e[r]){t[r]=Object.assign(Array.isArray(e[r])?[]:{},e[r]);continue}t[r]=e[r]}return t.events=a.default.events,f.forEach(r=>{t[r]=function(){for(var t=arguments.length,n=Array(t),o=0;o{if(i.default.preinit){e.forEach(e=>{i.default.preinit(e,{as:"style"})});return}{let t=document.head;e.forEach(e=>{let r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.href=e,t.appendChild(r)})}},m=e=>{let{src:t,id:r,onLoad:n=()=>{},onReady:o=null,dangerouslySetInnerHTML:a,children:i="",strategy:u="afterInteractive",onError:s,stylesheets:c}=e,m=r||t;if(m&&d.has(m))return;if(f.has(t)){d.add(m),f.get(t).then(n,s);return}let g=()=>{o&&o(),d.add(m)},y=document.createElement("script"),v=new Promise((e,t)=>{y.addEventListener("load",function(t){e(),n&&n.call(this,t),g()}),y.addEventListener("error",function(e){t(e)})}).catch(function(e){s&&s(e)});for(let[r,n]of(a?(y.innerHTML=a.__html||"",g()):i?(y.textContent="string"==typeof i?i:Array.isArray(i)?i.join(""):"",g()):t&&(y.src=t,f.set(t,v)),Object.entries(e))){if(void 0===n||h.includes(r))continue;let e=l.DOMAttributeNames[r]||r.toLowerCase();y.setAttribute(e,n)}"worker"===u&&y.setAttribute("type","text/partytown"),y.setAttribute("data-nscript",u),c&&p(c),document.body.appendChild(y)};function g(e){let{strategy:t="afterInteractive"}=e;"lazyOnload"===t?window.addEventListener("load",()=>{(0,c.requestIdleCallback)(()=>m(e))}):m(e)}function y(e){e.forEach(g),[...document.querySelectorAll('[data-nscript="beforeInteractive"]'),...document.querySelectorAll('[data-nscript="beforePageRender"]')].forEach(e=>{let t=e.id||e.getAttribute("src");d.add(t)})}function v(e){let{id:t,src:r="",onLoad:n=()=>{},onReady:o=null,strategy:l="afterInteractive",onError:f,stylesheets:h,...p}=e,{updateScripts:g,scripts:y,getIsSsr:v,appDir:b,nonce:P}=(0,u.useContext)(s.HeadManagerContext),E=(0,u.useRef)(!1);(0,u.useEffect)(()=>{let e=t||r;E.current||(o&&e&&d.has(e)&&o(),E.current=!0)},[o,t,r]);let S=(0,u.useRef)(!1);if((0,u.useEffect)(()=>{!S.current&&("afterInteractive"===l?m(e):"lazyOnload"===l&&("complete"===document.readyState?(0,c.requestIdleCallback)(()=>m(e)):window.addEventListener("load",()=>{(0,c.requestIdleCallback)(()=>m(e))})),S.current=!0)},[e,l]),("beforeInteractive"===l||"worker"===l)&&(g?(y[l]=(y[l]||[]).concat([{id:t,src:r,onLoad:n,onReady:o,onError:f,...p}]),g(y)):v&&v()?d.add(t||r):v&&!v()&&m(e)),b){if(h&&h.forEach(e=>{i.default.preinit(e,{as:"style"})}),"beforeInteractive"===l)return r?(i.default.preload(r,p.integrity?{as:"script",integrity:p.integrity,nonce:P}:{as:"script",nonce:P}),(0,a.jsx)("script",{nonce:P,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push("+JSON.stringify([r,{...p,id:t}])+")"}})):(p.dangerouslySetInnerHTML&&(p.children=p.dangerouslySetInnerHTML.__html,delete p.dangerouslySetInnerHTML),(0,a.jsx)("script",{nonce:P,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push("+JSON.stringify([0,{...p,id:t}])+")"}}));"afterInteractive"===l&&r&&i.default.preload(r,p.integrity?{as:"script",integrity:p.integrity,nonce:P}:{as:"script",nonce:P})}return null}Object.defineProperty(v,"__nextScript",{value:!0});let b=v;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},28177:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let n=r(87089);function o(e){if("ended"!==e.state.state)throw Error("Expected span to be ended");(0,n.sendMessage)(JSON.stringify({event:"span-end",startTime:e.startTime,endTime:e.state.endTime,spanName:e.name,attributes:e.attributes}))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},83790:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}});let n=r(38754)._(r(4818));class o{end(e){if("ended"===this.state.state)throw Error("Span has already ended");this.state={state:"ended",endTime:null!=e?e:Date.now()},this.onSpanEnd(this)}constructor(e,t,r){var n,o;this.name=e,this.attributes=null!=(n=t.attributes)?n:{},this.startTime=null!=(o=t.startTime)?o:Date.now(),this.onSpanEnd=r,this.state={state:"inprogress"}}}class a{startSpan(e,t){return new o(e,t,this.handleSpanEnd)}onSpanEnd(e){return this._emitter.on("spanend",e),()=>{this._emitter.off("spanend",e)}}constructor(){this._emitter=(0,n.default)(),this.handleSpanEnd=e=>{this._emitter.emit("spanend",e)}}}let i=new a;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},11220:function(e,t){"use strict";let r;function n(e){var t;return(null==(t=function(){if(void 0===r){var e;r=(null==(e=window.trustedTypes)?void 0:e.createPolicy("nextjs",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e}))||null}return r}())?void 0:t.createScriptURL(e))||e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"__unsafeCreateTrustedScriptURL",{enumerable:!0,get:function(){return n}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},28626:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(84878),self.__next_set_public_path__=e=>{r.p=e},("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},89780:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}}),r(38754);let n=r(85893);r(67294);let o=r(9090);function a(e){function t(t){return(0,n.jsx)(e,{router:(0,o.useRouter)(),...t})}return t.getInitialProps=e.getInitialProps,t.origGetInitialProps=e.origGetInitialProps,t}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},16958:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}});let n=r(38754),o=r(85893),a=n._(r(67294)),i=r(57201);async function u(e){let{Component:t,ctx:r}=e;return{pageProps:await (0,i.loadGetInitialProps)(t,r)}}class s extends a.default.Component{render(){let{Component:e,pageProps:t}=this.props;return(0,o.jsx)(e,{...t})}}s.origGetInitialProps=u,s.getInitialProps=u,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},26971:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return c}});let n=r(38754),o=r(85893),a=n._(r(67294)),i=n._(r(7828)),u={400:"Bad Request",404:"This page could not be found",405:"Method Not Allowed",500:"Internal Server Error"};function s(e){let{res:t,err:r}=e;return{statusCode:t&&t.statusCode?t.statusCode:r?r.statusCode:404}}let l={error:{fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},desc:{lineHeight:"48px"},h1:{display:"inline-block",margin:"0 20px 0 0",paddingRight:23,fontSize:24,fontWeight:500,verticalAlign:"top"},h2:{fontSize:14,fontWeight:400,lineHeight:"28px"},wrap:{display:"inline-block"}};class c extends a.default.Component{render(){let{statusCode:e,withDarkMode:t=!0}=this.props,r=this.props.title||u[e]||"An unexpected error has occurred";return(0,o.jsxs)("div",{style:l.error,children:[(0,o.jsx)(i.default,{children:(0,o.jsx)("title",{children:e?e+": "+r:"Application error: a client-side exception has occurred"})}),(0,o.jsxs)("div",{style:l.desc,children:[(0,o.jsx)("style",{dangerouslySetInnerHTML:{__html:"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}"+(t?"@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}":"")}}),e?(0,o.jsx)("h1",{className:"next-error-h1",style:l.h1,children:e}):null,(0,o.jsx)("div",{style:l.wrap,children:(0,o.jsxs)("h2",{style:l.h2,children:[this.props.title||e?r:(0,o.jsx)(o.Fragment,{children:"Application error: a client-side exception has occurred (see the browser console for more information)"}),"."]})})]})]})}}c.displayName="ErrorPage",c.getInitialProps=s,c.origGetInitialProps=s,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},58438:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AmpStateContext",{enumerable:!0,get:function(){return n}});let n=r(38754)._(r(67294)).default.createContext({})},85495:function(e,t){"use strict";function r(e){let{ampFirst:t=!1,hybrid:r=!1,hasQuery:n=!1}=void 0===e?{}:e;return t||r&&n}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isInAmpMode",{enumerable:!0,get:function(){return r}})},15320:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{AppRouterContext:function(){return o},GlobalLayoutRouterContext:function(){return i},LayoutRouterContext:function(){return a},MissingSlotContext:function(){return s},TemplateContext:function(){return u}});let n=r(38754)._(r(67294)),o=n.default.createContext(null),a=n.default.createContext(null),i=n.default.createContext(null),u=n.default.createContext(null),s=n.default.createContext(new Set)},97019:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BloomFilter",{enumerable:!0,get:function(){return r}});class r{static from(e,t){void 0===t&&(t=1e-4);let n=new r(e.length,t);for(let t of e)n.add(t);return n}export(){return{numItems:this.numItems,errorRate:this.errorRate,numBits:this.numBits,numHashes:this.numHashes,bitArray:this.bitArray}}import(e){this.numItems=e.numItems,this.errorRate=e.errorRate,this.numBits=e.numBits,this.numHashes=e.numHashes,this.bitArray=e.bitArray}add(e){this.getHashValues(e).forEach(e=>{this.bitArray[e]=1})}contains(e){return this.getHashValues(e).every(e=>this.bitArray[e])}getHashValues(e){let t=[];for(let r=1;r<=this.numHashes;r++){let n=function(e){let t=0;for(let r=0;r>>13,t=Math.imul(t,1540483477);return t>>>0}(""+e+r)%this.numBits;t.push(n)}return t}constructor(e,t=1e-4){this.numItems=e,this.errorRate=t,this.numBits=Math.ceil(-(e*Math.log(t))/(Math.log(2)*Math.log(2))),this.numHashes=Math.ceil(this.numBits/e*Math.log(2)),this.bitArray=Array(this.numBits).fill(0)}}},45960:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{APP_BUILD_MANIFEST:function(){return b},APP_CLIENT_INTERNALS:function(){return J},APP_PATHS_MANIFEST:function(){return g},APP_PATH_ROUTES_MANIFEST:function(){return y},AUTOMATIC_FONT_OPTIMIZATION_MANIFEST:function(){return L},BARREL_OPTIMIZATION_PREFIX:function(){return q},BLOCKED_PAGES:function(){return U},BUILD_ID_FILE:function(){return D},BUILD_MANIFEST:function(){return v},CLIENT_PUBLIC_FILES_PATH:function(){return F},CLIENT_REFERENCE_MANIFEST:function(){return G},CLIENT_STATIC_FILES_PATH:function(){return B},CLIENT_STATIC_FILES_RUNTIME_AMP:function(){return Z},CLIENT_STATIC_FILES_RUNTIME_MAIN:function(){return K},CLIENT_STATIC_FILES_RUNTIME_MAIN_APP:function(){return Y},CLIENT_STATIC_FILES_RUNTIME_POLYFILLS:function(){return et},CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL:function(){return er},CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH:function(){return Q},CLIENT_STATIC_FILES_RUNTIME_WEBPACK:function(){return ee},COMPILER_INDEXES:function(){return i},COMPILER_NAMES:function(){return o},CONFIG_FILES:function(){return k},DEFAULT_RUNTIME_WEBPACK:function(){return en},DEFAULT_SANS_SERIF_FONT:function(){return ec},DEFAULT_SERIF_FONT:function(){return el},DEV_CLIENT_PAGES_MANIFEST:function(){return M},DEV_MIDDLEWARE_MANIFEST:function(){return A},EDGE_RUNTIME_WEBPACK:function(){return eo},EDGE_UNSUPPORTED_NODE_APIS:function(){return em},EXPORT_DETAIL:function(){return j},EXPORT_MARKER:function(){return w},FUNCTIONS_CONFIG_MANIFEST:function(){return P},GOOGLE_FONT_PROVIDER:function(){return eu},IMAGES_MANIFEST:function(){return T},INTERCEPTION_ROUTE_REWRITE_MANIFEST:function(){return $},INTERNAL_HEADERS:function(){return a},MIDDLEWARE_BUILD_MANIFEST:function(){return V},MIDDLEWARE_MANIFEST:function(){return I},MIDDLEWARE_REACT_LOADABLE_MANIFEST:function(){return X},MODERN_BROWSERSLIST_TARGET:function(){return n.default},NEXT_BUILTIN_DOCUMENT:function(){return W},NEXT_FONT_MANIFEST:function(){return S},OPTIMIZED_FONT_PROVIDERS:function(){return es},PAGES_MANIFEST:function(){return m},PHASE_DEVELOPMENT_SERVER:function(){return d},PHASE_EXPORT:function(){return l},PHASE_INFO:function(){return p},PHASE_PRODUCTION_BUILD:function(){return c},PHASE_PRODUCTION_SERVER:function(){return f},PHASE_TEST:function(){return h},PRERENDER_MANIFEST:function(){return O},REACT_LOADABLE_MANIFEST:function(){return C},ROUTES_MANIFEST:function(){return R},RSC_MODULE_TYPES:function(){return ep},SERVER_DIRECTORY:function(){return N},SERVER_FILES_MANIFEST:function(){return x},SERVER_PROPS_ID:function(){return ei},SERVER_REFERENCE_MANIFEST:function(){return z},STATIC_PROPS_ID:function(){return ea},STATIC_STATUS_PAGES:function(){return ef},STRING_LITERAL_DROP_BUNDLE:function(){return H},SUBRESOURCE_INTEGRITY_MANIFEST:function(){return E},SYSTEM_ENTRYPOINTS:function(){return e_},TRACE_OUTPUT_VERSION:function(){return ed},TURBO_TRACE_DEFAULT_MEMORY_LIMIT:function(){return eh},UNDERSCORE_NOT_FOUND_ROUTE:function(){return u},UNDERSCORE_NOT_FOUND_ROUTE_ENTRY:function(){return s}});let n=r(38754)._(r(63479)),o={client:"client",server:"server",edgeServer:"edge-server"},a=["x-invoke-error","x-invoke-output","x-invoke-path","x-invoke-query","x-invoke-status","x-middleware-invoke"],i={[o.client]:0,[o.server]:1,[o.edgeServer]:2},u="/_not-found",s=""+u+"/page",l="phase-export",c="phase-production-build",f="phase-production-server",d="phase-development-server",h="phase-test",p="phase-info",m="pages-manifest.json",g="app-paths-manifest.json",y="app-path-routes-manifest.json",v="build-manifest.json",b="app-build-manifest.json",P="functions-config-manifest.json",E="subresource-integrity-manifest",S="next-font-manifest",w="export-marker.json",j="export-detail.json",O="prerender-manifest.json",R="routes-manifest.json",T="images-manifest.json",x="required-server-files.json",M="_devPagesManifest.json",I="middleware-manifest.json",A="_devMiddlewareManifest.json",C="react-loadable-manifest.json",L="font-manifest.json",N="server",k=["next.config.js","next.config.mjs"],D="BUILD_ID",U=["/_document","/_app","/_error"],F="public",B="static",H="__NEXT_DROP_CLIENT_FILE__",W="__NEXT_BUILTIN_DOCUMENT__",q="__barrel_optimize__",G="client-reference-manifest",z="server-reference-manifest",V="middleware-build-manifest",X="middleware-react-loadable-manifest",$="interception-route-rewrite-manifest",K="main",Y=""+K+"-app",J="app-pages-internals",Q="react-refresh",Z="amp",ee="webpack",et="polyfills",er=Symbol(et),en="webpack-runtime",eo="edge-runtime-webpack",ea="__N_SSG",ei="__N_SSP",eu="https://fonts.googleapis.com/",es=[{url:eu,preconnect:"https://fonts.gstatic.com"},{url:"https://use.typekit.net",preconnect:"https://use.typekit.net"}],el={name:"Times New Roman",xAvgCharWidth:821,azAvgWidth:854.3953488372093,unitsPerEm:2048},ec={name:"Arial",xAvgCharWidth:904,azAvgWidth:934.5116279069767,unitsPerEm:2048},ef=["/500"],ed=1,eh=6e3,ep={client:"client",server:"server"},em=["clearImmediate","setImmediate","BroadcastChannel","ByteLengthQueuingStrategy","CompressionStream","CountQueuingStrategy","DecompressionStream","DomException","MessageChannel","MessageEvent","MessagePort","ReadableByteStreamController","ReadableStreamBYOBRequest","ReadableStreamDefaultController","TransformStreamDefaultController","WritableStreamDefaultController"],e_=new Set([K,Q,Z,Y]);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},61885:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"escapeStringRegexp",{enumerable:!0,get:function(){return o}});let r=/[|\\{}()[\]^$+*?.-]/,n=/[|\\{}()[\]^$+*?.-]/g;function o(e){return r.test(e)?e.replace(n,"\\$&"):e}},89253:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HeadManagerContext",{enumerable:!0,get:function(){return n}});let n=r(38754)._(r(67294)).default.createContext({})},7828:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return m},defaultHead:function(){return f}});let n=r(38754),o=r(61757),a=r(85893),i=o._(r(67294)),u=n._(r(67215)),s=r(58438),l=r(89253),c=r(85495);function f(e){void 0===e&&(e=!1);let t=[(0,a.jsx)("meta",{charSet:"utf-8"})];return e||t.push((0,a.jsx)("meta",{name:"viewport",content:"width=device-width"})),t}function d(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===i.default.Fragment?e.concat(i.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}r(1997);let h=["name","httpEquiv","charSet","itemProp"];function p(e,t){let{inAmpMode:r}=t;return e.reduce(d,[]).reverse().concat(f(r).reverse()).filter(function(){let e=new Set,t=new Set,r=new Set,n={};return o=>{let a=!0,i=!1;if(o.key&&"number"!=typeof o.key&&o.key.indexOf("$")>0){i=!0;let t=o.key.slice(o.key.indexOf("$")+1);e.has(t)?a=!1:e.add(t)}switch(o.type){case"title":case"base":t.has(o.type)?a=!1:t.add(o.type);break;case"meta":for(let e=0,t=h.length;e{let n=e.key||t;if(!r&&"link"===e.type&&e.props.href&&["https://fonts.googleapis.com/css","https://use.typekit.net/"].some(t=>e.props.href.startsWith(t))){let t={...e.props||{}};return t["data-href"]=t.href,t.href=void 0,t["data-optimized-fonts"]=!0,i.default.cloneElement(e,t)}return i.default.cloneElement(e,{key:n})})}let m=function(e){let{children:t}=e,r=(0,i.useContext)(s.AmpStateContext),n=(0,i.useContext)(l.HeadManagerContext);return(0,a.jsx)(u.default,{reduceComponentsToState:p,headManager:n,inAmpMode:(0,c.isInAmpMode)(r),children:t})};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},51083:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{PathParamsContext:function(){return i},PathnameContext:function(){return a},SearchParamsContext:function(){return o}});let n=r(67294),o=(0,n.createContext)(null),a=(0,n.createContext)(null),i=(0,n.createContext)(null)},1808:function(e,t){"use strict";function r(e,t){let r;let n=e.split("/");return(t||[]).some(t=>!!n[1]&&n[1].toLowerCase()===t.toLowerCase()&&(r=t,n.splice(1,1),e=n.join("/")||"/",!0)),{pathname:e,detectedLocale:r}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizeLocalePath",{enumerable:!0,get:function(){return r}})},54938:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ImageConfigContext",{enumerable:!0,get:function(){return a}});let n=r(38754)._(r(67294)),o=r(27903),a=n.default.createContext(o.imageConfigDefault)},27903:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{VALID_LOADERS:function(){return r},imageConfigDefault:function(){return n}});let r=["default","imgix","cloudinary","akamai","custom"],n={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:60,formats:["image/webp"],dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"inline",remotePatterns:[],unoptimized:!1}},35841:function(e,t){"use strict";function r(e){return Object.prototype.toString.call(e)}function n(e){if("[object Object]"!==r(e))return!1;let t=Object.getPrototypeOf(e);return null===t||t.hasOwnProperty("isPrototypeOf")}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getObjectClassLabel:function(){return r},isPlainObject:function(){return n}})},73467:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{BailoutToCSRError:function(){return n},isBailoutToCSRError:function(){return o}});let r="BAILOUT_TO_CLIENT_SIDE_RENDERING";class n extends Error{constructor(e){super("Bail out to client-side rendering: "+e),this.reason=e,this.digest=r}}function o(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===r}},4818:function(e,t){"use strict";function r(){let e=Object.create(null);return{on(t,r){(e[t]||(e[t]=[])).push(r)},off(t,r){e[t]&&e[t].splice(e[t].indexOf(r)>>>0,1)},emit(t){for(var r=arguments.length,n=Array(r>1?r-1:0),o=1;o{e(...n)})}}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}})},63479:function(e){"use strict";e.exports=["chrome 64","edge 79","firefox 67","opera 51","safari 12"]},29521:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"denormalizePagePath",{enumerable:!0,get:function(){return a}});let n=r(95722),o=r(61026);function a(e){let t=(0,o.normalizePathSep)(e);return t.startsWith("/index/")&&!(0,n.isDynamicRoute)(t)?t.slice(6):"/index"!==t?t:"/"}},93650:function(e,t){"use strict";function r(e){return e.startsWith("/")?e:"/"+e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ensureLeadingSlash",{enumerable:!0,get:function(){return r}})},61026:function(e,t){"use strict";function r(e){return e.replace(/\\/g,"/")}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizePathSep",{enumerable:!0,get:function(){return r}})},9953:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RouterContext",{enumerable:!0,get:function(){return n}});let n=r(38754)._(r(67294)).default.createContext(null)},30679:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{PathnameContextProviderAdapter:function(){return h},adaptForAppRouterInstance:function(){return c},adaptForPathParams:function(){return d},adaptForSearchParams:function(){return f}});let n=r(61757),o=r(85893),a=n._(r(67294)),i=r(51083),u=r(95722),s=r(7750),l=r(62437);function c(e){return{back(){e.back()},forward(){e.forward()},refresh(){e.reload()},fastRefresh(){},push(t,r){let{scroll:n}=void 0===r?{}:r;e.push(t,void 0,{scroll:n})},replace(t,r){let{scroll:n}=void 0===r?{}:r;e.replace(t,void 0,{scroll:n})},prefetch(t){e.prefetch(t)}}}function f(e){return e.isReady&&e.query?(0,s.asPathToSearchParams)(e.asPath):new URLSearchParams}function d(e){if(!e.isReady||!e.query)return null;let t={};for(let r of Object.keys((0,l.getRouteRegex)(e.pathname).groups))t[r]=e.query[r];return t}function h(e){let{children:t,router:r,...n}=e,s=(0,a.useRef)(n.isAutoExport),l=(0,a.useMemo)(()=>{let e;let t=s.current;if(t&&(s.current=!1),(0,u.isDynamicRoute)(r.pathname)&&(r.isFallback||t&&!r.isReady))return null;try{e=new URL(r.asPath,"http://f")}catch(e){return"/"}return e.pathname},[r.asPath,r.isFallback,r.isReady,r.pathname]);return(0,o.jsx)(i.PathnameContext.Provider,{value:l,children:t})}},79554:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{createKey:function(){return G},default:function(){return X},matchesMiddleware:function(){return k}});let n=r(38754),o=r(61757),a=r(29362),i=r(97270),u=r(32892),s=o._(r(80676)),l=r(29521),c=r(1808),f=n._(r(4818)),d=r(57201),h=r(38164),p=r(40505);r(72431);let m=r(10122),g=r(62437),y=r(27420);r(13656);let v=r(42107),b=r(11443),P=r(14569),E=r(28300),S=r(90953),w=r(79142),j=r(71401),O=r(79423),R=r(91858),T=r(15127),x=r(44389),M=r(2045),I=r(75004),A=r(13061),C=r(44321),L=r(69683);function N(){return Object.assign(Error("Route Cancelled"),{cancelled:!0})}async function k(e){let t=await Promise.resolve(e.router.pageLoader.getMiddleware());if(!t)return!1;let{pathname:r}=(0,v.parsePath)(e.asPath),n=(0,w.hasBasePath)(r)?(0,E.removeBasePath)(r):r,o=(0,S.addBasePath)((0,b.addLocale)(n,e.locale));return t.some(e=>new RegExp(e.regexp).test(o))}function D(e){let t=(0,d.getLocationOrigin)();return e.startsWith(t)?e.substring(t.length):e}function U(e,t,r){let[n,o]=(0,j.resolveHref)(e,t,!0),a=(0,d.getLocationOrigin)(),i=n.startsWith(a),u=o&&o.startsWith(a);n=D(n),o=o?D(o):o;let s=i?n:(0,S.addBasePath)(n),l=r?D((0,j.resolveHref)(e,r)):o||n;return{url:s,as:u?l:(0,S.addBasePath)(l)}}function F(e,t){let r=(0,a.removeTrailingSlash)((0,l.denormalizePagePath)(e));return"/404"===r||"/_error"===r?e:(t.includes(r)||t.some(t=>{if((0,h.isDynamicRoute)(t)&&(0,g.getRouteRegex)(t).re.test(r))return e=t,!0}),(0,a.removeTrailingSlash)(e))}async function B(e){if(!await k(e)||!e.fetchData)return null;let t=await e.fetchData(),r=await function(e,t,r){let n={basePath:r.router.basePath,i18n:{locales:r.router.locales},trailingSlash:!0},o=t.headers.get("x-nextjs-rewrite"),u=o||t.headers.get("x-nextjs-matched-path"),s=t.headers.get("x-matched-path");if(!s||u||s.includes("__next_data_catchall")||s.includes("/_error")||s.includes("/404")||(u=s),u){if(u.startsWith("/")){let t=(0,p.parseRelativeUrl)(u),s=(0,R.getNextPathnameInfo)(t.pathname,{nextConfig:n,parseData:!0}),l=(0,a.removeTrailingSlash)(s.pathname);return Promise.all([r.router.pageLoader.getPageList(),(0,i.getClientBuildManifest)()]).then(a=>{let[i,{__rewrites:u}]=a,f=(0,b.addLocale)(s.pathname,s.locale);if((0,h.isDynamicRoute)(f)||!o&&i.includes((0,c.normalizeLocalePath)((0,E.removeBasePath)(f),r.router.locales).pathname)){let r=(0,R.getNextPathnameInfo)((0,p.parseRelativeUrl)(e).pathname,{nextConfig:n,parseData:!0});f=(0,S.addBasePath)(r.pathname),t.pathname=f}if(!i.includes(l)){let e=F(l,i);e!==l&&(l=e)}let d=i.includes(l)?l:F((0,c.normalizeLocalePath)((0,E.removeBasePath)(t.pathname),r.router.locales).pathname,i);if((0,h.isDynamicRoute)(d)){let e=(0,m.getRouteMatcher)((0,g.getRouteRegex)(d))(f);Object.assign(t.query,e||{})}return{type:"rewrite",parsedAs:t,resolvedHref:d}})}let t=(0,v.parsePath)(e);return Promise.resolve({type:"redirect-external",destination:""+(0,T.formatNextPathnameInfo)({...(0,R.getNextPathnameInfo)(t.pathname,{nextConfig:n,parseData:!0}),defaultLocale:r.router.defaultLocale,buildId:""})+t.query+t.hash})}let l=t.headers.get("x-nextjs-redirect");if(l){if(l.startsWith("/")){let e=(0,v.parsePath)(l),t=(0,T.formatNextPathnameInfo)({...(0,R.getNextPathnameInfo)(e.pathname,{nextConfig:n,parseData:!0}),defaultLocale:r.router.defaultLocale,buildId:""});return Promise.resolve({type:"redirect-internal",newAs:""+t+e.query+e.hash,newUrl:""+t+e.query+e.hash})}return Promise.resolve({type:"redirect-external",destination:l})}return Promise.resolve({type:"next"})}(t.dataHref,t.response,e);return{dataHref:t.dataHref,json:t.json,response:t.response,text:t.text,cacheKey:t.cacheKey,effect:r}}let H=Symbol("SSG_DATA_NOT_FOUND");function W(e){try{return JSON.parse(e)}catch(e){return null}}function q(e){let{dataHref:t,inflightCache:r,isPrefetch:n,hasMiddleware:o,isServerRender:a,parseJSON:u,persistCache:s,isBackground:l,unstable_skipClientCache:c}=e,{href:f}=new URL(t,window.location.href),d=e=>{var l;return(function e(t,r,n){return fetch(t,{credentials:"same-origin",method:n.method||"GET",headers:Object.assign({},n.headers,{"x-nextjs-data":"1"})}).then(o=>!o.ok&&r>1&&o.status>=500?e(t,r-1,n):o)})(t,a?3:1,{headers:Object.assign({},n?{purpose:"prefetch"}:{},n&&o?{"x-middleware-prefetch":"1"}:{}),method:null!=(l=null==e?void 0:e.method)?l:"GET"}).then(r=>r.ok&&(null==e?void 0:e.method)==="HEAD"?{dataHref:t,response:r,text:"",json:{},cacheKey:f}:r.text().then(e=>{if(!r.ok){if(o&&[301,302,307,308].includes(r.status))return{dataHref:t,response:r,text:e,json:{},cacheKey:f};if(404===r.status){var n;if(null==(n=W(e))?void 0:n.notFound)return{dataHref:t,json:{notFound:H},response:r,text:e,cacheKey:f}}let u=Error("Failed to load static props");throw a||(0,i.markAssetError)(u),u}return{dataHref:t,json:u?W(e):null,response:r,text:e,cacheKey:f}})).then(e=>(s&&"no-cache"!==e.response.headers.get("x-middleware-cache")||delete r[f],e)).catch(e=>{throw c||delete r[f],("Failed to fetch"===e.message||"NetworkError when attempting to fetch resource."===e.message||"Load failed"===e.message)&&(0,i.markAssetError)(e),e})};return c&&s?d({}).then(e=>(r[f]=Promise.resolve(e),e)):void 0!==r[f]?r[f]:r[f]=d(l?{method:"HEAD"}:{})}function G(){return Math.random().toString(36).slice(2,10)}function z(e){let{url:t,router:r}=e;if(t===(0,S.addBasePath)((0,b.addLocale)(r.asPath,r.locale)))throw Error("Invariant: attempted to hard navigate to the same URL "+t+" "+location.href);window.location.href=t}let V=e=>{let{route:t,router:r}=e,n=!1,o=r.clc=()=>{n=!0};return()=>{if(n){let e=Error('Abort fetching component for route: "'+t+'"');throw e.cancelled=!0,e}o===r.clc&&(r.clc=null)}};class X{reload(){window.location.reload()}back(){window.history.back()}forward(){window.history.forward()}push(e,t,r){return void 0===r&&(r={}),{url:e,as:t}=U(this,e,t),this.change("pushState",e,t,r)}replace(e,t,r){return void 0===r&&(r={}),{url:e,as:t}=U(this,e,t),this.change("replaceState",e,t,r)}async _bfl(e,t,r,n){{let s=!1,l=!1;for(let c of[e,t])if(c){let t=(0,a.removeTrailingSlash)(new URL(c,"http://n").pathname),f=(0,S.addBasePath)((0,b.addLocale)(t,r||this.locale));if(t!==(0,a.removeTrailingSlash)(new URL(this.asPath,"http://n").pathname)){var o,i,u;for(let e of(s=s||!!(null==(o=this._bfl_s)?void 0:o.contains(t))||!!(null==(i=this._bfl_s)?void 0:i.contains(f)),[t,f])){let t=e.split("/");for(let e=0;!l&&e{})}}}}return!1}async change(e,t,r,n,o){var l,c,f,j,O,R,T,I,L;let D,B;if(!(0,M.isLocalURL)(t))return z({url:t,router:this}),!1;let W=1===n._h;W||n.shallow||await this._bfl(r,void 0,n.locale);let q=W||n._shouldResolveHref||(0,v.parsePath)(t).pathname===(0,v.parsePath)(r).pathname,G={...this.state},V=!0!==this.isReady;this.isReady=!0;let $=this.isSsr;if(W||(this.isSsr=!1),W&&this.clc)return!1;let K=G.locale;d.ST&&performance.mark("routeChange");let{shallow:Y=!1,scroll:J=!0}=n,Q={shallow:Y};this._inFlightRoute&&this.clc&&($||X.events.emit("routeChangeError",N(),this._inFlightRoute,Q),this.clc(),this.clc=null),r=(0,S.addBasePath)((0,b.addLocale)((0,w.hasBasePath)(r)?(0,E.removeBasePath)(r):r,n.locale,this.defaultLocale));let Z=(0,P.removeLocale)((0,w.hasBasePath)(r)?(0,E.removeBasePath)(r):r,G.locale);this._inFlightRoute=r;let ee=K!==G.locale;if(!W&&this.onlyAHashChange(Z)&&!ee){G.asPath=Z,X.events.emit("hashChangeStart",r,Q),this.changeState(e,t,r,{...n,scroll:!1}),J&&this.scrollToHash(Z);try{await this.set(G,this.components[G.route],null)}catch(e){throw(0,s.default)(e)&&e.cancelled&&X.events.emit("routeChangeError",e,Z,Q),e}return X.events.emit("hashChangeComplete",r,Q),!0}let et=(0,p.parseRelativeUrl)(t),{pathname:er,query:en}=et;try{[D,{__rewrites:B}]=await Promise.all([this.pageLoader.getPageList(),(0,i.getClientBuildManifest)(),this.pageLoader.getMiddleware()])}catch(e){return z({url:r,router:this}),!1}this.urlIsNew(Z)||ee||(e="replaceState");let eo=r;er=er?(0,a.removeTrailingSlash)((0,E.removeBasePath)(er)):er;let ea=(0,a.removeTrailingSlash)(er),ei=r.startsWith("/")&&(0,p.parseRelativeUrl)(r).pathname;if(null==(l=this.components[er])?void 0:l.__appRouter)return z({url:r,router:this}),new Promise(()=>{});let eu=!!(ei&&ea!==ei&&(!(0,h.isDynamicRoute)(ea)||!(0,m.getRouteMatcher)((0,g.getRouteRegex)(ea))(ei))),es=!n.shallow&&await k({asPath:r,locale:G.locale,router:this});if(W&&es&&(q=!1),q&&"/_error"!==er&&(n._shouldResolveHref=!0,et.pathname=F(er,D),et.pathname===er||(er=et.pathname,et.pathname=(0,S.addBasePath)(er),es||(t=(0,y.formatWithValidation)(et)))),!(0,M.isLocalURL)(r))return z({url:r,router:this}),!1;eo=(0,P.removeLocale)((0,E.removeBasePath)(eo),G.locale),ea=(0,a.removeTrailingSlash)(er);let el=!1;if((0,h.isDynamicRoute)(ea)){let e=(0,p.parseRelativeUrl)(eo),n=e.pathname,o=(0,g.getRouteRegex)(ea);el=(0,m.getRouteMatcher)(o)(n);let a=ea===n,i=a?(0,C.interpolateAs)(ea,n,en):{};if(el&&(!a||i.result))a?r=(0,y.formatWithValidation)(Object.assign({},e,{pathname:i.result,query:(0,A.omit)(en,i.params)})):Object.assign(en,el);else{let e=Object.keys(o.groups).filter(e=>!en[e]&&!o.groups[e].optional);if(e.length>0&&!es)throw Error((a?"The provided `href` ("+t+") value is missing query values ("+e.join(", ")+") to be interpolated properly. ":"The provided `as` value ("+n+") is incompatible with the `href` value ("+ea+"). ")+"Read more: https://nextjs.org/docs/messages/"+(a?"href-interpolation-failed":"incompatible-href-as"))}}W||X.events.emit("routeChangeStart",r,Q);let ec="/404"===this.pathname||"/_error"===this.pathname;try{let a=await this.getRouteInfo({route:ea,pathname:er,query:en,as:r,resolvedAs:eo,routeProps:Q,locale:G.locale,isPreview:G.isPreview,hasMiddleware:es,unstable_skipClientCache:n.unstable_skipClientCache,isQueryUpdating:W&&!this.isFallback,isMiddlewareRewrite:eu});if(W||n.shallow||await this._bfl(r,"resolvedAs"in a?a.resolvedAs:void 0,G.locale),"route"in a&&es){ea=er=a.route||ea,Q.shallow||(en=Object.assign({},a.query||{},en));let e=(0,w.hasBasePath)(et.pathname)?(0,E.removeBasePath)(et.pathname):et.pathname;if(el&&er!==e&&Object.keys(el).forEach(e=>{el&&en[e]===el[e]&&delete en[e]}),(0,h.isDynamicRoute)(er)){let e=!Q.shallow&&a.resolvedAs?a.resolvedAs:(0,S.addBasePath)((0,b.addLocale)(new URL(r,location.href).pathname,G.locale),!0);(0,w.hasBasePath)(e)&&(e=(0,E.removeBasePath)(e));let t=(0,g.getRouteRegex)(er),n=(0,m.getRouteMatcher)(t)(new URL(e,location.href).pathname);n&&Object.assign(en,n)}}if("type"in a){if("redirect-internal"===a.type)return this.change(e,a.newUrl,a.newAs,n);return z({url:a.destination,router:this}),new Promise(()=>{})}let i=a.Component;if(i&&i.unstable_scriptLoader&&[].concat(i.unstable_scriptLoader()).forEach(e=>{(0,u.handleClientScriptLoad)(e.props)}),(a.__N_SSG||a.__N_SSP)&&a.props){if(a.props.pageProps&&a.props.pageProps.__N_REDIRECT){n.locale=!1;let t=a.props.pageProps.__N_REDIRECT;if(t.startsWith("/")&&!1!==a.props.pageProps.__N_REDIRECT_BASE_PATH){let r=(0,p.parseRelativeUrl)(t);r.pathname=F(r.pathname,D);let{url:o,as:a}=U(this,t,t);return this.change(e,o,a,n)}return z({url:t,router:this}),new Promise(()=>{})}if(G.isPreview=!!a.props.__N_PREVIEW,a.props.notFound===H){let e;try{await this.fetchComponent("/404"),e="/404"}catch(t){e="/_error"}if(a=await this.getRouteInfo({route:e,pathname:e,query:en,as:r,resolvedAs:eo,routeProps:{shallow:!1},locale:G.locale,isPreview:G.isPreview,isNotFound:!0}),"type"in a)throw Error("Unexpected middleware effect on /404")}}W&&"/_error"===this.pathname&&(null==(f=self.__NEXT_DATA__.props)?void 0:null==(c=f.pageProps)?void 0:c.statusCode)===500&&(null==(j=a.props)?void 0:j.pageProps)&&(a.props.pageProps.statusCode=500);let l=n.shallow&&G.route===(null!=(O=a.route)?O:ea),d=null!=(R=n.scroll)?R:!W&&!l,y=null!=o?o:d?{x:0,y:0}:null,v={...G,route:ea,pathname:er,query:en,asPath:Z,isFallback:!1};if(W&&ec){if(a=await this.getRouteInfo({route:this.pathname,pathname:this.pathname,query:en,as:r,resolvedAs:eo,routeProps:{shallow:!1},locale:G.locale,isPreview:G.isPreview,isQueryUpdating:W&&!this.isFallback}),"type"in a)throw Error("Unexpected middleware effect on "+this.pathname);"/_error"===this.pathname&&(null==(I=self.__NEXT_DATA__.props)?void 0:null==(T=I.pageProps)?void 0:T.statusCode)===500&&(null==(L=a.props)?void 0:L.pageProps)&&(a.props.pageProps.statusCode=500);try{await this.set(v,a,y)}catch(e){throw(0,s.default)(e)&&e.cancelled&&X.events.emit("routeChangeError",e,Z,Q),e}return!0}if(X.events.emit("beforeHistoryChange",r,Q),this.changeState(e,t,r,n),!(W&&!y&&!V&&!ee&&(0,x.compareRouterStates)(v,this.state))){try{await this.set(v,a,y)}catch(e){if(e.cancelled)a.error=a.error||e;else throw e}if(a.error)throw W||X.events.emit("routeChangeError",a.error,Z,Q),a.error;W||X.events.emit("routeChangeComplete",r,Q),d&&/#.+$/.test(r)&&this.scrollToHash(r)}return!0}catch(e){if((0,s.default)(e)&&e.cancelled)return!1;throw e}}changeState(e,t,r,n){void 0===n&&(n={}),("pushState"!==e||(0,d.getURL)()!==r)&&(this._shallow=n.shallow,window.history[e]({url:t,as:r,options:n,__N:!0,key:this._key="pushState"!==e?this._key:G()},"",r))}async handleRouteInfoError(e,t,r,n,o,a){if(console.error(e),e.cancelled)throw e;if((0,i.isAssetError)(e)||a)throw X.events.emit("routeChangeError",e,n,o),z({url:n,router:this}),N();try{let n;let{page:o,styleSheets:a}=await this.fetchComponent("/_error"),i={props:n,Component:o,styleSheets:a,err:e,error:e};if(!i.props)try{i.props=await this.getInitialProps(o,{err:e,pathname:t,query:r})}catch(e){console.error("Error in error page `getInitialProps`: ",e),i.props={}}return i}catch(e){return this.handleRouteInfoError((0,s.default)(e)?e:Error(e+""),t,r,n,o,!0)}}async getRouteInfo(e){let{route:t,pathname:r,query:n,as:o,resolvedAs:i,routeProps:u,locale:l,hasMiddleware:f,isPreview:d,unstable_skipClientCache:h,isQueryUpdating:p,isMiddlewareRewrite:m,isNotFound:g}=e,v=t;try{var b,P,S,w;let e=this.components[v];if(u.shallow&&e&&this.route===v)return e;let t=V({route:v,router:this});f&&(e=void 0);let s=!e||"initial"in e?void 0:e,j={dataHref:this.pageLoader.getDataHref({href:(0,y.formatWithValidation)({pathname:r,query:n}),skipInterpolation:!0,asPath:g?"/404":i,locale:l}),hasMiddleware:!0,isServerRender:this.isSsr,parseJSON:!0,inflightCache:p?this.sbc:this.sdc,persistCache:!d,isPrefetch:!1,unstable_skipClientCache:h,isBackground:p},R=p&&!m?null:await B({fetchData:()=>q(j),asPath:g?"/404":i,locale:l,router:this}).catch(e=>{if(p)return null;throw e});if(R&&("/_error"===r||"/404"===r)&&(R.effect=void 0),p&&(R?R.json=self.__NEXT_DATA__.props:R={json:self.__NEXT_DATA__.props}),t(),(null==R?void 0:null==(b=R.effect)?void 0:b.type)==="redirect-internal"||(null==R?void 0:null==(P=R.effect)?void 0:P.type)==="redirect-external")return R.effect;if((null==R?void 0:null==(S=R.effect)?void 0:S.type)==="rewrite"){let t=(0,a.removeTrailingSlash)(R.effect.resolvedHref),o=await this.pageLoader.getPageList();if((!p||o.includes(t))&&(v=t,r=R.effect.resolvedHref,n={...n,...R.effect.parsedAs.query},i=(0,E.removeBasePath)((0,c.normalizeLocalePath)(R.effect.parsedAs.pathname,this.locales).pathname),e=this.components[v],u.shallow&&e&&this.route===v&&!f))return{...e,route:v}}if((0,O.isAPIRoute)(v))return z({url:o,router:this}),new Promise(()=>{});let T=s||await this.fetchComponent(v).then(e=>({Component:e.page,styleSheets:e.styleSheets,__N_SSG:e.mod.__N_SSG,__N_SSP:e.mod.__N_SSP})),x=null==R?void 0:null==(w=R.response)?void 0:w.headers.get("x-middleware-skip"),M=T.__N_SSG||T.__N_SSP;x&&(null==R?void 0:R.dataHref)&&delete this.sdc[R.dataHref];let{props:I,cacheKey:A}=await this._getData(async()=>{if(M){if((null==R?void 0:R.json)&&!x)return{cacheKey:R.cacheKey,props:R.json};let e=(null==R?void 0:R.dataHref)?R.dataHref:this.pageLoader.getDataHref({href:(0,y.formatWithValidation)({pathname:r,query:n}),asPath:i,locale:l}),t=await q({dataHref:e,isServerRender:this.isSsr,parseJSON:!0,inflightCache:x?{}:this.sdc,persistCache:!d,isPrefetch:!1,unstable_skipClientCache:h});return{cacheKey:t.cacheKey,props:t.json||{}}}return{headers:{},props:await this.getInitialProps(T.Component,{pathname:r,query:n,asPath:o,locale:l,locales:this.locales,defaultLocale:this.defaultLocale})}});return T.__N_SSP&&j.dataHref&&A&&delete this.sdc[A],this.isPreview||!T.__N_SSG||p||q(Object.assign({},j,{isBackground:!0,persistCache:!1,inflightCache:this.sbc})).catch(()=>{}),I.pageProps=Object.assign({},I.pageProps),T.props=I,T.route=v,T.query=n,T.resolvedAs=i,this.components[v]=T,T}catch(e){return this.handleRouteInfoError((0,s.getProperError)(e),r,n,o,u)}}set(e,t,r){return this.state=e,this.sub(t,this.components["/_app"].Component,r)}beforePopState(e){this._bps=e}onlyAHashChange(e){if(!this.asPath)return!1;let[t,r]=this.asPath.split("#",2),[n,o]=e.split("#",2);return!!o&&t===n&&r===o||t===n&&r!==o}scrollToHash(e){let[,t=""]=e.split("#",2);(0,L.handleSmoothScroll)(()=>{if(""===t||"top"===t){window.scrollTo(0,0);return}let e=decodeURIComponent(t),r=document.getElementById(e);if(r){r.scrollIntoView();return}let n=document.getElementsByName(e)[0];n&&n.scrollIntoView()},{onlyHashChange:this.onlyAHashChange(e)})}urlIsNew(e){return this.asPath!==e}async prefetch(e,t,r){if(void 0===t&&(t=e),void 0===r&&(r={}),(0,I.isBot)(window.navigator.userAgent))return;let n=(0,p.parseRelativeUrl)(e),o=n.pathname,{pathname:i,query:u}=n,s=i,l=await this.pageLoader.getPageList(),c=t,f=void 0!==r.locale?r.locale||void 0:this.locale,d=await k({asPath:t,locale:f,router:this});n.pathname=F(n.pathname,l),(0,h.isDynamicRoute)(n.pathname)&&(i=n.pathname,n.pathname=i,Object.assign(u,(0,m.getRouteMatcher)((0,g.getRouteRegex)(n.pathname))((0,v.parsePath)(t).pathname)||{}),d||(e=(0,y.formatWithValidation)(n)));let b=await B({fetchData:()=>q({dataHref:this.pageLoader.getDataHref({href:(0,y.formatWithValidation)({pathname:s,query:u}),skipInterpolation:!0,asPath:c,locale:f}),hasMiddleware:!0,isServerRender:!1,parseJSON:!0,inflightCache:this.sdc,persistCache:!this.isPreview,isPrefetch:!0}),asPath:t,locale:f,router:this});if((null==b?void 0:b.effect.type)==="rewrite"&&(n.pathname=b.effect.resolvedHref,i=b.effect.resolvedHref,u={...u,...b.effect.parsedAs.query},c=b.effect.parsedAs.pathname,e=(0,y.formatWithValidation)(n)),(null==b?void 0:b.effect.type)==="redirect-external")return;let P=(0,a.removeTrailingSlash)(i);await this._bfl(t,c,r.locale,!0)&&(this.components[o]={__appRouter:!0}),await Promise.all([this.pageLoader._isSsg(P).then(t=>!!t&&q({dataHref:(null==b?void 0:b.json)?null==b?void 0:b.dataHref:this.pageLoader.getDataHref({href:e,asPath:c,locale:f}),isServerRender:!1,parseJSON:!0,inflightCache:this.sdc,persistCache:!this.isPreview,isPrefetch:!0,unstable_skipClientCache:r.unstable_skipClientCache||r.priority&&!0}).then(()=>!1).catch(()=>!1)),this.pageLoader[r.priority?"loadPage":"prefetch"](P)])}async fetchComponent(e){let t=V({route:e,router:this});try{let r=await this.pageLoader.loadPage(e);return t(),r}catch(e){throw t(),e}}_getData(e){let t=!1,r=()=>{t=!0};return this.clc=r,e().then(e=>{if(r===this.clc&&(this.clc=null),t){let e=Error("Loading initial props cancelled");throw e.cancelled=!0,e}return e})}_getFlightData(e){return q({dataHref:e,isServerRender:!0,parseJSON:!1,inflightCache:this.sdc,persistCache:!1,isPrefetch:!1}).then(e=>{let{text:t}=e;return{data:t}})}getInitialProps(e,t){let{Component:r}=this.components["/_app"],n=this._wrapApp(r);return t.AppTree=n,(0,d.loadGetInitialProps)(r,{AppTree:n,Component:e,router:this,ctx:t})}get route(){return this.state.route}get pathname(){return this.state.pathname}get query(){return this.state.query}get asPath(){return this.state.asPath}get locale(){return this.state.locale}get isFallback(){return this.state.isFallback}get isPreview(){return this.state.isPreview}constructor(e,t,n,{initialProps:o,pageLoader:i,App:u,wrapApp:s,Component:l,err:c,subscription:f,isFallback:m,locale:g,locales:v,defaultLocale:b,domainLocales:P,isPreview:E}){this.sdc={},this.sbc={},this.isFirstPopStateEvent=!0,this._key=G(),this.onPopState=e=>{let t;let{isFirstPopStateEvent:r}=this;this.isFirstPopStateEvent=!1;let n=e.state;if(!n){let{pathname:e,query:t}=this;this.changeState("replaceState",(0,y.formatWithValidation)({pathname:(0,S.addBasePath)(e),query:t}),(0,d.getURL)());return}if(n.__NA){window.location.reload();return}if(!n.__N||r&&this.locale===n.options.locale&&n.as===this.asPath)return;let{url:o,as:a,options:i,key:u}=n;this._key=u;let{pathname:s}=(0,p.parseRelativeUrl)(o);(!this.isSsr||a!==(0,S.addBasePath)(this.asPath)||s!==(0,S.addBasePath)(this.pathname))&&(!this._bps||this._bps(n))&&this.change("replaceState",o,a,Object.assign({},i,{shallow:i.shallow&&this._shallow,locale:i.locale||this.defaultLocale,_h:0}),t)};let w=(0,a.removeTrailingSlash)(e);this.components={},"/_error"!==e&&(this.components[w]={Component:l,initial:!0,props:o,err:c,__N_SSG:o&&o.__N_SSG,__N_SSP:o&&o.__N_SSP}),this.components["/_app"]={Component:u,styleSheets:[]};{let{BloomFilter:e}=r(97019),t={numItems:0,errorRate:1e-4,numBits:0,numHashes:null,bitArray:[]},n={numItems:0,errorRate:1e-4,numBits:0,numHashes:null,bitArray:[]};(null==t?void 0:t.numHashes)&&(this._bfl_s=new e(t.numItems,t.errorRate),this._bfl_s.import(t)),(null==n?void 0:n.numHashes)&&(this._bfl_d=new e(n.numItems,n.errorRate),this._bfl_d.import(n))}this.events=X.events,this.pageLoader=i;let j=(0,h.isDynamicRoute)(e)&&self.__NEXT_DATA__.autoExport;if(this.basePath="",this.sub=f,this.clc=null,this._wrapApp=s,this.isSsr=!0,this.isLocaleDomain=!1,this.isReady=!!(self.__NEXT_DATA__.gssp||self.__NEXT_DATA__.gip||self.__NEXT_DATA__.isExperimentalCompile||self.__NEXT_DATA__.appGip&&!self.__NEXT_DATA__.gsp||!j&&!self.location.search),this.state={route:w,pathname:e,query:t,asPath:j?e:n,isPreview:!!E,locale:void 0,isFallback:m},this._initialMatchesMiddlewarePromise=Promise.resolve(!1),!n.startsWith("//")){let r={locale:g},o=(0,d.getURL)();this._initialMatchesMiddlewarePromise=k({router:this,locale:g,asPath:o}).then(a=>(r._shouldResolveHref=n!==e,this.changeState("replaceState",a?o:(0,y.formatWithValidation)({pathname:(0,S.addBasePath)(e),query:t}),o,r),a))}window.addEventListener("popstate",this.onPopState)}}X.events=(0,f.default)()},62947:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addLocale",{enumerable:!0,get:function(){return a}});let n=r(80475),o=r(48106);function a(e,t,r,a){if(!t||t===r)return e;let i=e.toLowerCase();return!a&&((0,o.pathHasPrefix)(i,"/api")||(0,o.pathHasPrefix)(i,"/"+t.toLowerCase()))?e:(0,n.addPathPrefix)(e,"/"+t)}},80475:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addPathPrefix",{enumerable:!0,get:function(){return o}});let n=r(42107);function o(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:o,hash:a}=(0,n.parsePath)(e);return""+t+r+o+a}},1476:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addPathSuffix",{enumerable:!0,get:function(){return o}});let n=r(42107);function o(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:o,hash:a}=(0,n.parsePath)(e);return""+r+t+o+a}},3787:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{normalizeAppPath:function(){return a},normalizeRscURL:function(){return i}});let n=r(93650),o=r(74722);function a(e){return(0,n.ensureLeadingSlash)(e.split("/").reduce((e,t,r,n)=>!t||(0,o.isGroupSegment)(t)||"@"===t[0]||("page"===t||"route"===t)&&r===n.length-1?e:e+"/"+t,""))}function i(e){return e.replace(/\.rsc($|\?)/,"$1")}},7750:function(e,t){"use strict";function r(e){return new URL(e,"http://n").searchParams}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"asPathToSearchParams",{enumerable:!0,get:function(){return r}})},44389:function(e,t){"use strict";function r(e,t){let r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let n=r.length;n--;){let o=r[n];if("query"===o){let r=Object.keys(e.query);if(r.length!==Object.keys(t.query).length)return!1;for(let n=r.length;n--;){let o=r[n];if(!t.query.hasOwnProperty(o)||e.query[o]!==t.query[o])return!1}}else if(!t.hasOwnProperty(o)||e[o]!==t[o])return!1}return!0}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"compareRouterStates",{enumerable:!0,get:function(){return r}})},15127:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"formatNextPathnameInfo",{enumerable:!0,get:function(){return u}});let n=r(29362),o=r(80475),a=r(1476),i=r(62947);function u(e){let t=(0,i.addLocale)(e.pathname,e.locale,e.buildId?void 0:e.defaultLocale,e.ignorePrefix);return(e.buildId||!e.trailingSlash)&&(t=(0,n.removeTrailingSlash)(t)),e.buildId&&(t=(0,a.addPathSuffix)((0,o.addPathPrefix)(t,"/_next/data/"+e.buildId),"/"===e.pathname?"index.json":".json")),t=(0,o.addPathPrefix)(t,e.basePath),!e.buildId&&e.trailingSlash?t.endsWith("/")?t:(0,a.addPathSuffix)(t,"/"):(0,n.removeTrailingSlash)(t)}},27420:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{formatUrl:function(){return a},formatWithValidation:function(){return u},urlObjectKeys:function(){return i}});let n=r(61757)._(r(18260)),o=/https?|ftp|gopher|file/;function a(e){let{auth:t,hostname:r}=e,a=e.protocol||"",i=e.pathname||"",u=e.hash||"",s=e.query||"",l=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?l=t+e.host:r&&(l=t+(~r.indexOf(":")?"["+r+"]":r),e.port&&(l+=":"+e.port)),s&&"object"==typeof s&&(s=String(n.urlQueryToSearchParams(s)));let c=e.search||s&&"?"+s||"";return a&&!a.endsWith(":")&&(a+=":"),e.slashes||(!a||o.test(a))&&!1!==l?(l="//"+(l||""),i&&"/"!==i[0]&&(i="/"+i)):l||(l=""),u&&"#"!==u[0]&&(u="#"+u),c&&"?"!==c[0]&&(c="?"+c),""+a+l+(i=i.replace(/[?#]/g,encodeURIComponent))+(c=c.replace("#","%23"))+u}let i=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return a(e)}},28211:function(e,t){"use strict";function r(e,t){return void 0===t&&(t=""),("/"===e?"/index":/^\/index(\/|$)/.test(e)?"/index"+e:e)+t}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}})},91858:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getNextPathnameInfo",{enumerable:!0,get:function(){return i}});let n=r(1808),o=r(16943),a=r(48106);function i(e,t){var r,i;let{basePath:u,i18n:s,trailingSlash:l}=null!=(r=t.nextConfig)?r:{},c={pathname:e,trailingSlash:"/"!==e?e.endsWith("/"):l};u&&(0,a.pathHasPrefix)(c.pathname,u)&&(c.pathname=(0,o.removePathPrefix)(c.pathname,u),c.basePath=u);let f=c.pathname;if(c.pathname.startsWith("/_next/data/")&&c.pathname.endsWith(".json")){let e=c.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),r=e[0];c.buildId=r,f="index"!==e[1]?"/"+e.slice(1).join("/"):"/",!0===t.parseData&&(c.pathname=f)}if(s){let e=t.i18nProvider?t.i18nProvider.analyze(c.pathname):(0,n.normalizeLocalePath)(c.pathname,s.locales);c.locale=e.detectedLocale,c.pathname=null!=(i=e.pathname)?i:c.pathname,!e.detectedLocale&&c.buildId&&(e=t.i18nProvider?t.i18nProvider.analyze(f):(0,n.normalizeLocalePath)(f,s.locales)).detectedLocale&&(c.locale=e.detectedLocale)}return c}},69683:function(e,t){"use strict";function r(e,t){if(void 0===t&&(t={}),t.onlyHashChange){e();return}let r=document.documentElement,n=r.style.scrollBehavior;r.style.scrollBehavior="auto",t.dontForceLayout||r.getClientRects(),e(),r.style.scrollBehavior=n}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleSmoothScroll",{enumerable:!0,get:function(){return r}})},95722:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getSortedRoutes:function(){return n.getSortedRoutes},isDynamicRoute:function(){return o.isDynamicRoute}});let n=r(69960),o=r(38164)},44321:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"interpolateAs",{enumerable:!0,get:function(){return a}});let n=r(10122),o=r(62437);function a(e,t,r){let a="",i=(0,o.getRouteRegex)(e),u=i.groups,s=(t!==e?(0,n.getRouteMatcher)(i)(t):"")||r;a=e;let l=Object.keys(u);return l.every(e=>{let t=s[e]||"",{repeat:r,optional:n}=u[e],o="["+(r?"...":"")+e+"]";return n&&(o=(t?"":"/")+"["+o+"]"),r&&!Array.isArray(t)&&(t=[t]),(n||e in s)&&(a=a.replace(o,r?t.map(e=>encodeURIComponent(e)).join("/"):encodeURIComponent(t))||"/")})||(a=""),{params:l,result:a}}},75004:function(e,t){"use strict";function r(e){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(e)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isBot",{enumerable:!0,get:function(){return r}})},38164:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isDynamicRoute",{enumerable:!0,get:function(){return a}});let n=r(92407),o=/\/\[[^/]+?\](?=\/|$)/;function a(e){return(0,n.isInterceptionRouteAppPath)(e)&&(e=(0,n.extractInterceptionRouteInformation)(e).interceptedRoute),o.test(e)}},2045:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isLocalURL",{enumerable:!0,get:function(){return a}});let n=r(57201),o=r(79142);function a(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},13061:function(e,t){"use strict";function r(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)||(r[n]=e[n])}),r}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"omit",{enumerable:!0,get:function(){return r}})},42107:function(e,t){"use strict";function r(e){let t=e.indexOf("#"),r=e.indexOf("?"),n=r>-1&&(t<0||r-1?{pathname:e.substring(0,n?r:t),query:n?e.substring(r,t>-1?t:void 0):"",hash:t>-1?e.slice(t):""}:{pathname:e,query:"",hash:""}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parsePath",{enumerable:!0,get:function(){return r}})},40505:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parseRelativeUrl",{enumerable:!0,get:function(){return a}});let n=r(57201),o=r(18260);function a(e,t){let r=new URL((0,n.getLocationOrigin)()),a=t?new URL(t,r):e.startsWith(".")?new URL(window.location.href):r,{pathname:i,searchParams:u,search:s,hash:l,href:c,origin:f}=new URL(e,a);if(f!==r.origin)throw Error("invariant: invalid relative URL, router received "+e);return{pathname:i,query:(0,o.searchParamsToUrlQuery)(u),search:s,hash:l,href:c.slice(r.origin.length)}}},48106:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"pathHasPrefix",{enumerable:!0,get:function(){return o}});let n=r(42107);function o(e,t){if("string"!=typeof e)return!1;let{pathname:r}=(0,n.parsePath)(e);return r===t||r.startsWith(t+"/")}},18260:function(e,t){"use strict";function r(e){let t={};return e.forEach((e,r)=>{void 0===t[r]?t[r]=e:Array.isArray(t[r])?t[r].push(e):t[r]=[t[r],e]}),t}function n(e){return"string"!=typeof e&&("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function o(e){let t=new URLSearchParams;return Object.entries(e).forEach(e=>{let[r,o]=e;Array.isArray(o)?o.forEach(e=>t.append(r,n(e))):t.set(r,n(o))}),t}function a(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n{Array.from(t.keys()).forEach(t=>e.delete(t)),t.forEach((t,r)=>e.append(r,t))}),e}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{assign:function(){return a},searchParamsToUrlQuery:function(){return r},urlQueryToSearchParams:function(){return o}})},16943:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removePathPrefix",{enumerable:!0,get:function(){return o}});let n=r(48106);function o(e,t){if(!(0,n.pathHasPrefix)(e,t))return e;let r=e.slice(t.length);return r.startsWith("/")?r:"/"+r}},29362:function(e,t){"use strict";function r(e){return e.replace(/\/$/,"")||"/"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeTrailingSlash",{enumerable:!0,get:function(){return r}})},10122:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getRouteMatcher",{enumerable:!0,get:function(){return o}});let n=r(57201);function o(e){let{re:t,groups:r}=e;return e=>{let o=t.exec(e);if(!o)return!1;let a=e=>{try{return decodeURIComponent(e)}catch(e){throw new n.DecodeError("failed to decode param")}},i={};return Object.keys(r).forEach(e=>{let t=r[e],n=o[t.pos];void 0!==n&&(i[e]=~n.indexOf("/")?n.split("/").map(e=>a(e)):t.repeat?[a(n)]:a(n))}),i}}},62437:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getNamedMiddlewareRegex:function(){return d},getNamedRouteRegex:function(){return f},getRouteRegex:function(){return s}});let n=r(92407),o=r(61885),a=r(29362);function i(e){let t=e.startsWith("[")&&e.endsWith("]");t&&(e=e.slice(1,-1));let r=e.startsWith("...");return r&&(e=e.slice(3)),{key:e,repeat:r,optional:t}}function u(e){let t=(0,a.removeTrailingSlash)(e).slice(1).split("/"),r={},u=1;return{parameterizedRoute:t.map(e=>{let t=n.INTERCEPTION_ROUTE_MARKERS.find(t=>e.startsWith(t)),a=e.match(/\[((?:\[.*\])|.+)\]/);if(t&&a){let{key:e,optional:n,repeat:s}=i(a[1]);return r[e]={pos:u++,repeat:s,optional:n},"/"+(0,o.escapeStringRegexp)(t)+"([^/]+?)"}if(!a)return"/"+(0,o.escapeStringRegexp)(e);{let{key:e,repeat:t,optional:n}=i(a[1]);return r[e]={pos:u++,repeat:t,optional:n},t?n?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)"}}).join(""),groups:r}}function s(e){let{parameterizedRoute:t,groups:r}=u(e);return{re:RegExp("^"+t+"(?:/)?$"),groups:r}}function l(e){let{interceptionMarker:t,getSafeRouteKey:r,segment:n,routeKeys:a,keyPrefix:u}=e,{key:s,optional:l,repeat:c}=i(n),f=s.replace(/\W/g,"");u&&(f=""+u+f);let d=!1;(0===f.length||f.length>30)&&(d=!0),isNaN(parseInt(f.slice(0,1)))||(d=!0),d&&(f=r()),u?a[f]=""+u+s:a[f]=s;let h=t?(0,o.escapeStringRegexp)(t):"";return c?l?"(?:/"+h+"(?<"+f+">.+?))?":"/"+h+"(?<"+f+">.+?)":"/"+h+"(?<"+f+">[^/]+?)"}function c(e,t){let r;let i=(0,a.removeTrailingSlash)(e).slice(1).split("/"),u=(r=0,()=>{let e="",t=++r;for(;t>0;)e+=String.fromCharCode(97+(t-1)%26),t=Math.floor((t-1)/26);return e}),s={};return{namedParameterizedRoute:i.map(e=>{let r=n.INTERCEPTION_ROUTE_MARKERS.some(t=>e.startsWith(t)),a=e.match(/\[((?:\[.*\])|.+)\]/);if(r&&a){let[r]=e.split(a[0]);return l({getSafeRouteKey:u,interceptionMarker:r,segment:a[1],routeKeys:s,keyPrefix:t?"nxtI":void 0})}return a?l({getSafeRouteKey:u,segment:a[1],routeKeys:s,keyPrefix:t?"nxtP":void 0}):"/"+(0,o.escapeStringRegexp)(e)}).join(""),routeKeys:s}}function f(e,t){let r=c(e,t);return{...s(e),namedRegex:"^"+r.namedParameterizedRoute+"(?:/)?$",routeKeys:r.routeKeys}}function d(e,t){let{parameterizedRoute:r}=u(e),{catchAll:n=!0}=t;if("/"===r)return{namedRegex:"^/"+(n?".*":"")+"$"};let{namedParameterizedRoute:o}=c(e,!1);return{namedRegex:"^"+o+(n?"(?:(/.*)?)":"")+"$"}}},69960:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSortedRoutes",{enumerable:!0,get:function(){return n}});class r{insert(e){this._insert(e.split("/").filter(Boolean),[],!1)}smoosh(){return this._smoosh()}_smoosh(e){void 0===e&&(e="/");let t=[...this.children.keys()].sort();null!==this.slugName&&t.splice(t.indexOf("[]"),1),null!==this.restSlugName&&t.splice(t.indexOf("[...]"),1),null!==this.optionalRestSlugName&&t.splice(t.indexOf("[[...]]"),1);let r=t.map(t=>this.children.get(t)._smoosh(""+e+t+"/")).reduce((e,t)=>[...e,...t],[]);if(null!==this.slugName&&r.push(...this.children.get("[]")._smoosh(e+"["+this.slugName+"]/")),!this.placeholder){let t="/"===e?"/":e.slice(0,-1);if(null!=this.optionalRestSlugName)throw Error('You cannot define a route with the same specificity as a optional catch-all route ("'+t+'" and "'+t+"[[..."+this.optionalRestSlugName+']]").');r.unshift(t)}return null!==this.restSlugName&&r.push(...this.children.get("[...]")._smoosh(e+"[..."+this.restSlugName+"]/")),null!==this.optionalRestSlugName&&r.push(...this.children.get("[[...]]")._smoosh(e+"[[..."+this.optionalRestSlugName+"]]/")),r}_insert(e,t,n){if(0===e.length){this.placeholder=!1;return}if(n)throw Error("Catch-all must be the last part of the URL.");let o=e[0];if(o.startsWith("[")&&o.endsWith("]")){let r=o.slice(1,-1),i=!1;if(r.startsWith("[")&&r.endsWith("]")&&(r=r.slice(1,-1),i=!0),r.startsWith("...")&&(r=r.substring(3),n=!0),r.startsWith("[")||r.endsWith("]"))throw Error("Segment names may not start or end with extra brackets ('"+r+"').");if(r.startsWith("."))throw Error("Segment names may not start with erroneous periods ('"+r+"').");function a(e,r){if(null!==e&&e!==r)throw Error("You cannot use different slug names for the same dynamic path ('"+e+"' !== '"+r+"').");t.forEach(e=>{if(e===r)throw Error('You cannot have the same slug name "'+r+'" repeat within a single dynamic path');if(e.replace(/\W/g,"")===o.replace(/\W/g,""))throw Error('You cannot have the slug names "'+e+'" and "'+r+'" differ only by non-word symbols within a single dynamic path')}),t.push(r)}if(n){if(i){if(null!=this.restSlugName)throw Error('You cannot use both an required and optional catch-all route at the same level ("[...'+this.restSlugName+']" and "'+e[0]+'" ).');a(this.optionalRestSlugName,r),this.optionalRestSlugName=r,o="[[...]]"}else{if(null!=this.optionalRestSlugName)throw Error('You cannot use both an optional and required catch-all route at the same level ("[[...'+this.optionalRestSlugName+']]" and "'+e[0]+'").');a(this.restSlugName,r),this.restSlugName=r,o="[...]"}}else{if(i)throw Error('Optional route parameters are not yet supported ("'+e[0]+'").');a(this.slugName,r),this.slugName=r,o="[]"}}this.children.has(o)||this.children.set(o,new r),this.children.get(o)._insert(e.slice(1),t,n)}constructor(){this.placeholder=!0,this.children=new Map,this.slugName=null,this.restSlugName=null,this.optionalRestSlugName=null}}function n(e){let t=new r;return e.forEach(e=>t.insert(e)),t.smoosh()}},61224:function(e,t){"use strict";let r;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return n},setConfig:function(){return o}});let n=()=>r;function o(e){r=e}},74722:function(e,t){"use strict";function r(e){return"("===e[0]&&e.endsWith(")")}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{DEFAULT_SEGMENT_KEY:function(){return o},PAGE_SEGMENT_KEY:function(){return n},isGroupSegment:function(){return r}});let n="__PAGE__",o="__DEFAULT__"},67215:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}});let n=r(67294),o=n.useLayoutEffect,a=n.useEffect;function i(e){let{headManager:t,reduceComponentsToState:r}=e;function i(){if(t&&t.mountedInstances){let o=n.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(r(o,e))}}return o(()=>{var r;return null==t||null==(r=t.mountedInstances)||r.add(e.children),()=>{var r;null==t||null==(r=t.mountedInstances)||r.delete(e.children)}}),o(()=>(t&&(t._pendingUpdate=i),()=>{t&&(t._pendingUpdate=i)})),a(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},57201:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{DecodeError:function(){return p},MiddlewareNotFoundError:function(){return v},MissingStaticPage:function(){return y},NormalizeError:function(){return m},PageNotFoundError:function(){return g},SP:function(){return d},ST:function(){return h},WEB_VITALS:function(){return r},execOnce:function(){return n},getDisplayName:function(){return s},getLocationOrigin:function(){return i},getURL:function(){return u},isAbsoluteUrl:function(){return a},isResSent:function(){return l},loadGetInitialProps:function(){return f},normalizeRepeatedSlashes:function(){return c},stringifyError:function(){return b}});let r=["CLS","FCP","FID","INP","LCP","TTFB"];function n(e){let t,r=!1;return function(){for(var n=arguments.length,o=Array(n),a=0;ao.test(e);function i(){let{protocol:e,hostname:t,port:r}=window.location;return e+"//"+t+(r?":"+r:"")}function u(){let{href:e}=window.location,t=i();return e.substring(t.length)}function s(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function l(e){return e.finished||e.headersSent}function c(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?"?"+t.slice(1).join("?"):"")}async function f(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await f(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&l(r))return n;if(!n)throw Error('"'+s(e)+'.getInitialProps()" should resolve to an object. But found "'+n+'" instead.');return n}let d="undefined"!=typeof performance,h=d&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class p extends Error{}class m extends Error{}class g extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+e}}class y extends Error{constructor(e,t){super(),this.message="Failed to load static file for page: "+e+" "+t}}class v extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function b(e){return JSON.stringify({message:e.message,stack:e.stack})}},1997:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"warnOnce",{enumerable:!0,get:function(){return r}});let r=e=>{}},78018:function(e){var t,r,n,o,a,i,u,s,l,c,f,d,h,p,m,g,y,v,b,P,E,S,w,j,O,R,T,x,M,I,A,C,L,N,k,D,U,F,B,H,W,q,G,z,V,X;(t={}).d=function(e,r){for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},void 0!==t&&(t.ab="//"),r={},t.r(r),t.d(r,{getCLS:function(){return w},getFCP:function(){return P},getFID:function(){return I},getINP:function(){return q},getLCP:function(){return z},getTTFB:function(){return X},onCLS:function(){return w},onFCP:function(){return P},onFID:function(){return I},onINP:function(){return q},onLCP:function(){return z},onTTFB:function(){return X}}),s=-1,l=function(e){addEventListener("pageshow",function(t){t.persisted&&(s=t.timeStamp,e(t))},!0)},c=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},f=function(){var e=c();return e&&e.activationStart||0},d=function(e,t){var r=c(),n="navigate";return s>=0?n="back-forward-cache":r&&(n=document.prerendering||f()>0?"prerender":r.type.replace(/_/g,"-")),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},h=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver(function(e){t(e.getEntries())});return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(e){}},p=function(e,t){var r=function r(n){"pagehide"!==n.type&&"hidden"!==document.visibilityState||(e(n),t&&(removeEventListener("visibilitychange",r,!0),removeEventListener("pagehide",r,!0)))};addEventListener("visibilitychange",r,!0),addEventListener("pagehide",r,!0)},m=function(e,t,r,n){var o,a;return function(i){var u;t.value>=0&&(i||n)&&((a=t.value-(o||0))||void 0===o)&&(o=t.value,t.delta=a,t.rating=(u=t.value)>r[1]?"poor":u>r[0]?"needs-improvement":"good",e(t))}},g=-1,y=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},v=function(){p(function(e){g=e.timeStamp},!0)},b=function(){return g<0&&(g=y(),v(),l(function(){setTimeout(function(){g=y(),v()},0)})),{get firstHiddenTime(){return g}}},P=function(e,t){t=t||{};var r,n=[1800,3e3],o=b(),a=d("FCP"),i=function(e){e.forEach(function(e){"first-contentful-paint"===e.name&&(s&&s.disconnect(),e.startTime-1&&e(t)},a=d("CLS",0),i=0,u=[],s=function(e){e.forEach(function(e){if(!e.hadRecentInput){var t=u[0],r=u[u.length-1];i&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,u.push(e)):(i=e.value,u=[e]),i>a.value&&(a.value=i,a.entries=u,n())}})},c=h("layout-shift",s);c&&(n=m(o,a,r,t.reportAllChanges),p(function(){s(c.takeRecords()),n(!0)}),l(function(){i=0,S=-1,n=m(o,a=d("CLS",0),r,t.reportAllChanges)}))},j={passive:!0,capture:!0},O=new Date,R=function(e,t){n||(n=t,o=e,a=new Date,M(removeEventListener),T())},T=function(){if(o>=0&&o1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?(t=function(){R(o,e),n()},r=function(){n()},n=function(){removeEventListener("pointerup",t,j),removeEventListener("pointercancel",r,j)},addEventListener("pointerup",t,j),addEventListener("pointercancel",r,j)):R(o,e)}},M=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach(function(t){return e(t,x,j)})},I=function(e,t){t=t||{};var r,a=[100,300],u=b(),s=d("FID"),c=function(e){e.startTimet.latency){if(r)r.entries.push(e),r.latency=Math.max(r.latency,e.duration);else{var n={id:e.interactionId,latency:e.duration,entries:[e]};H[n.id]=n,B.push(n)}B.sort(function(e,t){return t.latency-e.latency}),B.splice(10).forEach(function(e){delete H[e.id]})}},q=function(e,t){t=t||{};var r=[200,500];D();var n,o=d("INP"),a=function(e){e.forEach(function(e){e.interactionId&&W(e),"first-input"!==e.entryType||B.some(function(t){return t.entries.some(function(t){return e.duration===t.duration&&e.startTime===t.startTime})})||W(e)});var t,r=(t=Math.min(B.length-1,Math.floor(F()/50)),B[t]);r&&r.latency!==o.value&&(o.value=r.latency,o.entries=r.entries,n())},i=h("event",a,{durationThreshold:t.durationThreshold||40});n=m(e,o,r,t.reportAllChanges),i&&(i.observe({type:"first-input",buffered:!0}),p(function(){a(i.takeRecords()),o.value<0&&F()>0&&(o.value=0,o.entries=[]),n(!0)}),l(function(){B=[],U=k(),n=m(e,o=d("INP"),r,t.reportAllChanges)}))},G={},z=function(e,t){t=t||{};var r,n=[2500,4e3],o=b(),a=d("LCP"),i=function(e){var t=e[e.length-1];if(t){var n=t.startTime-f();nperformance.now())return;n.entries=[a],o(!0),l(function(){(o=m(e,n=d("TTFB",0),r,t.reportAllChanges))(!0)})}})},e.exports=r},79423:function(e,t){"use strict";function r(e){return"/api"===e||!!(null==e?void 0:e.startsWith("/api/"))}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isAPIRoute",{enumerable:!0,get:function(){return r}})},80676:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return o},getProperError:function(){return a}});let n=r(35841);function o(e){return"object"==typeof e&&null!==e&&"name"in e&&"message"in e}function a(e){return o(e)?e:Error((0,n.isPlainObject)(e)?JSON.stringify(e):e+"")}},92407:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{INTERCEPTION_ROUTE_MARKERS:function(){return o},extractInterceptionRouteInformation:function(){return i},isInterceptionRouteAppPath:function(){return a}});let n=r(3787),o=["(..)(..)","(.)","(..)","(...)"];function a(e){return void 0!==e.split("/").find(e=>o.find(t=>e.startsWith(t)))}function i(e){let t,r,a;for(let n of e.split("/"))if(r=o.find(e=>n.startsWith(e))){[t,a]=e.split(r,2);break}if(!t||!r||!a)throw Error(`Invalid interception route: ${e}. Must be in the format //(..|...|..)(..)/`);switch(t=(0,n.normalizeAppPath)(t),r){case"(.)":a="/"===t?`/${a}`:t+"/"+a;break;case"(..)":if("/"===t)throw Error(`Invalid interception route: ${e}. Cannot use (..) marker at the root level, use (.) instead.`);a=t.split("/").slice(0,-1).concat(a).join("/");break;case"(...)":a="/"+a;break;case"(..)(..)":let i=t.split("/");if(i.length<=2)throw Error(`Invalid interception route: ${e}. Cannot use (..)(..) marker at the root level or one level up.`);a=i.slice(0,-2).concat(a).join("/");break;default:throw Error("Invariant: unexpected marker")}return{interceptingRoute:t,interceptedRoute:a}}},72431:function(){},38754:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.r(t),r.d(t,{_:function(){return n},_interop_require_default:function(){return n}})},61757:function(e,t,r){"use strict";function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}function o(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var o={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var u=a?Object.getOwnPropertyDescriptor(e,i):null;u&&(u.get||u.set)?Object.defineProperty(o,i,u):o[i]=e[i]}return o.default=e,r&&r.set(e,o),o}r.r(t),r.d(t,{_:function(){return o},_interop_require_wildcard:function(){return o}})}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[9774],function(){return t(71191),t(4768)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/webpack-cc2976124aab378f.js b/static/web/_next/static/chunks/webpack-cc2976124aab378f.js new file mode 100644 index 000000000..00acfc26d --- /dev/null +++ b/static/web/_next/static/chunks/webpack-cc2976124aab378f.js @@ -0,0 +1 @@ +!function(){"use strict";var e,c,a,f,d,t,b,n,r,u,o,i,s={},l={};function h(e){var c=l[e];if(void 0!==c)return c.exports;var a=l[e]={id:e,loaded:!1,exports:{}},f=!0;try{s[e].call(a.exports,a,a.exports,h),f=!1}finally{f&&delete l[e]}return a.loaded=!0,a.exports}h.m=s,h.amdO={},e=[],h.O=function(c,a,f,d){if(a){d=d||0;for(var t=e.length;t>0&&e[t-1][2]>d;t--)e[t]=e[t-1];e[t]=[a,f,d];return}for(var b=1/0,t=0;t=d&&Object.keys(h.O).every(function(e){return h.O[e](a[r])})?a.splice(r--,1):(n=!1,d