diff --git a/docs/administration/authentication/overview.md b/docs/administration/authentication/overview.md
index 6b805ee92..37e81b3a3 100644
--- a/docs/administration/authentication/overview.md
+++ b/docs/administration/authentication/overview.md
@@ -41,6 +41,12 @@ NetBox supports single sign-on authentication via the [python-social-auth](https
Most remote authentication backends require some additional configuration through settings prefixed with `SOCIAL_AUTH_`. These will be automatically imported from NetBox's `configuration.py` file. Additionally, the [authentication pipeline](https://python-social-auth.readthedocs.io/en/latest/pipeline.html) can be customized via the `SOCIAL_AUTH_PIPELINE` parameter. (NetBox's default pipeline is defined in `netbox/settings.py` for your reference.)
+!!! note "Content Security Policy"
+ Beginning an SSO login requires the browser to make a request back to NetBox before it is sent
+ on to the identity provider. If you serve NetBox with a Content Security Policy which does not
+ permit same-origin connections, SSO logins will fail: add `connect-src 'self'` (or a
+ `default-src` which covers it) to your policy.
+
#### Configuring the SSO module's appearance
The way a remote authentication backend is displayed to the user on the login
diff --git a/netbox/account/views.py b/netbox/account/views.py
index 416981d22..1c16d6d54 100644
--- a/netbox/account/views.py
+++ b/netbox/account/views.py
@@ -9,14 +9,16 @@ from django.contrib.auth.forms import AuthenticationForm, PasswordChangeForm
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.models import update_last_login
from django.contrib.auth.signals import user_logged_in
-from django.http import HttpResponseRedirect
+from django.http import HttpResponseRedirect, JsonResponse
from django.shortcuts import get_object_or_404, redirect, render, resolve_url
from django.urls import reverse, reverse_lazy
from django.utils.decorators import method_decorator
from django.utils.translation import gettext_lazy as _
+from django.views.decorators.cache import never_cache
from django.views.decorators.debug import sensitive_post_parameters
from django.views.generic import View
from social_core.backends.utils import load_backends
+from social_django.views import auth as social_auth_begin
from account.models import UserToken
from core.models import ObjectChange
@@ -78,7 +80,7 @@ class LoginView(View):
request_data = request.POST if request.method == 'POST' else request.GET
for name in load_backends(settings.AUTHENTICATION_BACKENDS).keys():
- url = reverse('social:begin', args=[name])
+ url = reverse('social_auth_begin', args=[name])
params = {}
if next := request_data.get('next'):
params['next'] = next
@@ -188,6 +190,50 @@ class LogoutView(View):
return response
+class SocialAuthBeginView(View):
+ """
+ Initiate authentication against a social auth (SSO) backend.
+
+ This wraps python-social-auth's "begin" view, which responds with an HTTP redirect to the
+ identity provider. Chromium-based browsers evaluate the CSP `form-action` directive against
+ every hop in a form submission's redirect chain, so a deployment which serves NetBox with
+ `form-action 'self'` (a common reverse proxy default) blocks that redirect and the SSO button
+ appears to do nothing. A client which asks for JSON is given the identity provider's URL in the
+ response body instead, and navigates to it itself: `form-action` does not govern a navigation
+ initiated by a script. Any other client (e.g. a browser with JavaScript disabled) receives the
+ unmodified response from python-social-auth.
+
+ A backend which does not redirect (`uses_redirect()` is False, as for OpenID 2.0) renders its
+ own HTML instead, which is returned in the response body for the client to render in place so
+ that it need not repeat the request. This is not a way around `form-action`: that document
+ carries a form which submits itself to the identity provider, and such a submission is governed
+ by the policy wherever the document is rendered. Deployments using one of these backends still
+ require a `form-action` which admits the identity provider.
+
+ The underlying view is reused as-is so that CSRF protection, the callback URL, and the session
+ state recorded for the identity provider all remain identical to a direct form submission.
+ """
+ @method_decorator(never_cache)
+ def dispatch(self, *args, **kwargs):
+ return super().dispatch(*args, **kwargs)
+
+ def post(self, request, backend):
+ response = social_auth_begin(request, backend)
+
+ if 'application/json' in request.headers.get('Accept', ''):
+ if url := response.headers.get('Location'):
+ return JsonResponse({'url': url})
+ if response.status_code == 200:
+ # Some backends render an HTML form (which submits itself to the identity provider)
+ # rather than redirecting. Hand that document to the client to render, so that it
+ # need not repeat the request and initiate the login a second time.
+ return JsonResponse({'html': response.content.decode(response.charset)})
+
+ # Anything else (including the response to a client which has not asked for JSON) is passed
+ # through unchanged.
+ return response
+
+
#
# User profiles
#
diff --git a/netbox/netbox/tests/test_authentication.py b/netbox/netbox/tests/test_authentication.py
index 56b6c748a..3deac7157 100644
--- a/netbox/netbox/tests/test_authentication.py
+++ b/netbox/netbox/tests/test_authentication.py
@@ -6,6 +6,7 @@ from unittest.mock import MagicMock, patch
from django.conf import settings
from django.contrib.messages.storage.fallback import FallbackStorage
+from django.http import HttpResponse
from django.test import Client, RequestFactory, SimpleTestCase
from django.test import TestCase as DjangoTestCase
from django.test.utils import override_settings
@@ -861,7 +862,7 @@ class SSOLoginButtonTestCase(DjangoTestCase):
Return the body of the rendered SSO form. The password login form renders its own hidden
`next` field, so assertions about the SSO parameters must be scoped to this form.
"""
- begin_url = reverse('social:begin', args=['google-oauth2'])
+ begin_url = reverse('social_auth_begin', args=['google-oauth2'])
match = re.search(
rf'
',
response.content.decode(),
@@ -876,7 +877,7 @@ class SSOLoginButtonTestCase(DjangoTestCase):
"""
Each SSO button must be rendered as a POST form (including a CSRF token) rather than a link.
"""
- begin_url = reverse('social:begin', args=['google-oauth2'])
+ begin_url = reverse('social_auth_begin', args=['google-oauth2'])
response = self.client.get(reverse('login'))
self.assertEqual(response.status_code, 200)
@@ -951,6 +952,158 @@ class SSOLoginButtonTestCase(DjangoTestCase):
self.assertEqual(auth_backend['params'].get('next'), '/dcim/sites/')
+class SocialAuthBeginViewTestCase(DjangoTestCase):
+ """
+ Verify the view which initiates an SSO login. Chromium-based browsers evaluate the CSP
+ `form-action` directive against every hop in a form submission's redirect chain, so redirecting
+ the submission to the identity provider is blocked wherever `form-action 'self'` is enforced.
+ Clients which ask for JSON are handed the identity provider's URL to navigate to instead
+ (see #23112).
+ """
+ SSO_BACKENDS = [
+ 'social_core.backends.google.GoogleOAuth2',
+ 'netbox.authentication.ObjectPermissionBackend',
+ ]
+ AUTHORIZATION_URL = 'https://accounts.google.com/o/oauth2/auth'
+ # Stands in for the document rendered by a backend which does not redirect (see BaseAuth.start())
+ AUTH_HTML = ''
+
+ def setUp(self):
+ # load_backends() caches the discovered backends in a module-level dict, so isolate the
+ # backends overridden below from the remainder of the test suite.
+ cache_patcher = patch.dict('social_core.backends.utils.BACKENDSCACHE', {}, clear=True)
+ cache_patcher.start()
+ self.addCleanup(cache_patcher.stop)
+
+ self.url = reverse('social_auth_begin', args=['google-oauth2'])
+
+ @override_settings(AUTHENTICATION_BACKENDS=SSO_BACKENDS)
+ def test_json_request_returns_authorization_url(self):
+ """
+ A client which requests JSON receives the identity provider's URL in the response body
+ rather than an HTTP redirect, so that it can navigate there itself.
+ """
+ response = self.client.post(self.url, headers={'accept': 'application/json'})
+
+ self.assertEqual(response.status_code, 200)
+ self.assertEqual(response.headers['Content-Type'], 'application/json')
+ self.assertNotIn('Location', response.headers)
+ self.assertTrue(response.json()['url'].startswith(self.AUTHORIZATION_URL))
+
+ @override_settings(AUTHENTICATION_BACKENDS=SSO_BACKENDS)
+ def test_form_submission_returns_redirect(self):
+ """
+ A client which has not asked for JSON (e.g. a browser with JavaScript disabled) receives the
+ unmodified redirect from python-social-auth.
+ """
+ response = self.client.post(self.url, headers={'accept': 'text/html'})
+
+ self.assertEqual(response.status_code, 302)
+ self.assertTrue(response.headers['Location'].startswith(self.AUTHORIZATION_URL))
+
+ @override_settings(AUTHENTICATION_BACKENDS=SSO_BACKENDS)
+ def test_session_state_recorded(self):
+ """
+ The anti-forgery state conveyed to the identity provider must be recorded in the session, as
+ the completion view compares the two. This is what makes the JSON response safe to follow:
+ the session established here is the one the callback is validated against.
+ """
+ response = self.client.post(self.url, headers={'accept': 'application/json'})
+
+ state = self.client.session['google-oauth2_state']
+ self.assertIn(f'state={state}', response.json()['url'])
+
+ @override_settings(AUTHENTICATION_BACKENDS=SSO_BACKENDS)
+ def test_next_recorded_in_session(self):
+ """
+ The post-login URL is read from the POST data by do_auth() and stashed in the session; the
+ wrapper must not interfere with the form fields rendered on the login page.
+ """
+ self.client.post(self.url, {'next': '/dcim/sites/'}, headers={'accept': 'application/json'})
+
+ self.assertEqual(self.client.session['next'], '/dcim/sites/')
+
+ @override_settings(AUTHENTICATION_BACKENDS=SSO_BACKENDS)
+ def test_get_request_not_allowed(self):
+ """
+ Authentication must be initiated by POST: a GET request is trivially forgeable, which is why
+ social-auth-app-django restricts its own begin view to POST.
+ """
+ response = self.client.get(self.url)
+
+ self.assertEqual(response.status_code, 405)
+
+ @override_settings(AUTHENTICATION_BACKENDS=SSO_BACKENDS)
+ def test_csrf_token_required(self):
+ """
+ CSRF protection must be retained, so that a third party cannot silently initiate an SSO
+ login on the user's behalf.
+ """
+ client = Client(enforce_csrf_checks=True)
+ response = client.post(self.url, headers={'accept': 'application/json'})
+
+ self.assertEqual(response.status_code, 403)
+
+ @override_settings(AUTHENTICATION_BACKENDS=SSO_BACKENDS)
+ def test_response_is_not_cached(self):
+ """
+ The authorization URL embeds a single-use state parameter and must never be cached.
+ """
+ response = self.client.post(self.url, headers={'accept': 'application/json'})
+
+ self.assertIn('no-store', response.headers['Cache-Control'])
+
+ @override_settings(AUTHENTICATION_BACKENDS=SSO_BACKENDS)
+ def test_unknown_backend(self):
+ """
+ An unconfigured backend yields an HTTP 404, as it does via python-social-auth directly.
+ """
+ response = self.client.post(reverse('social_auth_begin', args=['nosuchbackend']))
+
+ self.assertEqual(response.status_code, 404)
+
+ @override_settings(AUTHENTICATION_BACKENDS=SSO_BACKENDS)
+ @patch('social_core.backends.google.GoogleOAuth2.uses_redirect', return_value=False)
+ @patch('social_core.backends.google.GoogleOAuth2.auth_html', return_value=AUTH_HTML)
+ def test_json_request_returns_html_for_non_redirecting_backend(self, _auth_html, _uses_redirect):
+ """
+ A backend which renders its own HTML rather than redirecting has that document returned in
+ the response body. The client renders it in place: were it made to submit the form to fetch
+ the document again, the login would be initiated a second time.
+ """
+ response = self.client.post(self.url, headers={'accept': 'application/json'})
+
+ self.assertEqual(response.status_code, 200)
+ self.assertEqual(response.headers['Content-Type'], 'application/json')
+ self.assertNotIn('Location', response.headers)
+ self.assertEqual(response.json()['html'], self.AUTH_HTML)
+
+ @override_settings(AUTHENTICATION_BACKENDS=SSO_BACKENDS)
+ @patch('social_core.backends.google.GoogleOAuth2.uses_redirect', return_value=False)
+ @patch('social_core.backends.google.GoogleOAuth2.auth_html', return_value=AUTH_HTML)
+ def test_html_passed_through_for_non_redirecting_backend(self, _auth_html, _uses_redirect):
+ """
+ A client which has not asked for JSON receives that same document unmodified.
+ """
+ response = self.client.post(self.url, headers={'accept': 'text/html'})
+
+ self.assertEqual(response.status_code, 200)
+ self.assertEqual(response.content.decode(), self.AUTH_HTML)
+
+ @override_settings(AUTHENTICATION_BACKENDS=SSO_BACKENDS)
+ @patch('account.views.social_auth_begin', side_effect=lambda *args, **kwargs: HttpResponse(status=502))
+ def test_json_request_passes_through_error_response(self, _begin):
+ """
+ Only a redirect or a rendered document is translated to JSON. An unsuccessful response is
+ passed through as-is, so that the client reports the failure rather than mistaking the
+ response for a login it can act on.
+ """
+ response = self.client.post(self.url, headers={'accept': 'application/json'})
+
+ self.assertEqual(response.status_code, 502)
+ self.assertNotEqual(response.headers.get('Content-Type'), 'application/json')
+
+
class SocialAuthExceptionMiddlewareTestCase(SimpleTestCase):
"""
Verify that SSO/SAML authentication failures are surfaced as a login-page message rather than
diff --git a/netbox/netbox/urls.py b/netbox/netbox/urls.py
index 6629e41e2..7ff81cc21 100644
--- a/netbox/netbox/urls.py
+++ b/netbox/netbox/urls.py
@@ -4,7 +4,7 @@ from django.urls import path
from django.views.decorators.cache import cache_page
from drf_spectacular.views import SpectacularAPIView, SpectacularRedocView, SpectacularSwaggerView
-from account.views import LoginView, LogoutView
+from account.views import LoginView, LogoutView, SocialAuthBeginView
from netbox.api.views import APIRootView, AuthenticationCheckView, StatusView
from netbox.graphql.schema import schema
from netbox.graphql.views import NetBoxGraphQLView
@@ -20,6 +20,7 @@ _patterns = [
# Login/logout
path('login/', LoginView.as_view(), name='login'),
path('logout/', LogoutView.as_view(), name='logout'),
+ path('oauth/begin//', SocialAuthBeginView.as_view(), name='social_auth_begin'),
path('oauth/', include('social_django.urls', namespace='social')),
# Apps
diff --git a/netbox/project-static/dist/netbox.js b/netbox/project-static/dist/netbox.js
index a4006f23a..5ca8cb4f8 100644
--- a/netbox/project-static/dist/netbox.js
+++ b/netbox/project-static/dist/netbox.js
@@ -1,11 +1,11 @@
-"use strict";(()=>{var hu=Object.create;var Li=Object.defineProperty,pu=Object.defineProperties,mu=Object.getOwnPropertyDescriptor,gu=Object.getOwnPropertyDescriptors,vu=Object.getOwnPropertyNames,vs=Object.getOwnPropertySymbols,yu=Object.getPrototypeOf,ys=Object.prototype.hasOwnProperty,Eu=Object.prototype.propertyIsEnumerable;var Ur=(n,e,t)=>e in n?Li(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,O=(n,e)=>{for(var t in e||(e={}))ys.call(e,t)&&Ur(n,t,e[t]);if(vs)for(var t of vs(e))Eu.call(e,t)&&Ur(n,t,e[t]);return n},oe=(n,e)=>pu(n,gu(e));var bu=(n,e)=>()=>{try{return e||n((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},Es=(n,e)=>{for(var t in e)Li(n,t,{get:e[t],enumerable:!0})},_u=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of vu(e))!ys.call(n,r)&&r!==t&&Li(n,r,{get:()=>e[r],enumerable:!(i=mu(e,r))||i.enumerable});return n};var wu=(n,e,t)=>(t=n!=null?hu(yu(n)):{},_u(e||!n||!n.__esModule?Li(t,"default",{value:n,enumerable:!0}):t,n));var ae=(n,e,t)=>Ur(n,typeof e!="symbol"?e+"":e,t);var at=(n,e,t)=>new Promise((i,r)=>{var o=l=>{try{a(t.next(l))}catch(c){r(c)}},s=l=>{try{a(t.throw(l))}catch(c){r(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,s);a((t=t.apply(n,e)).next())});var Dc=bu((gi,os)=>{(function(e,t){typeof gi=="object"&&typeof os=="object"?os.exports=t():typeof define=="function"&&define.amd?define([],t):typeof gi=="object"?gi.ClipboardJS=t():e.ClipboardJS=t()})(gi,function(){return(function(){var n={686:(function(i,r,o){"use strict";o.d(r,{default:function(){return Ie}});var s=o(279),a=o.n(s),l=o(370),c=o.n(l),u=o(817),d=o.n(u);function p(W){try{return document.execCommand(W)}catch(M){return!1}}var y=function(M){var D=d()(M);return p("cut"),D},m=y;function g(W){var M=document.documentElement.getAttribute("dir")==="rtl",D=document.createElement("textarea");D.style.fontSize="12pt",D.style.border="0",D.style.padding="0",D.style.margin="0",D.style.position="absolute",D.style[M?"right":"left"]="-9999px";var B=window.pageYOffset||document.documentElement.scrollTop;return D.style.top="".concat(B,"px"),D.setAttribute("readonly",""),D.value=W,D}var _=function(M,D){var B=g(M);D.container.appendChild(B);var V=d()(B);return p("copy"),B.remove(),V},x=function(M){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},B="";return typeof M=="string"?B=_(M,D):M instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(M==null?void 0:M.type)?B=_(M.value,D):(B=d()(M),p("copy")),B},A=x;function w(W){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?w=function(D){return typeof D}:w=function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},w(W)}var C=function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},D=M.action,B=D===void 0?"copy":D,V=M.container,U=M.target,Y=M.text;if(B!=="copy"&&B!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(U!==void 0)if(U&&w(U)==="object"&&U.nodeType===1){if(B==="copy"&&U.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(B==="cut"&&(U.hasAttribute("readonly")||U.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(Y)return A(Y,{container:V});if(U)return B==="cut"?m(U):A(U,{container:V})},$=C;function q(W){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?q=function(D){return typeof D}:q=function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},q(W)}function H(W,M){if(!(W instanceof M))throw new TypeError("Cannot call a class as a function")}function R(W,M){for(var D=0;D0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof V.action=="function"?V.action:this.defaultAction,this.target=typeof V.target=="function"?V.target:this.defaultTarget,this.text=typeof V.text=="function"?V.text:this.defaultText,this.container=q(V.container)==="object"?V.container:document.body}},{key:"listenClick",value:function(V){var U=this;this.listener=c()(V,"click",function(Y){return U.onClick(Y)})}},{key:"onClick",value:function(V){var U=V.delegateTarget||V.currentTarget,Y=this.action(U)||"copy",ee=$({action:Y,container:this.container,target:this.target(U),text:this.text(U)});this.emit(ee?"success":"error",{action:Y,text:ee,trigger:U,clearSelection:function(){U&&U.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(V){return ne("action",V)}},{key:"defaultTarget",value:function(V){var U=ne("target",V);if(U)return document.querySelector(U)}},{key:"defaultText",value:function(V){return ne("text",V)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(V){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return A(V,U)}},{key:"cut",value:function(V){return m(V)}},{key:"isSupported",value:function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],U=typeof V=="string"?[V]:V,Y=!!document.queryCommandSupported;return U.forEach(function(ee){Y=Y&&!!document.queryCommandSupported(ee)}),Y}}]),D})(a()),Ie=Ue}),828:(function(i){var r=9;if(typeof Element!="undefined"&&!Element.prototype.matches){var o=Element.prototype;o.matches=o.matchesSelector||o.mozMatchesSelector||o.msMatchesSelector||o.oMatchesSelector||o.webkitMatchesSelector}function s(a,l){for(;a&&a.nodeType!==r;){if(typeof a.matches=="function"&&a.matches(l))return a;a=a.parentNode}}i.exports=s}),438:(function(i,r,o){var s=o(828);function a(u,d,p,y,m){var g=c.apply(this,arguments);return u.addEventListener(p,g,m),{destroy:function(){u.removeEventListener(p,g,m)}}}function l(u,d,p,y,m){return typeof u.addEventListener=="function"?a.apply(null,arguments):typeof p=="function"?a.bind(null,document).apply(null,arguments):(typeof u=="string"&&(u=document.querySelectorAll(u)),Array.prototype.map.call(u,function(g){return a(g,d,p,y,m)}))}function c(u,d,p,y){return function(m){m.delegateTarget=s(m.target,d),m.delegateTarget&&y.call(u,m)}}i.exports=l}),879:(function(i,r){r.node=function(o){return o!==void 0&&o instanceof HTMLElement&&o.nodeType===1},r.nodeList=function(o){var s=Object.prototype.toString.call(o);return o!==void 0&&(s==="[object NodeList]"||s==="[object HTMLCollection]")&&"length"in o&&(o.length===0||r.node(o[0]))},r.string=function(o){return typeof o=="string"||o instanceof String},r.fn=function(o){var s=Object.prototype.toString.call(o);return s==="[object Function]"}}),370:(function(i,r,o){var s=o(879),a=o(438);function l(p,y,m){if(!p&&!y&&!m)throw new Error("Missing required arguments");if(!s.string(y))throw new TypeError("Second argument must be a String");if(!s.fn(m))throw new TypeError("Third argument must be a Function");if(s.node(p))return c(p,y,m);if(s.nodeList(p))return u(p,y,m);if(s.string(p))return d(p,y,m);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function c(p,y,m){return p.addEventListener(y,m),{destroy:function(){p.removeEventListener(y,m)}}}function u(p,y,m){return Array.prototype.forEach.call(p,function(g){g.addEventListener(y,m)}),{destroy:function(){Array.prototype.forEach.call(p,function(g){g.removeEventListener(y,m)})}}}function d(p,y,m){return a(document.body,p,y,m)}i.exports=l}),817:(function(i){function r(o){var s;if(o.nodeName==="SELECT")o.focus(),s=o.value;else if(o.nodeName==="INPUT"||o.nodeName==="TEXTAREA"){var a=o.hasAttribute("readonly");a||o.setAttribute("readonly",""),o.select(),o.setSelectionRange(0,o.value.length),a||o.removeAttribute("readonly"),s=o.value}else{o.hasAttribute("contenteditable")&&o.focus();var l=window.getSelection(),c=document.createRange();c.selectNodeContents(o),l.removeAllRanges(),l.addRange(c),s=l.toString()}return s}i.exports=r}),279:(function(i){function r(){}r.prototype={on:function(o,s,a){var l=this.e||(this.e={});return(l[o]||(l[o]=[])).push({fn:s,ctx:a}),this},once:function(o,s,a){var l=this;function c(){l.off(o,c),s.apply(a,arguments)}return c._=s,this.on(o,c,a)},emit:function(o){var s=[].slice.call(arguments,1),a=((this.e||(this.e={}))[o]||[]).slice(),l=0,c=a.length;for(l;lCs,afterRead:()=>ws,afterWrite:()=>Ds,applyStyles:()=>hn,arrow:()=>Ni,auto:()=>zn,basePlacements:()=>lt,beforeMain:()=>xs,beforeRead:()=>bs,beforeWrite:()=>Ss,bottom:()=>ge,clippingParents:()=>Yr,computeStyles:()=>mn,createPopper:()=>Qn,createPopperBase:()=>Ps,createPopperLite:()=>Fs,detectOverflow:()=>ke,end:()=>_t,eventListeners:()=>gn,flip:()=>Ii,hide:()=>Pi,left:()=>pe,main:()=>Ts,modifierPhases:()=>Kr,offset:()=>Fi,placements:()=>jn,popper:()=>$t,popperGenerator:()=>Yt,popperOffsets:()=>En,preventOverflow:()=>$i,read:()=>_s,reference:()=>Gr,right:()=>me,start:()=>rt,top:()=>de,variationPlacements:()=>Mi,viewport:()=>qn,write:()=>As});var de="top",ge="bottom",me="right",pe="left",zn="auto",lt=[de,ge,me,pe],rt="start",_t="end",Yr="clippingParents",qn="viewport",$t="popper",Gr="reference",Mi=lt.reduce(function(n,e){return n.concat([e+"-"+rt,e+"-"+_t])},[]),jn=[].concat(lt,[zn]).reduce(function(n,e){return n.concat([e,e+"-"+rt,e+"-"+_t])},[]),bs="beforeRead",_s="read",ws="afterRead",xs="beforeMain",Ts="main",Cs="afterMain",Ss="beforeWrite",As="write",Ds="afterWrite",Kr=[bs,_s,ws,xs,Ts,Cs,Ss,As,Ds];function xe(n){return n?(n.nodeName||"").toLowerCase():null}function ce(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function Ye(n){var e=ce(n).Element;return n instanceof e||n instanceof Element}function _e(n){var e=ce(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function fn(n){if(typeof ShadowRoot=="undefined")return!1;var e=ce(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function xu(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},r=e.attributes[t]||{},o=e.elements[t];!_e(o)||!xe(o)||(Object.assign(o.style,i),Object.keys(r).forEach(function(s){var a=r[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function Tu(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var r=e.elements[i],o=e.attributes[i]||{},s=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),a=s.reduce(function(l,c){return l[c]="",l},{});!_e(r)||!xe(r)||(Object.assign(r.style,a),Object.keys(o).forEach(function(l){r.removeAttribute(l)}))})}}var hn={name:"applyStyles",enabled:!0,phase:"write",fn:xu,effect:Tu,requires:["computeStyles"]};function Te(n){return n.split("-")[0]}var Ze=Math.max,Bt=Math.min,ct=Math.round;function pn(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Wn(){return!/^((?!chrome|android).)*safari/i.test(pn())}function Ge(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=n.getBoundingClientRect(),r=1,o=1;e&&_e(n)&&(r=n.offsetWidth>0&&ct(i.width)/n.offsetWidth||1,o=n.offsetHeight>0&&ct(i.height)/n.offsetHeight||1);var s=Ye(n)?ce(n):window,a=s.visualViewport,l=!Wn()&&t,c=(i.left+(l&&a?a.offsetLeft:0))/r,u=(i.top+(l&&a?a.offsetTop:0))/o,d=i.width/r,p=i.height/o;return{width:d,height:p,top:u,right:c+d,bottom:u+p,left:c,x:c,y:u}}function Vt(n){var e=Ge(n),t=n.offsetWidth,i=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:i}}function Un(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&fn(t)){var i=e;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Ne(n){return ce(n).getComputedStyle(n)}function Xr(n){return["table","td","th"].indexOf(xe(n))>=0}function Se(n){return((Ye(n)?n.ownerDocument:n.document)||window.document).documentElement}function ut(n){return xe(n)==="html"?n:n.assignedSlot||n.parentNode||(fn(n)?n.host:null)||Se(n)}function Os(n){return!_e(n)||Ne(n).position==="fixed"?null:n.offsetParent}function Cu(n){var e=/firefox/i.test(pn()),t=/Trident/i.test(pn());if(t&&_e(n)){var i=Ne(n);if(i.position==="fixed")return null}var r=ut(n);for(fn(r)&&(r=r.host);_e(r)&&["html","body"].indexOf(xe(r))<0;){var o=Ne(r);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return r;r=r.parentNode}return null}function et(n){for(var e=ce(n),t=Os(n);t&&Xr(t)&&Ne(t).position==="static";)t=Os(t);return t&&(xe(t)==="html"||xe(t)==="body"&&Ne(t).position==="static")?e:t||Cu(n)||e}function zt(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function qt(n,e,t){return Ze(n,Bt(e,t))}function Ls(n,e,t){var i=qt(n,e,t);return i>t?t:i}function Yn(){return{top:0,right:0,bottom:0,left:0}}function Gn(n){return Object.assign({},Yn(),n)}function Kn(n,e){return e.reduce(function(t,i){return t[i]=n,t},{})}var Su=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,Gn(typeof e!="number"?e:Kn(e,lt))};function Au(n){var e,t=n.state,i=n.name,r=n.options,o=t.elements.arrow,s=t.modifiersData.popperOffsets,a=Te(t.placement),l=zt(a),c=[pe,me].indexOf(a)>=0,u=c?"height":"width";if(!(!o||!s)){var d=Su(r.padding,t),p=Vt(o),y=l==="y"?de:pe,m=l==="y"?ge:me,g=t.rects.reference[u]+t.rects.reference[l]-s[l]-t.rects.popper[u],_=s[l]-t.rects.reference[l],x=et(o),A=x?l==="y"?x.clientHeight||0:x.clientWidth||0:0,w=g/2-_/2,C=d[y],$=A-p[u]-d[m],q=A/2-p[u]/2+w,H=qt(C,q,$),R=l;t.modifiersData[i]=(e={},e[R]=H,e.centerOffset=H-q,e)}}function Du(n){var e=n.state,t=n.options,i=t.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||Un(e.elements.popper,r)&&(e.elements.arrow=r))}var Ni={name:"arrow",enabled:!0,phase:"main",fn:Au,effect:Du,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ke(n){return n.split("-")[1]}var Ou={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Lu(n,e){var t=n.x,i=n.y,r=e.devicePixelRatio||1;return{x:ct(t*r)/r||0,y:ct(i*r)/r||0}}function Ms(n){var e,t=n.popper,i=n.popperRect,r=n.placement,o=n.variation,s=n.offsets,a=n.position,l=n.gpuAcceleration,c=n.adaptive,u=n.roundOffsets,d=n.isFixed,p=s.x,y=p===void 0?0:p,m=s.y,g=m===void 0?0:m,_=typeof u=="function"?u({x:y,y:g}):{x:y,y:g};y=_.x,g=_.y;var x=s.hasOwnProperty("x"),A=s.hasOwnProperty("y"),w=pe,C=de,$=window;if(c){var q=et(t),H="clientHeight",R="clientWidth";if(q===ce(t)&&(q=Se(t),Ne(q).position!=="static"&&a==="absolute"&&(H="scrollHeight",R="scrollWidth")),q=q,r===de||(r===pe||r===me)&&o===_t){C=ge;var L=d&&q===$&&$.visualViewport?$.visualViewport.height:q[H];g-=L-i.height,g*=l?1:-1}if(r===pe||(r===de||r===ge)&&o===_t){w=me;var j=d&&q===$&&$.visualViewport?$.visualViewport.width:q[R];y-=j-i.width,y*=l?1:-1}}var G=Object.assign({position:a},c&&Ou),Q=u===!0?Lu({x:y,y:g},ce(t)):{x:y,y:g};if(y=Q.x,g=Q.y,l){var Z;return Object.assign({},G,(Z={},Z[C]=A?"0":"",Z[w]=x?"0":"",Z.transform=($.devicePixelRatio||1)<=1?"translate("+y+"px, "+g+"px)":"translate3d("+y+"px, "+g+"px, 0)",Z))}return Object.assign({},G,(e={},e[C]=A?g+"px":"",e[w]=x?y+"px":"",e.transform="",e))}function Mu(n){var e=n.state,t=n.options,i=t.gpuAcceleration,r=i===void 0?!0:i,o=t.adaptive,s=o===void 0?!0:o,a=t.roundOffsets,l=a===void 0?!0:a,c={placement:Te(e.placement),variation:Ke(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Ms(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Ms(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var mn={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Mu,data:{}};var ki={passive:!0};function Nu(n){var e=n.state,t=n.instance,i=n.options,r=i.scroll,o=r===void 0?!0:r,s=i.resize,a=s===void 0?!0:s,l=ce(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",t.update,ki)}),a&&l.addEventListener("resize",t.update,ki),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",t.update,ki)}),a&&l.removeEventListener("resize",t.update,ki)}}var gn={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Nu,data:{}};var ku={left:"right",right:"left",bottom:"top",top:"bottom"};function vn(n){return n.replace(/left|right|bottom|top/g,function(e){return ku[e]})}var Hu={start:"end",end:"start"};function Hi(n){return n.replace(/start|end/g,function(e){return Hu[e]})}function jt(n){var e=ce(n),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function Wt(n){return Ge(Se(n)).left+jt(n).scrollLeft}function Qr(n,e){var t=ce(n),i=Se(n),r=t.visualViewport,o=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;var c=Wn();(c||!c&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a+Wt(n),y:l}}function Jr(n){var e,t=Se(n),i=jt(n),r=(e=n.ownerDocument)==null?void 0:e.body,o=Ze(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=Ze(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+Wt(n),l=-i.scrollTop;return Ne(r||t).direction==="rtl"&&(a+=Ze(t.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function Ut(n){var e=Ne(n),t=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+i)}function Ri(n){return["html","body","#document"].indexOf(xe(n))>=0?n.ownerDocument.body:_e(n)&&Ut(n)?n:Ri(ut(n))}function wt(n,e){var t;e===void 0&&(e=[]);var i=Ri(n),r=i===((t=n.ownerDocument)==null?void 0:t.body),o=ce(i),s=r?[o].concat(o.visualViewport||[],Ut(i)?i:[]):i,a=e.concat(s);return r?a:a.concat(wt(ut(s)))}function yn(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function Ru(n,e){var t=Ge(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function Ns(n,e,t){return e===qn?yn(Qr(n,t)):Ye(e)?Ru(e,t):yn(Jr(Se(n)))}function Iu(n){var e=wt(ut(n)),t=["absolute","fixed"].indexOf(Ne(n).position)>=0,i=t&&_e(n)?et(n):n;return Ye(i)?e.filter(function(r){return Ye(r)&&Un(r,i)&&xe(r)!=="body"}):[]}function Zr(n,e,t,i){var r=e==="clippingParents"?Iu(n):[].concat(e),o=[].concat(r,[t]),s=o[0],a=o.reduce(function(l,c){var u=Ns(n,c,i);return l.top=Ze(u.top,l.top),l.right=Bt(u.right,l.right),l.bottom=Bt(u.bottom,l.bottom),l.left=Ze(u.left,l.left),l},Ns(n,s,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Xn(n){var e=n.reference,t=n.element,i=n.placement,r=i?Te(i):null,o=i?Ke(i):null,s=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(r){case de:l={x:s,y:e.y-t.height};break;case ge:l={x:s,y:e.y+e.height};break;case me:l={x:e.x+e.width,y:a};break;case pe:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var c=r?zt(r):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case rt:l[c]=l[c]-(e[u]/2-t[u]/2);break;case _t:l[c]=l[c]+(e[u]/2-t[u]/2);break;default:}}return l}function ke(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=i===void 0?n.placement:i,o=t.strategy,s=o===void 0?n.strategy:o,a=t.boundary,l=a===void 0?Yr:a,c=t.rootBoundary,u=c===void 0?qn:c,d=t.elementContext,p=d===void 0?$t:d,y=t.altBoundary,m=y===void 0?!1:y,g=t.padding,_=g===void 0?0:g,x=Gn(typeof _!="number"?_:Kn(_,lt)),A=p===$t?Gr:$t,w=n.rects.popper,C=n.elements[m?A:p],$=Zr(Ye(C)?C:C.contextElement||Se(n.elements.popper),l,u,s),q=Ge(n.elements.reference),H=Xn({reference:q,element:w,strategy:"absolute",placement:r}),R=yn(Object.assign({},w,H)),L=p===$t?R:q,j={top:$.top-L.top+x.top,bottom:L.bottom-$.bottom+x.bottom,left:$.left-L.left+x.left,right:L.right-$.right+x.right},G=n.modifiersData.offset;if(p===$t&&G){var Q=G[r];Object.keys(j).forEach(function(Z){var he=[me,ge].indexOf(Z)>=0?1:-1,Ce=[de,ge].indexOf(Z)>=0?"y":"x";j[Z]+=Q[Ce]*he})}return j}function eo(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=t.boundary,o=t.rootBoundary,s=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,c=l===void 0?jn:l,u=Ke(i),d=u?a?Mi:Mi.filter(function(m){return Ke(m)===u}):lt,p=d.filter(function(m){return c.indexOf(m)>=0});p.length===0&&(p=d);var y=p.reduce(function(m,g){return m[g]=ke(n,{placement:g,boundary:r,rootBoundary:o,padding:s})[Te(g)],m},{});return Object.keys(y).sort(function(m,g){return y[m]-y[g]})}function Pu(n){if(Te(n)===zn)return[];var e=vn(n);return[Hi(n),e,Hi(e)]}function Fu(n){var e=n.state,t=n.options,i=n.name;if(!e.modifiersData[i]._skip){for(var r=t.mainAxis,o=r===void 0?!0:r,s=t.altAxis,a=s===void 0?!0:s,l=t.fallbackPlacements,c=t.padding,u=t.boundary,d=t.rootBoundary,p=t.altBoundary,y=t.flipVariations,m=y===void 0?!0:y,g=t.allowedAutoPlacements,_=e.options.placement,x=Te(_),A=x===_,w=l||(A||!m?[vn(_)]:Pu(_)),C=[_].concat(w).reduce(function(V,U){return V.concat(Te(U)===zn?eo(e,{placement:U,boundary:u,rootBoundary:d,padding:c,flipVariations:m,allowedAutoPlacements:g}):U)},[]),$=e.rects.reference,q=e.rects.popper,H=new Map,R=!0,L=C[0],j=0;j=0,Ce=he?"width":"height",ie=ke(e,{placement:G,boundary:u,rootBoundary:d,altBoundary:p,padding:c}),ne=he?Z?me:pe:Z?ge:de;$[Ce]>q[Ce]&&(ne=vn(ne));var Ue=vn(ne),Ie=[];if(o&&Ie.push(ie[Q]<=0),a&&Ie.push(ie[ne]<=0,ie[Ue]<=0),Ie.every(function(V){return V})){L=G,R=!1;break}H.set(G,Ie)}if(R)for(var W=m?3:1,M=function(U){var Y=C.find(function(ee){var se=H.get(ee);if(se)return se.slice(0,U).every(function(bt){return bt})});if(Y)return L=Y,"break"},D=W;D>0;D--){var B=M(D);if(B==="break")break}e.placement!==L&&(e.modifiersData[i]._skip=!0,e.placement=L,e.reset=!0)}}var Ii={name:"flip",enabled:!0,phase:"main",fn:Fu,requiresIfExists:["offset"],data:{_skip:!1}};function ks(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function Hs(n){return[de,me,ge,pe].some(function(e){return n[e]>=0})}function $u(n){var e=n.state,t=n.name,i=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,s=ke(e,{elementContext:"reference"}),a=ke(e,{altBoundary:!0}),l=ks(s,i),c=ks(a,r,o),u=Hs(l),d=Hs(c);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}var Pi={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:$u};function Bu(n,e,t){var i=Te(n),r=[pe,de].indexOf(i)>=0?-1:1,o=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,s=o[0],a=o[1];return s=s||0,a=(a||0)*r,[pe,me].indexOf(i)>=0?{x:a,y:s}:{x:s,y:a}}function Vu(n){var e=n.state,t=n.options,i=n.name,r=t.offset,o=r===void 0?[0,0]:r,s=jn.reduce(function(u,d){return u[d]=Bu(d,e.rects,o),u},{}),a=s[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=s}var Fi={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Vu};function zu(n){var e=n.state,t=n.name;e.modifiersData[t]=Xn({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var En={name:"popperOffsets",enabled:!0,phase:"read",fn:zu,data:{}};function to(n){return n==="x"?"y":"x"}function qu(n){var e=n.state,t=n.options,i=n.name,r=t.mainAxis,o=r===void 0?!0:r,s=t.altAxis,a=s===void 0?!1:s,l=t.boundary,c=t.rootBoundary,u=t.altBoundary,d=t.padding,p=t.tether,y=p===void 0?!0:p,m=t.tetherOffset,g=m===void 0?0:m,_=ke(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),x=Te(e.placement),A=Ke(e.placement),w=!A,C=zt(x),$=to(C),q=e.modifiersData.popperOffsets,H=e.rects.reference,R=e.rects.popper,L=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,j=typeof L=="number"?{mainAxis:L,altAxis:L}:Object.assign({mainAxis:0,altAxis:0},L),G=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,Q={x:0,y:0};if(q){if(o){var Z,he=C==="y"?de:pe,Ce=C==="y"?ge:me,ie=C==="y"?"height":"width",ne=q[C],Ue=ne+_[he],Ie=ne-_[Ce],W=y?-R[ie]/2:0,M=A===rt?H[ie]:R[ie],D=A===rt?-R[ie]:-H[ie],B=e.elements.arrow,V=y&&B?Vt(B):{width:0,height:0},U=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Yn(),Y=U[he],ee=U[Ce],se=qt(0,H[ie],V[ie]),bt=w?H[ie]/2-W-se-Y-j.mainAxis:M-se-Y-j.mainAxis,Br=w?-H[ie]/2+W+se+ee+j.mainAxis:D+se+ee+j.mainAxis,on=e.elements.arrow&&et(e.elements.arrow),sn=on?C==="y"?on.clientTop||0:on.clientLeft||0:0,xi=(Z=G==null?void 0:G[C])!=null?Z:0,Vr=ne+bt-xi-sn,Ti=ne+Br-xi,Ci=qt(y?Bt(Ue,Vr):Ue,ne,y?Ze(Ie,Ti):Ie);q[C]=Ci,Q[C]=Ci-ne}if(a){var Fn,Si=C==="x"?de:pe,an=C==="x"?ge:me,ot=q[$],ln=$==="y"?"height":"width",$n=ot+_[Si],cn=ot-_[an],un=[de,pe].indexOf(x)!==-1,Ft=(Fn=G==null?void 0:G[$])!=null?Fn:0,Ai=un?$n:ot-H[ln]-R[ln]-Ft+j.altAxis,Bn=un?ot+H[ln]+R[ln]-Ft-j.altAxis:cn,Di=y&&un?Ls(Ai,ot,Bn):qt(y?Ai:$n,ot,y?Bn:cn);q[$]=Di,Q[$]=Di-ot}e.modifiersData[i]=Q}}var $i={name:"preventOverflow",enabled:!0,phase:"main",fn:qu,requiresIfExists:["offset"]};function no(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function io(n){return n===ce(n)||!_e(n)?jt(n):no(n)}function ju(n){var e=n.getBoundingClientRect(),t=ct(e.width)/n.offsetWidth||1,i=ct(e.height)/n.offsetHeight||1;return t!==1||i!==1}function ro(n,e,t){t===void 0&&(t=!1);var i=_e(e),r=_e(e)&&ju(e),o=Se(e),s=Ge(n,r,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!t)&&((xe(e)!=="body"||Ut(o))&&(a=io(e)),_e(e)?(l=Ge(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=Wt(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Wu(n){var e=new Map,t=new Set,i=[];n.forEach(function(o){e.set(o.name,o)});function r(o){t.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&r(l)}}),i.push(o)}return n.forEach(function(o){t.has(o.name)||r(o)}),i}function oo(n){var e=Wu(n);return Kr.reduce(function(t,i){return t.concat(e.filter(function(r){return r.phase===i}))},[])}function so(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function ao(n){var e=n.reduce(function(t,i){var r=t[i.name];return t[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var Rs={placement:"bottom",modifiers:[],strategy:"absolute"};function Is(){for(var n=arguments.length,e=new Array(n),t=0;t(n&&window.CSS&&window.CSS.escape&&(n=n.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),n),Xu=n=>n==null?`${n}`:Object.prototype.toString.call(n).match(/\s([a-z]+)/i)[1].toLowerCase(),Qu=n=>{do n+=Math.floor(Math.random()*Gu);while(document.getElementById(n));return n},Ju=n=>{if(!n)return 0;let{transitionDuration:e,transitionDelay:t}=window.getComputedStyle(n),i=Number.parseFloat(e),r=Number.parseFloat(t);return!i&&!r?0:(e=e.split(",")[0],t=t.split(",")[0],(Number.parseFloat(e)+Number.parseFloat(t))*Ku)},pa=n=>{n.dispatchEvent(new Event(Co))},dt=n=>!n||typeof n!="object"?!1:(typeof n.jquery!="undefined"&&(n=n[0]),typeof n.nodeType!="undefined"),Tt=n=>dt(n)?n.jquery?n[0]:n:typeof n=="string"&&n.length>0?document.querySelector(ha(n)):null,An=n=>{if(!dt(n)||n.getClientRects().length===0)return!1;let e=getComputedStyle(n).getPropertyValue("visibility")==="visible",t=n.closest("details:not([open])");if(!t)return e;if(t!==n){let i=n.closest("summary");if(i&&i.parentNode!==t||i===null)return!1}return e},Ct=n=>!n||n.nodeType!==Node.ELEMENT_NODE||n.classList.contains("disabled")?!0:typeof n.disabled!="undefined"?n.disabled:n.hasAttribute("disabled")&&n.getAttribute("disabled")!=="false",ma=n=>{if(!document.documentElement.attachShadow)return null;if(typeof n.getRootNode=="function"){let e=n.getRootNode();return e instanceof ShadowRoot?e:null}return n instanceof ShadowRoot?n:n.parentNode?ma(n.parentNode):null},Ki=()=>{},ni=n=>{n.offsetHeight},ga=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,co=[],Zu=n=>{document.readyState==="loading"?(co.length||document.addEventListener("DOMContentLoaded",()=>{for(let e of co)e()}),co.push(n)):n()},Xe=()=>document.documentElement.dir==="rtl",Je=n=>{Zu(()=>{let e=ga();if(e){let t=n.NAME,i=e.fn[t];e.fn[t]=n.jQueryInterface,e.fn[t].Constructor=n,e.fn[t].noConflict=()=>(e.fn[t]=i,n.jQueryInterface)}})},Pe=(n,e=[],t=n)=>typeof n=="function"?n.call(...e):t,va=(n,e,t=!0)=>{if(!t){Pe(n);return}let r=Ju(e)+5,o=!1,s=({target:a})=>{a===e&&(o=!0,e.removeEventListener(Co,s),Pe(n))};e.addEventListener(Co,s),setTimeout(()=>{o||pa(e)},r)},Oo=(n,e,t,i)=>{let r=n.length,o=n.indexOf(e);return o===-1?!t&&i?n[r-1]:n[0]:(o+=t?1:-1,i&&(o=(o+r)%r),n[Math.max(0,Math.min(o,r-1))])},ed=/[^.]*(?=\..*)\.|.*/,td=/\..*/,nd=/::\d+$/,uo={},$s=1,ya={mouseenter:"mouseover",mouseleave:"mouseout"},id=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function Ea(n,e){return e&&`${e}::${$s++}`||n.uidEvent||$s++}function ba(n){let e=Ea(n);return n.uidEvent=e,uo[e]=uo[e]||{},uo[e]}function rd(n,e){return function t(i){return Lo(i,{delegateTarget:n}),t.oneOff&&T.off(n,i.type,e),e.apply(n,[i])}}function od(n,e,t){return function i(r){let o=n.querySelectorAll(e);for(let{target:s}=r;s&&s!==this;s=s.parentNode)for(let a of o)if(a===s)return Lo(r,{delegateTarget:s}),i.oneOff&&T.off(n,r.type,e,t),t.apply(s,[r])}}function _a(n,e,t=null){return Object.values(n).find(i=>i.callable===e&&i.delegationSelector===t)}function wa(n,e,t){let i=typeof e=="string",r=i?t:e||t,o=xa(n);return id.has(o)||(o=n),[i,r,o]}function Bs(n,e,t,i,r){if(typeof e!="string"||!n)return;let[o,s,a]=wa(e,t,i);e in ya&&(s=(m=>function(g){if(!g.relatedTarget||g.relatedTarget!==g.delegateTarget&&!g.delegateTarget.contains(g.relatedTarget))return m.call(this,g)})(s));let l=ba(n),c=l[a]||(l[a]={}),u=_a(c,s,o?t:null);if(u){u.oneOff=u.oneOff&&r;return}let d=Ea(s,e.replace(ed,"")),p=o?od(n,t,s):rd(n,s);p.delegationSelector=o?t:null,p.callable=s,p.oneOff=r,p.uidEvent=d,c[d]=p,n.addEventListener(a,p,o)}function So(n,e,t,i,r){let o=_a(e[t],i,r);o&&(n.removeEventListener(t,o,!!r),delete e[t][o.uidEvent])}function sd(n,e,t,i){let r=e[t]||{};for(let[o,s]of Object.entries(r))o.includes(i)&&So(n,e,t,s.callable,s.delegationSelector)}function xa(n){return n=n.replace(td,""),ya[n]||n}var T={on(n,e,t,i){Bs(n,e,t,i,!1)},one(n,e,t,i){Bs(n,e,t,i,!0)},off(n,e,t,i){if(typeof e!="string"||!n)return;let[r,o,s]=wa(e,t,i),a=s!==e,l=ba(n),c=l[s]||{},u=e.startsWith(".");if(typeof o!="undefined"){if(!Object.keys(c).length)return;So(n,l,s,o,r?t:null);return}if(u)for(let d of Object.keys(l))sd(n,l,d,e.slice(1));for(let[d,p]of Object.entries(c)){let y=d.replace(nd,"");(!a||e.includes(y))&&So(n,l,s,p.callable,p.delegationSelector)}},trigger(n,e,t){if(typeof e!="string"||!n)return null;let i=ga(),r=xa(e),o=e!==r,s=null,a=!0,l=!0,c=!1;o&&i&&(s=i.Event(e,t),i(n).trigger(s),a=!s.isPropagationStopped(),l=!s.isImmediatePropagationStopped(),c=s.isDefaultPrevented());let u=Lo(new Event(e,{bubbles:a,cancelable:!0}),t);return c&&u.preventDefault(),l&&n.dispatchEvent(u),u.defaultPrevented&&s&&s.preventDefault(),u}};function Lo(n,e={}){for(let[t,i]of Object.entries(e))try{n[t]=i}catch(r){Object.defineProperty(n,t,{configurable:!0,get(){return i}})}return n}function Vs(n){if(n==="true")return!0;if(n==="false")return!1;if(n===Number(n).toString())return Number(n);if(n===""||n==="null")return null;if(typeof n!="string")return n;try{return JSON.parse(decodeURIComponent(n))}catch(e){return n}}function fo(n){return n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}var ft={setDataAttribute(n,e,t){n.setAttribute(`data-bs-${fo(e)}`,t)},removeDataAttribute(n,e){n.removeAttribute(`data-bs-${fo(e)}`)},getDataAttributes(n){if(!n)return{};let e={},t=Object.keys(n.dataset).filter(i=>i.startsWith("bs")&&!i.startsWith("bsConfig"));for(let i of t){let r=i.replace(/^bs/,"");r=r.charAt(0).toLowerCase()+r.slice(1),e[r]=Vs(n.dataset[i])}return e},getDataAttribute(n,e){return Vs(n.getAttribute(`data-bs-${fo(e)}`))}},Xt=class{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){let i=dt(t)?ft.getDataAttribute(t,"config"):{};return O(O(O(O({},this.constructor.Default),typeof i=="object"?i:{}),dt(t)?ft.getDataAttributes(t):{}),typeof e=="object"?e:{})}_typeCheckConfig(e,t=this.constructor.DefaultType){for(let[i,r]of Object.entries(t)){let o=e[i],s=dt(o)?"element":Xu(o);if(!new RegExp(r).test(s))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${i}" provided type "${s}" but expected type "${r}".`)}}},ad="5.3.8",We=class extends Xt{constructor(e,t){super(),e=Tt(e),e&&(this._element=e,this._config=this._getConfig(t),lo.set(this._element,this.constructor.DATA_KEY,this))}dispose(){lo.remove(this._element,this.constructor.DATA_KEY),T.off(this._element,this.constructor.EVENT_KEY);for(let e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,i=!0){va(e,t,i)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return lo.get(Tt(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,typeof t=="object"?t:null)}static get VERSION(){return ad}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}},ho=n=>{let e=n.getAttribute("data-bs-target");if(!e||e==="#"){let t=n.getAttribute("href");if(!t||!t.includes("#")&&!t.startsWith("."))return null;t.includes("#")&&!t.startsWith("#")&&(t=`#${t.split("#")[1]}`),e=t&&t!=="#"?t.trim():null}return e?e.split(",").map(t=>ha(t)).join(","):null},z={find(n,e=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(e,n))},findOne(n,e=document.documentElement){return Element.prototype.querySelector.call(e,n)},children(n,e){return[].concat(...n.children).filter(t=>t.matches(e))},parents(n,e){let t=[],i=n.parentNode.closest(e);for(;i;)t.push(i),i=i.parentNode.closest(e);return t},prev(n,e){let t=n.previousElementSibling;for(;t;){if(t.matches(e))return[t];t=t.previousElementSibling}return[]},next(n,e){let t=n.nextElementSibling;for(;t;){if(t.matches(e))return[t];t=t.nextElementSibling}return[]},focusableChildren(n){let e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(t=>`${t}:not([tabindex^="-"])`).join(",");return this.find(e,n).filter(t=>!Ct(t)&&An(t))},getSelectorFromElement(n){let e=ho(n);return e&&z.findOne(e)?e:null},getElementFromSelector(n){let e=ho(n);return e?z.findOne(e):null},getMultipleElementsFromSelector(n){let e=ho(n);return e?z.find(e):[]}},ir=(n,e="hide")=>{let t=`click.dismiss${n.EVENT_KEY}`,i=n.NAME;T.on(document,t,`[data-bs-dismiss="${i}"]`,function(r){if(["A","AREA"].includes(this.tagName)&&r.preventDefault(),Ct(this))return;let o=z.getElementFromSelector(this)||this.closest(`.${i}`);n.getOrCreateInstance(o)[e]()})},ld="alert",cd="bs.alert",Ta=`.${cd}`,ud=`close${Ta}`,dd=`closed${Ta}`,fd="fade",hd="show",Xi=class n extends We{static get NAME(){return ld}close(){if(T.trigger(this._element,ud).defaultPrevented)return;this._element.classList.remove(hd);let t=this._element.classList.contains(fd);this._queueCallback(()=>this._destroyElement(),this._element,t)}_destroyElement(){this._element.remove(),T.trigger(this._element,dd),this.dispose()}static jQueryInterface(e){return this.each(function(){let t=n.getOrCreateInstance(this);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e](this)}})}};ir(Xi,"close");Je(Xi);var pd="button",md="bs.button",gd=`.${md}`,vd=".data-api",yd="active",zs='[data-bs-toggle="button"]',Ed=`click${gd}${vd}`,Qi=class n extends We{static get NAME(){return pd}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle(yd))}static jQueryInterface(e){return this.each(function(){let t=n.getOrCreateInstance(this);e==="toggle"&&t[e]()})}};T.on(document,Ed,zs,n=>{n.preventDefault();let e=n.target.closest(zs);Qi.getOrCreateInstance(e).toggle()});Je(Qi);var bd="swipe",Dn=".bs.swipe",_d=`touchstart${Dn}`,wd=`touchmove${Dn}`,xd=`touchend${Dn}`,Td=`pointerdown${Dn}`,Cd=`pointerup${Dn}`,Sd="touch",Ad="pen",Dd="pointer-event",Od=40,Ld={endCallback:null,leftCallback:null,rightCallback:null},Md={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"},Ji=class n extends Xt{constructor(e,t){super(),this._element=e,!(!e||!n.isSupported())&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return Ld}static get DefaultType(){return Md}static get NAME(){return bd}dispose(){T.off(this._element,Dn)}_start(e){if(!this._supportPointerEvents){this._deltaX=e.touches[0].clientX;return}this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX)}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),Pe(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){let e=Math.abs(this._deltaX);if(e<=Od)return;let t=e/this._deltaX;this._deltaX=0,t&&Pe(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(T.on(this._element,Td,e=>this._start(e)),T.on(this._element,Cd,e=>this._end(e)),this._element.classList.add(Dd)):(T.on(this._element,_d,e=>this._start(e)),T.on(this._element,wd,e=>this._move(e)),T.on(this._element,xd,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&(e.pointerType===Ad||e.pointerType===Sd)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}},Nd="carousel",kd="bs.carousel",Dt=`.${kd}`,Ca=".data-api",Hd="ArrowLeft",Rd="ArrowRight",Id=500,Jn="next",bn="prev",wn="left",Yi="right",Pd=`slide${Dt}`,po=`slid${Dt}`,Fd=`keydown${Dt}`,$d=`mouseenter${Dt}`,Bd=`mouseleave${Dt}`,Vd=`dragstart${Dt}`,zd=`load${Dt}${Ca}`,qd=`click${Dt}${Ca}`,Sa="carousel",Vi="active",jd="slide",Wd="carousel-item-end",Ud="carousel-item-start",Yd="carousel-item-next",Gd="carousel-item-prev",Aa=".active",Da=".carousel-item",Kd=Aa+Da,Xd=".carousel-item img",Qd=".carousel-indicators",Jd="[data-bs-slide], [data-bs-slide-to]",Zd='[data-bs-ride="carousel"]',ef={[Hd]:Yi,[Rd]:wn},tf={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},nf={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"},ei=class n extends We{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=z.findOne(Qd,this._element),this._addEventListeners(),this._config.ride===Sa&&this.cycle()}static get Default(){return tf}static get DefaultType(){return nf}static get NAME(){return Nd}next(){this._slide(Jn)}nextWhenVisible(){!document.hidden&&An(this._element)&&this.next()}prev(){this._slide(bn)}pause(){this._isSliding&&pa(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){if(this._config.ride){if(this._isSliding){T.one(this._element,po,()=>this.cycle());return}this.cycle()}}to(e){let t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding){T.one(this._element,po,()=>this.to(e));return}let i=this._getItemIndex(this._getActive());if(i===e)return;let r=e>i?Jn:bn;this._slide(r,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&T.on(this._element,Fd,e=>this._keydown(e)),this._config.pause==="hover"&&(T.on(this._element,$d,()=>this.pause()),T.on(this._element,Bd,()=>this._maybeEnableCycle())),this._config.touch&&Ji.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(let i of z.find(Xd,this._element))T.on(i,Vd,r=>r.preventDefault());let t={leftCallback:()=>this._slide(this._directionToOrder(wn)),rightCallback:()=>this._slide(this._directionToOrder(Yi)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),Id+this._config.interval))}};this._swipeHelper=new Ji(this._element,t)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;let t=ef[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;let t=z.findOne(Aa,this._indicatorsElement);t.classList.remove(Vi),t.removeAttribute("aria-current");let i=z.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);i&&(i.classList.add(Vi),i.setAttribute("aria-current","true"))}_updateInterval(){let e=this._activeElement||this._getActive();if(!e)return;let t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;let i=this._getActive(),r=e===Jn,o=t||Oo(this._getItems(),i,r,this._config.wrap);if(o===i)return;let s=this._getItemIndex(o),a=y=>T.trigger(this._element,y,{relatedTarget:o,direction:this._orderToDirection(e),from:this._getItemIndex(i),to:s});if(a(Pd).defaultPrevented||!i||!o)return;let c=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(s),this._activeElement=o;let u=r?Ud:Wd,d=r?Yd:Gd;o.classList.add(d),ni(o),i.classList.add(u),o.classList.add(u);let p=()=>{o.classList.remove(u,d),o.classList.add(Vi),i.classList.remove(Vi,d,u),this._isSliding=!1,a(po)};this._queueCallback(p,i,this._isAnimated()),c&&this.cycle()}_isAnimated(){return this._element.classList.contains(jd)}_getActive(){return z.findOne(Kd,this._element)}_getItems(){return z.find(Da,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return Xe()?e===wn?bn:Jn:e===wn?Jn:bn}_orderToDirection(e){return Xe()?e===bn?wn:Yi:e===bn?Yi:wn}static jQueryInterface(e){return this.each(function(){let t=n.getOrCreateInstance(this,e);if(typeof e=="number"){t.to(e);return}if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}};T.on(document,qd,Jd,function(n){let e=z.getElementFromSelector(this);if(!e||!e.classList.contains(Sa))return;n.preventDefault();let t=ei.getOrCreateInstance(e),i=this.getAttribute("data-bs-slide-to");if(i){t.to(i),t._maybeEnableCycle();return}if(ft.getDataAttribute(this,"slide")==="next"){t.next(),t._maybeEnableCycle();return}t.prev(),t._maybeEnableCycle()});T.on(window,zd,()=>{let n=z.find(Zd);for(let e of n)ei.getOrCreateInstance(e)});Je(ei);var rf="collapse",of="bs.collapse",ii=`.${of}`,sf=".data-api",af=`show${ii}`,lf=`shown${ii}`,cf=`hide${ii}`,uf=`hidden${ii}`,df=`click${ii}${sf}`,mo="show",Tn="collapse",zi="collapsing",ff="collapsed",hf=`:scope .${Tn} .${Tn}`,pf="collapse-horizontal",mf="width",gf="height",vf=".collapse.show, .collapse.collapsing",Ao='[data-bs-toggle="collapse"]',yf={parent:null,toggle:!0},Ef={parent:"(null|element)",toggle:"boolean"},Cn=class n extends We{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];let i=z.find(Ao);for(let r of i){let o=z.getSelectorFromElement(r),s=z.find(o).filter(a=>a===this._element);o!==null&&s.length&&this._triggerArray.push(r)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return yf}static get DefaultType(){return Ef}static get NAME(){return rf}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(vf).filter(a=>a!==this._element).map(a=>n.getOrCreateInstance(a,{toggle:!1}))),e.length&&e[0]._isTransitioning||T.trigger(this._element,af).defaultPrevented)return;for(let a of e)a.hide();let i=this._getDimension();this._element.classList.remove(Tn),this._element.classList.add(zi),this._element.style[i]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;let r=()=>{this._isTransitioning=!1,this._element.classList.remove(zi),this._element.classList.add(Tn,mo),this._element.style[i]="",T.trigger(this._element,lf)},s=`scroll${i[0].toUpperCase()+i.slice(1)}`;this._queueCallback(r,this._element,!0),this._element.style[i]=`${this._element[s]}px`}hide(){if(this._isTransitioning||!this._isShown()||T.trigger(this._element,cf).defaultPrevented)return;let t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,ni(this._element),this._element.classList.add(zi),this._element.classList.remove(Tn,mo);for(let r of this._triggerArray){let o=z.getElementFromSelector(r);o&&!this._isShown(o)&&this._addAriaAndCollapsedClass([r],!1)}this._isTransitioning=!0;let i=()=>{this._isTransitioning=!1,this._element.classList.remove(zi),this._element.classList.add(Tn),T.trigger(this._element,uf)};this._element.style[t]="",this._queueCallback(i,this._element,!0)}_isShown(e=this._element){return e.classList.contains(mo)}_configAfterMerge(e){return e.toggle=!!e.toggle,e.parent=Tt(e.parent),e}_getDimension(){return this._element.classList.contains(pf)?mf:gf}_initializeChildren(){if(!this._config.parent)return;let e=this._getFirstLevelChildren(Ao);for(let t of e){let i=z.getElementFromSelector(t);i&&this._addAriaAndCollapsedClass([t],this._isShown(i))}}_getFirstLevelChildren(e){let t=z.find(hf,this._config.parent);return z.find(e,this._config.parent).filter(i=>!t.includes(i))}_addAriaAndCollapsedClass(e,t){if(e.length)for(let i of e)i.classList.toggle(ff,!t),i.setAttribute("aria-expanded",t)}static jQueryInterface(e){let t={};return typeof e=="string"&&/show|hide/.test(e)&&(t.toggle=!1),this.each(function(){let i=n.getOrCreateInstance(this,t);if(typeof e=="string"){if(typeof i[e]=="undefined")throw new TypeError(`No method named "${e}"`);i[e]()}})}};T.on(document,df,Ao,function(n){(n.target.tagName==="A"||n.delegateTarget&&n.delegateTarget.tagName==="A")&&n.preventDefault();for(let e of z.getMultipleElementsFromSelector(this))Cn.getOrCreateInstance(e,{toggle:!1}).toggle()});Je(Cn);var qs="dropdown",bf="bs.dropdown",Jt=`.${bf}`,Mo=".data-api",_f="Escape",js="Tab",wf="ArrowUp",Ws="ArrowDown",xf=2,Tf=`hide${Jt}`,Cf=`hidden${Jt}`,Sf=`show${Jt}`,Af=`shown${Jt}`,Oa=`click${Jt}${Mo}`,La=`keydown${Jt}${Mo}`,Df=`keyup${Jt}${Mo}`,xn="show",Of="dropup",Lf="dropend",Mf="dropstart",Nf="dropup-center",kf="dropdown-center",Gt='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',Hf=`${Gt}.${xn}`,Gi=".dropdown-menu",Rf=".navbar",If=".navbar-nav",Pf=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",Ff=Xe()?"top-end":"top-start",$f=Xe()?"top-start":"top-end",Bf=Xe()?"bottom-end":"bottom-start",Vf=Xe()?"bottom-start":"bottom-end",zf=Xe()?"left-start":"right-start",qf=Xe()?"right-start":"left-start",jf="top",Wf="bottom",Uf={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},Yf={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"},St=class n extends We{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=z.next(this._element,Gi)[0]||z.prev(this._element,Gi)[0]||z.findOne(Gi,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return Uf}static get DefaultType(){return Yf}static get NAME(){return qs}toggle(){return this._isShown()?this.hide():this.show()}show(){if(Ct(this._element)||this._isShown())return;let e={relatedTarget:this._element};if(!T.trigger(this._element,Sf,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(If))for(let i of[].concat(...document.body.children))T.on(i,"mouseover",Ki);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(xn),this._element.classList.add(xn),T.trigger(this._element,Af,e)}}hide(){if(Ct(this._element)||!this._isShown())return;let e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!T.trigger(this._element,Tf,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(let i of[].concat(...document.body.children))T.off(i,"mouseover",Ki);this._popper&&this._popper.destroy(),this._menu.classList.remove(xn),this._element.classList.remove(xn),this._element.setAttribute("aria-expanded","false"),ft.removeDataAttribute(this._menu,"popper"),T.trigger(this._element,Cf,e)}}_getConfig(e){if(e=super._getConfig(e),typeof e.reference=="object"&&!dt(e.reference)&&typeof e.reference.getBoundingClientRect!="function")throw new TypeError(`${qs.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(typeof Bi=="undefined")throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org/docs/v2/)");let e=this._element;this._config.reference==="parent"?e=this._parent:dt(this._config.reference)?e=Tt(this._config.reference):typeof this._config.reference=="object"&&(e=this._config.reference);let t=this._getPopperConfig();this._popper=Qn(e,this._menu,t)}_isShown(){return this._menu.classList.contains(xn)}_getPlacement(){let e=this._parent;if(e.classList.contains(Lf))return zf;if(e.classList.contains(Mf))return qf;if(e.classList.contains(Nf))return jf;if(e.classList.contains(kf))return Wf;let t=getComputedStyle(this._menu).getPropertyValue("--bs-position").trim()==="end";return e.classList.contains(Of)?t?$f:Ff:t?Vf:Bf}_detectNavbar(){return this._element.closest(Rf)!==null}_getOffset(){let{offset:e}=this._config;return typeof e=="string"?e.split(",").map(t=>Number.parseInt(t,10)):typeof e=="function"?t=>e(t,this._element):e}_getPopperConfig(){let e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(ft.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),O(O({},e),Pe(this._config.popperConfig,[void 0,e]))}_selectMenuItem({key:e,target:t}){let i=z.find(Pf,this._menu).filter(r=>An(r));i.length&&Oo(i,t,e===Ws,!i.includes(t)).focus()}static jQueryInterface(e){return this.each(function(){let t=n.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]=="undefined")throw new TypeError(`No method named "${e}"`);t[e]()}})}static clearMenus(e){if(e.button===xf||e.type==="keyup"&&e.key!==js)return;let t=z.find(Hf);for(let i of t){let r=n.getInstance(i);if(!r||r._config.autoClose===!1)continue;let o=e.composedPath(),s=o.includes(r._menu);if(o.includes(r._element)||r._config.autoClose==="inside"&&!s||r._config.autoClose==="outside"&&s||r._menu.contains(e.target)&&(e.type==="keyup"&&e.key===js||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;let a={relatedTarget:r._element};e.type==="click"&&(a.clickEvent=e),r._completeHide(a)}}static dataApiKeydownHandler(e){let t=/input|textarea/i.test(e.target.tagName),i=e.key===_f,r=[wf,Ws].includes(e.key);if(!r&&!i||t&&!i)return;e.preventDefault();let o=this.matches(Gt)?this:z.prev(this,Gt)[0]||z.next(this,Gt)[0]||z.findOne(Gt,e.delegateTarget.parentNode),s=n.getOrCreateInstance(o);if(r){e.stopPropagation(),s.show(),s._selectMenuItem(e);return}s._isShown()&&(e.stopPropagation(),s.hide(),o.focus())}};T.on(document,La,Gt,St.dataApiKeydownHandler);T.on(document,La,Gi,St.dataApiKeydownHandler);T.on(document,Oa,St.clearMenus);T.on(document,Df,St.clearMenus);T.on(document,Oa,Gt,function(n){n.preventDefault(),St.getOrCreateInstance(this).toggle()});Je(St);var Ma="backdrop",Gf="fade",Us="show",Ys=`mousedown.bs.${Ma}`,Kf={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Xf={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"},Zi=class extends Xt{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return Kf}static get DefaultType(){return Xf}static get NAME(){return Ma}show(e){if(!this._config.isVisible){Pe(e);return}this._append();let t=this._getElement();this._config.isAnimated&&ni(t),t.classList.add(Us),this._emulateAnimation(()=>{Pe(e)})}hide(e){if(!this._config.isVisible){Pe(e);return}this._getElement().classList.remove(Us),this._emulateAnimation(()=>{this.dispose(),Pe(e)})}dispose(){this._isAppended&&(T.off(this._element,Ys),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){let e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add(Gf),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=Tt(e.rootElement),e}_append(){if(this._isAppended)return;let e=this._getElement();this._config.rootElement.append(e),T.on(e,Ys,()=>{Pe(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){va(e,this._getElement(),this._config.isAnimated)}},Qf="focustrap",Jf="bs.focustrap",er=`.${Jf}`,Zf=`focusin${er}`,eh=`keydown.tab${er}`,th="Tab",nh="forward",Gs="backward",ih={autofocus:!0,trapElement:null},rh={autofocus:"boolean",trapElement:"element"},tr=class extends Xt{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return ih}static get DefaultType(){return rh}static get NAME(){return Qf}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),T.off(document,er),T.on(document,Zf,e=>this._handleFocusin(e)),T.on(document,eh,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,T.off(document,er))}_handleFocusin(e){let{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;let i=z.focusableChildren(t);i.length===0?t.focus():this._lastTabNavDirection===Gs?i[i.length-1].focus():i[0].focus()}_handleKeydown(e){e.key===th&&(this._lastTabNavDirection=e.shiftKey?Gs:nh)}},Ks=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Xs=".sticky-top",qi="padding-right",Qs="margin-right",ti=class{constructor(){this._element=document.body}getWidth(){let e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){let e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,qi,t=>t+e),this._setElementAttributes(Ks,qi,t=>t+e),this._setElementAttributes(Xs,Qs,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,qi),this._resetElementAttributes(Ks,qi),this._resetElementAttributes(Xs,Qs)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,i){let r=this.getWidth(),o=s=>{if(s!==this._element&&window.innerWidth>s.clientWidth+r)return;this._saveInitialAttribute(s,t);let a=window.getComputedStyle(s).getPropertyValue(t);s.style.setProperty(t,`${i(Number.parseFloat(a))}px`)};this._applyManipulationCallback(e,o)}_saveInitialAttribute(e,t){let i=e.style.getPropertyValue(t);i&&ft.setDataAttribute(e,t,i)}_resetElementAttributes(e,t){let i=r=>{let o=ft.getDataAttribute(r,t);if(o===null){r.style.removeProperty(t);return}ft.removeDataAttribute(r,t),r.style.setProperty(t,o)};this._applyManipulationCallback(e,i)}_applyManipulationCallback(e,t){if(dt(e)){t(e);return}for(let i of z.find(e,this._element))t(i)}},oh="modal",sh="bs.modal",Qe=`.${sh}`,ah=".data-api",lh="Escape",ch=`hide${Qe}`,uh=`hidePrevented${Qe}`,Na=`hidden${Qe}`,ka=`show${Qe}`,dh=`shown${Qe}`,fh=`resize${Qe}`,hh=`click.dismiss${Qe}`,ph=`mousedown.dismiss${Qe}`,mh=`keydown.dismiss${Qe}`,gh=`click${Qe}${ah}`,Js="modal-open",vh="fade",Zs="show",go="modal-static",yh=".modal.show",Eh=".modal-dialog",bh=".modal-body",_h='[data-bs-toggle="modal"]',wh={backdrop:!0,focus:!0,keyboard:!0},xh={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"},tt=class n extends We{constructor(e,t){super(e,t),this._dialog=z.findOne(Eh,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new ti,this._addEventListeners()}static get Default(){return wh}static get DefaultType(){return xh}static get NAME(){return oh}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||T.trigger(this._element,ka,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Js),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){!this._isShown||this._isTransitioning||T.trigger(this._element,ch).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Zs),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){T.off(window,Qe),T.off(this._dialog,Qe),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Zi({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new tr({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;let t=z.findOne(bh,this._dialog);t&&(t.scrollTop=0),ni(this._element),this._element.classList.add(Zs);let i=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,T.trigger(this._element,dh,{relatedTarget:e})};this._queueCallback(i,this._dialog,this._isAnimated())}_addEventListeners(){T.on(this._element,mh,e=>{if(e.key===lh){if(this._config.keyboard){this.hide();return}this._triggerBackdropTransition()}}),T.on(window,fh,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),T.on(this._element,ph,e=>{T.one(this._element,hh,t=>{if(!(this._element!==e.target||this._element!==t.target)){if(this._config.backdrop==="static"){this._triggerBackdropTransition();return}this._config.backdrop&&this.hide()}})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(Js),this._resetAdjustments(),this._scrollBar.reset(),T.trigger(this._element,Na)})}_isAnimated(){return this._element.classList.contains(vh)}_triggerBackdropTransition(){if(T.trigger(this._element,uh).defaultPrevented)return;let t=this._element.scrollHeight>document.documentElement.clientHeight,i=this._element.style.overflowY;i==="hidden"||this._element.classList.contains(go)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(go),this._queueCallback(()=>{this._element.classList.remove(go),this._queueCallback(()=>{this._element.style.overflowY=i},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){let e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),i=t>0;if(i&&!e){let r=Xe()?"paddingLeft":"paddingRight";this._element.style[r]=`${t}px`}if(!i&&e){let r=Xe()?"paddingRight":"paddingLeft";this._element.style[r]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each(function(){let i=n.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof i[e]=="undefined")throw new TypeError(`No method named "${e}"`);i[e](t)}})}};T.on(document,gh,_h,function(n){let e=z.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&n.preventDefault(),T.one(e,ka,r=>{r.defaultPrevented||T.one(e,Na,()=>{An(this)&&this.focus()})});let t=z.findOne(yh);t&&tt.getInstance(t).hide(),tt.getOrCreateInstance(e).toggle(this)});ir(tt);Je(tt);var Th="offcanvas",Ch="bs.offcanvas",mt=`.${Ch}`,Ha=".data-api",Sh=`load${mt}${Ha}`,Ah="Escape",ea="show",ta="showing",na="hiding",Dh="offcanvas-backdrop",Ra=".offcanvas.show",Oh=`show${mt}`,Lh=`shown${mt}`,Mh=`hide${mt}`,ia=`hidePrevented${mt}`,Ia=`hidden${mt}`,Nh=`resize${mt}`,kh=`click${mt}${Ha}`,Hh=`keydown.dismiss${mt}`,Rh='[data-bs-toggle="offcanvas"]',Ih={backdrop:!0,keyboard:!0,scroll:!1},Ph={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"},At=class n extends We{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return Ih}static get DefaultType(){return Ph}static get NAME(){return Th}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||T.trigger(this._element,Oh,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||new ti().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(ta);let i=()=>{(!this._config.scroll||this._config.backdrop)&&this._focustrap.activate(),this._element.classList.add(ea),this._element.classList.remove(ta),T.trigger(this._element,Lh,{relatedTarget:e})};this._queueCallback(i,this._element,!0)}hide(){if(!this._isShown||T.trigger(this._element,Mh).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(na),this._backdrop.hide();let t=()=>{this._element.classList.remove(ea,na),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new ti().reset(),T.trigger(this._element,Ia)};this._queueCallback(t,this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){let e=()=>{if(this._config.backdrop==="static"){T.trigger(this._element,ia);return}this.hide()},t=!!this._config.backdrop;return new Zi({className:Dh,isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?e:null})}_initializeFocusTrap(){return new tr({trapElement:this._element})}_addEventListeners(){T.on(this._element,Hh,e=>{if(e.key===Ah){if(this._config.keyboard){this.hide();return}T.trigger(this._element,ia)}})}static jQueryInterface(e){return this.each(function(){let t=n.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e](this)}})}};T.on(document,kh,Rh,function(n){let e=z.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),Ct(this))return;T.one(e,Ia,()=>{An(this)&&this.focus()});let t=z.findOne(Ra);t&&t!==e&&At.getInstance(t).hide(),At.getOrCreateInstance(e).toggle(this)});T.on(window,Sh,()=>{for(let n of z.find(Ra))At.getOrCreateInstance(n).show()});T.on(window,Nh,()=>{for(let n of z.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(n).position!=="fixed"&&At.getOrCreateInstance(n).hide()});ir(At);Je(At);var Fh=/^aria-[\w-]*$/i,Pa={"*":["class","dir","id","lang","role",Fh],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},$h=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Bh=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Vh=(n,e)=>{let t=n.nodeName.toLowerCase();return e.includes(t)?$h.has(t)?!!Bh.test(n.nodeValue):!0:e.filter(i=>i instanceof RegExp).some(i=>i.test(t))};function zh(n,e,t){if(!n.length)return n;if(t&&typeof t=="function")return t(n);let r=new window.DOMParser().parseFromString(n,"text/html"),o=[].concat(...r.body.querySelectorAll("*"));for(let s of o){let a=s.nodeName.toLowerCase();if(!Object.keys(e).includes(a)){s.remove();continue}let l=[].concat(...s.attributes),c=[].concat(e["*"]||[],e[a]||[]);for(let u of l)Vh(u,c)||s.removeAttribute(u.nodeName)}return r.body.innerHTML}var qh="TemplateFactory",jh={allowList:Pa,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:""},Wh={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Uh={entry:"(string|element|function|null)",selector:"(string|element)"},Do=class extends Xt{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return jh}static get DefaultType(){return Wh}static get NAME(){return qh}getContent(){return Object.values(this._config.content).map(e=>this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content=O(O({},this._config.content),e),this}toHtml(){let e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(let[r,o]of Object.entries(this._config.content))this._setContent(e,o,r);let t=e.children[0],i=this._resolvePossibleFunction(this._config.extraClass);return i&&t.classList.add(...i.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(let[t,i]of Object.entries(e))super._typeCheckConfig({selector:t,entry:i},Uh)}_setContent(e,t,i){let r=z.findOne(i,e);if(r){if(t=this._resolvePossibleFunction(t),!t){r.remove();return}if(dt(t)){this._putElementInTemplate(Tt(t),r);return}if(this._config.html){r.innerHTML=this._maybeSanitize(t);return}r.textContent=t}}_maybeSanitize(e){return this._config.sanitize?zh(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return Pe(e,[void 0,this])}_putElementInTemplate(e,t){if(this._config.html){t.innerHTML="",t.append(e);return}t.textContent=e.textContent}},Yh="tooltip",Gh=new Set(["sanitize","allowList","sanitizeFn"]),vo="fade",Kh="modal",ji="show",Xh=".tooltip-inner",ra=`.${Kh}`,oa="hide.bs.modal",Zn="hover",yo="focus",Eo="click",Qh="manual",Jh="hide",Zh="hidden",ep="show",tp="shown",np="inserted",ip="click",rp="focusin",op="focusout",sp="mouseenter",ap="mouseleave",lp={AUTO:"auto",TOP:"top",RIGHT:Xe()?"left":"right",BOTTOM:"bottom",LEFT:Xe()?"right":"left"},cp={allowList:Pa,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'
',title:"",trigger:"hover focus"},up={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"},ht=class n extends We{constructor(e,t){if(typeof Bi=="undefined")throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org/docs/v2/)");super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return cp}static get DefaultType(){return up}static get NAME(){return Yh}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){if(this._isEnabled){if(this._isShown()){this._leave();return}this._enter()}}dispose(){clearTimeout(this._timeout),T.off(this._element.closest(ra),oa,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!(this._isWithContent()&&this._isEnabled))return;let e=T.trigger(this._element,this.constructor.eventName(ep)),i=(ma(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!i)return;this._disposePopper();let r=this._getTipElement();this._element.setAttribute("aria-describedby",r.getAttribute("id"));let{container:o}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(o.append(r),T.trigger(this._element,this.constructor.eventName(np))),this._popper=this._createPopper(r),r.classList.add(ji),"ontouchstart"in document.documentElement)for(let a of[].concat(...document.body.children))T.on(a,"mouseover",Ki);let s=()=>{T.trigger(this._element,this.constructor.eventName(tp)),this._isHovered===!1&&this._leave(),this._isHovered=!1};this._queueCallback(s,this.tip,this._isAnimated())}hide(){if(!this._isShown()||T.trigger(this._element,this.constructor.eventName(Jh)).defaultPrevented)return;if(this._getTipElement().classList.remove(ji),"ontouchstart"in document.documentElement)for(let r of[].concat(...document.body.children))T.off(r,"mouseover",Ki);this._activeTrigger[Eo]=!1,this._activeTrigger[yo]=!1,this._activeTrigger[Zn]=!1,this._isHovered=null;let i=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),T.trigger(this._element,this.constructor.eventName(Zh)))};this._queueCallback(i,this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return!!this._getTitle()}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){let t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(vo,ji),t.classList.add(`bs-${this.constructor.NAME}-auto`);let i=Qu(this.constructor.NAME).toString();return t.setAttribute("id",i),this._isAnimated()&&t.classList.add(vo),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new Do(oe(O({},this._config),{content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)})),this._templateFactory}_getContentForTemplate(){return{[Xh]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(vo)}_isShown(){return this.tip&&this.tip.classList.contains(ji)}_createPopper(e){let t=Pe(this._config.placement,[this,e,this._element]),i=lp[t.toUpperCase()];return Qn(this._element,e,this._getPopperConfig(i))}_getOffset(){let{offset:e}=this._config;return typeof e=="string"?e.split(",").map(t=>Number.parseInt(t,10)):typeof e=="function"?t=>e(t,this._element):e}_resolvePossibleFunction(e){return Pe(e,[this._element,this._element])}_getPopperConfig(e){let t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:i=>{this._getTipElement().setAttribute("data-popper-placement",i.state.placement)}}]};return O(O({},t),Pe(this._config.popperConfig,[void 0,t]))}_setListeners(){let e=this._config.trigger.split(" ");for(let t of e)if(t==="click")T.on(this._element,this.constructor.eventName(ip),this._config.selector,i=>{let r=this._initializeOnDelegatedTarget(i);r._activeTrigger[Eo]=!(r._isShown()&&r._activeTrigger[Eo]),r.toggle()});else if(t!==Qh){let i=t===Zn?this.constructor.eventName(sp):this.constructor.eventName(rp),r=t===Zn?this.constructor.eventName(ap):this.constructor.eventName(op);T.on(this._element,i,this._config.selector,o=>{let s=this._initializeOnDelegatedTarget(o);s._activeTrigger[o.type==="focusin"?yo:Zn]=!0,s._enter()}),T.on(this._element,r,this._config.selector,o=>{let s=this._initializeOnDelegatedTarget(o);s._activeTrigger[o.type==="focusout"?yo:Zn]=s._element.contains(o.relatedTarget),s._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},T.on(this._element.closest(ra),oa,this._hideModalHandler)}_fixTitle(){let e=this._element.getAttribute("title");e&&(!this._element.getAttribute("aria-label")&&!this._element.textContent.trim()&&this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){if(this._isShown()||this._isHovered){this._isHovered=!0;return}this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show)}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){let t=ft.getDataAttributes(this._element);for(let i of Object.keys(t))Gh.has(i)&&delete t[i];return e=O(O({},t),typeof e=="object"&&e?e:{}),e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=e.container===!1?document.body:Tt(e.container),typeof e.delay=="number"&&(e.delay={show:e.delay,hide:e.delay}),typeof e.title=="number"&&(e.title=e.title.toString()),typeof e.content=="number"&&(e.content=e.content.toString()),e}_getDelegateConfig(){let e={};for(let[t,i]of Object.entries(this._config))this.constructor.Default[t]!==i&&(e[t]=i);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each(function(){let t=n.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]=="undefined")throw new TypeError(`No method named "${e}"`);t[e]()}})}};Je(ht);var dp="popover",fp=".popover-header",hp=".popover-body",pp=oe(O({},ht.Default),{content:"",offset:[0,8],placement:"right",template:'
'},n.settings.render),o.addEventListener("scroll",()=>{n.settings.shouldLoadMore.call(n)&&y(n.lastValue)&&(s||(s=!0,n.load.call(n,n.lastValue)))})})}we.define("change_listener",sl);we.define("checkbox_options",ll);we.define("clear_button",cl);we.define("drag_drop",ul);we.define("dropdown_header",dl);we.define("caret_position",fl);we.define("dropdown_input",pl);we.define("input_autogrow",ml);we.define("no_backspace_delete",gl);we.define("no_active_items",vl);we.define("optgroup_columns",yl);we.define("remove_button",wl);we.define("restore_on_backspace",xl);we.define("virtual_scroll",Tl);var Cl=we;function en(n){return"error"in n}function ye(n){let e=["","null","undefined"];return Array.isArray(n)?n.length>0:typeof n=="string"&&!e.includes(n)||typeof n=="number"||typeof n=="boolean"?!0:typeof n=="object"&&n!==null}function mr(n){return typeof n!==null&&typeof n!="undefined"}function gg(n,e,t){return at(this,null,function*(){let i=window.CSRF_TOKEN,r=new Headers({"X-CSRFToken":i}),o;typeof t!="undefined"&&(o=JSON.stringify(t),r.set("content-type","application/json"));let s=yield fetch(n,{method:e,body:o,headers:r,credentials:"same-origin"}),a=s.headers.get("Content-Type");if(typeof a=="string"&&a.includes("text"))return{error:yield s.text()};let l=yield s.json();return!s.ok&&Array.isArray(l)?{error:l.join(`
-`)}:!s.ok&&"detail"in l?{error:l.detail}:l})}function Ln(n,e){return at(this,null,function*(){return yield gg(n,"PATCH",e)})}function*k(...n){for(let e of n)for(let t of document.querySelectorAll(e))t!==null&&(yield t)}function fi(n){return document.getElementById(n)}function Sl(n,e="select"){let t=[];for(let i of n.querySelectorAll(e))if(i!==null){let r={name:i.name,options:[]};for(let o of i.options)o.selected&&r.options.push(o.value);t=[...t,r]}return t}function Al(n,e,t){function i(o){return!!(typeof t=="string"&&o!==null&&o.matches(t))}function r(o){if(o!==null&&o.parentElement!==null&&!i(o)){for(let s of o.parentElement.querySelectorAll(e))if(s!==null)return s;return r(o.parentElement.parentElement)}return null}return r(n)}function Wo(n,e,t=null,i=[]){let r=document.createElement(n);if(e!==null)for(let o of Object.keys(e)){let s=o,a=e[s];s in r&&(r[s]=a)}t!==null&&t.length>0&&r.classList.add(...t);for(let o of i)r.appendChild(o);return r}function Uo(n,e,t){if(typeof n!="string")throw new TypeError("replaceAll 'input' argument must be a string");if(typeof e!="string"&&!(e instanceof RegExp))throw new TypeError("replaceAll 'pattern' argument must be a string or RegExp instance");switch(typeof t){case"boolean":t=String(t);break;case"number":t=String(t);break;case"string":break;default:throw new TypeError("replaceAll 'replacement' argument must be stringifyable")}if(e instanceof RegExp){let i=Array.from(new Set([...e.flags.split(""),"g"])).join("");e=new RegExp(e.source,i)}else e=new RegExp(e,"g");return n.replace(e,t)}function Dl(){for(let n of k("[data-requires-fields]")){let e=n.getAttribute("data-requires-fields");if(!e)continue;let t=e.split(",").map(i=>i.trim());for(let i of t){let r=document.querySelector(`[name="${i}"]`);r&&r.addEventListener("change",()=>{if(!r.value||r.value===""){let o=n.tomselect;o?o.clear():n.value=""}})}}}function vg(){for(let n of k("select.select-all option"))n.selected=!0}function Ol(){for(let n of k("form")){let e=n.querySelectorAll("button[type=submit]");for(let i of e)i.addEventListener("click",()=>vg());let t=document.querySelector("button[data-reset-select]");t!==null&&t.addEventListener("click",()=>{window.location.assign(window.location.origin+window.location.pathname)})}}var hi="empty_true",gr="empty_false";function Ml(){for(let n of k("form")){let e=n.querySelectorAll(".modifier-select");e.length!==0&&(Eg(n),e.forEach(t=>{t.addEventListener("change",()=>Ll(t)),Ll(t)}),n.addEventListener("submit",t=>{t.preventDefault();let i=new FormData(n);yg(n,i);let r=new URLSearchParams;for(let[s,a]of i.entries())a&&String(a).trim()&&r.append(s,String(a));let o=n.getAttribute("action")||n.action;window.location.href=`${o}?${r.toString()}`}))}}function Ll(n){let e=n.closest(".filter-modifier-group");if(!e)return;let t=e.querySelector(".filter-value-container");if(!t)return;let i=t.querySelector("input, select, textarea");if(!i)return;let r=n.value;if(r===hi||r===gr){i.disabled=!0,i.value="";let o=n.dataset.emptyPlaceholder||"(automatically set)";i.setAttribute("placeholder",o)}else i.disabled=!1,i.removeAttribute("placeholder")}function yg(n,e){let t=n.querySelectorAll(".filter-modifier-group");for(let i of t){let r=i.querySelector(".modifier-select"),o=i.querySelector(".filter-value-container");if(!o)continue;let s=o.querySelector("input, select, textarea");if(!r||!s)continue;let a=s.name,l=r.value;if(l===hi||l===gr){e.delete(a);let c=l===hi?"true":"false";e.set(`${a}__empty`,c)}else{let c=e.getAll(a);if(c.length>0&&c.some(u=>String(u).trim())){e.delete(a);let u=l==="exact"?a:`${a}__${l}`;for(let d of c)String(d).trim()&&e.append(u,d)}else e.delete(a)}}}function Eg(n){let e=new URLSearchParams(window.location.search),t=n.querySelectorAll(".filter-modifier-group");for(let i of t){let r=i.querySelector(".modifier-select"),o=i.querySelector(".filter-value-container");if(!o)continue;let s=o.querySelector("input, select, textarea");if(!r||!s)continue;let a=s.name,l=`${a}__empty`;if(e.has(l)){let u=e.get(l)==="true"?hi:gr;r.value=u;continue}for(let c of r.options){let u=c.value;if(u===hi||u===gr)continue;let d=u==="exact"?a:`${a}__${u}`;if(e.has(d)){if(r.value=u,s instanceof HTMLSelectElement&&s.multiple){let p=e.getAll(d);for(let y of s.options)y.selected=p.includes(y.value)}else s.value=e.get(d)||"";break}}}}var vt=class extends Cl{setup(){super.setup(),this.input.setAttribute("aria-hidden","true")}focus(){if(this.isDisabled||this.isReadOnly)return;this.ignoreFocus=!0;let e=this.control_input.offsetWidth?this.control_input:this.focus_node;e.focus(),setTimeout(()=>{this.ignoreFocus=!1,(document.activeElement===e||this.control.contains(document.activeElement))&&this.onFocus()},0)}};function tn(n){let e={};return n.required||(e.clear_button={html:t=>``}),n.hasAttribute("multiple")&&(e.remove_button={title:"Remove"}),n.hasAttribute("multiple")&&(e.drag_drop={}),{plugins:e}}function Go(n){return n.tomselect}function Nl(n,e){Go(n)||new vt(n,oe(O({},tn(n)),{maxOptions:void 0,onChange:()=>{pi(e),nn(e)}}))}function nn(n){var i,r,o,s;let e=n.querySelector('input[type="hidden"]');if(e===null)return;let t=[];for(let a of n.querySelectorAll("[data-port-mapping-row]")){let l=(r=(i=a.querySelector("select.port-mapping-protocol"))==null?void 0:i.value)!=null?r:"",c=(s=(o=a.querySelector(".port-mapping-ports"))==null?void 0:o.value.trim())!=null?s:"";l===""&&c===""||t.push({protocol:l,ports:c})}e.value=JSON.stringify(t)}function Yo(n){if(!n.id)return;let e=`${n.id}_protocol_0`,t=Array.from(n.querySelectorAll("select.port-mapping-protocol"));for(let i of t)i.id===e&&i.removeAttribute("id");t.length>0&&(t[0].id=e)}function bg(n){let e=n.querySelectorAll("select.port-mapping-protocol");return new Set(Array.from(e).map(t=>t.value).filter(t=>t!==""))}function kl(n){var i;let e=n.querySelector("template[data-port-mapping-template]"),t=e==null?void 0:e.content.querySelector("select.port-mapping-protocol");return Array.from((i=t==null?void 0:t.options)!=null?i:[]).filter(r=>r.value!=="").map(r=>{var o,s;return{value:r.value,text:(s=(o=r.textContent)==null?void 0:o.trim())!=null?s:r.value}})}function pi(n){let e=kl(n),t=Array.from(n.querySelectorAll("select.port-mapping-protocol")),i=new Set(t.map(o=>o.value).filter(o=>o!==""));for(let o of t){let s=o.value,a=Go(o);if(a)e.forEach(({value:l,text:c},u)=>{let d=l===s||!i.has(l),p=Object.prototype.hasOwnProperty.call(a.options,l);d&&!p?a.addOption({value:l,text:c,$order:u+1}):!d&&p&&a.removeOption(l,!0)}),a.refreshOptions(!1);else for(let l of Array.from(o.options))l.value!==""&&(l.disabled=i.has(l.value)&&l.value!==s)}let r=n.querySelector("[data-port-mapping-add]");r!==null&&(r.disabled=e.length>0&&i.size>=e.length)}function _g(n){var a;let e=n.querySelector("template[data-port-mapping-template]"),t=n.querySelector("[data-port-mapping-rows]");if(e===null||t===null)return;let i=bg(n),r=e.content.cloneNode(!0);t.appendChild(r);let o=t.querySelectorAll("[data-port-mapping-row]"),s=(a=o[o.length-1])==null?void 0:a.querySelector("select.port-mapping-protocol");if(s){Nl(s,n);let l=kl(n).find(c=>!i.has(c.value));if(l){let c=Go(s);c?c.setValue(l.value,!0):s.value=l.value}}Yo(n),pi(n),nn(n)}function wg(n){var t;if(n.dataset.portMappingInitialized==="true")return;n.dataset.portMappingInitialized="true";for(let i of n.querySelectorAll("select.port-mapping-protocol"))Nl(i,n);let e=n.querySelector("[data-port-mapping-add]");e==null||e.addEventListener("click",()=>_g(n)),n.addEventListener("click",i=>{var s;let o=i.target.closest("[data-port-mapping-remove]");o!==null&&((s=o.closest("[data-port-mapping-row]"))==null||s.remove(),Yo(n),pi(n),nn(n))}),n.addEventListener("input",()=>nn(n)),n.addEventListener("change",()=>{pi(n),nn(n)}),(t=n.closest("form"))==null||t.addEventListener("submit",()=>nn(n)),Yo(n),pi(n),nn(n)}function Hl(){for(let n of k(".port-mapping-widget"))wg(n)}function Rl(){for(let e of k("a.set_field_value"))if(e!==null){let t=function(i){i.preventDefault();let r=e.getAttribute("data"),o=document.getElementById(e.target);o!==null&&r!==null&&(o.value=r)};var n=t;e.addEventListener("click",t)}}function vr(){for(let n of[Ol,Rl,Ml,Dl,Hl])n()}window.Collapse=Cn;window.Modal=tt;window.Popover=Sn;window.Toast=pt;window.Tooltip=ht;function xg(){for(let n of k('[data-bs-toggle="tooltip"]'))new ht(n,{container:"body"})}function Tg(){for(let n of k('[data-bs-toggle="modal"]'))new tt(n)}function kt(n,e,t,i){let r="mdi-alert";switch(n){case"warning":r="mdi-alert";break;case"success":r="mdi-check-circle";break;case"info":r="mdi-information";break;case"danger":r="mdi-alert";break}let o=document.createElement("div");o.setAttribute("class","toast-container position-fixed bottom-0 end-0 m-3");let s=document.createElement("div");s.setAttribute("class",`toast bg-${n}`),s.setAttribute("role","alert"),s.setAttribute("aria-live","assertive"),s.setAttribute("aria-atomic","true");let a=document.createElement("div");a.setAttribute("class",`toast-header bg-${n} text-body`);let l=document.createElement("i");l.setAttribute("class",`mdi ${r}`);let c=document.createElement("strong");c.setAttribute("class","me-auto ms-1"),c.innerText=e;let u=document.createElement("button");u.setAttribute("type","button"),u.setAttribute("class","btn-close"),u.setAttribute("data-bs-dismiss","toast"),u.setAttribute("aria-label","Close");let d=document.createElement("div");if(d.setAttribute("class","toast-body"),a.appendChild(l),a.appendChild(c),typeof i!="undefined"){let y=document.createElement("small");y.setAttribute("class","text-muted"),a.appendChild(y)}return a.appendChild(u),d.innerText=t.trim(),s.appendChild(a),s.appendChild(d),o.appendChild(s),document.body.appendChild(o),new pt(s)}function Cg(){let{hash:n}=location;if(n&&n.match(/^#tab_.+$/)){let e=n.replace("tab_","");for(let t of k(`ul.nav.nav-tabs .nav-link[data-bs-target="${e}"]`))new Qt(t).show()}}function Sg(){let n=document.querySelectorAll(".sidebar .accordion-item");function e(t){for(let i of n)i!==t?i.classList.remove("is-open"):i.classList.toggle("is-open")}for(let t of n)for(let i of t.querySelectorAll(".accordion-button"))i.addEventListener("click",()=>{e(t)})}function Ag(){var n;for(let e of k("a.image-preview")){let t=(n=e.dataset.previewUrl)!=null?n:e.href,i=Wo("img",{src:t});i.loading="lazy",i.decoding="async";let r=Wo("div",null,null,[i]);new Sn(e,{customClass:"image-preview-popover",trigger:"hover",html:!0,content:r})}}function yr(){for(let n of[xg,Tg,Cg,Ag,Sg])n()}function Il(n){let e=n.currentTarget,t=document.getElementById("quicksearch_clear");ye(t)&&(e.value===""?t.classList.add("invisible"):t.classList.remove("invisible"))}function Pl(){let n=document.getElementById("export_current_view"),e=n==null?void 0:n.href.split("&")[0];n.setAttribute("href",e)}function Dg(n){let e=n.currentTarget;if(Pl(),e!=null){let t=document.getElementById("export_current_view"),i=new URLSearchParams;i.set("q",e.value);let r=i.toString(),o=(t==null?void 0:t.href)+"&"+r;t.setAttribute("href",o)}}function Fl(){let n=document.getElementById("quicksearch"),e=document.getElementById("quicksearch_clear");ye(n)&&(n.addEventListener("keyup",Il,{passive:!0}),n.addEventListener("search",Il,{passive:!0}),n.addEventListener("change",Dg,{passive:!0}),ye(e)&&e.addEventListener("click",()=>at(null,null,function*(){let t=new Event("search");n.value="",yield new Promise(i=>setTimeout(i,100)),n.dispatchEvent(t),Pl()}),{passive:!0}))}function Og(n,e){let t=`
`}function $l(){for(let n of k("select:not(.tomselected):not(.no-ts):not([size]):not(.api-select):not(.color-select)"))new vt(n,oe(O({},tn(n)),{maxOptions:void 0,render:{option:Og}}))}function Bl(){function n(e,t){return`
${t(e.text)}
`}for(let e of k("select.color-select:not(.tomselected)"))new vt(e,oe(O({},tn(e)),{maxOptions:void 0,render:{option:n,item:n}}))}var Vl=(n,e)=>{if(Array.isArray(n))n.forEach(e);else for(var t in n)n.hasOwnProperty(t)&&e(n[t],t)};var zl=(n,...e)=>{var t=jl(e);n=Wl(n),n.map(i=>{t.map(r=>{i.classList.add(r)})})},ql=(n,...e)=>{var t=jl(e);n=Wl(n),n.map(i=>{t.map(r=>{i.classList.remove(r)})})},jl=n=>{var e=[];return Vl(n,t=>{typeof t=="string"&&(t=t.trim().split(/[\t\n\f\r\s]/)),Array.isArray(t)&&(e=e.concat(t))}),e.filter(Boolean)},Wl=n=>(Array.isArray(n)||(n=[n]),n);var es={};Es(es,{exclude:()=>Vg,extract:()=>Jo,parse:()=>Zo,parseUrl:()=>tc,pick:()=>Qo,stringify:()=>ec,stringifyUrl:()=>nc});var Lg="%[a-f0-9]{2}",Ul=new RegExp(`(${Lg})+`,"gi"),Mg=/^[a-f\d]{2}$/i;function Yl(n,e){if(n.codePointAt(e)!==37||e+3>n.length)return;let t=n.slice(e+1,e+3);if(Mg.test(t))return{byte:Number.parseInt(t,16),next:e+3}}function Ng(n){return n<=127?1:n>=194&&n<=223?2:n>=224&&n<=239?3:n>=240&&n<=244?4:0}function kg(n){return n>=128&&n<=191}function Hg(n){try{return decodeURIComponent(n)}catch(e){let t="",i=0;for(;in==null,Pg=n=>encodeURIComponent(n).replaceAll(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Xo=Symbol("encodeFragmentIdentifier");function Fg(n){switch(n.arrayFormat){case"index":return e=>(t,i)=>{let r=t.length;return i===void 0||n.skipNull&&i===null||n.skipEmptyString&&i===""?t:i===null?(t.push([Ee(e,n),"[",r,"]"].join("")),t):(t.push([Ee(e,n),"[",Ee(r,n),"]=",Ee(i,n)].join("")),t)};case"bracket":return e=>(t,i)=>i===void 0||n.skipNull&&i===null||n.skipEmptyString&&i===""?t:i===null?(t.push([Ee(e,n),"[]"].join("")),t):(t.push([Ee(e,n),"[]=",Ee(i,n)].join("")),t);case"colon-list-separator":return e=>(t,i)=>i===void 0||n.skipNull&&i===null||n.skipEmptyString&&i===""?t:i===null?(t.push([Ee(e,n),":list="].join("")),t):(t.push([Ee(e,n),":list=",Ee(i,n)].join("")),t);case"comma":case"separator":case"bracket-separator":{let e=n.arrayFormat==="bracket-separator"?"[]=":"=";return t=>(i,r)=>r===void 0||n.skipNull&&r===null||n.skipEmptyString&&r===""?i:(r=r===null?"":r,i.length===0?(i.push([Ee(t,n),e,Ee(r,n)].join("")),i):(i.push(Ee(r,n)),i))}default:return e=>(t,i)=>i===void 0||n.skipNull&&i===null||n.skipEmptyString&&i===""?t:i===null?(t.push(Ee(e,n)),t):(t.push([Ee(e,n),"=",Ee(i,n)].join("")),t)}}function $g(n){let e;switch(n.arrayFormat){case"index":return(t,i,r)=>{if(e=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),!e){r[t]=i;return}r[t]===void 0&&(r[t]={}),r[t][e[1]]=i};case"bracket":return(t,i,r)=>{if(e=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),!e){r[t]=i;return}if(r[t]===void 0){r[t]=[i];return}if(!Array.isArray(r[t])){r[t]=[r[t],i];return}r[t].push(i)};case"colon-list-separator":return(t,i,r)=>{if(e=/(:list)$/.exec(t),t=t.replace(/:list$/,""),!e){r[t]=i;return}if(r[t]===void 0){r[t]=[i];return}if(!Array.isArray(r[t])){r[t]=[r[t],i];return}r[t].push(i)};case"comma":case"separator":return(t,i,r)=>{let s=typeof i=="string"&&i.includes(n.arrayFormatSeparator)?i.split(n.arrayFormatSeparator).map(a=>rn(a,n)):i===null?i:rn(i,n);r[t]=s};case"bracket-separator":return(t,i,r)=>{let o=/(\[])$/.test(t);if(t=t.replace(/\[]$/,""),!o){r[t]=i&&rn(i,n);return}let s=i===null?[]:rn(i,n).split(n.arrayFormatSeparator);if(r[t]===void 0){r[t]=s;return}Array.isArray(r[t])||(r[t]=[r[t]]);for(let a of s)r[t].push(a)};default:return(t,i,r)=>{if(r[t]===void 0){r[t]=i;return}if(Array.isArray(r[t])){r[t].push(i);return}r[t]=[r[t],i]}}}function Xl(n){if(typeof n!="string"||n.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function Ee(n,e){return e.encode?e.strict?Pg(n):encodeURIComponent(n):n}function rn(n,e){return e.decode?Ko(n):n}function Ql(n){return Array.isArray(n)?n.sort():typeof n=="object"?Ql(Object.keys(n)).sort((e,t)=>Number(e)-Number(t)).map(e=>n[e]):n}function Jl(n){let e=n.indexOf("#");return e!==-1&&(n=n.slice(0,e)),n}function Bg(n){let e="",t=n.indexOf("#");return t!==-1&&(e=n.slice(t)),e}function Zl(n){let e=n.indexOf("?");return e===-1?n:n.slice(0,e)}function Kl(n,e,t){return t==="string"&&typeof n=="string"?n:typeof t=="function"&&typeof n=="string"?t(n):t==="boolean"&&n===null?!0:t==="boolean"&&n!==null&&(n.toLowerCase()==="true"||n.toLowerCase()==="false")?n.toLowerCase()==="true":t==="boolean"&&n!==null&&(n.toLowerCase()==="1"||n.toLowerCase()==="0")?n.toLowerCase()==="1":t==="string[]"&&e.arrayFormat!=="none"&&typeof n=="string"?[n]:t==="number[]"&&e.arrayFormat!=="none"&&!Number.isNaN(Number(n))&&typeof n=="string"&&n.trim()!==""?[Number(n)]:t==="number"&&!Number.isNaN(Number(n))&&typeof n=="string"&&n.trim()!==""?Number(n):e.parseBooleans&&n!==null&&(n.toLowerCase()==="true"||n.toLowerCase()==="false")?n.toLowerCase()==="true":e.parseNumbers&&!Number.isNaN(Number(n))&&typeof n=="string"&&n.trim()!==""?Number(n):n}function Jo(n){n=Jl(n);let e=n.indexOf("?");return e===-1?"":n.slice(e+1)}function Zo(n,e){e=O({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null)},e),Xl(e.arrayFormatSeparator);let t=$g(e),i=Object.create(null);if(typeof n!="string"||(n=n.trim().replace(/^[?#&]/,""),!n)||/^&+$/.test(n))return i;let r=0,o=n.indexOf("&");o===-1&&(o=n.length);for(let s=o;s<=n.length;s++){if(s{let l=i[a];return s[a]=l&&typeof l=="object"&&!Array.isArray(l)?Ql(l):l,s},Object.create(null))}function ec(n,e){if(!n)return"";e=O({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e),Xl(e.arrayFormatSeparator);let t=s=>e.skipNull&&Ig(n[s])||e.skipEmptyString&&n[s]==="",i=Fg(e),r={};for(let[s,a]of Object.entries(n))t(s)||(r[s]=a);let o=Object.keys(r);return e.sort!==!1&&o.sort(e.sort),o.map(s=>{let a=n[s];if(e.replacer&&(a=e.replacer(s,a),a===void 0)||a===void 0)return"";if(a===null)return Ee(s,e);if(Array.isArray(a)){if(a.length===0&&e.arrayFormat==="bracket-separator")return Ee(s,e)+"[]";let l=a;e.replacer&&(l=a.map((d,p)=>e.replacer(`${s}[${p}]`,d)).filter(d=>d!==void 0));let c=l.reduce(i(s),[]),u=["comma","separator","bracket-separator"].includes(e.arrayFormat)?e.arrayFormatSeparator:"&";return c.join(u)}return Ee(s,e)+"="+Ee(a,e)}).filter(s=>s.length>0).join("&")}function tc(n,e){e=O({decode:!0},e);let[t,i]=Er(n,"#");return t===void 0&&(t=n),O({url:Zl(t!=null?t:""),query:Zo(Jo(n),e)},e&&e.parseFragmentIdentifier&&i?{fragmentIdentifier:rn(i,e)}:{})}function nc(n,e){e=O({encode:!0,strict:!0,[Xo]:!0},e);let t=Zl(Jl(n.url))||"",i=Jo(n.url),r=O(O({},Zo(i,O({sort:!1},e))),n.query),o=ec(r,e);o&&(o=`?${o}`);let s=Bg(n.url);if(typeof n.fragmentIdentifier=="string"&&(s=`#${n.fragmentIdentifier}`,e[Xo])){let a=new URL("https://query-string.invalid");a.hash=s,s=a.hash}return`${t}${o}${s}`}function Qo(n,e,t){t=O({parseFragmentIdentifier:!0,[Xo]:!1},t);let{url:i,query:r,fragmentIdentifier:o}=tc(n,t);return nc({url:i,query:Gl(r,e),fragmentIdentifier:o},t)}function Vg(n,e,t){if(Array.isArray(e)){let i=new Set(e);return Qo(n,r=>!i.has(r),t)}return Qo(n,(i,r)=>!e(i,r),t)}var ic=es;function rc(n){if(Array.isArray(n)){for(let e of n)if(typeof e=="object"&&e!==null&&"fieldName"in e&&"queryParam"in e)return typeof e.fieldName=="string"&&typeof e.queryParam=="string"}return!1}var br=class extends Map{queryParam(e){let t=this.get(e);return typeof t!="undefined"?t.queryParam:null}queryValue(e){let t=this.get(e);return typeof t!="undefined"?t.queryValue:[]}updateValue(e,t){let i=this.get(e);if(ye(i)){let{queryParam:r}=i;return this.set(e,{queryParam:r,queryValue:t}),!0}return!1}addFromJson(e){if(ye(e)){let t=JSON.parse(e);if(rc(t))for(let{queryParam:i,fieldName:r}of t)this.set(r,{queryParam:i,queryValue:[]});else throw new Error(`Data from 'data-dynamic-params' attribute is improperly formatted: '${e}'`)}}};var _r=class extends vt{constructor(t,i){super(t,i);ae(this,"nullOption",null);ae(this,"api_url",null);ae(this,"queryParams",new Map);ae(this,"staticParams",new Map);ae(this,"dynamicParams",new br);ae(this,"pathValues",new Map);ae(this,"loadSequence",0);ae(this,"pendingRestoreValue");this.api_url=this.input.getAttribute("data-url"),this.valueField=this.input.getAttribute("ts-value-field")||this.settings.valueField,this.labelField=this.input.getAttribute("ts-label-field")||this.settings.labelField,this.disabledField=this.input.getAttribute("ts-disabled-field")||this.settings.disabledField,this.descriptionField=this.input.getAttribute("ts-description-field")||"description",this.depthField=this.input.getAttribute("ts-depth-field")||"_depth",this.parentField=this.input.getAttribute("ts-parent-field")||null,this.countField=this.input.getAttribute("ts-count-field")||null;let r=this.input.getAttribute("data-null-option");if(r){let o=this.settings.valueField,s=this.settings.labelField;this.nullOption={},this.nullOption[o]="null",this.nullOption[s]=r}this.getStaticParams();for(let[o,s]of this.staticParams.entries())this.queryParams.set(o,s);this.getDynamicParams();for(let o of this.dynamicParams.keys())this.updateQueryParams(o);this.getPathKeys();for(let o of this.pathValues.keys())this.updatePathValues(o);this.addEventListeners()}load(t,i){let r=this;r.loadSequence+=1;let o=r.loadSequence;if((Array.isArray(i)?i.length>0:i!==void 0)&&(r.pendingRestoreValue=i),!r.api_url){r.pendingRestoreValue=void 0;return}r.clearOptions(),r.nullOption&&!t&&r.addOption(r.nullOption);let a=r.getRequestUrl(t);if(!a){r.pendingRestoreValue=void 0;return}zl(r.wrapper,r.settings.loadingClass),r.loading++,fetch(a).then(l=>l.json()).then(l=>{let c=l.results,u=[];for(let d of c){let p=r.getOptionFromData(d);u.push(p)}return u}).then(l=>{if(o!==r.loadSequence){r.finalizeStaleLoad();return}if(r.loadCallback(l,[]),r.pendingRestoreValue!==void 0){let u=(Array.isArray(r.pendingRestoreValue)?r.pendingRestoreValue:[r.pendingRestoreValue]).filter(d=>d!==""&&d in r.options);u.length>0&&r.setValue(u.length===1?u[0]:u,!0),r.pendingRestoreValue=void 0}}).catch(()=>{if(o!==r.loadSequence){r.finalizeStaleLoad();return}r.pendingRestoreValue=void 0,r.loadCallback([],[])})}finalizeStaleLoad(){this.loading=Math.max(this.loading-1,0),this.loading||(ql(this.wrapper,this.settings.loadingClass),this.refreshOptions(!1))}getRequestUrl(t){if(!this.api_url)return"";let i=this.api_url,r=i,o={};for(let[s,a]of this.queryParams.entries())o[s]=a;for(let[s,a]of this.pathValues.entries())for(let l of i.matchAll(new RegExp(`({{${s}}})`,"g")))if(a)r=Uo(r,l[1],a.toString());else return"";return t&&(o.q=[t]),o.brief=[!0],o.limit=[this.settings.maxOptions],ic.stringifyUrl({url:r,query:o})}getOptionFromData(t){let i={id:t[this.valueField],display:t[this.labelField],depth:t[this.depthField]||null,description:t[this.descriptionField]||null};if(t[this.parentField]){let r=t[this.parentField];i.parent=r[this.labelField]}return t[this.countField]&&(i.count=t[this.countField]),t[this.disabledField]&&(i.disabled=t[this.disabledField]),i}getStaticParams(){let t=this.input.getAttribute("data-static-params");try{if(t){let i=JSON.parse(t);if(i)for(let{queryParam:r,queryValue:o}of i)Array.isArray(o)?this.staticParams.set(r,o):this.staticParams.set(r,[o])}}catch(i){console.group(`Unable to determine static query parameters for select field '${this.name}'`),console.warn(i),console.groupEnd()}}getDynamicParams(){let t=this.input.getAttribute("data-dynamic-params");try{this.dynamicParams.addFromJson(t)}catch(i){console.group(`Unable to determine dynamic query parameters for select field '${this.name}'`),console.warn(i),console.groupEnd()}}getPathKeys(){if(this.api_url)for(let t of this.api_url.matchAll(new RegExp("{{(.+)}}","g")))this.pathValues.set(t[1],"")}updateQueryParams(t){let i=document.querySelector(`[name="${t}"]`);if(i!==null){let r=[];if(i.multiple?r=Array.from(i.options).filter(o=>o.selected).map(o=>o.value):i.value!==""&&(r=[i.value]),r.length>0){this.dynamicParams.updateValue(t,r);let o=this.dynamicParams.get(t);if(typeof o!="undefined"){let{queryParam:s,queryValue:a}=o,l=[];if(this.staticParams.has(s)){let c=this.staticParams.get(s);typeof c!="undefined"&&(l=[...c,...a])}else l=a;l.length>0?this.queryParams.set(s,l):this.queryParams.delete(s)}}else{let o=this.dynamicParams.queryParam(t);o!==null&&this.queryParams.delete(o)}}}updatePathValues(t){if(!this.api_url)return;let i=this.api_url,r=Uo(t,/^id_/i,""),o=fi(`id_${r}`);o!==null&&i.includes("{{")&&i.match(new RegExp(`({{(${t})}})`,"g"))&&(o.value?this.pathValues.set(t,o.value):this.pathValues.set(t,""))}addEventListeners(){let t=new Set([...this.dynamicParams.keys(),...this.pathValues.keys()]);for(let i of t){let r=document.querySelector(`[name="${i}"]`);r!==null&&r.addEventListener("change",o=>this.handleEvent(o)),this.input.addEventListener(`netbox.select.onload.${i}`,o=>this.handleEvent(o))}}handleEvent(t){let i=t.target,r=this.getValue();this.updateQueryParams(i.name),this.updatePathValues(i.name),this.clear();let o=r!==""&&r!==null?r:void 0;this.load(this.lastValue,o)}};var zg="id",wr="display",qg=100;function jg(n,e){let t="
'},n.settings.render),o.addEventListener("scroll",()=>{n.settings.shouldLoadMore.call(n)&&y(n.lastValue)&&(s||(s=!0,n.load.call(n,n.lastValue)))})})}we.define("change_listener",ll);we.define("checkbox_options",ul);we.define("clear_button",dl);we.define("drag_drop",fl);we.define("dropdown_header",hl);we.define("caret_position",pl);we.define("dropdown_input",gl);we.define("input_autogrow",vl);we.define("no_backspace_delete",yl);we.define("no_active_items",El);we.define("optgroup_columns",bl);we.define("remove_button",Tl);we.define("restore_on_backspace",Cl);we.define("virtual_scroll",Sl);var Al=we;function en(n){return"error"in n}function ye(n){let e=["","null","undefined"];return Array.isArray(n)?n.length>0:typeof n=="string"&&!e.includes(n)||typeof n=="number"||typeof n=="boolean"?!0:typeof n=="object"&&n!==null}function mr(n){return typeof n!==null&&typeof n!="undefined"}function bg(n,e,t){return Ze(this,null,function*(){let i=window.CSRF_TOKEN,r=new Headers({"X-CSRFToken":i}),o;typeof t!="undefined"&&(o=JSON.stringify(t),r.set("content-type","application/json"));let s=yield fetch(n,{method:e,body:o,headers:r,credentials:"same-origin"}),a=s.headers.get("Content-Type");if(typeof a=="string"&&a.includes("text"))return{error:yield s.text()};let l=yield s.json();return!s.ok&&Array.isArray(l)?{error:l.join(`
+`)}:!s.ok&&"detail"in l?{error:l.detail}:l})}function Mn(n,e){return Ze(this,null,function*(){return yield bg(n,"PATCH",e)})}function*k(...n){for(let e of n)for(let t of document.querySelectorAll(e))t!==null&&(yield t)}function tn(n){return document.getElementById(n)}function Dl(n,e="select"){let t=[];for(let i of n.querySelectorAll(e))if(i!==null){let r={name:i.name,options:[]};for(let o of i.options)o.selected&&r.options.push(o.value);t=[...t,r]}return t}function Ol(n,e,t){function i(o){return!!(typeof t=="string"&&o!==null&&o.matches(t))}function r(o){if(o!==null&&o.parentElement!==null&&!i(o)){for(let s of o.parentElement.querySelectorAll(e))if(s!==null)return s;return r(o.parentElement.parentElement)}return null}return r(n)}function Uo(n,e,t=null,i=[]){let r=document.createElement(n);if(e!==null)for(let o of Object.keys(e)){let s=o,a=e[s];s in r&&(r[s]=a)}t!==null&&t.length>0&&r.classList.add(...t);for(let o of i)r.appendChild(o);return r}function Yo(n,e,t){if(typeof n!="string")throw new TypeError("replaceAll 'input' argument must be a string");if(typeof e!="string"&&!(e instanceof RegExp))throw new TypeError("replaceAll 'pattern' argument must be a string or RegExp instance");switch(typeof t){case"boolean":t=String(t);break;case"number":t=String(t);break;case"string":break;default:throw new TypeError("replaceAll 'replacement' argument must be stringifyable")}if(e instanceof RegExp){let i=Array.from(new Set([...e.flags.split(""),"g"])).join("");e=new RegExp(e.source,i)}else e=new RegExp(e,"g");return n.replace(e,t)}function Ll(){for(let n of k("[data-requires-fields]")){let e=n.getAttribute("data-requires-fields");if(!e)continue;let t=e.split(",").map(i=>i.trim());for(let i of t){let r=document.querySelector(`[name="${i}"]`);r&&r.addEventListener("change",()=>{if(!r.value||r.value===""){let o=n.tomselect;o?o.clear():n.value=""}})}}}function _g(){for(let n of k("select.select-all option"))n.selected=!0}function Ml(){for(let n of k("form")){let e=n.querySelectorAll("button[type=submit]");for(let i of e)i.addEventListener("click",()=>_g());let t=document.querySelector("button[data-reset-select]");t!==null&&t.addEventListener("click",()=>{window.location.assign(window.location.origin+window.location.pathname)})}}var hi="empty_true",gr="empty_false";function kl(){for(let n of k("form")){let e=n.querySelectorAll(".modifier-select");e.length!==0&&(xg(n),e.forEach(t=>{t.addEventListener("change",()=>Nl(t)),Nl(t)}),n.addEventListener("submit",t=>{t.preventDefault();let i=new FormData(n);wg(n,i);let r=new URLSearchParams;for(let[s,a]of i.entries())a&&String(a).trim()&&r.append(s,String(a));let o=n.getAttribute("action")||n.action;window.location.href=`${o}?${r.toString()}`}))}}function Nl(n){let e=n.closest(".filter-modifier-group");if(!e)return;let t=e.querySelector(".filter-value-container");if(!t)return;let i=t.querySelector("input, select, textarea");if(!i)return;let r=n.value;if(r===hi||r===gr){i.disabled=!0,i.value="";let o=n.dataset.emptyPlaceholder||"(automatically set)";i.setAttribute("placeholder",o)}else i.disabled=!1,i.removeAttribute("placeholder")}function wg(n,e){let t=n.querySelectorAll(".filter-modifier-group");for(let i of t){let r=i.querySelector(".modifier-select"),o=i.querySelector(".filter-value-container");if(!o)continue;let s=o.querySelector("input, select, textarea");if(!r||!s)continue;let a=s.name,l=r.value;if(l===hi||l===gr){e.delete(a);let c=l===hi?"true":"false";e.set(`${a}__empty`,c)}else{let c=e.getAll(a);if(c.length>0&&c.some(u=>String(u).trim())){e.delete(a);let u=l==="exact"?a:`${a}__${l}`;for(let d of c)String(d).trim()&&e.append(u,d)}else e.delete(a)}}}function xg(n){let e=new URLSearchParams(window.location.search),t=n.querySelectorAll(".filter-modifier-group");for(let i of t){let r=i.querySelector(".modifier-select"),o=i.querySelector(".filter-value-container");if(!o)continue;let s=o.querySelector("input, select, textarea");if(!r||!s)continue;let a=s.name,l=`${a}__empty`;if(e.has(l)){let u=e.get(l)==="true"?hi:gr;r.value=u;continue}for(let c of r.options){let u=c.value;if(u===hi||u===gr)continue;let d=u==="exact"?a:`${a}__${u}`;if(e.has(d)){if(r.value=u,s instanceof HTMLSelectElement&&s.multiple){let p=e.getAll(d);for(let y of s.options)y.selected=p.includes(y.value)}else s.value=e.get(d)||"";break}}}}var vt=class extends Al{setup(){super.setup(),this.input.setAttribute("aria-hidden","true")}focus(){if(this.isDisabled||this.isReadOnly)return;this.ignoreFocus=!0;let e=this.control_input.offsetWidth?this.control_input:this.focus_node;e.focus(),setTimeout(()=>{this.ignoreFocus=!1,(document.activeElement===e||this.control.contains(document.activeElement))&&this.onFocus()},0)}};function nn(n){let e={};return n.required||(e.clear_button={html:t=>``}),n.hasAttribute("multiple")&&(e.remove_button={title:"Remove"}),n.hasAttribute("multiple")&&(e.drag_drop={}),{plugins:e}}function Ko(n){return n.tomselect}function Hl(n,e){Ko(n)||new vt(n,oe(O({},nn(n)),{maxOptions:void 0,onChange:()=>{pi(e),rn(e)}}))}function rn(n){var i,r,o,s;let e=n.querySelector('input[type="hidden"]');if(e===null)return;let t=[];for(let a of n.querySelectorAll("[data-port-mapping-row]")){let l=(r=(i=a.querySelector("select.port-mapping-protocol"))==null?void 0:i.value)!=null?r:"",c=(s=(o=a.querySelector(".port-mapping-ports"))==null?void 0:o.value.trim())!=null?s:"";l===""&&c===""||t.push({protocol:l,ports:c})}e.value=JSON.stringify(t)}function Go(n){if(!n.id)return;let e=`${n.id}_protocol_0`,t=Array.from(n.querySelectorAll("select.port-mapping-protocol"));for(let i of t)i.id===e&&i.removeAttribute("id");t.length>0&&(t[0].id=e)}function Tg(n){let e=n.querySelectorAll("select.port-mapping-protocol");return new Set(Array.from(e).map(t=>t.value).filter(t=>t!==""))}function Rl(n){var i;let e=n.querySelector("template[data-port-mapping-template]"),t=e==null?void 0:e.content.querySelector("select.port-mapping-protocol");return Array.from((i=t==null?void 0:t.options)!=null?i:[]).filter(r=>r.value!=="").map(r=>{var o,s;return{value:r.value,text:(s=(o=r.textContent)==null?void 0:o.trim())!=null?s:r.value}})}function pi(n){let e=Rl(n),t=Array.from(n.querySelectorAll("select.port-mapping-protocol")),i=new Set(t.map(o=>o.value).filter(o=>o!==""));for(let o of t){let s=o.value,a=Ko(o);if(a)e.forEach(({value:l,text:c},u)=>{let d=l===s||!i.has(l),p=Object.prototype.hasOwnProperty.call(a.options,l);d&&!p?a.addOption({value:l,text:c,$order:u+1}):!d&&p&&a.removeOption(l,!0)}),a.refreshOptions(!1);else for(let l of Array.from(o.options))l.value!==""&&(l.disabled=i.has(l.value)&&l.value!==s)}let r=n.querySelector("[data-port-mapping-add]");r!==null&&(r.disabled=e.length>0&&i.size>=e.length)}function Cg(n){var a;let e=n.querySelector("template[data-port-mapping-template]"),t=n.querySelector("[data-port-mapping-rows]");if(e===null||t===null)return;let i=Tg(n),r=e.content.cloneNode(!0);t.appendChild(r);let o=t.querySelectorAll("[data-port-mapping-row]"),s=(a=o[o.length-1])==null?void 0:a.querySelector("select.port-mapping-protocol");if(s){Hl(s,n);let l=Rl(n).find(c=>!i.has(c.value));if(l){let c=Ko(s);c?c.setValue(l.value,!0):s.value=l.value}}Go(n),pi(n),rn(n)}function Sg(n){var t;if(n.dataset.portMappingInitialized==="true")return;n.dataset.portMappingInitialized="true";for(let i of n.querySelectorAll("select.port-mapping-protocol"))Hl(i,n);let e=n.querySelector("[data-port-mapping-add]");e==null||e.addEventListener("click",()=>Cg(n)),n.addEventListener("click",i=>{var s;let o=i.target.closest("[data-port-mapping-remove]");o!==null&&((s=o.closest("[data-port-mapping-row]"))==null||s.remove(),Go(n),pi(n),rn(n))}),n.addEventListener("input",()=>rn(n)),n.addEventListener("change",()=>{pi(n),rn(n)}),(t=n.closest("form"))==null||t.addEventListener("submit",()=>rn(n)),Go(n),pi(n),rn(n)}function Il(){for(let n of k(".port-mapping-widget"))Sg(n)}function Pl(){for(let e of k("a.set_field_value"))if(e!==null){let t=function(i){i.preventDefault();let r=e.getAttribute("data"),o=document.getElementById(e.target);o!==null&&r!==null&&(o.value=r)};var n=t;e.addEventListener("click",t)}}function vr(){for(let n of[Ml,Pl,kl,Ll,Il])n()}window.Collapse=Sn;window.Modal=nt;window.Popover=An;window.Toast=pt;window.Tooltip=ht;function Ag(){for(let n of k('[data-bs-toggle="tooltip"]'))new ht(n,{container:"body"})}function Dg(){for(let n of k('[data-bs-toggle="modal"]'))new nt(n)}function kt(n,e,t,i){let r="mdi-alert";switch(n){case"warning":r="mdi-alert";break;case"success":r="mdi-check-circle";break;case"info":r="mdi-information";break;case"danger":r="mdi-alert";break}let o=document.createElement("div");o.setAttribute("class","toast-container position-fixed bottom-0 end-0 m-3");let s=document.createElement("div");s.setAttribute("class",`toast bg-${n}`),s.setAttribute("role","alert"),s.setAttribute("aria-live","assertive"),s.setAttribute("aria-atomic","true");let a=document.createElement("div");a.setAttribute("class",`toast-header bg-${n} text-body`);let l=document.createElement("i");l.setAttribute("class",`mdi ${r}`);let c=document.createElement("strong");c.setAttribute("class","me-auto ms-1"),c.innerText=e;let u=document.createElement("button");u.setAttribute("type","button"),u.setAttribute("class","btn-close"),u.setAttribute("data-bs-dismiss","toast"),u.setAttribute("aria-label","Close");let d=document.createElement("div");if(d.setAttribute("class","toast-body"),a.appendChild(l),a.appendChild(c),typeof i!="undefined"){let y=document.createElement("small");y.setAttribute("class","text-muted"),a.appendChild(y)}return a.appendChild(u),d.innerText=t.trim(),s.appendChild(a),s.appendChild(d),o.appendChild(s),document.body.appendChild(o),new pt(s)}function Og(){let{hash:n}=location;if(n&&n.match(/^#tab_.+$/)){let e=n.replace("tab_","");for(let t of k(`ul.nav.nav-tabs .nav-link[data-bs-target="${e}"]`))new Qt(t).show()}}function Lg(){let n=document.querySelectorAll(".sidebar .accordion-item");function e(t){for(let i of n)i!==t?i.classList.remove("is-open"):i.classList.toggle("is-open")}for(let t of n)for(let i of t.querySelectorAll(".accordion-button"))i.addEventListener("click",()=>{e(t)})}function Mg(){var n;for(let e of k("a.image-preview")){let t=(n=e.dataset.previewUrl)!=null?n:e.href,i=Uo("img",{src:t});i.loading="lazy",i.decoding="async";let r=Uo("div",null,null,[i]);new An(e,{customClass:"image-preview-popover",trigger:"hover",html:!0,content:r})}}function yr(){for(let n of[Ag,Dg,Og,Mg,Lg])n()}function Fl(n){let e=n.currentTarget,t=document.getElementById("quicksearch_clear");ye(t)&&(e.value===""?t.classList.add("invisible"):t.classList.remove("invisible"))}function $l(){let n=document.getElementById("export_current_view"),e=n==null?void 0:n.href.split("&")[0];n.setAttribute("href",e)}function Ng(n){let e=n.currentTarget;if($l(),e!=null){let t=document.getElementById("export_current_view"),i=new URLSearchParams;i.set("q",e.value);let r=i.toString(),o=(t==null?void 0:t.href)+"&"+r;t.setAttribute("href",o)}}function Bl(){let n=document.getElementById("quicksearch"),e=document.getElementById("quicksearch_clear");ye(n)&&(n.addEventListener("keyup",Fl,{passive:!0}),n.addEventListener("search",Fl,{passive:!0}),n.addEventListener("change",Ng,{passive:!0}),ye(e)&&e.addEventListener("click",()=>Ze(null,null,function*(){let t=new Event("search");n.value="",yield new Promise(i=>setTimeout(i,100)),n.dispatchEvent(t),$l()}),{passive:!0}))}function kg(n,e){let t=`
`}function Vl(){for(let n of k("select:not(.tomselected):not(.no-ts):not([size]):not(.api-select):not(.color-select)"))new vt(n,oe(O({},nn(n)),{maxOptions:void 0,render:{option:kg}}))}function zl(){function n(e,t){return`
${t(e.text)}
`}for(let e of k("select.color-select:not(.tomselected)"))new vt(e,oe(O({},nn(e)),{maxOptions:void 0,render:{option:n,item:n}}))}var ql=(n,e)=>{if(Array.isArray(n))n.forEach(e);else for(var t in n)n.hasOwnProperty(t)&&e(n[t],t)};var jl=(n,...e)=>{var t=Ul(e);n=Yl(n),n.map(i=>{t.map(r=>{i.classList.add(r)})})},Wl=(n,...e)=>{var t=Ul(e);n=Yl(n),n.map(i=>{t.map(r=>{i.classList.remove(r)})})},Ul=n=>{var e=[];return ql(n,t=>{typeof t=="string"&&(t=t.trim().split(/[\t\n\f\r\s]/)),Array.isArray(t)&&(e=e.concat(t))}),e.filter(Boolean)},Yl=n=>(Array.isArray(n)||(n=[n]),n);var ts={};_s(ts,{exclude:()=>Wg,extract:()=>Zo,parse:()=>es,parseUrl:()=>ic,pick:()=>Jo,stringify:()=>nc,stringifyUrl:()=>rc});var Hg="%[a-f0-9]{2}",Gl=new RegExp(`(${Hg})+`,"gi"),Rg=/^[a-f\d]{2}$/i;function Kl(n,e){if(n.codePointAt(e)!==37||e+3>n.length)return;let t=n.slice(e+1,e+3);if(Rg.test(t))return{byte:Number.parseInt(t,16),next:e+3}}function Ig(n){return n<=127?1:n>=194&&n<=223?2:n>=224&&n<=239?3:n>=240&&n<=244?4:0}function Pg(n){return n>=128&&n<=191}function Fg(n){try{return decodeURIComponent(n)}catch(e){let t="",i=0;for(;in==null,Vg=n=>encodeURIComponent(n).replaceAll(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Qo=Symbol("encodeFragmentIdentifier");function zg(n){switch(n.arrayFormat){case"index":return e=>(t,i)=>{let r=t.length;return i===void 0||n.skipNull&&i===null||n.skipEmptyString&&i===""?t:i===null?(t.push([Ee(e,n),"[",r,"]"].join("")),t):(t.push([Ee(e,n),"[",Ee(r,n),"]=",Ee(i,n)].join("")),t)};case"bracket":return e=>(t,i)=>i===void 0||n.skipNull&&i===null||n.skipEmptyString&&i===""?t:i===null?(t.push([Ee(e,n),"[]"].join("")),t):(t.push([Ee(e,n),"[]=",Ee(i,n)].join("")),t);case"colon-list-separator":return e=>(t,i)=>i===void 0||n.skipNull&&i===null||n.skipEmptyString&&i===""?t:i===null?(t.push([Ee(e,n),":list="].join("")),t):(t.push([Ee(e,n),":list=",Ee(i,n)].join("")),t);case"comma":case"separator":case"bracket-separator":{let e=n.arrayFormat==="bracket-separator"?"[]=":"=";return t=>(i,r)=>r===void 0||n.skipNull&&r===null||n.skipEmptyString&&r===""?i:(r=r===null?"":r,i.length===0?(i.push([Ee(t,n),e,Ee(r,n)].join("")),i):(i.push(Ee(r,n)),i))}default:return e=>(t,i)=>i===void 0||n.skipNull&&i===null||n.skipEmptyString&&i===""?t:i===null?(t.push(Ee(e,n)),t):(t.push([Ee(e,n),"=",Ee(i,n)].join("")),t)}}function qg(n){let e;switch(n.arrayFormat){case"index":return(t,i,r)=>{if(e=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),!e){r[t]=i;return}r[t]===void 0&&(r[t]={}),r[t][e[1]]=i};case"bracket":return(t,i,r)=>{if(e=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),!e){r[t]=i;return}if(r[t]===void 0){r[t]=[i];return}if(!Array.isArray(r[t])){r[t]=[r[t],i];return}r[t].push(i)};case"colon-list-separator":return(t,i,r)=>{if(e=/(:list)$/.exec(t),t=t.replace(/:list$/,""),!e){r[t]=i;return}if(r[t]===void 0){r[t]=[i];return}if(!Array.isArray(r[t])){r[t]=[r[t],i];return}r[t].push(i)};case"comma":case"separator":return(t,i,r)=>{let s=typeof i=="string"&&i.includes(n.arrayFormatSeparator)?i.split(n.arrayFormatSeparator).map(a=>on(a,n)):i===null?i:on(i,n);r[t]=s};case"bracket-separator":return(t,i,r)=>{let o=/(\[])$/.test(t);if(t=t.replace(/\[]$/,""),!o){r[t]=i&&on(i,n);return}let s=i===null?[]:on(i,n).split(n.arrayFormatSeparator);if(r[t]===void 0){r[t]=s;return}Array.isArray(r[t])||(r[t]=[r[t]]);for(let a of s)r[t].push(a)};default:return(t,i,r)=>{if(r[t]===void 0){r[t]=i;return}if(Array.isArray(r[t])){r[t].push(i);return}r[t]=[r[t],i]}}}function Jl(n){if(typeof n!="string"||n.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function Ee(n,e){return e.encode?e.strict?Vg(n):encodeURIComponent(n):n}function on(n,e){return e.decode?Xo(n):n}function Zl(n){return Array.isArray(n)?n.sort():typeof n=="object"?Zl(Object.keys(n)).sort((e,t)=>Number(e)-Number(t)).map(e=>n[e]):n}function ec(n){let e=n.indexOf("#");return e!==-1&&(n=n.slice(0,e)),n}function jg(n){let e="",t=n.indexOf("#");return t!==-1&&(e=n.slice(t)),e}function tc(n){let e=n.indexOf("?");return e===-1?n:n.slice(0,e)}function Ql(n,e,t){return t==="string"&&typeof n=="string"?n:typeof t=="function"&&typeof n=="string"?t(n):t==="boolean"&&n===null?!0:t==="boolean"&&n!==null&&(n.toLowerCase()==="true"||n.toLowerCase()==="false")?n.toLowerCase()==="true":t==="boolean"&&n!==null&&(n.toLowerCase()==="1"||n.toLowerCase()==="0")?n.toLowerCase()==="1":t==="string[]"&&e.arrayFormat!=="none"&&typeof n=="string"?[n]:t==="number[]"&&e.arrayFormat!=="none"&&!Number.isNaN(Number(n))&&typeof n=="string"&&n.trim()!==""?[Number(n)]:t==="number"&&!Number.isNaN(Number(n))&&typeof n=="string"&&n.trim()!==""?Number(n):e.parseBooleans&&n!==null&&(n.toLowerCase()==="true"||n.toLowerCase()==="false")?n.toLowerCase()==="true":e.parseNumbers&&!Number.isNaN(Number(n))&&typeof n=="string"&&n.trim()!==""?Number(n):n}function Zo(n){n=ec(n);let e=n.indexOf("?");return e===-1?"":n.slice(e+1)}function es(n,e){e=O({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null)},e),Jl(e.arrayFormatSeparator);let t=qg(e),i=Object.create(null);if(typeof n!="string"||(n=n.trim().replace(/^[?#&]/,""),!n)||/^&+$/.test(n))return i;let r=0,o=n.indexOf("&");o===-1&&(o=n.length);for(let s=o;s<=n.length;s++){if(s{let l=i[a];return s[a]=l&&typeof l=="object"&&!Array.isArray(l)?Zl(l):l,s},Object.create(null))}function nc(n,e){if(!n)return"";e=O({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e),Jl(e.arrayFormatSeparator);let t=s=>e.skipNull&&Bg(n[s])||e.skipEmptyString&&n[s]==="",i=zg(e),r={};for(let[s,a]of Object.entries(n))t(s)||(r[s]=a);let o=Object.keys(r);return e.sort!==!1&&o.sort(e.sort),o.map(s=>{let a=n[s];if(e.replacer&&(a=e.replacer(s,a),a===void 0)||a===void 0)return"";if(a===null)return Ee(s,e);if(Array.isArray(a)){if(a.length===0&&e.arrayFormat==="bracket-separator")return Ee(s,e)+"[]";let l=a;e.replacer&&(l=a.map((d,p)=>e.replacer(`${s}[${p}]`,d)).filter(d=>d!==void 0));let c=l.reduce(i(s),[]),u=["comma","separator","bracket-separator"].includes(e.arrayFormat)?e.arrayFormatSeparator:"&";return c.join(u)}return Ee(s,e)+"="+Ee(a,e)}).filter(s=>s.length>0).join("&")}function ic(n,e){e=O({decode:!0},e);let[t,i]=Er(n,"#");return t===void 0&&(t=n),O({url:tc(t!=null?t:""),query:es(Zo(n),e)},e&&e.parseFragmentIdentifier&&i?{fragmentIdentifier:on(i,e)}:{})}function rc(n,e){e=O({encode:!0,strict:!0,[Qo]:!0},e);let t=tc(ec(n.url))||"",i=Zo(n.url),r=O(O({},es(i,O({sort:!1},e))),n.query),o=nc(r,e);o&&(o=`?${o}`);let s=jg(n.url);if(typeof n.fragmentIdentifier=="string"&&(s=`#${n.fragmentIdentifier}`,e[Qo])){let a=new URL("https://query-string.invalid");a.hash=s,s=a.hash}return`${t}${o}${s}`}function Jo(n,e,t){t=O({parseFragmentIdentifier:!0,[Qo]:!1},t);let{url:i,query:r,fragmentIdentifier:o}=ic(n,t);return rc({url:i,query:Xl(r,e),fragmentIdentifier:o},t)}function Wg(n,e,t){if(Array.isArray(e)){let i=new Set(e);return Jo(n,r=>!i.has(r),t)}return Jo(n,(i,r)=>!e(i,r),t)}var oc=ts;function sc(n){if(Array.isArray(n)){for(let e of n)if(typeof e=="object"&&e!==null&&"fieldName"in e&&"queryParam"in e)return typeof e.fieldName=="string"&&typeof e.queryParam=="string"}return!1}var br=class extends Map{queryParam(e){let t=this.get(e);return typeof t!="undefined"?t.queryParam:null}queryValue(e){let t=this.get(e);return typeof t!="undefined"?t.queryValue:[]}updateValue(e,t){let i=this.get(e);if(ye(i)){let{queryParam:r}=i;return this.set(e,{queryParam:r,queryValue:t}),!0}return!1}addFromJson(e){if(ye(e)){let t=JSON.parse(e);if(sc(t))for(let{queryParam:i,fieldName:r}of t)this.set(r,{queryParam:i,queryValue:[]});else throw new Error(`Data from 'data-dynamic-params' attribute is improperly formatted: '${e}'`)}}};var _r=class extends vt{constructor(t,i){super(t,i);ae(this,"nullOption",null);ae(this,"api_url",null);ae(this,"queryParams",new Map);ae(this,"staticParams",new Map);ae(this,"dynamicParams",new br);ae(this,"pathValues",new Map);ae(this,"loadSequence",0);ae(this,"pendingRestoreValue");this.api_url=this.input.getAttribute("data-url"),this.valueField=this.input.getAttribute("ts-value-field")||this.settings.valueField,this.labelField=this.input.getAttribute("ts-label-field")||this.settings.labelField,this.disabledField=this.input.getAttribute("ts-disabled-field")||this.settings.disabledField,this.descriptionField=this.input.getAttribute("ts-description-field")||"description",this.depthField=this.input.getAttribute("ts-depth-field")||"_depth",this.parentField=this.input.getAttribute("ts-parent-field")||null,this.countField=this.input.getAttribute("ts-count-field")||null;let r=this.input.getAttribute("data-null-option");if(r){let o=this.settings.valueField,s=this.settings.labelField;this.nullOption={},this.nullOption[o]="null",this.nullOption[s]=r}this.getStaticParams();for(let[o,s]of this.staticParams.entries())this.queryParams.set(o,s);this.getDynamicParams();for(let o of this.dynamicParams.keys())this.updateQueryParams(o);this.getPathKeys();for(let o of this.pathValues.keys())this.updatePathValues(o);this.addEventListeners()}load(t,i){let r=this;r.loadSequence+=1;let o=r.loadSequence;if((Array.isArray(i)?i.length>0:i!==void 0)&&(r.pendingRestoreValue=i),!r.api_url){r.pendingRestoreValue=void 0;return}r.clearOptions(),r.nullOption&&!t&&r.addOption(r.nullOption);let a=r.getRequestUrl(t);if(!a){r.pendingRestoreValue=void 0;return}jl(r.wrapper,r.settings.loadingClass),r.loading++,fetch(a).then(l=>l.json()).then(l=>{let c=l.results,u=[];for(let d of c){let p=r.getOptionFromData(d);u.push(p)}return u}).then(l=>{if(o!==r.loadSequence){r.finalizeStaleLoad();return}if(r.loadCallback(l,[]),r.pendingRestoreValue!==void 0){let u=(Array.isArray(r.pendingRestoreValue)?r.pendingRestoreValue:[r.pendingRestoreValue]).filter(d=>d!==""&&d in r.options);u.length>0&&r.setValue(u.length===1?u[0]:u,!0),r.pendingRestoreValue=void 0}}).catch(()=>{if(o!==r.loadSequence){r.finalizeStaleLoad();return}r.pendingRestoreValue=void 0,r.loadCallback([],[])})}finalizeStaleLoad(){this.loading=Math.max(this.loading-1,0),this.loading||(Wl(this.wrapper,this.settings.loadingClass),this.refreshOptions(!1))}getRequestUrl(t){if(!this.api_url)return"";let i=this.api_url,r=i,o={};for(let[s,a]of this.queryParams.entries())o[s]=a;for(let[s,a]of this.pathValues.entries())for(let l of i.matchAll(new RegExp(`({{${s}}})`,"g")))if(a)r=Yo(r,l[1],a.toString());else return"";return t&&(o.q=[t]),o.brief=[!0],o.limit=[this.settings.maxOptions],oc.stringifyUrl({url:r,query:o})}getOptionFromData(t){let i={id:t[this.valueField],display:t[this.labelField],depth:t[this.depthField]||null,description:t[this.descriptionField]||null};if(t[this.parentField]){let r=t[this.parentField];i.parent=r[this.labelField]}return t[this.countField]&&(i.count=t[this.countField]),t[this.disabledField]&&(i.disabled=t[this.disabledField]),i}getStaticParams(){let t=this.input.getAttribute("data-static-params");try{if(t){let i=JSON.parse(t);if(i)for(let{queryParam:r,queryValue:o}of i)Array.isArray(o)?this.staticParams.set(r,o):this.staticParams.set(r,[o])}}catch(i){console.group(`Unable to determine static query parameters for select field '${this.name}'`),console.warn(i),console.groupEnd()}}getDynamicParams(){let t=this.input.getAttribute("data-dynamic-params");try{this.dynamicParams.addFromJson(t)}catch(i){console.group(`Unable to determine dynamic query parameters for select field '${this.name}'`),console.warn(i),console.groupEnd()}}getPathKeys(){if(this.api_url)for(let t of this.api_url.matchAll(new RegExp("{{(.+)}}","g")))this.pathValues.set(t[1],"")}updateQueryParams(t){let i=document.querySelector(`[name="${t}"]`);if(i!==null){let r=[];if(i.multiple?r=Array.from(i.options).filter(o=>o.selected).map(o=>o.value):i.value!==""&&(r=[i.value]),r.length>0){this.dynamicParams.updateValue(t,r);let o=this.dynamicParams.get(t);if(typeof o!="undefined"){let{queryParam:s,queryValue:a}=o,l=[];if(this.staticParams.has(s)){let c=this.staticParams.get(s);typeof c!="undefined"&&(l=[...c,...a])}else l=a;l.length>0?this.queryParams.set(s,l):this.queryParams.delete(s)}}else{let o=this.dynamicParams.queryParam(t);o!==null&&this.queryParams.delete(o)}}}updatePathValues(t){if(!this.api_url)return;let i=this.api_url,r=Yo(t,/^id_/i,""),o=tn(`id_${r}`);o!==null&&i.includes("{{")&&i.match(new RegExp(`({{(${t})}})`,"g"))&&(o.value?this.pathValues.set(t,o.value):this.pathValues.set(t,""))}addEventListeners(){let t=new Set([...this.dynamicParams.keys(),...this.pathValues.keys()]);for(let i of t){let r=document.querySelector(`[name="${i}"]`);r!==null&&r.addEventListener("change",o=>this.handleEvent(o)),this.input.addEventListener(`netbox.select.onload.${i}`,o=>this.handleEvent(o))}}handleEvent(t){let i=t.target,r=this.getValue();this.updateQueryParams(i.name),this.updatePathValues(i.name),this.clear();let o=r!==""&&r!==null?r:void 0;this.load(this.lastValue,o)}};var Ug="id",wr="display",Yg=100;function Gg(n,e){let t="