From 7c0bf4f137575ed165843b0fc7ef7582529297a4 Mon Sep 17 00:00:00 2001 From: Donald Zou Date: Thu, 3 Oct 2024 15:24:50 +0800 Subject: [PATCH] Fixed #357: Brought back IP Address and Port But still manually restart WGDashboard is needed --- src/dashboard.py | 2 + src/static/app/dist/assets/index.css | 2 +- src/static/app/dist/assets/index.js | 44 +++---- .../accountSettingsInputUsername.vue | 3 +- .../dashboardIPPortInput.vue | 116 ++++++++++++++++++ .../settingsComponent/dashboardLanguage.vue | 5 +- src/static/app/src/views/settings.vue | 18 ++- src/static/css/dashboard.css | 6 + src/static/locale/de.json | 1 + src/static/locale/ru.json | 1 + src/static/locale/uk.json | 1 + src/static/locale/zh-CN.json | 6 +- src/static/locale/zh-HK.json | 5 +- 13 files changed, 179 insertions(+), 31 deletions(-) create mode 100644 src/static/app/src/components/settingsComponent/dashboardIPPortInput.vue diff --git a/src/dashboard.py b/src/dashboard.py index d6be2b9..5d36e25 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -1228,6 +1228,8 @@ class DashboardConfig: self.__config[section][key] = "true" else: self.__config[section][key] = "false" + if type(value) in [int, float]: + self.__config[section][key] = str(value) else: self.__config[section][key] = value return self.SaveConfig(), "" diff --git a/src/static/app/dist/assets/index.css b/src/static/app/dist/assets/index.css index e4594b8..0357bb8 100644 --- a/src/static/app/dist/assets/index.css +++ b/src/static/app/dist/assets/index.css @@ -1,4 +1,4 @@ -@charset "UTF-8";*{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol}.dp__input{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol!important}::-webkit-scrollbar{display:none}.codeFont{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.feather{width:16px;height:16px;vertical-align:text-bottom}.btn-primary{font-weight:700}@property --brandColor1{syntax: ""; initial-value: #009dff; inherits: false;}@property --brandColor2{syntax: ""; initial-value: #ff4a00; inherits: false;}@property --distance2{syntax: ""; initial-value: 0%; inherits: false;}@property --degree{syntax: ""; initial-value: 234deg; inherits: false;}.dashboardLogo{background:#178bff;background:linear-gradient(234deg,var(--brandColor1) var(--distance2),var(--brandColor2) 100%);-webkit-background-clip:text;-webkit-text-fill-color:transparent;transition:--brandColor1 1s,--brandColor2 .3s,--distance2 1s!important}.btn-brand{background:linear-gradient(var(--degree),var(--brandColor1) var(--distance2),var(--brandColor2) 100%);border:0!important;transition:--brandColor1 1s,--brandColor2 1s,--distance2 .5s!important}.btn-brand.loading{animation:spin infinite forwards 3s linear}.btn-brand:hover,.dashboardLogo:hover{--brandColor1: #009dff;--brandColor2: #ff875b;--distance2: 30%}.signInBtn.signedIn{--distance2: 100%}@keyframes spin{0%{--degree: 234deg}to{--degree: 594deg}}[data-bs-theme=dark].main,#app:has(.main[data-bs-theme=dark]),[data-bs-theme=dark].navbar-container{background-color:#1b1e21}.sidebar .nav-link,.bottomNavContainer .nav-link{font-weight:500;color:#333;transition:.2s cubic-bezier(.82,-.07,0,1.01)}[data-bs-theme=dark] .sidebar .nav-link{color:#fff}[data-bs-theme=dark] .sidebar .nav-link.active{color:#74b7ff}[data-bs-theme=dark] .nav-link:hover{background-color:#323844}.nav-link:hover{background-color:#e8e8e8}.sidebar .nav-link .feather{margin-right:4px;color:#999}.sidebar .nav-link.active,.bottomNavContainer .nav-link.active{color:#007bff}.sidebar .nav-link:hover .feather,.sidebar .nav-link.active .feather{color:inherit}.sidebar-heading{font-size:.75rem;text-transform:uppercase}.navbar-brand{padding-top:.75rem;padding-bottom:.75rem;font-size:1rem}.navbar .navbar-toggler{top:.25rem;right:1rem}.form-control{transition:all .2s ease-in-out}.form-control:disabled{cursor:not-allowed}.navbar .form-control{padding:.75rem 1rem;border-width:0;border-radius:0}.form-control-dark{color:#fff;background-color:#ffffff1a;border-color:#ffffff1a}.form-control-dark:focus{border-color:transparent;box-shadow:0 0 0 3px #ffffff40}.dot{width:10px;height:10px;border-radius:50px;display:inline-block;margin-left:auto!important;background-color:#6c757d}.dot.active{background-color:#28a745!important;box-shadow:0 0 0 .2rem #28a74545}.h6-dot-running{margin-left:.3rem}.card-running{border-color:#28a745}.info h6{line-break:anywhere;transition:all .4s cubic-bezier(.96,-.07,.34,1.01);opacity:1}.info .row .col-sm{display:flex;flex-direction:column}.info .row .col-sm small{display:flex}.info .row .col-sm small strong:last-child(1){margin-left:auto!important}.btn-control{border:none!important;padding:0;margin:0 1rem 0 0}.btn-control:hover{background-color:transparent!important}.btn-control:active,.btn-control:focus{background-color:transparent!important;border:none!important;box-shadow:none}.btn-qrcode-peer{padding:0!important}.btn-qrcode-peer:active,.btn-qrcode-peer:hover{transform:scale(.9) rotate(180deg);border:0!important}.btn-download-peer:active,.btn-download-peer:hover{color:#17a2b8!important;transform:translateY(5px)}.share_peer_btn_group .btn-control{margin:0 0 0 1rem;padding:0!important;transition:all .4s cubic-bezier(1,-.43,0,1.37)}.btn-control:hover{background:#fff}.btn-delete-peer:hover{color:#dc3545}.btn-lock-peer:hover{color:#28a745}.btn-lock-peer.lock,.btn-lock-peer.lock:hover{color:#6c757d}.btn-control.btn-outline-primary:hover{color:#007bff}.btn-download-peer:hover{color:#17a2b8}.login-container{padding:2rem}@media (max-width: 992px){.card-col{margin-bottom:1rem}}.switch{font-size:2rem}.switch:hover{text-decoration:none}.btn-group-label:hover{color:#007bff;border-color:#007bff;background:#fff}.peer_data_group{text-align:right;display:flex;margin-bottom:.5rem}.peer_data_group p{text-transform:uppercase;margin-bottom:0;margin-right:1rem}@media (max-width: 768px){.peer_data_group{text-align:left}}.index-switch{display:flex;align-items:center;justify-content:flex-end}main{margin-bottom:3rem}.peer_list{margin-bottom:7rem}@media (max-width: 768px){.add_btn{bottom:1.5rem!important}.peer_list{margin-bottom:7rem!important}}.btn-manage-group{z-index:99;position:fixed;bottom:3rem;right:2rem;display:flex}.btn-manage-group .setting_btn_menu{position:absolute;top:-124px;background-color:#fff;padding:1rem 0;right:0;box-shadow:0 10px 20px #00000030,0 6px 6px #0000003b;border-radius:10px;min-width:250px;display:none;transform:translateY(-30px);opacity:0;transition:all .3s cubic-bezier(.58,.03,.05,1.28)}.btn-manage-group .setting_btn_menu.show{display:block}.setting_btn_menu.showing{transform:translateY(0);opacity:1}.setting_btn_menu a{display:flex;padding:.5rem 1rem;transition:all .1s ease-in-out;font-size:1rem;align-items:center;cursor:pointer}.setting_btn_menu a:hover{background-color:#efefef;text-decoration:none}.setting_btn_menu a i{margin-right:auto!important}.add_btn{height:54px;z-index:99;border-radius:100px!important;padding:0 14px;box-shadow:0 10px 20px #00000030,0 6px 6px #0000003b;margin-right:1rem;font-size:1.5rem}.setting_btn{height:54px;z-index:99;border-radius:100px!important;padding:0 14px;box-shadow:0 10px 20px #00000030,0 6px 6px #0000003b;font-size:1.5rem}@-webkit-keyframes rotating{0%{-webkit-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotating{0%{-ms-transform:rotate(0deg);-moz-transform:rotate(0deg);-webkit-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0)}to{-ms-transform:rotate(360deg);-moz-transform:rotate(360deg);-webkit-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}.rotating:before{-webkit-animation:rotating .75s linear infinite;-moz-animation:rotating .75s linear infinite;-ms-animation:rotating .75s linear infinite;-o-animation:rotating .75s linear infinite;animation:rotating .75s linear infinite}.peer_private_key_textbox_switch{position:absolute;right:2rem;transform:translateY(-28px);font-size:1.2rem;cursor:pointer}#peer_private_key_textbox,#private_key,#public_key,#peer_preshared_key_textbox{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.progress-bar{transition:.3s ease-in-out}.key{transition:.2s ease-in-out;cursor:pointer}.key:hover{color:#007bff}.card{border-radius:10px}.peer_list .card .button-group{height:22px}.form-control{border-radius:10px}.btn{border-radius:8px}.login-box #username,.login-box #password,.login-box #totp{padding:.6rem calc(.9rem + 32px);height:inherit}.login-box label[for=username],.login-box label[for=password],.login-box label[for=totp]{font-size:1rem;margin:0!important;transform:translateY(2.1rem) translate(1rem);padding:0}.modal-content{border-radius:10px}.tooltip-inner{font-size:.8rem}@-webkit-keyframes loading{0%{background-color:#dfdfdf}50%{background-color:#adadad}to{background-color:#dfdfdf}}@-moz-keyframes loading{0%{background-color:#dfdfdf}50%{background-color:#adadad}to{background-color:#dfdfdf}}.conf_card{transition:.2s ease-in-out}.conf_card:hover{border-color:#007bff}.info_loading{height:19.19px;opacity:0!important}#conf_status_btn{transition:.2s ease-in-out}#conf_status_btn.info_loading{height:38px;border-radius:5px;animation:loading 3s infinite ease-in-out}#qrcode_img img{width:100%}#selected_ip_list .badge,#selected_peer_list .badge{margin:.1rem}#add_modal.ip_modal_open{transition:filter .2s ease-in-out;filter:brightness(.5)}#delete_bulk_modal .list-group a.active{background-color:#dc3545;border-color:#dc3545}#selected_peer_list{max-height:80px;overflow-y:scroll;overflow-x:hidden}.no-response{width:100%;height:100%;position:fixed;background:#000000ba;z-index:10000;display:none;flex-direction:column;align-items:center;justify-content:center;opacity:0;transition:all 1s ease-in-out}.no-response.active{display:flex}.no-response.active.show{opacity:100}.no-response .container>*{text-align:center}.no-responding{transition:all 1s ease-in-out;filter:blur(10px)}pre.index-alert{margin-bottom:0;padding:1rem;background-color:#343a40;border:1px solid rgba(0,0,0,.125);border-radius:.25rem;margin-top:1rem;color:#fff}.peerNameCol{display:flex;align-items:center;margin-bottom:.2rem}.peerName{margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.peerLightContainer{text-transform:uppercase;margin:0;margin-left:auto!important}#config_body{transition:.3s ease-in-out}#config_body.firstLoading{opacity:.2}.chartTitle{display:flex}.chartControl{margin-bottom:1rem;display:flex;align-items:center}.chartTitle h6{margin-bottom:0;line-height:1;margin-right:.5rem}.chartContainer.fullScreen{position:fixed;z-index:9999;background-color:#fff;top:0;left:0;width:calc(100% + 15px);height:100%;padding:32px}.chartContainer.fullScreen .col-sm{padding-right:0;height:100%}.chartContainer.fullScreen .chartCanvasContainer{width:100%;height:calc(100% - 47px)!important;max-height:calc(100% - 47px)!important}#switch{transition:all .2s ease-in}.toggle--switch{display:none}.toggleLabel{width:64px;height:32px;background-color:#6c757d17;display:flex;position:relative;border:2px solid #6c757d8c;border-radius:100px;transition:all .2s ease-in;cursor:pointer;margin:0}.toggle--switch.waiting+.toggleLabel{opacity:.5}.toggleLabel:before{background-color:#6c757d;height:26px;width:26px;content:"";border-radius:100px;margin:1px;position:absolute;animation-name:off;animation-duration:.35s;animation-fill-mode:forwards;transition:all .2s ease-in;cursor:pointer}.toggleLabel:hover:before{filter:brightness(1.2)}.toggle--switch:checked+.toggleLabel{background-color:#007bff17!important;border:2px solid #007bff8c}.toggle--switch:checked+.toggleLabel:before{background-color:#007bff;animation-name:on;animation-duration:.35s;animation-fill-mode:forwards}@keyframes on{0%{left:0}60%{left:0;width:40px}to{left:32px;width:26px}}@keyframes off{0%{left:32px}60%{left:18px;width:40px}to{left:0;width:26px}}.toastContainer{z-index:99999!important}.toast{min-width:300px;background-color:#fff;z-index:99999}.toast-header{background-color:#fff}.toast-progressbar{width:100%;height:4px;background-color:#007bff;border-bottom-left-radius:.25rem}.addConfigurationAvailableIPs{margin-bottom:0}.input-feedback{display:none}#addConfigurationModal label{display:flex;width:100%;align-items:center}#addConfigurationModal label a{margin-left:auto!important}#reGeneratePrivateKey{border-top-right-radius:10px;border-bottom-right-radius:10px}.addConfigurationToggleStatus.waiting{opacity:.5}.peerDataUsageChartContainer{min-height:50vh;width:100%}.peerDataUsageChartControl{display:block!important;margin:0}.peerDataUsageChartControl .switchUnit{width:33.3%}.peerDataUsageChartControl .switchTimePeriod{width:25%}@media (min-width: 1200px){#peerDataUsage .modal-xl{max-width:95vw}}.bottom{display:none}@media (max-width: 768px){.bottom{display:block}.btn-manage-group{bottom:calc(3rem + 40px + env(safe-area-inset-bottom,5px))}main{padding-bottom:calc(3rem + 40px + env(safe-area-inset-bottom,5px))}}.bottomNavContainer{display:flex;color:#333;padding-bottom:env(safe-area-inset-bottom,5px);box-shadow:inset 0 1px #0000001a}.bottomNavButton{width:25vw;display:flex;flex-direction:column;align-items:center;margin:.7rem 0;color:#33333380;cursor:pointer;transition:all ease-in .2s}.bottomNavButton.active{color:#333}.bottomNavButton i{font-size:1.2rem}.bottomNavButton .subNav{width:100vw;position:absolute;z-index:10000;bottom:0;left:0;background-color:#272b30;display:none;animation-duration:.4s;padding-bottom:env(safe-area-inset-bottom,5px)}.bottomNavButton .subNav.active{display:block}.bottomNavButton .subNav .nav .nav-item .nav-link{padding:.7rem 1rem}.bottomNavWrapper{height:100%;width:100%;background-color:#000000a1;position:fixed;z-index:1030;display:none;left:0}.bottomNavWrapper.active{display:block}.sb-update-url .dot-running{transform:translate(10px)}.list-group-item{transition:all .1s ease-in}.theme-switch-btn{width:100%}.fade-enter-active,.fade-leave-active{transition:all .3s ease-in-out}.fade-enter-from,.fade-leave-to{transform:translateY(30px);opacity:0}.fade2-enter-active,.fade2-leave-active{transition:all .15s ease-in-out}.fade2-enter-from{transform:translate(20px);opacity:0}.fade2-leave-to{transform:translate(-20px);opacity:0}.login-container-fluid{height:calc(100% - 50px)!important}.totp{font-family:var(--bs-font-monospace)}.message-move,.message-enter-active,.message-leave-active{transition:all .5s ease}.message-enter-from,.message-leave-to{filter:blur(2px);opacity:0}.message-enter-from{transform:translateY(-30px) scale(.7)}.message-leave-to{transform:translateY(30px)}.message-leave-active{position:absolute}.fade3-enter-active,.fade3-leave-active{transition:all .15s ease-in-out}.fade3-enter-from{transform:scale(1);opacity:0}.fade3-leave-to{transform:scale(.8);opacity:0}.list-move,.list-enter-active,.list-leave-active{transition:all .5s ease-in-out}.list-enter-from,.list-leave-to{opacity:0;transform:scale(1.1)}.list-leave-active{position:absolute}.peerSettingContainer{background-color:#00000060;z-index:9999;backdrop-filter:blur(1px);-webkit-backdrop-filter:blur(1px)}.dashboardModal{min-height:calc(100% - 3.5rem);width:700px}.dashboardModal>.card{margin:1.75rem}.zoom-enter-active,.zoom-leave-active,.zoomReversed-enter-active,.zoomReversed-leave-active{transition:all .3s cubic-bezier(.82,.58,.17,.9)}.zoom-enter-from,.zoom-leave-to{transform:scale(1.1);filter:blur(3px);opacity:0}.zoomReversed-enter-from,.zoomReversed-leave-to{transform:scale(.9);filter:blur(3px);opacity:0}.messageCentre{z-index:9999}.slide-move,.slide-enter-active,.slide-leave-active{transition:all .4s cubic-bezier(.82,.58,.17,.9)}.slide-leave-active{position:absolute;width:100%}.slide-enter-from{opacity:0;transform:translate(-50px)!important}.slide-leave-to{opacity:0;transform:translate(50px)!important}/*! +@charset "UTF-8";*{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol}.dp__input{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol!important}::-webkit-scrollbar{display:none}.codeFont{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.feather{width:16px;height:16px;vertical-align:text-bottom}.btn-primary{font-weight:700}[data-bs-theme=dark]{hr{border-color:#efefef}}@property --brandColor1{syntax: ""; initial-value: #009dff; inherits: false;}@property --brandColor2{syntax: ""; initial-value: #ff4a00; inherits: false;}@property --distance2{syntax: ""; initial-value: 0%; inherits: false;}@property --degree{syntax: ""; initial-value: 234deg; inherits: false;}.dashboardLogo{background:#178bff;background:linear-gradient(234deg,var(--brandColor1) var(--distance2),var(--brandColor2) 100%);-webkit-background-clip:text;-webkit-text-fill-color:transparent;transition:--brandColor1 1s,--brandColor2 .3s,--distance2 1s!important}.btn-brand{background:linear-gradient(var(--degree),var(--brandColor1) var(--distance2),var(--brandColor2) 100%);border:0!important;transition:--brandColor1 1s,--brandColor2 1s,--distance2 .5s!important}.btn-brand.loading{animation:spin infinite forwards 3s linear}.btn-brand:hover,.dashboardLogo:hover{--brandColor1: #009dff;--brandColor2: #ff875b;--distance2: 30%}.signInBtn.signedIn{--distance2: 100%}@keyframes spin{0%{--degree: 234deg}to{--degree: 594deg}}[data-bs-theme=dark].main,#app:has(.main[data-bs-theme=dark]),[data-bs-theme=dark].navbar-container{background-color:#1b1e21}.sidebar .nav-link,.bottomNavContainer .nav-link{font-weight:500;color:#333;transition:.2s cubic-bezier(.82,-.07,0,1.01)}[data-bs-theme=dark] .sidebar .nav-link{color:#fff}[data-bs-theme=dark] .sidebar .nav-link.active{color:#74b7ff}[data-bs-theme=dark] .nav-link:hover{background-color:#323844}.nav-link:hover{background-color:#e8e8e8}.sidebar .nav-link .feather{margin-right:4px;color:#999}.sidebar .nav-link.active,.bottomNavContainer .nav-link.active{color:#007bff}.sidebar .nav-link:hover .feather,.sidebar .nav-link.active .feather{color:inherit}.sidebar-heading{font-size:.75rem;text-transform:uppercase}.navbar-brand{padding-top:.75rem;padding-bottom:.75rem;font-size:1rem}.navbar .navbar-toggler{top:.25rem;right:1rem}.form-control{transition:all .2s ease-in-out}.form-control:disabled{cursor:not-allowed}.navbar .form-control{padding:.75rem 1rem;border-width:0;border-radius:0}.form-control-dark{color:#fff;background-color:#ffffff1a;border-color:#ffffff1a}.form-control-dark:focus{border-color:transparent;box-shadow:0 0 0 3px #ffffff40}.dot{width:10px;height:10px;border-radius:50px;display:inline-block;margin-left:auto!important;background-color:#6c757d}.dot.active{background-color:#28a745!important;box-shadow:0 0 0 .2rem #28a74545}.h6-dot-running{margin-left:.3rem}.card-running{border-color:#28a745}.info h6{line-break:anywhere;transition:all .4s cubic-bezier(.96,-.07,.34,1.01);opacity:1}.info .row .col-sm{display:flex;flex-direction:column}.info .row .col-sm small{display:flex}.info .row .col-sm small strong:last-child(1){margin-left:auto!important}.btn-control{border:none!important;padding:0;margin:0 1rem 0 0}.btn-control:hover{background-color:transparent!important}.btn-control:active,.btn-control:focus{background-color:transparent!important;border:none!important;box-shadow:none}.btn-qrcode-peer{padding:0!important}.btn-qrcode-peer:active,.btn-qrcode-peer:hover{transform:scale(.9) rotate(180deg);border:0!important}.btn-download-peer:active,.btn-download-peer:hover{color:#17a2b8!important;transform:translateY(5px)}.share_peer_btn_group .btn-control{margin:0 0 0 1rem;padding:0!important;transition:all .4s cubic-bezier(1,-.43,0,1.37)}.btn-control:hover{background:#fff}.btn-delete-peer:hover{color:#dc3545}.btn-lock-peer:hover{color:#28a745}.btn-lock-peer.lock,.btn-lock-peer.lock:hover{color:#6c757d}.btn-control.btn-outline-primary:hover{color:#007bff}.btn-download-peer:hover{color:#17a2b8}.login-container{padding:2rem}@media (max-width: 992px){.card-col{margin-bottom:1rem}}.switch{font-size:2rem}.switch:hover{text-decoration:none}.btn-group-label:hover{color:#007bff;border-color:#007bff;background:#fff}.peer_data_group{text-align:right;display:flex;margin-bottom:.5rem}.peer_data_group p{text-transform:uppercase;margin-bottom:0;margin-right:1rem}@media (max-width: 768px){.peer_data_group{text-align:left}}.index-switch{display:flex;align-items:center;justify-content:flex-end}main{margin-bottom:3rem}.peer_list{margin-bottom:7rem}@media (max-width: 768px){.add_btn{bottom:1.5rem!important}.peer_list{margin-bottom:7rem!important}}.btn-manage-group{z-index:99;position:fixed;bottom:3rem;right:2rem;display:flex}.btn-manage-group .setting_btn_menu{position:absolute;top:-124px;background-color:#fff;padding:1rem 0;right:0;box-shadow:0 10px 20px #00000030,0 6px 6px #0000003b;border-radius:10px;min-width:250px;display:none;transform:translateY(-30px);opacity:0;transition:all .3s cubic-bezier(.58,.03,.05,1.28)}.btn-manage-group .setting_btn_menu.show{display:block}.setting_btn_menu.showing{transform:translateY(0);opacity:1}.setting_btn_menu a{display:flex;padding:.5rem 1rem;transition:all .1s ease-in-out;font-size:1rem;align-items:center;cursor:pointer}.setting_btn_menu a:hover{background-color:#efefef;text-decoration:none}.setting_btn_menu a i{margin-right:auto!important}.add_btn{height:54px;z-index:99;border-radius:100px!important;padding:0 14px;box-shadow:0 10px 20px #00000030,0 6px 6px #0000003b;margin-right:1rem;font-size:1.5rem}.setting_btn{height:54px;z-index:99;border-radius:100px!important;padding:0 14px;box-shadow:0 10px 20px #00000030,0 6px 6px #0000003b;font-size:1.5rem}@-webkit-keyframes rotating{0%{-webkit-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotating{0%{-ms-transform:rotate(0deg);-moz-transform:rotate(0deg);-webkit-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0)}to{-ms-transform:rotate(360deg);-moz-transform:rotate(360deg);-webkit-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}.rotating:before{-webkit-animation:rotating .75s linear infinite;-moz-animation:rotating .75s linear infinite;-ms-animation:rotating .75s linear infinite;-o-animation:rotating .75s linear infinite;animation:rotating .75s linear infinite}.peer_private_key_textbox_switch{position:absolute;right:2rem;transform:translateY(-28px);font-size:1.2rem;cursor:pointer}#peer_private_key_textbox,#private_key,#public_key,#peer_preshared_key_textbox{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.progress-bar{transition:.3s ease-in-out}.key{transition:.2s ease-in-out;cursor:pointer}.key:hover{color:#007bff}.card{border-radius:10px}.peer_list .card .button-group{height:22px}.form-control{border-radius:10px}.btn{border-radius:8px}.login-box #username,.login-box #password,.login-box #totp{padding:.6rem calc(.9rem + 32px);height:inherit}.login-box label[for=username],.login-box label[for=password],.login-box label[for=totp]{font-size:1rem;margin:0!important;transform:translateY(2.1rem) translate(1rem);padding:0}.modal-content{border-radius:10px}.tooltip-inner{font-size:.8rem}@-webkit-keyframes loading{0%{background-color:#dfdfdf}50%{background-color:#adadad}to{background-color:#dfdfdf}}@-moz-keyframes loading{0%{background-color:#dfdfdf}50%{background-color:#adadad}to{background-color:#dfdfdf}}.conf_card{transition:.2s ease-in-out}.conf_card:hover{border-color:#007bff}.info_loading{height:19.19px;opacity:0!important}#conf_status_btn{transition:.2s ease-in-out}#conf_status_btn.info_loading{height:38px;border-radius:5px;animation:loading 3s infinite ease-in-out}#qrcode_img img{width:100%}#selected_ip_list .badge,#selected_peer_list .badge{margin:.1rem}#add_modal.ip_modal_open{transition:filter .2s ease-in-out;filter:brightness(.5)}#delete_bulk_modal .list-group a.active{background-color:#dc3545;border-color:#dc3545}#selected_peer_list{max-height:80px;overflow-y:scroll;overflow-x:hidden}.no-response{width:100%;height:100%;position:fixed;background:#000000ba;z-index:10000;display:none;flex-direction:column;align-items:center;justify-content:center;opacity:0;transition:all 1s ease-in-out}.no-response.active{display:flex}.no-response.active.show{opacity:100}.no-response .container>*{text-align:center}.no-responding{transition:all 1s ease-in-out;filter:blur(10px)}pre.index-alert{margin-bottom:0;padding:1rem;background-color:#343a40;border:1px solid rgba(0,0,0,.125);border-radius:.25rem;margin-top:1rem;color:#fff}.peerNameCol{display:flex;align-items:center;margin-bottom:.2rem}.peerName{margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.peerLightContainer{text-transform:uppercase;margin:0;margin-left:auto!important}#config_body{transition:.3s ease-in-out}#config_body.firstLoading{opacity:.2}.chartTitle{display:flex}.chartControl{margin-bottom:1rem;display:flex;align-items:center}.chartTitle h6{margin-bottom:0;line-height:1;margin-right:.5rem}.chartContainer.fullScreen{position:fixed;z-index:9999;background-color:#fff;top:0;left:0;width:calc(100% + 15px);height:100%;padding:32px}.chartContainer.fullScreen .col-sm{padding-right:0;height:100%}.chartContainer.fullScreen .chartCanvasContainer{width:100%;height:calc(100% - 47px)!important;max-height:calc(100% - 47px)!important}#switch{transition:all .2s ease-in}.toggle--switch{display:none}.toggleLabel{width:64px;height:32px;background-color:#6c757d17;display:flex;position:relative;border:2px solid #6c757d8c;border-radius:100px;transition:all .2s ease-in;cursor:pointer;margin:0}.toggle--switch.waiting+.toggleLabel{opacity:.5}.toggleLabel:before{background-color:#6c757d;height:26px;width:26px;content:"";border-radius:100px;margin:1px;position:absolute;animation-name:off;animation-duration:.35s;animation-fill-mode:forwards;transition:all .2s ease-in;cursor:pointer}.toggleLabel:hover:before{filter:brightness(1.2)}.toggle--switch:checked+.toggleLabel{background-color:#007bff17!important;border:2px solid #007bff8c}.toggle--switch:checked+.toggleLabel:before{background-color:#007bff;animation-name:on;animation-duration:.35s;animation-fill-mode:forwards}@keyframes on{0%{left:0}60%{left:0;width:40px}to{left:32px;width:26px}}@keyframes off{0%{left:32px}60%{left:18px;width:40px}to{left:0;width:26px}}.toastContainer{z-index:99999!important}.toast{min-width:300px;background-color:#fff;z-index:99999}.toast-header{background-color:#fff}.toast-progressbar{width:100%;height:4px;background-color:#007bff;border-bottom-left-radius:.25rem}.addConfigurationAvailableIPs{margin-bottom:0}.input-feedback{display:none}#addConfigurationModal label{display:flex;width:100%;align-items:center}#addConfigurationModal label a{margin-left:auto!important}#reGeneratePrivateKey{border-top-right-radius:10px;border-bottom-right-radius:10px}.addConfigurationToggleStatus.waiting{opacity:.5}.peerDataUsageChartContainer{min-height:50vh;width:100%}.peerDataUsageChartControl{display:block!important;margin:0}.peerDataUsageChartControl .switchUnit{width:33.3%}.peerDataUsageChartControl .switchTimePeriod{width:25%}@media (min-width: 1200px){#peerDataUsage .modal-xl{max-width:95vw}}.bottom{display:none}@media (max-width: 768px){.bottom{display:block}.btn-manage-group{bottom:calc(3rem + 40px + env(safe-area-inset-bottom,5px))}main{padding-bottom:calc(3rem + 40px + env(safe-area-inset-bottom,5px))}}.bottomNavContainer{display:flex;color:#333;padding-bottom:env(safe-area-inset-bottom,5px);box-shadow:inset 0 1px #0000001a}.bottomNavButton{width:25vw;display:flex;flex-direction:column;align-items:center;margin:.7rem 0;color:#33333380;cursor:pointer;transition:all ease-in .2s}.bottomNavButton.active{color:#333}.bottomNavButton i{font-size:1.2rem}.bottomNavButton .subNav{width:100vw;position:absolute;z-index:10000;bottom:0;left:0;background-color:#272b30;display:none;animation-duration:.4s;padding-bottom:env(safe-area-inset-bottom,5px)}.bottomNavButton .subNav.active{display:block}.bottomNavButton .subNav .nav .nav-item .nav-link{padding:.7rem 1rem}.bottomNavWrapper{height:100%;width:100%;background-color:#000000a1;position:fixed;z-index:1030;display:none;left:0}.bottomNavWrapper.active{display:block}.sb-update-url .dot-running{transform:translate(10px)}.list-group-item{transition:all .1s ease-in}.theme-switch-btn{width:100%}.fade-enter-active,.fade-leave-active{transition:all .3s ease-in-out}.fade-enter-from,.fade-leave-to{transform:translateY(30px);opacity:0}.fade2-enter-active,.fade2-leave-active{transition:all .15s ease-in-out}.fade2-enter-from{transform:translate(20px);opacity:0}.fade2-leave-to{transform:translate(-20px);opacity:0}.login-container-fluid{height:calc(100% - 50px)!important}.totp{font-family:var(--bs-font-monospace)}.message-move,.message-enter-active,.message-leave-active{transition:all .5s ease}.message-enter-from,.message-leave-to{filter:blur(2px);opacity:0}.message-enter-from{transform:translateY(-30px) scale(.7)}.message-leave-to{transform:translateY(30px)}.message-leave-active{position:absolute}.fade3-enter-active,.fade3-leave-active{transition:all .15s ease-in-out}.fade3-enter-from{transform:scale(1);opacity:0}.fade3-leave-to{transform:scale(.8);opacity:0}.list-move,.list-enter-active,.list-leave-active{transition:all .5s ease-in-out}.list-enter-from,.list-leave-to{opacity:0;transform:scale(1.1)}.list-leave-active{position:absolute}.peerSettingContainer{background-color:#00000060;z-index:9999;backdrop-filter:blur(1px);-webkit-backdrop-filter:blur(1px)}.dashboardModal{min-height:calc(100% - 3.5rem);width:700px}.dashboardModal>.card{margin:1.75rem}.zoom-enter-active,.zoom-leave-active,.zoomReversed-enter-active,.zoomReversed-leave-active{transition:all .3s cubic-bezier(.82,.58,.17,.9)}.zoom-enter-from,.zoom-leave-to{transform:scale(1.1);filter:blur(3px);opacity:0}.zoomReversed-enter-from,.zoomReversed-leave-to{transform:scale(.9);filter:blur(3px);opacity:0}.messageCentre{z-index:9999}.slide-move,.slide-enter-active,.slide-leave-active{transition:all .4s cubic-bezier(.82,.58,.17,.9)}.slide-leave-active{position:absolute;width:100%}.slide-enter-from{opacity:0;transform:translate(-50px)!important}.slide-leave-to{opacity:0;transform:translate(50px)!important}/*! * Bootstrap v5.3.2 (https://getbootstrap.com/) * Copyright 2011-2023 The Bootstrap Authors * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) diff --git a/src/static/app/dist/assets/index.js b/src/static/app/dist/assets/index.js index bbb5490..e6f80e6 100644 --- a/src/static/app/dist/assets/index.js +++ b/src/static/app/dist/assets/index.js @@ -1,12 +1,12 @@ -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(s){if(s.ep)return;s.ep=!0;const r=n(s);fetch(s.href,r)}})();var lx=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function TP(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function kP(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:function(){return t[i]}})}),n}var AP={exports:{}},ei="top",Ai="bottom",Mi="right",ti="left",Gh="auto",Wl=[ei,Ai,Mi,ti],ra="start",dl="end",cx="clippingParents",Nm="viewport",Ya="popper",ux="reference",Mp=Wl.reduce(function(t,e){return t.concat([e+"-"+ra,e+"-"+dl])},[]),Fm=[].concat(Wl,[Gh]).reduce(function(t,e){return t.concat([e,e+"-"+ra,e+"-"+dl])},[]),dx="beforeRead",hx="read",fx="afterRead",gx="beforeMain",px="main",mx="afterMain",_x="beforeWrite",yx="write",vx="afterWrite",bx=[dx,hx,fx,gx,px,mx,_x,yx,vx];function $s(t){return t?(t.nodeName||"").toLowerCase():null}function Ii(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function oa(t){var e=Ii(t).Element;return t instanceof e||t instanceof Element}function Yi(t){var e=Ii(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Bm(t){if(typeof ShadowRoot>"u")return!1;var e=Ii(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function MP(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var i=e.styles[n]||{},s=e.attributes[n]||{},r=e.elements[n];!Yi(r)||!$s(r)||(Object.assign(r.style,i),Object.keys(s).forEach(function(o){var a=s[o];a===!1?r.removeAttribute(o):r.setAttribute(o,a===!0?"":a)}))})}function IP(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(i){var s=e.elements[i],r=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:n[i]),a=o.reduce(function(l,c){return l[c]="",l},{});!Yi(s)||!$s(s)||(Object.assign(s.style,a),Object.keys(r).forEach(function(l){s.removeAttribute(l)}))})}}const Vm={name:"applyStyles",enabled:!0,phase:"write",fn:MP,effect:IP,requires:["computeStyles"]};function Ps(t){return t.split("-")[0]}var Zo=Math.max,lh=Math.min,hl=Math.round;function Ip(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function wx(){return!/^((?!chrome|android).)*safari/i.test(Ip())}function fl(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var i=t.getBoundingClientRect(),s=1,r=1;e&&Yi(t)&&(s=t.offsetWidth>0&&hl(i.width)/t.offsetWidth||1,r=t.offsetHeight>0&&hl(i.height)/t.offsetHeight||1);var o=oa(t)?Ii(t):window,a=o.visualViewport,l=!wx()&&n,c=(i.left+(l&&a?a.offsetLeft:0))/s,u=(i.top+(l&&a?a.offsetTop:0))/r,d=i.width/s,h=i.height/r;return{width:d,height:h,top:u,right:c+d,bottom:u+h,left:c,x:c,y:u}}function zm(t){var e=fl(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function xx(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Bm(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function fr(t){return Ii(t).getComputedStyle(t)}function PP(t){return["table","td","th"].indexOf($s(t))>=0}function ho(t){return((oa(t)?t.ownerDocument:t.document)||window.document).documentElement}function Xh(t){return $s(t)==="html"?t:t.assignedSlot||t.parentNode||(Bm(t)?t.host:null)||ho(t)}function K0(t){return!Yi(t)||fr(t).position==="fixed"?null:t.offsetParent}function RP(t){var e=/firefox/i.test(Ip()),n=/Trident/i.test(Ip());if(n&&Yi(t)){var i=fr(t);if(i.position==="fixed")return null}var s=Xh(t);for(Bm(s)&&(s=s.host);Yi(s)&&["html","body"].indexOf($s(s))<0;){var r=fr(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||e&&r.willChange==="filter"||e&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function Ru(t){for(var e=Ii(t),n=K0(t);n&&PP(n)&&fr(n).position==="static";)n=K0(n);return n&&($s(n)==="html"||$s(n)==="body"&&fr(n).position==="static")?e:n||RP(t)||e}function Wm(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Pc(t,e,n){return Zo(t,lh(e,n))}function DP(t,e,n){var i=Pc(t,e,n);return i>n?n:i}function Ex(){return{top:0,right:0,bottom:0,left:0}}function Sx(t){return Object.assign({},Ex(),t)}function Cx(t,e){return e.reduce(function(n,i){return n[i]=t,n},{})}var $P=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Sx(typeof e!="number"?e:Cx(e,Wl))};function LP(t){var e,n=t.state,i=t.name,s=t.options,r=n.elements.arrow,o=n.modifiersData.popperOffsets,a=Ps(n.placement),l=Wm(a),c=[ti,Mi].indexOf(a)>=0,u=c?"height":"width";if(!(!r||!o)){var d=$P(s.padding,n),h=zm(r),f=l==="y"?ei:ti,p=l==="y"?Ai:Mi,m=n.rects.reference[u]+n.rects.reference[l]-o[l]-n.rects.popper[u],y=o[l]-n.rects.reference[l],v=Ru(r),b=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,E=m/2-y/2,C=d[f],w=b-h[u]-d[p],x=b/2-h[u]/2+E,T=Pc(C,x,w),k=l;n.modifiersData[i]=(e={},e[k]=T,e.centerOffset=T-x,e)}}function OP(t){var e=t.state,n=t.options,i=n.element,s=i===void 0?"[data-popper-arrow]":i;s!=null&&(typeof s=="string"&&(s=e.elements.popper.querySelector(s),!s)||xx(e.elements.popper,s)&&(e.elements.arrow=s))}const Tx={name:"arrow",enabled:!0,phase:"main",fn:LP,effect:OP,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function gl(t){return t.split("-")[1]}var NP={top:"auto",right:"auto",bottom:"auto",left:"auto"};function FP(t,e){var n=t.x,i=t.y,s=e.devicePixelRatio||1;return{x:hl(n*s)/s||0,y:hl(i*s)/s||0}}function U0(t){var e,n=t.popper,i=t.popperRect,s=t.placement,r=t.variation,o=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,d=t.isFixed,h=o.x,f=h===void 0?0:h,p=o.y,m=p===void 0?0:p,y=typeof u=="function"?u({x:f,y:m}):{x:f,y:m};f=y.x,m=y.y;var v=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),E=ti,C=ei,w=window;if(c){var x=Ru(n),T="clientHeight",k="clientWidth";if(x===Ii(n)&&(x=ho(n),fr(x).position!=="static"&&a==="absolute"&&(T="scrollHeight",k="scrollWidth")),x=x,s===ei||(s===ti||s===Mi)&&r===dl){C=Ai;var A=d&&x===w&&w.visualViewport?w.visualViewport.height:x[T];m-=A-i.height,m*=l?1:-1}if(s===ti||(s===ei||s===Ai)&&r===dl){E=Mi;var P=d&&x===w&&w.visualViewport?w.visualViewport.width:x[k];f-=P-i.width,f*=l?1:-1}}var F=Object.assign({position:a},c&&NP),H=u===!0?FP({x:f,y:m},Ii(n)):{x:f,y:m};if(f=H.x,m=H.y,l){var te;return Object.assign({},F,(te={},te[C]=b?"0":"",te[E]=v?"0":"",te.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",te))}return Object.assign({},F,(e={},e[C]=b?m+"px":"",e[E]=v?f+"px":"",e.transform="",e))}function BP(t){var e=t.state,n=t.options,i=n.gpuAcceleration,s=i===void 0?!0:i,r=n.adaptive,o=r===void 0?!0:r,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:Ps(e.placement),variation:gl(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,U0(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,U0(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})}const Hm={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:BP,data:{}};var ud={passive:!0};function VP(t){var e=t.state,n=t.instance,i=t.options,s=i.scroll,r=s===void 0?!0:s,o=i.resize,a=o===void 0?!0:o,l=Ii(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&c.forEach(function(u){u.addEventListener("scroll",n.update,ud)}),a&&l.addEventListener("resize",n.update,ud),function(){r&&c.forEach(function(u){u.removeEventListener("scroll",n.update,ud)}),a&&l.removeEventListener("resize",n.update,ud)}}const Ym={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:VP,data:{}};var zP={left:"right",right:"left",bottom:"top",top:"bottom"};function qd(t){return t.replace(/left|right|bottom|top/g,function(e){return zP[e]})}var WP={start:"end",end:"start"};function G0(t){return t.replace(/start|end/g,function(e){return WP[e]})}function jm(t){var e=Ii(t),n=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:n,scrollTop:i}}function Km(t){return fl(ho(t)).left+jm(t).scrollLeft}function HP(t,e){var n=Ii(t),i=ho(t),s=n.visualViewport,r=i.clientWidth,o=i.clientHeight,a=0,l=0;if(s){r=s.width,o=s.height;var c=wx();(c||!c&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:r,height:o,x:a+Km(t),y:l}}function YP(t){var e,n=ho(t),i=jm(t),s=(e=t.ownerDocument)==null?void 0:e.body,r=Zo(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Zo(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-i.scrollLeft+Km(t),l=-i.scrollTop;return fr(s||n).direction==="rtl"&&(a+=Zo(n.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function Um(t){var e=fr(t),n=e.overflow,i=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+i)}function kx(t){return["html","body","#document"].indexOf($s(t))>=0?t.ownerDocument.body:Yi(t)&&Um(t)?t:kx(Xh(t))}function Rc(t,e){var n;e===void 0&&(e=[]);var i=kx(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),r=Ii(i),o=s?[r].concat(r.visualViewport||[],Um(i)?i:[]):i,a=e.concat(o);return s?a:a.concat(Rc(Xh(o)))}function Pp(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function jP(t,e){var n=fl(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function X0(t,e,n){return e===Nm?Pp(HP(t,n)):oa(e)?jP(e,n):Pp(YP(ho(t)))}function KP(t){var e=Rc(Xh(t)),n=["absolute","fixed"].indexOf(fr(t).position)>=0,i=n&&Yi(t)?Ru(t):t;return oa(i)?e.filter(function(s){return oa(s)&&xx(s,i)&&$s(s)!=="body"}):[]}function UP(t,e,n,i){var s=e==="clippingParents"?KP(t):[].concat(e),r=[].concat(s,[n]),o=r[0],a=r.reduce(function(l,c){var u=X0(t,c,i);return l.top=Zo(u.top,l.top),l.right=lh(u.right,l.right),l.bottom=lh(u.bottom,l.bottom),l.left=Zo(u.left,l.left),l},X0(t,o,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Ax(t){var e=t.reference,n=t.element,i=t.placement,s=i?Ps(i):null,r=i?gl(i):null,o=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(s){case ei:l={x:o,y:e.y-n.height};break;case Ai:l={x:o,y:e.y+e.height};break;case Mi:l={x:e.x+e.width,y:a};break;case ti:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=s?Wm(s):null;if(c!=null){var u=c==="y"?"height":"width";switch(r){case ra:l[c]=l[c]-(e[u]/2-n[u]/2);break;case dl:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function pl(t,e){e===void 0&&(e={});var n=e,i=n.placement,s=i===void 0?t.placement:i,r=n.strategy,o=r===void 0?t.strategy:r,a=n.boundary,l=a===void 0?cx:a,c=n.rootBoundary,u=c===void 0?Nm:c,d=n.elementContext,h=d===void 0?Ya:d,f=n.altBoundary,p=f===void 0?!1:f,m=n.padding,y=m===void 0?0:m,v=Sx(typeof y!="number"?y:Cx(y,Wl)),b=h===Ya?ux:Ya,E=t.rects.popper,C=t.elements[p?b:h],w=UP(oa(C)?C:C.contextElement||ho(t.elements.popper),l,u,o),x=fl(t.elements.reference),T=Ax({reference:x,element:E,strategy:"absolute",placement:s}),k=Pp(Object.assign({},E,T)),A=h===Ya?k:x,P={top:w.top-A.top+v.top,bottom:A.bottom-w.bottom+v.bottom,left:w.left-A.left+v.left,right:A.right-w.right+v.right},F=t.modifiersData.offset;if(h===Ya&&F){var H=F[s];Object.keys(P).forEach(function(te){var N=[Mi,Ai].indexOf(te)>=0?1:-1,L=[ei,Ai].indexOf(te)>=0?"y":"x";P[te]+=H[L]*N})}return P}function GP(t,e){e===void 0&&(e={});var n=e,i=n.placement,s=n.boundary,r=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?Fm:l,u=gl(i),d=u?a?Mp:Mp.filter(function(p){return gl(p)===u}):Wl,h=d.filter(function(p){return c.indexOf(p)>=0});h.length===0&&(h=d);var f=h.reduce(function(p,m){return p[m]=pl(t,{placement:m,boundary:s,rootBoundary:r,padding:o})[Ps(m)],p},{});return Object.keys(f).sort(function(p,m){return f[p]-f[m]})}function XP(t){if(Ps(t)===Gh)return[];var e=qd(t);return[G0(t),e,G0(e)]}function qP(t){var e=t.state,n=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!0:o,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,p=f===void 0?!0:f,m=n.allowedAutoPlacements,y=e.options.placement,v=Ps(y),b=v===y,E=l||(b||!p?[qd(y)]:XP(y)),C=[y].concat(E).reduce(function(M,ie){return M.concat(Ps(ie)===Gh?GP(e,{placement:ie,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}):ie)},[]),w=e.rects.reference,x=e.rects.popper,T=new Map,k=!0,A=C[0],P=0;P=0,L=N?"width":"height",I=pl(e,{placement:F,boundary:u,rootBoundary:d,altBoundary:h,padding:c}),W=N?te?Mi:ti:te?Ai:ei;w[L]>x[L]&&(W=qd(W));var X=qd(W),J=[];if(r&&J.push(I[H]<=0),a&&J.push(I[W]<=0,I[X]<=0),J.every(function(M){return M})){A=F,k=!1;break}T.set(F,J)}if(k)for(var ne=p?3:1,ue=function(ie){var le=C.find(function($){var oe=T.get($);if(oe)return oe.slice(0,ie).every(function(de){return de})});if(le)return A=le,"break"},Y=ne;Y>0;Y--){var Z=ue(Y);if(Z==="break")break}e.placement!==A&&(e.modifiersData[i]._skip=!0,e.placement=A,e.reset=!0)}}const Mx={name:"flip",enabled:!0,phase:"main",fn:qP,requiresIfExists:["offset"],data:{_skip:!1}};function q0(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Z0(t){return[ei,Mi,Ai,ti].some(function(e){return t[e]>=0})}function ZP(t){var e=t.state,n=t.name,i=e.rects.reference,s=e.rects.popper,r=e.modifiersData.preventOverflow,o=pl(e,{elementContext:"reference"}),a=pl(e,{altBoundary:!0}),l=q0(o,i),c=q0(a,s,r),u=Z0(l),d=Z0(c);e.modifiersData[n]={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})}const Ix={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:ZP};function JP(t,e,n){var i=Ps(t),s=[ti,ei].indexOf(i)>=0?-1:1,r=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,o=r[0],a=r[1];return o=o||0,a=(a||0)*s,[ti,Mi].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function QP(t){var e=t.state,n=t.options,i=t.name,s=n.offset,r=s===void 0?[0,0]:s,o=Fm.reduce(function(u,d){return u[d]=JP(d,e.rects,r),u},{}),a=o[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]=o}const Px={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:QP};function e2(t){var e=t.state,n=t.name;e.modifiersData[n]=Ax({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Gm={name:"popperOffsets",enabled:!0,phase:"read",fn:e2,data:{}};function t2(t){return t==="x"?"y":"x"}function n2(t){var e=t.state,n=t.options,i=t.name,s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!1:o,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,h=n.tether,f=h===void 0?!0:h,p=n.tetherOffset,m=p===void 0?0:p,y=pl(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),v=Ps(e.placement),b=gl(e.placement),E=!b,C=Wm(v),w=t2(C),x=e.modifiersData.popperOffsets,T=e.rects.reference,k=e.rects.popper,A=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,P=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),F=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,H={x:0,y:0};if(x){if(r){var te,N=C==="y"?ei:ti,L=C==="y"?Ai:Mi,I=C==="y"?"height":"width",W=x[C],X=W+y[N],J=W-y[L],ne=f?-k[I]/2:0,ue=b===ra?T[I]:k[I],Y=b===ra?-k[I]:-T[I],Z=e.elements.arrow,M=f&&Z?zm(Z):{width:0,height:0},ie=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Ex(),le=ie[N],$=ie[L],oe=Pc(0,T[I],M[I]),de=E?T[I]/2-ne-oe-le-P.mainAxis:ue-oe-le-P.mainAxis,ve=E?-T[I]/2+ne+oe+$+P.mainAxis:Y+oe+$+P.mainAxis,z=e.elements.arrow&&Ru(e.elements.arrow),ge=z?C==="y"?z.clientTop||0:z.clientLeft||0:0,S=(te=F?.[C])!=null?te:0,O=W+de-S-ge,K=W+ve-S,U=Pc(f?lh(X,O):X,W,f?Zo(J,K):J);x[C]=U,H[C]=U-W}if(a){var re,j=C==="x"?ei:ti,se=C==="x"?Ai:Mi,ee=x[w],fe=w==="y"?"height":"width",me=ee+y[j],pe=ee-y[se],Le=[ei,ti].indexOf(v)!==-1,Ae=(re=F?.[w])!=null?re:0,ze=Le?me:ee-T[fe]-k[fe]-Ae+P.altAxis,Be=Le?ee+T[fe]+k[fe]-Ae-P.altAxis:pe,nt=f&&Le?DP(ze,ee,Be):Pc(f?ze:me,ee,f?Be:pe);x[w]=nt,H[w]=nt-ee}e.modifiersData[i]=H}}const Rx={name:"preventOverflow",enabled:!0,phase:"main",fn:n2,requiresIfExists:["offset"]};function i2(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function s2(t){return t===Ii(t)||!Yi(t)?jm(t):i2(t)}function r2(t){var e=t.getBoundingClientRect(),n=hl(e.width)/t.offsetWidth||1,i=hl(e.height)/t.offsetHeight||1;return n!==1||i!==1}function o2(t,e,n){n===void 0&&(n=!1);var i=Yi(e),s=Yi(e)&&r2(e),r=ho(e),o=fl(t,s,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&(($s(e)!=="body"||Um(r))&&(a=s2(e)),Yi(e)?(l=fl(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):r&&(l.x=Km(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function a2(t){var e=new Map,n=new Set,i=[];t.forEach(function(r){e.set(r.name,r)});function s(r){n.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&s(l)}}),i.push(r)}return t.forEach(function(r){n.has(r.name)||s(r)}),i}function l2(t){var e=a2(t);return bx.reduce(function(n,i){return n.concat(e.filter(function(s){return s.phase===i}))},[])}function c2(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function u2(t){var e=t.reduce(function(n,i){var s=n[i.name];return n[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,n},{});return Object.keys(e).map(function(n){return e[n]})}var J0={placement:"bottom",modifiers:[],strategy:"absolute"};function Q0(){for(var t=arguments.length,e=new Array(t),n=0;n{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(s){if(s.ep)return;s.ep=!0;const r=n(s);fetch(s.href,r)}})();var lx=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function TP(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function kP(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:function(){return t[i]}})}),n}var AP={exports:{}},ei="top",Ai="bottom",Mi="right",ti="left",Gh="auto",Wl=[ei,Ai,Mi,ti],ra="start",dl="end",cx="clippingParents",Nm="viewport",Ya="popper",ux="reference",Mp=Wl.reduce(function(t,e){return t.concat([e+"-"+ra,e+"-"+dl])},[]),Fm=[].concat(Wl,[Gh]).reduce(function(t,e){return t.concat([e,e+"-"+ra,e+"-"+dl])},[]),dx="beforeRead",hx="read",fx="afterRead",gx="beforeMain",px="main",mx="afterMain",_x="beforeWrite",yx="write",vx="afterWrite",bx=[dx,hx,fx,gx,px,mx,_x,yx,vx];function $s(t){return t?(t.nodeName||"").toLowerCase():null}function Ii(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function oa(t){var e=Ii(t).Element;return t instanceof e||t instanceof Element}function Yi(t){var e=Ii(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Bm(t){if(typeof ShadowRoot>"u")return!1;var e=Ii(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function MP(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var i=e.styles[n]||{},s=e.attributes[n]||{},r=e.elements[n];!Yi(r)||!$s(r)||(Object.assign(r.style,i),Object.keys(s).forEach(function(o){var a=s[o];a===!1?r.removeAttribute(o):r.setAttribute(o,a===!0?"":a)}))})}function IP(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(i){var s=e.elements[i],r=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:n[i]),a=o.reduce(function(l,c){return l[c]="",l},{});!Yi(s)||!$s(s)||(Object.assign(s.style,a),Object.keys(r).forEach(function(l){s.removeAttribute(l)}))})}}const Vm={name:"applyStyles",enabled:!0,phase:"write",fn:MP,effect:IP,requires:["computeStyles"]};function Ps(t){return t.split("-")[0]}var Zo=Math.max,lh=Math.min,hl=Math.round;function Ip(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function wx(){return!/^((?!chrome|android).)*safari/i.test(Ip())}function fl(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var i=t.getBoundingClientRect(),s=1,r=1;e&&Yi(t)&&(s=t.offsetWidth>0&&hl(i.width)/t.offsetWidth||1,r=t.offsetHeight>0&&hl(i.height)/t.offsetHeight||1);var o=oa(t)?Ii(t):window,a=o.visualViewport,l=!wx()&&n,c=(i.left+(l&&a?a.offsetLeft:0))/s,u=(i.top+(l&&a?a.offsetTop:0))/r,d=i.width/s,h=i.height/r;return{width:d,height:h,top:u,right:c+d,bottom:u+h,left:c,x:c,y:u}}function zm(t){var e=fl(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function xx(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Bm(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function fr(t){return Ii(t).getComputedStyle(t)}function PP(t){return["table","td","th"].indexOf($s(t))>=0}function ho(t){return((oa(t)?t.ownerDocument:t.document)||window.document).documentElement}function Xh(t){return $s(t)==="html"?t:t.assignedSlot||t.parentNode||(Bm(t)?t.host:null)||ho(t)}function K0(t){return!Yi(t)||fr(t).position==="fixed"?null:t.offsetParent}function RP(t){var e=/firefox/i.test(Ip()),n=/Trident/i.test(Ip());if(n&&Yi(t)){var i=fr(t);if(i.position==="fixed")return null}var s=Xh(t);for(Bm(s)&&(s=s.host);Yi(s)&&["html","body"].indexOf($s(s))<0;){var r=fr(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||e&&r.willChange==="filter"||e&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function Ru(t){for(var e=Ii(t),n=K0(t);n&&PP(n)&&fr(n).position==="static";)n=K0(n);return n&&($s(n)==="html"||$s(n)==="body"&&fr(n).position==="static")?e:n||RP(t)||e}function Wm(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Pc(t,e,n){return Zo(t,lh(e,n))}function DP(t,e,n){var i=Pc(t,e,n);return i>n?n:i}function Ex(){return{top:0,right:0,bottom:0,left:0}}function Sx(t){return Object.assign({},Ex(),t)}function Cx(t,e){return e.reduce(function(n,i){return n[i]=t,n},{})}var $P=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Sx(typeof e!="number"?e:Cx(e,Wl))};function LP(t){var e,n=t.state,i=t.name,s=t.options,r=n.elements.arrow,o=n.modifiersData.popperOffsets,a=Ps(n.placement),l=Wm(a),c=[ti,Mi].indexOf(a)>=0,u=c?"height":"width";if(!(!r||!o)){var d=$P(s.padding,n),h=zm(r),f=l==="y"?ei:ti,p=l==="y"?Ai:Mi,m=n.rects.reference[u]+n.rects.reference[l]-o[l]-n.rects.popper[u],y=o[l]-n.rects.reference[l],v=Ru(r),b=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,E=m/2-y/2,C=d[f],w=b-h[u]-d[p],x=b/2-h[u]/2+E,T=Pc(C,x,w),k=l;n.modifiersData[i]=(e={},e[k]=T,e.centerOffset=T-x,e)}}function OP(t){var e=t.state,n=t.options,i=n.element,s=i===void 0?"[data-popper-arrow]":i;s!=null&&(typeof s=="string"&&(s=e.elements.popper.querySelector(s),!s)||xx(e.elements.popper,s)&&(e.elements.arrow=s))}const Tx={name:"arrow",enabled:!0,phase:"main",fn:LP,effect:OP,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function gl(t){return t.split("-")[1]}var NP={top:"auto",right:"auto",bottom:"auto",left:"auto"};function FP(t,e){var n=t.x,i=t.y,s=e.devicePixelRatio||1;return{x:hl(n*s)/s||0,y:hl(i*s)/s||0}}function U0(t){var e,n=t.popper,i=t.popperRect,s=t.placement,r=t.variation,o=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,d=t.isFixed,h=o.x,f=h===void 0?0:h,p=o.y,m=p===void 0?0:p,y=typeof u=="function"?u({x:f,y:m}):{x:f,y:m};f=y.x,m=y.y;var v=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),E=ti,C=ei,w=window;if(c){var x=Ru(n),T="clientHeight",k="clientWidth";if(x===Ii(n)&&(x=ho(n),fr(x).position!=="static"&&a==="absolute"&&(T="scrollHeight",k="scrollWidth")),x=x,s===ei||(s===ti||s===Mi)&&r===dl){C=Ai;var A=d&&x===w&&w.visualViewport?w.visualViewport.height:x[T];m-=A-i.height,m*=l?1:-1}if(s===ti||(s===ei||s===Ai)&&r===dl){E=Mi;var P=d&&x===w&&w.visualViewport?w.visualViewport.width:x[k];f-=P-i.width,f*=l?1:-1}}var F=Object.assign({position:a},c&&NP),H=u===!0?FP({x:f,y:m},Ii(n)):{x:f,y:m};if(f=H.x,m=H.y,l){var te;return Object.assign({},F,(te={},te[C]=b?"0":"",te[E]=v?"0":"",te.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",te))}return Object.assign({},F,(e={},e[C]=b?m+"px":"",e[E]=v?f+"px":"",e.transform="",e))}function BP(t){var e=t.state,n=t.options,i=n.gpuAcceleration,s=i===void 0?!0:i,r=n.adaptive,o=r===void 0?!0:r,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:Ps(e.placement),variation:gl(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,U0(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,U0(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})}const Hm={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:BP,data:{}};var ud={passive:!0};function VP(t){var e=t.state,n=t.instance,i=t.options,s=i.scroll,r=s===void 0?!0:s,o=i.resize,a=o===void 0?!0:o,l=Ii(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&c.forEach(function(u){u.addEventListener("scroll",n.update,ud)}),a&&l.addEventListener("resize",n.update,ud),function(){r&&c.forEach(function(u){u.removeEventListener("scroll",n.update,ud)}),a&&l.removeEventListener("resize",n.update,ud)}}const Ym={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:VP,data:{}};var zP={left:"right",right:"left",bottom:"top",top:"bottom"};function qd(t){return t.replace(/left|right|bottom|top/g,function(e){return zP[e]})}var WP={start:"end",end:"start"};function G0(t){return t.replace(/start|end/g,function(e){return WP[e]})}function jm(t){var e=Ii(t),n=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:n,scrollTop:i}}function Km(t){return fl(ho(t)).left+jm(t).scrollLeft}function HP(t,e){var n=Ii(t),i=ho(t),s=n.visualViewport,r=i.clientWidth,o=i.clientHeight,a=0,l=0;if(s){r=s.width,o=s.height;var c=wx();(c||!c&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:r,height:o,x:a+Km(t),y:l}}function YP(t){var e,n=ho(t),i=jm(t),s=(e=t.ownerDocument)==null?void 0:e.body,r=Zo(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Zo(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-i.scrollLeft+Km(t),l=-i.scrollTop;return fr(s||n).direction==="rtl"&&(a+=Zo(n.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function Um(t){var e=fr(t),n=e.overflow,i=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+i)}function kx(t){return["html","body","#document"].indexOf($s(t))>=0?t.ownerDocument.body:Yi(t)&&Um(t)?t:kx(Xh(t))}function Rc(t,e){var n;e===void 0&&(e=[]);var i=kx(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),r=Ii(i),o=s?[r].concat(r.visualViewport||[],Um(i)?i:[]):i,a=e.concat(o);return s?a:a.concat(Rc(Xh(o)))}function Pp(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function jP(t,e){var n=fl(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function X0(t,e,n){return e===Nm?Pp(HP(t,n)):oa(e)?jP(e,n):Pp(YP(ho(t)))}function KP(t){var e=Rc(Xh(t)),n=["absolute","fixed"].indexOf(fr(t).position)>=0,i=n&&Yi(t)?Ru(t):t;return oa(i)?e.filter(function(s){return oa(s)&&xx(s,i)&&$s(s)!=="body"}):[]}function UP(t,e,n,i){var s=e==="clippingParents"?KP(t):[].concat(e),r=[].concat(s,[n]),o=r[0],a=r.reduce(function(l,c){var u=X0(t,c,i);return l.top=Zo(u.top,l.top),l.right=lh(u.right,l.right),l.bottom=lh(u.bottom,l.bottom),l.left=Zo(u.left,l.left),l},X0(t,o,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Ax(t){var e=t.reference,n=t.element,i=t.placement,s=i?Ps(i):null,r=i?gl(i):null,o=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(s){case ei:l={x:o,y:e.y-n.height};break;case Ai:l={x:o,y:e.y+e.height};break;case Mi:l={x:e.x+e.width,y:a};break;case ti:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=s?Wm(s):null;if(c!=null){var u=c==="y"?"height":"width";switch(r){case ra:l[c]=l[c]-(e[u]/2-n[u]/2);break;case dl:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function pl(t,e){e===void 0&&(e={});var n=e,i=n.placement,s=i===void 0?t.placement:i,r=n.strategy,o=r===void 0?t.strategy:r,a=n.boundary,l=a===void 0?cx:a,c=n.rootBoundary,u=c===void 0?Nm:c,d=n.elementContext,h=d===void 0?Ya:d,f=n.altBoundary,p=f===void 0?!1:f,m=n.padding,y=m===void 0?0:m,v=Sx(typeof y!="number"?y:Cx(y,Wl)),b=h===Ya?ux:Ya,E=t.rects.popper,C=t.elements[p?b:h],w=UP(oa(C)?C:C.contextElement||ho(t.elements.popper),l,u,o),x=fl(t.elements.reference),T=Ax({reference:x,element:E,strategy:"absolute",placement:s}),k=Pp(Object.assign({},E,T)),A=h===Ya?k:x,P={top:w.top-A.top+v.top,bottom:A.bottom-w.bottom+v.bottom,left:w.left-A.left+v.left,right:A.right-w.right+v.right},F=t.modifiersData.offset;if(h===Ya&&F){var H=F[s];Object.keys(P).forEach(function(te){var N=[Mi,Ai].indexOf(te)>=0?1:-1,L=[ei,Ai].indexOf(te)>=0?"y":"x";P[te]+=H[L]*N})}return P}function GP(t,e){e===void 0&&(e={});var n=e,i=n.placement,s=n.boundary,r=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?Fm:l,u=gl(i),d=u?a?Mp:Mp.filter(function(p){return gl(p)===u}):Wl,h=d.filter(function(p){return c.indexOf(p)>=0});h.length===0&&(h=d);var f=h.reduce(function(p,m){return p[m]=pl(t,{placement:m,boundary:s,rootBoundary:r,padding:o})[Ps(m)],p},{});return Object.keys(f).sort(function(p,m){return f[p]-f[m]})}function XP(t){if(Ps(t)===Gh)return[];var e=qd(t);return[G0(t),e,G0(e)]}function qP(t){var e=t.state,n=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!0:o,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,p=f===void 0?!0:f,m=n.allowedAutoPlacements,y=e.options.placement,v=Ps(y),b=v===y,E=l||(b||!p?[qd(y)]:XP(y)),C=[y].concat(E).reduce(function(M,ie){return M.concat(Ps(ie)===Gh?GP(e,{placement:ie,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}):ie)},[]),w=e.rects.reference,x=e.rects.popper,T=new Map,k=!0,A=C[0],P=0;P=0,L=N?"width":"height",I=pl(e,{placement:F,boundary:u,rootBoundary:d,altBoundary:h,padding:c}),W=N?te?Mi:ti:te?Ai:ei;w[L]>x[L]&&(W=qd(W));var X=qd(W),J=[];if(r&&J.push(I[H]<=0),a&&J.push(I[W]<=0,I[X]<=0),J.every(function(M){return M})){A=F,k=!1;break}T.set(F,J)}if(k)for(var ne=p?3:1,ue=function(ie){var le=C.find(function($){var oe=T.get($);if(oe)return oe.slice(0,ie).every(function(de){return de})});if(le)return A=le,"break"},Y=ne;Y>0;Y--){var Z=ue(Y);if(Z==="break")break}e.placement!==A&&(e.modifiersData[i]._skip=!0,e.placement=A,e.reset=!0)}}const Mx={name:"flip",enabled:!0,phase:"main",fn:qP,requiresIfExists:["offset"],data:{_skip:!1}};function q0(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Z0(t){return[ei,Mi,Ai,ti].some(function(e){return t[e]>=0})}function ZP(t){var e=t.state,n=t.name,i=e.rects.reference,s=e.rects.popper,r=e.modifiersData.preventOverflow,o=pl(e,{elementContext:"reference"}),a=pl(e,{altBoundary:!0}),l=q0(o,i),c=q0(a,s,r),u=Z0(l),d=Z0(c);e.modifiersData[n]={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})}const Ix={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:ZP};function JP(t,e,n){var i=Ps(t),s=[ti,ei].indexOf(i)>=0?-1:1,r=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,o=r[0],a=r[1];return o=o||0,a=(a||0)*s,[ti,Mi].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function QP(t){var e=t.state,n=t.options,i=t.name,s=n.offset,r=s===void 0?[0,0]:s,o=Fm.reduce(function(u,d){return u[d]=JP(d,e.rects,r),u},{}),a=o[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]=o}const Px={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:QP};function e2(t){var e=t.state,n=t.name;e.modifiersData[n]=Ax({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Gm={name:"popperOffsets",enabled:!0,phase:"read",fn:e2,data:{}};function t2(t){return t==="x"?"y":"x"}function n2(t){var e=t.state,n=t.options,i=t.name,s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!1:o,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,h=n.tether,f=h===void 0?!0:h,p=n.tetherOffset,m=p===void 0?0:p,y=pl(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),v=Ps(e.placement),b=gl(e.placement),E=!b,C=Wm(v),w=t2(C),x=e.modifiersData.popperOffsets,T=e.rects.reference,k=e.rects.popper,A=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,P=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),F=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,H={x:0,y:0};if(x){if(r){var te,N=C==="y"?ei:ti,L=C==="y"?Ai:Mi,I=C==="y"?"height":"width",W=x[C],X=W+y[N],J=W-y[L],ne=f?-k[I]/2:0,ue=b===ra?T[I]:k[I],Y=b===ra?-k[I]:-T[I],Z=e.elements.arrow,M=f&&Z?zm(Z):{width:0,height:0},ie=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Ex(),le=ie[N],$=ie[L],oe=Pc(0,T[I],M[I]),de=E?T[I]/2-ne-oe-le-P.mainAxis:ue-oe-le-P.mainAxis,ve=E?-T[I]/2+ne+oe+$+P.mainAxis:Y+oe+$+P.mainAxis,z=e.elements.arrow&&Ru(e.elements.arrow),ge=z?C==="y"?z.clientTop||0:z.clientLeft||0:0,S=(te=F?.[C])!=null?te:0,O=W+de-S-ge,K=W+ve-S,U=Pc(f?lh(X,O):X,W,f?Zo(J,K):J);x[C]=U,H[C]=U-W}if(a){var re,j=C==="x"?ei:ti,se=C==="x"?Ai:Mi,ee=x[w],fe=w==="y"?"height":"width",me=ee+y[j],pe=ee-y[se],Le=[ei,ti].indexOf(v)!==-1,Ae=(re=F?.[w])!=null?re:0,ze=Le?me:ee-T[fe]-k[fe]-Ae+P.altAxis,Be=Le?ee+T[fe]+k[fe]-Ae-P.altAxis:pe,it=f&&Le?DP(ze,ee,Be):Pc(f?ze:me,ee,f?Be:pe);x[w]=it,H[w]=it-ee}e.modifiersData[i]=H}}const Rx={name:"preventOverflow",enabled:!0,phase:"main",fn:n2,requiresIfExists:["offset"]};function i2(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function s2(t){return t===Ii(t)||!Yi(t)?jm(t):i2(t)}function r2(t){var e=t.getBoundingClientRect(),n=hl(e.width)/t.offsetWidth||1,i=hl(e.height)/t.offsetHeight||1;return n!==1||i!==1}function o2(t,e,n){n===void 0&&(n=!1);var i=Yi(e),s=Yi(e)&&r2(e),r=ho(e),o=fl(t,s,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&(($s(e)!=="body"||Um(r))&&(a=s2(e)),Yi(e)?(l=fl(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):r&&(l.x=Km(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function a2(t){var e=new Map,n=new Set,i=[];t.forEach(function(r){e.set(r.name,r)});function s(r){n.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&s(l)}}),i.push(r)}return t.forEach(function(r){n.has(r.name)||s(r)}),i}function l2(t){var e=a2(t);return bx.reduce(function(n,i){return n.concat(e.filter(function(s){return s.phase===i}))},[])}function c2(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function u2(t){var e=t.reduce(function(n,i){var s=n[i.name];return n[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,n},{});return Object.keys(e).map(function(n){return e[n]})}var J0={placement:"bottom",modifiers:[],strategy:"absolute"};function Q0(){for(var t=arguments.length,e=new Array(t),n=0;nG[R]})}}return _.default=G,Object.freeze(_)}const s=i(n),r=new Map,o={set(G,_,R){r.has(G)||r.set(G,new Map);const q=r.get(G);if(!q.has(_)&&q.size!==0){console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(q.keys())[0]}.`);return}q.set(_,R)},get(G,_){return r.has(G)&&r.get(G).get(_)||null},remove(G,_){if(!r.has(G))return;const R=r.get(G);R.delete(_),R.size===0&&r.delete(G)}},a=1e6,l=1e3,c="transitionend",u=G=>(G&&window.CSS&&window.CSS.escape&&(G=G.replace(/#([^\s"#']+)/g,(_,R)=>`#${CSS.escape(R)}`)),G),d=G=>G==null?`${G}`:Object.prototype.toString.call(G).match(/\s([a-z]+)/i)[1].toLowerCase(),h=G=>{do G+=Math.floor(Math.random()*a);while(document.getElementById(G));return G},f=G=>{if(!G)return 0;let{transitionDuration:_,transitionDelay:R}=window.getComputedStyle(G);const q=Number.parseFloat(_),ye=Number.parseFloat(R);return!q&&!ye?0:(_=_.split(",")[0],R=R.split(",")[0],(Number.parseFloat(_)+Number.parseFloat(R))*l)},p=G=>{G.dispatchEvent(new Event(c))},m=G=>!G||typeof G!="object"?!1:(typeof G.jquery<"u"&&(G=G[0]),typeof G.nodeType<"u"),y=G=>m(G)?G.jquery?G[0]:G:typeof G=="string"&&G.length>0?document.querySelector(u(G)):null,v=G=>{if(!m(G)||G.getClientRects().length===0)return!1;const _=getComputedStyle(G).getPropertyValue("visibility")==="visible",R=G.closest("details:not([open])");if(!R)return _;if(R!==G){const q=G.closest("summary");if(q&&q.parentNode!==R||q===null)return!1}return _},b=G=>!G||G.nodeType!==Node.ELEMENT_NODE||G.classList.contains("disabled")?!0:typeof G.disabled<"u"?G.disabled:G.hasAttribute("disabled")&&G.getAttribute("disabled")!=="false",E=G=>{if(!document.documentElement.attachShadow)return null;if(typeof G.getRootNode=="function"){const _=G.getRootNode();return _ instanceof ShadowRoot?_:null}return G instanceof ShadowRoot?G:G.parentNode?E(G.parentNode):null},C=()=>{},w=G=>{G.offsetHeight},x=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,T=[],k=G=>{document.readyState==="loading"?(T.length||document.addEventListener("DOMContentLoaded",()=>{for(const _ of T)_()}),T.push(G)):G()},A=()=>document.documentElement.dir==="rtl",P=G=>{k(()=>{const _=x();if(_){const R=G.NAME,q=_.fn[R];_.fn[R]=G.jQueryInterface,_.fn[R].Constructor=G,_.fn[R].noConflict=()=>(_.fn[R]=q,G.jQueryInterface)}})},F=(G,_=[],R=G)=>typeof G=="function"?G(..._):R,H=(G,_,R=!0)=>{if(!R){F(G);return}const ye=f(_)+5;let Pe=!1;const Me=({target:rt})=>{rt===_&&(Pe=!0,_.removeEventListener(c,Me),F(G))};_.addEventListener(c,Me),setTimeout(()=>{Pe||p(_)},ye)},te=(G,_,R,q)=>{const ye=G.length;let Pe=G.indexOf(_);return Pe===-1?!R&&q?G[ye-1]:G[0]:(Pe+=R?1:-1,q&&(Pe=(Pe+ye)%ye),G[Math.max(0,Math.min(Pe,ye-1))])},N=/[^.]*(?=\..*)\.|.*/,L=/\..*/,I=/::\d+$/,W={};let X=1;const J={mouseenter:"mouseover",mouseleave:"mouseout"},ne=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 ue(G,_){return _&&`${_}::${X++}`||G.uidEvent||X++}function Y(G){const _=ue(G);return G.uidEvent=_,W[_]=W[_]||{},W[_]}function Z(G,_){return function R(q){return ge(q,{delegateTarget:G}),R.oneOff&&z.off(G,q.type,_),_.apply(G,[q])}}function M(G,_,R){return function q(ye){const Pe=G.querySelectorAll(_);for(let{target:Me}=ye;Me&&Me!==this;Me=Me.parentNode)for(const rt of Pe)if(rt===Me)return ge(ye,{delegateTarget:Me}),q.oneOff&&z.off(G,ye.type,_,R),R.apply(Me,[ye])}}function ie(G,_,R=null){return Object.values(G).find(q=>q.callable===_&&q.delegationSelector===R)}function le(G,_,R){const q=typeof _=="string",ye=q?R:_||R;let Pe=ve(G);return ne.has(Pe)||(Pe=G),[q,ye,Pe]}function $(G,_,R,q,ye){if(typeof _!="string"||!G)return;let[Pe,Me,rt]=le(_,R,q);_ in J&&(Me=(CP=>function(Ma){if(!Ma.relatedTarget||Ma.relatedTarget!==Ma.delegateTarget&&!Ma.delegateTarget.contains(Ma.relatedTarget))return CP.call(this,Ma)})(Me));const oi=Y(G),Oi=oi[rt]||(oi[rt]={}),Cn=ie(Oi,Me,Pe?R:null);if(Cn){Cn.oneOff=Cn.oneOff&&ye;return}const ms=ue(Me,_.replace(N,"")),Ji=Pe?M(G,R,Me):Z(G,Me);Ji.delegationSelector=Pe?R:null,Ji.callable=Me,Ji.oneOff=ye,Ji.uidEvent=ms,Oi[ms]=Ji,G.addEventListener(rt,Ji,Pe)}function oe(G,_,R,q,ye){const Pe=ie(_[R],q,ye);Pe&&(G.removeEventListener(R,Pe,!!ye),delete _[R][Pe.uidEvent])}function de(G,_,R,q){const ye=_[R]||{};for(const[Pe,Me]of Object.entries(ye))Pe.includes(q)&&oe(G,_,R,Me.callable,Me.delegationSelector)}function ve(G){return G=G.replace(L,""),J[G]||G}const z={on(G,_,R,q){$(G,_,R,q,!1)},one(G,_,R,q){$(G,_,R,q,!0)},off(G,_,R,q){if(typeof _!="string"||!G)return;const[ye,Pe,Me]=le(_,R,q),rt=Me!==_,oi=Y(G),Oi=oi[Me]||{},Cn=_.startsWith(".");if(typeof Pe<"u"){if(!Object.keys(Oi).length)return;oe(G,oi,Me,Pe,ye?R:null);return}if(Cn)for(const ms of Object.keys(oi))de(G,oi,ms,_.slice(1));for(const[ms,Ji]of Object.entries(Oi)){const cd=ms.replace(I,"");(!rt||_.includes(cd))&&oe(G,oi,Me,Ji.callable,Ji.delegationSelector)}},trigger(G,_,R){if(typeof _!="string"||!G)return null;const q=x(),ye=ve(_),Pe=_!==ye;let Me=null,rt=!0,oi=!0,Oi=!1;Pe&&q&&(Me=q.Event(_,R),q(G).trigger(Me),rt=!Me.isPropagationStopped(),oi=!Me.isImmediatePropagationStopped(),Oi=Me.isDefaultPrevented());const Cn=ge(new Event(_,{bubbles:rt,cancelable:!0}),R);return Oi&&Cn.preventDefault(),oi&&G.dispatchEvent(Cn),Cn.defaultPrevented&&Me&&Me.preventDefault(),Cn}};function ge(G,_={}){for(const[R,q]of Object.entries(_))try{G[R]=q}catch{Object.defineProperty(G,R,{configurable:!0,get(){return q}})}return G}function S(G){if(G==="true")return!0;if(G==="false")return!1;if(G===Number(G).toString())return Number(G);if(G===""||G==="null")return null;if(typeof G!="string")return G;try{return JSON.parse(decodeURIComponent(G))}catch{return G}}function O(G){return G.replace(/[A-Z]/g,_=>`-${_.toLowerCase()}`)}const K={setDataAttribute(G,_,R){G.setAttribute(`data-bs-${O(_)}`,R)},removeDataAttribute(G,_){G.removeAttribute(`data-bs-${O(_)}`)},getDataAttributes(G){if(!G)return{};const _={},R=Object.keys(G.dataset).filter(q=>q.startsWith("bs")&&!q.startsWith("bsConfig"));for(const q of R){let ye=q.replace(/^bs/,"");ye=ye.charAt(0).toLowerCase()+ye.slice(1,ye.length),_[ye]=S(G.dataset[q])}return _},getDataAttribute(G,_){return S(G.getAttribute(`data-bs-${O(_)}`))}};class U{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(_){return _=this._mergeConfigObj(_),_=this._configAfterMerge(_),this._typeCheckConfig(_),_}_configAfterMerge(_){return _}_mergeConfigObj(_,R){const q=m(R)?K.getDataAttribute(R,"config"):{};return{...this.constructor.Default,...typeof q=="object"?q:{},...m(R)?K.getDataAttributes(R):{},...typeof _=="object"?_:{}}}_typeCheckConfig(_,R=this.constructor.DefaultType){for(const[q,ye]of Object.entries(R)){const Pe=_[q],Me=m(Pe)?"element":d(Pe);if(!new RegExp(ye).test(Me))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${q}" provided type "${Me}" but expected type "${ye}".`)}}}const re="5.3.2";class j extends U{constructor(_,R){super(),_=y(_),_&&(this._element=_,this._config=this._getConfig(R),o.set(this._element,this.constructor.DATA_KEY,this))}dispose(){o.remove(this._element,this.constructor.DATA_KEY),z.off(this._element,this.constructor.EVENT_KEY);for(const _ of Object.getOwnPropertyNames(this))this[_]=null}_queueCallback(_,R,q=!0){H(_,R,q)}_getConfig(_){return _=this._mergeConfigObj(_,this._element),_=this._configAfterMerge(_),this._typeCheckConfig(_),_}static getInstance(_){return o.get(y(_),this.DATA_KEY)}static getOrCreateInstance(_,R={}){return this.getInstance(_)||new this(_,typeof R=="object"?R:null)}static get VERSION(){return re}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(_){return`${_}${this.EVENT_KEY}`}}const se=G=>{let _=G.getAttribute("data-bs-target");if(!_||_==="#"){let R=G.getAttribute("href");if(!R||!R.includes("#")&&!R.startsWith("."))return null;R.includes("#")&&!R.startsWith("#")&&(R=`#${R.split("#")[1]}`),_=R&&R!=="#"?u(R.trim()):null}return _},ee={find(G,_=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(_,G))},findOne(G,_=document.documentElement){return Element.prototype.querySelector.call(_,G)},children(G,_){return[].concat(...G.children).filter(R=>R.matches(_))},parents(G,_){const R=[];let q=G.parentNode.closest(_);for(;q;)R.push(q),q=q.parentNode.closest(_);return R},prev(G,_){let R=G.previousElementSibling;for(;R;){if(R.matches(_))return[R];R=R.previousElementSibling}return[]},next(G,_){let R=G.nextElementSibling;for(;R;){if(R.matches(_))return[R];R=R.nextElementSibling}return[]},focusableChildren(G){const _=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(R=>`${R}:not([tabindex^="-"])`).join(",");return this.find(_,G).filter(R=>!b(R)&&v(R))},getSelectorFromElement(G){const _=se(G);return _&&ee.findOne(_)?_:null},getElementFromSelector(G){const _=se(G);return _?ee.findOne(_):null},getMultipleElementsFromSelector(G){const _=se(G);return _?ee.find(_):[]}},fe=(G,_="hide")=>{const R=`click.dismiss${G.EVENT_KEY}`,q=G.NAME;z.on(document,R,`[data-bs-dismiss="${q}"]`,function(ye){if(["A","AREA"].includes(this.tagName)&&ye.preventDefault(),b(this))return;const Pe=ee.getElementFromSelector(this)||this.closest(`.${q}`);G.getOrCreateInstance(Pe)[_]()})},me="alert",Le=".bs.alert",Ae=`close${Le}`,ze=`closed${Le}`,Be="fade",nt="show";class Ze extends j{static get NAME(){return me}close(){if(z.trigger(this._element,Ae).defaultPrevented)return;this._element.classList.remove(nt);const R=this._element.classList.contains(Be);this._queueCallback(()=>this._destroyElement(),this._element,R)}_destroyElement(){this._element.remove(),z.trigger(this._element,ze),this.dispose()}static jQueryInterface(_){return this.each(function(){const R=Ze.getOrCreateInstance(this);if(typeof _=="string"){if(R[_]===void 0||_.startsWith("_")||_==="constructor")throw new TypeError(`No method named "${_}"`);R[_](this)}})}}fe(Ze,"close"),P(Ze);const Mt="button",Un=".bs.button",Ri=".data-api",wi="active",Xi='[data-bs-toggle="button"]',Ut=`click${Un}${Ri}`;class ae extends j{static get NAME(){return Mt}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle(wi))}static jQueryInterface(_){return this.each(function(){const R=ae.getOrCreateInstance(this);_==="toggle"&&R[_]()})}}z.on(document,Ut,Xi,G=>{G.preventDefault();const _=G.target.closest(Xi);ae.getOrCreateInstance(_).toggle()}),P(ae);const Te="swipe",he=".bs.swipe",ke=`touchstart${he}`,De=`touchmove${he}`,Ht=`touchend${he}`,un=`pointerdown${he}`,Di=`pointerup${he}`,zs="touch",dn="pen",En="pointer-event",Sn=40,ii={endCallback:null,leftCallback:null,rightCallback:null},si={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class ri extends U{constructor(_,R){super(),this._element=_,!(!_||!ri.isSupported())&&(this._config=this._getConfig(R),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return ii}static get DefaultType(){return si}static get NAME(){return Te}dispose(){z.off(this._element,he)}_start(_){if(!this._supportPointerEvents){this._deltaX=_.touches[0].clientX;return}this._eventIsPointerPenTouch(_)&&(this._deltaX=_.clientX)}_end(_){this._eventIsPointerPenTouch(_)&&(this._deltaX=_.clientX-this._deltaX),this._handleSwipe(),F(this._config.endCallback)}_move(_){this._deltaX=_.touches&&_.touches.length>1?0:_.touches[0].clientX-this._deltaX}_handleSwipe(){const _=Math.abs(this._deltaX);if(_<=Sn)return;const R=_/this._deltaX;this._deltaX=0,R&&F(R>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(z.on(this._element,un,_=>this._start(_)),z.on(this._element,Di,_=>this._end(_)),this._element.classList.add(En)):(z.on(this._element,ke,_=>this._start(_)),z.on(this._element,De,_=>this._move(_)),z.on(this._element,Ht,_=>this._end(_)))}_eventIsPointerPenTouch(_){return this._supportPointerEvents&&(_.pointerType===dn||_.pointerType===zs)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const qi="carousel",zt=".bs.carousel",$i=".data-api",ig="ArrowLeft",cA="ArrowRight",uA=500,Ql="next",xa="prev",Ea="left",Qu="right",dA=`slide${zt}`,sg=`slid${zt}`,hA=`keydown${zt}`,fA=`mouseenter${zt}`,gA=`mouseleave${zt}`,pA=`dragstart${zt}`,mA=`load${zt}${$i}`,_A=`click${zt}${$i}`,o0="carousel",ed="active",yA="slide",vA="carousel-item-end",bA="carousel-item-start",wA="carousel-item-next",xA="carousel-item-prev",a0=".active",l0=".carousel-item",EA=a0+l0,SA=".carousel-item img",CA=".carousel-indicators",TA="[data-bs-slide], [data-bs-slide-to]",kA='[data-bs-ride="carousel"]',AA={[ig]:Qu,[cA]:Ea},MA={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},IA={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class Sa extends j{constructor(_,R){super(_,R),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=ee.findOne(CA,this._element),this._addEventListeners(),this._config.ride===o0&&this.cycle()}static get Default(){return MA}static get DefaultType(){return IA}static get NAME(){return qi}next(){this._slide(Ql)}nextWhenVisible(){!document.hidden&&v(this._element)&&this.next()}prev(){this._slide(xa)}pause(){this._isSliding&&p(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){z.one(this._element,sg,()=>this.cycle());return}this.cycle()}}to(_){const R=this._getItems();if(_>R.length-1||_<0)return;if(this._isSliding){z.one(this._element,sg,()=>this.to(_));return}const q=this._getItemIndex(this._getActive());if(q===_)return;const ye=_>q?Ql:xa;this._slide(ye,R[_])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(_){return _.defaultInterval=_.interval,_}_addEventListeners(){this._config.keyboard&&z.on(this._element,hA,_=>this._keydown(_)),this._config.pause==="hover"&&(z.on(this._element,fA,()=>this.pause()),z.on(this._element,gA,()=>this._maybeEnableCycle())),this._config.touch&&ri.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const q of ee.find(SA,this._element))z.on(q,pA,ye=>ye.preventDefault());const R={leftCallback:()=>this._slide(this._directionToOrder(Ea)),rightCallback:()=>this._slide(this._directionToOrder(Qu)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),uA+this._config.interval))}};this._swipeHelper=new ri(this._element,R)}_keydown(_){if(/input|textarea/i.test(_.target.tagName))return;const R=AA[_.key];R&&(_.preventDefault(),this._slide(this._directionToOrder(R)))}_getItemIndex(_){return this._getItems().indexOf(_)}_setActiveIndicatorElement(_){if(!this._indicatorsElement)return;const R=ee.findOne(a0,this._indicatorsElement);R.classList.remove(ed),R.removeAttribute("aria-current");const q=ee.findOne(`[data-bs-slide-to="${_}"]`,this._indicatorsElement);q&&(q.classList.add(ed),q.setAttribute("aria-current","true"))}_updateInterval(){const _=this._activeElement||this._getActive();if(!_)return;const R=Number.parseInt(_.getAttribute("data-bs-interval"),10);this._config.interval=R||this._config.defaultInterval}_slide(_,R=null){if(this._isSliding)return;const q=this._getActive(),ye=_===Ql,Pe=R||te(this._getItems(),q,ye,this._config.wrap);if(Pe===q)return;const Me=this._getItemIndex(Pe),rt=cd=>z.trigger(this._element,cd,{relatedTarget:Pe,direction:this._orderToDirection(_),from:this._getItemIndex(q),to:Me});if(rt(dA).defaultPrevented||!q||!Pe)return;const Oi=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(Me),this._activeElement=Pe;const Cn=ye?bA:vA,ms=ye?wA:xA;Pe.classList.add(ms),w(Pe),q.classList.add(Cn),Pe.classList.add(Cn);const Ji=()=>{Pe.classList.remove(Cn,ms),Pe.classList.add(ed),q.classList.remove(ed,ms,Cn),this._isSliding=!1,rt(sg)};this._queueCallback(Ji,q,this._isAnimated()),Oi&&this.cycle()}_isAnimated(){return this._element.classList.contains(yA)}_getActive(){return ee.findOne(EA,this._element)}_getItems(){return ee.find(l0,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(_){return A()?_===Ea?xa:Ql:_===Ea?Ql:xa}_orderToDirection(_){return A()?_===xa?Ea:Qu:_===xa?Qu:Ea}static jQueryInterface(_){return this.each(function(){const R=Sa.getOrCreateInstance(this,_);if(typeof _=="number"){R.to(_);return}if(typeof _=="string"){if(R[_]===void 0||_.startsWith("_")||_==="constructor")throw new TypeError(`No method named "${_}"`);R[_]()}})}}z.on(document,_A,TA,function(G){const _=ee.getElementFromSelector(this);if(!_||!_.classList.contains(o0))return;G.preventDefault();const R=Sa.getOrCreateInstance(_),q=this.getAttribute("data-bs-slide-to");if(q){R.to(q),R._maybeEnableCycle();return}if(K.getDataAttribute(this,"slide")==="next"){R.next(),R._maybeEnableCycle();return}R.prev(),R._maybeEnableCycle()}),z.on(window,mA,()=>{const G=ee.find(kA);for(const _ of G)Sa.getOrCreateInstance(_)}),P(Sa);const PA="collapse",ec=".bs.collapse",RA=".data-api",DA=`show${ec}`,$A=`shown${ec}`,LA=`hide${ec}`,OA=`hidden${ec}`,NA=`click${ec}${RA}`,rg="show",Ca="collapse",td="collapsing",FA="collapsed",BA=`:scope .${Ca} .${Ca}`,VA="collapse-horizontal",zA="width",WA="height",HA=".collapse.show, .collapse.collapsing",og='[data-bs-toggle="collapse"]',YA={parent:null,toggle:!0},jA={parent:"(null|element)",toggle:"boolean"};class Ta extends j{constructor(_,R){super(_,R),this._isTransitioning=!1,this._triggerArray=[];const q=ee.find(og);for(const ye of q){const Pe=ee.getSelectorFromElement(ye),Me=ee.find(Pe).filter(rt=>rt===this._element);Pe!==null&&Me.length&&this._triggerArray.push(ye)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return YA}static get DefaultType(){return jA}static get NAME(){return PA}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let _=[];if(this._config.parent&&(_=this._getFirstLevelChildren(HA).filter(rt=>rt!==this._element).map(rt=>Ta.getOrCreateInstance(rt,{toggle:!1}))),_.length&&_[0]._isTransitioning||z.trigger(this._element,DA).defaultPrevented)return;for(const rt of _)rt.hide();const q=this._getDimension();this._element.classList.remove(Ca),this._element.classList.add(td),this._element.style[q]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const ye=()=>{this._isTransitioning=!1,this._element.classList.remove(td),this._element.classList.add(Ca,rg),this._element.style[q]="",z.trigger(this._element,$A)},Me=`scroll${q[0].toUpperCase()+q.slice(1)}`;this._queueCallback(ye,this._element,!0),this._element.style[q]=`${this._element[Me]}px`}hide(){if(this._isTransitioning||!this._isShown()||z.trigger(this._element,LA).defaultPrevented)return;const R=this._getDimension();this._element.style[R]=`${this._element.getBoundingClientRect()[R]}px`,w(this._element),this._element.classList.add(td),this._element.classList.remove(Ca,rg);for(const ye of this._triggerArray){const Pe=ee.getElementFromSelector(ye);Pe&&!this._isShown(Pe)&&this._addAriaAndCollapsedClass([ye],!1)}this._isTransitioning=!0;const q=()=>{this._isTransitioning=!1,this._element.classList.remove(td),this._element.classList.add(Ca),z.trigger(this._element,OA)};this._element.style[R]="",this._queueCallback(q,this._element,!0)}_isShown(_=this._element){return _.classList.contains(rg)}_configAfterMerge(_){return _.toggle=!!_.toggle,_.parent=y(_.parent),_}_getDimension(){return this._element.classList.contains(VA)?zA:WA}_initializeChildren(){if(!this._config.parent)return;const _=this._getFirstLevelChildren(og);for(const R of _){const q=ee.getElementFromSelector(R);q&&this._addAriaAndCollapsedClass([R],this._isShown(q))}}_getFirstLevelChildren(_){const R=ee.find(BA,this._config.parent);return ee.find(_,this._config.parent).filter(q=>!R.includes(q))}_addAriaAndCollapsedClass(_,R){if(_.length)for(const q of _)q.classList.toggle(FA,!R),q.setAttribute("aria-expanded",R)}static jQueryInterface(_){const R={};return typeof _=="string"&&/show|hide/.test(_)&&(R.toggle=!1),this.each(function(){const q=Ta.getOrCreateInstance(this,R);if(typeof _=="string"){if(typeof q[_]>"u")throw new TypeError(`No method named "${_}"`);q[_]()}})}}z.on(document,NA,og,function(G){(G.target.tagName==="A"||G.delegateTarget&&G.delegateTarget.tagName==="A")&&G.preventDefault();for(const _ of ee.getMultipleElementsFromSelector(this))Ta.getOrCreateInstance(_,{toggle:!1}).toggle()}),P(Ta);const c0="dropdown",Eo=".bs.dropdown",ag=".data-api",KA="Escape",u0="Tab",UA="ArrowUp",d0="ArrowDown",GA=2,XA=`hide${Eo}`,qA=`hidden${Eo}`,ZA=`show${Eo}`,JA=`shown${Eo}`,h0=`click${Eo}${ag}`,f0=`keydown${Eo}${ag}`,QA=`keyup${Eo}${ag}`,ka="show",eM="dropup",tM="dropend",nM="dropstart",iM="dropup-center",sM="dropdown-center",So='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',rM=`${So}.${ka}`,nd=".dropdown-menu",oM=".navbar",aM=".navbar-nav",lM=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",cM=A()?"top-end":"top-start",uM=A()?"top-start":"top-end",dM=A()?"bottom-end":"bottom-start",hM=A()?"bottom-start":"bottom-end",fM=A()?"left-start":"right-start",gM=A()?"right-start":"left-start",pM="top",mM="bottom",_M={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},yM={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class Zi extends j{constructor(_,R){super(_,R),this._popper=null,this._parent=this._element.parentNode,this._menu=ee.next(this._element,nd)[0]||ee.prev(this._element,nd)[0]||ee.findOne(nd,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return _M}static get DefaultType(){return yM}static get NAME(){return c0}toggle(){return this._isShown()?this.hide():this.show()}show(){if(b(this._element)||this._isShown())return;const _={relatedTarget:this._element};if(!z.trigger(this._element,ZA,_).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(aM))for(const q of[].concat(...document.body.children))z.on(q,"mouseover",C);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(ka),this._element.classList.add(ka),z.trigger(this._element,JA,_)}}hide(){if(b(this._element)||!this._isShown())return;const _={relatedTarget:this._element};this._completeHide(_)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(_){if(!z.trigger(this._element,XA,_).defaultPrevented){if("ontouchstart"in document.documentElement)for(const q of[].concat(...document.body.children))z.off(q,"mouseover",C);this._popper&&this._popper.destroy(),this._menu.classList.remove(ka),this._element.classList.remove(ka),this._element.setAttribute("aria-expanded","false"),K.removeDataAttribute(this._menu,"popper"),z.trigger(this._element,qA,_)}}_getConfig(_){if(_=super._getConfig(_),typeof _.reference=="object"&&!m(_.reference)&&typeof _.reference.getBoundingClientRect!="function")throw new TypeError(`${c0.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return _}_createPopper(){if(typeof s>"u")throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let _=this._element;this._config.reference==="parent"?_=this._parent:m(this._config.reference)?_=y(this._config.reference):typeof this._config.reference=="object"&&(_=this._config.reference);const R=this._getPopperConfig();this._popper=s.createPopper(_,this._menu,R)}_isShown(){return this._menu.classList.contains(ka)}_getPlacement(){const _=this._parent;if(_.classList.contains(tM))return fM;if(_.classList.contains(nM))return gM;if(_.classList.contains(iM))return pM;if(_.classList.contains(sM))return mM;const R=getComputedStyle(this._menu).getPropertyValue("--bs-position").trim()==="end";return _.classList.contains(eM)?R?uM:cM:R?hM:dM}_detectNavbar(){return this._element.closest(oM)!==null}_getOffset(){const{offset:_}=this._config;return typeof _=="string"?_.split(",").map(R=>Number.parseInt(R,10)):typeof _=="function"?R=>_(R,this._element):_}_getPopperConfig(){const _={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(K.setDataAttribute(this._menu,"popper","static"),_.modifiers=[{name:"applyStyles",enabled:!1}]),{..._,...F(this._config.popperConfig,[_])}}_selectMenuItem({key:_,target:R}){const q=ee.find(lM,this._menu).filter(ye=>v(ye));q.length&&te(q,R,_===d0,!q.includes(R)).focus()}static jQueryInterface(_){return this.each(function(){const R=Zi.getOrCreateInstance(this,_);if(typeof _=="string"){if(typeof R[_]>"u")throw new TypeError(`No method named "${_}"`);R[_]()}})}static clearMenus(_){if(_.button===GA||_.type==="keyup"&&_.key!==u0)return;const R=ee.find(rM);for(const q of R){const ye=Zi.getInstance(q);if(!ye||ye._config.autoClose===!1)continue;const Pe=_.composedPath(),Me=Pe.includes(ye._menu);if(Pe.includes(ye._element)||ye._config.autoClose==="inside"&&!Me||ye._config.autoClose==="outside"&&Me||ye._menu.contains(_.target)&&(_.type==="keyup"&&_.key===u0||/input|select|option|textarea|form/i.test(_.target.tagName)))continue;const rt={relatedTarget:ye._element};_.type==="click"&&(rt.clickEvent=_),ye._completeHide(rt)}}static dataApiKeydownHandler(_){const R=/input|textarea/i.test(_.target.tagName),q=_.key===KA,ye=[UA,d0].includes(_.key);if(!ye&&!q||R&&!q)return;_.preventDefault();const Pe=this.matches(So)?this:ee.prev(this,So)[0]||ee.next(this,So)[0]||ee.findOne(So,_.delegateTarget.parentNode),Me=Zi.getOrCreateInstance(Pe);if(ye){_.stopPropagation(),Me.show(),Me._selectMenuItem(_);return}Me._isShown()&&(_.stopPropagation(),Me.hide(),Pe.focus())}}z.on(document,f0,So,Zi.dataApiKeydownHandler),z.on(document,f0,nd,Zi.dataApiKeydownHandler),z.on(document,h0,Zi.clearMenus),z.on(document,QA,Zi.clearMenus),z.on(document,h0,So,function(G){G.preventDefault(),Zi.getOrCreateInstance(this).toggle()}),P(Zi);const g0="backdrop",vM="fade",p0="show",m0=`mousedown.bs.${g0}`,bM={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},wM={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class _0 extends U{constructor(_){super(),this._config=this._getConfig(_),this._isAppended=!1,this._element=null}static get Default(){return bM}static get DefaultType(){return wM}static get NAME(){return g0}show(_){if(!this._config.isVisible){F(_);return}this._append();const R=this._getElement();this._config.isAnimated&&w(R),R.classList.add(p0),this._emulateAnimation(()=>{F(_)})}hide(_){if(!this._config.isVisible){F(_);return}this._getElement().classList.remove(p0),this._emulateAnimation(()=>{this.dispose(),F(_)})}dispose(){this._isAppended&&(z.off(this._element,m0),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const _=document.createElement("div");_.className=this._config.className,this._config.isAnimated&&_.classList.add(vM),this._element=_}return this._element}_configAfterMerge(_){return _.rootElement=y(_.rootElement),_}_append(){if(this._isAppended)return;const _=this._getElement();this._config.rootElement.append(_),z.on(_,m0,()=>{F(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(_){H(_,this._getElement(),this._config.isAnimated)}}const xM="focustrap",id=".bs.focustrap",EM=`focusin${id}`,SM=`keydown.tab${id}`,CM="Tab",TM="forward",y0="backward",kM={autofocus:!0,trapElement:null},AM={autofocus:"boolean",trapElement:"element"};class v0 extends U{constructor(_){super(),this._config=this._getConfig(_),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return kM}static get DefaultType(){return AM}static get NAME(){return xM}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),z.off(document,id),z.on(document,EM,_=>this._handleFocusin(_)),z.on(document,SM,_=>this._handleKeydown(_)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,z.off(document,id))}_handleFocusin(_){const{trapElement:R}=this._config;if(_.target===document||_.target===R||R.contains(_.target))return;const q=ee.focusableChildren(R);q.length===0?R.focus():this._lastTabNavDirection===y0?q[q.length-1].focus():q[0].focus()}_handleKeydown(_){_.key===CM&&(this._lastTabNavDirection=_.shiftKey?y0:TM)}}const b0=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",w0=".sticky-top",sd="padding-right",x0="margin-right";class lg{constructor(){this._element=document.body}getWidth(){const _=document.documentElement.clientWidth;return Math.abs(window.innerWidth-_)}hide(){const _=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,sd,R=>R+_),this._setElementAttributes(b0,sd,R=>R+_),this._setElementAttributes(w0,x0,R=>R-_)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,sd),this._resetElementAttributes(b0,sd),this._resetElementAttributes(w0,x0)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(_,R,q){const ye=this.getWidth(),Pe=Me=>{if(Me!==this._element&&window.innerWidth>Me.clientWidth+ye)return;this._saveInitialAttribute(Me,R);const rt=window.getComputedStyle(Me).getPropertyValue(R);Me.style.setProperty(R,`${q(Number.parseFloat(rt))}px`)};this._applyManipulationCallback(_,Pe)}_saveInitialAttribute(_,R){const q=_.style.getPropertyValue(R);q&&K.setDataAttribute(_,R,q)}_resetElementAttributes(_,R){const q=ye=>{const Pe=K.getDataAttribute(ye,R);if(Pe===null){ye.style.removeProperty(R);return}K.removeDataAttribute(ye,R),ye.style.setProperty(R,Pe)};this._applyManipulationCallback(_,q)}_applyManipulationCallback(_,R){if(m(_)){R(_);return}for(const q of ee.find(_,this._element))R(q)}}const MM="modal",Li=".bs.modal",IM=".data-api",PM="Escape",RM=`hide${Li}`,DM=`hidePrevented${Li}`,E0=`hidden${Li}`,S0=`show${Li}`,$M=`shown${Li}`,LM=`resize${Li}`,OM=`click.dismiss${Li}`,NM=`mousedown.dismiss${Li}`,FM=`keydown.dismiss${Li}`,BM=`click${Li}${IM}`,C0="modal-open",VM="fade",T0="show",cg="modal-static",zM=".modal.show",WM=".modal-dialog",HM=".modal-body",YM='[data-bs-toggle="modal"]',jM={backdrop:!0,focus:!0,keyboard:!0},KM={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Co extends j{constructor(_,R){super(_,R),this._dialog=ee.findOne(WM,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new lg,this._addEventListeners()}static get Default(){return jM}static get DefaultType(){return KM}static get NAME(){return MM}toggle(_){return this._isShown?this.hide():this.show(_)}show(_){this._isShown||this._isTransitioning||z.trigger(this._element,S0,{relatedTarget:_}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(C0),this._adjustDialog(),this._backdrop.show(()=>this._showElement(_)))}hide(){!this._isShown||this._isTransitioning||z.trigger(this._element,RM).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(T0),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){z.off(window,Li),z.off(this._dialog,Li),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new _0({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new v0({trapElement:this._element})}_showElement(_){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;const R=ee.findOne(HM,this._dialog);R&&(R.scrollTop=0),w(this._element),this._element.classList.add(T0);const q=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,z.trigger(this._element,$M,{relatedTarget:_})};this._queueCallback(q,this._dialog,this._isAnimated())}_addEventListeners(){z.on(this._element,FM,_=>{if(_.key===PM){if(this._config.keyboard){this.hide();return}this._triggerBackdropTransition()}}),z.on(window,LM,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),z.on(this._element,NM,_=>{z.one(this._element,OM,R=>{if(!(this._element!==_.target||this._element!==R.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(C0),this._resetAdjustments(),this._scrollBar.reset(),z.trigger(this._element,E0)})}_isAnimated(){return this._element.classList.contains(VM)}_triggerBackdropTransition(){if(z.trigger(this._element,DM).defaultPrevented)return;const R=this._element.scrollHeight>document.documentElement.clientHeight,q=this._element.style.overflowY;q==="hidden"||this._element.classList.contains(cg)||(R||(this._element.style.overflowY="hidden"),this._element.classList.add(cg),this._queueCallback(()=>{this._element.classList.remove(cg),this._queueCallback(()=>{this._element.style.overflowY=q},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const _=this._element.scrollHeight>document.documentElement.clientHeight,R=this._scrollBar.getWidth(),q=R>0;if(q&&!_){const ye=A()?"paddingLeft":"paddingRight";this._element.style[ye]=`${R}px`}if(!q&&_){const ye=A()?"paddingRight":"paddingLeft";this._element.style[ye]=`${R}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(_,R){return this.each(function(){const q=Co.getOrCreateInstance(this,_);if(typeof _=="string"){if(typeof q[_]>"u")throw new TypeError(`No method named "${_}"`);q[_](R)}})}}z.on(document,BM,YM,function(G){const _=ee.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&G.preventDefault(),z.one(_,S0,ye=>{ye.defaultPrevented||z.one(_,E0,()=>{v(this)&&this.focus()})});const R=ee.findOne(zM);R&&Co.getInstance(R).hide(),Co.getOrCreateInstance(_).toggle(this)}),fe(Co),P(Co);const UM="offcanvas",Ws=".bs.offcanvas",k0=".data-api",GM=`load${Ws}${k0}`,XM="Escape",A0="show",M0="showing",I0="hiding",qM="offcanvas-backdrop",P0=".offcanvas.show",ZM=`show${Ws}`,JM=`shown${Ws}`,QM=`hide${Ws}`,R0=`hidePrevented${Ws}`,D0=`hidden${Ws}`,eI=`resize${Ws}`,tI=`click${Ws}${k0}`,nI=`keydown.dismiss${Ws}`,iI='[data-bs-toggle="offcanvas"]',sI={backdrop:!0,keyboard:!0,scroll:!1},rI={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class Hs extends j{constructor(_,R){super(_,R),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return sI}static get DefaultType(){return rI}static get NAME(){return UM}toggle(_){return this._isShown?this.hide():this.show(_)}show(_){if(this._isShown||z.trigger(this._element,ZM,{relatedTarget:_}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||new lg().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(M0);const q=()=>{(!this._config.scroll||this._config.backdrop)&&this._focustrap.activate(),this._element.classList.add(A0),this._element.classList.remove(M0),z.trigger(this._element,JM,{relatedTarget:_})};this._queueCallback(q,this._element,!0)}hide(){if(!this._isShown||z.trigger(this._element,QM).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(I0),this._backdrop.hide();const R=()=>{this._element.classList.remove(A0,I0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new lg().reset(),z.trigger(this._element,D0)};this._queueCallback(R,this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const _=()=>{if(this._config.backdrop==="static"){z.trigger(this._element,R0);return}this.hide()},R=!!this._config.backdrop;return new _0({className:qM,isVisible:R,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:R?_:null})}_initializeFocusTrap(){return new v0({trapElement:this._element})}_addEventListeners(){z.on(this._element,nI,_=>{if(_.key===XM){if(this._config.keyboard){this.hide();return}z.trigger(this._element,R0)}})}static jQueryInterface(_){return this.each(function(){const R=Hs.getOrCreateInstance(this,_);if(typeof _=="string"){if(R[_]===void 0||_.startsWith("_")||_==="constructor")throw new TypeError(`No method named "${_}"`);R[_](this)}})}}z.on(document,tI,iI,function(G){const _=ee.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&G.preventDefault(),b(this))return;z.one(_,D0,()=>{v(this)&&this.focus()});const R=ee.findOne(P0);R&&R!==_&&Hs.getInstance(R).hide(),Hs.getOrCreateInstance(_).toggle(this)}),z.on(window,GM,()=>{for(const G of ee.find(P0))Hs.getOrCreateInstance(G).show()}),z.on(window,eI,()=>{for(const G of ee.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(G).position!=="fixed"&&Hs.getOrCreateInstance(G).hide()}),fe(Hs),P(Hs);const $0={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],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:[]},oI=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),aI=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,lI=(G,_)=>{const R=G.nodeName.toLowerCase();return _.includes(R)?oI.has(R)?!!aI.test(G.nodeValue):!0:_.filter(q=>q instanceof RegExp).some(q=>q.test(R))};function cI(G,_,R){if(!G.length)return G;if(R&&typeof R=="function")return R(G);const ye=new window.DOMParser().parseFromString(G,"text/html"),Pe=[].concat(...ye.body.querySelectorAll("*"));for(const Me of Pe){const rt=Me.nodeName.toLowerCase();if(!Object.keys(_).includes(rt)){Me.remove();continue}const oi=[].concat(...Me.attributes),Oi=[].concat(_["*"]||[],_[rt]||[]);for(const Cn of oi)lI(Cn,Oi)||Me.removeAttribute(Cn.nodeName)}return ye.body.innerHTML}const uI="TemplateFactory",dI={allowList:$0,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},hI={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},fI={entry:"(string|element|function|null)",selector:"(string|element)"};class gI extends U{constructor(_){super(),this._config=this._getConfig(_)}static get Default(){return dI}static get DefaultType(){return hI}static get NAME(){return uI}getContent(){return Object.values(this._config.content).map(_=>this._resolvePossibleFunction(_)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(_){return this._checkContent(_),this._config.content={...this._config.content,..._},this}toHtml(){const _=document.createElement("div");_.innerHTML=this._maybeSanitize(this._config.template);for(const[ye,Pe]of Object.entries(this._config.content))this._setContent(_,Pe,ye);const R=_.children[0],q=this._resolvePossibleFunction(this._config.extraClass);return q&&R.classList.add(...q.split(" ")),R}_typeCheckConfig(_){super._typeCheckConfig(_),this._checkContent(_.content)}_checkContent(_){for(const[R,q]of Object.entries(_))super._typeCheckConfig({selector:R,entry:q},fI)}_setContent(_,R,q){const ye=ee.findOne(q,_);if(ye){if(R=this._resolvePossibleFunction(R),!R){ye.remove();return}if(m(R)){this._putElementInTemplate(y(R),ye);return}if(this._config.html){ye.innerHTML=this._maybeSanitize(R);return}ye.textContent=R}}_maybeSanitize(_){return this._config.sanitize?cI(_,this._config.allowList,this._config.sanitizeFn):_}_resolvePossibleFunction(_){return F(_,[this])}_putElementInTemplate(_,R){if(this._config.html){R.innerHTML="",R.append(_);return}R.textContent=_.textContent}}const pI="tooltip",mI=new Set(["sanitize","allowList","sanitizeFn"]),ug="fade",_I="modal",rd="show",yI=".tooltip-inner",L0=`.${_I}`,O0="hide.bs.modal",tc="hover",dg="focus",vI="click",bI="manual",wI="hide",xI="hidden",EI="show",SI="shown",CI="inserted",TI="click",kI="focusin",AI="focusout",MI="mouseenter",II="mouseleave",PI={AUTO:"auto",TOP:"top",RIGHT:A()?"left":"right",BOTTOM:"bottom",LEFT:A()?"right":"left"},RI={allowList:$0,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"},DI={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"};class To extends j{constructor(_,R){if(typeof s>"u")throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(_,R),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 RI}static get DefaultType(){return DI}static get NAME(){return pI}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){if(this._isEnabled){if(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()){this._leave();return}this._enter()}}dispose(){clearTimeout(this._timeout),z.off(this._element.closest(L0),O0,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;const _=z.trigger(this._element,this.constructor.eventName(EI)),q=(E(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(_.defaultPrevented||!q)return;this._disposePopper();const ye=this._getTipElement();this._element.setAttribute("aria-describedby",ye.getAttribute("id"));const{container:Pe}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(Pe.append(ye),z.trigger(this._element,this.constructor.eventName(CI))),this._popper=this._createPopper(ye),ye.classList.add(rd),"ontouchstart"in document.documentElement)for(const rt of[].concat(...document.body.children))z.on(rt,"mouseover",C);const Me=()=>{z.trigger(this._element,this.constructor.eventName(SI)),this._isHovered===!1&&this._leave(),this._isHovered=!1};this._queueCallback(Me,this.tip,this._isAnimated())}hide(){if(!this._isShown()||z.trigger(this._element,this.constructor.eventName(wI)).defaultPrevented)return;if(this._getTipElement().classList.remove(rd),"ontouchstart"in document.documentElement)for(const ye of[].concat(...document.body.children))z.off(ye,"mouseover",C);this._activeTrigger[vI]=!1,this._activeTrigger[dg]=!1,this._activeTrigger[tc]=!1,this._isHovered=null;const q=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),z.trigger(this._element,this.constructor.eventName(xI)))};this._queueCallback(q,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(_){const R=this._getTemplateFactory(_).toHtml();if(!R)return null;R.classList.remove(ug,rd),R.classList.add(`bs-${this.constructor.NAME}-auto`);const q=h(this.constructor.NAME).toString();return R.setAttribute("id",q),this._isAnimated()&&R.classList.add(ug),R}setContent(_){this._newContent=_,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(_){return this._templateFactory?this._templateFactory.changeContent(_):this._templateFactory=new gI({...this._config,content:_,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[yI]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(_){return this.constructor.getOrCreateInstance(_.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(ug)}_isShown(){return this.tip&&this.tip.classList.contains(rd)}_createPopper(_){const R=F(this._config.placement,[this,_,this._element]),q=PI[R.toUpperCase()];return s.createPopper(this._element,_,this._getPopperConfig(q))}_getOffset(){const{offset:_}=this._config;return typeof _=="string"?_.split(",").map(R=>Number.parseInt(R,10)):typeof _=="function"?R=>_(R,this._element):_}_resolvePossibleFunction(_){return F(_,[this._element])}_getPopperConfig(_){const R={placement:_,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:q=>{this._getTipElement().setAttribute("data-popper-placement",q.state.placement)}}]};return{...R,...F(this._config.popperConfig,[R])}}_setListeners(){const _=this._config.trigger.split(" ");for(const R of _)if(R==="click")z.on(this._element,this.constructor.eventName(TI),this._config.selector,q=>{this._initializeOnDelegatedTarget(q).toggle()});else if(R!==bI){const q=R===tc?this.constructor.eventName(MI):this.constructor.eventName(kI),ye=R===tc?this.constructor.eventName(II):this.constructor.eventName(AI);z.on(this._element,q,this._config.selector,Pe=>{const Me=this._initializeOnDelegatedTarget(Pe);Me._activeTrigger[Pe.type==="focusin"?dg:tc]=!0,Me._enter()}),z.on(this._element,ye,this._config.selector,Pe=>{const Me=this._initializeOnDelegatedTarget(Pe);Me._activeTrigger[Pe.type==="focusout"?dg:tc]=Me._element.contains(Pe.relatedTarget),Me._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},z.on(this._element.closest(L0),O0,this._hideModalHandler)}_fixTitle(){const _=this._element.getAttribute("title");_&&(!this._element.getAttribute("aria-label")&&!this._element.textContent.trim()&&this._element.setAttribute("aria-label",_),this._element.setAttribute("data-bs-original-title",_),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(_,R){clearTimeout(this._timeout),this._timeout=setTimeout(_,R)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(_){const R=K.getDataAttributes(this._element);for(const q of Object.keys(R))mI.has(q)&&delete R[q];return _={...R,...typeof _=="object"&&_?_:{}},_=this._mergeConfigObj(_),_=this._configAfterMerge(_),this._typeCheckConfig(_),_}_configAfterMerge(_){return _.container=_.container===!1?document.body:y(_.container),typeof _.delay=="number"&&(_.delay={show:_.delay,hide:_.delay}),typeof _.title=="number"&&(_.title=_.title.toString()),typeof _.content=="number"&&(_.content=_.content.toString()),_}_getDelegateConfig(){const _={};for(const[R,q]of Object.entries(this._config))this.constructor.Default[R]!==q&&(_[R]=q);return _.selector=!1,_.trigger="manual",_}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(_){return this.each(function(){const R=To.getOrCreateInstance(this,_);if(typeof _=="string"){if(typeof R[_]>"u")throw new TypeError(`No method named "${_}"`);R[_]()}})}}P(To);const $I="popover",LI=".popover-header",OI=".popover-body",NI={...To.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},FI={...To.DefaultType,content:"(null|string|element|function)"};class od extends To{static get Default(){return NI}static get DefaultType(){return FI}static get NAME(){return $I}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[LI]:this._getTitle(),[OI]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(_){return this.each(function(){const R=od.getOrCreateInstance(this,_);if(typeof _=="string"){if(typeof R[_]>"u")throw new TypeError(`No method named "${_}"`);R[_]()}})}}P(od);const BI="scrollspy",hg=".bs.scrollspy",VI=".data-api",zI=`activate${hg}`,N0=`click${hg}`,WI=`load${hg}${VI}`,HI="dropdown-item",Aa="active",YI='[data-bs-spy="scroll"]',fg="[href]",jI=".nav, .list-group",F0=".nav-link",KI=`${F0}, .nav-item > ${F0}, .list-group-item`,UI=".dropdown",GI=".dropdown-toggle",XI={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},qI={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class nc extends j{constructor(_,R){super(_,R),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return XI}static get DefaultType(){return qI}static get NAME(){return BI}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const _ of this._observableSections.values())this._observer.observe(_)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(_){return _.target=y(_.target)||document.body,_.rootMargin=_.offset?`${_.offset}px 0px -30%`:_.rootMargin,typeof _.threshold=="string"&&(_.threshold=_.threshold.split(",").map(R=>Number.parseFloat(R))),_}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(z.off(this._config.target,N0),z.on(this._config.target,N0,fg,_=>{const R=this._observableSections.get(_.target.hash);if(R){_.preventDefault();const q=this._rootElement||window,ye=R.offsetTop-this._element.offsetTop;if(q.scrollTo){q.scrollTo({top:ye,behavior:"smooth"});return}q.scrollTop=ye}}))}_getNewObserver(){const _={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(R=>this._observerCallback(R),_)}_observerCallback(_){const R=Me=>this._targetLinks.get(`#${Me.target.id}`),q=Me=>{this._previousScrollData.visibleEntryTop=Me.target.offsetTop,this._process(R(Me))},ye=(this._rootElement||document.documentElement).scrollTop,Pe=ye>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=ye;for(const Me of _){if(!Me.isIntersecting){this._activeTarget=null,this._clearActiveClass(R(Me));continue}const rt=Me.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(Pe&&rt){if(q(Me),!ye)return;continue}!Pe&&!rt&&q(Me)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const _=ee.find(fg,this._config.target);for(const R of _){if(!R.hash||b(R))continue;const q=ee.findOne(decodeURI(R.hash),this._element);v(q)&&(this._targetLinks.set(decodeURI(R.hash),R),this._observableSections.set(R.hash,q))}}_process(_){this._activeTarget!==_&&(this._clearActiveClass(this._config.target),this._activeTarget=_,_.classList.add(Aa),this._activateParents(_),z.trigger(this._element,zI,{relatedTarget:_}))}_activateParents(_){if(_.classList.contains(HI)){ee.findOne(GI,_.closest(UI)).classList.add(Aa);return}for(const R of ee.parents(_,jI))for(const q of ee.prev(R,KI))q.classList.add(Aa)}_clearActiveClass(_){_.classList.remove(Aa);const R=ee.find(`${fg}.${Aa}`,_);for(const q of R)q.classList.remove(Aa)}static jQueryInterface(_){return this.each(function(){const R=nc.getOrCreateInstance(this,_);if(typeof _=="string"){if(R[_]===void 0||_.startsWith("_")||_==="constructor")throw new TypeError(`No method named "${_}"`);R[_]()}})}}z.on(window,WI,()=>{for(const G of ee.find(YI))nc.getOrCreateInstance(G)}),P(nc);const ZI="tab",ko=".bs.tab",JI=`hide${ko}`,QI=`hidden${ko}`,eP=`show${ko}`,tP=`shown${ko}`,nP=`click${ko}`,iP=`keydown${ko}`,sP=`load${ko}`,rP="ArrowLeft",B0="ArrowRight",oP="ArrowUp",V0="ArrowDown",gg="Home",z0="End",Ao="active",W0="fade",pg="show",aP="dropdown",H0=".dropdown-toggle",lP=".dropdown-menu",mg=`:not(${H0})`,cP='.list-group, .nav, [role="tablist"]',uP=".nav-item, .list-group-item",dP=`.nav-link${mg}, .list-group-item${mg}, [role="tab"]${mg}`,Y0='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',_g=`${dP}, ${Y0}`,hP=`.${Ao}[data-bs-toggle="tab"], .${Ao}[data-bs-toggle="pill"], .${Ao}[data-bs-toggle="list"]`;class Mo extends j{constructor(_){super(_),this._parent=this._element.closest(cP),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),z.on(this._element,iP,R=>this._keydown(R)))}static get NAME(){return ZI}show(){const _=this._element;if(this._elemIsActive(_))return;const R=this._getActiveElem(),q=R?z.trigger(R,JI,{relatedTarget:_}):null;z.trigger(_,eP,{relatedTarget:R}).defaultPrevented||q&&q.defaultPrevented||(this._deactivate(R,_),this._activate(_,R))}_activate(_,R){if(!_)return;_.classList.add(Ao),this._activate(ee.getElementFromSelector(_));const q=()=>{if(_.getAttribute("role")!=="tab"){_.classList.add(pg);return}_.removeAttribute("tabindex"),_.setAttribute("aria-selected",!0),this._toggleDropDown(_,!0),z.trigger(_,tP,{relatedTarget:R})};this._queueCallback(q,_,_.classList.contains(W0))}_deactivate(_,R){if(!_)return;_.classList.remove(Ao),_.blur(),this._deactivate(ee.getElementFromSelector(_));const q=()=>{if(_.getAttribute("role")!=="tab"){_.classList.remove(pg);return}_.setAttribute("aria-selected",!1),_.setAttribute("tabindex","-1"),this._toggleDropDown(_,!1),z.trigger(_,QI,{relatedTarget:R})};this._queueCallback(q,_,_.classList.contains(W0))}_keydown(_){if(![rP,B0,oP,V0,gg,z0].includes(_.key))return;_.stopPropagation(),_.preventDefault();const R=this._getChildren().filter(ye=>!b(ye));let q;if([gg,z0].includes(_.key))q=R[_.key===gg?0:R.length-1];else{const ye=[B0,V0].includes(_.key);q=te(R,_.target,ye,!0)}q&&(q.focus({preventScroll:!0}),Mo.getOrCreateInstance(q).show())}_getChildren(){return ee.find(_g,this._parent)}_getActiveElem(){return this._getChildren().find(_=>this._elemIsActive(_))||null}_setInitialAttributes(_,R){this._setAttributeIfNotExists(_,"role","tablist");for(const q of R)this._setInitialAttributesOnChild(q)}_setInitialAttributesOnChild(_){_=this._getInnerElement(_);const R=this._elemIsActive(_),q=this._getOuterElement(_);_.setAttribute("aria-selected",R),q!==_&&this._setAttributeIfNotExists(q,"role","presentation"),R||_.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(_,"role","tab"),this._setInitialAttributesOnTargetPanel(_)}_setInitialAttributesOnTargetPanel(_){const R=ee.getElementFromSelector(_);R&&(this._setAttributeIfNotExists(R,"role","tabpanel"),_.id&&this._setAttributeIfNotExists(R,"aria-labelledby",`${_.id}`))}_toggleDropDown(_,R){const q=this._getOuterElement(_);if(!q.classList.contains(aP))return;const ye=(Pe,Me)=>{const rt=ee.findOne(Pe,q);rt&&rt.classList.toggle(Me,R)};ye(H0,Ao),ye(lP,pg),q.setAttribute("aria-expanded",R)}_setAttributeIfNotExists(_,R,q){_.hasAttribute(R)||_.setAttribute(R,q)}_elemIsActive(_){return _.classList.contains(Ao)}_getInnerElement(_){return _.matches(_g)?_:ee.findOne(_g,_)}_getOuterElement(_){return _.closest(uP)||_}static jQueryInterface(_){return this.each(function(){const R=Mo.getOrCreateInstance(this);if(typeof _=="string"){if(R[_]===void 0||_.startsWith("_")||_==="constructor")throw new TypeError(`No method named "${_}"`);R[_]()}})}}z.on(document,nP,Y0,function(G){["A","AREA"].includes(this.tagName)&&G.preventDefault(),!b(this)&&Mo.getOrCreateInstance(this).show()}),z.on(window,sP,()=>{for(const G of ee.find(hP))Mo.getOrCreateInstance(G)}),P(Mo);const fP="toast",xr=".bs.toast",gP=`mouseover${xr}`,pP=`mouseout${xr}`,mP=`focusin${xr}`,_P=`focusout${xr}`,yP=`hide${xr}`,vP=`hidden${xr}`,bP=`show${xr}`,wP=`shown${xr}`,xP="fade",j0="hide",ad="show",ld="showing",EP={animation:"boolean",autohide:"boolean",delay:"number"},SP={animation:!0,autohide:!0,delay:5e3};class ic extends j{constructor(_,R){super(_,R),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return SP}static get DefaultType(){return EP}static get NAME(){return fP}show(){if(z.trigger(this._element,bP).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add(xP);const R=()=>{this._element.classList.remove(ld),z.trigger(this._element,wP),this._maybeScheduleHide()};this._element.classList.remove(j0),w(this._element),this._element.classList.add(ad,ld),this._queueCallback(R,this._element,this._config.animation)}hide(){if(!this.isShown()||z.trigger(this._element,yP).defaultPrevented)return;const R=()=>{this._element.classList.add(j0),this._element.classList.remove(ld,ad),z.trigger(this._element,vP)};this._element.classList.add(ld),this._queueCallback(R,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(ad),super.dispose()}isShown(){return this._element.classList.contains(ad)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(_,R){switch(_.type){case"mouseover":case"mouseout":{this._hasMouseInteraction=R;break}case"focusin":case"focusout":{this._hasKeyboardInteraction=R;break}}if(R){this._clearTimeout();return}const q=_.relatedTarget;this._element===q||this._element.contains(q)||this._maybeScheduleHide()}_setListeners(){z.on(this._element,gP,_=>this._onInteraction(_,!0)),z.on(this._element,pP,_=>this._onInteraction(_,!1)),z.on(this._element,mP,_=>this._onInteraction(_,!0)),z.on(this._element,_P,_=>this._onInteraction(_,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(_){return this.each(function(){const R=ic.getOrCreateInstance(this,_);if(typeof _=="string"){if(typeof R[_]>"u")throw new TypeError(`No method named "${_}"`);R[_](this)}})}}return fe(ic),P(ic),{Alert:Ze,Button:ae,Carousel:Sa,Collapse:Ta,Dropdown:Zi,Modal:Co,Offcanvas:Hs,Popover:od,ScrollSpy:nc,Tab:Mo,Toast:ic,Tooltip:To}})})(AP);/** + */(function(t,e){(function(n,i){t.exports=i(_2)})(lx,function(n){function i(G){const _=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(G){for(const R in G)if(R!=="default"){const q=Object.getOwnPropertyDescriptor(G,R);Object.defineProperty(_,R,q.get?q:{enumerable:!0,get:()=>G[R]})}}return _.default=G,Object.freeze(_)}const s=i(n),r=new Map,o={set(G,_,R){r.has(G)||r.set(G,new Map);const q=r.get(G);if(!q.has(_)&&q.size!==0){console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(q.keys())[0]}.`);return}q.set(_,R)},get(G,_){return r.has(G)&&r.get(G).get(_)||null},remove(G,_){if(!r.has(G))return;const R=r.get(G);R.delete(_),R.size===0&&r.delete(G)}},a=1e6,l=1e3,c="transitionend",u=G=>(G&&window.CSS&&window.CSS.escape&&(G=G.replace(/#([^\s"#']+)/g,(_,R)=>`#${CSS.escape(R)}`)),G),d=G=>G==null?`${G}`:Object.prototype.toString.call(G).match(/\s([a-z]+)/i)[1].toLowerCase(),h=G=>{do G+=Math.floor(Math.random()*a);while(document.getElementById(G));return G},f=G=>{if(!G)return 0;let{transitionDuration:_,transitionDelay:R}=window.getComputedStyle(G);const q=Number.parseFloat(_),ye=Number.parseFloat(R);return!q&&!ye?0:(_=_.split(",")[0],R=R.split(",")[0],(Number.parseFloat(_)+Number.parseFloat(R))*l)},p=G=>{G.dispatchEvent(new Event(c))},m=G=>!G||typeof G!="object"?!1:(typeof G.jquery<"u"&&(G=G[0]),typeof G.nodeType<"u"),y=G=>m(G)?G.jquery?G[0]:G:typeof G=="string"&&G.length>0?document.querySelector(u(G)):null,v=G=>{if(!m(G)||G.getClientRects().length===0)return!1;const _=getComputedStyle(G).getPropertyValue("visibility")==="visible",R=G.closest("details:not([open])");if(!R)return _;if(R!==G){const q=G.closest("summary");if(q&&q.parentNode!==R||q===null)return!1}return _},b=G=>!G||G.nodeType!==Node.ELEMENT_NODE||G.classList.contains("disabled")?!0:typeof G.disabled<"u"?G.disabled:G.hasAttribute("disabled")&&G.getAttribute("disabled")!=="false",E=G=>{if(!document.documentElement.attachShadow)return null;if(typeof G.getRootNode=="function"){const _=G.getRootNode();return _ instanceof ShadowRoot?_:null}return G instanceof ShadowRoot?G:G.parentNode?E(G.parentNode):null},C=()=>{},w=G=>{G.offsetHeight},x=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,T=[],k=G=>{document.readyState==="loading"?(T.length||document.addEventListener("DOMContentLoaded",()=>{for(const _ of T)_()}),T.push(G)):G()},A=()=>document.documentElement.dir==="rtl",P=G=>{k(()=>{const _=x();if(_){const R=G.NAME,q=_.fn[R];_.fn[R]=G.jQueryInterface,_.fn[R].Constructor=G,_.fn[R].noConflict=()=>(_.fn[R]=q,G.jQueryInterface)}})},F=(G,_=[],R=G)=>typeof G=="function"?G(..._):R,H=(G,_,R=!0)=>{if(!R){F(G);return}const ye=f(_)+5;let Pe=!1;const Ie=({target:rt})=>{rt===_&&(Pe=!0,_.removeEventListener(c,Ie),F(G))};_.addEventListener(c,Ie),setTimeout(()=>{Pe||p(_)},ye)},te=(G,_,R,q)=>{const ye=G.length;let Pe=G.indexOf(_);return Pe===-1?!R&&q?G[ye-1]:G[0]:(Pe+=R?1:-1,q&&(Pe=(Pe+ye)%ye),G[Math.max(0,Math.min(Pe,ye-1))])},N=/[^.]*(?=\..*)\.|.*/,L=/\..*/,I=/::\d+$/,W={};let X=1;const J={mouseenter:"mouseover",mouseleave:"mouseout"},ne=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 ue(G,_){return _&&`${_}::${X++}`||G.uidEvent||X++}function Y(G){const _=ue(G);return G.uidEvent=_,W[_]=W[_]||{},W[_]}function Z(G,_){return function R(q){return ge(q,{delegateTarget:G}),R.oneOff&&z.off(G,q.type,_),_.apply(G,[q])}}function M(G,_,R){return function q(ye){const Pe=G.querySelectorAll(_);for(let{target:Ie}=ye;Ie&&Ie!==this;Ie=Ie.parentNode)for(const rt of Pe)if(rt===Ie)return ge(ye,{delegateTarget:Ie}),q.oneOff&&z.off(G,ye.type,_,R),R.apply(Ie,[ye])}}function ie(G,_,R=null){return Object.values(G).find(q=>q.callable===_&&q.delegationSelector===R)}function le(G,_,R){const q=typeof _=="string",ye=q?R:_||R;let Pe=ve(G);return ne.has(Pe)||(Pe=G),[q,ye,Pe]}function $(G,_,R,q,ye){if(typeof _!="string"||!G)return;let[Pe,Ie,rt]=le(_,R,q);_ in J&&(Ie=(CP=>function(Ma){if(!Ma.relatedTarget||Ma.relatedTarget!==Ma.delegateTarget&&!Ma.delegateTarget.contains(Ma.relatedTarget))return CP.call(this,Ma)})(Ie));const oi=Y(G),Oi=oi[rt]||(oi[rt]={}),Cn=ie(Oi,Ie,Pe?R:null);if(Cn){Cn.oneOff=Cn.oneOff&&ye;return}const ms=ue(Ie,_.replace(N,"")),Ji=Pe?M(G,R,Ie):Z(G,Ie);Ji.delegationSelector=Pe?R:null,Ji.callable=Ie,Ji.oneOff=ye,Ji.uidEvent=ms,Oi[ms]=Ji,G.addEventListener(rt,Ji,Pe)}function oe(G,_,R,q,ye){const Pe=ie(_[R],q,ye);Pe&&(G.removeEventListener(R,Pe,!!ye),delete _[R][Pe.uidEvent])}function de(G,_,R,q){const ye=_[R]||{};for(const[Pe,Ie]of Object.entries(ye))Pe.includes(q)&&oe(G,_,R,Ie.callable,Ie.delegationSelector)}function ve(G){return G=G.replace(L,""),J[G]||G}const z={on(G,_,R,q){$(G,_,R,q,!1)},one(G,_,R,q){$(G,_,R,q,!0)},off(G,_,R,q){if(typeof _!="string"||!G)return;const[ye,Pe,Ie]=le(_,R,q),rt=Ie!==_,oi=Y(G),Oi=oi[Ie]||{},Cn=_.startsWith(".");if(typeof Pe<"u"){if(!Object.keys(Oi).length)return;oe(G,oi,Ie,Pe,ye?R:null);return}if(Cn)for(const ms of Object.keys(oi))de(G,oi,ms,_.slice(1));for(const[ms,Ji]of Object.entries(Oi)){const cd=ms.replace(I,"");(!rt||_.includes(cd))&&oe(G,oi,Ie,Ji.callable,Ji.delegationSelector)}},trigger(G,_,R){if(typeof _!="string"||!G)return null;const q=x(),ye=ve(_),Pe=_!==ye;let Ie=null,rt=!0,oi=!0,Oi=!1;Pe&&q&&(Ie=q.Event(_,R),q(G).trigger(Ie),rt=!Ie.isPropagationStopped(),oi=!Ie.isImmediatePropagationStopped(),Oi=Ie.isDefaultPrevented());const Cn=ge(new Event(_,{bubbles:rt,cancelable:!0}),R);return Oi&&Cn.preventDefault(),oi&&G.dispatchEvent(Cn),Cn.defaultPrevented&&Ie&&Ie.preventDefault(),Cn}};function ge(G,_={}){for(const[R,q]of Object.entries(_))try{G[R]=q}catch{Object.defineProperty(G,R,{configurable:!0,get(){return q}})}return G}function S(G){if(G==="true")return!0;if(G==="false")return!1;if(G===Number(G).toString())return Number(G);if(G===""||G==="null")return null;if(typeof G!="string")return G;try{return JSON.parse(decodeURIComponent(G))}catch{return G}}function O(G){return G.replace(/[A-Z]/g,_=>`-${_.toLowerCase()}`)}const K={setDataAttribute(G,_,R){G.setAttribute(`data-bs-${O(_)}`,R)},removeDataAttribute(G,_){G.removeAttribute(`data-bs-${O(_)}`)},getDataAttributes(G){if(!G)return{};const _={},R=Object.keys(G.dataset).filter(q=>q.startsWith("bs")&&!q.startsWith("bsConfig"));for(const q of R){let ye=q.replace(/^bs/,"");ye=ye.charAt(0).toLowerCase()+ye.slice(1,ye.length),_[ye]=S(G.dataset[q])}return _},getDataAttribute(G,_){return S(G.getAttribute(`data-bs-${O(_)}`))}};class U{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(_){return _=this._mergeConfigObj(_),_=this._configAfterMerge(_),this._typeCheckConfig(_),_}_configAfterMerge(_){return _}_mergeConfigObj(_,R){const q=m(R)?K.getDataAttribute(R,"config"):{};return{...this.constructor.Default,...typeof q=="object"?q:{},...m(R)?K.getDataAttributes(R):{},...typeof _=="object"?_:{}}}_typeCheckConfig(_,R=this.constructor.DefaultType){for(const[q,ye]of Object.entries(R)){const Pe=_[q],Ie=m(Pe)?"element":d(Pe);if(!new RegExp(ye).test(Ie))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${q}" provided type "${Ie}" but expected type "${ye}".`)}}}const re="5.3.2";class j extends U{constructor(_,R){super(),_=y(_),_&&(this._element=_,this._config=this._getConfig(R),o.set(this._element,this.constructor.DATA_KEY,this))}dispose(){o.remove(this._element,this.constructor.DATA_KEY),z.off(this._element,this.constructor.EVENT_KEY);for(const _ of Object.getOwnPropertyNames(this))this[_]=null}_queueCallback(_,R,q=!0){H(_,R,q)}_getConfig(_){return _=this._mergeConfigObj(_,this._element),_=this._configAfterMerge(_),this._typeCheckConfig(_),_}static getInstance(_){return o.get(y(_),this.DATA_KEY)}static getOrCreateInstance(_,R={}){return this.getInstance(_)||new this(_,typeof R=="object"?R:null)}static get VERSION(){return re}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(_){return`${_}${this.EVENT_KEY}`}}const se=G=>{let _=G.getAttribute("data-bs-target");if(!_||_==="#"){let R=G.getAttribute("href");if(!R||!R.includes("#")&&!R.startsWith("."))return null;R.includes("#")&&!R.startsWith("#")&&(R=`#${R.split("#")[1]}`),_=R&&R!=="#"?u(R.trim()):null}return _},ee={find(G,_=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(_,G))},findOne(G,_=document.documentElement){return Element.prototype.querySelector.call(_,G)},children(G,_){return[].concat(...G.children).filter(R=>R.matches(_))},parents(G,_){const R=[];let q=G.parentNode.closest(_);for(;q;)R.push(q),q=q.parentNode.closest(_);return R},prev(G,_){let R=G.previousElementSibling;for(;R;){if(R.matches(_))return[R];R=R.previousElementSibling}return[]},next(G,_){let R=G.nextElementSibling;for(;R;){if(R.matches(_))return[R];R=R.nextElementSibling}return[]},focusableChildren(G){const _=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(R=>`${R}:not([tabindex^="-"])`).join(",");return this.find(_,G).filter(R=>!b(R)&&v(R))},getSelectorFromElement(G){const _=se(G);return _&&ee.findOne(_)?_:null},getElementFromSelector(G){const _=se(G);return _?ee.findOne(_):null},getMultipleElementsFromSelector(G){const _=se(G);return _?ee.find(_):[]}},fe=(G,_="hide")=>{const R=`click.dismiss${G.EVENT_KEY}`,q=G.NAME;z.on(document,R,`[data-bs-dismiss="${q}"]`,function(ye){if(["A","AREA"].includes(this.tagName)&&ye.preventDefault(),b(this))return;const Pe=ee.getElementFromSelector(this)||this.closest(`.${q}`);G.getOrCreateInstance(Pe)[_]()})},me="alert",Le=".bs.alert",Ae=`close${Le}`,ze=`closed${Le}`,Be="fade",it="show";class Ze extends j{static get NAME(){return me}close(){if(z.trigger(this._element,Ae).defaultPrevented)return;this._element.classList.remove(it);const R=this._element.classList.contains(Be);this._queueCallback(()=>this._destroyElement(),this._element,R)}_destroyElement(){this._element.remove(),z.trigger(this._element,ze),this.dispose()}static jQueryInterface(_){return this.each(function(){const R=Ze.getOrCreateInstance(this);if(typeof _=="string"){if(R[_]===void 0||_.startsWith("_")||_==="constructor")throw new TypeError(`No method named "${_}"`);R[_](this)}})}}fe(Ze,"close"),P(Ze);const Mt="button",Un=".bs.button",Ri=".data-api",wi="active",Xi='[data-bs-toggle="button"]',Ut=`click${Un}${Ri}`;class ae extends j{static get NAME(){return Mt}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle(wi))}static jQueryInterface(_){return this.each(function(){const R=ae.getOrCreateInstance(this);_==="toggle"&&R[_]()})}}z.on(document,Ut,Xi,G=>{G.preventDefault();const _=G.target.closest(Xi);ae.getOrCreateInstance(_).toggle()}),P(ae);const Te="swipe",he=".bs.swipe",ke=`touchstart${he}`,De=`touchmove${he}`,Ht=`touchend${he}`,un=`pointerdown${he}`,Di=`pointerup${he}`,zs="touch",dn="pen",En="pointer-event",Sn=40,ii={endCallback:null,leftCallback:null,rightCallback:null},si={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class ri extends U{constructor(_,R){super(),this._element=_,!(!_||!ri.isSupported())&&(this._config=this._getConfig(R),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return ii}static get DefaultType(){return si}static get NAME(){return Te}dispose(){z.off(this._element,he)}_start(_){if(!this._supportPointerEvents){this._deltaX=_.touches[0].clientX;return}this._eventIsPointerPenTouch(_)&&(this._deltaX=_.clientX)}_end(_){this._eventIsPointerPenTouch(_)&&(this._deltaX=_.clientX-this._deltaX),this._handleSwipe(),F(this._config.endCallback)}_move(_){this._deltaX=_.touches&&_.touches.length>1?0:_.touches[0].clientX-this._deltaX}_handleSwipe(){const _=Math.abs(this._deltaX);if(_<=Sn)return;const R=_/this._deltaX;this._deltaX=0,R&&F(R>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(z.on(this._element,un,_=>this._start(_)),z.on(this._element,Di,_=>this._end(_)),this._element.classList.add(En)):(z.on(this._element,ke,_=>this._start(_)),z.on(this._element,De,_=>this._move(_)),z.on(this._element,Ht,_=>this._end(_)))}_eventIsPointerPenTouch(_){return this._supportPointerEvents&&(_.pointerType===dn||_.pointerType===zs)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const qi="carousel",zt=".bs.carousel",$i=".data-api",ig="ArrowLeft",cA="ArrowRight",uA=500,Ql="next",xa="prev",Ea="left",Qu="right",dA=`slide${zt}`,sg=`slid${zt}`,hA=`keydown${zt}`,fA=`mouseenter${zt}`,gA=`mouseleave${zt}`,pA=`dragstart${zt}`,mA=`load${zt}${$i}`,_A=`click${zt}${$i}`,o0="carousel",ed="active",yA="slide",vA="carousel-item-end",bA="carousel-item-start",wA="carousel-item-next",xA="carousel-item-prev",a0=".active",l0=".carousel-item",EA=a0+l0,SA=".carousel-item img",CA=".carousel-indicators",TA="[data-bs-slide], [data-bs-slide-to]",kA='[data-bs-ride="carousel"]',AA={[ig]:Qu,[cA]:Ea},MA={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},IA={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class Sa extends j{constructor(_,R){super(_,R),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=ee.findOne(CA,this._element),this._addEventListeners(),this._config.ride===o0&&this.cycle()}static get Default(){return MA}static get DefaultType(){return IA}static get NAME(){return qi}next(){this._slide(Ql)}nextWhenVisible(){!document.hidden&&v(this._element)&&this.next()}prev(){this._slide(xa)}pause(){this._isSliding&&p(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){z.one(this._element,sg,()=>this.cycle());return}this.cycle()}}to(_){const R=this._getItems();if(_>R.length-1||_<0)return;if(this._isSliding){z.one(this._element,sg,()=>this.to(_));return}const q=this._getItemIndex(this._getActive());if(q===_)return;const ye=_>q?Ql:xa;this._slide(ye,R[_])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(_){return _.defaultInterval=_.interval,_}_addEventListeners(){this._config.keyboard&&z.on(this._element,hA,_=>this._keydown(_)),this._config.pause==="hover"&&(z.on(this._element,fA,()=>this.pause()),z.on(this._element,gA,()=>this._maybeEnableCycle())),this._config.touch&&ri.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const q of ee.find(SA,this._element))z.on(q,pA,ye=>ye.preventDefault());const R={leftCallback:()=>this._slide(this._directionToOrder(Ea)),rightCallback:()=>this._slide(this._directionToOrder(Qu)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),uA+this._config.interval))}};this._swipeHelper=new ri(this._element,R)}_keydown(_){if(/input|textarea/i.test(_.target.tagName))return;const R=AA[_.key];R&&(_.preventDefault(),this._slide(this._directionToOrder(R)))}_getItemIndex(_){return this._getItems().indexOf(_)}_setActiveIndicatorElement(_){if(!this._indicatorsElement)return;const R=ee.findOne(a0,this._indicatorsElement);R.classList.remove(ed),R.removeAttribute("aria-current");const q=ee.findOne(`[data-bs-slide-to="${_}"]`,this._indicatorsElement);q&&(q.classList.add(ed),q.setAttribute("aria-current","true"))}_updateInterval(){const _=this._activeElement||this._getActive();if(!_)return;const R=Number.parseInt(_.getAttribute("data-bs-interval"),10);this._config.interval=R||this._config.defaultInterval}_slide(_,R=null){if(this._isSliding)return;const q=this._getActive(),ye=_===Ql,Pe=R||te(this._getItems(),q,ye,this._config.wrap);if(Pe===q)return;const Ie=this._getItemIndex(Pe),rt=cd=>z.trigger(this._element,cd,{relatedTarget:Pe,direction:this._orderToDirection(_),from:this._getItemIndex(q),to:Ie});if(rt(dA).defaultPrevented||!q||!Pe)return;const Oi=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(Ie),this._activeElement=Pe;const Cn=ye?bA:vA,ms=ye?wA:xA;Pe.classList.add(ms),w(Pe),q.classList.add(Cn),Pe.classList.add(Cn);const Ji=()=>{Pe.classList.remove(Cn,ms),Pe.classList.add(ed),q.classList.remove(ed,ms,Cn),this._isSliding=!1,rt(sg)};this._queueCallback(Ji,q,this._isAnimated()),Oi&&this.cycle()}_isAnimated(){return this._element.classList.contains(yA)}_getActive(){return ee.findOne(EA,this._element)}_getItems(){return ee.find(l0,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(_){return A()?_===Ea?xa:Ql:_===Ea?Ql:xa}_orderToDirection(_){return A()?_===xa?Ea:Qu:_===xa?Qu:Ea}static jQueryInterface(_){return this.each(function(){const R=Sa.getOrCreateInstance(this,_);if(typeof _=="number"){R.to(_);return}if(typeof _=="string"){if(R[_]===void 0||_.startsWith("_")||_==="constructor")throw new TypeError(`No method named "${_}"`);R[_]()}})}}z.on(document,_A,TA,function(G){const _=ee.getElementFromSelector(this);if(!_||!_.classList.contains(o0))return;G.preventDefault();const R=Sa.getOrCreateInstance(_),q=this.getAttribute("data-bs-slide-to");if(q){R.to(q),R._maybeEnableCycle();return}if(K.getDataAttribute(this,"slide")==="next"){R.next(),R._maybeEnableCycle();return}R.prev(),R._maybeEnableCycle()}),z.on(window,mA,()=>{const G=ee.find(kA);for(const _ of G)Sa.getOrCreateInstance(_)}),P(Sa);const PA="collapse",ec=".bs.collapse",RA=".data-api",DA=`show${ec}`,$A=`shown${ec}`,LA=`hide${ec}`,OA=`hidden${ec}`,NA=`click${ec}${RA}`,rg="show",Ca="collapse",td="collapsing",FA="collapsed",BA=`:scope .${Ca} .${Ca}`,VA="collapse-horizontal",zA="width",WA="height",HA=".collapse.show, .collapse.collapsing",og='[data-bs-toggle="collapse"]',YA={parent:null,toggle:!0},jA={parent:"(null|element)",toggle:"boolean"};class Ta extends j{constructor(_,R){super(_,R),this._isTransitioning=!1,this._triggerArray=[];const q=ee.find(og);for(const ye of q){const Pe=ee.getSelectorFromElement(ye),Ie=ee.find(Pe).filter(rt=>rt===this._element);Pe!==null&&Ie.length&&this._triggerArray.push(ye)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return YA}static get DefaultType(){return jA}static get NAME(){return PA}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let _=[];if(this._config.parent&&(_=this._getFirstLevelChildren(HA).filter(rt=>rt!==this._element).map(rt=>Ta.getOrCreateInstance(rt,{toggle:!1}))),_.length&&_[0]._isTransitioning||z.trigger(this._element,DA).defaultPrevented)return;for(const rt of _)rt.hide();const q=this._getDimension();this._element.classList.remove(Ca),this._element.classList.add(td),this._element.style[q]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const ye=()=>{this._isTransitioning=!1,this._element.classList.remove(td),this._element.classList.add(Ca,rg),this._element.style[q]="",z.trigger(this._element,$A)},Ie=`scroll${q[0].toUpperCase()+q.slice(1)}`;this._queueCallback(ye,this._element,!0),this._element.style[q]=`${this._element[Ie]}px`}hide(){if(this._isTransitioning||!this._isShown()||z.trigger(this._element,LA).defaultPrevented)return;const R=this._getDimension();this._element.style[R]=`${this._element.getBoundingClientRect()[R]}px`,w(this._element),this._element.classList.add(td),this._element.classList.remove(Ca,rg);for(const ye of this._triggerArray){const Pe=ee.getElementFromSelector(ye);Pe&&!this._isShown(Pe)&&this._addAriaAndCollapsedClass([ye],!1)}this._isTransitioning=!0;const q=()=>{this._isTransitioning=!1,this._element.classList.remove(td),this._element.classList.add(Ca),z.trigger(this._element,OA)};this._element.style[R]="",this._queueCallback(q,this._element,!0)}_isShown(_=this._element){return _.classList.contains(rg)}_configAfterMerge(_){return _.toggle=!!_.toggle,_.parent=y(_.parent),_}_getDimension(){return this._element.classList.contains(VA)?zA:WA}_initializeChildren(){if(!this._config.parent)return;const _=this._getFirstLevelChildren(og);for(const R of _){const q=ee.getElementFromSelector(R);q&&this._addAriaAndCollapsedClass([R],this._isShown(q))}}_getFirstLevelChildren(_){const R=ee.find(BA,this._config.parent);return ee.find(_,this._config.parent).filter(q=>!R.includes(q))}_addAriaAndCollapsedClass(_,R){if(_.length)for(const q of _)q.classList.toggle(FA,!R),q.setAttribute("aria-expanded",R)}static jQueryInterface(_){const R={};return typeof _=="string"&&/show|hide/.test(_)&&(R.toggle=!1),this.each(function(){const q=Ta.getOrCreateInstance(this,R);if(typeof _=="string"){if(typeof q[_]>"u")throw new TypeError(`No method named "${_}"`);q[_]()}})}}z.on(document,NA,og,function(G){(G.target.tagName==="A"||G.delegateTarget&&G.delegateTarget.tagName==="A")&&G.preventDefault();for(const _ of ee.getMultipleElementsFromSelector(this))Ta.getOrCreateInstance(_,{toggle:!1}).toggle()}),P(Ta);const c0="dropdown",Eo=".bs.dropdown",ag=".data-api",KA="Escape",u0="Tab",UA="ArrowUp",d0="ArrowDown",GA=2,XA=`hide${Eo}`,qA=`hidden${Eo}`,ZA=`show${Eo}`,JA=`shown${Eo}`,h0=`click${Eo}${ag}`,f0=`keydown${Eo}${ag}`,QA=`keyup${Eo}${ag}`,ka="show",eM="dropup",tM="dropend",nM="dropstart",iM="dropup-center",sM="dropdown-center",So='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',rM=`${So}.${ka}`,nd=".dropdown-menu",oM=".navbar",aM=".navbar-nav",lM=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",cM=A()?"top-end":"top-start",uM=A()?"top-start":"top-end",dM=A()?"bottom-end":"bottom-start",hM=A()?"bottom-start":"bottom-end",fM=A()?"left-start":"right-start",gM=A()?"right-start":"left-start",pM="top",mM="bottom",_M={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},yM={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class Zi extends j{constructor(_,R){super(_,R),this._popper=null,this._parent=this._element.parentNode,this._menu=ee.next(this._element,nd)[0]||ee.prev(this._element,nd)[0]||ee.findOne(nd,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return _M}static get DefaultType(){return yM}static get NAME(){return c0}toggle(){return this._isShown()?this.hide():this.show()}show(){if(b(this._element)||this._isShown())return;const _={relatedTarget:this._element};if(!z.trigger(this._element,ZA,_).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(aM))for(const q of[].concat(...document.body.children))z.on(q,"mouseover",C);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(ka),this._element.classList.add(ka),z.trigger(this._element,JA,_)}}hide(){if(b(this._element)||!this._isShown())return;const _={relatedTarget:this._element};this._completeHide(_)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(_){if(!z.trigger(this._element,XA,_).defaultPrevented){if("ontouchstart"in document.documentElement)for(const q of[].concat(...document.body.children))z.off(q,"mouseover",C);this._popper&&this._popper.destroy(),this._menu.classList.remove(ka),this._element.classList.remove(ka),this._element.setAttribute("aria-expanded","false"),K.removeDataAttribute(this._menu,"popper"),z.trigger(this._element,qA,_)}}_getConfig(_){if(_=super._getConfig(_),typeof _.reference=="object"&&!m(_.reference)&&typeof _.reference.getBoundingClientRect!="function")throw new TypeError(`${c0.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return _}_createPopper(){if(typeof s>"u")throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let _=this._element;this._config.reference==="parent"?_=this._parent:m(this._config.reference)?_=y(this._config.reference):typeof this._config.reference=="object"&&(_=this._config.reference);const R=this._getPopperConfig();this._popper=s.createPopper(_,this._menu,R)}_isShown(){return this._menu.classList.contains(ka)}_getPlacement(){const _=this._parent;if(_.classList.contains(tM))return fM;if(_.classList.contains(nM))return gM;if(_.classList.contains(iM))return pM;if(_.classList.contains(sM))return mM;const R=getComputedStyle(this._menu).getPropertyValue("--bs-position").trim()==="end";return _.classList.contains(eM)?R?uM:cM:R?hM:dM}_detectNavbar(){return this._element.closest(oM)!==null}_getOffset(){const{offset:_}=this._config;return typeof _=="string"?_.split(",").map(R=>Number.parseInt(R,10)):typeof _=="function"?R=>_(R,this._element):_}_getPopperConfig(){const _={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(K.setDataAttribute(this._menu,"popper","static"),_.modifiers=[{name:"applyStyles",enabled:!1}]),{..._,...F(this._config.popperConfig,[_])}}_selectMenuItem({key:_,target:R}){const q=ee.find(lM,this._menu).filter(ye=>v(ye));q.length&&te(q,R,_===d0,!q.includes(R)).focus()}static jQueryInterface(_){return this.each(function(){const R=Zi.getOrCreateInstance(this,_);if(typeof _=="string"){if(typeof R[_]>"u")throw new TypeError(`No method named "${_}"`);R[_]()}})}static clearMenus(_){if(_.button===GA||_.type==="keyup"&&_.key!==u0)return;const R=ee.find(rM);for(const q of R){const ye=Zi.getInstance(q);if(!ye||ye._config.autoClose===!1)continue;const Pe=_.composedPath(),Ie=Pe.includes(ye._menu);if(Pe.includes(ye._element)||ye._config.autoClose==="inside"&&!Ie||ye._config.autoClose==="outside"&&Ie||ye._menu.contains(_.target)&&(_.type==="keyup"&&_.key===u0||/input|select|option|textarea|form/i.test(_.target.tagName)))continue;const rt={relatedTarget:ye._element};_.type==="click"&&(rt.clickEvent=_),ye._completeHide(rt)}}static dataApiKeydownHandler(_){const R=/input|textarea/i.test(_.target.tagName),q=_.key===KA,ye=[UA,d0].includes(_.key);if(!ye&&!q||R&&!q)return;_.preventDefault();const Pe=this.matches(So)?this:ee.prev(this,So)[0]||ee.next(this,So)[0]||ee.findOne(So,_.delegateTarget.parentNode),Ie=Zi.getOrCreateInstance(Pe);if(ye){_.stopPropagation(),Ie.show(),Ie._selectMenuItem(_);return}Ie._isShown()&&(_.stopPropagation(),Ie.hide(),Pe.focus())}}z.on(document,f0,So,Zi.dataApiKeydownHandler),z.on(document,f0,nd,Zi.dataApiKeydownHandler),z.on(document,h0,Zi.clearMenus),z.on(document,QA,Zi.clearMenus),z.on(document,h0,So,function(G){G.preventDefault(),Zi.getOrCreateInstance(this).toggle()}),P(Zi);const g0="backdrop",vM="fade",p0="show",m0=`mousedown.bs.${g0}`,bM={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},wM={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class _0 extends U{constructor(_){super(),this._config=this._getConfig(_),this._isAppended=!1,this._element=null}static get Default(){return bM}static get DefaultType(){return wM}static get NAME(){return g0}show(_){if(!this._config.isVisible){F(_);return}this._append();const R=this._getElement();this._config.isAnimated&&w(R),R.classList.add(p0),this._emulateAnimation(()=>{F(_)})}hide(_){if(!this._config.isVisible){F(_);return}this._getElement().classList.remove(p0),this._emulateAnimation(()=>{this.dispose(),F(_)})}dispose(){this._isAppended&&(z.off(this._element,m0),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const _=document.createElement("div");_.className=this._config.className,this._config.isAnimated&&_.classList.add(vM),this._element=_}return this._element}_configAfterMerge(_){return _.rootElement=y(_.rootElement),_}_append(){if(this._isAppended)return;const _=this._getElement();this._config.rootElement.append(_),z.on(_,m0,()=>{F(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(_){H(_,this._getElement(),this._config.isAnimated)}}const xM="focustrap",id=".bs.focustrap",EM=`focusin${id}`,SM=`keydown.tab${id}`,CM="Tab",TM="forward",y0="backward",kM={autofocus:!0,trapElement:null},AM={autofocus:"boolean",trapElement:"element"};class v0 extends U{constructor(_){super(),this._config=this._getConfig(_),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return kM}static get DefaultType(){return AM}static get NAME(){return xM}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),z.off(document,id),z.on(document,EM,_=>this._handleFocusin(_)),z.on(document,SM,_=>this._handleKeydown(_)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,z.off(document,id))}_handleFocusin(_){const{trapElement:R}=this._config;if(_.target===document||_.target===R||R.contains(_.target))return;const q=ee.focusableChildren(R);q.length===0?R.focus():this._lastTabNavDirection===y0?q[q.length-1].focus():q[0].focus()}_handleKeydown(_){_.key===CM&&(this._lastTabNavDirection=_.shiftKey?y0:TM)}}const b0=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",w0=".sticky-top",sd="padding-right",x0="margin-right";class lg{constructor(){this._element=document.body}getWidth(){const _=document.documentElement.clientWidth;return Math.abs(window.innerWidth-_)}hide(){const _=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,sd,R=>R+_),this._setElementAttributes(b0,sd,R=>R+_),this._setElementAttributes(w0,x0,R=>R-_)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,sd),this._resetElementAttributes(b0,sd),this._resetElementAttributes(w0,x0)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(_,R,q){const ye=this.getWidth(),Pe=Ie=>{if(Ie!==this._element&&window.innerWidth>Ie.clientWidth+ye)return;this._saveInitialAttribute(Ie,R);const rt=window.getComputedStyle(Ie).getPropertyValue(R);Ie.style.setProperty(R,`${q(Number.parseFloat(rt))}px`)};this._applyManipulationCallback(_,Pe)}_saveInitialAttribute(_,R){const q=_.style.getPropertyValue(R);q&&K.setDataAttribute(_,R,q)}_resetElementAttributes(_,R){const q=ye=>{const Pe=K.getDataAttribute(ye,R);if(Pe===null){ye.style.removeProperty(R);return}K.removeDataAttribute(ye,R),ye.style.setProperty(R,Pe)};this._applyManipulationCallback(_,q)}_applyManipulationCallback(_,R){if(m(_)){R(_);return}for(const q of ee.find(_,this._element))R(q)}}const MM="modal",Li=".bs.modal",IM=".data-api",PM="Escape",RM=`hide${Li}`,DM=`hidePrevented${Li}`,E0=`hidden${Li}`,S0=`show${Li}`,$M=`shown${Li}`,LM=`resize${Li}`,OM=`click.dismiss${Li}`,NM=`mousedown.dismiss${Li}`,FM=`keydown.dismiss${Li}`,BM=`click${Li}${IM}`,C0="modal-open",VM="fade",T0="show",cg="modal-static",zM=".modal.show",WM=".modal-dialog",HM=".modal-body",YM='[data-bs-toggle="modal"]',jM={backdrop:!0,focus:!0,keyboard:!0},KM={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Co extends j{constructor(_,R){super(_,R),this._dialog=ee.findOne(WM,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new lg,this._addEventListeners()}static get Default(){return jM}static get DefaultType(){return KM}static get NAME(){return MM}toggle(_){return this._isShown?this.hide():this.show(_)}show(_){this._isShown||this._isTransitioning||z.trigger(this._element,S0,{relatedTarget:_}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(C0),this._adjustDialog(),this._backdrop.show(()=>this._showElement(_)))}hide(){!this._isShown||this._isTransitioning||z.trigger(this._element,RM).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(T0),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){z.off(window,Li),z.off(this._dialog,Li),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new _0({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new v0({trapElement:this._element})}_showElement(_){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;const R=ee.findOne(HM,this._dialog);R&&(R.scrollTop=0),w(this._element),this._element.classList.add(T0);const q=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,z.trigger(this._element,$M,{relatedTarget:_})};this._queueCallback(q,this._dialog,this._isAnimated())}_addEventListeners(){z.on(this._element,FM,_=>{if(_.key===PM){if(this._config.keyboard){this.hide();return}this._triggerBackdropTransition()}}),z.on(window,LM,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),z.on(this._element,NM,_=>{z.one(this._element,OM,R=>{if(!(this._element!==_.target||this._element!==R.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(C0),this._resetAdjustments(),this._scrollBar.reset(),z.trigger(this._element,E0)})}_isAnimated(){return this._element.classList.contains(VM)}_triggerBackdropTransition(){if(z.trigger(this._element,DM).defaultPrevented)return;const R=this._element.scrollHeight>document.documentElement.clientHeight,q=this._element.style.overflowY;q==="hidden"||this._element.classList.contains(cg)||(R||(this._element.style.overflowY="hidden"),this._element.classList.add(cg),this._queueCallback(()=>{this._element.classList.remove(cg),this._queueCallback(()=>{this._element.style.overflowY=q},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const _=this._element.scrollHeight>document.documentElement.clientHeight,R=this._scrollBar.getWidth(),q=R>0;if(q&&!_){const ye=A()?"paddingLeft":"paddingRight";this._element.style[ye]=`${R}px`}if(!q&&_){const ye=A()?"paddingRight":"paddingLeft";this._element.style[ye]=`${R}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(_,R){return this.each(function(){const q=Co.getOrCreateInstance(this,_);if(typeof _=="string"){if(typeof q[_]>"u")throw new TypeError(`No method named "${_}"`);q[_](R)}})}}z.on(document,BM,YM,function(G){const _=ee.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&G.preventDefault(),z.one(_,S0,ye=>{ye.defaultPrevented||z.one(_,E0,()=>{v(this)&&this.focus()})});const R=ee.findOne(zM);R&&Co.getInstance(R).hide(),Co.getOrCreateInstance(_).toggle(this)}),fe(Co),P(Co);const UM="offcanvas",Ws=".bs.offcanvas",k0=".data-api",GM=`load${Ws}${k0}`,XM="Escape",A0="show",M0="showing",I0="hiding",qM="offcanvas-backdrop",P0=".offcanvas.show",ZM=`show${Ws}`,JM=`shown${Ws}`,QM=`hide${Ws}`,R0=`hidePrevented${Ws}`,D0=`hidden${Ws}`,eI=`resize${Ws}`,tI=`click${Ws}${k0}`,nI=`keydown.dismiss${Ws}`,iI='[data-bs-toggle="offcanvas"]',sI={backdrop:!0,keyboard:!0,scroll:!1},rI={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class Hs extends j{constructor(_,R){super(_,R),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return sI}static get DefaultType(){return rI}static get NAME(){return UM}toggle(_){return this._isShown?this.hide():this.show(_)}show(_){if(this._isShown||z.trigger(this._element,ZM,{relatedTarget:_}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||new lg().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(M0);const q=()=>{(!this._config.scroll||this._config.backdrop)&&this._focustrap.activate(),this._element.classList.add(A0),this._element.classList.remove(M0),z.trigger(this._element,JM,{relatedTarget:_})};this._queueCallback(q,this._element,!0)}hide(){if(!this._isShown||z.trigger(this._element,QM).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(I0),this._backdrop.hide();const R=()=>{this._element.classList.remove(A0,I0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new lg().reset(),z.trigger(this._element,D0)};this._queueCallback(R,this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const _=()=>{if(this._config.backdrop==="static"){z.trigger(this._element,R0);return}this.hide()},R=!!this._config.backdrop;return new _0({className:qM,isVisible:R,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:R?_:null})}_initializeFocusTrap(){return new v0({trapElement:this._element})}_addEventListeners(){z.on(this._element,nI,_=>{if(_.key===XM){if(this._config.keyboard){this.hide();return}z.trigger(this._element,R0)}})}static jQueryInterface(_){return this.each(function(){const R=Hs.getOrCreateInstance(this,_);if(typeof _=="string"){if(R[_]===void 0||_.startsWith("_")||_==="constructor")throw new TypeError(`No method named "${_}"`);R[_](this)}})}}z.on(document,tI,iI,function(G){const _=ee.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&G.preventDefault(),b(this))return;z.one(_,D0,()=>{v(this)&&this.focus()});const R=ee.findOne(P0);R&&R!==_&&Hs.getInstance(R).hide(),Hs.getOrCreateInstance(_).toggle(this)}),z.on(window,GM,()=>{for(const G of ee.find(P0))Hs.getOrCreateInstance(G).show()}),z.on(window,eI,()=>{for(const G of ee.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(G).position!=="fixed"&&Hs.getOrCreateInstance(G).hide()}),fe(Hs),P(Hs);const $0={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],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:[]},oI=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),aI=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,lI=(G,_)=>{const R=G.nodeName.toLowerCase();return _.includes(R)?oI.has(R)?!!aI.test(G.nodeValue):!0:_.filter(q=>q instanceof RegExp).some(q=>q.test(R))};function cI(G,_,R){if(!G.length)return G;if(R&&typeof R=="function")return R(G);const ye=new window.DOMParser().parseFromString(G,"text/html"),Pe=[].concat(...ye.body.querySelectorAll("*"));for(const Ie of Pe){const rt=Ie.nodeName.toLowerCase();if(!Object.keys(_).includes(rt)){Ie.remove();continue}const oi=[].concat(...Ie.attributes),Oi=[].concat(_["*"]||[],_[rt]||[]);for(const Cn of oi)lI(Cn,Oi)||Ie.removeAttribute(Cn.nodeName)}return ye.body.innerHTML}const uI="TemplateFactory",dI={allowList:$0,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},hI={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},fI={entry:"(string|element|function|null)",selector:"(string|element)"};class gI extends U{constructor(_){super(),this._config=this._getConfig(_)}static get Default(){return dI}static get DefaultType(){return hI}static get NAME(){return uI}getContent(){return Object.values(this._config.content).map(_=>this._resolvePossibleFunction(_)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(_){return this._checkContent(_),this._config.content={...this._config.content,..._},this}toHtml(){const _=document.createElement("div");_.innerHTML=this._maybeSanitize(this._config.template);for(const[ye,Pe]of Object.entries(this._config.content))this._setContent(_,Pe,ye);const R=_.children[0],q=this._resolvePossibleFunction(this._config.extraClass);return q&&R.classList.add(...q.split(" ")),R}_typeCheckConfig(_){super._typeCheckConfig(_),this._checkContent(_.content)}_checkContent(_){for(const[R,q]of Object.entries(_))super._typeCheckConfig({selector:R,entry:q},fI)}_setContent(_,R,q){const ye=ee.findOne(q,_);if(ye){if(R=this._resolvePossibleFunction(R),!R){ye.remove();return}if(m(R)){this._putElementInTemplate(y(R),ye);return}if(this._config.html){ye.innerHTML=this._maybeSanitize(R);return}ye.textContent=R}}_maybeSanitize(_){return this._config.sanitize?cI(_,this._config.allowList,this._config.sanitizeFn):_}_resolvePossibleFunction(_){return F(_,[this])}_putElementInTemplate(_,R){if(this._config.html){R.innerHTML="",R.append(_);return}R.textContent=_.textContent}}const pI="tooltip",mI=new Set(["sanitize","allowList","sanitizeFn"]),ug="fade",_I="modal",rd="show",yI=".tooltip-inner",L0=`.${_I}`,O0="hide.bs.modal",tc="hover",dg="focus",vI="click",bI="manual",wI="hide",xI="hidden",EI="show",SI="shown",CI="inserted",TI="click",kI="focusin",AI="focusout",MI="mouseenter",II="mouseleave",PI={AUTO:"auto",TOP:"top",RIGHT:A()?"left":"right",BOTTOM:"bottom",LEFT:A()?"right":"left"},RI={allowList:$0,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"},DI={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"};class To extends j{constructor(_,R){if(typeof s>"u")throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(_,R),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 RI}static get DefaultType(){return DI}static get NAME(){return pI}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){if(this._isEnabled){if(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()){this._leave();return}this._enter()}}dispose(){clearTimeout(this._timeout),z.off(this._element.closest(L0),O0,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;const _=z.trigger(this._element,this.constructor.eventName(EI)),q=(E(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(_.defaultPrevented||!q)return;this._disposePopper();const ye=this._getTipElement();this._element.setAttribute("aria-describedby",ye.getAttribute("id"));const{container:Pe}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(Pe.append(ye),z.trigger(this._element,this.constructor.eventName(CI))),this._popper=this._createPopper(ye),ye.classList.add(rd),"ontouchstart"in document.documentElement)for(const rt of[].concat(...document.body.children))z.on(rt,"mouseover",C);const Ie=()=>{z.trigger(this._element,this.constructor.eventName(SI)),this._isHovered===!1&&this._leave(),this._isHovered=!1};this._queueCallback(Ie,this.tip,this._isAnimated())}hide(){if(!this._isShown()||z.trigger(this._element,this.constructor.eventName(wI)).defaultPrevented)return;if(this._getTipElement().classList.remove(rd),"ontouchstart"in document.documentElement)for(const ye of[].concat(...document.body.children))z.off(ye,"mouseover",C);this._activeTrigger[vI]=!1,this._activeTrigger[dg]=!1,this._activeTrigger[tc]=!1,this._isHovered=null;const q=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),z.trigger(this._element,this.constructor.eventName(xI)))};this._queueCallback(q,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(_){const R=this._getTemplateFactory(_).toHtml();if(!R)return null;R.classList.remove(ug,rd),R.classList.add(`bs-${this.constructor.NAME}-auto`);const q=h(this.constructor.NAME).toString();return R.setAttribute("id",q),this._isAnimated()&&R.classList.add(ug),R}setContent(_){this._newContent=_,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(_){return this._templateFactory?this._templateFactory.changeContent(_):this._templateFactory=new gI({...this._config,content:_,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[yI]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(_){return this.constructor.getOrCreateInstance(_.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(ug)}_isShown(){return this.tip&&this.tip.classList.contains(rd)}_createPopper(_){const R=F(this._config.placement,[this,_,this._element]),q=PI[R.toUpperCase()];return s.createPopper(this._element,_,this._getPopperConfig(q))}_getOffset(){const{offset:_}=this._config;return typeof _=="string"?_.split(",").map(R=>Number.parseInt(R,10)):typeof _=="function"?R=>_(R,this._element):_}_resolvePossibleFunction(_){return F(_,[this._element])}_getPopperConfig(_){const R={placement:_,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:q=>{this._getTipElement().setAttribute("data-popper-placement",q.state.placement)}}]};return{...R,...F(this._config.popperConfig,[R])}}_setListeners(){const _=this._config.trigger.split(" ");for(const R of _)if(R==="click")z.on(this._element,this.constructor.eventName(TI),this._config.selector,q=>{this._initializeOnDelegatedTarget(q).toggle()});else if(R!==bI){const q=R===tc?this.constructor.eventName(MI):this.constructor.eventName(kI),ye=R===tc?this.constructor.eventName(II):this.constructor.eventName(AI);z.on(this._element,q,this._config.selector,Pe=>{const Ie=this._initializeOnDelegatedTarget(Pe);Ie._activeTrigger[Pe.type==="focusin"?dg:tc]=!0,Ie._enter()}),z.on(this._element,ye,this._config.selector,Pe=>{const Ie=this._initializeOnDelegatedTarget(Pe);Ie._activeTrigger[Pe.type==="focusout"?dg:tc]=Ie._element.contains(Pe.relatedTarget),Ie._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},z.on(this._element.closest(L0),O0,this._hideModalHandler)}_fixTitle(){const _=this._element.getAttribute("title");_&&(!this._element.getAttribute("aria-label")&&!this._element.textContent.trim()&&this._element.setAttribute("aria-label",_),this._element.setAttribute("data-bs-original-title",_),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(_,R){clearTimeout(this._timeout),this._timeout=setTimeout(_,R)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(_){const R=K.getDataAttributes(this._element);for(const q of Object.keys(R))mI.has(q)&&delete R[q];return _={...R,...typeof _=="object"&&_?_:{}},_=this._mergeConfigObj(_),_=this._configAfterMerge(_),this._typeCheckConfig(_),_}_configAfterMerge(_){return _.container=_.container===!1?document.body:y(_.container),typeof _.delay=="number"&&(_.delay={show:_.delay,hide:_.delay}),typeof _.title=="number"&&(_.title=_.title.toString()),typeof _.content=="number"&&(_.content=_.content.toString()),_}_getDelegateConfig(){const _={};for(const[R,q]of Object.entries(this._config))this.constructor.Default[R]!==q&&(_[R]=q);return _.selector=!1,_.trigger="manual",_}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(_){return this.each(function(){const R=To.getOrCreateInstance(this,_);if(typeof _=="string"){if(typeof R[_]>"u")throw new TypeError(`No method named "${_}"`);R[_]()}})}}P(To);const $I="popover",LI=".popover-header",OI=".popover-body",NI={...To.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},FI={...To.DefaultType,content:"(null|string|element|function)"};class od extends To{static get Default(){return NI}static get DefaultType(){return FI}static get NAME(){return $I}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[LI]:this._getTitle(),[OI]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(_){return this.each(function(){const R=od.getOrCreateInstance(this,_);if(typeof _=="string"){if(typeof R[_]>"u")throw new TypeError(`No method named "${_}"`);R[_]()}})}}P(od);const BI="scrollspy",hg=".bs.scrollspy",VI=".data-api",zI=`activate${hg}`,N0=`click${hg}`,WI=`load${hg}${VI}`,HI="dropdown-item",Aa="active",YI='[data-bs-spy="scroll"]',fg="[href]",jI=".nav, .list-group",F0=".nav-link",KI=`${F0}, .nav-item > ${F0}, .list-group-item`,UI=".dropdown",GI=".dropdown-toggle",XI={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},qI={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class nc extends j{constructor(_,R){super(_,R),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return XI}static get DefaultType(){return qI}static get NAME(){return BI}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const _ of this._observableSections.values())this._observer.observe(_)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(_){return _.target=y(_.target)||document.body,_.rootMargin=_.offset?`${_.offset}px 0px -30%`:_.rootMargin,typeof _.threshold=="string"&&(_.threshold=_.threshold.split(",").map(R=>Number.parseFloat(R))),_}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(z.off(this._config.target,N0),z.on(this._config.target,N0,fg,_=>{const R=this._observableSections.get(_.target.hash);if(R){_.preventDefault();const q=this._rootElement||window,ye=R.offsetTop-this._element.offsetTop;if(q.scrollTo){q.scrollTo({top:ye,behavior:"smooth"});return}q.scrollTop=ye}}))}_getNewObserver(){const _={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(R=>this._observerCallback(R),_)}_observerCallback(_){const R=Ie=>this._targetLinks.get(`#${Ie.target.id}`),q=Ie=>{this._previousScrollData.visibleEntryTop=Ie.target.offsetTop,this._process(R(Ie))},ye=(this._rootElement||document.documentElement).scrollTop,Pe=ye>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=ye;for(const Ie of _){if(!Ie.isIntersecting){this._activeTarget=null,this._clearActiveClass(R(Ie));continue}const rt=Ie.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(Pe&&rt){if(q(Ie),!ye)return;continue}!Pe&&!rt&&q(Ie)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const _=ee.find(fg,this._config.target);for(const R of _){if(!R.hash||b(R))continue;const q=ee.findOne(decodeURI(R.hash),this._element);v(q)&&(this._targetLinks.set(decodeURI(R.hash),R),this._observableSections.set(R.hash,q))}}_process(_){this._activeTarget!==_&&(this._clearActiveClass(this._config.target),this._activeTarget=_,_.classList.add(Aa),this._activateParents(_),z.trigger(this._element,zI,{relatedTarget:_}))}_activateParents(_){if(_.classList.contains(HI)){ee.findOne(GI,_.closest(UI)).classList.add(Aa);return}for(const R of ee.parents(_,jI))for(const q of ee.prev(R,KI))q.classList.add(Aa)}_clearActiveClass(_){_.classList.remove(Aa);const R=ee.find(`${fg}.${Aa}`,_);for(const q of R)q.classList.remove(Aa)}static jQueryInterface(_){return this.each(function(){const R=nc.getOrCreateInstance(this,_);if(typeof _=="string"){if(R[_]===void 0||_.startsWith("_")||_==="constructor")throw new TypeError(`No method named "${_}"`);R[_]()}})}}z.on(window,WI,()=>{for(const G of ee.find(YI))nc.getOrCreateInstance(G)}),P(nc);const ZI="tab",ko=".bs.tab",JI=`hide${ko}`,QI=`hidden${ko}`,eP=`show${ko}`,tP=`shown${ko}`,nP=`click${ko}`,iP=`keydown${ko}`,sP=`load${ko}`,rP="ArrowLeft",B0="ArrowRight",oP="ArrowUp",V0="ArrowDown",gg="Home",z0="End",Ao="active",W0="fade",pg="show",aP="dropdown",H0=".dropdown-toggle",lP=".dropdown-menu",mg=`:not(${H0})`,cP='.list-group, .nav, [role="tablist"]',uP=".nav-item, .list-group-item",dP=`.nav-link${mg}, .list-group-item${mg}, [role="tab"]${mg}`,Y0='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',_g=`${dP}, ${Y0}`,hP=`.${Ao}[data-bs-toggle="tab"], .${Ao}[data-bs-toggle="pill"], .${Ao}[data-bs-toggle="list"]`;class Mo extends j{constructor(_){super(_),this._parent=this._element.closest(cP),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),z.on(this._element,iP,R=>this._keydown(R)))}static get NAME(){return ZI}show(){const _=this._element;if(this._elemIsActive(_))return;const R=this._getActiveElem(),q=R?z.trigger(R,JI,{relatedTarget:_}):null;z.trigger(_,eP,{relatedTarget:R}).defaultPrevented||q&&q.defaultPrevented||(this._deactivate(R,_),this._activate(_,R))}_activate(_,R){if(!_)return;_.classList.add(Ao),this._activate(ee.getElementFromSelector(_));const q=()=>{if(_.getAttribute("role")!=="tab"){_.classList.add(pg);return}_.removeAttribute("tabindex"),_.setAttribute("aria-selected",!0),this._toggleDropDown(_,!0),z.trigger(_,tP,{relatedTarget:R})};this._queueCallback(q,_,_.classList.contains(W0))}_deactivate(_,R){if(!_)return;_.classList.remove(Ao),_.blur(),this._deactivate(ee.getElementFromSelector(_));const q=()=>{if(_.getAttribute("role")!=="tab"){_.classList.remove(pg);return}_.setAttribute("aria-selected",!1),_.setAttribute("tabindex","-1"),this._toggleDropDown(_,!1),z.trigger(_,QI,{relatedTarget:R})};this._queueCallback(q,_,_.classList.contains(W0))}_keydown(_){if(![rP,B0,oP,V0,gg,z0].includes(_.key))return;_.stopPropagation(),_.preventDefault();const R=this._getChildren().filter(ye=>!b(ye));let q;if([gg,z0].includes(_.key))q=R[_.key===gg?0:R.length-1];else{const ye=[B0,V0].includes(_.key);q=te(R,_.target,ye,!0)}q&&(q.focus({preventScroll:!0}),Mo.getOrCreateInstance(q).show())}_getChildren(){return ee.find(_g,this._parent)}_getActiveElem(){return this._getChildren().find(_=>this._elemIsActive(_))||null}_setInitialAttributes(_,R){this._setAttributeIfNotExists(_,"role","tablist");for(const q of R)this._setInitialAttributesOnChild(q)}_setInitialAttributesOnChild(_){_=this._getInnerElement(_);const R=this._elemIsActive(_),q=this._getOuterElement(_);_.setAttribute("aria-selected",R),q!==_&&this._setAttributeIfNotExists(q,"role","presentation"),R||_.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(_,"role","tab"),this._setInitialAttributesOnTargetPanel(_)}_setInitialAttributesOnTargetPanel(_){const R=ee.getElementFromSelector(_);R&&(this._setAttributeIfNotExists(R,"role","tabpanel"),_.id&&this._setAttributeIfNotExists(R,"aria-labelledby",`${_.id}`))}_toggleDropDown(_,R){const q=this._getOuterElement(_);if(!q.classList.contains(aP))return;const ye=(Pe,Ie)=>{const rt=ee.findOne(Pe,q);rt&&rt.classList.toggle(Ie,R)};ye(H0,Ao),ye(lP,pg),q.setAttribute("aria-expanded",R)}_setAttributeIfNotExists(_,R,q){_.hasAttribute(R)||_.setAttribute(R,q)}_elemIsActive(_){return _.classList.contains(Ao)}_getInnerElement(_){return _.matches(_g)?_:ee.findOne(_g,_)}_getOuterElement(_){return _.closest(uP)||_}static jQueryInterface(_){return this.each(function(){const R=Mo.getOrCreateInstance(this);if(typeof _=="string"){if(R[_]===void 0||_.startsWith("_")||_==="constructor")throw new TypeError(`No method named "${_}"`);R[_]()}})}}z.on(document,nP,Y0,function(G){["A","AREA"].includes(this.tagName)&&G.preventDefault(),!b(this)&&Mo.getOrCreateInstance(this).show()}),z.on(window,sP,()=>{for(const G of ee.find(hP))Mo.getOrCreateInstance(G)}),P(Mo);const fP="toast",xr=".bs.toast",gP=`mouseover${xr}`,pP=`mouseout${xr}`,mP=`focusin${xr}`,_P=`focusout${xr}`,yP=`hide${xr}`,vP=`hidden${xr}`,bP=`show${xr}`,wP=`shown${xr}`,xP="fade",j0="hide",ad="show",ld="showing",EP={animation:"boolean",autohide:"boolean",delay:"number"},SP={animation:!0,autohide:!0,delay:5e3};class ic extends j{constructor(_,R){super(_,R),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return SP}static get DefaultType(){return EP}static get NAME(){return fP}show(){if(z.trigger(this._element,bP).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add(xP);const R=()=>{this._element.classList.remove(ld),z.trigger(this._element,wP),this._maybeScheduleHide()};this._element.classList.remove(j0),w(this._element),this._element.classList.add(ad,ld),this._queueCallback(R,this._element,this._config.animation)}hide(){if(!this.isShown()||z.trigger(this._element,yP).defaultPrevented)return;const R=()=>{this._element.classList.add(j0),this._element.classList.remove(ld,ad),z.trigger(this._element,vP)};this._element.classList.add(ld),this._queueCallback(R,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(ad),super.dispose()}isShown(){return this._element.classList.contains(ad)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(_,R){switch(_.type){case"mouseover":case"mouseout":{this._hasMouseInteraction=R;break}case"focusin":case"focusout":{this._hasKeyboardInteraction=R;break}}if(R){this._clearTimeout();return}const q=_.relatedTarget;this._element===q||this._element.contains(q)||this._maybeScheduleHide()}_setListeners(){z.on(this._element,gP,_=>this._onInteraction(_,!0)),z.on(this._element,pP,_=>this._onInteraction(_,!1)),z.on(this._element,mP,_=>this._onInteraction(_,!0)),z.on(this._element,_P,_=>this._onInteraction(_,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(_){return this.each(function(){const R=ic.getOrCreateInstance(this,_);if(typeof _=="string"){if(typeof R[_]>"u")throw new TypeError(`No method named "${_}"`);R[_](this)}})}}return fe(ic),P(ic),{Alert:Ze,Button:ae,Carousel:Sa,Collapse:Ta,Dropdown:Zi,Modal:Co,Offcanvas:Hs,Popover:od,ScrollSpy:nc,Tab:Mo,Toast:ic,Tooltip:To}})})(AP);/** * @vue/shared v3.4.29 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**//*! #__NO_SIDE_EFFECTS__ */function Xm(t,e){const n=new Set(t.split(","));return e?i=>n.has(i.toLowerCase()):i=>n.has(i)}const Ot={},tl=[],Vi=()=>{},y2=()=>!1,Zh=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),qm=t=>t.startsWith("onUpdate:"),ln=Object.assign,Zm=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},v2=Object.prototype.hasOwnProperty,ht=(t,e)=>v2.call(t,e),We=Array.isArray,nl=t=>Du(t)==="[object Map]",Hl=t=>Du(t)==="[object Set]",ev=t=>Du(t)==="[object Date]",qe=t=>typeof t=="function",Kt=t=>typeof t=="string",gr=t=>typeof t=="symbol",At=t=>t!==null&&typeof t=="object",Dx=t=>(At(t)||qe(t))&&qe(t.then)&&qe(t.catch),$x=Object.prototype.toString,Du=t=>$x.call(t),b2=t=>Du(t).slice(8,-1),Lx=t=>Du(t)==="[object Object]",Jm=t=>Kt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Dc=Xm(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Jh=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},w2=/-(\w)/g,Ls=Jh(t=>t.replace(w2,(e,n)=>n?n.toUpperCase():"")),x2=/\B([A-Z])/g,fa=Jh(t=>t.replace(x2,"-$1").toLowerCase()),Qh=Jh(t=>t.charAt(0).toUpperCase()+t.slice(1)),yg=Jh(t=>t?`on${Qh(t)}`:""),io=(t,e)=>!Object.is(t,e),Zd=(t,...e)=>{for(let n=0;n{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:i,value:n})},ch=t=>{const e=parseFloat(t);return isNaN(e)?t:e},Nx=t=>{const e=Kt(t)?Number(t):NaN;return isNaN(e)?t:e};let tv;const Fx=()=>tv||(tv=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Mn(t){if(We(t)){const e={};for(let n=0;n{if(n){const i=n.split(S2);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function Ie(t){let e="";if(Kt(t))e=t;else if(We(t))for(let n=0;naa(n,e))}const Ee=t=>Kt(t)?t:t==null?"":We(t)||At(t)&&(t.toString===$x||!qe(t.toString))?JSON.stringify(t,Vx,2):String(t),Vx=(t,e)=>e&&e.__v_isRef?Vx(t,e.value):nl(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[i,s],r)=>(n[vg(i,r)+" =>"]=s,n),{})}:Hl(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>vg(n))}:gr(e)?vg(e):At(e)&&!We(e)&&!Lx(e)?String(e):e,vg=(t,e="")=>{var n;return gr(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};/** +**//*! #__NO_SIDE_EFFECTS__ */function Xm(t,e){const n=new Set(t.split(","));return e?i=>n.has(i.toLowerCase()):i=>n.has(i)}const Ot={},tl=[],Vi=()=>{},y2=()=>!1,Zh=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),qm=t=>t.startsWith("onUpdate:"),ln=Object.assign,Zm=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},v2=Object.prototype.hasOwnProperty,ht=(t,e)=>v2.call(t,e),We=Array.isArray,nl=t=>Du(t)==="[object Map]",Hl=t=>Du(t)==="[object Set]",ev=t=>Du(t)==="[object Date]",qe=t=>typeof t=="function",Kt=t=>typeof t=="string",gr=t=>typeof t=="symbol",At=t=>t!==null&&typeof t=="object",Dx=t=>(At(t)||qe(t))&&qe(t.then)&&qe(t.catch),$x=Object.prototype.toString,Du=t=>$x.call(t),b2=t=>Du(t).slice(8,-1),Lx=t=>Du(t)==="[object Object]",Jm=t=>Kt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Dc=Xm(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Jh=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},w2=/-(\w)/g,Ls=Jh(t=>t.replace(w2,(e,n)=>n?n.toUpperCase():"")),x2=/\B([A-Z])/g,fa=Jh(t=>t.replace(x2,"-$1").toLowerCase()),Qh=Jh(t=>t.charAt(0).toUpperCase()+t.slice(1)),yg=Jh(t=>t?`on${Qh(t)}`:""),io=(t,e)=>!Object.is(t,e),Zd=(t,...e)=>{for(let n=0;n{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:i,value:n})},ch=t=>{const e=parseFloat(t);return isNaN(e)?t:e},Nx=t=>{const e=Kt(t)?Number(t):NaN;return isNaN(e)?t:e};let tv;const Fx=()=>tv||(tv=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Mn(t){if(We(t)){const e={};for(let n=0;n{if(n){const i=n.split(S2);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function Me(t){let e="";if(Kt(t))e=t;else if(We(t))for(let n=0;naa(n,e))}const xe=t=>Kt(t)?t:t==null?"":We(t)||At(t)&&(t.toString===$x||!qe(t.toString))?JSON.stringify(t,Vx,2):String(t),Vx=(t,e)=>e&&e.__v_isRef?Vx(t,e.value):nl(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[i,s],r)=>(n[vg(i,r)+" =>"]=s,n),{})}:Hl(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>vg(n))}:gr(e)?vg(e):At(e)&&!We(e)&&!Lx(e)?String(e):e,vg=(t,e="")=>{var n;return gr(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};/** * @vue/reactivity v3.4.29 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT @@ -14,7 +14,7 @@ * @vue/runtime-core v3.4.29 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/function Jr(t,e,n,i){try{return i?t(...i):t()}catch(s){$u(s,e,n)}}function ji(t,e,n,i){if(qe(t)){const s=Jr(t,e,n,i);return s&&Dx(s)&&s.catch(r=>{$u(r,e,n)}),s}if(We(t)){const s=[];for(let r=0;r>>1,s=Wn[i],r=Qc(s);rbs&&Wn.splice(e,1)}function Op(t){We(t)?il.push(...t):(!Nr||!Nr.includes(t,t.allowRecurse?Yo+1:Yo))&&il.push(t),lE()}function cv(t,e,n=Jc?bs+1:0){for(;nQc(n)-Qc(i));if(il.length=0,Nr){Nr.push(...e);return}for(Nr=e,Yo=0;Yot.id==null?1/0:t.id,oR=(t,e)=>{const n=Qc(t)-Qc(e);if(n===0){if(t.pre&&!e.pre)return-1;if(e.pre&&!t.pre)return 1}return n};function uE(t){Lp=!1,Jc=!0,Wn.sort(oR);try{for(bs=0;bsKt(f)?f.trim():f)),d&&(s=n.map(ch))}let a,l=i[a=yg(e)]||i[a=yg(Ls(e))];!l&&r&&(l=i[a=yg(fa(e))]),l&&ji(l,t,6,s);const c=i[a+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,ji(c,t,6,s)}}function dE(t,e,n=!1){const i=e.emitsCache,s=i.get(t);if(s!==void 0)return s;const r=t.emits;let o={},a=!1;if(!qe(t)){const l=c=>{const u=dE(c,e,!0);u&&(a=!0,ln(o,u))};!n&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}return!r&&!a?(At(t)&&i.set(t,null),null):(We(r)?r.forEach(l=>o[l]=null):ln(o,r),At(t)&&i.set(t,o),o)}function rf(t,e){return!t||!Zh(e)?!1:(e=e.slice(2).replace(/Once$/,""),ht(t,e[0].toLowerCase()+e.slice(1))||ht(t,fa(e))||ht(t,e))}let _n=null,of=null;function hh(t){const e=_n;return _n=t,of=t&&t.type.__scopeId||null,e}function bn(t){of=t}function wn(){of=null}function Re(t,e=_n,n){if(!e||t._n)return t;const i=(...s)=>{i._d&&Cv(-1);const r=hh(e);let o;try{o=t(...s)}finally{hh(r),i._d&&Cv(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function bg(t){const{type:e,vnode:n,proxy:i,withProxy:s,propsOptions:[r],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:d,data:h,setupState:f,ctx:p,inheritAttrs:m}=t,y=hh(t);let v,b;try{if(n.shapeFlag&4){const C=s||i,w=C;v=ns(c.call(w,C,u,d,f,h,p)),b=a}else{const C=e;v=ns(C.length>1?C(d,{attrs:a,slots:o,emit:l}):C(d,null)),b=e.props?a:cR(a)}}catch(C){Nc.length=0,$u(C,t,1),v=B(Hn)}let E=v;if(b&&m!==!1){const C=Object.keys(b),{shapeFlag:w}=E;C.length&&w&7&&(r&&C.some(qm)&&(b=uR(b,r)),E=so(E,b,!1,!0))}return n.dirs&&(E=so(E,null,!1,!0),E.dirs=E.dirs?E.dirs.concat(n.dirs):n.dirs),n.transition&&(E.transition=n.transition),v=E,hh(y),v}function lR(t,e=!0){let n;for(let i=0;i{let e;for(const n in t)(n==="class"||n==="style"||Zh(n))&&((e||(e={}))[n]=t[n]);return e},uR=(t,e)=>{const n={};for(const i in t)(!qm(i)||!(i.slice(9)in e))&&(n[i]=t[i]);return n};function dR(t,e,n){const{props:i,children:s,component:r}=t,{props:o,children:a,patchFlag:l}=e,c=r.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return i?uv(i,o,c):!!o;if(l&8){const u=e.dynamicProps;for(let d=0;dt.__isSuspense;let Np=0;const fR={name:"Suspense",__isSuspense:!0,process(t,e,n,i,s,r,o,a,l,c){if(t==null)gR(e,n,i,s,r,o,a,l,c);else{if(r&&r.deps>0&&!t.suspense.isInFallback){e.suspense=t.suspense,e.suspense.vnode=e,e.el=t.el;return}pR(t,e,n,i,s,o,a,l,c)}},hydrate:mR,create:g_,normalize:_R},f_=fR;function eu(t,e){const n=t.props&&t.props[e];qe(n)&&n()}function gR(t,e,n,i,s,r,o,a,l){const{p:c,o:{createElement:u}}=l,d=u("div"),h=t.suspense=g_(t,s,i,e,d,n,r,o,a,l);c(null,h.pendingBranch=t.ssContent,d,null,i,h,r,o),h.deps>0?(eu(t,"onPending"),eu(t,"onFallback"),c(null,t.ssFallback,e,n,i,null,r,o),sl(h,t.ssFallback)):h.resolve(!1,!0)}function pR(t,e,n,i,s,r,o,a,{p:l,um:c,o:{createElement:u}}){const d=e.suspense=t.suspense;d.vnode=e,e.el=t.el;const h=e.ssContent,f=e.ssFallback,{activeBranch:p,pendingBranch:m,isInFallback:y,isHydrating:v}=d;if(m)d.pendingBranch=h,ws(h,m)?(l(m,h,d.hiddenContainer,null,s,d,r,o,a),d.deps<=0?d.resolve():y&&(v||(l(p,f,n,i,s,null,r,o,a),sl(d,f)))):(d.pendingId=Np++,v?(d.isHydrating=!1,d.activeBranch=m):c(m,s,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),y?(l(null,h,d.hiddenContainer,null,s,d,r,o,a),d.deps<=0?d.resolve():(l(p,f,n,i,s,null,r,o,a),sl(d,f))):p&&ws(h,p)?(l(p,h,n,i,s,d,r,o,a),d.resolve(!0)):(l(null,h,d.hiddenContainer,null,s,d,r,o,a),d.deps<=0&&d.resolve()));else if(p&&ws(h,p))l(p,h,n,i,s,d,r,o,a),sl(d,h);else if(eu(e,"onPending"),d.pendingBranch=h,h.shapeFlag&512?d.pendingId=h.component.suspenseId:d.pendingId=Np++,l(null,h,d.hiddenContainer,null,s,d,r,o,a),d.deps<=0)d.resolve();else{const{timeout:b,pendingId:E}=d;b>0?setTimeout(()=>{d.pendingId===E&&d.fallback(f)},b):b===0&&d.fallback(f)}}function g_(t,e,n,i,s,r,o,a,l,c,u=!1){const{p:d,m:h,um:f,n:p,o:{parentNode:m,remove:y}}=c;let v;const b=vR(t);b&&e&&e.pendingBranch&&(v=e.pendingId,e.deps++);const E=t.props?Nx(t.props.timeout):void 0,C=r,w={vnode:t,parent:e,parentComponent:n,namespace:o,container:i,hiddenContainer:s,deps:0,pendingId:Np++,timeout:typeof E=="number"?E:-1,activeBranch:null,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(x=!1,T=!1){const{vnode:k,activeBranch:A,pendingBranch:P,pendingId:F,effects:H,parentComponent:te,container:N}=w;let L=!1;w.isHydrating?w.isHydrating=!1:x||(L=A&&P.transition&&P.transition.mode==="out-in",L&&(A.transition.afterLeave=()=>{F===w.pendingId&&(h(P,N,r===C?p(A):r,0),Op(H))}),A&&(m(A.el)!==w.hiddenContainer&&(r=p(A)),f(A,te,w,!0)),L||h(P,N,r,0)),sl(w,P),w.pendingBranch=null,w.isInFallback=!1;let I=w.parent,W=!1;for(;I;){if(I.pendingBranch){I.effects.push(...H),W=!0;break}I=I.parent}!W&&!L&&Op(H),w.effects=[],b&&e&&e.pendingBranch&&v===e.pendingId&&(e.deps--,e.deps===0&&!T&&e.resolve()),eu(k,"onResolve")},fallback(x){if(!w.pendingBranch)return;const{vnode:T,activeBranch:k,parentComponent:A,container:P,namespace:F}=w;eu(T,"onFallback");const H=p(k),te=()=>{w.isInFallback&&(d(null,x,P,H,A,null,F,a,l),sl(w,x))},N=x.transition&&x.transition.mode==="out-in";N&&(k.transition.afterLeave=te),w.isInFallback=!0,f(k,A,null,!0),N||te()},move(x,T,k){w.activeBranch&&h(w.activeBranch,x,T,k),w.container=x},next(){return w.activeBranch&&p(w.activeBranch)},registerDep(x,T,k){const A=!!w.pendingBranch;A&&w.deps++;const P=x.vnode.el;x.asyncDep.catch(F=>{$u(F,x,0)}).then(F=>{if(x.isUnmounted||w.isUnmounted||w.pendingId!==x.suspenseId)return;x.asyncResolved=!0;const{vnode:H}=x;jp(x,F,!1),P&&(H.el=P);const te=!P&&x.subTree.el;T(x,H,m(P||x.subTree.el),P?null:p(x.subTree),w,o,k),te&&y(te),d_(x,H.el),A&&--w.deps===0&&w.resolve()})},unmount(x,T){w.isUnmounted=!0,w.activeBranch&&f(w.activeBranch,n,x,T),w.pendingBranch&&f(w.pendingBranch,n,x,T)}};return w}function mR(t,e,n,i,s,r,o,a,l){const c=e.suspense=g_(e,i,n,t.parentNode,document.createElement("div"),null,s,r,o,a,!0),u=l(t,c.pendingBranch=e.ssContent,n,c,r,o);return c.deps===0&&c.resolve(!1,!0),u}function _R(t){const{shapeFlag:e,children:n}=t,i=e&32;t.ssContent=hv(i?n.default:n),t.ssFallback=i?hv(n.fallback):B(Hn)}function hv(t){let e;if(qe(t)){const n=_l&&t._c;n&&(t._d=!1,D()),t=t(),n&&(t._d=!0,e=zi,NE())}return We(t)&&(t=lR(t)),t=ns(t),e&&!t.dynamicChildren&&(t.dynamicChildren=e.filter(n=>n!==t)),t}function yR(t,e){e&&e.pendingBranch?We(t)?e.effects.push(...t):e.effects.push(t):Op(t)}function sl(t,e){t.activeBranch=e;const{vnode:n,parentComponent:i}=t;let s=e.el;for(;!s&&e.component;)e=e.component.subTree,s=e.el;n.el=s,i&&i.subTree===n&&(i.vnode.el=s,d_(i,s))}function vR(t){const e=t.props&&t.props.suspensible;return e!=null&&e!==!1}function af(t,e,n=An,i=!1){if(n){const s=n[t]||(n[t]=[]),r=e.__weh||(e.__weh=(...o)=>{fo();const a=Lu(n),l=ji(e,n,t,o);return a(),go(),l});return i?s.unshift(r):s.push(r),r}}const yr=t=>(e,n=An)=>{(!uf||t==="sp")&&af(t,(...i)=>e(...i),n)},bR=yr("bm"),xn=yr("m"),gE=yr("bu"),pE=yr("u"),p_=yr("bum"),Yl=yr("um"),wR=yr("sp"),xR=yr("rtg"),ER=yr("rtc");function SR(t,e=An){af("ec",t,e)}function Ne(t,e){if(_n===null)return t;const n=df(_n),i=t.dirs||(t.dirs=[]);for(let s=0;se(o,a,void 0,r&&r[a]));else{const o=Object.keys(t);s=new Array(o.length);for(let a=0,l=o.length;a{const r=i.fn(...s);return r&&(r.key=i.key),r}:i.fn)}return t}/*! #__NO_SIDE_EFFECTS__ */function cn(t,e){return qe(t)?ln({name:t.name},e,{setup:t}):t}const $c=t=>!!t.type.__asyncLoader;function Oe(t,e,n={},i,s){if(_n.isCE||_n.parent&&$c(_n.parent)&&_n.parent.isCE)return e!=="default"&&(n.name=e),B("slot",n,i&&i());let r=t[e];r&&r._c&&(r._d=!1),D();const o=r&&mE(r(n)),a=Ce($e,{key:n.key||o&&o.key||`_${e}`},o||(i?i():[]),o&&t._===1?64:-2);return!s&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),r&&r._c&&(r._d=!0),a}function mE(t){return t.some(e=>nu(e)?!(e.type===Hn||e.type===$e&&!mE(e.children)):!0)?t:null}const Fp=t=>t?VE(t)?df(t):Fp(t.parent):null,Lc=ln(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Fp(t.parent),$root:t=>Fp(t.root),$emit:t=>t.emit,$options:t=>m_(t),$forceUpdate:t=>t.f||(t.f=()=>{t.effect.dirty=!0,u_(t.update)}),$nextTick:t=>t.n||(t.n=Rn.bind(t.proxy)),$watch:t=>KR.bind(t)}),wg=(t,e)=>t!==Ot&&!t.__isScriptSetup&&ht(t,e),CR={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:i,data:s,props:r,accessCache:o,type:a,appContext:l}=t;let c;if(e[0]!=="$"){const f=o[e];if(f!==void 0)switch(f){case 1:return i[e];case 2:return s[e];case 4:return n[e];case 3:return r[e]}else{if(wg(i,e))return o[e]=1,i[e];if(s!==Ot&&ht(s,e))return o[e]=2,s[e];if((c=t.propsOptions[0])&&ht(c,e))return o[e]=3,r[e];if(n!==Ot&&ht(n,e))return o[e]=4,n[e];Bp&&(o[e]=0)}}const u=Lc[e];let d,h;if(u)return e==="$attrs"&&yi(t.attrs,"get",""),u(t);if((d=a.__cssModules)&&(d=d[e]))return d;if(n!==Ot&&ht(n,e))return o[e]=4,n[e];if(h=l.config.globalProperties,ht(h,e))return h[e]},set({_:t},e,n){const{data:i,setupState:s,ctx:r}=t;return wg(s,e)?(s[e]=n,!0):i!==Ot&&ht(i,e)?(i[e]=n,!0):ht(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(r[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:i,appContext:s,propsOptions:r}},o){let a;return!!n[o]||t!==Ot&&ht(t,o)||wg(e,o)||(a=r[0])&&ht(a,o)||ht(i,o)||ht(Lc,o)||ht(s.config.globalProperties,o)},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:ht(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function pa(){return _E().slots}function TR(){return _E().attrs}function _E(){const t=w_();return t.setupContext||(t.setupContext=WE(t))}function fv(t){return We(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}let Bp=!0;function kR(t){const e=m_(t),n=t.proxy,i=t.ctx;Bp=!1,e.beforeCreate&&gv(e.beforeCreate,t,"bc");const{data:s,computed:r,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:d,mounted:h,beforeUpdate:f,updated:p,activated:m,deactivated:y,beforeDestroy:v,beforeUnmount:b,destroyed:E,unmounted:C,render:w,renderTracked:x,renderTriggered:T,errorCaptured:k,serverPrefetch:A,expose:P,inheritAttrs:F,components:H,directives:te,filters:N}=e;if(c&&AR(c,i,null),o)for(const W in o){const X=o[W];qe(X)&&(i[W]=X.bind(n))}if(s){const W=s.call(n,n);At(W)&&(t.data=Ns(W))}if(Bp=!0,r)for(const W in r){const X=r[W],J=qe(X)?X.bind(n,n):qe(X.get)?X.get.bind(n,n):Vi,ne=!qe(X)&&qe(X.set)?X.set.bind(n):Vi,ue=be({get:J,set:ne});Object.defineProperty(i,W,{enumerable:!0,configurable:!0,get:()=>ue.value,set:Y=>ue.value=Y})}if(a)for(const W in a)yE(a[W],i,n,W);if(l){const W=qe(l)?l.call(n):l;Reflect.ownKeys(W).forEach(X=>{Qd(X,W[X])})}u&&gv(u,t,"c");function I(W,X){We(X)?X.forEach(J=>W(J.bind(n))):X&&W(X.bind(n))}if(I(bR,d),I(xn,h),I(gE,f),I(pE,p),I(UR,m),I(GR,y),I(SR,k),I(ER,x),I(xR,T),I(p_,b),I(Yl,C),I(wR,A),We(P))if(P.length){const W=t.exposed||(t.exposed={});P.forEach(X=>{Object.defineProperty(W,X,{get:()=>n[X],set:J=>n[X]=J})})}else t.exposed||(t.exposed={});w&&t.render===Vi&&(t.render=w),F!=null&&(t.inheritAttrs=F),H&&(t.components=H),te&&(t.directives=te)}function AR(t,e,n=Vi){We(t)&&(t=Vp(t));for(const i in t){const s=t[i];let r;At(s)?"default"in s?r=cs(s.from||i,s.default,!0):r=cs(s.from||i):r=cs(s),Qt(r)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[i]=r}}function gv(t,e,n){ji(We(t)?t.map(i=>i.bind(e.proxy)):t.bind(e.proxy),e,n)}function yE(t,e,n,i){const s=i.includes(".")?IE(n,i):()=>n[i];if(Kt(t)){const r=e[t];qe(r)&&fn(s,r)}else if(qe(t))fn(s,t.bind(n));else if(At(t))if(We(t))t.forEach(r=>yE(r,e,n,i));else{const r=qe(t.handler)?t.handler.bind(n):e[t.handler];qe(r)&&fn(s,r,t)}}function m_(t){const e=t.type,{mixins:n,extends:i}=e,{mixins:s,optionsCache:r,config:{optionMergeStrategies:o}}=t.appContext,a=r.get(e);let l;return a?l=a:!s.length&&!n&&!i?l=e:(l={},s.length&&s.forEach(c=>fh(l,c,o,!0)),fh(l,e,o)),At(e)&&r.set(e,l),l}function fh(t,e,n,i=!1){const{mixins:s,extends:r}=e;r&&fh(t,r,n,!0),s&&s.forEach(o=>fh(t,o,n,!0));for(const o in e)if(!(i&&o==="expose")){const a=MR[o]||n&&n[o];t[o]=a?a(t[o],e[o]):e[o]}return t}const MR={data:pv,props:mv,emits:mv,methods:vc,computed:vc,beforeCreate:Gn,created:Gn,beforeMount:Gn,mounted:Gn,beforeUpdate:Gn,updated:Gn,beforeDestroy:Gn,beforeUnmount:Gn,destroyed:Gn,unmounted:Gn,activated:Gn,deactivated:Gn,errorCaptured:Gn,serverPrefetch:Gn,components:vc,directives:vc,watch:PR,provide:pv,inject:IR};function pv(t,e){return e?t?function(){return ln(qe(t)?t.call(this,this):t,qe(e)?e.call(this,this):e)}:e:t}function IR(t,e){return vc(Vp(t),Vp(e))}function Vp(t){if(We(t)){const e={};for(let n=0;n1)return n&&qe(e)?e.call(i&&i.proxy):e}}function $R(){return!!(An||_n||rl)}const bE={},wE=()=>Object.create(bE),xE=t=>Object.getPrototypeOf(t)===bE;function LR(t,e,n,i=!1){const s={},r=wE();t.propsDefaults=Object.create(null),EE(t,e,s,r);for(const o in t.propsOptions[0])o in s||(s[o]=void 0);n?t.props=i?s:eE(s):t.type.props?t.props=s:t.props=r,t.attrs=r}function OR(t,e,n,i){const{props:s,attrs:r,vnode:{patchFlag:o}}=t,a=lt(s),[l]=t.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const u=t.vnode.dynamicProps;for(let d=0;d{l=!0;const[h,f]=SE(d,e,!0);ln(o,h),f&&a.push(...f)};!n&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}if(!r&&!l)return At(t)&&i.set(t,tl),tl;if(We(r))for(let u=0;u-1,f[1]=m<0||p-1||ht(f,"default"))&&a.push(d)}}}const c=[o,a];return At(t)&&i.set(t,c),c}function _v(t){return t[0]!=="$"&&!Dc(t)}function yv(t){return t===null?"null":typeof t=="function"?t.name||"":typeof t=="object"&&t.constructor&&t.constructor.name||""}function vv(t,e){return yv(t)===yv(e)}function bv(t,e){return We(e)?e.findIndex(n=>vv(n,t)):qe(e)&&vv(e,t)?0:-1}const CE=t=>t[0]==="_"||t==="$stable",__=t=>We(t)?t.map(ns):[ns(t)],NR=(t,e,n)=>{if(e._n)return e;const i=Re((...s)=>__(e(...s)),n);return i._c=!1,i},TE=(t,e,n)=>{const i=t._ctx;for(const s in t){if(CE(s))continue;const r=t[s];if(qe(r))e[s]=NR(s,r,i);else if(r!=null){const o=__(r);e[s]=()=>o}}},kE=(t,e)=>{const n=__(e);t.slots.default=()=>n},FR=(t,e)=>{const n=t.slots=wE();if(t.vnode.shapeFlag&32){const i=e._;i?(ln(n,e),Ox(n,"_",i,!0)):TE(e,n)}else e&&kE(t,e)},BR=(t,e,n)=>{const{vnode:i,slots:s}=t;let r=!0,o=Ot;if(i.shapeFlag&32){const a=e._;a?n&&a===1?r=!1:(ln(s,e),!n&&a===1&&delete s._):(r=!e.$stable,TE(e,s)),o=e}else e&&(kE(t,e),o={default:1});if(r)for(const a in s)!CE(a)&&o[a]==null&&delete s[a]};function Wp(t,e,n,i,s=!1){if(We(t)){t.forEach((h,f)=>Wp(h,e&&(We(e)?e[f]:e),n,i,s));return}if($c(i)&&!s)return;const r=i.shapeFlag&4?df(i.component):i.el,o=s?null:r,{i:a,r:l}=t,c=e&&e.r,u=a.refs===Ot?a.refs={}:a.refs,d=a.setupState;if(c!=null&&c!==l&&(Kt(c)?(u[c]=null,ht(d,c)&&(d[c]=null)):Qt(c)&&(c.value=null)),qe(l))Jr(l,a,12,[o,u]);else{const h=Kt(l),f=Qt(l);if(h||f){const p=()=>{if(t.f){const m=h?ht(d,l)?d[l]:u[l]:l.value;s?We(m)&&Zm(m,r):We(m)?m.includes(r)||m.push(r):h?(u[l]=[r],ht(d,l)&&(d[l]=u[l])):(l.value=[r],t.k&&(u[t.k]=l.value))}else h?(u[l]=o,ht(d,l)&&(d[l]=o)):f&&(l.value=o,t.k&&(u[t.k]=o))};o?(p.id=-1,li(p,n)):p()}}}const li=yR;function VR(t){return zR(t)}function zR(t,e){const n=Fx();n.__VUE__=!0;const{insert:i,remove:s,patchProp:r,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:d,nextSibling:h,setScopeId:f=Vi,insertStaticContent:p}=t,m=(S,O,K,U=null,re=null,j=null,se=void 0,ee=null,fe=!!O.dynamicChildren)=>{if(S===O)return;S&&!ws(S,O)&&(U=$(S),Y(S,re,j,!0),S=null),O.patchFlag===-2&&(fe=!1,O.dynamicChildren=null);const{type:me,ref:pe,shapeFlag:Le}=O;switch(me){case cf:y(S,O,K,U);break;case Hn:v(S,O,K,U);break;case Sg:S==null&&b(O,K,U,se);break;case $e:H(S,O,K,U,re,j,se,ee,fe);break;default:Le&1?w(S,O,K,U,re,j,se,ee,fe):Le&6?te(S,O,K,U,re,j,se,ee,fe):(Le&64||Le&128)&&me.process(S,O,K,U,re,j,se,ee,fe,ve)}pe!=null&&re&&Wp(pe,S&&S.ref,j,O||S,!O)},y=(S,O,K,U)=>{if(S==null)i(O.el=a(O.children),K,U);else{const re=O.el=S.el;O.children!==S.children&&c(re,O.children)}},v=(S,O,K,U)=>{S==null?i(O.el=l(O.children||""),K,U):O.el=S.el},b=(S,O,K,U)=>{[S.el,S.anchor]=p(S.children,O,K,U,S.el,S.anchor)},E=({el:S,anchor:O},K,U)=>{let re;for(;S&&S!==O;)re=h(S),i(S,K,U),S=re;i(O,K,U)},C=({el:S,anchor:O})=>{let K;for(;S&&S!==O;)K=h(S),s(S),S=K;s(O)},w=(S,O,K,U,re,j,se,ee,fe)=>{O.type==="svg"?se="svg":O.type==="math"&&(se="mathml"),S==null?x(O,K,U,re,j,se,ee,fe):A(S,O,re,j,se,ee,fe)},x=(S,O,K,U,re,j,se,ee)=>{let fe,me;const{props:pe,shapeFlag:Le,transition:Ae,dirs:ze}=S;if(fe=S.el=o(S.type,j,pe&&pe.is,pe),Le&8?u(fe,S.children):Le&16&&k(S.children,fe,null,U,re,xg(S,j),se,ee),ze&&Io(S,null,U,"created"),T(fe,S,S.scopeId,se,U),pe){for(const nt in pe)nt!=="value"&&!Dc(nt)&&r(fe,nt,null,pe[nt],j,S.children,U,re,le);"value"in pe&&r(fe,"value",null,pe.value,j),(me=pe.onVnodeBeforeMount)&&_s(me,U,S)}ze&&Io(S,null,U,"beforeMount");const Be=WR(re,Ae);Be&&Ae.beforeEnter(fe),i(fe,O,K),((me=pe&&pe.onVnodeMounted)||Be||ze)&&li(()=>{me&&_s(me,U,S),Be&&Ae.enter(fe),ze&&Io(S,null,U,"mounted")},re)},T=(S,O,K,U,re)=>{if(K&&f(S,K),U)for(let j=0;j{for(let me=fe;me{const ee=O.el=S.el;let{patchFlag:fe,dynamicChildren:me,dirs:pe}=O;fe|=S.patchFlag&16;const Le=S.props||Ot,Ae=O.props||Ot;let ze;if(K&&Po(K,!1),(ze=Ae.onVnodeBeforeUpdate)&&_s(ze,K,O,S),pe&&Io(O,S,K,"beforeUpdate"),K&&Po(K,!0),me?P(S.dynamicChildren,me,ee,K,U,xg(O,re),j):se||X(S,O,ee,null,K,U,xg(O,re),j,!1),fe>0){if(fe&16)F(ee,O,Le,Ae,K,U,re);else if(fe&2&&Le.class!==Ae.class&&r(ee,"class",null,Ae.class,re),fe&4&&r(ee,"style",Le.style,Ae.style,re),fe&8){const Be=O.dynamicProps;for(let nt=0;nt{ze&&_s(ze,K,O,S),pe&&Io(O,S,K,"updated")},U)},P=(S,O,K,U,re,j,se)=>{for(let ee=0;ee{if(K!==U){if(K!==Ot)for(const ee in K)!Dc(ee)&&!(ee in U)&&r(S,ee,K[ee],null,se,O.children,re,j,le);for(const ee in U){if(Dc(ee))continue;const fe=U[ee],me=K[ee];fe!==me&&ee!=="value"&&r(S,ee,me,fe,se,O.children,re,j,le)}"value"in U&&r(S,"value",K.value,U.value,se)}},H=(S,O,K,U,re,j,se,ee,fe)=>{const me=O.el=S?S.el:a(""),pe=O.anchor=S?S.anchor:a("");let{patchFlag:Le,dynamicChildren:Ae,slotScopeIds:ze}=O;ze&&(ee=ee?ee.concat(ze):ze),S==null?(i(me,K,U),i(pe,K,U),k(O.children||[],K,pe,re,j,se,ee,fe)):Le>0&&Le&64&&Ae&&S.dynamicChildren?(P(S.dynamicChildren,Ae,K,re,j,se,ee),(O.key!=null||re&&O===re.subTree)&&y_(S,O,!0)):X(S,O,K,pe,re,j,se,ee,fe)},te=(S,O,K,U,re,j,se,ee,fe)=>{O.slotScopeIds=ee,S==null?O.shapeFlag&512?re.ctx.activate(O,K,U,se,fe):N(O,K,U,re,j,se,fe):L(S,O,fe)},N=(S,O,K,U,re,j,se)=>{const ee=S.component=rD(S,U,re);if(lf(S)&&(ee.ctx.renderer=ve),oD(ee),ee.asyncDep){if(re&&re.registerDep(ee,I,se),!S.el){const fe=ee.subTree=B(Hn);v(null,fe,O,K)}}else I(ee,S,O,K,re,j,se)},L=(S,O,K)=>{const U=O.component=S.component;if(dR(S,O,K))if(U.asyncDep&&!U.asyncResolved){W(U,O,K);return}else U.next=O,rR(U.update),U.effect.dirty=!0,U.update();else O.el=S.el,U.vnode=O},I=(S,O,K,U,re,j,se)=>{const ee=()=>{if(S.isMounted){let{next:pe,bu:Le,u:Ae,parent:ze,vnode:Be}=S;{const Un=AE(S);if(Un){pe&&(pe.el=Be.el,W(S,pe,se)),Un.asyncDep.then(()=>{S.isUnmounted||ee()});return}}let nt=pe,Ze;Po(S,!1),pe?(pe.el=Be.el,W(S,pe,se)):pe=Be,Le&&Zd(Le),(Ze=pe.props&&pe.props.onVnodeBeforeUpdate)&&_s(Ze,ze,pe,Be),Po(S,!0);const Mt=bg(S),gn=S.subTree;S.subTree=Mt,m(gn,Mt,d(gn.el),$(gn),S,re,j),pe.el=Mt.el,nt===null&&d_(S,Mt.el),Ae&&li(Ae,re),(Ze=pe.props&&pe.props.onVnodeUpdated)&&li(()=>_s(Ze,ze,pe,Be),re)}else{let pe;const{el:Le,props:Ae}=O,{bm:ze,m:Be,parent:nt}=S,Ze=$c(O);if(Po(S,!1),ze&&Zd(ze),!Ze&&(pe=Ae&&Ae.onVnodeBeforeMount)&&_s(pe,nt,O),Po(S,!0),Le&&ge){const Mt=()=>{S.subTree=bg(S),ge(Le,S.subTree,S,re,null)};Ze?O.type.__asyncLoader().then(()=>!S.isUnmounted&&Mt()):Mt()}else{const Mt=S.subTree=bg(S);m(null,Mt,K,U,S,re,j),O.el=Mt.el}if(Be&&li(Be,re),!Ze&&(pe=Ae&&Ae.onVnodeMounted)){const Mt=O;li(()=>_s(pe,nt,Mt),re)}(O.shapeFlag&256||nt&&$c(nt.vnode)&&nt.vnode.shapeFlag&256)&&S.a&&li(S.a,re),S.isMounted=!0,O=K=U=null}},fe=S.effect=new t_(ee,Vi,()=>u_(me),S.scope),me=S.update=()=>{fe.dirty&&fe.run()};me.id=S.uid,Po(S,!0),me()},W=(S,O,K)=>{O.component=S;const U=S.vnode.props;S.vnode=O,S.next=null,OR(S,O.props,U,K),BR(S,O.children,K),fo(),cv(S),go()},X=(S,O,K,U,re,j,se,ee,fe=!1)=>{const me=S&&S.children,pe=S?S.shapeFlag:0,Le=O.children,{patchFlag:Ae,shapeFlag:ze}=O;if(Ae>0){if(Ae&128){ne(me,Le,K,U,re,j,se,ee,fe);return}else if(Ae&256){J(me,Le,K,U,re,j,se,ee,fe);return}}ze&8?(pe&16&&le(me,re,j),Le!==me&&u(K,Le)):pe&16?ze&16?ne(me,Le,K,U,re,j,se,ee,fe):le(me,re,j,!0):(pe&8&&u(K,""),ze&16&&k(Le,K,U,re,j,se,ee,fe))},J=(S,O,K,U,re,j,se,ee,fe)=>{S=S||tl,O=O||tl;const me=S.length,pe=O.length,Le=Math.min(me,pe);let Ae;for(Ae=0;Aepe?le(S,re,j,!0,!1,Le):k(O,K,U,re,j,se,ee,fe,Le)},ne=(S,O,K,U,re,j,se,ee,fe)=>{let me=0;const pe=O.length;let Le=S.length-1,Ae=pe-1;for(;me<=Le&&me<=Ae;){const ze=S[me],Be=O[me]=fe?Br(O[me]):ns(O[me]);if(ws(ze,Be))m(ze,Be,K,null,re,j,se,ee,fe);else break;me++}for(;me<=Le&&me<=Ae;){const ze=S[Le],Be=O[Ae]=fe?Br(O[Ae]):ns(O[Ae]);if(ws(ze,Be))m(ze,Be,K,null,re,j,se,ee,fe);else break;Le--,Ae--}if(me>Le){if(me<=Ae){const ze=Ae+1,Be=zeAe)for(;me<=Le;)Y(S[me],re,j,!0),me++;else{const ze=me,Be=me,nt=new Map;for(me=Be;me<=Ae;me++){const Ut=O[me]=fe?Br(O[me]):ns(O[me]);Ut.key!=null&&nt.set(Ut.key,me)}let Ze,Mt=0;const gn=Ae-Be+1;let Un=!1,Ri=0;const wi=new Array(gn);for(me=0;me=gn){Y(Ut,re,j,!0);continue}let ae;if(Ut.key!=null)ae=nt.get(Ut.key);else for(Ze=Be;Ze<=Ae;Ze++)if(wi[Ze-Be]===0&&ws(Ut,O[Ze])){ae=Ze;break}ae===void 0?Y(Ut,re,j,!0):(wi[ae-Be]=me+1,ae>=Ri?Ri=ae:Un=!0,m(Ut,O[ae],K,null,re,j,se,ee,fe),Mt++)}const Xi=Un?HR(wi):tl;for(Ze=Xi.length-1,me=gn-1;me>=0;me--){const Ut=Be+me,ae=O[Ut],Te=Ut+1{const{el:j,type:se,transition:ee,children:fe,shapeFlag:me}=S;if(me&6){ue(S.component.subTree,O,K,U);return}if(me&128){S.suspense.move(O,K,U);return}if(me&64){se.move(S,O,K,ve);return}if(se===$e){i(j,O,K);for(let Le=0;Leee.enter(j),re);else{const{leave:Le,delayLeave:Ae,afterLeave:ze}=ee,Be=()=>i(j,O,K),nt=()=>{Le(j,()=>{Be(),ze&&ze()})};Ae?Ae(j,Be,nt):nt()}else i(j,O,K)},Y=(S,O,K,U=!1,re=!1)=>{const{type:j,props:se,ref:ee,children:fe,dynamicChildren:me,shapeFlag:pe,patchFlag:Le,dirs:Ae,memoIndex:ze}=S;if(ee!=null&&Wp(ee,null,K,S,!0),ze!=null&&(O.renderCache[ze]=void 0),pe&256){O.ctx.deactivate(S);return}const Be=pe&1&&Ae,nt=!$c(S);let Ze;if(nt&&(Ze=se&&se.onVnodeBeforeUnmount)&&_s(Ze,O,S),pe&6)ie(S.component,K,U);else{if(pe&128){S.suspense.unmount(K,U);return}Be&&Io(S,null,O,"beforeUnmount"),pe&64?S.type.remove(S,O,K,re,ve,U):me&&(j!==$e||Le>0&&Le&64)?le(me,O,K,!1,!0):(j===$e&&Le&384||!re&&pe&16)&&le(fe,O,K),U&&Z(S)}(nt&&(Ze=se&&se.onVnodeUnmounted)||Be)&&li(()=>{Ze&&_s(Ze,O,S),Be&&Io(S,null,O,"unmounted")},K)},Z=S=>{const{type:O,el:K,anchor:U,transition:re}=S;if(O===$e){M(K,U);return}if(O===Sg){C(S);return}const j=()=>{s(K),re&&!re.persisted&&re.afterLeave&&re.afterLeave()};if(S.shapeFlag&1&&re&&!re.persisted){const{leave:se,delayLeave:ee}=re,fe=()=>se(K,j);ee?ee(S.el,j,fe):fe()}else j()},M=(S,O)=>{let K;for(;S!==O;)K=h(S),s(S),S=K;s(O)},ie=(S,O,K)=>{const{bum:U,scope:re,update:j,subTree:se,um:ee,m:fe,a:me}=S;wv(fe),wv(me),U&&Zd(U),re.stop(),j&&(j.active=!1,Y(se,S,O,K)),ee&&li(ee,O),li(()=>{S.isUnmounted=!0},O),O&&O.pendingBranch&&!O.isUnmounted&&S.asyncDep&&!S.asyncResolved&&S.suspenseId===O.pendingId&&(O.deps--,O.deps===0&&O.resolve())},le=(S,O,K,U=!1,re=!1,j=0)=>{for(let se=j;seS.shapeFlag&6?$(S.component.subTree):S.shapeFlag&128?S.suspense.next():h(S.anchor||S.el);let oe=!1;const de=(S,O,K)=>{S==null?O._vnode&&Y(O._vnode,null,null,!0):m(O._vnode||null,S,O,null,null,null,K),oe||(oe=!0,cv(),cE(),oe=!1),O._vnode=S},ve={p:m,um:Y,m:ue,r:Z,mt:N,mc:k,pc:X,pbc:P,n:$,o:t};let z,ge;return e&&([z,ge]=e(ve)),{render:de,hydrate:z,createApp:DR(de,z)}}function xg({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function Po({effect:t,update:e},n){t.allowRecurse=e.allowRecurse=n}function WR(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function y_(t,e,n=!1){const i=t.children,s=e.children;if(We(i)&&We(s))for(let r=0;r>1,t[n[a]]0&&(e[i]=n[r-1]),n[r]=i)}}for(r=n.length,o=n[r-1];r-- >0;)n[r]=o,o=e[o];return n}function AE(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:AE(e)}function wv(t){if(t)for(let e=0;ecs(YR),md={};function fn(t,e,n){return ME(t,e,n)}function ME(t,e,{immediate:n,deep:i,flush:s,once:r,onTrack:o,onTrigger:a}=Ot){if(e&&r){const x=e;e=(...T)=>{x(...T),w()}}const l=An,c=x=>i===!0?x:Wr(x,i===!1?1:void 0);let u,d=!1,h=!1;if(Qt(t)?(u=()=>t.value,d=dh(t)):ea(t)?(u=()=>c(t),d=!0):We(t)?(h=!0,d=t.some(x=>ea(x)||dh(x)),u=()=>t.map(x=>{if(Qt(x))return x.value;if(ea(x))return c(x);if(qe(x))return Jr(x,l,2)})):qe(t)?e?u=()=>Jr(t,l,2):u=()=>(f&&f(),ji(t,l,3,[p])):u=Vi,e&&i){const x=u;u=()=>Wr(x())}let f,p=x=>{f=E.onStop=()=>{Jr(x,l,4),f=E.onStop=void 0}},m;if(uf)if(p=Vi,e?n&&ji(e,l,3,[u(),h?[]:void 0,p]):u(),s==="sync"){const x=jR();m=x.__watcherHandles||(x.__watcherHandles=[])}else return Vi;let y=h?new Array(t.length).fill(md):md;const v=()=>{if(!(!E.active||!E.dirty))if(e){const x=E.run();(i||d||(h?x.some((T,k)=>io(T,y[k])):io(x,y)))&&(f&&f(),ji(e,l,3,[x,y===md?void 0:h&&y[0]===md?[]:y,p]),y=x)}else E.run()};v.allowRecurse=!!e;let b;s==="sync"?b=v:s==="post"?b=()=>li(v,l&&l.suspense):(v.pre=!0,l&&(v.id=l.uid),b=()=>u_(v));const E=new t_(u,Vi,b),C=ef(),w=()=>{E.stop(),C&&Zm(C.effects,E)};return e?n?v():y=E.run():s==="post"?li(E.run.bind(E),l&&l.suspense):E.run(),m&&m.push(w),w}function KR(t,e,n){const i=this.proxy,s=Kt(t)?t.includes(".")?IE(i,t):()=>i[t]:t.bind(i,i);let r;qe(e)?r=e:(r=e.handler,n=e);const o=Lu(this),a=ME(s,r.bind(i),n);return o(),a}function IE(t,e){const n=e.split(".");return()=>{let i=t;for(let s=0;s{Wr(i,e,n)});else if(Lx(t)){for(const i in t)Wr(t[i],e,n);for(const i of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,i)&&Wr(t[i],e,n)}return t}const lf=t=>t.type.__isKeepAlive;function UR(t,e){PE(t,"a",e)}function GR(t,e){PE(t,"da",e)}function PE(t,e,n=An){const i=t.__wdc||(t.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return t()});if(af(e,i,n),n){let s=n.parent;for(;s&&s.parent;)lf(s.parent.vnode)&&XR(i,e,n,s),s=s.parent}}function XR(t,e,n,i){const s=af(e,t,i,!0);Yl(()=>{Zm(i[e],s)},n)}const Fr=Symbol("_leaveCb"),_d=Symbol("_enterCb");function RE(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return xn(()=>{t.isMounted=!0}),p_(()=>{t.isUnmounting=!0}),t}const Ni=[Function,Array],DE={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ni,onEnter:Ni,onAfterEnter:Ni,onEnterCancelled:Ni,onBeforeLeave:Ni,onLeave:Ni,onAfterLeave:Ni,onLeaveCancelled:Ni,onBeforeAppear:Ni,onAppear:Ni,onAfterAppear:Ni,onAppearCancelled:Ni},$E=t=>{const e=t.subTree;return e.component?$E(e.component):e},qR={name:"BaseTransition",props:DE,setup(t,{slots:e}){const n=w_(),i=RE();return()=>{const s=e.default&&v_(e.default(),!0);if(!s||!s.length)return;let r=s[0];if(s.length>1){for(const h of s)if(h.type!==Hn){r=h;break}}const o=lt(t),{mode:a}=o;if(i.isLeaving)return Eg(r);const l=xv(r);if(!l)return Eg(r);let c=tu(l,o,i,n,h=>c=h);ml(l,c);const u=n.subTree,d=u&&xv(u);if(d&&d.type!==Hn&&!ws(l,d)&&$E(n).type!==Hn){const h=tu(d,o,i,n);if(ml(d,h),a==="out-in"&&l.type!==Hn)return i.isLeaving=!0,h.afterLeave=()=>{i.isLeaving=!1,n.update.active!==!1&&(n.effect.dirty=!0,n.update())},Eg(r);a==="in-out"&&l.type!==Hn&&(h.delayLeave=(f,p,m)=>{const y=LE(i,d);y[String(d.key)]=d,f[Fr]=()=>{p(),f[Fr]=void 0,delete c.delayedLeave},c.delayedLeave=m})}return r}}},ZR=qR;function LE(t,e){const{leavingVNodes:n}=t;let i=n.get(e.type);return i||(i=Object.create(null),n.set(e.type,i)),i}function tu(t,e,n,i,s){const{appear:r,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:h,onLeave:f,onAfterLeave:p,onLeaveCancelled:m,onBeforeAppear:y,onAppear:v,onAfterAppear:b,onAppearCancelled:E}=e,C=String(t.key),w=LE(n,t),x=(A,P)=>{A&&ji(A,i,9,P)},T=(A,P)=>{const F=P[1];x(A,P),We(A)?A.every(H=>H.length<=1)&&F():A.length<=1&&F()},k={mode:o,persisted:a,beforeEnter(A){let P=l;if(!n.isMounted)if(r)P=y||l;else return;A[Fr]&&A[Fr](!0);const F=w[C];F&&ws(t,F)&&F.el[Fr]&&F.el[Fr](),x(P,[A])},enter(A){let P=c,F=u,H=d;if(!n.isMounted)if(r)P=v||c,F=b||u,H=E||d;else return;let te=!1;const N=A[_d]=L=>{te||(te=!0,L?x(H,[A]):x(F,[A]),k.delayedLeave&&k.delayedLeave(),A[_d]=void 0)};P?T(P,[A,N]):N()},leave(A,P){const F=String(t.key);if(A[_d]&&A[_d](!0),n.isUnmounting)return P();x(h,[A]);let H=!1;const te=A[Fr]=N=>{H||(H=!0,P(),N?x(m,[A]):x(p,[A]),A[Fr]=void 0,w[F]===t&&delete w[F])};w[F]=t,f?T(f,[A,te]):te()},clone(A){const P=tu(A,e,n,i,s);return s&&s(P),P}};return k}function Eg(t){if(lf(t))return t=so(t),t.children=null,t}function xv(t){if(!lf(t))return t;const{shapeFlag:e,children:n}=t;if(n){if(e&16)return n[0];if(e&32&&qe(n.default))return n.default()}}function ml(t,e){t.shapeFlag&6&&t.component?ml(t.component.subTree,e):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function v_(t,e=!1,n){let i=[],s=0;for(let r=0;r1)for(let r=0;rt.__isTeleport,Oc=t=>t&&(t.disabled||t.disabled===""),Ev=t=>typeof SVGElement<"u"&&t instanceof SVGElement,Sv=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,Hp=(t,e)=>{const n=t&&t.to;return Kt(n)?e?e(n):null:n},QR={name:"Teleport",__isTeleport:!0,process(t,e,n,i,s,r,o,a,l,c){const{mc:u,pc:d,pbc:h,o:{insert:f,querySelector:p,createText:m,createComment:y}}=c,v=Oc(e.props);let{shapeFlag:b,children:E,dynamicChildren:C}=e;if(t==null){const w=e.el=m(""),x=e.anchor=m("");f(w,n,i),f(x,n,i);const T=e.target=Hp(e.props,p),k=e.targetAnchor=m("");T&&(f(k,T),o==="svg"||Ev(T)?o="svg":(o==="mathml"||Sv(T))&&(o="mathml"));const A=(P,F)=>{b&16&&u(E,P,F,s,r,o,a,l)};v?A(n,x):T&&A(T,k)}else{e.el=t.el;const w=e.anchor=t.anchor,x=e.target=t.target,T=e.targetAnchor=t.targetAnchor,k=Oc(t.props),A=k?n:x,P=k?w:T;if(o==="svg"||Ev(x)?o="svg":(o==="mathml"||Sv(x))&&(o="mathml"),C?(h(t.dynamicChildren,C,A,s,r,o,a),y_(t,e,!0)):l||d(t,e,A,P,s,r,o,a,!1),v)k?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):yd(e,n,w,c,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const F=e.target=Hp(e.props,p);F&&yd(e,F,null,c,0)}else k&&yd(e,x,T,c,1)}OE(e)},remove(t,e,n,i,{um:s,o:{remove:r}},o){const{shapeFlag:a,children:l,anchor:c,targetAnchor:u,target:d,props:h}=t;if(d&&r(u),o&&r(c),a&16){const f=o||!Oc(h);for(let p=0;p0?zi||tl:null,NE(),_l>0&&zi&&zi.push(t),t}function V(t,e,n,i,s,r){return FE(g(t,e,n,i,s,r,!0))}function Ce(t,e,n,i,s){return FE(B(t,e,n,i,s,!0))}function nu(t){return t?t.__v_isVNode===!0:!1}function ws(t,e){return t.type===e.type&&t.key===e.key}const BE=({key:t})=>t??null,eh=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?Kt(t)||Qt(t)||qe(t)?{i:_n,r:t,k:e,f:!!n}:t:null);function g(t,e=null,n=null,i=0,s=null,r=t===$e?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&BE(e),ref:e&&eh(e),scopeId:of,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:i,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:_n};return a?(b_(l,n),r&128&&t.normalize(l)):n&&(l.shapeFlag|=Kt(n)?8:16),_l>0&&!o&&zi&&(l.patchFlag>0||r&6)&&l.patchFlag!==32&&zi.push(l),l}const B=nD;function nD(t,e=null,n=null,i=0,s=null,r=!1){if((!t||t===hE)&&(t=Hn),nu(t)){const a=so(t,e,!0);return n&&b_(a,n),_l>0&&!r&&zi&&(a.shapeFlag&6?zi[zi.indexOf(t)]=a:zi.push(a)),a.patchFlag=-2,a}if(uD(t)&&(t=t.__vccOpts),e){e=Zn(e);let{class:a,style:l}=e;a&&!Kt(a)&&(e.class=Ie(a)),At(l)&&(nf(l)&&!We(l)&&(l=ln({},l)),e.style=Mn(l))}const o=Kt(t)?1:hR(t)?128:JR(t)?64:At(t)?4:qe(t)?2:0;return g(t,e,n,i,s,o,r,!0)}function Zn(t){return t?nf(t)||xE(t)?ln({},t):t:null}function so(t,e,n=!1,i=!1){const{props:s,ref:r,patchFlag:o,children:a,transition:l}=t,c=e?yn(s||{},e):s,u={__v_isVNode:!0,__v_skip:!0,type:t.type,props:c,key:c&&BE(c),ref:e&&e.ref?n&&r?We(r)?r.concat(eh(e)):[r,eh(e)]:eh(e):r,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:a,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==$e?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:l,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&so(t.ssContent),ssFallback:t.ssFallback&&so(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return l&&i&&ml(u,l.clone(u)),u}function He(t=" ",e=0){return B(cf,null,t,e)}function ce(t="",e=!1){return e?(D(),Ce(Hn,null,t)):B(Hn,null,t)}function ns(t){return t==null||typeof t=="boolean"?B(Hn):We(t)?B($e,null,t.slice()):typeof t=="object"?Br(t):B(cf,null,String(t))}function Br(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:so(t)}function b_(t,e){let n=0;const{shapeFlag:i}=t;if(e==null)e=null;else if(We(e))n=16;else if(typeof e=="object")if(i&65){const s=e.default;s&&(s._c&&(s._d=!1),b_(t,s()),s._c&&(s._d=!0));return}else{n=32;const s=e._;!s&&!xE(e)?e._ctx=_n:s===3&&_n&&(_n.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else qe(e)?(e={default:e,_ctx:_n},n=32):(e=String(e),i&64?(n=16,e=[He(e)]):n=8);t.children=e,t.shapeFlag|=n}function yn(...t){const e={};for(let n=0;nAn||_n;let gh,Yp;{const t=Fx(),e=(n,i)=>{let s;return(s=t[n])||(s=t[n]=[]),s.push(i),r=>{s.length>1?s.forEach(o=>o(r)):s[0](r)}};gh=e("__VUE_INSTANCE_SETTERS__",n=>An=n),Yp=e("__VUE_SSR_SETTERS__",n=>uf=n)}const Lu=t=>{const e=An;return gh(t),t.scope.on(),()=>{t.scope.off(),gh(e)}},Tv=()=>{An&&An.scope.off(),gh(null)};function VE(t){return t.vnode.shapeFlag&4}let uf=!1;function oD(t,e=!1){e&&Yp(e);const{props:n,children:i}=t.vnode,s=VE(t);LR(t,n,s,e),FR(t,i);const r=s?aD(t,e):void 0;return e&&Yp(!1),r}function aD(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,CR);const{setup:i}=n;if(i){const s=t.setupContext=i.length>1?WE(t):null,r=Lu(t);fo();const o=Jr(i,t,0,[t.props,s]);if(go(),r(),Dx(o)){if(o.then(Tv,Tv),e)return o.then(a=>{jp(t,a,e)}).catch(a=>{$u(a,t,0)});t.asyncDep=o}else jp(t,o,e)}else zE(t,e)}function jp(t,e,n){qe(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:At(e)&&(t.setupState=rE(e)),zE(t,n)}let kv;function zE(t,e,n){const i=t.type;if(!t.render){if(!e&&kv&&!i.render){const s=i.template||m_(t).template;if(s){const{isCustomElement:r,compilerOptions:o}=t.appContext.config,{delimiters:a,compilerOptions:l}=i,c=ln(ln({isCustomElement:r,delimiters:a},o),l);i.render=kv(s,c)}}t.render=i.render||Vi}{const s=Lu(t);fo();try{kR(t)}finally{go(),s()}}}const lD={get(t,e){return yi(t,"get",""),t[e]}};function WE(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,lD),slots:t.slots,emit:t.emit,expose:e}}function df(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(rE(sf(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in Lc)return Lc[n](t)},has(e,n){return n in e||n in Lc}})):t.proxy}function cD(t,e=!0){return qe(t)?t.displayName||t.name:t.name||e&&t.__name}function uD(t){return qe(t)&&"__vccOpts"in t}const be=(t,e)=>Z2(t,e,uf);function la(t,e,n){const i=arguments.length;return i===2?At(e)&&!We(e)?nu(e)?B(t,null,[e]):B(t,e):B(t,null,e):(i>3?n=Array.prototype.slice.call(arguments,2):i===3&&nu(n)&&(n=[n]),B(t,e,n))}const HE="3.4.29";/** +**/function Jr(t,e,n,i){try{return i?t(...i):t()}catch(s){$u(s,e,n)}}function ji(t,e,n,i){if(qe(t)){const s=Jr(t,e,n,i);return s&&Dx(s)&&s.catch(r=>{$u(r,e,n)}),s}if(We(t)){const s=[];for(let r=0;r>>1,s=Wn[i],r=Qc(s);rbs&&Wn.splice(e,1)}function Op(t){We(t)?il.push(...t):(!Nr||!Nr.includes(t,t.allowRecurse?Yo+1:Yo))&&il.push(t),lE()}function cv(t,e,n=Jc?bs+1:0){for(;nQc(n)-Qc(i));if(il.length=0,Nr){Nr.push(...e);return}for(Nr=e,Yo=0;Yot.id==null?1/0:t.id,oR=(t,e)=>{const n=Qc(t)-Qc(e);if(n===0){if(t.pre&&!e.pre)return-1;if(e.pre&&!t.pre)return 1}return n};function uE(t){Lp=!1,Jc=!0,Wn.sort(oR);try{for(bs=0;bsKt(f)?f.trim():f)),d&&(s=n.map(ch))}let a,l=i[a=yg(e)]||i[a=yg(Ls(e))];!l&&r&&(l=i[a=yg(fa(e))]),l&&ji(l,t,6,s);const c=i[a+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,ji(c,t,6,s)}}function dE(t,e,n=!1){const i=e.emitsCache,s=i.get(t);if(s!==void 0)return s;const r=t.emits;let o={},a=!1;if(!qe(t)){const l=c=>{const u=dE(c,e,!0);u&&(a=!0,ln(o,u))};!n&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}return!r&&!a?(At(t)&&i.set(t,null),null):(We(r)?r.forEach(l=>o[l]=null):ln(o,r),At(t)&&i.set(t,o),o)}function rf(t,e){return!t||!Zh(e)?!1:(e=e.slice(2).replace(/Once$/,""),ht(t,e[0].toLowerCase()+e.slice(1))||ht(t,fa(e))||ht(t,e))}let _n=null,of=null;function hh(t){const e=_n;return _n=t,of=t&&t.type.__scopeId||null,e}function bn(t){of=t}function wn(){of=null}function Re(t,e=_n,n){if(!e||t._n)return t;const i=(...s)=>{i._d&&Cv(-1);const r=hh(e);let o;try{o=t(...s)}finally{hh(r),i._d&&Cv(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function bg(t){const{type:e,vnode:n,proxy:i,withProxy:s,propsOptions:[r],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:d,data:h,setupState:f,ctx:p,inheritAttrs:m}=t,y=hh(t);let v,b;try{if(n.shapeFlag&4){const C=s||i,w=C;v=ns(c.call(w,C,u,d,f,h,p)),b=a}else{const C=e;v=ns(C.length>1?C(d,{attrs:a,slots:o,emit:l}):C(d,null)),b=e.props?a:cR(a)}}catch(C){Nc.length=0,$u(C,t,1),v=B(Hn)}let E=v;if(b&&m!==!1){const C=Object.keys(b),{shapeFlag:w}=E;C.length&&w&7&&(r&&C.some(qm)&&(b=uR(b,r)),E=so(E,b,!1,!0))}return n.dirs&&(E=so(E,null,!1,!0),E.dirs=E.dirs?E.dirs.concat(n.dirs):n.dirs),n.transition&&(E.transition=n.transition),v=E,hh(y),v}function lR(t,e=!0){let n;for(let i=0;i{let e;for(const n in t)(n==="class"||n==="style"||Zh(n))&&((e||(e={}))[n]=t[n]);return e},uR=(t,e)=>{const n={};for(const i in t)(!qm(i)||!(i.slice(9)in e))&&(n[i]=t[i]);return n};function dR(t,e,n){const{props:i,children:s,component:r}=t,{props:o,children:a,patchFlag:l}=e,c=r.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return i?uv(i,o,c):!!o;if(l&8){const u=e.dynamicProps;for(let d=0;dt.__isSuspense;let Np=0;const fR={name:"Suspense",__isSuspense:!0,process(t,e,n,i,s,r,o,a,l,c){if(t==null)gR(e,n,i,s,r,o,a,l,c);else{if(r&&r.deps>0&&!t.suspense.isInFallback){e.suspense=t.suspense,e.suspense.vnode=e,e.el=t.el;return}pR(t,e,n,i,s,o,a,l,c)}},hydrate:mR,create:g_,normalize:_R},f_=fR;function eu(t,e){const n=t.props&&t.props[e];qe(n)&&n()}function gR(t,e,n,i,s,r,o,a,l){const{p:c,o:{createElement:u}}=l,d=u("div"),h=t.suspense=g_(t,s,i,e,d,n,r,o,a,l);c(null,h.pendingBranch=t.ssContent,d,null,i,h,r,o),h.deps>0?(eu(t,"onPending"),eu(t,"onFallback"),c(null,t.ssFallback,e,n,i,null,r,o),sl(h,t.ssFallback)):h.resolve(!1,!0)}function pR(t,e,n,i,s,r,o,a,{p:l,um:c,o:{createElement:u}}){const d=e.suspense=t.suspense;d.vnode=e,e.el=t.el;const h=e.ssContent,f=e.ssFallback,{activeBranch:p,pendingBranch:m,isInFallback:y,isHydrating:v}=d;if(m)d.pendingBranch=h,ws(h,m)?(l(m,h,d.hiddenContainer,null,s,d,r,o,a),d.deps<=0?d.resolve():y&&(v||(l(p,f,n,i,s,null,r,o,a),sl(d,f)))):(d.pendingId=Np++,v?(d.isHydrating=!1,d.activeBranch=m):c(m,s,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),y?(l(null,h,d.hiddenContainer,null,s,d,r,o,a),d.deps<=0?d.resolve():(l(p,f,n,i,s,null,r,o,a),sl(d,f))):p&&ws(h,p)?(l(p,h,n,i,s,d,r,o,a),d.resolve(!0)):(l(null,h,d.hiddenContainer,null,s,d,r,o,a),d.deps<=0&&d.resolve()));else if(p&&ws(h,p))l(p,h,n,i,s,d,r,o,a),sl(d,h);else if(eu(e,"onPending"),d.pendingBranch=h,h.shapeFlag&512?d.pendingId=h.component.suspenseId:d.pendingId=Np++,l(null,h,d.hiddenContainer,null,s,d,r,o,a),d.deps<=0)d.resolve();else{const{timeout:b,pendingId:E}=d;b>0?setTimeout(()=>{d.pendingId===E&&d.fallback(f)},b):b===0&&d.fallback(f)}}function g_(t,e,n,i,s,r,o,a,l,c,u=!1){const{p:d,m:h,um:f,n:p,o:{parentNode:m,remove:y}}=c;let v;const b=vR(t);b&&e&&e.pendingBranch&&(v=e.pendingId,e.deps++);const E=t.props?Nx(t.props.timeout):void 0,C=r,w={vnode:t,parent:e,parentComponent:n,namespace:o,container:i,hiddenContainer:s,deps:0,pendingId:Np++,timeout:typeof E=="number"?E:-1,activeBranch:null,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(x=!1,T=!1){const{vnode:k,activeBranch:A,pendingBranch:P,pendingId:F,effects:H,parentComponent:te,container:N}=w;let L=!1;w.isHydrating?w.isHydrating=!1:x||(L=A&&P.transition&&P.transition.mode==="out-in",L&&(A.transition.afterLeave=()=>{F===w.pendingId&&(h(P,N,r===C?p(A):r,0),Op(H))}),A&&(m(A.el)!==w.hiddenContainer&&(r=p(A)),f(A,te,w,!0)),L||h(P,N,r,0)),sl(w,P),w.pendingBranch=null,w.isInFallback=!1;let I=w.parent,W=!1;for(;I;){if(I.pendingBranch){I.effects.push(...H),W=!0;break}I=I.parent}!W&&!L&&Op(H),w.effects=[],b&&e&&e.pendingBranch&&v===e.pendingId&&(e.deps--,e.deps===0&&!T&&e.resolve()),eu(k,"onResolve")},fallback(x){if(!w.pendingBranch)return;const{vnode:T,activeBranch:k,parentComponent:A,container:P,namespace:F}=w;eu(T,"onFallback");const H=p(k),te=()=>{w.isInFallback&&(d(null,x,P,H,A,null,F,a,l),sl(w,x))},N=x.transition&&x.transition.mode==="out-in";N&&(k.transition.afterLeave=te),w.isInFallback=!0,f(k,A,null,!0),N||te()},move(x,T,k){w.activeBranch&&h(w.activeBranch,x,T,k),w.container=x},next(){return w.activeBranch&&p(w.activeBranch)},registerDep(x,T,k){const A=!!w.pendingBranch;A&&w.deps++;const P=x.vnode.el;x.asyncDep.catch(F=>{$u(F,x,0)}).then(F=>{if(x.isUnmounted||w.isUnmounted||w.pendingId!==x.suspenseId)return;x.asyncResolved=!0;const{vnode:H}=x;jp(x,F,!1),P&&(H.el=P);const te=!P&&x.subTree.el;T(x,H,m(P||x.subTree.el),P?null:p(x.subTree),w,o,k),te&&y(te),d_(x,H.el),A&&--w.deps===0&&w.resolve()})},unmount(x,T){w.isUnmounted=!0,w.activeBranch&&f(w.activeBranch,n,x,T),w.pendingBranch&&f(w.pendingBranch,n,x,T)}};return w}function mR(t,e,n,i,s,r,o,a,l){const c=e.suspense=g_(e,i,n,t.parentNode,document.createElement("div"),null,s,r,o,a,!0),u=l(t,c.pendingBranch=e.ssContent,n,c,r,o);return c.deps===0&&c.resolve(!1,!0),u}function _R(t){const{shapeFlag:e,children:n}=t,i=e&32;t.ssContent=hv(i?n.default:n),t.ssFallback=i?hv(n.fallback):B(Hn)}function hv(t){let e;if(qe(t)){const n=_l&&t._c;n&&(t._d=!1,D()),t=t(),n&&(t._d=!0,e=zi,NE())}return We(t)&&(t=lR(t)),t=ns(t),e&&!t.dynamicChildren&&(t.dynamicChildren=e.filter(n=>n!==t)),t}function yR(t,e){e&&e.pendingBranch?We(t)?e.effects.push(...t):e.effects.push(t):Op(t)}function sl(t,e){t.activeBranch=e;const{vnode:n,parentComponent:i}=t;let s=e.el;for(;!s&&e.component;)e=e.component.subTree,s=e.el;n.el=s,i&&i.subTree===n&&(i.vnode.el=s,d_(i,s))}function vR(t){const e=t.props&&t.props.suspensible;return e!=null&&e!==!1}function af(t,e,n=An,i=!1){if(n){const s=n[t]||(n[t]=[]),r=e.__weh||(e.__weh=(...o)=>{fo();const a=Lu(n),l=ji(e,n,t,o);return a(),go(),l});return i?s.unshift(r):s.push(r),r}}const yr=t=>(e,n=An)=>{(!uf||t==="sp")&&af(t,(...i)=>e(...i),n)},bR=yr("bm"),xn=yr("m"),gE=yr("bu"),pE=yr("u"),p_=yr("bum"),Yl=yr("um"),wR=yr("sp"),xR=yr("rtg"),ER=yr("rtc");function SR(t,e=An){af("ec",t,e)}function Oe(t,e){if(_n===null)return t;const n=df(_n),i=t.dirs||(t.dirs=[]);for(let s=0;se(o,a,void 0,r&&r[a]));else{const o=Object.keys(t);s=new Array(o.length);for(let a=0,l=o.length;a{const r=i.fn(...s);return r&&(r.key=i.key),r}:i.fn)}return t}/*! #__NO_SIDE_EFFECTS__ */function cn(t,e){return qe(t)?ln({name:t.name},e,{setup:t}):t}const $c=t=>!!t.type.__asyncLoader;function Ne(t,e,n={},i,s){if(_n.isCE||_n.parent&&$c(_n.parent)&&_n.parent.isCE)return e!=="default"&&(n.name=e),B("slot",n,i&&i());let r=t[e];r&&r._c&&(r._d=!1),D();const o=r&&mE(r(n)),a=Ce($e,{key:n.key||o&&o.key||`_${e}`},o||(i?i():[]),o&&t._===1?64:-2);return!s&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),r&&r._c&&(r._d=!0),a}function mE(t){return t.some(e=>nu(e)?!(e.type===Hn||e.type===$e&&!mE(e.children)):!0)?t:null}const Fp=t=>t?VE(t)?df(t):Fp(t.parent):null,Lc=ln(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Fp(t.parent),$root:t=>Fp(t.root),$emit:t=>t.emit,$options:t=>m_(t),$forceUpdate:t=>t.f||(t.f=()=>{t.effect.dirty=!0,u_(t.update)}),$nextTick:t=>t.n||(t.n=Rn.bind(t.proxy)),$watch:t=>KR.bind(t)}),wg=(t,e)=>t!==Ot&&!t.__isScriptSetup&&ht(t,e),CR={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:i,data:s,props:r,accessCache:o,type:a,appContext:l}=t;let c;if(e[0]!=="$"){const f=o[e];if(f!==void 0)switch(f){case 1:return i[e];case 2:return s[e];case 4:return n[e];case 3:return r[e]}else{if(wg(i,e))return o[e]=1,i[e];if(s!==Ot&&ht(s,e))return o[e]=2,s[e];if((c=t.propsOptions[0])&&ht(c,e))return o[e]=3,r[e];if(n!==Ot&&ht(n,e))return o[e]=4,n[e];Bp&&(o[e]=0)}}const u=Lc[e];let d,h;if(u)return e==="$attrs"&&yi(t.attrs,"get",""),u(t);if((d=a.__cssModules)&&(d=d[e]))return d;if(n!==Ot&&ht(n,e))return o[e]=4,n[e];if(h=l.config.globalProperties,ht(h,e))return h[e]},set({_:t},e,n){const{data:i,setupState:s,ctx:r}=t;return wg(s,e)?(s[e]=n,!0):i!==Ot&&ht(i,e)?(i[e]=n,!0):ht(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(r[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:i,appContext:s,propsOptions:r}},o){let a;return!!n[o]||t!==Ot&&ht(t,o)||wg(e,o)||(a=r[0])&&ht(a,o)||ht(i,o)||ht(Lc,o)||ht(s.config.globalProperties,o)},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:ht(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function pa(){return _E().slots}function TR(){return _E().attrs}function _E(){const t=w_();return t.setupContext||(t.setupContext=WE(t))}function fv(t){return We(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}let Bp=!0;function kR(t){const e=m_(t),n=t.proxy,i=t.ctx;Bp=!1,e.beforeCreate&&gv(e.beforeCreate,t,"bc");const{data:s,computed:r,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:d,mounted:h,beforeUpdate:f,updated:p,activated:m,deactivated:y,beforeDestroy:v,beforeUnmount:b,destroyed:E,unmounted:C,render:w,renderTracked:x,renderTriggered:T,errorCaptured:k,serverPrefetch:A,expose:P,inheritAttrs:F,components:H,directives:te,filters:N}=e;if(c&&AR(c,i,null),o)for(const W in o){const X=o[W];qe(X)&&(i[W]=X.bind(n))}if(s){const W=s.call(n,n);At(W)&&(t.data=Ns(W))}if(Bp=!0,r)for(const W in r){const X=r[W],J=qe(X)?X.bind(n,n):qe(X.get)?X.get.bind(n,n):Vi,ne=!qe(X)&&qe(X.set)?X.set.bind(n):Vi,ue=be({get:J,set:ne});Object.defineProperty(i,W,{enumerable:!0,configurable:!0,get:()=>ue.value,set:Y=>ue.value=Y})}if(a)for(const W in a)yE(a[W],i,n,W);if(l){const W=qe(l)?l.call(n):l;Reflect.ownKeys(W).forEach(X=>{Qd(X,W[X])})}u&&gv(u,t,"c");function I(W,X){We(X)?X.forEach(J=>W(J.bind(n))):X&&W(X.bind(n))}if(I(bR,d),I(xn,h),I(gE,f),I(pE,p),I(UR,m),I(GR,y),I(SR,k),I(ER,x),I(xR,T),I(p_,b),I(Yl,C),I(wR,A),We(P))if(P.length){const W=t.exposed||(t.exposed={});P.forEach(X=>{Object.defineProperty(W,X,{get:()=>n[X],set:J=>n[X]=J})})}else t.exposed||(t.exposed={});w&&t.render===Vi&&(t.render=w),F!=null&&(t.inheritAttrs=F),H&&(t.components=H),te&&(t.directives=te)}function AR(t,e,n=Vi){We(t)&&(t=Vp(t));for(const i in t){const s=t[i];let r;At(s)?"default"in s?r=cs(s.from||i,s.default,!0):r=cs(s.from||i):r=cs(s),Qt(r)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[i]=r}}function gv(t,e,n){ji(We(t)?t.map(i=>i.bind(e.proxy)):t.bind(e.proxy),e,n)}function yE(t,e,n,i){const s=i.includes(".")?IE(n,i):()=>n[i];if(Kt(t)){const r=e[t];qe(r)&&fn(s,r)}else if(qe(t))fn(s,t.bind(n));else if(At(t))if(We(t))t.forEach(r=>yE(r,e,n,i));else{const r=qe(t.handler)?t.handler.bind(n):e[t.handler];qe(r)&&fn(s,r,t)}}function m_(t){const e=t.type,{mixins:n,extends:i}=e,{mixins:s,optionsCache:r,config:{optionMergeStrategies:o}}=t.appContext,a=r.get(e);let l;return a?l=a:!s.length&&!n&&!i?l=e:(l={},s.length&&s.forEach(c=>fh(l,c,o,!0)),fh(l,e,o)),At(e)&&r.set(e,l),l}function fh(t,e,n,i=!1){const{mixins:s,extends:r}=e;r&&fh(t,r,n,!0),s&&s.forEach(o=>fh(t,o,n,!0));for(const o in e)if(!(i&&o==="expose")){const a=MR[o]||n&&n[o];t[o]=a?a(t[o],e[o]):e[o]}return t}const MR={data:pv,props:mv,emits:mv,methods:vc,computed:vc,beforeCreate:Gn,created:Gn,beforeMount:Gn,mounted:Gn,beforeUpdate:Gn,updated:Gn,beforeDestroy:Gn,beforeUnmount:Gn,destroyed:Gn,unmounted:Gn,activated:Gn,deactivated:Gn,errorCaptured:Gn,serverPrefetch:Gn,components:vc,directives:vc,watch:PR,provide:pv,inject:IR};function pv(t,e){return e?t?function(){return ln(qe(t)?t.call(this,this):t,qe(e)?e.call(this,this):e)}:e:t}function IR(t,e){return vc(Vp(t),Vp(e))}function Vp(t){if(We(t)){const e={};for(let n=0;n1)return n&&qe(e)?e.call(i&&i.proxy):e}}function $R(){return!!(An||_n||rl)}const bE={},wE=()=>Object.create(bE),xE=t=>Object.getPrototypeOf(t)===bE;function LR(t,e,n,i=!1){const s={},r=wE();t.propsDefaults=Object.create(null),EE(t,e,s,r);for(const o in t.propsOptions[0])o in s||(s[o]=void 0);n?t.props=i?s:eE(s):t.type.props?t.props=s:t.props=r,t.attrs=r}function OR(t,e,n,i){const{props:s,attrs:r,vnode:{patchFlag:o}}=t,a=lt(s),[l]=t.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const u=t.vnode.dynamicProps;for(let d=0;d{l=!0;const[h,f]=SE(d,e,!0);ln(o,h),f&&a.push(...f)};!n&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}if(!r&&!l)return At(t)&&i.set(t,tl),tl;if(We(r))for(let u=0;u-1,f[1]=m<0||p-1||ht(f,"default"))&&a.push(d)}}}const c=[o,a];return At(t)&&i.set(t,c),c}function _v(t){return t[0]!=="$"&&!Dc(t)}function yv(t){return t===null?"null":typeof t=="function"?t.name||"":typeof t=="object"&&t.constructor&&t.constructor.name||""}function vv(t,e){return yv(t)===yv(e)}function bv(t,e){return We(e)?e.findIndex(n=>vv(n,t)):qe(e)&&vv(e,t)?0:-1}const CE=t=>t[0]==="_"||t==="$stable",__=t=>We(t)?t.map(ns):[ns(t)],NR=(t,e,n)=>{if(e._n)return e;const i=Re((...s)=>__(e(...s)),n);return i._c=!1,i},TE=(t,e,n)=>{const i=t._ctx;for(const s in t){if(CE(s))continue;const r=t[s];if(qe(r))e[s]=NR(s,r,i);else if(r!=null){const o=__(r);e[s]=()=>o}}},kE=(t,e)=>{const n=__(e);t.slots.default=()=>n},FR=(t,e)=>{const n=t.slots=wE();if(t.vnode.shapeFlag&32){const i=e._;i?(ln(n,e),Ox(n,"_",i,!0)):TE(e,n)}else e&&kE(t,e)},BR=(t,e,n)=>{const{vnode:i,slots:s}=t;let r=!0,o=Ot;if(i.shapeFlag&32){const a=e._;a?n&&a===1?r=!1:(ln(s,e),!n&&a===1&&delete s._):(r=!e.$stable,TE(e,s)),o=e}else e&&(kE(t,e),o={default:1});if(r)for(const a in s)!CE(a)&&o[a]==null&&delete s[a]};function Wp(t,e,n,i,s=!1){if(We(t)){t.forEach((h,f)=>Wp(h,e&&(We(e)?e[f]:e),n,i,s));return}if($c(i)&&!s)return;const r=i.shapeFlag&4?df(i.component):i.el,o=s?null:r,{i:a,r:l}=t,c=e&&e.r,u=a.refs===Ot?a.refs={}:a.refs,d=a.setupState;if(c!=null&&c!==l&&(Kt(c)?(u[c]=null,ht(d,c)&&(d[c]=null)):Qt(c)&&(c.value=null)),qe(l))Jr(l,a,12,[o,u]);else{const h=Kt(l),f=Qt(l);if(h||f){const p=()=>{if(t.f){const m=h?ht(d,l)?d[l]:u[l]:l.value;s?We(m)&&Zm(m,r):We(m)?m.includes(r)||m.push(r):h?(u[l]=[r],ht(d,l)&&(d[l]=u[l])):(l.value=[r],t.k&&(u[t.k]=l.value))}else h?(u[l]=o,ht(d,l)&&(d[l]=o)):f&&(l.value=o,t.k&&(u[t.k]=o))};o?(p.id=-1,li(p,n)):p()}}}const li=yR;function VR(t){return zR(t)}function zR(t,e){const n=Fx();n.__VUE__=!0;const{insert:i,remove:s,patchProp:r,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:d,nextSibling:h,setScopeId:f=Vi,insertStaticContent:p}=t,m=(S,O,K,U=null,re=null,j=null,se=void 0,ee=null,fe=!!O.dynamicChildren)=>{if(S===O)return;S&&!ws(S,O)&&(U=$(S),Y(S,re,j,!0),S=null),O.patchFlag===-2&&(fe=!1,O.dynamicChildren=null);const{type:me,ref:pe,shapeFlag:Le}=O;switch(me){case cf:y(S,O,K,U);break;case Hn:v(S,O,K,U);break;case Sg:S==null&&b(O,K,U,se);break;case $e:H(S,O,K,U,re,j,se,ee,fe);break;default:Le&1?w(S,O,K,U,re,j,se,ee,fe):Le&6?te(S,O,K,U,re,j,se,ee,fe):(Le&64||Le&128)&&me.process(S,O,K,U,re,j,se,ee,fe,ve)}pe!=null&&re&&Wp(pe,S&&S.ref,j,O||S,!O)},y=(S,O,K,U)=>{if(S==null)i(O.el=a(O.children),K,U);else{const re=O.el=S.el;O.children!==S.children&&c(re,O.children)}},v=(S,O,K,U)=>{S==null?i(O.el=l(O.children||""),K,U):O.el=S.el},b=(S,O,K,U)=>{[S.el,S.anchor]=p(S.children,O,K,U,S.el,S.anchor)},E=({el:S,anchor:O},K,U)=>{let re;for(;S&&S!==O;)re=h(S),i(S,K,U),S=re;i(O,K,U)},C=({el:S,anchor:O})=>{let K;for(;S&&S!==O;)K=h(S),s(S),S=K;s(O)},w=(S,O,K,U,re,j,se,ee,fe)=>{O.type==="svg"?se="svg":O.type==="math"&&(se="mathml"),S==null?x(O,K,U,re,j,se,ee,fe):A(S,O,re,j,se,ee,fe)},x=(S,O,K,U,re,j,se,ee)=>{let fe,me;const{props:pe,shapeFlag:Le,transition:Ae,dirs:ze}=S;if(fe=S.el=o(S.type,j,pe&&pe.is,pe),Le&8?u(fe,S.children):Le&16&&k(S.children,fe,null,U,re,xg(S,j),se,ee),ze&&Io(S,null,U,"created"),T(fe,S,S.scopeId,se,U),pe){for(const it in pe)it!=="value"&&!Dc(it)&&r(fe,it,null,pe[it],j,S.children,U,re,le);"value"in pe&&r(fe,"value",null,pe.value,j),(me=pe.onVnodeBeforeMount)&&_s(me,U,S)}ze&&Io(S,null,U,"beforeMount");const Be=WR(re,Ae);Be&&Ae.beforeEnter(fe),i(fe,O,K),((me=pe&&pe.onVnodeMounted)||Be||ze)&&li(()=>{me&&_s(me,U,S),Be&&Ae.enter(fe),ze&&Io(S,null,U,"mounted")},re)},T=(S,O,K,U,re)=>{if(K&&f(S,K),U)for(let j=0;j{for(let me=fe;me{const ee=O.el=S.el;let{patchFlag:fe,dynamicChildren:me,dirs:pe}=O;fe|=S.patchFlag&16;const Le=S.props||Ot,Ae=O.props||Ot;let ze;if(K&&Po(K,!1),(ze=Ae.onVnodeBeforeUpdate)&&_s(ze,K,O,S),pe&&Io(O,S,K,"beforeUpdate"),K&&Po(K,!0),me?P(S.dynamicChildren,me,ee,K,U,xg(O,re),j):se||X(S,O,ee,null,K,U,xg(O,re),j,!1),fe>0){if(fe&16)F(ee,O,Le,Ae,K,U,re);else if(fe&2&&Le.class!==Ae.class&&r(ee,"class",null,Ae.class,re),fe&4&&r(ee,"style",Le.style,Ae.style,re),fe&8){const Be=O.dynamicProps;for(let it=0;it{ze&&_s(ze,K,O,S),pe&&Io(O,S,K,"updated")},U)},P=(S,O,K,U,re,j,se)=>{for(let ee=0;ee{if(K!==U){if(K!==Ot)for(const ee in K)!Dc(ee)&&!(ee in U)&&r(S,ee,K[ee],null,se,O.children,re,j,le);for(const ee in U){if(Dc(ee))continue;const fe=U[ee],me=K[ee];fe!==me&&ee!=="value"&&r(S,ee,me,fe,se,O.children,re,j,le)}"value"in U&&r(S,"value",K.value,U.value,se)}},H=(S,O,K,U,re,j,se,ee,fe)=>{const me=O.el=S?S.el:a(""),pe=O.anchor=S?S.anchor:a("");let{patchFlag:Le,dynamicChildren:Ae,slotScopeIds:ze}=O;ze&&(ee=ee?ee.concat(ze):ze),S==null?(i(me,K,U),i(pe,K,U),k(O.children||[],K,pe,re,j,se,ee,fe)):Le>0&&Le&64&&Ae&&S.dynamicChildren?(P(S.dynamicChildren,Ae,K,re,j,se,ee),(O.key!=null||re&&O===re.subTree)&&y_(S,O,!0)):X(S,O,K,pe,re,j,se,ee,fe)},te=(S,O,K,U,re,j,se,ee,fe)=>{O.slotScopeIds=ee,S==null?O.shapeFlag&512?re.ctx.activate(O,K,U,se,fe):N(O,K,U,re,j,se,fe):L(S,O,fe)},N=(S,O,K,U,re,j,se)=>{const ee=S.component=rD(S,U,re);if(lf(S)&&(ee.ctx.renderer=ve),oD(ee),ee.asyncDep){if(re&&re.registerDep(ee,I,se),!S.el){const fe=ee.subTree=B(Hn);v(null,fe,O,K)}}else I(ee,S,O,K,re,j,se)},L=(S,O,K)=>{const U=O.component=S.component;if(dR(S,O,K))if(U.asyncDep&&!U.asyncResolved){W(U,O,K);return}else U.next=O,rR(U.update),U.effect.dirty=!0,U.update();else O.el=S.el,U.vnode=O},I=(S,O,K,U,re,j,se)=>{const ee=()=>{if(S.isMounted){let{next:pe,bu:Le,u:Ae,parent:ze,vnode:Be}=S;{const Un=AE(S);if(Un){pe&&(pe.el=Be.el,W(S,pe,se)),Un.asyncDep.then(()=>{S.isUnmounted||ee()});return}}let it=pe,Ze;Po(S,!1),pe?(pe.el=Be.el,W(S,pe,se)):pe=Be,Le&&Zd(Le),(Ze=pe.props&&pe.props.onVnodeBeforeUpdate)&&_s(Ze,ze,pe,Be),Po(S,!0);const Mt=bg(S),gn=S.subTree;S.subTree=Mt,m(gn,Mt,d(gn.el),$(gn),S,re,j),pe.el=Mt.el,it===null&&d_(S,Mt.el),Ae&&li(Ae,re),(Ze=pe.props&&pe.props.onVnodeUpdated)&&li(()=>_s(Ze,ze,pe,Be),re)}else{let pe;const{el:Le,props:Ae}=O,{bm:ze,m:Be,parent:it}=S,Ze=$c(O);if(Po(S,!1),ze&&Zd(ze),!Ze&&(pe=Ae&&Ae.onVnodeBeforeMount)&&_s(pe,it,O),Po(S,!0),Le&&ge){const Mt=()=>{S.subTree=bg(S),ge(Le,S.subTree,S,re,null)};Ze?O.type.__asyncLoader().then(()=>!S.isUnmounted&&Mt()):Mt()}else{const Mt=S.subTree=bg(S);m(null,Mt,K,U,S,re,j),O.el=Mt.el}if(Be&&li(Be,re),!Ze&&(pe=Ae&&Ae.onVnodeMounted)){const Mt=O;li(()=>_s(pe,it,Mt),re)}(O.shapeFlag&256||it&&$c(it.vnode)&&it.vnode.shapeFlag&256)&&S.a&&li(S.a,re),S.isMounted=!0,O=K=U=null}},fe=S.effect=new t_(ee,Vi,()=>u_(me),S.scope),me=S.update=()=>{fe.dirty&&fe.run()};me.id=S.uid,Po(S,!0),me()},W=(S,O,K)=>{O.component=S;const U=S.vnode.props;S.vnode=O,S.next=null,OR(S,O.props,U,K),BR(S,O.children,K),fo(),cv(S),go()},X=(S,O,K,U,re,j,se,ee,fe=!1)=>{const me=S&&S.children,pe=S?S.shapeFlag:0,Le=O.children,{patchFlag:Ae,shapeFlag:ze}=O;if(Ae>0){if(Ae&128){ne(me,Le,K,U,re,j,se,ee,fe);return}else if(Ae&256){J(me,Le,K,U,re,j,se,ee,fe);return}}ze&8?(pe&16&&le(me,re,j),Le!==me&&u(K,Le)):pe&16?ze&16?ne(me,Le,K,U,re,j,se,ee,fe):le(me,re,j,!0):(pe&8&&u(K,""),ze&16&&k(Le,K,U,re,j,se,ee,fe))},J=(S,O,K,U,re,j,se,ee,fe)=>{S=S||tl,O=O||tl;const me=S.length,pe=O.length,Le=Math.min(me,pe);let Ae;for(Ae=0;Aepe?le(S,re,j,!0,!1,Le):k(O,K,U,re,j,se,ee,fe,Le)},ne=(S,O,K,U,re,j,se,ee,fe)=>{let me=0;const pe=O.length;let Le=S.length-1,Ae=pe-1;for(;me<=Le&&me<=Ae;){const ze=S[me],Be=O[me]=fe?Br(O[me]):ns(O[me]);if(ws(ze,Be))m(ze,Be,K,null,re,j,se,ee,fe);else break;me++}for(;me<=Le&&me<=Ae;){const ze=S[Le],Be=O[Ae]=fe?Br(O[Ae]):ns(O[Ae]);if(ws(ze,Be))m(ze,Be,K,null,re,j,se,ee,fe);else break;Le--,Ae--}if(me>Le){if(me<=Ae){const ze=Ae+1,Be=zeAe)for(;me<=Le;)Y(S[me],re,j,!0),me++;else{const ze=me,Be=me,it=new Map;for(me=Be;me<=Ae;me++){const Ut=O[me]=fe?Br(O[me]):ns(O[me]);Ut.key!=null&&it.set(Ut.key,me)}let Ze,Mt=0;const gn=Ae-Be+1;let Un=!1,Ri=0;const wi=new Array(gn);for(me=0;me=gn){Y(Ut,re,j,!0);continue}let ae;if(Ut.key!=null)ae=it.get(Ut.key);else for(Ze=Be;Ze<=Ae;Ze++)if(wi[Ze-Be]===0&&ws(Ut,O[Ze])){ae=Ze;break}ae===void 0?Y(Ut,re,j,!0):(wi[ae-Be]=me+1,ae>=Ri?Ri=ae:Un=!0,m(Ut,O[ae],K,null,re,j,se,ee,fe),Mt++)}const Xi=Un?HR(wi):tl;for(Ze=Xi.length-1,me=gn-1;me>=0;me--){const Ut=Be+me,ae=O[Ut],Te=Ut+1{const{el:j,type:se,transition:ee,children:fe,shapeFlag:me}=S;if(me&6){ue(S.component.subTree,O,K,U);return}if(me&128){S.suspense.move(O,K,U);return}if(me&64){se.move(S,O,K,ve);return}if(se===$e){i(j,O,K);for(let Le=0;Leee.enter(j),re);else{const{leave:Le,delayLeave:Ae,afterLeave:ze}=ee,Be=()=>i(j,O,K),it=()=>{Le(j,()=>{Be(),ze&&ze()})};Ae?Ae(j,Be,it):it()}else i(j,O,K)},Y=(S,O,K,U=!1,re=!1)=>{const{type:j,props:se,ref:ee,children:fe,dynamicChildren:me,shapeFlag:pe,patchFlag:Le,dirs:Ae,memoIndex:ze}=S;if(ee!=null&&Wp(ee,null,K,S,!0),ze!=null&&(O.renderCache[ze]=void 0),pe&256){O.ctx.deactivate(S);return}const Be=pe&1&&Ae,it=!$c(S);let Ze;if(it&&(Ze=se&&se.onVnodeBeforeUnmount)&&_s(Ze,O,S),pe&6)ie(S.component,K,U);else{if(pe&128){S.suspense.unmount(K,U);return}Be&&Io(S,null,O,"beforeUnmount"),pe&64?S.type.remove(S,O,K,re,ve,U):me&&(j!==$e||Le>0&&Le&64)?le(me,O,K,!1,!0):(j===$e&&Le&384||!re&&pe&16)&&le(fe,O,K),U&&Z(S)}(it&&(Ze=se&&se.onVnodeUnmounted)||Be)&&li(()=>{Ze&&_s(Ze,O,S),Be&&Io(S,null,O,"unmounted")},K)},Z=S=>{const{type:O,el:K,anchor:U,transition:re}=S;if(O===$e){M(K,U);return}if(O===Sg){C(S);return}const j=()=>{s(K),re&&!re.persisted&&re.afterLeave&&re.afterLeave()};if(S.shapeFlag&1&&re&&!re.persisted){const{leave:se,delayLeave:ee}=re,fe=()=>se(K,j);ee?ee(S.el,j,fe):fe()}else j()},M=(S,O)=>{let K;for(;S!==O;)K=h(S),s(S),S=K;s(O)},ie=(S,O,K)=>{const{bum:U,scope:re,update:j,subTree:se,um:ee,m:fe,a:me}=S;wv(fe),wv(me),U&&Zd(U),re.stop(),j&&(j.active=!1,Y(se,S,O,K)),ee&&li(ee,O),li(()=>{S.isUnmounted=!0},O),O&&O.pendingBranch&&!O.isUnmounted&&S.asyncDep&&!S.asyncResolved&&S.suspenseId===O.pendingId&&(O.deps--,O.deps===0&&O.resolve())},le=(S,O,K,U=!1,re=!1,j=0)=>{for(let se=j;seS.shapeFlag&6?$(S.component.subTree):S.shapeFlag&128?S.suspense.next():h(S.anchor||S.el);let oe=!1;const de=(S,O,K)=>{S==null?O._vnode&&Y(O._vnode,null,null,!0):m(O._vnode||null,S,O,null,null,null,K),oe||(oe=!0,cv(),cE(),oe=!1),O._vnode=S},ve={p:m,um:Y,m:ue,r:Z,mt:N,mc:k,pc:X,pbc:P,n:$,o:t};let z,ge;return e&&([z,ge]=e(ve)),{render:de,hydrate:z,createApp:DR(de,z)}}function xg({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function Po({effect:t,update:e},n){t.allowRecurse=e.allowRecurse=n}function WR(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function y_(t,e,n=!1){const i=t.children,s=e.children;if(We(i)&&We(s))for(let r=0;r>1,t[n[a]]0&&(e[i]=n[r-1]),n[r]=i)}}for(r=n.length,o=n[r-1];r-- >0;)n[r]=o,o=e[o];return n}function AE(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:AE(e)}function wv(t){if(t)for(let e=0;ecs(YR),md={};function fn(t,e,n){return ME(t,e,n)}function ME(t,e,{immediate:n,deep:i,flush:s,once:r,onTrack:o,onTrigger:a}=Ot){if(e&&r){const x=e;e=(...T)=>{x(...T),w()}}const l=An,c=x=>i===!0?x:Wr(x,i===!1?1:void 0);let u,d=!1,h=!1;if(Qt(t)?(u=()=>t.value,d=dh(t)):ea(t)?(u=()=>c(t),d=!0):We(t)?(h=!0,d=t.some(x=>ea(x)||dh(x)),u=()=>t.map(x=>{if(Qt(x))return x.value;if(ea(x))return c(x);if(qe(x))return Jr(x,l,2)})):qe(t)?e?u=()=>Jr(t,l,2):u=()=>(f&&f(),ji(t,l,3,[p])):u=Vi,e&&i){const x=u;u=()=>Wr(x())}let f,p=x=>{f=E.onStop=()=>{Jr(x,l,4),f=E.onStop=void 0}},m;if(uf)if(p=Vi,e?n&&ji(e,l,3,[u(),h?[]:void 0,p]):u(),s==="sync"){const x=jR();m=x.__watcherHandles||(x.__watcherHandles=[])}else return Vi;let y=h?new Array(t.length).fill(md):md;const v=()=>{if(!(!E.active||!E.dirty))if(e){const x=E.run();(i||d||(h?x.some((T,k)=>io(T,y[k])):io(x,y)))&&(f&&f(),ji(e,l,3,[x,y===md?void 0:h&&y[0]===md?[]:y,p]),y=x)}else E.run()};v.allowRecurse=!!e;let b;s==="sync"?b=v:s==="post"?b=()=>li(v,l&&l.suspense):(v.pre=!0,l&&(v.id=l.uid),b=()=>u_(v));const E=new t_(u,Vi,b),C=ef(),w=()=>{E.stop(),C&&Zm(C.effects,E)};return e?n?v():y=E.run():s==="post"?li(E.run.bind(E),l&&l.suspense):E.run(),m&&m.push(w),w}function KR(t,e,n){const i=this.proxy,s=Kt(t)?t.includes(".")?IE(i,t):()=>i[t]:t.bind(i,i);let r;qe(e)?r=e:(r=e.handler,n=e);const o=Lu(this),a=ME(s,r.bind(i),n);return o(),a}function IE(t,e){const n=e.split(".");return()=>{let i=t;for(let s=0;s{Wr(i,e,n)});else if(Lx(t)){for(const i in t)Wr(t[i],e,n);for(const i of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,i)&&Wr(t[i],e,n)}return t}const lf=t=>t.type.__isKeepAlive;function UR(t,e){PE(t,"a",e)}function GR(t,e){PE(t,"da",e)}function PE(t,e,n=An){const i=t.__wdc||(t.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return t()});if(af(e,i,n),n){let s=n.parent;for(;s&&s.parent;)lf(s.parent.vnode)&&XR(i,e,n,s),s=s.parent}}function XR(t,e,n,i){const s=af(e,t,i,!0);Yl(()=>{Zm(i[e],s)},n)}const Fr=Symbol("_leaveCb"),_d=Symbol("_enterCb");function RE(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return xn(()=>{t.isMounted=!0}),p_(()=>{t.isUnmounting=!0}),t}const Ni=[Function,Array],DE={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ni,onEnter:Ni,onAfterEnter:Ni,onEnterCancelled:Ni,onBeforeLeave:Ni,onLeave:Ni,onAfterLeave:Ni,onLeaveCancelled:Ni,onBeforeAppear:Ni,onAppear:Ni,onAfterAppear:Ni,onAppearCancelled:Ni},$E=t=>{const e=t.subTree;return e.component?$E(e.component):e},qR={name:"BaseTransition",props:DE,setup(t,{slots:e}){const n=w_(),i=RE();return()=>{const s=e.default&&v_(e.default(),!0);if(!s||!s.length)return;let r=s[0];if(s.length>1){for(const h of s)if(h.type!==Hn){r=h;break}}const o=lt(t),{mode:a}=o;if(i.isLeaving)return Eg(r);const l=xv(r);if(!l)return Eg(r);let c=tu(l,o,i,n,h=>c=h);ml(l,c);const u=n.subTree,d=u&&xv(u);if(d&&d.type!==Hn&&!ws(l,d)&&$E(n).type!==Hn){const h=tu(d,o,i,n);if(ml(d,h),a==="out-in"&&l.type!==Hn)return i.isLeaving=!0,h.afterLeave=()=>{i.isLeaving=!1,n.update.active!==!1&&(n.effect.dirty=!0,n.update())},Eg(r);a==="in-out"&&l.type!==Hn&&(h.delayLeave=(f,p,m)=>{const y=LE(i,d);y[String(d.key)]=d,f[Fr]=()=>{p(),f[Fr]=void 0,delete c.delayedLeave},c.delayedLeave=m})}return r}}},ZR=qR;function LE(t,e){const{leavingVNodes:n}=t;let i=n.get(e.type);return i||(i=Object.create(null),n.set(e.type,i)),i}function tu(t,e,n,i,s){const{appear:r,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:h,onLeave:f,onAfterLeave:p,onLeaveCancelled:m,onBeforeAppear:y,onAppear:v,onAfterAppear:b,onAppearCancelled:E}=e,C=String(t.key),w=LE(n,t),x=(A,P)=>{A&&ji(A,i,9,P)},T=(A,P)=>{const F=P[1];x(A,P),We(A)?A.every(H=>H.length<=1)&&F():A.length<=1&&F()},k={mode:o,persisted:a,beforeEnter(A){let P=l;if(!n.isMounted)if(r)P=y||l;else return;A[Fr]&&A[Fr](!0);const F=w[C];F&&ws(t,F)&&F.el[Fr]&&F.el[Fr](),x(P,[A])},enter(A){let P=c,F=u,H=d;if(!n.isMounted)if(r)P=v||c,F=b||u,H=E||d;else return;let te=!1;const N=A[_d]=L=>{te||(te=!0,L?x(H,[A]):x(F,[A]),k.delayedLeave&&k.delayedLeave(),A[_d]=void 0)};P?T(P,[A,N]):N()},leave(A,P){const F=String(t.key);if(A[_d]&&A[_d](!0),n.isUnmounting)return P();x(h,[A]);let H=!1;const te=A[Fr]=N=>{H||(H=!0,P(),N?x(m,[A]):x(p,[A]),A[Fr]=void 0,w[F]===t&&delete w[F])};w[F]=t,f?T(f,[A,te]):te()},clone(A){const P=tu(A,e,n,i,s);return s&&s(P),P}};return k}function Eg(t){if(lf(t))return t=so(t),t.children=null,t}function xv(t){if(!lf(t))return t;const{shapeFlag:e,children:n}=t;if(n){if(e&16)return n[0];if(e&32&&qe(n.default))return n.default()}}function ml(t,e){t.shapeFlag&6&&t.component?ml(t.component.subTree,e):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function v_(t,e=!1,n){let i=[],s=0;for(let r=0;r1)for(let r=0;rt.__isTeleport,Oc=t=>t&&(t.disabled||t.disabled===""),Ev=t=>typeof SVGElement<"u"&&t instanceof SVGElement,Sv=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,Hp=(t,e)=>{const n=t&&t.to;return Kt(n)?e?e(n):null:n},QR={name:"Teleport",__isTeleport:!0,process(t,e,n,i,s,r,o,a,l,c){const{mc:u,pc:d,pbc:h,o:{insert:f,querySelector:p,createText:m,createComment:y}}=c,v=Oc(e.props);let{shapeFlag:b,children:E,dynamicChildren:C}=e;if(t==null){const w=e.el=m(""),x=e.anchor=m("");f(w,n,i),f(x,n,i);const T=e.target=Hp(e.props,p),k=e.targetAnchor=m("");T&&(f(k,T),o==="svg"||Ev(T)?o="svg":(o==="mathml"||Sv(T))&&(o="mathml"));const A=(P,F)=>{b&16&&u(E,P,F,s,r,o,a,l)};v?A(n,x):T&&A(T,k)}else{e.el=t.el;const w=e.anchor=t.anchor,x=e.target=t.target,T=e.targetAnchor=t.targetAnchor,k=Oc(t.props),A=k?n:x,P=k?w:T;if(o==="svg"||Ev(x)?o="svg":(o==="mathml"||Sv(x))&&(o="mathml"),C?(h(t.dynamicChildren,C,A,s,r,o,a),y_(t,e,!0)):l||d(t,e,A,P,s,r,o,a,!1),v)k?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):yd(e,n,w,c,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const F=e.target=Hp(e.props,p);F&&yd(e,F,null,c,0)}else k&&yd(e,x,T,c,1)}OE(e)},remove(t,e,n,i,{um:s,o:{remove:r}},o){const{shapeFlag:a,children:l,anchor:c,targetAnchor:u,target:d,props:h}=t;if(d&&r(u),o&&r(c),a&16){const f=o||!Oc(h);for(let p=0;p0?zi||tl:null,NE(),_l>0&&zi&&zi.push(t),t}function V(t,e,n,i,s,r){return FE(g(t,e,n,i,s,r,!0))}function Ce(t,e,n,i,s){return FE(B(t,e,n,i,s,!0))}function nu(t){return t?t.__v_isVNode===!0:!1}function ws(t,e){return t.type===e.type&&t.key===e.key}const BE=({key:t})=>t??null,eh=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?Kt(t)||Qt(t)||qe(t)?{i:_n,r:t,k:e,f:!!n}:t:null);function g(t,e=null,n=null,i=0,s=null,r=t===$e?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&BE(e),ref:e&&eh(e),scopeId:of,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:i,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:_n};return a?(b_(l,n),r&128&&t.normalize(l)):n&&(l.shapeFlag|=Kt(n)?8:16),_l>0&&!o&&zi&&(l.patchFlag>0||r&6)&&l.patchFlag!==32&&zi.push(l),l}const B=nD;function nD(t,e=null,n=null,i=0,s=null,r=!1){if((!t||t===hE)&&(t=Hn),nu(t)){const a=so(t,e,!0);return n&&b_(a,n),_l>0&&!r&&zi&&(a.shapeFlag&6?zi[zi.indexOf(t)]=a:zi.push(a)),a.patchFlag=-2,a}if(uD(t)&&(t=t.__vccOpts),e){e=Zn(e);let{class:a,style:l}=e;a&&!Kt(a)&&(e.class=Me(a)),At(l)&&(nf(l)&&!We(l)&&(l=ln({},l)),e.style=Mn(l))}const o=Kt(t)?1:hR(t)?128:JR(t)?64:At(t)?4:qe(t)?2:0;return g(t,e,n,i,s,o,r,!0)}function Zn(t){return t?nf(t)||xE(t)?ln({},t):t:null}function so(t,e,n=!1,i=!1){const{props:s,ref:r,patchFlag:o,children:a,transition:l}=t,c=e?yn(s||{},e):s,u={__v_isVNode:!0,__v_skip:!0,type:t.type,props:c,key:c&&BE(c),ref:e&&e.ref?n&&r?We(r)?r.concat(eh(e)):[r,eh(e)]:eh(e):r,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:a,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==$e?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:l,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&so(t.ssContent),ssFallback:t.ssFallback&&so(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return l&&i&&ml(u,l.clone(u)),u}function Ye(t=" ",e=0){return B(cf,null,t,e)}function ce(t="",e=!1){return e?(D(),Ce(Hn,null,t)):B(Hn,null,t)}function ns(t){return t==null||typeof t=="boolean"?B(Hn):We(t)?B($e,null,t.slice()):typeof t=="object"?Br(t):B(cf,null,String(t))}function Br(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:so(t)}function b_(t,e){let n=0;const{shapeFlag:i}=t;if(e==null)e=null;else if(We(e))n=16;else if(typeof e=="object")if(i&65){const s=e.default;s&&(s._c&&(s._d=!1),b_(t,s()),s._c&&(s._d=!0));return}else{n=32;const s=e._;!s&&!xE(e)?e._ctx=_n:s===3&&_n&&(_n.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else qe(e)?(e={default:e,_ctx:_n},n=32):(e=String(e),i&64?(n=16,e=[Ye(e)]):n=8);t.children=e,t.shapeFlag|=n}function yn(...t){const e={};for(let n=0;nAn||_n;let gh,Yp;{const t=Fx(),e=(n,i)=>{let s;return(s=t[n])||(s=t[n]=[]),s.push(i),r=>{s.length>1?s.forEach(o=>o(r)):s[0](r)}};gh=e("__VUE_INSTANCE_SETTERS__",n=>An=n),Yp=e("__VUE_SSR_SETTERS__",n=>uf=n)}const Lu=t=>{const e=An;return gh(t),t.scope.on(),()=>{t.scope.off(),gh(e)}},Tv=()=>{An&&An.scope.off(),gh(null)};function VE(t){return t.vnode.shapeFlag&4}let uf=!1;function oD(t,e=!1){e&&Yp(e);const{props:n,children:i}=t.vnode,s=VE(t);LR(t,n,s,e),FR(t,i);const r=s?aD(t,e):void 0;return e&&Yp(!1),r}function aD(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,CR);const{setup:i}=n;if(i){const s=t.setupContext=i.length>1?WE(t):null,r=Lu(t);fo();const o=Jr(i,t,0,[t.props,s]);if(go(),r(),Dx(o)){if(o.then(Tv,Tv),e)return o.then(a=>{jp(t,a,e)}).catch(a=>{$u(a,t,0)});t.asyncDep=o}else jp(t,o,e)}else zE(t,e)}function jp(t,e,n){qe(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:At(e)&&(t.setupState=rE(e)),zE(t,n)}let kv;function zE(t,e,n){const i=t.type;if(!t.render){if(!e&&kv&&!i.render){const s=i.template||m_(t).template;if(s){const{isCustomElement:r,compilerOptions:o}=t.appContext.config,{delimiters:a,compilerOptions:l}=i,c=ln(ln({isCustomElement:r,delimiters:a},o),l);i.render=kv(s,c)}}t.render=i.render||Vi}{const s=Lu(t);fo();try{kR(t)}finally{go(),s()}}}const lD={get(t,e){return yi(t,"get",""),t[e]}};function WE(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,lD),slots:t.slots,emit:t.emit,expose:e}}function df(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(rE(sf(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in Lc)return Lc[n](t)},has(e,n){return n in e||n in Lc}})):t.proxy}function cD(t,e=!0){return qe(t)?t.displayName||t.name:t.name||e&&t.__name}function uD(t){return qe(t)&&"__vccOpts"in t}const be=(t,e)=>Z2(t,e,uf);function la(t,e,n){const i=arguments.length;return i===2?At(e)&&!We(e)?nu(e)?B(t,null,[e]):B(t,e):B(t,null,e):(i>3?n=Array.prototype.slice.call(arguments,2):i===3&&nu(n)&&(n=[n]),B(t,e,n))}const HE="3.4.29";/** * @vue/runtime-dom v3.4.29 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT @@ -37,40 +37,40 @@ (?:${hn}:){1}(?:(?::${hn}){0,4}:${ts}|(?::${hn}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4 (?::(?:(?::${hn}){0,5}:${ts}|(?::${hn}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4 )(?:%[0-9a-zA-Z]{1,})? // %eth0 %1 -`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),rL=new RegExp(`(?:^${ts}$)|(?:^${gf}$)`),oL=new RegExp(`^${ts}$`),aL=new RegExp(`^${gf}$`),pf=t=>t&&t.exact?rL:new RegExp(`(?:${Hr(t)}${ts}${Hr(t)})|(?:${Hr(t)}${gf}${Hr(t)})`,"g");pf.v4=t=>t&&t.exact?oL:new RegExp(`${Hr(t)}${ts}${Hr(t)}`,"g");pf.v6=t=>t&&t.exact?aL:new RegExp(`${Hr(t)}${gf}${Hr(t)}`,"g");const _S={exact:!1},yS=`${pf.v4().source}\\/(3[0-2]|[12]?[0-9])`,vS=`${pf.v6().source}\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])`,lL=new RegExp(`^${yS}$`),cL=new RegExp(`^${vS}$`),uL=({exact:t}=_S)=>t?lL:new RegExp(yS,"g"),dL=({exact:t}=_S)=>t?cL:new RegExp(vS,"g"),bS=uL({exact:!0}),wS=dL({exact:!0}),T_=t=>bS.test(t)?4:wS.test(t)?6:0;T_.v4=t=>bS.test(t);T_.v6=t=>wS.test(t);const Tt=t=>{const e=st();if(e.Locale===null)return t;const i=Object.keys(e.Locale).filter(s=>t.match(new RegExp("^"+s+"$","gi"))!==null);return i.length===0||i.length>1?t:t.replace(new RegExp(i[0],"gi"),e.Locale[i[0]])},vi=x_("WireguardConfigurationsStore",{state:()=>({Configurations:void 0,searchString:"",ConfigurationListInterval:void 0,PeerScheduleJobs:{dropdowns:{Field:[{display:Tt("Total Received"),value:"total_receive",unit:"GB",type:"number"},{display:Tt("Total Sent"),value:"total_sent",unit:"GB",type:"number"},{display:Tt("Total Usage"),value:"total_data",unit:"GB",type:"number"},{display:Tt("Date"),value:"date",type:"date"}],Operator:[{display:Tt("larger than"),value:"lgt"}],Action:[{display:Tt("Restrict Peer"),value:"restrict"},{display:Tt("Delete Peer"),value:"delete"}]}}}),actions:{async getConfigurations(){await Vt("/api/getWireguardConfigurations",{},t=>{t.status&&(this.Configurations=t.data)})},regexCheckIP(t){return/((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/.test(t)},checkCIDR(t){return T_(t)!==0}}}),Ye=(t,e)=>{const n=t.__vccOpts||t;for(const[i,s]of e)n[i]=s;return n},hL={name:"localeText",props:{t:""},computed:{getLocaleText(){return Tt(this.t)}}};function fL(t,e,n,i,s,r){return Ee(this.getLocaleText)}const Qe=Ye(hL,[["render",fL]]),gL={name:"navbar",components:{LocaleText:Qe},setup(){const t=vi(),e=st();return{wireguardConfigurationsStore:t,dashboardConfigurationStore:e}},data(){return{updateAvailable:!1,updateMessage:"Checking for update...",updateUrl:""}},mounted(){Vt("/api/getDashboardUpdate",{},t=>{t.status?(t.data&&(this.updateAvailable=!0,this.updateUrl=t.data),this.updateMessage=t.message):(this.updateMessage=Tt("Failed to check available update"),console.log(`Failed to get update: ${t.message}`))})}},po=t=>(bn("data-v-c16dfe93"),t=t(),wn(),t),pL=["data-bs-theme"],mL={id:"sidebarMenu",class:"bg-body-tertiary sidebar border h-100 rounded-3 shadow overflow-y-scroll"},_L={class:"sidebar-sticky pt-3"},yL={class:"nav flex-column px-2"},vL={class:"nav-item"},bL=po(()=>g("i",{class:"bi bi-house me-2"},null,-1)),wL={class:"nav-item"},xL=po(()=>g("i",{class:"bi bi-gear me-2"},null,-1)),EL=po(()=>g("hr",{class:"text-body"},null,-1)),SL={class:"sidebar-heading px-3 mt-4 mb-1 text-muted text-center"},CL=po(()=>g("i",{class:"bi bi-body-text me-2"},null,-1)),TL={class:"nav flex-column px-2"},kL={class:"nav-item"},AL=po(()=>g("hr",{class:"text-body"},null,-1)),ML={class:"sidebar-heading px-3 mt-4 mb-1 text-muted text-center"},IL=po(()=>g("i",{class:"bi bi-tools me-2"},null,-1)),PL={class:"nav flex-column px-2"},RL={class:"nav-item"},DL={class:"nav-item"},$L=po(()=>g("hr",{class:"text-body"},null,-1)),LL={class:"nav flex-column px-2"},OL={class:"nav-item"},NL=po(()=>g("i",{class:"bi bi-box-arrow-left me-2"},null,-1)),FL={class:"nav-item",style:{"font-size":"0.8rem"}},BL=["href"],VL={class:"nav-link text-muted rounded-3"},zL={key:1,class:"nav-link text-muted rounded-3"};function WL(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("RouterLink");return D(),V("div",{class:Ie(["col-md-3 col-lg-2 d-md-block p-3 navbar-container",{active:this.dashboardConfigurationStore.ShowNavBar}]),"data-bs-theme":i.dashboardConfigurationStore.Configuration.Server.dashboard_theme,style:{height:"calc(-50px + 100vh)"}},[g("nav",mL,[g("div",_L,[g("ul",yL,[g("li",vL,[B(a,{class:"nav-link rounded-3",to:"/","exact-active-class":"active"},{default:Re(()=>[bL,B(o,{t:"Home"})]),_:1})]),g("li",wL,[B(a,{class:"nav-link rounded-3",to:"/settings","exact-active-class":"active"},{default:Re(()=>[xL,B(o,{t:"Settings"})]),_:1})])]),EL,g("h6",SL,[CL,B(o,{t:"WireGuard Configurations"})]),g("ul",TL,[g("li",kL,[(D(!0),V($e,null,Xe(this.wireguardConfigurationsStore.Configurations,l=>(D(),Ce(a,{to:"/configuration/"+l.Name+"/peers",class:"nav-link nav-conf-link rounded-3","active-class":"active"},{default:Re(()=>[g("span",{class:Ie(["dot me-2",{active:l.Status}])},null,2),He(" "+Ee(l.Name),1)]),_:2},1032,["to"]))),256))])]),AL,g("h6",ML,[IL,B(o,{t:"Tools"})]),g("ul",PL,[g("li",RL,[B(a,{to:"/ping",class:"nav-link rounded-3","active-class":"active"},{default:Re(()=>[He("Ping")]),_:1})]),g("li",DL,[B(a,{to:"/traceroute",class:"nav-link rounded-3","active-class":"active"},{default:Re(()=>[He("Traceroute")]),_:1})])]),$L,g("ul",LL,[g("li",OL,[g("a",{class:"nav-link text-danger rounded-3",onClick:e[0]||(e[0]=l=>this.dashboardConfigurationStore.signOut()),role:"button",style:{"font-weight":"bold"}},[NL,B(o,{t:"Sign Out"})])]),g("li",FL,[this.updateAvailable?(D(),V("a",{key:0,href:this.updateUrl,class:"text-decoration-none rounded-3",target:"_blank"},[g("small",VL,[B(o,{t:this.updateMessage},null,8,["t"]),He(" ("),B(o,{t:"Current Version:"}),He(" "+Ee(i.dashboardConfigurationStore.Configuration.Server.version)+") ",1)])],8,BL)):(D(),V("small",zL,[B(o,{t:this.updateMessage},null,8,["t"]),He(" ("+Ee(i.dashboardConfigurationStore.Configuration.Server.version)+") ",1)]))])])])])],10,pL)}const HL=Ye(gL,[["render",WL],["__scopeId","data-v-c16dfe93"]]),YL={name:"message",components:{LocaleText:Qe},props:{message:Object},mounted(){setTimeout(()=>{this.message.show=!1},5e3)}},jL=["id"],KL={class:"card-body"},UL={class:"fw-bold d-block",style:{"text-transform":"uppercase"}};function GL(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",{class:Ie(["card shadow rounded-3 position-relative mb-2",{"text-bg-danger":this.message.type==="danger","text-bg-success":this.message.type==="success","text-bg-warning":this.message.type==="warning"}]),id:this.message.id,style:{width:"400px"}},[g("div",KL,[g("small",UL,[B(o,{t:"FROM "}),He(" "+Ee(this.message.from),1)]),He(" "+Ee(this.message.content),1)])],10,jL)}const xS=Ye(YL,[["render",GL]]),XL={name:"index",components:{Message:xS,Navbar:HL},async setup(){return{dashboardConfigurationStore:st()}},computed:{getMessages(){return this.dashboardConfigurationStore.Messages.filter(t=>t.show)}}},qL=["data-bs-theme"],ZL={class:"row h-100"},JL={class:"col-md-9 ml-sm-auto col-lg-10 px-md-4 overflow-y-scroll mb-0",style:{height:"calc(100vh - 50px)"}},QL={class:"messageCentre text-body position-fixed"};function eO(t,e,n,i,s,r){const o=Se("Navbar"),a=Se("RouterView"),l=Se("Message");return D(),V("div",{class:"container-fluid flex-grow-1 main","data-bs-theme":this.dashboardConfigurationStore.Configuration.Server.dashboard_theme},[g("div",ZL,[B(o),g("main",JL,[(D(),Ce(f_,null,{default:Re(()=>[B(a,null,{default:Re(({Component:c})=>[B(Rt,{name:"fade2",mode:"out-in"},{default:Re(()=>[(D(),Ce(ga(c)))]),_:2},1024)]),_:1})]),_:1})),g("div",QL,[B(jl,{name:"message",tag:"div",class:"position-relative"},{default:Re(()=>[(D(!0),V($e,null,Xe(r.getMessages.slice().reverse(),c=>(D(),Ce(l,{message:c,key:c.id},null,8,["message"]))),128))]),_:1})])])])],8,qL)}const tO=Ye(XL,[["render",eO],["__scopeId","data-v-b776d181"]]);var ES={exports:{}};(function(t,e){(function(n,i){t.exports=i()})(lx,function(){var n=1e3,i=6e4,s=36e5,r="millisecond",o="second",a="minute",l="hour",c="day",u="week",d="month",h="quarter",f="year",p="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(N){var L=["th","st","nd","rd"],I=N%100;return"["+N+(L[(I-20)%10]||L[I]||L[0])+"]"}},E=function(N,L,I){var W=String(N);return!W||W.length>=L?N:""+Array(L+1-W.length).join(I)+N},C={s:E,z:function(N){var L=-N.utcOffset(),I=Math.abs(L),W=Math.floor(I/60),X=I%60;return(L<=0?"+":"-")+E(W,2,"0")+":"+E(X,2,"0")},m:function N(L,I){if(L.date()1)return N(ne[0])}else{var ue=L.name;x[ue]=L,X=ue}return!W&&X&&(w=X),X||!W&&w},P=function(N,L){if(k(N))return N.clone();var I=typeof L=="object"?L:{};return I.date=N,I.args=arguments,new H(I)},F=C;F.l=A,F.i=k,F.w=function(N,L){return P(N,{locale:L.$L,utc:L.$u,x:L.$x,$offset:L.$offset})};var H=function(){function N(I){this.$L=A(I.locale,null,!0),this.parse(I),this.$x=this.$x||I.x||{},this[T]=!0}var L=N.prototype;return L.parse=function(I){this.$d=function(W){var X=W.date,J=W.utc;if(X===null)return new Date(NaN);if(F.u(X))return new Date;if(X instanceof Date)return new Date(X);if(typeof X=="string"&&!/Z$/i.test(X)){var ne=X.match(y);if(ne){var ue=ne[2]-1||0,Y=(ne[7]||"0").substring(0,3);return J?new Date(Date.UTC(ne[1],ue,ne[3]||1,ne[4]||0,ne[5]||0,ne[6]||0,Y)):new Date(ne[1],ue,ne[3]||1,ne[4]||0,ne[5]||0,ne[6]||0,Y)}}return new Date(X)}(I),this.init()},L.init=function(){var I=this.$d;this.$y=I.getFullYear(),this.$M=I.getMonth(),this.$D=I.getDate(),this.$W=I.getDay(),this.$H=I.getHours(),this.$m=I.getMinutes(),this.$s=I.getSeconds(),this.$ms=I.getMilliseconds()},L.$utils=function(){return F},L.isValid=function(){return this.$d.toString()!==m},L.isSame=function(I,W){var X=P(I);return this.startOf(W)<=X&&X<=this.endOf(W)},L.isAfter=function(I,W){return P(I){if(t.status===200)return t.json();throw new Error(t.statusText)}).then(()=>{this.endTime=pi(),this.active=!0}).catch(t=>{this.active=!1,this.errorMsg=t}),this.refreshing=!1)},async connect(){await fetch(`${this.server.host}/api/authenticate`,{headers:{"content-type":"application/json","wg-dashboard-apikey":this.server.apiKey},body:JSON.stringify({host:window.location.hostname}),method:"POST",signal:AbortSignal.timeout(5e3)}).then(t=>t.json()).then(t=>{this.$emit("setActiveServer"),this.$router.push("/")})}},mounted(){this.handshake()},computed:{getHandshakeTime(){return this.startTime&&this.endTime?`${pi().subtract(this.startTime).millisecond()}ms`:this.refreshing?Tt("Pinging..."):this.errorMsg?this.errorMsg:"N/A"}}},Kl=t=>(bn("data-v-ed7817c7"),t=t(),wn(),t),sO={class:"card rounded-3"},rO={class:"card-body"},oO={class:"d-flex gap-3 w-100 remoteServerContainer"},aO={class:"d-flex gap-3 align-items-center flex-grow-1"},lO=Kl(()=>g("i",{class:"bi bi-server"},null,-1)),cO={class:"d-flex gap-3 align-items-center flex-grow-1"},uO=Kl(()=>g("i",{class:"bi bi-key-fill"},null,-1)),dO={class:"d-flex gap-2 button-group"},hO=Kl(()=>g("i",{class:"bi bi-trash"},null,-1)),fO=[hO],gO=Kl(()=>g("i",{class:"bi bi-arrow-right-circle"},null,-1)),pO=[gO],mO={class:"card-footer gap-2 d-flex align-items-center"},_O={key:0,class:"spin ms-auto text-primary-emphasis"},yO=Kl(()=>g("i",{class:"bi bi-arrow-clockwise"},null,-1)),vO=[yO],bO=Kl(()=>g("i",{class:"bi bi-arrow-clockwise me"},null,-1)),wO=[bO];function xO(t,e,n,i,s,r){return D(),V("div",sO,[g("div",rO,[g("div",oO,[g("div",aO,[lO,Ne(g("input",{class:"form-control form-control-sm",onBlur:e[0]||(e[0]=o=>this.handshake()),"onUpdate:modelValue":e[1]||(e[1]=o=>this.server.host=o),type:"url"},null,544),[[Ke,this.server.host]])]),g("div",cO,[uO,Ne(g("input",{class:"form-control form-control-sm",onBlur:e[2]||(e[2]=o=>this.handshake()),"onUpdate:modelValue":e[3]||(e[3]=o=>this.server.apiKey=o),type:"text"},null,544),[[Ke,this.server.apiKey]])]),g("div",dO,[g("button",{onClick:e[4]||(e[4]=o=>this.$emit("delete")),class:"ms-auto btn btn-sm bg-danger-subtle text-danger-emphasis border-1 border-danger-subtle"},fO),g("button",{onClick:e[5]||(e[5]=o=>this.connect()),class:Ie([{disabled:!this.active},"ms-auto btn btn-sm bg-success-subtle text-success-emphasis border-1 border-success-subtle"])},pO,2)])])]),g("div",mO,[g("span",{class:Ie(["dot ms-0 me-2",[this.active?"active":"inactive"]])},null,2),g("small",null,Ee(this.getHandshakeTime),1),this.refreshing?(D(),V("div",_O,vO)):(D(),V("a",{key:1,role:"button",onClick:e[6]||(e[6]=o=>this.handshake()),class:"text-primary-emphasis text-decoration-none ms-auto disabled"},wO))])])}const EO=Ye(iO,[["render",xO],["__scopeId","data-v-ed7817c7"]]),SO={name:"RemoteServerList",setup(){return{store:st()}},components:{LocaleText:Qe,RemoteServer:EO}},CO={class:"w-100 mt-3"},TO={class:"d-flex align-items-center mb-3"},kO={class:"mb-0"},AO=g("i",{class:"bi bi-plus-circle-fill me-2"},null,-1),MO={class:"w-100 d-flex gap-3 flex-column p-3 border border-1 border-secondary-subtle rounded-3",style:{height:"400px","overflow-y":"scroll"}},IO={key:0,class:"text-muted m-auto"},PO=g("i",{class:"bi bi-plus-circle-fill mx-1"},null,-1);function RO(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("RemoteServer");return D(),V("div",CO,[g("div",TO,[g("h5",kO,[B(o,{t:"Server List"})]),g("button",{onClick:e[0]||(e[0]=l=>this.store.addCrossServerConfiguration()),class:"btn bg-primary-subtle text-primary-emphasis border-1 border-primary-subtle shadow-sm ms-auto"},[AO,B(o,{t:"Server"})])]),g("div",MO,[(D(!0),V($e,null,Xe(this.store.CrossServerConfiguration.ServerList,(l,c)=>(D(),Ce(a,{onSetActiveServer:u=>this.store.setActiveCrossServer(c),onDelete:u=>this.store.deleteCrossServerConfiguration(c),key:c,server:l},null,8,["onSetActiveServer","onDelete","server"]))),128)),Object.keys(this.store.CrossServerConfiguration.ServerList).length===0?(D(),V("h6",IO,[B(o,{t:"Click"}),PO,B(o,{t:"to add your server"})])):ce("",!0)])])}const DO=Ye(SO,[["render",RO]]),$O={name:"signInInput",methods:{GetLocale:Tt},props:{id:"",data:"",type:"",placeholder:""},computed:{getLocaleText(){return Tt(this.placeholder)}}},LO=["type","id","name","placeholder"];function OO(t,e,n,i,s,r){return Ne((D(),V("input",{type:n.type,"onUpdate:modelValue":e[0]||(e[0]=o=>this.data[this.id]=o),class:"form-control",id:this.id,name:this.id,autocomplete:"on",placeholder:this.getLocaleText,required:""},null,8,LO)),[[QE,this.data[this.id]]])}const NO=Ye($O,[["render",OO]]),FO={name:"signInTOTP",methods:{GetLocale:Tt},props:{data:""},computed:{getLocaleText(){return Tt("OTP from your authenticator")}}},BO=["placeholder"];function VO(t,e,n,i,s,r){return Ne((D(),V("input",{class:"form-control totp",required:"",id:"totp",maxlength:"6",type:"text",inputmode:"numeric",autocomplete:"one-time-code",placeholder:this.getLocaleText,"onUpdate:modelValue":e[0]||(e[0]=o=>this.data.totp=o)},null,8,BO)),[[Ke,this.data.totp]])}const zO=Ye(FO,[["render",VO]]),WO={name:"signin",components:{SignInTOTP:zO,SignInInput:NO,LocaleText:Qe,RemoteServerList:DO,Message:xS},async setup(){const t=st();let e="dark",n=!1,i;return t.IsElectronApp||await Promise.all([Vt("/api/getDashboardTheme",{},s=>{e=s.data}),Vt("/api/isTotpEnabled",{},s=>{n=s.data}),Vt("/api/getDashboardVersion",{},s=>{i=s.data})]),t.removeActiveCrossServer(),{store:t,theme:e,totpEnabled:n,version:i}},data(){return{data:{username:"",password:"",totp:""},loginError:!1,loginErrorMessage:"",loading:!1}},computed:{getMessages(){return this.store.Messages.filter(t=>t.show)},applyLocale(t){return Tt(t)}},methods:{GetLocale:Tt,async auth(){this.data.username&&this.data.password&&(this.totpEnabled&&this.data.totp||!this.totpEnabled)?(this.loading=!0,await kt("/api/authenticate",this.data,t=>{t.status?(this.loginError=!1,this.$refs.signInBtn.classList.add("signedIn"),t.message?this.$router.push("/welcome"):this.store.Redirect!==void 0?this.$router.push(this.store.Redirect):this.$router.push("/")):(this.loginError=!0,this.loginErrorMessage=t.message,document.querySelectorAll("input[required]").forEach(e=>{e.classList.remove("is-valid"),e.classList.add("is-invalid")}),this.loading=!1)})):document.querySelectorAll("input[required]").forEach(t=>{t.value.length===0?(t.classList.remove("is-valid"),t.classList.add("is-invalid")):(t.classList.remove("is-invalid"),t.classList.add("is-valid"))})}}},ma=t=>(bn("data-v-2fa13e60"),t=t(),wn(),t),HO=["data-bs-theme"],YO={class:"login-box m-auto"},jO={class:"m-auto",style:{width:"700px"}},KO={class:"mb-0 text-body"},UO=ma(()=>g("span",{class:"dashboardLogo display-3"},[g("strong",null,"WGDashboard")],-1)),GO={key:0,class:"alert alert-danger mt-2 mb-0",role:"alert"},XO={class:"form-group text-body"},qO=ma(()=>g("label",{for:"username",class:"text-left",style:{"font-size":"1rem"}},[g("i",{class:"bi bi-person-circle"})],-1)),ZO={class:"form-group text-body"},JO=ma(()=>g("label",{for:"password",class:"text-left",style:{"font-size":"1rem"}},[g("i",{class:"bi bi-key-fill"})],-1)),QO={key:0,class:"form-group text-body"},eN=ma(()=>g("label",{for:"totp",class:"text-left",style:{"font-size":"1rem"}},[g("i",{class:"bi bi-lock-fill"})],-1)),tN={class:"btn btn-lg btn-dark ms-auto mt-4 w-100 d-flex btn-brand signInBtn",ref:"signInBtn"},nN={key:0,class:"d-flex w-100"},iN=ma(()=>g("i",{class:"ms-auto bi bi-chevron-right"},null,-1)),sN={key:1,class:"d-flex w-100 align-items-center"},rN=ma(()=>g("span",{class:"spinner-border ms-auto spinner-border-sm",role:"status"},null,-1)),oN={key:3,class:"d-flex mt-3"},aN={class:"form-check form-switch ms-auto"},lN={class:"form-check-label",for:"flexSwitchCheckChecked"},cN={class:"text-muted pb-3 d-block w-100 text-center mt-3"},uN=ma(()=>g("a",{href:"https://github.com/donaldzou",target:"_blank"},[g("strong",null,"Donald Zou")],-1)),dN={class:"messageCentre text-body position-absolute end-0 m-3"};function hN(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("SignInInput"),l=Se("SignInTOTP"),c=Se("RemoteServerList"),u=Se("Message");return D(),V("div",{class:"container-fluid login-container-fluid d-flex main flex-column py-4 text-body",style:{"overflow-y":"scroll"},"data-bs-theme":this.theme},[g("div",YO,[g("div",jO,[g("h4",KO,[B(o,{t:"Welcome to"})]),UO,s.loginError?(D(),V("div",GO,[B(o,{t:this.loginErrorMessage},null,8,["t"])])):ce("",!0),this.store.CrossServerConfiguration.Enable?(D(),Ce(c,{key:2})):(D(),V("form",{key:1,onSubmit:e[0]||(e[0]=d=>{d.preventDefault(),this.auth()})},[g("div",XO,[qO,B(a,{id:"username",data:this.data,type:"text",placeholder:"Username"},null,8,["data"])]),g("div",ZO,[JO,B(a,{id:"password",data:this.data,type:"password",placeholder:"Password"},null,8,["data"])]),i.totpEnabled?(D(),V("div",QO,[eN,B(l,{data:this.data},null,8,["data"])])):ce("",!0),g("button",tN,[this.loading?(D(),V("span",sN,[B(o,{t:"Signing In..."}),rN])):(D(),V("span",nN,[B(o,{t:"Sign In"}),iN]))],512)],32)),this.store.IsElectronApp?ce("",!0):(D(),V("div",oN,[g("div",aN,[Ne(g("input",{"onUpdate:modelValue":e[1]||(e[1]=d=>this.store.CrossServerConfiguration.Enable=d),class:"form-check-input",type:"checkbox",role:"switch",id:"flexSwitchCheckChecked"},null,512),[[Jn,this.store.CrossServerConfiguration.Enable]]),g("label",lN,[B(o,{t:"Access Remote Server"})])])]))])]),g("small",cN,[He(" WGDashboard "+Ee(this.version)+" | Developed with ❤️ by ",1),uN]),g("div",dN,[B(jl,{name:"message",tag:"div",class:"position-relative"},{default:Re(()=>[(D(!0),V($e,null,Xe(r.getMessages.slice().reverse(),d=>(D(),Ce(u,{message:d,key:d.id},null,8,["message"]))),128))]),_:1})])],8,HO)}const fN=Ye(WO,[["render",hN],["__scopeId","data-v-2fa13e60"]]),gN={name:"configurationCard",components:{LocaleText:Qe},props:{c:{Name:String,Status:Boolean,PublicKey:String,PrivateKey:String}},data(){return{configurationToggling:!1}},setup(){return{dashboardConfigurationStore:st()}},methods:{toggle(){this.configurationToggling=!0,Vt("/api/toggleWireguardConfiguration/",{configurationName:this.c.Name},t=>{t.status?this.dashboardConfigurationStore.newMessage("Server",`${this.c.Name} ${t.data?"is on":"is off"}`):this.dashboardConfigurationStore.newMessage("Server",t.message,"danger"),this.c.Status=t.data,this.configurationToggling=!1})}}},pN={class:"card conf_card rounded-3 shadow text-decoration-none"},mN={class:"mb-0"},_N={class:"card-title mb-0"},yN=g("h6",{class:"mb-0 ms-auto"},[g("i",{class:"bi bi-chevron-right"})],-1),vN={class:"card-footer d-flex gap-2 flex-column"},bN={class:"row"},wN={class:"col-6 col-md-3"},xN=g("i",{class:"bi bi-arrow-down-up me-2"},null,-1),EN={class:"text-primary-emphasis col-6 col-md-3"},SN=g("i",{class:"bi bi-arrow-down me-2"},null,-1),CN={class:"text-success-emphasis col-6 col-md-3"},TN=g("i",{class:"bi bi-arrow-up me-2"},null,-1),kN={class:"text-md-end col-6 col-md-3"},AN={class:"d-flex align-items-center gap-2"},MN={class:"text-muted"},IN={style:{"word-break":"keep-all"}},PN={class:"mb-0 d-block d-lg-inline-block"},RN={style:{"line-break":"anywhere"}},DN={class:"form-check form-switch ms-auto"},$N=["for"],LN={key:4,class:"spinner-border spinner-border-sm ms-2","aria-hidden":"true"},ON=["disabled","id"];function NN(t,e,n,i,s,r){const o=Se("RouterLink"),a=Se("LocaleText");return D(),V("div",pN,[B(o,{to:"/configuration/"+n.c.Name+"/peers",class:"card-body d-flex align-items-center gap-3 flex-wrap text-decoration-none"},{default:Re(()=>[g("h6",mN,[g("span",{class:Ie(["dot",{active:n.c.Status}])},null,2)]),g("h6",_N,[g("samp",null,Ee(n.c.Name),1)]),yN]),_:1},8,["to"]),g("div",vN,[g("div",bN,[g("small",wN,[xN,He(Ee(n.c.DataUsage.Total>0?n.c.DataUsage.Total.toFixed(4):0)+" GB ",1)]),g("small",EN,[SN,He(Ee(n.c.DataUsage.Receive>0?n.c.DataUsage.Receive.toFixed(4):0)+" GB ",1)]),g("small",CN,[TN,He(Ee(n.c.DataUsage.Sent>0?n.c.DataUsage.Sent.toFixed(4):0)+" GB ",1)]),g("small",kN,[g("span",{class:Ie(["dot me-2",{active:n.c.ConnectedPeers>0}])},null,2),He(Ee(n.c.ConnectedPeers)+" ",1),B(a,{t:"Peers"})])]),g("div",AN,[g("small",MN,[g("strong",IN,[B(a,{t:"Public Key"})])]),g("small",PN,[g("samp",RN,Ee(n.c.PublicKey),1)]),g("div",DN,[g("label",{class:"form-check-label",style:{cursor:"pointer"},for:"switch"+n.c.PrivateKey},[!n.c.Status&&this.configurationToggling?(D(),Ce(a,{key:0,t:"Turning Off..."})):n.c.Status&&this.configurationToggling?(D(),Ce(a,{key:1,t:"Turning On..."})):n.c.Status&&!this.configurationToggling?(D(),Ce(a,{key:2,t:"On"})):!n.c.Status&&!this.configurationToggling?(D(),Ce(a,{key:3,t:"Off"})):ce("",!0),this.configurationToggling?(D(),V("span",LN)):ce("",!0)],8,$N),Ne(g("input",{class:"form-check-input",style:{cursor:"pointer"},disabled:this.configurationToggling,type:"checkbox",role:"switch",id:"switch"+n.c.PrivateKey,onChange:e[0]||(e[0]=l=>this.toggle()),"onUpdate:modelValue":e[1]||(e[1]=l=>n.c.Status=l)},null,40,ON),[[Jn,n.c.Status]])])])])])}const FN=Ye(gN,[["render",NN]]),BN={name:"configurationList",components:{LocaleText:Qe,ConfigurationCard:FN},async setup(){return{wireguardConfigurationsStore:vi()}},data(){return{configurationLoaded:!1}},async mounted(){await this.wireguardConfigurationsStore.getConfigurations(),this.configurationLoaded=!0,this.wireguardConfigurationsStore.ConfigurationListInterval=setInterval(()=>{this.wireguardConfigurationsStore.getConfigurations()},1e4)},beforeUnmount(){clearInterval(this.wireguardConfigurationsStore.ConfigurationListInterval)}},SS=t=>(bn("data-v-106e7dee"),t=t(),wn(),t),VN={class:"mt-md-5 mt-3"},zN={class:"container-md"},WN={class:"d-flex mb-4 configurationListTitle"},HN={class:"text-body d-flex"},YN=SS(()=>g("i",{class:"bi bi-body-text me-2"},null,-1)),jN=SS(()=>g("i",{class:"bi bi-plus-circle-fill me-2"},null,-1)),KN={key:0},UN={key:0,class:"text-muted"},GN={key:1,class:"d-flex gap-3 flex-column mb-3"};function XN(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("RouterLink"),l=Se("ConfigurationCard");return D(),V("div",VN,[g("div",zN,[g("div",WN,[g("h3",HN,[YN,g("span",null,[B(o,{t:"WireGuard Configurations"})])]),B(a,{to:"/new_configuration",class:"btn btn-dark btn-brand rounded-3 px-3 py-2 shadow ms-auto rounded-3"},{default:Re(()=>[jN,B(o,{t:"Configuration"})]),_:1})]),B(Rt,{name:"fade",mode:"out-in"},{default:Re(()=>[this.configurationLoaded?(D(),V("div",KN,[this.wireguardConfigurationsStore.Configurations.length===0?(D(),V("p",UN,[B(o,{t:"You don't have any WireGuard configurations yet. Please check the configuration folder or change it in Settings. By default the folder is /etc/wireguard."})])):(D(),V("div",GN,[(D(!0),V($e,null,Xe(this.wireguardConfigurationsStore.Configurations,c=>(D(),Ce(l,{key:c.Name,c},null,8,["c"]))),128))]))])):ce("",!0)]),_:1})])])}const qN=Ye(BN,[["render",XN],["__scopeId","data-v-106e7dee"]]);let bd;const ZN=new Uint8Array(16);function JN(){if(!bd&&(bd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!bd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return bd(ZN)}const Dn=[];for(let t=0;t<256;++t)Dn.push((t+256).toString(16).slice(1));function QN(t,e=0){return Dn[t[e+0]]+Dn[t[e+1]]+Dn[t[e+2]]+Dn[t[e+3]]+"-"+Dn[t[e+4]]+Dn[t[e+5]]+"-"+Dn[t[e+6]]+Dn[t[e+7]]+"-"+Dn[t[e+8]]+Dn[t[e+9]]+"-"+Dn[t[e+10]]+Dn[t[e+11]]+Dn[t[e+12]]+Dn[t[e+13]]+Dn[t[e+14]]+Dn[t[e+15]]}const e3=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),db={randomUUID:e3};function Os(t,e,n){if(db.randomUUID&&!e&&!t)return db.randomUUID();t=t||{};const i=t.random||(t.rng||JN)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){n=n||0;for(let s=0;s<16;++s)e[n+s]=i[s];return e}return QN(i)}const t3={components:{LocaleText:Qe},props:{targetData:String,title:String,warning:!1,warningText:""},setup(){const t=st(),e=`input_${Os()}`;return{store:t,uuid:e}},data(){return{value:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.value=this.store.Configuration.Peers[this.targetData]},methods:{async useValidation(){this.changed&&await kt("/api/updateDashboardConfigurationItem",{section:"Peers",key:this.targetData,value:this.value},t=>{t.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Peers[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=t.message),this.changed=!1,this.updating=!1})}}},n3={class:"form-group mb-2"},i3=["for"],s3=["id","disabled"],r3={class:"invalid-feedback"},o3={key:0,class:"px-2 py-1 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2 d-inline-block mt-1"},a3=g("i",{class:"bi bi-exclamation-triangle-fill me-2"},null,-1);function l3(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",n3,[g("label",{for:this.uuid,class:"text-muted mb-1"},[g("strong",null,[g("small",null,[B(o,{t:this.title},null,8,["t"])])])],8,i3),Ne(g("input",{type:"text",class:Ie(["form-control",{"is-invalid":s.showInvalidFeedback,"is-valid":s.isValid}]),id:this.uuid,"onUpdate:modelValue":e[0]||(e[0]=a=>this.value=a),onKeydown:e[1]||(e[1]=a=>this.changed=!0),onBlur:e[2]||(e[2]=a=>r.useValidation()),disabled:this.updating},null,42,s3),[[Ke,this.value]]),g("div",r3,Ee(this.invalidFeedback),1),n.warning?(D(),V("div",o3,[g("small",null,[a3,B(o,{t:n.warningText},null,8,["t"])])])):ce("",!0)])}const c3=Ye(t3,[["render",l3]]),u3=t=>{},d3={name:"accountSettingsInputUsername",components:{LocaleText:Qe},props:{targetData:String,title:String},setup(){const t=st(),e=`input_${Os()}`;return{store:t,uuid:e}},data(){return{value:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.value=this.store.Configuration.Account[this.targetData]},methods:{async useValidation(){this.changed&&(this.updating=!0,await kt("/api/updateDashboardConfigurationItem",{section:"Account",key:this.targetData,value:this.value},t=>{t.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=t.message),this.changed=!1,this.updating=!1}))}}},h3={class:"form-group mb-2"},f3=["for"],g3=["id","disabled"],p3={class:"invalid-feedback"};function m3(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",h3,[g("label",{for:this.uuid,class:"text-muted mb-1"},[g("strong",null,[g("small",null,[B(o,{t:this.title},null,8,["t"])])])],8,f3),Ne(g("input",{type:"text",class:Ie(["form-control",{"is-invalid":s.showInvalidFeedback,"is-valid":s.isValid}]),id:this.uuid,"onUpdate:modelValue":e[0]||(e[0]=a=>this.value=a),onKeydown:e[1]||(e[1]=a=>this.changed=!0),onBlur:e[2]||(e[2]=a=>r.useValidation()),disabled:this.updating},null,42,g3),[[Ke,this.value]]),g("div",p3,Ee(this.invalidFeedback),1)])}const _3=Ye(d3,[["render",m3]]),y3={name:"accountSettingsInputPassword",components:{LocaleText:Qe},props:{targetData:String,warning:!1,warningText:""},setup(){const t=st(),e=`input_${Os()}`;return{store:t,uuid:e}},data(){return{value:{currentPassword:"",newPassword:"",repeatNewPassword:""},invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0}},methods:{async useValidation(){Object.values(this.value).find(t=>t.length===0)===void 0?this.value.newPassword===this.value.repeatNewPassword?await kt("/api/updateDashboardConfigurationItem",{section:"Account",key:this.targetData,value:this.value},t=>{t.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.isValid=!1,this.value={currentPassword:"",newPassword:"",repeatNewPassword:""}},5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=t.message)}):(this.showInvalidFeedback=!0,this.invalidFeedback="New passwords does not match"):(this.showInvalidFeedback=!0,this.invalidFeedback="Please fill in all required fields.")}},computed:{passwordValid(){return Object.values(this.value).find(t=>t.length===0)===void 0&&this.value.newPassword===this.value.repeatNewPassword}}},v3={class:"d-flex flex-column"},b3={class:"row"},w3={class:"col-sm"},x3={class:"form-group mb-2"},E3=["for"],S3=["id"],C3={key:0,class:"invalid-feedback d-block"},T3={class:"col-sm"},k3={class:"form-group mb-2"},A3=["for"],M3=["id"],I3={class:"col-sm"},P3={class:"form-group mb-2"},R3=["for"],D3=["id"],$3=["disabled"],L3=g("i",{class:"bi bi-save2-fill me-2"},null,-1);function O3(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",v3,[g("div",b3,[g("div",w3,[g("div",x3,[g("label",{for:"currentPassword_"+this.uuid,class:"text-muted mb-1"},[g("strong",null,[g("small",null,[B(o,{t:"Current Password"})])])],8,E3),Ne(g("input",{type:"password",class:Ie(["form-control mb-2",{"is-invalid":s.showInvalidFeedback,"is-valid":s.isValid}]),"onUpdate:modelValue":e[0]||(e[0]=a=>this.value.currentPassword=a),id:"currentPassword_"+this.uuid},null,10,S3),[[Ke,this.value.currentPassword]]),s.showInvalidFeedback?(D(),V("div",C3,Ee(this.invalidFeedback),1)):ce("",!0)])]),g("div",T3,[g("div",k3,[g("label",{for:"newPassword_"+this.uuid,class:"text-muted mb-1"},[g("strong",null,[g("small",null,[B(o,{t:"New Password"})])])],8,A3),Ne(g("input",{type:"password",class:Ie(["form-control mb-2",{"is-invalid":s.showInvalidFeedback,"is-valid":s.isValid}]),"onUpdate:modelValue":e[1]||(e[1]=a=>this.value.newPassword=a),id:"newPassword_"+this.uuid},null,10,M3),[[Ke,this.value.newPassword]])])]),g("div",I3,[g("div",P3,[g("label",{for:"repeatNewPassword_"+this.uuid,class:"text-muted mb-1"},[g("strong",null,[g("small",null,[B(o,{t:"Repeat New Password"})])])],8,R3),Ne(g("input",{type:"password",class:Ie(["form-control mb-2",{"is-invalid":s.showInvalidFeedback,"is-valid":s.isValid}]),"onUpdate:modelValue":e[2]||(e[2]=a=>this.value.repeatNewPassword=a),id:"repeatNewPassword_"+this.uuid},null,10,D3),[[Ke,this.value.repeatNewPassword]])])])]),g("button",{disabled:!this.passwordValid,class:"ms-auto btn bg-success-subtle text-success-emphasis border-1 border-success-subtle rounded-3 shadow-sm",onClick:e[3]||(e[3]=a=>this.useValidation())},[L3,B(o,{t:"Update Password"})],8,$3)])}const N3=Ye(y3,[["render",O3]]),F3={name:"dashboardSettingsInputWireguardConfigurationPath",components:{LocaleText:Qe},props:{targetData:String,title:String,warning:!1,warningText:""},setup(){const t=st(),e=vi(),n=`input_${Os()}`;return{store:t,uuid:n,WireguardConfigurationStore:e}},data(){return{value:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.value=this.store.Configuration.Server[this.targetData]},methods:{async useValidation(){this.changed&&(this.updating=!0,await kt("/api/updateDashboardConfigurationItem",{section:"Server",key:this.targetData,value:this.value},t=>{t.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3),this.WireguardConfigurationStore.getConfigurations(),this.store.newMessage("Server","WireGuard configuration path saved","success")):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=t.message),this.changed=!1,this.updating=!1}))}}},B3={class:"form-group"},V3=["for"],z3={class:"d-flex gap-2 align-items-start"},W3={class:"flex-grow-1"},H3=["id","disabled"],Y3={class:"invalid-feedback fw-bold"},j3=["disabled"],K3={key:0,class:"bi bi-save2-fill"},U3={key:1,class:"spinner-border spinner-border-sm"},G3={key:0,class:"px-2 py-1 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2 d-inline-block mt-1 mb-2"},X3=g("i",{class:"bi bi-exclamation-triangle-fill me-2"},null,-1);function q3(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",B3,[g("label",{for:this.uuid,class:"text-muted mb-1"},[g("strong",null,[g("small",null,[B(o,{t:this.title},null,8,["t"])])])],8,V3),g("div",z3,[g("div",W3,[Ne(g("input",{type:"text",class:Ie(["form-control rounded-3",{"is-invalid":this.showInvalidFeedback,"is-valid":this.isValid}]),id:this.uuid,"onUpdate:modelValue":e[0]||(e[0]=a=>this.value=a),onKeydown:e[1]||(e[1]=a=>this.changed=!0),disabled:this.updating},null,42,H3),[[Ke,this.value]]),g("div",Y3,Ee(this.invalidFeedback),1)]),g("button",{onClick:e[2]||(e[2]=a=>this.useValidation()),disabled:!this.changed,class:"ms-auto btn rounded-3 border-success-subtle bg-success-subtle text-success-emphasis"},[this.updating?(D(),V("span",U3)):(D(),V("i",K3))],8,j3)]),n.warning?(D(),V("div",G3,[g("small",null,[X3,B(o,{t:n.warningText},null,8,["t"])])])):ce("",!0)])}const Z3=Ye(F3,[["render",q3]]),J3={name:"dashboardTheme",components:{LocaleText:Qe},setup(){return{dashboardConfigurationStore:st()}},methods:{async switchTheme(t){await kt("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_theme",value:t},e=>{e.status&&(this.dashboardConfigurationStore.Configuration.Server.dashboard_theme=t)})}}},Q3={class:"card mb-4 shadow rounded-3"},eF={class:"card-header"},tF={class:"card-body d-flex gap-2"},nF=g("i",{class:"bi bi-sun-fill me-2"},null,-1),iF=g("i",{class:"bi bi-moon-fill me-2"},null,-1);function sF(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",Q3,[g("p",eF,[B(o,{t:"Dashboard Theme"})]),g("div",tF,[g("button",{class:Ie(["btn bg-primary-subtle text-primary-emphasis flex-grow-1",{active:this.dashboardConfigurationStore.Configuration.Server.dashboard_theme==="light"}]),onClick:e[0]||(e[0]=a=>this.switchTheme("light"))},[nF,B(o,{t:"Light"})],2),g("button",{class:Ie(["btn bg-primary-subtle text-primary-emphasis flex-grow-1",{active:this.dashboardConfigurationStore.Configuration.Server.dashboard_theme==="dark"}]),onClick:e[1]||(e[1]=a=>this.switchTheme("dark"))},[iF,B(o,{t:"Dark"})],2)])])}const rF=Ye(J3,[["render",sF]]),oF={name:"dashboardSettingsInputIPAddressAndPort",props:{},setup(){const t=st(),e=`input_${Os()}`;return{store:t,uuid:e}},data(){return{app_ip:"",app_port:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.app_ip=this.store.Configuration.Server.app_ip,this.app_port=this.store.Configuration.Server.app_port},methods:{async useValidation(){this.changed&&await kt("/api/updateDashboardConfigurationItem",{section:"Server",key:this.targetData,value:this.value},t=>{t.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=t.message)})}}},aF={class:"invalid-feedback d-block mt-0"},lF={class:"row"},cF={class:"form-group mb-2 col-sm"},uF=["for"],dF=g("strong",null,[g("small",null,"Dashboard IP Address")],-1),hF=[dF],fF=["id"],gF=g("div",{class:"px-2 py-1 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2 d-inline-block"},[g("small",null,[g("i",{class:"bi bi-exclamation-triangle-fill me-2"}),g("code",null,"0.0.0.0"),He(" means it can be access by anyone with your server IP Address.")])],-1),pF={class:"form-group col-sm"},mF=["for"],_F=g("strong",null,[g("small",null,"Dashboard Port")],-1),yF=[_F],vF=["id"],bF=g("button",{class:"btn btn-success btn-sm fw-bold rounded-3"},[g("i",{class:"bi bi-floppy-fill me-2"}),He("Update Dashboard Settings & Restart ")],-1);function wF(t,e,n,i,s,r){return D(),V("div",null,[g("div",aF,Ee(this.invalidFeedback),1),g("div",lF,[g("div",cF,[g("label",{for:"app_ip_"+this.uuid,class:"text-muted mb-1"},hF,8,uF),Ne(g("input",{type:"text",class:"form-control mb-2",id:"app_ip_"+this.uuid,"onUpdate:modelValue":e[0]||(e[0]=o=>this.app_ip=o)},null,8,fF),[[Ke,this.app_ip]]),gF]),g("div",pF,[g("label",{for:"app_port_"+this.uuid,class:"text-muted mb-1"},yF,8,mF),Ne(g("input",{type:"text",class:"form-control mb-2",id:"app_port_"+this.uuid,"onUpdate:modelValue":e[1]||(e[1]=o=>this.app_port=o)},null,8,vF),[[Ke,this.app_port]])])]),bF])}const xF=Ye(oF,[["render",wF]]);function Ve(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function yt(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function ss(t,e){const n=Ve(t);return isNaN(e)?yt(t,NaN):(e&&n.setDate(n.getDate()+e),n)}function us(t,e){const n=Ve(t);if(isNaN(e))return yt(t,NaN);if(!e)return n;const i=n.getDate(),s=yt(t,n.getTime());s.setMonth(n.getMonth()+e+1,0);const r=s.getDate();return i>=r?s:(n.setFullYear(s.getFullYear(),s.getMonth(),i),n)}function CS(t,e){const{years:n=0,months:i=0,weeks:s=0,days:r=0,hours:o=0,minutes:a=0,seconds:l=0}=e,c=Ve(t),u=i||n?us(c,i+n*12):c,d=r||s?ss(u,r+s*7):u,h=a+o*60,p=(l+h*60)*1e3;return yt(t,d.getTime()+p)}function EF(t,e){const n=+Ve(t);return yt(t,n+e)}const TS=6048e5,SF=864e5,CF=6e4,kS=36e5,TF=1e3;function kF(t,e){return EF(t,e*kS)}let AF={};function _a(){return AF}function fs(t,e){const n=_a(),i=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=Ve(t),r=s.getDay(),o=(r=s.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function hb(t){const e=Ve(t);return e.setHours(0,0,0,0),e}function yh(t){const e=Ve(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function MS(t,e){const n=hb(t),i=hb(e),s=+n-yh(n),r=+i-yh(i);return Math.round((s-r)/SF)}function MF(t){const e=AS(t),n=yt(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),xl(n)}function IF(t,e){const n=e*3;return us(t,n)}function k_(t,e){return us(t,e*12)}function fb(t,e){const n=Ve(t),i=Ve(e),s=n.getTime()-i.getTime();return s<0?-1:s>0?1:s}function IS(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function zc(t){if(!IS(t)&&typeof t!="number")return!1;const e=Ve(t);return!isNaN(Number(e))}function gb(t){const e=Ve(t);return Math.trunc(e.getMonth()/3)+1}function PF(t,e){const n=Ve(t),i=Ve(e);return n.getFullYear()-i.getFullYear()}function RF(t,e){const n=Ve(t),i=Ve(e),s=fb(n,i),r=Math.abs(PF(n,i));n.setFullYear(1584),i.setFullYear(1584);const o=fb(n,i)===-s,a=s*(r-+o);return a===0?0:a}function PS(t,e){const n=Ve(t.start),i=Ve(t.end);let s=+n>+i;const r=s?+n:+i,o=s?i:n;o.setHours(0,0,0,0);let a=e?.step??1;if(!a)return[];a<0&&(a=-a,s=!s);const l=[];for(;+o<=r;)l.push(Ve(o)),o.setDate(o.getDate()+a),o.setHours(0,0,0,0);return s?l.reverse():l}function Ko(t){const e=Ve(t),n=e.getMonth(),i=n-n%3;return e.setMonth(i,1),e.setHours(0,0,0,0),e}function DF(t,e){const n=Ve(t.start),i=Ve(t.end);let s=+n>+i;const r=s?+Ko(n):+Ko(i);let o=Ko(s?i:n),a=e?.step??1;if(!a)return[];a<0&&(a=-a,s=!s);const l=[];for(;+o<=r;)l.push(Ve(o)),o=IF(o,a);return s?l.reverse():l}function $F(t){const e=Ve(t);return e.setDate(1),e.setHours(0,0,0,0),e}function RS(t){const e=Ve(t),n=e.getFullYear();return e.setFullYear(n+1,0,0),e.setHours(23,59,59,999),e}function ru(t){const e=Ve(t),n=yt(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}function DS(t,e){const n=_a(),i=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=Ve(t),r=s.getDay(),o=(r{let i;const s=LF[t];return typeof s=="string"?i=s:e===1?i=s.one:i=s.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function Pg(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const NF={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},FF={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},BF={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},VF={date:Pg({formats:NF,defaultWidth:"full"}),time:Pg({formats:FF,defaultWidth:"full"}),dateTime:Pg({formats:BF,defaultWidth:"full"})},zF={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},WF=(t,e,n,i)=>zF[t];function ac(t){return(e,n)=>{const i=n?.context?String(n.context):"standalone";let s;if(i==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=n?.width?String(n.width):o;s=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=n?.width?String(n.width):t.defaultWidth;s=t.values[a]||t.values[o]}const r=t.argumentCallback?t.argumentCallback(e):e;return s[r]}}const HF={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},YF={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},jF={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},KF={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},UF={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},GF={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},XF=(t,e)=>{const n=Number(t),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},qF={ordinalNumber:XF,era:ac({values:HF,defaultWidth:"wide"}),quarter:ac({values:YF,defaultWidth:"wide",argumentCallback:t=>t-1}),month:ac({values:jF,defaultWidth:"wide"}),day:ac({values:KF,defaultWidth:"wide"}),dayPeriod:ac({values:UF,defaultWidth:"wide",formattingValues:GF,defaultFormattingWidth:"wide"})};function lc(t){return(e,n={})=>{const i=n.width,s=i&&t.matchPatterns[i]||t.matchPatterns[t.defaultMatchWidth],r=e.match(s);if(!r)return null;const o=r[0],a=i&&t.parsePatterns[i]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?JF(a,d=>d.test(o)):ZF(a,d=>d.test(o));let c;c=t.valueCallback?t.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=e.slice(o.length);return{value:c,rest:u}}}function ZF(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function JF(t,e){for(let n=0;n{const i=e.match(t.matchPattern);if(!i)return null;const s=i[0],r=e.match(t.parsePattern);if(!r)return null;let o=t.valueCallback?t.valueCallback(r[0]):r[0];o=n.valueCallback?n.valueCallback(o):o;const a=e.slice(s.length);return{value:o,rest:a}}}const e5=/^(\d+)(th|st|nd|rd)?/i,t5=/\d+/i,n5={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},i5={any:[/^b/i,/^(a|c)/i]},s5={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},r5={any:[/1/i,/2/i,/3/i,/4/i]},o5={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},a5={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},l5={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},c5={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},u5={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},d5={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},h5={ordinalNumber:QF({matchPattern:e5,parsePattern:t5,valueCallback:t=>parseInt(t,10)}),era:lc({matchPatterns:n5,defaultMatchWidth:"wide",parsePatterns:i5,defaultParseWidth:"any"}),quarter:lc({matchPatterns:s5,defaultMatchWidth:"wide",parsePatterns:r5,defaultParseWidth:"any",valueCallback:t=>t+1}),month:lc({matchPatterns:o5,defaultMatchWidth:"wide",parsePatterns:a5,defaultParseWidth:"any"}),day:lc({matchPatterns:l5,defaultMatchWidth:"wide",parsePatterns:c5,defaultParseWidth:"any"}),dayPeriod:lc({matchPatterns:u5,defaultMatchWidth:"any",parsePatterns:d5,defaultParseWidth:"any"})},$S={code:"en-US",formatDistance:OF,formatLong:VF,formatRelative:WF,localize:qF,match:h5,options:{weekStartsOn:0,firstWeekContainsDate:1}};function f5(t){const e=Ve(t);return MS(e,ru(e))+1}function A_(t){const e=Ve(t),n=+xl(e)-+MF(e);return Math.round(n/TS)+1}function M_(t,e){const n=Ve(t),i=n.getFullYear(),s=_a(),r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,o=yt(t,0);o.setFullYear(i+1,0,r),o.setHours(0,0,0,0);const a=fs(o,e),l=yt(t,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=fs(l,e);return n.getTime()>=a.getTime()?i+1:n.getTime()>=c.getTime()?i:i-1}function g5(t,e){const n=_a(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=M_(t,e),r=yt(t,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),fs(r,e)}function I_(t,e){const n=Ve(t),i=+fs(n,e)-+g5(n,e);return Math.round(i/TS)+1}function Et(t,e){const n=t<0?"-":"",i=Math.abs(t).toString().padStart(e,"0");return n+i}const Tr={y(t,e){const n=t.getFullYear(),i=n>0?n:1-n;return Et(e==="yy"?i%100:i,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):Et(n+1,2)},d(t,e){return Et(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return Et(t.getHours()%12||12,e.length)},H(t,e){return Et(t.getHours(),e.length)},m(t,e){return Et(t.getMinutes(),e.length)},s(t,e){return Et(t.getSeconds(),e.length)},S(t,e){const n=e.length,i=t.getMilliseconds(),s=Math.trunc(i*Math.pow(10,n-3));return Et(s,e.length)}},Pa={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},mb={G:function(t,e,n){const i=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const i=t.getFullYear(),s=i>0?i:1-i;return n.ordinalNumber(s,{unit:"year"})}return Tr.y(t,e)},Y:function(t,e,n,i){const s=M_(t,i),r=s>0?s:1-s;if(e==="YY"){const o=r%100;return Et(o,2)}return e==="Yo"?n.ordinalNumber(r,{unit:"year"}):Et(r,e.length)},R:function(t,e){const n=AS(t);return Et(n,e.length)},u:function(t,e){const n=t.getFullYear();return Et(n,e.length)},Q:function(t,e,n){const i=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return Et(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,e,n){const i=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return Et(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,e,n){const i=t.getMonth();switch(e){case"M":case"MM":return Tr.M(t,e);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(t,e,n){const i=t.getMonth();switch(e){case"L":return String(i+1);case"LL":return Et(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(t,e,n,i){const s=I_(t,i);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):Et(s,e.length)},I:function(t,e,n){const i=A_(t);return e==="Io"?n.ordinalNumber(i,{unit:"week"}):Et(i,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Tr.d(t,e)},D:function(t,e,n){const i=f5(t);return e==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):Et(i,e.length)},E:function(t,e,n){const i=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(t,e,n,i){const s=t.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return Et(r,2);case"eo":return n.ordinalNumber(r,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,n,i){const s=t.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return Et(r,e.length);case"co":return n.ordinalNumber(r,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,n){const i=t.getDay(),s=i===0?7:i;switch(e){case"i":return String(s);case"ii":return Et(s,e.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(t,e,n){const s=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,e,n){const i=t.getHours();let s;switch(i===12?s=Pa.noon:i===0?s=Pa.midnight:s=i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,n){const i=t.getHours();let s;switch(i>=17?s=Pa.evening:i>=12?s=Pa.afternoon:i>=4?s=Pa.morning:s=Pa.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let i=t.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Tr.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Tr.H(t,e)},K:function(t,e,n){const i=t.getHours()%12;return e==="Ko"?n.ordinalNumber(i,{unit:"hour"}):Et(i,e.length)},k:function(t,e,n){let i=t.getHours();return i===0&&(i=24),e==="ko"?n.ordinalNumber(i,{unit:"hour"}):Et(i,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Tr.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Tr.s(t,e)},S:function(t,e){return Tr.S(t,e)},X:function(t,e,n){const i=t.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return yb(i);case"XXXX":case"XX":return Bo(i);case"XXXXX":case"XXX":default:return Bo(i,":")}},x:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"x":return yb(i);case"xxxx":case"xx":return Bo(i);case"xxxxx":case"xxx":default:return Bo(i,":")}},O:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+_b(i,":");case"OOOO":default:return"GMT"+Bo(i,":")}},z:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+_b(i,":");case"zzzz":default:return"GMT"+Bo(i,":")}},t:function(t,e,n){const i=Math.trunc(t.getTime()/1e3);return Et(i,e.length)},T:function(t,e,n){const i=t.getTime();return Et(i,e.length)}};function _b(t,e=""){const n=t>0?"-":"+",i=Math.abs(t),s=Math.trunc(i/60),r=i%60;return r===0?n+String(s):n+String(s)+e+Et(r,2)}function yb(t,e){return t%60===0?(t>0?"-":"+")+Et(Math.abs(t)/60,2):Bo(t,e)}function Bo(t,e=""){const n=t>0?"-":"+",i=Math.abs(t),s=Et(Math.trunc(i/60),2),r=Et(i%60,2);return n+s+e+r}const vb=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},LS=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},p5=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],i=n[1],s=n[2];if(!s)return vb(t,e);let r;switch(i){case"P":r=e.dateTime({width:"short"});break;case"PP":r=e.dateTime({width:"medium"});break;case"PPP":r=e.dateTime({width:"long"});break;case"PPPP":default:r=e.dateTime({width:"full"});break}return r.replace("{{date}}",vb(i,e)).replace("{{time}}",LS(s,e))},Zp={p:LS,P:p5},m5=/^D+$/,_5=/^Y+$/,y5=["D","DD","YY","YYYY"];function OS(t){return m5.test(t)}function NS(t){return _5.test(t)}function Jp(t,e,n){const i=v5(t,e,n);if(console.warn(i),y5.includes(t))throw new RangeError(i)}function v5(t,e,n){const i=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const b5=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,w5=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,x5=/^'([^]*?)'?$/,E5=/''/g,S5=/[a-zA-Z]/;function Rs(t,e,n){const i=_a(),s=n?.locale??i.locale??$S,r=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,a=Ve(t);if(!zc(a))throw new RangeError("Invalid time value");let l=e.match(w5).map(u=>{const d=u[0];if(d==="p"||d==="P"){const h=Zp[d];return h(u,s.formatLong)}return u}).join("").match(b5).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const d=u[0];if(d==="'")return{isToken:!1,value:C5(u)};if(mb[d])return{isToken:!0,value:u};if(d.match(S5))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:u}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:r,weekStartsOn:o,locale:s};return l.map(u=>{if(!u.isToken)return u.value;const d=u.value;(!n?.useAdditionalWeekYearTokens&&NS(d)||!n?.useAdditionalDayOfYearTokens&&OS(d))&&Jp(d,e,String(t));const h=mb[d[0]];return h(a,d,s.localize,c)}).join("")}function C5(t){const e=t.match(x5);return e?e[1].replace(E5,"'"):t}function T5(t){return Ve(t).getDay()}function k5(t){const e=Ve(t),n=e.getFullYear(),i=e.getMonth(),s=yt(t,0);return s.setFullYear(n,i+1,0),s.setHours(0,0,0,0),s.getDate()}function A5(){return Object.assign({},_a())}function pr(t){return Ve(t).getHours()}function M5(t){let n=Ve(t).getDay();return n===0&&(n=7),n}function oo(t){return Ve(t).getMinutes()}function at(t){return Ve(t).getMonth()}function El(t){return Ve(t).getSeconds()}function Ge(t){return Ve(t).getFullYear()}function Sl(t,e){const n=Ve(t),i=Ve(e);return n.getTime()>i.getTime()}function ou(t,e){const n=Ve(t),i=Ve(e);return+n<+i}function Za(t,e){const n=Ve(t),i=Ve(e);return+n==+i}function I5(t,e){const n=e instanceof Date?yt(e,0):new e(0);return n.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),n.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),n}const P5=10;class FS{subPriority=0;validate(e,n){return!0}}class R5 extends FS{constructor(e,n,i,s,r){super(),this.value=e,this.validateValue=n,this.setValue=i,this.priority=s,r&&(this.subPriority=r)}validate(e,n){return this.validateValue(e,this.value,n)}set(e,n,i){return this.setValue(e,n,this.value,i)}}class D5 extends FS{priority=P5;subPriority=-1;set(e,n){return n.timestampIsSet?e:yt(e,I5(e,Date))}}class bt{run(e,n,i,s){const r=this.parse(e,n,i,s);return r?{setter:new R5(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(e,n,i){return!0}}class $5 extends bt{priority=140;parse(e,n,i){switch(n){case"G":case"GG":case"GGG":return i.era(e,{width:"abbreviated"})||i.era(e,{width:"narrow"});case"GGGGG":return i.era(e,{width:"narrow"});case"GGGG":default:return i.era(e,{width:"wide"})||i.era(e,{width:"abbreviated"})||i.era(e,{width:"narrow"})}}set(e,n,i){return n.era=i,e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]}const sn={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},xs={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function rn(t,e){return t&&{value:e(t.value),rest:t.rest}}function jt(t,e){const n=e.match(t);return n?{value:parseInt(n[0],10),rest:e.slice(n[0].length)}:null}function Es(t,e){const n=e.match(t);if(!n)return null;if(n[0]==="Z")return{value:0,rest:e.slice(1)};const i=n[1]==="+"?1:-1,s=n[2]?parseInt(n[2],10):0,r=n[3]?parseInt(n[3],10):0,o=n[5]?parseInt(n[5],10):0;return{value:i*(s*kS+r*CF+o*TF),rest:e.slice(n[0].length)}}function BS(t){return jt(sn.anyDigitsSigned,t)}function en(t,e){switch(t){case 1:return jt(sn.singleDigit,e);case 2:return jt(sn.twoDigits,e);case 3:return jt(sn.threeDigits,e);case 4:return jt(sn.fourDigits,e);default:return jt(new RegExp("^\\d{1,"+t+"}"),e)}}function vh(t,e){switch(t){case 1:return jt(sn.singleDigitSigned,e);case 2:return jt(sn.twoDigitsSigned,e);case 3:return jt(sn.threeDigitsSigned,e);case 4:return jt(sn.fourDigitsSigned,e);default:return jt(new RegExp("^-?\\d{1,"+t+"}"),e)}}function P_(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function VS(t,e){const n=e>0,i=n?e:1-e;let s;if(i<=50)s=t||100;else{const r=i+50,o=Math.trunc(r/100)*100,a=t>=r%100;s=t+o-(a?100:0)}return n?s:1-s}function zS(t){return t%400===0||t%4===0&&t%100!==0}class L5 extends bt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,n,i){const s=r=>({year:r,isTwoDigitYear:n==="yy"});switch(n){case"y":return rn(en(4,e),s);case"yo":return rn(i.ordinalNumber(e,{unit:"year"}),s);default:return rn(en(n.length,e),s)}}validate(e,n){return n.isTwoDigitYear||n.year>0}set(e,n,i){const s=e.getFullYear();if(i.isTwoDigitYear){const o=VS(i.year,s);return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}const r=!("era"in n)||n.era===1?i.year:1-i.year;return e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}}class O5 extends bt{priority=130;parse(e,n,i){const s=r=>({year:r,isTwoDigitYear:n==="YY"});switch(n){case"Y":return rn(en(4,e),s);case"Yo":return rn(i.ordinalNumber(e,{unit:"year"}),s);default:return rn(en(n.length,e),s)}}validate(e,n){return n.isTwoDigitYear||n.year>0}set(e,n,i,s){const r=M_(e,s);if(i.isTwoDigitYear){const a=VS(i.year,r);return e.setFullYear(a,0,s.firstWeekContainsDate),e.setHours(0,0,0,0),fs(e,s)}const o=!("era"in n)||n.era===1?i.year:1-i.year;return e.setFullYear(o,0,s.firstWeekContainsDate),e.setHours(0,0,0,0),fs(e,s)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class N5 extends bt{priority=130;parse(e,n){return vh(n==="R"?4:n.length,e)}set(e,n,i){const s=yt(e,0);return s.setFullYear(i,0,4),s.setHours(0,0,0,0),xl(s)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class F5 extends bt{priority=130;parse(e,n){return vh(n==="u"?4:n.length,e)}set(e,n,i){return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class B5 extends bt{priority=120;parse(e,n,i){switch(n){case"Q":case"QQ":return en(n.length,e);case"Qo":return i.ordinalNumber(e,{unit:"quarter"});case"QQQ":return i.quarter(e,{width:"abbreviated",context:"formatting"})||i.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(e,{width:"wide",context:"formatting"})||i.quarter(e,{width:"abbreviated",context:"formatting"})||i.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=1&&n<=4}set(e,n,i){return e.setMonth((i-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class V5 extends bt{priority=120;parse(e,n,i){switch(n){case"q":case"qq":return en(n.length,e);case"qo":return i.ordinalNumber(e,{unit:"quarter"});case"qqq":return i.quarter(e,{width:"abbreviated",context:"standalone"})||i.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(e,{width:"wide",context:"standalone"})||i.quarter(e,{width:"abbreviated",context:"standalone"})||i.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,n){return n>=1&&n<=4}set(e,n,i){return e.setMonth((i-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class z5 extends bt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,n,i){const s=r=>r-1;switch(n){case"M":return rn(jt(sn.month,e),s);case"MM":return rn(en(2,e),s);case"Mo":return rn(i.ordinalNumber(e,{unit:"month"}),s);case"MMM":return i.month(e,{width:"abbreviated",context:"formatting"})||i.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(e,{width:"wide",context:"formatting"})||i.month(e,{width:"abbreviated",context:"formatting"})||i.month(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=0&&n<=11}set(e,n,i){return e.setMonth(i,1),e.setHours(0,0,0,0),e}}class W5 extends bt{priority=110;parse(e,n,i){const s=r=>r-1;switch(n){case"L":return rn(jt(sn.month,e),s);case"LL":return rn(en(2,e),s);case"Lo":return rn(i.ordinalNumber(e,{unit:"month"}),s);case"LLL":return i.month(e,{width:"abbreviated",context:"standalone"})||i.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(e,{width:"wide",context:"standalone"})||i.month(e,{width:"abbreviated",context:"standalone"})||i.month(e,{width:"narrow",context:"standalone"})}}validate(e,n){return n>=0&&n<=11}set(e,n,i){return e.setMonth(i,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function H5(t,e,n){const i=Ve(t),s=I_(i,n)-e;return i.setDate(i.getDate()-s*7),i}class Y5 extends bt{priority=100;parse(e,n,i){switch(n){case"w":return jt(sn.week,e);case"wo":return i.ordinalNumber(e,{unit:"week"});default:return en(n.length,e)}}validate(e,n){return n>=1&&n<=53}set(e,n,i,s){return fs(H5(e,i,s),s)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function j5(t,e){const n=Ve(t),i=A_(n)-e;return n.setDate(n.getDate()-i*7),n}class K5 extends bt{priority=100;parse(e,n,i){switch(n){case"I":return jt(sn.week,e);case"Io":return i.ordinalNumber(e,{unit:"week"});default:return en(n.length,e)}}validate(e,n){return n>=1&&n<=53}set(e,n,i){return xl(j5(e,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const U5=[31,28,31,30,31,30,31,31,30,31,30,31],G5=[31,29,31,30,31,30,31,31,30,31,30,31];class X5 extends bt{priority=90;subPriority=1;parse(e,n,i){switch(n){case"d":return jt(sn.date,e);case"do":return i.ordinalNumber(e,{unit:"date"});default:return en(n.length,e)}}validate(e,n){const i=e.getFullYear(),s=zS(i),r=e.getMonth();return s?n>=1&&n<=G5[r]:n>=1&&n<=U5[r]}set(e,n,i){return e.setDate(i),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class q5 extends bt{priority=90;subpriority=1;parse(e,n,i){switch(n){case"D":case"DD":return jt(sn.dayOfYear,e);case"Do":return i.ordinalNumber(e,{unit:"date"});default:return en(n.length,e)}}validate(e,n){const i=e.getFullYear();return zS(i)?n>=1&&n<=366:n>=1&&n<=365}set(e,n,i){return e.setMonth(0,i),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function R_(t,e,n){const i=_a(),s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,r=Ve(t),o=r.getDay(),l=(e%7+7)%7,c=7-s,u=e<0||e>6?e-(o+c)%7:(l+c)%7-(o+c)%7;return ss(r,u)}class Z5 extends bt{priority=90;parse(e,n,i){switch(n){case"E":case"EE":case"EEE":return i.day(e,{width:"abbreviated",context:"formatting"})||i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return i.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return i.day(e,{width:"wide",context:"formatting"})||i.day(e,{width:"abbreviated",context:"formatting"})||i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=0&&n<=6}set(e,n,i,s){return e=R_(e,i,s),e.setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]}class J5 extends bt{priority=90;parse(e,n,i,s){const r=o=>{const a=Math.floor((o-1)/7)*7;return(o+s.weekStartsOn+6)%7+a};switch(n){case"e":case"ee":return rn(en(n.length,e),r);case"eo":return rn(i.ordinalNumber(e,{unit:"day"}),r);case"eee":return i.day(e,{width:"abbreviated",context:"formatting"})||i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"});case"eeeee":return i.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return i.day(e,{width:"wide",context:"formatting"})||i.day(e,{width:"abbreviated",context:"formatting"})||i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=0&&n<=6}set(e,n,i,s){return e=R_(e,i,s),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class Q5 extends bt{priority=90;parse(e,n,i,s){const r=o=>{const a=Math.floor((o-1)/7)*7;return(o+s.weekStartsOn+6)%7+a};switch(n){case"c":case"cc":return rn(en(n.length,e),r);case"co":return rn(i.ordinalNumber(e,{unit:"day"}),r);case"ccc":return i.day(e,{width:"abbreviated",context:"standalone"})||i.day(e,{width:"short",context:"standalone"})||i.day(e,{width:"narrow",context:"standalone"});case"ccccc":return i.day(e,{width:"narrow",context:"standalone"});case"cccccc":return i.day(e,{width:"short",context:"standalone"})||i.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return i.day(e,{width:"wide",context:"standalone"})||i.day(e,{width:"abbreviated",context:"standalone"})||i.day(e,{width:"short",context:"standalone"})||i.day(e,{width:"narrow",context:"standalone"})}}validate(e,n){return n>=0&&n<=6}set(e,n,i,s){return e=R_(e,i,s),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function eB(t,e){const n=Ve(t),i=M5(n),s=e-i;return ss(n,s)}class tB extends bt{priority=90;parse(e,n,i){const s=r=>r===0?7:r;switch(n){case"i":case"ii":return en(n.length,e);case"io":return i.ordinalNumber(e,{unit:"day"});case"iii":return rn(i.day(e,{width:"abbreviated",context:"formatting"})||i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"}),s);case"iiiii":return rn(i.day(e,{width:"narrow",context:"formatting"}),s);case"iiiiii":return rn(i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"}),s);case"iiii":default:return rn(i.day(e,{width:"wide",context:"formatting"})||i.day(e,{width:"abbreviated",context:"formatting"})||i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"}),s)}}validate(e,n){return n>=1&&n<=7}set(e,n,i){return e=eB(e,i),e.setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class nB extends bt{priority=80;parse(e,n,i){switch(n){case"a":case"aa":case"aaa":return i.dayPeriod(e,{width:"abbreviated",context:"formatting"})||i.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return i.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(e,{width:"wide",context:"formatting"})||i.dayPeriod(e,{width:"abbreviated",context:"formatting"})||i.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,n,i){return e.setHours(P_(i),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]}class iB extends bt{priority=80;parse(e,n,i){switch(n){case"b":case"bb":case"bbb":return i.dayPeriod(e,{width:"abbreviated",context:"formatting"})||i.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return i.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(e,{width:"wide",context:"formatting"})||i.dayPeriod(e,{width:"abbreviated",context:"formatting"})||i.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,n,i){return e.setHours(P_(i),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]}class sB extends bt{priority=80;parse(e,n,i){switch(n){case"B":case"BB":case"BBB":return i.dayPeriod(e,{width:"abbreviated",context:"formatting"})||i.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return i.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(e,{width:"wide",context:"formatting"})||i.dayPeriod(e,{width:"abbreviated",context:"formatting"})||i.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,n,i){return e.setHours(P_(i),0,0,0),e}incompatibleTokens=["a","b","t","T"]}class rB extends bt{priority=70;parse(e,n,i){switch(n){case"h":return jt(sn.hour12h,e);case"ho":return i.ordinalNumber(e,{unit:"hour"});default:return en(n.length,e)}}validate(e,n){return n>=1&&n<=12}set(e,n,i){const s=e.getHours()>=12;return s&&i<12?e.setHours(i+12,0,0,0):!s&&i===12?e.setHours(0,0,0,0):e.setHours(i,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]}class oB extends bt{priority=70;parse(e,n,i){switch(n){case"H":return jt(sn.hour23h,e);case"Ho":return i.ordinalNumber(e,{unit:"hour"});default:return en(n.length,e)}}validate(e,n){return n>=0&&n<=23}set(e,n,i){return e.setHours(i,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]}class aB extends bt{priority=70;parse(e,n,i){switch(n){case"K":return jt(sn.hour11h,e);case"Ko":return i.ordinalNumber(e,{unit:"hour"});default:return en(n.length,e)}}validate(e,n){return n>=0&&n<=11}set(e,n,i){return e.getHours()>=12&&i<12?e.setHours(i+12,0,0,0):e.setHours(i,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]}class lB extends bt{priority=70;parse(e,n,i){switch(n){case"k":return jt(sn.hour24h,e);case"ko":return i.ordinalNumber(e,{unit:"hour"});default:return en(n.length,e)}}validate(e,n){return n>=1&&n<=24}set(e,n,i){const s=i<=24?i%24:i;return e.setHours(s,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]}class cB extends bt{priority=60;parse(e,n,i){switch(n){case"m":return jt(sn.minute,e);case"mo":return i.ordinalNumber(e,{unit:"minute"});default:return en(n.length,e)}}validate(e,n){return n>=0&&n<=59}set(e,n,i){return e.setMinutes(i,0,0),e}incompatibleTokens=["t","T"]}class uB extends bt{priority=50;parse(e,n,i){switch(n){case"s":return jt(sn.second,e);case"so":return i.ordinalNumber(e,{unit:"second"});default:return en(n.length,e)}}validate(e,n){return n>=0&&n<=59}set(e,n,i){return e.setSeconds(i,0),e}incompatibleTokens=["t","T"]}class dB extends bt{priority=30;parse(e,n){const i=s=>Math.trunc(s*Math.pow(10,-n.length+3));return rn(en(n.length,e),i)}set(e,n,i){return e.setMilliseconds(i),e}incompatibleTokens=["t","T"]}class hB extends bt{priority=10;parse(e,n){switch(n){case"X":return Es(xs.basicOptionalMinutes,e);case"XX":return Es(xs.basic,e);case"XXXX":return Es(xs.basicOptionalSeconds,e);case"XXXXX":return Es(xs.extendedOptionalSeconds,e);case"XXX":default:return Es(xs.extended,e)}}set(e,n,i){return n.timestampIsSet?e:yt(e,e.getTime()-yh(e)-i)}incompatibleTokens=["t","T","x"]}class fB extends bt{priority=10;parse(e,n){switch(n){case"x":return Es(xs.basicOptionalMinutes,e);case"xx":return Es(xs.basic,e);case"xxxx":return Es(xs.basicOptionalSeconds,e);case"xxxxx":return Es(xs.extendedOptionalSeconds,e);case"xxx":default:return Es(xs.extended,e)}}set(e,n,i){return n.timestampIsSet?e:yt(e,e.getTime()-yh(e)-i)}incompatibleTokens=["t","T","X"]}class gB extends bt{priority=40;parse(e){return BS(e)}set(e,n,i){return[yt(e,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class pB extends bt{priority=20;parse(e){return BS(e)}set(e,n,i){return[yt(e,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const mB={G:new $5,y:new L5,Y:new O5,R:new N5,u:new F5,Q:new B5,q:new V5,M:new z5,L:new W5,w:new Y5,I:new K5,d:new X5,D:new q5,E:new Z5,e:new J5,c:new Q5,i:new tB,a:new nB,b:new iB,B:new sB,h:new rB,H:new oB,K:new aB,k:new lB,m:new cB,s:new uB,S:new dB,X:new hB,x:new fB,t:new gB,T:new pB},_B=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,yB=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,vB=/^'([^]*?)'?$/,bB=/''/g,wB=/\S/,xB=/[a-zA-Z]/;function Qp(t,e,n,i){const s=A5(),r=i?.locale??s.locale??$S,o=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,a=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0;if(e==="")return t===""?Ve(n):yt(n,NaN);const l={firstWeekContainsDate:o,weekStartsOn:a,locale:r},c=[new D5],u=e.match(yB).map(m=>{const y=m[0];if(y in Zp){const v=Zp[y];return v(m,r.formatLong)}return m}).join("").match(_B),d=[];for(let m of u){!i?.useAdditionalWeekYearTokens&&NS(m)&&Jp(m,e,t),!i?.useAdditionalDayOfYearTokens&&OS(m)&&Jp(m,e,t);const y=m[0],v=mB[y];if(v){const{incompatibleTokens:b}=v;if(Array.isArray(b)){const C=d.find(w=>b.includes(w.token)||w.token===y);if(C)throw new RangeError(`The format string mustn't contain \`${C.fullToken}\` and \`${m}\` at the same time`)}else if(v.incompatibleTokens==="*"&&d.length>0)throw new RangeError(`The format string mustn't contain \`${m}\` and any other token at the same time`);d.push({token:y,fullToken:m});const E=v.run(t,m,r.match,l);if(!E)return yt(n,NaN);c.push(E.setter),t=E.rest}else{if(y.match(xB))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");if(m==="''"?m="'":y==="'"&&(m=EB(m)),t.indexOf(m)===0)t=t.slice(m.length);else return yt(n,NaN)}}if(t.length>0&&wB.test(t))return yt(n,NaN);const h=c.map(m=>m.priority).sort((m,y)=>y-m).filter((m,y,v)=>v.indexOf(m)===y).map(m=>c.filter(y=>y.priority===m).sort((y,v)=>v.subPriority-y.subPriority)).map(m=>m[0]);let f=Ve(n);if(isNaN(f.getTime()))return yt(n,NaN);const p={};for(const m of h){if(!m.validate(f,l))return yt(n,NaN);const y=m.set(f,p,l);Array.isArray(y)?(f=y[0],Object.assign(p,y[1])):f=y}return yt(n,f)}function EB(t){return t.match(vB)[1].replace(bB,"'")}function bb(t,e){const n=Ko(t),i=Ko(e);return+n==+i}function SB(t,e){return ss(t,-e)}function WS(t,e){const n=Ve(t),i=n.getFullYear(),s=n.getDate(),r=yt(t,0);r.setFullYear(i,e,15),r.setHours(0,0,0,0);const o=k5(r);return n.setMonth(e,Math.min(s,o)),n}function It(t,e){let n=Ve(t);return isNaN(+n)?yt(t,NaN):(e.year!=null&&n.setFullYear(e.year),e.month!=null&&(n=WS(n,e.month)),e.date!=null&&n.setDate(e.date),e.hours!=null&&n.setHours(e.hours),e.minutes!=null&&n.setMinutes(e.minutes),e.seconds!=null&&n.setSeconds(e.seconds),e.milliseconds!=null&&n.setMilliseconds(e.milliseconds),n)}function CB(t,e){const n=Ve(t);return n.setHours(e),n}function HS(t,e){const n=Ve(t);return n.setMilliseconds(e),n}function TB(t,e){const n=Ve(t);return n.setMinutes(e),n}function YS(t,e){const n=Ve(t);return n.setSeconds(e),n}function Ts(t,e){const n=Ve(t);return isNaN(+n)?yt(t,NaN):(n.setFullYear(e),n)}function Cl(t,e){return us(t,-e)}function kB(t,e){const{years:n=0,months:i=0,weeks:s=0,days:r=0,hours:o=0,minutes:a=0,seconds:l=0}=e,c=Cl(t,i+n*12),u=SB(c,r+s*7),d=a+o*60,f=(l+d*60)*1e3;return yt(t,u.getTime()-f)}function jS(t,e){return k_(t,-e)}function Ul(){const t=TR();return D(),V("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img",...t},[g("path",{d:"M29.333 8c0-2.208-1.792-4-4-4h-18.667c-2.208 0-4 1.792-4 4v18.667c0 2.208 1.792 4 4 4h18.667c2.208 0 4-1.792 4-4v-18.667zM26.667 8v18.667c0 0.736-0.597 1.333-1.333 1.333 0 0-18.667 0-18.667 0-0.736 0-1.333-0.597-1.333-1.333 0 0 0-18.667 0-18.667 0-0.736 0.597-1.333 1.333-1.333 0 0 18.667 0 18.667 0 0.736 0 1.333 0.597 1.333 1.333z"}),g("path",{d:"M20 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),g("path",{d:"M9.333 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),g("path",{d:"M4 14.667h24c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-24c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"})])}Ul.compatConfig={MODE:3};function KS(){return D(),V("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[g("path",{d:"M23.057 7.057l-16 16c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l16-16c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0z"}),g("path",{d:"M7.057 8.943l16 16c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885l-16-16c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}KS.compatConfig={MODE:3};function D_(){return D(),V("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[g("path",{d:"M20.943 23.057l-7.057-7.057c0 0 7.057-7.057 7.057-7.057 0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-8 8c-0.521 0.521-0.521 1.365 0 1.885l8 8c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}D_.compatConfig={MODE:3};function $_(){return D(),V("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[g("path",{d:"M12.943 24.943l8-8c0.521-0.521 0.521-1.365 0-1.885l-8-8c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885l7.057 7.057c0 0-7.057 7.057-7.057 7.057-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0z"})])}$_.compatConfig={MODE:3};function L_(){return D(),V("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[g("path",{d:"M16 1.333c-8.095 0-14.667 6.572-14.667 14.667s6.572 14.667 14.667 14.667c8.095 0 14.667-6.572 14.667-14.667s-6.572-14.667-14.667-14.667zM16 4c6.623 0 12 5.377 12 12s-5.377 12-12 12c-6.623 0-12-5.377-12-12s5.377-12 12-12z"}),g("path",{d:"M14.667 8v8c0 0.505 0.285 0.967 0.737 1.193l5.333 2.667c0.658 0.329 1.46 0.062 1.789-0.596s0.062-1.46-0.596-1.789l-4.596-2.298c0 0 0-7.176 0-7.176 0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"})])}L_.compatConfig={MODE:3};function O_(){return D(),V("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[g("path",{d:"M24.943 19.057l-8-8c-0.521-0.521-1.365-0.521-1.885 0l-8 8c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l7.057-7.057c0 0 7.057 7.057 7.057 7.057 0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}O_.compatConfig={MODE:3};function N_(){return D(),V("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[g("path",{d:"M7.057 12.943l8 8c0.521 0.521 1.365 0.521 1.885 0l8-8c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-7.057 7.057c0 0-7.057-7.057-7.057-7.057-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}N_.compatConfig={MODE:3};const _i=(t,e)=>e?new Date(t.toLocaleString("en-US",{timeZone:e})):new Date(t),F_=(t,e,n)=>em(t,e,n)||xe(),AB=(t,e,n)=>{const i=e.dateInTz?_i(new Date(t),e.dateInTz):xe(t);return n?ni(i,!0):i},em=(t,e,n)=>{if(!t)return null;const i=n?ni(xe(t),!0):xe(t);return e?e.exactMatch?AB(t,e,n):_i(i,e.timezone):i},MB=t=>{if(!t)return 0;const e=new Date,n=new Date(e.toLocaleString("en-US",{timeZone:"UTC"})),i=new Date(e.toLocaleString("en-US",{timeZone:t})),s=i.getTimezoneOffset()/60;return(+n-+i)/(1e3*60*60)-s};var es=(t=>(t.month="month",t.year="year",t))(es||{}),Vo=(t=>(t.top="top",t.bottom="bottom",t))(Vo||{}),ta=(t=>(t.header="header",t.calendar="calendar",t.timePicker="timePicker",t))(ta||{}),zn=(t=>(t.month="month",t.year="year",t.calendar="calendar",t.time="time",t.minutes="minutes",t.hours="hours",t.seconds="seconds",t))(zn||{});const IB=["timestamp","date","iso"];var Xn=(t=>(t.up="up",t.down="down",t.left="left",t.right="right",t))(Xn||{}),Lt=(t=>(t.arrowUp="ArrowUp",t.arrowDown="ArrowDown",t.arrowLeft="ArrowLeft",t.arrowRight="ArrowRight",t.enter="Enter",t.space=" ",t.esc="Escape",t.tab="Tab",t.home="Home",t.end="End",t.pageUp="PageUp",t.pageDown="PageDown",t))(Lt||{});function wb(t){return e=>new Intl.DateTimeFormat(t,{weekday:"short",timeZone:"UTC"}).format(new Date(`2017-01-0${e}T00:00:00+00:00`)).slice(0,2)}function PB(t){return e=>Rs(_i(new Date(`2017-01-0${e}T00:00:00+00:00`),"UTC"),"EEEEEE",{locale:t})}const RB=(t,e,n)=>{const i=[1,2,3,4,5,6,7];let s;if(t!==null)try{s=i.map(PB(t))}catch{s=i.map(wb(e))}else s=i.map(wb(e));const r=s.slice(0,n),o=s.slice(n+1,s.length);return[s[n]].concat(...o).concat(...r)},B_=(t,e,n)=>{const i=[];for(let s=+t[0];s<=+t[1];s++)i.push({value:+s,text:qS(s,e)});return n?i.reverse():i},US=(t,e,n)=>{const i=[1,2,3,4,5,6,7,8,9,10,11,12].map(r=>{const o=r<10?`0${r}`:r;return new Date(`2017-${o}-01T00:00:00+00:00`)});if(t!==null)try{const r=n==="long"?"LLLL":"LLL";return i.map((o,a)=>{const l=Rs(_i(o,"UTC"),r,{locale:t});return{text:l.charAt(0).toUpperCase()+l.substring(1),value:a}})}catch{}const s=new Intl.DateTimeFormat(e,{month:n,timeZone:"UTC"});return i.map((r,o)=>{const a=s.format(r);return{text:a.charAt(0).toUpperCase()+a.substring(1),value:o}})},DB=t=>[12,1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11][t],mn=t=>{const e=Q(t);return e!=null&&e.$el?e?.$el:e},$B=t=>({type:"dot",...t??{}}),GS=t=>Array.isArray(t)?!!t[0]&&!!t[1]:!1,V_={prop:t=>`"${t}" prop must be enabled!`,dateArr:t=>`You need to use array as "model-value" binding in order to support "${t}"`},Tn=t=>t,xb=t=>t===0?t:!t||isNaN(+t)?null:+t,Eb=t=>t===null,XS=t=>{if(t)return[...t.querySelectorAll("input, button, select, textarea, a[href]")][0]},LB=t=>{const e=[],n=i=>i.filter(s=>s);for(let i=0;i{const i=n!=null,s=e!=null;if(!i&&!s)return!1;const r=+n,o=+e;return i&&s?+t>r||+tr:s?+tLB(t).map(n=>n.map(i=>{const{active:s,disabled:r,isBetween:o,highlighted:a}=e(i);return{...i,active:s,disabled:r,className:{dp__overlay_cell_active:s,dp__overlay_cell:!s,dp__overlay_cell_disabled:r,dp__overlay_cell_pad:!0,dp__overlay_cell_active_disabled:r&&s,dp__cell_in_between:o,"dp--highlighted":a}}})),Qr=(t,e,n=!1)=>{t&&e.allowStopPropagation&&(n&&t.stopImmediatePropagation(),t.stopPropagation())},OB=()=>["a[href]","area[href]","input:not([disabled]):not([type='hidden'])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","[tabindex]:not([tabindex='-1'])","[data-datepicker-instance]"].join(", ");function NB(t,e){let n=[...document.querySelectorAll(OB())];n=n.filter(s=>!t.contains(s)||s.hasAttribute("data-datepicker-instance"));const i=n.indexOf(t);if(i>=0&&(e?i-1>=0:i+1<=n.length))return n[i+(e?-1:1)]}const tm=(t,e)=>t?.querySelector(`[data-dp-element="${e}"]`),qS=(t,e)=>new Intl.NumberFormat(e,{useGrouping:!1,style:"decimal"}).format(t),z_=t=>Rs(t,"dd-MM-yyyy"),Rg=t=>Array.isArray(t),bh=(t,e)=>e.get(z_(t)),FB=(t,e)=>t?e?e instanceof Map?!!bh(t,e):e(xe(t)):!1:!0,Qn=(t,e,n=!1,i)=>{if(t.key===Lt.enter||t.key===Lt.space)return n&&t.preventDefault(),e();if(i)return i(t)},BB=()=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].some(t=>navigator.userAgent.includes(t))||navigator.userAgent.includes("Mac")&&"ontouchend"in document,Sb=(t,e,n,i,s,r)=>{const o=Qp(t,e.slice(0,t.length),new Date,{locale:r});return zc(o)&&IS(o)?i||s?o:It(o,{hours:+n.hours,minutes:+n?.minutes,seconds:+n?.seconds,milliseconds:0}):null},VB=(t,e,n,i,s,r)=>{const o=Array.isArray(n)?n[0]:n;if(typeof e=="string")return Sb(t,e,o,i,s,r);if(Array.isArray(e)){let a=null;for(const l of e)if(a=Sb(t,l,o,i,s,r),a)break;return a}return typeof e=="function"?e(t):null},xe=t=>t?new Date(t):new Date,zB=(t,e,n)=>{if(e){const s=(t.getMonth()+1).toString().padStart(2,"0"),r=t.getDate().toString().padStart(2,"0"),o=t.getHours().toString().padStart(2,"0"),a=t.getMinutes().toString().padStart(2,"0"),l=n?t.getSeconds().toString().padStart(2,"0"):"00";return`${t.getFullYear()}-${s}-${r}T${o}:${a}:${l}.000Z`}const i=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds());return new Date(i).toISOString()},ni=(t,e)=>{const n=xe(JSON.parse(JSON.stringify(t))),i=It(n,{hours:0,minutes:0,seconds:0,milliseconds:0});return e?$F(i):i},eo=(t,e,n,i)=>{let s=t?xe(t):xe();return(e||e===0)&&(s=CB(s,+e)),(n||n===0)&&(s=TB(s,+n)),(i||i===0)&&(s=YS(s,+i)),HS(s,0)},Xt=(t,e)=>!t||!e?!1:ou(ni(t),ni(e)),ct=(t,e)=>!t||!e?!1:Za(ni(t),ni(e)),nn=(t,e)=>!t||!e?!1:Sl(ni(t),ni(e)),mf=(t,e,n)=>t!=null&&t[0]&&t!=null&&t[1]?nn(n,t[0])&&Xt(n,t[1]):t!=null&&t[0]&&e?nn(n,t[0])&&Xt(n,e)||Xt(n,t[0])&&nn(n,e):!1,rs=t=>{const e=It(new Date(t),{date:1});return ni(e)},Dg=(t,e,n)=>e&&(n||n===0)?Object.fromEntries(["hours","minutes","seconds"].map(i=>i===e?[i,n]:[i,isNaN(+t[i])?void 0:+t[i]])):{hours:isNaN(+t.hours)?void 0:+t.hours,minutes:isNaN(+t.minutes)?void 0:+t.minutes,seconds:isNaN(+t.seconds)?void 0:+t.seconds},na=t=>({hours:pr(t),minutes:oo(t),seconds:El(t)}),ZS=(t,e)=>{if(e){const n=Ge(xe(e));if(n>t)return 12;if(n===t)return at(xe(e))}},JS=(t,e)=>{if(e){const n=Ge(xe(e));return n{if(t)return Ge(xe(t))},QS=(t,e)=>{const n=nn(t,e)?e:t,i=nn(e,t)?e:t;return PS({start:n,end:i})},WB=t=>{const e=us(t,1);return{month:at(e),year:Ge(e)}},er=(t,e)=>{const n=fs(t,{weekStartsOn:+e}),i=DS(t,{weekStartsOn:+e});return[n,i]},eC=(t,e)=>{const n={hours:pr(xe()),minutes:oo(xe()),seconds:e?El(xe()):0};return Object.assign(n,t)},Yr=(t,e,n)=>[It(xe(t),{date:1}),It(xe(),{month:e,year:n,date:1})],sr=(t,e,n)=>{let i=t?xe(t):xe();return(e||e===0)&&(i=WS(i,e)),n&&(i=Ts(i,n)),i},tC=(t,e,n,i,s)=>{if(!i||s&&!e||!s&&!n)return!1;const r=s?us(t,1):Cl(t,1),o=[at(r),Ge(r)];return s?!YB(...o,e):!HB(...o,n)},HB=(t,e,n)=>Xt(...Yr(n,t,e))||ct(...Yr(n,t,e)),YB=(t,e,n)=>nn(...Yr(n,t,e))||ct(...Yr(n,t,e)),nC=(t,e,n,i,s,r,o)=>{if(typeof e=="function"&&!o)return e(t);const a=n?{locale:n}:void 0;return Array.isArray(t)?`${Rs(t[0],r,a)}${s&&!t[1]?"":i}${t[1]?Rs(t[1],r,a):""}`:Rs(t,r,a)},Ra=t=>{if(t)return null;throw new Error(V_.prop("partial-range"))},wd=(t,e)=>{if(e)return t();throw new Error(V_.prop("range"))},nm=t=>Array.isArray(t)?zc(t[0])&&(t[1]?zc(t[1]):!0):t?zc(t):!1,jB=(t,e)=>It(e??xe(),{hours:+t.hours||0,minutes:+t.minutes||0,seconds:+t.seconds||0}),$g=(t,e,n,i)=>{if(!t)return!0;if(i){const s=n==="max"?ou(t,e):Sl(t,e),r={seconds:0,milliseconds:0};return s||Za(It(t,r),It(e,r))}return n==="max"?t.getTime()<=e.getTime():t.getTime()>=e.getTime()},Lg=(t,e,n)=>t?jB(t,e):xe(n??e),Cb=(t,e,n,i,s)=>{if(Array.isArray(i)){const o=Lg(t,i[0],e),a=Lg(t,i[1],e);return $g(i[0],o,n,!!e)&&$g(i[1],a,n,!!e)&&s}const r=Lg(t,i,e);return $g(i,r,n,!!e)&&s},Og=t=>It(xe(),na(t)),KB=(t,e)=>t instanceof Map?Array.from(t.values()).filter(n=>Ge(xe(n))===e).map(n=>at(n)):[],iC=(t,e,n)=>typeof t=="function"?t({month:e,year:n}):!!t.months.find(i=>i.month===e&&i.year===n),W_=(t,e)=>typeof t=="function"?t(e):t.years.includes(e),sC=t=>Rs(t,"yyyy-MM-dd"),cc=Ns({menuFocused:!1,shiftKeyInMenu:!1}),rC=()=>{const t=n=>{cc.menuFocused=n},e=n=>{cc.shiftKeyInMenu!==n&&(cc.shiftKeyInMenu=n)};return{control:be(()=>({shiftKeyInMenu:cc.shiftKeyInMenu,menuFocused:cc.menuFocused})),setMenuFocused:t,setShiftKey:e}},$t=Ns({monthYear:[],calendar:[],time:[],actionRow:[],selectionGrid:[],timePicker:{0:[],1:[]},monthPicker:[]}),Ng=we(null),xd=we(!1),Fg=we(!1),Bg=we(!1),Vg=we(!1),Nn=we(0),tn=we(0),mo=()=>{const t=be(()=>xd.value?[...$t.selectionGrid,$t.actionRow].filter(d=>d.length):Fg.value?[...$t.timePicker[0],...$t.timePicker[1],Vg.value?[]:[Ng.value],$t.actionRow].filter(d=>d.length):Bg.value?[...$t.monthPicker,$t.actionRow]:[$t.monthYear,...$t.calendar,$t.time,$t.actionRow].filter(d=>d.length)),e=d=>{Nn.value=d?Nn.value+1:Nn.value-1;let h=null;t.value[tn.value]&&(h=t.value[tn.value][Nn.value]),!h&&t.value[tn.value+(d?1:-1)]?(tn.value=tn.value+(d?1:-1),Nn.value=d?0:t.value[tn.value].length-1):h||(Nn.value=d?Nn.value-1:Nn.value+1)},n=d=>{tn.value===0&&!d||tn.value===t.value.length&&d||(tn.value=d?tn.value+1:tn.value-1,t.value[tn.value]?t.value[tn.value]&&!t.value[tn.value][Nn.value]&&Nn.value!==0&&(Nn.value=t.value[tn.value].length-1):tn.value=d?tn.value-1:tn.value+1)},i=d=>{let h=null;t.value[tn.value]&&(h=t.value[tn.value][Nn.value]),h?h.focus({preventScroll:!xd.value}):Nn.value=d?Nn.value-1:Nn.value+1},s=()=>{e(!0),i(!0)},r=()=>{e(!1),i(!1)},o=()=>{n(!1),i(!0)},a=()=>{n(!0),i(!0)},l=(d,h)=>{$t[h]=d},c=(d,h)=>{$t[h]=d},u=()=>{Nn.value=0,tn.value=0};return{buildMatrix:l,buildMultiLevelMatrix:c,setTimePickerBackRef:d=>{Ng.value=d},setSelectionGrid:d=>{xd.value=d,u(),d||($t.selectionGrid=[])},setTimePicker:(d,h=!1)=>{Fg.value=d,Vg.value=h,u(),d||($t.timePicker[0]=[],$t.timePicker[1]=[])},setTimePickerElements:(d,h=0)=>{$t.timePicker[h]=d},arrowRight:s,arrowLeft:r,arrowUp:o,arrowDown:a,clearArrowNav:()=>{$t.monthYear=[],$t.calendar=[],$t.time=[],$t.actionRow=[],$t.selectionGrid=[],$t.timePicker[0]=[],$t.timePicker[1]=[],xd.value=!1,Fg.value=!1,Vg.value=!1,Bg.value=!1,u(),Ng.value=null},setMonthPicker:d=>{Bg.value=d,u()},refSets:$t}},Tb=t=>({menuAppearTop:"dp-menu-appear-top",menuAppearBottom:"dp-menu-appear-bottom",open:"dp-slide-down",close:"dp-slide-up",next:"calendar-next",previous:"calendar-prev",vNext:"dp-slide-up",vPrevious:"dp-slide-down",...t??{}}),UB=t=>({toggleOverlay:"Toggle overlay",menu:"Datepicker menu",input:"Datepicker input",openTimePicker:"Open time picker",closeTimePicker:"Close time Picker",incrementValue:e=>`Increment ${e}`,decrementValue:e=>`Decrement ${e}`,openTpOverlay:e=>`Open ${e} overlay`,amPmButton:"Switch AM/PM mode",openYearsOverlay:"Open years overlay",openMonthsOverlay:"Open months overlay",nextMonth:"Next month",prevMonth:"Previous month",nextYear:"Next year",prevYear:"Previous year",day:void 0,weekDay:void 0,clearInput:"Clear value",calendarIcon:"Calendar icon",timePicker:"Time picker",monthPicker:e=>`Month picker${e?" overlay":""}`,yearPicker:e=>`Year picker${e?" overlay":""}`,timeOverlay:e=>`${e} overlay`,...t??{}}),kb=t=>t?typeof t=="boolean"?t?2:0:+t>=2?+t:2:0,GB=t=>{const e=typeof t=="object"&&t,n={static:!0,solo:!1};if(!t)return{...n,count:kb(!1)};const i=e?t:{},s=e?i.count??!0:t,r=kb(s);return Object.assign(n,i,{count:r})},XB=(t,e,n)=>t||(typeof n=="string"?n:e),qB=t=>typeof t=="boolean"?t?Tb({}):!1:Tb(t),ZB=t=>{const e={enterSubmit:!0,tabSubmit:!0,openMenu:"open",selectOnFocus:!1,rangeSeparator:" - "};return typeof t=="object"?{...e,...t??{},enabled:!0}:{...e,enabled:t}},JB=t=>({months:[],years:[],times:{hours:[],minutes:[],seconds:[]},...t??{}}),QB=t=>({showSelect:!0,showCancel:!0,showNow:!1,showPreview:!0,...t??{}}),e4=t=>{const e={input:!1};return typeof t=="object"?{...e,...t??{},enabled:!0}:{enabled:t,...e}},t4=t=>({allowStopPropagation:!0,closeOnScroll:!1,modeHeight:255,allowPreventDefault:!1,closeOnClearValue:!0,closeOnAutoApply:!0,noSwipe:!1,keepActionRow:!1,onClickOutside:void 0,tabOutClosesMenu:!0,arrowLeft:void 0,keepViewOnOffsetClick:!1,timeArrowHoldThreshold:0,shadowDom:!1,...t??{}}),n4=t=>{const e={dates:Array.isArray(t)?t.map(n=>xe(n)):[],years:[],months:[],quarters:[],weeks:[],weekdays:[],options:{highlightDisabled:!1}};return typeof t=="function"?t:{...e,...t??{}}},i4=t=>typeof t=="object"?{type:t?.type??"local",hideOnOffsetDates:t?.hideOnOffsetDates??!1}:{type:t,hideOnOffsetDates:!1},s4=t=>{const e={noDisabledRange:!1,showLastInRange:!0,minMaxRawRange:!1,partialRange:!0,disableTimeRangeValidation:!1,maxRange:void 0,minRange:void 0,autoRange:void 0,fixedStart:!1,fixedEnd:!1};return typeof t=="object"?{enabled:!0,...e,...t}:{enabled:t,...e}},r4=t=>t?typeof t=="string"?{timezone:t,exactMatch:!1,dateInTz:void 0,emitTimezone:void 0,convertModel:!0}:{timezone:t.timezone,exactMatch:t.exactMatch??!1,dateInTz:t.dateInTz??void 0,emitTimezone:t.emitTimezone??void 0,convertModel:t.convertModel??!0}:{timezone:void 0,exactMatch:!1,emitTimezone:void 0},zg=(t,e,n)=>new Map(t.map(i=>{const s=F_(i,e,n);return[z_(s),s]})),o4=(t,e)=>t.length?new Map(t.map(n=>{const i=F_(n.date,e);return[z_(i),n]})):null,a4=t=>{var e;return{minDate:em(t.minDate,t.timezone,t.isSpecific),maxDate:em(t.maxDate,t.timezone,t.isSpecific),disabledDates:Rg(t.disabledDates)?zg(t.disabledDates,t.timezone,t.isSpecific):t.disabledDates,allowedDates:Rg(t.allowedDates)?zg(t.allowedDates,t.timezone,t.isSpecific):null,highlight:typeof t.highlight=="object"&&Rg((e=t.highlight)==null?void 0:e.dates)?zg(t.highlight.dates,t.timezone):t.highlight,markers:o4(t.markers,t.timezone)}},l4=t=>typeof t=="boolean"?{enabled:t,dragSelect:!0,limit:null}:{enabled:!!t,limit:t.limit?+t.limit:null,dragSelect:t.dragSelect??!0},c4=t=>({...Object.fromEntries(Object.keys(t).map(e=>{const n=e,i=t[n],s=typeof t[n]=="string"?{[i]:!0}:Object.fromEntries(i.map(r=>[r,!0]));return[e,s]}))}),Wt=t=>{const e=()=>{const x=t.enableSeconds?":ss":"",T=t.enableMinutes?":mm":"";return t.is24?`HH${T}${x}`:`hh${T}${x} aa`},n=()=>{var x;return t.format?t.format:t.monthPicker?"MM/yyyy":t.timePicker?e():t.weekPicker?`${((x=y.value)==null?void 0:x.type)==="iso"?"RR":"ww"}-yyyy`:t.yearPicker?"yyyy":t.quarterPicker?"QQQ/yyyy":t.enableTimePicker?`MM/dd/yyyy, ${e()}`:"MM/dd/yyyy"},i=x=>eC(x,t.enableSeconds),s=()=>C.value.enabled?t.startTime&&Array.isArray(t.startTime)?[i(t.startTime[0]),i(t.startTime[1])]:null:t.startTime&&!Array.isArray(t.startTime)?i(t.startTime):null,r=be(()=>GB(t.multiCalendars)),o=be(()=>s()),a=be(()=>UB(t.ariaLabels)),l=be(()=>JB(t.filters)),c=be(()=>qB(t.transitions)),u=be(()=>QB(t.actionRow)),d=be(()=>XB(t.previewFormat,t.format,n())),h=be(()=>ZB(t.textInput)),f=be(()=>e4(t.inline)),p=be(()=>t4(t.config)),m=be(()=>n4(t.highlight)),y=be(()=>i4(t.weekNumbers)),v=be(()=>r4(t.timezone)),b=be(()=>l4(t.multiDates)),E=be(()=>a4({minDate:t.minDate,maxDate:t.maxDate,disabledDates:t.disabledDates,allowedDates:t.allowedDates,highlight:m.value,markers:t.markers,timezone:v.value,isSpecific:t.monthPicker||t.yearPicker||t.quarterPicker})),C=be(()=>s4(t.range)),w=be(()=>c4(t.ui));return{defaultedTransitions:c,defaultedMultiCalendars:r,defaultedStartTime:o,defaultedAriaLabels:a,defaultedFilters:l,defaultedActionRow:u,defaultedPreviewFormat:d,defaultedTextInput:h,defaultedInline:f,defaultedConfig:p,defaultedHighlight:m,defaultedWeekNumbers:y,defaultedRange:C,propDates:E,defaultedTz:v,defaultedMultiDates:b,defaultedUI:w,getDefaultPattern:n,getDefaultStartTime:s}},u4=(t,e,n)=>{const i=we(),{defaultedTextInput:s,defaultedRange:r,defaultedTz:o,defaultedMultiDates:a,getDefaultPattern:l}=Wt(e),c=we(""),u=Zc(e,"format"),d=Zc(e,"formatLocale");fn(i,()=>{typeof e.onInternalModelChange=="function"&&t("internal-model-change",i.value,le(!0))},{deep:!0}),fn(r,($,oe)=>{$.enabled!==oe.enabled&&(i.value=null)}),fn(u,()=>{X()});const h=$=>o.value.timezone&&o.value.convertModel?_i($,o.value.timezone):$,f=$=>{if(o.value.timezone&&o.value.convertModel){const oe=MB(o.value.timezone);return kF($,oe)}return $},p=($,oe,de=!1)=>nC($,e.format,e.formatLocale,s.value.rangeSeparator,e.modelAuto,oe??l(),de),m=$=>$?e.modelType?ne($):{hours:pr($),minutes:oo($),seconds:e.enableSeconds?El($):0}:null,y=$=>e.modelType?ne($):{month:at($),year:Ge($)},v=$=>Array.isArray($)?a.value.enabled?$.map(oe=>b(oe,Ts(xe(),oe))):wd(()=>[Ts(xe(),$[0]),$[1]?Ts(xe(),$[1]):Ra(r.value.partialRange)],r.value.enabled):Ts(xe(),+$),b=($,oe)=>(typeof $=="string"||typeof $=="number")&&e.modelType?J($):oe,E=$=>Array.isArray($)?[b($[0],eo(null,+$[0].hours,+$[0].minutes,$[0].seconds)),b($[1],eo(null,+$[1].hours,+$[1].minutes,$[1].seconds))]:b($,eo(null,$.hours,$.minutes,$.seconds)),C=$=>{const oe=It(xe(),{date:1});return Array.isArray($)?a.value.enabled?$.map(de=>b(de,sr(oe,+de.month,+de.year))):wd(()=>[b($[0],sr(oe,+$[0].month,+$[0].year)),b($[1],$[1]?sr(oe,+$[1].month,+$[1].year):Ra(r.value.partialRange))],r.value.enabled):b($,sr(oe,+$.month,+$.year))},w=$=>{if(Array.isArray($))return $.map(oe=>J(oe));throw new Error(V_.dateArr("multi-dates"))},x=$=>{if(Array.isArray($)&&r.value.enabled){const oe=$[0],de=$[1];return[xe(Array.isArray(oe)?oe[0]:null),xe(Array.isArray(de)?de[0]:null)]}return xe($[0])},T=$=>e.modelAuto?Array.isArray($)?[J($[0]),J($[1])]:e.autoApply?[J($)]:[J($),null]:Array.isArray($)?wd(()=>$[1]?[J($[0]),$[1]?J($[1]):Ra(r.value.partialRange)]:[J($[0])],r.value.enabled):J($),k=()=>{Array.isArray(i.value)&&r.value.enabled&&i.value.length===1&&i.value.push(Ra(r.value.partialRange))},A=()=>{const $=i.value;return[ne($[0]),$[1]?ne($[1]):Ra(r.value.partialRange)]},P=()=>i.value[1]?A():ne(Tn(i.value[0])),F=()=>(i.value||[]).map($=>ne($)),H=($=!1)=>($||k(),e.modelAuto?P():a.value.enabled?F():Array.isArray(i.value)?wd(()=>A(),r.value.enabled):ne(Tn(i.value))),te=$=>!$||Array.isArray($)&&!$.length?null:e.timePicker?E(Tn($)):e.monthPicker?C(Tn($)):e.yearPicker?v(Tn($)):a.value.enabled?w(Tn($)):e.weekPicker?x(Tn($)):T(Tn($)),N=$=>{const oe=te($);nm(Tn(oe))?(i.value=Tn(oe),X()):(i.value=null,c.value="")},L=()=>{const $=oe=>Rs(oe,s.value.format);return`${$(i.value[0])} ${s.value.rangeSeparator} ${i.value[1]?$(i.value[1]):""}`},I=()=>n.value&&i.value?Array.isArray(i.value)?L():Rs(i.value,s.value.format):p(i.value),W=()=>i.value?a.value.enabled?i.value.map($=>p($)).join("; "):s.value.enabled&&typeof s.value.format=="string"?I():p(i.value):"",X=()=>{!e.format||typeof e.format=="string"||s.value.enabled&&typeof s.value.format=="string"?c.value=W():c.value=e.format(i.value)},J=$=>{if(e.utc){const oe=new Date($);return e.utc==="preserve"?new Date(oe.getTime()+oe.getTimezoneOffset()*6e4):oe}return e.modelType?IB.includes(e.modelType)?h(new Date($)):e.modelType==="format"&&(typeof e.format=="string"||!e.format)?h(Qp($,l(),new Date,{locale:d.value})):h(Qp($,e.modelType,new Date,{locale:d.value})):h(new Date($))},ne=$=>$?e.utc?zB($,e.utc==="preserve",e.enableSeconds):e.modelType?e.modelType==="timestamp"?+f($):e.modelType==="iso"?f($).toISOString():e.modelType==="format"&&(typeof e.format=="string"||!e.format)?p(f($)):p(f($),e.modelType,!0):f($):"",ue=($,oe=!1,de=!1)=>{if(de)return $;if(t("update:model-value",$),o.value.emitTimezone&&oe){const ve=Array.isArray($)?$.map(z=>_i(Tn(z),o.value.emitTimezone)):_i(Tn($),o.value.emitTimezone);t("update:model-timezone-value",ve)}},Y=$=>Array.isArray(i.value)?a.value.enabled?i.value.map(oe=>$(oe)):[$(i.value[0]),i.value[1]?$(i.value[1]):Ra(r.value.partialRange)]:$(Tn(i.value)),Z=()=>{if(Array.isArray(i.value)){const $=er(i.value[0],e.weekStart),oe=i.value[1]?er(i.value[1],e.weekStart):[];return[$.map(de=>xe(de)),oe.map(de=>xe(de))]}return er(i.value,e.weekStart).map($=>xe($))},M=($,oe)=>ue(Tn(Y($)),!1,oe),ie=$=>{const oe=Z();return $?oe:t("update:model-value",Z())},le=($=!1)=>($||X(),e.monthPicker?M(y,$):e.timePicker?M(m,$):e.yearPicker?M(Ge,$):e.weekPicker?ie($):ue(H($),!0,$));return{inputValue:c,internalModelValue:i,checkBeforeEmit:()=>i.value?r.value.enabled?r.value.partialRange?i.value.length>=1:i.value.length===2:!!i.value:!1,parseExternalModelValue:N,formatInputValue:X,emitModelValue:le}},d4=(t,e)=>{const{defaultedFilters:n,propDates:i}=Wt(t),{validateMonthYearInRange:s}=_o(t),r=(u,d)=>{let h=u;return n.value.months.includes(at(h))?(h=d?us(u,1):Cl(u,1),r(h,d)):h},o=(u,d)=>{let h=u;return n.value.years.includes(Ge(h))?(h=d?k_(u,1):jS(u,1),o(h,d)):h},a=(u,d=!1)=>{const h=It(xe(),{month:t.month,year:t.year});let f=u?us(h,1):Cl(h,1);t.disableYearSelect&&(f=Ts(f,t.year));let p=at(f),m=Ge(f);n.value.months.includes(p)&&(f=r(f,u),p=at(f),m=Ge(f)),n.value.years.includes(m)&&(f=o(f,u),m=Ge(f)),s(p,m,u,t.preventMinMaxNavigation)&&l(p,m,d)},l=(u,d,h)=>{e("update-month-year",{month:u,year:d,fromNav:h})},c=be(()=>u=>tC(It(xe(),{month:t.month,year:t.year}),i.value.maxDate,i.value.minDate,t.preventMinMaxNavigation,u));return{handleMonthYearChange:a,isDisabled:c,updateMonthYear:l}},_f={multiCalendars:{type:[Boolean,Number,String,Object],default:void 0},modelValue:{type:[String,Date,Array,Object,Number],default:null},modelType:{type:String,default:null},position:{type:String,default:"center"},dark:{type:Boolean,default:!1},format:{type:[String,Function],default:()=>null},autoPosition:{type:Boolean,default:!0},altPosition:{type:Function,default:null},transitions:{type:[Boolean,Object],default:!0},formatLocale:{type:Object,default:null},utc:{type:[Boolean,String],default:!1},ariaLabels:{type:Object,default:()=>({})},offset:{type:[Number,String],default:10},hideNavigation:{type:Array,default:()=>[]},timezone:{type:[String,Object],default:null},vertical:{type:Boolean,default:!1},disableMonthYearSelect:{type:Boolean,default:!1},disableYearSelect:{type:Boolean,default:!1},dayClass:{type:Function,default:null},yearRange:{type:Array,default:()=>[1900,2100]},enableTimePicker:{type:Boolean,default:!0},autoApply:{type:Boolean,default:!1},disabledDates:{type:[Array,Function],default:()=>[]},monthNameFormat:{type:String,default:"short"},startDate:{type:[Date,String],default:null},startTime:{type:[Object,Array],default:null},hideOffsetDates:{type:Boolean,default:!1},noToday:{type:Boolean,default:!1},disabledWeekDays:{type:Array,default:()=>[]},allowedDates:{type:Array,default:null},nowButtonLabel:{type:String,default:"Now"},markers:{type:Array,default:()=>[]},escClose:{type:Boolean,default:!0},spaceConfirm:{type:Boolean,default:!0},monthChangeOnArrows:{type:Boolean,default:!0},presetDates:{type:Array,default:()=>[]},flow:{type:Array,default:()=>[]},partialFlow:{type:Boolean,default:!1},preventMinMaxNavigation:{type:Boolean,default:!1},reverseYears:{type:Boolean,default:!1},weekPicker:{type:Boolean,default:!1},filters:{type:Object,default:()=>({})},arrowNavigation:{type:Boolean,default:!1},highlight:{type:[Function,Object],default:null},teleport:{type:[Boolean,String,Object],default:null},teleportCenter:{type:Boolean,default:!1},locale:{type:String,default:"en-Us"},weekNumName:{type:String,default:"W"},weekStart:{type:[Number,String],default:1},weekNumbers:{type:[String,Function,Object],default:null},monthChangeOnScroll:{type:[Boolean,String],default:!0},dayNames:{type:[Function,Array],default:null},monthPicker:{type:Boolean,default:!1},customProps:{type:Object,default:null},yearPicker:{type:Boolean,default:!1},modelAuto:{type:Boolean,default:!1},selectText:{type:String,default:"Select"},cancelText:{type:String,default:"Cancel"},previewFormat:{type:[String,Function],default:()=>""},multiDates:{type:[Object,Boolean],default:!1},ignoreTimeValidation:{type:Boolean,default:!1},minDate:{type:[Date,String],default:null},maxDate:{type:[Date,String],default:null},minTime:{type:Object,default:null},maxTime:{type:Object,default:null},name:{type:String,default:null},placeholder:{type:String,default:""},hideInputIcon:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},state:{type:Boolean,default:null},required:{type:Boolean,default:!1},autocomplete:{type:String,default:"off"},timePicker:{type:Boolean,default:!1},enableSeconds:{type:Boolean,default:!1},is24:{type:Boolean,default:!0},noHoursOverlay:{type:Boolean,default:!1},noMinutesOverlay:{type:Boolean,default:!1},noSecondsOverlay:{type:Boolean,default:!1},hoursGridIncrement:{type:[String,Number],default:1},minutesGridIncrement:{type:[String,Number],default:5},secondsGridIncrement:{type:[String,Number],default:5},hoursIncrement:{type:[Number,String],default:1},minutesIncrement:{type:[Number,String],default:1},secondsIncrement:{type:[Number,String],default:1},range:{type:[Boolean,Object],default:!1},uid:{type:String,default:null},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},inline:{type:[Boolean,Object],default:!1},textInput:{type:[Boolean,Object],default:!1},sixWeeks:{type:[Boolean,String],default:!1},actionRow:{type:Object,default:()=>({})},focusStartDate:{type:Boolean,default:!1},disabledTimes:{type:[Function,Array],default:void 0},timePickerInline:{type:Boolean,default:!1},calendar:{type:Function,default:null},config:{type:Object,default:void 0},quarterPicker:{type:Boolean,default:!1},yearFirst:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},onInternalModelChange:{type:[Function,Object],default:null},enableMinutes:{type:Boolean,default:!0},ui:{type:Object,default:()=>({})}},ps={..._f,shadow:{type:Boolean,default:!1},flowStep:{type:Number,default:0},internalModelValue:{type:[Date,Array],default:null},noOverlayFocus:{type:Boolean,default:!1},collapse:{type:Boolean,default:!1},menuWrapRef:{type:Object,default:null},getInputRect:{type:Function,default:()=>({})},isTextInputDate:{type:Boolean,default:!1}},h4=["title"],f4=["disabled"],g4=cn({compatConfig:{MODE:3},__name:"ActionRow",props:{menuMount:{type:Boolean,default:!1},calendarWidth:{type:Number,default:0},...ps},emits:["close-picker","select-date","select-now","invalid-select"],setup(t,{emit:e}){const n=e,i=t,{defaultedActionRow:s,defaultedPreviewFormat:r,defaultedMultiCalendars:o,defaultedTextInput:a,defaultedInline:l,defaultedRange:c,defaultedMultiDates:u,getDefaultPattern:d}=Wt(i),{isTimeValid:h,isMonthValid:f}=_o(i),{buildMatrix:p}=mo(),m=we(null),y=we(null),v=we(!1),b=we({}),E=we(null),C=we(null);xn(()=>{i.arrowNavigation&&p([mn(m),mn(y)],"actionRow"),w(),window.addEventListener("resize",w)}),Yl(()=>{window.removeEventListener("resize",w)});const w=()=>{v.value=!1,setTimeout(()=>{var L,I;const W=(L=E.value)==null?void 0:L.getBoundingClientRect(),X=(I=C.value)==null?void 0:I.getBoundingClientRect();W&&X&&(b.value.maxWidth=`${X.width-W.width-20}px`),v.value=!0},0)},x=be(()=>c.value.enabled&&!c.value.partialRange&&i.internalModelValue?i.internalModelValue.length===2:!0),T=be(()=>!h.value(i.internalModelValue)||!f.value(i.internalModelValue)||!x.value),k=()=>{const L=r.value;return i.timePicker||i.monthPicker,L(Tn(i.internalModelValue))},A=()=>{const L=i.internalModelValue;return o.value.count>0?`${P(L[0])} - ${P(L[1])}`:[P(L[0]),P(L[1])]},P=L=>nC(L,r.value,i.formatLocale,a.value.rangeSeparator,i.modelAuto,d()),F=be(()=>!i.internalModelValue||!i.menuMount?"":typeof r.value=="string"?Array.isArray(i.internalModelValue)?i.internalModelValue.length===2&&i.internalModelValue[1]?A():u.value.enabled?i.internalModelValue.map(L=>`${P(L)}`):i.modelAuto?`${P(i.internalModelValue[0])}`:`${P(i.internalModelValue[0])} -`:P(i.internalModelValue):k()),H=()=>u.value.enabled?"; ":" - ",te=be(()=>Array.isArray(F.value)?F.value.join(H()):F.value),N=()=>{h.value(i.internalModelValue)&&f.value(i.internalModelValue)&&x.value?n("select-date"):n("invalid-select")};return(L,I)=>(D(),V("div",{ref_key:"actionRowRef",ref:C,class:"dp__action_row"},[L.$slots["action-row"]?Oe(L.$slots,"action-row",In(yn({key:0},{internalModelValue:L.internalModelValue,disabled:T.value,selectDate:()=>L.$emit("select-date"),closePicker:()=>L.$emit("close-picker")}))):(D(),V($e,{key:1},[Q(s).showPreview?(D(),V("div",{key:0,class:"dp__selection_preview",title:te.value,style:Mn(b.value)},[L.$slots["action-preview"]&&v.value?Oe(L.$slots,"action-preview",{key:0,value:L.internalModelValue}):ce("",!0),!L.$slots["action-preview"]&&v.value?(D(),V($e,{key:1},[He(Ee(te.value),1)],64)):ce("",!0)],12,h4)):ce("",!0),g("div",{ref_key:"actionBtnContainer",ref:E,class:"dp__action_buttons","data-dp-element":"action-row"},[L.$slots["action-buttons"]?Oe(L.$slots,"action-buttons",{key:0,value:L.internalModelValue}):ce("",!0),L.$slots["action-buttons"]?ce("",!0):(D(),V($e,{key:1},[!Q(l).enabled&&Q(s).showCancel?(D(),V("button",{key:0,ref_key:"cancelButtonRef",ref:m,type:"button",class:"dp__action_button dp__action_cancel",onClick:I[0]||(I[0]=W=>L.$emit("close-picker")),onKeydown:I[1]||(I[1]=W=>Q(Qn)(W,()=>L.$emit("close-picker")))},Ee(L.cancelText),545)):ce("",!0),Q(s).showNow?(D(),V("button",{key:1,type:"button",class:"dp__action_button dp__action_cancel",onClick:I[2]||(I[2]=W=>L.$emit("select-now")),onKeydown:I[3]||(I[3]=W=>Q(Qn)(W,()=>L.$emit("select-now")))},Ee(L.nowButtonLabel),33)):ce("",!0),Q(s).showSelect?(D(),V("button",{key:2,ref_key:"selectButtonRef",ref:y,type:"button",class:"dp__action_button dp__action_select",disabled:T.value,"data-test":"select-button",onKeydown:I[4]||(I[4]=W=>Q(Qn)(W,()=>N())),onClick:N},Ee(L.selectText),41,f4)):ce("",!0)],64))],512)],64))],512))}}),p4=["role","aria-label","tabindex"],m4={class:"dp__selection_grid_header"},_4=["aria-selected","aria-disabled","data-test","onClick","onKeydown","onMouseover"],y4=["aria-label"],Ou=cn({__name:"SelectionOverlay",props:{items:{},type:{},isLast:{type:Boolean},arrowNavigation:{type:Boolean},skipButtonRef:{type:Boolean},headerRefs:{},hideNavigation:{},escClose:{type:Boolean},useRelative:{type:Boolean},height:{},textInput:{type:[Boolean,Object]},config:{},noOverlayFocus:{type:Boolean},focusValue:{},menuWrapRef:{},ariaLabels:{},overlayLabel:{}},emits:["selected","toggle","reset-flow","hover-value"],setup(t,{expose:e,emit:n}){const{setSelectionGrid:i,buildMultiLevelMatrix:s,setMonthPicker:r}=mo(),o=n,a=t,{defaultedAriaLabels:l,defaultedTextInput:c,defaultedConfig:u}=Wt(a),{hideNavigationButtons:d}=bf(),h=we(!1),f=we(null),p=we(null),m=we([]),y=we(),v=we(null),b=we(0),E=we(null);gE(()=>{f.value=null}),xn(()=>{Rn().then(()=>F()),a.noOverlayFocus||w(),C(!0)}),Yl(()=>C(!1));const C=Y=>{var Z;a.arrowNavigation&&((Z=a.headerRefs)!=null&&Z.length?r(Y):i(Y))},w=()=>{var Y;const Z=mn(p);Z&&(c.value.enabled||(f.value?(Y=f.value)==null||Y.focus({preventScroll:!0}):Z.focus({preventScroll:!0})),h.value=Z.clientHeight({dp__overlay:!0,"dp--overlay-absolute":!a.useRelative,"dp--overlay-relative":a.useRelative})),T=be(()=>a.useRelative?{height:`${a.height}px`,width:"260px"}:void 0),k=be(()=>({dp__overlay_col:!0})),A=be(()=>({dp__btn:!0,dp__button:!0,dp__overlay_action:!0,dp__over_action_scroll:h.value,dp__button_bottom:a.isLast})),P=be(()=>{var Y,Z;return{dp__overlay_container:!0,dp__container_flex:((Y=a.items)==null?void 0:Y.length)<=6,dp__container_block:((Z=a.items)==null?void 0:Z.length)>6}});fn(()=>a.items,()=>F(!1),{deep:!0});const F=(Y=!0)=>{Rn().then(()=>{const Z=mn(f),M=mn(p),ie=mn(v),le=mn(E),$=ie?ie.getBoundingClientRect().height:0;M&&(M.getBoundingClientRect().height?b.value=M.getBoundingClientRect().height-$:b.value=u.value.modeHeight-$),Z&&le&&Y&&(le.scrollTop=Z.offsetTop-le.offsetTop-(b.value/2-Z.getBoundingClientRect().height)-$)})},H=Y=>{Y.disabled||o("selected",Y.value)},te=()=>{o("toggle"),o("reset-flow")},N=()=>{a.escClose&&te()},L=(Y,Z,M,ie)=>{Y&&((Z.active||Z.value===a.focusValue)&&(f.value=Y),a.arrowNavigation&&(Array.isArray(m.value[M])?m.value[M][ie]=Y:m.value[M]=[Y],I()))},I=()=>{var Y,Z;const M=(Y=a.headerRefs)!=null&&Y.length?[a.headerRefs].concat(m.value):m.value.concat([a.skipButtonRef?[]:[v.value]]);s(Tn(M),(Z=a.headerRefs)!=null&&Z.length?"monthPicker":"selectionGrid")},W=Y=>{a.arrowNavigation||Qr(Y,u.value,!0)},X=Y=>{y.value=Y,o("hover-value",Y)},J=()=>{if(te(),!a.isLast){const Y=tm(a.menuWrapRef??null,"action-row");if(Y){const Z=XS(Y);Z?.focus()}}},ne=Y=>{switch(Y.key){case Lt.esc:return N();case Lt.arrowLeft:return W(Y);case Lt.arrowRight:return W(Y);case Lt.arrowUp:return W(Y);case Lt.arrowDown:return W(Y);default:return}},ue=Y=>{if(Y.key===Lt.enter)return te();if(Y.key===Lt.tab)return J()};return e({focusGrid:w}),(Y,Z)=>{var M;return D(),V("div",{ref_key:"gridWrapRef",ref:p,class:Ie(x.value),style:Mn(T.value),role:Y.useRelative?void 0:"dialog","aria-label":Y.overlayLabel,tabindex:Y.useRelative?void 0:"0",onKeydown:ne,onClick:Z[0]||(Z[0]=iu(()=>{},["prevent"]))},[g("div",{ref_key:"containerRef",ref:E,class:Ie(P.value),style:Mn({"--dp-overlay-height":`${b.value}px`}),role:"grid"},[g("div",m4,[Oe(Y.$slots,"header")]),Y.$slots.overlay?Oe(Y.$slots,"overlay",{key:0}):(D(!0),V($e,{key:1},Xe(Y.items,(ie,le)=>(D(),V("div",{key:le,class:Ie(["dp__overlay_row",{dp__flex_row:Y.items.length>=3}]),role:"row"},[(D(!0),V($e,null,Xe(ie,($,oe)=>(D(),V("div",{key:$.value,ref_for:!0,ref:de=>L(de,$,le,oe),role:"gridcell",class:Ie(k.value),"aria-selected":$.active||void 0,"aria-disabled":$.disabled||void 0,tabindex:"0","data-test":$.text,onClick:iu(de=>H($),["prevent"]),onKeydown:de=>Q(Qn)(de,()=>H($),!0),onMouseover:de=>X($.value)},[g("div",{class:Ie($.className)},[Y.$slots.item?Oe(Y.$slots,"item",{key:0,item:$}):ce("",!0),Y.$slots.item?ce("",!0):(D(),V($e,{key:1},[He(Ee($.text),1)],64))],2)],42,_4))),128))],2))),128))],6),Y.$slots["button-icon"]?Ne((D(),V("button",{key:0,ref_key:"toggleButton",ref:v,type:"button","aria-label":(M=Q(l))==null?void 0:M.toggleOverlay,class:Ie(A.value),tabindex:"0",onClick:te,onKeydown:ue},[Oe(Y.$slots,"button-icon")],42,y4)),[[th,!Q(d)(Y.hideNavigation,Y.type)]]):ce("",!0)],46,p4)}}}),yf=cn({__name:"InstanceWrap",props:{multiCalendars:{},stretch:{type:Boolean},collapse:{type:Boolean}},setup(t){const e=t,n=be(()=>e.multiCalendars>0?[...Array(e.multiCalendars).keys()]:[0]),i=be(()=>({dp__instance_calendar:e.multiCalendars>0}));return(s,r)=>(D(),V("div",{class:Ie({dp__menu_inner:!s.stretch,"dp--menu--inner-stretched":s.stretch,dp__flex_display:s.multiCalendars>0,"dp--flex-display-collapsed":s.collapse})},[(D(!0),V($e,null,Xe(n.value,(o,a)=>(D(),V("div",{key:o,class:Ie(i.value)},[Oe(s.$slots,"default",{instance:o,index:a})],2))),128))],2))}}),v4=["data-dp-element","aria-label","aria-disabled"],Wc=cn({compatConfig:{MODE:3},__name:"ArrowBtn",props:{ariaLabel:{},elName:{},disabled:{type:Boolean}},emits:["activate","set-ref"],setup(t,{emit:e}){const n=e,i=we(null);return xn(()=>n("set-ref",i)),(s,r)=>(D(),V("button",{ref_key:"elRef",ref:i,type:"button","data-dp-element":s.elName,class:"dp__btn dp--arrow-btn-nav",tabindex:"0","aria-label":s.ariaLabel,"aria-disabled":s.disabled||void 0,onClick:r[0]||(r[0]=o=>s.$emit("activate")),onKeydown:r[1]||(r[1]=o=>Q(Qn)(o,()=>s.$emit("activate"),!0))},[g("span",{class:Ie(["dp__inner_nav",{dp__inner_nav_disabled:s.disabled}])},[Oe(s.$slots,"default")],2)],40,v4))}}),b4=["aria-label","data-test"],oC=cn({__name:"YearModePicker",props:{...ps,showYearPicker:{type:Boolean,default:!1},items:{type:Array,default:()=>[]},instance:{type:Number,default:0},year:{type:Number,default:0},isDisabled:{type:Function,default:()=>!1}},emits:["toggle-year-picker","year-select","handle-year"],setup(t,{emit:e}){const n=e,i=t,{showRightIcon:s,showLeftIcon:r}=bf(),{defaultedConfig:o,defaultedMultiCalendars:a,defaultedAriaLabels:l,defaultedTransitions:c,defaultedUI:u}=Wt(i),{showTransition:d,transitionName:h}=Nu(c),f=we(!1),p=(v=!1,b)=>{f.value=!f.value,n("toggle-year-picker",{flow:v,show:b})},m=v=>{f.value=!1,n("year-select",v)},y=(v=!1)=>{n("handle-year",v)};return(v,b)=>{var E,C,w,x,T;return D(),V($e,null,[g("div",{class:Ie(["dp--year-mode-picker",{"dp--hidden-el":f.value}])},[Q(r)(Q(a),t.instance)?(D(),Ce(Wc,{key:0,ref:"mpPrevIconRef","aria-label":(E=Q(l))==null?void 0:E.prevYear,disabled:t.isDisabled(!1),class:Ie((C=Q(u))==null?void 0:C.navBtnPrev),onActivate:b[0]||(b[0]=k=>y(!1))},{default:Re(()=>[v.$slots["arrow-left"]?Oe(v.$slots,"arrow-left",{key:0}):ce("",!0),v.$slots["arrow-left"]?ce("",!0):(D(),Ce(Q(D_),{key:1}))]),_:3},8,["aria-label","disabled","class"])):ce("",!0),g("button",{ref:"mpYearButtonRef",class:"dp__btn dp--year-select",type:"button","aria-label":`${t.year}-${(w=Q(l))==null?void 0:w.openYearsOverlay}`,"data-test":`year-mode-btn-${t.instance}`,onClick:b[1]||(b[1]=()=>p(!1)),onKeydown:b[2]||(b[2]=eS(()=>p(!1),["enter"]))},[v.$slots.year?Oe(v.$slots,"year",{key:0,year:t.year}):ce("",!0),v.$slots.year?ce("",!0):(D(),V($e,{key:1},[He(Ee(t.year),1)],64))],40,b4),Q(s)(Q(a),t.instance)?(D(),Ce(Wc,{key:1,ref:"mpNextIconRef","aria-label":(x=Q(l))==null?void 0:x.nextYear,disabled:t.isDisabled(!0),class:Ie((T=Q(u))==null?void 0:T.navBtnNext),onActivate:b[3]||(b[3]=k=>y(!0))},{default:Re(()=>[v.$slots["arrow-right"]?Oe(v.$slots,"arrow-right",{key:0}):ce("",!0),v.$slots["arrow-right"]?ce("",!0):(D(),Ce(Q($_),{key:1}))]),_:3},8,["aria-label","disabled","class"])):ce("",!0)],2),B(Rt,{name:Q(h)(t.showYearPicker),css:Q(d)},{default:Re(()=>{var k,A;return[t.showYearPicker?(D(),Ce(Ou,{key:0,items:t.items,"text-input":v.textInput,"esc-close":v.escClose,config:v.config,"is-last":v.autoApply&&!Q(o).keepActionRow,"hide-navigation":v.hideNavigation,"aria-labels":v.ariaLabels,"overlay-label":(A=(k=Q(l))==null?void 0:k.yearPicker)==null?void 0:A.call(k,!0),type:"year",onToggle:p,onSelected:b[4]||(b[4]=P=>m(P))},jn({"button-icon":Re(()=>[v.$slots["calendar-icon"]?Oe(v.$slots,"calendar-icon",{key:0}):ce("",!0),v.$slots["calendar-icon"]?ce("",!0):(D(),Ce(Q(Ul),{key:1}))]),_:2},[v.$slots["year-overlay-value"]?{name:"item",fn:Re(({item:P})=>[Oe(v.$slots,"year-overlay-value",{text:P.text,value:P.value})]),key:"0"}:void 0]),1032,["items","text-input","esc-close","config","is-last","hide-navigation","aria-labels","overlay-label"])):ce("",!0)]}),_:3},8,["name","css"])],64)}}}),H_=(t,e,n)=>{if(e.value&&Array.isArray(e.value))if(e.value.some(i=>ct(t,i))){const i=e.value.filter(s=>!ct(s,t));e.value=i.length?i:null}else(n&&+n>e.value.length||!n)&&e.value.push(t);else e.value=[t]},Y_=(t,e,n)=>{let i=t.value?t.value.slice():[];return i.length===2&&i[1]!==null&&(i=[]),i.length?Xt(e,i[0])?(i.unshift(e),n("range-start",i[0]),n("range-start",i[1])):(i[1]=e,n("range-end",e)):(i=[e],n("range-start",e)),i},vf=(t,e,n,i)=>{t&&(t[0]&&t[1]&&n&&e("auto-apply"),t[0]&&!t[1]&&i&&n&&e("auto-apply"))},aC=t=>{Array.isArray(t.value)&&t.value.length<=2&&t.range?t.modelValue.value=t.value.map(e=>_i(xe(e),t.timezone)):Array.isArray(t.value)||(t.modelValue.value=_i(xe(t.value),t.timezone))},lC=(t,e,n,i)=>Array.isArray(e.value)&&(e.value.length===2||e.value.length===1&&i.value.partialRange)?i.value.fixedStart&&(nn(t,e.value[0])||ct(t,e.value[0]))?[e.value[0],t]:i.value.fixedEnd&&(Xt(t,e.value[1])||ct(t,e.value[1]))?[t,e.value[1]]:(n("invalid-fixed-range",t),e.value):[],cC=({multiCalendars:t,range:e,highlight:n,propDates:i,calendars:s,modelValue:r,props:o,filters:a,year:l,month:c,emit:u})=>{const d=be(()=>B_(o.yearRange,o.locale,o.reverseYears)),h=we([!1]),f=be(()=>(P,F)=>{const H=It(rs(new Date),{month:c.value(P),year:l.value(P)}),te=F?RS(H):ru(H);return tC(te,i.value.maxDate,i.value.minDate,o.preventMinMaxNavigation,F)}),p=()=>Array.isArray(r.value)&&t.value.solo&&r.value[1],m=()=>{for(let P=0;P{if(!P)return m();const F=It(xe(),s.value[P]);return s.value[0].year=Ge(jS(F,t.value.count-1)),m()},v=(P,F)=>{const H=RF(F,P);return e.value.showLastInRange&&H>1?F:P},b=P=>o.focusStartDate||t.value.solo?P[0]:P[1]?v(P[0],P[1]):P[0],E=()=>{if(r.value){const P=Array.isArray(r.value)?b(r.value):r.value;s.value[0]={month:at(P),year:Ge(P)}}},C=()=>{E(),t.value.count&&m()};fn(r,(P,F)=>{o.isTextInputDate&&JSON.stringify(P??{})!==JSON.stringify(F??{})&&C()}),xn(()=>{C()});const w=(P,F)=>{s.value[F].year=P,u("update-month-year",{instance:F,year:P,month:s.value[F].month}),t.value.count&&!t.value.solo&&y(F)},x=be(()=>P=>Tl(d.value,F=>{var H;const te=l.value(P)===F.value,N=au(F.value,kl(i.value.minDate),kl(i.value.maxDate))||((H=a.value.years)==null?void 0:H.includes(l.value(P))),L=W_(n.value,F.value);return{active:te,disabled:N,highlighted:L}})),T=(P,F)=>{w(P,F),A(F)},k=(P,F=!1)=>{if(!f.value(P,F)){const H=F?l.value(P)+1:l.value(P)-1;w(H,P)}},A=(P,F=!1,H)=>{F||u("reset-flow"),H!==void 0?h.value[P]=H:h.value[P]=!h.value[P],h.value[P]?u("overlay-toggle",{open:!0,overlay:zn.year}):(u("overlay-closed"),u("overlay-toggle",{open:!1,overlay:zn.year}))};return{isDisabled:f,groupedYears:x,showYearPicker:h,selectYear:w,toggleYearPicker:A,handleYearSelect:T,handleYear:k}},w4=(t,e)=>{const{defaultedMultiCalendars:n,defaultedAriaLabels:i,defaultedTransitions:s,defaultedConfig:r,defaultedRange:o,defaultedHighlight:a,propDates:l,defaultedTz:c,defaultedFilters:u,defaultedMultiDates:d}=Wt(t),h=()=>{t.isTextInputDate&&C(Ge(xe(t.startDate)),0)},{modelValue:f,year:p,month:m,calendars:y}=Fu(t,e,h),v=be(()=>US(t.formatLocale,t.locale,t.monthNameFormat)),b=we(null),{checkMinMaxRange:E}=_o(t),{selectYear:C,groupedYears:w,showYearPicker:x,toggleYearPicker:T,handleYearSelect:k,handleYear:A,isDisabled:P}=cC({modelValue:f,multiCalendars:n,range:o,highlight:a,calendars:y,year:p,propDates:l,month:m,filters:u,props:t,emit:e});xn(()=>{t.startDate&&(f.value&&t.focusStartDate||!f.value)&&C(Ge(xe(t.startDate)),0)});const F=M=>M?{month:at(M),year:Ge(M)}:{month:null,year:null},H=()=>f.value?Array.isArray(f.value)?f.value.map(M=>F(M)):F(f.value):F(),te=(M,ie)=>{const le=y.value[M],$=H();return Array.isArray($)?$.some(oe=>oe.year===le?.year&&oe.month===ie):le?.year===$.year&&ie===$.month},N=(M,ie,le)=>{var $,oe;const de=H();return Array.isArray(de)?p.value(ie)===(($=de[le])==null?void 0:$.year)&&M===((oe=de[le])==null?void 0:oe.month):!1},L=(M,ie)=>{if(o.value.enabled){const le=H();if(Array.isArray(f.value)&&Array.isArray(le)){const $=N(M,ie,0)||N(M,ie,1),oe=sr(rs(xe()),M,p.value(ie));return mf(f.value,b.value,oe)&&!$}return!1}return!1},I=be(()=>M=>Tl(v.value,ie=>{var le;const $=te(M,ie.value),oe=au(ie.value,ZS(p.value(M),l.value.minDate),JS(p.value(M),l.value.maxDate))||KB(l.value.disabledDates,p.value(M)).includes(ie.value)||((le=u.value.months)==null?void 0:le.includes(ie.value)),de=L(ie.value,M),ve=iC(a.value,ie.value,p.value(M));return{active:$,disabled:oe,isBetween:de,highlighted:ve}})),W=(M,ie)=>sr(rs(xe()),M,p.value(ie)),X=(M,ie)=>{const le=f.value?f.value:rs(new Date);f.value=sr(le,M,p.value(ie)),e("auto-apply"),e("update-flow-step")},J=(M,ie)=>{const le=W(M,ie);o.value.fixedEnd||o.value.fixedStart?f.value=lC(le,f,e,o):f.value?E(le,f.value)&&(f.value=Y_(f,W(M,ie),e)):f.value=[W(M,ie)],Rn().then(()=>{vf(f.value,e,t.autoApply,t.modelAuto)})},ne=(M,ie)=>{H_(W(M,ie),f,d.value.limit),e("auto-apply",!0)},ue=(M,ie)=>(y.value[ie].month=M,Z(ie,y.value[ie].year,M),d.value.enabled?ne(M,ie):o.value.enabled?J(M,ie):X(M,ie)),Y=(M,ie)=>{C(M,ie),Z(ie,M,null)},Z=(M,ie,le)=>{let $=le;if(!$&&$!==0){const oe=H();$=Array.isArray(oe)?oe[M].month:oe.month}e("update-month-year",{instance:M,year:ie,month:$})};return{groupedMonths:I,groupedYears:w,year:p,isDisabled:P,defaultedMultiCalendars:n,defaultedAriaLabels:i,defaultedTransitions:s,defaultedConfig:r,showYearPicker:x,modelValue:f,presetDate:(M,ie)=>{aC({value:M,modelValue:f,range:o.value.enabled,timezone:ie?void 0:c.value.timezone}),e("auto-apply")},setHoverDate:(M,ie)=>{b.value=W(M,ie)},selectMonth:ue,selectYear:Y,toggleYearPicker:T,handleYearSelect:k,handleYear:A,getModelMonthYear:H}},x4=cn({compatConfig:{MODE:3},__name:"MonthPicker",props:{...ps},emits:["update:internal-model-value","overlay-closed","reset-flow","range-start","range-end","auto-apply","update-month-year","update-flow-step","mount","invalid-fixed-range","overlay-toggle"],setup(t,{expose:e,emit:n}){const i=n,s=pa(),r=ki(s,"yearMode"),o=t;xn(()=>{o.shadow||i("mount",null)});const{groupedMonths:a,groupedYears:l,year:c,isDisabled:u,defaultedMultiCalendars:d,defaultedConfig:h,showYearPicker:f,modelValue:p,presetDate:m,setHoverDate:y,selectMonth:v,selectYear:b,toggleYearPicker:E,handleYearSelect:C,handleYear:w,getModelMonthYear:x}=w4(o,i);return e({getSidebarProps:()=>({modelValue:p,year:c,getModelMonthYear:x,selectMonth:v,selectYear:b,handleYear:w}),presetDate:m,toggleYearPicker:T=>E(0,T)}),(T,k)=>(D(),Ce(yf,{"multi-calendars":Q(d).count,collapse:T.collapse,stretch:""},{default:Re(({instance:A})=>[T.$slots["top-extra"]?Oe(T.$slots,"top-extra",{key:0,value:T.internalModelValue}):ce("",!0),T.$slots["month-year"]?Oe(T.$slots,"month-year",In(yn({key:1},{year:Q(c),months:Q(a)(A),years:Q(l)(A),selectMonth:Q(v),selectYear:Q(b),instance:A}))):(D(),Ce(Ou,{key:2,items:Q(a)(A),"arrow-navigation":T.arrowNavigation,"is-last":T.autoApply&&!Q(h).keepActionRow,"esc-close":T.escClose,height:Q(h).modeHeight,config:T.config,"no-overlay-focus":!!(T.noOverlayFocus||T.textInput),"use-relative":"",type:"month",onSelected:P=>Q(v)(P,A),onHoverValue:P=>Q(y)(P,A)},jn({header:Re(()=>[B(oC,yn(T.$props,{items:Q(l)(A),instance:A,"show-year-picker":Q(f)[A],year:Q(c)(A),"is-disabled":P=>Q(u)(A,P),onHandleYear:P=>Q(w)(A,P),onYearSelect:P=>Q(C)(P,A),onToggleYearPicker:P=>Q(E)(A,P?.flow,P?.show)}),jn({_:2},[Xe(Q(r),(P,F)=>({name:P,fn:Re(H=>[Oe(T.$slots,P,In(Zn(H)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),_:2},[T.$slots["month-overlay-value"]?{name:"item",fn:Re(({item:P})=>[Oe(T.$slots,"month-overlay-value",{text:P.text,value:P.value})]),key:"0"}:void 0]),1032,["items","arrow-navigation","is-last","esc-close","height","config","no-overlay-focus","onSelected","onHoverValue"]))]),_:3},8,["multi-calendars","collapse"]))}}),E4=(t,e)=>{const n=()=>{t.isTextInputDate&&(u.value=Ge(xe(t.startDate)))},{modelValue:i}=Fu(t,e,n),s=we(null),{defaultedHighlight:r,defaultedMultiDates:o,defaultedFilters:a,defaultedRange:l,propDates:c}=Wt(t),u=we();xn(()=>{t.startDate&&(i.value&&t.focusStartDate||!i.value)&&(u.value=Ge(xe(t.startDate)))});const d=m=>Array.isArray(i.value)?i.value.some(y=>Ge(y)===m):i.value?Ge(i.value)===m:!1,h=m=>l.value.enabled&&Array.isArray(i.value)?mf(i.value,s.value,p(m)):!1,f=be(()=>Tl(B_(t.yearRange,t.locale,t.reverseYears),m=>{const y=d(m.value),v=au(m.value,kl(c.value.minDate),kl(c.value.maxDate))||a.value.years.includes(m.value),b=h(m.value)&&!y,E=W_(r.value,m.value);return{active:y,disabled:v,isBetween:b,highlighted:E}})),p=m=>Ts(rs(ru(new Date)),m);return{groupedYears:f,modelValue:i,focusYear:u,setHoverValue:m=>{s.value=Ts(rs(new Date),m)},selectYear:m=>{var y;if(e("update-month-year",{instance:0,year:m}),o.value.enabled)return i.value?Array.isArray(i.value)&&(((y=i.value)==null?void 0:y.map(v=>Ge(v))).includes(m)?i.value=i.value.filter(v=>Ge(v)!==m):i.value.push(Ts(ni(xe()),m))):i.value=[Ts(ni(ru(xe())),m)],e("auto-apply",!0);l.value.enabled?(i.value=Y_(i,p(m),e),Rn().then(()=>{vf(i.value,e,t.autoApply,t.modelAuto)})):(i.value=p(m),e("auto-apply"))}}},S4=cn({compatConfig:{MODE:3},__name:"YearPicker",props:{...ps},emits:["update:internal-model-value","reset-flow","range-start","range-end","auto-apply","update-month-year"],setup(t,{expose:e,emit:n}){const i=n,s=t,{groupedYears:r,modelValue:o,focusYear:a,selectYear:l,setHoverValue:c}=E4(s,i),{defaultedConfig:u}=Wt(s);return e({getSidebarProps:()=>({modelValue:o,selectYear:l})}),(d,h)=>(D(),V("div",null,[d.$slots["top-extra"]?Oe(d.$slots,"top-extra",{key:0,value:d.internalModelValue}):ce("",!0),d.$slots["month-year"]?Oe(d.$slots,"month-year",In(yn({key:1},{years:Q(r),selectYear:Q(l)}))):(D(),Ce(Ou,{key:2,items:Q(r),"is-last":d.autoApply&&!Q(u).keepActionRow,height:Q(u).modeHeight,config:d.config,"no-overlay-focus":!!(d.noOverlayFocus||d.textInput),"focus-value":Q(a),type:"year","use-relative":"",onSelected:Q(l),onHoverValue:Q(c)},jn({_:2},[d.$slots["year-overlay-value"]?{name:"item",fn:Re(({item:f})=>[Oe(d.$slots,"year-overlay-value",{text:f.text,value:f.value})]),key:"0"}:void 0]),1032,["items","is-last","height","config","no-overlay-focus","focus-value","onSelected","onHoverValue"]))]))}}),C4={key:0,class:"dp__time_input"},T4=["data-test","aria-label","onKeydown","onClick","onMousedown"],k4=g("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1),A4=g("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1),M4=["aria-label","disabled","data-test","onKeydown","onClick"],I4=["data-test","aria-label","onKeydown","onClick","onMousedown"],P4=g("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1),R4=g("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1),D4={key:0},$4=["aria-label"],L4=cn({compatConfig:{MODE:3},__name:"TimeInput",props:{hours:{type:Number,default:0},minutes:{type:Number,default:0},seconds:{type:Number,default:0},closeTimePickerBtn:{type:Object,default:null},order:{type:Number,default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...ps},emits:["set-hours","set-minutes","update:hours","update:minutes","update:seconds","reset-flow","mounted","overlay-closed","overlay-opened","am-pm-change"],setup(t,{expose:e,emit:n}){const i=n,s=t,{setTimePickerElements:r,setTimePickerBackRef:o}=mo(),{defaultedAriaLabels:a,defaultedTransitions:l,defaultedFilters:c,defaultedConfig:u,defaultedRange:d}=Wt(s),{transitionName:h,showTransition:f}=Nu(l),p=Ns({hours:!1,minutes:!1,seconds:!1}),m=we("AM"),y=we(null),v=we([]),b=we(),E=we(!1);xn(()=>{i("mounted")});const C=S=>It(new Date,{hours:S.hours,minutes:S.minutes,seconds:s.enableSeconds?S.seconds:0,milliseconds:0}),w=be(()=>S=>W(S,s[S])||T(S,s[S])),x=be(()=>({hours:s.hours,minutes:s.minutes,seconds:s.seconds})),T=(S,O)=>d.value.enabled&&!d.value.disableTimeRangeValidation?!s.validateTime(S,O):!1,k=(S,O)=>{if(d.value.enabled&&!d.value.disableTimeRangeValidation){const K=O?+s[`${S}Increment`]:-+s[`${S}Increment`],U=s[S]+K;return!s.validateTime(S,U)}return!1},A=be(()=>S=>!Y(+s[S]+ +s[`${S}Increment`],S)||k(S,!0)),P=be(()=>S=>!Y(+s[S]-+s[`${S}Increment`],S)||k(S,!1)),F=(S,O)=>CS(It(xe(),S),O),H=(S,O)=>kB(It(xe(),S),O),te=be(()=>({dp__time_col:!0,dp__time_col_block:!s.timePickerInline,dp__time_col_reg_block:!s.enableSeconds&&s.is24&&!s.timePickerInline,dp__time_col_reg_inline:!s.enableSeconds&&s.is24&&s.timePickerInline,dp__time_col_reg_with_button:!s.enableSeconds&&!s.is24,dp__time_col_sec:s.enableSeconds&&s.is24,dp__time_col_sec_with_button:s.enableSeconds&&!s.is24})),N=be(()=>{const S=[{type:"hours"}];return s.enableMinutes&&S.push({type:"",separator:!0},{type:"minutes"}),s.enableSeconds&&S.push({type:"",separator:!0},{type:"seconds"}),S}),L=be(()=>N.value.filter(S=>!S.separator)),I=be(()=>S=>{if(S==="hours"){const O=oe(+s.hours);return{text:O<10?`0${O}`:`${O}`,value:O}}return{text:s[S]<10?`0${s[S]}`:`${s[S]}`,value:s[S]}}),W=(S,O)=>{var K;if(!s.disabledTimesConfig)return!1;const U=s.disabledTimesConfig(s.order,S==="hours"?O:void 0);return U[S]?!!((K=U[S])!=null&&K.includes(O)):!0},X=(S,O)=>O!=="hours"||m.value==="AM"?S:S+12,J=S=>{const O=s.is24?24:12,K=S==="hours"?O:60,U=+s[`${S}GridIncrement`],re=S==="hours"&&!s.is24?U:0,j=[];for(let se=re;se({active:!1,disabled:c.value.times[S].includes(se.value)||!Y(se.value,S)||W(S,se.value)||T(S,se.value)}))},ne=S=>S>=0?S:59,ue=S=>S>=0?S:23,Y=(S,O)=>{const K=s.minTime?C(Dg(s.minTime)):null,U=s.maxTime?C(Dg(s.maxTime)):null,re=C(Dg(x.value,O,O==="minutes"||O==="seconds"?ne(S):ue(S)));return K&&U?(ou(re,U)||Za(re,U))&&(Sl(re,K)||Za(re,K)):K?Sl(re,K)||Za(re,K):U?ou(re,U)||Za(re,U):!0},Z=S=>s[`no${S[0].toUpperCase()+S.slice(1)}Overlay`],M=S=>{Z(S)||(p[S]=!p[S],p[S]?(E.value=!0,i("overlay-opened",S)):(E.value=!1,i("overlay-closed",S)))},ie=S=>S==="hours"?pr:S==="minutes"?oo:El,le=()=>{b.value&&clearTimeout(b.value)},$=(S,O=!0,K)=>{const U=O?F:H,re=O?+s[`${S}Increment`]:-+s[`${S}Increment`];Y(+s[S]+re,S)&&i(`update:${S}`,ie(S)(U({[S]:+s[S]},{[S]:+s[`${S}Increment`]}))),!(K!=null&&K.keyboard)&&u.value.timeArrowHoldThreshold&&(b.value=setTimeout(()=>{$(S,O)},u.value.timeArrowHoldThreshold))},oe=S=>s.is24?S:(S>=12?m.value="PM":m.value="AM",DB(S)),de=()=>{m.value==="PM"?(m.value="AM",i("update:hours",s.hours-12)):(m.value="PM",i("update:hours",s.hours+12)),i("am-pm-change",m.value)},ve=S=>{p[S]=!0},z=(S,O,K)=>{if(S&&s.arrowNavigation){Array.isArray(v.value[O])?v.value[O][K]=S:v.value[O]=[S];const U=v.value.reduce((re,j)=>j.map((se,ee)=>[...re[ee]||[],j[ee]]),[]);o(s.closeTimePickerBtn),y.value&&(U[1]=U[1].concat(y.value)),r(U,s.order)}},ge=(S,O)=>(M(S),i(`update:${S}`,O));return e({openChildCmp:ve}),(S,O)=>{var K;return S.disabled?ce("",!0):(D(),V("div",C4,[(D(!0),V($e,null,Xe(N.value,(U,re)=>{var j,se,ee;return D(),V("div",{key:re,class:Ie(te.value)},[U.separator?(D(),V($e,{key:0},[E.value?ce("",!0):(D(),V($e,{key:0},[He(":")],64))],64)):(D(),V($e,{key:1},[g("button",{ref_for:!0,ref:fe=>z(fe,re,0),type:"button",class:Ie({dp__btn:!0,dp__inc_dec_button:!S.timePickerInline,dp__inc_dec_button_inline:S.timePickerInline,dp__tp_inline_btn_top:S.timePickerInline,dp__inc_dec_button_disabled:A.value(U.type),"dp--hidden-el":E.value}),"data-test":`${U.type}-time-inc-btn-${s.order}`,"aria-label":(j=Q(a))==null?void 0:j.incrementValue(U.type),tabindex:"0",onKeydown:fe=>Q(Qn)(fe,()=>$(U.type,!0,{keyboard:!0}),!0),onClick:fe=>Q(u).timeArrowHoldThreshold?void 0:$(U.type,!0),onMousedown:fe=>Q(u).timeArrowHoldThreshold?$(U.type,!0):void 0,onMouseup:le},[s.timePickerInline?(D(),V($e,{key:1},[S.$slots["tp-inline-arrow-up"]?Oe(S.$slots,"tp-inline-arrow-up",{key:0}):(D(),V($e,{key:1},[k4,A4],64))],64)):(D(),V($e,{key:0},[S.$slots["arrow-up"]?Oe(S.$slots,"arrow-up",{key:0}):ce("",!0),S.$slots["arrow-up"]?ce("",!0):(D(),Ce(Q(O_),{key:1}))],64))],42,T4),g("button",{ref_for:!0,ref:fe=>z(fe,re,1),type:"button","aria-label":`${I.value(U.type).text}-${(se=Q(a))==null?void 0:se.openTpOverlay(U.type)}`,class:Ie({dp__time_display:!0,dp__time_display_block:!S.timePickerInline,dp__time_display_inline:S.timePickerInline,"dp--time-invalid":w.value(U.type),"dp--time-overlay-btn":!w.value(U.type),"dp--hidden-el":E.value}),disabled:Z(U.type),tabindex:"0","data-test":`${U.type}-toggle-overlay-btn-${s.order}`,onKeydown:fe=>Q(Qn)(fe,()=>M(U.type),!0),onClick:fe=>M(U.type)},[S.$slots[U.type]?Oe(S.$slots,U.type,{key:0,text:I.value(U.type).text,value:I.value(U.type).value}):ce("",!0),S.$slots[U.type]?ce("",!0):(D(),V($e,{key:1},[He(Ee(I.value(U.type).text),1)],64))],42,M4),g("button",{ref_for:!0,ref:fe=>z(fe,re,2),type:"button",class:Ie({dp__btn:!0,dp__inc_dec_button:!S.timePickerInline,dp__inc_dec_button_inline:S.timePickerInline,dp__tp_inline_btn_bottom:S.timePickerInline,dp__inc_dec_button_disabled:P.value(U.type),"dp--hidden-el":E.value}),"data-test":`${U.type}-time-dec-btn-${s.order}`,"aria-label":(ee=Q(a))==null?void 0:ee.decrementValue(U.type),tabindex:"0",onKeydown:fe=>Q(Qn)(fe,()=>$(U.type,!1,{keyboard:!0}),!0),onClick:fe=>Q(u).timeArrowHoldThreshold?void 0:$(U.type,!1),onMousedown:fe=>Q(u).timeArrowHoldThreshold?$(U.type,!1):void 0,onMouseup:le},[s.timePickerInline?(D(),V($e,{key:1},[S.$slots["tp-inline-arrow-down"]?Oe(S.$slots,"tp-inline-arrow-down",{key:0}):(D(),V($e,{key:1},[P4,R4],64))],64)):(D(),V($e,{key:0},[S.$slots["arrow-down"]?Oe(S.$slots,"arrow-down",{key:0}):ce("",!0),S.$slots["arrow-down"]?ce("",!0):(D(),Ce(Q(N_),{key:1}))],64))],42,I4)],64))],2)}),128)),S.is24?ce("",!0):(D(),V("div",D4,[S.$slots["am-pm-button"]?Oe(S.$slots,"am-pm-button",{key:0,toggle:de,value:m.value}):ce("",!0),S.$slots["am-pm-button"]?ce("",!0):(D(),V("button",{key:1,ref_key:"amPmButton",ref:y,type:"button",class:"dp__pm_am_button",role:"button","aria-label":(K=Q(a))==null?void 0:K.amPmButton,tabindex:"0",onClick:de,onKeydown:O[0]||(O[0]=U=>Q(Qn)(U,()=>de(),!0))},Ee(m.value),41,$4))])),(D(!0),V($e,null,Xe(L.value,(U,re)=>(D(),Ce(Rt,{key:re,name:Q(h)(p[U.type]),css:Q(f)},{default:Re(()=>{var j,se;return[p[U.type]?(D(),Ce(Ou,{key:0,items:J(U.type),"is-last":S.autoApply&&!Q(u).keepActionRow,"esc-close":S.escClose,type:U.type,"text-input":S.textInput,config:S.config,"arrow-navigation":S.arrowNavigation,"aria-labels":S.ariaLabels,"overlay-label":(se=(j=Q(a)).timeOverlay)==null?void 0:se.call(j,U.type),onSelected:ee=>ge(U.type,ee),onToggle:ee=>M(U.type),onResetFlow:O[1]||(O[1]=ee=>S.$emit("reset-flow"))},jn({"button-icon":Re(()=>[S.$slots["clock-icon"]?Oe(S.$slots,"clock-icon",{key:0}):ce("",!0),S.$slots["clock-icon"]?ce("",!0):(D(),Ce(ga(S.timePickerInline?Q(Ul):Q(L_)),{key:1}))]),_:2},[S.$slots[`${U.type}-overlay-value`]?{name:"item",fn:Re(({item:ee})=>[Oe(S.$slots,`${U.type}-overlay-value`,{text:ee.text,value:ee.value})]),key:"0"}:void 0,S.$slots[`${U.type}-overlay-header`]?{name:"header",fn:Re(()=>[Oe(S.$slots,`${U.type}-overlay-header`,{toggle:()=>M(U.type)})]),key:"1"}:void 0]),1032,["items","is-last","esc-close","type","text-input","config","arrow-navigation","aria-labels","overlay-label","onSelected","onToggle"])):ce("",!0)]}),_:2},1032,["name","css"]))),128))]))}}}),O4={class:"dp--tp-wrap"},N4=["aria-label","tabindex"],F4=["role","aria-label","tabindex"],B4=["aria-label"],uC=cn({compatConfig:{MODE:3},__name:"TimePicker",props:{hours:{type:[Number,Array],default:0},minutes:{type:[Number,Array],default:0},seconds:{type:[Number,Array],default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...ps},emits:["update:hours","update:minutes","update:seconds","mount","reset-flow","overlay-opened","overlay-closed","am-pm-change"],setup(t,{expose:e,emit:n}){const i=n,s=t,{buildMatrix:r,setTimePicker:o}=mo(),a=pa(),{defaultedTransitions:l,defaultedAriaLabels:c,defaultedTextInput:u,defaultedConfig:d,defaultedRange:h}=Wt(s),{transitionName:f,showTransition:p}=Nu(l),{hideNavigationButtons:m}=bf(),y=we(null),v=we(null),b=we([]),E=we(null),C=we(!1);xn(()=>{i("mount"),!s.timePicker&&s.arrowNavigation?r([mn(y.value)],"time"):o(!0,s.timePicker)});const w=be(()=>h.value.enabled&&s.modelAuto?GS(s.internalModelValue):!0),x=we(!1),T=J=>({hours:Array.isArray(s.hours)?s.hours[J]:s.hours,minutes:Array.isArray(s.minutes)?s.minutes[J]:s.minutes,seconds:Array.isArray(s.seconds)?s.seconds[J]:s.seconds}),k=be(()=>{const J=[];if(h.value.enabled)for(let ne=0;ne<2;ne++)J.push(T(ne));else J.push(T(0));return J}),A=(J,ne=!1,ue="")=>{ne||i("reset-flow"),x.value=J,i(J?"overlay-opened":"overlay-closed",zn.time),s.arrowNavigation&&o(J),Rn(()=>{ue!==""&&b.value[0]&&b.value[0].openChildCmp(ue)})},P=be(()=>({dp__btn:!0,dp__button:!0,dp__button_bottom:s.autoApply&&!d.value.keepActionRow})),F=ki(a,"timePicker"),H=(J,ne,ue)=>h.value.enabled?ne===0?[J,k.value[1][ue]]:[k.value[0][ue],J]:J,te=J=>{i("update:hours",J)},N=J=>{i("update:minutes",J)},L=J=>{i("update:seconds",J)},I=()=>{if(E.value&&!u.value.enabled&&!s.noOverlayFocus){const J=XS(E.value);J&&J.focus({preventScroll:!0})}},W=J=>{C.value=!1,i("overlay-closed",J)},X=J=>{C.value=!0,i("overlay-opened",J)};return e({toggleTimePicker:A}),(J,ne)=>{var ue;return D(),V("div",O4,[!J.timePicker&&!J.timePickerInline?Ne((D(),V("button",{key:0,ref_key:"openTimePickerBtn",ref:y,type:"button",class:Ie({...P.value,"dp--hidden-el":x.value}),"aria-label":(ue=Q(c))==null?void 0:ue.openTimePicker,tabindex:J.noOverlayFocus?void 0:0,"data-test":"open-time-picker-btn",onKeydown:ne[0]||(ne[0]=Y=>Q(Qn)(Y,()=>A(!0))),onClick:ne[1]||(ne[1]=Y=>A(!0))},[J.$slots["clock-icon"]?Oe(J.$slots,"clock-icon",{key:0}):ce("",!0),J.$slots["clock-icon"]?ce("",!0):(D(),Ce(Q(L_),{key:1}))],42,N4)),[[th,!Q(m)(J.hideNavigation,"time")]]):ce("",!0),B(Rt,{name:Q(f)(x.value),css:Q(p)&&!J.timePickerInline},{default:Re(()=>{var Y,Z;return[x.value||J.timePicker||J.timePickerInline?(D(),V("div",{key:0,ref_key:"overlayRef",ref:E,role:J.timePickerInline?void 0:"dialog",class:Ie({dp__overlay:!J.timePickerInline,"dp--overlay-absolute":!s.timePicker&&!J.timePickerInline,"dp--overlay-relative":s.timePicker}),style:Mn(J.timePicker?{height:`${Q(d).modeHeight}px`}:void 0),"aria-label":(Y=Q(c))==null?void 0:Y.timePicker,tabindex:J.timePickerInline?void 0:0},[g("div",{class:Ie(J.timePickerInline?"dp__time_picker_inline_container":"dp__overlay_container dp__container_flex dp__time_picker_overlay_container"),style:{display:"flex"}},[J.$slots["time-picker-overlay"]?Oe(J.$slots,"time-picker-overlay",{key:0,hours:t.hours,minutes:t.minutes,seconds:t.seconds,setHours:te,setMinutes:N,setSeconds:L}):ce("",!0),J.$slots["time-picker-overlay"]?ce("",!0):(D(),V("div",{key:1,class:Ie(J.timePickerInline?"dp__flex":"dp__overlay_row dp__flex_row")},[(D(!0),V($e,null,Xe(k.value,(M,ie)=>Ne((D(),Ce(L4,yn({key:ie,ref_for:!0},{...J.$props,order:ie,hours:M.hours,minutes:M.minutes,seconds:M.seconds,closeTimePickerBtn:v.value,disabledTimesConfig:t.disabledTimesConfig,disabled:ie===0?Q(h).fixedStart:Q(h).fixedEnd},{ref_for:!0,ref_key:"timeInputRefs",ref:b,"validate-time":(le,$)=>t.validateTime(le,H($,ie,le)),"onUpdate:hours":le=>te(H(le,ie,"hours")),"onUpdate:minutes":le=>N(H(le,ie,"minutes")),"onUpdate:seconds":le=>L(H(le,ie,"seconds")),onMounted:I,onOverlayClosed:W,onOverlayOpened:X,onAmPmChange:ne[2]||(ne[2]=le=>J.$emit("am-pm-change",le))}),jn({_:2},[Xe(Q(F),(le,$)=>({name:le,fn:Re(oe=>[Oe(J.$slots,le,yn({ref_for:!0},oe))])}))]),1040,["validate-time","onUpdate:hours","onUpdate:minutes","onUpdate:seconds"])),[[th,ie===0?!0:w.value]])),128))],2)),!J.timePicker&&!J.timePickerInline?Ne((D(),V("button",{key:2,ref_key:"closeTimePickerBtn",ref:v,type:"button",class:Ie({...P.value,"dp--hidden-el":C.value}),"aria-label":(Z=Q(c))==null?void 0:Z.closeTimePicker,tabindex:"0",onKeydown:ne[3]||(ne[3]=M=>Q(Qn)(M,()=>A(!1))),onClick:ne[4]||(ne[4]=M=>A(!1))},[J.$slots["calendar-icon"]?Oe(J.$slots,"calendar-icon",{key:0}):ce("",!0),J.$slots["calendar-icon"]?ce("",!0):(D(),Ce(Q(Ul),{key:1}))],42,B4)),[[th,!Q(m)(J.hideNavigation,"time")]]):ce("",!0)],2)],14,F4)):ce("",!0)]}),_:3},8,["name","css"])])}}}),dC=(t,e,n,i)=>{const{defaultedRange:s}=Wt(t),r=(E,C)=>Array.isArray(e[E])?e[E][C]:e[E],o=E=>t.enableSeconds?Array.isArray(e.seconds)?e.seconds[E]:e.seconds:0,a=(E,C)=>E?C!==void 0?eo(E,r("hours",C),r("minutes",C),o(C)):eo(E,e.hours,e.minutes,o()):YS(xe(),o(C)),l=(E,C)=>{e[E]=C},c=be(()=>t.modelAuto&&s.value.enabled?Array.isArray(n.value)?n.value.length>1:!1:s.value.enabled),u=(E,C)=>{const w=Object.fromEntries(Object.keys(e).map(x=>x===E?[x,C]:[x,e[x]].slice()));if(c.value&&!s.value.disableTimeRangeValidation){const x=k=>n.value?eo(n.value[k],w.hours[k],w.minutes[k],w.seconds[k]):null,T=k=>HS(n.value[k],0);return!(ct(x(0),x(1))&&(Sl(x(0),T(1))||ou(x(1),T(0))))}return!0},d=(E,C)=>{u(E,C)&&(l(E,C),i&&i())},h=E=>{d("hours",E)},f=E=>{d("minutes",E)},p=E=>{d("seconds",E)},m=(E,C,w,x)=>{C&&h(E),!C&&!w&&f(E),w&&p(E),n.value&&x(n.value)},y=E=>{if(E){const C=Array.isArray(E),w=C?[+E[0].hours,+E[1].hours]:+E.hours,x=C?[+E[0].minutes,+E[1].minutes]:+E.minutes,T=C?[+E[0].seconds,+E[1].seconds]:+E.seconds;l("hours",w),l("minutes",x),t.enableSeconds&&l("seconds",T)}},v=(E,C)=>{const w={hours:Array.isArray(e.hours)?e.hours[E]:e.hours,disabledArr:[]};return(C||C===0)&&(w.hours=C),Array.isArray(t.disabledTimes)&&(w.disabledArr=s.value.enabled&&Array.isArray(t.disabledTimes[E])?t.disabledTimes[E]:t.disabledTimes),w},b=be(()=>(E,C)=>{var w;if(Array.isArray(t.disabledTimes)){const{disabledArr:x,hours:T}=v(E,C),k=x.filter(A=>+A.hours===T);return((w=k[0])==null?void 0:w.minutes)==="*"?{hours:[T],minutes:void 0,seconds:void 0}:{hours:[],minutes:k?.map(A=>+A.minutes)??[],seconds:k?.map(A=>A.seconds?+A.seconds:void 0)??[]}}return{hours:[],minutes:[],seconds:[]}});return{setTime:l,updateHours:h,updateMinutes:f,updateSeconds:p,getSetDateTime:a,updateTimeValues:m,getSecondsValue:o,assignStartTime:y,validateTime:u,disabledTimesConfig:b}},V4=(t,e)=>{const n=()=>{t.isTextInputDate&&C()},{modelValue:i,time:s}=Fu(t,e,n),{defaultedStartTime:r,defaultedRange:o,defaultedTz:a}=Wt(t),{updateTimeValues:l,getSetDateTime:c,setTime:u,assignStartTime:d,disabledTimesConfig:h,validateTime:f}=dC(t,s,i,p);function p(){e("update-flow-step")}const m=x=>{const{hours:T,minutes:k,seconds:A}=x;return{hours:+T,minutes:+k,seconds:A?+A:0}},y=()=>{if(t.startTime){if(Array.isArray(t.startTime)){const T=m(t.startTime[0]),k=m(t.startTime[1]);return[It(xe(),T),It(xe(),k)]}const x=m(t.startTime);return It(xe(),x)}return o.value.enabled?[null,null]:null},v=()=>{if(o.value.enabled){const[x,T]=y();i.value=[_i(c(x,0),a.value.timezone),_i(c(T,1),a.value.timezone)]}else i.value=_i(c(y()),a.value.timezone)},b=x=>Array.isArray(x)?[na(xe(x[0])),na(xe(x[1]))]:[na(x??xe())],E=(x,T,k)=>{u("hours",x),u("minutes",T),u("seconds",t.enableSeconds?k:0)},C=()=>{const[x,T]=b(i.value);return o.value.enabled?E([x.hours,T.hours],[x.minutes,T.minutes],[x.seconds,T.seconds]):E(x.hours,x.minutes,x.seconds)};xn(()=>{if(!t.shadow)return d(r.value),i.value?C():v()});const w=()=>{Array.isArray(i.value)?i.value=i.value.map((x,T)=>x&&c(x,T)):i.value=c(i.value),e("time-update")};return{modelValue:i,time:s,disabledTimesConfig:h,updateTime:(x,T=!0,k=!1)=>{l(x,T,k,w)},validateTime:f}},z4=cn({compatConfig:{MODE:3},__name:"TimePickerSolo",props:{...ps},emits:["update:internal-model-value","time-update","am-pm-change","mount","reset-flow","update-flow-step","overlay-toggle"],setup(t,{expose:e,emit:n}){const i=n,s=t,r=pa(),o=ki(r,"timePicker"),a=we(null),{time:l,modelValue:c,disabledTimesConfig:u,updateTime:d,validateTime:h}=V4(s,i);return xn(()=>{s.shadow||i("mount",null)}),e({getSidebarProps:()=>({modelValue:c,time:l,updateTime:d}),toggleTimePicker:(f,p=!1,m="")=>{var y;(y=a.value)==null||y.toggleTimePicker(f,p,m)}}),(f,p)=>(D(),Ce(yf,{"multi-calendars":0,stretch:""},{default:Re(()=>[B(uC,yn({ref_key:"tpRef",ref:a},f.$props,{hours:Q(l).hours,minutes:Q(l).minutes,seconds:Q(l).seconds,"internal-model-value":f.internalModelValue,"disabled-times-config":Q(u),"validate-time":Q(h),"onUpdate:hours":p[0]||(p[0]=m=>Q(d)(m)),"onUpdate:minutes":p[1]||(p[1]=m=>Q(d)(m,!1)),"onUpdate:seconds":p[2]||(p[2]=m=>Q(d)(m,!1,!0)),onAmPmChange:p[3]||(p[3]=m=>f.$emit("am-pm-change",m)),onResetFlow:p[4]||(p[4]=m=>f.$emit("reset-flow")),onOverlayClosed:p[5]||(p[5]=m=>f.$emit("overlay-toggle",{open:!1,overlay:m})),onOverlayOpened:p[6]||(p[6]=m=>f.$emit("overlay-toggle",{open:!0,overlay:m}))}),jn({_:2},[Xe(Q(o),(m,y)=>({name:m,fn:Re(v=>[Oe(f.$slots,m,In(Zn(v)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"])]),_:3}))}}),W4={class:"dp--header-wrap"},H4={key:0,class:"dp__month_year_wrap"},Y4={key:0},j4={class:"dp__month_year_wrap"},K4=["data-dp-element","aria-label","data-test","onClick","onKeydown"],U4=cn({compatConfig:{MODE:3},__name:"DpHeader",props:{month:{type:Number,default:0},year:{type:Number,default:0},instance:{type:Number,default:0},years:{type:Array,default:()=>[]},months:{type:Array,default:()=>[]},...ps},emits:["update-month-year","mount","reset-flow","overlay-closed","overlay-opened"],setup(t,{expose:e,emit:n}){const i=n,s=t,{defaultedTransitions:r,defaultedAriaLabels:o,defaultedMultiCalendars:a,defaultedFilters:l,defaultedConfig:c,defaultedHighlight:u,propDates:d,defaultedUI:h}=Wt(s),{transitionName:f,showTransition:p}=Nu(r),{buildMatrix:m}=mo(),{handleMonthYearChange:y,isDisabled:v,updateMonthYear:b}=d4(s,i),{showLeftIcon:E,showRightIcon:C}=bf(),w=we(!1),x=we(!1),T=we(!1),k=we([null,null,null,null]);xn(()=>{i("mount")});const A=Z=>({get:()=>s[Z],set:M=>{const ie=Z===es.month?es.year:es.month;i("update-month-year",{[Z]:M,[ie]:s[ie]}),Z===es.month?W(!0):X(!0)}}),P=be(A(es.month)),F=be(A(es.year)),H=be(()=>Z=>({month:s.month,year:s.year,items:Z===es.month?s.months:s.years,instance:s.instance,updateMonthYear:b,toggle:Z===es.month?W:X})),te=be(()=>s.months.find(M=>M.value===s.month)||{text:"",value:0}),N=be(()=>Tl(s.months,Z=>{const M=s.month===Z.value,ie=au(Z.value,ZS(s.year,d.value.minDate),JS(s.year,d.value.maxDate))||l.value.months.includes(Z.value),le=iC(u.value,Z.value,s.year);return{active:M,disabled:ie,highlighted:le}})),L=be(()=>Tl(s.years,Z=>{const M=s.year===Z.value,ie=au(Z.value,kl(d.value.minDate),kl(d.value.maxDate))||l.value.years.includes(Z.value),le=W_(u.value,Z.value);return{active:M,disabled:ie,highlighted:le}})),I=(Z,M,ie)=>{ie!==void 0?Z.value=ie:Z.value=!Z.value,Z.value?(T.value=!0,i("overlay-opened",M)):(T.value=!1,i("overlay-closed",M))},W=(Z=!1,M)=>{J(Z),I(w,zn.month,M)},X=(Z=!1,M)=>{J(Z),I(x,zn.year,M)},J=Z=>{Z||i("reset-flow")},ne=(Z,M)=>{s.arrowNavigation&&(k.value[M]=mn(Z),m(k.value,"monthYear"))},ue=be(()=>{var Z,M,ie,le,$,oe;return[{type:es.month,index:1,toggle:W,modelValue:P.value,updateModelValue:de=>P.value=de,text:te.value.text,showSelectionGrid:w.value,items:N.value,ariaLabel:(Z=o.value)==null?void 0:Z.openMonthsOverlay,overlayLabel:((ie=(M=o.value).monthPicker)==null?void 0:ie.call(M,!0))??void 0},{type:es.year,index:2,toggle:X,modelValue:F.value,updateModelValue:de=>F.value=de,text:qS(s.year,s.locale),showSelectionGrid:x.value,items:L.value,ariaLabel:(le=o.value)==null?void 0:le.openYearsOverlay,overlayLabel:((oe=($=o.value).yearPicker)==null?void 0:oe.call($,!0))??void 0}]}),Y=be(()=>s.disableYearSelect?[ue.value[0]]:s.yearFirst?[...ue.value].reverse():ue.value);return e({toggleMonthPicker:W,toggleYearPicker:X,handleMonthYearChange:y}),(Z,M)=>{var ie,le,$,oe,de,ve;return D(),V("div",W4,[Z.$slots["month-year"]?(D(),V("div",H4,[Oe(Z.$slots,"month-year",In(Zn({month:t.month,year:t.year,months:t.months,years:t.years,updateMonthYear:Q(b),handleMonthYearChange:Q(y),instance:t.instance})))])):(D(),V($e,{key:1},[Z.$slots["top-extra"]?(D(),V("div",Y4,[Oe(Z.$slots,"top-extra",{value:Z.internalModelValue})])):ce("",!0),g("div",j4,[Q(E)(Q(a),t.instance)&&!Z.vertical?(D(),Ce(Wc,{key:0,"aria-label":(ie=Q(o))==null?void 0:ie.prevMonth,disabled:Q(v)(!1),class:Ie((le=Q(h))==null?void 0:le.navBtnPrev),"el-name":"action-prev",onActivate:M[0]||(M[0]=z=>Q(y)(!1,!0)),onSetRef:M[1]||(M[1]=z=>ne(z,0))},{default:Re(()=>[Z.$slots["arrow-left"]?Oe(Z.$slots,"arrow-left",{key:0}):ce("",!0),Z.$slots["arrow-left"]?ce("",!0):(D(),Ce(Q(D_),{key:1}))]),_:3},8,["aria-label","disabled","class"])):ce("",!0),g("div",{class:Ie(["dp__month_year_wrap",{dp__year_disable_select:Z.disableYearSelect}])},[(D(!0),V($e,null,Xe(Y.value,(z,ge)=>(D(),V($e,{key:z.type},[g("button",{ref_for:!0,ref:S=>ne(S,ge+1),type:"button","data-dp-element":`overlay-${z.type}`,class:Ie(["dp__btn dp__month_year_select",{"dp--hidden-el":T.value}]),"aria-label":`${z.text}-${z.ariaLabel}`,"data-test":`${z.type}-toggle-overlay-${t.instance}`,onClick:z.toggle,onKeydown:S=>Q(Qn)(S,()=>z.toggle(),!0)},[Z.$slots[z.type]?Oe(Z.$slots,z.type,{key:0,text:z.text,value:s[z.type]}):ce("",!0),Z.$slots[z.type]?ce("",!0):(D(),V($e,{key:1},[He(Ee(z.text),1)],64))],42,K4),B(Rt,{name:Q(f)(z.showSelectionGrid),css:Q(p)},{default:Re(()=>[z.showSelectionGrid?(D(),Ce(Ou,{key:0,items:z.items,"arrow-navigation":Z.arrowNavigation,"hide-navigation":Z.hideNavigation,"is-last":Z.autoApply&&!Q(c).keepActionRow,"skip-button-ref":!1,config:Z.config,type:z.type,"header-refs":[],"esc-close":Z.escClose,"menu-wrap-ref":Z.menuWrapRef,"text-input":Z.textInput,"aria-labels":Z.ariaLabels,"overlay-label":z.overlayLabel,onSelected:z.updateModelValue,onToggle:z.toggle},jn({"button-icon":Re(()=>[Z.$slots["calendar-icon"]?Oe(Z.$slots,"calendar-icon",{key:0}):ce("",!0),Z.$slots["calendar-icon"]?ce("",!0):(D(),Ce(Q(Ul),{key:1}))]),_:2},[Z.$slots[`${z.type}-overlay-value`]?{name:"item",fn:Re(({item:S})=>[Oe(Z.$slots,`${z.type}-overlay-value`,{text:S.text,value:S.value})]),key:"0"}:void 0,Z.$slots[`${z.type}-overlay`]?{name:"overlay",fn:Re(()=>[Oe(Z.$slots,`${z.type}-overlay`,yn({ref_for:!0},H.value(z.type)))]),key:"1"}:void 0,Z.$slots[`${z.type}-overlay-header`]?{name:"header",fn:Re(()=>[Oe(Z.$slots,`${z.type}-overlay-header`,{toggle:z.toggle})]),key:"2"}:void 0]),1032,["items","arrow-navigation","hide-navigation","is-last","config","type","esc-close","menu-wrap-ref","text-input","aria-labels","overlay-label","onSelected","onToggle"])):ce("",!0)]),_:2},1032,["name","css"])],64))),128))],2),Q(E)(Q(a),t.instance)&&Z.vertical?(D(),Ce(Wc,{key:1,"aria-label":($=Q(o))==null?void 0:$.prevMonth,"el-name":"action-prev",disabled:Q(v)(!1),class:Ie((oe=Q(h))==null?void 0:oe.navBtnPrev),onActivate:M[2]||(M[2]=z=>Q(y)(!1,!0))},{default:Re(()=>[Z.$slots["arrow-up"]?Oe(Z.$slots,"arrow-up",{key:0}):ce("",!0),Z.$slots["arrow-up"]?ce("",!0):(D(),Ce(Q(O_),{key:1}))]),_:3},8,["aria-label","disabled","class"])):ce("",!0),Q(C)(Q(a),t.instance)?(D(),Ce(Wc,{key:2,ref:"rightIcon","el-name":"action-next",disabled:Q(v)(!0),"aria-label":(de=Q(o))==null?void 0:de.nextMonth,class:Ie((ve=Q(h))==null?void 0:ve.navBtnNext),onActivate:M[3]||(M[3]=z=>Q(y)(!0,!0)),onSetRef:M[4]||(M[4]=z=>ne(z,Z.disableYearSelect?2:3))},{default:Re(()=>[Z.$slots[Z.vertical?"arrow-down":"arrow-right"]?Oe(Z.$slots,Z.vertical?"arrow-down":"arrow-right",{key:0}):ce("",!0),Z.$slots[Z.vertical?"arrow-down":"arrow-right"]?ce("",!0):(D(),Ce(ga(Z.vertical?Q(N_):Q($_)),{key:1}))]),_:3},8,["disabled","aria-label","class"])):ce("",!0)])],64))])}}}),G4={class:"dp__calendar_header",role:"row"},X4={key:0,class:"dp__calendar_header_item",role:"gridcell"},q4=["aria-label"],Z4=g("div",{class:"dp__calendar_header_separator"},null,-1),J4={key:0,class:"dp__calendar_item dp__week_num",role:"gridcell"},Q4={class:"dp__cell_inner"},eV=["id","aria-pressed","aria-disabled","aria-label","data-test","onClick","onTouchend","onKeydown","onMouseenter","onMouseleave","onMousedown"],tV=cn({compatConfig:{MODE:3},__name:"DpCalendar",props:{mappedDates:{type:Array,default:()=>[]},instance:{type:Number,default:0},month:{type:Number,default:0},year:{type:Number,default:0},...ps},emits:["select-date","set-hover-date","handle-scroll","mount","handle-swipe","handle-space","tooltip-open","tooltip-close"],setup(t,{expose:e,emit:n}){const i=n,s=t,{buildMultiLevelMatrix:r}=mo(),{defaultedTransitions:o,defaultedConfig:a,defaultedAriaLabels:l,defaultedMultiCalendars:c,defaultedWeekNumbers:u,defaultedMultiDates:d,defaultedUI:h}=Wt(s),f=we(null),p=we({bottom:"",left:"",transform:""}),m=we([]),y=we(null),v=we(!0),b=we(""),E=we({startX:0,endX:0,startY:0,endY:0}),C=we([]),w=we({left:"50%"}),x=we(!1),T=be(()=>s.calendar?s.calendar(s.mappedDates):s.mappedDates),k=be(()=>s.dayNames?Array.isArray(s.dayNames)?s.dayNames:s.dayNames(s.locale,+s.weekStart):RB(s.formatLocale,s.locale,+s.weekStart));xn(()=>{i("mount",{cmp:"calendar",refs:m}),a.value.noSwipe||y.value&&(y.value.addEventListener("touchstart",ne,{passive:!1}),y.value.addEventListener("touchend",ue,{passive:!1}),y.value.addEventListener("touchmove",Y,{passive:!1})),s.monthChangeOnScroll&&y.value&&y.value.addEventListener("wheel",ie,{passive:!1})});const A=z=>z?s.vertical?"vNext":"next":s.vertical?"vPrevious":"previous",P=(z,ge)=>{if(s.transitions){const S=ni(sr(xe(),s.month,s.year));b.value=nn(ni(sr(xe(),z,ge)),S)?o.value[A(!0)]:o.value[A(!1)],v.value=!1,Rn(()=>{v.value=!0})}},F=be(()=>({...h.value.calendar??{}})),H=be(()=>z=>{const ge=$B(z);return{dp__marker_dot:ge.type==="dot",dp__marker_line:ge.type==="line"}}),te=be(()=>z=>ct(z,f.value)),N=be(()=>({dp__calendar:!0,dp__calendar_next:c.value.count>0&&s.instance!==0})),L=be(()=>z=>s.hideOffsetDates?z.current:!0),I=async(z,ge)=>{const{width:S,height:O}=z.getBoundingClientRect();f.value=ge.value;let K={left:`${S/2}px`},U=-50;if(await Rn(),C.value[0]){const{left:re,width:j}=C.value[0].getBoundingClientRect();re<0&&(K={left:"0"},U=0,w.value.left=`${S/2}px`),window.innerWidth{var O,K,U;const re=mn(m.value[ge][S]);re&&((O=z.marker)!=null&&O.customPosition&&(U=(K=z.marker)==null?void 0:K.tooltip)!=null&&U.length?p.value=z.marker.customPosition(re):await I(re,z),i("tooltip-open",z.marker))},X=async(z,ge,S)=>{var O,K;if(x.value&&d.value.enabled&&d.value.dragSelect)return i("select-date",z);i("set-hover-date",z),(K=(O=z.marker)==null?void 0:O.tooltip)!=null&&K.length&&await W(z,ge,S)},J=z=>{f.value&&(f.value=null,p.value=JSON.parse(JSON.stringify({bottom:"",left:"",transform:""})),i("tooltip-close",z.marker))},ne=z=>{E.value.startX=z.changedTouches[0].screenX,E.value.startY=z.changedTouches[0].screenY},ue=z=>{E.value.endX=z.changedTouches[0].screenX,E.value.endY=z.changedTouches[0].screenY,Z()},Y=z=>{s.vertical&&!s.inline&&z.preventDefault()},Z=()=>{const z=s.vertical?"Y":"X";Math.abs(E.value[`start${z}`]-E.value[`end${z}`])>10&&i("handle-swipe",E.value[`start${z}`]>E.value[`end${z}`]?"right":"left")},M=(z,ge,S)=>{z&&(Array.isArray(m.value[ge])?m.value[ge][S]=z:m.value[ge]=[z]),s.arrowNavigation&&r(m.value,"calendar")},ie=z=>{s.monthChangeOnScroll&&(z.preventDefault(),i("handle-scroll",z))},le=z=>u.value.type==="local"?I_(z.value,{weekStartsOn:+s.weekStart}):u.value.type==="iso"?A_(z.value):typeof u.value.type=="function"?u.value.type(z.value):"",$=z=>{const ge=z[0];return u.value.hideOnOffsetDates?z.some(S=>S.current)?le(ge):"":le(ge)},oe=(z,ge,S=!0)=>{S&&BB()||d.value.enabled||(Qr(z,a.value),i("select-date",ge))},de=z=>{Qr(z,a.value)},ve=z=>{d.value.enabled&&d.value.dragSelect?(x.value=!0,i("select-date",z)):d.value.enabled&&i("select-date",z)};return e({triggerTransition:P}),(z,ge)=>(D(),V("div",{class:Ie(N.value)},[g("div",{ref_key:"calendarWrapRef",ref:y,class:Ie(F.value),role:"grid"},[g("div",G4,[z.weekNumbers?(D(),V("div",X4,Ee(z.weekNumName),1)):ce("",!0),(D(!0),V($e,null,Xe(k.value,(S,O)=>{var K,U;return D(),V("div",{key:O,class:"dp__calendar_header_item",role:"gridcell","data-test":"calendar-header","aria-label":(U=(K=Q(l))==null?void 0:K.weekDay)==null?void 0:U.call(K,O)},[z.$slots["calendar-header"]?Oe(z.$slots,"calendar-header",{key:0,day:S,index:O}):ce("",!0),z.$slots["calendar-header"]?ce("",!0):(D(),V($e,{key:1},[He(Ee(S),1)],64))],8,q4)}),128))]),Z4,B(Rt,{name:b.value,css:!!z.transitions},{default:Re(()=>[v.value?(D(),V("div",{key:0,class:"dp__calendar",role:"rowgroup",onMouseleave:ge[1]||(ge[1]=S=>x.value=!1)},[(D(!0),V($e,null,Xe(T.value,(S,O)=>(D(),V("div",{key:O,class:"dp__calendar_row",role:"row"},[z.weekNumbers?(D(),V("div",J4,[g("div",Q4,Ee($(S.days)),1)])):ce("",!0),(D(!0),V($e,null,Xe(S.days,(K,U)=>{var re,j,se;return D(),V("div",{id:Q(sC)(K.value),ref_for:!0,ref:ee=>M(ee,O,U),key:U+O,role:"gridcell",class:"dp__calendar_item","aria-pressed":(K.classData.dp__active_date||K.classData.dp__range_start||K.classData.dp__range_start)??void 0,"aria-disabled":K.classData.dp__cell_disabled||void 0,"aria-label":(j=(re=Q(l))==null?void 0:re.day)==null?void 0:j.call(re,K),tabindex:"0","data-test":K.value,onClick:iu(ee=>oe(ee,K),["prevent"]),onTouchend:ee=>oe(ee,K,!1),onKeydown:ee=>Q(Qn)(ee,()=>z.$emit("select-date",K)),onMouseenter:ee=>X(K,O,U),onMouseleave:ee=>J(K),onMousedown:ee=>ve(K),onMouseup:ge[0]||(ge[0]=ee=>x.value=!1)},[g("div",{class:Ie(["dp__cell_inner",K.classData])},[z.$slots.day&&L.value(K)?Oe(z.$slots,"day",{key:0,day:+K.text,date:K.value}):ce("",!0),z.$slots.day?ce("",!0):(D(),V($e,{key:1},[He(Ee(K.text),1)],64)),K.marker&&L.value(K)?(D(),V($e,{key:2},[z.$slots.marker?Oe(z.$slots,"marker",{key:0,marker:K.marker,day:+K.text,date:K.value}):(D(),V("div",{key:1,class:Ie(H.value(K.marker)),style:Mn(K.marker.color?{backgroundColor:K.marker.color}:{})},null,6))],64)):ce("",!0),te.value(K.value)?(D(),V("div",{key:3,ref_for:!0,ref_key:"activeTooltip",ref:C,class:"dp__marker_tooltip",style:Mn(p.value)},[(se=K.marker)!=null&&se.tooltip?(D(),V("div",{key:0,class:"dp__tooltip_content",onClick:de},[(D(!0),V($e,null,Xe(K.marker.tooltip,(ee,fe)=>(D(),V("div",{key:fe,class:"dp__tooltip_text"},[z.$slots["marker-tooltip"]?Oe(z.$slots,"marker-tooltip",{key:0,tooltip:ee,day:K.value}):ce("",!0),z.$slots["marker-tooltip"]?ce("",!0):(D(),V($e,{key:1},[g("div",{class:"dp__tooltip_mark",style:Mn(ee.color?{backgroundColor:ee.color}:{})},null,4),g("div",null,Ee(ee.text),1)],64))]))),128)),g("div",{class:"dp__arrow_bottom_tp",style:Mn(w.value)},null,4)])):ce("",!0)],4)):ce("",!0)],2)],40,eV)}),128))]))),128))],32)):ce("",!0)]),_:3},8,["name","css"])],2)],2))}}),Ab=t=>Array.isArray(t),nV=(t,e,n,i)=>{const s=we([]),r=we(new Date),o=we(),a=()=>ne(t.isTextInputDate),{modelValue:l,calendars:c,time:u,today:d}=Fu(t,e,a),{defaultedMultiCalendars:h,defaultedStartTime:f,defaultedRange:p,defaultedConfig:m,defaultedTz:y,propDates:v,defaultedMultiDates:b}=Wt(t),{validateMonthYearInRange:E,isDisabled:C,isDateRangeAllowed:w,checkMinMaxRange:x}=_o(t),{updateTimeValues:T,getSetDateTime:k,setTime:A,assignStartTime:P,validateTime:F,disabledTimesConfig:H}=dC(t,u,l,i),te=be(()=>ae=>c.value[ae]?c.value[ae].month:0),N=be(()=>ae=>c.value[ae]?c.value[ae].year:0),L=ae=>!m.value.keepViewOnOffsetClick||ae?!0:!o.value,I=(ae,Te,he,ke=!1)=>{var De,Ht;L(ke)&&(c.value[ae]||(c.value[ae]={month:0,year:0}),c.value[ae].month=Eb(Te)?(De=c.value[ae])==null?void 0:De.month:Te,c.value[ae].year=Eb(he)?(Ht=c.value[ae])==null?void 0:Ht.year:he)},W=()=>{t.autoApply&&e("select-date")};xn(()=>{t.shadow||(l.value||(z(),f.value&&P(f.value)),ne(!0),t.focusStartDate&&t.startDate&&z())});const X=be(()=>{var ae;return(ae=t.flow)!=null&&ae.length&&!t.partialFlow?t.flowStep===t.flow.length:!0}),J=()=>{t.autoApply&&X.value&&e("auto-apply",t.partialFlow?t.flowStep!==t.flow.length:!1)},ne=(ae=!1)=>{if(l.value)return Array.isArray(l.value)?(s.value=l.value,$(ae)):Z(l.value,ae);if(h.value.count&&ae&&!t.startDate)return Y(xe(),ae)},ue=()=>Array.isArray(l.value)&&p.value.enabled?at(l.value[0])===at(l.value[1]??l.value[0]):!1,Y=(ae=new Date,Te=!1)=>{if((!h.value.count||!h.value.static||Te)&&I(0,at(ae),Ge(ae)),h.value.count&&(!h.value.solo||!l.value||ue()))for(let he=1;he{Y(ae),A("hours",pr(ae)),A("minutes",oo(ae)),A("seconds",El(ae)),h.value.count&&Te&&ve()},M=ae=>{if(h.value.count){if(h.value.solo)return 0;const Te=at(ae[0]),he=at(ae[1]);return Math.abs(he-Te){ae[1]&&p.value.showLastInRange?Y(ae[M(ae)],Te):Y(ae[0],Te);const he=(ke,De)=>[ke(ae[0]),ae[1]?ke(ae[1]):u[De][1]];A("hours",he(pr,"hours")),A("minutes",he(oo,"minutes")),A("seconds",he(El,"seconds"))},le=(ae,Te)=>{if((p.value.enabled||t.weekPicker)&&!b.value.enabled)return ie(ae,Te);if(b.value.enabled&&Te){const he=ae[ae.length-1];return Z(he,Te)}},$=ae=>{const Te=l.value;le(Te,ae),h.value.count&&h.value.solo&&ve()},oe=(ae,Te)=>{const he=It(xe(),{month:te.value(Te),year:N.value(Te)}),ke=ae<0?us(he,1):Cl(he,1);E(at(ke),Ge(ke),ae<0,t.preventMinMaxNavigation)&&(I(Te,at(ke),Ge(ke)),e("update-month-year",{instance:Te,month:at(ke),year:Ge(ke)}),h.value.count&&!h.value.solo&&de(Te),n())},de=ae=>{for(let Te=ae-1;Te>=0;Te--){const he=Cl(It(xe(),{month:te.value(Te+1),year:N.value(Te+1)}),1);I(Te,at(he),Ge(he))}for(let Te=ae+1;Te<=h.value.count-1;Te++){const he=us(It(xe(),{month:te.value(Te-1),year:N.value(Te-1)}),1);I(Te,at(he),Ge(he))}},ve=()=>{if(Array.isArray(l.value)&&l.value.length===2){const ae=xe(xe(l.value[1]?l.value[1]:us(l.value[0],1))),[Te,he]=[at(l.value[0]),Ge(l.value[0])],[ke,De]=[at(l.value[1]),Ge(l.value[1])];(Te!==ke||Te===ke&&he!==De)&&h.value.solo&&I(1,at(ae),Ge(ae))}else l.value&&!Array.isArray(l.value)&&(I(0,at(l.value),Ge(l.value)),Y(xe()))},z=()=>{t.startDate&&(I(0,at(xe(t.startDate)),Ge(xe(t.startDate))),h.value.count&&de(0))},ge=(ae,Te)=>{if(t.monthChangeOnScroll){const he=new Date().getTime()-r.value.getTime(),ke=Math.abs(ae.deltaY);let De=500;ke>1&&(De=100),ke>100&&(De=0),he>De&&(r.value=new Date,oe(t.monthChangeOnScroll!=="inverse"?-ae.deltaY:ae.deltaY,Te))}},S=(ae,Te,he=!1)=>{t.monthChangeOnArrows&&t.vertical===he&&O(ae,Te)},O=(ae,Te)=>{oe(ae==="right"?-1:1,Te)},K=ae=>{if(v.value.markers)return bh(ae.value,v.value.markers)},U=(ae,Te)=>{switch(t.sixWeeks===!0?"append":t.sixWeeks){case"prepend":return[!0,!1];case"center":return[ae==0,!0];case"fair":return[ae==0||Te>ae,!0];case"append":return[!1,!1];default:return[!1,!1]}},re=(ae,Te,he,ke)=>{if(t.sixWeeks&&ae.length<6){const De=6-ae.length,Ht=(Te.getDay()+7-ke)%7,un=6-(he.getDay()+7-ke)%7,[Di,zs]=U(Ht,un);for(let dn=1;dn<=De;dn++)if(zs?!!(dn%2)==Di:Di){const En=ae[0].days[0],Sn=j(ss(En.value,-7),at(Te));ae.unshift({days:Sn})}else{const En=ae[ae.length-1],Sn=En.days[En.days.length-1],ii=j(ss(Sn.value,1),at(Te));ae.push({days:ii})}}return ae},j=(ae,Te)=>{const he=xe(ae),ke=[];for(let De=0;De<7;De++){const Ht=ss(he,De),un=at(Ht)!==Te;ke.push({text:t.hideOffsetDates&&un?"":Ht.getDate(),value:Ht,current:!un,classData:{}})}return ke},se=(ae,Te)=>{const he=[],ke=new Date(Te,ae),De=new Date(Te,ae+1,0),Ht=t.weekStart,un=fs(ke,{weekStartsOn:Ht}),Di=zs=>{const dn=j(zs,ae);if(he.push({days:dn}),!he[he.length-1].days.some(En=>ct(ni(En.value),ni(De)))){const En=ss(zs,7);Di(En)}};return Di(un),re(he,ke,De,Ht)},ee=ae=>{const Te=eo(xe(ae.value),u.hours,u.minutes,Be());e("date-update",Te),b.value.enabled?H_(Te,l,b.value.limit):l.value=Te,i(),Rn().then(()=>{J()})},fe=ae=>p.value.noDisabledRange?QS(s.value[0],ae).some(Te=>C(Te)):!1,me=()=>{s.value=l.value?l.value.slice():[],s.value.length===2&&!(p.value.fixedStart||p.value.fixedEnd)&&(s.value=[])},pe=(ae,Te)=>{const he=[xe(ae.value),ss(xe(ae.value),+p.value.autoRange)];w(he)?(Te&&Le(ae.value),s.value=he):e("invalid-date",ae.value)},Le=ae=>{const Te=at(xe(ae)),he=Ge(xe(ae));if(I(0,Te,he),h.value.count>0)for(let ke=1;ke{if(fe(ae.value)||!x(ae.value,l.value,p.value.fixedStart?0:1))return e("invalid-date",ae.value);s.value=lC(xe(ae.value),l,e,p)},ze=(ae,Te)=>{if(me(),p.value.autoRange)return pe(ae,Te);if(p.value.fixedStart||p.value.fixedEnd)return Ae(ae);s.value[0]?x(xe(ae.value),l.value)&&!fe(ae.value)?Xt(xe(ae.value),xe(s.value[0]))?(s.value.unshift(xe(ae.value)),e("range-end",s.value[0])):(s.value[1]=xe(ae.value),e("range-end",s.value[1])):(t.autoApply&&e("auto-apply-invalid",ae.value),e("invalid-date",ae.value)):(s.value[0]=xe(ae.value),e("range-start",s.value[0]))},Be=(ae=!0)=>t.enableSeconds?Array.isArray(u.seconds)?ae?u.seconds[0]:u.seconds[1]:u.seconds:0,nt=ae=>{s.value[ae]=eo(s.value[ae],u.hours[ae],u.minutes[ae],Be(ae!==1))},Ze=()=>{var ae,Te;s.value[0]&&s.value[1]&&+((ae=s.value)==null?void 0:ae[0])>+((Te=s.value)==null?void 0:Te[1])&&(s.value.reverse(),e("range-start",s.value[0]),e("range-end",s.value[1]))},Mt=()=>{s.value.length&&(s.value[0]&&!s.value[1]?nt(0):(nt(0),nt(1),i()),Ze(),l.value=s.value.slice(),vf(s.value,e,t.autoApply,t.modelAuto))},gn=(ae,Te=!1)=>{if(C(ae.value)||!ae.current&&t.hideOffsetDates)return e("invalid-date",ae.value);if(o.value=JSON.parse(JSON.stringify(ae)),!p.value.enabled)return ee(ae);Ab(u.hours)&&Ab(u.minutes)&&!b.value.enabled&&(ze(ae,Te),Mt())},Un=(ae,Te)=>{var he;I(ae,Te.month,Te.year,!0),h.value.count&&!h.value.solo&&de(ae),e("update-month-year",{instance:ae,month:Te.month,year:Te.year}),n(h.value.solo?ae:void 0);const ke=(he=t.flow)!=null&&he.length?t.flow[t.flowStep]:void 0;!Te.fromNav&&(ke===zn.month||ke===zn.year)&&i()},Ri=(ae,Te)=>{aC({value:ae,modelValue:l,range:p.value.enabled,timezone:Te?void 0:y.value.timezone}),W(),t.multiCalendars&&Rn().then(()=>ne(!0))},wi=()=>{const ae=F_(xe(),y.value);p.value.enabled?l.value&&Array.isArray(l.value)&&l.value[0]?l.value=Xt(ae,l.value[0])?[ae,l.value[0]]:[l.value[0],ae]:l.value=[ae]:l.value=ae,W()},Xi=()=>{if(Array.isArray(l.value))if(b.value.enabled){const ae=Ut();l.value[l.value.length-1]=k(ae)}else l.value=l.value.map((ae,Te)=>ae&&k(ae,Te));else l.value=k(l.value);e("time-update")},Ut=()=>Array.isArray(l.value)&&l.value.length?l.value[l.value.length-1]:null;return{calendars:c,modelValue:l,month:te,year:N,time:u,disabledTimesConfig:H,today:d,validateTime:F,getCalendarDays:se,getMarker:K,handleScroll:ge,handleSwipe:O,handleArrow:S,selectDate:gn,updateMonthYear:Un,presetDate:Ri,selectCurrentDate:wi,updateTime:(ae,Te=!0,he=!1)=>{T(ae,Te,he,Xi)},assignMonthAndYear:Y}},iV={key:0},sV=cn({__name:"DatePicker",props:{...ps},emits:["tooltip-open","tooltip-close","mount","update:internal-model-value","update-flow-step","reset-flow","auto-apply","focus-menu","select-date","range-start","range-end","invalid-fixed-range","time-update","am-pm-change","time-picker-open","time-picker-close","recalculate-position","update-month-year","auto-apply-invalid","date-update","invalid-date","overlay-toggle"],setup(t,{expose:e,emit:n}){const i=n,s=t,{calendars:r,month:o,year:a,modelValue:l,time:c,disabledTimesConfig:u,today:d,validateTime:h,getCalendarDays:f,getMarker:p,handleArrow:m,handleScroll:y,handleSwipe:v,selectDate:b,updateMonthYear:E,presetDate:C,selectCurrentDate:w,updateTime:x,assignMonthAndYear:T}=nV(s,i,ue,Y),k=pa(),{setHoverDate:A,getDayClassData:P,clearHoverDate:F}=wV(l,s),{defaultedMultiCalendars:H}=Wt(s),te=we([]),N=we([]),L=we(null),I=ki(k,"calendar"),W=ki(k,"monthYear"),X=ki(k,"timePicker"),J=ge=>{s.shadow||i("mount",ge)};fn(r,()=>{s.shadow||setTimeout(()=>{i("recalculate-position")},0)},{deep:!0}),fn(H,(ge,S)=>{ge.count-S.count>0&&T()},{deep:!0});const ne=be(()=>ge=>f(o.value(ge),a.value(ge)).map(S=>({...S,days:S.days.map(O=>(O.marker=p(O),O.classData=P(O),O))})));function ue(ge){var S;ge||ge===0?(S=N.value[ge])==null||S.triggerTransition(o.value(ge),a.value(ge)):N.value.forEach((O,K)=>O.triggerTransition(o.value(K),a.value(K)))}function Y(){i("update-flow-step")}const Z=(ge,S=!1)=>{b(ge,S),s.spaceConfirm&&i("select-date")},M=(ge,S,O=0)=>{var K;(K=te.value[O])==null||K.toggleMonthPicker(ge,S)},ie=(ge,S,O=0)=>{var K;(K=te.value[O])==null||K.toggleYearPicker(ge,S)},le=(ge,S,O)=>{var K;(K=L.value)==null||K.toggleTimePicker(ge,S,O)},$=(ge,S)=>{var O;if(!s.range){const K=l.value?l.value:d,U=S?new Date(S):K,re=ge?fs(U,{weekStartsOn:1}):DS(U,{weekStartsOn:1});b({value:re,current:at(U)===o.value(0),text:"",classData:{}}),(O=document.getElementById(sC(re)))==null||O.focus()}},oe=ge=>{var S;(S=te.value[0])==null||S.handleMonthYearChange(ge,!0)},de=ge=>{E(0,{month:o.value(0),year:a.value(0)+(ge?1:-1),fromNav:!0})},ve=(ge,S)=>{ge===zn.time&&i(`time-picker-${S?"open":"close"}`),i("overlay-toggle",{open:S,overlay:ge})},z=ge=>{i("overlay-toggle",{open:!1,overlay:ge}),i("focus-menu")};return e({clearHoverDate:F,presetDate:C,selectCurrentDate:w,toggleMonthPicker:M,toggleYearPicker:ie,toggleTimePicker:le,handleArrow:m,updateMonthYear:E,getSidebarProps:()=>({modelValue:l,month:o,year:a,time:c,updateTime:x,updateMonthYear:E,selectDate:b,presetDate:C}),changeMonth:oe,changeYear:de,selectWeekDate:$}),(ge,S)=>(D(),V($e,null,[B(yf,{"multi-calendars":Q(H).count,collapse:ge.collapse},{default:Re(({instance:O,index:K})=>[ge.disableMonthYearSelect?ce("",!0):(D(),Ce(U4,yn({key:0,ref:U=>{U&&(te.value[K]=U)},months:Q(US)(ge.formatLocale,ge.locale,ge.monthNameFormat),years:Q(B_)(ge.yearRange,ge.locale,ge.reverseYears),month:Q(o)(O),year:Q(a)(O),instance:O},ge.$props,{onMount:S[0]||(S[0]=U=>J(Q(ta).header)),onResetFlow:S[1]||(S[1]=U=>ge.$emit("reset-flow")),onUpdateMonthYear:U=>Q(E)(O,U),onOverlayClosed:z,onOverlayOpened:S[2]||(S[2]=U=>ge.$emit("overlay-toggle",{open:!0,overlay:U}))}),jn({_:2},[Xe(Q(W),(U,re)=>({name:U,fn:Re(j=>[Oe(ge.$slots,U,In(Zn(j)))])}))]),1040,["months","years","month","year","instance","onUpdateMonthYear"])),B(tV,yn({ref:U=>{U&&(N.value[K]=U)},"mapped-dates":ne.value(O),month:Q(o)(O),year:Q(a)(O),instance:O},ge.$props,{onSelectDate:U=>Q(b)(U,O!==1),onHandleSpace:U=>Z(U,O!==1),onSetHoverDate:S[3]||(S[3]=U=>Q(A)(U)),onHandleScroll:U=>Q(y)(U,O),onHandleSwipe:U=>Q(v)(U,O),onMount:S[4]||(S[4]=U=>J(Q(ta).calendar)),onResetFlow:S[5]||(S[5]=U=>ge.$emit("reset-flow")),onTooltipOpen:S[6]||(S[6]=U=>ge.$emit("tooltip-open",U)),onTooltipClose:S[7]||(S[7]=U=>ge.$emit("tooltip-close",U))}),jn({_:2},[Xe(Q(I),(U,re)=>({name:U,fn:Re(j=>[Oe(ge.$slots,U,In(Zn({...j})))])}))]),1040,["mapped-dates","month","year","instance","onSelectDate","onHandleSpace","onHandleScroll","onHandleSwipe"])]),_:3},8,["multi-calendars","collapse"]),ge.enableTimePicker?(D(),V("div",iV,[ge.$slots["time-picker"]?Oe(ge.$slots,"time-picker",In(yn({key:0},{time:Q(c),updateTime:Q(x)}))):(D(),Ce(uC,yn({key:1,ref_key:"timePickerRef",ref:L},ge.$props,{hours:Q(c).hours,minutes:Q(c).minutes,seconds:Q(c).seconds,"internal-model-value":ge.internalModelValue,"disabled-times-config":Q(u),"validate-time":Q(h),onMount:S[8]||(S[8]=O=>J(Q(ta).timePicker)),"onUpdate:hours":S[9]||(S[9]=O=>Q(x)(O)),"onUpdate:minutes":S[10]||(S[10]=O=>Q(x)(O,!1)),"onUpdate:seconds":S[11]||(S[11]=O=>Q(x)(O,!1,!0)),onResetFlow:S[12]||(S[12]=O=>ge.$emit("reset-flow")),onOverlayClosed:S[13]||(S[13]=O=>ve(O,!1)),onOverlayOpened:S[14]||(S[14]=O=>ve(O,!0)),onAmPmChange:S[15]||(S[15]=O=>ge.$emit("am-pm-change",O))}),jn({_:2},[Xe(Q(X),(O,K)=>({name:O,fn:Re(U=>[Oe(ge.$slots,O,In(Zn(U)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"]))])):ce("",!0)],64))}}),rV=(t,e)=>{const n=we(),{defaultedMultiCalendars:i,defaultedConfig:s,defaultedHighlight:r,defaultedRange:o,propDates:a,defaultedFilters:l,defaultedMultiDates:c}=Wt(t),{modelValue:u,year:d,month:h,calendars:f}=Fu(t,e),{isDisabled:p}=_o(t),{selectYear:m,groupedYears:y,showYearPicker:v,isDisabled:b,toggleYearPicker:E,handleYearSelect:C,handleYear:w}=cC({modelValue:u,multiCalendars:i,range:o,highlight:r,calendars:f,propDates:a,month:h,year:d,filters:l,props:t,emit:e}),x=(L,I)=>[L,I].map(W=>Rs(W,"MMMM",{locale:t.formatLocale})).join("-"),T=be(()=>L=>u.value?Array.isArray(u.value)?u.value.some(I=>bb(L,I)):bb(u.value,L):!1),k=L=>{if(o.value.enabled){if(Array.isArray(u.value)){const I=ct(L,u.value[0])||ct(L,u.value[1]);return mf(u.value,n.value,L)&&!I}return!1}return!1},A=(L,I)=>L.quarter===gb(I)&&L.year===Ge(I),P=L=>typeof r.value=="function"?r.value({quarter:gb(L),year:Ge(L)}):!!r.value.quarters.find(I=>A(I,L)),F=be(()=>L=>{const I=It(new Date,{year:d.value(L)});return DF({start:ru(I),end:RS(I)}).map(W=>{const X=Ko(W),J=pb(W),ne=p(W),ue=k(X),Y=P(X);return{text:x(X,J),value:X,active:T.value(X),highlighted:Y,disabled:ne,isBetween:ue}})}),H=L=>{H_(L,u,c.value.limit),e("auto-apply",!0)},te=L=>{u.value=Y_(u,L,e),vf(u.value,e,t.autoApply,t.modelAuto)},N=L=>{u.value=L,e("auto-apply")};return{defaultedConfig:s,defaultedMultiCalendars:i,groupedYears:y,year:d,isDisabled:b,quarters:F,showYearPicker:v,modelValue:u,setHoverDate:L=>{n.value=L},selectYear:m,selectQuarter:(L,I,W)=>{if(!W)return f.value[I].month=at(pb(L)),c.value.enabled?H(L):o.value.enabled?te(L):N(L)},toggleYearPicker:E,handleYearSelect:C,handleYear:w}},oV={class:"dp--quarter-items"},aV=["data-test","disabled","onClick","onMouseover"],lV=cn({compatConfig:{MODE:3},__name:"QuarterPicker",props:{...ps},emits:["update:internal-model-value","reset-flow","overlay-closed","auto-apply","range-start","range-end","overlay-toggle","update-month-year"],setup(t,{expose:e,emit:n}){const i=n,s=t,r=pa(),o=ki(r,"yearMode"),{defaultedMultiCalendars:a,defaultedConfig:l,groupedYears:c,year:u,isDisabled:d,quarters:h,modelValue:f,showYearPicker:p,setHoverDate:m,selectQuarter:y,toggleYearPicker:v,handleYearSelect:b,handleYear:E}=rV(s,i);return e({getSidebarProps:()=>({modelValue:f,year:u,selectQuarter:y,handleYearSelect:b,handleYear:E})}),(C,w)=>(D(),Ce(yf,{"multi-calendars":Q(a).count,collapse:C.collapse,stretch:""},{default:Re(({instance:x})=>[g("div",{class:"dp-quarter-picker-wrap",style:Mn({minHeight:`${Q(l).modeHeight}px`})},[C.$slots["top-extra"]?Oe(C.$slots,"top-extra",{key:0,value:C.internalModelValue}):ce("",!0),g("div",null,[B(oC,yn(C.$props,{items:Q(c)(x),instance:x,"show-year-picker":Q(p)[x],year:Q(u)(x),"is-disabled":T=>Q(d)(x,T),onHandleYear:T=>Q(E)(x,T),onYearSelect:T=>Q(b)(T,x),onToggleYearPicker:T=>Q(v)(x,T?.flow,T?.show)}),jn({_:2},[Xe(Q(o),(T,k)=>({name:T,fn:Re(A=>[Oe(C.$slots,T,In(Zn(A)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),g("div",oV,[(D(!0),V($e,null,Xe(Q(h)(x),(T,k)=>(D(),V("div",{key:k},[g("button",{type:"button",class:Ie(["dp--qr-btn",{"dp--qr-btn-active":T.active,"dp--qr-btn-between":T.isBetween,"dp--qr-btn-disabled":T.disabled,"dp--highlighted":T.highlighted}]),"data-test":T.value,disabled:T.disabled,onClick:A=>Q(y)(T.value,x,T.disabled),onMouseover:A=>Q(m)(T.value)},[C.$slots.quarter?Oe(C.$slots,"quarter",{key:0,value:T.value,text:T.text}):(D(),V($e,{key:1},[He(Ee(T.text),1)],64))],42,aV)]))),128))])],4)]),_:3},8,["multi-calendars","collapse"]))}}),cV=["id","tabindex","role","aria-label"],uV={key:0,class:"dp--menu-load-container"},dV=g("span",{class:"dp--menu-loader"},null,-1),hV=[dV],fV={key:1,class:"dp--menu-header"},gV={key:0,class:"dp__sidebar_left"},pV=["data-test","onClick","onKeydown"],mV={key:2,class:"dp__sidebar_right"},_V={key:3,class:"dp__action_extra"},Mb=cn({compatConfig:{MODE:3},__name:"DatepickerMenu",props:{..._f,shadow:{type:Boolean,default:!1},openOnTop:{type:Boolean,default:!1},internalModelValue:{type:[Date,Array],default:null},noOverlayFocus:{type:Boolean,default:!1},collapse:{type:Boolean,default:!1},getInputRect:{type:Function,default:()=>({})},isTextInputDate:{type:Boolean,default:!1}},emits:["close-picker","select-date","auto-apply","time-update","flow-step","update-month-year","invalid-select","update:internal-model-value","recalculate-position","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","auto-apply-invalid","date-update","invalid-date","overlay-toggle"],setup(t,{expose:e,emit:n}){const i=n,s=t,r=we(null),o=be(()=>{const{openOnTop:j,...se}=s;return{...se,flowStep:A.value,collapse:s.collapse,noOverlayFocus:s.noOverlayFocus,menuWrapRef:r.value}}),{setMenuFocused:a,setShiftKey:l,control:c}=rC(),u=pa(),{defaultedTextInput:d,defaultedInline:h,defaultedConfig:f,defaultedUI:p}=Wt(s),m=we(null),y=we(0),v=we(null),b=we(!1),E=we(null);xn(()=>{if(!s.shadow){b.value=!0,C(),window.addEventListener("resize",C);const j=mn(r);if(j&&!d.value.enabled&&!h.value.enabled&&(a(!0),I()),j){const se=ee=>{f.value.allowPreventDefault&&ee.preventDefault(),Qr(ee,f.value,!0)};j.addEventListener("pointerdown",se),j.addEventListener("mousedown",se)}}}),Yl(()=>{window.removeEventListener("resize",C)});const C=()=>{const j=mn(v);j&&(y.value=j.getBoundingClientRect().width)},{arrowRight:w,arrowLeft:x,arrowDown:T,arrowUp:k}=mo(),{flowStep:A,updateFlowStep:P,childMount:F,resetFlow:H,handleFlow:te}=xV(s,i,E),N=be(()=>s.monthPicker?x4:s.yearPicker?S4:s.timePicker?z4:s.quarterPicker?lV:sV),L=be(()=>{var j;if(f.value.arrowLeft)return f.value.arrowLeft;const se=(j=r.value)==null?void 0:j.getBoundingClientRect(),ee=s.getInputRect();return ee?.width=(se?.right??0)&&ee?.width{const j=mn(r);j&&j.focus({preventScroll:!0})},W=be(()=>{var j;return((j=E.value)==null?void 0:j.getSidebarProps())||{}}),X=()=>{s.openOnTop&&i("recalculate-position")},J=ki(u,"action"),ne=be(()=>s.monthPicker||s.yearPicker?ki(u,"monthYear"):s.timePicker?ki(u,"timePicker"):ki(u,"shared")),ue=be(()=>s.openOnTop?"dp__arrow_bottom":"dp__arrow_top"),Y=be(()=>({dp__menu_disabled:s.disabled,dp__menu_readonly:s.readonly,"dp-menu-loading":s.loading})),Z=be(()=>({dp__menu:!0,dp__menu_index:!h.value.enabled,dp__relative:h.value.enabled,...p.value.menu??{}})),M=j=>{Qr(j,f.value,!0)},ie=()=>{s.escClose&&i("close-picker")},le=j=>{if(s.arrowNavigation){if(j===Xn.up)return k();if(j===Xn.down)return T();if(j===Xn.left)return x();if(j===Xn.right)return w()}else j===Xn.left||j===Xn.up?z("handleArrow",Xn.left,0,j===Xn.up):z("handleArrow",Xn.right,0,j===Xn.down)},$=j=>{l(j.shiftKey),!s.disableMonthYearSelect&&j.code===Lt.tab&&j.target.classList.contains("dp__menu")&&c.value.shiftKeyInMenu&&(j.preventDefault(),Qr(j,f.value,!0),i("close-picker"))},oe=()=>{I(),i("time-picker-close")},de=j=>{var se,ee,fe;(se=E.value)==null||se.toggleTimePicker(!1,!1),(ee=E.value)==null||ee.toggleMonthPicker(!1,!1,j),(fe=E.value)==null||fe.toggleYearPicker(!1,!1,j)},ve=(j,se=0)=>{var ee,fe,me;return j==="month"?(ee=E.value)==null?void 0:ee.toggleMonthPicker(!1,!0,se):j==="year"?(fe=E.value)==null?void 0:fe.toggleYearPicker(!1,!0,se):j==="time"?(me=E.value)==null?void 0:me.toggleTimePicker(!0,!1):de(se)},z=(j,...se)=>{var ee,fe;(ee=E.value)!=null&&ee[j]&&((fe=E.value)==null||fe[j](...se))},ge=()=>{z("selectCurrentDate")},S=(j,se)=>{z("presetDate",j,se)},O=()=>{z("clearHoverDate")},K=(j,se)=>{z("updateMonthYear",j,se)},U=(j,se)=>{j.preventDefault(),le(se)},re=j=>{var se,ee,fe;if($(j),j.key===Lt.home||j.key===Lt.end)return z("selectWeekDate",j.key===Lt.home,j.target.getAttribute("id"));switch((j.key===Lt.pageUp||j.key===Lt.pageDown)&&(j.shiftKey?(z("changeYear",j.key===Lt.pageUp),(se=tm(r.value,"overlay-year"))==null||se.focus()):(z("changeMonth",j.key===Lt.pageUp),(ee=tm(r.value,j.key===Lt.pageUp?"action-prev":"action-next"))==null||ee.focus()),j.target.getAttribute("id")&&((fe=r.value)==null||fe.focus({preventScroll:!0}))),j.key){case Lt.esc:return ie();case Lt.arrowLeft:return U(j,Xn.left);case Lt.arrowRight:return U(j,Xn.right);case Lt.arrowUp:return U(j,Xn.up);case Lt.arrowDown:return U(j,Xn.down);default:return}};return e({updateMonthYear:K,switchView:ve,handleFlow:te}),(j,se)=>{var ee,fe,me;return D(),V("div",{id:j.uid?`dp-menu-${j.uid}`:void 0,ref_key:"dpMenuRef",ref:r,tabindex:Q(h).enabled?void 0:"0",role:Q(h).enabled?void 0:"dialog","aria-label":(ee=j.ariaLabels)==null?void 0:ee.menu,class:Ie(Z.value),style:Mn({"--dp-arrow-left":L.value}),onMouseleave:O,onClick:M,onKeydown:re},[(j.disabled||j.readonly)&&Q(h).enabled||j.loading?(D(),V("div",{key:0,class:Ie(Y.value)},[j.loading?(D(),V("div",uV,hV)):ce("",!0)],2)):ce("",!0),j.$slots["menu-header"]?(D(),V("div",fV,[Oe(j.$slots,"menu-header")])):ce("",!0),!Q(h).enabled&&!j.teleportCenter?(D(),V("div",{key:2,class:Ie(ue.value)},null,2)):ce("",!0),g("div",{ref_key:"innerMenuRef",ref:v,class:Ie({dp__menu_content_wrapper:((fe=j.presetDates)==null?void 0:fe.length)||!!j.$slots["left-sidebar"]||!!j.$slots["right-sidebar"],"dp--menu-content-wrapper-collapsed":t.collapse&&(((me=j.presetDates)==null?void 0:me.length)||!!j.$slots["left-sidebar"]||!!j.$slots["right-sidebar"])}),style:Mn({"--dp-menu-width":`${y.value}px`})},[j.$slots["left-sidebar"]?(D(),V("div",gV,[Oe(j.$slots,"left-sidebar",In(Zn(W.value)))])):ce("",!0),j.presetDates.length?(D(),V("div",{key:1,class:Ie({"dp--preset-dates-collapsed":t.collapse,"dp--preset-dates":!0})},[(D(!0),V($e,null,Xe(j.presetDates,(pe,Le)=>(D(),V($e,{key:Le},[pe.slot?Oe(j.$slots,pe.slot,{key:0,presetDate:S,label:pe.label,value:pe.value}):(D(),V("button",{key:1,type:"button",style:Mn(pe.style||{}),class:Ie(["dp__btn dp--preset-range",{"dp--preset-range-collapsed":t.collapse}]),"data-test":pe.testId??void 0,onClick:iu(Ae=>S(pe.value,pe.noTz),["prevent"]),onKeydown:Ae=>Q(Qn)(Ae,()=>S(pe.value,pe.noTz),!0)},Ee(pe.label),47,pV))],64))),128))],2)):ce("",!0),g("div",{ref_key:"calendarWrapperRef",ref:m,class:"dp__instance_calendar",role:"document"},[(D(),Ce(ga(N.value),yn({ref_key:"dynCmpRef",ref:E},o.value,{"flow-step":Q(A),onMount:Q(F),onUpdateFlowStep:Q(P),onResetFlow:Q(H),onFocusMenu:I,onSelectDate:se[0]||(se[0]=pe=>j.$emit("select-date")),onDateUpdate:se[1]||(se[1]=pe=>j.$emit("date-update",pe)),onTooltipOpen:se[2]||(se[2]=pe=>j.$emit("tooltip-open",pe)),onTooltipClose:se[3]||(se[3]=pe=>j.$emit("tooltip-close",pe)),onAutoApply:se[4]||(se[4]=pe=>j.$emit("auto-apply",pe)),onRangeStart:se[5]||(se[5]=pe=>j.$emit("range-start",pe)),onRangeEnd:se[6]||(se[6]=pe=>j.$emit("range-end",pe)),onInvalidFixedRange:se[7]||(se[7]=pe=>j.$emit("invalid-fixed-range",pe)),onTimeUpdate:se[8]||(se[8]=pe=>j.$emit("time-update")),onAmPmChange:se[9]||(se[9]=pe=>j.$emit("am-pm-change",pe)),onTimePickerOpen:se[10]||(se[10]=pe=>j.$emit("time-picker-open",pe)),onTimePickerClose:oe,onRecalculatePosition:X,onUpdateMonthYear:se[11]||(se[11]=pe=>j.$emit("update-month-year",pe)),onAutoApplyInvalid:se[12]||(se[12]=pe=>j.$emit("auto-apply-invalid",pe)),onInvalidDate:se[13]||(se[13]=pe=>j.$emit("invalid-date",pe)),onOverlayToggle:se[14]||(se[14]=pe=>j.$emit("overlay-toggle",pe)),"onUpdate:internalModelValue":se[15]||(se[15]=pe=>j.$emit("update:internal-model-value",pe))}),jn({_:2},[Xe(ne.value,(pe,Le)=>({name:pe,fn:Re(Ae=>[Oe(j.$slots,pe,In(Zn({...Ae})))])}))]),1040,["flow-step","onMount","onUpdateFlowStep","onResetFlow"]))],512),j.$slots["right-sidebar"]?(D(),V("div",mV,[Oe(j.$slots,"right-sidebar",In(Zn(W.value)))])):ce("",!0),j.$slots["action-extra"]?(D(),V("div",_V,[j.$slots["action-extra"]?Oe(j.$slots,"action-extra",{key:0,selectCurrentDate:ge}):ce("",!0)])):ce("",!0)],6),!j.autoApply||Q(f).keepActionRow?(D(),Ce(g4,yn({key:3,"menu-mount":b.value},o.value,{"calendar-width":y.value,onClosePicker:se[16]||(se[16]=pe=>j.$emit("close-picker")),onSelectDate:se[17]||(se[17]=pe=>j.$emit("select-date")),onInvalidSelect:se[18]||(se[18]=pe=>j.$emit("invalid-select")),onSelectNow:ge}),jn({_:2},[Xe(Q(J),(pe,Le)=>({name:pe,fn:Re(Ae=>[Oe(j.$slots,pe,In(Zn({...Ae})))])}))]),1040,["menu-mount","calendar-width"])):ce("",!0)],46,cV)}}});var Ka=(t=>(t.center="center",t.left="left",t.right="right",t))(Ka||{});const yV=({menuRef:t,menuRefInner:e,inputRef:n,pickerWrapperRef:i,inline:s,emit:r,props:o,slots:a})=>{const{defaultedConfig:l}=Wt(o),c=we({}),u=we(!1),d=we({top:"0",left:"0"}),h=we(!1),f=Zc(o,"teleportCenter");fn(f,()=>{d.value=JSON.parse(JSON.stringify({})),w()});const p=I=>{if(o.teleport){const W=I.getBoundingClientRect();return{left:W.left+window.scrollX,top:W.top+window.scrollY}}return{top:0,left:0}},m=(I,W)=>{d.value.left=`${I+W-c.value.width}px`},y=I=>{d.value.left=`${I}px`},v=(I,W)=>{o.position===Ka.left&&y(I),o.position===Ka.right&&m(I,W),o.position===Ka.center&&(d.value.left=`${I+W/2-c.value.width/2}px`)},b=I=>{const{width:W,height:X}=I.getBoundingClientRect(),{top:J,left:ne}=o.altPosition?o.altPosition(I):p(I);return{top:+J,left:+ne,width:W,height:X}},E=()=>{d.value.left="50%",d.value.top="50%",d.value.transform="translate(-50%, -50%)",d.value.position="fixed",delete d.value.opacity},C=()=>{const I=mn(n),{top:W,left:X,transform:J}=o.altPosition(I);d.value={top:`${W}px`,left:`${X}px`,transform:J??""}},w=(I=!0)=>{var W;if(!s.value.enabled){if(f.value)return E();if(o.altPosition!==null)return C();if(I){const X=o.teleport?(W=e.value)==null?void 0:W.$el:t.value;X&&(c.value=X.getBoundingClientRect()),r("recalculate-position")}return H()}},x=({inputEl:I,left:W,width:X})=>{window.screen.width>768&&!u.value&&v(W,X),A(I)},T=I=>{const{top:W,left:X,height:J,width:ne}=b(I);d.value.top=`${J+W+ +o.offset}px`,h.value=!1,u.value||(d.value.left=`${X+ne/2-c.value.width/2}px`),x({inputEl:I,left:X,width:ne})},k=I=>{const{top:W,left:X,width:J}=b(I);d.value.top=`${W-+o.offset-c.value.height}px`,h.value=!0,x({inputEl:I,left:X,width:J})},A=I=>{if(o.autoPosition){const{left:W,width:X}=b(I),{left:J,right:ne}=c.value;if(!u.value){if(Math.abs(J)!==Math.abs(ne)){if(J<=0)return u.value=!0,y(W);if(ne>=document.documentElement.clientWidth)return u.value=!0,m(W,X)}return v(W,X)}}},P=()=>{const I=mn(n);if(I){const{height:W}=c.value,{top:X,height:J}=I.getBoundingClientRect(),ne=window.innerHeight-X-J,ue=X;return W<=ne?Vo.bottom:W>ne&&W<=ue?Vo.top:ne>=ue?Vo.bottom:Vo.top}return Vo.bottom},F=I=>P()===Vo.bottom?T(I):k(I),H=()=>{const I=mn(n);if(I)return o.autoPosition?F(I):T(I)},te=function(I){if(I){const W=I.scrollHeight>I.clientHeight,X=window.getComputedStyle(I).overflowY.indexOf("hidden")!==-1;return W&&!X}return!0},N=function(I){return!I||I===document.body||I.nodeType===Node.DOCUMENT_FRAGMENT_NODE?window:te(I)?I:N(I.assignedSlot&&l.value.shadowDom?I.assignedSlot.parentNode:I.parentNode)},L=I=>{if(I)switch(o.position){case Ka.left:return{left:0,transform:"translateX(0)"};case Ka.right:return{left:`${I.width}px`,transform:"translateX(-100%)"};default:return{left:`${I.width/2}px`,transform:"translateX(-50%)"}}return{}};return{openOnTop:h,menuStyle:d,xCorrect:u,setMenuPosition:w,getScrollableParent:N,shadowRender:(I,W)=>{var X,J,ne;const ue=document.createElement("div"),Y=(X=mn(n))==null?void 0:X.getBoundingClientRect();ue.setAttribute("id","dp--temp-container");const Z=(J=i.value)!=null&&J.clientWidth?i.value:document.body;Z.append(ue);const M=L(Y),ie=l.value.shadowDom?Object.keys(a).filter($=>["right-sidebar","left-sidebar","top-extra","action-extra"].includes($)):Object.keys(a),le=la(I,{...W,shadow:!0,style:{opacity:0,position:"absolute",...M}},Object.fromEntries(ie.map($=>[$,a[$]])));Kv(le,ue),c.value=(ne=le.el)==null?void 0:ne.getBoundingClientRect(),Kv(null,ue),Z.removeChild(ue)}}},kr=[{name:"clock-icon",use:["time","calendar","shared"]},{name:"arrow-left",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-right",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-up",use:["time","calendar","month-year","shared"]},{name:"arrow-down",use:["time","calendar","month-year","shared"]},{name:"calendar-icon",use:["month-year","time","calendar","shared","year-mode"]},{name:"day",use:["calendar","shared"]},{name:"month-overlay-value",use:["calendar","month-year","shared"]},{name:"year-overlay-value",use:["calendar","month-year","shared","year-mode"]},{name:"year-overlay",use:["month-year","shared"]},{name:"month-overlay",use:["month-year","shared"]},{name:"month-overlay-header",use:["month-year","shared"]},{name:"year-overlay-header",use:["month-year","shared"]},{name:"hours-overlay-value",use:["calendar","time","shared"]},{name:"hours-overlay-header",use:["calendar","time","shared"]},{name:"minutes-overlay-value",use:["calendar","time","shared"]},{name:"minutes-overlay-header",use:["calendar","time","shared"]},{name:"seconds-overlay-value",use:["calendar","time","shared"]},{name:"seconds-overlay-header",use:["calendar","time","shared"]},{name:"hours",use:["calendar","time","shared"]},{name:"minutes",use:["calendar","time","shared"]},{name:"month",use:["calendar","month-year","shared"]},{name:"year",use:["calendar","month-year","shared","year-mode"]},{name:"action-buttons",use:["action"]},{name:"action-preview",use:["action"]},{name:"calendar-header",use:["calendar","shared"]},{name:"marker-tooltip",use:["calendar","shared"]},{name:"action-extra",use:["menu"]},{name:"time-picker-overlay",use:["calendar","time","shared"]},{name:"am-pm-button",use:["calendar","time","shared"]},{name:"left-sidebar",use:["menu"]},{name:"right-sidebar",use:["menu"]},{name:"month-year",use:["month-year","shared"]},{name:"time-picker",use:["menu","shared"]},{name:"action-row",use:["action"]},{name:"marker",use:["calendar","shared"]},{name:"quarter",use:["shared"]},{name:"top-extra",use:["shared","month-year"]},{name:"tp-inline-arrow-up",use:["shared","time"]},{name:"tp-inline-arrow-down",use:["shared","time"]},{name:"menu-header",use:["menu"]}],vV=[{name:"trigger"},{name:"input-icon"},{name:"clear-icon"},{name:"dp-input"}],bV={all:()=>kr,monthYear:()=>kr.filter(t=>t.use.includes("month-year")),input:()=>vV,timePicker:()=>kr.filter(t=>t.use.includes("time")),action:()=>kr.filter(t=>t.use.includes("action")),calendar:()=>kr.filter(t=>t.use.includes("calendar")),menu:()=>kr.filter(t=>t.use.includes("menu")),shared:()=>kr.filter(t=>t.use.includes("shared")),yearMode:()=>kr.filter(t=>t.use.includes("year-mode"))},ki=(t,e,n)=>{const i=[];return bV[e]().forEach(s=>{t[s.name]&&i.push(s.name)}),n!=null&&n.length&&n.forEach(s=>{s.slot&&i.push(s.slot)}),i},Nu=t=>{const e=be(()=>i=>t.value?i?t.value.open:t.value.close:""),n=be(()=>i=>t.value?i?t.value.menuAppearTop:t.value.menuAppearBottom:"");return{transitionName:e,showTransition:!!t.value,menuTransition:n}},Fu=(t,e,n)=>{const{defaultedRange:i,defaultedTz:s}=Wt(t),r=xe(_i(xe(),s.value.timezone)),o=we([{month:at(r),year:Ge(r)}]),a=h=>{const f={hours:pr(r),minutes:oo(r),seconds:0};return i.value.enabled?[f[h],f[h]]:f[h]},l=Ns({hours:a("hours"),minutes:a("minutes"),seconds:a("seconds")});fn(i,(h,f)=>{h.enabled!==f.enabled&&(l.hours=a("hours"),l.minutes=a("minutes"),l.seconds=a("seconds"))},{deep:!0});const c=be({get:()=>t.internalModelValue,set:h=>{!t.readonly&&!t.disabled&&e("update:internal-model-value",h)}}),u=be(()=>h=>o.value[h]?o.value[h].month:0),d=be(()=>h=>o.value[h]?o.value[h].year:0);return fn(c,(h,f)=>{n&&JSON.stringify(h??{})!==JSON.stringify(f??{})&&n()},{deep:!0}),{calendars:o,time:l,modelValue:c,month:u,year:d,today:r}},wV=(t,e)=>{const{defaultedMultiCalendars:n,defaultedMultiDates:i,defaultedUI:s,defaultedHighlight:r,defaultedTz:o,propDates:a,defaultedRange:l}=Wt(e),{isDisabled:c}=_o(e),u=we(null),d=we(_i(new Date,o.value.timezone)),h=M=>{!M.current&&e.hideOffsetDates||(u.value=M.value)},f=()=>{u.value=null},p=M=>Array.isArray(t.value)&&l.value.enabled&&t.value[0]&&u.value?M?nn(u.value,t.value[0]):Xt(u.value,t.value[0]):!0,m=(M,ie)=>{const le=()=>t.value?ie?t.value[0]||null:t.value[1]:null,$=t.value&&Array.isArray(t.value)?le():null;return ct(xe(M.value),$)},y=M=>{const ie=Array.isArray(t.value)?t.value[0]:null;return M?!Xt(u.value??null,ie):!0},v=(M,ie=!0)=>(l.value.enabled||e.weekPicker)&&Array.isArray(t.value)&&t.value.length===2?e.hideOffsetDates&&!M.current?!1:ct(xe(M.value),t.value[ie?0:1]):l.value.enabled?m(M,ie)&&y(ie)||ct(M.value,Array.isArray(t.value)?t.value[0]:null)&&p(ie):!1,b=(M,ie)=>{if(Array.isArray(t.value)&&t.value[0]&&t.value.length===1){const le=ct(M.value,u.value);return ie?nn(t.value[0],M.value)&&le:Xt(t.value[0],M.value)&&le}return!1},E=M=>!t.value||e.hideOffsetDates&&!M.current?!1:l.value.enabled?e.modelAuto&&Array.isArray(t.value)?ct(M.value,t.value[0]?t.value[0]:d.value):!1:i.value.enabled&&Array.isArray(t.value)?t.value.some(ie=>ct(ie,M.value)):ct(M.value,t.value?t.value:d.value),C=M=>{if(l.value.autoRange||e.weekPicker){if(u.value){if(e.hideOffsetDates&&!M.current)return!1;const ie=ss(u.value,+l.value.autoRange),le=er(xe(u.value),e.weekStart);return e.weekPicker?ct(le[1],xe(M.value)):ct(ie,xe(M.value))}return!1}return!1},w=M=>{if(l.value.autoRange||e.weekPicker){if(u.value){const ie=ss(u.value,+l.value.autoRange);if(e.hideOffsetDates&&!M.current)return!1;const le=er(xe(u.value),e.weekStart);return e.weekPicker?nn(M.value,le[0])&&Xt(M.value,le[1]):nn(M.value,u.value)&&Xt(M.value,ie)}return!1}return!1},x=M=>{if(l.value.autoRange||e.weekPicker){if(u.value){if(e.hideOffsetDates&&!M.current)return!1;const ie=er(xe(u.value),e.weekStart);return e.weekPicker?ct(ie[0],M.value):ct(u.value,M.value)}return!1}return!1},T=M=>mf(t.value,u.value,M.value),k=()=>e.modelAuto&&Array.isArray(e.internalModelValue)?!!e.internalModelValue[0]:!1,A=()=>e.modelAuto?GS(e.internalModelValue):!0,P=M=>{if(e.weekPicker)return!1;const ie=l.value.enabled?!v(M)&&!v(M,!1):!0;return!c(M.value)&&!E(M)&&!(!M.current&&e.hideOffsetDates)&&ie},F=M=>l.value.enabled?e.modelAuto?k()&&E(M):!1:E(M),H=M=>r.value?FB(M.value,a.value.highlight):!1,te=M=>{const ie=c(M.value);return ie&&(typeof r.value=="function"?!r.value(M.value,ie):!r.value.options.highlightDisabled)},N=M=>{var ie;return typeof r.value=="function"?r.value(M.value):(ie=r.value.weekdays)==null?void 0:ie.includes(M.value.getDay())},L=M=>(l.value.enabled||e.weekPicker)&&(!(n.value.count>0)||M.current)&&A()&&!(!M.current&&e.hideOffsetDates)&&!E(M)?T(M):!1,I=M=>{const{isRangeStart:ie,isRangeEnd:le}=ne(M),$=l.value.enabled?ie||le:!1;return{dp__cell_offset:!M.current,dp__pointer:!e.disabled&&!(!M.current&&e.hideOffsetDates)&&!c(M.value),dp__cell_disabled:c(M.value),dp__cell_highlight:!te(M)&&(H(M)||N(M))&&!F(M)&&!$&&!x(M)&&!(L(M)&&e.weekPicker)&&!le,dp__cell_highlight_active:!te(M)&&(H(M)||N(M))&&F(M),dp__today:!e.noToday&&ct(M.value,d.value)&&M.current,"dp--past":Xt(M.value,d.value),"dp--future":nn(M.value,d.value)}},W=M=>({dp__active_date:F(M),dp__date_hover:P(M)}),X=M=>{if(t.value&&!Array.isArray(t.value)){const ie=er(t.value,e.weekStart);return{...Y(M),dp__range_start:ct(ie[0],M.value),dp__range_end:ct(ie[1],M.value),dp__range_between_week:nn(M.value,ie[0])&&Xt(M.value,ie[1])}}return{...Y(M)}},J=M=>{if(t.value&&Array.isArray(t.value)){const ie=er(t.value[0],e.weekStart),le=t.value[1]?er(t.value[1],e.weekStart):[];return{...Y(M),dp__range_start:ct(ie[0],M.value)||ct(le[0],M.value),dp__range_end:ct(ie[1],M.value)||ct(le[1],M.value),dp__range_between_week:nn(M.value,ie[0])&&Xt(M.value,ie[1])||nn(M.value,le[0])&&Xt(M.value,le[1]),dp__range_between:nn(M.value,ie[1])&&Xt(M.value,le[0])}}return{...Y(M)}},ne=M=>{const ie=n.value.count>0?M.current&&v(M)&&A():v(M)&&A(),le=n.value.count>0?M.current&&v(M,!1)&&A():v(M,!1)&&A();return{isRangeStart:ie,isRangeEnd:le}},ue=M=>{const{isRangeStart:ie,isRangeEnd:le}=ne(M);return{dp__range_start:ie,dp__range_end:le,dp__range_between:L(M),dp__date_hover:ct(M.value,u.value)&&!ie&&!le&&!e.weekPicker,dp__date_hover_start:b(M,!0),dp__date_hover_end:b(M,!1)}},Y=M=>({...ue(M),dp__cell_auto_range:w(M),dp__cell_auto_range_start:x(M),dp__cell_auto_range_end:C(M)}),Z=M=>l.value.enabled?l.value.autoRange?Y(M):e.modelAuto?{...W(M),...ue(M)}:e.weekPicker?J(M):ue(M):e.weekPicker?X(M):W(M);return{setHoverDate:h,clearHoverDate:f,getDayClassData:M=>e.hideOffsetDates&&!M.current?{}:{...I(M),...Z(M),[e.dayClass?e.dayClass(M.value,e.internalModelValue):""]:!0,...s.value.calendarCell??{}}}},_o=t=>{const{defaultedFilters:e,defaultedRange:n,propDates:i,defaultedMultiDates:s}=Wt(t),r=N=>i.value.disabledDates?typeof i.value.disabledDates=="function"?i.value.disabledDates(xe(N)):!!bh(N,i.value.disabledDates):!1,o=N=>i.value.maxDate?t.yearPicker?Ge(N)>Ge(i.value.maxDate):nn(N,i.value.maxDate):!1,a=N=>i.value.minDate?t.yearPicker?Ge(N){const L=o(N),I=a(N),W=r(N),X=e.value.months.map(Z=>+Z).includes(at(N)),J=t.disabledWeekDays.length?t.disabledWeekDays.some(Z=>+Z===T5(N)):!1,ne=f(N),ue=Ge(N),Y=ue<+t.yearRange[0]||ue>+t.yearRange[1];return!(L||I||W||X||Y||J||ne)},c=(N,L)=>Xt(...Yr(i.value.minDate,N,L))||ct(...Yr(i.value.minDate,N,L)),u=(N,L)=>nn(...Yr(i.value.maxDate,N,L))||ct(...Yr(i.value.maxDate,N,L)),d=(N,L,I)=>{let W=!1;return i.value.maxDate&&I&&u(N,L)&&(W=!0),i.value.minDate&&!I&&c(N,L)&&(W=!0),W},h=(N,L,I,W)=>{let X=!1;return W?i.value.minDate&&i.value.maxDate?X=d(N,L,I):(i.value.minDate&&c(N,L)||i.value.maxDate&&u(N,L))&&(X=!0):X=!0,X},f=N=>Array.isArray(i.value.allowedDates)&&!i.value.allowedDates.length?!0:i.value.allowedDates?!bh(N,i.value.allowedDates):!1,p=N=>!l(N),m=N=>n.value.noDisabledRange?!PS({start:N[0],end:N[1]}).some(L=>p(L)):!0,y=N=>{if(N){const L=Ge(N);return L>=+t.yearRange[0]&&L<=t.yearRange[1]}return!0},v=(N,L)=>!!(Array.isArray(N)&&N[L]&&(n.value.maxRange||n.value.minRange)&&y(N[L])),b=(N,L,I=0)=>{if(v(L,I)&&y(N)){const W=MS(N,L[I]),X=QS(L[I],N),J=X.length===1?0:X.filter(ue=>p(ue)).length,ne=Math.abs(W)-(n.value.minMaxRawRange?0:J);if(n.value.minRange&&n.value.maxRange)return ne>=+n.value.minRange&&ne<=+n.value.maxRange;if(n.value.minRange)return ne>=+n.value.minRange;if(n.value.maxRange)return ne<=+n.value.maxRange}return!0},E=()=>!t.enableTimePicker||t.monthPicker||t.yearPicker||t.ignoreTimeValidation,C=N=>Array.isArray(N)?[N[0]?Og(N[0]):null,N[1]?Og(N[1]):null]:Og(N),w=(N,L,I)=>N.find(W=>+W.hours===pr(L)&&W.minutes==="*"?!0:+W.minutes===oo(L)&&+W.hours===pr(L))&&I,x=(N,L,I)=>{const[W,X]=N,[J,ne]=L;return!w(W,J,I)&&!w(X,ne,I)&&I},T=(N,L)=>{const I=Array.isArray(L)?L:[L];return Array.isArray(t.disabledTimes)?Array.isArray(t.disabledTimes[0])?x(t.disabledTimes,I,N):!I.some(W=>w(t.disabledTimes,W,N)):N},k=(N,L)=>{const I=Array.isArray(L)?[na(L[0]),L[1]?na(L[1]):void 0]:na(L),W=!t.disabledTimes(I);return N&&W},A=(N,L)=>t.disabledTimes?Array.isArray(t.disabledTimes)?T(L,N):k(L,N):L,P=N=>{let L=!0;if(!N||E())return!0;const I=!i.value.minDate&&!i.value.maxDate?C(N):N;return(t.maxTime||i.value.maxDate)&&(L=Cb(t.maxTime,i.value.maxDate,"max",Tn(I),L)),(t.minTime||i.value.minDate)&&(L=Cb(t.minTime,i.value.minDate,"min",Tn(I),L)),A(N,L)},F=N=>{if(!t.monthPicker)return!0;let L=!0;const I=xe(rs(N));if(i.value.minDate&&i.value.maxDate){const W=xe(rs(i.value.minDate)),X=xe(rs(i.value.maxDate));return nn(I,W)&&Xt(I,X)||ct(I,W)||ct(I,X)}if(i.value.minDate){const W=xe(rs(i.value.minDate));L=nn(I,W)||ct(I,W)}if(i.value.maxDate){const W=xe(rs(i.value.maxDate));L=Xt(I,W)||ct(I,W)}return L},H=be(()=>N=>!t.enableTimePicker||t.ignoreTimeValidation?!0:P(N)),te=be(()=>N=>t.monthPicker?Array.isArray(N)&&(n.value.enabled||s.value.enabled)?!N.filter(L=>!F(L)).length:F(N):!0);return{isDisabled:p,validateDate:l,validateMonthYearInRange:h,isDateRangeAllowed:m,checkMinMaxRange:b,isValidTime:P,isTimeValid:H,isMonthValid:te}},bf=()=>{const t=be(()=>(i,s)=>i?.includes(s)),e=be(()=>(i,s)=>i.count?i.solo?!0:s===0:!0),n=be(()=>(i,s)=>i.count?i.solo?!0:s===i.count-1:!0);return{hideNavigationButtons:t,showLeftIcon:e,showRightIcon:n}},xV=(t,e,n)=>{const i=we(0),s=Ns({[ta.timePicker]:!t.enableTimePicker||t.timePicker||t.monthPicker,[ta.calendar]:!1,[ta.header]:!1}),r=be(()=>t.monthPicker||t.timePicker),o=d=>{var h;if((h=t.flow)!=null&&h.length){if(!d&&r.value)return u();s[d]=!0,Object.keys(s).filter(f=>!s[f]).length||u()}},a=()=>{var d,h;(d=t.flow)!=null&&d.length&&i.value!==-1&&(i.value+=1,e("flow-step",i.value),u()),((h=t.flow)==null?void 0:h.length)===i.value&&Rn().then(()=>l())},l=()=>{i.value=-1},c=(d,h,...f)=>{var p,m;t.flow[i.value]===d&&n.value&&((m=(p=n.value)[h])==null||m.call(p,...f))},u=(d=0)=>{d&&(i.value+=d),c(zn.month,"toggleMonthPicker",!0),c(zn.year,"toggleYearPicker",!0),c(zn.calendar,"toggleTimePicker",!1,!0),c(zn.time,"toggleTimePicker",!0,!0);const h=t.flow[i.value];(h===zn.hours||h===zn.minutes||h===zn.seconds)&&c(h,"toggleTimePicker",!0,!0,h)};return{childMount:o,updateFlowStep:a,resetFlow:l,handleFlow:u,flowStep:i}},EV={key:1,class:"dp__input_wrap"},SV=["id","name","inputmode","placeholder","disabled","readonly","required","value","autocomplete","aria-disabled","aria-invalid"],CV={key:2,class:"dp--clear-btn"},TV=["aria-label"],kV=cn({compatConfig:{MODE:3},__name:"DatepickerInput",props:{isMenuOpen:{type:Boolean,default:!1},inputValue:{type:String,default:""},..._f},emits:["clear","open","update:input-value","set-input-date","close","select-date","set-empty-date","toggle","focus-prev","focus","blur","real-blur","text-input"],setup(t,{expose:e,emit:n}){const i=n,s=t,{defaultedTextInput:r,defaultedAriaLabels:o,defaultedInline:a,defaultedConfig:l,defaultedRange:c,defaultedMultiDates:u,defaultedUI:d,getDefaultPattern:h,getDefaultStartTime:f}=Wt(s),{checkMinMaxRange:p}=_o(s),m=we(),y=we(null),v=we(!1),b=we(!1),E=we(!1),C=we(null),w=be(()=>({dp__pointer:!s.disabled&&!s.readonly&&!r.value.enabled,dp__disabled:s.disabled,dp__input_readonly:!r.value.enabled,dp__input:!0,dp__input_icon_pad:!s.hideInputIcon,dp__input_valid:typeof s.state=="boolean"?s.state:!1,dp__input_invalid:typeof s.state=="boolean"?!s.state:!1,dp__input_focus:v.value||s.isMenuOpen,dp__input_reg:!r.value.enabled,...d.value.input??{}})),x=()=>{i("set-input-date",null),s.clearable&&s.autoApply&&(i("set-empty-date"),m.value=null)},T=Y=>{const Z=f();return VB(Y,r.value.format??h(),Z??eC({},s.enableSeconds),s.inputValue,E.value,s.formatLocale)},k=Y=>{const{rangeSeparator:Z}=r.value,[M,ie]=Y.split(`${Z}`);if(M){const le=T(M.trim()),$=ie?T(ie.trim()):null;if(Sl(le,$))return;const oe=le&&$?[le,$]:[le];p($,oe,0)&&(m.value=le?oe:null)}},A=()=>{E.value=!0},P=Y=>{if(c.value.enabled)k(Y);else if(u.value.enabled){const Z=Y.split(";");m.value=Z.map(M=>T(M.trim())).filter(M=>M)}else m.value=T(Y)},F=Y=>{var Z;const M=typeof Y=="string"?Y:(Z=Y.target)==null?void 0:Z.value;M!==""?(r.value.openMenu&&!s.isMenuOpen&&i("open"),P(M),i("set-input-date",m.value)):x(),E.value=!1,i("update:input-value",M),i("text-input",Y,m.value)},H=Y=>{r.value.enabled?(P(Y.target.value),r.value.enterSubmit&&nm(m.value)&&s.inputValue!==""?(i("set-input-date",m.value,!0),m.value=null):r.value.enterSubmit&&s.inputValue===""&&(m.value=null,i("clear"))):L(Y)},te=(Y,Z)=>{var M;if(C.value&&Z&&!b.value)return Y.preventDefault(),b.value=!0,(M=C.value)==null?void 0:M.focus();r.value.enabled&&r.value.tabSubmit&&P(Y.target.value),r.value.tabSubmit&&nm(m.value)&&s.inputValue!==""?(i("set-input-date",m.value,!0,!0),m.value=null):r.value.tabSubmit&&s.inputValue===""&&(m.value=null,i("clear",!0))},N=()=>{v.value=!0,i("focus"),Rn().then(()=>{var Y;r.value.enabled&&r.value.selectOnFocus&&((Y=y.value)==null||Y.select())})},L=Y=>{if(Y.preventDefault(),Qr(Y,l.value,!0),r.value.enabled&&r.value.openMenu&&!a.value.input){if(r.value.openMenu==="open"&&!s.isMenuOpen)return i("open");if(r.value.openMenu==="toggle")return i("toggle")}else r.value.enabled||i("toggle")},I=()=>{i("real-blur"),v.value=!1,(!s.isMenuOpen||a.value.enabled&&a.value.input)&&i("blur"),s.autoApply&&r.value.enabled&&m.value&&!s.isMenuOpen&&(i("set-input-date",m.value),i("select-date"),m.value=null)},W=Y=>{Qr(Y,l.value,!0),i("clear")},X=(Y,Z)=>{if(Y.key==="Tab"&&te(Y,Z),Y.key==="Enter"&&H(Y),!r.value.enabled){if(Y.code==="Tab")return;Y.preventDefault()}},J=()=>{var Y;(Y=y.value)==null||Y.focus({preventScroll:!0})},ne=Y=>{m.value=Y},ue=Y=>{Y.key===Lt.tab&&(b.value=!1,te(Y))};return e({focusInput:J,setParsedDate:ne}),(Y,Z)=>{var M,ie;return D(),V("div",{onClick:L},[Y.$slots.trigger&&!Y.$slots["dp-input"]&&!Q(a).enabled?Oe(Y.$slots,"trigger",{key:0}):ce("",!0),!Y.$slots.trigger&&(!Q(a).enabled||Q(a).input)?(D(),V("div",EV,[Y.$slots["dp-input"]&&!Y.$slots.trigger&&(!Q(a).enabled||Q(a).enabled&&Q(a).input)?Oe(Y.$slots,"dp-input",{key:0,value:t.inputValue,isMenuOpen:t.isMenuOpen,onInput:F,onEnter:H,onTab:te,onClear:W,onBlur:I,onKeypress:X,onPaste:A,onFocus:N,openMenu:()=>Y.$emit("open"),closeMenu:()=>Y.$emit("close"),toggleMenu:()=>Y.$emit("toggle")}):ce("",!0),Y.$slots["dp-input"]?ce("",!0):(D(),V("input",{key:1,id:Y.uid?`dp-input-${Y.uid}`:void 0,ref_key:"inputRef",ref:y,"data-test":"dp-input",name:Y.name,class:Ie(w.value),inputmode:Q(r).enabled?"text":"none",placeholder:Y.placeholder,disabled:Y.disabled,readonly:Y.readonly,required:Y.required,value:t.inputValue,autocomplete:Y.autocomplete,"aria-disabled":Y.disabled||void 0,"aria-invalid":Y.state===!1?!0:void 0,onInput:F,onBlur:I,onFocus:N,onKeypress:X,onKeydown:Z[0]||(Z[0]=le=>X(le,!0)),onPaste:A},null,42,SV)),g("div",{onClick:Z[3]||(Z[3]=le=>i("toggle"))},[Y.$slots["input-icon"]&&!Y.hideInputIcon?(D(),V("span",{key:0,class:"dp__input_icon",onClick:Z[1]||(Z[1]=le=>i("toggle"))},[Oe(Y.$slots,"input-icon")])):ce("",!0),!Y.$slots["input-icon"]&&!Y.hideInputIcon&&!Y.$slots["dp-input"]?(D(),Ce(Q(Ul),{key:1,"aria-label":(M=Q(o))==null?void 0:M.calendarIcon,class:"dp__input_icon dp__input_icons",onClick:Z[2]||(Z[2]=le=>i("toggle"))},null,8,["aria-label"])):ce("",!0)]),Y.$slots["clear-icon"]&&t.inputValue&&Y.clearable&&!Y.disabled&&!Y.readonly?(D(),V("span",CV,[Oe(Y.$slots,"clear-icon",{clear:W})])):ce("",!0),Y.clearable&&!Y.$slots["clear-icon"]&&t.inputValue&&!Y.disabled&&!Y.readonly?(D(),V("button",{key:3,ref_key:"clearBtnRef",ref:C,"aria-label":(ie=Q(o))==null?void 0:ie.clearInput,class:"dp--clear-btn",type:"button",onBlur:Z[4]||(Z[4]=le=>b.value=!1),onKeydown:Z[5]||(Z[5]=le=>Q(Qn)(le,()=>W(le),!0,ue)),onClick:Z[6]||(Z[6]=iu(le=>W(le),["prevent"]))},[B(Q(KS),{class:"dp__input_icons","data-test":"clear-icon"})],40,TV)):ce("",!0)])):ce("",!0)])}}}),AV=typeof window<"u"?window:void 0,Wg=()=>{},MV=t=>ef()?(e_(t),!0):!1,IV=(t,e,n,i)=>{if(!t)return Wg;let s=Wg;const r=fn(()=>Q(t),a=>{s(),a&&(a.addEventListener(e,n,i),s=()=>{a.removeEventListener(e,n,i),s=Wg})},{immediate:!0,flush:"post"}),o=()=>{r(),s()};return MV(o),o},PV=(t,e,n,i={})=>{const{window:s=AV,event:r="pointerdown"}=i;return s?IV(s,r,o=>{const a=mn(t),l=mn(e);!a||!l||a===o.target||o.composedPath().includes(a)||o.composedPath().includes(l)||n(o)},{passive:!0}):void 0},RV=cn({compatConfig:{MODE:3},__name:"VueDatePicker",props:{..._f},emits:["update:model-value","update:model-timezone-value","text-submit","closed","cleared","open","focus","blur","internal-model-change","recalculate-position","flow-step","update-month-year","invalid-select","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","date-update","invalid-date","overlay-toggle","text-input"],setup(t,{expose:e,emit:n}){const i=n,s=t,r=pa(),o=we(!1),a=Zc(s,"modelValue"),l=Zc(s,"timezone"),c=we(null),u=we(null),d=we(null),h=we(!1),f=we(null),p=we(!1),m=we(!1),y=we(!1),v=we(!1),{setMenuFocused:b,setShiftKey:E}=rC(),{clearArrowNav:C}=mo(),{validateDate:w,isValidTime:x}=_o(s),{defaultedTransitions:T,defaultedTextInput:k,defaultedInline:A,defaultedConfig:P,defaultedRange:F,defaultedMultiDates:H}=Wt(s),{menuTransition:te,showTransition:N}=Nu(T);xn(()=>{ie(s.modelValue),Rn().then(()=>{if(!A.value.enabled){const he=ue(f.value);he?.addEventListener("scroll",K),window?.addEventListener("resize",U)}}),A.value.enabled&&(o.value=!0),window?.addEventListener("keyup",re),window?.addEventListener("keydown",j)}),Yl(()=>{if(!A.value.enabled){const he=ue(f.value);he?.removeEventListener("scroll",K),window?.removeEventListener("resize",U)}window?.removeEventListener("keyup",re),window?.removeEventListener("keydown",j)});const L=ki(r,"all",s.presetDates),I=ki(r,"input");fn([a,l],()=>{ie(a.value)},{deep:!0});const{openOnTop:W,menuStyle:X,xCorrect:J,setMenuPosition:ne,getScrollableParent:ue,shadowRender:Y}=yV({menuRef:c,menuRefInner:u,inputRef:d,pickerWrapperRef:f,inline:A,emit:i,props:s,slots:r}),{inputValue:Z,internalModelValue:M,parseExternalModelValue:ie,emitModelValue:le,formatInputValue:$,checkBeforeEmit:oe}=u4(i,s,h),de=be(()=>({dp__main:!0,dp__theme_dark:s.dark,dp__theme_light:!s.dark,dp__flex_display:A.value.enabled,"dp--flex-display-collapsed":y.value,dp__flex_display_with_input:A.value.input})),ve=be(()=>s.dark?"dp__theme_dark":"dp__theme_light"),z=be(()=>s.teleport?{to:typeof s.teleport=="boolean"?"body":s.teleport,disabled:!s.teleport||A.value.enabled}:{}),ge=be(()=>({class:"dp__outer_menu_wrap"})),S=be(()=>A.value.enabled&&(s.timePicker||s.monthPicker||s.yearPicker||s.quarterPicker)),O=()=>{var he,ke;return(ke=(he=d.value)==null?void 0:he.$el)==null?void 0:ke.getBoundingClientRect()},K=()=>{o.value&&(P.value.closeOnScroll?Be():ne())},U=()=>{var he;o.value&&ne();const ke=(he=u.value)==null?void 0:he.$el.getBoundingClientRect().width;y.value=document.body.offsetWidth<=ke},re=he=>{he.key==="Tab"&&!A.value.enabled&&!s.teleport&&P.value.tabOutClosesMenu&&(f.value.contains(document.activeElement)||Be()),m.value=he.shiftKey},j=he=>{m.value=he.shiftKey},se=()=>{!s.disabled&&!s.readonly&&(Y(Mb,s),ne(!1),o.value=!0,o.value&&i("open"),o.value||ze(),ie(s.modelValue))},ee=()=>{var he;Z.value="",ze(),(he=d.value)==null||he.setParsedDate(null),i("update:model-value",null),i("update:model-timezone-value",null),i("cleared"),P.value.closeOnClearValue&&Be()},fe=()=>{const he=M.value;return!he||!Array.isArray(he)&&w(he)?!0:Array.isArray(he)?H.value.enabled||he.length===2&&w(he[0])&&w(he[1])?!0:F.value.partialRange&&!s.timePicker?w(he[0]):!1:!1},me=()=>{oe()&&fe()?(le(),Be()):i("invalid-select",M.value)},pe=he=>{Le(),le(),P.value.closeOnAutoApply&&!he&&Be()},Le=()=>{d.value&&k.value.enabled&&d.value.setParsedDate(M.value)},Ae=(he=!1)=>{s.autoApply&&x(M.value)&&fe()&&(F.value.enabled&&Array.isArray(M.value)?(F.value.partialRange||M.value.length===2)&&pe(he):pe(he))},ze=()=>{k.value.enabled||(M.value=null)},Be=()=>{A.value.enabled||(o.value&&(o.value=!1,J.value=!1,b(!1),E(!1),C(),i("closed"),Z.value&&ie(a.value)),ze(),i("blur"))},nt=(he,ke,De=!1)=>{if(!he){M.value=null;return}const Ht=Array.isArray(he)?!he.some(Di=>!w(Di)):w(he),un=x(he);Ht&&un&&(v.value=!0,M.value=he,ke&&(p.value=De,me(),i("text-submit")),Rn().then(()=>{v.value=!1}))},Ze=()=>{s.autoApply&&x(M.value)&&le(),Le()},Mt=()=>o.value?Be():se(),gn=he=>{M.value=he},Un=()=>{k.value.enabled&&(h.value=!0,$()),i("focus")},Ri=()=>{if(k.value.enabled&&(h.value=!1,ie(s.modelValue),p.value)){const he=NB(f.value,m.value);he?.focus()}i("blur")},wi=he=>{u.value&&u.value.updateMonthYear(0,{month:xb(he.month),year:xb(he.year)})},Xi=he=>{ie(he??s.modelValue)},Ut=(he,ke)=>{var De;(De=u.value)==null||De.switchView(he,ke)},ae=he=>P.value.onClickOutside?P.value.onClickOutside(he):Be(),Te=(he=0)=>{var ke;(ke=u.value)==null||ke.handleFlow(he)};return PV(c,d,()=>ae(fe)),e({closeMenu:Be,selectDate:me,clearValue:ee,openMenu:se,onScroll:K,formatInputValue:$,updateInternalModelValue:gn,setMonthYear:wi,parseModel:Xi,switchView:Ut,toggleMenu:Mt,handleFlow:Te,dpWrapMenuRef:c}),(he,ke)=>(D(),V("div",{ref_key:"pickerWrapperRef",ref:f,class:Ie(de.value),"data-datepicker-instance":""},[B(kV,yn({ref_key:"inputRef",ref:d,"input-value":Q(Z),"onUpdate:inputValue":ke[0]||(ke[0]=De=>Qt(Z)?Z.value=De:null),"is-menu-open":o.value},he.$props,{onClear:ee,onOpen:se,onSetInputDate:nt,onSetEmptyDate:Q(le),onSelectDate:me,onToggle:Mt,onClose:Be,onFocus:Un,onBlur:Ri,onRealBlur:ke[1]||(ke[1]=De=>h.value=!1),onTextInput:ke[2]||(ke[2]=De=>he.$emit("text-input",De))}),jn({_:2},[Xe(Q(I),(De,Ht)=>({name:De,fn:Re(un=>[Oe(he.$slots,De,In(Zn(un)))])}))]),1040,["input-value","is-menu-open","onSetEmptyDate"]),(D(),Ce(ga(he.teleport?tD:"div"),In(Zn(z.value)),{default:Re(()=>[B(Rt,{name:Q(te)(Q(W)),css:Q(N)&&!Q(A).enabled},{default:Re(()=>[o.value?(D(),V("div",yn({key:0,ref_key:"dpWrapMenuRef",ref:c},ge.value,{class:{"dp--menu-wrapper":!Q(A).enabled},style:Q(A).enabled?void 0:Q(X)}),[B(Mb,yn({ref_key:"dpMenuRef",ref:u},he.$props,{"internal-model-value":Q(M),"onUpdate:internalModelValue":ke[3]||(ke[3]=De=>Qt(M)?M.value=De:null),class:{[ve.value]:!0,"dp--menu-wrapper":he.teleport},"open-on-top":Q(W),"no-overlay-focus":S.value,collapse:y.value,"get-input-rect":O,"is-text-input-date":v.value,onClosePicker:Be,onSelectDate:me,onAutoApply:Ae,onTimeUpdate:Ze,onFlowStep:ke[4]||(ke[4]=De=>he.$emit("flow-step",De)),onUpdateMonthYear:ke[5]||(ke[5]=De=>he.$emit("update-month-year",De)),onInvalidSelect:ke[6]||(ke[6]=De=>he.$emit("invalid-select",Q(M))),onAutoApplyInvalid:ke[7]||(ke[7]=De=>he.$emit("invalid-select",De)),onInvalidFixedRange:ke[8]||(ke[8]=De=>he.$emit("invalid-fixed-range",De)),onRecalculatePosition:Q(ne),onTooltipOpen:ke[9]||(ke[9]=De=>he.$emit("tooltip-open",De)),onTooltipClose:ke[10]||(ke[10]=De=>he.$emit("tooltip-close",De)),onTimePickerOpen:ke[11]||(ke[11]=De=>he.$emit("time-picker-open",De)),onTimePickerClose:ke[12]||(ke[12]=De=>he.$emit("time-picker-close",De)),onAmPmChange:ke[13]||(ke[13]=De=>he.$emit("am-pm-change",De)),onRangeStart:ke[14]||(ke[14]=De=>he.$emit("range-start",De)),onRangeEnd:ke[15]||(ke[15]=De=>he.$emit("range-end",De)),onDateUpdate:ke[16]||(ke[16]=De=>he.$emit("date-update",De)),onInvalidDate:ke[17]||(ke[17]=De=>he.$emit("invalid-date",De)),onOverlayToggle:ke[18]||(ke[18]=De=>he.$emit("overlay-toggle",De))}),jn({_:2},[Xe(Q(L),(De,Ht)=>({name:De,fn:Re(un=>[Oe(he.$slots,De,In(Zn({...un})))])}))]),1040,["internal-model-value","class","open-on-top","no-overlay-focus","collapse","is-text-input-date","onRecalculatePosition"])],16)):ce("",!0)]),_:3},8,["name","css"])]),_:3},16))],2))}}),Bu=(()=>{const t=RV;return t.install=e=>{e.component("Vue3DatePicker",t)},t})(),DV=Object.freeze(Object.defineProperty({__proto__:null,default:Bu},Symbol.toStringTag,{value:"Module"}));Object.entries(DV).forEach(([t,e])=>{t!=="default"&&(Bu[t]=e)});const $V={name:"newDashboardAPIKey",components:{LocaleText:Qe,VueDatePicker:Bu},data(){return{newKeyData:{ExpiredAt:pi().add(7,"d").format("YYYY-MM-DD HH:mm:ss"),neverExpire:!1},submitting:!1}},setup(){return{store:st()}},mounted(){console.log(this.newKeyData.ExpiredAt)},methods:{submitNewAPIKey(){this.submitting=!0,kt("/api/newDashboardAPIKey",this.newKeyData,t=>{t.status?(this.$emit("created",t.data),this.store.newMessage("Server","API Key created","success"),this.$emit("close")):this.store.newMessage("Server",t.message,"danger"),this.submitting=!1})},fixDate(t){return console.log(pi(t).format("YYYY-MM-DDTHH:mm:ss")),pi(t).format("YYYY-MM-DDTHH:mm:ss")},parseTime(t){t?this.newKeyData.ExpiredAt=pi(t).format("YYYY-MM-DD HH:mm:ss"):this.newKeyData.ExpiredAt=void 0}}},LV={class:"position-absolute w-100 h-100 top-0 start-0 rounded-bottom-3 p-3 d-flex",style:{"background-color":"#00000060","backdrop-filter":"blur(3px)"}},OV={class:"card m-auto rounded-3 mt-5"},NV={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-0"},FV={class:"mb-0"},BV={class:"card-body d-flex gap-2 p-4 flex-column"},VV={class:"text-muted"},zV={class:"d-flex align-items-center gap-2"},WV={class:"form-check"},HV=["disabled"],YV={class:"form-check-label",for:"neverExpire"},jV=g("i",{class:"bi bi-emoji-grimace-fill me-2"},null,-1),KV={key:0,class:"bi bi-check-lg me-2"};function UV(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("VueDatePicker");return D(),V("div",LV,[g("div",OV,[g("div",NV,[g("h6",FV,[B(o,{t:"Create API Key"})]),g("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=l=>this.$emit("close"))})]),g("div",BV,[g("small",VV,[B(o,{t:"When should this API Key expire?"})]),g("div",zV,[B(a,{is24:!0,"min-date":new Date,"model-value":this.newKeyData.ExpiredAt,"onUpdate:modelValue":this.parseTime,"time-picker-inline":"",format:"yyyy-MM-dd HH:mm:ss","preview-format":"yyyy-MM-dd HH:mm:ss",clearable:!1,disabled:this.newKeyData.neverExpire||this.submitting,dark:this.store.Configuration.Server.dashboard_theme==="dark"},null,8,["min-date","model-value","onUpdate:modelValue","disabled","dark"])]),g("div",WV,[Ne(g("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[1]||(e[1]=l=>this.newKeyData.neverExpire=l),id:"neverExpire",disabled:this.submitting},null,8,HV),[[Jn,this.newKeyData.neverExpire]]),g("label",YV,[B(o,{t:"Never Expire"}),He(" ("),jV,B(o,{t:"Don't think that's a good idea"}),He(") ")])]),g("button",{class:Ie(["ms-auto btn bg-success-subtle text-success-emphasis border-1 border-success-subtle rounded-3 shadow-sm",{disabled:this.submitting}]),onClick:e[2]||(e[2]=l=>this.submitNewAPIKey())},[this.submitting?ce("",!0):(D(),V("i",KV)),this.submitting?(D(),Ce(o,{key:1,t:"Creating..."})):(D(),Ce(o,{key:2,t:"Create"}))],2)])])])}const GV=Ye($V,[["render",UV]]),XV={name:"dashboardAPIKey",components:{LocaleText:Qe},props:{apiKey:Object},setup(){return{store:st()}},data(){return{confirmDelete:!1}},methods:{deleteAPIKey(){kt("/api/deleteDashboardAPIKey",{Key:this.apiKey.Key},t=>{t.status?(this.$emit("deleted",t.data),this.store.newMessage("Server","API Key deleted","success")):this.store.newMessage("Server",t.message,"danger")})}}},j_=t=>(bn("data-v-a76253c8"),t=t(),wn(),t),qV={class:"card rounded-3 shadow-sm"},ZV={key:0,class:"card-body d-flex gap-3 align-items-center apiKey-card-body"},JV={class:"d-flex align-items-center gap-2"},QV={class:"text-muted"},e6={style:{"word-break":"break-all"}},t6={class:"d-flex align-items-center gap-2 ms-auto"},n6={class:"text-muted"},i6=j_(()=>g("i",{class:"bi bi-trash-fill"},null,-1)),s6=[i6],r6={key:0,class:"card-body d-flex gap-3 align-items-center justify-content-end"},o6=j_(()=>g("i",{class:"bi bi-check-lg"},null,-1)),a6=[o6],l6=j_(()=>g("i",{class:"bi bi-x-lg"},null,-1)),c6=[l6];function u6(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",qV,[this.confirmDelete?(D(),V($e,{key:1},[this.store.getActiveCrossServer()?ce("",!0):(D(),V("div",r6,[B(o,{t:"Are you sure to delete this API key?"}),g("a",{role:"button",class:"btn btn-sm bg-success-subtle text-success-emphasis rounded-3",onClick:e[1]||(e[1]=a=>this.deleteAPIKey())},a6),g("a",{role:"button",class:"btn btn-sm bg-secondary-subtle text-secondary-emphasis rounded-3",onClick:e[2]||(e[2]=a=>this.confirmDelete=!1)},c6)]))],64)):(D(),V("div",ZV,[g("div",JV,[g("small",QV,[B(o,{t:"Key"})]),g("span",e6,Ee(this.apiKey.Key),1)]),g("div",t6,[g("small",n6,[B(o,{t:"Expire At"})]),this.apiKey.ExpiredAt?ce("",!0):(D(),Ce(o,{key:0,t:"Never Expire"})),g("span",null,Ee(this.apiKey.ExpiredAt),1)]),this.store.getActiveCrossServer()?ce("",!0):(D(),V("a",{key:0,role:"button",class:"btn btn-sm bg-danger-subtle text-danger-emphasis rounded-3",onClick:e[0]||(e[0]=a=>this.confirmDelete=!0)},s6))]))])}const d6=Ye(XV,[["render",u6],["__scopeId","data-v-a76253c8"]]),h6={name:"dashboardAPIKeys",components:{LocaleText:Qe,DashboardAPIKey:d6,NewDashboardAPIKey:GV},setup(){return{store:st()}},data(){return{value:this.store.Configuration.Server.dashboard_api_key,apiKeys:[],newDashboardAPIKey:!1}},methods:{async toggleDashboardAPIKeys(){await kt("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_api_key",value:this.value},t=>{t.status?(this.store.Configuration.Peers[this.targetData]=this.value,this.store.newMessage("Server",`API Keys function is successfully ${this.value?"enabled":"disabled"}`,"success")):(this.value=this.store.Configuration.Peers[this.targetData],this.store.newMessage("Server",`API Keys function is failed to ${this.value?"enabled":"disabled"}`,"danger"))})}},watch:{value:{immediate:!0,handler(t){t?Vt("/api/getDashboardAPIKeys",{},e=>{console.log(e),e.status?this.apiKeys=e.data:(this.apiKeys=[],this.store.newMessage("Server",e.message,"danger"))}):this.apiKeys=[]}}}},f6=t=>(bn("data-v-167c06a6"),t=t(),wn(),t),g6={class:"card mb-4 shadow rounded-3"},p6={class:"card-header d-flex"},m6={key:0,class:"form-check form-switch ms-auto"},_6={class:"form-check-label",for:"allowAPIKeysSwitch"},y6={key:0,class:"card-body position-relative d-flex flex-column gap-2"},v6=f6(()=>g("i",{class:"bi bi-plus-circle-fill me-2"},null,-1)),b6={key:1,class:"card",style:{height:"300px"}},w6={class:"card-body d-flex text-muted"},x6={class:"m-auto"},E6={key:2,class:"d-flex flex-column gap-2 position-relative",style:{"min-height":"300px"}};function S6(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("DashboardAPIKey"),l=Se("NewDashboardAPIKey");return D(),V("div",g6,[g("div",p6,[B(o,{t:"API Keys"}),this.store.getActiveCrossServer()?ce("",!0):(D(),V("div",m6,[Ne(g("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[0]||(e[0]=c=>this.value=c),onChange:e[1]||(e[1]=c=>this.toggleDashboardAPIKeys()),role:"switch",id:"allowAPIKeysSwitch"},null,544),[[Jn,this.value]]),g("label",_6,[this.value?(D(),Ce(o,{key:0,t:"Enabled"})):(D(),Ce(o,{key:1,t:"Disabled"}))])]))]),this.value?(D(),V("div",y6,[this.store.getActiveCrossServer()?ce("",!0):(D(),V("button",{key:0,class:"ms-auto btn bg-primary-subtle text-primary-emphasis border-1 border-primary-subtle rounded-3 shadow-sm",onClick:e[2]||(e[2]=c=>this.newDashboardAPIKey=!0)},[v6,B(o,{t:"API Key"})])),this.apiKeys.length===0?(D(),V("div",b6,[g("div",w6,[g("span",x6,[B(o,{t:"No WGDashboard API Key"})])])])):(D(),V("div",E6,[B(jl,{name:"apiKey"},{default:Re(()=>[(D(!0),V($e,null,Xe(this.apiKeys,c=>(D(),Ce(a,{apiKey:c,key:c.Key,onDeleted:e[3]||(e[3]=u=>this.apiKeys=u)},null,8,["apiKey"]))),128))]),_:1})])),B(Rt,{name:"zoomReversed"},{default:Re(()=>[this.newDashboardAPIKey?(D(),Ce(l,{key:0,onCreated:e[4]||(e[4]=c=>this.apiKeys=c),onClose:e[5]||(e[5]=c=>this.newDashboardAPIKey=!1)})):ce("",!0)]),_:1})])):ce("",!0)])}const C6=Ye(h6,[["render",S6],["__scopeId","data-v-167c06a6"]]),T6={name:"accountSettingsMFA",components:{LocaleText:Qe},setup(){const t=st(),e=`input_${Os()}`;return{store:t,uuid:e}},data(){return{status:!1}},mounted(){this.status=this.store.Configuration.Account.enable_totp},methods:{async resetMFA(){await kt("/api/updateDashboardConfigurationItem",{section:"Account",key:"totp_verified",value:"false"},async t=>{await kt("/api/updateDashboardConfigurationItem",{section:"Account",key:"enable_totp",value:"false"},e=>{e.status&&this.$router.push("/2FASetup")})})}}},k6={class:"d-flex align-items-center"},A6={class:"form-check form-switch ms-3"},M6=g("i",{class:"bi bi-shield-lock-fill me-2"},null,-1);function I6(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",null,[g("div",k6,[g("strong",null,[B(o,{t:"Multi-Factor Authentication (MFA)"})]),g("div",A6,[Ne(g("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[0]||(e[0]=a=>this.status=a),role:"switch",id:"allowMFAKeysSwitch"},null,512),[[Jn,this.status]])]),this.status?(D(),V("button",{key:0,class:"btn bg-warning-subtle text-warning-emphasis border-1 border-warning-subtle ms-auto rounded-3 shadow-sm",onClick:e[1]||(e[1]=a=>this.resetMFA())},[M6,this.store.Configuration.Account.totp_verified?(D(),Ce(o,{key:0,t:"Reset"})):(D(),Ce(o,{key:1,t:"Setup"})),He(" MFA ")])):ce("",!0)])])}const P6=Ye(T6,[["render",I6]]),R6={name:"dashboardLanguage",components:{LocaleText:Qe},setup(){return{store:st()}},data(){return{languages:void 0}},mounted(){Vt("/api/locale/available",{},t=>{this.languages=t.data})},methods:{changeLanguage(t){kt("/api/locale/update",{lang_id:t},e=>{e.status?(this.store.Configuration.Server.dashboard_language=t,this.store.Locale=e.data):this.store.newMessage("Server","Dashboard language update failed","danger")})}},computed:{currentLanguage(){let t=this.store.Configuration.Server.dashboard_language;return this.languages.find(e=>e.lang_id===t)}}},D6={class:"card mb-4 shadow rounded-3"},$6={class:"card-header"},L6={class:"card-body d-flex gap-2"},O6={class:"dropdown w-100"},N6=["disabled"],F6={key:1},B6={class:"dropdown-menu rounded-3 shadow",style:{width:"500px"}},V6=["onClick"],z6={class:"me-auto mb-0"},W6={class:"d-block",style:{"font-size":"0.8rem"}},H6={key:0,class:"bi bi-check text-primary fs-5"};function Y6(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",D6,[g("p",$6,[B(o,{t:"Dashboard Language"})]),g("div",L6,[g("div",O6,[g("button",{class:"btn bg-primary-subtle text-primary-emphasis dropdown-toggle w-100 rounded-3",disabled:!this.languages,type:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[this.languages?(D(),V("span",F6,Ee(r.currentLanguage?.lang_name_localized),1)):(D(),Ce(o,{key:0,t:"Loading..."}))],8,N6),g("ul",B6,[(D(!0),V($e,null,Xe(this.languages,a=>(D(),V("li",null,[g("a",{class:"dropdown-item d-flex align-items-center",role:"button",onClick:l=>this.changeLanguage(a.lang_id)},[g("p",z6,[He(Ee(a.lang_name_localized)+" ",1),g("small",W6,Ee(a.lang_name),1)]),r.currentLanguage?.lang_id===a.lang_id?(D(),V("i",H6)):ce("",!0)],8,V6)]))),256))])])])])}const j6=Ye(R6,[["render",Y6]]),K6={name:"settings",methods:{ipV46RegexCheck:u3},components:{DashboardLanguage:j6,LocaleText:Qe,AccountSettingsMFA:P6,DashboardAPIKeys:C6,DashboardSettingsInputIPAddressAndPort:xF,DashboardTheme:rF,DashboardSettingsInputWireguardConfigurationPath:Z3,AccountSettingsInputPassword:N3,AccountSettingsInputUsername:_3,PeersDefaultSettingsInput:c3},setup(){return{dashboardConfigurationStore:st()}}},U6={class:"mt-md-5 mt-3"},G6={class:"container-md"},X6={class:"mb-3 text-body"},q6={class:"card mb-4 shadow rounded-3"},Z6={class:"card-header"},J6={class:"card-body"},Q6={class:"card mb-4 shadow rounded-3"},ez={class:"card-header"},tz={class:"card-body"},nz={class:"card mb-4 shadow rounded-3"},iz={class:"card-header"},sz={class:"card-body d-flex gap-4 flex-column"},rz=g("hr",{class:"m-0"},null,-1),oz={key:0,class:"m-0"};function az(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("DashboardTheme"),l=Se("DashboardLanguage"),c=Se("PeersDefaultSettingsInput"),u=Se("DashboardSettingsInputWireguardConfigurationPath"),d=Se("AccountSettingsInputUsername"),h=Se("AccountSettingsInputPassword"),f=Se("AccountSettingsMFA"),p=Se("DashboardAPIKeys");return D(),V("div",U6,[g("div",G6,[g("h3",X6,[B(o,{t:"Settings"})]),B(a),B(l),g("div",q6,[g("p",Z6,[B(o,{t:"Peers Default Settings"})]),g("div",J6,[B(c,{targetData:"peer_global_dns",title:"DNS"}),B(c,{targetData:"peer_endpoint_allowed_ip",title:"Endpoint Allowed IPs"}),B(c,{targetData:"peer_mtu",title:"MTU"}),B(c,{targetData:"peer_keep_alive",title:"Persistent Keepalive"}),B(c,{targetData:"remote_endpoint",title:"Peer Remote Endpoint",warning:!0,warningText:"This will be changed globally, and will be apply to all peer's QR code and configuration file."})])]),g("div",Q6,[g("p",ez,[B(o,{t:"WireGuard Configurations Settings"})]),g("div",tz,[B(u,{targetData:"wg_conf_path",title:"Configurations Directory",warning:!0,"warning-text":"Remember to remove / at the end of your path. e.g /etc/wireguard"})])]),g("div",nz,[g("p",iz,[B(o,{t:"WGDashboard Account Settings"})]),g("div",sz,[B(d,{targetData:"username",title:"Username"}),rz,B(h,{targetData:"password"}),this.dashboardConfigurationStore.getActiveCrossServer()?ce("",!0):(D(),V("hr",oz)),this.dashboardConfigurationStore.getActiveCrossServer()?ce("",!0):(D(),Ce(f,{key:1}))])]),B(p)])])}const lz=Ye(K6,[["render",az]]),cz={name:"setup",components:{LocaleText:Qe},setup(){return{store:st()}},data(){return{setup:{username:"",newPassword:"",repeatNewPassword:"",enable_totp:!0},loading:!1,errorMessage:"",done:!1}},computed:{goodToSubmit(){return this.setup.username&&this.setup.newPassword.length>=8&&this.setup.repeatNewPassword.length>=8&&this.setup.newPassword===this.setup.repeatNewPassword}},methods:{submit(){this.loading=!0,kt("/api/Welcome_Finish",this.setup,t=>{t.status?(this.done=!0,this.$router.push("/2FASetup")):(document.querySelectorAll("#createAccount input").forEach(e=>e.classList.add("is-invalid")),this.errorMessage=t.message,document.querySelector(".login-container-fluid").scrollTo({top:0,left:0,behavior:"smooth"})),this.loading=!1})}}},uz=["data-bs-theme"],dz={class:"m-auto text-body",style:{width:"500px"}},hz={class:"dashboardLogo display-4"},fz={class:"mb-5"},gz={key:0,class:"alert alert-danger"},pz={class:"d-flex flex-column gap-3"},mz={id:"createAccount",class:"d-flex flex-column gap-2"},_z={class:"form-group text-body"},yz={for:"username",class:"mb-1 text-muted"},vz={class:"form-group text-body"},bz={for:"password",class:"mb-1 text-muted"},wz={class:"form-group text-body"},xz={for:"confirmPassword",class:"mb-1 text-muted"},Ez=["disabled"],Sz={key:0,class:"d-flex align-items-center w-100"},Cz=g("i",{class:"bi bi-chevron-right ms-auto"},null,-1),Tz={key:1,class:"d-flex align-items-center w-100"},kz=g("span",{class:"spinner-border ms-auto spinner-border-sm",role:"status"},[g("span",{class:"visually-hidden"},"Loading...")],-1);function Az(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",{class:"container-fluid login-container-fluid d-flex main pt-5 overflow-scroll","data-bs-theme":this.store.Configuration.Server.dashboard_theme},[g("div",dz,[g("span",hz,[B(o,{t:"Nice to meet you!"})]),g("p",fz,[B(o,{t:"Please fill in the following fields to finish setup"}),He(" 😊")]),g("div",null,[g("h3",null,[B(o,{t:"Create an account"})]),this.errorMessage?(D(),V("div",gz,Ee(this.errorMessage),1)):ce("",!0),g("div",pz,[g("form",mz,[g("div",_z,[g("label",yz,[g("small",null,[B(o,{t:"Enter an username you like"})])]),Ne(g("input",{type:"text",autocomplete:"username","onUpdate:modelValue":e[0]||(e[0]=a=>this.setup.username=a),class:"form-control",id:"username",name:"username",required:""},null,512),[[Ke,this.setup.username]])]),g("div",vz,[g("label",bz,[g("small",null,[B(o,{t:"Enter a password"}),g("code",null,[B(o,{t:"(At least 8 characters and make sure is strong enough!)"})])])]),Ne(g("input",{type:"password",autocomplete:"new-password","onUpdate:modelValue":e[1]||(e[1]=a=>this.setup.newPassword=a),class:"form-control",id:"password",name:"password",required:""},null,512),[[Ke,this.setup.newPassword]])]),g("div",wz,[g("label",xz,[g("small",null,[B(o,{t:"Confirm password"})])]),Ne(g("input",{type:"password",autocomplete:"confirm-new-password","onUpdate:modelValue":e[2]||(e[2]=a=>this.setup.repeatNewPassword=a),class:"form-control",id:"confirmPassword",name:"confirmPassword",required:""},null,512),[[Ke,this.setup.repeatNewPassword]])])]),g("button",{class:"btn btn-dark btn-lg mb-5 d-flex btn-brand shadow align-items-center",ref:"signInBtn",disabled:!this.goodToSubmit||this.loading||this.done,onClick:e[3]||(e[3]=a=>this.submit())},[!this.loading&&!this.done?(D(),V("span",Sz,[B(o,{t:"Next"}),Cz])):(D(),V("span",Tz,[B(o,{t:"Saving..."}),kz]))],8,Ez)])])])],8,uz)}const Mz=Ye(cz,[["render",Az]]);function K_(t){return t.includes(":")?6:t.includes(".")?4:0}function Iz(t){const e=K_(t);if(!e)throw new Error(`Invalid IP address: ${t}`);let n=0n,i=0n;const s=Object.create(null);if(e===4)for(const r of t.split(".").map(BigInt).reverse())n+=r*2n**i,i+=8n;else{if(t.includes(".")&&(s.ipv4mapped=!0,t=t.split(":").map(a=>{if(a.includes(".")){const[l,c,u,d]=a.split(".").map(h=>Number(h).toString(16).padStart(2,"0"));return`${l}${c}:${u}${d}`}else return a}).join(":")),t.includes("%")){let a;[,t,a]=/(.+)%(.+)/.exec(t),s.scopeid=a}const r=t.split(":"),o=r.indexOf("");if(o!==-1)for(;r.length<8;)r.splice(o,0,"");for(const a of r.map(l=>BigInt(parseInt(l||0,16))).reverse())n+=a*2n**i,i+=16n}return s.number=n,s.version=e,s}const Ib={4:32,6:128},Pz=t=>t.includes("/")?K_(t):0;function Rz(t){const e=Pz(t),n=Object.create(null);if(n.single=!1,e)n.cidr=t,n.version=e;else{const d=K_(t);if(d)n.cidr=`${t}/${Ib[d]}`,n.version=d,n.single=!0;else throw new Error(`Network is not a CIDR or IP: ${t}`)}const[i,s]=n.cidr.split("/");n.prefix=s;const{number:r,version:o}=Iz(i),a=Ib[o],l=r.toString(2).padStart(a,"0"),c=Number(a-s),u=l.substring(0,a-c);return n.start=BigInt(`0b${u}${"0".repeat(c)}`),n.end=BigInt(`0b${u}${"1".repeat(c)}`),n}/*! SPDX-License-Identifier: GPL-2.0 +`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),rL=new RegExp(`(?:^${ts}$)|(?:^${gf}$)`),oL=new RegExp(`^${ts}$`),aL=new RegExp(`^${gf}$`),pf=t=>t&&t.exact?rL:new RegExp(`(?:${Hr(t)}${ts}${Hr(t)})|(?:${Hr(t)}${gf}${Hr(t)})`,"g");pf.v4=t=>t&&t.exact?oL:new RegExp(`${Hr(t)}${ts}${Hr(t)}`,"g");pf.v6=t=>t&&t.exact?aL:new RegExp(`${Hr(t)}${gf}${Hr(t)}`,"g");const _S={exact:!1},yS=`${pf.v4().source}\\/(3[0-2]|[12]?[0-9])`,vS=`${pf.v6().source}\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])`,lL=new RegExp(`^${yS}$`),cL=new RegExp(`^${vS}$`),uL=({exact:t}=_S)=>t?lL:new RegExp(yS,"g"),dL=({exact:t}=_S)=>t?cL:new RegExp(vS,"g"),bS=uL({exact:!0}),wS=dL({exact:!0}),T_=t=>bS.test(t)?4:wS.test(t)?6:0;T_.v4=t=>bS.test(t);T_.v6=t=>wS.test(t);const Tt=t=>{const e=nt();if(e.Locale===null)return t;const i=Object.keys(e.Locale).filter(s=>t.match(new RegExp("^"+s+"$","gi"))!==null);return i.length===0||i.length>1?t:t.replace(new RegExp(i[0],"gi"),e.Locale[i[0]])},vi=x_("WireguardConfigurationsStore",{state:()=>({Configurations:void 0,searchString:"",ConfigurationListInterval:void 0,PeerScheduleJobs:{dropdowns:{Field:[{display:Tt("Total Received"),value:"total_receive",unit:"GB",type:"number"},{display:Tt("Total Sent"),value:"total_sent",unit:"GB",type:"number"},{display:Tt("Total Usage"),value:"total_data",unit:"GB",type:"number"},{display:Tt("Date"),value:"date",type:"date"}],Operator:[{display:Tt("larger than"),value:"lgt"}],Action:[{display:Tt("Restrict Peer"),value:"restrict"},{display:Tt("Delete Peer"),value:"delete"}]}}}),actions:{async getConfigurations(){await Vt("/api/getWireguardConfigurations",{},t=>{t.status&&(this.Configurations=t.data)})},regexCheckIP(t){return/((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/.test(t)},checkCIDR(t){return T_(t)!==0}}}),He=(t,e)=>{const n=t.__vccOpts||t;for(const[i,s]of e)n[i]=s;return n},hL={name:"localeText",props:{t:""},computed:{getLocaleText(){return Tt(this.t)}}};function fL(t,e,n,i,s,r){return xe(this.getLocaleText)}const Qe=He(hL,[["render",fL]]),gL={name:"navbar",components:{LocaleText:Qe},setup(){const t=vi(),e=nt();return{wireguardConfigurationsStore:t,dashboardConfigurationStore:e}},data(){return{updateAvailable:!1,updateMessage:"Checking for update...",updateUrl:""}},mounted(){Vt("/api/getDashboardUpdate",{},t=>{t.status?(t.data&&(this.updateAvailable=!0,this.updateUrl=t.data),this.updateMessage=t.message):(this.updateMessage=Tt("Failed to check available update"),console.log(`Failed to get update: ${t.message}`))})}},po=t=>(bn("data-v-c16dfe93"),t=t(),wn(),t),pL=["data-bs-theme"],mL={id:"sidebarMenu",class:"bg-body-tertiary sidebar border h-100 rounded-3 shadow overflow-y-scroll"},_L={class:"sidebar-sticky pt-3"},yL={class:"nav flex-column px-2"},vL={class:"nav-item"},bL=po(()=>g("i",{class:"bi bi-house me-2"},null,-1)),wL={class:"nav-item"},xL=po(()=>g("i",{class:"bi bi-gear me-2"},null,-1)),EL=po(()=>g("hr",{class:"text-body"},null,-1)),SL={class:"sidebar-heading px-3 mt-4 mb-1 text-muted text-center"},CL=po(()=>g("i",{class:"bi bi-body-text me-2"},null,-1)),TL={class:"nav flex-column px-2"},kL={class:"nav-item"},AL=po(()=>g("hr",{class:"text-body"},null,-1)),ML={class:"sidebar-heading px-3 mt-4 mb-1 text-muted text-center"},IL=po(()=>g("i",{class:"bi bi-tools me-2"},null,-1)),PL={class:"nav flex-column px-2"},RL={class:"nav-item"},DL={class:"nav-item"},$L=po(()=>g("hr",{class:"text-body"},null,-1)),LL={class:"nav flex-column px-2"},OL={class:"nav-item"},NL=po(()=>g("i",{class:"bi bi-box-arrow-left me-2"},null,-1)),FL={class:"nav-item",style:{"font-size":"0.8rem"}},BL=["href"],VL={class:"nav-link text-muted rounded-3"},zL={key:1,class:"nav-link text-muted rounded-3"};function WL(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("RouterLink");return D(),V("div",{class:Me(["col-md-3 col-lg-2 d-md-block p-3 navbar-container",{active:this.dashboardConfigurationStore.ShowNavBar}]),"data-bs-theme":i.dashboardConfigurationStore.Configuration.Server.dashboard_theme,style:{height:"calc(-50px + 100vh)"}},[g("nav",mL,[g("div",_L,[g("ul",yL,[g("li",vL,[B(a,{class:"nav-link rounded-3",to:"/","exact-active-class":"active"},{default:Re(()=>[bL,B(o,{t:"Home"})]),_:1})]),g("li",wL,[B(a,{class:"nav-link rounded-3",to:"/settings","exact-active-class":"active"},{default:Re(()=>[xL,B(o,{t:"Settings"})]),_:1})])]),EL,g("h6",SL,[CL,B(o,{t:"WireGuard Configurations"})]),g("ul",TL,[g("li",kL,[(D(!0),V($e,null,Xe(this.wireguardConfigurationsStore.Configurations,l=>(D(),Ce(a,{to:"/configuration/"+l.Name+"/peers",class:"nav-link nav-conf-link rounded-3","active-class":"active"},{default:Re(()=>[g("span",{class:Me(["dot me-2",{active:l.Status}])},null,2),Ye(" "+xe(l.Name),1)]),_:2},1032,["to"]))),256))])]),AL,g("h6",ML,[IL,B(o,{t:"Tools"})]),g("ul",PL,[g("li",RL,[B(a,{to:"/ping",class:"nav-link rounded-3","active-class":"active"},{default:Re(()=>[Ye("Ping")]),_:1})]),g("li",DL,[B(a,{to:"/traceroute",class:"nav-link rounded-3","active-class":"active"},{default:Re(()=>[Ye("Traceroute")]),_:1})])]),$L,g("ul",LL,[g("li",OL,[g("a",{class:"nav-link text-danger rounded-3",onClick:e[0]||(e[0]=l=>this.dashboardConfigurationStore.signOut()),role:"button",style:{"font-weight":"bold"}},[NL,B(o,{t:"Sign Out"})])]),g("li",FL,[this.updateAvailable?(D(),V("a",{key:0,href:this.updateUrl,class:"text-decoration-none rounded-3",target:"_blank"},[g("small",VL,[B(o,{t:this.updateMessage},null,8,["t"]),Ye(" ("),B(o,{t:"Current Version:"}),Ye(" "+xe(i.dashboardConfigurationStore.Configuration.Server.version)+") ",1)])],8,BL)):(D(),V("small",zL,[B(o,{t:this.updateMessage},null,8,["t"]),Ye(" ("+xe(i.dashboardConfigurationStore.Configuration.Server.version)+") ",1)]))])])])])],10,pL)}const HL=He(gL,[["render",WL],["__scopeId","data-v-c16dfe93"]]),YL={name:"message",components:{LocaleText:Qe},props:{message:Object},mounted(){setTimeout(()=>{this.message.show=!1},5e3)}},jL=["id"],KL={class:"card-body"},UL={class:"fw-bold d-block",style:{"text-transform":"uppercase"}};function GL(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",{class:Me(["card shadow rounded-3 position-relative mb-2",{"text-bg-danger":this.message.type==="danger","text-bg-success":this.message.type==="success","text-bg-warning":this.message.type==="warning"}]),id:this.message.id,style:{width:"400px"}},[g("div",KL,[g("small",UL,[B(o,{t:"FROM "}),Ye(" "+xe(this.message.from),1)]),Ye(" "+xe(this.message.content),1)])],10,jL)}const xS=He(YL,[["render",GL]]),XL={name:"index",components:{Message:xS,Navbar:HL},async setup(){return{dashboardConfigurationStore:nt()}},computed:{getMessages(){return this.dashboardConfigurationStore.Messages.filter(t=>t.show)}}},qL=["data-bs-theme"],ZL={class:"row h-100"},JL={class:"col-md-9 ml-sm-auto col-lg-10 px-md-4 overflow-y-scroll mb-0",style:{height:"calc(100vh - 50px)"}},QL={class:"messageCentre text-body position-fixed"};function eO(t,e,n,i,s,r){const o=Se("Navbar"),a=Se("RouterView"),l=Se("Message");return D(),V("div",{class:"container-fluid flex-grow-1 main","data-bs-theme":this.dashboardConfigurationStore.Configuration.Server.dashboard_theme},[g("div",ZL,[B(o),g("main",JL,[(D(),Ce(f_,null,{default:Re(()=>[B(a,null,{default:Re(({Component:c})=>[B(Rt,{name:"fade2",mode:"out-in"},{default:Re(()=>[(D(),Ce(ga(c)))]),_:2},1024)]),_:1})]),_:1})),g("div",QL,[B(jl,{name:"message",tag:"div",class:"position-relative"},{default:Re(()=>[(D(!0),V($e,null,Xe(r.getMessages.slice().reverse(),c=>(D(),Ce(l,{message:c,key:c.id},null,8,["message"]))),128))]),_:1})])])])],8,qL)}const tO=He(XL,[["render",eO],["__scopeId","data-v-b776d181"]]);var ES={exports:{}};(function(t,e){(function(n,i){t.exports=i()})(lx,function(){var n=1e3,i=6e4,s=36e5,r="millisecond",o="second",a="minute",l="hour",c="day",u="week",d="month",h="quarter",f="year",p="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(N){var L=["th","st","nd","rd"],I=N%100;return"["+N+(L[(I-20)%10]||L[I]||L[0])+"]"}},E=function(N,L,I){var W=String(N);return!W||W.length>=L?N:""+Array(L+1-W.length).join(I)+N},C={s:E,z:function(N){var L=-N.utcOffset(),I=Math.abs(L),W=Math.floor(I/60),X=I%60;return(L<=0?"+":"-")+E(W,2,"0")+":"+E(X,2,"0")},m:function N(L,I){if(L.date()1)return N(ne[0])}else{var ue=L.name;x[ue]=L,X=ue}return!W&&X&&(w=X),X||!W&&w},P=function(N,L){if(k(N))return N.clone();var I=typeof L=="object"?L:{};return I.date=N,I.args=arguments,new H(I)},F=C;F.l=A,F.i=k,F.w=function(N,L){return P(N,{locale:L.$L,utc:L.$u,x:L.$x,$offset:L.$offset})};var H=function(){function N(I){this.$L=A(I.locale,null,!0),this.parse(I),this.$x=this.$x||I.x||{},this[T]=!0}var L=N.prototype;return L.parse=function(I){this.$d=function(W){var X=W.date,J=W.utc;if(X===null)return new Date(NaN);if(F.u(X))return new Date;if(X instanceof Date)return new Date(X);if(typeof X=="string"&&!/Z$/i.test(X)){var ne=X.match(y);if(ne){var ue=ne[2]-1||0,Y=(ne[7]||"0").substring(0,3);return J?new Date(Date.UTC(ne[1],ue,ne[3]||1,ne[4]||0,ne[5]||0,ne[6]||0,Y)):new Date(ne[1],ue,ne[3]||1,ne[4]||0,ne[5]||0,ne[6]||0,Y)}}return new Date(X)}(I),this.init()},L.init=function(){var I=this.$d;this.$y=I.getFullYear(),this.$M=I.getMonth(),this.$D=I.getDate(),this.$W=I.getDay(),this.$H=I.getHours(),this.$m=I.getMinutes(),this.$s=I.getSeconds(),this.$ms=I.getMilliseconds()},L.$utils=function(){return F},L.isValid=function(){return this.$d.toString()!==m},L.isSame=function(I,W){var X=P(I);return this.startOf(W)<=X&&X<=this.endOf(W)},L.isAfter=function(I,W){return P(I){if(t.status===200)return t.json();throw new Error(t.statusText)}).then(()=>{this.endTime=pi(),this.active=!0}).catch(t=>{this.active=!1,this.errorMsg=t}),this.refreshing=!1)},async connect(){await fetch(`${this.server.host}/api/authenticate`,{headers:{"content-type":"application/json","wg-dashboard-apikey":this.server.apiKey},body:JSON.stringify({host:window.location.hostname}),method:"POST",signal:AbortSignal.timeout(5e3)}).then(t=>t.json()).then(t=>{this.$emit("setActiveServer"),this.$router.push("/")})}},mounted(){this.handshake()},computed:{getHandshakeTime(){return this.startTime&&this.endTime?`${pi().subtract(this.startTime).millisecond()}ms`:this.refreshing?Tt("Pinging..."):this.errorMsg?this.errorMsg:"N/A"}}},Kl=t=>(bn("data-v-ed7817c7"),t=t(),wn(),t),sO={class:"card rounded-3"},rO={class:"card-body"},oO={class:"d-flex gap-3 w-100 remoteServerContainer"},aO={class:"d-flex gap-3 align-items-center flex-grow-1"},lO=Kl(()=>g("i",{class:"bi bi-server"},null,-1)),cO={class:"d-flex gap-3 align-items-center flex-grow-1"},uO=Kl(()=>g("i",{class:"bi bi-key-fill"},null,-1)),dO={class:"d-flex gap-2 button-group"},hO=Kl(()=>g("i",{class:"bi bi-trash"},null,-1)),fO=[hO],gO=Kl(()=>g("i",{class:"bi bi-arrow-right-circle"},null,-1)),pO=[gO],mO={class:"card-footer gap-2 d-flex align-items-center"},_O={key:0,class:"spin ms-auto text-primary-emphasis"},yO=Kl(()=>g("i",{class:"bi bi-arrow-clockwise"},null,-1)),vO=[yO],bO=Kl(()=>g("i",{class:"bi bi-arrow-clockwise me"},null,-1)),wO=[bO];function xO(t,e,n,i,s,r){return D(),V("div",sO,[g("div",rO,[g("div",oO,[g("div",aO,[lO,Oe(g("input",{class:"form-control form-control-sm",onBlur:e[0]||(e[0]=o=>this.handshake()),"onUpdate:modelValue":e[1]||(e[1]=o=>this.server.host=o),type:"url"},null,544),[[Ke,this.server.host]])]),g("div",cO,[uO,Oe(g("input",{class:"form-control form-control-sm",onBlur:e[2]||(e[2]=o=>this.handshake()),"onUpdate:modelValue":e[3]||(e[3]=o=>this.server.apiKey=o),type:"text"},null,544),[[Ke,this.server.apiKey]])]),g("div",dO,[g("button",{onClick:e[4]||(e[4]=o=>this.$emit("delete")),class:"ms-auto btn btn-sm bg-danger-subtle text-danger-emphasis border-1 border-danger-subtle"},fO),g("button",{onClick:e[5]||(e[5]=o=>this.connect()),class:Me([{disabled:!this.active},"ms-auto btn btn-sm bg-success-subtle text-success-emphasis border-1 border-success-subtle"])},pO,2)])])]),g("div",mO,[g("span",{class:Me(["dot ms-0 me-2",[this.active?"active":"inactive"]])},null,2),g("small",null,xe(this.getHandshakeTime),1),this.refreshing?(D(),V("div",_O,vO)):(D(),V("a",{key:1,role:"button",onClick:e[6]||(e[6]=o=>this.handshake()),class:"text-primary-emphasis text-decoration-none ms-auto disabled"},wO))])])}const EO=He(iO,[["render",xO],["__scopeId","data-v-ed7817c7"]]),SO={name:"RemoteServerList",setup(){return{store:nt()}},components:{LocaleText:Qe,RemoteServer:EO}},CO={class:"w-100 mt-3"},TO={class:"d-flex align-items-center mb-3"},kO={class:"mb-0"},AO=g("i",{class:"bi bi-plus-circle-fill me-2"},null,-1),MO={class:"w-100 d-flex gap-3 flex-column p-3 border border-1 border-secondary-subtle rounded-3",style:{height:"400px","overflow-y":"scroll"}},IO={key:0,class:"text-muted m-auto"},PO=g("i",{class:"bi bi-plus-circle-fill mx-1"},null,-1);function RO(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("RemoteServer");return D(),V("div",CO,[g("div",TO,[g("h5",kO,[B(o,{t:"Server List"})]),g("button",{onClick:e[0]||(e[0]=l=>this.store.addCrossServerConfiguration()),class:"btn bg-primary-subtle text-primary-emphasis border-1 border-primary-subtle shadow-sm ms-auto"},[AO,B(o,{t:"Server"})])]),g("div",MO,[(D(!0),V($e,null,Xe(this.store.CrossServerConfiguration.ServerList,(l,c)=>(D(),Ce(a,{onSetActiveServer:u=>this.store.setActiveCrossServer(c),onDelete:u=>this.store.deleteCrossServerConfiguration(c),key:c,server:l},null,8,["onSetActiveServer","onDelete","server"]))),128)),Object.keys(this.store.CrossServerConfiguration.ServerList).length===0?(D(),V("h6",IO,[B(o,{t:"Click"}),PO,B(o,{t:"to add your server"})])):ce("",!0)])])}const DO=He(SO,[["render",RO]]),$O={name:"signInInput",methods:{GetLocale:Tt},props:{id:"",data:"",type:"",placeholder:""},computed:{getLocaleText(){return Tt(this.placeholder)}}},LO=["type","id","name","placeholder"];function OO(t,e,n,i,s,r){return Oe((D(),V("input",{type:n.type,"onUpdate:modelValue":e[0]||(e[0]=o=>this.data[this.id]=o),class:"form-control",id:this.id,name:this.id,autocomplete:"on",placeholder:this.getLocaleText,required:""},null,8,LO)),[[QE,this.data[this.id]]])}const NO=He($O,[["render",OO]]),FO={name:"signInTOTP",methods:{GetLocale:Tt},props:{data:""},computed:{getLocaleText(){return Tt("OTP from your authenticator")}}},BO=["placeholder"];function VO(t,e,n,i,s,r){return Oe((D(),V("input",{class:"form-control totp",required:"",id:"totp",maxlength:"6",type:"text",inputmode:"numeric",autocomplete:"one-time-code",placeholder:this.getLocaleText,"onUpdate:modelValue":e[0]||(e[0]=o=>this.data.totp=o)},null,8,BO)),[[Ke,this.data.totp]])}const zO=He(FO,[["render",VO]]),WO={name:"signin",components:{SignInTOTP:zO,SignInInput:NO,LocaleText:Qe,RemoteServerList:DO,Message:xS},async setup(){const t=nt();let e="dark",n=!1,i;return t.IsElectronApp||await Promise.all([Vt("/api/getDashboardTheme",{},s=>{e=s.data}),Vt("/api/isTotpEnabled",{},s=>{n=s.data}),Vt("/api/getDashboardVersion",{},s=>{i=s.data})]),t.removeActiveCrossServer(),{store:t,theme:e,totpEnabled:n,version:i}},data(){return{data:{username:"",password:"",totp:""},loginError:!1,loginErrorMessage:"",loading:!1}},computed:{getMessages(){return this.store.Messages.filter(t=>t.show)},applyLocale(t){return Tt(t)}},methods:{GetLocale:Tt,async auth(){this.data.username&&this.data.password&&(this.totpEnabled&&this.data.totp||!this.totpEnabled)?(this.loading=!0,await kt("/api/authenticate",this.data,t=>{t.status?(this.loginError=!1,this.$refs.signInBtn.classList.add("signedIn"),t.message?this.$router.push("/welcome"):this.store.Redirect!==void 0?this.$router.push(this.store.Redirect):this.$router.push("/")):(this.loginError=!0,this.loginErrorMessage=t.message,document.querySelectorAll("input[required]").forEach(e=>{e.classList.remove("is-valid"),e.classList.add("is-invalid")}),this.loading=!1)})):document.querySelectorAll("input[required]").forEach(t=>{t.value.length===0?(t.classList.remove("is-valid"),t.classList.add("is-invalid")):(t.classList.remove("is-invalid"),t.classList.add("is-valid"))})}}},ma=t=>(bn("data-v-2fa13e60"),t=t(),wn(),t),HO=["data-bs-theme"],YO={class:"login-box m-auto"},jO={class:"m-auto",style:{width:"700px"}},KO={class:"mb-0 text-body"},UO=ma(()=>g("span",{class:"dashboardLogo display-3"},[g("strong",null,"WGDashboard")],-1)),GO={key:0,class:"alert alert-danger mt-2 mb-0",role:"alert"},XO={class:"form-group text-body"},qO=ma(()=>g("label",{for:"username",class:"text-left",style:{"font-size":"1rem"}},[g("i",{class:"bi bi-person-circle"})],-1)),ZO={class:"form-group text-body"},JO=ma(()=>g("label",{for:"password",class:"text-left",style:{"font-size":"1rem"}},[g("i",{class:"bi bi-key-fill"})],-1)),QO={key:0,class:"form-group text-body"},eN=ma(()=>g("label",{for:"totp",class:"text-left",style:{"font-size":"1rem"}},[g("i",{class:"bi bi-lock-fill"})],-1)),tN={class:"btn btn-lg btn-dark ms-auto mt-4 w-100 d-flex btn-brand signInBtn",ref:"signInBtn"},nN={key:0,class:"d-flex w-100"},iN=ma(()=>g("i",{class:"ms-auto bi bi-chevron-right"},null,-1)),sN={key:1,class:"d-flex w-100 align-items-center"},rN=ma(()=>g("span",{class:"spinner-border ms-auto spinner-border-sm",role:"status"},null,-1)),oN={key:3,class:"d-flex mt-3"},aN={class:"form-check form-switch ms-auto"},lN={class:"form-check-label",for:"flexSwitchCheckChecked"},cN={class:"text-muted pb-3 d-block w-100 text-center mt-3"},uN=ma(()=>g("a",{href:"https://github.com/donaldzou",target:"_blank"},[g("strong",null,"Donald Zou")],-1)),dN={class:"messageCentre text-body position-absolute end-0 m-3"};function hN(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("SignInInput"),l=Se("SignInTOTP"),c=Se("RemoteServerList"),u=Se("Message");return D(),V("div",{class:"container-fluid login-container-fluid d-flex main flex-column py-4 text-body",style:{"overflow-y":"scroll"},"data-bs-theme":this.theme},[g("div",YO,[g("div",jO,[g("h4",KO,[B(o,{t:"Welcome to"})]),UO,s.loginError?(D(),V("div",GO,[B(o,{t:this.loginErrorMessage},null,8,["t"])])):ce("",!0),this.store.CrossServerConfiguration.Enable?(D(),Ce(c,{key:2})):(D(),V("form",{key:1,onSubmit:e[0]||(e[0]=d=>{d.preventDefault(),this.auth()})},[g("div",XO,[qO,B(a,{id:"username",data:this.data,type:"text",placeholder:"Username"},null,8,["data"])]),g("div",ZO,[JO,B(a,{id:"password",data:this.data,type:"password",placeholder:"Password"},null,8,["data"])]),i.totpEnabled?(D(),V("div",QO,[eN,B(l,{data:this.data},null,8,["data"])])):ce("",!0),g("button",tN,[this.loading?(D(),V("span",sN,[B(o,{t:"Signing In..."}),rN])):(D(),V("span",nN,[B(o,{t:"Sign In"}),iN]))],512)],32)),this.store.IsElectronApp?ce("",!0):(D(),V("div",oN,[g("div",aN,[Oe(g("input",{"onUpdate:modelValue":e[1]||(e[1]=d=>this.store.CrossServerConfiguration.Enable=d),class:"form-check-input",type:"checkbox",role:"switch",id:"flexSwitchCheckChecked"},null,512),[[Jn,this.store.CrossServerConfiguration.Enable]]),g("label",lN,[B(o,{t:"Access Remote Server"})])])]))])]),g("small",cN,[Ye(" WGDashboard "+xe(this.version)+" | Developed with ❤️ by ",1),uN]),g("div",dN,[B(jl,{name:"message",tag:"div",class:"position-relative"},{default:Re(()=>[(D(!0),V($e,null,Xe(r.getMessages.slice().reverse(),d=>(D(),Ce(u,{message:d,key:d.id},null,8,["message"]))),128))]),_:1})])],8,HO)}const fN=He(WO,[["render",hN],["__scopeId","data-v-2fa13e60"]]),gN={name:"configurationCard",components:{LocaleText:Qe},props:{c:{Name:String,Status:Boolean,PublicKey:String,PrivateKey:String}},data(){return{configurationToggling:!1}},setup(){return{dashboardConfigurationStore:nt()}},methods:{toggle(){this.configurationToggling=!0,Vt("/api/toggleWireguardConfiguration/",{configurationName:this.c.Name},t=>{t.status?this.dashboardConfigurationStore.newMessage("Server",`${this.c.Name} ${t.data?"is on":"is off"}`):this.dashboardConfigurationStore.newMessage("Server",t.message,"danger"),this.c.Status=t.data,this.configurationToggling=!1})}}},pN={class:"card conf_card rounded-3 shadow text-decoration-none"},mN={class:"mb-0"},_N={class:"card-title mb-0"},yN=g("h6",{class:"mb-0 ms-auto"},[g("i",{class:"bi bi-chevron-right"})],-1),vN={class:"card-footer d-flex gap-2 flex-column"},bN={class:"row"},wN={class:"col-6 col-md-3"},xN=g("i",{class:"bi bi-arrow-down-up me-2"},null,-1),EN={class:"text-primary-emphasis col-6 col-md-3"},SN=g("i",{class:"bi bi-arrow-down me-2"},null,-1),CN={class:"text-success-emphasis col-6 col-md-3"},TN=g("i",{class:"bi bi-arrow-up me-2"},null,-1),kN={class:"text-md-end col-6 col-md-3"},AN={class:"d-flex align-items-center gap-2"},MN={class:"text-muted"},IN={style:{"word-break":"keep-all"}},PN={class:"mb-0 d-block d-lg-inline-block"},RN={style:{"line-break":"anywhere"}},DN={class:"form-check form-switch ms-auto"},$N=["for"],LN={key:4,class:"spinner-border spinner-border-sm ms-2","aria-hidden":"true"},ON=["disabled","id"];function NN(t,e,n,i,s,r){const o=Se("RouterLink"),a=Se("LocaleText");return D(),V("div",pN,[B(o,{to:"/configuration/"+n.c.Name+"/peers",class:"card-body d-flex align-items-center gap-3 flex-wrap text-decoration-none"},{default:Re(()=>[g("h6",mN,[g("span",{class:Me(["dot",{active:n.c.Status}])},null,2)]),g("h6",_N,[g("samp",null,xe(n.c.Name),1)]),yN]),_:1},8,["to"]),g("div",vN,[g("div",bN,[g("small",wN,[xN,Ye(xe(n.c.DataUsage.Total>0?n.c.DataUsage.Total.toFixed(4):0)+" GB ",1)]),g("small",EN,[SN,Ye(xe(n.c.DataUsage.Receive>0?n.c.DataUsage.Receive.toFixed(4):0)+" GB ",1)]),g("small",CN,[TN,Ye(xe(n.c.DataUsage.Sent>0?n.c.DataUsage.Sent.toFixed(4):0)+" GB ",1)]),g("small",kN,[g("span",{class:Me(["dot me-2",{active:n.c.ConnectedPeers>0}])},null,2),Ye(xe(n.c.ConnectedPeers)+" ",1),B(a,{t:"Peers"})])]),g("div",AN,[g("small",MN,[g("strong",IN,[B(a,{t:"Public Key"})])]),g("small",PN,[g("samp",RN,xe(n.c.PublicKey),1)]),g("div",DN,[g("label",{class:"form-check-label",style:{cursor:"pointer"},for:"switch"+n.c.PrivateKey},[!n.c.Status&&this.configurationToggling?(D(),Ce(a,{key:0,t:"Turning Off..."})):n.c.Status&&this.configurationToggling?(D(),Ce(a,{key:1,t:"Turning On..."})):n.c.Status&&!this.configurationToggling?(D(),Ce(a,{key:2,t:"On"})):!n.c.Status&&!this.configurationToggling?(D(),Ce(a,{key:3,t:"Off"})):ce("",!0),this.configurationToggling?(D(),V("span",LN)):ce("",!0)],8,$N),Oe(g("input",{class:"form-check-input",style:{cursor:"pointer"},disabled:this.configurationToggling,type:"checkbox",role:"switch",id:"switch"+n.c.PrivateKey,onChange:e[0]||(e[0]=l=>this.toggle()),"onUpdate:modelValue":e[1]||(e[1]=l=>n.c.Status=l)},null,40,ON),[[Jn,n.c.Status]])])])])])}const FN=He(gN,[["render",NN]]),BN={name:"configurationList",components:{LocaleText:Qe,ConfigurationCard:FN},async setup(){return{wireguardConfigurationsStore:vi()}},data(){return{configurationLoaded:!1}},async mounted(){await this.wireguardConfigurationsStore.getConfigurations(),this.configurationLoaded=!0,this.wireguardConfigurationsStore.ConfigurationListInterval=setInterval(()=>{this.wireguardConfigurationsStore.getConfigurations()},1e4)},beforeUnmount(){clearInterval(this.wireguardConfigurationsStore.ConfigurationListInterval)}},SS=t=>(bn("data-v-106e7dee"),t=t(),wn(),t),VN={class:"mt-md-5 mt-3"},zN={class:"container-md"},WN={class:"d-flex mb-4 configurationListTitle"},HN={class:"text-body d-flex"},YN=SS(()=>g("i",{class:"bi bi-body-text me-2"},null,-1)),jN=SS(()=>g("i",{class:"bi bi-plus-circle-fill me-2"},null,-1)),KN={key:0},UN={key:0,class:"text-muted"},GN={key:1,class:"d-flex gap-3 flex-column mb-3"};function XN(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("RouterLink"),l=Se("ConfigurationCard");return D(),V("div",VN,[g("div",zN,[g("div",WN,[g("h3",HN,[YN,g("span",null,[B(o,{t:"WireGuard Configurations"})])]),B(a,{to:"/new_configuration",class:"btn btn-dark btn-brand rounded-3 px-3 py-2 shadow ms-auto rounded-3"},{default:Re(()=>[jN,B(o,{t:"Configuration"})]),_:1})]),B(Rt,{name:"fade",mode:"out-in"},{default:Re(()=>[this.configurationLoaded?(D(),V("div",KN,[this.wireguardConfigurationsStore.Configurations.length===0?(D(),V("p",UN,[B(o,{t:"You don't have any WireGuard configurations yet. Please check the configuration folder or change it in Settings. By default the folder is /etc/wireguard."})])):(D(),V("div",GN,[(D(!0),V($e,null,Xe(this.wireguardConfigurationsStore.Configurations,c=>(D(),Ce(l,{key:c.Name,c},null,8,["c"]))),128))]))])):ce("",!0)]),_:1})])])}const qN=He(BN,[["render",XN],["__scopeId","data-v-106e7dee"]]);let bd;const ZN=new Uint8Array(16);function JN(){if(!bd&&(bd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!bd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return bd(ZN)}const Dn=[];for(let t=0;t<256;++t)Dn.push((t+256).toString(16).slice(1));function QN(t,e=0){return Dn[t[e+0]]+Dn[t[e+1]]+Dn[t[e+2]]+Dn[t[e+3]]+"-"+Dn[t[e+4]]+Dn[t[e+5]]+"-"+Dn[t[e+6]]+Dn[t[e+7]]+"-"+Dn[t[e+8]]+Dn[t[e+9]]+"-"+Dn[t[e+10]]+Dn[t[e+11]]+Dn[t[e+12]]+Dn[t[e+13]]+Dn[t[e+14]]+Dn[t[e+15]]}const e3=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),db={randomUUID:e3};function Os(t,e,n){if(db.randomUUID&&!e&&!t)return db.randomUUID();t=t||{};const i=t.random||(t.rng||JN)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){n=n||0;for(let s=0;s<16;++s)e[n+s]=i[s];return e}return QN(i)}const t3={components:{LocaleText:Qe},props:{targetData:String,title:String,warning:!1,warningText:""},setup(){const t=nt(),e=`input_${Os()}`;return{store:t,uuid:e}},data(){return{value:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.value=this.store.Configuration.Peers[this.targetData]},methods:{async useValidation(){this.changed&&await kt("/api/updateDashboardConfigurationItem",{section:"Peers",key:this.targetData,value:this.value},t=>{t.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Peers[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=t.message),this.changed=!1,this.updating=!1})}}},n3={class:"form-group mb-2"},i3=["for"],s3=["id","disabled"],r3={class:"invalid-feedback"},o3={key:0,class:"px-2 py-1 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2 d-inline-block mt-1"},a3=g("i",{class:"bi bi-exclamation-triangle-fill me-2"},null,-1);function l3(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",n3,[g("label",{for:this.uuid,class:"text-muted mb-1"},[g("strong",null,[g("small",null,[B(o,{t:this.title},null,8,["t"])])])],8,i3),Oe(g("input",{type:"text",class:Me(["form-control",{"is-invalid":s.showInvalidFeedback,"is-valid":s.isValid}]),id:this.uuid,"onUpdate:modelValue":e[0]||(e[0]=a=>this.value=a),onKeydown:e[1]||(e[1]=a=>this.changed=!0),onBlur:e[2]||(e[2]=a=>r.useValidation()),disabled:this.updating},null,42,s3),[[Ke,this.value]]),g("div",r3,xe(this.invalidFeedback),1),n.warning?(D(),V("div",o3,[g("small",null,[a3,B(o,{t:n.warningText},null,8,["t"])])])):ce("",!0)])}const c3=He(t3,[["render",l3]]),u3=t=>{},d3={name:"accountSettingsInputUsername",components:{LocaleText:Qe},props:{targetData:String,title:String},setup(){const t=nt(),e=`input_${Os()}`;return{store:t,uuid:e}},data(){return{value:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.value=this.store.Configuration.Account[this.targetData]},methods:{async useValidation(t){this.changed&&(this.updating=!0,await kt("/api/updateDashboardConfigurationItem",{section:"Account",key:this.targetData,value:this.value},e=>{e.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=e.message),this.changed=!1,this.updating=!1}))}}},h3={class:"form-group mb-2"},f3=["for"],g3=["id","disabled"],p3={class:"invalid-feedback"};function m3(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",h3,[g("label",{for:this.uuid,class:"text-muted mb-1"},[g("strong",null,[g("small",null,[B(o,{t:this.title},null,8,["t"])])])],8,f3),Oe(g("input",{type:"text",class:Me(["form-control",{"is-invalid":s.showInvalidFeedback,"is-valid":s.isValid}]),id:this.uuid,"onUpdate:modelValue":e[0]||(e[0]=a=>this.value=a),onKeydown:e[1]||(e[1]=a=>this.changed=!0),onBlur:e[2]||(e[2]=a=>r.useValidation()),disabled:this.updating},null,42,g3),[[Ke,this.value]]),g("div",p3,xe(this.invalidFeedback),1)])}const _3=He(d3,[["render",m3]]),y3={name:"accountSettingsInputPassword",components:{LocaleText:Qe},props:{targetData:String,warning:!1,warningText:""},setup(){const t=nt(),e=`input_${Os()}`;return{store:t,uuid:e}},data(){return{value:{currentPassword:"",newPassword:"",repeatNewPassword:""},invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0}},methods:{async useValidation(){Object.values(this.value).find(t=>t.length===0)===void 0?this.value.newPassword===this.value.repeatNewPassword?await kt("/api/updateDashboardConfigurationItem",{section:"Account",key:this.targetData,value:this.value},t=>{t.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.isValid=!1,this.value={currentPassword:"",newPassword:"",repeatNewPassword:""}},5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=t.message)}):(this.showInvalidFeedback=!0,this.invalidFeedback="New passwords does not match"):(this.showInvalidFeedback=!0,this.invalidFeedback="Please fill in all required fields.")}},computed:{passwordValid(){return Object.values(this.value).find(t=>t.length===0)===void 0&&this.value.newPassword===this.value.repeatNewPassword}}},v3={class:"d-flex flex-column"},b3={class:"row"},w3={class:"col-sm"},x3={class:"form-group mb-2"},E3=["for"],S3=["id"],C3={key:0,class:"invalid-feedback d-block"},T3={class:"col-sm"},k3={class:"form-group mb-2"},A3=["for"],M3=["id"],I3={class:"col-sm"},P3={class:"form-group mb-2"},R3=["for"],D3=["id"],$3=["disabled"],L3=g("i",{class:"bi bi-save2-fill me-2"},null,-1);function O3(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",v3,[g("div",b3,[g("div",w3,[g("div",x3,[g("label",{for:"currentPassword_"+this.uuid,class:"text-muted mb-1"},[g("strong",null,[g("small",null,[B(o,{t:"Current Password"})])])],8,E3),Oe(g("input",{type:"password",class:Me(["form-control mb-2",{"is-invalid":s.showInvalidFeedback,"is-valid":s.isValid}]),"onUpdate:modelValue":e[0]||(e[0]=a=>this.value.currentPassword=a),id:"currentPassword_"+this.uuid},null,10,S3),[[Ke,this.value.currentPassword]]),s.showInvalidFeedback?(D(),V("div",C3,xe(this.invalidFeedback),1)):ce("",!0)])]),g("div",T3,[g("div",k3,[g("label",{for:"newPassword_"+this.uuid,class:"text-muted mb-1"},[g("strong",null,[g("small",null,[B(o,{t:"New Password"})])])],8,A3),Oe(g("input",{type:"password",class:Me(["form-control mb-2",{"is-invalid":s.showInvalidFeedback,"is-valid":s.isValid}]),"onUpdate:modelValue":e[1]||(e[1]=a=>this.value.newPassword=a),id:"newPassword_"+this.uuid},null,10,M3),[[Ke,this.value.newPassword]])])]),g("div",I3,[g("div",P3,[g("label",{for:"repeatNewPassword_"+this.uuid,class:"text-muted mb-1"},[g("strong",null,[g("small",null,[B(o,{t:"Repeat New Password"})])])],8,R3),Oe(g("input",{type:"password",class:Me(["form-control mb-2",{"is-invalid":s.showInvalidFeedback,"is-valid":s.isValid}]),"onUpdate:modelValue":e[2]||(e[2]=a=>this.value.repeatNewPassword=a),id:"repeatNewPassword_"+this.uuid},null,10,D3),[[Ke,this.value.repeatNewPassword]])])])]),g("button",{disabled:!this.passwordValid,class:"ms-auto btn bg-success-subtle text-success-emphasis border-1 border-success-subtle rounded-3 shadow-sm",onClick:e[3]||(e[3]=a=>this.useValidation())},[L3,B(o,{t:"Update Password"})],8,$3)])}const N3=He(y3,[["render",O3]]),F3={name:"dashboardSettingsInputWireguardConfigurationPath",components:{LocaleText:Qe},props:{targetData:String,title:String,warning:!1,warningText:""},setup(){const t=nt(),e=vi(),n=`input_${Os()}`;return{store:t,uuid:n,WireguardConfigurationStore:e}},data(){return{value:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.value=this.store.Configuration.Server[this.targetData]},methods:{async useValidation(){this.changed&&(this.updating=!0,await kt("/api/updateDashboardConfigurationItem",{section:"Server",key:this.targetData,value:this.value},t=>{t.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3),this.WireguardConfigurationStore.getConfigurations(),this.store.newMessage("Server","WireGuard configuration path saved","success")):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=t.message),this.changed=!1,this.updating=!1}))}}},B3={class:"form-group"},V3=["for"],z3={class:"d-flex gap-2 align-items-start"},W3={class:"flex-grow-1"},H3=["id","disabled"],Y3={class:"invalid-feedback fw-bold"},j3=["disabled"],K3={key:0,class:"bi bi-save2-fill"},U3={key:1,class:"spinner-border spinner-border-sm"},G3={key:0,class:"px-2 py-1 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2 d-inline-block mt-1 mb-2"},X3=g("i",{class:"bi bi-exclamation-triangle-fill me-2"},null,-1);function q3(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",B3,[g("label",{for:this.uuid,class:"text-muted mb-1"},[g("strong",null,[g("small",null,[B(o,{t:this.title},null,8,["t"])])])],8,V3),g("div",z3,[g("div",W3,[Oe(g("input",{type:"text",class:Me(["form-control rounded-3",{"is-invalid":this.showInvalidFeedback,"is-valid":this.isValid}]),id:this.uuid,"onUpdate:modelValue":e[0]||(e[0]=a=>this.value=a),onKeydown:e[1]||(e[1]=a=>this.changed=!0),disabled:this.updating},null,42,H3),[[Ke,this.value]]),g("div",Y3,xe(this.invalidFeedback),1)]),g("button",{onClick:e[2]||(e[2]=a=>this.useValidation()),disabled:!this.changed,class:"ms-auto btn rounded-3 border-success-subtle bg-success-subtle text-success-emphasis"},[this.updating?(D(),V("span",U3)):(D(),V("i",K3))],8,j3)]),n.warning?(D(),V("div",G3,[g("small",null,[X3,B(o,{t:n.warningText},null,8,["t"])])])):ce("",!0)])}const Z3=He(F3,[["render",q3]]),J3={name:"dashboardTheme",components:{LocaleText:Qe},setup(){return{dashboardConfigurationStore:nt()}},methods:{async switchTheme(t){await kt("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_theme",value:t},e=>{e.status&&(this.dashboardConfigurationStore.Configuration.Server.dashboard_theme=t)})}}},Q3={class:"card mb-4 shadow rounded-3"},eF={class:"card-header"},tF={class:"card-body d-flex gap-2"},nF=g("i",{class:"bi bi-sun-fill me-2"},null,-1),iF=g("i",{class:"bi bi-moon-fill me-2"},null,-1);function sF(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",Q3,[g("p",eF,[B(o,{t:"Dashboard Theme"})]),g("div",tF,[g("button",{class:Me(["btn bg-primary-subtle text-primary-emphasis flex-grow-1",{active:this.dashboardConfigurationStore.Configuration.Server.dashboard_theme==="light"}]),onClick:e[0]||(e[0]=a=>this.switchTheme("light"))},[nF,B(o,{t:"Light"})],2),g("button",{class:Me(["btn bg-primary-subtle text-primary-emphasis flex-grow-1",{active:this.dashboardConfigurationStore.Configuration.Server.dashboard_theme==="dark"}]),onClick:e[1]||(e[1]=a=>this.switchTheme("dark"))},[iF,B(o,{t:"Dark"})],2)])])}const rF=He(J3,[["render",sF]]),oF={name:"dashboardSettingsInputIPAddressAndPort",props:{},setup(){const t=nt(),e=`input_${Os()}`;return{store:t,uuid:e}},data(){return{app_ip:"",app_port:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.app_ip=this.store.Configuration.Server.app_ip,this.app_port=this.store.Configuration.Server.app_port},methods:{async useValidation(){this.changed&&await kt("/api/updateDashboardConfigurationItem",{section:"Server",key:this.targetData,value:this.value},t=>{t.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=t.message)})}}},aF={class:"invalid-feedback d-block mt-0"},lF={class:"row"},cF={class:"form-group mb-2 col-sm"},uF=["for"],dF=g("strong",null,[g("small",null,"Dashboard IP Address")],-1),hF=[dF],fF=["id"],gF=g("div",{class:"px-2 py-1 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2 d-inline-block"},[g("small",null,[g("i",{class:"bi bi-exclamation-triangle-fill me-2"}),g("code",null,"0.0.0.0"),Ye(" means it can be access by anyone with your server IP Address.")])],-1),pF={class:"form-group col-sm"},mF=["for"],_F=g("strong",null,[g("small",null,"Dashboard Port")],-1),yF=[_F],vF=["id"],bF=g("button",{class:"btn btn-success btn-sm fw-bold rounded-3"},[g("i",{class:"bi bi-floppy-fill me-2"}),Ye("Update Dashboard Settings & Restart ")],-1);function wF(t,e,n,i,s,r){return D(),V("div",null,[g("div",aF,xe(this.invalidFeedback),1),g("div",lF,[g("div",cF,[g("label",{for:"app_ip_"+this.uuid,class:"text-muted mb-1"},hF,8,uF),Oe(g("input",{type:"text",class:"form-control mb-2",id:"app_ip_"+this.uuid,"onUpdate:modelValue":e[0]||(e[0]=o=>this.app_ip=o)},null,8,fF),[[Ke,this.app_ip]]),gF]),g("div",pF,[g("label",{for:"app_port_"+this.uuid,class:"text-muted mb-1"},yF,8,mF),Oe(g("input",{type:"text",class:"form-control mb-2",id:"app_port_"+this.uuid,"onUpdate:modelValue":e[1]||(e[1]=o=>this.app_port=o)},null,8,vF),[[Ke,this.app_port]])])]),bF])}const xF=He(oF,[["render",wF]]);function Ve(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function yt(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function ss(t,e){const n=Ve(t);return isNaN(e)?yt(t,NaN):(e&&n.setDate(n.getDate()+e),n)}function us(t,e){const n=Ve(t);if(isNaN(e))return yt(t,NaN);if(!e)return n;const i=n.getDate(),s=yt(t,n.getTime());s.setMonth(n.getMonth()+e+1,0);const r=s.getDate();return i>=r?s:(n.setFullYear(s.getFullYear(),s.getMonth(),i),n)}function CS(t,e){const{years:n=0,months:i=0,weeks:s=0,days:r=0,hours:o=0,minutes:a=0,seconds:l=0}=e,c=Ve(t),u=i||n?us(c,i+n*12):c,d=r||s?ss(u,r+s*7):u,h=a+o*60,p=(l+h*60)*1e3;return yt(t,d.getTime()+p)}function EF(t,e){const n=+Ve(t);return yt(t,n+e)}const TS=6048e5,SF=864e5,CF=6e4,kS=36e5,TF=1e3;function kF(t,e){return EF(t,e*kS)}let AF={};function _a(){return AF}function fs(t,e){const n=_a(),i=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=Ve(t),r=s.getDay(),o=(r=s.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function hb(t){const e=Ve(t);return e.setHours(0,0,0,0),e}function yh(t){const e=Ve(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function MS(t,e){const n=hb(t),i=hb(e),s=+n-yh(n),r=+i-yh(i);return Math.round((s-r)/SF)}function MF(t){const e=AS(t),n=yt(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),xl(n)}function IF(t,e){const n=e*3;return us(t,n)}function k_(t,e){return us(t,e*12)}function fb(t,e){const n=Ve(t),i=Ve(e),s=n.getTime()-i.getTime();return s<0?-1:s>0?1:s}function IS(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function zc(t){if(!IS(t)&&typeof t!="number")return!1;const e=Ve(t);return!isNaN(Number(e))}function gb(t){const e=Ve(t);return Math.trunc(e.getMonth()/3)+1}function PF(t,e){const n=Ve(t),i=Ve(e);return n.getFullYear()-i.getFullYear()}function RF(t,e){const n=Ve(t),i=Ve(e),s=fb(n,i),r=Math.abs(PF(n,i));n.setFullYear(1584),i.setFullYear(1584);const o=fb(n,i)===-s,a=s*(r-+o);return a===0?0:a}function PS(t,e){const n=Ve(t.start),i=Ve(t.end);let s=+n>+i;const r=s?+n:+i,o=s?i:n;o.setHours(0,0,0,0);let a=e?.step??1;if(!a)return[];a<0&&(a=-a,s=!s);const l=[];for(;+o<=r;)l.push(Ve(o)),o.setDate(o.getDate()+a),o.setHours(0,0,0,0);return s?l.reverse():l}function Ko(t){const e=Ve(t),n=e.getMonth(),i=n-n%3;return e.setMonth(i,1),e.setHours(0,0,0,0),e}function DF(t,e){const n=Ve(t.start),i=Ve(t.end);let s=+n>+i;const r=s?+Ko(n):+Ko(i);let o=Ko(s?i:n),a=e?.step??1;if(!a)return[];a<0&&(a=-a,s=!s);const l=[];for(;+o<=r;)l.push(Ve(o)),o=IF(o,a);return s?l.reverse():l}function $F(t){const e=Ve(t);return e.setDate(1),e.setHours(0,0,0,0),e}function RS(t){const e=Ve(t),n=e.getFullYear();return e.setFullYear(n+1,0,0),e.setHours(23,59,59,999),e}function ru(t){const e=Ve(t),n=yt(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}function DS(t,e){const n=_a(),i=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=Ve(t),r=s.getDay(),o=(r{let i;const s=LF[t];return typeof s=="string"?i=s:e===1?i=s.one:i=s.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function Pg(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const NF={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},FF={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},BF={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},VF={date:Pg({formats:NF,defaultWidth:"full"}),time:Pg({formats:FF,defaultWidth:"full"}),dateTime:Pg({formats:BF,defaultWidth:"full"})},zF={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},WF=(t,e,n,i)=>zF[t];function ac(t){return(e,n)=>{const i=n?.context?String(n.context):"standalone";let s;if(i==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=n?.width?String(n.width):o;s=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=n?.width?String(n.width):t.defaultWidth;s=t.values[a]||t.values[o]}const r=t.argumentCallback?t.argumentCallback(e):e;return s[r]}}const HF={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},YF={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},jF={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},KF={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},UF={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},GF={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},XF=(t,e)=>{const n=Number(t),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},qF={ordinalNumber:XF,era:ac({values:HF,defaultWidth:"wide"}),quarter:ac({values:YF,defaultWidth:"wide",argumentCallback:t=>t-1}),month:ac({values:jF,defaultWidth:"wide"}),day:ac({values:KF,defaultWidth:"wide"}),dayPeriod:ac({values:UF,defaultWidth:"wide",formattingValues:GF,defaultFormattingWidth:"wide"})};function lc(t){return(e,n={})=>{const i=n.width,s=i&&t.matchPatterns[i]||t.matchPatterns[t.defaultMatchWidth],r=e.match(s);if(!r)return null;const o=r[0],a=i&&t.parsePatterns[i]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?JF(a,d=>d.test(o)):ZF(a,d=>d.test(o));let c;c=t.valueCallback?t.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=e.slice(o.length);return{value:c,rest:u}}}function ZF(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function JF(t,e){for(let n=0;n{const i=e.match(t.matchPattern);if(!i)return null;const s=i[0],r=e.match(t.parsePattern);if(!r)return null;let o=t.valueCallback?t.valueCallback(r[0]):r[0];o=n.valueCallback?n.valueCallback(o):o;const a=e.slice(s.length);return{value:o,rest:a}}}const e5=/^(\d+)(th|st|nd|rd)?/i,t5=/\d+/i,n5={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},i5={any:[/^b/i,/^(a|c)/i]},s5={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},r5={any:[/1/i,/2/i,/3/i,/4/i]},o5={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},a5={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},l5={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},c5={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},u5={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},d5={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},h5={ordinalNumber:QF({matchPattern:e5,parsePattern:t5,valueCallback:t=>parseInt(t,10)}),era:lc({matchPatterns:n5,defaultMatchWidth:"wide",parsePatterns:i5,defaultParseWidth:"any"}),quarter:lc({matchPatterns:s5,defaultMatchWidth:"wide",parsePatterns:r5,defaultParseWidth:"any",valueCallback:t=>t+1}),month:lc({matchPatterns:o5,defaultMatchWidth:"wide",parsePatterns:a5,defaultParseWidth:"any"}),day:lc({matchPatterns:l5,defaultMatchWidth:"wide",parsePatterns:c5,defaultParseWidth:"any"}),dayPeriod:lc({matchPatterns:u5,defaultMatchWidth:"any",parsePatterns:d5,defaultParseWidth:"any"})},$S={code:"en-US",formatDistance:OF,formatLong:VF,formatRelative:WF,localize:qF,match:h5,options:{weekStartsOn:0,firstWeekContainsDate:1}};function f5(t){const e=Ve(t);return MS(e,ru(e))+1}function A_(t){const e=Ve(t),n=+xl(e)-+MF(e);return Math.round(n/TS)+1}function M_(t,e){const n=Ve(t),i=n.getFullYear(),s=_a(),r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,o=yt(t,0);o.setFullYear(i+1,0,r),o.setHours(0,0,0,0);const a=fs(o,e),l=yt(t,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=fs(l,e);return n.getTime()>=a.getTime()?i+1:n.getTime()>=c.getTime()?i:i-1}function g5(t,e){const n=_a(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=M_(t,e),r=yt(t,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),fs(r,e)}function I_(t,e){const n=Ve(t),i=+fs(n,e)-+g5(n,e);return Math.round(i/TS)+1}function Et(t,e){const n=t<0?"-":"",i=Math.abs(t).toString().padStart(e,"0");return n+i}const Tr={y(t,e){const n=t.getFullYear(),i=n>0?n:1-n;return Et(e==="yy"?i%100:i,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):Et(n+1,2)},d(t,e){return Et(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return Et(t.getHours()%12||12,e.length)},H(t,e){return Et(t.getHours(),e.length)},m(t,e){return Et(t.getMinutes(),e.length)},s(t,e){return Et(t.getSeconds(),e.length)},S(t,e){const n=e.length,i=t.getMilliseconds(),s=Math.trunc(i*Math.pow(10,n-3));return Et(s,e.length)}},Pa={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},mb={G:function(t,e,n){const i=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const i=t.getFullYear(),s=i>0?i:1-i;return n.ordinalNumber(s,{unit:"year"})}return Tr.y(t,e)},Y:function(t,e,n,i){const s=M_(t,i),r=s>0?s:1-s;if(e==="YY"){const o=r%100;return Et(o,2)}return e==="Yo"?n.ordinalNumber(r,{unit:"year"}):Et(r,e.length)},R:function(t,e){const n=AS(t);return Et(n,e.length)},u:function(t,e){const n=t.getFullYear();return Et(n,e.length)},Q:function(t,e,n){const i=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return Et(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,e,n){const i=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return Et(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,e,n){const i=t.getMonth();switch(e){case"M":case"MM":return Tr.M(t,e);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(t,e,n){const i=t.getMonth();switch(e){case"L":return String(i+1);case"LL":return Et(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(t,e,n,i){const s=I_(t,i);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):Et(s,e.length)},I:function(t,e,n){const i=A_(t);return e==="Io"?n.ordinalNumber(i,{unit:"week"}):Et(i,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Tr.d(t,e)},D:function(t,e,n){const i=f5(t);return e==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):Et(i,e.length)},E:function(t,e,n){const i=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(t,e,n,i){const s=t.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return Et(r,2);case"eo":return n.ordinalNumber(r,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,n,i){const s=t.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return Et(r,e.length);case"co":return n.ordinalNumber(r,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,n){const i=t.getDay(),s=i===0?7:i;switch(e){case"i":return String(s);case"ii":return Et(s,e.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(t,e,n){const s=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,e,n){const i=t.getHours();let s;switch(i===12?s=Pa.noon:i===0?s=Pa.midnight:s=i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,n){const i=t.getHours();let s;switch(i>=17?s=Pa.evening:i>=12?s=Pa.afternoon:i>=4?s=Pa.morning:s=Pa.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let i=t.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Tr.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Tr.H(t,e)},K:function(t,e,n){const i=t.getHours()%12;return e==="Ko"?n.ordinalNumber(i,{unit:"hour"}):Et(i,e.length)},k:function(t,e,n){let i=t.getHours();return i===0&&(i=24),e==="ko"?n.ordinalNumber(i,{unit:"hour"}):Et(i,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Tr.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Tr.s(t,e)},S:function(t,e){return Tr.S(t,e)},X:function(t,e,n){const i=t.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return yb(i);case"XXXX":case"XX":return Bo(i);case"XXXXX":case"XXX":default:return Bo(i,":")}},x:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"x":return yb(i);case"xxxx":case"xx":return Bo(i);case"xxxxx":case"xxx":default:return Bo(i,":")}},O:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+_b(i,":");case"OOOO":default:return"GMT"+Bo(i,":")}},z:function(t,e,n){const i=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+_b(i,":");case"zzzz":default:return"GMT"+Bo(i,":")}},t:function(t,e,n){const i=Math.trunc(t.getTime()/1e3);return Et(i,e.length)},T:function(t,e,n){const i=t.getTime();return Et(i,e.length)}};function _b(t,e=""){const n=t>0?"-":"+",i=Math.abs(t),s=Math.trunc(i/60),r=i%60;return r===0?n+String(s):n+String(s)+e+Et(r,2)}function yb(t,e){return t%60===0?(t>0?"-":"+")+Et(Math.abs(t)/60,2):Bo(t,e)}function Bo(t,e=""){const n=t>0?"-":"+",i=Math.abs(t),s=Et(Math.trunc(i/60),2),r=Et(i%60,2);return n+s+e+r}const vb=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},LS=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},p5=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],i=n[1],s=n[2];if(!s)return vb(t,e);let r;switch(i){case"P":r=e.dateTime({width:"short"});break;case"PP":r=e.dateTime({width:"medium"});break;case"PPP":r=e.dateTime({width:"long"});break;case"PPPP":default:r=e.dateTime({width:"full"});break}return r.replace("{{date}}",vb(i,e)).replace("{{time}}",LS(s,e))},Zp={p:LS,P:p5},m5=/^D+$/,_5=/^Y+$/,y5=["D","DD","YY","YYYY"];function OS(t){return m5.test(t)}function NS(t){return _5.test(t)}function Jp(t,e,n){const i=v5(t,e,n);if(console.warn(i),y5.includes(t))throw new RangeError(i)}function v5(t,e,n){const i=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const b5=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,w5=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,x5=/^'([^]*?)'?$/,E5=/''/g,S5=/[a-zA-Z]/;function Rs(t,e,n){const i=_a(),s=n?.locale??i.locale??$S,r=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,a=Ve(t);if(!zc(a))throw new RangeError("Invalid time value");let l=e.match(w5).map(u=>{const d=u[0];if(d==="p"||d==="P"){const h=Zp[d];return h(u,s.formatLong)}return u}).join("").match(b5).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const d=u[0];if(d==="'")return{isToken:!1,value:C5(u)};if(mb[d])return{isToken:!0,value:u};if(d.match(S5))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:u}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:r,weekStartsOn:o,locale:s};return l.map(u=>{if(!u.isToken)return u.value;const d=u.value;(!n?.useAdditionalWeekYearTokens&&NS(d)||!n?.useAdditionalDayOfYearTokens&&OS(d))&&Jp(d,e,String(t));const h=mb[d[0]];return h(a,d,s.localize,c)}).join("")}function C5(t){const e=t.match(x5);return e?e[1].replace(E5,"'"):t}function T5(t){return Ve(t).getDay()}function k5(t){const e=Ve(t),n=e.getFullYear(),i=e.getMonth(),s=yt(t,0);return s.setFullYear(n,i+1,0),s.setHours(0,0,0,0),s.getDate()}function A5(){return Object.assign({},_a())}function pr(t){return Ve(t).getHours()}function M5(t){let n=Ve(t).getDay();return n===0&&(n=7),n}function oo(t){return Ve(t).getMinutes()}function at(t){return Ve(t).getMonth()}function El(t){return Ve(t).getSeconds()}function Ge(t){return Ve(t).getFullYear()}function Sl(t,e){const n=Ve(t),i=Ve(e);return n.getTime()>i.getTime()}function ou(t,e){const n=Ve(t),i=Ve(e);return+n<+i}function Za(t,e){const n=Ve(t),i=Ve(e);return+n==+i}function I5(t,e){const n=e instanceof Date?yt(e,0):new e(0);return n.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),n.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),n}const P5=10;class FS{subPriority=0;validate(e,n){return!0}}class R5 extends FS{constructor(e,n,i,s,r){super(),this.value=e,this.validateValue=n,this.setValue=i,this.priority=s,r&&(this.subPriority=r)}validate(e,n){return this.validateValue(e,this.value,n)}set(e,n,i){return this.setValue(e,n,this.value,i)}}class D5 extends FS{priority=P5;subPriority=-1;set(e,n){return n.timestampIsSet?e:yt(e,I5(e,Date))}}class bt{run(e,n,i,s){const r=this.parse(e,n,i,s);return r?{setter:new R5(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(e,n,i){return!0}}class $5 extends bt{priority=140;parse(e,n,i){switch(n){case"G":case"GG":case"GGG":return i.era(e,{width:"abbreviated"})||i.era(e,{width:"narrow"});case"GGGGG":return i.era(e,{width:"narrow"});case"GGGG":default:return i.era(e,{width:"wide"})||i.era(e,{width:"abbreviated"})||i.era(e,{width:"narrow"})}}set(e,n,i){return n.era=i,e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]}const sn={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},xs={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function rn(t,e){return t&&{value:e(t.value),rest:t.rest}}function jt(t,e){const n=e.match(t);return n?{value:parseInt(n[0],10),rest:e.slice(n[0].length)}:null}function Es(t,e){const n=e.match(t);if(!n)return null;if(n[0]==="Z")return{value:0,rest:e.slice(1)};const i=n[1]==="+"?1:-1,s=n[2]?parseInt(n[2],10):0,r=n[3]?parseInt(n[3],10):0,o=n[5]?parseInt(n[5],10):0;return{value:i*(s*kS+r*CF+o*TF),rest:e.slice(n[0].length)}}function BS(t){return jt(sn.anyDigitsSigned,t)}function en(t,e){switch(t){case 1:return jt(sn.singleDigit,e);case 2:return jt(sn.twoDigits,e);case 3:return jt(sn.threeDigits,e);case 4:return jt(sn.fourDigits,e);default:return jt(new RegExp("^\\d{1,"+t+"}"),e)}}function vh(t,e){switch(t){case 1:return jt(sn.singleDigitSigned,e);case 2:return jt(sn.twoDigitsSigned,e);case 3:return jt(sn.threeDigitsSigned,e);case 4:return jt(sn.fourDigitsSigned,e);default:return jt(new RegExp("^-?\\d{1,"+t+"}"),e)}}function P_(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function VS(t,e){const n=e>0,i=n?e:1-e;let s;if(i<=50)s=t||100;else{const r=i+50,o=Math.trunc(r/100)*100,a=t>=r%100;s=t+o-(a?100:0)}return n?s:1-s}function zS(t){return t%400===0||t%4===0&&t%100!==0}class L5 extends bt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,n,i){const s=r=>({year:r,isTwoDigitYear:n==="yy"});switch(n){case"y":return rn(en(4,e),s);case"yo":return rn(i.ordinalNumber(e,{unit:"year"}),s);default:return rn(en(n.length,e),s)}}validate(e,n){return n.isTwoDigitYear||n.year>0}set(e,n,i){const s=e.getFullYear();if(i.isTwoDigitYear){const o=VS(i.year,s);return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}const r=!("era"in n)||n.era===1?i.year:1-i.year;return e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}}class O5 extends bt{priority=130;parse(e,n,i){const s=r=>({year:r,isTwoDigitYear:n==="YY"});switch(n){case"Y":return rn(en(4,e),s);case"Yo":return rn(i.ordinalNumber(e,{unit:"year"}),s);default:return rn(en(n.length,e),s)}}validate(e,n){return n.isTwoDigitYear||n.year>0}set(e,n,i,s){const r=M_(e,s);if(i.isTwoDigitYear){const a=VS(i.year,r);return e.setFullYear(a,0,s.firstWeekContainsDate),e.setHours(0,0,0,0),fs(e,s)}const o=!("era"in n)||n.era===1?i.year:1-i.year;return e.setFullYear(o,0,s.firstWeekContainsDate),e.setHours(0,0,0,0),fs(e,s)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class N5 extends bt{priority=130;parse(e,n){return vh(n==="R"?4:n.length,e)}set(e,n,i){const s=yt(e,0);return s.setFullYear(i,0,4),s.setHours(0,0,0,0),xl(s)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class F5 extends bt{priority=130;parse(e,n){return vh(n==="u"?4:n.length,e)}set(e,n,i){return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class B5 extends bt{priority=120;parse(e,n,i){switch(n){case"Q":case"QQ":return en(n.length,e);case"Qo":return i.ordinalNumber(e,{unit:"quarter"});case"QQQ":return i.quarter(e,{width:"abbreviated",context:"formatting"})||i.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(e,{width:"wide",context:"formatting"})||i.quarter(e,{width:"abbreviated",context:"formatting"})||i.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=1&&n<=4}set(e,n,i){return e.setMonth((i-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class V5 extends bt{priority=120;parse(e,n,i){switch(n){case"q":case"qq":return en(n.length,e);case"qo":return i.ordinalNumber(e,{unit:"quarter"});case"qqq":return i.quarter(e,{width:"abbreviated",context:"standalone"})||i.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(e,{width:"wide",context:"standalone"})||i.quarter(e,{width:"abbreviated",context:"standalone"})||i.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,n){return n>=1&&n<=4}set(e,n,i){return e.setMonth((i-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class z5 extends bt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,n,i){const s=r=>r-1;switch(n){case"M":return rn(jt(sn.month,e),s);case"MM":return rn(en(2,e),s);case"Mo":return rn(i.ordinalNumber(e,{unit:"month"}),s);case"MMM":return i.month(e,{width:"abbreviated",context:"formatting"})||i.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(e,{width:"wide",context:"formatting"})||i.month(e,{width:"abbreviated",context:"formatting"})||i.month(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=0&&n<=11}set(e,n,i){return e.setMonth(i,1),e.setHours(0,0,0,0),e}}class W5 extends bt{priority=110;parse(e,n,i){const s=r=>r-1;switch(n){case"L":return rn(jt(sn.month,e),s);case"LL":return rn(en(2,e),s);case"Lo":return rn(i.ordinalNumber(e,{unit:"month"}),s);case"LLL":return i.month(e,{width:"abbreviated",context:"standalone"})||i.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(e,{width:"wide",context:"standalone"})||i.month(e,{width:"abbreviated",context:"standalone"})||i.month(e,{width:"narrow",context:"standalone"})}}validate(e,n){return n>=0&&n<=11}set(e,n,i){return e.setMonth(i,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function H5(t,e,n){const i=Ve(t),s=I_(i,n)-e;return i.setDate(i.getDate()-s*7),i}class Y5 extends bt{priority=100;parse(e,n,i){switch(n){case"w":return jt(sn.week,e);case"wo":return i.ordinalNumber(e,{unit:"week"});default:return en(n.length,e)}}validate(e,n){return n>=1&&n<=53}set(e,n,i,s){return fs(H5(e,i,s),s)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function j5(t,e){const n=Ve(t),i=A_(n)-e;return n.setDate(n.getDate()-i*7),n}class K5 extends bt{priority=100;parse(e,n,i){switch(n){case"I":return jt(sn.week,e);case"Io":return i.ordinalNumber(e,{unit:"week"});default:return en(n.length,e)}}validate(e,n){return n>=1&&n<=53}set(e,n,i){return xl(j5(e,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const U5=[31,28,31,30,31,30,31,31,30,31,30,31],G5=[31,29,31,30,31,30,31,31,30,31,30,31];class X5 extends bt{priority=90;subPriority=1;parse(e,n,i){switch(n){case"d":return jt(sn.date,e);case"do":return i.ordinalNumber(e,{unit:"date"});default:return en(n.length,e)}}validate(e,n){const i=e.getFullYear(),s=zS(i),r=e.getMonth();return s?n>=1&&n<=G5[r]:n>=1&&n<=U5[r]}set(e,n,i){return e.setDate(i),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class q5 extends bt{priority=90;subpriority=1;parse(e,n,i){switch(n){case"D":case"DD":return jt(sn.dayOfYear,e);case"Do":return i.ordinalNumber(e,{unit:"date"});default:return en(n.length,e)}}validate(e,n){const i=e.getFullYear();return zS(i)?n>=1&&n<=366:n>=1&&n<=365}set(e,n,i){return e.setMonth(0,i),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function R_(t,e,n){const i=_a(),s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,r=Ve(t),o=r.getDay(),l=(e%7+7)%7,c=7-s,u=e<0||e>6?e-(o+c)%7:(l+c)%7-(o+c)%7;return ss(r,u)}class Z5 extends bt{priority=90;parse(e,n,i){switch(n){case"E":case"EE":case"EEE":return i.day(e,{width:"abbreviated",context:"formatting"})||i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return i.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return i.day(e,{width:"wide",context:"formatting"})||i.day(e,{width:"abbreviated",context:"formatting"})||i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=0&&n<=6}set(e,n,i,s){return e=R_(e,i,s),e.setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]}class J5 extends bt{priority=90;parse(e,n,i,s){const r=o=>{const a=Math.floor((o-1)/7)*7;return(o+s.weekStartsOn+6)%7+a};switch(n){case"e":case"ee":return rn(en(n.length,e),r);case"eo":return rn(i.ordinalNumber(e,{unit:"day"}),r);case"eee":return i.day(e,{width:"abbreviated",context:"formatting"})||i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"});case"eeeee":return i.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return i.day(e,{width:"wide",context:"formatting"})||i.day(e,{width:"abbreviated",context:"formatting"})||i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"})}}validate(e,n){return n>=0&&n<=6}set(e,n,i,s){return e=R_(e,i,s),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class Q5 extends bt{priority=90;parse(e,n,i,s){const r=o=>{const a=Math.floor((o-1)/7)*7;return(o+s.weekStartsOn+6)%7+a};switch(n){case"c":case"cc":return rn(en(n.length,e),r);case"co":return rn(i.ordinalNumber(e,{unit:"day"}),r);case"ccc":return i.day(e,{width:"abbreviated",context:"standalone"})||i.day(e,{width:"short",context:"standalone"})||i.day(e,{width:"narrow",context:"standalone"});case"ccccc":return i.day(e,{width:"narrow",context:"standalone"});case"cccccc":return i.day(e,{width:"short",context:"standalone"})||i.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return i.day(e,{width:"wide",context:"standalone"})||i.day(e,{width:"abbreviated",context:"standalone"})||i.day(e,{width:"short",context:"standalone"})||i.day(e,{width:"narrow",context:"standalone"})}}validate(e,n){return n>=0&&n<=6}set(e,n,i,s){return e=R_(e,i,s),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function eB(t,e){const n=Ve(t),i=M5(n),s=e-i;return ss(n,s)}class tB extends bt{priority=90;parse(e,n,i){const s=r=>r===0?7:r;switch(n){case"i":case"ii":return en(n.length,e);case"io":return i.ordinalNumber(e,{unit:"day"});case"iii":return rn(i.day(e,{width:"abbreviated",context:"formatting"})||i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"}),s);case"iiiii":return rn(i.day(e,{width:"narrow",context:"formatting"}),s);case"iiiiii":return rn(i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"}),s);case"iiii":default:return rn(i.day(e,{width:"wide",context:"formatting"})||i.day(e,{width:"abbreviated",context:"formatting"})||i.day(e,{width:"short",context:"formatting"})||i.day(e,{width:"narrow",context:"formatting"}),s)}}validate(e,n){return n>=1&&n<=7}set(e,n,i){return e=eB(e,i),e.setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class nB extends bt{priority=80;parse(e,n,i){switch(n){case"a":case"aa":case"aaa":return i.dayPeriod(e,{width:"abbreviated",context:"formatting"})||i.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return i.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(e,{width:"wide",context:"formatting"})||i.dayPeriod(e,{width:"abbreviated",context:"formatting"})||i.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,n,i){return e.setHours(P_(i),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]}class iB extends bt{priority=80;parse(e,n,i){switch(n){case"b":case"bb":case"bbb":return i.dayPeriod(e,{width:"abbreviated",context:"formatting"})||i.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return i.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(e,{width:"wide",context:"formatting"})||i.dayPeriod(e,{width:"abbreviated",context:"formatting"})||i.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,n,i){return e.setHours(P_(i),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]}class sB extends bt{priority=80;parse(e,n,i){switch(n){case"B":case"BB":case"BBB":return i.dayPeriod(e,{width:"abbreviated",context:"formatting"})||i.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return i.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(e,{width:"wide",context:"formatting"})||i.dayPeriod(e,{width:"abbreviated",context:"formatting"})||i.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,n,i){return e.setHours(P_(i),0,0,0),e}incompatibleTokens=["a","b","t","T"]}class rB extends bt{priority=70;parse(e,n,i){switch(n){case"h":return jt(sn.hour12h,e);case"ho":return i.ordinalNumber(e,{unit:"hour"});default:return en(n.length,e)}}validate(e,n){return n>=1&&n<=12}set(e,n,i){const s=e.getHours()>=12;return s&&i<12?e.setHours(i+12,0,0,0):!s&&i===12?e.setHours(0,0,0,0):e.setHours(i,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]}class oB extends bt{priority=70;parse(e,n,i){switch(n){case"H":return jt(sn.hour23h,e);case"Ho":return i.ordinalNumber(e,{unit:"hour"});default:return en(n.length,e)}}validate(e,n){return n>=0&&n<=23}set(e,n,i){return e.setHours(i,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]}class aB extends bt{priority=70;parse(e,n,i){switch(n){case"K":return jt(sn.hour11h,e);case"Ko":return i.ordinalNumber(e,{unit:"hour"});default:return en(n.length,e)}}validate(e,n){return n>=0&&n<=11}set(e,n,i){return e.getHours()>=12&&i<12?e.setHours(i+12,0,0,0):e.setHours(i,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]}class lB extends bt{priority=70;parse(e,n,i){switch(n){case"k":return jt(sn.hour24h,e);case"ko":return i.ordinalNumber(e,{unit:"hour"});default:return en(n.length,e)}}validate(e,n){return n>=1&&n<=24}set(e,n,i){const s=i<=24?i%24:i;return e.setHours(s,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]}class cB extends bt{priority=60;parse(e,n,i){switch(n){case"m":return jt(sn.minute,e);case"mo":return i.ordinalNumber(e,{unit:"minute"});default:return en(n.length,e)}}validate(e,n){return n>=0&&n<=59}set(e,n,i){return e.setMinutes(i,0,0),e}incompatibleTokens=["t","T"]}class uB extends bt{priority=50;parse(e,n,i){switch(n){case"s":return jt(sn.second,e);case"so":return i.ordinalNumber(e,{unit:"second"});default:return en(n.length,e)}}validate(e,n){return n>=0&&n<=59}set(e,n,i){return e.setSeconds(i,0),e}incompatibleTokens=["t","T"]}class dB extends bt{priority=30;parse(e,n){const i=s=>Math.trunc(s*Math.pow(10,-n.length+3));return rn(en(n.length,e),i)}set(e,n,i){return e.setMilliseconds(i),e}incompatibleTokens=["t","T"]}class hB extends bt{priority=10;parse(e,n){switch(n){case"X":return Es(xs.basicOptionalMinutes,e);case"XX":return Es(xs.basic,e);case"XXXX":return Es(xs.basicOptionalSeconds,e);case"XXXXX":return Es(xs.extendedOptionalSeconds,e);case"XXX":default:return Es(xs.extended,e)}}set(e,n,i){return n.timestampIsSet?e:yt(e,e.getTime()-yh(e)-i)}incompatibleTokens=["t","T","x"]}class fB extends bt{priority=10;parse(e,n){switch(n){case"x":return Es(xs.basicOptionalMinutes,e);case"xx":return Es(xs.basic,e);case"xxxx":return Es(xs.basicOptionalSeconds,e);case"xxxxx":return Es(xs.extendedOptionalSeconds,e);case"xxx":default:return Es(xs.extended,e)}}set(e,n,i){return n.timestampIsSet?e:yt(e,e.getTime()-yh(e)-i)}incompatibleTokens=["t","T","X"]}class gB extends bt{priority=40;parse(e){return BS(e)}set(e,n,i){return[yt(e,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class pB extends bt{priority=20;parse(e){return BS(e)}set(e,n,i){return[yt(e,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const mB={G:new $5,y:new L5,Y:new O5,R:new N5,u:new F5,Q:new B5,q:new V5,M:new z5,L:new W5,w:new Y5,I:new K5,d:new X5,D:new q5,E:new Z5,e:new J5,c:new Q5,i:new tB,a:new nB,b:new iB,B:new sB,h:new rB,H:new oB,K:new aB,k:new lB,m:new cB,s:new uB,S:new dB,X:new hB,x:new fB,t:new gB,T:new pB},_B=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,yB=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,vB=/^'([^]*?)'?$/,bB=/''/g,wB=/\S/,xB=/[a-zA-Z]/;function Qp(t,e,n,i){const s=A5(),r=i?.locale??s.locale??$S,o=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,a=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0;if(e==="")return t===""?Ve(n):yt(n,NaN);const l={firstWeekContainsDate:o,weekStartsOn:a,locale:r},c=[new D5],u=e.match(yB).map(m=>{const y=m[0];if(y in Zp){const v=Zp[y];return v(m,r.formatLong)}return m}).join("").match(_B),d=[];for(let m of u){!i?.useAdditionalWeekYearTokens&&NS(m)&&Jp(m,e,t),!i?.useAdditionalDayOfYearTokens&&OS(m)&&Jp(m,e,t);const y=m[0],v=mB[y];if(v){const{incompatibleTokens:b}=v;if(Array.isArray(b)){const C=d.find(w=>b.includes(w.token)||w.token===y);if(C)throw new RangeError(`The format string mustn't contain \`${C.fullToken}\` and \`${m}\` at the same time`)}else if(v.incompatibleTokens==="*"&&d.length>0)throw new RangeError(`The format string mustn't contain \`${m}\` and any other token at the same time`);d.push({token:y,fullToken:m});const E=v.run(t,m,r.match,l);if(!E)return yt(n,NaN);c.push(E.setter),t=E.rest}else{if(y.match(xB))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");if(m==="''"?m="'":y==="'"&&(m=EB(m)),t.indexOf(m)===0)t=t.slice(m.length);else return yt(n,NaN)}}if(t.length>0&&wB.test(t))return yt(n,NaN);const h=c.map(m=>m.priority).sort((m,y)=>y-m).filter((m,y,v)=>v.indexOf(m)===y).map(m=>c.filter(y=>y.priority===m).sort((y,v)=>v.subPriority-y.subPriority)).map(m=>m[0]);let f=Ve(n);if(isNaN(f.getTime()))return yt(n,NaN);const p={};for(const m of h){if(!m.validate(f,l))return yt(n,NaN);const y=m.set(f,p,l);Array.isArray(y)?(f=y[0],Object.assign(p,y[1])):f=y}return yt(n,f)}function EB(t){return t.match(vB)[1].replace(bB,"'")}function bb(t,e){const n=Ko(t),i=Ko(e);return+n==+i}function SB(t,e){return ss(t,-e)}function WS(t,e){const n=Ve(t),i=n.getFullYear(),s=n.getDate(),r=yt(t,0);r.setFullYear(i,e,15),r.setHours(0,0,0,0);const o=k5(r);return n.setMonth(e,Math.min(s,o)),n}function It(t,e){let n=Ve(t);return isNaN(+n)?yt(t,NaN):(e.year!=null&&n.setFullYear(e.year),e.month!=null&&(n=WS(n,e.month)),e.date!=null&&n.setDate(e.date),e.hours!=null&&n.setHours(e.hours),e.minutes!=null&&n.setMinutes(e.minutes),e.seconds!=null&&n.setSeconds(e.seconds),e.milliseconds!=null&&n.setMilliseconds(e.milliseconds),n)}function CB(t,e){const n=Ve(t);return n.setHours(e),n}function HS(t,e){const n=Ve(t);return n.setMilliseconds(e),n}function TB(t,e){const n=Ve(t);return n.setMinutes(e),n}function YS(t,e){const n=Ve(t);return n.setSeconds(e),n}function Ts(t,e){const n=Ve(t);return isNaN(+n)?yt(t,NaN):(n.setFullYear(e),n)}function Cl(t,e){return us(t,-e)}function kB(t,e){const{years:n=0,months:i=0,weeks:s=0,days:r=0,hours:o=0,minutes:a=0,seconds:l=0}=e,c=Cl(t,i+n*12),u=SB(c,r+s*7),d=a+o*60,f=(l+d*60)*1e3;return yt(t,u.getTime()-f)}function jS(t,e){return k_(t,-e)}function Ul(){const t=TR();return D(),V("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img",...t},[g("path",{d:"M29.333 8c0-2.208-1.792-4-4-4h-18.667c-2.208 0-4 1.792-4 4v18.667c0 2.208 1.792 4 4 4h18.667c2.208 0 4-1.792 4-4v-18.667zM26.667 8v18.667c0 0.736-0.597 1.333-1.333 1.333 0 0-18.667 0-18.667 0-0.736 0-1.333-0.597-1.333-1.333 0 0 0-18.667 0-18.667 0-0.736 0.597-1.333 1.333-1.333 0 0 18.667 0 18.667 0 0.736 0 1.333 0.597 1.333 1.333z"}),g("path",{d:"M20 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),g("path",{d:"M9.333 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),g("path",{d:"M4 14.667h24c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-24c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"})])}Ul.compatConfig={MODE:3};function KS(){return D(),V("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[g("path",{d:"M23.057 7.057l-16 16c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l16-16c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0z"}),g("path",{d:"M7.057 8.943l16 16c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885l-16-16c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}KS.compatConfig={MODE:3};function D_(){return D(),V("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[g("path",{d:"M20.943 23.057l-7.057-7.057c0 0 7.057-7.057 7.057-7.057 0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-8 8c-0.521 0.521-0.521 1.365 0 1.885l8 8c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}D_.compatConfig={MODE:3};function $_(){return D(),V("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[g("path",{d:"M12.943 24.943l8-8c0.521-0.521 0.521-1.365 0-1.885l-8-8c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885l7.057 7.057c0 0-7.057 7.057-7.057 7.057-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0z"})])}$_.compatConfig={MODE:3};function L_(){return D(),V("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[g("path",{d:"M16 1.333c-8.095 0-14.667 6.572-14.667 14.667s6.572 14.667 14.667 14.667c8.095 0 14.667-6.572 14.667-14.667s-6.572-14.667-14.667-14.667zM16 4c6.623 0 12 5.377 12 12s-5.377 12-12 12c-6.623 0-12-5.377-12-12s5.377-12 12-12z"}),g("path",{d:"M14.667 8v8c0 0.505 0.285 0.967 0.737 1.193l5.333 2.667c0.658 0.329 1.46 0.062 1.789-0.596s0.062-1.46-0.596-1.789l-4.596-2.298c0 0 0-7.176 0-7.176 0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"})])}L_.compatConfig={MODE:3};function O_(){return D(),V("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[g("path",{d:"M24.943 19.057l-8-8c-0.521-0.521-1.365-0.521-1.885 0l-8 8c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l7.057-7.057c0 0 7.057 7.057 7.057 7.057 0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}O_.compatConfig={MODE:3};function N_(){return D(),V("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[g("path",{d:"M7.057 12.943l8 8c0.521 0.521 1.365 0.521 1.885 0l8-8c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-7.057 7.057c0 0-7.057-7.057-7.057-7.057-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}N_.compatConfig={MODE:3};const _i=(t,e)=>e?new Date(t.toLocaleString("en-US",{timeZone:e})):new Date(t),F_=(t,e,n)=>em(t,e,n)||Ee(),AB=(t,e,n)=>{const i=e.dateInTz?_i(new Date(t),e.dateInTz):Ee(t);return n?ni(i,!0):i},em=(t,e,n)=>{if(!t)return null;const i=n?ni(Ee(t),!0):Ee(t);return e?e.exactMatch?AB(t,e,n):_i(i,e.timezone):i},MB=t=>{if(!t)return 0;const e=new Date,n=new Date(e.toLocaleString("en-US",{timeZone:"UTC"})),i=new Date(e.toLocaleString("en-US",{timeZone:t})),s=i.getTimezoneOffset()/60;return(+n-+i)/(1e3*60*60)-s};var es=(t=>(t.month="month",t.year="year",t))(es||{}),Vo=(t=>(t.top="top",t.bottom="bottom",t))(Vo||{}),ta=(t=>(t.header="header",t.calendar="calendar",t.timePicker="timePicker",t))(ta||{}),zn=(t=>(t.month="month",t.year="year",t.calendar="calendar",t.time="time",t.minutes="minutes",t.hours="hours",t.seconds="seconds",t))(zn||{});const IB=["timestamp","date","iso"];var Xn=(t=>(t.up="up",t.down="down",t.left="left",t.right="right",t))(Xn||{}),Lt=(t=>(t.arrowUp="ArrowUp",t.arrowDown="ArrowDown",t.arrowLeft="ArrowLeft",t.arrowRight="ArrowRight",t.enter="Enter",t.space=" ",t.esc="Escape",t.tab="Tab",t.home="Home",t.end="End",t.pageUp="PageUp",t.pageDown="PageDown",t))(Lt||{});function wb(t){return e=>new Intl.DateTimeFormat(t,{weekday:"short",timeZone:"UTC"}).format(new Date(`2017-01-0${e}T00:00:00+00:00`)).slice(0,2)}function PB(t){return e=>Rs(_i(new Date(`2017-01-0${e}T00:00:00+00:00`),"UTC"),"EEEEEE",{locale:t})}const RB=(t,e,n)=>{const i=[1,2,3,4,5,6,7];let s;if(t!==null)try{s=i.map(PB(t))}catch{s=i.map(wb(e))}else s=i.map(wb(e));const r=s.slice(0,n),o=s.slice(n+1,s.length);return[s[n]].concat(...o).concat(...r)},B_=(t,e,n)=>{const i=[];for(let s=+t[0];s<=+t[1];s++)i.push({value:+s,text:qS(s,e)});return n?i.reverse():i},US=(t,e,n)=>{const i=[1,2,3,4,5,6,7,8,9,10,11,12].map(r=>{const o=r<10?`0${r}`:r;return new Date(`2017-${o}-01T00:00:00+00:00`)});if(t!==null)try{const r=n==="long"?"LLLL":"LLL";return i.map((o,a)=>{const l=Rs(_i(o,"UTC"),r,{locale:t});return{text:l.charAt(0).toUpperCase()+l.substring(1),value:a}})}catch{}const s=new Intl.DateTimeFormat(e,{month:n,timeZone:"UTC"});return i.map((r,o)=>{const a=s.format(r);return{text:a.charAt(0).toUpperCase()+a.substring(1),value:o}})},DB=t=>[12,1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11][t],mn=t=>{const e=Q(t);return e!=null&&e.$el?e?.$el:e},$B=t=>({type:"dot",...t??{}}),GS=t=>Array.isArray(t)?!!t[0]&&!!t[1]:!1,V_={prop:t=>`"${t}" prop must be enabled!`,dateArr:t=>`You need to use array as "model-value" binding in order to support "${t}"`},Tn=t=>t,xb=t=>t===0?t:!t||isNaN(+t)?null:+t,Eb=t=>t===null,XS=t=>{if(t)return[...t.querySelectorAll("input, button, select, textarea, a[href]")][0]},LB=t=>{const e=[],n=i=>i.filter(s=>s);for(let i=0;i{const i=n!=null,s=e!=null;if(!i&&!s)return!1;const r=+n,o=+e;return i&&s?+t>r||+tr:s?+tLB(t).map(n=>n.map(i=>{const{active:s,disabled:r,isBetween:o,highlighted:a}=e(i);return{...i,active:s,disabled:r,className:{dp__overlay_cell_active:s,dp__overlay_cell:!s,dp__overlay_cell_disabled:r,dp__overlay_cell_pad:!0,dp__overlay_cell_active_disabled:r&&s,dp__cell_in_between:o,"dp--highlighted":a}}})),Qr=(t,e,n=!1)=>{t&&e.allowStopPropagation&&(n&&t.stopImmediatePropagation(),t.stopPropagation())},OB=()=>["a[href]","area[href]","input:not([disabled]):not([type='hidden'])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","[tabindex]:not([tabindex='-1'])","[data-datepicker-instance]"].join(", ");function NB(t,e){let n=[...document.querySelectorAll(OB())];n=n.filter(s=>!t.contains(s)||s.hasAttribute("data-datepicker-instance"));const i=n.indexOf(t);if(i>=0&&(e?i-1>=0:i+1<=n.length))return n[i+(e?-1:1)]}const tm=(t,e)=>t?.querySelector(`[data-dp-element="${e}"]`),qS=(t,e)=>new Intl.NumberFormat(e,{useGrouping:!1,style:"decimal"}).format(t),z_=t=>Rs(t,"dd-MM-yyyy"),Rg=t=>Array.isArray(t),bh=(t,e)=>e.get(z_(t)),FB=(t,e)=>t?e?e instanceof Map?!!bh(t,e):e(Ee(t)):!1:!0,Qn=(t,e,n=!1,i)=>{if(t.key===Lt.enter||t.key===Lt.space)return n&&t.preventDefault(),e();if(i)return i(t)},BB=()=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].some(t=>navigator.userAgent.includes(t))||navigator.userAgent.includes("Mac")&&"ontouchend"in document,Sb=(t,e,n,i,s,r)=>{const o=Qp(t,e.slice(0,t.length),new Date,{locale:r});return zc(o)&&IS(o)?i||s?o:It(o,{hours:+n.hours,minutes:+n?.minutes,seconds:+n?.seconds,milliseconds:0}):null},VB=(t,e,n,i,s,r)=>{const o=Array.isArray(n)?n[0]:n;if(typeof e=="string")return Sb(t,e,o,i,s,r);if(Array.isArray(e)){let a=null;for(const l of e)if(a=Sb(t,l,o,i,s,r),a)break;return a}return typeof e=="function"?e(t):null},Ee=t=>t?new Date(t):new Date,zB=(t,e,n)=>{if(e){const s=(t.getMonth()+1).toString().padStart(2,"0"),r=t.getDate().toString().padStart(2,"0"),o=t.getHours().toString().padStart(2,"0"),a=t.getMinutes().toString().padStart(2,"0"),l=n?t.getSeconds().toString().padStart(2,"0"):"00";return`${t.getFullYear()}-${s}-${r}T${o}:${a}:${l}.000Z`}const i=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds());return new Date(i).toISOString()},ni=(t,e)=>{const n=Ee(JSON.parse(JSON.stringify(t))),i=It(n,{hours:0,minutes:0,seconds:0,milliseconds:0});return e?$F(i):i},eo=(t,e,n,i)=>{let s=t?Ee(t):Ee();return(e||e===0)&&(s=CB(s,+e)),(n||n===0)&&(s=TB(s,+n)),(i||i===0)&&(s=YS(s,+i)),HS(s,0)},Xt=(t,e)=>!t||!e?!1:ou(ni(t),ni(e)),ct=(t,e)=>!t||!e?!1:Za(ni(t),ni(e)),nn=(t,e)=>!t||!e?!1:Sl(ni(t),ni(e)),mf=(t,e,n)=>t!=null&&t[0]&&t!=null&&t[1]?nn(n,t[0])&&Xt(n,t[1]):t!=null&&t[0]&&e?nn(n,t[0])&&Xt(n,e)||Xt(n,t[0])&&nn(n,e):!1,rs=t=>{const e=It(new Date(t),{date:1});return ni(e)},Dg=(t,e,n)=>e&&(n||n===0)?Object.fromEntries(["hours","minutes","seconds"].map(i=>i===e?[i,n]:[i,isNaN(+t[i])?void 0:+t[i]])):{hours:isNaN(+t.hours)?void 0:+t.hours,minutes:isNaN(+t.minutes)?void 0:+t.minutes,seconds:isNaN(+t.seconds)?void 0:+t.seconds},na=t=>({hours:pr(t),minutes:oo(t),seconds:El(t)}),ZS=(t,e)=>{if(e){const n=Ge(Ee(e));if(n>t)return 12;if(n===t)return at(Ee(e))}},JS=(t,e)=>{if(e){const n=Ge(Ee(e));return n{if(t)return Ge(Ee(t))},QS=(t,e)=>{const n=nn(t,e)?e:t,i=nn(e,t)?e:t;return PS({start:n,end:i})},WB=t=>{const e=us(t,1);return{month:at(e),year:Ge(e)}},er=(t,e)=>{const n=fs(t,{weekStartsOn:+e}),i=DS(t,{weekStartsOn:+e});return[n,i]},eC=(t,e)=>{const n={hours:pr(Ee()),minutes:oo(Ee()),seconds:e?El(Ee()):0};return Object.assign(n,t)},Yr=(t,e,n)=>[It(Ee(t),{date:1}),It(Ee(),{month:e,year:n,date:1})],sr=(t,e,n)=>{let i=t?Ee(t):Ee();return(e||e===0)&&(i=WS(i,e)),n&&(i=Ts(i,n)),i},tC=(t,e,n,i,s)=>{if(!i||s&&!e||!s&&!n)return!1;const r=s?us(t,1):Cl(t,1),o=[at(r),Ge(r)];return s?!YB(...o,e):!HB(...o,n)},HB=(t,e,n)=>Xt(...Yr(n,t,e))||ct(...Yr(n,t,e)),YB=(t,e,n)=>nn(...Yr(n,t,e))||ct(...Yr(n,t,e)),nC=(t,e,n,i,s,r,o)=>{if(typeof e=="function"&&!o)return e(t);const a=n?{locale:n}:void 0;return Array.isArray(t)?`${Rs(t[0],r,a)}${s&&!t[1]?"":i}${t[1]?Rs(t[1],r,a):""}`:Rs(t,r,a)},Ra=t=>{if(t)return null;throw new Error(V_.prop("partial-range"))},wd=(t,e)=>{if(e)return t();throw new Error(V_.prop("range"))},nm=t=>Array.isArray(t)?zc(t[0])&&(t[1]?zc(t[1]):!0):t?zc(t):!1,jB=(t,e)=>It(e??Ee(),{hours:+t.hours||0,minutes:+t.minutes||0,seconds:+t.seconds||0}),$g=(t,e,n,i)=>{if(!t)return!0;if(i){const s=n==="max"?ou(t,e):Sl(t,e),r={seconds:0,milliseconds:0};return s||Za(It(t,r),It(e,r))}return n==="max"?t.getTime()<=e.getTime():t.getTime()>=e.getTime()},Lg=(t,e,n)=>t?jB(t,e):Ee(n??e),Cb=(t,e,n,i,s)=>{if(Array.isArray(i)){const o=Lg(t,i[0],e),a=Lg(t,i[1],e);return $g(i[0],o,n,!!e)&&$g(i[1],a,n,!!e)&&s}const r=Lg(t,i,e);return $g(i,r,n,!!e)&&s},Og=t=>It(Ee(),na(t)),KB=(t,e)=>t instanceof Map?Array.from(t.values()).filter(n=>Ge(Ee(n))===e).map(n=>at(n)):[],iC=(t,e,n)=>typeof t=="function"?t({month:e,year:n}):!!t.months.find(i=>i.month===e&&i.year===n),W_=(t,e)=>typeof t=="function"?t(e):t.years.includes(e),sC=t=>Rs(t,"yyyy-MM-dd"),cc=Ns({menuFocused:!1,shiftKeyInMenu:!1}),rC=()=>{const t=n=>{cc.menuFocused=n},e=n=>{cc.shiftKeyInMenu!==n&&(cc.shiftKeyInMenu=n)};return{control:be(()=>({shiftKeyInMenu:cc.shiftKeyInMenu,menuFocused:cc.menuFocused})),setMenuFocused:t,setShiftKey:e}},$t=Ns({monthYear:[],calendar:[],time:[],actionRow:[],selectionGrid:[],timePicker:{0:[],1:[]},monthPicker:[]}),Ng=we(null),xd=we(!1),Fg=we(!1),Bg=we(!1),Vg=we(!1),Nn=we(0),tn=we(0),mo=()=>{const t=be(()=>xd.value?[...$t.selectionGrid,$t.actionRow].filter(d=>d.length):Fg.value?[...$t.timePicker[0],...$t.timePicker[1],Vg.value?[]:[Ng.value],$t.actionRow].filter(d=>d.length):Bg.value?[...$t.monthPicker,$t.actionRow]:[$t.monthYear,...$t.calendar,$t.time,$t.actionRow].filter(d=>d.length)),e=d=>{Nn.value=d?Nn.value+1:Nn.value-1;let h=null;t.value[tn.value]&&(h=t.value[tn.value][Nn.value]),!h&&t.value[tn.value+(d?1:-1)]?(tn.value=tn.value+(d?1:-1),Nn.value=d?0:t.value[tn.value].length-1):h||(Nn.value=d?Nn.value-1:Nn.value+1)},n=d=>{tn.value===0&&!d||tn.value===t.value.length&&d||(tn.value=d?tn.value+1:tn.value-1,t.value[tn.value]?t.value[tn.value]&&!t.value[tn.value][Nn.value]&&Nn.value!==0&&(Nn.value=t.value[tn.value].length-1):tn.value=d?tn.value-1:tn.value+1)},i=d=>{let h=null;t.value[tn.value]&&(h=t.value[tn.value][Nn.value]),h?h.focus({preventScroll:!xd.value}):Nn.value=d?Nn.value-1:Nn.value+1},s=()=>{e(!0),i(!0)},r=()=>{e(!1),i(!1)},o=()=>{n(!1),i(!0)},a=()=>{n(!0),i(!0)},l=(d,h)=>{$t[h]=d},c=(d,h)=>{$t[h]=d},u=()=>{Nn.value=0,tn.value=0};return{buildMatrix:l,buildMultiLevelMatrix:c,setTimePickerBackRef:d=>{Ng.value=d},setSelectionGrid:d=>{xd.value=d,u(),d||($t.selectionGrid=[])},setTimePicker:(d,h=!1)=>{Fg.value=d,Vg.value=h,u(),d||($t.timePicker[0]=[],$t.timePicker[1]=[])},setTimePickerElements:(d,h=0)=>{$t.timePicker[h]=d},arrowRight:s,arrowLeft:r,arrowUp:o,arrowDown:a,clearArrowNav:()=>{$t.monthYear=[],$t.calendar=[],$t.time=[],$t.actionRow=[],$t.selectionGrid=[],$t.timePicker[0]=[],$t.timePicker[1]=[],xd.value=!1,Fg.value=!1,Vg.value=!1,Bg.value=!1,u(),Ng.value=null},setMonthPicker:d=>{Bg.value=d,u()},refSets:$t}},Tb=t=>({menuAppearTop:"dp-menu-appear-top",menuAppearBottom:"dp-menu-appear-bottom",open:"dp-slide-down",close:"dp-slide-up",next:"calendar-next",previous:"calendar-prev",vNext:"dp-slide-up",vPrevious:"dp-slide-down",...t??{}}),UB=t=>({toggleOverlay:"Toggle overlay",menu:"Datepicker menu",input:"Datepicker input",openTimePicker:"Open time picker",closeTimePicker:"Close time Picker",incrementValue:e=>`Increment ${e}`,decrementValue:e=>`Decrement ${e}`,openTpOverlay:e=>`Open ${e} overlay`,amPmButton:"Switch AM/PM mode",openYearsOverlay:"Open years overlay",openMonthsOverlay:"Open months overlay",nextMonth:"Next month",prevMonth:"Previous month",nextYear:"Next year",prevYear:"Previous year",day:void 0,weekDay:void 0,clearInput:"Clear value",calendarIcon:"Calendar icon",timePicker:"Time picker",monthPicker:e=>`Month picker${e?" overlay":""}`,yearPicker:e=>`Year picker${e?" overlay":""}`,timeOverlay:e=>`${e} overlay`,...t??{}}),kb=t=>t?typeof t=="boolean"?t?2:0:+t>=2?+t:2:0,GB=t=>{const e=typeof t=="object"&&t,n={static:!0,solo:!1};if(!t)return{...n,count:kb(!1)};const i=e?t:{},s=e?i.count??!0:t,r=kb(s);return Object.assign(n,i,{count:r})},XB=(t,e,n)=>t||(typeof n=="string"?n:e),qB=t=>typeof t=="boolean"?t?Tb({}):!1:Tb(t),ZB=t=>{const e={enterSubmit:!0,tabSubmit:!0,openMenu:"open",selectOnFocus:!1,rangeSeparator:" - "};return typeof t=="object"?{...e,...t??{},enabled:!0}:{...e,enabled:t}},JB=t=>({months:[],years:[],times:{hours:[],minutes:[],seconds:[]},...t??{}}),QB=t=>({showSelect:!0,showCancel:!0,showNow:!1,showPreview:!0,...t??{}}),e4=t=>{const e={input:!1};return typeof t=="object"?{...e,...t??{},enabled:!0}:{enabled:t,...e}},t4=t=>({allowStopPropagation:!0,closeOnScroll:!1,modeHeight:255,allowPreventDefault:!1,closeOnClearValue:!0,closeOnAutoApply:!0,noSwipe:!1,keepActionRow:!1,onClickOutside:void 0,tabOutClosesMenu:!0,arrowLeft:void 0,keepViewOnOffsetClick:!1,timeArrowHoldThreshold:0,shadowDom:!1,...t??{}}),n4=t=>{const e={dates:Array.isArray(t)?t.map(n=>Ee(n)):[],years:[],months:[],quarters:[],weeks:[],weekdays:[],options:{highlightDisabled:!1}};return typeof t=="function"?t:{...e,...t??{}}},i4=t=>typeof t=="object"?{type:t?.type??"local",hideOnOffsetDates:t?.hideOnOffsetDates??!1}:{type:t,hideOnOffsetDates:!1},s4=t=>{const e={noDisabledRange:!1,showLastInRange:!0,minMaxRawRange:!1,partialRange:!0,disableTimeRangeValidation:!1,maxRange:void 0,minRange:void 0,autoRange:void 0,fixedStart:!1,fixedEnd:!1};return typeof t=="object"?{enabled:!0,...e,...t}:{enabled:t,...e}},r4=t=>t?typeof t=="string"?{timezone:t,exactMatch:!1,dateInTz:void 0,emitTimezone:void 0,convertModel:!0}:{timezone:t.timezone,exactMatch:t.exactMatch??!1,dateInTz:t.dateInTz??void 0,emitTimezone:t.emitTimezone??void 0,convertModel:t.convertModel??!0}:{timezone:void 0,exactMatch:!1,emitTimezone:void 0},zg=(t,e,n)=>new Map(t.map(i=>{const s=F_(i,e,n);return[z_(s),s]})),o4=(t,e)=>t.length?new Map(t.map(n=>{const i=F_(n.date,e);return[z_(i),n]})):null,a4=t=>{var e;return{minDate:em(t.minDate,t.timezone,t.isSpecific),maxDate:em(t.maxDate,t.timezone,t.isSpecific),disabledDates:Rg(t.disabledDates)?zg(t.disabledDates,t.timezone,t.isSpecific):t.disabledDates,allowedDates:Rg(t.allowedDates)?zg(t.allowedDates,t.timezone,t.isSpecific):null,highlight:typeof t.highlight=="object"&&Rg((e=t.highlight)==null?void 0:e.dates)?zg(t.highlight.dates,t.timezone):t.highlight,markers:o4(t.markers,t.timezone)}},l4=t=>typeof t=="boolean"?{enabled:t,dragSelect:!0,limit:null}:{enabled:!!t,limit:t.limit?+t.limit:null,dragSelect:t.dragSelect??!0},c4=t=>({...Object.fromEntries(Object.keys(t).map(e=>{const n=e,i=t[n],s=typeof t[n]=="string"?{[i]:!0}:Object.fromEntries(i.map(r=>[r,!0]));return[e,s]}))}),Wt=t=>{const e=()=>{const x=t.enableSeconds?":ss":"",T=t.enableMinutes?":mm":"";return t.is24?`HH${T}${x}`:`hh${T}${x} aa`},n=()=>{var x;return t.format?t.format:t.monthPicker?"MM/yyyy":t.timePicker?e():t.weekPicker?`${((x=y.value)==null?void 0:x.type)==="iso"?"RR":"ww"}-yyyy`:t.yearPicker?"yyyy":t.quarterPicker?"QQQ/yyyy":t.enableTimePicker?`MM/dd/yyyy, ${e()}`:"MM/dd/yyyy"},i=x=>eC(x,t.enableSeconds),s=()=>C.value.enabled?t.startTime&&Array.isArray(t.startTime)?[i(t.startTime[0]),i(t.startTime[1])]:null:t.startTime&&!Array.isArray(t.startTime)?i(t.startTime):null,r=be(()=>GB(t.multiCalendars)),o=be(()=>s()),a=be(()=>UB(t.ariaLabels)),l=be(()=>JB(t.filters)),c=be(()=>qB(t.transitions)),u=be(()=>QB(t.actionRow)),d=be(()=>XB(t.previewFormat,t.format,n())),h=be(()=>ZB(t.textInput)),f=be(()=>e4(t.inline)),p=be(()=>t4(t.config)),m=be(()=>n4(t.highlight)),y=be(()=>i4(t.weekNumbers)),v=be(()=>r4(t.timezone)),b=be(()=>l4(t.multiDates)),E=be(()=>a4({minDate:t.minDate,maxDate:t.maxDate,disabledDates:t.disabledDates,allowedDates:t.allowedDates,highlight:m.value,markers:t.markers,timezone:v.value,isSpecific:t.monthPicker||t.yearPicker||t.quarterPicker})),C=be(()=>s4(t.range)),w=be(()=>c4(t.ui));return{defaultedTransitions:c,defaultedMultiCalendars:r,defaultedStartTime:o,defaultedAriaLabels:a,defaultedFilters:l,defaultedActionRow:u,defaultedPreviewFormat:d,defaultedTextInput:h,defaultedInline:f,defaultedConfig:p,defaultedHighlight:m,defaultedWeekNumbers:y,defaultedRange:C,propDates:E,defaultedTz:v,defaultedMultiDates:b,defaultedUI:w,getDefaultPattern:n,getDefaultStartTime:s}},u4=(t,e,n)=>{const i=we(),{defaultedTextInput:s,defaultedRange:r,defaultedTz:o,defaultedMultiDates:a,getDefaultPattern:l}=Wt(e),c=we(""),u=Zc(e,"format"),d=Zc(e,"formatLocale");fn(i,()=>{typeof e.onInternalModelChange=="function"&&t("internal-model-change",i.value,le(!0))},{deep:!0}),fn(r,($,oe)=>{$.enabled!==oe.enabled&&(i.value=null)}),fn(u,()=>{X()});const h=$=>o.value.timezone&&o.value.convertModel?_i($,o.value.timezone):$,f=$=>{if(o.value.timezone&&o.value.convertModel){const oe=MB(o.value.timezone);return kF($,oe)}return $},p=($,oe,de=!1)=>nC($,e.format,e.formatLocale,s.value.rangeSeparator,e.modelAuto,oe??l(),de),m=$=>$?e.modelType?ne($):{hours:pr($),minutes:oo($),seconds:e.enableSeconds?El($):0}:null,y=$=>e.modelType?ne($):{month:at($),year:Ge($)},v=$=>Array.isArray($)?a.value.enabled?$.map(oe=>b(oe,Ts(Ee(),oe))):wd(()=>[Ts(Ee(),$[0]),$[1]?Ts(Ee(),$[1]):Ra(r.value.partialRange)],r.value.enabled):Ts(Ee(),+$),b=($,oe)=>(typeof $=="string"||typeof $=="number")&&e.modelType?J($):oe,E=$=>Array.isArray($)?[b($[0],eo(null,+$[0].hours,+$[0].minutes,$[0].seconds)),b($[1],eo(null,+$[1].hours,+$[1].minutes,$[1].seconds))]:b($,eo(null,$.hours,$.minutes,$.seconds)),C=$=>{const oe=It(Ee(),{date:1});return Array.isArray($)?a.value.enabled?$.map(de=>b(de,sr(oe,+de.month,+de.year))):wd(()=>[b($[0],sr(oe,+$[0].month,+$[0].year)),b($[1],$[1]?sr(oe,+$[1].month,+$[1].year):Ra(r.value.partialRange))],r.value.enabled):b($,sr(oe,+$.month,+$.year))},w=$=>{if(Array.isArray($))return $.map(oe=>J(oe));throw new Error(V_.dateArr("multi-dates"))},x=$=>{if(Array.isArray($)&&r.value.enabled){const oe=$[0],de=$[1];return[Ee(Array.isArray(oe)?oe[0]:null),Ee(Array.isArray(de)?de[0]:null)]}return Ee($[0])},T=$=>e.modelAuto?Array.isArray($)?[J($[0]),J($[1])]:e.autoApply?[J($)]:[J($),null]:Array.isArray($)?wd(()=>$[1]?[J($[0]),$[1]?J($[1]):Ra(r.value.partialRange)]:[J($[0])],r.value.enabled):J($),k=()=>{Array.isArray(i.value)&&r.value.enabled&&i.value.length===1&&i.value.push(Ra(r.value.partialRange))},A=()=>{const $=i.value;return[ne($[0]),$[1]?ne($[1]):Ra(r.value.partialRange)]},P=()=>i.value[1]?A():ne(Tn(i.value[0])),F=()=>(i.value||[]).map($=>ne($)),H=($=!1)=>($||k(),e.modelAuto?P():a.value.enabled?F():Array.isArray(i.value)?wd(()=>A(),r.value.enabled):ne(Tn(i.value))),te=$=>!$||Array.isArray($)&&!$.length?null:e.timePicker?E(Tn($)):e.monthPicker?C(Tn($)):e.yearPicker?v(Tn($)):a.value.enabled?w(Tn($)):e.weekPicker?x(Tn($)):T(Tn($)),N=$=>{const oe=te($);nm(Tn(oe))?(i.value=Tn(oe),X()):(i.value=null,c.value="")},L=()=>{const $=oe=>Rs(oe,s.value.format);return`${$(i.value[0])} ${s.value.rangeSeparator} ${i.value[1]?$(i.value[1]):""}`},I=()=>n.value&&i.value?Array.isArray(i.value)?L():Rs(i.value,s.value.format):p(i.value),W=()=>i.value?a.value.enabled?i.value.map($=>p($)).join("; "):s.value.enabled&&typeof s.value.format=="string"?I():p(i.value):"",X=()=>{!e.format||typeof e.format=="string"||s.value.enabled&&typeof s.value.format=="string"?c.value=W():c.value=e.format(i.value)},J=$=>{if(e.utc){const oe=new Date($);return e.utc==="preserve"?new Date(oe.getTime()+oe.getTimezoneOffset()*6e4):oe}return e.modelType?IB.includes(e.modelType)?h(new Date($)):e.modelType==="format"&&(typeof e.format=="string"||!e.format)?h(Qp($,l(),new Date,{locale:d.value})):h(Qp($,e.modelType,new Date,{locale:d.value})):h(new Date($))},ne=$=>$?e.utc?zB($,e.utc==="preserve",e.enableSeconds):e.modelType?e.modelType==="timestamp"?+f($):e.modelType==="iso"?f($).toISOString():e.modelType==="format"&&(typeof e.format=="string"||!e.format)?p(f($)):p(f($),e.modelType,!0):f($):"",ue=($,oe=!1,de=!1)=>{if(de)return $;if(t("update:model-value",$),o.value.emitTimezone&&oe){const ve=Array.isArray($)?$.map(z=>_i(Tn(z),o.value.emitTimezone)):_i(Tn($),o.value.emitTimezone);t("update:model-timezone-value",ve)}},Y=$=>Array.isArray(i.value)?a.value.enabled?i.value.map(oe=>$(oe)):[$(i.value[0]),i.value[1]?$(i.value[1]):Ra(r.value.partialRange)]:$(Tn(i.value)),Z=()=>{if(Array.isArray(i.value)){const $=er(i.value[0],e.weekStart),oe=i.value[1]?er(i.value[1],e.weekStart):[];return[$.map(de=>Ee(de)),oe.map(de=>Ee(de))]}return er(i.value,e.weekStart).map($=>Ee($))},M=($,oe)=>ue(Tn(Y($)),!1,oe),ie=$=>{const oe=Z();return $?oe:t("update:model-value",Z())},le=($=!1)=>($||X(),e.monthPicker?M(y,$):e.timePicker?M(m,$):e.yearPicker?M(Ge,$):e.weekPicker?ie($):ue(H($),!0,$));return{inputValue:c,internalModelValue:i,checkBeforeEmit:()=>i.value?r.value.enabled?r.value.partialRange?i.value.length>=1:i.value.length===2:!!i.value:!1,parseExternalModelValue:N,formatInputValue:X,emitModelValue:le}},d4=(t,e)=>{const{defaultedFilters:n,propDates:i}=Wt(t),{validateMonthYearInRange:s}=_o(t),r=(u,d)=>{let h=u;return n.value.months.includes(at(h))?(h=d?us(u,1):Cl(u,1),r(h,d)):h},o=(u,d)=>{let h=u;return n.value.years.includes(Ge(h))?(h=d?k_(u,1):jS(u,1),o(h,d)):h},a=(u,d=!1)=>{const h=It(Ee(),{month:t.month,year:t.year});let f=u?us(h,1):Cl(h,1);t.disableYearSelect&&(f=Ts(f,t.year));let p=at(f),m=Ge(f);n.value.months.includes(p)&&(f=r(f,u),p=at(f),m=Ge(f)),n.value.years.includes(m)&&(f=o(f,u),m=Ge(f)),s(p,m,u,t.preventMinMaxNavigation)&&l(p,m,d)},l=(u,d,h)=>{e("update-month-year",{month:u,year:d,fromNav:h})},c=be(()=>u=>tC(It(Ee(),{month:t.month,year:t.year}),i.value.maxDate,i.value.minDate,t.preventMinMaxNavigation,u));return{handleMonthYearChange:a,isDisabled:c,updateMonthYear:l}},_f={multiCalendars:{type:[Boolean,Number,String,Object],default:void 0},modelValue:{type:[String,Date,Array,Object,Number],default:null},modelType:{type:String,default:null},position:{type:String,default:"center"},dark:{type:Boolean,default:!1},format:{type:[String,Function],default:()=>null},autoPosition:{type:Boolean,default:!0},altPosition:{type:Function,default:null},transitions:{type:[Boolean,Object],default:!0},formatLocale:{type:Object,default:null},utc:{type:[Boolean,String],default:!1},ariaLabels:{type:Object,default:()=>({})},offset:{type:[Number,String],default:10},hideNavigation:{type:Array,default:()=>[]},timezone:{type:[String,Object],default:null},vertical:{type:Boolean,default:!1},disableMonthYearSelect:{type:Boolean,default:!1},disableYearSelect:{type:Boolean,default:!1},dayClass:{type:Function,default:null},yearRange:{type:Array,default:()=>[1900,2100]},enableTimePicker:{type:Boolean,default:!0},autoApply:{type:Boolean,default:!1},disabledDates:{type:[Array,Function],default:()=>[]},monthNameFormat:{type:String,default:"short"},startDate:{type:[Date,String],default:null},startTime:{type:[Object,Array],default:null},hideOffsetDates:{type:Boolean,default:!1},noToday:{type:Boolean,default:!1},disabledWeekDays:{type:Array,default:()=>[]},allowedDates:{type:Array,default:null},nowButtonLabel:{type:String,default:"Now"},markers:{type:Array,default:()=>[]},escClose:{type:Boolean,default:!0},spaceConfirm:{type:Boolean,default:!0},monthChangeOnArrows:{type:Boolean,default:!0},presetDates:{type:Array,default:()=>[]},flow:{type:Array,default:()=>[]},partialFlow:{type:Boolean,default:!1},preventMinMaxNavigation:{type:Boolean,default:!1},reverseYears:{type:Boolean,default:!1},weekPicker:{type:Boolean,default:!1},filters:{type:Object,default:()=>({})},arrowNavigation:{type:Boolean,default:!1},highlight:{type:[Function,Object],default:null},teleport:{type:[Boolean,String,Object],default:null},teleportCenter:{type:Boolean,default:!1},locale:{type:String,default:"en-Us"},weekNumName:{type:String,default:"W"},weekStart:{type:[Number,String],default:1},weekNumbers:{type:[String,Function,Object],default:null},monthChangeOnScroll:{type:[Boolean,String],default:!0},dayNames:{type:[Function,Array],default:null},monthPicker:{type:Boolean,default:!1},customProps:{type:Object,default:null},yearPicker:{type:Boolean,default:!1},modelAuto:{type:Boolean,default:!1},selectText:{type:String,default:"Select"},cancelText:{type:String,default:"Cancel"},previewFormat:{type:[String,Function],default:()=>""},multiDates:{type:[Object,Boolean],default:!1},ignoreTimeValidation:{type:Boolean,default:!1},minDate:{type:[Date,String],default:null},maxDate:{type:[Date,String],default:null},minTime:{type:Object,default:null},maxTime:{type:Object,default:null},name:{type:String,default:null},placeholder:{type:String,default:""},hideInputIcon:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},state:{type:Boolean,default:null},required:{type:Boolean,default:!1},autocomplete:{type:String,default:"off"},timePicker:{type:Boolean,default:!1},enableSeconds:{type:Boolean,default:!1},is24:{type:Boolean,default:!0},noHoursOverlay:{type:Boolean,default:!1},noMinutesOverlay:{type:Boolean,default:!1},noSecondsOverlay:{type:Boolean,default:!1},hoursGridIncrement:{type:[String,Number],default:1},minutesGridIncrement:{type:[String,Number],default:5},secondsGridIncrement:{type:[String,Number],default:5},hoursIncrement:{type:[Number,String],default:1},minutesIncrement:{type:[Number,String],default:1},secondsIncrement:{type:[Number,String],default:1},range:{type:[Boolean,Object],default:!1},uid:{type:String,default:null},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},inline:{type:[Boolean,Object],default:!1},textInput:{type:[Boolean,Object],default:!1},sixWeeks:{type:[Boolean,String],default:!1},actionRow:{type:Object,default:()=>({})},focusStartDate:{type:Boolean,default:!1},disabledTimes:{type:[Function,Array],default:void 0},timePickerInline:{type:Boolean,default:!1},calendar:{type:Function,default:null},config:{type:Object,default:void 0},quarterPicker:{type:Boolean,default:!1},yearFirst:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},onInternalModelChange:{type:[Function,Object],default:null},enableMinutes:{type:Boolean,default:!0},ui:{type:Object,default:()=>({})}},ps={..._f,shadow:{type:Boolean,default:!1},flowStep:{type:Number,default:0},internalModelValue:{type:[Date,Array],default:null},noOverlayFocus:{type:Boolean,default:!1},collapse:{type:Boolean,default:!1},menuWrapRef:{type:Object,default:null},getInputRect:{type:Function,default:()=>({})},isTextInputDate:{type:Boolean,default:!1}},h4=["title"],f4=["disabled"],g4=cn({compatConfig:{MODE:3},__name:"ActionRow",props:{menuMount:{type:Boolean,default:!1},calendarWidth:{type:Number,default:0},...ps},emits:["close-picker","select-date","select-now","invalid-select"],setup(t,{emit:e}){const n=e,i=t,{defaultedActionRow:s,defaultedPreviewFormat:r,defaultedMultiCalendars:o,defaultedTextInput:a,defaultedInline:l,defaultedRange:c,defaultedMultiDates:u,getDefaultPattern:d}=Wt(i),{isTimeValid:h,isMonthValid:f}=_o(i),{buildMatrix:p}=mo(),m=we(null),y=we(null),v=we(!1),b=we({}),E=we(null),C=we(null);xn(()=>{i.arrowNavigation&&p([mn(m),mn(y)],"actionRow"),w(),window.addEventListener("resize",w)}),Yl(()=>{window.removeEventListener("resize",w)});const w=()=>{v.value=!1,setTimeout(()=>{var L,I;const W=(L=E.value)==null?void 0:L.getBoundingClientRect(),X=(I=C.value)==null?void 0:I.getBoundingClientRect();W&&X&&(b.value.maxWidth=`${X.width-W.width-20}px`),v.value=!0},0)},x=be(()=>c.value.enabled&&!c.value.partialRange&&i.internalModelValue?i.internalModelValue.length===2:!0),T=be(()=>!h.value(i.internalModelValue)||!f.value(i.internalModelValue)||!x.value),k=()=>{const L=r.value;return i.timePicker||i.monthPicker,L(Tn(i.internalModelValue))},A=()=>{const L=i.internalModelValue;return o.value.count>0?`${P(L[0])} - ${P(L[1])}`:[P(L[0]),P(L[1])]},P=L=>nC(L,r.value,i.formatLocale,a.value.rangeSeparator,i.modelAuto,d()),F=be(()=>!i.internalModelValue||!i.menuMount?"":typeof r.value=="string"?Array.isArray(i.internalModelValue)?i.internalModelValue.length===2&&i.internalModelValue[1]?A():u.value.enabled?i.internalModelValue.map(L=>`${P(L)}`):i.modelAuto?`${P(i.internalModelValue[0])}`:`${P(i.internalModelValue[0])} -`:P(i.internalModelValue):k()),H=()=>u.value.enabled?"; ":" - ",te=be(()=>Array.isArray(F.value)?F.value.join(H()):F.value),N=()=>{h.value(i.internalModelValue)&&f.value(i.internalModelValue)&&x.value?n("select-date"):n("invalid-select")};return(L,I)=>(D(),V("div",{ref_key:"actionRowRef",ref:C,class:"dp__action_row"},[L.$slots["action-row"]?Ne(L.$slots,"action-row",In(yn({key:0},{internalModelValue:L.internalModelValue,disabled:T.value,selectDate:()=>L.$emit("select-date"),closePicker:()=>L.$emit("close-picker")}))):(D(),V($e,{key:1},[Q(s).showPreview?(D(),V("div",{key:0,class:"dp__selection_preview",title:te.value,style:Mn(b.value)},[L.$slots["action-preview"]&&v.value?Ne(L.$slots,"action-preview",{key:0,value:L.internalModelValue}):ce("",!0),!L.$slots["action-preview"]&&v.value?(D(),V($e,{key:1},[Ye(xe(te.value),1)],64)):ce("",!0)],12,h4)):ce("",!0),g("div",{ref_key:"actionBtnContainer",ref:E,class:"dp__action_buttons","data-dp-element":"action-row"},[L.$slots["action-buttons"]?Ne(L.$slots,"action-buttons",{key:0,value:L.internalModelValue}):ce("",!0),L.$slots["action-buttons"]?ce("",!0):(D(),V($e,{key:1},[!Q(l).enabled&&Q(s).showCancel?(D(),V("button",{key:0,ref_key:"cancelButtonRef",ref:m,type:"button",class:"dp__action_button dp__action_cancel",onClick:I[0]||(I[0]=W=>L.$emit("close-picker")),onKeydown:I[1]||(I[1]=W=>Q(Qn)(W,()=>L.$emit("close-picker")))},xe(L.cancelText),545)):ce("",!0),Q(s).showNow?(D(),V("button",{key:1,type:"button",class:"dp__action_button dp__action_cancel",onClick:I[2]||(I[2]=W=>L.$emit("select-now")),onKeydown:I[3]||(I[3]=W=>Q(Qn)(W,()=>L.$emit("select-now")))},xe(L.nowButtonLabel),33)):ce("",!0),Q(s).showSelect?(D(),V("button",{key:2,ref_key:"selectButtonRef",ref:y,type:"button",class:"dp__action_button dp__action_select",disabled:T.value,"data-test":"select-button",onKeydown:I[4]||(I[4]=W=>Q(Qn)(W,()=>N())),onClick:N},xe(L.selectText),41,f4)):ce("",!0)],64))],512)],64))],512))}}),p4=["role","aria-label","tabindex"],m4={class:"dp__selection_grid_header"},_4=["aria-selected","aria-disabled","data-test","onClick","onKeydown","onMouseover"],y4=["aria-label"],Ou=cn({__name:"SelectionOverlay",props:{items:{},type:{},isLast:{type:Boolean},arrowNavigation:{type:Boolean},skipButtonRef:{type:Boolean},headerRefs:{},hideNavigation:{},escClose:{type:Boolean},useRelative:{type:Boolean},height:{},textInput:{type:[Boolean,Object]},config:{},noOverlayFocus:{type:Boolean},focusValue:{},menuWrapRef:{},ariaLabels:{},overlayLabel:{}},emits:["selected","toggle","reset-flow","hover-value"],setup(t,{expose:e,emit:n}){const{setSelectionGrid:i,buildMultiLevelMatrix:s,setMonthPicker:r}=mo(),o=n,a=t,{defaultedAriaLabels:l,defaultedTextInput:c,defaultedConfig:u}=Wt(a),{hideNavigationButtons:d}=bf(),h=we(!1),f=we(null),p=we(null),m=we([]),y=we(),v=we(null),b=we(0),E=we(null);gE(()=>{f.value=null}),xn(()=>{Rn().then(()=>F()),a.noOverlayFocus||w(),C(!0)}),Yl(()=>C(!1));const C=Y=>{var Z;a.arrowNavigation&&((Z=a.headerRefs)!=null&&Z.length?r(Y):i(Y))},w=()=>{var Y;const Z=mn(p);Z&&(c.value.enabled||(f.value?(Y=f.value)==null||Y.focus({preventScroll:!0}):Z.focus({preventScroll:!0})),h.value=Z.clientHeight({dp__overlay:!0,"dp--overlay-absolute":!a.useRelative,"dp--overlay-relative":a.useRelative})),T=be(()=>a.useRelative?{height:`${a.height}px`,width:"260px"}:void 0),k=be(()=>({dp__overlay_col:!0})),A=be(()=>({dp__btn:!0,dp__button:!0,dp__overlay_action:!0,dp__over_action_scroll:h.value,dp__button_bottom:a.isLast})),P=be(()=>{var Y,Z;return{dp__overlay_container:!0,dp__container_flex:((Y=a.items)==null?void 0:Y.length)<=6,dp__container_block:((Z=a.items)==null?void 0:Z.length)>6}});fn(()=>a.items,()=>F(!1),{deep:!0});const F=(Y=!0)=>{Rn().then(()=>{const Z=mn(f),M=mn(p),ie=mn(v),le=mn(E),$=ie?ie.getBoundingClientRect().height:0;M&&(M.getBoundingClientRect().height?b.value=M.getBoundingClientRect().height-$:b.value=u.value.modeHeight-$),Z&&le&&Y&&(le.scrollTop=Z.offsetTop-le.offsetTop-(b.value/2-Z.getBoundingClientRect().height)-$)})},H=Y=>{Y.disabled||o("selected",Y.value)},te=()=>{o("toggle"),o("reset-flow")},N=()=>{a.escClose&&te()},L=(Y,Z,M,ie)=>{Y&&((Z.active||Z.value===a.focusValue)&&(f.value=Y),a.arrowNavigation&&(Array.isArray(m.value[M])?m.value[M][ie]=Y:m.value[M]=[Y],I()))},I=()=>{var Y,Z;const M=(Y=a.headerRefs)!=null&&Y.length?[a.headerRefs].concat(m.value):m.value.concat([a.skipButtonRef?[]:[v.value]]);s(Tn(M),(Z=a.headerRefs)!=null&&Z.length?"monthPicker":"selectionGrid")},W=Y=>{a.arrowNavigation||Qr(Y,u.value,!0)},X=Y=>{y.value=Y,o("hover-value",Y)},J=()=>{if(te(),!a.isLast){const Y=tm(a.menuWrapRef??null,"action-row");if(Y){const Z=XS(Y);Z?.focus()}}},ne=Y=>{switch(Y.key){case Lt.esc:return N();case Lt.arrowLeft:return W(Y);case Lt.arrowRight:return W(Y);case Lt.arrowUp:return W(Y);case Lt.arrowDown:return W(Y);default:return}},ue=Y=>{if(Y.key===Lt.enter)return te();if(Y.key===Lt.tab)return J()};return e({focusGrid:w}),(Y,Z)=>{var M;return D(),V("div",{ref_key:"gridWrapRef",ref:p,class:Me(x.value),style:Mn(T.value),role:Y.useRelative?void 0:"dialog","aria-label":Y.overlayLabel,tabindex:Y.useRelative?void 0:"0",onKeydown:ne,onClick:Z[0]||(Z[0]=iu(()=>{},["prevent"]))},[g("div",{ref_key:"containerRef",ref:E,class:Me(P.value),style:Mn({"--dp-overlay-height":`${b.value}px`}),role:"grid"},[g("div",m4,[Ne(Y.$slots,"header")]),Y.$slots.overlay?Ne(Y.$slots,"overlay",{key:0}):(D(!0),V($e,{key:1},Xe(Y.items,(ie,le)=>(D(),V("div",{key:le,class:Me(["dp__overlay_row",{dp__flex_row:Y.items.length>=3}]),role:"row"},[(D(!0),V($e,null,Xe(ie,($,oe)=>(D(),V("div",{key:$.value,ref_for:!0,ref:de=>L(de,$,le,oe),role:"gridcell",class:Me(k.value),"aria-selected":$.active||void 0,"aria-disabled":$.disabled||void 0,tabindex:"0","data-test":$.text,onClick:iu(de=>H($),["prevent"]),onKeydown:de=>Q(Qn)(de,()=>H($),!0),onMouseover:de=>X($.value)},[g("div",{class:Me($.className)},[Y.$slots.item?Ne(Y.$slots,"item",{key:0,item:$}):ce("",!0),Y.$slots.item?ce("",!0):(D(),V($e,{key:1},[Ye(xe($.text),1)],64))],2)],42,_4))),128))],2))),128))],6),Y.$slots["button-icon"]?Oe((D(),V("button",{key:0,ref_key:"toggleButton",ref:v,type:"button","aria-label":(M=Q(l))==null?void 0:M.toggleOverlay,class:Me(A.value),tabindex:"0",onClick:te,onKeydown:ue},[Ne(Y.$slots,"button-icon")],42,y4)),[[th,!Q(d)(Y.hideNavigation,Y.type)]]):ce("",!0)],46,p4)}}}),yf=cn({__name:"InstanceWrap",props:{multiCalendars:{},stretch:{type:Boolean},collapse:{type:Boolean}},setup(t){const e=t,n=be(()=>e.multiCalendars>0?[...Array(e.multiCalendars).keys()]:[0]),i=be(()=>({dp__instance_calendar:e.multiCalendars>0}));return(s,r)=>(D(),V("div",{class:Me({dp__menu_inner:!s.stretch,"dp--menu--inner-stretched":s.stretch,dp__flex_display:s.multiCalendars>0,"dp--flex-display-collapsed":s.collapse})},[(D(!0),V($e,null,Xe(n.value,(o,a)=>(D(),V("div",{key:o,class:Me(i.value)},[Ne(s.$slots,"default",{instance:o,index:a})],2))),128))],2))}}),v4=["data-dp-element","aria-label","aria-disabled"],Wc=cn({compatConfig:{MODE:3},__name:"ArrowBtn",props:{ariaLabel:{},elName:{},disabled:{type:Boolean}},emits:["activate","set-ref"],setup(t,{emit:e}){const n=e,i=we(null);return xn(()=>n("set-ref",i)),(s,r)=>(D(),V("button",{ref_key:"elRef",ref:i,type:"button","data-dp-element":s.elName,class:"dp__btn dp--arrow-btn-nav",tabindex:"0","aria-label":s.ariaLabel,"aria-disabled":s.disabled||void 0,onClick:r[0]||(r[0]=o=>s.$emit("activate")),onKeydown:r[1]||(r[1]=o=>Q(Qn)(o,()=>s.$emit("activate"),!0))},[g("span",{class:Me(["dp__inner_nav",{dp__inner_nav_disabled:s.disabled}])},[Ne(s.$slots,"default")],2)],40,v4))}}),b4=["aria-label","data-test"],oC=cn({__name:"YearModePicker",props:{...ps,showYearPicker:{type:Boolean,default:!1},items:{type:Array,default:()=>[]},instance:{type:Number,default:0},year:{type:Number,default:0},isDisabled:{type:Function,default:()=>!1}},emits:["toggle-year-picker","year-select","handle-year"],setup(t,{emit:e}){const n=e,i=t,{showRightIcon:s,showLeftIcon:r}=bf(),{defaultedConfig:o,defaultedMultiCalendars:a,defaultedAriaLabels:l,defaultedTransitions:c,defaultedUI:u}=Wt(i),{showTransition:d,transitionName:h}=Nu(c),f=we(!1),p=(v=!1,b)=>{f.value=!f.value,n("toggle-year-picker",{flow:v,show:b})},m=v=>{f.value=!1,n("year-select",v)},y=(v=!1)=>{n("handle-year",v)};return(v,b)=>{var E,C,w,x,T;return D(),V($e,null,[g("div",{class:Me(["dp--year-mode-picker",{"dp--hidden-el":f.value}])},[Q(r)(Q(a),t.instance)?(D(),Ce(Wc,{key:0,ref:"mpPrevIconRef","aria-label":(E=Q(l))==null?void 0:E.prevYear,disabled:t.isDisabled(!1),class:Me((C=Q(u))==null?void 0:C.navBtnPrev),onActivate:b[0]||(b[0]=k=>y(!1))},{default:Re(()=>[v.$slots["arrow-left"]?Ne(v.$slots,"arrow-left",{key:0}):ce("",!0),v.$slots["arrow-left"]?ce("",!0):(D(),Ce(Q(D_),{key:1}))]),_:3},8,["aria-label","disabled","class"])):ce("",!0),g("button",{ref:"mpYearButtonRef",class:"dp__btn dp--year-select",type:"button","aria-label":`${t.year}-${(w=Q(l))==null?void 0:w.openYearsOverlay}`,"data-test":`year-mode-btn-${t.instance}`,onClick:b[1]||(b[1]=()=>p(!1)),onKeydown:b[2]||(b[2]=eS(()=>p(!1),["enter"]))},[v.$slots.year?Ne(v.$slots,"year",{key:0,year:t.year}):ce("",!0),v.$slots.year?ce("",!0):(D(),V($e,{key:1},[Ye(xe(t.year),1)],64))],40,b4),Q(s)(Q(a),t.instance)?(D(),Ce(Wc,{key:1,ref:"mpNextIconRef","aria-label":(x=Q(l))==null?void 0:x.nextYear,disabled:t.isDisabled(!0),class:Me((T=Q(u))==null?void 0:T.navBtnNext),onActivate:b[3]||(b[3]=k=>y(!0))},{default:Re(()=>[v.$slots["arrow-right"]?Ne(v.$slots,"arrow-right",{key:0}):ce("",!0),v.$slots["arrow-right"]?ce("",!0):(D(),Ce(Q($_),{key:1}))]),_:3},8,["aria-label","disabled","class"])):ce("",!0)],2),B(Rt,{name:Q(h)(t.showYearPicker),css:Q(d)},{default:Re(()=>{var k,A;return[t.showYearPicker?(D(),Ce(Ou,{key:0,items:t.items,"text-input":v.textInput,"esc-close":v.escClose,config:v.config,"is-last":v.autoApply&&!Q(o).keepActionRow,"hide-navigation":v.hideNavigation,"aria-labels":v.ariaLabels,"overlay-label":(A=(k=Q(l))==null?void 0:k.yearPicker)==null?void 0:A.call(k,!0),type:"year",onToggle:p,onSelected:b[4]||(b[4]=P=>m(P))},jn({"button-icon":Re(()=>[v.$slots["calendar-icon"]?Ne(v.$slots,"calendar-icon",{key:0}):ce("",!0),v.$slots["calendar-icon"]?ce("",!0):(D(),Ce(Q(Ul),{key:1}))]),_:2},[v.$slots["year-overlay-value"]?{name:"item",fn:Re(({item:P})=>[Ne(v.$slots,"year-overlay-value",{text:P.text,value:P.value})]),key:"0"}:void 0]),1032,["items","text-input","esc-close","config","is-last","hide-navigation","aria-labels","overlay-label"])):ce("",!0)]}),_:3},8,["name","css"])],64)}}}),H_=(t,e,n)=>{if(e.value&&Array.isArray(e.value))if(e.value.some(i=>ct(t,i))){const i=e.value.filter(s=>!ct(s,t));e.value=i.length?i:null}else(n&&+n>e.value.length||!n)&&e.value.push(t);else e.value=[t]},Y_=(t,e,n)=>{let i=t.value?t.value.slice():[];return i.length===2&&i[1]!==null&&(i=[]),i.length?Xt(e,i[0])?(i.unshift(e),n("range-start",i[0]),n("range-start",i[1])):(i[1]=e,n("range-end",e)):(i=[e],n("range-start",e)),i},vf=(t,e,n,i)=>{t&&(t[0]&&t[1]&&n&&e("auto-apply"),t[0]&&!t[1]&&i&&n&&e("auto-apply"))},aC=t=>{Array.isArray(t.value)&&t.value.length<=2&&t.range?t.modelValue.value=t.value.map(e=>_i(Ee(e),t.timezone)):Array.isArray(t.value)||(t.modelValue.value=_i(Ee(t.value),t.timezone))},lC=(t,e,n,i)=>Array.isArray(e.value)&&(e.value.length===2||e.value.length===1&&i.value.partialRange)?i.value.fixedStart&&(nn(t,e.value[0])||ct(t,e.value[0]))?[e.value[0],t]:i.value.fixedEnd&&(Xt(t,e.value[1])||ct(t,e.value[1]))?[t,e.value[1]]:(n("invalid-fixed-range",t),e.value):[],cC=({multiCalendars:t,range:e,highlight:n,propDates:i,calendars:s,modelValue:r,props:o,filters:a,year:l,month:c,emit:u})=>{const d=be(()=>B_(o.yearRange,o.locale,o.reverseYears)),h=we([!1]),f=be(()=>(P,F)=>{const H=It(rs(new Date),{month:c.value(P),year:l.value(P)}),te=F?RS(H):ru(H);return tC(te,i.value.maxDate,i.value.minDate,o.preventMinMaxNavigation,F)}),p=()=>Array.isArray(r.value)&&t.value.solo&&r.value[1],m=()=>{for(let P=0;P{if(!P)return m();const F=It(Ee(),s.value[P]);return s.value[0].year=Ge(jS(F,t.value.count-1)),m()},v=(P,F)=>{const H=RF(F,P);return e.value.showLastInRange&&H>1?F:P},b=P=>o.focusStartDate||t.value.solo?P[0]:P[1]?v(P[0],P[1]):P[0],E=()=>{if(r.value){const P=Array.isArray(r.value)?b(r.value):r.value;s.value[0]={month:at(P),year:Ge(P)}}},C=()=>{E(),t.value.count&&m()};fn(r,(P,F)=>{o.isTextInputDate&&JSON.stringify(P??{})!==JSON.stringify(F??{})&&C()}),xn(()=>{C()});const w=(P,F)=>{s.value[F].year=P,u("update-month-year",{instance:F,year:P,month:s.value[F].month}),t.value.count&&!t.value.solo&&y(F)},x=be(()=>P=>Tl(d.value,F=>{var H;const te=l.value(P)===F.value,N=au(F.value,kl(i.value.minDate),kl(i.value.maxDate))||((H=a.value.years)==null?void 0:H.includes(l.value(P))),L=W_(n.value,F.value);return{active:te,disabled:N,highlighted:L}})),T=(P,F)=>{w(P,F),A(F)},k=(P,F=!1)=>{if(!f.value(P,F)){const H=F?l.value(P)+1:l.value(P)-1;w(H,P)}},A=(P,F=!1,H)=>{F||u("reset-flow"),H!==void 0?h.value[P]=H:h.value[P]=!h.value[P],h.value[P]?u("overlay-toggle",{open:!0,overlay:zn.year}):(u("overlay-closed"),u("overlay-toggle",{open:!1,overlay:zn.year}))};return{isDisabled:f,groupedYears:x,showYearPicker:h,selectYear:w,toggleYearPicker:A,handleYearSelect:T,handleYear:k}},w4=(t,e)=>{const{defaultedMultiCalendars:n,defaultedAriaLabels:i,defaultedTransitions:s,defaultedConfig:r,defaultedRange:o,defaultedHighlight:a,propDates:l,defaultedTz:c,defaultedFilters:u,defaultedMultiDates:d}=Wt(t),h=()=>{t.isTextInputDate&&C(Ge(Ee(t.startDate)),0)},{modelValue:f,year:p,month:m,calendars:y}=Fu(t,e,h),v=be(()=>US(t.formatLocale,t.locale,t.monthNameFormat)),b=we(null),{checkMinMaxRange:E}=_o(t),{selectYear:C,groupedYears:w,showYearPicker:x,toggleYearPicker:T,handleYearSelect:k,handleYear:A,isDisabled:P}=cC({modelValue:f,multiCalendars:n,range:o,highlight:a,calendars:y,year:p,propDates:l,month:m,filters:u,props:t,emit:e});xn(()=>{t.startDate&&(f.value&&t.focusStartDate||!f.value)&&C(Ge(Ee(t.startDate)),0)});const F=M=>M?{month:at(M),year:Ge(M)}:{month:null,year:null},H=()=>f.value?Array.isArray(f.value)?f.value.map(M=>F(M)):F(f.value):F(),te=(M,ie)=>{const le=y.value[M],$=H();return Array.isArray($)?$.some(oe=>oe.year===le?.year&&oe.month===ie):le?.year===$.year&&ie===$.month},N=(M,ie,le)=>{var $,oe;const de=H();return Array.isArray(de)?p.value(ie)===(($=de[le])==null?void 0:$.year)&&M===((oe=de[le])==null?void 0:oe.month):!1},L=(M,ie)=>{if(o.value.enabled){const le=H();if(Array.isArray(f.value)&&Array.isArray(le)){const $=N(M,ie,0)||N(M,ie,1),oe=sr(rs(Ee()),M,p.value(ie));return mf(f.value,b.value,oe)&&!$}return!1}return!1},I=be(()=>M=>Tl(v.value,ie=>{var le;const $=te(M,ie.value),oe=au(ie.value,ZS(p.value(M),l.value.minDate),JS(p.value(M),l.value.maxDate))||KB(l.value.disabledDates,p.value(M)).includes(ie.value)||((le=u.value.months)==null?void 0:le.includes(ie.value)),de=L(ie.value,M),ve=iC(a.value,ie.value,p.value(M));return{active:$,disabled:oe,isBetween:de,highlighted:ve}})),W=(M,ie)=>sr(rs(Ee()),M,p.value(ie)),X=(M,ie)=>{const le=f.value?f.value:rs(new Date);f.value=sr(le,M,p.value(ie)),e("auto-apply"),e("update-flow-step")},J=(M,ie)=>{const le=W(M,ie);o.value.fixedEnd||o.value.fixedStart?f.value=lC(le,f,e,o):f.value?E(le,f.value)&&(f.value=Y_(f,W(M,ie),e)):f.value=[W(M,ie)],Rn().then(()=>{vf(f.value,e,t.autoApply,t.modelAuto)})},ne=(M,ie)=>{H_(W(M,ie),f,d.value.limit),e("auto-apply",!0)},ue=(M,ie)=>(y.value[ie].month=M,Z(ie,y.value[ie].year,M),d.value.enabled?ne(M,ie):o.value.enabled?J(M,ie):X(M,ie)),Y=(M,ie)=>{C(M,ie),Z(ie,M,null)},Z=(M,ie,le)=>{let $=le;if(!$&&$!==0){const oe=H();$=Array.isArray(oe)?oe[M].month:oe.month}e("update-month-year",{instance:M,year:ie,month:$})};return{groupedMonths:I,groupedYears:w,year:p,isDisabled:P,defaultedMultiCalendars:n,defaultedAriaLabels:i,defaultedTransitions:s,defaultedConfig:r,showYearPicker:x,modelValue:f,presetDate:(M,ie)=>{aC({value:M,modelValue:f,range:o.value.enabled,timezone:ie?void 0:c.value.timezone}),e("auto-apply")},setHoverDate:(M,ie)=>{b.value=W(M,ie)},selectMonth:ue,selectYear:Y,toggleYearPicker:T,handleYearSelect:k,handleYear:A,getModelMonthYear:H}},x4=cn({compatConfig:{MODE:3},__name:"MonthPicker",props:{...ps},emits:["update:internal-model-value","overlay-closed","reset-flow","range-start","range-end","auto-apply","update-month-year","update-flow-step","mount","invalid-fixed-range","overlay-toggle"],setup(t,{expose:e,emit:n}){const i=n,s=pa(),r=ki(s,"yearMode"),o=t;xn(()=>{o.shadow||i("mount",null)});const{groupedMonths:a,groupedYears:l,year:c,isDisabled:u,defaultedMultiCalendars:d,defaultedConfig:h,showYearPicker:f,modelValue:p,presetDate:m,setHoverDate:y,selectMonth:v,selectYear:b,toggleYearPicker:E,handleYearSelect:C,handleYear:w,getModelMonthYear:x}=w4(o,i);return e({getSidebarProps:()=>({modelValue:p,year:c,getModelMonthYear:x,selectMonth:v,selectYear:b,handleYear:w}),presetDate:m,toggleYearPicker:T=>E(0,T)}),(T,k)=>(D(),Ce(yf,{"multi-calendars":Q(d).count,collapse:T.collapse,stretch:""},{default:Re(({instance:A})=>[T.$slots["top-extra"]?Ne(T.$slots,"top-extra",{key:0,value:T.internalModelValue}):ce("",!0),T.$slots["month-year"]?Ne(T.$slots,"month-year",In(yn({key:1},{year:Q(c),months:Q(a)(A),years:Q(l)(A),selectMonth:Q(v),selectYear:Q(b),instance:A}))):(D(),Ce(Ou,{key:2,items:Q(a)(A),"arrow-navigation":T.arrowNavigation,"is-last":T.autoApply&&!Q(h).keepActionRow,"esc-close":T.escClose,height:Q(h).modeHeight,config:T.config,"no-overlay-focus":!!(T.noOverlayFocus||T.textInput),"use-relative":"",type:"month",onSelected:P=>Q(v)(P,A),onHoverValue:P=>Q(y)(P,A)},jn({header:Re(()=>[B(oC,yn(T.$props,{items:Q(l)(A),instance:A,"show-year-picker":Q(f)[A],year:Q(c)(A),"is-disabled":P=>Q(u)(A,P),onHandleYear:P=>Q(w)(A,P),onYearSelect:P=>Q(C)(P,A),onToggleYearPicker:P=>Q(E)(A,P?.flow,P?.show)}),jn({_:2},[Xe(Q(r),(P,F)=>({name:P,fn:Re(H=>[Ne(T.$slots,P,In(Zn(H)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),_:2},[T.$slots["month-overlay-value"]?{name:"item",fn:Re(({item:P})=>[Ne(T.$slots,"month-overlay-value",{text:P.text,value:P.value})]),key:"0"}:void 0]),1032,["items","arrow-navigation","is-last","esc-close","height","config","no-overlay-focus","onSelected","onHoverValue"]))]),_:3},8,["multi-calendars","collapse"]))}}),E4=(t,e)=>{const n=()=>{t.isTextInputDate&&(u.value=Ge(Ee(t.startDate)))},{modelValue:i}=Fu(t,e,n),s=we(null),{defaultedHighlight:r,defaultedMultiDates:o,defaultedFilters:a,defaultedRange:l,propDates:c}=Wt(t),u=we();xn(()=>{t.startDate&&(i.value&&t.focusStartDate||!i.value)&&(u.value=Ge(Ee(t.startDate)))});const d=m=>Array.isArray(i.value)?i.value.some(y=>Ge(y)===m):i.value?Ge(i.value)===m:!1,h=m=>l.value.enabled&&Array.isArray(i.value)?mf(i.value,s.value,p(m)):!1,f=be(()=>Tl(B_(t.yearRange,t.locale,t.reverseYears),m=>{const y=d(m.value),v=au(m.value,kl(c.value.minDate),kl(c.value.maxDate))||a.value.years.includes(m.value),b=h(m.value)&&!y,E=W_(r.value,m.value);return{active:y,disabled:v,isBetween:b,highlighted:E}})),p=m=>Ts(rs(ru(new Date)),m);return{groupedYears:f,modelValue:i,focusYear:u,setHoverValue:m=>{s.value=Ts(rs(new Date),m)},selectYear:m=>{var y;if(e("update-month-year",{instance:0,year:m}),o.value.enabled)return i.value?Array.isArray(i.value)&&(((y=i.value)==null?void 0:y.map(v=>Ge(v))).includes(m)?i.value=i.value.filter(v=>Ge(v)!==m):i.value.push(Ts(ni(Ee()),m))):i.value=[Ts(ni(ru(Ee())),m)],e("auto-apply",!0);l.value.enabled?(i.value=Y_(i,p(m),e),Rn().then(()=>{vf(i.value,e,t.autoApply,t.modelAuto)})):(i.value=p(m),e("auto-apply"))}}},S4=cn({compatConfig:{MODE:3},__name:"YearPicker",props:{...ps},emits:["update:internal-model-value","reset-flow","range-start","range-end","auto-apply","update-month-year"],setup(t,{expose:e,emit:n}){const i=n,s=t,{groupedYears:r,modelValue:o,focusYear:a,selectYear:l,setHoverValue:c}=E4(s,i),{defaultedConfig:u}=Wt(s);return e({getSidebarProps:()=>({modelValue:o,selectYear:l})}),(d,h)=>(D(),V("div",null,[d.$slots["top-extra"]?Ne(d.$slots,"top-extra",{key:0,value:d.internalModelValue}):ce("",!0),d.$slots["month-year"]?Ne(d.$slots,"month-year",In(yn({key:1},{years:Q(r),selectYear:Q(l)}))):(D(),Ce(Ou,{key:2,items:Q(r),"is-last":d.autoApply&&!Q(u).keepActionRow,height:Q(u).modeHeight,config:d.config,"no-overlay-focus":!!(d.noOverlayFocus||d.textInput),"focus-value":Q(a),type:"year","use-relative":"",onSelected:Q(l),onHoverValue:Q(c)},jn({_:2},[d.$slots["year-overlay-value"]?{name:"item",fn:Re(({item:f})=>[Ne(d.$slots,"year-overlay-value",{text:f.text,value:f.value})]),key:"0"}:void 0]),1032,["items","is-last","height","config","no-overlay-focus","focus-value","onSelected","onHoverValue"]))]))}}),C4={key:0,class:"dp__time_input"},T4=["data-test","aria-label","onKeydown","onClick","onMousedown"],k4=g("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1),A4=g("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1),M4=["aria-label","disabled","data-test","onKeydown","onClick"],I4=["data-test","aria-label","onKeydown","onClick","onMousedown"],P4=g("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1),R4=g("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1),D4={key:0},$4=["aria-label"],L4=cn({compatConfig:{MODE:3},__name:"TimeInput",props:{hours:{type:Number,default:0},minutes:{type:Number,default:0},seconds:{type:Number,default:0},closeTimePickerBtn:{type:Object,default:null},order:{type:Number,default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...ps},emits:["set-hours","set-minutes","update:hours","update:minutes","update:seconds","reset-flow","mounted","overlay-closed","overlay-opened","am-pm-change"],setup(t,{expose:e,emit:n}){const i=n,s=t,{setTimePickerElements:r,setTimePickerBackRef:o}=mo(),{defaultedAriaLabels:a,defaultedTransitions:l,defaultedFilters:c,defaultedConfig:u,defaultedRange:d}=Wt(s),{transitionName:h,showTransition:f}=Nu(l),p=Ns({hours:!1,minutes:!1,seconds:!1}),m=we("AM"),y=we(null),v=we([]),b=we(),E=we(!1);xn(()=>{i("mounted")});const C=S=>It(new Date,{hours:S.hours,minutes:S.minutes,seconds:s.enableSeconds?S.seconds:0,milliseconds:0}),w=be(()=>S=>W(S,s[S])||T(S,s[S])),x=be(()=>({hours:s.hours,minutes:s.minutes,seconds:s.seconds})),T=(S,O)=>d.value.enabled&&!d.value.disableTimeRangeValidation?!s.validateTime(S,O):!1,k=(S,O)=>{if(d.value.enabled&&!d.value.disableTimeRangeValidation){const K=O?+s[`${S}Increment`]:-+s[`${S}Increment`],U=s[S]+K;return!s.validateTime(S,U)}return!1},A=be(()=>S=>!Y(+s[S]+ +s[`${S}Increment`],S)||k(S,!0)),P=be(()=>S=>!Y(+s[S]-+s[`${S}Increment`],S)||k(S,!1)),F=(S,O)=>CS(It(Ee(),S),O),H=(S,O)=>kB(It(Ee(),S),O),te=be(()=>({dp__time_col:!0,dp__time_col_block:!s.timePickerInline,dp__time_col_reg_block:!s.enableSeconds&&s.is24&&!s.timePickerInline,dp__time_col_reg_inline:!s.enableSeconds&&s.is24&&s.timePickerInline,dp__time_col_reg_with_button:!s.enableSeconds&&!s.is24,dp__time_col_sec:s.enableSeconds&&s.is24,dp__time_col_sec_with_button:s.enableSeconds&&!s.is24})),N=be(()=>{const S=[{type:"hours"}];return s.enableMinutes&&S.push({type:"",separator:!0},{type:"minutes"}),s.enableSeconds&&S.push({type:"",separator:!0},{type:"seconds"}),S}),L=be(()=>N.value.filter(S=>!S.separator)),I=be(()=>S=>{if(S==="hours"){const O=oe(+s.hours);return{text:O<10?`0${O}`:`${O}`,value:O}}return{text:s[S]<10?`0${s[S]}`:`${s[S]}`,value:s[S]}}),W=(S,O)=>{var K;if(!s.disabledTimesConfig)return!1;const U=s.disabledTimesConfig(s.order,S==="hours"?O:void 0);return U[S]?!!((K=U[S])!=null&&K.includes(O)):!0},X=(S,O)=>O!=="hours"||m.value==="AM"?S:S+12,J=S=>{const O=s.is24?24:12,K=S==="hours"?O:60,U=+s[`${S}GridIncrement`],re=S==="hours"&&!s.is24?U:0,j=[];for(let se=re;se({active:!1,disabled:c.value.times[S].includes(se.value)||!Y(se.value,S)||W(S,se.value)||T(S,se.value)}))},ne=S=>S>=0?S:59,ue=S=>S>=0?S:23,Y=(S,O)=>{const K=s.minTime?C(Dg(s.minTime)):null,U=s.maxTime?C(Dg(s.maxTime)):null,re=C(Dg(x.value,O,O==="minutes"||O==="seconds"?ne(S):ue(S)));return K&&U?(ou(re,U)||Za(re,U))&&(Sl(re,K)||Za(re,K)):K?Sl(re,K)||Za(re,K):U?ou(re,U)||Za(re,U):!0},Z=S=>s[`no${S[0].toUpperCase()+S.slice(1)}Overlay`],M=S=>{Z(S)||(p[S]=!p[S],p[S]?(E.value=!0,i("overlay-opened",S)):(E.value=!1,i("overlay-closed",S)))},ie=S=>S==="hours"?pr:S==="minutes"?oo:El,le=()=>{b.value&&clearTimeout(b.value)},$=(S,O=!0,K)=>{const U=O?F:H,re=O?+s[`${S}Increment`]:-+s[`${S}Increment`];Y(+s[S]+re,S)&&i(`update:${S}`,ie(S)(U({[S]:+s[S]},{[S]:+s[`${S}Increment`]}))),!(K!=null&&K.keyboard)&&u.value.timeArrowHoldThreshold&&(b.value=setTimeout(()=>{$(S,O)},u.value.timeArrowHoldThreshold))},oe=S=>s.is24?S:(S>=12?m.value="PM":m.value="AM",DB(S)),de=()=>{m.value==="PM"?(m.value="AM",i("update:hours",s.hours-12)):(m.value="PM",i("update:hours",s.hours+12)),i("am-pm-change",m.value)},ve=S=>{p[S]=!0},z=(S,O,K)=>{if(S&&s.arrowNavigation){Array.isArray(v.value[O])?v.value[O][K]=S:v.value[O]=[S];const U=v.value.reduce((re,j)=>j.map((se,ee)=>[...re[ee]||[],j[ee]]),[]);o(s.closeTimePickerBtn),y.value&&(U[1]=U[1].concat(y.value)),r(U,s.order)}},ge=(S,O)=>(M(S),i(`update:${S}`,O));return e({openChildCmp:ve}),(S,O)=>{var K;return S.disabled?ce("",!0):(D(),V("div",C4,[(D(!0),V($e,null,Xe(N.value,(U,re)=>{var j,se,ee;return D(),V("div",{key:re,class:Me(te.value)},[U.separator?(D(),V($e,{key:0},[E.value?ce("",!0):(D(),V($e,{key:0},[Ye(":")],64))],64)):(D(),V($e,{key:1},[g("button",{ref_for:!0,ref:fe=>z(fe,re,0),type:"button",class:Me({dp__btn:!0,dp__inc_dec_button:!S.timePickerInline,dp__inc_dec_button_inline:S.timePickerInline,dp__tp_inline_btn_top:S.timePickerInline,dp__inc_dec_button_disabled:A.value(U.type),"dp--hidden-el":E.value}),"data-test":`${U.type}-time-inc-btn-${s.order}`,"aria-label":(j=Q(a))==null?void 0:j.incrementValue(U.type),tabindex:"0",onKeydown:fe=>Q(Qn)(fe,()=>$(U.type,!0,{keyboard:!0}),!0),onClick:fe=>Q(u).timeArrowHoldThreshold?void 0:$(U.type,!0),onMousedown:fe=>Q(u).timeArrowHoldThreshold?$(U.type,!0):void 0,onMouseup:le},[s.timePickerInline?(D(),V($e,{key:1},[S.$slots["tp-inline-arrow-up"]?Ne(S.$slots,"tp-inline-arrow-up",{key:0}):(D(),V($e,{key:1},[k4,A4],64))],64)):(D(),V($e,{key:0},[S.$slots["arrow-up"]?Ne(S.$slots,"arrow-up",{key:0}):ce("",!0),S.$slots["arrow-up"]?ce("",!0):(D(),Ce(Q(O_),{key:1}))],64))],42,T4),g("button",{ref_for:!0,ref:fe=>z(fe,re,1),type:"button","aria-label":`${I.value(U.type).text}-${(se=Q(a))==null?void 0:se.openTpOverlay(U.type)}`,class:Me({dp__time_display:!0,dp__time_display_block:!S.timePickerInline,dp__time_display_inline:S.timePickerInline,"dp--time-invalid":w.value(U.type),"dp--time-overlay-btn":!w.value(U.type),"dp--hidden-el":E.value}),disabled:Z(U.type),tabindex:"0","data-test":`${U.type}-toggle-overlay-btn-${s.order}`,onKeydown:fe=>Q(Qn)(fe,()=>M(U.type),!0),onClick:fe=>M(U.type)},[S.$slots[U.type]?Ne(S.$slots,U.type,{key:0,text:I.value(U.type).text,value:I.value(U.type).value}):ce("",!0),S.$slots[U.type]?ce("",!0):(D(),V($e,{key:1},[Ye(xe(I.value(U.type).text),1)],64))],42,M4),g("button",{ref_for:!0,ref:fe=>z(fe,re,2),type:"button",class:Me({dp__btn:!0,dp__inc_dec_button:!S.timePickerInline,dp__inc_dec_button_inline:S.timePickerInline,dp__tp_inline_btn_bottom:S.timePickerInline,dp__inc_dec_button_disabled:P.value(U.type),"dp--hidden-el":E.value}),"data-test":`${U.type}-time-dec-btn-${s.order}`,"aria-label":(ee=Q(a))==null?void 0:ee.decrementValue(U.type),tabindex:"0",onKeydown:fe=>Q(Qn)(fe,()=>$(U.type,!1,{keyboard:!0}),!0),onClick:fe=>Q(u).timeArrowHoldThreshold?void 0:$(U.type,!1),onMousedown:fe=>Q(u).timeArrowHoldThreshold?$(U.type,!1):void 0,onMouseup:le},[s.timePickerInline?(D(),V($e,{key:1},[S.$slots["tp-inline-arrow-down"]?Ne(S.$slots,"tp-inline-arrow-down",{key:0}):(D(),V($e,{key:1},[P4,R4],64))],64)):(D(),V($e,{key:0},[S.$slots["arrow-down"]?Ne(S.$slots,"arrow-down",{key:0}):ce("",!0),S.$slots["arrow-down"]?ce("",!0):(D(),Ce(Q(N_),{key:1}))],64))],42,I4)],64))],2)}),128)),S.is24?ce("",!0):(D(),V("div",D4,[S.$slots["am-pm-button"]?Ne(S.$slots,"am-pm-button",{key:0,toggle:de,value:m.value}):ce("",!0),S.$slots["am-pm-button"]?ce("",!0):(D(),V("button",{key:1,ref_key:"amPmButton",ref:y,type:"button",class:"dp__pm_am_button",role:"button","aria-label":(K=Q(a))==null?void 0:K.amPmButton,tabindex:"0",onClick:de,onKeydown:O[0]||(O[0]=U=>Q(Qn)(U,()=>de(),!0))},xe(m.value),41,$4))])),(D(!0),V($e,null,Xe(L.value,(U,re)=>(D(),Ce(Rt,{key:re,name:Q(h)(p[U.type]),css:Q(f)},{default:Re(()=>{var j,se;return[p[U.type]?(D(),Ce(Ou,{key:0,items:J(U.type),"is-last":S.autoApply&&!Q(u).keepActionRow,"esc-close":S.escClose,type:U.type,"text-input":S.textInput,config:S.config,"arrow-navigation":S.arrowNavigation,"aria-labels":S.ariaLabels,"overlay-label":(se=(j=Q(a)).timeOverlay)==null?void 0:se.call(j,U.type),onSelected:ee=>ge(U.type,ee),onToggle:ee=>M(U.type),onResetFlow:O[1]||(O[1]=ee=>S.$emit("reset-flow"))},jn({"button-icon":Re(()=>[S.$slots["clock-icon"]?Ne(S.$slots,"clock-icon",{key:0}):ce("",!0),S.$slots["clock-icon"]?ce("",!0):(D(),Ce(ga(S.timePickerInline?Q(Ul):Q(L_)),{key:1}))]),_:2},[S.$slots[`${U.type}-overlay-value`]?{name:"item",fn:Re(({item:ee})=>[Ne(S.$slots,`${U.type}-overlay-value`,{text:ee.text,value:ee.value})]),key:"0"}:void 0,S.$slots[`${U.type}-overlay-header`]?{name:"header",fn:Re(()=>[Ne(S.$slots,`${U.type}-overlay-header`,{toggle:()=>M(U.type)})]),key:"1"}:void 0]),1032,["items","is-last","esc-close","type","text-input","config","arrow-navigation","aria-labels","overlay-label","onSelected","onToggle"])):ce("",!0)]}),_:2},1032,["name","css"]))),128))]))}}}),O4={class:"dp--tp-wrap"},N4=["aria-label","tabindex"],F4=["role","aria-label","tabindex"],B4=["aria-label"],uC=cn({compatConfig:{MODE:3},__name:"TimePicker",props:{hours:{type:[Number,Array],default:0},minutes:{type:[Number,Array],default:0},seconds:{type:[Number,Array],default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...ps},emits:["update:hours","update:minutes","update:seconds","mount","reset-flow","overlay-opened","overlay-closed","am-pm-change"],setup(t,{expose:e,emit:n}){const i=n,s=t,{buildMatrix:r,setTimePicker:o}=mo(),a=pa(),{defaultedTransitions:l,defaultedAriaLabels:c,defaultedTextInput:u,defaultedConfig:d,defaultedRange:h}=Wt(s),{transitionName:f,showTransition:p}=Nu(l),{hideNavigationButtons:m}=bf(),y=we(null),v=we(null),b=we([]),E=we(null),C=we(!1);xn(()=>{i("mount"),!s.timePicker&&s.arrowNavigation?r([mn(y.value)],"time"):o(!0,s.timePicker)});const w=be(()=>h.value.enabled&&s.modelAuto?GS(s.internalModelValue):!0),x=we(!1),T=J=>({hours:Array.isArray(s.hours)?s.hours[J]:s.hours,minutes:Array.isArray(s.minutes)?s.minutes[J]:s.minutes,seconds:Array.isArray(s.seconds)?s.seconds[J]:s.seconds}),k=be(()=>{const J=[];if(h.value.enabled)for(let ne=0;ne<2;ne++)J.push(T(ne));else J.push(T(0));return J}),A=(J,ne=!1,ue="")=>{ne||i("reset-flow"),x.value=J,i(J?"overlay-opened":"overlay-closed",zn.time),s.arrowNavigation&&o(J),Rn(()=>{ue!==""&&b.value[0]&&b.value[0].openChildCmp(ue)})},P=be(()=>({dp__btn:!0,dp__button:!0,dp__button_bottom:s.autoApply&&!d.value.keepActionRow})),F=ki(a,"timePicker"),H=(J,ne,ue)=>h.value.enabled?ne===0?[J,k.value[1][ue]]:[k.value[0][ue],J]:J,te=J=>{i("update:hours",J)},N=J=>{i("update:minutes",J)},L=J=>{i("update:seconds",J)},I=()=>{if(E.value&&!u.value.enabled&&!s.noOverlayFocus){const J=XS(E.value);J&&J.focus({preventScroll:!0})}},W=J=>{C.value=!1,i("overlay-closed",J)},X=J=>{C.value=!0,i("overlay-opened",J)};return e({toggleTimePicker:A}),(J,ne)=>{var ue;return D(),V("div",O4,[!J.timePicker&&!J.timePickerInline?Oe((D(),V("button",{key:0,ref_key:"openTimePickerBtn",ref:y,type:"button",class:Me({...P.value,"dp--hidden-el":x.value}),"aria-label":(ue=Q(c))==null?void 0:ue.openTimePicker,tabindex:J.noOverlayFocus?void 0:0,"data-test":"open-time-picker-btn",onKeydown:ne[0]||(ne[0]=Y=>Q(Qn)(Y,()=>A(!0))),onClick:ne[1]||(ne[1]=Y=>A(!0))},[J.$slots["clock-icon"]?Ne(J.$slots,"clock-icon",{key:0}):ce("",!0),J.$slots["clock-icon"]?ce("",!0):(D(),Ce(Q(L_),{key:1}))],42,N4)),[[th,!Q(m)(J.hideNavigation,"time")]]):ce("",!0),B(Rt,{name:Q(f)(x.value),css:Q(p)&&!J.timePickerInline},{default:Re(()=>{var Y,Z;return[x.value||J.timePicker||J.timePickerInline?(D(),V("div",{key:0,ref_key:"overlayRef",ref:E,role:J.timePickerInline?void 0:"dialog",class:Me({dp__overlay:!J.timePickerInline,"dp--overlay-absolute":!s.timePicker&&!J.timePickerInline,"dp--overlay-relative":s.timePicker}),style:Mn(J.timePicker?{height:`${Q(d).modeHeight}px`}:void 0),"aria-label":(Y=Q(c))==null?void 0:Y.timePicker,tabindex:J.timePickerInline?void 0:0},[g("div",{class:Me(J.timePickerInline?"dp__time_picker_inline_container":"dp__overlay_container dp__container_flex dp__time_picker_overlay_container"),style:{display:"flex"}},[J.$slots["time-picker-overlay"]?Ne(J.$slots,"time-picker-overlay",{key:0,hours:t.hours,minutes:t.minutes,seconds:t.seconds,setHours:te,setMinutes:N,setSeconds:L}):ce("",!0),J.$slots["time-picker-overlay"]?ce("",!0):(D(),V("div",{key:1,class:Me(J.timePickerInline?"dp__flex":"dp__overlay_row dp__flex_row")},[(D(!0),V($e,null,Xe(k.value,(M,ie)=>Oe((D(),Ce(L4,yn({key:ie,ref_for:!0},{...J.$props,order:ie,hours:M.hours,minutes:M.minutes,seconds:M.seconds,closeTimePickerBtn:v.value,disabledTimesConfig:t.disabledTimesConfig,disabled:ie===0?Q(h).fixedStart:Q(h).fixedEnd},{ref_for:!0,ref_key:"timeInputRefs",ref:b,"validate-time":(le,$)=>t.validateTime(le,H($,ie,le)),"onUpdate:hours":le=>te(H(le,ie,"hours")),"onUpdate:minutes":le=>N(H(le,ie,"minutes")),"onUpdate:seconds":le=>L(H(le,ie,"seconds")),onMounted:I,onOverlayClosed:W,onOverlayOpened:X,onAmPmChange:ne[2]||(ne[2]=le=>J.$emit("am-pm-change",le))}),jn({_:2},[Xe(Q(F),(le,$)=>({name:le,fn:Re(oe=>[Ne(J.$slots,le,yn({ref_for:!0},oe))])}))]),1040,["validate-time","onUpdate:hours","onUpdate:minutes","onUpdate:seconds"])),[[th,ie===0?!0:w.value]])),128))],2)),!J.timePicker&&!J.timePickerInline?Oe((D(),V("button",{key:2,ref_key:"closeTimePickerBtn",ref:v,type:"button",class:Me({...P.value,"dp--hidden-el":C.value}),"aria-label":(Z=Q(c))==null?void 0:Z.closeTimePicker,tabindex:"0",onKeydown:ne[3]||(ne[3]=M=>Q(Qn)(M,()=>A(!1))),onClick:ne[4]||(ne[4]=M=>A(!1))},[J.$slots["calendar-icon"]?Ne(J.$slots,"calendar-icon",{key:0}):ce("",!0),J.$slots["calendar-icon"]?ce("",!0):(D(),Ce(Q(Ul),{key:1}))],42,B4)),[[th,!Q(m)(J.hideNavigation,"time")]]):ce("",!0)],2)],14,F4)):ce("",!0)]}),_:3},8,["name","css"])])}}}),dC=(t,e,n,i)=>{const{defaultedRange:s}=Wt(t),r=(E,C)=>Array.isArray(e[E])?e[E][C]:e[E],o=E=>t.enableSeconds?Array.isArray(e.seconds)?e.seconds[E]:e.seconds:0,a=(E,C)=>E?C!==void 0?eo(E,r("hours",C),r("minutes",C),o(C)):eo(E,e.hours,e.minutes,o()):YS(Ee(),o(C)),l=(E,C)=>{e[E]=C},c=be(()=>t.modelAuto&&s.value.enabled?Array.isArray(n.value)?n.value.length>1:!1:s.value.enabled),u=(E,C)=>{const w=Object.fromEntries(Object.keys(e).map(x=>x===E?[x,C]:[x,e[x]].slice()));if(c.value&&!s.value.disableTimeRangeValidation){const x=k=>n.value?eo(n.value[k],w.hours[k],w.minutes[k],w.seconds[k]):null,T=k=>HS(n.value[k],0);return!(ct(x(0),x(1))&&(Sl(x(0),T(1))||ou(x(1),T(0))))}return!0},d=(E,C)=>{u(E,C)&&(l(E,C),i&&i())},h=E=>{d("hours",E)},f=E=>{d("minutes",E)},p=E=>{d("seconds",E)},m=(E,C,w,x)=>{C&&h(E),!C&&!w&&f(E),w&&p(E),n.value&&x(n.value)},y=E=>{if(E){const C=Array.isArray(E),w=C?[+E[0].hours,+E[1].hours]:+E.hours,x=C?[+E[0].minutes,+E[1].minutes]:+E.minutes,T=C?[+E[0].seconds,+E[1].seconds]:+E.seconds;l("hours",w),l("minutes",x),t.enableSeconds&&l("seconds",T)}},v=(E,C)=>{const w={hours:Array.isArray(e.hours)?e.hours[E]:e.hours,disabledArr:[]};return(C||C===0)&&(w.hours=C),Array.isArray(t.disabledTimes)&&(w.disabledArr=s.value.enabled&&Array.isArray(t.disabledTimes[E])?t.disabledTimes[E]:t.disabledTimes),w},b=be(()=>(E,C)=>{var w;if(Array.isArray(t.disabledTimes)){const{disabledArr:x,hours:T}=v(E,C),k=x.filter(A=>+A.hours===T);return((w=k[0])==null?void 0:w.minutes)==="*"?{hours:[T],minutes:void 0,seconds:void 0}:{hours:[],minutes:k?.map(A=>+A.minutes)??[],seconds:k?.map(A=>A.seconds?+A.seconds:void 0)??[]}}return{hours:[],minutes:[],seconds:[]}});return{setTime:l,updateHours:h,updateMinutes:f,updateSeconds:p,getSetDateTime:a,updateTimeValues:m,getSecondsValue:o,assignStartTime:y,validateTime:u,disabledTimesConfig:b}},V4=(t,e)=>{const n=()=>{t.isTextInputDate&&C()},{modelValue:i,time:s}=Fu(t,e,n),{defaultedStartTime:r,defaultedRange:o,defaultedTz:a}=Wt(t),{updateTimeValues:l,getSetDateTime:c,setTime:u,assignStartTime:d,disabledTimesConfig:h,validateTime:f}=dC(t,s,i,p);function p(){e("update-flow-step")}const m=x=>{const{hours:T,minutes:k,seconds:A}=x;return{hours:+T,minutes:+k,seconds:A?+A:0}},y=()=>{if(t.startTime){if(Array.isArray(t.startTime)){const T=m(t.startTime[0]),k=m(t.startTime[1]);return[It(Ee(),T),It(Ee(),k)]}const x=m(t.startTime);return It(Ee(),x)}return o.value.enabled?[null,null]:null},v=()=>{if(o.value.enabled){const[x,T]=y();i.value=[_i(c(x,0),a.value.timezone),_i(c(T,1),a.value.timezone)]}else i.value=_i(c(y()),a.value.timezone)},b=x=>Array.isArray(x)?[na(Ee(x[0])),na(Ee(x[1]))]:[na(x??Ee())],E=(x,T,k)=>{u("hours",x),u("minutes",T),u("seconds",t.enableSeconds?k:0)},C=()=>{const[x,T]=b(i.value);return o.value.enabled?E([x.hours,T.hours],[x.minutes,T.minutes],[x.seconds,T.seconds]):E(x.hours,x.minutes,x.seconds)};xn(()=>{if(!t.shadow)return d(r.value),i.value?C():v()});const w=()=>{Array.isArray(i.value)?i.value=i.value.map((x,T)=>x&&c(x,T)):i.value=c(i.value),e("time-update")};return{modelValue:i,time:s,disabledTimesConfig:h,updateTime:(x,T=!0,k=!1)=>{l(x,T,k,w)},validateTime:f}},z4=cn({compatConfig:{MODE:3},__name:"TimePickerSolo",props:{...ps},emits:["update:internal-model-value","time-update","am-pm-change","mount","reset-flow","update-flow-step","overlay-toggle"],setup(t,{expose:e,emit:n}){const i=n,s=t,r=pa(),o=ki(r,"timePicker"),a=we(null),{time:l,modelValue:c,disabledTimesConfig:u,updateTime:d,validateTime:h}=V4(s,i);return xn(()=>{s.shadow||i("mount",null)}),e({getSidebarProps:()=>({modelValue:c,time:l,updateTime:d}),toggleTimePicker:(f,p=!1,m="")=>{var y;(y=a.value)==null||y.toggleTimePicker(f,p,m)}}),(f,p)=>(D(),Ce(yf,{"multi-calendars":0,stretch:""},{default:Re(()=>[B(uC,yn({ref_key:"tpRef",ref:a},f.$props,{hours:Q(l).hours,minutes:Q(l).minutes,seconds:Q(l).seconds,"internal-model-value":f.internalModelValue,"disabled-times-config":Q(u),"validate-time":Q(h),"onUpdate:hours":p[0]||(p[0]=m=>Q(d)(m)),"onUpdate:minutes":p[1]||(p[1]=m=>Q(d)(m,!1)),"onUpdate:seconds":p[2]||(p[2]=m=>Q(d)(m,!1,!0)),onAmPmChange:p[3]||(p[3]=m=>f.$emit("am-pm-change",m)),onResetFlow:p[4]||(p[4]=m=>f.$emit("reset-flow")),onOverlayClosed:p[5]||(p[5]=m=>f.$emit("overlay-toggle",{open:!1,overlay:m})),onOverlayOpened:p[6]||(p[6]=m=>f.$emit("overlay-toggle",{open:!0,overlay:m}))}),jn({_:2},[Xe(Q(o),(m,y)=>({name:m,fn:Re(v=>[Ne(f.$slots,m,In(Zn(v)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"])]),_:3}))}}),W4={class:"dp--header-wrap"},H4={key:0,class:"dp__month_year_wrap"},Y4={key:0},j4={class:"dp__month_year_wrap"},K4=["data-dp-element","aria-label","data-test","onClick","onKeydown"],U4=cn({compatConfig:{MODE:3},__name:"DpHeader",props:{month:{type:Number,default:0},year:{type:Number,default:0},instance:{type:Number,default:0},years:{type:Array,default:()=>[]},months:{type:Array,default:()=>[]},...ps},emits:["update-month-year","mount","reset-flow","overlay-closed","overlay-opened"],setup(t,{expose:e,emit:n}){const i=n,s=t,{defaultedTransitions:r,defaultedAriaLabels:o,defaultedMultiCalendars:a,defaultedFilters:l,defaultedConfig:c,defaultedHighlight:u,propDates:d,defaultedUI:h}=Wt(s),{transitionName:f,showTransition:p}=Nu(r),{buildMatrix:m}=mo(),{handleMonthYearChange:y,isDisabled:v,updateMonthYear:b}=d4(s,i),{showLeftIcon:E,showRightIcon:C}=bf(),w=we(!1),x=we(!1),T=we(!1),k=we([null,null,null,null]);xn(()=>{i("mount")});const A=Z=>({get:()=>s[Z],set:M=>{const ie=Z===es.month?es.year:es.month;i("update-month-year",{[Z]:M,[ie]:s[ie]}),Z===es.month?W(!0):X(!0)}}),P=be(A(es.month)),F=be(A(es.year)),H=be(()=>Z=>({month:s.month,year:s.year,items:Z===es.month?s.months:s.years,instance:s.instance,updateMonthYear:b,toggle:Z===es.month?W:X})),te=be(()=>s.months.find(M=>M.value===s.month)||{text:"",value:0}),N=be(()=>Tl(s.months,Z=>{const M=s.month===Z.value,ie=au(Z.value,ZS(s.year,d.value.minDate),JS(s.year,d.value.maxDate))||l.value.months.includes(Z.value),le=iC(u.value,Z.value,s.year);return{active:M,disabled:ie,highlighted:le}})),L=be(()=>Tl(s.years,Z=>{const M=s.year===Z.value,ie=au(Z.value,kl(d.value.minDate),kl(d.value.maxDate))||l.value.years.includes(Z.value),le=W_(u.value,Z.value);return{active:M,disabled:ie,highlighted:le}})),I=(Z,M,ie)=>{ie!==void 0?Z.value=ie:Z.value=!Z.value,Z.value?(T.value=!0,i("overlay-opened",M)):(T.value=!1,i("overlay-closed",M))},W=(Z=!1,M)=>{J(Z),I(w,zn.month,M)},X=(Z=!1,M)=>{J(Z),I(x,zn.year,M)},J=Z=>{Z||i("reset-flow")},ne=(Z,M)=>{s.arrowNavigation&&(k.value[M]=mn(Z),m(k.value,"monthYear"))},ue=be(()=>{var Z,M,ie,le,$,oe;return[{type:es.month,index:1,toggle:W,modelValue:P.value,updateModelValue:de=>P.value=de,text:te.value.text,showSelectionGrid:w.value,items:N.value,ariaLabel:(Z=o.value)==null?void 0:Z.openMonthsOverlay,overlayLabel:((ie=(M=o.value).monthPicker)==null?void 0:ie.call(M,!0))??void 0},{type:es.year,index:2,toggle:X,modelValue:F.value,updateModelValue:de=>F.value=de,text:qS(s.year,s.locale),showSelectionGrid:x.value,items:L.value,ariaLabel:(le=o.value)==null?void 0:le.openYearsOverlay,overlayLabel:((oe=($=o.value).yearPicker)==null?void 0:oe.call($,!0))??void 0}]}),Y=be(()=>s.disableYearSelect?[ue.value[0]]:s.yearFirst?[...ue.value].reverse():ue.value);return e({toggleMonthPicker:W,toggleYearPicker:X,handleMonthYearChange:y}),(Z,M)=>{var ie,le,$,oe,de,ve;return D(),V("div",W4,[Z.$slots["month-year"]?(D(),V("div",H4,[Ne(Z.$slots,"month-year",In(Zn({month:t.month,year:t.year,months:t.months,years:t.years,updateMonthYear:Q(b),handleMonthYearChange:Q(y),instance:t.instance})))])):(D(),V($e,{key:1},[Z.$slots["top-extra"]?(D(),V("div",Y4,[Ne(Z.$slots,"top-extra",{value:Z.internalModelValue})])):ce("",!0),g("div",j4,[Q(E)(Q(a),t.instance)&&!Z.vertical?(D(),Ce(Wc,{key:0,"aria-label":(ie=Q(o))==null?void 0:ie.prevMonth,disabled:Q(v)(!1),class:Me((le=Q(h))==null?void 0:le.navBtnPrev),"el-name":"action-prev",onActivate:M[0]||(M[0]=z=>Q(y)(!1,!0)),onSetRef:M[1]||(M[1]=z=>ne(z,0))},{default:Re(()=>[Z.$slots["arrow-left"]?Ne(Z.$slots,"arrow-left",{key:0}):ce("",!0),Z.$slots["arrow-left"]?ce("",!0):(D(),Ce(Q(D_),{key:1}))]),_:3},8,["aria-label","disabled","class"])):ce("",!0),g("div",{class:Me(["dp__month_year_wrap",{dp__year_disable_select:Z.disableYearSelect}])},[(D(!0),V($e,null,Xe(Y.value,(z,ge)=>(D(),V($e,{key:z.type},[g("button",{ref_for:!0,ref:S=>ne(S,ge+1),type:"button","data-dp-element":`overlay-${z.type}`,class:Me(["dp__btn dp__month_year_select",{"dp--hidden-el":T.value}]),"aria-label":`${z.text}-${z.ariaLabel}`,"data-test":`${z.type}-toggle-overlay-${t.instance}`,onClick:z.toggle,onKeydown:S=>Q(Qn)(S,()=>z.toggle(),!0)},[Z.$slots[z.type]?Ne(Z.$slots,z.type,{key:0,text:z.text,value:s[z.type]}):ce("",!0),Z.$slots[z.type]?ce("",!0):(D(),V($e,{key:1},[Ye(xe(z.text),1)],64))],42,K4),B(Rt,{name:Q(f)(z.showSelectionGrid),css:Q(p)},{default:Re(()=>[z.showSelectionGrid?(D(),Ce(Ou,{key:0,items:z.items,"arrow-navigation":Z.arrowNavigation,"hide-navigation":Z.hideNavigation,"is-last":Z.autoApply&&!Q(c).keepActionRow,"skip-button-ref":!1,config:Z.config,type:z.type,"header-refs":[],"esc-close":Z.escClose,"menu-wrap-ref":Z.menuWrapRef,"text-input":Z.textInput,"aria-labels":Z.ariaLabels,"overlay-label":z.overlayLabel,onSelected:z.updateModelValue,onToggle:z.toggle},jn({"button-icon":Re(()=>[Z.$slots["calendar-icon"]?Ne(Z.$slots,"calendar-icon",{key:0}):ce("",!0),Z.$slots["calendar-icon"]?ce("",!0):(D(),Ce(Q(Ul),{key:1}))]),_:2},[Z.$slots[`${z.type}-overlay-value`]?{name:"item",fn:Re(({item:S})=>[Ne(Z.$slots,`${z.type}-overlay-value`,{text:S.text,value:S.value})]),key:"0"}:void 0,Z.$slots[`${z.type}-overlay`]?{name:"overlay",fn:Re(()=>[Ne(Z.$slots,`${z.type}-overlay`,yn({ref_for:!0},H.value(z.type)))]),key:"1"}:void 0,Z.$slots[`${z.type}-overlay-header`]?{name:"header",fn:Re(()=>[Ne(Z.$slots,`${z.type}-overlay-header`,{toggle:z.toggle})]),key:"2"}:void 0]),1032,["items","arrow-navigation","hide-navigation","is-last","config","type","esc-close","menu-wrap-ref","text-input","aria-labels","overlay-label","onSelected","onToggle"])):ce("",!0)]),_:2},1032,["name","css"])],64))),128))],2),Q(E)(Q(a),t.instance)&&Z.vertical?(D(),Ce(Wc,{key:1,"aria-label":($=Q(o))==null?void 0:$.prevMonth,"el-name":"action-prev",disabled:Q(v)(!1),class:Me((oe=Q(h))==null?void 0:oe.navBtnPrev),onActivate:M[2]||(M[2]=z=>Q(y)(!1,!0))},{default:Re(()=>[Z.$slots["arrow-up"]?Ne(Z.$slots,"arrow-up",{key:0}):ce("",!0),Z.$slots["arrow-up"]?ce("",!0):(D(),Ce(Q(O_),{key:1}))]),_:3},8,["aria-label","disabled","class"])):ce("",!0),Q(C)(Q(a),t.instance)?(D(),Ce(Wc,{key:2,ref:"rightIcon","el-name":"action-next",disabled:Q(v)(!0),"aria-label":(de=Q(o))==null?void 0:de.nextMonth,class:Me((ve=Q(h))==null?void 0:ve.navBtnNext),onActivate:M[3]||(M[3]=z=>Q(y)(!0,!0)),onSetRef:M[4]||(M[4]=z=>ne(z,Z.disableYearSelect?2:3))},{default:Re(()=>[Z.$slots[Z.vertical?"arrow-down":"arrow-right"]?Ne(Z.$slots,Z.vertical?"arrow-down":"arrow-right",{key:0}):ce("",!0),Z.$slots[Z.vertical?"arrow-down":"arrow-right"]?ce("",!0):(D(),Ce(ga(Z.vertical?Q(N_):Q($_)),{key:1}))]),_:3},8,["disabled","aria-label","class"])):ce("",!0)])],64))])}}}),G4={class:"dp__calendar_header",role:"row"},X4={key:0,class:"dp__calendar_header_item",role:"gridcell"},q4=["aria-label"],Z4=g("div",{class:"dp__calendar_header_separator"},null,-1),J4={key:0,class:"dp__calendar_item dp__week_num",role:"gridcell"},Q4={class:"dp__cell_inner"},eV=["id","aria-pressed","aria-disabled","aria-label","data-test","onClick","onTouchend","onKeydown","onMouseenter","onMouseleave","onMousedown"],tV=cn({compatConfig:{MODE:3},__name:"DpCalendar",props:{mappedDates:{type:Array,default:()=>[]},instance:{type:Number,default:0},month:{type:Number,default:0},year:{type:Number,default:0},...ps},emits:["select-date","set-hover-date","handle-scroll","mount","handle-swipe","handle-space","tooltip-open","tooltip-close"],setup(t,{expose:e,emit:n}){const i=n,s=t,{buildMultiLevelMatrix:r}=mo(),{defaultedTransitions:o,defaultedConfig:a,defaultedAriaLabels:l,defaultedMultiCalendars:c,defaultedWeekNumbers:u,defaultedMultiDates:d,defaultedUI:h}=Wt(s),f=we(null),p=we({bottom:"",left:"",transform:""}),m=we([]),y=we(null),v=we(!0),b=we(""),E=we({startX:0,endX:0,startY:0,endY:0}),C=we([]),w=we({left:"50%"}),x=we(!1),T=be(()=>s.calendar?s.calendar(s.mappedDates):s.mappedDates),k=be(()=>s.dayNames?Array.isArray(s.dayNames)?s.dayNames:s.dayNames(s.locale,+s.weekStart):RB(s.formatLocale,s.locale,+s.weekStart));xn(()=>{i("mount",{cmp:"calendar",refs:m}),a.value.noSwipe||y.value&&(y.value.addEventListener("touchstart",ne,{passive:!1}),y.value.addEventListener("touchend",ue,{passive:!1}),y.value.addEventListener("touchmove",Y,{passive:!1})),s.monthChangeOnScroll&&y.value&&y.value.addEventListener("wheel",ie,{passive:!1})});const A=z=>z?s.vertical?"vNext":"next":s.vertical?"vPrevious":"previous",P=(z,ge)=>{if(s.transitions){const S=ni(sr(Ee(),s.month,s.year));b.value=nn(ni(sr(Ee(),z,ge)),S)?o.value[A(!0)]:o.value[A(!1)],v.value=!1,Rn(()=>{v.value=!0})}},F=be(()=>({...h.value.calendar??{}})),H=be(()=>z=>{const ge=$B(z);return{dp__marker_dot:ge.type==="dot",dp__marker_line:ge.type==="line"}}),te=be(()=>z=>ct(z,f.value)),N=be(()=>({dp__calendar:!0,dp__calendar_next:c.value.count>0&&s.instance!==0})),L=be(()=>z=>s.hideOffsetDates?z.current:!0),I=async(z,ge)=>{const{width:S,height:O}=z.getBoundingClientRect();f.value=ge.value;let K={left:`${S/2}px`},U=-50;if(await Rn(),C.value[0]){const{left:re,width:j}=C.value[0].getBoundingClientRect();re<0&&(K={left:"0"},U=0,w.value.left=`${S/2}px`),window.innerWidth{var O,K,U;const re=mn(m.value[ge][S]);re&&((O=z.marker)!=null&&O.customPosition&&(U=(K=z.marker)==null?void 0:K.tooltip)!=null&&U.length?p.value=z.marker.customPosition(re):await I(re,z),i("tooltip-open",z.marker))},X=async(z,ge,S)=>{var O,K;if(x.value&&d.value.enabled&&d.value.dragSelect)return i("select-date",z);i("set-hover-date",z),(K=(O=z.marker)==null?void 0:O.tooltip)!=null&&K.length&&await W(z,ge,S)},J=z=>{f.value&&(f.value=null,p.value=JSON.parse(JSON.stringify({bottom:"",left:"",transform:""})),i("tooltip-close",z.marker))},ne=z=>{E.value.startX=z.changedTouches[0].screenX,E.value.startY=z.changedTouches[0].screenY},ue=z=>{E.value.endX=z.changedTouches[0].screenX,E.value.endY=z.changedTouches[0].screenY,Z()},Y=z=>{s.vertical&&!s.inline&&z.preventDefault()},Z=()=>{const z=s.vertical?"Y":"X";Math.abs(E.value[`start${z}`]-E.value[`end${z}`])>10&&i("handle-swipe",E.value[`start${z}`]>E.value[`end${z}`]?"right":"left")},M=(z,ge,S)=>{z&&(Array.isArray(m.value[ge])?m.value[ge][S]=z:m.value[ge]=[z]),s.arrowNavigation&&r(m.value,"calendar")},ie=z=>{s.monthChangeOnScroll&&(z.preventDefault(),i("handle-scroll",z))},le=z=>u.value.type==="local"?I_(z.value,{weekStartsOn:+s.weekStart}):u.value.type==="iso"?A_(z.value):typeof u.value.type=="function"?u.value.type(z.value):"",$=z=>{const ge=z[0];return u.value.hideOnOffsetDates?z.some(S=>S.current)?le(ge):"":le(ge)},oe=(z,ge,S=!0)=>{S&&BB()||d.value.enabled||(Qr(z,a.value),i("select-date",ge))},de=z=>{Qr(z,a.value)},ve=z=>{d.value.enabled&&d.value.dragSelect?(x.value=!0,i("select-date",z)):d.value.enabled&&i("select-date",z)};return e({triggerTransition:P}),(z,ge)=>(D(),V("div",{class:Me(N.value)},[g("div",{ref_key:"calendarWrapRef",ref:y,class:Me(F.value),role:"grid"},[g("div",G4,[z.weekNumbers?(D(),V("div",X4,xe(z.weekNumName),1)):ce("",!0),(D(!0),V($e,null,Xe(k.value,(S,O)=>{var K,U;return D(),V("div",{key:O,class:"dp__calendar_header_item",role:"gridcell","data-test":"calendar-header","aria-label":(U=(K=Q(l))==null?void 0:K.weekDay)==null?void 0:U.call(K,O)},[z.$slots["calendar-header"]?Ne(z.$slots,"calendar-header",{key:0,day:S,index:O}):ce("",!0),z.$slots["calendar-header"]?ce("",!0):(D(),V($e,{key:1},[Ye(xe(S),1)],64))],8,q4)}),128))]),Z4,B(Rt,{name:b.value,css:!!z.transitions},{default:Re(()=>[v.value?(D(),V("div",{key:0,class:"dp__calendar",role:"rowgroup",onMouseleave:ge[1]||(ge[1]=S=>x.value=!1)},[(D(!0),V($e,null,Xe(T.value,(S,O)=>(D(),V("div",{key:O,class:"dp__calendar_row",role:"row"},[z.weekNumbers?(D(),V("div",J4,[g("div",Q4,xe($(S.days)),1)])):ce("",!0),(D(!0),V($e,null,Xe(S.days,(K,U)=>{var re,j,se;return D(),V("div",{id:Q(sC)(K.value),ref_for:!0,ref:ee=>M(ee,O,U),key:U+O,role:"gridcell",class:"dp__calendar_item","aria-pressed":(K.classData.dp__active_date||K.classData.dp__range_start||K.classData.dp__range_start)??void 0,"aria-disabled":K.classData.dp__cell_disabled||void 0,"aria-label":(j=(re=Q(l))==null?void 0:re.day)==null?void 0:j.call(re,K),tabindex:"0","data-test":K.value,onClick:iu(ee=>oe(ee,K),["prevent"]),onTouchend:ee=>oe(ee,K,!1),onKeydown:ee=>Q(Qn)(ee,()=>z.$emit("select-date",K)),onMouseenter:ee=>X(K,O,U),onMouseleave:ee=>J(K),onMousedown:ee=>ve(K),onMouseup:ge[0]||(ge[0]=ee=>x.value=!1)},[g("div",{class:Me(["dp__cell_inner",K.classData])},[z.$slots.day&&L.value(K)?Ne(z.$slots,"day",{key:0,day:+K.text,date:K.value}):ce("",!0),z.$slots.day?ce("",!0):(D(),V($e,{key:1},[Ye(xe(K.text),1)],64)),K.marker&&L.value(K)?(D(),V($e,{key:2},[z.$slots.marker?Ne(z.$slots,"marker",{key:0,marker:K.marker,day:+K.text,date:K.value}):(D(),V("div",{key:1,class:Me(H.value(K.marker)),style:Mn(K.marker.color?{backgroundColor:K.marker.color}:{})},null,6))],64)):ce("",!0),te.value(K.value)?(D(),V("div",{key:3,ref_for:!0,ref_key:"activeTooltip",ref:C,class:"dp__marker_tooltip",style:Mn(p.value)},[(se=K.marker)!=null&&se.tooltip?(D(),V("div",{key:0,class:"dp__tooltip_content",onClick:de},[(D(!0),V($e,null,Xe(K.marker.tooltip,(ee,fe)=>(D(),V("div",{key:fe,class:"dp__tooltip_text"},[z.$slots["marker-tooltip"]?Ne(z.$slots,"marker-tooltip",{key:0,tooltip:ee,day:K.value}):ce("",!0),z.$slots["marker-tooltip"]?ce("",!0):(D(),V($e,{key:1},[g("div",{class:"dp__tooltip_mark",style:Mn(ee.color?{backgroundColor:ee.color}:{})},null,4),g("div",null,xe(ee.text),1)],64))]))),128)),g("div",{class:"dp__arrow_bottom_tp",style:Mn(w.value)},null,4)])):ce("",!0)],4)):ce("",!0)],2)],40,eV)}),128))]))),128))],32)):ce("",!0)]),_:3},8,["name","css"])],2)],2))}}),Ab=t=>Array.isArray(t),nV=(t,e,n,i)=>{const s=we([]),r=we(new Date),o=we(),a=()=>ne(t.isTextInputDate),{modelValue:l,calendars:c,time:u,today:d}=Fu(t,e,a),{defaultedMultiCalendars:h,defaultedStartTime:f,defaultedRange:p,defaultedConfig:m,defaultedTz:y,propDates:v,defaultedMultiDates:b}=Wt(t),{validateMonthYearInRange:E,isDisabled:C,isDateRangeAllowed:w,checkMinMaxRange:x}=_o(t),{updateTimeValues:T,getSetDateTime:k,setTime:A,assignStartTime:P,validateTime:F,disabledTimesConfig:H}=dC(t,u,l,i),te=be(()=>ae=>c.value[ae]?c.value[ae].month:0),N=be(()=>ae=>c.value[ae]?c.value[ae].year:0),L=ae=>!m.value.keepViewOnOffsetClick||ae?!0:!o.value,I=(ae,Te,he,ke=!1)=>{var De,Ht;L(ke)&&(c.value[ae]||(c.value[ae]={month:0,year:0}),c.value[ae].month=Eb(Te)?(De=c.value[ae])==null?void 0:De.month:Te,c.value[ae].year=Eb(he)?(Ht=c.value[ae])==null?void 0:Ht.year:he)},W=()=>{t.autoApply&&e("select-date")};xn(()=>{t.shadow||(l.value||(z(),f.value&&P(f.value)),ne(!0),t.focusStartDate&&t.startDate&&z())});const X=be(()=>{var ae;return(ae=t.flow)!=null&&ae.length&&!t.partialFlow?t.flowStep===t.flow.length:!0}),J=()=>{t.autoApply&&X.value&&e("auto-apply",t.partialFlow?t.flowStep!==t.flow.length:!1)},ne=(ae=!1)=>{if(l.value)return Array.isArray(l.value)?(s.value=l.value,$(ae)):Z(l.value,ae);if(h.value.count&&ae&&!t.startDate)return Y(Ee(),ae)},ue=()=>Array.isArray(l.value)&&p.value.enabled?at(l.value[0])===at(l.value[1]??l.value[0]):!1,Y=(ae=new Date,Te=!1)=>{if((!h.value.count||!h.value.static||Te)&&I(0,at(ae),Ge(ae)),h.value.count&&(!h.value.solo||!l.value||ue()))for(let he=1;he{Y(ae),A("hours",pr(ae)),A("minutes",oo(ae)),A("seconds",El(ae)),h.value.count&&Te&&ve()},M=ae=>{if(h.value.count){if(h.value.solo)return 0;const Te=at(ae[0]),he=at(ae[1]);return Math.abs(he-Te){ae[1]&&p.value.showLastInRange?Y(ae[M(ae)],Te):Y(ae[0],Te);const he=(ke,De)=>[ke(ae[0]),ae[1]?ke(ae[1]):u[De][1]];A("hours",he(pr,"hours")),A("minutes",he(oo,"minutes")),A("seconds",he(El,"seconds"))},le=(ae,Te)=>{if((p.value.enabled||t.weekPicker)&&!b.value.enabled)return ie(ae,Te);if(b.value.enabled&&Te){const he=ae[ae.length-1];return Z(he,Te)}},$=ae=>{const Te=l.value;le(Te,ae),h.value.count&&h.value.solo&&ve()},oe=(ae,Te)=>{const he=It(Ee(),{month:te.value(Te),year:N.value(Te)}),ke=ae<0?us(he,1):Cl(he,1);E(at(ke),Ge(ke),ae<0,t.preventMinMaxNavigation)&&(I(Te,at(ke),Ge(ke)),e("update-month-year",{instance:Te,month:at(ke),year:Ge(ke)}),h.value.count&&!h.value.solo&&de(Te),n())},de=ae=>{for(let Te=ae-1;Te>=0;Te--){const he=Cl(It(Ee(),{month:te.value(Te+1),year:N.value(Te+1)}),1);I(Te,at(he),Ge(he))}for(let Te=ae+1;Te<=h.value.count-1;Te++){const he=us(It(Ee(),{month:te.value(Te-1),year:N.value(Te-1)}),1);I(Te,at(he),Ge(he))}},ve=()=>{if(Array.isArray(l.value)&&l.value.length===2){const ae=Ee(Ee(l.value[1]?l.value[1]:us(l.value[0],1))),[Te,he]=[at(l.value[0]),Ge(l.value[0])],[ke,De]=[at(l.value[1]),Ge(l.value[1])];(Te!==ke||Te===ke&&he!==De)&&h.value.solo&&I(1,at(ae),Ge(ae))}else l.value&&!Array.isArray(l.value)&&(I(0,at(l.value),Ge(l.value)),Y(Ee()))},z=()=>{t.startDate&&(I(0,at(Ee(t.startDate)),Ge(Ee(t.startDate))),h.value.count&&de(0))},ge=(ae,Te)=>{if(t.monthChangeOnScroll){const he=new Date().getTime()-r.value.getTime(),ke=Math.abs(ae.deltaY);let De=500;ke>1&&(De=100),ke>100&&(De=0),he>De&&(r.value=new Date,oe(t.monthChangeOnScroll!=="inverse"?-ae.deltaY:ae.deltaY,Te))}},S=(ae,Te,he=!1)=>{t.monthChangeOnArrows&&t.vertical===he&&O(ae,Te)},O=(ae,Te)=>{oe(ae==="right"?-1:1,Te)},K=ae=>{if(v.value.markers)return bh(ae.value,v.value.markers)},U=(ae,Te)=>{switch(t.sixWeeks===!0?"append":t.sixWeeks){case"prepend":return[!0,!1];case"center":return[ae==0,!0];case"fair":return[ae==0||Te>ae,!0];case"append":return[!1,!1];default:return[!1,!1]}},re=(ae,Te,he,ke)=>{if(t.sixWeeks&&ae.length<6){const De=6-ae.length,Ht=(Te.getDay()+7-ke)%7,un=6-(he.getDay()+7-ke)%7,[Di,zs]=U(Ht,un);for(let dn=1;dn<=De;dn++)if(zs?!!(dn%2)==Di:Di){const En=ae[0].days[0],Sn=j(ss(En.value,-7),at(Te));ae.unshift({days:Sn})}else{const En=ae[ae.length-1],Sn=En.days[En.days.length-1],ii=j(ss(Sn.value,1),at(Te));ae.push({days:ii})}}return ae},j=(ae,Te)=>{const he=Ee(ae),ke=[];for(let De=0;De<7;De++){const Ht=ss(he,De),un=at(Ht)!==Te;ke.push({text:t.hideOffsetDates&&un?"":Ht.getDate(),value:Ht,current:!un,classData:{}})}return ke},se=(ae,Te)=>{const he=[],ke=new Date(Te,ae),De=new Date(Te,ae+1,0),Ht=t.weekStart,un=fs(ke,{weekStartsOn:Ht}),Di=zs=>{const dn=j(zs,ae);if(he.push({days:dn}),!he[he.length-1].days.some(En=>ct(ni(En.value),ni(De)))){const En=ss(zs,7);Di(En)}};return Di(un),re(he,ke,De,Ht)},ee=ae=>{const Te=eo(Ee(ae.value),u.hours,u.minutes,Be());e("date-update",Te),b.value.enabled?H_(Te,l,b.value.limit):l.value=Te,i(),Rn().then(()=>{J()})},fe=ae=>p.value.noDisabledRange?QS(s.value[0],ae).some(Te=>C(Te)):!1,me=()=>{s.value=l.value?l.value.slice():[],s.value.length===2&&!(p.value.fixedStart||p.value.fixedEnd)&&(s.value=[])},pe=(ae,Te)=>{const he=[Ee(ae.value),ss(Ee(ae.value),+p.value.autoRange)];w(he)?(Te&&Le(ae.value),s.value=he):e("invalid-date",ae.value)},Le=ae=>{const Te=at(Ee(ae)),he=Ge(Ee(ae));if(I(0,Te,he),h.value.count>0)for(let ke=1;ke{if(fe(ae.value)||!x(ae.value,l.value,p.value.fixedStart?0:1))return e("invalid-date",ae.value);s.value=lC(Ee(ae.value),l,e,p)},ze=(ae,Te)=>{if(me(),p.value.autoRange)return pe(ae,Te);if(p.value.fixedStart||p.value.fixedEnd)return Ae(ae);s.value[0]?x(Ee(ae.value),l.value)&&!fe(ae.value)?Xt(Ee(ae.value),Ee(s.value[0]))?(s.value.unshift(Ee(ae.value)),e("range-end",s.value[0])):(s.value[1]=Ee(ae.value),e("range-end",s.value[1])):(t.autoApply&&e("auto-apply-invalid",ae.value),e("invalid-date",ae.value)):(s.value[0]=Ee(ae.value),e("range-start",s.value[0]))},Be=(ae=!0)=>t.enableSeconds?Array.isArray(u.seconds)?ae?u.seconds[0]:u.seconds[1]:u.seconds:0,it=ae=>{s.value[ae]=eo(s.value[ae],u.hours[ae],u.minutes[ae],Be(ae!==1))},Ze=()=>{var ae,Te;s.value[0]&&s.value[1]&&+((ae=s.value)==null?void 0:ae[0])>+((Te=s.value)==null?void 0:Te[1])&&(s.value.reverse(),e("range-start",s.value[0]),e("range-end",s.value[1]))},Mt=()=>{s.value.length&&(s.value[0]&&!s.value[1]?it(0):(it(0),it(1),i()),Ze(),l.value=s.value.slice(),vf(s.value,e,t.autoApply,t.modelAuto))},gn=(ae,Te=!1)=>{if(C(ae.value)||!ae.current&&t.hideOffsetDates)return e("invalid-date",ae.value);if(o.value=JSON.parse(JSON.stringify(ae)),!p.value.enabled)return ee(ae);Ab(u.hours)&&Ab(u.minutes)&&!b.value.enabled&&(ze(ae,Te),Mt())},Un=(ae,Te)=>{var he;I(ae,Te.month,Te.year,!0),h.value.count&&!h.value.solo&&de(ae),e("update-month-year",{instance:ae,month:Te.month,year:Te.year}),n(h.value.solo?ae:void 0);const ke=(he=t.flow)!=null&&he.length?t.flow[t.flowStep]:void 0;!Te.fromNav&&(ke===zn.month||ke===zn.year)&&i()},Ri=(ae,Te)=>{aC({value:ae,modelValue:l,range:p.value.enabled,timezone:Te?void 0:y.value.timezone}),W(),t.multiCalendars&&Rn().then(()=>ne(!0))},wi=()=>{const ae=F_(Ee(),y.value);p.value.enabled?l.value&&Array.isArray(l.value)&&l.value[0]?l.value=Xt(ae,l.value[0])?[ae,l.value[0]]:[l.value[0],ae]:l.value=[ae]:l.value=ae,W()},Xi=()=>{if(Array.isArray(l.value))if(b.value.enabled){const ae=Ut();l.value[l.value.length-1]=k(ae)}else l.value=l.value.map((ae,Te)=>ae&&k(ae,Te));else l.value=k(l.value);e("time-update")},Ut=()=>Array.isArray(l.value)&&l.value.length?l.value[l.value.length-1]:null;return{calendars:c,modelValue:l,month:te,year:N,time:u,disabledTimesConfig:H,today:d,validateTime:F,getCalendarDays:se,getMarker:K,handleScroll:ge,handleSwipe:O,handleArrow:S,selectDate:gn,updateMonthYear:Un,presetDate:Ri,selectCurrentDate:wi,updateTime:(ae,Te=!0,he=!1)=>{T(ae,Te,he,Xi)},assignMonthAndYear:Y}},iV={key:0},sV=cn({__name:"DatePicker",props:{...ps},emits:["tooltip-open","tooltip-close","mount","update:internal-model-value","update-flow-step","reset-flow","auto-apply","focus-menu","select-date","range-start","range-end","invalid-fixed-range","time-update","am-pm-change","time-picker-open","time-picker-close","recalculate-position","update-month-year","auto-apply-invalid","date-update","invalid-date","overlay-toggle"],setup(t,{expose:e,emit:n}){const i=n,s=t,{calendars:r,month:o,year:a,modelValue:l,time:c,disabledTimesConfig:u,today:d,validateTime:h,getCalendarDays:f,getMarker:p,handleArrow:m,handleScroll:y,handleSwipe:v,selectDate:b,updateMonthYear:E,presetDate:C,selectCurrentDate:w,updateTime:x,assignMonthAndYear:T}=nV(s,i,ue,Y),k=pa(),{setHoverDate:A,getDayClassData:P,clearHoverDate:F}=wV(l,s),{defaultedMultiCalendars:H}=Wt(s),te=we([]),N=we([]),L=we(null),I=ki(k,"calendar"),W=ki(k,"monthYear"),X=ki(k,"timePicker"),J=ge=>{s.shadow||i("mount",ge)};fn(r,()=>{s.shadow||setTimeout(()=>{i("recalculate-position")},0)},{deep:!0}),fn(H,(ge,S)=>{ge.count-S.count>0&&T()},{deep:!0});const ne=be(()=>ge=>f(o.value(ge),a.value(ge)).map(S=>({...S,days:S.days.map(O=>(O.marker=p(O),O.classData=P(O),O))})));function ue(ge){var S;ge||ge===0?(S=N.value[ge])==null||S.triggerTransition(o.value(ge),a.value(ge)):N.value.forEach((O,K)=>O.triggerTransition(o.value(K),a.value(K)))}function Y(){i("update-flow-step")}const Z=(ge,S=!1)=>{b(ge,S),s.spaceConfirm&&i("select-date")},M=(ge,S,O=0)=>{var K;(K=te.value[O])==null||K.toggleMonthPicker(ge,S)},ie=(ge,S,O=0)=>{var K;(K=te.value[O])==null||K.toggleYearPicker(ge,S)},le=(ge,S,O)=>{var K;(K=L.value)==null||K.toggleTimePicker(ge,S,O)},$=(ge,S)=>{var O;if(!s.range){const K=l.value?l.value:d,U=S?new Date(S):K,re=ge?fs(U,{weekStartsOn:1}):DS(U,{weekStartsOn:1});b({value:re,current:at(U)===o.value(0),text:"",classData:{}}),(O=document.getElementById(sC(re)))==null||O.focus()}},oe=ge=>{var S;(S=te.value[0])==null||S.handleMonthYearChange(ge,!0)},de=ge=>{E(0,{month:o.value(0),year:a.value(0)+(ge?1:-1),fromNav:!0})},ve=(ge,S)=>{ge===zn.time&&i(`time-picker-${S?"open":"close"}`),i("overlay-toggle",{open:S,overlay:ge})},z=ge=>{i("overlay-toggle",{open:!1,overlay:ge}),i("focus-menu")};return e({clearHoverDate:F,presetDate:C,selectCurrentDate:w,toggleMonthPicker:M,toggleYearPicker:ie,toggleTimePicker:le,handleArrow:m,updateMonthYear:E,getSidebarProps:()=>({modelValue:l,month:o,year:a,time:c,updateTime:x,updateMonthYear:E,selectDate:b,presetDate:C}),changeMonth:oe,changeYear:de,selectWeekDate:$}),(ge,S)=>(D(),V($e,null,[B(yf,{"multi-calendars":Q(H).count,collapse:ge.collapse},{default:Re(({instance:O,index:K})=>[ge.disableMonthYearSelect?ce("",!0):(D(),Ce(U4,yn({key:0,ref:U=>{U&&(te.value[K]=U)},months:Q(US)(ge.formatLocale,ge.locale,ge.monthNameFormat),years:Q(B_)(ge.yearRange,ge.locale,ge.reverseYears),month:Q(o)(O),year:Q(a)(O),instance:O},ge.$props,{onMount:S[0]||(S[0]=U=>J(Q(ta).header)),onResetFlow:S[1]||(S[1]=U=>ge.$emit("reset-flow")),onUpdateMonthYear:U=>Q(E)(O,U),onOverlayClosed:z,onOverlayOpened:S[2]||(S[2]=U=>ge.$emit("overlay-toggle",{open:!0,overlay:U}))}),jn({_:2},[Xe(Q(W),(U,re)=>({name:U,fn:Re(j=>[Ne(ge.$slots,U,In(Zn(j)))])}))]),1040,["months","years","month","year","instance","onUpdateMonthYear"])),B(tV,yn({ref:U=>{U&&(N.value[K]=U)},"mapped-dates":ne.value(O),month:Q(o)(O),year:Q(a)(O),instance:O},ge.$props,{onSelectDate:U=>Q(b)(U,O!==1),onHandleSpace:U=>Z(U,O!==1),onSetHoverDate:S[3]||(S[3]=U=>Q(A)(U)),onHandleScroll:U=>Q(y)(U,O),onHandleSwipe:U=>Q(v)(U,O),onMount:S[4]||(S[4]=U=>J(Q(ta).calendar)),onResetFlow:S[5]||(S[5]=U=>ge.$emit("reset-flow")),onTooltipOpen:S[6]||(S[6]=U=>ge.$emit("tooltip-open",U)),onTooltipClose:S[7]||(S[7]=U=>ge.$emit("tooltip-close",U))}),jn({_:2},[Xe(Q(I),(U,re)=>({name:U,fn:Re(j=>[Ne(ge.$slots,U,In(Zn({...j})))])}))]),1040,["mapped-dates","month","year","instance","onSelectDate","onHandleSpace","onHandleScroll","onHandleSwipe"])]),_:3},8,["multi-calendars","collapse"]),ge.enableTimePicker?(D(),V("div",iV,[ge.$slots["time-picker"]?Ne(ge.$slots,"time-picker",In(yn({key:0},{time:Q(c),updateTime:Q(x)}))):(D(),Ce(uC,yn({key:1,ref_key:"timePickerRef",ref:L},ge.$props,{hours:Q(c).hours,minutes:Q(c).minutes,seconds:Q(c).seconds,"internal-model-value":ge.internalModelValue,"disabled-times-config":Q(u),"validate-time":Q(h),onMount:S[8]||(S[8]=O=>J(Q(ta).timePicker)),"onUpdate:hours":S[9]||(S[9]=O=>Q(x)(O)),"onUpdate:minutes":S[10]||(S[10]=O=>Q(x)(O,!1)),"onUpdate:seconds":S[11]||(S[11]=O=>Q(x)(O,!1,!0)),onResetFlow:S[12]||(S[12]=O=>ge.$emit("reset-flow")),onOverlayClosed:S[13]||(S[13]=O=>ve(O,!1)),onOverlayOpened:S[14]||(S[14]=O=>ve(O,!0)),onAmPmChange:S[15]||(S[15]=O=>ge.$emit("am-pm-change",O))}),jn({_:2},[Xe(Q(X),(O,K)=>({name:O,fn:Re(U=>[Ne(ge.$slots,O,In(Zn(U)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"]))])):ce("",!0)],64))}}),rV=(t,e)=>{const n=we(),{defaultedMultiCalendars:i,defaultedConfig:s,defaultedHighlight:r,defaultedRange:o,propDates:a,defaultedFilters:l,defaultedMultiDates:c}=Wt(t),{modelValue:u,year:d,month:h,calendars:f}=Fu(t,e),{isDisabled:p}=_o(t),{selectYear:m,groupedYears:y,showYearPicker:v,isDisabled:b,toggleYearPicker:E,handleYearSelect:C,handleYear:w}=cC({modelValue:u,multiCalendars:i,range:o,highlight:r,calendars:f,propDates:a,month:h,year:d,filters:l,props:t,emit:e}),x=(L,I)=>[L,I].map(W=>Rs(W,"MMMM",{locale:t.formatLocale})).join("-"),T=be(()=>L=>u.value?Array.isArray(u.value)?u.value.some(I=>bb(L,I)):bb(u.value,L):!1),k=L=>{if(o.value.enabled){if(Array.isArray(u.value)){const I=ct(L,u.value[0])||ct(L,u.value[1]);return mf(u.value,n.value,L)&&!I}return!1}return!1},A=(L,I)=>L.quarter===gb(I)&&L.year===Ge(I),P=L=>typeof r.value=="function"?r.value({quarter:gb(L),year:Ge(L)}):!!r.value.quarters.find(I=>A(I,L)),F=be(()=>L=>{const I=It(new Date,{year:d.value(L)});return DF({start:ru(I),end:RS(I)}).map(W=>{const X=Ko(W),J=pb(W),ne=p(W),ue=k(X),Y=P(X);return{text:x(X,J),value:X,active:T.value(X),highlighted:Y,disabled:ne,isBetween:ue}})}),H=L=>{H_(L,u,c.value.limit),e("auto-apply",!0)},te=L=>{u.value=Y_(u,L,e),vf(u.value,e,t.autoApply,t.modelAuto)},N=L=>{u.value=L,e("auto-apply")};return{defaultedConfig:s,defaultedMultiCalendars:i,groupedYears:y,year:d,isDisabled:b,quarters:F,showYearPicker:v,modelValue:u,setHoverDate:L=>{n.value=L},selectYear:m,selectQuarter:(L,I,W)=>{if(!W)return f.value[I].month=at(pb(L)),c.value.enabled?H(L):o.value.enabled?te(L):N(L)},toggleYearPicker:E,handleYearSelect:C,handleYear:w}},oV={class:"dp--quarter-items"},aV=["data-test","disabled","onClick","onMouseover"],lV=cn({compatConfig:{MODE:3},__name:"QuarterPicker",props:{...ps},emits:["update:internal-model-value","reset-flow","overlay-closed","auto-apply","range-start","range-end","overlay-toggle","update-month-year"],setup(t,{expose:e,emit:n}){const i=n,s=t,r=pa(),o=ki(r,"yearMode"),{defaultedMultiCalendars:a,defaultedConfig:l,groupedYears:c,year:u,isDisabled:d,quarters:h,modelValue:f,showYearPicker:p,setHoverDate:m,selectQuarter:y,toggleYearPicker:v,handleYearSelect:b,handleYear:E}=rV(s,i);return e({getSidebarProps:()=>({modelValue:f,year:u,selectQuarter:y,handleYearSelect:b,handleYear:E})}),(C,w)=>(D(),Ce(yf,{"multi-calendars":Q(a).count,collapse:C.collapse,stretch:""},{default:Re(({instance:x})=>[g("div",{class:"dp-quarter-picker-wrap",style:Mn({minHeight:`${Q(l).modeHeight}px`})},[C.$slots["top-extra"]?Ne(C.$slots,"top-extra",{key:0,value:C.internalModelValue}):ce("",!0),g("div",null,[B(oC,yn(C.$props,{items:Q(c)(x),instance:x,"show-year-picker":Q(p)[x],year:Q(u)(x),"is-disabled":T=>Q(d)(x,T),onHandleYear:T=>Q(E)(x,T),onYearSelect:T=>Q(b)(T,x),onToggleYearPicker:T=>Q(v)(x,T?.flow,T?.show)}),jn({_:2},[Xe(Q(o),(T,k)=>({name:T,fn:Re(A=>[Ne(C.$slots,T,In(Zn(A)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),g("div",oV,[(D(!0),V($e,null,Xe(Q(h)(x),(T,k)=>(D(),V("div",{key:k},[g("button",{type:"button",class:Me(["dp--qr-btn",{"dp--qr-btn-active":T.active,"dp--qr-btn-between":T.isBetween,"dp--qr-btn-disabled":T.disabled,"dp--highlighted":T.highlighted}]),"data-test":T.value,disabled:T.disabled,onClick:A=>Q(y)(T.value,x,T.disabled),onMouseover:A=>Q(m)(T.value)},[C.$slots.quarter?Ne(C.$slots,"quarter",{key:0,value:T.value,text:T.text}):(D(),V($e,{key:1},[Ye(xe(T.text),1)],64))],42,aV)]))),128))])],4)]),_:3},8,["multi-calendars","collapse"]))}}),cV=["id","tabindex","role","aria-label"],uV={key:0,class:"dp--menu-load-container"},dV=g("span",{class:"dp--menu-loader"},null,-1),hV=[dV],fV={key:1,class:"dp--menu-header"},gV={key:0,class:"dp__sidebar_left"},pV=["data-test","onClick","onKeydown"],mV={key:2,class:"dp__sidebar_right"},_V={key:3,class:"dp__action_extra"},Mb=cn({compatConfig:{MODE:3},__name:"DatepickerMenu",props:{..._f,shadow:{type:Boolean,default:!1},openOnTop:{type:Boolean,default:!1},internalModelValue:{type:[Date,Array],default:null},noOverlayFocus:{type:Boolean,default:!1},collapse:{type:Boolean,default:!1},getInputRect:{type:Function,default:()=>({})},isTextInputDate:{type:Boolean,default:!1}},emits:["close-picker","select-date","auto-apply","time-update","flow-step","update-month-year","invalid-select","update:internal-model-value","recalculate-position","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","auto-apply-invalid","date-update","invalid-date","overlay-toggle"],setup(t,{expose:e,emit:n}){const i=n,s=t,r=we(null),o=be(()=>{const{openOnTop:j,...se}=s;return{...se,flowStep:A.value,collapse:s.collapse,noOverlayFocus:s.noOverlayFocus,menuWrapRef:r.value}}),{setMenuFocused:a,setShiftKey:l,control:c}=rC(),u=pa(),{defaultedTextInput:d,defaultedInline:h,defaultedConfig:f,defaultedUI:p}=Wt(s),m=we(null),y=we(0),v=we(null),b=we(!1),E=we(null);xn(()=>{if(!s.shadow){b.value=!0,C(),window.addEventListener("resize",C);const j=mn(r);if(j&&!d.value.enabled&&!h.value.enabled&&(a(!0),I()),j){const se=ee=>{f.value.allowPreventDefault&&ee.preventDefault(),Qr(ee,f.value,!0)};j.addEventListener("pointerdown",se),j.addEventListener("mousedown",se)}}}),Yl(()=>{window.removeEventListener("resize",C)});const C=()=>{const j=mn(v);j&&(y.value=j.getBoundingClientRect().width)},{arrowRight:w,arrowLeft:x,arrowDown:T,arrowUp:k}=mo(),{flowStep:A,updateFlowStep:P,childMount:F,resetFlow:H,handleFlow:te}=xV(s,i,E),N=be(()=>s.monthPicker?x4:s.yearPicker?S4:s.timePicker?z4:s.quarterPicker?lV:sV),L=be(()=>{var j;if(f.value.arrowLeft)return f.value.arrowLeft;const se=(j=r.value)==null?void 0:j.getBoundingClientRect(),ee=s.getInputRect();return ee?.width=(se?.right??0)&&ee?.width{const j=mn(r);j&&j.focus({preventScroll:!0})},W=be(()=>{var j;return((j=E.value)==null?void 0:j.getSidebarProps())||{}}),X=()=>{s.openOnTop&&i("recalculate-position")},J=ki(u,"action"),ne=be(()=>s.monthPicker||s.yearPicker?ki(u,"monthYear"):s.timePicker?ki(u,"timePicker"):ki(u,"shared")),ue=be(()=>s.openOnTop?"dp__arrow_bottom":"dp__arrow_top"),Y=be(()=>({dp__menu_disabled:s.disabled,dp__menu_readonly:s.readonly,"dp-menu-loading":s.loading})),Z=be(()=>({dp__menu:!0,dp__menu_index:!h.value.enabled,dp__relative:h.value.enabled,...p.value.menu??{}})),M=j=>{Qr(j,f.value,!0)},ie=()=>{s.escClose&&i("close-picker")},le=j=>{if(s.arrowNavigation){if(j===Xn.up)return k();if(j===Xn.down)return T();if(j===Xn.left)return x();if(j===Xn.right)return w()}else j===Xn.left||j===Xn.up?z("handleArrow",Xn.left,0,j===Xn.up):z("handleArrow",Xn.right,0,j===Xn.down)},$=j=>{l(j.shiftKey),!s.disableMonthYearSelect&&j.code===Lt.tab&&j.target.classList.contains("dp__menu")&&c.value.shiftKeyInMenu&&(j.preventDefault(),Qr(j,f.value,!0),i("close-picker"))},oe=()=>{I(),i("time-picker-close")},de=j=>{var se,ee,fe;(se=E.value)==null||se.toggleTimePicker(!1,!1),(ee=E.value)==null||ee.toggleMonthPicker(!1,!1,j),(fe=E.value)==null||fe.toggleYearPicker(!1,!1,j)},ve=(j,se=0)=>{var ee,fe,me;return j==="month"?(ee=E.value)==null?void 0:ee.toggleMonthPicker(!1,!0,se):j==="year"?(fe=E.value)==null?void 0:fe.toggleYearPicker(!1,!0,se):j==="time"?(me=E.value)==null?void 0:me.toggleTimePicker(!0,!1):de(se)},z=(j,...se)=>{var ee,fe;(ee=E.value)!=null&&ee[j]&&((fe=E.value)==null||fe[j](...se))},ge=()=>{z("selectCurrentDate")},S=(j,se)=>{z("presetDate",j,se)},O=()=>{z("clearHoverDate")},K=(j,se)=>{z("updateMonthYear",j,se)},U=(j,se)=>{j.preventDefault(),le(se)},re=j=>{var se,ee,fe;if($(j),j.key===Lt.home||j.key===Lt.end)return z("selectWeekDate",j.key===Lt.home,j.target.getAttribute("id"));switch((j.key===Lt.pageUp||j.key===Lt.pageDown)&&(j.shiftKey?(z("changeYear",j.key===Lt.pageUp),(se=tm(r.value,"overlay-year"))==null||se.focus()):(z("changeMonth",j.key===Lt.pageUp),(ee=tm(r.value,j.key===Lt.pageUp?"action-prev":"action-next"))==null||ee.focus()),j.target.getAttribute("id")&&((fe=r.value)==null||fe.focus({preventScroll:!0}))),j.key){case Lt.esc:return ie();case Lt.arrowLeft:return U(j,Xn.left);case Lt.arrowRight:return U(j,Xn.right);case Lt.arrowUp:return U(j,Xn.up);case Lt.arrowDown:return U(j,Xn.down);default:return}};return e({updateMonthYear:K,switchView:ve,handleFlow:te}),(j,se)=>{var ee,fe,me;return D(),V("div",{id:j.uid?`dp-menu-${j.uid}`:void 0,ref_key:"dpMenuRef",ref:r,tabindex:Q(h).enabled?void 0:"0",role:Q(h).enabled?void 0:"dialog","aria-label":(ee=j.ariaLabels)==null?void 0:ee.menu,class:Me(Z.value),style:Mn({"--dp-arrow-left":L.value}),onMouseleave:O,onClick:M,onKeydown:re},[(j.disabled||j.readonly)&&Q(h).enabled||j.loading?(D(),V("div",{key:0,class:Me(Y.value)},[j.loading?(D(),V("div",uV,hV)):ce("",!0)],2)):ce("",!0),j.$slots["menu-header"]?(D(),V("div",fV,[Ne(j.$slots,"menu-header")])):ce("",!0),!Q(h).enabled&&!j.teleportCenter?(D(),V("div",{key:2,class:Me(ue.value)},null,2)):ce("",!0),g("div",{ref_key:"innerMenuRef",ref:v,class:Me({dp__menu_content_wrapper:((fe=j.presetDates)==null?void 0:fe.length)||!!j.$slots["left-sidebar"]||!!j.$slots["right-sidebar"],"dp--menu-content-wrapper-collapsed":t.collapse&&(((me=j.presetDates)==null?void 0:me.length)||!!j.$slots["left-sidebar"]||!!j.$slots["right-sidebar"])}),style:Mn({"--dp-menu-width":`${y.value}px`})},[j.$slots["left-sidebar"]?(D(),V("div",gV,[Ne(j.$slots,"left-sidebar",In(Zn(W.value)))])):ce("",!0),j.presetDates.length?(D(),V("div",{key:1,class:Me({"dp--preset-dates-collapsed":t.collapse,"dp--preset-dates":!0})},[(D(!0),V($e,null,Xe(j.presetDates,(pe,Le)=>(D(),V($e,{key:Le},[pe.slot?Ne(j.$slots,pe.slot,{key:0,presetDate:S,label:pe.label,value:pe.value}):(D(),V("button",{key:1,type:"button",style:Mn(pe.style||{}),class:Me(["dp__btn dp--preset-range",{"dp--preset-range-collapsed":t.collapse}]),"data-test":pe.testId??void 0,onClick:iu(Ae=>S(pe.value,pe.noTz),["prevent"]),onKeydown:Ae=>Q(Qn)(Ae,()=>S(pe.value,pe.noTz),!0)},xe(pe.label),47,pV))],64))),128))],2)):ce("",!0),g("div",{ref_key:"calendarWrapperRef",ref:m,class:"dp__instance_calendar",role:"document"},[(D(),Ce(ga(N.value),yn({ref_key:"dynCmpRef",ref:E},o.value,{"flow-step":Q(A),onMount:Q(F),onUpdateFlowStep:Q(P),onResetFlow:Q(H),onFocusMenu:I,onSelectDate:se[0]||(se[0]=pe=>j.$emit("select-date")),onDateUpdate:se[1]||(se[1]=pe=>j.$emit("date-update",pe)),onTooltipOpen:se[2]||(se[2]=pe=>j.$emit("tooltip-open",pe)),onTooltipClose:se[3]||(se[3]=pe=>j.$emit("tooltip-close",pe)),onAutoApply:se[4]||(se[4]=pe=>j.$emit("auto-apply",pe)),onRangeStart:se[5]||(se[5]=pe=>j.$emit("range-start",pe)),onRangeEnd:se[6]||(se[6]=pe=>j.$emit("range-end",pe)),onInvalidFixedRange:se[7]||(se[7]=pe=>j.$emit("invalid-fixed-range",pe)),onTimeUpdate:se[8]||(se[8]=pe=>j.$emit("time-update")),onAmPmChange:se[9]||(se[9]=pe=>j.$emit("am-pm-change",pe)),onTimePickerOpen:se[10]||(se[10]=pe=>j.$emit("time-picker-open",pe)),onTimePickerClose:oe,onRecalculatePosition:X,onUpdateMonthYear:se[11]||(se[11]=pe=>j.$emit("update-month-year",pe)),onAutoApplyInvalid:se[12]||(se[12]=pe=>j.$emit("auto-apply-invalid",pe)),onInvalidDate:se[13]||(se[13]=pe=>j.$emit("invalid-date",pe)),onOverlayToggle:se[14]||(se[14]=pe=>j.$emit("overlay-toggle",pe)),"onUpdate:internalModelValue":se[15]||(se[15]=pe=>j.$emit("update:internal-model-value",pe))}),jn({_:2},[Xe(ne.value,(pe,Le)=>({name:pe,fn:Re(Ae=>[Ne(j.$slots,pe,In(Zn({...Ae})))])}))]),1040,["flow-step","onMount","onUpdateFlowStep","onResetFlow"]))],512),j.$slots["right-sidebar"]?(D(),V("div",mV,[Ne(j.$slots,"right-sidebar",In(Zn(W.value)))])):ce("",!0),j.$slots["action-extra"]?(D(),V("div",_V,[j.$slots["action-extra"]?Ne(j.$slots,"action-extra",{key:0,selectCurrentDate:ge}):ce("",!0)])):ce("",!0)],6),!j.autoApply||Q(f).keepActionRow?(D(),Ce(g4,yn({key:3,"menu-mount":b.value},o.value,{"calendar-width":y.value,onClosePicker:se[16]||(se[16]=pe=>j.$emit("close-picker")),onSelectDate:se[17]||(se[17]=pe=>j.$emit("select-date")),onInvalidSelect:se[18]||(se[18]=pe=>j.$emit("invalid-select")),onSelectNow:ge}),jn({_:2},[Xe(Q(J),(pe,Le)=>({name:pe,fn:Re(Ae=>[Ne(j.$slots,pe,In(Zn({...Ae})))])}))]),1040,["menu-mount","calendar-width"])):ce("",!0)],46,cV)}}});var Ka=(t=>(t.center="center",t.left="left",t.right="right",t))(Ka||{});const yV=({menuRef:t,menuRefInner:e,inputRef:n,pickerWrapperRef:i,inline:s,emit:r,props:o,slots:a})=>{const{defaultedConfig:l}=Wt(o),c=we({}),u=we(!1),d=we({top:"0",left:"0"}),h=we(!1),f=Zc(o,"teleportCenter");fn(f,()=>{d.value=JSON.parse(JSON.stringify({})),w()});const p=I=>{if(o.teleport){const W=I.getBoundingClientRect();return{left:W.left+window.scrollX,top:W.top+window.scrollY}}return{top:0,left:0}},m=(I,W)=>{d.value.left=`${I+W-c.value.width}px`},y=I=>{d.value.left=`${I}px`},v=(I,W)=>{o.position===Ka.left&&y(I),o.position===Ka.right&&m(I,W),o.position===Ka.center&&(d.value.left=`${I+W/2-c.value.width/2}px`)},b=I=>{const{width:W,height:X}=I.getBoundingClientRect(),{top:J,left:ne}=o.altPosition?o.altPosition(I):p(I);return{top:+J,left:+ne,width:W,height:X}},E=()=>{d.value.left="50%",d.value.top="50%",d.value.transform="translate(-50%, -50%)",d.value.position="fixed",delete d.value.opacity},C=()=>{const I=mn(n),{top:W,left:X,transform:J}=o.altPosition(I);d.value={top:`${W}px`,left:`${X}px`,transform:J??""}},w=(I=!0)=>{var W;if(!s.value.enabled){if(f.value)return E();if(o.altPosition!==null)return C();if(I){const X=o.teleport?(W=e.value)==null?void 0:W.$el:t.value;X&&(c.value=X.getBoundingClientRect()),r("recalculate-position")}return H()}},x=({inputEl:I,left:W,width:X})=>{window.screen.width>768&&!u.value&&v(W,X),A(I)},T=I=>{const{top:W,left:X,height:J,width:ne}=b(I);d.value.top=`${J+W+ +o.offset}px`,h.value=!1,u.value||(d.value.left=`${X+ne/2-c.value.width/2}px`),x({inputEl:I,left:X,width:ne})},k=I=>{const{top:W,left:X,width:J}=b(I);d.value.top=`${W-+o.offset-c.value.height}px`,h.value=!0,x({inputEl:I,left:X,width:J})},A=I=>{if(o.autoPosition){const{left:W,width:X}=b(I),{left:J,right:ne}=c.value;if(!u.value){if(Math.abs(J)!==Math.abs(ne)){if(J<=0)return u.value=!0,y(W);if(ne>=document.documentElement.clientWidth)return u.value=!0,m(W,X)}return v(W,X)}}},P=()=>{const I=mn(n);if(I){const{height:W}=c.value,{top:X,height:J}=I.getBoundingClientRect(),ne=window.innerHeight-X-J,ue=X;return W<=ne?Vo.bottom:W>ne&&W<=ue?Vo.top:ne>=ue?Vo.bottom:Vo.top}return Vo.bottom},F=I=>P()===Vo.bottom?T(I):k(I),H=()=>{const I=mn(n);if(I)return o.autoPosition?F(I):T(I)},te=function(I){if(I){const W=I.scrollHeight>I.clientHeight,X=window.getComputedStyle(I).overflowY.indexOf("hidden")!==-1;return W&&!X}return!0},N=function(I){return!I||I===document.body||I.nodeType===Node.DOCUMENT_FRAGMENT_NODE?window:te(I)?I:N(I.assignedSlot&&l.value.shadowDom?I.assignedSlot.parentNode:I.parentNode)},L=I=>{if(I)switch(o.position){case Ka.left:return{left:0,transform:"translateX(0)"};case Ka.right:return{left:`${I.width}px`,transform:"translateX(-100%)"};default:return{left:`${I.width/2}px`,transform:"translateX(-50%)"}}return{}};return{openOnTop:h,menuStyle:d,xCorrect:u,setMenuPosition:w,getScrollableParent:N,shadowRender:(I,W)=>{var X,J,ne;const ue=document.createElement("div"),Y=(X=mn(n))==null?void 0:X.getBoundingClientRect();ue.setAttribute("id","dp--temp-container");const Z=(J=i.value)!=null&&J.clientWidth?i.value:document.body;Z.append(ue);const M=L(Y),ie=l.value.shadowDom?Object.keys(a).filter($=>["right-sidebar","left-sidebar","top-extra","action-extra"].includes($)):Object.keys(a),le=la(I,{...W,shadow:!0,style:{opacity:0,position:"absolute",...M}},Object.fromEntries(ie.map($=>[$,a[$]])));Kv(le,ue),c.value=(ne=le.el)==null?void 0:ne.getBoundingClientRect(),Kv(null,ue),Z.removeChild(ue)}}},kr=[{name:"clock-icon",use:["time","calendar","shared"]},{name:"arrow-left",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-right",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-up",use:["time","calendar","month-year","shared"]},{name:"arrow-down",use:["time","calendar","month-year","shared"]},{name:"calendar-icon",use:["month-year","time","calendar","shared","year-mode"]},{name:"day",use:["calendar","shared"]},{name:"month-overlay-value",use:["calendar","month-year","shared"]},{name:"year-overlay-value",use:["calendar","month-year","shared","year-mode"]},{name:"year-overlay",use:["month-year","shared"]},{name:"month-overlay",use:["month-year","shared"]},{name:"month-overlay-header",use:["month-year","shared"]},{name:"year-overlay-header",use:["month-year","shared"]},{name:"hours-overlay-value",use:["calendar","time","shared"]},{name:"hours-overlay-header",use:["calendar","time","shared"]},{name:"minutes-overlay-value",use:["calendar","time","shared"]},{name:"minutes-overlay-header",use:["calendar","time","shared"]},{name:"seconds-overlay-value",use:["calendar","time","shared"]},{name:"seconds-overlay-header",use:["calendar","time","shared"]},{name:"hours",use:["calendar","time","shared"]},{name:"minutes",use:["calendar","time","shared"]},{name:"month",use:["calendar","month-year","shared"]},{name:"year",use:["calendar","month-year","shared","year-mode"]},{name:"action-buttons",use:["action"]},{name:"action-preview",use:["action"]},{name:"calendar-header",use:["calendar","shared"]},{name:"marker-tooltip",use:["calendar","shared"]},{name:"action-extra",use:["menu"]},{name:"time-picker-overlay",use:["calendar","time","shared"]},{name:"am-pm-button",use:["calendar","time","shared"]},{name:"left-sidebar",use:["menu"]},{name:"right-sidebar",use:["menu"]},{name:"month-year",use:["month-year","shared"]},{name:"time-picker",use:["menu","shared"]},{name:"action-row",use:["action"]},{name:"marker",use:["calendar","shared"]},{name:"quarter",use:["shared"]},{name:"top-extra",use:["shared","month-year"]},{name:"tp-inline-arrow-up",use:["shared","time"]},{name:"tp-inline-arrow-down",use:["shared","time"]},{name:"menu-header",use:["menu"]}],vV=[{name:"trigger"},{name:"input-icon"},{name:"clear-icon"},{name:"dp-input"}],bV={all:()=>kr,monthYear:()=>kr.filter(t=>t.use.includes("month-year")),input:()=>vV,timePicker:()=>kr.filter(t=>t.use.includes("time")),action:()=>kr.filter(t=>t.use.includes("action")),calendar:()=>kr.filter(t=>t.use.includes("calendar")),menu:()=>kr.filter(t=>t.use.includes("menu")),shared:()=>kr.filter(t=>t.use.includes("shared")),yearMode:()=>kr.filter(t=>t.use.includes("year-mode"))},ki=(t,e,n)=>{const i=[];return bV[e]().forEach(s=>{t[s.name]&&i.push(s.name)}),n!=null&&n.length&&n.forEach(s=>{s.slot&&i.push(s.slot)}),i},Nu=t=>{const e=be(()=>i=>t.value?i?t.value.open:t.value.close:""),n=be(()=>i=>t.value?i?t.value.menuAppearTop:t.value.menuAppearBottom:"");return{transitionName:e,showTransition:!!t.value,menuTransition:n}},Fu=(t,e,n)=>{const{defaultedRange:i,defaultedTz:s}=Wt(t),r=Ee(_i(Ee(),s.value.timezone)),o=we([{month:at(r),year:Ge(r)}]),a=h=>{const f={hours:pr(r),minutes:oo(r),seconds:0};return i.value.enabled?[f[h],f[h]]:f[h]},l=Ns({hours:a("hours"),minutes:a("minutes"),seconds:a("seconds")});fn(i,(h,f)=>{h.enabled!==f.enabled&&(l.hours=a("hours"),l.minutes=a("minutes"),l.seconds=a("seconds"))},{deep:!0});const c=be({get:()=>t.internalModelValue,set:h=>{!t.readonly&&!t.disabled&&e("update:internal-model-value",h)}}),u=be(()=>h=>o.value[h]?o.value[h].month:0),d=be(()=>h=>o.value[h]?o.value[h].year:0);return fn(c,(h,f)=>{n&&JSON.stringify(h??{})!==JSON.stringify(f??{})&&n()},{deep:!0}),{calendars:o,time:l,modelValue:c,month:u,year:d,today:r}},wV=(t,e)=>{const{defaultedMultiCalendars:n,defaultedMultiDates:i,defaultedUI:s,defaultedHighlight:r,defaultedTz:o,propDates:a,defaultedRange:l}=Wt(e),{isDisabled:c}=_o(e),u=we(null),d=we(_i(new Date,o.value.timezone)),h=M=>{!M.current&&e.hideOffsetDates||(u.value=M.value)},f=()=>{u.value=null},p=M=>Array.isArray(t.value)&&l.value.enabled&&t.value[0]&&u.value?M?nn(u.value,t.value[0]):Xt(u.value,t.value[0]):!0,m=(M,ie)=>{const le=()=>t.value?ie?t.value[0]||null:t.value[1]:null,$=t.value&&Array.isArray(t.value)?le():null;return ct(Ee(M.value),$)},y=M=>{const ie=Array.isArray(t.value)?t.value[0]:null;return M?!Xt(u.value??null,ie):!0},v=(M,ie=!0)=>(l.value.enabled||e.weekPicker)&&Array.isArray(t.value)&&t.value.length===2?e.hideOffsetDates&&!M.current?!1:ct(Ee(M.value),t.value[ie?0:1]):l.value.enabled?m(M,ie)&&y(ie)||ct(M.value,Array.isArray(t.value)?t.value[0]:null)&&p(ie):!1,b=(M,ie)=>{if(Array.isArray(t.value)&&t.value[0]&&t.value.length===1){const le=ct(M.value,u.value);return ie?nn(t.value[0],M.value)&&le:Xt(t.value[0],M.value)&&le}return!1},E=M=>!t.value||e.hideOffsetDates&&!M.current?!1:l.value.enabled?e.modelAuto&&Array.isArray(t.value)?ct(M.value,t.value[0]?t.value[0]:d.value):!1:i.value.enabled&&Array.isArray(t.value)?t.value.some(ie=>ct(ie,M.value)):ct(M.value,t.value?t.value:d.value),C=M=>{if(l.value.autoRange||e.weekPicker){if(u.value){if(e.hideOffsetDates&&!M.current)return!1;const ie=ss(u.value,+l.value.autoRange),le=er(Ee(u.value),e.weekStart);return e.weekPicker?ct(le[1],Ee(M.value)):ct(ie,Ee(M.value))}return!1}return!1},w=M=>{if(l.value.autoRange||e.weekPicker){if(u.value){const ie=ss(u.value,+l.value.autoRange);if(e.hideOffsetDates&&!M.current)return!1;const le=er(Ee(u.value),e.weekStart);return e.weekPicker?nn(M.value,le[0])&&Xt(M.value,le[1]):nn(M.value,u.value)&&Xt(M.value,ie)}return!1}return!1},x=M=>{if(l.value.autoRange||e.weekPicker){if(u.value){if(e.hideOffsetDates&&!M.current)return!1;const ie=er(Ee(u.value),e.weekStart);return e.weekPicker?ct(ie[0],M.value):ct(u.value,M.value)}return!1}return!1},T=M=>mf(t.value,u.value,M.value),k=()=>e.modelAuto&&Array.isArray(e.internalModelValue)?!!e.internalModelValue[0]:!1,A=()=>e.modelAuto?GS(e.internalModelValue):!0,P=M=>{if(e.weekPicker)return!1;const ie=l.value.enabled?!v(M)&&!v(M,!1):!0;return!c(M.value)&&!E(M)&&!(!M.current&&e.hideOffsetDates)&&ie},F=M=>l.value.enabled?e.modelAuto?k()&&E(M):!1:E(M),H=M=>r.value?FB(M.value,a.value.highlight):!1,te=M=>{const ie=c(M.value);return ie&&(typeof r.value=="function"?!r.value(M.value,ie):!r.value.options.highlightDisabled)},N=M=>{var ie;return typeof r.value=="function"?r.value(M.value):(ie=r.value.weekdays)==null?void 0:ie.includes(M.value.getDay())},L=M=>(l.value.enabled||e.weekPicker)&&(!(n.value.count>0)||M.current)&&A()&&!(!M.current&&e.hideOffsetDates)&&!E(M)?T(M):!1,I=M=>{const{isRangeStart:ie,isRangeEnd:le}=ne(M),$=l.value.enabled?ie||le:!1;return{dp__cell_offset:!M.current,dp__pointer:!e.disabled&&!(!M.current&&e.hideOffsetDates)&&!c(M.value),dp__cell_disabled:c(M.value),dp__cell_highlight:!te(M)&&(H(M)||N(M))&&!F(M)&&!$&&!x(M)&&!(L(M)&&e.weekPicker)&&!le,dp__cell_highlight_active:!te(M)&&(H(M)||N(M))&&F(M),dp__today:!e.noToday&&ct(M.value,d.value)&&M.current,"dp--past":Xt(M.value,d.value),"dp--future":nn(M.value,d.value)}},W=M=>({dp__active_date:F(M),dp__date_hover:P(M)}),X=M=>{if(t.value&&!Array.isArray(t.value)){const ie=er(t.value,e.weekStart);return{...Y(M),dp__range_start:ct(ie[0],M.value),dp__range_end:ct(ie[1],M.value),dp__range_between_week:nn(M.value,ie[0])&&Xt(M.value,ie[1])}}return{...Y(M)}},J=M=>{if(t.value&&Array.isArray(t.value)){const ie=er(t.value[0],e.weekStart),le=t.value[1]?er(t.value[1],e.weekStart):[];return{...Y(M),dp__range_start:ct(ie[0],M.value)||ct(le[0],M.value),dp__range_end:ct(ie[1],M.value)||ct(le[1],M.value),dp__range_between_week:nn(M.value,ie[0])&&Xt(M.value,ie[1])||nn(M.value,le[0])&&Xt(M.value,le[1]),dp__range_between:nn(M.value,ie[1])&&Xt(M.value,le[0])}}return{...Y(M)}},ne=M=>{const ie=n.value.count>0?M.current&&v(M)&&A():v(M)&&A(),le=n.value.count>0?M.current&&v(M,!1)&&A():v(M,!1)&&A();return{isRangeStart:ie,isRangeEnd:le}},ue=M=>{const{isRangeStart:ie,isRangeEnd:le}=ne(M);return{dp__range_start:ie,dp__range_end:le,dp__range_between:L(M),dp__date_hover:ct(M.value,u.value)&&!ie&&!le&&!e.weekPicker,dp__date_hover_start:b(M,!0),dp__date_hover_end:b(M,!1)}},Y=M=>({...ue(M),dp__cell_auto_range:w(M),dp__cell_auto_range_start:x(M),dp__cell_auto_range_end:C(M)}),Z=M=>l.value.enabled?l.value.autoRange?Y(M):e.modelAuto?{...W(M),...ue(M)}:e.weekPicker?J(M):ue(M):e.weekPicker?X(M):W(M);return{setHoverDate:h,clearHoverDate:f,getDayClassData:M=>e.hideOffsetDates&&!M.current?{}:{...I(M),...Z(M),[e.dayClass?e.dayClass(M.value,e.internalModelValue):""]:!0,...s.value.calendarCell??{}}}},_o=t=>{const{defaultedFilters:e,defaultedRange:n,propDates:i,defaultedMultiDates:s}=Wt(t),r=N=>i.value.disabledDates?typeof i.value.disabledDates=="function"?i.value.disabledDates(Ee(N)):!!bh(N,i.value.disabledDates):!1,o=N=>i.value.maxDate?t.yearPicker?Ge(N)>Ge(i.value.maxDate):nn(N,i.value.maxDate):!1,a=N=>i.value.minDate?t.yearPicker?Ge(N){const L=o(N),I=a(N),W=r(N),X=e.value.months.map(Z=>+Z).includes(at(N)),J=t.disabledWeekDays.length?t.disabledWeekDays.some(Z=>+Z===T5(N)):!1,ne=f(N),ue=Ge(N),Y=ue<+t.yearRange[0]||ue>+t.yearRange[1];return!(L||I||W||X||Y||J||ne)},c=(N,L)=>Xt(...Yr(i.value.minDate,N,L))||ct(...Yr(i.value.minDate,N,L)),u=(N,L)=>nn(...Yr(i.value.maxDate,N,L))||ct(...Yr(i.value.maxDate,N,L)),d=(N,L,I)=>{let W=!1;return i.value.maxDate&&I&&u(N,L)&&(W=!0),i.value.minDate&&!I&&c(N,L)&&(W=!0),W},h=(N,L,I,W)=>{let X=!1;return W?i.value.minDate&&i.value.maxDate?X=d(N,L,I):(i.value.minDate&&c(N,L)||i.value.maxDate&&u(N,L))&&(X=!0):X=!0,X},f=N=>Array.isArray(i.value.allowedDates)&&!i.value.allowedDates.length?!0:i.value.allowedDates?!bh(N,i.value.allowedDates):!1,p=N=>!l(N),m=N=>n.value.noDisabledRange?!PS({start:N[0],end:N[1]}).some(L=>p(L)):!0,y=N=>{if(N){const L=Ge(N);return L>=+t.yearRange[0]&&L<=t.yearRange[1]}return!0},v=(N,L)=>!!(Array.isArray(N)&&N[L]&&(n.value.maxRange||n.value.minRange)&&y(N[L])),b=(N,L,I=0)=>{if(v(L,I)&&y(N)){const W=MS(N,L[I]),X=QS(L[I],N),J=X.length===1?0:X.filter(ue=>p(ue)).length,ne=Math.abs(W)-(n.value.minMaxRawRange?0:J);if(n.value.minRange&&n.value.maxRange)return ne>=+n.value.minRange&&ne<=+n.value.maxRange;if(n.value.minRange)return ne>=+n.value.minRange;if(n.value.maxRange)return ne<=+n.value.maxRange}return!0},E=()=>!t.enableTimePicker||t.monthPicker||t.yearPicker||t.ignoreTimeValidation,C=N=>Array.isArray(N)?[N[0]?Og(N[0]):null,N[1]?Og(N[1]):null]:Og(N),w=(N,L,I)=>N.find(W=>+W.hours===pr(L)&&W.minutes==="*"?!0:+W.minutes===oo(L)&&+W.hours===pr(L))&&I,x=(N,L,I)=>{const[W,X]=N,[J,ne]=L;return!w(W,J,I)&&!w(X,ne,I)&&I},T=(N,L)=>{const I=Array.isArray(L)?L:[L];return Array.isArray(t.disabledTimes)?Array.isArray(t.disabledTimes[0])?x(t.disabledTimes,I,N):!I.some(W=>w(t.disabledTimes,W,N)):N},k=(N,L)=>{const I=Array.isArray(L)?[na(L[0]),L[1]?na(L[1]):void 0]:na(L),W=!t.disabledTimes(I);return N&&W},A=(N,L)=>t.disabledTimes?Array.isArray(t.disabledTimes)?T(L,N):k(L,N):L,P=N=>{let L=!0;if(!N||E())return!0;const I=!i.value.minDate&&!i.value.maxDate?C(N):N;return(t.maxTime||i.value.maxDate)&&(L=Cb(t.maxTime,i.value.maxDate,"max",Tn(I),L)),(t.minTime||i.value.minDate)&&(L=Cb(t.minTime,i.value.minDate,"min",Tn(I),L)),A(N,L)},F=N=>{if(!t.monthPicker)return!0;let L=!0;const I=Ee(rs(N));if(i.value.minDate&&i.value.maxDate){const W=Ee(rs(i.value.minDate)),X=Ee(rs(i.value.maxDate));return nn(I,W)&&Xt(I,X)||ct(I,W)||ct(I,X)}if(i.value.minDate){const W=Ee(rs(i.value.minDate));L=nn(I,W)||ct(I,W)}if(i.value.maxDate){const W=Ee(rs(i.value.maxDate));L=Xt(I,W)||ct(I,W)}return L},H=be(()=>N=>!t.enableTimePicker||t.ignoreTimeValidation?!0:P(N)),te=be(()=>N=>t.monthPicker?Array.isArray(N)&&(n.value.enabled||s.value.enabled)?!N.filter(L=>!F(L)).length:F(N):!0);return{isDisabled:p,validateDate:l,validateMonthYearInRange:h,isDateRangeAllowed:m,checkMinMaxRange:b,isValidTime:P,isTimeValid:H,isMonthValid:te}},bf=()=>{const t=be(()=>(i,s)=>i?.includes(s)),e=be(()=>(i,s)=>i.count?i.solo?!0:s===0:!0),n=be(()=>(i,s)=>i.count?i.solo?!0:s===i.count-1:!0);return{hideNavigationButtons:t,showLeftIcon:e,showRightIcon:n}},xV=(t,e,n)=>{const i=we(0),s=Ns({[ta.timePicker]:!t.enableTimePicker||t.timePicker||t.monthPicker,[ta.calendar]:!1,[ta.header]:!1}),r=be(()=>t.monthPicker||t.timePicker),o=d=>{var h;if((h=t.flow)!=null&&h.length){if(!d&&r.value)return u();s[d]=!0,Object.keys(s).filter(f=>!s[f]).length||u()}},a=()=>{var d,h;(d=t.flow)!=null&&d.length&&i.value!==-1&&(i.value+=1,e("flow-step",i.value),u()),((h=t.flow)==null?void 0:h.length)===i.value&&Rn().then(()=>l())},l=()=>{i.value=-1},c=(d,h,...f)=>{var p,m;t.flow[i.value]===d&&n.value&&((m=(p=n.value)[h])==null||m.call(p,...f))},u=(d=0)=>{d&&(i.value+=d),c(zn.month,"toggleMonthPicker",!0),c(zn.year,"toggleYearPicker",!0),c(zn.calendar,"toggleTimePicker",!1,!0),c(zn.time,"toggleTimePicker",!0,!0);const h=t.flow[i.value];(h===zn.hours||h===zn.minutes||h===zn.seconds)&&c(h,"toggleTimePicker",!0,!0,h)};return{childMount:o,updateFlowStep:a,resetFlow:l,handleFlow:u,flowStep:i}},EV={key:1,class:"dp__input_wrap"},SV=["id","name","inputmode","placeholder","disabled","readonly","required","value","autocomplete","aria-disabled","aria-invalid"],CV={key:2,class:"dp--clear-btn"},TV=["aria-label"],kV=cn({compatConfig:{MODE:3},__name:"DatepickerInput",props:{isMenuOpen:{type:Boolean,default:!1},inputValue:{type:String,default:""},..._f},emits:["clear","open","update:input-value","set-input-date","close","select-date","set-empty-date","toggle","focus-prev","focus","blur","real-blur","text-input"],setup(t,{expose:e,emit:n}){const i=n,s=t,{defaultedTextInput:r,defaultedAriaLabels:o,defaultedInline:a,defaultedConfig:l,defaultedRange:c,defaultedMultiDates:u,defaultedUI:d,getDefaultPattern:h,getDefaultStartTime:f}=Wt(s),{checkMinMaxRange:p}=_o(s),m=we(),y=we(null),v=we(!1),b=we(!1),E=we(!1),C=we(null),w=be(()=>({dp__pointer:!s.disabled&&!s.readonly&&!r.value.enabled,dp__disabled:s.disabled,dp__input_readonly:!r.value.enabled,dp__input:!0,dp__input_icon_pad:!s.hideInputIcon,dp__input_valid:typeof s.state=="boolean"?s.state:!1,dp__input_invalid:typeof s.state=="boolean"?!s.state:!1,dp__input_focus:v.value||s.isMenuOpen,dp__input_reg:!r.value.enabled,...d.value.input??{}})),x=()=>{i("set-input-date",null),s.clearable&&s.autoApply&&(i("set-empty-date"),m.value=null)},T=Y=>{const Z=f();return VB(Y,r.value.format??h(),Z??eC({},s.enableSeconds),s.inputValue,E.value,s.formatLocale)},k=Y=>{const{rangeSeparator:Z}=r.value,[M,ie]=Y.split(`${Z}`);if(M){const le=T(M.trim()),$=ie?T(ie.trim()):null;if(Sl(le,$))return;const oe=le&&$?[le,$]:[le];p($,oe,0)&&(m.value=le?oe:null)}},A=()=>{E.value=!0},P=Y=>{if(c.value.enabled)k(Y);else if(u.value.enabled){const Z=Y.split(";");m.value=Z.map(M=>T(M.trim())).filter(M=>M)}else m.value=T(Y)},F=Y=>{var Z;const M=typeof Y=="string"?Y:(Z=Y.target)==null?void 0:Z.value;M!==""?(r.value.openMenu&&!s.isMenuOpen&&i("open"),P(M),i("set-input-date",m.value)):x(),E.value=!1,i("update:input-value",M),i("text-input",Y,m.value)},H=Y=>{r.value.enabled?(P(Y.target.value),r.value.enterSubmit&&nm(m.value)&&s.inputValue!==""?(i("set-input-date",m.value,!0),m.value=null):r.value.enterSubmit&&s.inputValue===""&&(m.value=null,i("clear"))):L(Y)},te=(Y,Z)=>{var M;if(C.value&&Z&&!b.value)return Y.preventDefault(),b.value=!0,(M=C.value)==null?void 0:M.focus();r.value.enabled&&r.value.tabSubmit&&P(Y.target.value),r.value.tabSubmit&&nm(m.value)&&s.inputValue!==""?(i("set-input-date",m.value,!0,!0),m.value=null):r.value.tabSubmit&&s.inputValue===""&&(m.value=null,i("clear",!0))},N=()=>{v.value=!0,i("focus"),Rn().then(()=>{var Y;r.value.enabled&&r.value.selectOnFocus&&((Y=y.value)==null||Y.select())})},L=Y=>{if(Y.preventDefault(),Qr(Y,l.value,!0),r.value.enabled&&r.value.openMenu&&!a.value.input){if(r.value.openMenu==="open"&&!s.isMenuOpen)return i("open");if(r.value.openMenu==="toggle")return i("toggle")}else r.value.enabled||i("toggle")},I=()=>{i("real-blur"),v.value=!1,(!s.isMenuOpen||a.value.enabled&&a.value.input)&&i("blur"),s.autoApply&&r.value.enabled&&m.value&&!s.isMenuOpen&&(i("set-input-date",m.value),i("select-date"),m.value=null)},W=Y=>{Qr(Y,l.value,!0),i("clear")},X=(Y,Z)=>{if(Y.key==="Tab"&&te(Y,Z),Y.key==="Enter"&&H(Y),!r.value.enabled){if(Y.code==="Tab")return;Y.preventDefault()}},J=()=>{var Y;(Y=y.value)==null||Y.focus({preventScroll:!0})},ne=Y=>{m.value=Y},ue=Y=>{Y.key===Lt.tab&&(b.value=!1,te(Y))};return e({focusInput:J,setParsedDate:ne}),(Y,Z)=>{var M,ie;return D(),V("div",{onClick:L},[Y.$slots.trigger&&!Y.$slots["dp-input"]&&!Q(a).enabled?Ne(Y.$slots,"trigger",{key:0}):ce("",!0),!Y.$slots.trigger&&(!Q(a).enabled||Q(a).input)?(D(),V("div",EV,[Y.$slots["dp-input"]&&!Y.$slots.trigger&&(!Q(a).enabled||Q(a).enabled&&Q(a).input)?Ne(Y.$slots,"dp-input",{key:0,value:t.inputValue,isMenuOpen:t.isMenuOpen,onInput:F,onEnter:H,onTab:te,onClear:W,onBlur:I,onKeypress:X,onPaste:A,onFocus:N,openMenu:()=>Y.$emit("open"),closeMenu:()=>Y.$emit("close"),toggleMenu:()=>Y.$emit("toggle")}):ce("",!0),Y.$slots["dp-input"]?ce("",!0):(D(),V("input",{key:1,id:Y.uid?`dp-input-${Y.uid}`:void 0,ref_key:"inputRef",ref:y,"data-test":"dp-input",name:Y.name,class:Me(w.value),inputmode:Q(r).enabled?"text":"none",placeholder:Y.placeholder,disabled:Y.disabled,readonly:Y.readonly,required:Y.required,value:t.inputValue,autocomplete:Y.autocomplete,"aria-disabled":Y.disabled||void 0,"aria-invalid":Y.state===!1?!0:void 0,onInput:F,onBlur:I,onFocus:N,onKeypress:X,onKeydown:Z[0]||(Z[0]=le=>X(le,!0)),onPaste:A},null,42,SV)),g("div",{onClick:Z[3]||(Z[3]=le=>i("toggle"))},[Y.$slots["input-icon"]&&!Y.hideInputIcon?(D(),V("span",{key:0,class:"dp__input_icon",onClick:Z[1]||(Z[1]=le=>i("toggle"))},[Ne(Y.$slots,"input-icon")])):ce("",!0),!Y.$slots["input-icon"]&&!Y.hideInputIcon&&!Y.$slots["dp-input"]?(D(),Ce(Q(Ul),{key:1,"aria-label":(M=Q(o))==null?void 0:M.calendarIcon,class:"dp__input_icon dp__input_icons",onClick:Z[2]||(Z[2]=le=>i("toggle"))},null,8,["aria-label"])):ce("",!0)]),Y.$slots["clear-icon"]&&t.inputValue&&Y.clearable&&!Y.disabled&&!Y.readonly?(D(),V("span",CV,[Ne(Y.$slots,"clear-icon",{clear:W})])):ce("",!0),Y.clearable&&!Y.$slots["clear-icon"]&&t.inputValue&&!Y.disabled&&!Y.readonly?(D(),V("button",{key:3,ref_key:"clearBtnRef",ref:C,"aria-label":(ie=Q(o))==null?void 0:ie.clearInput,class:"dp--clear-btn",type:"button",onBlur:Z[4]||(Z[4]=le=>b.value=!1),onKeydown:Z[5]||(Z[5]=le=>Q(Qn)(le,()=>W(le),!0,ue)),onClick:Z[6]||(Z[6]=iu(le=>W(le),["prevent"]))},[B(Q(KS),{class:"dp__input_icons","data-test":"clear-icon"})],40,TV)):ce("",!0)])):ce("",!0)])}}}),AV=typeof window<"u"?window:void 0,Wg=()=>{},MV=t=>ef()?(e_(t),!0):!1,IV=(t,e,n,i)=>{if(!t)return Wg;let s=Wg;const r=fn(()=>Q(t),a=>{s(),a&&(a.addEventListener(e,n,i),s=()=>{a.removeEventListener(e,n,i),s=Wg})},{immediate:!0,flush:"post"}),o=()=>{r(),s()};return MV(o),o},PV=(t,e,n,i={})=>{const{window:s=AV,event:r="pointerdown"}=i;return s?IV(s,r,o=>{const a=mn(t),l=mn(e);!a||!l||a===o.target||o.composedPath().includes(a)||o.composedPath().includes(l)||n(o)},{passive:!0}):void 0},RV=cn({compatConfig:{MODE:3},__name:"VueDatePicker",props:{..._f},emits:["update:model-value","update:model-timezone-value","text-submit","closed","cleared","open","focus","blur","internal-model-change","recalculate-position","flow-step","update-month-year","invalid-select","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","date-update","invalid-date","overlay-toggle","text-input"],setup(t,{expose:e,emit:n}){const i=n,s=t,r=pa(),o=we(!1),a=Zc(s,"modelValue"),l=Zc(s,"timezone"),c=we(null),u=we(null),d=we(null),h=we(!1),f=we(null),p=we(!1),m=we(!1),y=we(!1),v=we(!1),{setMenuFocused:b,setShiftKey:E}=rC(),{clearArrowNav:C}=mo(),{validateDate:w,isValidTime:x}=_o(s),{defaultedTransitions:T,defaultedTextInput:k,defaultedInline:A,defaultedConfig:P,defaultedRange:F,defaultedMultiDates:H}=Wt(s),{menuTransition:te,showTransition:N}=Nu(T);xn(()=>{ie(s.modelValue),Rn().then(()=>{if(!A.value.enabled){const he=ue(f.value);he?.addEventListener("scroll",K),window?.addEventListener("resize",U)}}),A.value.enabled&&(o.value=!0),window?.addEventListener("keyup",re),window?.addEventListener("keydown",j)}),Yl(()=>{if(!A.value.enabled){const he=ue(f.value);he?.removeEventListener("scroll",K),window?.removeEventListener("resize",U)}window?.removeEventListener("keyup",re),window?.removeEventListener("keydown",j)});const L=ki(r,"all",s.presetDates),I=ki(r,"input");fn([a,l],()=>{ie(a.value)},{deep:!0});const{openOnTop:W,menuStyle:X,xCorrect:J,setMenuPosition:ne,getScrollableParent:ue,shadowRender:Y}=yV({menuRef:c,menuRefInner:u,inputRef:d,pickerWrapperRef:f,inline:A,emit:i,props:s,slots:r}),{inputValue:Z,internalModelValue:M,parseExternalModelValue:ie,emitModelValue:le,formatInputValue:$,checkBeforeEmit:oe}=u4(i,s,h),de=be(()=>({dp__main:!0,dp__theme_dark:s.dark,dp__theme_light:!s.dark,dp__flex_display:A.value.enabled,"dp--flex-display-collapsed":y.value,dp__flex_display_with_input:A.value.input})),ve=be(()=>s.dark?"dp__theme_dark":"dp__theme_light"),z=be(()=>s.teleport?{to:typeof s.teleport=="boolean"?"body":s.teleport,disabled:!s.teleport||A.value.enabled}:{}),ge=be(()=>({class:"dp__outer_menu_wrap"})),S=be(()=>A.value.enabled&&(s.timePicker||s.monthPicker||s.yearPicker||s.quarterPicker)),O=()=>{var he,ke;return(ke=(he=d.value)==null?void 0:he.$el)==null?void 0:ke.getBoundingClientRect()},K=()=>{o.value&&(P.value.closeOnScroll?Be():ne())},U=()=>{var he;o.value&&ne();const ke=(he=u.value)==null?void 0:he.$el.getBoundingClientRect().width;y.value=document.body.offsetWidth<=ke},re=he=>{he.key==="Tab"&&!A.value.enabled&&!s.teleport&&P.value.tabOutClosesMenu&&(f.value.contains(document.activeElement)||Be()),m.value=he.shiftKey},j=he=>{m.value=he.shiftKey},se=()=>{!s.disabled&&!s.readonly&&(Y(Mb,s),ne(!1),o.value=!0,o.value&&i("open"),o.value||ze(),ie(s.modelValue))},ee=()=>{var he;Z.value="",ze(),(he=d.value)==null||he.setParsedDate(null),i("update:model-value",null),i("update:model-timezone-value",null),i("cleared"),P.value.closeOnClearValue&&Be()},fe=()=>{const he=M.value;return!he||!Array.isArray(he)&&w(he)?!0:Array.isArray(he)?H.value.enabled||he.length===2&&w(he[0])&&w(he[1])?!0:F.value.partialRange&&!s.timePicker?w(he[0]):!1:!1},me=()=>{oe()&&fe()?(le(),Be()):i("invalid-select",M.value)},pe=he=>{Le(),le(),P.value.closeOnAutoApply&&!he&&Be()},Le=()=>{d.value&&k.value.enabled&&d.value.setParsedDate(M.value)},Ae=(he=!1)=>{s.autoApply&&x(M.value)&&fe()&&(F.value.enabled&&Array.isArray(M.value)?(F.value.partialRange||M.value.length===2)&&pe(he):pe(he))},ze=()=>{k.value.enabled||(M.value=null)},Be=()=>{A.value.enabled||(o.value&&(o.value=!1,J.value=!1,b(!1),E(!1),C(),i("closed"),Z.value&&ie(a.value)),ze(),i("blur"))},it=(he,ke,De=!1)=>{if(!he){M.value=null;return}const Ht=Array.isArray(he)?!he.some(Di=>!w(Di)):w(he),un=x(he);Ht&&un&&(v.value=!0,M.value=he,ke&&(p.value=De,me(),i("text-submit")),Rn().then(()=>{v.value=!1}))},Ze=()=>{s.autoApply&&x(M.value)&&le(),Le()},Mt=()=>o.value?Be():se(),gn=he=>{M.value=he},Un=()=>{k.value.enabled&&(h.value=!0,$()),i("focus")},Ri=()=>{if(k.value.enabled&&(h.value=!1,ie(s.modelValue),p.value)){const he=NB(f.value,m.value);he?.focus()}i("blur")},wi=he=>{u.value&&u.value.updateMonthYear(0,{month:xb(he.month),year:xb(he.year)})},Xi=he=>{ie(he??s.modelValue)},Ut=(he,ke)=>{var De;(De=u.value)==null||De.switchView(he,ke)},ae=he=>P.value.onClickOutside?P.value.onClickOutside(he):Be(),Te=(he=0)=>{var ke;(ke=u.value)==null||ke.handleFlow(he)};return PV(c,d,()=>ae(fe)),e({closeMenu:Be,selectDate:me,clearValue:ee,openMenu:se,onScroll:K,formatInputValue:$,updateInternalModelValue:gn,setMonthYear:wi,parseModel:Xi,switchView:Ut,toggleMenu:Mt,handleFlow:Te,dpWrapMenuRef:c}),(he,ke)=>(D(),V("div",{ref_key:"pickerWrapperRef",ref:f,class:Me(de.value),"data-datepicker-instance":""},[B(kV,yn({ref_key:"inputRef",ref:d,"input-value":Q(Z),"onUpdate:inputValue":ke[0]||(ke[0]=De=>Qt(Z)?Z.value=De:null),"is-menu-open":o.value},he.$props,{onClear:ee,onOpen:se,onSetInputDate:it,onSetEmptyDate:Q(le),onSelectDate:me,onToggle:Mt,onClose:Be,onFocus:Un,onBlur:Ri,onRealBlur:ke[1]||(ke[1]=De=>h.value=!1),onTextInput:ke[2]||(ke[2]=De=>he.$emit("text-input",De))}),jn({_:2},[Xe(Q(I),(De,Ht)=>({name:De,fn:Re(un=>[Ne(he.$slots,De,In(Zn(un)))])}))]),1040,["input-value","is-menu-open","onSetEmptyDate"]),(D(),Ce(ga(he.teleport?tD:"div"),In(Zn(z.value)),{default:Re(()=>[B(Rt,{name:Q(te)(Q(W)),css:Q(N)&&!Q(A).enabled},{default:Re(()=>[o.value?(D(),V("div",yn({key:0,ref_key:"dpWrapMenuRef",ref:c},ge.value,{class:{"dp--menu-wrapper":!Q(A).enabled},style:Q(A).enabled?void 0:Q(X)}),[B(Mb,yn({ref_key:"dpMenuRef",ref:u},he.$props,{"internal-model-value":Q(M),"onUpdate:internalModelValue":ke[3]||(ke[3]=De=>Qt(M)?M.value=De:null),class:{[ve.value]:!0,"dp--menu-wrapper":he.teleport},"open-on-top":Q(W),"no-overlay-focus":S.value,collapse:y.value,"get-input-rect":O,"is-text-input-date":v.value,onClosePicker:Be,onSelectDate:me,onAutoApply:Ae,onTimeUpdate:Ze,onFlowStep:ke[4]||(ke[4]=De=>he.$emit("flow-step",De)),onUpdateMonthYear:ke[5]||(ke[5]=De=>he.$emit("update-month-year",De)),onInvalidSelect:ke[6]||(ke[6]=De=>he.$emit("invalid-select",Q(M))),onAutoApplyInvalid:ke[7]||(ke[7]=De=>he.$emit("invalid-select",De)),onInvalidFixedRange:ke[8]||(ke[8]=De=>he.$emit("invalid-fixed-range",De)),onRecalculatePosition:Q(ne),onTooltipOpen:ke[9]||(ke[9]=De=>he.$emit("tooltip-open",De)),onTooltipClose:ke[10]||(ke[10]=De=>he.$emit("tooltip-close",De)),onTimePickerOpen:ke[11]||(ke[11]=De=>he.$emit("time-picker-open",De)),onTimePickerClose:ke[12]||(ke[12]=De=>he.$emit("time-picker-close",De)),onAmPmChange:ke[13]||(ke[13]=De=>he.$emit("am-pm-change",De)),onRangeStart:ke[14]||(ke[14]=De=>he.$emit("range-start",De)),onRangeEnd:ke[15]||(ke[15]=De=>he.$emit("range-end",De)),onDateUpdate:ke[16]||(ke[16]=De=>he.$emit("date-update",De)),onInvalidDate:ke[17]||(ke[17]=De=>he.$emit("invalid-date",De)),onOverlayToggle:ke[18]||(ke[18]=De=>he.$emit("overlay-toggle",De))}),jn({_:2},[Xe(Q(L),(De,Ht)=>({name:De,fn:Re(un=>[Ne(he.$slots,De,In(Zn({...un})))])}))]),1040,["internal-model-value","class","open-on-top","no-overlay-focus","collapse","is-text-input-date","onRecalculatePosition"])],16)):ce("",!0)]),_:3},8,["name","css"])]),_:3},16))],2))}}),Bu=(()=>{const t=RV;return t.install=e=>{e.component("Vue3DatePicker",t)},t})(),DV=Object.freeze(Object.defineProperty({__proto__:null,default:Bu},Symbol.toStringTag,{value:"Module"}));Object.entries(DV).forEach(([t,e])=>{t!=="default"&&(Bu[t]=e)});const $V={name:"newDashboardAPIKey",components:{LocaleText:Qe,VueDatePicker:Bu},data(){return{newKeyData:{ExpiredAt:pi().add(7,"d").format("YYYY-MM-DD HH:mm:ss"),neverExpire:!1},submitting:!1}},setup(){return{store:nt()}},mounted(){console.log(this.newKeyData.ExpiredAt)},methods:{submitNewAPIKey(){this.submitting=!0,kt("/api/newDashboardAPIKey",this.newKeyData,t=>{t.status?(this.$emit("created",t.data),this.store.newMessage("Server","API Key created","success"),this.$emit("close")):this.store.newMessage("Server",t.message,"danger"),this.submitting=!1})},fixDate(t){return console.log(pi(t).format("YYYY-MM-DDTHH:mm:ss")),pi(t).format("YYYY-MM-DDTHH:mm:ss")},parseTime(t){t?this.newKeyData.ExpiredAt=pi(t).format("YYYY-MM-DD HH:mm:ss"):this.newKeyData.ExpiredAt=void 0}}},LV={class:"position-absolute w-100 h-100 top-0 start-0 rounded-bottom-3 p-3 d-flex",style:{"background-color":"#00000060","backdrop-filter":"blur(3px)"}},OV={class:"card m-auto rounded-3 mt-5"},NV={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-0"},FV={class:"mb-0"},BV={class:"card-body d-flex gap-2 p-4 flex-column"},VV={class:"text-muted"},zV={class:"d-flex align-items-center gap-2"},WV={class:"form-check"},HV=["disabled"],YV={class:"form-check-label",for:"neverExpire"},jV=g("i",{class:"bi bi-emoji-grimace-fill me-2"},null,-1),KV={key:0,class:"bi bi-check-lg me-2"};function UV(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("VueDatePicker");return D(),V("div",LV,[g("div",OV,[g("div",NV,[g("h6",FV,[B(o,{t:"Create API Key"})]),g("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=l=>this.$emit("close"))})]),g("div",BV,[g("small",VV,[B(o,{t:"When should this API Key expire?"})]),g("div",zV,[B(a,{is24:!0,"min-date":new Date,"model-value":this.newKeyData.ExpiredAt,"onUpdate:modelValue":this.parseTime,"time-picker-inline":"",format:"yyyy-MM-dd HH:mm:ss","preview-format":"yyyy-MM-dd HH:mm:ss",clearable:!1,disabled:this.newKeyData.neverExpire||this.submitting,dark:this.store.Configuration.Server.dashboard_theme==="dark"},null,8,["min-date","model-value","onUpdate:modelValue","disabled","dark"])]),g("div",WV,[Oe(g("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[1]||(e[1]=l=>this.newKeyData.neverExpire=l),id:"neverExpire",disabled:this.submitting},null,8,HV),[[Jn,this.newKeyData.neverExpire]]),g("label",YV,[B(o,{t:"Never Expire"}),Ye(" ("),jV,B(o,{t:"Don't think that's a good idea"}),Ye(") ")])]),g("button",{class:Me(["ms-auto btn bg-success-subtle text-success-emphasis border-1 border-success-subtle rounded-3 shadow-sm",{disabled:this.submitting}]),onClick:e[2]||(e[2]=l=>this.submitNewAPIKey())},[this.submitting?ce("",!0):(D(),V("i",KV)),this.submitting?(D(),Ce(o,{key:1,t:"Creating..."})):(D(),Ce(o,{key:2,t:"Create"}))],2)])])])}const GV=He($V,[["render",UV]]),XV={name:"dashboardAPIKey",components:{LocaleText:Qe},props:{apiKey:Object},setup(){return{store:nt()}},data(){return{confirmDelete:!1}},methods:{deleteAPIKey(){kt("/api/deleteDashboardAPIKey",{Key:this.apiKey.Key},t=>{t.status?(this.$emit("deleted",t.data),this.store.newMessage("Server","API Key deleted","success")):this.store.newMessage("Server",t.message,"danger")})}}},j_=t=>(bn("data-v-a76253c8"),t=t(),wn(),t),qV={class:"card rounded-3 shadow-sm"},ZV={key:0,class:"card-body d-flex gap-3 align-items-center apiKey-card-body"},JV={class:"d-flex align-items-center gap-2"},QV={class:"text-muted"},e6={style:{"word-break":"break-all"}},t6={class:"d-flex align-items-center gap-2 ms-auto"},n6={class:"text-muted"},i6=j_(()=>g("i",{class:"bi bi-trash-fill"},null,-1)),s6=[i6],r6={key:0,class:"card-body d-flex gap-3 align-items-center justify-content-end"},o6=j_(()=>g("i",{class:"bi bi-check-lg"},null,-1)),a6=[o6],l6=j_(()=>g("i",{class:"bi bi-x-lg"},null,-1)),c6=[l6];function u6(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",qV,[this.confirmDelete?(D(),V($e,{key:1},[this.store.getActiveCrossServer()?ce("",!0):(D(),V("div",r6,[B(o,{t:"Are you sure to delete this API key?"}),g("a",{role:"button",class:"btn btn-sm bg-success-subtle text-success-emphasis rounded-3",onClick:e[1]||(e[1]=a=>this.deleteAPIKey())},a6),g("a",{role:"button",class:"btn btn-sm bg-secondary-subtle text-secondary-emphasis rounded-3",onClick:e[2]||(e[2]=a=>this.confirmDelete=!1)},c6)]))],64)):(D(),V("div",ZV,[g("div",JV,[g("small",QV,[B(o,{t:"Key"})]),g("span",e6,xe(this.apiKey.Key),1)]),g("div",t6,[g("small",n6,[B(o,{t:"Expire At"})]),this.apiKey.ExpiredAt?ce("",!0):(D(),Ce(o,{key:0,t:"Never Expire"})),g("span",null,xe(this.apiKey.ExpiredAt),1)]),this.store.getActiveCrossServer()?ce("",!0):(D(),V("a",{key:0,role:"button",class:"btn btn-sm bg-danger-subtle text-danger-emphasis rounded-3",onClick:e[0]||(e[0]=a=>this.confirmDelete=!0)},s6))]))])}const d6=He(XV,[["render",u6],["__scopeId","data-v-a76253c8"]]),h6={name:"dashboardAPIKeys",components:{LocaleText:Qe,DashboardAPIKey:d6,NewDashboardAPIKey:GV},setup(){return{store:nt()}},data(){return{value:this.store.Configuration.Server.dashboard_api_key,apiKeys:[],newDashboardAPIKey:!1}},methods:{async toggleDashboardAPIKeys(){await kt("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_api_key",value:this.value},t=>{t.status?(this.store.Configuration.Peers[this.targetData]=this.value,this.store.newMessage("Server",`API Keys function is successfully ${this.value?"enabled":"disabled"}`,"success")):(this.value=this.store.Configuration.Peers[this.targetData],this.store.newMessage("Server",`API Keys function is failed to ${this.value?"enabled":"disabled"}`,"danger"))})}},watch:{value:{immediate:!0,handler(t){t?Vt("/api/getDashboardAPIKeys",{},e=>{console.log(e),e.status?this.apiKeys=e.data:(this.apiKeys=[],this.store.newMessage("Server",e.message,"danger"))}):this.apiKeys=[]}}}},f6=t=>(bn("data-v-167c06a6"),t=t(),wn(),t),g6={class:"card mb-4 shadow rounded-3"},p6={class:"card-header d-flex"},m6={key:0,class:"form-check form-switch ms-auto"},_6={class:"form-check-label",for:"allowAPIKeysSwitch"},y6={key:0,class:"card-body position-relative d-flex flex-column gap-2"},v6=f6(()=>g("i",{class:"bi bi-plus-circle-fill me-2"},null,-1)),b6={key:1,class:"card",style:{height:"300px"}},w6={class:"card-body d-flex text-muted"},x6={class:"m-auto"},E6={key:2,class:"d-flex flex-column gap-2 position-relative",style:{"min-height":"300px"}};function S6(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("DashboardAPIKey"),l=Se("NewDashboardAPIKey");return D(),V("div",g6,[g("div",p6,[B(o,{t:"API Keys"}),this.store.getActiveCrossServer()?ce("",!0):(D(),V("div",m6,[Oe(g("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[0]||(e[0]=c=>this.value=c),onChange:e[1]||(e[1]=c=>this.toggleDashboardAPIKeys()),role:"switch",id:"allowAPIKeysSwitch"},null,544),[[Jn,this.value]]),g("label",_6,[this.value?(D(),Ce(o,{key:0,t:"Enabled"})):(D(),Ce(o,{key:1,t:"Disabled"}))])]))]),this.value?(D(),V("div",y6,[this.store.getActiveCrossServer()?ce("",!0):(D(),V("button",{key:0,class:"ms-auto btn bg-primary-subtle text-primary-emphasis border-1 border-primary-subtle rounded-3 shadow-sm",onClick:e[2]||(e[2]=c=>this.newDashboardAPIKey=!0)},[v6,B(o,{t:"API Key"})])),this.apiKeys.length===0?(D(),V("div",b6,[g("div",w6,[g("span",x6,[B(o,{t:"No WGDashboard API Key"})])])])):(D(),V("div",E6,[B(jl,{name:"apiKey"},{default:Re(()=>[(D(!0),V($e,null,Xe(this.apiKeys,c=>(D(),Ce(a,{apiKey:c,key:c.Key,onDeleted:e[3]||(e[3]=u=>this.apiKeys=u)},null,8,["apiKey"]))),128))]),_:1})])),B(Rt,{name:"zoomReversed"},{default:Re(()=>[this.newDashboardAPIKey?(D(),Ce(l,{key:0,onCreated:e[4]||(e[4]=c=>this.apiKeys=c),onClose:e[5]||(e[5]=c=>this.newDashboardAPIKey=!1)})):ce("",!0)]),_:1})])):ce("",!0)])}const C6=He(h6,[["render",S6],["__scopeId","data-v-167c06a6"]]),T6={name:"accountSettingsMFA",components:{LocaleText:Qe},setup(){const t=nt(),e=`input_${Os()}`;return{store:t,uuid:e}},data(){return{status:!1}},mounted(){this.status=this.store.Configuration.Account.enable_totp},methods:{async resetMFA(){await kt("/api/updateDashboardConfigurationItem",{section:"Account",key:"totp_verified",value:"false"},async t=>{await kt("/api/updateDashboardConfigurationItem",{section:"Account",key:"enable_totp",value:"false"},e=>{e.status&&this.$router.push("/2FASetup")})})}}},k6={class:"d-flex align-items-center"},A6={class:"form-check form-switch ms-3"},M6=g("i",{class:"bi bi-shield-lock-fill me-2"},null,-1);function I6(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",null,[g("div",k6,[g("strong",null,[B(o,{t:"Multi-Factor Authentication (MFA)"})]),g("div",A6,[Oe(g("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[0]||(e[0]=a=>this.status=a),role:"switch",id:"allowMFAKeysSwitch"},null,512),[[Jn,this.status]])]),this.status?(D(),V("button",{key:0,class:"btn bg-warning-subtle text-warning-emphasis border-1 border-warning-subtle ms-auto rounded-3 shadow-sm",onClick:e[1]||(e[1]=a=>this.resetMFA())},[M6,this.store.Configuration.Account.totp_verified?(D(),Ce(o,{key:0,t:"Reset"})):(D(),Ce(o,{key:1,t:"Setup"})),Ye(" MFA ")])):ce("",!0)])])}const P6=He(T6,[["render",I6]]),R6={name:"dashboardLanguage",components:{LocaleText:Qe},setup(){return{store:nt()}},data(){return{languages:void 0}},mounted(){Vt("/api/locale/available",{},t=>{this.languages=t.data})},methods:{changeLanguage(t){kt("/api/locale/update",{lang_id:t},e=>{e.status?(this.store.Configuration.Server.dashboard_language=t,this.store.Locale=e.data):this.store.newMessage("Server","Dashboard language update failed","danger")})}},computed:{currentLanguage(){let t=this.store.Configuration.Server.dashboard_language;return this.languages.find(e=>e.lang_id===t)}}},D6={class:"card mb-4 shadow rounded-3"},$6={class:"card-header"},L6={class:"card-body d-flex gap-2"},O6={class:"dropdown w-100"},N6=["disabled"],F6={key:1},B6={class:"dropdown-menu rounded-3 shadow",style:{width:"500px"}},V6=["onClick"],z6={class:"me-auto mb-0"},W6={class:"d-block",style:{"font-size":"0.8rem"}},H6={key:0,class:"bi bi-check text-primary fs-5"};function Y6(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",D6,[g("p",$6,[B(o,{t:"Dashboard Language"})]),g("div",L6,[g("div",O6,[g("button",{class:"btn bg-primary-subtle text-primary-emphasis dropdown-toggle w-100 rounded-3",disabled:!this.languages,type:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[this.languages?(D(),V("span",F6,xe(r.currentLanguage?.lang_name_localized),1)):(D(),Ce(o,{key:0,t:"Loading..."}))],8,N6),g("ul",B6,[(D(!0),V($e,null,Xe(this.languages,a=>(D(),V("li",null,[g("a",{class:"dropdown-item d-flex align-items-center",role:"button",onClick:l=>this.changeLanguage(a.lang_id)},[g("p",z6,[Ye(xe(a.lang_name_localized)+" ",1),g("small",W6,xe(a.lang_name),1)]),r.currentLanguage?.lang_id===a.lang_id?(D(),V("i",H6)):ce("",!0)],8,V6)]))),256))])])])])}const j6=He(R6,[["render",Y6]]),K6={name:"dashboardIPPortInput",components:{LocaleText:Qe},setup(){return{store:nt()}},data(){return{ipAddress:"",port:0,invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.ipAddress=this.store.Configuration.Server.app_ip,this.port=this.store.Configuration.Server.app_port},methods:{async useValidation(t,e,n){console.log(t),this.changed&&(this.updating=!0,await kt("/api/updateDashboardConfigurationItem",{section:"Server",key:e,value:n},i=>{i.status?(t.target.classList.add("is-valid"),this.showInvalidFeedback=!1,this.store.Configuration.Server[e]=n,clearTimeout(this.timeout),this.timeout=setTimeout(()=>{t.target.classList.remove("is-valid")},5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=i.message),this.changed=!1,this.updating=!1}))}}},U6={class:"card mb-4 shadow rounded-3"},G6={class:"card-header"},X6={class:"card-body"},q6={class:"row gx-3"},Z6={class:"col-sm"},J6={class:"form-group mb-2"},Q6={for:"input_dashboard_ip",class:"text-muted mb-1"},ez=["disabled"],tz={class:"invalid-feedback"},nz={class:"col-sm"},iz={class:"form-group mb-2"},sz={for:"input_dashboard_ip",class:"text-muted mb-1"},rz=["disabled"],oz={class:"invalid-feedback"},az={class:"px-2 py-1 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2 d-inline-block mt-1 mb-2"},lz=g("i",{class:"bi bi-exclamation-triangle-fill me-2"},null,-1);function cz(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",U6,[g("p",G6,[B(o,{t:"Dashboard IP Address & Port"})]),g("div",X6,[g("div",q6,[g("div",Z6,[g("div",J6,[g("label",Q6,[g("strong",null,[g("small",null,[B(o,{t:"IP Address"})])])]),Oe(g("input",{type:"text",class:Me(["form-control",{"is-invalid":s.showInvalidFeedback,"is-valid":s.isValid}]),id:"input_dashboard_ip","onUpdate:modelValue":e[0]||(e[0]=a=>this.ipAddress=a),onKeydown:e[1]||(e[1]=a=>this.changed=!0),onBlur:e[2]||(e[2]=a=>r.useValidation(a,"app_ip",this.ipAddress)),disabled:this.updating},null,42,ez),[[Ke,this.ipAddress]]),g("div",tz,xe(this.invalidFeedback),1)])]),g("div",nz,[g("div",iz,[g("label",sz,[g("strong",null,[g("small",null,[B(o,{t:"Listen Port"})])])]),Oe(g("input",{type:"number",class:Me(["form-control",{"is-invalid":s.showInvalidFeedback,"is-valid":s.isValid}]),id:"input_dashboard_ip","onUpdate:modelValue":e[3]||(e[3]=a=>this.port=a),onKeydown:e[4]||(e[4]=a=>this.changed=!0),onBlur:e[5]||(e[5]=a=>r.useValidation(a,"app_port",this.port)),disabled:this.updating},null,42,rz),[[Ke,this.port]]),g("div",oz,xe(this.invalidFeedback),1)])])]),g("div",az,[g("small",null,[lz,B(o,{t:"Currently, you will need to manually restart WGDashboard to apply changes on IP Address and Listen Port"})])])])])}const uz=He(K6,[["render",cz]]),dz={name:"settings",methods:{ipV46RegexCheck:u3},components:{DashboardIPPortInput:uz,DashboardLanguage:j6,LocaleText:Qe,AccountSettingsMFA:P6,DashboardAPIKeys:C6,DashboardSettingsInputIPAddressAndPort:xF,DashboardTheme:rF,DashboardSettingsInputWireguardConfigurationPath:Z3,AccountSettingsInputPassword:N3,AccountSettingsInputUsername:_3,PeersDefaultSettingsInput:c3},setup(){return{dashboardConfigurationStore:nt()}}},hz={class:"mt-md-5 mt-3"},fz={class:"container-md"},gz={class:"mb-3 text-body"},pz={class:"card mb-4 shadow rounded-3"},mz={class:"card-header"},_z={class:"card-body"},yz={class:"card mb-4 shadow rounded-3"},vz={class:"card-header"},bz={class:"card-body"},wz=g("hr",{class:"mb-4"},null,-1),xz={class:"row gx-4"},Ez={class:"col-sm"},Sz={class:"col-sm"},Cz={class:"card mb-4 shadow rounded-3"},Tz={class:"card-header"},kz={class:"card-body d-flex gap-4 flex-column"},Az=g("hr",{class:"m-0"},null,-1),Mz={key:0,class:"m-0"};function Iz(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("PeersDefaultSettingsInput"),l=Se("DashboardSettingsInputWireguardConfigurationPath"),c=Se("DashboardTheme"),u=Se("DashboardLanguage"),d=Se("DashboardIPPortInput"),h=Se("AccountSettingsInputUsername"),f=Se("AccountSettingsInputPassword"),p=Se("AccountSettingsMFA"),m=Se("DashboardAPIKeys");return D(),V("div",hz,[g("div",fz,[g("h3",gz,[B(o,{t:"Settings"})]),g("div",pz,[g("p",mz,[B(o,{t:"Peers Default Settings"})]),g("div",_z,[B(a,{targetData:"peer_global_dns",title:"DNS"}),B(a,{targetData:"peer_endpoint_allowed_ip",title:"Endpoint Allowed IPs"}),B(a,{targetData:"peer_mtu",title:"MTU"}),B(a,{targetData:"peer_keep_alive",title:"Persistent Keepalive"}),B(a,{targetData:"remote_endpoint",title:"Peer Remote Endpoint",warning:!0,warningText:"This will be changed globally, and will be apply to all peer's QR code and configuration file."})])]),g("div",yz,[g("p",vz,[B(o,{t:"WireGuard Configurations Settings"})]),g("div",bz,[B(l,{targetData:"wg_conf_path",title:"Configurations Directory",warning:!0,"warning-text":"Remember to remove / at the end of your path. e.g /etc/wireguard"})])]),wz,g("div",xz,[g("div",Ez,[B(c)]),g("div",Sz,[B(u)])]),B(d),g("div",Cz,[g("p",Tz,[B(o,{t:"WGDashboard Account Settings"})]),g("div",kz,[B(h,{targetData:"username",title:"Username"}),Az,B(f,{targetData:"password"}),this.dashboardConfigurationStore.getActiveCrossServer()?ce("",!0):(D(),V("hr",Mz)),this.dashboardConfigurationStore.getActiveCrossServer()?ce("",!0):(D(),Ce(p,{key:1}))])]),B(m)])])}const Pz=He(dz,[["render",Iz]]),Rz={name:"setup",components:{LocaleText:Qe},setup(){return{store:nt()}},data(){return{setup:{username:"",newPassword:"",repeatNewPassword:"",enable_totp:!0},loading:!1,errorMessage:"",done:!1}},computed:{goodToSubmit(){return this.setup.username&&this.setup.newPassword.length>=8&&this.setup.repeatNewPassword.length>=8&&this.setup.newPassword===this.setup.repeatNewPassword}},methods:{submit(){this.loading=!0,kt("/api/Welcome_Finish",this.setup,t=>{t.status?(this.done=!0,this.$router.push("/2FASetup")):(document.querySelectorAll("#createAccount input").forEach(e=>e.classList.add("is-invalid")),this.errorMessage=t.message,document.querySelector(".login-container-fluid").scrollTo({top:0,left:0,behavior:"smooth"})),this.loading=!1})}}},Dz=["data-bs-theme"],$z={class:"m-auto text-body",style:{width:"500px"}},Lz={class:"dashboardLogo display-4"},Oz={class:"mb-5"},Nz={key:0,class:"alert alert-danger"},Fz={class:"d-flex flex-column gap-3"},Bz={id:"createAccount",class:"d-flex flex-column gap-2"},Vz={class:"form-group text-body"},zz={for:"username",class:"mb-1 text-muted"},Wz={class:"form-group text-body"},Hz={for:"password",class:"mb-1 text-muted"},Yz={class:"form-group text-body"},jz={for:"confirmPassword",class:"mb-1 text-muted"},Kz=["disabled"],Uz={key:0,class:"d-flex align-items-center w-100"},Gz=g("i",{class:"bi bi-chevron-right ms-auto"},null,-1),Xz={key:1,class:"d-flex align-items-center w-100"},qz=g("span",{class:"spinner-border ms-auto spinner-border-sm",role:"status"},[g("span",{class:"visually-hidden"},"Loading...")],-1);function Zz(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",{class:"container-fluid login-container-fluid d-flex main pt-5 overflow-scroll","data-bs-theme":this.store.Configuration.Server.dashboard_theme},[g("div",$z,[g("span",Lz,[B(o,{t:"Nice to meet you!"})]),g("p",Oz,[B(o,{t:"Please fill in the following fields to finish setup"}),Ye(" 😊")]),g("div",null,[g("h3",null,[B(o,{t:"Create an account"})]),this.errorMessage?(D(),V("div",Nz,xe(this.errorMessage),1)):ce("",!0),g("div",Fz,[g("form",Bz,[g("div",Vz,[g("label",zz,[g("small",null,[B(o,{t:"Enter an username you like"})])]),Oe(g("input",{type:"text",autocomplete:"username","onUpdate:modelValue":e[0]||(e[0]=a=>this.setup.username=a),class:"form-control",id:"username",name:"username",required:""},null,512),[[Ke,this.setup.username]])]),g("div",Wz,[g("label",Hz,[g("small",null,[B(o,{t:"Enter a password"}),g("code",null,[B(o,{t:"(At least 8 characters and make sure is strong enough!)"})])])]),Oe(g("input",{type:"password",autocomplete:"new-password","onUpdate:modelValue":e[1]||(e[1]=a=>this.setup.newPassword=a),class:"form-control",id:"password",name:"password",required:""},null,512),[[Ke,this.setup.newPassword]])]),g("div",Yz,[g("label",jz,[g("small",null,[B(o,{t:"Confirm password"})])]),Oe(g("input",{type:"password",autocomplete:"confirm-new-password","onUpdate:modelValue":e[2]||(e[2]=a=>this.setup.repeatNewPassword=a),class:"form-control",id:"confirmPassword",name:"confirmPassword",required:""},null,512),[[Ke,this.setup.repeatNewPassword]])])]),g("button",{class:"btn btn-dark btn-lg mb-5 d-flex btn-brand shadow align-items-center",ref:"signInBtn",disabled:!this.goodToSubmit||this.loading||this.done,onClick:e[3]||(e[3]=a=>this.submit())},[!this.loading&&!this.done?(D(),V("span",Uz,[B(o,{t:"Next"}),Gz])):(D(),V("span",Xz,[B(o,{t:"Saving..."}),qz]))],8,Kz)])])])],8,Dz)}const Jz=He(Rz,[["render",Zz]]);function K_(t){return t.includes(":")?6:t.includes(".")?4:0}function Qz(t){const e=K_(t);if(!e)throw new Error(`Invalid IP address: ${t}`);let n=0n,i=0n;const s=Object.create(null);if(e===4)for(const r of t.split(".").map(BigInt).reverse())n+=r*2n**i,i+=8n;else{if(t.includes(".")&&(s.ipv4mapped=!0,t=t.split(":").map(a=>{if(a.includes(".")){const[l,c,u,d]=a.split(".").map(h=>Number(h).toString(16).padStart(2,"0"));return`${l}${c}:${u}${d}`}else return a}).join(":")),t.includes("%")){let a;[,t,a]=/(.+)%(.+)/.exec(t),s.scopeid=a}const r=t.split(":"),o=r.indexOf("");if(o!==-1)for(;r.length<8;)r.splice(o,0,"");for(const a of r.map(l=>BigInt(parseInt(l||0,16))).reverse())n+=a*2n**i,i+=16n}return s.number=n,s.version=e,s}const Ib={4:32,6:128},eW=t=>t.includes("/")?K_(t):0;function tW(t){const e=eW(t),n=Object.create(null);if(n.single=!1,e)n.cidr=t,n.version=e;else{const d=K_(t);if(d)n.cidr=`${t}/${Ib[d]}`,n.version=d,n.single=!0;else throw new Error(`Network is not a CIDR or IP: ${t}`)}const[i,s]=n.cidr.split("/");n.prefix=s;const{number:r,version:o}=Qz(i),a=Ib[o],l=r.toString(2).padStart(a,"0"),c=Number(a-s),u=l.substring(0,a-c);return n.start=BigInt(`0b${u}${"0".repeat(c)}`),n.end=BigInt(`0b${u}${"1".repeat(c)}`),n}/*! SPDX-License-Identifier: GPL-2.0 * * Copyright (C) 2015-2020 Jason A. Donenfeld . All Rights Reserved. - */(function(){function t(w){var x=new Float64Array(16);if(w)for(var T=0;T>16&1),k[P-1]&=65535;k[15]=A[15]-32767-(k[14]>>16&1),T=k[15]>>16&1,k[14]&=65535,i(A,k,1-T)}for(var P=0;P<16;++P)w[2*P]=A[P]&255,w[2*P+1]=A[P]>>8}function n(w){for(var x=0;x<16;++x)w[(x+1)%16]+=(x<15?1:38)*Math.floor(w[x]/65536),w[x]&=65535}function i(w,x,T){for(var k,A=~(T-1),P=0;P<16;++P)k=A&(w[P]^x[P]),w[P]^=k,x[P]^=k}function s(w,x,T){for(var k=0;k<16;++k)w[k]=x[k]+T[k]|0}function r(w,x,T){for(var k=0;k<16;++k)w[k]=x[k]-T[k]|0}function o(w,x,T){for(var k=new Float64Array(31),A=0;A<16;++A)for(var P=0;P<16;++P)k[A+P]+=x[A]*T[P];for(var A=0;A<15;++A)k[A]+=38*k[A+16];for(var A=0;A<16;++A)w[A]=k[A];n(w),n(w)}function a(w,x){for(var T=t(),k=0;k<16;++k)T[k]=x[k];for(var k=253;k>=0;--k)o(T,T,T),k!==2&&k!==4&&o(T,T,x);for(var k=0;k<16;++k)w[k]=T[k]}function l(w){w[31]=w[31]&127|64,w[0]&=248}function c(w){for(var x,T=new Uint8Array(32),k=t([1]),A=t([9]),P=t(),F=t([1]),H=t(),te=t(),N=t([56129,1]),L=t([9]),I=0;I<32;++I)T[I]=w[I];l(T);for(var I=254;I>=0;--I)x=T[I>>>3]>>>(I&7)&1,i(k,A,x),i(P,F,x),s(H,k,P),r(k,k,P),s(P,A,F),r(A,A,F),o(F,H,H),o(te,k,k),o(k,P,k),o(P,A,H),s(H,k,P),r(k,k,P),o(A,k,k),r(P,F,te),o(k,P,N),s(k,k,F),o(P,P,k),o(k,F,te),o(F,A,L),o(A,H,H),i(k,A,x),i(P,F,x);return a(P,P),o(k,k,P),e(T,k),T}function u(){var w=new Uint8Array(32);return window.crypto.getRandomValues(w),w}function d(){var w=u();return l(w),w}function h(w,x){for(var T=Uint8Array.from([x[0]>>2&63,(x[0]<<4|x[1]>>4)&63,(x[1]<<2|x[2]>>6)&63,x[2]&63]),k=0;k<4;++k)w[k]=T[k]+65+(25-T[k]>>8&6)-(51-T[k]>>8&75)-(61-T[k]>>8&15)+(62-T[k]>>8&3)}function f(w){var x,T=new Uint8Array(44);for(x=0;x<32/3;++x)h(T.subarray(x*4),w.subarray(x*3));return h(T.subarray(x*4),Uint8Array.from([w[x*3+0],w[x*3+1],0])),T[43]=61,String.fromCharCode.apply(null,T)}function p(w){let x=window.atob(w),T=x.length,k=new Uint8Array(T);for(let P=0;P>>8&255,x>>>16&255,x>>>24&255)}function y(w,x){w.push(x&255,x>>>8&255)}function v(w,x){for(var T=0;T>>1:x>>>1;E.table[T]=x}}for(var A=-1,P=0;P>>8^E.table[(A^w[P])&255];return(A^-1)>>>0}function C(w){for(var x=[],T=[],k=0,A=0;A{t.status?(this.success=!0,await this.store.getConfigurations(),this.$router.push(`/configuration/${this.newConfiguration.ConfigurationName}/peers`)):(this.error=!0,this.errorMessage=t.message,document.querySelector(`#${t.data}`).classList.remove("is-valid"),document.querySelector(`#${t.data}`).classList.add("is-invalid"),this.loading=!1)}))}},computed:{goodToSubmit(){let t=["ConfigurationName","Address","ListenPort","PrivateKey"],e=[...document.querySelectorAll("input[required]")];return t.find(n=>this.newConfiguration[n].length===0)===void 0&&e.find(n=>n.classList.contains("is-invalid"))===void 0}},watch:{"newConfiguration.Address"(t){let e=document.querySelector("#Address");e.classList.remove("is-invalid","is-valid");try{if(t.trim().split("/").filter(s=>s.length>0).length!==2)throw Error();let n=Rz(t),i=n.end-n.start;this.numberOfAvailableIPs=i.toLocaleString(),e.classList.add("is-valid")}catch{this.numberOfAvailableIPs="0",e.classList.add("is-invalid")}},"newConfiguration.ListenPort"(t){let e=document.querySelector("#ListenPort");e.classList.remove("is-invalid","is-valid"),t<0||t>65353||!Number.isInteger(t)?e.classList.add("is-invalid"):e.classList.add("is-valid")},"newConfiguration.ConfigurationName"(t){let e=document.querySelector("#ConfigurationName");e.classList.remove("is-invalid","is-valid"),!/^[a-zA-Z0-9_=+.-]{1,15}$/.test(t)||t.length===0||this.store.Configurations.find(n=>n.Name===t)?e.classList.add("is-invalid"):e.classList.add("is-valid")},"newConfiguration.PrivateKey"(t){let e=document.querySelector("#PrivateKey");e.classList.remove("is-invalid","is-valid");try{wireguard.generatePublicKey(t),e.classList.add("is-valid")}catch{e.classList.add("is-invalid")}}}},$z={class:"mt-5"},Lz={class:"container mb-4"},Oz={class:"mb-4 d-flex align-items-center gap-4"},Nz={class:"mb-0 text-body"},Fz=g("i",{class:"bi bi-chevron-left me-4"},null,-1),Bz={class:"card rounded-3 shadow"},Vz={class:"card-header"},zz={class:"card-body"},Wz=["disabled"],Hz={class:"invalid-feedback"},Yz={key:0},jz={key:1},Kz={class:"mb-0"},Uz={class:"card rounded-3 shadow"},Gz={class:"card-header"},Xz={class:"card-body",style:{"font-family":"var(--bs-font-monospace)"}},qz={class:"mb-2"},Zz={class:"text-muted fw-bold mb-1"},Jz={class:"input-group"},Qz=["disabled"],eW=g("i",{class:"bi bi-arrow-repeat"},null,-1),tW=[eW],nW={class:"text-muted fw-bold mb-1"},iW={class:"card rounded-3 shadow"},sW={class:"card-header"},rW={class:"card-body"},oW=["disabled"],aW={class:"invalid-feedback"},lW={key:0},cW={key:1},uW={class:"card rounded-3 shadow"},dW={class:"card-header d-flex align-items-center"},hW={class:"badge rounded-pill text-bg-success ms-auto"},fW={class:"card-body"},gW=["disabled"],pW={class:"invalid-feedback"},mW={key:0},_W={key:1},yW=g("hr",null,null,-1),vW={class:"accordion",id:"newConfigurationOptionalAccordion"},bW={class:"accordion-item"},wW={class:"accordion-header"},xW={class:"accordion-button collapsed",type:"button","data-bs-toggle":"collapse","data-bs-target":"#newConfigurationOptionalAccordionCollapse"},EW={id:"newConfigurationOptionalAccordionCollapse",class:"accordion-collapse collapse","data-bs-parent":"#newConfigurationOptionalAccordion"},SW={class:"accordion-body d-flex flex-column gap-3"},CW={class:"card rounded-3"},TW=g("div",{class:"card-header"},"PreUp",-1),kW={class:"card-body"},AW={class:"card rounded-3"},MW=g("div",{class:"card-header"},"PreDown",-1),IW={class:"card-body"},PW={class:"card rounded-3"},RW=g("div",{class:"card-header"},"PostUp",-1),DW={class:"card-body"},$W={class:"card rounded-3"},LW=g("div",{class:"card-header"},"PostDown",-1),OW={class:"card-body"},NW=["disabled"],FW={key:0,class:"d-flex w-100"},BW=g("i",{class:"bi bi-check-circle-fill ms-2"},null,-1),VW={key:1,class:"d-flex w-100"},zW=g("i",{class:"bi bi-save-fill ms-2"},null,-1),WW={key:2,class:"d-flex w-100 align-items-center"},HW=g("span",{class:"ms-2 spinner-border spinner-border-sm",role:"status"},null,-1);function YW(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("RouterLink");return D(),V("div",$z,[g("div",Lz,[g("div",Oz,[B(a,{to:"/",class:"text-decoration-none"},{default:Re(()=>[g("h3",Nz,[Fz,B(o,{t:"New Configuration"})])]),_:1})]),g("form",{class:"text-body d-flex flex-column gap-3",onSubmit:e[10]||(e[10]=l=>{l.preventDefault(),this.saveNewConfiguration()})},[g("div",Bz,[g("div",Vz,[B(o,{t:"Configuration Name"})]),g("div",zz,[Ne(g("input",{type:"text",class:"form-control",placeholder:"ex. wg1",id:"ConfigurationName","onUpdate:modelValue":e[0]||(e[0]=l=>this.newConfiguration.ConfigurationName=l),disabled:this.loading,required:""},null,8,Wz),[[Ke,this.newConfiguration.ConfigurationName]]),g("div",Hz,[this.error?(D(),V("div",Yz,Ee(this.errorMessage),1)):(D(),V("div",jz,[B(o,{t:"Configuration name is invalid. Possible reasons:"}),g("ul",Kz,[g("li",null,[B(o,{t:"Configuration name already exist."})]),g("li",null,[B(o,{t:"Configuration name can only contain 15 lower/uppercase alphabet, numbers, underscore, equal sign, plus sign, period and hyphen."})])])]))])])]),g("div",Uz,[g("div",Gz,[B(o,{t:"Private Key"}),He(" & "),B(o,{t:"Public Key"})]),g("div",Xz,[g("div",qz,[g("label",Zz,[g("small",null,[B(o,{t:"Private Key"})])]),g("div",Jz,[Ne(g("input",{type:"text",class:"form-control",id:"PrivateKey",required:"",disabled:this.loading,"onUpdate:modelValue":e[1]||(e[1]=l=>this.newConfiguration.PrivateKey=l)},null,8,Qz),[[Ke,this.newConfiguration.PrivateKey]]),g("button",{class:"btn btn-outline-primary",type:"button",title:"Regenerate Private Key",onClick:e[2]||(e[2]=l=>r.wireguardGenerateKeypair())},tW)])]),g("div",null,[g("label",nW,[g("small",null,[B(o,{t:"Public Key"})])]),Ne(g("input",{type:"text",class:"form-control",id:"PublicKey","onUpdate:modelValue":e[3]||(e[3]=l=>this.newConfiguration.PublicKey=l),disabled:""},null,512),[[Ke,this.newConfiguration.PublicKey]])])])]),g("div",iW,[g("div",sW,[B(o,{t:"Listen Port"})]),g("div",rW,[Ne(g("input",{type:"number",class:"form-control",placeholder:"0-65353",id:"ListenPort",min:"1",max:"65353","onUpdate:modelValue":e[4]||(e[4]=l=>this.newConfiguration.ListenPort=l),disabled:this.loading,required:""},null,8,oW),[[Ke,this.newConfiguration.ListenPort]]),g("div",aW,[this.error?(D(),V("div",lW,Ee(this.errorMessage),1)):(D(),V("div",cW,[B(o,{t:"Invalid port"})]))])])]),g("div",uW,[g("div",dW,[B(o,{t:"IP Address/CIDR"}),g("span",hW,Ee(s.numberOfAvailableIPs)+" Available IPs",1)]),g("div",fW,[Ne(g("input",{type:"text",class:"form-control",placeholder:"Ex: 10.0.0.1/24",id:"Address","onUpdate:modelValue":e[5]||(e[5]=l=>this.newConfiguration.Address=l),disabled:this.loading,required:""},null,8,gW),[[Ke,this.newConfiguration.Address]]),g("div",pW,[this.error?(D(),V("div",mW,Ee(this.errorMessage),1)):(D(),V("div",_W," IP Address/CIDR is invalid "))])])]),yW,g("div",vW,[g("div",bW,[g("h2",wW,[g("button",xW,[B(o,{t:"Optional Settings"})])]),g("div",EW,[g("div",SW,[g("div",CW,[TW,g("div",kW,[Ne(g("input",{type:"text",class:"form-control",id:"preUp","onUpdate:modelValue":e[6]||(e[6]=l=>this.newConfiguration.PreUp=l)},null,512),[[Ke,this.newConfiguration.PreUp]])])]),g("div",AW,[MW,g("div",IW,[Ne(g("input",{type:"text",class:"form-control",id:"preDown","onUpdate:modelValue":e[7]||(e[7]=l=>this.newConfiguration.PreDown=l)},null,512),[[Ke,this.newConfiguration.PreDown]])])]),g("div",PW,[RW,g("div",DW,[Ne(g("input",{type:"text",class:"form-control",id:"postUp","onUpdate:modelValue":e[8]||(e[8]=l=>this.newConfiguration.PostUp=l)},null,512),[[Ke,this.newConfiguration.PostUp]])])]),g("div",$W,[LW,g("div",OW,[Ne(g("input",{type:"text",class:"form-control",id:"postDown","onUpdate:modelValue":e[9]||(e[9]=l=>this.newConfiguration.PostDown=l)},null,512),[[Ke,this.newConfiguration.PostDown]])])])])])])]),g("button",{class:"btn btn-dark btn-brand rounded-3 px-3 py-2 shadow ms-auto",disabled:!this.goodToSubmit||this.loading||this.success},[this.success?(D(),V("span",FW,[B(o,{t:"Success"}),He("! "),BW])):this.loading?(D(),V("span",WW,[B(o,{t:"Saving..."}),HW])):(D(),V("span",VW,[B(o,{t:"Save Configuration"}),zW]))],8,NW)],32)])])}const jW=Ye(Dz,[["render",YW]]),KW={name:"configuration"},UW={class:"mt-md-5 mt-3 text-body"};function GW(t,e,n,i,s,r){const o=Se("RouterView");return D(),V("div",UW,[B(o,null,{default:Re(({Component:a,route:l})=>[B(Rt,{name:"fade2",mode:"out-in"},{default:Re(()=>[(D(),Ce(f_,null,{default:Re(()=>[(D(),Ce(ga(a),{key:l.path}))]),_:2},1024))]),_:2},1024)]),_:1})])}const XW=Ye(KW,[["render",GW]]),qW={name:"peerSearch",components:{LocaleText:Qe},setup(){const t=st(),e=vi();return{store:t,wireguardConfigurationStore:e}},props:{configuration:Object},data(){return{sort:{status:Tt("Status"),name:Tt("Name"),allowed_ip:Tt("Allowed IPs"),restricted:Tt("Restricted")},interval:{5e3:Tt("5 Seconds"),1e4:Tt("10 Seconds"),3e4:Tt("30 Seconds"),6e4:Tt("1 Minutes")},searchString:"",searchStringTimeout:void 0,showDisplaySettings:!1,showMoreSettings:!1}},methods:{debounce(){this.searchStringTimeout?(clearTimeout(this.searchStringTimeout),this.searchStringTimeout=setTimeout(()=>{this.wireguardConfigurationStore.searchString=this.searchString},300)):this.searchStringTimeout=setTimeout(()=>{this.wireguardConfigurationStore.searchString=this.searchString},300)},updateSort(t){kt("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_sort",value:t},e=>{e.status&&this.store.getConfiguration()})},updateRefreshInterval(t){kt("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_refresh_interval",value:t},e=>{e.status&&this.store.getConfiguration()})},downloadAllPeer(){Vt(`/api/downloadAllPeers/${this.configuration.Name}`,{},t=>{console.log(t),window.wireguard.generateZipFiles(t,this.configuration.Name)})}},computed:{searchBarPlaceholder(){return Tt("Search Peers...")}}},wf=t=>(bn("data-v-c8fa0b7d"),t=t(),wn(),t),ZW={class:"mb-3"},JW={class:"d-flex gap-2 z-3 peerSearchContainer"},QW=wf(()=>g("i",{class:"bi bi-plus-lg me-2"},null,-1)),e8=wf(()=>g("i",{class:"bi bi-download me-2"},null,-1)),t8={class:"mt-3 mt-md-0 flex-grow-1"},n8=["placeholder"],i8=wf(()=>g("i",{class:"bi bi-filter-circle me-2"},null,-1)),s8=wf(()=>g("i",{class:"bi bi-three-dots"},null,-1)),r8=[s8],o8={key:0,class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll displayModal"},a8={class:"container-md d-flex h-100 w-100"},l8={class:"m-auto modal-dialog-centered dashboardModal"},c8={class:"card rounded-3 shadow w-100"},u8={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},d8={class:"mb-0 fw-normal"},h8={class:"card-body px-4 pb-4 d-flex gap-3 flex-column"},f8={class:"text-muted fw-bold mb-2"},g8={class:"list-group"},p8=["onClick"],m8={class:"me-auto"},_8={key:0,class:"bi bi-check text-primary"},y8={class:"text-muted fw-bold mb-2"},v8={class:"list-group"},b8=["onClick"],w8={class:"me-auto"},x8={key:0,class:"bi bi-check text-primary"},E8={key:0,class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll displayModal"},S8={class:"container-md d-flex h-100 w-100"},C8={class:"m-auto modal-dialog-centered dashboardModal"},T8={class:"card rounded-3 shadow w-100"},k8={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},A8={class:"mb-0 fw-normal"},M8={class:"card-body px-4 pb-4 d-flex gap-3 flex-column"},I8={class:"text-muted fw-bold mb-2"},P8={class:"list-group"};function R8(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("RouterLink");return D(),V("div",ZW,[g("div",JW,[B(a,{to:"create",class:"text-decoration-none btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle shadow-sm"},{default:Re(()=>[QW,B(o,{t:"Peer"})]),_:1}),g("button",{class:"btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle shadow-sm",onClick:e[0]||(e[0]=l=>this.downloadAllPeer())},[e8,B(o,{t:"Download All"})]),g("div",t8,[Ne(g("input",{class:"form-control rounded-3 bg-secondary-subtle border-1 border-secondary-subtle shadow-sm w-100",placeholder:r.searchBarPlaceholder,id:"searchPeers",onKeyup:e[1]||(e[1]=l=>this.debounce()),"onUpdate:modelValue":e[2]||(e[2]=l=>this.searchString=l)},null,40,n8),[[Ke,this.searchString]])]),g("button",{onClick:e[3]||(e[3]=l=>this.showDisplaySettings=!0),class:"btn text-secondary-emphasis bg-secondary-subtle rounded-3 border-1 border-secondary-subtle shadow-sm",type:"button","aria-expanded":"false"},[i8,B(o,{t:"Display"})]),g("button",{class:"btn text-secondary-emphasis bg-secondary-subtle rounded-3 border-1 border-secondary-subtle shadow-sm",onClick:e[4]||(e[4]=l=>this.showMoreSettings=!0),type:"button","aria-expanded":"false"},r8),B(Rt,{name:"zoom"},{default:Re(()=>[this.showDisplaySettings?(D(),V("div",o8,[g("div",a8,[g("div",l8,[g("div",c8,[g("div",u8,[g("h4",d8,[B(o,{t:"Display"})]),g("button",{type:"button",class:"btn-close ms-auto",onClick:e[5]||(e[5]=l=>this.showDisplaySettings=!1)})]),g("div",h8,[g("div",null,[g("p",f8,[g("small",null,[B(o,{t:"Sort by"})])]),g("div",g8,[(D(!0),V($e,null,Xe(this.sort,(l,c)=>(D(),V("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:u=>this.updateSort(c)},[g("span",m8,Ee(l),1),i.store.Configuration.Server.dashboard_sort===c?(D(),V("i",_8)):ce("",!0)],8,p8))),256))])]),g("div",null,[g("p",y8,[g("small",null,[B(o,{t:"Refresh Interval"})])]),g("div",v8,[(D(!0),V($e,null,Xe(this.interval,(l,c)=>(D(),V("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:u=>this.updateRefreshInterval(c)},[g("span",w8,Ee(l),1),i.store.Configuration.Server.dashboard_refresh_interval===c?(D(),V("i",x8)):ce("",!0)],8,b8))),256))])])])])])])])):ce("",!0)]),_:1}),B(Rt,{name:"zoom"},{default:Re(()=>[this.showMoreSettings?(D(),V("div",E8,[g("div",S8,[g("div",C8,[g("div",T8,[g("div",k8,[g("h4",A8,[B(o,{t:"Configuration Settings"})]),g("button",{type:"button",class:"btn-close ms-auto",onClick:e[6]||(e[6]=l=>this.showMoreSettings=!1)})]),g("div",M8,[g("div",null,[g("p",I8,[g("small",null,[B(o,{t:"Peer Jobs"})])]),g("div",P8,[g("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:e[7]||(e[7]=l=>this.$emit("jobsAll"))},[B(o,{t:"Active Jobs"})]),g("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:e[8]||(e[8]=l=>this.$emit("jobLogs"))},[B(o,{t:"Logs"})])])])])])])])])):ce("",!0)]),_:1})])])}const D8=Ye(qW,[["render",R8],["__scopeId","data-v-c8fa0b7d"]]);function $8(t){return ef()?(e_(t),!0):!1}function hC(t){return typeof t=="function"?t():Q(t)}const fC=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const L8=Object.prototype.toString,O8=t=>L8.call(t)==="[object Object]",sh=()=>{},N8=F8();function F8(){var t,e;return fC&&((t=window?.navigator)==null?void 0:t.userAgent)&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||((e=window?.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function bc(t){var e;const n=hC(t);return(e=n?.$el)!=null?e:n}const gC=fC?window:void 0;function Hg(...t){let e,n,i,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,i,s]=t,e=gC):[e,n,i,s]=t,!e)return sh;Array.isArray(n)||(n=[n]),Array.isArray(i)||(i=[i]);const r=[],o=()=>{r.forEach(u=>u()),r.length=0},a=(u,d,h,f)=>(u.addEventListener(d,h,f),()=>u.removeEventListener(d,h,f)),l=fn(()=>[bc(e),hC(s)],([u,d])=>{if(o(),!u)return;const h=O8(d)?{...d}:d;r.push(...n.flatMap(f=>i.map(p=>a(u,f,p,h))))},{immediate:!0,flush:"post"}),c=()=>{l(),o()};return $8(c),c}let Pb=!1;function B8(t,e,n={}){const{window:i=gC,ignore:s=[],capture:r=!0,detectIframe:o=!1}=n;if(!i)return sh;N8&&!Pb&&(Pb=!0,Array.from(i.document.body.children).forEach(h=>h.addEventListener("click",sh)),i.document.documentElement.addEventListener("click",sh));let a=!0;const l=h=>s.some(f=>{if(typeof f=="string")return Array.from(i.document.querySelectorAll(f)).some(p=>p===h.target||h.composedPath().includes(p));{const p=bc(f);return p&&(h.target===p||h.composedPath().includes(p))}}),u=[Hg(i,"click",h=>{const f=bc(t);if(!(!f||f===h.target||h.composedPath().includes(f))){if(h.detail===0&&(a=!l(h)),!a){a=!0;return}e(h)}},{passive:!0,capture:r}),Hg(i,"pointerdown",h=>{const f=bc(t);a=!l(h)&&!!(f&&!h.composedPath().includes(f))},{passive:!0}),o&&Hg(i,"blur",h=>{setTimeout(()=>{var f;const p=bc(t);((f=i.document.activeElement)==null?void 0:f.tagName)==="IFRAME"&&!p?.contains(i.document.activeElement)&&e(h)},0)})].filter(Boolean);return()=>u.forEach(h=>h())}const V8={name:"peerSettingsDropdown",components:{LocaleText:Qe},setup(){return{dashboardStore:st()}},props:{Peer:Object},data(){return{deleteBtnDisabled:!1,restrictBtnDisabled:!1,allowAccessBtnDisabled:!1}},methods:{downloadPeer(){Vt("/api/downloadPeer/"+this.$route.params.id,{id:this.Peer.id},t=>{if(t.status){const e=new Blob([t.data.file],{type:"text/plain"}),n=URL.createObjectURL(e),i=`${t.data.fileName}.conf`,s=document.createElement("a");s.href=n,s.download=i,s.click(),this.dashboardStore.newMessage("WGDashboard","Peer download started","success")}else this.dashboardStore.newMessage("Server",t.message,"danger")})},downloadQRCode(){Vt("/api/downloadPeer/"+this.$route.params.id,{id:this.Peer.id},t=>{t.status?this.$emit("qrcode",t.data.file):this.dashboardStore.newMessage("Server",t.message,"danger")})},deletePeer(){this.deleteBtnDisabled=!0,kt(`/api/deletePeers/${this.$route.params.id}`,{peers:[this.Peer.id]},t=>{this.dashboardStore.newMessage("Server",t.message,t.status?"success":"danger"),this.$emit("refresh"),this.deleteBtnDisabled=!1})},restrictPeer(){this.restrictBtnDisabled=!0,kt(`/api/restrictPeers/${this.$route.params.id}`,{peers:[this.Peer.id]},t=>{this.dashboardStore.newMessage("Server",t.message,t.status?"success":"danger"),this.$emit("refresh"),this.restrictBtnDisabled=!1})},allowAccessPeer(){this.allowAccessBtnDisabled=!0,kt(`/api/allowAccessPeers/${this.$route.params.id}`,{peers:[this.Peer.id]},t=>{this.dashboardStore.newMessage("Server",t.message,t.status?"success":"danger"),this.$emit("refresh"),this.allowAccessBtnDisabled=!1})}}},Fs=t=>(bn("data-v-e53c14b2"),t=t(),wn(),t),z8={class:"dropdown-menu mt-2 shadow-lg d-block rounded-3",style:{"max-width":"200px"}},W8={key:0},H8={class:"w-100 dropdown-item text-muted",style:{"white-space":"break-spaces","font-size":"0.7rem"}},Y8={key:1,class:"d-flex",style:{"padding-left":"var(--bs-dropdown-item-padding-x)","padding-right":"var(--bs-dropdown-item-padding-x)"}},j8=Fs(()=>g("i",{class:"me-auto bi bi-download"},null,-1)),K8=[j8],U8=Fs(()=>g("i",{class:"me-auto bi bi-qr-code"},null,-1)),G8=[U8],X8=Fs(()=>g("i",{class:"me-auto bi bi-share"},null,-1)),q8=[X8],Z8=Fs(()=>g("li",null,[g("hr",{class:"dropdown-divider"})],-1)),J8=Fs(()=>g("i",{class:"me-auto bi bi-pen"},null,-1)),Q8=Fs(()=>g("i",{class:"me-auto bi bi-app-indicator"},null,-1)),eH=Fs(()=>g("li",null,[g("hr",{class:"dropdown-divider"})],-1)),tH=Fs(()=>g("i",{class:"me-auto bi bi-lock"},null,-1)),nH=Fs(()=>g("i",{class:"me-auto bi bi-trash"},null,-1)),iH={key:1},sH=Fs(()=>g("i",{class:"me-auto bi bi-unlock"},null,-1));function rH(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("ul",z8,[this.Peer.restricted?(D(),V("li",iH,[g("a",{class:Ie(["dropdown-item d-flex text-warning",{disabled:this.allowAccessBtnDisabled}]),onClick:e[7]||(e[7]=a=>this.allowAccessPeer()),role:"button"},[sH,this.allowAccessBtnDisabled?(D(),Ce(o,{key:1,t:"Allowing Access..."})):(D(),Ce(o,{key:0,t:"Allow Access"}))],2)])):(D(),V($e,{key:0},[this.Peer.private_key?(D(),V("li",Y8,[g("a",{class:"dropdown-item text-center px-0 rounded-3",role:"button",onClick:e[0]||(e[0]=a=>this.downloadPeer())},K8),g("a",{class:"dropdown-item text-center px-0 rounded-3",role:"button",onClick:e[1]||(e[1]=a=>this.downloadQRCode())},G8),g("a",{class:"dropdown-item text-center px-0 rounded-3",role:"button",onClick:e[2]||(e[2]=a=>this.$emit("share"))},q8)])):(D(),V("li",W8,[g("small",H8,[B(o,{t:"Download & QR Code is not available due to no private key set for this peer"})])])),Z8,g("li",null,[g("a",{class:"dropdown-item d-flex",role:"button",onClick:e[3]||(e[3]=a=>this.$emit("setting"))},[J8,He(),B(o,{t:"Peer Settings"})])]),g("li",null,[g("a",{class:"dropdown-item d-flex",role:"button",onClick:e[4]||(e[4]=a=>this.$emit("jobs"))},[Q8,He(),B(o,{t:"Schedule Jobs"})])]),eH,g("li",null,[g("a",{class:Ie(["dropdown-item d-flex text-warning",{disabled:this.restrictBtnDisabled}]),onClick:e[5]||(e[5]=a=>this.restrictPeer()),role:"button"},[tH,this.restrictBtnDisabled?(D(),Ce(o,{key:1,t:"Restricting..."})):(D(),Ce(o,{key:0,t:"Restrict Access"}))],2)]),g("li",null,[g("a",{class:Ie(["dropdown-item d-flex fw-bold text-danger",{disabled:this.deleteBtnDisabled}]),onClick:e[6]||(e[6]=a=>this.deletePeer()),role:"button"},[nH,this.deleteBtnDisabled?(D(),Ce(o,{key:1,t:"Deleting..."})):(D(),Ce(o,{key:0,t:"Delete"}))],2)])],64))])}const oH=Ye(V8,[["render",rH],["__scopeId","data-v-e53c14b2"]]),aH={name:"peer",components:{LocaleText:Qe,PeerSettingsDropdown:oH},props:{Peer:Object},data(){return{}},setup(){const t=we(null),e=we(!1);return B8(t,n=>{e.value=!1}),{target:t,subMenuOpened:e}},computed:{getLatestHandshake(){return this.Peer.latest_handshake.includes(",")?this.Peer.latest_handshake.split(",")[0]:this.Peer.latest_handshake}}},Vu=t=>(bn("data-v-4a343fe2"),t=t(),wn(),t),lH={key:0,class:"card-header bg-transparent d-flex align-items-center gap-2 border-0"},cH={style:{"font-size":"0.8rem"},class:"ms-auto d-flex gap-2"},uH={class:"text-primary"},dH=Vu(()=>g("i",{class:"bi bi-arrow-down"},null,-1)),hH={class:"text-success"},fH=Vu(()=>g("i",{class:"bi bi-arrow-up"},null,-1)),gH={key:0,class:"text-secondary"},pH=Vu(()=>g("i",{class:"bi bi-arrows-angle-contract"},null,-1)),mH={key:1,class:"border-0 card-header bg-transparent text-warning fw-bold",style:{"font-size":"0.8rem"}},_H=Vu(()=>g("i",{class:"bi-lock-fill me-2"},null,-1)),yH={class:"card-body pt-1",style:{"font-size":"0.9rem"}},vH={class:"mb-2"},bH={class:"text-muted"},wH={class:"mb-0"},xH={class:"d-flex align-items-end"},EH={class:"text-muted"},SH={class:"mb-0"},CH=Vu(()=>g("h5",{class:"mb-0"},[g("i",{class:"bi bi-three-dots"})],-1)),TH=[CH];function kH(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("PeerSettingsDropdown");return D(),V("div",{class:Ie(["card shadow-sm rounded-3 peerCard bg-transparent",{"border-warning":n.Peer.restricted}])},[g("div",null,[n.Peer.restricted?(D(),V("div",mH,[_H,B(o,{t:"Access Restricted"})])):(D(),V("div",lH,[g("div",{class:Ie(["dot ms-0",{active:n.Peer.status==="running"}])},null,2),g("div",cH,[g("span",uH,[dH,g("strong",null,Ee((n.Peer.cumu_receive+n.Peer.total_receive).toFixed(4)),1),He(" GB ")]),g("span",hH,[fH,g("strong",null,Ee((n.Peer.cumu_sent+n.Peer.total_sent).toFixed(4)),1),He(" GB ")]),n.Peer.latest_handshake!=="No Handshake"?(D(),V("span",gH,[pH,He(" "+Ee(r.getLatestHandshake)+" ago ",1)])):ce("",!0)])]))]),g("div",yH,[g("h6",null,Ee(n.Peer.name?n.Peer.name:"Untitled Peer"),1),g("div",vH,[g("small",bH,[B(o,{t:"Public Key"})]),g("p",wH,[g("samp",null,Ee(n.Peer.id),1)])]),g("div",xH,[g("div",null,[g("small",EH,[B(o,{t:"Allowed IPs"})]),g("p",SH,[g("samp",null,Ee(n.Peer.allowed_ip),1)])]),g("div",{class:Ie(["ms-auto px-2 rounded-3 subMenuBtn",{active:this.subMenuOpened}])},[g("a",{role:"button",class:"text-body",onClick:e[0]||(e[0]=l=>this.subMenuOpened=!0)},TH),B(Rt,{name:"slide-fade"},{default:Re(()=>[this.subMenuOpened?(D(),Ce(a,{key:0,onQrcode:e[1]||(e[1]=l=>this.$emit("qrcode",l)),onSetting:e[2]||(e[2]=l=>this.$emit("setting")),onJobs:e[3]||(e[3]=l=>this.$emit("jobs")),onRefresh:e[4]||(e[4]=l=>this.$emit("refresh")),onShare:e[5]||(e[5]=l=>this.$emit("share")),Peer:n.Peer,ref:"target"},null,8,["Peer"])):ce("",!0)]),_:1})],2)])])],2)}const AH=Ye(aH,[["render",kH],["__scopeId","data-v-4a343fe2"]]);/*! + */(function(){function t(w){var x=new Float64Array(16);if(w)for(var T=0;T>16&1),k[P-1]&=65535;k[15]=A[15]-32767-(k[14]>>16&1),T=k[15]>>16&1,k[14]&=65535,i(A,k,1-T)}for(var P=0;P<16;++P)w[2*P]=A[P]&255,w[2*P+1]=A[P]>>8}function n(w){for(var x=0;x<16;++x)w[(x+1)%16]+=(x<15?1:38)*Math.floor(w[x]/65536),w[x]&=65535}function i(w,x,T){for(var k,A=~(T-1),P=0;P<16;++P)k=A&(w[P]^x[P]),w[P]^=k,x[P]^=k}function s(w,x,T){for(var k=0;k<16;++k)w[k]=x[k]+T[k]|0}function r(w,x,T){for(var k=0;k<16;++k)w[k]=x[k]-T[k]|0}function o(w,x,T){for(var k=new Float64Array(31),A=0;A<16;++A)for(var P=0;P<16;++P)k[A+P]+=x[A]*T[P];for(var A=0;A<15;++A)k[A]+=38*k[A+16];for(var A=0;A<16;++A)w[A]=k[A];n(w),n(w)}function a(w,x){for(var T=t(),k=0;k<16;++k)T[k]=x[k];for(var k=253;k>=0;--k)o(T,T,T),k!==2&&k!==4&&o(T,T,x);for(var k=0;k<16;++k)w[k]=T[k]}function l(w){w[31]=w[31]&127|64,w[0]&=248}function c(w){for(var x,T=new Uint8Array(32),k=t([1]),A=t([9]),P=t(),F=t([1]),H=t(),te=t(),N=t([56129,1]),L=t([9]),I=0;I<32;++I)T[I]=w[I];l(T);for(var I=254;I>=0;--I)x=T[I>>>3]>>>(I&7)&1,i(k,A,x),i(P,F,x),s(H,k,P),r(k,k,P),s(P,A,F),r(A,A,F),o(F,H,H),o(te,k,k),o(k,P,k),o(P,A,H),s(H,k,P),r(k,k,P),o(A,k,k),r(P,F,te),o(k,P,N),s(k,k,F),o(P,P,k),o(k,F,te),o(F,A,L),o(A,H,H),i(k,A,x),i(P,F,x);return a(P,P),o(k,k,P),e(T,k),T}function u(){var w=new Uint8Array(32);return window.crypto.getRandomValues(w),w}function d(){var w=u();return l(w),w}function h(w,x){for(var T=Uint8Array.from([x[0]>>2&63,(x[0]<<4|x[1]>>4)&63,(x[1]<<2|x[2]>>6)&63,x[2]&63]),k=0;k<4;++k)w[k]=T[k]+65+(25-T[k]>>8&6)-(51-T[k]>>8&75)-(61-T[k]>>8&15)+(62-T[k]>>8&3)}function f(w){var x,T=new Uint8Array(44);for(x=0;x<32/3;++x)h(T.subarray(x*4),w.subarray(x*3));return h(T.subarray(x*4),Uint8Array.from([w[x*3+0],w[x*3+1],0])),T[43]=61,String.fromCharCode.apply(null,T)}function p(w){let x=window.atob(w),T=x.length,k=new Uint8Array(T);for(let P=0;P>>8&255,x>>>16&255,x>>>24&255)}function y(w,x){w.push(x&255,x>>>8&255)}function v(w,x){for(var T=0;T>>1:x>>>1;E.table[T]=x}}for(var A=-1,P=0;P>>8^E.table[(A^w[P])&255];return(A^-1)>>>0}function C(w){for(var x=[],T=[],k=0,A=0;A{t.status?(this.success=!0,await this.store.getConfigurations(),this.$router.push(`/configuration/${this.newConfiguration.ConfigurationName}/peers`)):(this.error=!0,this.errorMessage=t.message,document.querySelector(`#${t.data}`).classList.remove("is-valid"),document.querySelector(`#${t.data}`).classList.add("is-invalid"),this.loading=!1)}))}},computed:{goodToSubmit(){let t=["ConfigurationName","Address","ListenPort","PrivateKey"],e=[...document.querySelectorAll("input[required]")];return t.find(n=>this.newConfiguration[n].length===0)===void 0&&e.find(n=>n.classList.contains("is-invalid"))===void 0}},watch:{"newConfiguration.Address"(t){let e=document.querySelector("#Address");e.classList.remove("is-invalid","is-valid");try{if(t.trim().split("/").filter(s=>s.length>0).length!==2)throw Error();let n=tW(t),i=n.end-n.start;this.numberOfAvailableIPs=i.toLocaleString(),e.classList.add("is-valid")}catch{this.numberOfAvailableIPs="0",e.classList.add("is-invalid")}},"newConfiguration.ListenPort"(t){let e=document.querySelector("#ListenPort");e.classList.remove("is-invalid","is-valid"),t<0||t>65353||!Number.isInteger(t)?e.classList.add("is-invalid"):e.classList.add("is-valid")},"newConfiguration.ConfigurationName"(t){let e=document.querySelector("#ConfigurationName");e.classList.remove("is-invalid","is-valid"),!/^[a-zA-Z0-9_=+.-]{1,15}$/.test(t)||t.length===0||this.store.Configurations.find(n=>n.Name===t)?e.classList.add("is-invalid"):e.classList.add("is-valid")},"newConfiguration.PrivateKey"(t){let e=document.querySelector("#PrivateKey");e.classList.remove("is-invalid","is-valid");try{wireguard.generatePublicKey(t),e.classList.add("is-valid")}catch{e.classList.add("is-invalid")}}}},iW={class:"mt-5"},sW={class:"container mb-4"},rW={class:"mb-4 d-flex align-items-center gap-4"},oW={class:"mb-0 text-body"},aW=g("i",{class:"bi bi-chevron-left me-4"},null,-1),lW={class:"card rounded-3 shadow"},cW={class:"card-header"},uW={class:"card-body"},dW=["disabled"],hW={class:"invalid-feedback"},fW={key:0},gW={key:1},pW={class:"mb-0"},mW={class:"card rounded-3 shadow"},_W={class:"card-header"},yW={class:"card-body",style:{"font-family":"var(--bs-font-monospace)"}},vW={class:"mb-2"},bW={class:"text-muted fw-bold mb-1"},wW={class:"input-group"},xW=["disabled"],EW=g("i",{class:"bi bi-arrow-repeat"},null,-1),SW=[EW],CW={class:"text-muted fw-bold mb-1"},TW={class:"card rounded-3 shadow"},kW={class:"card-header"},AW={class:"card-body"},MW=["disabled"],IW={class:"invalid-feedback"},PW={key:0},RW={key:1},DW={class:"card rounded-3 shadow"},$W={class:"card-header d-flex align-items-center"},LW={class:"badge rounded-pill text-bg-success ms-auto"},OW={class:"card-body"},NW=["disabled"],FW={class:"invalid-feedback"},BW={key:0},VW={key:1},zW=g("hr",null,null,-1),WW={class:"accordion",id:"newConfigurationOptionalAccordion"},HW={class:"accordion-item"},YW={class:"accordion-header"},jW={class:"accordion-button collapsed",type:"button","data-bs-toggle":"collapse","data-bs-target":"#newConfigurationOptionalAccordionCollapse"},KW={id:"newConfigurationOptionalAccordionCollapse",class:"accordion-collapse collapse","data-bs-parent":"#newConfigurationOptionalAccordion"},UW={class:"accordion-body d-flex flex-column gap-3"},GW={class:"card rounded-3"},XW=g("div",{class:"card-header"},"PreUp",-1),qW={class:"card-body"},ZW={class:"card rounded-3"},JW=g("div",{class:"card-header"},"PreDown",-1),QW={class:"card-body"},e8={class:"card rounded-3"},t8=g("div",{class:"card-header"},"PostUp",-1),n8={class:"card-body"},i8={class:"card rounded-3"},s8=g("div",{class:"card-header"},"PostDown",-1),r8={class:"card-body"},o8=["disabled"],a8={key:0,class:"d-flex w-100"},l8=g("i",{class:"bi bi-check-circle-fill ms-2"},null,-1),c8={key:1,class:"d-flex w-100"},u8=g("i",{class:"bi bi-save-fill ms-2"},null,-1),d8={key:2,class:"d-flex w-100 align-items-center"},h8=g("span",{class:"ms-2 spinner-border spinner-border-sm",role:"status"},null,-1);function f8(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("RouterLink");return D(),V("div",iW,[g("div",sW,[g("div",rW,[B(a,{to:"/",class:"text-decoration-none"},{default:Re(()=>[g("h3",oW,[aW,B(o,{t:"New Configuration"})])]),_:1})]),g("form",{class:"text-body d-flex flex-column gap-3",onSubmit:e[10]||(e[10]=l=>{l.preventDefault(),this.saveNewConfiguration()})},[g("div",lW,[g("div",cW,[B(o,{t:"Configuration Name"})]),g("div",uW,[Oe(g("input",{type:"text",class:"form-control",placeholder:"ex. wg1",id:"ConfigurationName","onUpdate:modelValue":e[0]||(e[0]=l=>this.newConfiguration.ConfigurationName=l),disabled:this.loading,required:""},null,8,dW),[[Ke,this.newConfiguration.ConfigurationName]]),g("div",hW,[this.error?(D(),V("div",fW,xe(this.errorMessage),1)):(D(),V("div",gW,[B(o,{t:"Configuration name is invalid. Possible reasons:"}),g("ul",pW,[g("li",null,[B(o,{t:"Configuration name already exist."})]),g("li",null,[B(o,{t:"Configuration name can only contain 15 lower/uppercase alphabet, numbers, underscore, equal sign, plus sign, period and hyphen."})])])]))])])]),g("div",mW,[g("div",_W,[B(o,{t:"Private Key"}),Ye(" & "),B(o,{t:"Public Key"})]),g("div",yW,[g("div",vW,[g("label",bW,[g("small",null,[B(o,{t:"Private Key"})])]),g("div",wW,[Oe(g("input",{type:"text",class:"form-control",id:"PrivateKey",required:"",disabled:this.loading,"onUpdate:modelValue":e[1]||(e[1]=l=>this.newConfiguration.PrivateKey=l)},null,8,xW),[[Ke,this.newConfiguration.PrivateKey]]),g("button",{class:"btn btn-outline-primary",type:"button",title:"Regenerate Private Key",onClick:e[2]||(e[2]=l=>r.wireguardGenerateKeypair())},SW)])]),g("div",null,[g("label",CW,[g("small",null,[B(o,{t:"Public Key"})])]),Oe(g("input",{type:"text",class:"form-control",id:"PublicKey","onUpdate:modelValue":e[3]||(e[3]=l=>this.newConfiguration.PublicKey=l),disabled:""},null,512),[[Ke,this.newConfiguration.PublicKey]])])])]),g("div",TW,[g("div",kW,[B(o,{t:"Listen Port"})]),g("div",AW,[Oe(g("input",{type:"number",class:"form-control",placeholder:"0-65353",id:"ListenPort",min:"1",max:"65353","onUpdate:modelValue":e[4]||(e[4]=l=>this.newConfiguration.ListenPort=l),disabled:this.loading,required:""},null,8,MW),[[Ke,this.newConfiguration.ListenPort]]),g("div",IW,[this.error?(D(),V("div",PW,xe(this.errorMessage),1)):(D(),V("div",RW,[B(o,{t:"Invalid port"})]))])])]),g("div",DW,[g("div",$W,[B(o,{t:"IP Address/CIDR"}),g("span",LW,xe(s.numberOfAvailableIPs)+" Available IPs",1)]),g("div",OW,[Oe(g("input",{type:"text",class:"form-control",placeholder:"Ex: 10.0.0.1/24",id:"Address","onUpdate:modelValue":e[5]||(e[5]=l=>this.newConfiguration.Address=l),disabled:this.loading,required:""},null,8,NW),[[Ke,this.newConfiguration.Address]]),g("div",FW,[this.error?(D(),V("div",BW,xe(this.errorMessage),1)):(D(),V("div",VW," IP Address/CIDR is invalid "))])])]),zW,g("div",WW,[g("div",HW,[g("h2",YW,[g("button",jW,[B(o,{t:"Optional Settings"})])]),g("div",KW,[g("div",UW,[g("div",GW,[XW,g("div",qW,[Oe(g("input",{type:"text",class:"form-control",id:"preUp","onUpdate:modelValue":e[6]||(e[6]=l=>this.newConfiguration.PreUp=l)},null,512),[[Ke,this.newConfiguration.PreUp]])])]),g("div",ZW,[JW,g("div",QW,[Oe(g("input",{type:"text",class:"form-control",id:"preDown","onUpdate:modelValue":e[7]||(e[7]=l=>this.newConfiguration.PreDown=l)},null,512),[[Ke,this.newConfiguration.PreDown]])])]),g("div",e8,[t8,g("div",n8,[Oe(g("input",{type:"text",class:"form-control",id:"postUp","onUpdate:modelValue":e[8]||(e[8]=l=>this.newConfiguration.PostUp=l)},null,512),[[Ke,this.newConfiguration.PostUp]])])]),g("div",i8,[s8,g("div",r8,[Oe(g("input",{type:"text",class:"form-control",id:"postDown","onUpdate:modelValue":e[9]||(e[9]=l=>this.newConfiguration.PostDown=l)},null,512),[[Ke,this.newConfiguration.PostDown]])])])])])])]),g("button",{class:"btn btn-dark btn-brand rounded-3 px-3 py-2 shadow ms-auto",disabled:!this.goodToSubmit||this.loading||this.success},[this.success?(D(),V("span",a8,[B(o,{t:"Success"}),Ye("! "),l8])):this.loading?(D(),V("span",d8,[B(o,{t:"Saving..."}),h8])):(D(),V("span",c8,[B(o,{t:"Save Configuration"}),u8]))],8,o8)],32)])])}const g8=He(nW,[["render",f8]]),p8={name:"configuration"},m8={class:"mt-md-5 mt-3 text-body"};function _8(t,e,n,i,s,r){const o=Se("RouterView");return D(),V("div",m8,[B(o,null,{default:Re(({Component:a,route:l})=>[B(Rt,{name:"fade2",mode:"out-in"},{default:Re(()=>[(D(),Ce(f_,null,{default:Re(()=>[(D(),Ce(ga(a),{key:l.path}))]),_:2},1024))]),_:2},1024)]),_:1})])}const y8=He(p8,[["render",_8]]),v8={name:"peerSearch",components:{LocaleText:Qe},setup(){const t=nt(),e=vi();return{store:t,wireguardConfigurationStore:e}},props:{configuration:Object},data(){return{sort:{status:Tt("Status"),name:Tt("Name"),allowed_ip:Tt("Allowed IPs"),restricted:Tt("Restricted")},interval:{5e3:Tt("5 Seconds"),1e4:Tt("10 Seconds"),3e4:Tt("30 Seconds"),6e4:Tt("1 Minutes")},searchString:"",searchStringTimeout:void 0,showDisplaySettings:!1,showMoreSettings:!1}},methods:{debounce(){this.searchStringTimeout?(clearTimeout(this.searchStringTimeout),this.searchStringTimeout=setTimeout(()=>{this.wireguardConfigurationStore.searchString=this.searchString},300)):this.searchStringTimeout=setTimeout(()=>{this.wireguardConfigurationStore.searchString=this.searchString},300)},updateSort(t){kt("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_sort",value:t},e=>{e.status&&this.store.getConfiguration()})},updateRefreshInterval(t){kt("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_refresh_interval",value:t},e=>{e.status&&this.store.getConfiguration()})},downloadAllPeer(){Vt(`/api/downloadAllPeers/${this.configuration.Name}`,{},t=>{console.log(t),window.wireguard.generateZipFiles(t,this.configuration.Name)})}},computed:{searchBarPlaceholder(){return Tt("Search Peers...")}}},wf=t=>(bn("data-v-c8fa0b7d"),t=t(),wn(),t),b8={class:"mb-3"},w8={class:"d-flex gap-2 z-3 peerSearchContainer"},x8=wf(()=>g("i",{class:"bi bi-plus-lg me-2"},null,-1)),E8=wf(()=>g("i",{class:"bi bi-download me-2"},null,-1)),S8={class:"mt-3 mt-md-0 flex-grow-1"},C8=["placeholder"],T8=wf(()=>g("i",{class:"bi bi-filter-circle me-2"},null,-1)),k8=wf(()=>g("i",{class:"bi bi-three-dots"},null,-1)),A8=[k8],M8={key:0,class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll displayModal"},I8={class:"container-md d-flex h-100 w-100"},P8={class:"m-auto modal-dialog-centered dashboardModal"},R8={class:"card rounded-3 shadow w-100"},D8={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},$8={class:"mb-0 fw-normal"},L8={class:"card-body px-4 pb-4 d-flex gap-3 flex-column"},O8={class:"text-muted fw-bold mb-2"},N8={class:"list-group"},F8=["onClick"],B8={class:"me-auto"},V8={key:0,class:"bi bi-check text-primary"},z8={class:"text-muted fw-bold mb-2"},W8={class:"list-group"},H8=["onClick"],Y8={class:"me-auto"},j8={key:0,class:"bi bi-check text-primary"},K8={key:0,class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll displayModal"},U8={class:"container-md d-flex h-100 w-100"},G8={class:"m-auto modal-dialog-centered dashboardModal"},X8={class:"card rounded-3 shadow w-100"},q8={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},Z8={class:"mb-0 fw-normal"},J8={class:"card-body px-4 pb-4 d-flex gap-3 flex-column"},Q8={class:"text-muted fw-bold mb-2"},eH={class:"list-group"};function tH(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("RouterLink");return D(),V("div",b8,[g("div",w8,[B(a,{to:"create",class:"text-decoration-none btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle shadow-sm"},{default:Re(()=>[x8,B(o,{t:"Peer"})]),_:1}),g("button",{class:"btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle shadow-sm",onClick:e[0]||(e[0]=l=>this.downloadAllPeer())},[E8,B(o,{t:"Download All"})]),g("div",S8,[Oe(g("input",{class:"form-control rounded-3 bg-secondary-subtle border-1 border-secondary-subtle shadow-sm w-100",placeholder:r.searchBarPlaceholder,id:"searchPeers",onKeyup:e[1]||(e[1]=l=>this.debounce()),"onUpdate:modelValue":e[2]||(e[2]=l=>this.searchString=l)},null,40,C8),[[Ke,this.searchString]])]),g("button",{onClick:e[3]||(e[3]=l=>this.showDisplaySettings=!0),class:"btn text-secondary-emphasis bg-secondary-subtle rounded-3 border-1 border-secondary-subtle shadow-sm",type:"button","aria-expanded":"false"},[T8,B(o,{t:"Display"})]),g("button",{class:"btn text-secondary-emphasis bg-secondary-subtle rounded-3 border-1 border-secondary-subtle shadow-sm",onClick:e[4]||(e[4]=l=>this.showMoreSettings=!0),type:"button","aria-expanded":"false"},A8),B(Rt,{name:"zoom"},{default:Re(()=>[this.showDisplaySettings?(D(),V("div",M8,[g("div",I8,[g("div",P8,[g("div",R8,[g("div",D8,[g("h4",$8,[B(o,{t:"Display"})]),g("button",{type:"button",class:"btn-close ms-auto",onClick:e[5]||(e[5]=l=>this.showDisplaySettings=!1)})]),g("div",L8,[g("div",null,[g("p",O8,[g("small",null,[B(o,{t:"Sort by"})])]),g("div",N8,[(D(!0),V($e,null,Xe(this.sort,(l,c)=>(D(),V("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:u=>this.updateSort(c)},[g("span",B8,xe(l),1),i.store.Configuration.Server.dashboard_sort===c?(D(),V("i",V8)):ce("",!0)],8,F8))),256))])]),g("div",null,[g("p",z8,[g("small",null,[B(o,{t:"Refresh Interval"})])]),g("div",W8,[(D(!0),V($e,null,Xe(this.interval,(l,c)=>(D(),V("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:u=>this.updateRefreshInterval(c)},[g("span",Y8,xe(l),1),i.store.Configuration.Server.dashboard_refresh_interval===c?(D(),V("i",j8)):ce("",!0)],8,H8))),256))])])])])])])])):ce("",!0)]),_:1}),B(Rt,{name:"zoom"},{default:Re(()=>[this.showMoreSettings?(D(),V("div",K8,[g("div",U8,[g("div",G8,[g("div",X8,[g("div",q8,[g("h4",Z8,[B(o,{t:"Configuration Settings"})]),g("button",{type:"button",class:"btn-close ms-auto",onClick:e[6]||(e[6]=l=>this.showMoreSettings=!1)})]),g("div",J8,[g("div",null,[g("p",Q8,[g("small",null,[B(o,{t:"Peer Jobs"})])]),g("div",eH,[g("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:e[7]||(e[7]=l=>this.$emit("jobsAll"))},[B(o,{t:"Active Jobs"})]),g("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:e[8]||(e[8]=l=>this.$emit("jobLogs"))},[B(o,{t:"Logs"})])])])])])])])])):ce("",!0)]),_:1})])])}const nH=He(v8,[["render",tH],["__scopeId","data-v-c8fa0b7d"]]);function iH(t){return ef()?(e_(t),!0):!1}function hC(t){return typeof t=="function"?t():Q(t)}const fC=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const sH=Object.prototype.toString,rH=t=>sH.call(t)==="[object Object]",sh=()=>{},oH=aH();function aH(){var t,e;return fC&&((t=window?.navigator)==null?void 0:t.userAgent)&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||((e=window?.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function bc(t){var e;const n=hC(t);return(e=n?.$el)!=null?e:n}const gC=fC?window:void 0;function Hg(...t){let e,n,i,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,i,s]=t,e=gC):[e,n,i,s]=t,!e)return sh;Array.isArray(n)||(n=[n]),Array.isArray(i)||(i=[i]);const r=[],o=()=>{r.forEach(u=>u()),r.length=0},a=(u,d,h,f)=>(u.addEventListener(d,h,f),()=>u.removeEventListener(d,h,f)),l=fn(()=>[bc(e),hC(s)],([u,d])=>{if(o(),!u)return;const h=rH(d)?{...d}:d;r.push(...n.flatMap(f=>i.map(p=>a(u,f,p,h))))},{immediate:!0,flush:"post"}),c=()=>{l(),o()};return iH(c),c}let Pb=!1;function lH(t,e,n={}){const{window:i=gC,ignore:s=[],capture:r=!0,detectIframe:o=!1}=n;if(!i)return sh;oH&&!Pb&&(Pb=!0,Array.from(i.document.body.children).forEach(h=>h.addEventListener("click",sh)),i.document.documentElement.addEventListener("click",sh));let a=!0;const l=h=>s.some(f=>{if(typeof f=="string")return Array.from(i.document.querySelectorAll(f)).some(p=>p===h.target||h.composedPath().includes(p));{const p=bc(f);return p&&(h.target===p||h.composedPath().includes(p))}}),u=[Hg(i,"click",h=>{const f=bc(t);if(!(!f||f===h.target||h.composedPath().includes(f))){if(h.detail===0&&(a=!l(h)),!a){a=!0;return}e(h)}},{passive:!0,capture:r}),Hg(i,"pointerdown",h=>{const f=bc(t);a=!l(h)&&!!(f&&!h.composedPath().includes(f))},{passive:!0}),o&&Hg(i,"blur",h=>{setTimeout(()=>{var f;const p=bc(t);((f=i.document.activeElement)==null?void 0:f.tagName)==="IFRAME"&&!p?.contains(i.document.activeElement)&&e(h)},0)})].filter(Boolean);return()=>u.forEach(h=>h())}const cH={name:"peerSettingsDropdown",components:{LocaleText:Qe},setup(){return{dashboardStore:nt()}},props:{Peer:Object},data(){return{deleteBtnDisabled:!1,restrictBtnDisabled:!1,allowAccessBtnDisabled:!1}},methods:{downloadPeer(){Vt("/api/downloadPeer/"+this.$route.params.id,{id:this.Peer.id},t=>{if(t.status){const e=new Blob([t.data.file],{type:"text/plain"}),n=URL.createObjectURL(e),i=`${t.data.fileName}.conf`,s=document.createElement("a");s.href=n,s.download=i,s.click(),this.dashboardStore.newMessage("WGDashboard","Peer download started","success")}else this.dashboardStore.newMessage("Server",t.message,"danger")})},downloadQRCode(){Vt("/api/downloadPeer/"+this.$route.params.id,{id:this.Peer.id},t=>{t.status?this.$emit("qrcode",t.data.file):this.dashboardStore.newMessage("Server",t.message,"danger")})},deletePeer(){this.deleteBtnDisabled=!0,kt(`/api/deletePeers/${this.$route.params.id}`,{peers:[this.Peer.id]},t=>{this.dashboardStore.newMessage("Server",t.message,t.status?"success":"danger"),this.$emit("refresh"),this.deleteBtnDisabled=!1})},restrictPeer(){this.restrictBtnDisabled=!0,kt(`/api/restrictPeers/${this.$route.params.id}`,{peers:[this.Peer.id]},t=>{this.dashboardStore.newMessage("Server",t.message,t.status?"success":"danger"),this.$emit("refresh"),this.restrictBtnDisabled=!1})},allowAccessPeer(){this.allowAccessBtnDisabled=!0,kt(`/api/allowAccessPeers/${this.$route.params.id}`,{peers:[this.Peer.id]},t=>{this.dashboardStore.newMessage("Server",t.message,t.status?"success":"danger"),this.$emit("refresh"),this.allowAccessBtnDisabled=!1})}}},Fs=t=>(bn("data-v-e53c14b2"),t=t(),wn(),t),uH={class:"dropdown-menu mt-2 shadow-lg d-block rounded-3",style:{"max-width":"200px"}},dH={key:0},hH={class:"w-100 dropdown-item text-muted",style:{"white-space":"break-spaces","font-size":"0.7rem"}},fH={key:1,class:"d-flex",style:{"padding-left":"var(--bs-dropdown-item-padding-x)","padding-right":"var(--bs-dropdown-item-padding-x)"}},gH=Fs(()=>g("i",{class:"me-auto bi bi-download"},null,-1)),pH=[gH],mH=Fs(()=>g("i",{class:"me-auto bi bi-qr-code"},null,-1)),_H=[mH],yH=Fs(()=>g("i",{class:"me-auto bi bi-share"},null,-1)),vH=[yH],bH=Fs(()=>g("li",null,[g("hr",{class:"dropdown-divider"})],-1)),wH=Fs(()=>g("i",{class:"me-auto bi bi-pen"},null,-1)),xH=Fs(()=>g("i",{class:"me-auto bi bi-app-indicator"},null,-1)),EH=Fs(()=>g("li",null,[g("hr",{class:"dropdown-divider"})],-1)),SH=Fs(()=>g("i",{class:"me-auto bi bi-lock"},null,-1)),CH=Fs(()=>g("i",{class:"me-auto bi bi-trash"},null,-1)),TH={key:1},kH=Fs(()=>g("i",{class:"me-auto bi bi-unlock"},null,-1));function AH(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("ul",uH,[this.Peer.restricted?(D(),V("li",TH,[g("a",{class:Me(["dropdown-item d-flex text-warning",{disabled:this.allowAccessBtnDisabled}]),onClick:e[7]||(e[7]=a=>this.allowAccessPeer()),role:"button"},[kH,this.allowAccessBtnDisabled?(D(),Ce(o,{key:1,t:"Allowing Access..."})):(D(),Ce(o,{key:0,t:"Allow Access"}))],2)])):(D(),V($e,{key:0},[this.Peer.private_key?(D(),V("li",fH,[g("a",{class:"dropdown-item text-center px-0 rounded-3",role:"button",onClick:e[0]||(e[0]=a=>this.downloadPeer())},pH),g("a",{class:"dropdown-item text-center px-0 rounded-3",role:"button",onClick:e[1]||(e[1]=a=>this.downloadQRCode())},_H),g("a",{class:"dropdown-item text-center px-0 rounded-3",role:"button",onClick:e[2]||(e[2]=a=>this.$emit("share"))},vH)])):(D(),V("li",dH,[g("small",hH,[B(o,{t:"Download & QR Code is not available due to no private key set for this peer"})])])),bH,g("li",null,[g("a",{class:"dropdown-item d-flex",role:"button",onClick:e[3]||(e[3]=a=>this.$emit("setting"))},[wH,Ye(),B(o,{t:"Peer Settings"})])]),g("li",null,[g("a",{class:"dropdown-item d-flex",role:"button",onClick:e[4]||(e[4]=a=>this.$emit("jobs"))},[xH,Ye(),B(o,{t:"Schedule Jobs"})])]),EH,g("li",null,[g("a",{class:Me(["dropdown-item d-flex text-warning",{disabled:this.restrictBtnDisabled}]),onClick:e[5]||(e[5]=a=>this.restrictPeer()),role:"button"},[SH,this.restrictBtnDisabled?(D(),Ce(o,{key:1,t:"Restricting..."})):(D(),Ce(o,{key:0,t:"Restrict Access"}))],2)]),g("li",null,[g("a",{class:Me(["dropdown-item d-flex fw-bold text-danger",{disabled:this.deleteBtnDisabled}]),onClick:e[6]||(e[6]=a=>this.deletePeer()),role:"button"},[CH,this.deleteBtnDisabled?(D(),Ce(o,{key:1,t:"Deleting..."})):(D(),Ce(o,{key:0,t:"Delete"}))],2)])],64))])}const MH=He(cH,[["render",AH],["__scopeId","data-v-e53c14b2"]]),IH={name:"peer",components:{LocaleText:Qe,PeerSettingsDropdown:MH},props:{Peer:Object},data(){return{}},setup(){const t=we(null),e=we(!1);return lH(t,n=>{e.value=!1}),{target:t,subMenuOpened:e}},computed:{getLatestHandshake(){return this.Peer.latest_handshake.includes(",")?this.Peer.latest_handshake.split(",")[0]:this.Peer.latest_handshake}}},Vu=t=>(bn("data-v-4a343fe2"),t=t(),wn(),t),PH={key:0,class:"card-header bg-transparent d-flex align-items-center gap-2 border-0"},RH={style:{"font-size":"0.8rem"},class:"ms-auto d-flex gap-2"},DH={class:"text-primary"},$H=Vu(()=>g("i",{class:"bi bi-arrow-down"},null,-1)),LH={class:"text-success"},OH=Vu(()=>g("i",{class:"bi bi-arrow-up"},null,-1)),NH={key:0,class:"text-secondary"},FH=Vu(()=>g("i",{class:"bi bi-arrows-angle-contract"},null,-1)),BH={key:1,class:"border-0 card-header bg-transparent text-warning fw-bold",style:{"font-size":"0.8rem"}},VH=Vu(()=>g("i",{class:"bi-lock-fill me-2"},null,-1)),zH={class:"card-body pt-1",style:{"font-size":"0.9rem"}},WH={class:"mb-2"},HH={class:"text-muted"},YH={class:"mb-0"},jH={class:"d-flex align-items-end"},KH={class:"text-muted"},UH={class:"mb-0"},GH=Vu(()=>g("h5",{class:"mb-0"},[g("i",{class:"bi bi-three-dots"})],-1)),XH=[GH];function qH(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("PeerSettingsDropdown");return D(),V("div",{class:Me(["card shadow-sm rounded-3 peerCard bg-transparent",{"border-warning":n.Peer.restricted}])},[g("div",null,[n.Peer.restricted?(D(),V("div",BH,[VH,B(o,{t:"Access Restricted"})])):(D(),V("div",PH,[g("div",{class:Me(["dot ms-0",{active:n.Peer.status==="running"}])},null,2),g("div",RH,[g("span",DH,[$H,g("strong",null,xe((n.Peer.cumu_receive+n.Peer.total_receive).toFixed(4)),1),Ye(" GB ")]),g("span",LH,[OH,g("strong",null,xe((n.Peer.cumu_sent+n.Peer.total_sent).toFixed(4)),1),Ye(" GB ")]),n.Peer.latest_handshake!=="No Handshake"?(D(),V("span",NH,[FH,Ye(" "+xe(r.getLatestHandshake)+" ago ",1)])):ce("",!0)])]))]),g("div",zH,[g("h6",null,xe(n.Peer.name?n.Peer.name:"Untitled Peer"),1),g("div",WH,[g("small",HH,[B(o,{t:"Public Key"})]),g("p",YH,[g("samp",null,xe(n.Peer.id),1)])]),g("div",jH,[g("div",null,[g("small",KH,[B(o,{t:"Allowed IPs"})]),g("p",UH,[g("samp",null,xe(n.Peer.allowed_ip),1)])]),g("div",{class:Me(["ms-auto px-2 rounded-3 subMenuBtn",{active:this.subMenuOpened}])},[g("a",{role:"button",class:"text-body",onClick:e[0]||(e[0]=l=>this.subMenuOpened=!0)},XH),B(Rt,{name:"slide-fade"},{default:Re(()=>[this.subMenuOpened?(D(),Ce(a,{key:0,onQrcode:e[1]||(e[1]=l=>this.$emit("qrcode",l)),onSetting:e[2]||(e[2]=l=>this.$emit("setting")),onJobs:e[3]||(e[3]=l=>this.$emit("jobs")),onRefresh:e[4]||(e[4]=l=>this.$emit("refresh")),onShare:e[5]||(e[5]=l=>this.$emit("share")),Peer:n.Peer,ref:"target"},null,8,["Peer"])):ce("",!0)]),_:1})],2)])])],2)}const ZH=He(IH,[["render",qH],["__scopeId","data-v-4a343fe2"]]);/*! * @kurkle/color v0.3.2 * https://github.com/kurkle/color#readme * (c) 2023 Jukka Kurkela * Released under the MIT License - */function zu(t){return t+.5|0}const jr=(t,e,n)=>Math.max(Math.min(t,n),e);function wc(t){return jr(zu(t*2.55),0,255)}function to(t){return jr(zu(t*255),0,255)}function tr(t){return jr(zu(t/2.55)/100,0,1)}function Rb(t){return jr(zu(t*100),0,100)}const Fi={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},im=[..."0123456789ABCDEF"],MH=t=>im[t&15],IH=t=>im[(t&240)>>4]+im[t&15],Ed=t=>(t&240)>>4===(t&15),PH=t=>Ed(t.r)&&Ed(t.g)&&Ed(t.b)&&Ed(t.a);function RH(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&Fi[t[1]]*17,g:255&Fi[t[2]]*17,b:255&Fi[t[3]]*17,a:e===5?Fi[t[4]]*17:255}:(e===7||e===9)&&(n={r:Fi[t[1]]<<4|Fi[t[2]],g:Fi[t[3]]<<4|Fi[t[4]],b:Fi[t[5]]<<4|Fi[t[6]],a:e===9?Fi[t[7]]<<4|Fi[t[8]]:255})),n}const DH=(t,e)=>t<255?e(t):"";function $H(t){var e=PH(t)?MH:IH;return t?"#"+e(t.r)+e(t.g)+e(t.b)+DH(t.a,e):void 0}const LH=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function pC(t,e,n){const i=e*Math.min(n,1-n),s=(r,o=(r+t/30)%12)=>n-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function OH(t,e,n){const i=(s,r=(s+t/60)%6)=>n-n*e*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function NH(t,e,n){const i=pC(t,1,.5);let s;for(e+n>1&&(s=1/(e+n),e*=s,n*=s),s=0;s<3;s++)i[s]*=1-e-n,i[s]+=e;return i}function FH(t,e,n,i,s){return t===s?(e-n)/i+(e.5?u/(2-r-o):u/(r+o),l=FH(n,i,s,u,r),l=l*60+.5),[l|0,c||0,a]}function G_(t,e,n,i){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,i)).map(to)}function X_(t,e,n){return G_(pC,t,e,n)}function BH(t,e,n){return G_(NH,t,e,n)}function VH(t,e,n){return G_(OH,t,e,n)}function mC(t){return(t%360+360)%360}function zH(t){const e=LH.exec(t);let n=255,i;if(!e)return;e[5]!==i&&(n=e[6]?wc(+e[5]):to(+e[5]));const s=mC(+e[2]),r=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=BH(s,r,o):e[1]==="hsv"?i=VH(s,r,o):i=X_(s,r,o),{r:i[0],g:i[1],b:i[2],a:n}}function WH(t,e){var n=U_(t);n[0]=mC(n[0]+e),n=X_(n),t.r=n[0],t.g=n[1],t.b=n[2]}function HH(t){if(!t)return;const e=U_(t),n=e[0],i=Rb(e[1]),s=Rb(e[2]);return t.a<255?`hsla(${n}, ${i}%, ${s}%, ${tr(t.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const Db={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},$b={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function YH(){const t={},e=Object.keys($b),n=Object.keys(Db);let i,s,r,o,a;for(i=0;i>16&255,r>>8&255,r&255]}return t}let Sd;function jH(t){Sd||(Sd=YH(),Sd.transparent=[0,0,0,0]);const e=Sd[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const KH=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function UH(t){const e=KH.exec(t);let n=255,i,s,r;if(e){if(e[7]!==i){const o=+e[7];n=e[8]?wc(o):jr(o*255,0,255)}return i=+e[1],s=+e[3],r=+e[5],i=255&(e[2]?wc(i):jr(i,0,255)),s=255&(e[4]?wc(s):jr(s,0,255)),r=255&(e[6]?wc(r):jr(r,0,255)),{r:i,g:s,b:r,a:n}}}function GH(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${tr(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const Yg=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Da=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function XH(t,e,n){const i=Da(tr(t.r)),s=Da(tr(t.g)),r=Da(tr(t.b));return{r:to(Yg(i+n*(Da(tr(e.r))-i))),g:to(Yg(s+n*(Da(tr(e.g))-s))),b:to(Yg(r+n*(Da(tr(e.b))-r))),a:t.a+n*(e.a-t.a)}}function Cd(t,e,n){if(t){let i=U_(t);i[e]=Math.max(0,Math.min(i[e]+i[e]*n,e===0?360:1)),i=X_(i),t.r=i[0],t.g=i[1],t.b=i[2]}}function _C(t,e){return t&&Object.assign(e||{},t)}function Lb(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=to(t[3]))):(e=_C(t,{r:0,g:0,b:0,a:1}),e.a=to(e.a)),e}function qH(t){return t.charAt(0)==="r"?UH(t):zH(t)}class lu{constructor(e){if(e instanceof lu)return e;const n=typeof e;let i;n==="object"?i=Lb(e):n==="string"&&(i=RH(e)||jH(e)||qH(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=_C(this._rgb);return e&&(e.a=tr(e.a)),e}set rgb(e){this._rgb=Lb(e)}rgbString(){return this._valid?GH(this._rgb):void 0}hexString(){return this._valid?$H(this._rgb):void 0}hslString(){return this._valid?HH(this._rgb):void 0}mix(e,n){if(e){const i=this.rgb,s=e.rgb;let r;const o=n===r?.5:n,a=2*o-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,i.r=255&c*i.r+r*s.r+.5,i.g=255&c*i.g+r*s.g+.5,i.b=255&c*i.b+r*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(e,n){return e&&(this._rgb=XH(this._rgb,e._rgb,n)),this}clone(){return new lu(this.rgb)}alpha(e){return this._rgb.a=to(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=zu(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=n,this}opaquer(e){const n=this._rgb;return n.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Cd(this._rgb,2,e),this}darken(e){return Cd(this._rgb,2,-e),this}saturate(e){return Cd(this._rgb,1,e),this}desaturate(e){return Cd(this._rgb,1,-e),this}rotate(e){return WH(this._rgb,e),this}}/*! + */function zu(t){return t+.5|0}const jr=(t,e,n)=>Math.max(Math.min(t,n),e);function wc(t){return jr(zu(t*2.55),0,255)}function to(t){return jr(zu(t*255),0,255)}function tr(t){return jr(zu(t/2.55)/100,0,1)}function Rb(t){return jr(zu(t*100),0,100)}const Fi={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},im=[..."0123456789ABCDEF"],JH=t=>im[t&15],QH=t=>im[(t&240)>>4]+im[t&15],Ed=t=>(t&240)>>4===(t&15),eY=t=>Ed(t.r)&&Ed(t.g)&&Ed(t.b)&&Ed(t.a);function tY(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&Fi[t[1]]*17,g:255&Fi[t[2]]*17,b:255&Fi[t[3]]*17,a:e===5?Fi[t[4]]*17:255}:(e===7||e===9)&&(n={r:Fi[t[1]]<<4|Fi[t[2]],g:Fi[t[3]]<<4|Fi[t[4]],b:Fi[t[5]]<<4|Fi[t[6]],a:e===9?Fi[t[7]]<<4|Fi[t[8]]:255})),n}const nY=(t,e)=>t<255?e(t):"";function iY(t){var e=eY(t)?JH:QH;return t?"#"+e(t.r)+e(t.g)+e(t.b)+nY(t.a,e):void 0}const sY=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function pC(t,e,n){const i=e*Math.min(n,1-n),s=(r,o=(r+t/30)%12)=>n-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function rY(t,e,n){const i=(s,r=(s+t/60)%6)=>n-n*e*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function oY(t,e,n){const i=pC(t,1,.5);let s;for(e+n>1&&(s=1/(e+n),e*=s,n*=s),s=0;s<3;s++)i[s]*=1-e-n,i[s]+=e;return i}function aY(t,e,n,i,s){return t===s?(e-n)/i+(e.5?u/(2-r-o):u/(r+o),l=aY(n,i,s,u,r),l=l*60+.5),[l|0,c||0,a]}function G_(t,e,n,i){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,i)).map(to)}function X_(t,e,n){return G_(pC,t,e,n)}function lY(t,e,n){return G_(oY,t,e,n)}function cY(t,e,n){return G_(rY,t,e,n)}function mC(t){return(t%360+360)%360}function uY(t){const e=sY.exec(t);let n=255,i;if(!e)return;e[5]!==i&&(n=e[6]?wc(+e[5]):to(+e[5]));const s=mC(+e[2]),r=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=lY(s,r,o):e[1]==="hsv"?i=cY(s,r,o):i=X_(s,r,o),{r:i[0],g:i[1],b:i[2],a:n}}function dY(t,e){var n=U_(t);n[0]=mC(n[0]+e),n=X_(n),t.r=n[0],t.g=n[1],t.b=n[2]}function hY(t){if(!t)return;const e=U_(t),n=e[0],i=Rb(e[1]),s=Rb(e[2]);return t.a<255?`hsla(${n}, ${i}%, ${s}%, ${tr(t.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const Db={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},$b={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function fY(){const t={},e=Object.keys($b),n=Object.keys(Db);let i,s,r,o,a;for(i=0;i>16&255,r>>8&255,r&255]}return t}let Sd;function gY(t){Sd||(Sd=fY(),Sd.transparent=[0,0,0,0]);const e=Sd[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const pY=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function mY(t){const e=pY.exec(t);let n=255,i,s,r;if(e){if(e[7]!==i){const o=+e[7];n=e[8]?wc(o):jr(o*255,0,255)}return i=+e[1],s=+e[3],r=+e[5],i=255&(e[2]?wc(i):jr(i,0,255)),s=255&(e[4]?wc(s):jr(s,0,255)),r=255&(e[6]?wc(r):jr(r,0,255)),{r:i,g:s,b:r,a:n}}}function _Y(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${tr(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const Yg=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Da=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function yY(t,e,n){const i=Da(tr(t.r)),s=Da(tr(t.g)),r=Da(tr(t.b));return{r:to(Yg(i+n*(Da(tr(e.r))-i))),g:to(Yg(s+n*(Da(tr(e.g))-s))),b:to(Yg(r+n*(Da(tr(e.b))-r))),a:t.a+n*(e.a-t.a)}}function Cd(t,e,n){if(t){let i=U_(t);i[e]=Math.max(0,Math.min(i[e]+i[e]*n,e===0?360:1)),i=X_(i),t.r=i[0],t.g=i[1],t.b=i[2]}}function _C(t,e){return t&&Object.assign(e||{},t)}function Lb(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=to(t[3]))):(e=_C(t,{r:0,g:0,b:0,a:1}),e.a=to(e.a)),e}function vY(t){return t.charAt(0)==="r"?mY(t):uY(t)}class lu{constructor(e){if(e instanceof lu)return e;const n=typeof e;let i;n==="object"?i=Lb(e):n==="string"&&(i=tY(e)||gY(e)||vY(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=_C(this._rgb);return e&&(e.a=tr(e.a)),e}set rgb(e){this._rgb=Lb(e)}rgbString(){return this._valid?_Y(this._rgb):void 0}hexString(){return this._valid?iY(this._rgb):void 0}hslString(){return this._valid?hY(this._rgb):void 0}mix(e,n){if(e){const i=this.rgb,s=e.rgb;let r;const o=n===r?.5:n,a=2*o-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,i.r=255&c*i.r+r*s.r+.5,i.g=255&c*i.g+r*s.g+.5,i.b=255&c*i.b+r*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(e,n){return e&&(this._rgb=yY(this._rgb,e._rgb,n)),this}clone(){return new lu(this.rgb)}alpha(e){return this._rgb.a=to(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=zu(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=n,this}opaquer(e){const n=this._rgb;return n.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Cd(this._rgb,2,e),this}darken(e){return Cd(this._rgb,2,-e),this}saturate(e){return Cd(this._rgb,1,e),this}desaturate(e){return Cd(this._rgb,1,-e),this}rotate(e){return dY(this._rgb,e),this}}/*! * Chart.js v4.4.1 * https://www.chartjs.org * (c) 2023 Chart.js Contributors * Released under the MIT License - */function js(){}const ZH=(()=>{let t=0;return()=>t++})();function gt(t){return t===null||typeof t>"u"}function Nt(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function ut(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function qt(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function xi(t,e){return qt(t)?t:e}function tt(t,e){return typeof t>"u"?e:t}const JH=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,yC=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Pt(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function Ct(t,e,n,i){let s,r,o;if(Nt(t))if(r=t.length,i)for(s=r-1;s>=0;s--)e.call(n,t[s],s);else for(s=0;st,x:t=>t.x,y:t=>t.y};function tY(t){const e=t.split("."),n=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function nY(t){const e=tY(t);return n=>{for(const i of e){if(i==="")break;n=n&&n[i]}return n}}function ao(t,e){return(Ob[e]||(Ob[e]=nY(e)))(t)}function q_(t){return t.charAt(0).toUpperCase()+t.slice(1)}const uu=t=>typeof t<"u",lo=t=>typeof t=="function",Nb=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function iY(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Bt=Math.PI,Ft=2*Bt,sY=Ft+Bt,Eh=Number.POSITIVE_INFINITY,rY=Bt/180,on=Bt/2,Do=Bt/4,Fb=Bt*2/3,Kr=Math.log10,Ds=Math.sign;function Yc(t,e,n){return Math.abs(t-e)s-r).pop(),e}function Al(t){return!isNaN(parseFloat(t))&&isFinite(t)}function aY(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function bC(t,e,n){let i,s,r;for(i=0,s=t.length;il&&c=Math.min(e,n)-i&&t<=Math.max(e,n)+i}function J_(t,e,n){n=n||(o=>t[o]1;)r=s+i>>1,n(r)?s=r:i=r;return{lo:s,hi:i}}const or=(t,e,n,i)=>J_(t,n,i?s=>{const r=t[s][e];return rt[s][e]J_(t,n,i=>t[i][e]>=n);function dY(t,e,n){let i=0,s=t.length;for(;ii&&t[s-1]>n;)s--;return i>0||s{const i="_onData"+q_(n),s=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...r){const o=s.apply(this,r);return t._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function zb(t,e){const n=t._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(xC.forEach(r=>{delete t[r]}),delete t._chartjs)}function EC(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const SC=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function CC(t,e){let n=[],i=!1;return function(...s){n=s,i||(i=!0,SC.call(window,()=>{i=!1,t.apply(e,n)}))}}function fY(t,e){let n;return function(...i){return e?(clearTimeout(n),n=setTimeout(t,e,i)):t.apply(this,i),e}}const Q_=t=>t==="start"?"left":t==="end"?"right":"center",Bn=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,gY=(t,e,n,i)=>t===(i?"left":"right")?n:t==="center"?(e+n)/2:e;function TC(t,e,n){const i=e.length;let s=0,r=i;if(t._sorted){const{iScale:o,_parsed:a}=t,l=o.axis,{min:c,max:u,minDefined:d,maxDefined:h}=o.getUserBounds();d&&(s=Pn(Math.min(or(a,l,c).lo,n?i:or(e,l,o.getPixelForValue(c)).lo),0,i-1)),h?r=Pn(Math.max(or(a,o.axis,u,!0).hi+1,n?0:or(e,l,o.getPixelForValue(u),!0).hi+1),s,i)-s:r=i-s}return{start:s,count:r}}function kC(t){const{xScale:e,yScale:n,_scaleRanges:i}=t,s={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!i)return t._scaleRanges=s,!0;const r=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),r}const Td=t=>t===0||t===1,Wb=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*Ft/n)),Hb=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*Ft/n)+1,jc={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*on)+1,easeOutSine:t=>Math.sin(t*on),easeInOutSine:t=>-.5*(Math.cos(Bt*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>Td(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Td(t)?t:Wb(t,.075,.3),easeOutElastic:t=>Td(t)?t:Hb(t,.075,.3),easeInOutElastic(t){return Td(t)?t:t<.5?.5*Wb(t*2,.1125,.45):.5+.5*Hb(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-jc.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?jc.easeInBounce(t*2)*.5:jc.easeOutBounce(t*2-1)*.5+.5};function ey(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Yb(t){return ey(t)?t:new lu(t)}function jg(t){return ey(t)?t:new lu(t).saturate(.5).darken(.1).hexString()}const pY=["x","y","borderWidth","radius","tension"],mY=["color","borderColor","backgroundColor"];function _Y(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:mY},numbers:{type:"number",properties:pY}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function yY(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const jb=new Map;function vY(t,e){e=e||{};const n=t+JSON.stringify(e);let i=jb.get(n);return i||(i=new Intl.NumberFormat(t,e),jb.set(n,i)),i}function Wu(t,e,n){return vY(e,n).format(t)}const AC={values(t){return Nt(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const i=this.chart.options.locale;let s,r=t;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),r=bY(t,n)}const o=Kr(Math.abs(r)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Wu(t,i,l)},logarithmic(t,e,n){if(t===0)return"0";const i=n[e].significand||t/Math.pow(10,Math.floor(Kr(t)));return[1,2,3,5,10,15].includes(i)||e>.8*n.length?AC.numeric.call(this,t,e,n):""}};function bY(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}var xf={formatters:AC};function wY(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,n)=>n.lineWidth,tickColor:(e,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:xf.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const ca=Object.create(null),rm=Object.create(null);function Kc(t,e){if(!e)return t;const n=e.split(".");for(let i=0,s=n.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>jg(s.backgroundColor),this.hoverBorderColor=(i,s)=>jg(s.borderColor),this.hoverColor=(i,s)=>jg(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(n)}set(e,n){return Kg(this,e,n)}get(e){return Kc(this,e)}describe(e,n){return Kg(rm,e,n)}override(e,n){return Kg(ca,e,n)}route(e,n,i,s){const r=Kc(this,e),o=Kc(this,i),a="_"+n;Object.defineProperties(r,{[a]:{value:r[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=o[s];return ut(l)?Object.assign({},c,l):tt(l,c)},set(l){this[a]=l}}})}apply(e){e.forEach(n=>n(this))}}var Zt=new xY({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[_Y,yY,wY]);function EY(t){return!t||gt(t.size)||gt(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Sh(t,e,n,i,s){let r=e[s];return r||(r=e[s]=t.measureText(s).width,n.push(s)),r>i&&(i=r),i}function SY(t,e,n,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(s=i.data={},r=i.garbageCollect=[],i.font=e),t.save(),t.font=e;let o=0;const a=n.length;let l,c,u,d,h;for(l=0;ln.length){for(l=0;l0&&t.stroke()}}function ar(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.xe.top-n&&t.y0&&r.strokeColor!=="";let l,c;for(t.save(),t.font=s.string,kY(t,r),l=0;l+t||0;function ty(t,e){const n={},i=ut(e),s=i?Object.keys(e):e,r=ut(t)?i?o=>tt(t[o],t[e[o]]):o=>t[o]:()=>t;for(const o of s)n[o]=DY(r(o));return n}function IC(t){return ty(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ia(t){return ty(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Kn(t){const e=IC(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function vn(t,e){t=t||{},e=e||Zt.font;let n=tt(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let i=tt(t.style,e.style);i&&!(""+i).match(PY)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:tt(t.family,e.family),lineHeight:RY(tt(t.lineHeight,e.lineHeight),n),size:n,style:i,weight:tt(t.weight,e.weight),string:""};return s.string=EY(s),s}function xc(t,e,n,i){let s=!0,r,o,a;for(r=0,o=t.length;rn&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(s,r)}}function yo(t,e){return Object.assign(Object.create(t),e)}function ny(t,e=[""],n,i,s=()=>t[0]){const r=n||t;typeof i>"u"&&(i=$C("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:r,_fallback:i,_getTarget:s,override:a=>ny([a,...t],e,r,i)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete t[0][l],!0},get(a,l){return RC(a,l,()=>WY(l,e,t,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(a,l){return Gb(a).includes(l)},ownKeys(a){return Gb(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function Ml(t,e,n,i){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:PC(t,i),setContext:r=>Ml(t,r,n,i),override:r=>Ml(t.override(r),e,n,i)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete t[o],!0},get(r,o,a){return RC(r,o,()=>OY(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(t,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,o)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(r,o){return Reflect.has(t,o)},ownKeys(){return Reflect.ownKeys(t)},set(r,o,a){return t[o]=a,delete r[o],!0}})}function PC(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:i=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:n,indexable:i,isScriptable:lo(n)?n:()=>n,isIndexable:lo(i)?i:()=>i}}const LY=(t,e)=>t?t+q_(e):e,iy=(t,e)=>ut(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function RC(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const i=n();return t[e]=i,i}function OY(t,e,n){const{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=t;let a=i[e];return lo(a)&&o.isScriptable(e)&&(a=NY(e,a,t,n)),Nt(a)&&a.length&&(a=FY(e,a,t,o.isIndexable)),iy(e,a)&&(a=Ml(a,s,r&&r[e],o)),a}function NY(t,e,n,i){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=n;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(r,o||i);return a.delete(t),iy(t,l)&&(l=sy(s._scopes,s,t,l)),l}function FY(t,e,n,i){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=n;if(typeof r.index<"u"&&i(t))return e[r.index%e.length];if(ut(e[0])){const l=e,c=s._scopes.filter(u=>u!==l);e=[];for(const u of l){const d=sy(c,s,t,u);e.push(Ml(d,r,o&&o[t],a))}}return e}function DC(t,e,n){return lo(t)?t(e,n):t}const BY=(t,e)=>t===!0?e:typeof t=="string"?ao(e,t):void 0;function VY(t,e,n,i,s){for(const r of e){const o=BY(n,r);if(o){t.add(o);const a=DC(o._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==i)return a}else if(o===!1&&typeof i<"u"&&n!==i)return null}return!1}function sy(t,e,n,i){const s=e._rootScopes,r=DC(e._fallback,n,i),o=[...t,...s],a=new Set;a.add(i);let l=Ub(a,o,n,r||n,i);return l===null||typeof r<"u"&&r!==n&&(l=Ub(a,o,r,l,i),l===null)?!1:ny(Array.from(a),[""],s,r,()=>zY(e,n,i))}function Ub(t,e,n,i,s){for(;n;)n=VY(t,e,n,i,s);return n}function zY(t,e,n){const i=t._getTarget();e in i||(i[e]={});const s=i[e];return Nt(s)&&ut(n)?n:s||{}}function WY(t,e,n,i){let s;for(const r of e)if(s=$C(LY(r,t),n),typeof s<"u")return iy(t,s)?sy(n,i,t,s):s}function $C(t,e){for(const n of e){if(!n)continue;const i=n[t];if(typeof i<"u")return i}}function Gb(t){let e=t._keys;return e||(e=t._keys=HY(t._scopes)),e}function HY(t){const e=new Set;for(const n of t)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))e.add(i);return Array.from(e)}function LC(t,e,n,i){const{iScale:s}=t,{key:r="r"}=this._parsing,o=new Array(i);let a,l,c,u;for(a=0,l=i;aet==="x"?"y":"x";function jY(t,e,n,i){const s=t.skip?e:t,r=e,o=n.skip?e:n,a=sm(r,s),l=sm(o,r);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,h=i*u;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+h*(o.x-s.x),y:r.y+h*(o.y-s.y)}}}function KY(t,e,n){const i=t.length;let s,r,o,a,l,c=Il(t,0);for(let u=0;u!c.skip)),e.cubicInterpolationMode==="monotone")GY(t,s);else{let c=i?t[t.length-1]:t[0];for(r=0,o=t.length;rt.ownerDocument.defaultView.getComputedStyle(t,null);function ZY(t,e){return Cf(t).getPropertyValue(e)}const JY=["top","right","bottom","left"];function sa(t,e,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const r=JY[s];i[r]=parseFloat(t[e+"-"+r+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const QY=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function ej(t,e){const n=t.touches,i=n&&n.length?n[0]:t,{offsetX:s,offsetY:r}=i;let o=!1,a,l;if(QY(s,r,t.target))a=s,l=r;else{const c=e.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function zo(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:i}=e,s=Cf(n),r=s.boxSizing==="border-box",o=sa(s,"padding"),a=sa(s,"border","width"),{x:l,y:c,box:u}=ej(t,n),d=o.left+(u&&a.left),h=o.top+(u&&a.top);let{width:f,height:p}=e;return r&&(f-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-d)/f*n.width/i),y:Math.round((c-h)/p*n.height/i)}}function tj(t,e,n){let i,s;if(e===void 0||n===void 0){const r=oy(t);if(!r)e=t.clientWidth,n=t.clientHeight;else{const o=r.getBoundingClientRect(),a=Cf(r),l=sa(a,"border","width"),c=sa(a,"padding");e=o.width-c.width-l.width,n=o.height-c.height-l.height,i=Ch(a.maxWidth,r,"clientWidth"),s=Ch(a.maxHeight,r,"clientHeight")}}return{width:e,height:n,maxWidth:i||Eh,maxHeight:s||Eh}}const Ad=t=>Math.round(t*10)/10;function nj(t,e,n,i){const s=Cf(t),r=sa(s,"margin"),o=Ch(s.maxWidth,t,"clientWidth")||Eh,a=Ch(s.maxHeight,t,"clientHeight")||Eh,l=tj(t,e,n);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const h=sa(s,"border","width"),f=sa(s,"padding");c-=f.width+h.width,u-=f.height+h.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?c/i:u-r.height),c=Ad(Math.min(c,o,l.maxWidth)),u=Ad(Math.min(u,a,l.maxHeight)),c&&!u&&(u=Ad(c/2)),(e!==void 0||n!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=Ad(Math.floor(u*i))),{width:c,height:u}}function Xb(t,e,n){const i=e||1,s=Math.floor(t.height*i),r=Math.floor(t.width*i);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const o=t.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${t.height}px`,o.style.width=`${t.width}px`),t.currentDevicePixelRatio!==i||o.height!==s||o.width!==r?(t.currentDevicePixelRatio=i,o.height=s,o.width=r,t.ctx.setTransform(i,0,0,i,0,0),!0):!1}const ij=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};ry()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function qb(t,e){const n=ZY(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Wo(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function sj(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:i==="middle"?n<.5?t.y:e.y:i==="after"?n<1?t.y:e.y:n>0?e.y:t.y}}function rj(t,e,n,i){const s={x:t.cp2x,y:t.cp2y},r={x:e.cp1x,y:e.cp1y},o=Wo(t,s,n),a=Wo(s,r,n),l=Wo(r,e,n),c=Wo(o,a,n),u=Wo(a,l,n);return Wo(c,u,n)}const oj=function(t,e){return{x(n){return t+t+e-n},setWidth(n){e=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},aj=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function ol(t,e,n){return t?oj(e,n):aj()}function NC(t,e){let n,i;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=i)}function FC(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function BC(t){return t==="angle"?{between:du,compare:lY,normalize:Si}:{between:rr,compare:(e,n)=>e-n,normalize:e=>e}}function Zb({start:t,end:e,count:n,loop:i,style:s}){return{start:t%n,end:e%n,loop:i&&(e-t+1)%n===0,style:s}}function lj(t,e,n){const{property:i,start:s,end:r}=n,{between:o,normalize:a}=BC(i),l=e.length;let{start:c,end:u,loop:d}=t,h,f;if(d){for(c+=l,u+=l,h=0,f=l;hl(s,E,v)&&a(s,E)!==0,w=()=>a(r,v)===0||l(r,E,v),x=()=>m||C(),T=()=>!m||w();for(let k=u,A=u;k<=d;++k)b=e[k%o],!b.skip&&(v=c(b[i]),v!==E&&(m=l(v,s,r),y===null&&x()&&(y=a(v,s)===0?k:A),y!==null&&T()&&(p.push(Zb({start:y,end:k,loop:h,count:o,style:f})),y=null),A=k,E=v));return y!==null&&p.push(Zb({start:y,end:d,loop:h,count:o,style:f})),p}function zC(t,e){const n=[],i=t.segments;for(let s=0;ss&&t[r%e].skip;)r--;return r%=e,{start:s,end:r}}function uj(t,e,n,i){const s=t.length,r=[];let o=e,a=t[e],l;for(l=e+1;l<=n;++l){const c=t[l%s];c.skip||c.stop?a.skip||(i=!1,r.push({start:e%s,end:(l-1)%s,loop:i}),e=o=c.stop?l:null):(o=l,a.skip&&(e=l)),a=c}return o!==null&&r.push({start:e%s,end:o%s,loop:i}),r}function dj(t,e){const n=t.points,i=t.options.spanGaps,s=n.length;if(!s)return[];const r=!!t._loop,{start:o,end:a}=cj(n,s,r,i);if(i===!0)return Jb(t,[{start:o,end:a,loop:r}],n,e);const l=a{let t=0;return()=>t++})();function gt(t){return t===null||typeof t>"u"}function Nt(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function ut(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function qt(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function xi(t,e){return qt(t)?t:e}function tt(t,e){return typeof t>"u"?e:t}const wY=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,yC=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Pt(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function Ct(t,e,n,i){let s,r,o;if(Nt(t))if(r=t.length,i)for(s=r-1;s>=0;s--)e.call(n,t[s],s);else for(s=0;st,x:t=>t.x,y:t=>t.y};function SY(t){const e=t.split("."),n=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function CY(t){const e=SY(t);return n=>{for(const i of e){if(i==="")break;n=n&&n[i]}return n}}function ao(t,e){return(Ob[e]||(Ob[e]=CY(e)))(t)}function q_(t){return t.charAt(0).toUpperCase()+t.slice(1)}const uu=t=>typeof t<"u",lo=t=>typeof t=="function",Nb=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function TY(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Bt=Math.PI,Ft=2*Bt,kY=Ft+Bt,Eh=Number.POSITIVE_INFINITY,AY=Bt/180,on=Bt/2,Do=Bt/4,Fb=Bt*2/3,Kr=Math.log10,Ds=Math.sign;function Yc(t,e,n){return Math.abs(t-e)s-r).pop(),e}function Al(t){return!isNaN(parseFloat(t))&&isFinite(t)}function IY(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function bC(t,e,n){let i,s,r;for(i=0,s=t.length;il&&c=Math.min(e,n)-i&&t<=Math.max(e,n)+i}function J_(t,e,n){n=n||(o=>t[o]1;)r=s+i>>1,n(r)?s=r:i=r;return{lo:s,hi:i}}const or=(t,e,n,i)=>J_(t,n,i?s=>{const r=t[s][e];return rt[s][e]J_(t,n,i=>t[i][e]>=n);function $Y(t,e,n){let i=0,s=t.length;for(;ii&&t[s-1]>n;)s--;return i>0||s{const i="_onData"+q_(n),s=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...r){const o=s.apply(this,r);return t._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function zb(t,e){const n=t._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(xC.forEach(r=>{delete t[r]}),delete t._chartjs)}function EC(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const SC=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function CC(t,e){let n=[],i=!1;return function(...s){n=s,i||(i=!0,SC.call(window,()=>{i=!1,t.apply(e,n)}))}}function OY(t,e){let n;return function(...i){return e?(clearTimeout(n),n=setTimeout(t,e,i)):t.apply(this,i),e}}const Q_=t=>t==="start"?"left":t==="end"?"right":"center",Bn=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,NY=(t,e,n,i)=>t===(i?"left":"right")?n:t==="center"?(e+n)/2:e;function TC(t,e,n){const i=e.length;let s=0,r=i;if(t._sorted){const{iScale:o,_parsed:a}=t,l=o.axis,{min:c,max:u,minDefined:d,maxDefined:h}=o.getUserBounds();d&&(s=Pn(Math.min(or(a,l,c).lo,n?i:or(e,l,o.getPixelForValue(c)).lo),0,i-1)),h?r=Pn(Math.max(or(a,o.axis,u,!0).hi+1,n?0:or(e,l,o.getPixelForValue(u),!0).hi+1),s,i)-s:r=i-s}return{start:s,count:r}}function kC(t){const{xScale:e,yScale:n,_scaleRanges:i}=t,s={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!i)return t._scaleRanges=s,!0;const r=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),r}const Td=t=>t===0||t===1,Wb=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*Ft/n)),Hb=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*Ft/n)+1,jc={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*on)+1,easeOutSine:t=>Math.sin(t*on),easeInOutSine:t=>-.5*(Math.cos(Bt*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>Td(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Td(t)?t:Wb(t,.075,.3),easeOutElastic:t=>Td(t)?t:Hb(t,.075,.3),easeInOutElastic(t){return Td(t)?t:t<.5?.5*Wb(t*2,.1125,.45):.5+.5*Hb(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-jc.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?jc.easeInBounce(t*2)*.5:jc.easeOutBounce(t*2-1)*.5+.5};function ey(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Yb(t){return ey(t)?t:new lu(t)}function jg(t){return ey(t)?t:new lu(t).saturate(.5).darken(.1).hexString()}const FY=["x","y","borderWidth","radius","tension"],BY=["color","borderColor","backgroundColor"];function VY(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:BY},numbers:{type:"number",properties:FY}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function zY(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const jb=new Map;function WY(t,e){e=e||{};const n=t+JSON.stringify(e);let i=jb.get(n);return i||(i=new Intl.NumberFormat(t,e),jb.set(n,i)),i}function Wu(t,e,n){return WY(e,n).format(t)}const AC={values(t){return Nt(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const i=this.chart.options.locale;let s,r=t;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),r=HY(t,n)}const o=Kr(Math.abs(r)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Wu(t,i,l)},logarithmic(t,e,n){if(t===0)return"0";const i=n[e].significand||t/Math.pow(10,Math.floor(Kr(t)));return[1,2,3,5,10,15].includes(i)||e>.8*n.length?AC.numeric.call(this,t,e,n):""}};function HY(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}var xf={formatters:AC};function YY(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,n)=>n.lineWidth,tickColor:(e,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:xf.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const ca=Object.create(null),rm=Object.create(null);function Kc(t,e){if(!e)return t;const n=e.split(".");for(let i=0,s=n.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>jg(s.backgroundColor),this.hoverBorderColor=(i,s)=>jg(s.borderColor),this.hoverColor=(i,s)=>jg(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(n)}set(e,n){return Kg(this,e,n)}get(e){return Kc(this,e)}describe(e,n){return Kg(rm,e,n)}override(e,n){return Kg(ca,e,n)}route(e,n,i,s){const r=Kc(this,e),o=Kc(this,i),a="_"+n;Object.defineProperties(r,{[a]:{value:r[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=o[s];return ut(l)?Object.assign({},c,l):tt(l,c)},set(l){this[a]=l}}})}apply(e){e.forEach(n=>n(this))}}var Zt=new jY({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[VY,zY,YY]);function KY(t){return!t||gt(t.size)||gt(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Sh(t,e,n,i,s){let r=e[s];return r||(r=e[s]=t.measureText(s).width,n.push(s)),r>i&&(i=r),i}function UY(t,e,n,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(s=i.data={},r=i.garbageCollect=[],i.font=e),t.save(),t.font=e;let o=0;const a=n.length;let l,c,u,d,h;for(l=0;ln.length){for(l=0;l0&&t.stroke()}}function ar(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.xe.top-n&&t.y0&&r.strokeColor!=="";let l,c;for(t.save(),t.font=s.string,qY(t,r),l=0;l+t||0;function ty(t,e){const n={},i=ut(e),s=i?Object.keys(e):e,r=ut(t)?i?o=>tt(t[o],t[e[o]]):o=>t[o]:()=>t;for(const o of s)n[o]=nj(r(o));return n}function IC(t){return ty(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ia(t){return ty(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Kn(t){const e=IC(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function vn(t,e){t=t||{},e=e||Zt.font;let n=tt(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let i=tt(t.style,e.style);i&&!(""+i).match(ej)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:tt(t.family,e.family),lineHeight:tj(tt(t.lineHeight,e.lineHeight),n),size:n,style:i,weight:tt(t.weight,e.weight),string:""};return s.string=KY(s),s}function xc(t,e,n,i){let s=!0,r,o,a;for(r=0,o=t.length;rn&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(s,r)}}function yo(t,e){return Object.assign(Object.create(t),e)}function ny(t,e=[""],n,i,s=()=>t[0]){const r=n||t;typeof i>"u"&&(i=$C("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:r,_fallback:i,_getTarget:s,override:a=>ny([a,...t],e,r,i)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete t[0][l],!0},get(a,l){return RC(a,l,()=>dj(l,e,t,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(a,l){return Gb(a).includes(l)},ownKeys(a){return Gb(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function Ml(t,e,n,i){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:PC(t,i),setContext:r=>Ml(t,r,n,i),override:r=>Ml(t.override(r),e,n,i)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete t[o],!0},get(r,o,a){return RC(r,o,()=>rj(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(t,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,o)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(r,o){return Reflect.has(t,o)},ownKeys(){return Reflect.ownKeys(t)},set(r,o,a){return t[o]=a,delete r[o],!0}})}function PC(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:i=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:n,indexable:i,isScriptable:lo(n)?n:()=>n,isIndexable:lo(i)?i:()=>i}}const sj=(t,e)=>t?t+q_(e):e,iy=(t,e)=>ut(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function RC(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const i=n();return t[e]=i,i}function rj(t,e,n){const{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=t;let a=i[e];return lo(a)&&o.isScriptable(e)&&(a=oj(e,a,t,n)),Nt(a)&&a.length&&(a=aj(e,a,t,o.isIndexable)),iy(e,a)&&(a=Ml(a,s,r&&r[e],o)),a}function oj(t,e,n,i){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=n;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(r,o||i);return a.delete(t),iy(t,l)&&(l=sy(s._scopes,s,t,l)),l}function aj(t,e,n,i){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=n;if(typeof r.index<"u"&&i(t))return e[r.index%e.length];if(ut(e[0])){const l=e,c=s._scopes.filter(u=>u!==l);e=[];for(const u of l){const d=sy(c,s,t,u);e.push(Ml(d,r,o&&o[t],a))}}return e}function DC(t,e,n){return lo(t)?t(e,n):t}const lj=(t,e)=>t===!0?e:typeof t=="string"?ao(e,t):void 0;function cj(t,e,n,i,s){for(const r of e){const o=lj(n,r);if(o){t.add(o);const a=DC(o._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==i)return a}else if(o===!1&&typeof i<"u"&&n!==i)return null}return!1}function sy(t,e,n,i){const s=e._rootScopes,r=DC(e._fallback,n,i),o=[...t,...s],a=new Set;a.add(i);let l=Ub(a,o,n,r||n,i);return l===null||typeof r<"u"&&r!==n&&(l=Ub(a,o,r,l,i),l===null)?!1:ny(Array.from(a),[""],s,r,()=>uj(e,n,i))}function Ub(t,e,n,i,s){for(;n;)n=cj(t,e,n,i,s);return n}function uj(t,e,n){const i=t._getTarget();e in i||(i[e]={});const s=i[e];return Nt(s)&&ut(n)?n:s||{}}function dj(t,e,n,i){let s;for(const r of e)if(s=$C(sj(r,t),n),typeof s<"u")return iy(t,s)?sy(n,i,t,s):s}function $C(t,e){for(const n of e){if(!n)continue;const i=n[t];if(typeof i<"u")return i}}function Gb(t){let e=t._keys;return e||(e=t._keys=hj(t._scopes)),e}function hj(t){const e=new Set;for(const n of t)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))e.add(i);return Array.from(e)}function LC(t,e,n,i){const{iScale:s}=t,{key:r="r"}=this._parsing,o=new Array(i);let a,l,c,u;for(a=0,l=i;aet==="x"?"y":"x";function gj(t,e,n,i){const s=t.skip?e:t,r=e,o=n.skip?e:n,a=sm(r,s),l=sm(o,r);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,h=i*u;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+h*(o.x-s.x),y:r.y+h*(o.y-s.y)}}}function pj(t,e,n){const i=t.length;let s,r,o,a,l,c=Il(t,0);for(let u=0;u!c.skip)),e.cubicInterpolationMode==="monotone")_j(t,s);else{let c=i?t[t.length-1]:t[0];for(r=0,o=t.length;rt.ownerDocument.defaultView.getComputedStyle(t,null);function bj(t,e){return Cf(t).getPropertyValue(e)}const wj=["top","right","bottom","left"];function sa(t,e,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const r=wj[s];i[r]=parseFloat(t[e+"-"+r+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const xj=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function Ej(t,e){const n=t.touches,i=n&&n.length?n[0]:t,{offsetX:s,offsetY:r}=i;let o=!1,a,l;if(xj(s,r,t.target))a=s,l=r;else{const c=e.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function zo(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:i}=e,s=Cf(n),r=s.boxSizing==="border-box",o=sa(s,"padding"),a=sa(s,"border","width"),{x:l,y:c,box:u}=Ej(t,n),d=o.left+(u&&a.left),h=o.top+(u&&a.top);let{width:f,height:p}=e;return r&&(f-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-d)/f*n.width/i),y:Math.round((c-h)/p*n.height/i)}}function Sj(t,e,n){let i,s;if(e===void 0||n===void 0){const r=oy(t);if(!r)e=t.clientWidth,n=t.clientHeight;else{const o=r.getBoundingClientRect(),a=Cf(r),l=sa(a,"border","width"),c=sa(a,"padding");e=o.width-c.width-l.width,n=o.height-c.height-l.height,i=Ch(a.maxWidth,r,"clientWidth"),s=Ch(a.maxHeight,r,"clientHeight")}}return{width:e,height:n,maxWidth:i||Eh,maxHeight:s||Eh}}const Ad=t=>Math.round(t*10)/10;function Cj(t,e,n,i){const s=Cf(t),r=sa(s,"margin"),o=Ch(s.maxWidth,t,"clientWidth")||Eh,a=Ch(s.maxHeight,t,"clientHeight")||Eh,l=Sj(t,e,n);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const h=sa(s,"border","width"),f=sa(s,"padding");c-=f.width+h.width,u-=f.height+h.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?c/i:u-r.height),c=Ad(Math.min(c,o,l.maxWidth)),u=Ad(Math.min(u,a,l.maxHeight)),c&&!u&&(u=Ad(c/2)),(e!==void 0||n!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=Ad(Math.floor(u*i))),{width:c,height:u}}function Xb(t,e,n){const i=e||1,s=Math.floor(t.height*i),r=Math.floor(t.width*i);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const o=t.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${t.height}px`,o.style.width=`${t.width}px`),t.currentDevicePixelRatio!==i||o.height!==s||o.width!==r?(t.currentDevicePixelRatio=i,o.height=s,o.width=r,t.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Tj=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};ry()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function qb(t,e){const n=bj(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Wo(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function kj(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:i==="middle"?n<.5?t.y:e.y:i==="after"?n<1?t.y:e.y:n>0?e.y:t.y}}function Aj(t,e,n,i){const s={x:t.cp2x,y:t.cp2y},r={x:e.cp1x,y:e.cp1y},o=Wo(t,s,n),a=Wo(s,r,n),l=Wo(r,e,n),c=Wo(o,a,n),u=Wo(a,l,n);return Wo(c,u,n)}const Mj=function(t,e){return{x(n){return t+t+e-n},setWidth(n){e=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},Ij=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function ol(t,e,n){return t?Mj(e,n):Ij()}function NC(t,e){let n,i;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=i)}function FC(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function BC(t){return t==="angle"?{between:du,compare:PY,normalize:Si}:{between:rr,compare:(e,n)=>e-n,normalize:e=>e}}function Zb({start:t,end:e,count:n,loop:i,style:s}){return{start:t%n,end:e%n,loop:i&&(e-t+1)%n===0,style:s}}function Pj(t,e,n){const{property:i,start:s,end:r}=n,{between:o,normalize:a}=BC(i),l=e.length;let{start:c,end:u,loop:d}=t,h,f;if(d){for(c+=l,u+=l,h=0,f=l;hl(s,E,v)&&a(s,E)!==0,w=()=>a(r,v)===0||l(r,E,v),x=()=>m||C(),T=()=>!m||w();for(let k=u,A=u;k<=d;++k)b=e[k%o],!b.skip&&(v=c(b[i]),v!==E&&(m=l(v,s,r),y===null&&x()&&(y=a(v,s)===0?k:A),y!==null&&T()&&(p.push(Zb({start:y,end:k,loop:h,count:o,style:f})),y=null),A=k,E=v));return y!==null&&p.push(Zb({start:y,end:d,loop:h,count:o,style:f})),p}function zC(t,e){const n=[],i=t.segments;for(let s=0;ss&&t[r%e].skip;)r--;return r%=e,{start:s,end:r}}function Dj(t,e,n,i){const s=t.length,r=[];let o=e,a=t[e],l;for(l=e+1;l<=n;++l){const c=t[l%s];c.skip||c.stop?a.skip||(i=!1,r.push({start:e%s,end:(l-1)%s,loop:i}),e=o=c.stop?l:null):(o=l,a.skip&&(e=l)),a=c}return o!==null&&r.push({start:e%s,end:o%s,loop:i}),r}function $j(t,e){const n=t.points,i=t.options.spanGaps,s=n.length;if(!s)return[];const r=!!t._loop,{start:o,end:a}=Rj(n,s,r,i);if(i===!0)return Jb(t,[{start:o,end:a,loop:r}],n,e);const l=aa({chart:e,initial:n.initial,numSteps:o,currentStep:Math.min(i-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=SC.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(e),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,e,"progress")),r.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),n+=r.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let i=n.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,i)),i}listen(e,n,i){this._getAnims(e).listeners[n].push(i)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Xs=new gj;const e1="transparent",pj={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const i=Yb(t||e1),s=i.valid&&Yb(e||e1);return s&&s.valid?s.mix(i,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class mj{constructor(e,n,i,s){const r=n[i];s=xc([e.to,s,r,e.from]);const o=xc([e.from,r,s]);this._active=!0,this._fn=e.fn||pj[e.type||typeof o],this._easing=jc[e.easing]||jc.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=r,this._loop=!!e.loop,this._to=xc([e.to,n,s,e.from]),this._from=xc([e.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||n1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,i)=>{e.push({res:n,rej:i})})}_notify(e){const n=e?"res":"rej",i=this._promises||[];for(let s=0;s{const r=e[s];if(!ut(r))return;const o={};for(const a of n)o[a]=r[a];(Nt(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(e,n){const i=n.options,s=yj(e,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&_j(e.options.$animations,i).then(()=>{e.options=i},()=>{}),r}_createAnimations(e,n){const i=this._properties,s=[],r=e.$animations||(e.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(e,n));continue}const u=n[c];let d=r[c];const h=i.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){e[c]=u;continue}r[c]=d=new mj(h,e,c,u),s.push(d)}return s}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const i=this._createAnimations(e,n);if(i.length)return Xs.add(this._chart,i),!0}}function _j(t,e){const n=[],i=Object.keys(e);for(let s=0;s0||!n&&r<0)return s.index}return null}function r1(t,e){const{chart:n,_cachedMeta:i}=t,s=n._stacks||(n._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=xj(r,o,i),d=e.length;let h;for(let f=0;fn[i].axis===e).shift()}function Cj(t,e){return yo(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Tj(t,e,n){return yo(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function uc(t,e){const n=t.controller.index,i=t.vScale&&t.vScale.axis;if(i){e=e||t._parsed;for(const s of e){const r=s._stacks;if(!r||r[i]===void 0||r[i][n]===void 0)return;delete r[i][n],r[i]._visualValues!==void 0&&r[i]._visualValues[n]!==void 0&&delete r[i]._visualValues[n]}}}const Gg=t=>t==="reset"||t==="none",o1=(t,e)=>e?t:Object.assign({},t),kj=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:HC(n,!0),values:null};class vo{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,n){this.chart=e,this._ctx=e.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=i1(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&uc(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(d,h,f,p)=>d==="x"?h:d==="r"?p:f,r=n.xAxisID=tt(i.xAxisID,Ug(e,"x")),o=n.yAxisID=tt(i.yAxisID,Ug(e,"y")),a=n.rAxisID=tt(i.rAxisID,Ug(e,"r")),l=n.indexAxis,c=n.iAxisID=s(l,r,o,a),u=n.vAxisID=s(l,o,r,a);n.xScale=this.getScaleForId(r),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&zb(this._data,this),e._stacked&&uc(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),i=this._data;if(ut(n))this._data=wj(n);else if(i!==n){if(i){zb(i,this);const s=this._cachedMeta;uc(s),s._parsed=[]}n&&Object.isExtensible(n)&&hY(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const r=n._stacked;n._stacked=i1(n.vScale,n),n.stack!==i.stack&&(s=!0,uc(n),n.stack=i.stack),this._resyncElements(e),(s||r!==n._stacked)&&r1(this,n._parsed)}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis;let l=e===0&&n===s.length?!0:i._sorted,c=e>0&&i._parsed[e-1],u,d,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{Nt(s[e])?h=this.parseArrayData(i,s,e,n):ut(s[e])?h=this.parseObjectData(i,s,e,n):h=this.parsePrimitiveData(i,s,e,n);const f=()=>d[a]===null||c&&d[a]m||d=0;--h)if(!p()){this.updateRangeFromParsed(c,e,f,l);break}}return c}getAllParsedValues(e){const n=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=n.length;s=0&&ethis.getContext(i,s,n),m=c.resolveNamedOptions(h,f,p,d);return m.$shared&&(m.$shared=l,r[o]=Object.freeze(o1(m,l))),m}_resolveAnimations(e,n,i){const s=this.chart,r=this._cachedDataOpts,o=`animation-${n}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(e,i,n))}const c=new WC(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||Gg(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const i=this.resolveDataElementOptions(e,n),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(n,r)||r!==s;return this.updateSharedOptions(r,n,i),{sharedOptions:r,includeOptions:o}}updateElement(e,n,i,s){Gg(s)?Object.assign(e,i):this._resolveAnimations(n,s).update(e,i)}updateSharedOptions(e,n,i){e&&!Gg(n)&&this._resolveAnimations(void 0,n).update(e,i)}_setStyle(e,n,i,s){e.active=s;const r=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(e,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(e,n,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,n,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,r=n.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,e):r{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(r),a=e;as-r))}return t._cache.$bar}function Mj(t){const e=t.iScale,n=Aj(e,t.type);let i=e._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(uu(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=n.length;s0?s[t-1]:null,a=tMath.abs(a)&&(l=a,c=o),e[n.axis]=c,e._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function YC(t,e,n,i){return Nt(t)?Rj(t,e,n,i):e[n.axis]=n.parse(t,i),e}function a1(t,e,n,i){const s=t.iScale,r=t.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,h;for(c=n,u=n+i;c=n?1:-1)}function $j(t){let e,n,i,s,r;return t.horizontal?(e=t.base>t.x,n="left",i="right"):(e=t.basel.controller.options.grouped),r=i.options.stacked,o=[],a=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(gt(u)||isNaN(u))return!0};for(const l of s)if(!(n!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,n,i){const s=this._getStacks(e,i),r=n!==void 0?s.indexOf(n):-1;return r===-1?s.length-1:r}_getRuler(){const e=this.options,n=this._cachedMeta,i=n.iScale,s=[];let r,o;for(r=0,o=n.data.length;r=0;--i)n=Math.max(n,e[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(e){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=n,o=this.getParsed(e),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y),c=o._custom;return{label:i[e]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(e){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,e)}updateElements(e,n,i,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,s),u=o.axis,d=a.axis;for(let h=n;hdu(E,a,l,!0)?1:Math.max(C,C*n,w,w*n),p=(E,C,w)=>du(E,a,l,!0)?-1:Math.min(C,C*n,w,w*n),m=f(0,c,d),y=f(on,u,h),v=p(Bt,c,d),b=p(Bt+on,u,h);i=(m-v)/2,s=(y-b)/2,r=-(m+v)/2,o=-(y+b)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}class KC extends vo{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=e.legend.options;return n.labels.map((r,o)=>{const l=e.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!e.getDataVisibility(o),index:o}})}return[]}},onClick(e,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}};constructor(e,n){super(e,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,n){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(ut(i[e])){const{key:l="value"}=this._parsing;r=c=>+ao(i[c],l)}let o,a;for(o=e,a=e+n;o0&&!isNaN(e)?Ft*(Math.abs(e)/n):0}getLabelAndValue(e){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=Wu(n._parsed[e],i.options.locale);return{label:s[e]||"",value:r}}getMaxBorderWidth(e){let n=0;const i=this.chart;let s,r,o,a,l;if(!e){for(s=0,r=i.data.datasets.length;s0&&this.getParsed(n-1);for(let w=0;w=b){T.skip=!0;continue}const k=this.getParsed(w),A=gt(k[f]),P=T[h]=o.getPixelForValue(k[h],w),F=T[f]=r||A?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[f],w);T.skip=isNaN(P)||isNaN(F)||A,T.stop=w>0&&Math.abs(k[h]-C[h])>y,m&&(T.parsed=k,T.raw=c.data[w]),d&&(T.options=u||this.resolveDataElementOptions(w,x.active?"active":s)),v||this.updateElement(x,w,T,s),C=k}}getMaxOverflow(){const e=this._cachedMeta,n=e.dataset,i=n.options&&n.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}class Vj extends vo{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=e.legend.options;return n.labels.map((r,o)=>{const l=e.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!e.getDataVisibility(o),index:o}})}return[]}},onClick(e,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(e,n){super(e,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=Wu(n._parsed[e].r,i.options.locale);return{label:s[e]||"",value:r}}parseObjectData(e,n,i,s){return LC.bind(this)(e,n,i,s)}update(e){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,e)}getMinMax(){const e=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(rn.max&&(n.max=r))}),n}_updateRadius(){const e=this.chart,n=e.chartArea,i=e.options,s=Math.min(n.right-n.left,n.bottom-n.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/e.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(e,n,i,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*Bt;let f=h,p;const m=360/this.countVisibleElements();for(p=0;p{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(e,n,i){return this.chart.getDataVisibility(e)?as(this.resolveDataElementOptions(e,n).angle||i):0}}class zj extends KC{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class Wj extends vo{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(e){const n=this._cachedMeta.vScale,i=this.getParsed(e);return{label:n.getLabels()[e],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(e,n,i,s){return LC.bind(this)(e,n,i,s)}update(e){const n=this._cachedMeta,i=n.dataset,s=n.data||[],r=n.iScale.getLabels();if(i.points=s,e!=="resize"){const o=this.resolveDatasetElementOptions(e);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,e)}this.updateElements(s,0,s.length,e)}updateElements(e,n,i,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=n;a0&&this.getParsed(n-1);for(let C=n;C0&&Math.abs(x[f]-E[f])>v,y&&(T.parsed=x,T.raw=c.data[C]),h&&(T.options=d||this.resolveDataElementOptions(C,w.active?"active":s)),b||this.updateElement(w,C,T,s),E=x}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const e=this._cachedMeta,n=e.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=e.dataset,s=i.options&&i.options.borderWidth||0;if(!n.length)return s;const r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,r,o)/2}}function Lo(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ay{static override(e){Object.assign(ay.prototype,e)}options;constructor(e){this.options=e||{}}init(){}formats(){return Lo()}parse(){return Lo()}format(){return Lo()}add(){return Lo()}diff(){return Lo()}startOf(){return Lo()}endOf(){return Lo()}}var Yj={_date:ay};function jj(t,e,n,i){const{controller:s,data:r,_sorted:o}=t,a=s._cachedMeta.iScale;if(a&&e===a.axis&&e!=="r"&&o&&r.length){const l=a._reversePixels?uY:or;if(i){if(s._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(e);if(u){const d=l(r,e,n-u),h=l(r,e,n+u);return{lo:d.lo,hi:h.hi}}}}else return l(r,e,n)}return{lo:0,hi:r.length-1}}function Hu(t,e,n,i,s){const r=t.getSortedVisibleDatasetMetas(),o=n[e];for(let a=0,l=r.length;a{l[o](e[n],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(e.x,e.y,s))}),i&&!a?[]:r}var Xj={evaluateInteractionItems:Hu,modes:{index(t,e,n,i){const s=zo(e,t),r=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?qg(t,s,r,i,o):Zg(t,s,r,!1,i,o),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(t,e,n,i){const s=zo(e,t),r=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?qg(t,s,r,i,o):Zg(t,s,r,!1,i,o);if(a.length>0){const l=a[0].datasetIndex,c=t.getDatasetMeta(l).data;a=[];for(let u=0;un.pos===e)}function d1(t,e){return t.filter(n=>GC.indexOf(n.pos)===-1&&n.box.axis===e)}function hc(t,e){return t.sort((n,i)=>{const s=e?i:n,r=e?n:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function qj(t){const e=[];let n,i,s,r,o,a;for(n=0,i=(t||[]).length;nc.box.fullSize),!0),i=hc(dc(e,"left"),!0),s=hc(dc(e,"right")),r=hc(dc(e,"top"),!0),o=hc(dc(e,"bottom")),a=d1(e,"x"),l=d1(e,"y");return{fullSize:n,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:dc(e,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function h1(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function XC(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function eK(t,e,n,i){const{pos:s,box:r}=n,o=t.maxPadding;if(!ut(s)){n.size&&(t[s]-=n.size);const d=i[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?r.height:r.width),n.size=d.size/d.count,t[s]+=n.size}r.getPadding&&XC(o,r.getPadding());const a=Math.max(0,e.outerWidth-h1(o,t,"left","right")),l=Math.max(0,e.outerHeight-h1(o,t,"top","bottom")),c=a!==t.w,u=l!==t.h;return t.w=a,t.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function tK(t){const e=t.maxPadding;function n(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function nK(t,e){const n=e.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(e[o],n[o])}),r}return i(t?["left","right"]:["top","bottom"])}function Ec(t,e,n,i){const s=[];let r,o,a,l,c,u;for(r=0,o=t.length,c=0;r{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,y)=>y.box.options&&y.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:n,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),h=Object.assign({},s);XC(h,Kn(i));const f=Object.assign({maxPadding:h,w:r,h:o,x:s.left,y:s.top},s),p=Jj(l.concat(c),d);Ec(a.fullSize,f,d,p),Ec(l,f,d,p),Ec(c,f,d,p)&&Ec(l,f,d,p),tK(f),f1(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,f1(a.rightAndBottom,f,d,p),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},Ct(a.chartArea,m=>{const y=m.box;Object.assign(y,t.chartArea),y.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class qC{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,i){}removeEventListener(e,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,i,s){return n=Math.max(0,n||e.width),i=i||e.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(e){return!0}updateConfig(e){}}class iK extends qC{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const rh="$chartjs",sK={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},g1=t=>t===null||t==="";function rK(t,e){const n=t.style,i=t.getAttribute("height"),s=t.getAttribute("width");if(t[rh]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",g1(s)){const r=qb(t,"width");r!==void 0&&(t.width=r)}if(g1(i))if(t.style.height==="")t.height=t.width/(e||2);else{const r=qb(t,"height");r!==void 0&&(t.height=r)}return t}const ZC=ij?{passive:!0}:!1;function oK(t,e,n){t.addEventListener(e,n,ZC)}function aK(t,e,n){t.canvas.removeEventListener(e,n,ZC)}function lK(t,e){const n=sK[t.type]||t.type,{x:i,y:s}=zo(t,e);return{type:n,chart:e,native:t,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Th(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function cK(t,e,n){const i=t.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Th(a.addedNodes,i),o=o&&!Th(a.removedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function uK(t,e,n){const i=t.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Th(a.removedNodes,i),o=o&&!Th(a.addedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const fu=new Map;let p1=0;function JC(){const t=window.devicePixelRatio;t!==p1&&(p1=t,fu.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function dK(t,e){fu.size||window.addEventListener("resize",JC),fu.set(t,e)}function hK(t){fu.delete(t),fu.size||window.removeEventListener("resize",JC)}function fK(t,e,n){const i=t.canvas,s=i&&oy(i);if(!s)return;const r=CC((a,l)=>{const c=s.clientWidth;n(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),dK(t,r),o}function Jg(t,e,n){n&&n.disconnect(),e==="resize"&&hK(t)}function gK(t,e,n){const i=t.canvas,s=CC(r=>{t.ctx!==null&&n(lK(r,t))},t);return oK(i,e,s),s}class pK extends qC{acquireContext(e,n){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(rK(e,n),i):null}releaseContext(e){const n=e.canvas;if(!n[rh])return!1;const i=n[rh].initial;["height","width"].forEach(r=>{const o=i[r];gt(o)?n.removeAttribute(r):n.setAttribute(r,o)});const s=i.style||{};return Object.keys(s).forEach(r=>{n.style[r]=s[r]}),n.width=n.width,delete n[rh],!0}addEventListener(e,n,i){this.removeEventListener(e,n);const s=e.$proxies||(e.$proxies={}),o={attach:cK,detach:uK,resize:fK}[n]||gK;s[n]=o(e,n,i)}removeEventListener(e,n){const i=e.$proxies||(e.$proxies={}),s=i[n];if(!s)return;({attach:Jg,detach:Jg,resize:Jg}[n]||aK)(e,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,i,s){return nj(e,n,i,s)}isAttached(e){const n=oy(e);return!!(n&&n.isConnected)}}function mK(t){return!ry()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?iK:pK}let vr=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){const{x:n,y:i}=this.getProps(["x","y"],e);return{x:n,y:i}}hasValue(){return Al(this.x)&&Al(this.y)}getProps(e,n){const i=this.$animations;if(!n||!i)return this;const s={};return e.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}};function _K(t,e){const n=t.options.ticks,i=yK(t),s=Math.min(n.maxTicksLimit||i,i),r=n.major.enabled?bK(e):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return wK(e,c,r,o/s),c;const u=vK(r,e,s);if(o>0){let d,h;const f=o>1?Math.round((l-a)/(o-1)):null;for(Id(e,c,u,gt(f)?0:a-f,a),d=0,h=o-1;ds)return l}return Math.max(s,1)}function bK(t){const e=[];let n,i;for(n=0,i=t.length;nt==="left"?"right":t==="right"?"left":t,m1=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,_1=(t,e)=>Math.min(e||t,t);function y1(t,e){const n=[],i=t.length/e,s=t.length;let r=0;for(;ro+a)))return l}function CK(t,e){Ct(t,n=>{const i=n.gc,s=i.length/2;let r;if(s>e){for(r=0;ri?i:n,i=s&&n>i?n:i,{min:xi(n,xi(i,n)),max:xi(i,xi(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Pt(this.options.beforeUpdate,[this])}update(e,n,i){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=$Y(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,f=Pn(this.chart.width-d,0,this.maxWidth);a=e.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(e.offset?.5:1)),l=this.maxHeight-fc(e.grid)-n.padding-v1(e.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),o=Z_(Math.min(Math.asin(Pn((u.highest.height+6)/a,-1,1)),Math.asin(Pn(l/c,-1,1))-Math.asin(Pn(h/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){Pt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Pt(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=v1(s,n.options.font);if(a?(e.width=this.maxWidth,e.height=fc(r)+l):(e.height=this.maxHeight,e.width=fc(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),f=i.padding*2,p=as(this.labelRotation),m=Math.cos(p),y=Math.sin(p);if(a){const v=i.mirror?0:y*d.width+m*h.height;e.height=Math.min(this.maxHeight,e.height+v+f)}else{const v=i.mirror?0:m*d.width+y*h.height;e.width=Math.min(this.maxWidth,e.width+v+f)}this._calculatePadding(c,u,y,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,i,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?c?(h=s*e.width,f=i*n.height):(h=i*e.height,f=s*n.width):r==="start"?f=n.width:r==="end"?h=e.width:r!=="inner"&&(h=e.width/2,f=n.width/2),this.paddingLeft=Math.max((h-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-d+o)*this.width/(this.width-d),0)}else{let u=n.height/2,d=e.height/2;r==="start"?(u=0,d=e.height):r==="end"&&(u=n.height,d=0),this.paddingTop=u+o,this.paddingBottom=d+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Pt(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,i;for(n=0,i=e.length;n({width:o[A]||0,height:a[A]||0});return{first:k(0),last:k(n-1),widest:k(x),highest:k(T),widths:o,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return cY(this._alignToPixels?$o(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&ea*s?a/i:l/s:l*s0}_computeGridLineItems(e){const n=this.axis,i=this.chart,s=this.options,{grid:r,position:o,border:a}=s,l=r.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=fc(r),f=[],p=a.setContext(this.getContext()),m=p.display?p.width:0,y=m/2,v=function(I){return $o(i,I,m)};let b,E,C,w,x,T,k,A,P,F,H,te;if(o==="top")b=v(this.bottom),T=this.bottom-h,A=b-y,F=v(e.top)+y,te=e.bottom;else if(o==="bottom")b=v(this.top),F=e.top,te=v(e.bottom)-y,T=b+y,A=this.top+h;else if(o==="left")b=v(this.right),x=this.right-h,k=b-y,P=v(e.left)+y,H=e.right;else if(o==="right")b=v(this.left),P=e.left,H=v(e.right)-y,x=b+y,k=this.left+h;else if(n==="x"){if(o==="center")b=v((e.top+e.bottom)/2+.5);else if(ut(o)){const I=Object.keys(o)[0],W=o[I];b=v(this.chart.scales[I].getPixelForValue(W))}F=e.top,te=e.bottom,T=b+y,A=T+h}else if(n==="y"){if(o==="center")b=v((e.left+e.right)/2);else if(ut(o)){const I=Object.keys(o)[0],W=o[I];b=v(this.chart.scales[I].getPixelForValue(W))}x=b-y,k=x-h,P=e.left,H=e.right}const N=tt(s.ticks.maxTicksLimit,d),L=Math.max(1,Math.ceil(d/N));for(E=0;E0&&(le-=M/2);break}ue={left:le,top:ie,width:M+Y.width,height:Z+Y.height,color:L.backdropColor}}y.push({label:C,font:A,textOffset:H,options:{rotation:m,color:W,strokeColor:X,strokeWidth:J,textAlign:ne,textBaseline:te,translation:[w,x],backdrop:ue}})}return y}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-as(this.labelRotation))return e==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=e+r,l=o.widest.width;let c,u;return n==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:i,top:s,width:r,height:o}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(i,s,r,o),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(r=>r.value===e);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(r=0,o=s.length;r{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,o;for(r=0,o=n.length;r{const i=n.split("."),s=i.pop(),r=[t].concat(i).join("."),o=e[n].split("."),a=o.pop(),l=o.join(".");Zt.route(r,s,l,a)})}function RK(t){return"id"in t&&"defaults"in t}class DK{constructor(){this.controllers=new Pd(vo,"datasets",!0),this.elements=new Pd(vr,"elements"),this.plugins=new Pd(Object,"plugins"),this.scales=new Pd(ya,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,i){[...n].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(e,r,s):Ct(s,o=>{const a=i||this._getRegistryForType(o);this._exec(e,a,o)})})}_exec(e,n,i){const s=q_(e);Pt(i["before"+s],[],i),n[e](i),Pt(i["after"+s],[],i)}_getRegistryForType(e){for(let n=0;nr.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,i),e,"stop"),this._notify(s(i,n),e,"start")}}function LK(t){const e={},n=[],i=Object.keys(vs.plugins.items);for(let r=0;r1&&b1(t[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function w1(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function WK(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(i=>i.xAxisID===t||i.yAxisID===t);if(n.length)return w1(t,"x",n[0])||w1(t,"y",n[0])}return{}}function HK(t,e){const n=ca[t.type]||{scales:{}},i=e.scales||{},s=am(t.type,e),r=Object.create(null);return Object.keys(i).forEach(o=>{const a=i[o];if(!ut(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=lm(o,a,WK(o,t),Zt.scales[a.type]),c=VK(l,s),u=n.scales||{};r[o]=Hc(Object.create(null),[{axis:l},a,u[l],u[c]])}),t.data.datasets.forEach(o=>{const a=o.type||t.type,l=o.indexAxis||am(a,e),u=(ca[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=BK(d,l),f=o[h+"AxisID"]||h;r[f]=r[f]||Object.create(null),Hc(r[f],[{axis:h},i[f],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];Hc(a,[Zt.scales[a.type],Zt.scale])}),r}function QC(t){const e=t.options||(t.options={});e.plugins=tt(e.plugins,{}),e.scales=HK(t,e)}function eT(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function YK(t){return t=t||{},t.data=eT(t.data),QC(t),t}const x1=new Map,tT=new Set;function Rd(t,e){let n=x1.get(t);return n||(n=e(),x1.set(t,n),tT.add(n)),n}const gc=(t,e,n)=>{const i=ao(e,n);i!==void 0&&t.add(i)};let jK=class{constructor(e){this._config=YK(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=eT(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),QC(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Rd(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return Rd(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return Rd(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,i=this.type;return Rd(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const i=this._scopeCache;let s=i.get(e);return(!s||n)&&(s=new Map,i.set(e,s)),s}getOptionScopes(e,n,i){const{options:s,type:r}=this,o=this._cachedScopes(e,i),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{e&&(l.add(e),u.forEach(d=>gc(l,e,d))),u.forEach(d=>gc(l,s,d)),u.forEach(d=>gc(l,ca[r]||{},d)),u.forEach(d=>gc(l,Zt,d)),u.forEach(d=>gc(l,rm,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),tT.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:e,type:n}=this;return[e,ca[n]||{},Zt.datasets[n]||{},{type:n},Zt,rm]}resolveNamedOptions(e,n,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=E1(this._resolverCache,e,s);let l=o;if(UK(o,n)){r.$shared=!1,i=lo(i)?i():i;const c=this.createResolver(e,i,a);l=Ml(o,i,c)}for(const c of n)r[c]=l[c];return r}createResolver(e,n,i=[""],s){const{resolver:r}=E1(this._resolverCache,e,i);return ut(n)?Ml(r,n,void 0,s):r}};function E1(t,e,n){let i=t.get(e);i||(i=new Map,t.set(e,i));const s=n.join();let r=i.get(s);return r||(r={resolver:ny(e,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const KK=t=>ut(t)&&Object.getOwnPropertyNames(t).some(e=>lo(t[e]));function UK(t,e){const{isScriptable:n,isIndexable:i}=PC(t);for(const s of e){const r=n(s),o=i(s),a=(o||r)&&t[s];if(r&&(lo(a)||KK(a))||o&&Nt(a))return!0}return!1}var GK="4.4.1";const XK=["top","bottom","left","right","chartArea"];function S1(t,e){return t==="top"||t==="bottom"||XK.indexOf(t)===-1&&e==="x"}function C1(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}function T1(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),Pt(n&&n.onComplete,[t],e)}function qK(t){const e=t.chart,n=e.options.animation;Pt(n&&n.onProgress,[t],e)}function nT(t){return ry()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const oh={},k1=t=>{const e=nT(t);return Object.values(oh).filter(n=>n.canvas===e).pop()};function ZK(t,e,n){const i=Object.keys(t);for(const s of i){const r=+s;if(r>=e){const o=t[s];delete t[s],(n>0||r>e)&&(t[r+n]=o)}}}function JK(t,e,n,i){return!n||t.type==="mouseout"?null:i?e:t}function Dd(t,e,n){return t.options.clip?t[n]:e[n]}function QK(t,e){const{xScale:n,yScale:i}=t;return n&&i?{left:Dd(n,e,"left"),right:Dd(n,e,"right"),top:Dd(i,e,"top"),bottom:Dd(i,e,"bottom")}:e}let Tf=class{static defaults=Zt;static instances=oh;static overrides=ca;static registry=vs;static version=GK;static getChart=k1;static register(...e){vs.add(...e),A1()}static unregister(...e){vs.remove(...e),A1()}constructor(e,n){const i=this.config=new jK(n),s=nT(e),r=k1(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||mK(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=ZH(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new $K,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=fY(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],oh[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Xs.listen(this,"complete",T1),Xs.listen(this,"progress",qK),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:i,height:s,_aspectRatio:r}=this;return gt(e)?n&&r?r:s?i/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return vs}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Xb(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Kb(this.canvas,this.ctx),this}stop(){return Xs.stop(this),this}resize(e,n){Xs.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,e,n,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Xb(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Pt(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ct(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const e=this.options,n=e.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];n&&(r=r.concat(Object.keys(n).map(o=>{const a=n[o],l=lm(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Ct(r,o=>{const a=o.options,l=a.id,c=lm(l,a),u=tt(a.type,o.dtype);(a.position===void 0||S1(a.position,c)!==S1(o.dposition))&&(a.position=o.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const h=vs.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,e)}),Ct(s,(o,a)=>{o||delete i[a]}),Ct(i,o=>{Wi.configure(this,o,o.options),Wi.addBox(this,o)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,i=e.length;if(e.sort((s,r)=>s.index-r.index),i>n){for(let s=n;sn.length&&delete this._stacks,e.forEach((i,s)=>{n.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c{c.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(C1("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Ct(this.scales,e=>{Wi.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!Nb(n,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of n){const o=i==="_removeElements"?-r:r;ZK(e,s,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=r=>new Set(e.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;rr.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Wi.update(this,this.width,this.height,e);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],Ct(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,i=e._clip,s=!i.disabled,r=QK(e,this.chartArea),o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Ef(n,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),e.controller.draw(),s&&Sf(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return ar(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,i,s){const r=Xj.modes[n];return typeof r=="function"?r(this,e,i,s):[]}getDatasetMeta(e){const n=this.data.datasets[e],i=this._metasets;let s=i.filter(r=>r&&r._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:e,_dataset:n,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=yo(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(e,n){const i=this.getDatasetMeta(e);i.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,i){const s=i?"show":"hide",r=this.getDatasetMeta(e),o=r.controller._resolveAnimations(void 0,s);uu(n)?(r.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===e?s:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),Xs.remove(this),e=0,n=this.data.datasets.length;e{n.addEventListener(this,r,o),e[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};Ct(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),e[l]=c},s=(l,c)=>{e[l]&&(n.removeEventListener(this,l,c),delete e[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){Ct(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},Ct(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,i){const s=i?"set":"remove";let r,o,a,l;for(n==="dataset"&&(r=this.getDatasetMeta(e[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=e.length;a{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!wh(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(e,n,i){return this._plugins.notify(this,e,n,i)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(n,e),a=i?e:r(e,n);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(e,n){const i={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},s=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(e,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(e,n,i){const{_active:s=[],options:r}=this,o=n,a=this._getActiveElements(e,s,i,o),l=iY(e),c=JK(e,this._lastEvent,i,l);i&&(this._lastEvent=null,Pt(r.onHover,[e,a,this],this),l&&Pt(r.onClick,[e,a,this],this));const u=!wh(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,u}_getActiveElements(e,n,i,s){if(e.type==="mouseout")return[];if(!i)return n;const r=this.options.hover;return this.getElementsAtEventForMode(e,r.mode,r,s)}};function A1(){return Ct(Tf.instances,t=>t._plugins.invalidate())}function eU(t,e,n){const{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=e;let c=s/a;t.beginPath(),t.arc(r,o,a,i-c,n+c),l>s?(c=s/l,t.arc(r,o,l,n+c,i-c,!0)):t.arc(r,o,s,n+on,i-on),t.closePath(),t.clip()}function tU(t){return ty(t,["outerStart","outerEnd","innerStart","innerEnd"])}function nU(t,e,n,i){const s=tU(t.options.borderRadius),r=(n-e)/2,o=Math.min(r,i*e/2),a=l=>{const c=(n-Math.min(r,l))*i/2;return Pn(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Pn(s.innerStart,0,o),innerEnd:Pn(s.innerEnd,0,o)}}function $a(t,e,n,i){return{x:n+t*Math.cos(e),y:i+t*Math.sin(e)}}function kh(t,e,n,i,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=e,d=Math.max(e.outerRadius+i+n-c,0),h=u>0?u+i+n+c:0;let f=0;const p=s-l;if(i){const L=u>0?u-i:0,I=d>0?d-i:0,W=(L+I)/2,X=W!==0?p*W/(W+i):p;f=(p-X)/2}const m=Math.max(.001,p*d-n/Bt)/d,y=(p-m)/2,v=l+y+f,b=s-y-f,{outerStart:E,outerEnd:C,innerStart:w,innerEnd:x}=nU(e,h,d,b-v),T=d-E,k=d-C,A=v+E/T,P=b-C/k,F=h+w,H=h+x,te=v+w/F,N=b-x/H;if(t.beginPath(),r){const L=(A+P)/2;if(t.arc(o,a,d,A,L),t.arc(o,a,d,L,P),C>0){const J=$a(k,P,o,a);t.arc(J.x,J.y,C,P,b+on)}const I=$a(H,b,o,a);if(t.lineTo(I.x,I.y),x>0){const J=$a(H,N,o,a);t.arc(J.x,J.y,x,b+on,N+Math.PI)}const W=(b-x/h+(v+w/h))/2;if(t.arc(o,a,h,b-x/h,W,!0),t.arc(o,a,h,W,v+w/h,!0),w>0){const J=$a(F,te,o,a);t.arc(J.x,J.y,w,te+Math.PI,v-on)}const X=$a(T,v,o,a);if(t.lineTo(X.x,X.y),E>0){const J=$a(T,A,o,a);t.arc(J.x,J.y,E,v-on,A)}}else{t.moveTo(o,a);const L=Math.cos(A)*d+o,I=Math.sin(A)*d+a;t.lineTo(L,I);const W=Math.cos(P)*d+o,X=Math.sin(P)*d+a;t.lineTo(W,X)}t.closePath()}function iU(t,e,n,i,s){const{fullCircles:r,startAngle:o,circumference:a}=e;let l=e.endAngle;if(r){kh(t,e,n,i,l,s);for(let c=0;ce!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,n,i){const s=this.getProps(["x","y"],i),{angle:r,distance:o}=wC(s,{x:e,y:n}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:u,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),h=(this.options.spacing+this.options.borderWidth)/2,p=tt(d,l-a)>=Ft||du(r,a,l),m=rr(o,c+h,u+h);return p&&m}getCenterPoint(e){const{x:n,y:i,startAngle:s,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:l,spacing:c}=this.options,u=(s+r)/2,d=(o+a+c+l)/2;return{x:n+Math.cos(u)*d,y:i+Math.sin(u)*d}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:n,circumference:i}=this,s=(n.offset||0)/4,r=(n.spacing||0)/2,o=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=i>Ft?Math.floor(i/Ft):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const a=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(a)*s,Math.sin(a)*s);const l=1-Math.sin(Math.min(Bt,i||0)),c=s*l;e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,iU(e,this,c,r,o),sU(e,this,c,r,o),e.restore()}}function iT(t,e,n=e){t.lineCap=tt(n.borderCapStyle,e.borderCapStyle),t.setLineDash(tt(n.borderDash,e.borderDash)),t.lineDashOffset=tt(n.borderDashOffset,e.borderDashOffset),t.lineJoin=tt(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=tt(n.borderWidth,e.borderWidth),t.strokeStyle=tt(n.borderColor,e.borderColor)}function oU(t,e,n){t.lineTo(n.x,n.y)}function aU(t){return t.stepped?CY:t.tension||t.cubicInterpolationMode==="monotone"?TY:oU}function sT(t,e,n={}){const i=t.length,{start:s=0,end:r=i-1}=n,{start:o,end:a}=e,l=Math.max(s,o),c=Math.min(r,a),u=sa&&r>a;return{count:i,start:l,loop:e.loop,ilen:c(o+(c?a-C:C))%r,E=()=>{m!==y&&(t.lineTo(u,y),t.lineTo(u,m),t.lineTo(u,v))};for(l&&(f=s[b(0)],t.moveTo(f.x,f.y)),h=0;h<=a;++h){if(f=s[b(h)],f.skip)continue;const C=f.x,w=f.y,x=C|0;x===p?(wy&&(y=w),u=(d*u+C)/++d):(E(),t.lineTo(C,w),p=x,d=0,m=y=w),v=w}E()}function cm(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!n?cU:lU}function uU(t){return t.stepped?sj:t.tension||t.cubicInterpolationMode==="monotone"?rj:Wo}function dU(t,e,n,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,n,i)&&s.closePath()),iT(t,e.options),t.stroke(s)}function hU(t,e,n,i){const{segments:s,options:r}=e,o=cm(e);for(const a of s)iT(t,r,a.style),t.beginPath(),o(t,e,a,{start:n,end:n+i-1})&&t.closePath(),t.stroke()}const fU=typeof Path2D=="function";function gU(t,e,n,i){fU&&!e.options.segment?dU(t,e,n,i):hU(t,e,n,i)}class kf extends vr{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"};constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,n){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;qY(this._points,i,e,s,n),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=dj(this,this.options.segment))}first(){const e=this.segments,n=this.points;return e.length&&n[e[0].start]}last(){const e=this.segments,n=this.points,i=e.length;return i&&n[e[i-1].end]}interpolate(e,n){const i=this.options,s=e[n],r=this.points,o=zC(this,{property:n,start:s,end:s});if(!o.length)return;const a=[],l=uU(i);let c,u;for(c=0,u=o.length;c=n)return t.slice(e,e+n);const o=[],a=(n-2)/(r-2);let l=0;const c=e+n-1;let u=e,d,h,f,p,m;for(o[l++]=t[u],d=0;df&&(f=p,h=t[b],m=b);o[l++]=h,u=m}return o[l++]=t[c],o}function EU(t,e,n,i){let s=0,r=0,o,a,l,c,u,d,h,f,p,m;const y=[],v=e+n-1,b=t[e].x,C=t[v].x-b;for(o=e;om&&(m=c,h=o),s=(r*s+a.x)/++r;else{const x=o-1;if(!gt(d)&&!gt(h)){const T=Math.min(d,h),k=Math.max(d,h);T!==f&&T!==x&&y.push({...t[T],x:s}),k!==f&&k!==x&&y.push({...t[k],x:s})}o>0&&x!==f&&y.push(t[x]),y.push(a),u=w,r=0,p=m=c,d=h=f=o}}return y}function oT(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function I1(t){t.data.datasets.forEach(e=>{oT(e)})}function SU(t,e){const n=e.length;let i=0,s;const{iScale:r}=t,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=Pn(or(e,r.axis,o).lo,0,n-1)),c?s=Pn(or(e,r.axis,a).hi+1,i,n)-i:s=n-i,{start:i,count:s}}var CU={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,n)=>{if(!n.enabled){I1(t);return}const i=t.width;t.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=t.getDatasetMeta(r),c=o||s.data;if(xc([a,t.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=t.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||t.options.parsing)return;let{start:d,count:h}=SU(l,c);const f=n.threshold||4*i;if(h<=f){oT(s);return}gt(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(n.algorithm){case"lttb":p=xU(c,d,h,i,n);break;case"min-max":p=EU(c,d,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(t){I1(t)}};function TU(t,e,n){const i=t.segments,s=t.points,r=e.points,o=[];for(const a of i){let{start:l,end:c}=a;c=ly(l,c,s);const u=um(n,s[l],s[c],a.loop);if(!e.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}const d=zC(e,u);for(const h of d){const f=um(n,r[h.start],r[h.end],h.loop),p=VC(a,s,f);for(const m of p)o.push({source:m,target:h,start:{[n]:P1(u,f,"start",Math.max)},end:{[n]:P1(u,f,"end",Math.min)}})}}return o}function um(t,e,n,i){if(i)return;let s=e[t],r=n[t];return t==="angle"&&(s=Si(s),r=Si(r)),{property:t,start:s,end:r}}function kU(t,e){const{x:n=null,y:i=null}=t||{},s=e.points,r=[];return e.segments.forEach(({start:o,end:a})=>{a=ly(o,a,s);const l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):n!==null&&(r.push({x:n,y:l.y}),r.push({x:n,y:c.y}))}),r}function ly(t,e,n){for(;e>t;e--){const i=n[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function P1(t,e,n,i){return t&&e?i(t[n],e[n]):t?t[n]:e?e[n]:0}function aT(t,e){let n=[],i=!1;return Nt(t)?(i=!0,n=t):n=kU(t,e),n.length?new kf({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function R1(t){return t&&t.fill!==!1}function AU(t,e,n){let s=t[e].fill;const r=[e];let o;if(!n)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!qt(s))return s;if(o=t[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function MU(t,e,n){const i=DU(t);if(ut(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return qt(s)&&Math.floor(s)===s?IU(i[0],e,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function IU(t,e,n,i){return(t==="-"||t==="+")&&(n=e+n),n===e||n<0||n>=i?!1:n}function PU(t,e){let n=null;return t==="start"?n=e.bottom:t==="end"?n=e.top:ut(t)?n=e.getPixelForValue(t.value):e.getBasePixel&&(n=e.getBasePixel()),n}function RU(t,e,n){let i;return t==="start"?i=n:t==="end"?i=e.options.reverse?e.min:e.max:ut(t)?i=t.value:i=e.getBaseValue(),i}function DU(t){const e=t.options,n=e.fill;let i=tt(n&&n.target,n);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function $U(t){const{scale:e,index:n,line:i}=t,s=[],r=i.segments,o=i.points,a=LU(e,n);a.push(aT({x:null,y:e.bottom},i));for(let l=0;l=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&tp(t.ctx,a,r))}},beforeDatasetsDraw(t,e,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=t.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;R1(r)&&tp(t.ctx,r,t.chartArea)}},beforeDatasetDraw(t,e,n){const i=e.meta.$filler;!R1(i)||n.drawTime!=="beforeDatasetDraw"||tp(t.ctx,i,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const O1=(t,e)=>{let{boxHeight:n=e,boxWidth:i=e}=t;return t.usePointStyle&&(n=Math.min(n,e),i=t.pointStyleWidth||Math.min(i,e)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(e,n)}},KU=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class N1 extends vr{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n,i){this.maxWidth=e,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let n=Pt(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(i=>e.filter(i,this.chart.data))),e.sort&&(n=n.sort((i,s)=>e.sort(i,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:e,ctx:n}=this;if(!e.display){this.width=this.height=0;return}const i=e.labels,s=vn(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=O1(i,r);let c,u;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,s,a,l)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,n,i,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let d=e;r.textAlign="left",r.textBaseline="middle";let h=-1,f=-u;return this.legendItems.forEach((p,m)=>{const y=i+n/2+r.measureText(p.text).width;(m===0||c[c.length-1]+y+2*a>o)&&(d+=u,c[c.length-(m>0?0:1)]=0,f+=u,h++),l[m]={left:0,top:f,row:h,width:y,height:s},c[c.length-1]+=y+a}),d}_fitCols(e,n,i,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-e;let d=a,h=0,f=0,p=0,m=0;return this.legendItems.forEach((y,v)=>{const{itemWidth:b,itemHeight:E}=UU(i,n,r,y,s);v>0&&f+E+2*a>u&&(d+=h+a,c.push({width:h,height:f}),p+=h+a,m++,h=f=0),l[v]={left:p,top:f,col:m,width:b,height:E},h=Math.max(h,b),f+=E+a}),d+=h,c.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:r}}=this,o=ol(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=Bn(i,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Bn(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+e+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=Bn(i,this.top+e+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Bn(i,this.top+e+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;Ef(e,this),this._draw(),Sf(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:i,ctx:s}=this,{align:r,labels:o}=e,a=Zt.color,l=ol(e.rtl,this.left,this.width),c=vn(o.font),{padding:u}=o,d=c.size,h=d/2;let f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:y}=O1(o,d),v=function(x,T,k){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;s.save();const A=tt(k.lineWidth,1);if(s.fillStyle=tt(k.fillStyle,a),s.lineCap=tt(k.lineCap,"butt"),s.lineDashOffset=tt(k.lineDashOffset,0),s.lineJoin=tt(k.lineJoin,"miter"),s.lineWidth=A,s.strokeStyle=tt(k.strokeStyle,a),s.setLineDash(tt(k.lineDash,[])),o.usePointStyle){const P={radius:m*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:A},F=l.xPlus(x,p/2),H=T+h;MC(s,P,F,H,o.pointStyleWidth&&p)}else{const P=T+Math.max((d-m)/2,0),F=l.leftForLtr(x,p),H=ia(k.borderRadius);s.beginPath(),Object.values(H).some(te=>te!==0)?hu(s,{x:F,y:P,w:p,h:m,radius:H}):s.rect(F,P,p,m),s.fill(),A!==0&&s.stroke()}s.restore()},b=function(x,T,k){ua(s,k.text,x,T+y/2,c,{strikethrough:k.hidden,textAlign:l.textAlign(k.textAlign)})},E=this.isHorizontal(),C=this._computeTitleHeight();E?f={x:Bn(r,this.left+u,this.right-i[0]),y:this.top+u+C,line:0}:f={x:this.left+u,y:Bn(r,this.top+C+u,this.bottom-n[0].height),line:0},NC(this.ctx,e.textDirection);const w=y+u;this.legendItems.forEach((x,T)=>{s.strokeStyle=x.fontColor,s.fillStyle=x.fontColor;const k=s.measureText(x.text).width,A=l.textAlign(x.textAlign||(x.textAlign=o.textAlign)),P=p+h+k;let F=f.x,H=f.y;l.setWidth(this.width),E?T>0&&F+P+u>this.right&&(H=f.y+=w,f.line++,F=f.x=Bn(r,this.left+u,this.right-i[f.line])):T>0&&H+w>this.bottom&&(F=f.x=F+n[f.line].width+u,f.line++,H=f.y=Bn(r,this.top+C+u,this.bottom-n[f.line].height));const te=l.x(F);if(v(te,H,x),F=gY(A,F+p+h,E?F+P:this.right,e.rtl),b(l.x(F),H,x),E)f.x+=P+u;else if(typeof x.text!="string"){const N=c.lineHeight;f.y+=cT(x,N)+u}else f.y+=w}),FC(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,i=vn(n.font),s=Kn(n.padding);if(!n.display)return;const r=ol(e.rtl,this.left,this.width),o=this.ctx,a=n.position,l=i.size/2,c=s.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=Bn(e.align,d,this.right-h);else{const p=this.columnSizes.reduce((m,y)=>Math.max(m,y.height),0);u=c+Bn(e.align,this.top,this.bottom-p-e.labels.padding-this._computeTitleHeight())}const f=Bn(a,d,d+h);o.textAlign=r.textAlign(Q_(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=i.string,ua(o,n.text,f,u,i)}_computeTitleHeight(){const e=this.options.title,n=vn(e.font),i=Kn(e.padding);return e.display?n.lineHeight+i.height:0}_getLegendItemAt(e,n){let i,s,r;if(rr(e,this.left,this.right)&&rr(n,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;ir.length>o.length?r:o)),e+n.size/2+i.measureText(s).width}function XU(t,e,n){let i=t;return typeof e.text!="string"&&(i=cT(e,n)),i}function cT(t,e){const n=t.text?t.text.length:0;return e*n}function qU(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var ZU={id:"legend",_element:N1,start(t,e,n){const i=t.legend=new N1({ctx:t.ctx,options:n,chart:t});Wi.configure(t,i,n),Wi.addBox(t,i)},stop(t){Wi.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const i=t.legend;Wi.configure(t,i,n),i.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const i=e.datasetIndex,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),e.hidden=!0):(s.show(i),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:s,color:r,useBorderRadius:o,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Kn(c.borderWidth);return{text:e[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class uT extends vr{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=n;const s=Nt(i.text)?i.text.length:1;this._padding=Kn(i.padding);const r=s*vn(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:i,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=Bn(a,i,r),d=n+e,c=r-i):(o.position==="left"?(u=i+e,d=Bn(a,s,n),l=Bt*-.5):(u=r-e,d=Bn(a,n,s),l=Bt*.5),c=s-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const i=vn(n.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);ua(e,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:Q_(n.align),textBaseline:"middle",translation:[o,a]})}}function JU(t,e){const n=new uT({ctx:t.ctx,options:e,chart:t});Wi.configure(t,n,e),Wi.addBox(t,n),t.titleBlock=n}var QU={id:"title",_element:uT,start(t,e,n){JU(t,n)},stop(t){const e=t.titleBlock;Wi.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const i=t.titleBlock;Wi.configure(t,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Sc={average(t){if(!t.length)return!1;let e,n,i=0,s=0,r=0;for(e=0,n=t.length;ea({chart:e,initial:n.initial,numSteps:o,currentStep:Math.min(i-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=SC.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(e),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,e,"progress")),r.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),n+=r.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let i=n.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,i)),i}listen(e,n,i){this._getAnims(e).listeners[n].push(i)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Xs=new Nj;const e1="transparent",Fj={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const i=Yb(t||e1),s=i.valid&&Yb(e||e1);return s&&s.valid?s.mix(i,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class Bj{constructor(e,n,i,s){const r=n[i];s=xc([e.to,s,r,e.from]);const o=xc([e.from,r,s]);this._active=!0,this._fn=e.fn||Fj[e.type||typeof o],this._easing=jc[e.easing]||jc.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=r,this._loop=!!e.loop,this._to=xc([e.to,n,s,e.from]),this._from=xc([e.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||n1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,i)=>{e.push({res:n,rej:i})})}_notify(e){const n=e?"res":"rej",i=this._promises||[];for(let s=0;s{const r=e[s];if(!ut(r))return;const o={};for(const a of n)o[a]=r[a];(Nt(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(e,n){const i=n.options,s=zj(e,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&Vj(e.options.$animations,i).then(()=>{e.options=i},()=>{}),r}_createAnimations(e,n){const i=this._properties,s=[],r=e.$animations||(e.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(e,n));continue}const u=n[c];let d=r[c];const h=i.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){e[c]=u;continue}r[c]=d=new Bj(h,e,c,u),s.push(d)}return s}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const i=this._createAnimations(e,n);if(i.length)return Xs.add(this._chart,i),!0}}function Vj(t,e){const n=[],i=Object.keys(e);for(let s=0;s0||!n&&r<0)return s.index}return null}function r1(t,e){const{chart:n,_cachedMeta:i}=t,s=n._stacks||(n._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=jj(r,o,i),d=e.length;let h;for(let f=0;fn[i].axis===e).shift()}function Gj(t,e){return yo(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Xj(t,e,n){return yo(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function uc(t,e){const n=t.controller.index,i=t.vScale&&t.vScale.axis;if(i){e=e||t._parsed;for(const s of e){const r=s._stacks;if(!r||r[i]===void 0||r[i][n]===void 0)return;delete r[i][n],r[i]._visualValues!==void 0&&r[i]._visualValues[n]!==void 0&&delete r[i]._visualValues[n]}}}const Gg=t=>t==="reset"||t==="none",o1=(t,e)=>e?t:Object.assign({},t),qj=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:HC(n,!0),values:null};class vo{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,n){this.chart=e,this._ctx=e.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=i1(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&uc(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(d,h,f,p)=>d==="x"?h:d==="r"?p:f,r=n.xAxisID=tt(i.xAxisID,Ug(e,"x")),o=n.yAxisID=tt(i.yAxisID,Ug(e,"y")),a=n.rAxisID=tt(i.rAxisID,Ug(e,"r")),l=n.indexAxis,c=n.iAxisID=s(l,r,o,a),u=n.vAxisID=s(l,o,r,a);n.xScale=this.getScaleForId(r),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&zb(this._data,this),e._stacked&&uc(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),i=this._data;if(ut(n))this._data=Yj(n);else if(i!==n){if(i){zb(i,this);const s=this._cachedMeta;uc(s),s._parsed=[]}n&&Object.isExtensible(n)&&LY(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const r=n._stacked;n._stacked=i1(n.vScale,n),n.stack!==i.stack&&(s=!0,uc(n),n.stack=i.stack),this._resyncElements(e),(s||r!==n._stacked)&&r1(this,n._parsed)}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis;let l=e===0&&n===s.length?!0:i._sorted,c=e>0&&i._parsed[e-1],u,d,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{Nt(s[e])?h=this.parseArrayData(i,s,e,n):ut(s[e])?h=this.parseObjectData(i,s,e,n):h=this.parsePrimitiveData(i,s,e,n);const f=()=>d[a]===null||c&&d[a]m||d=0;--h)if(!p()){this.updateRangeFromParsed(c,e,f,l);break}}return c}getAllParsedValues(e){const n=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=n.length;s=0&&ethis.getContext(i,s,n),m=c.resolveNamedOptions(h,f,p,d);return m.$shared&&(m.$shared=l,r[o]=Object.freeze(o1(m,l))),m}_resolveAnimations(e,n,i){const s=this.chart,r=this._cachedDataOpts,o=`animation-${n}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(e,i,n))}const c=new WC(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||Gg(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const i=this.resolveDataElementOptions(e,n),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(n,r)||r!==s;return this.updateSharedOptions(r,n,i),{sharedOptions:r,includeOptions:o}}updateElement(e,n,i,s){Gg(s)?Object.assign(e,i):this._resolveAnimations(n,s).update(e,i)}updateSharedOptions(e,n,i){e&&!Gg(n)&&this._resolveAnimations(void 0,n).update(e,i)}_setStyle(e,n,i,s){e.active=s;const r=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(e,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(e,n,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,n,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,r=n.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,e):r{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(r),a=e;as-r))}return t._cache.$bar}function Jj(t){const e=t.iScale,n=Zj(e,t.type);let i=e._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(uu(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=n.length;s0?s[t-1]:null,a=tMath.abs(a)&&(l=a,c=o),e[n.axis]=c,e._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function YC(t,e,n,i){return Nt(t)?tK(t,e,n,i):e[n.axis]=n.parse(t,i),e}function a1(t,e,n,i){const s=t.iScale,r=t.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,h;for(c=n,u=n+i;c=n?1:-1)}function iK(t){let e,n,i,s,r;return t.horizontal?(e=t.base>t.x,n="left",i="right"):(e=t.basel.controller.options.grouped),r=i.options.stacked,o=[],a=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(gt(u)||isNaN(u))return!0};for(const l of s)if(!(n!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,n,i){const s=this._getStacks(e,i),r=n!==void 0?s.indexOf(n):-1;return r===-1?s.length-1:r}_getRuler(){const e=this.options,n=this._cachedMeta,i=n.iScale,s=[];let r,o;for(r=0,o=n.data.length;r=0;--i)n=Math.max(n,e[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(e){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=n,o=this.getParsed(e),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y),c=o._custom;return{label:i[e]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(e){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,e)}updateElements(e,n,i,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,s),u=o.axis,d=a.axis;for(let h=n;hdu(E,a,l,!0)?1:Math.max(C,C*n,w,w*n),p=(E,C,w)=>du(E,a,l,!0)?-1:Math.min(C,C*n,w,w*n),m=f(0,c,d),y=f(on,u,h),v=p(Bt,c,d),b=p(Bt+on,u,h);i=(m-v)/2,s=(y-b)/2,r=-(m+v)/2,o=-(y+b)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}class KC extends vo{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=e.legend.options;return n.labels.map((r,o)=>{const l=e.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!e.getDataVisibility(o),index:o}})}return[]}},onClick(e,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}};constructor(e,n){super(e,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,n){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(ut(i[e])){const{key:l="value"}=this._parsing;r=c=>+ao(i[c],l)}let o,a;for(o=e,a=e+n;o0&&!isNaN(e)?Ft*(Math.abs(e)/n):0}getLabelAndValue(e){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=Wu(n._parsed[e],i.options.locale);return{label:s[e]||"",value:r}}getMaxBorderWidth(e){let n=0;const i=this.chart;let s,r,o,a,l;if(!e){for(s=0,r=i.data.datasets.length;s0&&this.getParsed(n-1);for(let w=0;w=b){T.skip=!0;continue}const k=this.getParsed(w),A=gt(k[f]),P=T[h]=o.getPixelForValue(k[h],w),F=T[f]=r||A?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[f],w);T.skip=isNaN(P)||isNaN(F)||A,T.stop=w>0&&Math.abs(k[h]-C[h])>y,m&&(T.parsed=k,T.raw=c.data[w]),d&&(T.options=u||this.resolveDataElementOptions(w,x.active?"active":s)),v||this.updateElement(x,w,T,s),C=k}}getMaxOverflow(){const e=this._cachedMeta,n=e.dataset,i=n.options&&n.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}class cK extends vo{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=e.legend.options;return n.labels.map((r,o)=>{const l=e.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!e.getDataVisibility(o),index:o}})}return[]}},onClick(e,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(e,n){super(e,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=Wu(n._parsed[e].r,i.options.locale);return{label:s[e]||"",value:r}}parseObjectData(e,n,i,s){return LC.bind(this)(e,n,i,s)}update(e){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,e)}getMinMax(){const e=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(rn.max&&(n.max=r))}),n}_updateRadius(){const e=this.chart,n=e.chartArea,i=e.options,s=Math.min(n.right-n.left,n.bottom-n.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/e.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(e,n,i,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*Bt;let f=h,p;const m=360/this.countVisibleElements();for(p=0;p{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(e,n,i){return this.chart.getDataVisibility(e)?as(this.resolveDataElementOptions(e,n).angle||i):0}}class uK extends KC{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class dK extends vo{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(e){const n=this._cachedMeta.vScale,i=this.getParsed(e);return{label:n.getLabels()[e],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(e,n,i,s){return LC.bind(this)(e,n,i,s)}update(e){const n=this._cachedMeta,i=n.dataset,s=n.data||[],r=n.iScale.getLabels();if(i.points=s,e!=="resize"){const o=this.resolveDatasetElementOptions(e);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,e)}this.updateElements(s,0,s.length,e)}updateElements(e,n,i,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=n;a0&&this.getParsed(n-1);for(let C=n;C0&&Math.abs(x[f]-E[f])>v,y&&(T.parsed=x,T.raw=c.data[C]),h&&(T.options=d||this.resolveDataElementOptions(C,w.active?"active":s)),b||this.updateElement(w,C,T,s),E=x}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const e=this._cachedMeta,n=e.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=e.dataset,s=i.options&&i.options.borderWidth||0;if(!n.length)return s;const r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,r,o)/2}}function Lo(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ay{static override(e){Object.assign(ay.prototype,e)}options;constructor(e){this.options=e||{}}init(){}formats(){return Lo()}parse(){return Lo()}format(){return Lo()}add(){return Lo()}diff(){return Lo()}startOf(){return Lo()}endOf(){return Lo()}}var fK={_date:ay};function gK(t,e,n,i){const{controller:s,data:r,_sorted:o}=t,a=s._cachedMeta.iScale;if(a&&e===a.axis&&e!=="r"&&o&&r.length){const l=a._reversePixels?DY:or;if(i){if(s._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(e);if(u){const d=l(r,e,n-u),h=l(r,e,n+u);return{lo:d.lo,hi:h.hi}}}}else return l(r,e,n)}return{lo:0,hi:r.length-1}}function Hu(t,e,n,i,s){const r=t.getSortedVisibleDatasetMetas(),o=n[e];for(let a=0,l=r.length;a{l[o](e[n],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(e.x,e.y,s))}),i&&!a?[]:r}var yK={evaluateInteractionItems:Hu,modes:{index(t,e,n,i){const s=zo(e,t),r=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?qg(t,s,r,i,o):Zg(t,s,r,!1,i,o),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(t,e,n,i){const s=zo(e,t),r=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?qg(t,s,r,i,o):Zg(t,s,r,!1,i,o);if(a.length>0){const l=a[0].datasetIndex,c=t.getDatasetMeta(l).data;a=[];for(let u=0;un.pos===e)}function d1(t,e){return t.filter(n=>GC.indexOf(n.pos)===-1&&n.box.axis===e)}function hc(t,e){return t.sort((n,i)=>{const s=e?i:n,r=e?n:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function vK(t){const e=[];let n,i,s,r,o,a;for(n=0,i=(t||[]).length;nc.box.fullSize),!0),i=hc(dc(e,"left"),!0),s=hc(dc(e,"right")),r=hc(dc(e,"top"),!0),o=hc(dc(e,"bottom")),a=d1(e,"x"),l=d1(e,"y");return{fullSize:n,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:dc(e,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function h1(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function XC(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function EK(t,e,n,i){const{pos:s,box:r}=n,o=t.maxPadding;if(!ut(s)){n.size&&(t[s]-=n.size);const d=i[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?r.height:r.width),n.size=d.size/d.count,t[s]+=n.size}r.getPadding&&XC(o,r.getPadding());const a=Math.max(0,e.outerWidth-h1(o,t,"left","right")),l=Math.max(0,e.outerHeight-h1(o,t,"top","bottom")),c=a!==t.w,u=l!==t.h;return t.w=a,t.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function SK(t){const e=t.maxPadding;function n(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function CK(t,e){const n=e.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(e[o],n[o])}),r}return i(t?["left","right"]:["top","bottom"])}function Ec(t,e,n,i){const s=[];let r,o,a,l,c,u;for(r=0,o=t.length,c=0;r{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,y)=>y.box.options&&y.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:n,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),h=Object.assign({},s);XC(h,Kn(i));const f=Object.assign({maxPadding:h,w:r,h:o,x:s.left,y:s.top},s),p=wK(l.concat(c),d);Ec(a.fullSize,f,d,p),Ec(l,f,d,p),Ec(c,f,d,p)&&Ec(l,f,d,p),SK(f),f1(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,f1(a.rightAndBottom,f,d,p),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},Ct(a.chartArea,m=>{const y=m.box;Object.assign(y,t.chartArea),y.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class qC{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,i){}removeEventListener(e,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,i,s){return n=Math.max(0,n||e.width),i=i||e.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(e){return!0}updateConfig(e){}}class TK extends qC{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const rh="$chartjs",kK={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},g1=t=>t===null||t==="";function AK(t,e){const n=t.style,i=t.getAttribute("height"),s=t.getAttribute("width");if(t[rh]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",g1(s)){const r=qb(t,"width");r!==void 0&&(t.width=r)}if(g1(i))if(t.style.height==="")t.height=t.width/(e||2);else{const r=qb(t,"height");r!==void 0&&(t.height=r)}return t}const ZC=Tj?{passive:!0}:!1;function MK(t,e,n){t.addEventListener(e,n,ZC)}function IK(t,e,n){t.canvas.removeEventListener(e,n,ZC)}function PK(t,e){const n=kK[t.type]||t.type,{x:i,y:s}=zo(t,e);return{type:n,chart:e,native:t,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Th(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function RK(t,e,n){const i=t.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Th(a.addedNodes,i),o=o&&!Th(a.removedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function DK(t,e,n){const i=t.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Th(a.removedNodes,i),o=o&&!Th(a.addedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const fu=new Map;let p1=0;function JC(){const t=window.devicePixelRatio;t!==p1&&(p1=t,fu.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function $K(t,e){fu.size||window.addEventListener("resize",JC),fu.set(t,e)}function LK(t){fu.delete(t),fu.size||window.removeEventListener("resize",JC)}function OK(t,e,n){const i=t.canvas,s=i&&oy(i);if(!s)return;const r=CC((a,l)=>{const c=s.clientWidth;n(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),$K(t,r),o}function Jg(t,e,n){n&&n.disconnect(),e==="resize"&&LK(t)}function NK(t,e,n){const i=t.canvas,s=CC(r=>{t.ctx!==null&&n(PK(r,t))},t);return MK(i,e,s),s}class FK extends qC{acquireContext(e,n){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(AK(e,n),i):null}releaseContext(e){const n=e.canvas;if(!n[rh])return!1;const i=n[rh].initial;["height","width"].forEach(r=>{const o=i[r];gt(o)?n.removeAttribute(r):n.setAttribute(r,o)});const s=i.style||{};return Object.keys(s).forEach(r=>{n.style[r]=s[r]}),n.width=n.width,delete n[rh],!0}addEventListener(e,n,i){this.removeEventListener(e,n);const s=e.$proxies||(e.$proxies={}),o={attach:RK,detach:DK,resize:OK}[n]||NK;s[n]=o(e,n,i)}removeEventListener(e,n){const i=e.$proxies||(e.$proxies={}),s=i[n];if(!s)return;({attach:Jg,detach:Jg,resize:Jg}[n]||IK)(e,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,i,s){return Cj(e,n,i,s)}isAttached(e){const n=oy(e);return!!(n&&n.isConnected)}}function BK(t){return!ry()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?TK:FK}let vr=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){const{x:n,y:i}=this.getProps(["x","y"],e);return{x:n,y:i}}hasValue(){return Al(this.x)&&Al(this.y)}getProps(e,n){const i=this.$animations;if(!n||!i)return this;const s={};return e.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}};function VK(t,e){const n=t.options.ticks,i=zK(t),s=Math.min(n.maxTicksLimit||i,i),r=n.major.enabled?HK(e):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return YK(e,c,r,o/s),c;const u=WK(r,e,s);if(o>0){let d,h;const f=o>1?Math.round((l-a)/(o-1)):null;for(Id(e,c,u,gt(f)?0:a-f,a),d=0,h=o-1;ds)return l}return Math.max(s,1)}function HK(t){const e=[];let n,i;for(n=0,i=t.length;nt==="left"?"right":t==="right"?"left":t,m1=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,_1=(t,e)=>Math.min(e||t,t);function y1(t,e){const n=[],i=t.length/e,s=t.length;let r=0;for(;ro+a)))return l}function GK(t,e){Ct(t,n=>{const i=n.gc,s=i.length/2;let r;if(s>e){for(r=0;ri?i:n,i=s&&n>i?n:i,{min:xi(n,xi(i,n)),max:xi(i,xi(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Pt(this.options.beforeUpdate,[this])}update(e,n,i){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ij(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,f=Pn(this.chart.width-d,0,this.maxWidth);a=e.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(e.offset?.5:1)),l=this.maxHeight-fc(e.grid)-n.padding-v1(e.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),o=Z_(Math.min(Math.asin(Pn((u.highest.height+6)/a,-1,1)),Math.asin(Pn(l/c,-1,1))-Math.asin(Pn(h/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){Pt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Pt(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=v1(s,n.options.font);if(a?(e.width=this.maxWidth,e.height=fc(r)+l):(e.height=this.maxHeight,e.width=fc(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),f=i.padding*2,p=as(this.labelRotation),m=Math.cos(p),y=Math.sin(p);if(a){const v=i.mirror?0:y*d.width+m*h.height;e.height=Math.min(this.maxHeight,e.height+v+f)}else{const v=i.mirror?0:m*d.width+y*h.height;e.width=Math.min(this.maxWidth,e.width+v+f)}this._calculatePadding(c,u,y,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,i,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?c?(h=s*e.width,f=i*n.height):(h=i*e.height,f=s*n.width):r==="start"?f=n.width:r==="end"?h=e.width:r!=="inner"&&(h=e.width/2,f=n.width/2),this.paddingLeft=Math.max((h-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-d+o)*this.width/(this.width-d),0)}else{let u=n.height/2,d=e.height/2;r==="start"?(u=0,d=e.height):r==="end"&&(u=n.height,d=0),this.paddingTop=u+o,this.paddingBottom=d+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Pt(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,i;for(n=0,i=e.length;n({width:o[A]||0,height:a[A]||0});return{first:k(0),last:k(n-1),widest:k(x),highest:k(T),widths:o,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return RY(this._alignToPixels?$o(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&ea*s?a/i:l/s:l*s0}_computeGridLineItems(e){const n=this.axis,i=this.chart,s=this.options,{grid:r,position:o,border:a}=s,l=r.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=fc(r),f=[],p=a.setContext(this.getContext()),m=p.display?p.width:0,y=m/2,v=function(I){return $o(i,I,m)};let b,E,C,w,x,T,k,A,P,F,H,te;if(o==="top")b=v(this.bottom),T=this.bottom-h,A=b-y,F=v(e.top)+y,te=e.bottom;else if(o==="bottom")b=v(this.top),F=e.top,te=v(e.bottom)-y,T=b+y,A=this.top+h;else if(o==="left")b=v(this.right),x=this.right-h,k=b-y,P=v(e.left)+y,H=e.right;else if(o==="right")b=v(this.left),P=e.left,H=v(e.right)-y,x=b+y,k=this.left+h;else if(n==="x"){if(o==="center")b=v((e.top+e.bottom)/2+.5);else if(ut(o)){const I=Object.keys(o)[0],W=o[I];b=v(this.chart.scales[I].getPixelForValue(W))}F=e.top,te=e.bottom,T=b+y,A=T+h}else if(n==="y"){if(o==="center")b=v((e.left+e.right)/2);else if(ut(o)){const I=Object.keys(o)[0],W=o[I];b=v(this.chart.scales[I].getPixelForValue(W))}x=b-y,k=x-h,P=e.left,H=e.right}const N=tt(s.ticks.maxTicksLimit,d),L=Math.max(1,Math.ceil(d/N));for(E=0;E0&&(le-=M/2);break}ue={left:le,top:ie,width:M+Y.width,height:Z+Y.height,color:L.backdropColor}}y.push({label:C,font:A,textOffset:H,options:{rotation:m,color:W,strokeColor:X,strokeWidth:J,textAlign:ne,textBaseline:te,translation:[w,x],backdrop:ue}})}return y}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-as(this.labelRotation))return e==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=e+r,l=o.widest.width;let c,u;return n==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:i,top:s,width:r,height:o}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(i,s,r,o),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(r=>r.value===e);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(r=0,o=s.length;r{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,o;for(r=0,o=n.length;r{const i=n.split("."),s=i.pop(),r=[t].concat(i).join("."),o=e[n].split("."),a=o.pop(),l=o.join(".");Zt.route(r,s,l,a)})}function tU(t){return"id"in t&&"defaults"in t}class nU{constructor(){this.controllers=new Pd(vo,"datasets",!0),this.elements=new Pd(vr,"elements"),this.plugins=new Pd(Object,"plugins"),this.scales=new Pd(ya,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,i){[...n].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(e,r,s):Ct(s,o=>{const a=i||this._getRegistryForType(o);this._exec(e,a,o)})})}_exec(e,n,i){const s=q_(e);Pt(i["before"+s],[],i),n[e](i),Pt(i["after"+s],[],i)}_getRegistryForType(e){for(let n=0;nr.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,i),e,"stop"),this._notify(s(i,n),e,"start")}}function sU(t){const e={},n=[],i=Object.keys(vs.plugins.items);for(let r=0;r1&&b1(t[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function w1(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function dU(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(i=>i.xAxisID===t||i.yAxisID===t);if(n.length)return w1(t,"x",n[0])||w1(t,"y",n[0])}return{}}function hU(t,e){const n=ca[t.type]||{scales:{}},i=e.scales||{},s=am(t.type,e),r=Object.create(null);return Object.keys(i).forEach(o=>{const a=i[o];if(!ut(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=lm(o,a,dU(o,t),Zt.scales[a.type]),c=cU(l,s),u=n.scales||{};r[o]=Hc(Object.create(null),[{axis:l},a,u[l],u[c]])}),t.data.datasets.forEach(o=>{const a=o.type||t.type,l=o.indexAxis||am(a,e),u=(ca[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=lU(d,l),f=o[h+"AxisID"]||h;r[f]=r[f]||Object.create(null),Hc(r[f],[{axis:h},i[f],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];Hc(a,[Zt.scales[a.type],Zt.scale])}),r}function QC(t){const e=t.options||(t.options={});e.plugins=tt(e.plugins,{}),e.scales=hU(t,e)}function eT(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function fU(t){return t=t||{},t.data=eT(t.data),QC(t),t}const x1=new Map,tT=new Set;function Rd(t,e){let n=x1.get(t);return n||(n=e(),x1.set(t,n),tT.add(n)),n}const gc=(t,e,n)=>{const i=ao(e,n);i!==void 0&&t.add(i)};let gU=class{constructor(e){this._config=fU(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=eT(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),QC(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Rd(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return Rd(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return Rd(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,i=this.type;return Rd(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const i=this._scopeCache;let s=i.get(e);return(!s||n)&&(s=new Map,i.set(e,s)),s}getOptionScopes(e,n,i){const{options:s,type:r}=this,o=this._cachedScopes(e,i),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{e&&(l.add(e),u.forEach(d=>gc(l,e,d))),u.forEach(d=>gc(l,s,d)),u.forEach(d=>gc(l,ca[r]||{},d)),u.forEach(d=>gc(l,Zt,d)),u.forEach(d=>gc(l,rm,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),tT.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:e,type:n}=this;return[e,ca[n]||{},Zt.datasets[n]||{},{type:n},Zt,rm]}resolveNamedOptions(e,n,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=E1(this._resolverCache,e,s);let l=o;if(mU(o,n)){r.$shared=!1,i=lo(i)?i():i;const c=this.createResolver(e,i,a);l=Ml(o,i,c)}for(const c of n)r[c]=l[c];return r}createResolver(e,n,i=[""],s){const{resolver:r}=E1(this._resolverCache,e,i);return ut(n)?Ml(r,n,void 0,s):r}};function E1(t,e,n){let i=t.get(e);i||(i=new Map,t.set(e,i));const s=n.join();let r=i.get(s);return r||(r={resolver:ny(e,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const pU=t=>ut(t)&&Object.getOwnPropertyNames(t).some(e=>lo(t[e]));function mU(t,e){const{isScriptable:n,isIndexable:i}=PC(t);for(const s of e){const r=n(s),o=i(s),a=(o||r)&&t[s];if(r&&(lo(a)||pU(a))||o&&Nt(a))return!0}return!1}var _U="4.4.1";const yU=["top","bottom","left","right","chartArea"];function S1(t,e){return t==="top"||t==="bottom"||yU.indexOf(t)===-1&&e==="x"}function C1(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}function T1(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),Pt(n&&n.onComplete,[t],e)}function vU(t){const e=t.chart,n=e.options.animation;Pt(n&&n.onProgress,[t],e)}function nT(t){return ry()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const oh={},k1=t=>{const e=nT(t);return Object.values(oh).filter(n=>n.canvas===e).pop()};function bU(t,e,n){const i=Object.keys(t);for(const s of i){const r=+s;if(r>=e){const o=t[s];delete t[s],(n>0||r>e)&&(t[r+n]=o)}}}function wU(t,e,n,i){return!n||t.type==="mouseout"?null:i?e:t}function Dd(t,e,n){return t.options.clip?t[n]:e[n]}function xU(t,e){const{xScale:n,yScale:i}=t;return n&&i?{left:Dd(n,e,"left"),right:Dd(n,e,"right"),top:Dd(i,e,"top"),bottom:Dd(i,e,"bottom")}:e}let Tf=class{static defaults=Zt;static instances=oh;static overrides=ca;static registry=vs;static version=_U;static getChart=k1;static register(...e){vs.add(...e),A1()}static unregister(...e){vs.remove(...e),A1()}constructor(e,n){const i=this.config=new gU(n),s=nT(e),r=k1(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||BK(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=bY(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new iU,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=OY(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],oh[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Xs.listen(this,"complete",T1),Xs.listen(this,"progress",vU),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:i,height:s,_aspectRatio:r}=this;return gt(e)?n&&r?r:s?i/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return vs}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Xb(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Kb(this.canvas,this.ctx),this}stop(){return Xs.stop(this),this}resize(e,n){Xs.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,e,n,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Xb(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Pt(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ct(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const e=this.options,n=e.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];n&&(r=r.concat(Object.keys(n).map(o=>{const a=n[o],l=lm(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Ct(r,o=>{const a=o.options,l=a.id,c=lm(l,a),u=tt(a.type,o.dtype);(a.position===void 0||S1(a.position,c)!==S1(o.dposition))&&(a.position=o.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const h=vs.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,e)}),Ct(s,(o,a)=>{o||delete i[a]}),Ct(i,o=>{Wi.configure(this,o,o.options),Wi.addBox(this,o)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,i=e.length;if(e.sort((s,r)=>s.index-r.index),i>n){for(let s=n;sn.length&&delete this._stacks,e.forEach((i,s)=>{n.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c{c.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(C1("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Ct(this.scales,e=>{Wi.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!Nb(n,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of n){const o=i==="_removeElements"?-r:r;bU(e,s,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=r=>new Set(e.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;rr.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Wi.update(this,this.width,this.height,e);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],Ct(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,i=e._clip,s=!i.disabled,r=xU(e,this.chartArea),o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Ef(n,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),e.controller.draw(),s&&Sf(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return ar(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,i,s){const r=yK.modes[n];return typeof r=="function"?r(this,e,i,s):[]}getDatasetMeta(e){const n=this.data.datasets[e],i=this._metasets;let s=i.filter(r=>r&&r._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:e,_dataset:n,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=yo(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(e,n){const i=this.getDatasetMeta(e);i.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,i){const s=i?"show":"hide",r=this.getDatasetMeta(e),o=r.controller._resolveAnimations(void 0,s);uu(n)?(r.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===e?s:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),Xs.remove(this),e=0,n=this.data.datasets.length;e{n.addEventListener(this,r,o),e[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};Ct(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),e[l]=c},s=(l,c)=>{e[l]&&(n.removeEventListener(this,l,c),delete e[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){Ct(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},Ct(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,i){const s=i?"set":"remove";let r,o,a,l;for(n==="dataset"&&(r=this.getDatasetMeta(e[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=e.length;a{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!wh(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(e,n,i){return this._plugins.notify(this,e,n,i)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(n,e),a=i?e:r(e,n);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(e,n){const i={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},s=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(e,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(e,n,i){const{_active:s=[],options:r}=this,o=n,a=this._getActiveElements(e,s,i,o),l=TY(e),c=wU(e,this._lastEvent,i,l);i&&(this._lastEvent=null,Pt(r.onHover,[e,a,this],this),l&&Pt(r.onClick,[e,a,this],this));const u=!wh(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,u}_getActiveElements(e,n,i,s){if(e.type==="mouseout")return[];if(!i)return n;const r=this.options.hover;return this.getElementsAtEventForMode(e,r.mode,r,s)}};function A1(){return Ct(Tf.instances,t=>t._plugins.invalidate())}function EU(t,e,n){const{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=e;let c=s/a;t.beginPath(),t.arc(r,o,a,i-c,n+c),l>s?(c=s/l,t.arc(r,o,l,n+c,i-c,!0)):t.arc(r,o,s,n+on,i-on),t.closePath(),t.clip()}function SU(t){return ty(t,["outerStart","outerEnd","innerStart","innerEnd"])}function CU(t,e,n,i){const s=SU(t.options.borderRadius),r=(n-e)/2,o=Math.min(r,i*e/2),a=l=>{const c=(n-Math.min(r,l))*i/2;return Pn(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Pn(s.innerStart,0,o),innerEnd:Pn(s.innerEnd,0,o)}}function $a(t,e,n,i){return{x:n+t*Math.cos(e),y:i+t*Math.sin(e)}}function kh(t,e,n,i,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=e,d=Math.max(e.outerRadius+i+n-c,0),h=u>0?u+i+n+c:0;let f=0;const p=s-l;if(i){const L=u>0?u-i:0,I=d>0?d-i:0,W=(L+I)/2,X=W!==0?p*W/(W+i):p;f=(p-X)/2}const m=Math.max(.001,p*d-n/Bt)/d,y=(p-m)/2,v=l+y+f,b=s-y-f,{outerStart:E,outerEnd:C,innerStart:w,innerEnd:x}=CU(e,h,d,b-v),T=d-E,k=d-C,A=v+E/T,P=b-C/k,F=h+w,H=h+x,te=v+w/F,N=b-x/H;if(t.beginPath(),r){const L=(A+P)/2;if(t.arc(o,a,d,A,L),t.arc(o,a,d,L,P),C>0){const J=$a(k,P,o,a);t.arc(J.x,J.y,C,P,b+on)}const I=$a(H,b,o,a);if(t.lineTo(I.x,I.y),x>0){const J=$a(H,N,o,a);t.arc(J.x,J.y,x,b+on,N+Math.PI)}const W=(b-x/h+(v+w/h))/2;if(t.arc(o,a,h,b-x/h,W,!0),t.arc(o,a,h,W,v+w/h,!0),w>0){const J=$a(F,te,o,a);t.arc(J.x,J.y,w,te+Math.PI,v-on)}const X=$a(T,v,o,a);if(t.lineTo(X.x,X.y),E>0){const J=$a(T,A,o,a);t.arc(J.x,J.y,E,v-on,A)}}else{t.moveTo(o,a);const L=Math.cos(A)*d+o,I=Math.sin(A)*d+a;t.lineTo(L,I);const W=Math.cos(P)*d+o,X=Math.sin(P)*d+a;t.lineTo(W,X)}t.closePath()}function TU(t,e,n,i,s){const{fullCircles:r,startAngle:o,circumference:a}=e;let l=e.endAngle;if(r){kh(t,e,n,i,l,s);for(let c=0;ce!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,n,i){const s=this.getProps(["x","y"],i),{angle:r,distance:o}=wC(s,{x:e,y:n}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:u,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),h=(this.options.spacing+this.options.borderWidth)/2,p=tt(d,l-a)>=Ft||du(r,a,l),m=rr(o,c+h,u+h);return p&&m}getCenterPoint(e){const{x:n,y:i,startAngle:s,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:l,spacing:c}=this.options,u=(s+r)/2,d=(o+a+c+l)/2;return{x:n+Math.cos(u)*d,y:i+Math.sin(u)*d}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:n,circumference:i}=this,s=(n.offset||0)/4,r=(n.spacing||0)/2,o=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=i>Ft?Math.floor(i/Ft):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const a=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(a)*s,Math.sin(a)*s);const l=1-Math.sin(Math.min(Bt,i||0)),c=s*l;e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,TU(e,this,c,r,o),kU(e,this,c,r,o),e.restore()}}function iT(t,e,n=e){t.lineCap=tt(n.borderCapStyle,e.borderCapStyle),t.setLineDash(tt(n.borderDash,e.borderDash)),t.lineDashOffset=tt(n.borderDashOffset,e.borderDashOffset),t.lineJoin=tt(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=tt(n.borderWidth,e.borderWidth),t.strokeStyle=tt(n.borderColor,e.borderColor)}function MU(t,e,n){t.lineTo(n.x,n.y)}function IU(t){return t.stepped?GY:t.tension||t.cubicInterpolationMode==="monotone"?XY:MU}function sT(t,e,n={}){const i=t.length,{start:s=0,end:r=i-1}=n,{start:o,end:a}=e,l=Math.max(s,o),c=Math.min(r,a),u=sa&&r>a;return{count:i,start:l,loop:e.loop,ilen:c(o+(c?a-C:C))%r,E=()=>{m!==y&&(t.lineTo(u,y),t.lineTo(u,m),t.lineTo(u,v))};for(l&&(f=s[b(0)],t.moveTo(f.x,f.y)),h=0;h<=a;++h){if(f=s[b(h)],f.skip)continue;const C=f.x,w=f.y,x=C|0;x===p?(wy&&(y=w),u=(d*u+C)/++d):(E(),t.lineTo(C,w),p=x,d=0,m=y=w),v=w}E()}function cm(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!n?RU:PU}function DU(t){return t.stepped?kj:t.tension||t.cubicInterpolationMode==="monotone"?Aj:Wo}function $U(t,e,n,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,n,i)&&s.closePath()),iT(t,e.options),t.stroke(s)}function LU(t,e,n,i){const{segments:s,options:r}=e,o=cm(e);for(const a of s)iT(t,r,a.style),t.beginPath(),o(t,e,a,{start:n,end:n+i-1})&&t.closePath(),t.stroke()}const OU=typeof Path2D=="function";function NU(t,e,n,i){OU&&!e.options.segment?$U(t,e,n,i):LU(t,e,n,i)}class kf extends vr{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"};constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,n){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;vj(this._points,i,e,s,n),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=$j(this,this.options.segment))}first(){const e=this.segments,n=this.points;return e.length&&n[e[0].start]}last(){const e=this.segments,n=this.points,i=e.length;return i&&n[e[i-1].end]}interpolate(e,n){const i=this.options,s=e[n],r=this.points,o=zC(this,{property:n,start:s,end:s});if(!o.length)return;const a=[],l=DU(i);let c,u;for(c=0,u=o.length;c=n)return t.slice(e,e+n);const o=[],a=(n-2)/(r-2);let l=0;const c=e+n-1;let u=e,d,h,f,p,m;for(o[l++]=t[u],d=0;df&&(f=p,h=t[b],m=b);o[l++]=h,u=m}return o[l++]=t[c],o}function KU(t,e,n,i){let s=0,r=0,o,a,l,c,u,d,h,f,p,m;const y=[],v=e+n-1,b=t[e].x,C=t[v].x-b;for(o=e;om&&(m=c,h=o),s=(r*s+a.x)/++r;else{const x=o-1;if(!gt(d)&&!gt(h)){const T=Math.min(d,h),k=Math.max(d,h);T!==f&&T!==x&&y.push({...t[T],x:s}),k!==f&&k!==x&&y.push({...t[k],x:s})}o>0&&x!==f&&y.push(t[x]),y.push(a),u=w,r=0,p=m=c,d=h=f=o}}return y}function oT(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function I1(t){t.data.datasets.forEach(e=>{oT(e)})}function UU(t,e){const n=e.length;let i=0,s;const{iScale:r}=t,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=Pn(or(e,r.axis,o).lo,0,n-1)),c?s=Pn(or(e,r.axis,a).hi+1,i,n)-i:s=n-i,{start:i,count:s}}var GU={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,n)=>{if(!n.enabled){I1(t);return}const i=t.width;t.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=t.getDatasetMeta(r),c=o||s.data;if(xc([a,t.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=t.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||t.options.parsing)return;let{start:d,count:h}=UU(l,c);const f=n.threshold||4*i;if(h<=f){oT(s);return}gt(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(n.algorithm){case"lttb":p=jU(c,d,h,i,n);break;case"min-max":p=KU(c,d,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(t){I1(t)}};function XU(t,e,n){const i=t.segments,s=t.points,r=e.points,o=[];for(const a of i){let{start:l,end:c}=a;c=ly(l,c,s);const u=um(n,s[l],s[c],a.loop);if(!e.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}const d=zC(e,u);for(const h of d){const f=um(n,r[h.start],r[h.end],h.loop),p=VC(a,s,f);for(const m of p)o.push({source:m,target:h,start:{[n]:P1(u,f,"start",Math.max)},end:{[n]:P1(u,f,"end",Math.min)}})}}return o}function um(t,e,n,i){if(i)return;let s=e[t],r=n[t];return t==="angle"&&(s=Si(s),r=Si(r)),{property:t,start:s,end:r}}function qU(t,e){const{x:n=null,y:i=null}=t||{},s=e.points,r=[];return e.segments.forEach(({start:o,end:a})=>{a=ly(o,a,s);const l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):n!==null&&(r.push({x:n,y:l.y}),r.push({x:n,y:c.y}))}),r}function ly(t,e,n){for(;e>t;e--){const i=n[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function P1(t,e,n,i){return t&&e?i(t[n],e[n]):t?t[n]:e?e[n]:0}function aT(t,e){let n=[],i=!1;return Nt(t)?(i=!0,n=t):n=qU(t,e),n.length?new kf({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function R1(t){return t&&t.fill!==!1}function ZU(t,e,n){let s=t[e].fill;const r=[e];let o;if(!n)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!qt(s))return s;if(o=t[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function JU(t,e,n){const i=nG(t);if(ut(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return qt(s)&&Math.floor(s)===s?QU(i[0],e,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function QU(t,e,n,i){return(t==="-"||t==="+")&&(n=e+n),n===e||n<0||n>=i?!1:n}function eG(t,e){let n=null;return t==="start"?n=e.bottom:t==="end"?n=e.top:ut(t)?n=e.getPixelForValue(t.value):e.getBasePixel&&(n=e.getBasePixel()),n}function tG(t,e,n){let i;return t==="start"?i=n:t==="end"?i=e.options.reverse?e.min:e.max:ut(t)?i=t.value:i=e.getBaseValue(),i}function nG(t){const e=t.options,n=e.fill;let i=tt(n&&n.target,n);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function iG(t){const{scale:e,index:n,line:i}=t,s=[],r=i.segments,o=i.points,a=sG(e,n);a.push(aT({x:null,y:e.bottom},i));for(let l=0;l=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&tp(t.ctx,a,r))}},beforeDatasetsDraw(t,e,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=t.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;R1(r)&&tp(t.ctx,r,t.chartArea)}},beforeDatasetDraw(t,e,n){const i=e.meta.$filler;!R1(i)||n.drawTime!=="beforeDatasetDraw"||tp(t.ctx,i,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const O1=(t,e)=>{let{boxHeight:n=e,boxWidth:i=e}=t;return t.usePointStyle&&(n=Math.min(n,e),i=t.pointStyleWidth||Math.min(i,e)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(e,n)}},pG=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class N1 extends vr{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n,i){this.maxWidth=e,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let n=Pt(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(i=>e.filter(i,this.chart.data))),e.sort&&(n=n.sort((i,s)=>e.sort(i,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:e,ctx:n}=this;if(!e.display){this.width=this.height=0;return}const i=e.labels,s=vn(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=O1(i,r);let c,u;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,s,a,l)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,n,i,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let d=e;r.textAlign="left",r.textBaseline="middle";let h=-1,f=-u;return this.legendItems.forEach((p,m)=>{const y=i+n/2+r.measureText(p.text).width;(m===0||c[c.length-1]+y+2*a>o)&&(d+=u,c[c.length-(m>0?0:1)]=0,f+=u,h++),l[m]={left:0,top:f,row:h,width:y,height:s},c[c.length-1]+=y+a}),d}_fitCols(e,n,i,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-e;let d=a,h=0,f=0,p=0,m=0;return this.legendItems.forEach((y,v)=>{const{itemWidth:b,itemHeight:E}=mG(i,n,r,y,s);v>0&&f+E+2*a>u&&(d+=h+a,c.push({width:h,height:f}),p+=h+a,m++,h=f=0),l[v]={left:p,top:f,col:m,width:b,height:E},h=Math.max(h,b),f+=E+a}),d+=h,c.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:r}}=this,o=ol(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=Bn(i,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Bn(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+e+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=Bn(i,this.top+e+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Bn(i,this.top+e+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;Ef(e,this),this._draw(),Sf(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:i,ctx:s}=this,{align:r,labels:o}=e,a=Zt.color,l=ol(e.rtl,this.left,this.width),c=vn(o.font),{padding:u}=o,d=c.size,h=d/2;let f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:y}=O1(o,d),v=function(x,T,k){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;s.save();const A=tt(k.lineWidth,1);if(s.fillStyle=tt(k.fillStyle,a),s.lineCap=tt(k.lineCap,"butt"),s.lineDashOffset=tt(k.lineDashOffset,0),s.lineJoin=tt(k.lineJoin,"miter"),s.lineWidth=A,s.strokeStyle=tt(k.strokeStyle,a),s.setLineDash(tt(k.lineDash,[])),o.usePointStyle){const P={radius:m*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:A},F=l.xPlus(x,p/2),H=T+h;MC(s,P,F,H,o.pointStyleWidth&&p)}else{const P=T+Math.max((d-m)/2,0),F=l.leftForLtr(x,p),H=ia(k.borderRadius);s.beginPath(),Object.values(H).some(te=>te!==0)?hu(s,{x:F,y:P,w:p,h:m,radius:H}):s.rect(F,P,p,m),s.fill(),A!==0&&s.stroke()}s.restore()},b=function(x,T,k){ua(s,k.text,x,T+y/2,c,{strikethrough:k.hidden,textAlign:l.textAlign(k.textAlign)})},E=this.isHorizontal(),C=this._computeTitleHeight();E?f={x:Bn(r,this.left+u,this.right-i[0]),y:this.top+u+C,line:0}:f={x:this.left+u,y:Bn(r,this.top+C+u,this.bottom-n[0].height),line:0},NC(this.ctx,e.textDirection);const w=y+u;this.legendItems.forEach((x,T)=>{s.strokeStyle=x.fontColor,s.fillStyle=x.fontColor;const k=s.measureText(x.text).width,A=l.textAlign(x.textAlign||(x.textAlign=o.textAlign)),P=p+h+k;let F=f.x,H=f.y;l.setWidth(this.width),E?T>0&&F+P+u>this.right&&(H=f.y+=w,f.line++,F=f.x=Bn(r,this.left+u,this.right-i[f.line])):T>0&&H+w>this.bottom&&(F=f.x=F+n[f.line].width+u,f.line++,H=f.y=Bn(r,this.top+C+u,this.bottom-n[f.line].height));const te=l.x(F);if(v(te,H,x),F=NY(A,F+p+h,E?F+P:this.right,e.rtl),b(l.x(F),H,x),E)f.x+=P+u;else if(typeof x.text!="string"){const N=c.lineHeight;f.y+=cT(x,N)+u}else f.y+=w}),FC(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,i=vn(n.font),s=Kn(n.padding);if(!n.display)return;const r=ol(e.rtl,this.left,this.width),o=this.ctx,a=n.position,l=i.size/2,c=s.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=Bn(e.align,d,this.right-h);else{const p=this.columnSizes.reduce((m,y)=>Math.max(m,y.height),0);u=c+Bn(e.align,this.top,this.bottom-p-e.labels.padding-this._computeTitleHeight())}const f=Bn(a,d,d+h);o.textAlign=r.textAlign(Q_(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=i.string,ua(o,n.text,f,u,i)}_computeTitleHeight(){const e=this.options.title,n=vn(e.font),i=Kn(e.padding);return e.display?n.lineHeight+i.height:0}_getLegendItemAt(e,n){let i,s,r;if(rr(e,this.left,this.right)&&rr(n,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;ir.length>o.length?r:o)),e+n.size/2+i.measureText(s).width}function yG(t,e,n){let i=t;return typeof e.text!="string"&&(i=cT(e,n)),i}function cT(t,e){const n=t.text?t.text.length:0;return e*n}function vG(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var bG={id:"legend",_element:N1,start(t,e,n){const i=t.legend=new N1({ctx:t.ctx,options:n,chart:t});Wi.configure(t,i,n),Wi.addBox(t,i)},stop(t){Wi.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const i=t.legend;Wi.configure(t,i,n),i.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const i=e.datasetIndex,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),e.hidden=!0):(s.show(i),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:s,color:r,useBorderRadius:o,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Kn(c.borderWidth);return{text:e[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class uT extends vr{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=n;const s=Nt(i.text)?i.text.length:1;this._padding=Kn(i.padding);const r=s*vn(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:i,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=Bn(a,i,r),d=n+e,c=r-i):(o.position==="left"?(u=i+e,d=Bn(a,s,n),l=Bt*-.5):(u=r-e,d=Bn(a,n,s),l=Bt*.5),c=s-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const i=vn(n.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);ua(e,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:Q_(n.align),textBaseline:"middle",translation:[o,a]})}}function wG(t,e){const n=new uT({ctx:t.ctx,options:e,chart:t});Wi.configure(t,n,e),Wi.addBox(t,n),t.titleBlock=n}var xG={id:"title",_element:uT,start(t,e,n){wG(t,n)},stop(t){const e=t.titleBlock;Wi.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const i=t.titleBlock;Wi.configure(t,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Sc={average(t){if(!t.length)return!1;let e,n,i=0,s=0,r=0;for(e=0,n=t.length;e-1?t.split(` -`):t}function eG(t,e){const{element:n,datasetIndex:i,index:s}=e,r=t.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:t,label:o,parsed:r.getParsed(s),raw:t.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function F1(t,e){const n=t.chart.ctx,{body:i,footer:s,title:r}=t,{boxWidth:o,boxHeight:a}=e,l=vn(e.bodyFont),c=vn(e.titleFont),u=vn(e.footerFont),d=r.length,h=s.length,f=i.length,p=Kn(e.padding);let m=p.height,y=0,v=i.reduce((C,w)=>C+w.before.length+w.lines.length+w.after.length,0);if(v+=t.beforeBody.length+t.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),v){const C=e.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*C+(v-f)*l.lineHeight+(v-1)*e.bodySpacing}h&&(m+=e.footerMarginTop+h*u.lineHeight+(h-1)*e.footerSpacing);let b=0;const E=function(C){y=Math.max(y,n.measureText(C).width+b)};return n.save(),n.font=c.string,Ct(t.title,E),n.font=l.string,Ct(t.beforeBody.concat(t.afterBody),E),b=e.displayColors?o+2+e.boxPadding:0,Ct(i,C=>{Ct(C.before,E),Ct(C.lines,E),Ct(C.after,E)}),b=0,n.font=u.string,Ct(t.footer,E),n.restore(),y+=p.width,{width:y,height:m}}function tG(t,e){const{y:n,height:i}=e;return nt.height-i/2?"bottom":"center"}function nG(t,e,n,i){const{x:s,width:r}=i,o=n.caretSize+n.caretPadding;if(t==="left"&&s+r+o>e.width||t==="right"&&s-r-o<0)return!0}function iG(t,e,n,i){const{x:s,width:r}=n,{width:o,chartArea:{left:a,right:l}}=t;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),nG(c,t,e,n)&&(c="center"),c}function B1(t,e,n){const i=n.yAlign||e.yAlign||tG(t,n);return{xAlign:n.xAlign||e.xAlign||iG(t,e,n,i),yAlign:i}}function sG(t,e){let{x:n,width:i}=t;return e==="right"?n-=i:e==="center"&&(n-=i/2),n}function rG(t,e,n){let{y:i,height:s}=t;return e==="top"?i+=n:e==="bottom"?i-=s+n:i-=s/2,i}function V1(t,e,n,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=t,{xAlign:a,yAlign:l}=n,c=s+r,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:f}=ia(o);let p=sG(e,a);const m=rG(e,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+s:a==="right"&&(p+=Math.max(d,f)+s),{x:Pn(p,0,i.width-e.width),y:Pn(m,0,i.height-e.height)}}function $d(t,e,n){const i=Kn(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-i.right:t.x+i.left}function z1(t){return ys([],qs(t))}function oG(t,e,n){return yo(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function W1(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const dT={beforeTitle:js,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex"u"?dT[e].call(n,i):s}class H1 extends vr{static positioners=Sc;constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,r=new WC(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=oG(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:i}=n,s=ai(i,"beforeTitle",this,e),r=ai(i,"title",this,e),o=ai(i,"afterTitle",this,e);let a=[];return a=ys(a,qs(s)),a=ys(a,qs(r)),a=ys(a,qs(o)),a}getBeforeBody(e,n){return z1(ai(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:i}=n,s=[];return Ct(e,r=>{const o={before:[],lines:[],after:[]},a=W1(i,r);ys(o.before,qs(ai(a,"beforeLabel",this,r))),ys(o.lines,ai(a,"label",this,r)),ys(o.after,qs(ai(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(e,n){return z1(ai(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:i}=n,s=ai(i,"beforeFooter",this,e),r=ai(i,"footer",this,e),o=ai(i,"afterFooter",this,e);let a=[];return a=ys(a,qs(s)),a=ys(a,qs(r)),a=ys(a,qs(o)),a}_createItems(e){const n=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=n.length;le.filter(u,d,h,i))),e.itemSort&&(a=a.sort((u,d)=>e.itemSort(u,d,i))),Ct(a,u=>{const d=W1(e.callbacks,u);s.push(ai(d,"labelColor",this,u)),r.push(ai(d,"labelPointStyle",this,u)),o.push(ai(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(e,n){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=Sc[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=F1(this,i),c=Object.assign({},a,l),u=B1(this.chart,i,c),d=V1(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,i,s){const r=this.getCaretPosition(e,i,s);n.lineTo(r.x1,r.y1),n.lineTo(r.x2,r.y2),n.lineTo(r.x3,r.y3)}getCaretPosition(e,n,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=ia(a),{x:h,y:f}=e,{width:p,height:m}=n;let y,v,b,E,C,w;return r==="center"?(C=f+m/2,s==="left"?(y=h,v=y-o,E=C+o,w=C-o):(y=h+p,v=y+o,E=C-o,w=C+o),b=y):(s==="left"?v=h+Math.max(l,u)+o:s==="right"?v=h+p-Math.max(c,d)-o:v=this.caretX,r==="top"?(E=f,C=E-o,y=v-o,b=v+o):(E=f+m,C=E+o,y=v+o,b=v-o),w=E),{x1:y,x2:v,x3:b,y1:E,y2:C,y3:w}}drawTitle(e,n,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=ol(i.rtl,this.x,this.width);for(e.x=$d(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",o=vn(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=o.string,l=0;lb!==0)?(e.beginPath(),e.fillStyle=r.multiKeyBackground,hu(e,{x:m,y:p,w:c,h:l,radius:v}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),hu(e,{x:y,y:p+1,w:c-2,h:l-2,radius:v}),e.fill()):(e.fillStyle=r.multiKeyBackground,e.fillRect(m,p,c,l),e.strokeRect(m,p,c,l),e.fillStyle=o.backgroundColor,e.fillRect(y,p+1,c-2,l-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,n,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=vn(i.bodyFont);let h=d.lineHeight,f=0;const p=ol(i.rtl,this.x,this.width),m=function(k){n.fillText(k,p.x(e.x+f),e.y+h/2),e.y+=h+r},y=p.textAlign(o);let v,b,E,C,w,x,T;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,e.x=$d(this,y,i),n.fillStyle=i.bodyColor,Ct(this.beforeBody,m),f=a&&y!=="right"?o==="center"?c/2+u:c+2+u:0,C=0,x=s.length;C0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=Sc[e.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=F1(this,e),l=Object.assign({},o,this._size),c=B1(n,e,l),u=V1(e,l,c,n);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Kn(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(e.save(),e.globalAlpha=i,this.drawBackground(r,e,s,n),NC(e,n.textDirection),r.y+=o.top,this.drawTitle(r,e,n),this.drawBody(r,e,n),this.drawFooter(r,e,n),FC(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const i=this._active,s=e.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!wh(i,s),o=this._positionChanged(s,n);(r||o)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(e,r,n,i),a=this._positionChanged(o,e),l=n||!wh(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),l}_getActiveElements(e,n,i,s){const r=this.options;if(e.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(e,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(e,n){const{caretX:i,caretY:s,options:r}=this,o=Sc[r.position].call(this,e,n);return o!==!1&&(i!==o.x||s!==o.y)}}var aG={id:"tooltip",_element:H1,positioners:Sc,afterInit(t,e,n){n&&(t.tooltip=new H1({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:dT},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const lG=(t,e,n,i)=>(typeof e=="string"?(n=t.push(e)-1,i.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function cG(t,e,n,i){const s=t.indexOf(e);if(s===-1)return lG(t,e,n,i);const r=t.lastIndexOf(e);return s!==r?n:s}const uG=(t,e)=>t===null?null:Pn(Math.round(t),0,e);function Y1(t){const e=this.getLabels();return t>=0&&tn.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}function hG(t,e){const n=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=t,f=r||1,p=u-1,{min:m,max:y}=e,v=!gt(o),b=!gt(a),E=!gt(c),C=(y-m)/(d+1);let w=Bb((y-m)/p/f)*f,x,T,k,A;if(w<1e-14&&!v&&!b)return[{value:m},{value:y}];A=Math.ceil(y/w)-Math.floor(m/w),A>p&&(w=Bb(A*w/p/f)*f),gt(l)||(x=Math.pow(10,l),w=Math.ceil(w*x)/x),s==="ticks"?(T=Math.floor(m/w)*w,k=Math.ceil(y/w)*w):(T=m,k=y),v&&b&&r&&aY((a-o)/r,w/1e3)?(A=Math.round(Math.min((a-o)/w,u)),w=(a-o)/A,T=o,k=a):E?(T=v?o:T,k=b?a:k,A=c-1,w=(k-T)/A):(A=(k-T)/w,Yc(A,Math.round(A),w/1e3)?A=Math.round(A):A=Math.ceil(A));const P=Math.max(Vb(w),Vb(T));x=Math.pow(10,gt(l)?P:l),T=Math.round(T*x)/x,k=Math.round(k*x)/x;let F=0;for(v&&(h&&T!==o?(n.push({value:o}),Ta)break;n.push({value:H})}return b&&h&&k!==a?n.length&&Yc(n[n.length-1].value,a,j1(a,C,t))?n[n.length-1].value=a:n.push({value:a}):(!b||k===a)&&n.push({value:k}),n}function j1(t,e,{horizontal:n,minRotation:i}){const s=as(i),r=(n?Math.sin(s):Math.cos(s))||.001,o=.75*e*(""+t).length;return Math.min(e/r,o)}class Ah extends ya{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return gt(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=n?s:l,a=l=>r=i?r:l;if(e){const l=Ds(s),c=Ds(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);a(r+l),e||o(s-l)}this.min=s,this.max=r}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=e,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},r=this._range||this,o=hG(s,r);return e.bounds==="ticks"&&bC(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const s=(i-n)/Math.max(e.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(e){return Wu(e,this.chart.options.locale,this.options.ticks.format)}}class fG extends Ah{static id="linear";static defaults={ticks:{callback:xf.formatters.numeric}};determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=qt(e)?e:0,this.max=qt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,i=as(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,r.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}const gu=t=>Math.floor(Kr(t)),Oo=(t,e)=>Math.pow(10,gu(t)+e);function K1(t){return t/Math.pow(10,gu(t))===1}function U1(t,e,n){const i=Math.pow(10,n),s=Math.floor(t/i);return Math.ceil(e/i)-s}function gG(t,e){const n=e-t;let i=gu(n);for(;U1(t,e,i)>10;)i++;for(;U1(t,e,i)<10;)i--;return Math.min(i,gu(t))}function pG(t,{min:e,max:n}){e=xi(t.min,e);const i=[],s=gu(e);let r=gG(e,n),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((e-l)*o)/o,u=Math.floor((e-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,r)),h=xi(t.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;h=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),h=Math.round((l+u+d*Math.pow(10,r))*o)/o;const f=xi(t.max,h);return i.push({value:f,major:K1(f),significand:d}),i}class mG extends ya{static id="logarithmic";static defaults={ticks:{callback:xf.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,n){const i=Ah.prototype.parse.apply(this,[e,n]);if(i===0){this._zero=!0;return}return qt(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=qt(e)?Math.max(0,e):null,this.max=qt(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!qt(this._userMin)&&(this.min=e===Oo(this.min,0)?Oo(this.min,-1):Oo(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const r=a=>i=e?i:a,o=a=>s=n?s:a;i===s&&(i<=0?(r(1),o(10)):(r(Oo(i,-1)),o(Oo(s,1)))),i<=0&&r(Oo(s,-1)),s<=0&&o(Oo(i,1)),this.min=i,this.max=s}buildTicks(){const e=this.options,n={min:this._userMin,max:this._userMax},i=pG(n,this);return e.bounds==="ticks"&&bC(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":Wu(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Kr(e),this._valueRange=Kr(this.max)-Kr(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Kr(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}function dm(t){const e=t.ticks;if(e.display&&t.display){const n=Kn(e.backdropPadding);return tt(e.font&&e.font.size,Zt.font.size)+n.height}return 0}function _G(t,e,n){return n=Nt(n)?n:[n],{w:SY(t,e.string,n),h:n.length*e.lineHeight}}function G1(t,e,n,i,s){return t===i||t===s?{start:e-n/2,end:e+n/2}:ts?{start:e-n,end:e}:{start:e,end:e+n}}function yG(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),i=[],s=[],r=t._pointLabels.length,o=t.options.pointLabels,a=o.centerPointLabels?Bt/r:0;for(let l=0;le.r&&(a=(i.end-e.r)/r,t.r=Math.max(t.r,e.r+a)),s.starte.b&&(l=(s.end-e.b)/o,t.b=Math.max(t.b,e.b+l))}function bG(t,e,n){const i=t.drawingArea,{extra:s,additionalAngle:r,padding:o,size:a}=n,l=t.getPointPosition(e,i+s+o,r),c=Math.round(Z_(Si(l.angle+on))),u=CG(l.y,a.h,c),d=EG(c),h=SG(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+a.w,bottom:u+a.h}}function wG(t,e){if(!e)return!0;const{left:n,top:i,right:s,bottom:r}=t;return!(ar({x:n,y:i},e)||ar({x:n,y:r},e)||ar({x:s,y:i},e)||ar({x:s,y:r},e))}function xG(t,e,n){const i=[],s=t._pointLabels.length,r=t.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:dm(r)/2,additionalAngle:o?Bt/s:0};let c;for(let u=0;u270||n<90)&&(t-=e),t}function TG(t,e,n){const{left:i,top:s,right:r,bottom:o}=n,{backdropColor:a}=e;if(!gt(a)){const l=ia(e.borderRadius),c=Kn(e.backdropPadding);t.fillStyle=a;const u=i-c.left,d=s-c.top,h=r-i+c.width,f=o-s+c.height;Object.values(l).some(p=>p!==0)?(t.beginPath(),hu(t,{x:u,y:d,w:h,h:f,radius:l}),t.fill()):t.fillRect(u,d,h,f)}}function kG(t,e){const{ctx:n,options:{pointLabels:i}}=t;for(let s=e-1;s>=0;s--){const r=t._pointLabelItems[s];if(!r.visible)continue;const o=i.setContext(t.getPointLabelContext(s));TG(n,o,r);const a=vn(o.font),{x:l,y:c,textAlign:u}=r;ua(n,t._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function hT(t,e,n,i){const{ctx:s}=t;if(n)s.arc(t.xCenter,t.yCenter,e,0,Ft);else{let r=t.getPointPosition(0,e);s.moveTo(r.x,r.y);for(let o=1;o{const s=Pt(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?yG(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,n,i,s){this.xCenter+=Math.floor((e-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,n,i,s))}getIndexAngle(e){const n=Ft/(this._pointLabels.length||1),i=this.options.startAngle||0;return Si(e*n+as(i))}getDistanceFromCenterForValue(e){if(gt(e))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*n:(e-this.min)*n}getValueForDistanceFromCenter(e){if(gt(e))return NaN;const n=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(e){const n=this._pointLabels||[];if(e>=0&&e{if(d!==0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),f=s.setContext(h),p=r.setContext(h);AG(this,f,l,o,p)}}),i.display){for(e.save(),a=o-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:h}=u;!h||!d||(e.lineWidth=h,e.strokeStyle=d,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!n.reverse)return;const c=i.setContext(this.getContext(l)),u=vn(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){e.font=u.string,o=e.measureText(a.label).width,e.fillStyle=c.backdropColor;const d=Kn(c.backdropPadding);e.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}ua(e,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),e.restore()}drawTitle(){}}const Af={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},hi=Object.keys(Af);function X1(t,e){return t-e}function q1(t,e){if(gt(e))return null;const n=t._adapter,{parser:i,round:s,isoWeekday:r}=t._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),qt(o)||(o=typeof i=="string"?n.parse(o,i):n.parse(o)),o===null?null:(s&&(o=s==="week"&&(Al(r)||r===!0)?n.startOf(o,"isoWeek",r):n.startOf(o,s)),+o)}function Z1(t,e,n,i){const s=hi.length;for(let r=hi.indexOf(t);r=hi.indexOf(n);r--){const o=hi[r];if(Af[o].common&&t._adapter.diff(s,i,o)>=e-1)return o}return hi[n?hi.indexOf(n):0]}function RG(t){for(let e=hi.indexOf(t)+1,n=hi.length;e=e?n[i]:n[s];t[r]=!0}}function DG(t,e,n,i){const s=t._adapter,r=+s.startOf(e[0].value,i),o=e[e.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=n[a],l>=0&&(e[l].major=!0);return e}function Q1(t,e,n){const i=[],s={},r=e.length;let o,a;for(o=0;o+e.value))}initOffsets(e=[]){let n=0,i=0,s,r;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?n=1-s:n=(this.getDecimalForValue(e[1])-s)/2,r=this.getDecimalForValue(e[e.length-1]),e.length===1?i=r:i=(r-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;n=Pn(n,0,o),i=Pn(i,0,o),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const e=this._adapter,n=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||Z1(r.minUnit,n,i,this._getLabelCapacity(n)),a=tt(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=Al(l)||l===!0,u={};let d=n,h,f;if(c&&(d=+e.startOf(d,"isoWeek",l)),d=+e.startOf(d,c?"day":o),e.diff(i,n,o)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+o);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=d,f=0;h+m)}getLabelForValue(e){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(e,i.tooltipFormat):n.format(e,i.displayFormats.datetime)}format(e,n){const s=this.options.time.displayFormats,r=this._unit,o=n||s[r];return this._adapter.format(e,o)}_tickFormatFunction(e,n,i,s){const r=this.options,o=r.ticks.callback;if(o)return Pt(o,[e,n,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=i[n],f=c&&d&&h&&h.major;return this._adapter.format(e,s||(f?d:u))}generateTickLabels(e){let n,i,s;for(n=0,i=e.length;n0?a:1}getDataTimestamps(){let e=this._cache.data||[],n,i;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n=t[i].pos&&e<=t[s].pos&&({lo:i,hi:s}=or(t,"pos",e)),{pos:r,time:a}=t[i],{pos:o,time:l}=t[s]):(e>=t[i].time&&e<=t[s].time&&({lo:i,hi:s}=or(t,"time",e)),{time:r,pos:a}=t[i],{time:o,pos:l}=t[s]);const c=o-r;return c?a+(l-a)*(e-r)/c:a}class $G extends hm{static id="timeseries";static defaults=hm.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=Ld(n,this.min),this._tableRange=Ld(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=e.length;o=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(o=0,a=s.length;os-r)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?e=this.normalize(n.concat(i)):e=n.length?n:i,e=this._cache.all=e,e}getDecimalForValue(e){return(Ld(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,i=this.getDecimalForPixel(e)/n.factor-n.end;return Ld(this._table,i*this._tableRange+this._minPos,!0)}}const fT={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},LG={ariaLabel:{type:String},ariaDescribedby:{type:String}},OG={type:{type:String,required:!0},...fT,...LG},NG=HE[0]==="2"?(t,e)=>Object.assign(t,{attrs:e}):(t,e)=>Object.assign(t,e);function La(t){return nf(t)?lt(t):t}function FG(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t;return nf(e)?new Proxy(t,{}):t}function BG(t,e){const n=t.options;n&&e&&Object.assign(n,e)}function gT(t,e){t.labels=e}function pT(t,e,n){const i=[];t.datasets=e.map(s=>{const r=t.datasets.find(o=>o[n]===s[n]);return!r||!s.data||i.includes(r)?{...s}:(i.push(r),Object.assign(r,s),r)})}function VG(t,e){const n={labels:[],datasets:[]};return gT(n,t.labels),pT(n,t.datasets,e),n}const zG=cn({props:OG,setup(t,e){let{expose:n,slots:i}=e;const s=we(null),r=l_(null);n({chart:r});const o=()=>{if(!s.value)return;const{type:c,data:u,options:d,plugins:h,datasetIdKey:f}=t,p=VG(u,f),m=FG(p,u);r.value=new Tf(s.value,{type:c,data:m,options:{...d},plugins:h})},a=()=>{const c=lt(r.value);c&&(c.destroy(),r.value=null)},l=c=>{c.update(t.updateMode)};return xn(o),p_(a),fn([()=>t.options,()=>t.data],(c,u)=>{let[d,h]=c,[f,p]=u;const m=lt(r.value);if(!m)return;let y=!1;if(d){const v=La(d),b=La(f);v&&v!==b&&(BG(m,v),y=!0)}if(h){const v=La(h.labels),b=La(p.labels),E=La(h.datasets),C=La(p.datasets);v!==b&&(gT(m.config.data,v),y=!0),E&&E!==C&&(pT(m.config.data,E,t.datasetIdKey),y=!0)}y&&Rn(()=>{l(m)})},{deep:!0}),()=>la("canvas",{role:"img",ariaLabel:t.ariaLabel,ariaDescribedby:t.ariaDescribedby,ref:s},[la("p",{},[i.default?i.default():""])])}});function mT(t,e){return Tf.register(e),cn({props:fT,setup(n,i){let{expose:s}=i;const r=l_(null),o=a=>{r.value=a?.chart};return s({chart:r}),()=>la(zG,NG({ref:o},{type:t,...n}))}})}const WG=mT("bar",jC),HG=mT("line",UC);function mr(t){return Array.isArray?Array.isArray(t):vT(t)==="[object Array]"}const YG=1/0;function jG(t){if(typeof t=="string")return t;let e=t+"";return e=="0"&&1/t==-YG?"-0":e}function KG(t){return t==null?"":jG(t)}function ks(t){return typeof t=="string"}function _T(t){return typeof t=="number"}function UG(t){return t===!0||t===!1||GG(t)&&vT(t)=="[object Boolean]"}function yT(t){return typeof t=="object"}function GG(t){return yT(t)&&t!==null}function Ci(t){return t!=null}function np(t){return!t.trim().length}function vT(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const XG="Incorrect 'index' type",qG=t=>`Invalid value for key ${t}`,ZG=t=>`Pattern length exceeds max of ${t}.`,JG=t=>`Missing ${t} property in key`,QG=t=>`Property 'weight' in key '${t}' must be a positive integer`,ew=Object.prototype.hasOwnProperty;class e7{constructor(e){this._keys=[],this._keyMap={};let n=0;e.forEach(i=>{let s=bT(i);this._keys.push(s),this._keyMap[s.id]=s,n+=s.weight}),this._keys.forEach(i=>{i.weight/=n})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function bT(t){let e=null,n=null,i=null,s=1,r=null;if(ks(t)||mr(t))i=t,e=tw(t),n=fm(t);else{if(!ew.call(t,"name"))throw new Error(JG("name"));const o=t.name;if(i=o,ew.call(t,"weight")&&(s=t.weight,s<=0))throw new Error(QG(o));e=tw(o),n=fm(o),r=t.getFn}return{path:e,id:n,weight:s,src:i,getFn:r}}function tw(t){return mr(t)?t:t.split(".")}function fm(t){return mr(t)?t.join("."):t}function t7(t,e){let n=[],i=!1;const s=(r,o,a)=>{if(Ci(r))if(!o[a])n.push(r);else{let l=o[a];const c=r[l];if(!Ci(c))return;if(a===o.length-1&&(ks(c)||_T(c)||UG(c)))n.push(KG(c));else if(mr(c)){i=!0;for(let u=0,d=c.length;ut.score===e.score?t.idx{this._keysMap[n.id]=i})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,ks(this.docs[0])?this.docs.forEach((e,n)=>{this._addString(e,n)}):this.docs.forEach((e,n)=>{this._addObject(e,n)}),this.norm.clear())}add(e){const n=this.size();ks(e)?this._addString(e,n):this._addObject(e,n)}removeAt(e){this.records.splice(e,1);for(let n=e,i=this.size();n{let o=s.getFn?s.getFn(e):this.getFn(e,s.path);if(Ci(o)){if(mr(o)){let a=[];const l=[{nestedArrIndex:-1,value:o}];for(;l.length;){const{nestedArrIndex:c,value:u}=l.pop();if(Ci(u))if(ks(u)&&!np(u)){let d={v:u,i:c,n:this.norm.get(u)};a.push(d)}else mr(u)&&u.forEach((d,h)=>{l.push({nestedArrIndex:h,value:d})})}i.$[r]=a}else if(ks(o)&&!np(o)){let a={v:o,n:this.norm.get(o)};i.$[r]=a}}}),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function wT(t,e,{getFn:n=Je.getFn,fieldNormWeight:i=Je.fieldNormWeight}={}){const s=new cy({getFn:n,fieldNormWeight:i});return s.setKeys(t.map(bT)),s.setSources(e),s.create(),s}function l7(t,{getFn:e=Je.getFn,fieldNormWeight:n=Je.fieldNormWeight}={}){const{keys:i,records:s}=t,r=new cy({getFn:e,fieldNormWeight:n});return r.setKeys(i),r.setIndexRecords(s),r}function Od(t,{errors:e=0,currentLocation:n=0,expectedLocation:i=0,distance:s=Je.distance,ignoreLocation:r=Je.ignoreLocation}={}){const o=e/t.length;if(r)return o;const a=Math.abs(i-n);return s?o+a/s:a?1:o}function c7(t=[],e=Je.minMatchCharLength){let n=[],i=-1,s=-1,r=0;for(let o=t.length;r=e&&n.push([i,s]),i=-1)}return t[r-1]&&r-i>=e&&n.push([i,r-1]),n}const jo=32;function u7(t,e,n,{location:i=Je.location,distance:s=Je.distance,threshold:r=Je.threshold,findAllMatches:o=Je.findAllMatches,minMatchCharLength:a=Je.minMatchCharLength,includeMatches:l=Je.includeMatches,ignoreLocation:c=Je.ignoreLocation}={}){if(e.length>jo)throw new Error(ZG(jo));const u=e.length,d=t.length,h=Math.max(0,Math.min(i,d));let f=r,p=h;const m=a>1||l,y=m?Array(d):[];let v;for(;(v=t.indexOf(e,p))>-1;){let T=Od(e,{currentLocation:v,expectedLocation:h,distance:s,ignoreLocation:c});if(f=Math.min(T,f),p=v+u,m){let k=0;for(;k=P;N-=1){let L=N-1,I=n[t.charAt(L)];if(m&&(y[L]=+!!I),H[N]=(H[N+1]<<1|1)&I,T&&(H[N]|=(b[N+1]|b[N])<<1|1|b[N+1]),H[N]&w&&(E=Od(e,{errors:T,currentLocation:L,expectedLocation:h,distance:s,ignoreLocation:c}),E<=f)){if(f=E,p=L,p<=h)break;P=Math.max(1,2*h-p)}}if(Od(e,{errors:T+1,currentLocation:h,expectedLocation:h,distance:s,ignoreLocation:c})>f)break;b=H}const x={isMatch:p>=0,score:Math.max(.001,E)};if(m){const T=c7(y,a);T.length?l&&(x.indices=T):x.isMatch=!1}return x}function d7(t){let e={};for(let n=0,i=t.length;n{this.chunks.push({pattern:h,alphabet:d7(h),startIndex:f})},d=this.pattern.length;if(d>jo){let h=0;const f=d%jo,p=d-f;for(;h{const{isMatch:v,score:b,indices:E}=u7(e,p,m,{location:s+y,distance:r,threshold:o,findAllMatches:a,minMatchCharLength:l,includeMatches:i,ignoreLocation:c});v&&(h=!0),d+=b,v&&E&&(u=[...u,...E])});let f={isMatch:h,score:h?d/this.chunks.length:1};return h&&i&&(f.indices=u),f}}class bo{constructor(e){this.pattern=e}static isMultiMatch(e){return nw(e,this.multiRegex)}static isSingleMatch(e){return nw(e,this.singleRegex)}search(){}}function nw(t,e){const n=t.match(e);return n?n[1]:null}class h7 extends bo{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const n=e===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class f7 extends bo{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const i=e.indexOf(this.pattern)===-1;return{isMatch:i,score:i?0:1,indices:[0,e.length-1]}}}class g7 extends bo{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const n=e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class p7 extends bo{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const n=!e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class m7 extends bo{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const n=e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class _7 extends bo{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const n=!e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class ET extends bo{constructor(e,{location:n=Je.location,threshold:i=Je.threshold,distance:s=Je.distance,includeMatches:r=Je.includeMatches,findAllMatches:o=Je.findAllMatches,minMatchCharLength:a=Je.minMatchCharLength,isCaseSensitive:l=Je.isCaseSensitive,ignoreLocation:c=Je.ignoreLocation}={}){super(e),this._bitapSearch=new xT(e,{location:n,threshold:i,distance:s,includeMatches:r,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class ST extends bo{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let n=0,i;const s=[],r=this.pattern.length;for(;(i=e.indexOf(this.pattern,n))>-1;)n=i+r,s.push([i,n-1]);const o=!!s.length;return{isMatch:o,score:o?0:1,indices:s}}}const gm=[h7,ST,g7,p7,_7,m7,f7,ET],iw=gm.length,y7=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,v7="|";function b7(t,e={}){return t.split(v7).map(n=>{let i=n.trim().split(y7).filter(r=>r&&!!r.trim()),s=[];for(let r=0,o=i.length;r!!(t[Mh.AND]||t[Mh.OR]),S7=t=>!!t[_m.PATH],C7=t=>!mr(t)&&yT(t)&&!ym(t),sw=t=>({[Mh.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function CT(t,e,{auto:n=!0}={}){const i=s=>{let r=Object.keys(s);const o=S7(s);if(!o&&r.length>1&&!ym(s))return i(sw(s));if(C7(s)){const l=o?s[_m.PATH]:r[0],c=o?s[_m.PATTERN]:s[l];if(!ks(c))throw new Error(qG(l));const u={keyId:fm(l),pattern:c};return n&&(u.searcher=mm(c,e)),u}let a={children:[],operator:r[0]};return r.forEach(l=>{const c=s[l];mr(c)&&c.forEach(u=>{a.children.push(i(u))})}),a};return ym(t)||(t=sw(t)),i(t)}function T7(t,{ignoreFieldNorm:e=Je.ignoreFieldNorm}){t.forEach(n=>{let i=1;n.matches.forEach(({key:s,norm:r,score:o})=>{const a=s?s.weight:null;i*=Math.pow(o===0&&a?Number.EPSILON:o,(a||1)*(e?1:r))}),n.score=i})}function k7(t,e){const n=t.matches;e.matches=[],Ci(n)&&n.forEach(i=>{if(!Ci(i.indices)||!i.indices.length)return;const{indices:s,value:r}=i;let o={indices:s,value:r};i.key&&(o.key=i.key.src),i.idx>-1&&(o.refIndex=i.idx),e.matches.push(o)})}function A7(t,e){e.score=t.score}function M7(t,e,{includeMatches:n=Je.includeMatches,includeScore:i=Je.includeScore}={}){const s=[];return n&&s.push(k7),i&&s.push(A7),t.map(r=>{const{idx:o}=r,a={item:e[o],refIndex:o};return s.length&&s.forEach(l=>{l(r,a)}),a})}class Gl{constructor(e,n={},i){this.options={...Je,...n},this.options.useExtendedSearch,this._keyStore=new e7(this.options.keys),this.setCollection(e,i)}setCollection(e,n){if(this._docs=e,n&&!(n instanceof cy))throw new Error(XG);this._myIndex=n||wT(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){Ci(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const n=[];for(let i=0,s=this._docs.length;i-1&&(l=l.slice(0,n)),M7(l,this._docs,{includeMatches:i,includeScore:s})}_searchStringList(e){const n=mm(e,this.options),{records:i}=this._myIndex,s=[];return i.forEach(({v:r,i:o,n:a})=>{if(!Ci(r))return;const{isMatch:l,score:c,indices:u}=n.searchIn(r);l&&s.push({item:r,idx:o,matches:[{score:c,value:r,norm:a,indices:u}]})}),s}_searchLogical(e){const n=CT(e,this.options),i=(a,l,c)=>{if(!a.children){const{keyId:d,searcher:h}=a,f=this._findMatches({key:this._keyStore.get(d),value:this._myIndex.getValueForItemAtKeyId(l,d),searcher:h});return f&&f.length?[{idx:c,item:l,matches:f}]:[]}const u=[];for(let d=0,h=a.children.length;d{if(Ci(a)){let c=i(n,a,l);c.length&&(r[l]||(r[l]={idx:l,item:a,matches:[]},o.push(r[l])),c.forEach(({matches:u})=>{r[l].matches.push(...u)}))}}),o}_searchObjectList(e){const n=mm(e,this.options),{keys:i,records:s}=this._myIndex,r=[];return s.forEach(({$:o,i:a})=>{if(!Ci(o))return;let l=[];i.forEach((c,u)=>{l.push(...this._findMatches({key:c,value:o[u],searcher:n}))}),l.length&&r.push({idx:a,item:o,matches:l})}),r}_findMatches({key:e,value:n,searcher:i}){if(!Ci(n))return[];let s=[];if(mr(n))n.forEach(({v:r,i:o,n:a})=>{if(!Ci(r))return;const{isMatch:l,score:c,indices:u}=i.searchIn(r);l&&s.push({score:c,key:e,value:r,idx:o,norm:a,indices:u})});else{const{v:r,n:o}=n,{isMatch:a,score:l,indices:c}=i.searchIn(r);a&&s.push({score:l,key:e,value:r,norm:o,indices:c})}return s}}Gl.version="7.0.0";Gl.createIndex=wT;Gl.parseIndex=l7;Gl.config=Je;Gl.parseQuery=CT;E7(x7);const I7={name:"peerSettings",components:{LocaleText:Qe},props:{selectedPeer:Object},data(){return{data:void 0,dataChanged:!1,showKey:!1,saving:!1}},setup(){return{dashboardConfigurationStore:st()}},methods:{reset(){this.selectedPeer&&(this.data=JSON.parse(JSON.stringify(this.selectedPeer)),this.dataChanged=!1)},savePeer(){this.saving=!0,kt(`/api/updatePeerSettings/${this.$route.params.id}`,this.data,t=>{this.saving=!1,t.status?this.dashboardConfigurationStore.newMessage("Server","Peer saved","success"):this.dashboardConfigurationStore.newMessage("Server",t.message,"danger"),this.$emit("refresh")})},resetPeerData(t){this.saving=!0,kt(`/api/resetPeerData/${this.$route.params.id}`,{id:this.data.id,type:t},e=>{this.saving=!1,e.status?this.dashboardConfigurationStore.newMessage("Server","Peer data usage reset successfully","success"):this.dashboardConfigurationStore.newMessage("Server",e.message,"danger"),this.$emit("refresh")})}},beforeMount(){this.reset()},mounted(){this.$el.querySelectorAll("input").forEach(t=>{t.addEventListener("keyup",()=>{this.dataChanged=!0})})}},Xl=t=>(bn("data-v-2c571abb"),t=t(),wn(),t),P7={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},R7={class:"container d-flex h-100 w-100"},D7={class:"m-auto modal-dialog-centered dashboardModal"},$7={class:"card rounded-3 shadow flex-grow-1"},L7={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},O7={class:"mb-0"},N7={key:0,class:"card-body px-4 pb-4"},F7={class:"d-flex flex-column gap-2 mb-4"},B7={class:"d-flex align-items-center"},V7={class:"text-muted"},z7={class:"ms-auto"},W7={for:"peer_name_textbox",class:"form-label"},H7={class:"text-muted"},Y7=["disabled"],j7={class:"d-flex position-relative"},K7={for:"peer_private_key_textbox",class:"form-label"},U7={class:"text-muted"},G7=["type","disabled"],X7={for:"peer_allowed_ip_textbox",class:"form-label"},q7={class:"text-muted"},Z7=["disabled"],J7={for:"peer_endpoint_allowed_ips",class:"form-label"},Q7={class:"text-muted"},eX=["disabled"],tX={for:"peer_DNS_textbox",class:"form-label"},nX={class:"text-muted"},iX=["disabled"],sX={class:"accordion mt-3",id:"peerSettingsAccordion"},rX={class:"accordion-item"},oX={class:"accordion-header"},aX={class:"accordion-button rounded-3 collapsed",type:"button","data-bs-toggle":"collapse","data-bs-target":"#peerSettingsAccordionOptional"},lX={id:"peerSettingsAccordionOptional",class:"accordion-collapse collapse","data-bs-parent":"#peerSettingsAccordion"},cX={class:"accordion-body d-flex flex-column gap-2 mb-2"},uX={for:"peer_preshared_key_textbox",class:"form-label"},dX={class:"text-muted"},hX=["disabled"],fX={for:"peer_mtu",class:"form-label"},gX={class:"text-muted"},pX=["disabled"],mX={for:"peer_keep_alive",class:"form-label"},_X={class:"text-muted"},yX=["disabled"],vX=Xl(()=>g("hr",null,null,-1)),bX={class:"d-flex gap-2 align-items-center"},wX={class:"d-flex gap-2 ms-auto"},xX=Xl(()=>g("i",{class:"bi bi-arrow-down-up me-2"},null,-1)),EX=Xl(()=>g("i",{class:"bi bi-arrow-down me-2"},null,-1)),SX=Xl(()=>g("i",{class:"bi bi-arrow-up me-2"},null,-1)),CX={class:"d-flex align-items-center gap-2"},TX=["disabled"],kX=Xl(()=>g("i",{class:"bi bi-arrow-clockwise ms-2"},null,-1)),AX=["disabled"],MX=Xl(()=>g("i",{class:"bi bi-save-fill ms-2"},null,-1));function IX(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",P7,[g("div",R7,[g("div",D7,[g("div",$7,[g("div",L7,[g("h4",O7,[B(o,{t:"Peer Settings"})]),g("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=a=>this.$emit("close"))})]),this.data?(D(),V("div",N7,[g("div",F7,[g("div",B7,[g("small",V7,[B(o,{t:"Public Key"})]),g("small",z7,[g("samp",null,Ee(this.data.id),1)])]),g("div",null,[g("label",W7,[g("small",H7,[B(o,{t:"Name"})])]),Ne(g("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":e[1]||(e[1]=a=>this.data.name=a),id:"peer_name_textbox",placeholder:""},null,8,Y7),[[Ke,this.data.name]])]),g("div",null,[g("div",j7,[g("label",K7,[g("small",U7,[B(o,{t:"Private Key"}),g("code",null,[B(o,{t:"(Required for QR Code and Download)"})])])]),g("a",{role:"button",class:"ms-auto text-decoration-none toggleShowKey",onClick:e[2]||(e[2]=a=>this.showKey=!this.showKey)},[g("i",{class:Ie(["bi",[this.showKey?"bi-eye-slash-fill":"bi-eye-fill"]])},null,2)])]),Ne(g("input",{type:[this.showKey?"text":"password"],class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":e[3]||(e[3]=a=>this.data.private_key=a),id:"peer_private_key_textbox",style:{"padding-right":"40px"}},null,8,G7),[[QE,this.data.private_key]])]),g("div",null,[g("label",X7,[g("small",q7,[B(o,{t:"Allowed IPs"}),g("code",null,[B(o,{t:"(Required)"})])])]),Ne(g("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":e[4]||(e[4]=a=>this.data.allowed_ip=a),id:"peer_allowed_ip_textbox"},null,8,Z7),[[Ke,this.data.allowed_ip]])]),g("div",null,[g("label",J7,[g("small",Q7,[B(o,{t:"Endpoint Allowed IPs"}),g("code",null,[B(o,{t:"(Required)"})])])]),Ne(g("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":e[5]||(e[5]=a=>this.data.endpoint_allowed_ip=a),id:"peer_endpoint_allowed_ips"},null,8,eX),[[Ke,this.data.endpoint_allowed_ip]])]),g("div",null,[g("label",tX,[g("small",nX,[B(o,{t:"DNS"})])]),Ne(g("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":e[6]||(e[6]=a=>this.data.DNS=a),id:"peer_DNS_textbox"},null,8,iX),[[Ke,this.data.DNS]])]),g("div",sX,[g("div",rX,[g("h2",oX,[g("button",aX,[B(o,{t:"Optional Settings"})])]),g("div",lX,[g("div",cX,[g("div",null,[g("label",uX,[g("small",dX,[B(o,{t:"Pre-Shared Key"})])]),Ne(g("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":e[7]||(e[7]=a=>this.data.preshared_key=a),id:"peer_preshared_key_textbox"},null,8,hX),[[Ke,this.data.preshared_key]])]),g("div",null,[g("label",fX,[g("small",gX,[B(o,{t:"MTU"})])]),Ne(g("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":e[8]||(e[8]=a=>this.data.mtu=a),id:"peer_mtu"},null,8,pX),[[Ke,this.data.mtu]])]),g("div",null,[g("label",mX,[g("small",_X,[B(o,{t:"Persistent Keepalive"})])]),Ne(g("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":e[9]||(e[9]=a=>this.data.keepalive=a),id:"peer_keep_alive"},null,8,yX),[[Ke,this.data.keepalive]])])])])])]),vX,g("div",bX,[g("strong",null,[B(o,{t:"Reset Data Usage"})]),g("div",wX,[g("button",{class:"btn bg-primary-subtle text-primary-emphasis rounded-3 flex-grow-1 shadow-sm",onClick:e[10]||(e[10]=a=>this.resetPeerData("total"))},[xX,B(o,{t:"Total"})]),g("button",{class:"btn bg-primary-subtle text-primary-emphasis rounded-3 flex-grow-1 shadow-sm",onClick:e[11]||(e[11]=a=>this.resetPeerData("receive"))},[EX,B(o,{t:"Received"})]),g("button",{class:"btn bg-primary-subtle text-primary-emphasis rounded-3 flex-grow-1 shadow-sm",onClick:e[12]||(e[12]=a=>this.resetPeerData("sent"))},[SX,B(o,{t:"Sent"})])])])]),g("div",CX,[g("button",{class:"btn btn-secondary rounded-3 shadow",onClick:e[13]||(e[13]=a=>this.reset()),disabled:!this.dataChanged||this.saving},[B(o,{t:"Revert"}),kX],8,TX),g("button",{class:"ms-auto btn btn-dark btn-brand rounded-3 px-3 py-2 shadow",disabled:!this.dataChanged||this.saving,onClick:e[14]||(e[14]=a=>this.savePeer())},[B(o,{t:"Save Peer"}),MX],8,AX)])])):ce("",!0)])])])])}const PX=Ye(I7,[["render",IX],["__scopeId","data-v-2c571abb"]]);var va={},RX=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},TT={},Pi={};let uy;const DX=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];Pi.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};Pi.getSymbolTotalCodewords=function(e){return DX[e]};Pi.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};Pi.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');uy=e};Pi.isKanjiModeEnabled=function(){return typeof uy<"u"};Pi.toSJIS=function(e){return uy(e)};var Mf={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+n)}}t.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},t.from=function(i,s){if(t.isValid(i))return i;try{return e(i)}catch{return s}}})(Mf);function kT(){this.buffer=[],this.length=0}kT.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let n=0;n>>e-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var $X=kT;function Yu(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}Yu.prototype.set=function(t,e,n,i){const s=t*this.size+e;this.data[s]=n,i&&(this.reservedBit[s]=!0)};Yu.prototype.get=function(t,e){return this.data[t*this.size+e]};Yu.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n};Yu.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var LX=Yu,AT={};(function(t){const e=Pi.getSymbolSize;t.getRowColCoords=function(i){if(i===1)return[];const s=Math.floor(i/7)+2,r=e(i),o=r===145?26:Math.ceil((r-13)/(2*s-2))*2,a=[r-7];for(let l=1;l=0&&s<=7},t.from=function(s){return t.isValid(s)?parseInt(s,10):void 0},t.getPenaltyN1=function(s){const r=s.size;let o=0,a=0,l=0,c=null,u=null;for(let d=0;d=5&&(o+=e.N1+(a-5)),c=f,a=1),f=s.get(h,d),f===u?l++:(l>=5&&(o+=e.N1+(l-5)),u=f,l=1)}a>=5&&(o+=e.N1+(a-5)),l>=5&&(o+=e.N1+(l-5))}return o},t.getPenaltyN2=function(s){const r=s.size;let o=0;for(let a=0;a=10&&(a===1488||a===93)&&o++,l=l<<1&2047|s.get(u,c),u>=10&&(l===1488||l===93)&&o++}return o*e.N3},t.getPenaltyN4=function(s){let r=0;const o=s.data.length;for(let l=0;l=0;){const o=r[0];for(let l=0;l0){const r=new Uint8Array(this.degree);return r.set(i,s),r}return i};var NX=dy,DT={},wo={},hy={};hy.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var Bs={};const $T="[0-9]+",FX="[A-Z $%*+\\-./:]+";let pu="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";pu=pu.replace(/u/g,"\\u");const BX="(?:(?![A-Z0-9 $%*+\\-./:]|"+pu+`)(?:.|[\r -]))+`;Bs.KANJI=new RegExp(pu,"g");Bs.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Bs.BYTE=new RegExp(BX,"g");Bs.NUMERIC=new RegExp($T,"g");Bs.ALPHANUMERIC=new RegExp(FX,"g");const VX=new RegExp("^"+pu+"$"),zX=new RegExp("^"+$T+"$"),WX=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Bs.testKanji=function(e){return VX.test(e)};Bs.testNumeric=function(e){return zX.test(e)};Bs.testAlphanumeric=function(e){return WX.test(e)};(function(t){const e=hy,n=Bs;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(r,o){if(!r.ccBits)throw new Error("Invalid mode: "+r);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?r.ccBits[0]:o<27?r.ccBits[1]:r.ccBits[2]},t.getBestModeForData=function(r){return n.testNumeric(r)?t.NUMERIC:n.testAlphanumeric(r)?t.ALPHANUMERIC:n.testKanji(r)?t.KANJI:t.BYTE},t.toString=function(r){if(r&&r.id)return r.id;throw new Error("Invalid mode")},t.isValid=function(r){return r&&r.bit&&r.ccBits};function i(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+s)}}t.from=function(r,o){if(t.isValid(r))return r;try{return i(r)}catch{return o}}})(wo);(function(t){const e=Pi,n=If,i=Mf,s=wo,r=hy,o=7973,a=e.getBCHDigit(o);function l(h,f,p){for(let m=1;m<=40;m++)if(f<=t.getCapacity(m,p,h))return m}function c(h,f){return s.getCharCountIndicator(h,f)+4}function u(h,f){let p=0;return h.forEach(function(m){const y=c(m.mode,f);p+=y+m.getBitsLength()}),p}function d(h,f){for(let p=1;p<=40;p++)if(u(h,p)<=t.getCapacity(p,f,s.MIXED))return p}t.from=function(f,p){return r.isValid(f)?parseInt(f,10):p},t.getCapacity=function(f,p,m){if(!r.isValid(f))throw new Error("Invalid QR Code version");typeof m>"u"&&(m=s.BYTE);const y=e.getSymbolTotalCodewords(f),v=n.getTotalCodewordsCount(f,p),b=(y-v)*8;if(m===s.MIXED)return b;const E=b-c(m,f);switch(m){case s.NUMERIC:return Math.floor(E/10*3);case s.ALPHANUMERIC:return Math.floor(E/11*2);case s.KANJI:return Math.floor(E/13);case s.BYTE:default:return Math.floor(E/8)}},t.getBestVersionForData=function(f,p){let m;const y=i.from(p,i.M);if(Array.isArray(f)){if(f.length>1)return d(f,y);if(f.length===0)return 1;m=f[0]}else m=f;return l(m.mode,m.getLength(),y)},t.getEncodedBits=function(f){if(!r.isValid(f)||f<7)throw new Error("Invalid QR Code version");let p=f<<12;for(;e.getBCHDigit(p)-a>=0;)p^=o<=0;)s^=OT<0&&(i=this.data.substr(n),s=parseInt(i,10),e.put(s,r*3+1))};var jX=Pl;const KX=wo,ip=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Rl(t){this.mode=KX.ALPHANUMERIC,this.data=t}Rl.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};Rl.prototype.getLength=function(){return this.data.length};Rl.prototype.getBitsLength=function(){return Rl.getBitsLength(this.data.length)};Rl.prototype.write=function(e){let n;for(n=0;n+2<=this.data.length;n+=2){let i=ip.indexOf(this.data[n])*45;i+=ip.indexOf(this.data[n+1]),e.put(i,11)}this.data.length%2&&e.put(ip.indexOf(this.data[n]),6)};var UX=Rl,GX=function(e){for(var n=[],i=e.length,s=0;s=55296&&r<=56319&&i>s+1){var o=e.charCodeAt(s+1);o>=56320&&o<=57343&&(r=(r-55296)*1024+o-56320+65536,s+=1)}if(r<128){n.push(r);continue}if(r<2048){n.push(r>>6|192),n.push(r&63|128);continue}if(r<55296||r>=57344&&r<65536){n.push(r>>12|224),n.push(r>>6&63|128),n.push(r&63|128);continue}if(r>=65536&&r<=1114111){n.push(r>>18|240),n.push(r>>12&63|128),n.push(r>>6&63|128),n.push(r&63|128);continue}n.push(239,191,189)}return new Uint8Array(n).buffer};const XX=GX,qX=wo;function Dl(t){this.mode=qX.BYTE,typeof t=="string"&&(t=XX(t)),this.data=new Uint8Array(t)}Dl.getBitsLength=function(e){return e*8};Dl.prototype.getLength=function(){return this.data.length};Dl.prototype.getBitsLength=function(){return Dl.getBitsLength(this.data.length)};Dl.prototype.write=function(t){for(let e=0,n=this.data.length;e=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+` -Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),t.put(n,13)}};var e9=$l,FT={exports:{}};(function(t){var e={single_source_shortest_paths:function(n,i,s){var r={},o={};o[i]=0;var a=e.PriorityQueue.make();a.push(i,0);for(var l,c,u,d,h,f,p,m,y;!a.empty();){l=a.pop(),c=l.value,d=l.cost,h=n[c]||{};for(u in h)h.hasOwnProperty(u)&&(f=h[u],p=d+f,m=o[u],y=typeof o[u]>"u",(y||m>p)&&(o[u]=p,a.push(u,p),r[u]=c))}if(typeof s<"u"&&typeof o[s]>"u"){var v=["Could not find a path from ",i," to ",s,"."].join("");throw new Error(v)}return r},extract_shortest_path_from_predecessor_list:function(n,i){for(var s=[],r=i;r;)s.push(r),n[r],r=n[r];return s.reverse(),s},find_path:function(n,i,s){var r=e.single_source_shortest_paths(n,i,s);return e.extract_shortest_path_from_predecessor_list(r,s)},PriorityQueue:{make:function(n){var i=e.PriorityQueue,s={},r;n=n||{};for(r in i)i.hasOwnProperty(r)&&(s[r]=i[r]);return s.queue=[],s.sorter=n.sorter||i.default_sorter,s},default_sorter:function(n,i){return n.cost-i.cost},push:function(n,i){var s={value:n,cost:i};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(FT);var t9=FT.exports;(function(t){const e=wo,n=jX,i=UX,s=ZX,r=e9,o=Bs,a=Pi,l=t9;function c(v){return unescape(encodeURIComponent(v)).length}function u(v,b,E){const C=[];let w;for(;(w=v.exec(E))!==null;)C.push({data:w[0],index:w.index,mode:b,length:w[0].length});return C}function d(v){const b=u(o.NUMERIC,e.NUMERIC,v),E=u(o.ALPHANUMERIC,e.ALPHANUMERIC,v);let C,w;return a.isKanjiModeEnabled()?(C=u(o.BYTE,e.BYTE,v),w=u(o.KANJI,e.KANJI,v)):(C=u(o.BYTE_KANJI,e.BYTE,v),w=[]),b.concat(E,C,w).sort(function(T,k){return T.index-k.index}).map(function(T){return{data:T.data,mode:T.mode,length:T.length}})}function h(v,b){switch(b){case e.NUMERIC:return n.getBitsLength(v);case e.ALPHANUMERIC:return i.getBitsLength(v);case e.KANJI:return r.getBitsLength(v);case e.BYTE:return s.getBitsLength(v)}}function f(v){return v.reduce(function(b,E){const C=b.length-1>=0?b[b.length-1]:null;return C&&C.mode===E.mode?(b[b.length-1].data+=E.data,b):(b.push(E),b)},[])}function p(v){const b=[];for(let E=0;E=0&&a<=6&&(l===0||l===6)||l>=0&&l<=6&&(a===0||a===6)||a>=2&&a<=4&&l>=2&&l<=4?t.set(r+a,o+l,!0,!0):t.set(r+a,o+l,!1,!0))}}function u9(t){const e=t.size;for(let n=8;n>a&1)===1,t.set(s,r,o,!0),t.set(r,s,o,!0)}function op(t,e,n){const i=t.size,s=a9.getEncodedBits(e,n);let r,o;for(r=0;r<15;r++)o=(s>>r&1)===1,r<6?t.set(r,8,o,!0):r<8?t.set(r+1,8,o,!0):t.set(i-15+r,8,o,!0),r<8?t.set(8,i-r-1,o,!0):r<9?t.set(8,15-r-1+1,o,!0):t.set(8,15-r-1,o,!0);t.set(i-8,8,1,!0)}function f9(t,e){const n=t.size;let i=-1,s=n-1,r=7,o=0;for(let a=n-1;a>0;a-=2)for(a===6&&a--;;){for(let l=0;l<2;l++)if(!t.isReserved(s,a-l)){let c=!1;o>>r&1)===1),t.set(s,a-l,c),r--,r===-1&&(o++,r=7)}if(s+=i,s<0||n<=s){s-=i,i=-i;break}}}function g9(t,e,n){const i=new n9;n.forEach(function(l){i.put(l.mode.bit,4),i.put(l.getLength(),l9.getCharCountIndicator(l.mode,t)),l.write(i)});const s=Rf.getSymbolTotalCodewords(t),r=wm.getTotalCodewordsCount(t,e),o=(s-r)*8;for(i.getLengthInBits()+4<=o&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);const a=(o-i.getLengthInBits())/8;for(let l=0;lC+w.before.length+w.lines.length+w.after.length,0);if(v+=t.beforeBody.length+t.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),v){const C=e.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*C+(v-f)*l.lineHeight+(v-1)*e.bodySpacing}h&&(m+=e.footerMarginTop+h*u.lineHeight+(h-1)*e.footerSpacing);let b=0;const E=function(C){y=Math.max(y,n.measureText(C).width+b)};return n.save(),n.font=c.string,Ct(t.title,E),n.font=l.string,Ct(t.beforeBody.concat(t.afterBody),E),b=e.displayColors?o+2+e.boxPadding:0,Ct(i,C=>{Ct(C.before,E),Ct(C.lines,E),Ct(C.after,E)}),b=0,n.font=u.string,Ct(t.footer,E),n.restore(),y+=p.width,{width:y,height:m}}function SG(t,e){const{y:n,height:i}=e;return nt.height-i/2?"bottom":"center"}function CG(t,e,n,i){const{x:s,width:r}=i,o=n.caretSize+n.caretPadding;if(t==="left"&&s+r+o>e.width||t==="right"&&s-r-o<0)return!0}function TG(t,e,n,i){const{x:s,width:r}=n,{width:o,chartArea:{left:a,right:l}}=t;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),CG(c,t,e,n)&&(c="center"),c}function B1(t,e,n){const i=n.yAlign||e.yAlign||SG(t,n);return{xAlign:n.xAlign||e.xAlign||TG(t,e,n,i),yAlign:i}}function kG(t,e){let{x:n,width:i}=t;return e==="right"?n-=i:e==="center"&&(n-=i/2),n}function AG(t,e,n){let{y:i,height:s}=t;return e==="top"?i+=n:e==="bottom"?i-=s+n:i-=s/2,i}function V1(t,e,n,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=t,{xAlign:a,yAlign:l}=n,c=s+r,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:f}=ia(o);let p=kG(e,a);const m=AG(e,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+s:a==="right"&&(p+=Math.max(d,f)+s),{x:Pn(p,0,i.width-e.width),y:Pn(m,0,i.height-e.height)}}function $d(t,e,n){const i=Kn(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-i.right:t.x+i.left}function z1(t){return ys([],qs(t))}function MG(t,e,n){return yo(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function W1(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const dT={beforeTitle:js,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex"u"?dT[e].call(n,i):s}class H1 extends vr{static positioners=Sc;constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,r=new WC(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=MG(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:i}=n,s=ai(i,"beforeTitle",this,e),r=ai(i,"title",this,e),o=ai(i,"afterTitle",this,e);let a=[];return a=ys(a,qs(s)),a=ys(a,qs(r)),a=ys(a,qs(o)),a}getBeforeBody(e,n){return z1(ai(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:i}=n,s=[];return Ct(e,r=>{const o={before:[],lines:[],after:[]},a=W1(i,r);ys(o.before,qs(ai(a,"beforeLabel",this,r))),ys(o.lines,ai(a,"label",this,r)),ys(o.after,qs(ai(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(e,n){return z1(ai(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:i}=n,s=ai(i,"beforeFooter",this,e),r=ai(i,"footer",this,e),o=ai(i,"afterFooter",this,e);let a=[];return a=ys(a,qs(s)),a=ys(a,qs(r)),a=ys(a,qs(o)),a}_createItems(e){const n=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=n.length;le.filter(u,d,h,i))),e.itemSort&&(a=a.sort((u,d)=>e.itemSort(u,d,i))),Ct(a,u=>{const d=W1(e.callbacks,u);s.push(ai(d,"labelColor",this,u)),r.push(ai(d,"labelPointStyle",this,u)),o.push(ai(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(e,n){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=Sc[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=F1(this,i),c=Object.assign({},a,l),u=B1(this.chart,i,c),d=V1(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,i,s){const r=this.getCaretPosition(e,i,s);n.lineTo(r.x1,r.y1),n.lineTo(r.x2,r.y2),n.lineTo(r.x3,r.y3)}getCaretPosition(e,n,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=ia(a),{x:h,y:f}=e,{width:p,height:m}=n;let y,v,b,E,C,w;return r==="center"?(C=f+m/2,s==="left"?(y=h,v=y-o,E=C+o,w=C-o):(y=h+p,v=y+o,E=C-o,w=C+o),b=y):(s==="left"?v=h+Math.max(l,u)+o:s==="right"?v=h+p-Math.max(c,d)-o:v=this.caretX,r==="top"?(E=f,C=E-o,y=v-o,b=v+o):(E=f+m,C=E+o,y=v+o,b=v-o),w=E),{x1:y,x2:v,x3:b,y1:E,y2:C,y3:w}}drawTitle(e,n,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=ol(i.rtl,this.x,this.width);for(e.x=$d(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",o=vn(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=o.string,l=0;lb!==0)?(e.beginPath(),e.fillStyle=r.multiKeyBackground,hu(e,{x:m,y:p,w:c,h:l,radius:v}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),hu(e,{x:y,y:p+1,w:c-2,h:l-2,radius:v}),e.fill()):(e.fillStyle=r.multiKeyBackground,e.fillRect(m,p,c,l),e.strokeRect(m,p,c,l),e.fillStyle=o.backgroundColor,e.fillRect(y,p+1,c-2,l-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,n,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=vn(i.bodyFont);let h=d.lineHeight,f=0;const p=ol(i.rtl,this.x,this.width),m=function(k){n.fillText(k,p.x(e.x+f),e.y+h/2),e.y+=h+r},y=p.textAlign(o);let v,b,E,C,w,x,T;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,e.x=$d(this,y,i),n.fillStyle=i.bodyColor,Ct(this.beforeBody,m),f=a&&y!=="right"?o==="center"?c/2+u:c+2+u:0,C=0,x=s.length;C0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=Sc[e.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=F1(this,e),l=Object.assign({},o,this._size),c=B1(n,e,l),u=V1(e,l,c,n);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Kn(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(e.save(),e.globalAlpha=i,this.drawBackground(r,e,s,n),NC(e,n.textDirection),r.y+=o.top,this.drawTitle(r,e,n),this.drawBody(r,e,n),this.drawFooter(r,e,n),FC(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const i=this._active,s=e.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!wh(i,s),o=this._positionChanged(s,n);(r||o)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(e,r,n,i),a=this._positionChanged(o,e),l=n||!wh(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),l}_getActiveElements(e,n,i,s){const r=this.options;if(e.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(e,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(e,n){const{caretX:i,caretY:s,options:r}=this,o=Sc[r.position].call(this,e,n);return o!==!1&&(i!==o.x||s!==o.y)}}var IG={id:"tooltip",_element:H1,positioners:Sc,afterInit(t,e,n){n&&(t.tooltip=new H1({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:dT},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const PG=(t,e,n,i)=>(typeof e=="string"?(n=t.push(e)-1,i.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function RG(t,e,n,i){const s=t.indexOf(e);if(s===-1)return PG(t,e,n,i);const r=t.lastIndexOf(e);return s!==r?n:s}const DG=(t,e)=>t===null?null:Pn(Math.round(t),0,e);function Y1(t){const e=this.getLabels();return t>=0&&tn.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}function LG(t,e){const n=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=t,f=r||1,p=u-1,{min:m,max:y}=e,v=!gt(o),b=!gt(a),E=!gt(c),C=(y-m)/(d+1);let w=Bb((y-m)/p/f)*f,x,T,k,A;if(w<1e-14&&!v&&!b)return[{value:m},{value:y}];A=Math.ceil(y/w)-Math.floor(m/w),A>p&&(w=Bb(A*w/p/f)*f),gt(l)||(x=Math.pow(10,l),w=Math.ceil(w*x)/x),s==="ticks"?(T=Math.floor(m/w)*w,k=Math.ceil(y/w)*w):(T=m,k=y),v&&b&&r&&IY((a-o)/r,w/1e3)?(A=Math.round(Math.min((a-o)/w,u)),w=(a-o)/A,T=o,k=a):E?(T=v?o:T,k=b?a:k,A=c-1,w=(k-T)/A):(A=(k-T)/w,Yc(A,Math.round(A),w/1e3)?A=Math.round(A):A=Math.ceil(A));const P=Math.max(Vb(w),Vb(T));x=Math.pow(10,gt(l)?P:l),T=Math.round(T*x)/x,k=Math.round(k*x)/x;let F=0;for(v&&(h&&T!==o?(n.push({value:o}),Ta)break;n.push({value:H})}return b&&h&&k!==a?n.length&&Yc(n[n.length-1].value,a,j1(a,C,t))?n[n.length-1].value=a:n.push({value:a}):(!b||k===a)&&n.push({value:k}),n}function j1(t,e,{horizontal:n,minRotation:i}){const s=as(i),r=(n?Math.sin(s):Math.cos(s))||.001,o=.75*e*(""+t).length;return Math.min(e/r,o)}class Ah extends ya{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return gt(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=n?s:l,a=l=>r=i?r:l;if(e){const l=Ds(s),c=Ds(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);a(r+l),e||o(s-l)}this.min=s,this.max=r}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=e,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},r=this._range||this,o=LG(s,r);return e.bounds==="ticks"&&bC(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const s=(i-n)/Math.max(e.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(e){return Wu(e,this.chart.options.locale,this.options.ticks.format)}}class OG extends Ah{static id="linear";static defaults={ticks:{callback:xf.formatters.numeric}};determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=qt(e)?e:0,this.max=qt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,i=as(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,r.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}const gu=t=>Math.floor(Kr(t)),Oo=(t,e)=>Math.pow(10,gu(t)+e);function K1(t){return t/Math.pow(10,gu(t))===1}function U1(t,e,n){const i=Math.pow(10,n),s=Math.floor(t/i);return Math.ceil(e/i)-s}function NG(t,e){const n=e-t;let i=gu(n);for(;U1(t,e,i)>10;)i++;for(;U1(t,e,i)<10;)i--;return Math.min(i,gu(t))}function FG(t,{min:e,max:n}){e=xi(t.min,e);const i=[],s=gu(e);let r=NG(e,n),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((e-l)*o)/o,u=Math.floor((e-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,r)),h=xi(t.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;h=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),h=Math.round((l+u+d*Math.pow(10,r))*o)/o;const f=xi(t.max,h);return i.push({value:f,major:K1(f),significand:d}),i}class BG extends ya{static id="logarithmic";static defaults={ticks:{callback:xf.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,n){const i=Ah.prototype.parse.apply(this,[e,n]);if(i===0){this._zero=!0;return}return qt(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=qt(e)?Math.max(0,e):null,this.max=qt(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!qt(this._userMin)&&(this.min=e===Oo(this.min,0)?Oo(this.min,-1):Oo(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const r=a=>i=e?i:a,o=a=>s=n?s:a;i===s&&(i<=0?(r(1),o(10)):(r(Oo(i,-1)),o(Oo(s,1)))),i<=0&&r(Oo(s,-1)),s<=0&&o(Oo(i,1)),this.min=i,this.max=s}buildTicks(){const e=this.options,n={min:this._userMin,max:this._userMax},i=FG(n,this);return e.bounds==="ticks"&&bC(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":Wu(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Kr(e),this._valueRange=Kr(this.max)-Kr(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Kr(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}function dm(t){const e=t.ticks;if(e.display&&t.display){const n=Kn(e.backdropPadding);return tt(e.font&&e.font.size,Zt.font.size)+n.height}return 0}function VG(t,e,n){return n=Nt(n)?n:[n],{w:UY(t,e.string,n),h:n.length*e.lineHeight}}function G1(t,e,n,i,s){return t===i||t===s?{start:e-n/2,end:e+n/2}:ts?{start:e-n,end:e}:{start:e,end:e+n}}function zG(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),i=[],s=[],r=t._pointLabels.length,o=t.options.pointLabels,a=o.centerPointLabels?Bt/r:0;for(let l=0;le.r&&(a=(i.end-e.r)/r,t.r=Math.max(t.r,e.r+a)),s.starte.b&&(l=(s.end-e.b)/o,t.b=Math.max(t.b,e.b+l))}function HG(t,e,n){const i=t.drawingArea,{extra:s,additionalAngle:r,padding:o,size:a}=n,l=t.getPointPosition(e,i+s+o,r),c=Math.round(Z_(Si(l.angle+on))),u=GG(l.y,a.h,c),d=KG(c),h=UG(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+a.w,bottom:u+a.h}}function YG(t,e){if(!e)return!0;const{left:n,top:i,right:s,bottom:r}=t;return!(ar({x:n,y:i},e)||ar({x:n,y:r},e)||ar({x:s,y:i},e)||ar({x:s,y:r},e))}function jG(t,e,n){const i=[],s=t._pointLabels.length,r=t.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:dm(r)/2,additionalAngle:o?Bt/s:0};let c;for(let u=0;u270||n<90)&&(t-=e),t}function XG(t,e,n){const{left:i,top:s,right:r,bottom:o}=n,{backdropColor:a}=e;if(!gt(a)){const l=ia(e.borderRadius),c=Kn(e.backdropPadding);t.fillStyle=a;const u=i-c.left,d=s-c.top,h=r-i+c.width,f=o-s+c.height;Object.values(l).some(p=>p!==0)?(t.beginPath(),hu(t,{x:u,y:d,w:h,h:f,radius:l}),t.fill()):t.fillRect(u,d,h,f)}}function qG(t,e){const{ctx:n,options:{pointLabels:i}}=t;for(let s=e-1;s>=0;s--){const r=t._pointLabelItems[s];if(!r.visible)continue;const o=i.setContext(t.getPointLabelContext(s));XG(n,o,r);const a=vn(o.font),{x:l,y:c,textAlign:u}=r;ua(n,t._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function hT(t,e,n,i){const{ctx:s}=t;if(n)s.arc(t.xCenter,t.yCenter,e,0,Ft);else{let r=t.getPointPosition(0,e);s.moveTo(r.x,r.y);for(let o=1;o{const s=Pt(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?zG(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,n,i,s){this.xCenter+=Math.floor((e-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,n,i,s))}getIndexAngle(e){const n=Ft/(this._pointLabels.length||1),i=this.options.startAngle||0;return Si(e*n+as(i))}getDistanceFromCenterForValue(e){if(gt(e))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*n:(e-this.min)*n}getValueForDistanceFromCenter(e){if(gt(e))return NaN;const n=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(e){const n=this._pointLabels||[];if(e>=0&&e{if(d!==0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),f=s.setContext(h),p=r.setContext(h);ZG(this,f,l,o,p)}}),i.display){for(e.save(),a=o-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:h}=u;!h||!d||(e.lineWidth=h,e.strokeStyle=d,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!n.reverse)return;const c=i.setContext(this.getContext(l)),u=vn(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){e.font=u.string,o=e.measureText(a.label).width,e.fillStyle=c.backdropColor;const d=Kn(c.backdropPadding);e.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}ua(e,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),e.restore()}drawTitle(){}}const Af={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},hi=Object.keys(Af);function X1(t,e){return t-e}function q1(t,e){if(gt(e))return null;const n=t._adapter,{parser:i,round:s,isoWeekday:r}=t._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),qt(o)||(o=typeof i=="string"?n.parse(o,i):n.parse(o)),o===null?null:(s&&(o=s==="week"&&(Al(r)||r===!0)?n.startOf(o,"isoWeek",r):n.startOf(o,s)),+o)}function Z1(t,e,n,i){const s=hi.length;for(let r=hi.indexOf(t);r=hi.indexOf(n);r--){const o=hi[r];if(Af[o].common&&t._adapter.diff(s,i,o)>=e-1)return o}return hi[n?hi.indexOf(n):0]}function t7(t){for(let e=hi.indexOf(t)+1,n=hi.length;e=e?n[i]:n[s];t[r]=!0}}function n7(t,e,n,i){const s=t._adapter,r=+s.startOf(e[0].value,i),o=e[e.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=n[a],l>=0&&(e[l].major=!0);return e}function Q1(t,e,n){const i=[],s={},r=e.length;let o,a;for(o=0;o+e.value))}initOffsets(e=[]){let n=0,i=0,s,r;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?n=1-s:n=(this.getDecimalForValue(e[1])-s)/2,r=this.getDecimalForValue(e[e.length-1]),e.length===1?i=r:i=(r-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;n=Pn(n,0,o),i=Pn(i,0,o),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const e=this._adapter,n=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||Z1(r.minUnit,n,i,this._getLabelCapacity(n)),a=tt(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=Al(l)||l===!0,u={};let d=n,h,f;if(c&&(d=+e.startOf(d,"isoWeek",l)),d=+e.startOf(d,c?"day":o),e.diff(i,n,o)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+o);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=d,f=0;h+m)}getLabelForValue(e){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(e,i.tooltipFormat):n.format(e,i.displayFormats.datetime)}format(e,n){const s=this.options.time.displayFormats,r=this._unit,o=n||s[r];return this._adapter.format(e,o)}_tickFormatFunction(e,n,i,s){const r=this.options,o=r.ticks.callback;if(o)return Pt(o,[e,n,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=i[n],f=c&&d&&h&&h.major;return this._adapter.format(e,s||(f?d:u))}generateTickLabels(e){let n,i,s;for(n=0,i=e.length;n0?a:1}getDataTimestamps(){let e=this._cache.data||[],n,i;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n=t[i].pos&&e<=t[s].pos&&({lo:i,hi:s}=or(t,"pos",e)),{pos:r,time:a}=t[i],{pos:o,time:l}=t[s]):(e>=t[i].time&&e<=t[s].time&&({lo:i,hi:s}=or(t,"time",e)),{time:r,pos:a}=t[i],{time:o,pos:l}=t[s]);const c=o-r;return c?a+(l-a)*(e-r)/c:a}class i7 extends hm{static id="timeseries";static defaults=hm.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=Ld(n,this.min),this._tableRange=Ld(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=e.length;o=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(o=0,a=s.length;os-r)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?e=this.normalize(n.concat(i)):e=n.length?n:i,e=this._cache.all=e,e}getDecimalForValue(e){return(Ld(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,i=this.getDecimalForPixel(e)/n.factor-n.end;return Ld(this._table,i*this._tableRange+this._minPos,!0)}}const fT={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},s7={ariaLabel:{type:String},ariaDescribedby:{type:String}},r7={type:{type:String,required:!0},...fT,...s7},o7=HE[0]==="2"?(t,e)=>Object.assign(t,{attrs:e}):(t,e)=>Object.assign(t,e);function La(t){return nf(t)?lt(t):t}function a7(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t;return nf(e)?new Proxy(t,{}):t}function l7(t,e){const n=t.options;n&&e&&Object.assign(n,e)}function gT(t,e){t.labels=e}function pT(t,e,n){const i=[];t.datasets=e.map(s=>{const r=t.datasets.find(o=>o[n]===s[n]);return!r||!s.data||i.includes(r)?{...s}:(i.push(r),Object.assign(r,s),r)})}function c7(t,e){const n={labels:[],datasets:[]};return gT(n,t.labels),pT(n,t.datasets,e),n}const u7=cn({props:r7,setup(t,e){let{expose:n,slots:i}=e;const s=we(null),r=l_(null);n({chart:r});const o=()=>{if(!s.value)return;const{type:c,data:u,options:d,plugins:h,datasetIdKey:f}=t,p=c7(u,f),m=a7(p,u);r.value=new Tf(s.value,{type:c,data:m,options:{...d},plugins:h})},a=()=>{const c=lt(r.value);c&&(c.destroy(),r.value=null)},l=c=>{c.update(t.updateMode)};return xn(o),p_(a),fn([()=>t.options,()=>t.data],(c,u)=>{let[d,h]=c,[f,p]=u;const m=lt(r.value);if(!m)return;let y=!1;if(d){const v=La(d),b=La(f);v&&v!==b&&(l7(m,v),y=!0)}if(h){const v=La(h.labels),b=La(p.labels),E=La(h.datasets),C=La(p.datasets);v!==b&&(gT(m.config.data,v),y=!0),E&&E!==C&&(pT(m.config.data,E,t.datasetIdKey),y=!0)}y&&Rn(()=>{l(m)})},{deep:!0}),()=>la("canvas",{role:"img",ariaLabel:t.ariaLabel,ariaDescribedby:t.ariaDescribedby,ref:s},[la("p",{},[i.default?i.default():""])])}});function mT(t,e){return Tf.register(e),cn({props:fT,setup(n,i){let{expose:s}=i;const r=l_(null),o=a=>{r.value=a?.chart};return s({chart:r}),()=>la(u7,o7({ref:o},{type:t,...n}))}})}const d7=mT("bar",jC),h7=mT("line",UC);function mr(t){return Array.isArray?Array.isArray(t):vT(t)==="[object Array]"}const f7=1/0;function g7(t){if(typeof t=="string")return t;let e=t+"";return e=="0"&&1/t==-f7?"-0":e}function p7(t){return t==null?"":g7(t)}function ks(t){return typeof t=="string"}function _T(t){return typeof t=="number"}function m7(t){return t===!0||t===!1||_7(t)&&vT(t)=="[object Boolean]"}function yT(t){return typeof t=="object"}function _7(t){return yT(t)&&t!==null}function Ci(t){return t!=null}function np(t){return!t.trim().length}function vT(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const y7="Incorrect 'index' type",v7=t=>`Invalid value for key ${t}`,b7=t=>`Pattern length exceeds max of ${t}.`,w7=t=>`Missing ${t} property in key`,x7=t=>`Property 'weight' in key '${t}' must be a positive integer`,ew=Object.prototype.hasOwnProperty;class E7{constructor(e){this._keys=[],this._keyMap={};let n=0;e.forEach(i=>{let s=bT(i);this._keys.push(s),this._keyMap[s.id]=s,n+=s.weight}),this._keys.forEach(i=>{i.weight/=n})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function bT(t){let e=null,n=null,i=null,s=1,r=null;if(ks(t)||mr(t))i=t,e=tw(t),n=fm(t);else{if(!ew.call(t,"name"))throw new Error(w7("name"));const o=t.name;if(i=o,ew.call(t,"weight")&&(s=t.weight,s<=0))throw new Error(x7(o));e=tw(o),n=fm(o),r=t.getFn}return{path:e,id:n,weight:s,src:i,getFn:r}}function tw(t){return mr(t)?t:t.split(".")}function fm(t){return mr(t)?t.join("."):t}function S7(t,e){let n=[],i=!1;const s=(r,o,a)=>{if(Ci(r))if(!o[a])n.push(r);else{let l=o[a];const c=r[l];if(!Ci(c))return;if(a===o.length-1&&(ks(c)||_T(c)||m7(c)))n.push(p7(c));else if(mr(c)){i=!0;for(let u=0,d=c.length;ut.score===e.score?t.idx{this._keysMap[n.id]=i})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,ks(this.docs[0])?this.docs.forEach((e,n)=>{this._addString(e,n)}):this.docs.forEach((e,n)=>{this._addObject(e,n)}),this.norm.clear())}add(e){const n=this.size();ks(e)?this._addString(e,n):this._addObject(e,n)}removeAt(e){this.records.splice(e,1);for(let n=e,i=this.size();n{let o=s.getFn?s.getFn(e):this.getFn(e,s.path);if(Ci(o)){if(mr(o)){let a=[];const l=[{nestedArrIndex:-1,value:o}];for(;l.length;){const{nestedArrIndex:c,value:u}=l.pop();if(Ci(u))if(ks(u)&&!np(u)){let d={v:u,i:c,n:this.norm.get(u)};a.push(d)}else mr(u)&&u.forEach((d,h)=>{l.push({nestedArrIndex:h,value:d})})}i.$[r]=a}else if(ks(o)&&!np(o)){let a={v:o,n:this.norm.get(o)};i.$[r]=a}}}),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function wT(t,e,{getFn:n=Je.getFn,fieldNormWeight:i=Je.fieldNormWeight}={}){const s=new cy({getFn:n,fieldNormWeight:i});return s.setKeys(t.map(bT)),s.setSources(e),s.create(),s}function P7(t,{getFn:e=Je.getFn,fieldNormWeight:n=Je.fieldNormWeight}={}){const{keys:i,records:s}=t,r=new cy({getFn:e,fieldNormWeight:n});return r.setKeys(i),r.setIndexRecords(s),r}function Od(t,{errors:e=0,currentLocation:n=0,expectedLocation:i=0,distance:s=Je.distance,ignoreLocation:r=Je.ignoreLocation}={}){const o=e/t.length;if(r)return o;const a=Math.abs(i-n);return s?o+a/s:a?1:o}function R7(t=[],e=Je.minMatchCharLength){let n=[],i=-1,s=-1,r=0;for(let o=t.length;r=e&&n.push([i,s]),i=-1)}return t[r-1]&&r-i>=e&&n.push([i,r-1]),n}const jo=32;function D7(t,e,n,{location:i=Je.location,distance:s=Je.distance,threshold:r=Je.threshold,findAllMatches:o=Je.findAllMatches,minMatchCharLength:a=Je.minMatchCharLength,includeMatches:l=Je.includeMatches,ignoreLocation:c=Je.ignoreLocation}={}){if(e.length>jo)throw new Error(b7(jo));const u=e.length,d=t.length,h=Math.max(0,Math.min(i,d));let f=r,p=h;const m=a>1||l,y=m?Array(d):[];let v;for(;(v=t.indexOf(e,p))>-1;){let T=Od(e,{currentLocation:v,expectedLocation:h,distance:s,ignoreLocation:c});if(f=Math.min(T,f),p=v+u,m){let k=0;for(;k=P;N-=1){let L=N-1,I=n[t.charAt(L)];if(m&&(y[L]=+!!I),H[N]=(H[N+1]<<1|1)&I,T&&(H[N]|=(b[N+1]|b[N])<<1|1|b[N+1]),H[N]&w&&(E=Od(e,{errors:T,currentLocation:L,expectedLocation:h,distance:s,ignoreLocation:c}),E<=f)){if(f=E,p=L,p<=h)break;P=Math.max(1,2*h-p)}}if(Od(e,{errors:T+1,currentLocation:h,expectedLocation:h,distance:s,ignoreLocation:c})>f)break;b=H}const x={isMatch:p>=0,score:Math.max(.001,E)};if(m){const T=R7(y,a);T.length?l&&(x.indices=T):x.isMatch=!1}return x}function $7(t){let e={};for(let n=0,i=t.length;n{this.chunks.push({pattern:h,alphabet:$7(h),startIndex:f})},d=this.pattern.length;if(d>jo){let h=0;const f=d%jo,p=d-f;for(;h{const{isMatch:v,score:b,indices:E}=D7(e,p,m,{location:s+y,distance:r,threshold:o,findAllMatches:a,minMatchCharLength:l,includeMatches:i,ignoreLocation:c});v&&(h=!0),d+=b,v&&E&&(u=[...u,...E])});let f={isMatch:h,score:h?d/this.chunks.length:1};return h&&i&&(f.indices=u),f}}class bo{constructor(e){this.pattern=e}static isMultiMatch(e){return nw(e,this.multiRegex)}static isSingleMatch(e){return nw(e,this.singleRegex)}search(){}}function nw(t,e){const n=t.match(e);return n?n[1]:null}class L7 extends bo{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const n=e===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class O7 extends bo{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const i=e.indexOf(this.pattern)===-1;return{isMatch:i,score:i?0:1,indices:[0,e.length-1]}}}class N7 extends bo{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const n=e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class F7 extends bo{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const n=!e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class B7 extends bo{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const n=e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class V7 extends bo{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const n=!e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class ET extends bo{constructor(e,{location:n=Je.location,threshold:i=Je.threshold,distance:s=Je.distance,includeMatches:r=Je.includeMatches,findAllMatches:o=Je.findAllMatches,minMatchCharLength:a=Je.minMatchCharLength,isCaseSensitive:l=Je.isCaseSensitive,ignoreLocation:c=Je.ignoreLocation}={}){super(e),this._bitapSearch=new xT(e,{location:n,threshold:i,distance:s,includeMatches:r,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class ST extends bo{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let n=0,i;const s=[],r=this.pattern.length;for(;(i=e.indexOf(this.pattern,n))>-1;)n=i+r,s.push([i,n-1]);const o=!!s.length;return{isMatch:o,score:o?0:1,indices:s}}}const gm=[L7,ST,N7,F7,V7,B7,O7,ET],iw=gm.length,z7=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,W7="|";function H7(t,e={}){return t.split(W7).map(n=>{let i=n.trim().split(z7).filter(r=>r&&!!r.trim()),s=[];for(let r=0,o=i.length;r!!(t[Mh.AND]||t[Mh.OR]),U7=t=>!!t[_m.PATH],G7=t=>!mr(t)&&yT(t)&&!ym(t),sw=t=>({[Mh.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function CT(t,e,{auto:n=!0}={}){const i=s=>{let r=Object.keys(s);const o=U7(s);if(!o&&r.length>1&&!ym(s))return i(sw(s));if(G7(s)){const l=o?s[_m.PATH]:r[0],c=o?s[_m.PATTERN]:s[l];if(!ks(c))throw new Error(v7(l));const u={keyId:fm(l),pattern:c};return n&&(u.searcher=mm(c,e)),u}let a={children:[],operator:r[0]};return r.forEach(l=>{const c=s[l];mr(c)&&c.forEach(u=>{a.children.push(i(u))})}),a};return ym(t)||(t=sw(t)),i(t)}function X7(t,{ignoreFieldNorm:e=Je.ignoreFieldNorm}){t.forEach(n=>{let i=1;n.matches.forEach(({key:s,norm:r,score:o})=>{const a=s?s.weight:null;i*=Math.pow(o===0&&a?Number.EPSILON:o,(a||1)*(e?1:r))}),n.score=i})}function q7(t,e){const n=t.matches;e.matches=[],Ci(n)&&n.forEach(i=>{if(!Ci(i.indices)||!i.indices.length)return;const{indices:s,value:r}=i;let o={indices:s,value:r};i.key&&(o.key=i.key.src),i.idx>-1&&(o.refIndex=i.idx),e.matches.push(o)})}function Z7(t,e){e.score=t.score}function J7(t,e,{includeMatches:n=Je.includeMatches,includeScore:i=Je.includeScore}={}){const s=[];return n&&s.push(q7),i&&s.push(Z7),t.map(r=>{const{idx:o}=r,a={item:e[o],refIndex:o};return s.length&&s.forEach(l=>{l(r,a)}),a})}class Gl{constructor(e,n={},i){this.options={...Je,...n},this.options.useExtendedSearch,this._keyStore=new E7(this.options.keys),this.setCollection(e,i)}setCollection(e,n){if(this._docs=e,n&&!(n instanceof cy))throw new Error(y7);this._myIndex=n||wT(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){Ci(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const n=[];for(let i=0,s=this._docs.length;i-1&&(l=l.slice(0,n)),J7(l,this._docs,{includeMatches:i,includeScore:s})}_searchStringList(e){const n=mm(e,this.options),{records:i}=this._myIndex,s=[];return i.forEach(({v:r,i:o,n:a})=>{if(!Ci(r))return;const{isMatch:l,score:c,indices:u}=n.searchIn(r);l&&s.push({item:r,idx:o,matches:[{score:c,value:r,norm:a,indices:u}]})}),s}_searchLogical(e){const n=CT(e,this.options),i=(a,l,c)=>{if(!a.children){const{keyId:d,searcher:h}=a,f=this._findMatches({key:this._keyStore.get(d),value:this._myIndex.getValueForItemAtKeyId(l,d),searcher:h});return f&&f.length?[{idx:c,item:l,matches:f}]:[]}const u=[];for(let d=0,h=a.children.length;d{if(Ci(a)){let c=i(n,a,l);c.length&&(r[l]||(r[l]={idx:l,item:a,matches:[]},o.push(r[l])),c.forEach(({matches:u})=>{r[l].matches.push(...u)}))}}),o}_searchObjectList(e){const n=mm(e,this.options),{keys:i,records:s}=this._myIndex,r=[];return s.forEach(({$:o,i:a})=>{if(!Ci(o))return;let l=[];i.forEach((c,u)=>{l.push(...this._findMatches({key:c,value:o[u],searcher:n}))}),l.length&&r.push({idx:a,item:o,matches:l})}),r}_findMatches({key:e,value:n,searcher:i}){if(!Ci(n))return[];let s=[];if(mr(n))n.forEach(({v:r,i:o,n:a})=>{if(!Ci(r))return;const{isMatch:l,score:c,indices:u}=i.searchIn(r);l&&s.push({score:c,key:e,value:r,idx:o,norm:a,indices:u})});else{const{v:r,n:o}=n,{isMatch:a,score:l,indices:c}=i.searchIn(r);a&&s.push({score:l,key:e,value:r,norm:o,indices:c})}return s}}Gl.version="7.0.0";Gl.createIndex=wT;Gl.parseIndex=P7;Gl.config=Je;Gl.parseQuery=CT;K7(j7);const Q7={name:"peerSettings",components:{LocaleText:Qe},props:{selectedPeer:Object},data(){return{data:void 0,dataChanged:!1,showKey:!1,saving:!1}},setup(){return{dashboardConfigurationStore:nt()}},methods:{reset(){this.selectedPeer&&(this.data=JSON.parse(JSON.stringify(this.selectedPeer)),this.dataChanged=!1)},savePeer(){this.saving=!0,kt(`/api/updatePeerSettings/${this.$route.params.id}`,this.data,t=>{this.saving=!1,t.status?this.dashboardConfigurationStore.newMessage("Server","Peer saved","success"):this.dashboardConfigurationStore.newMessage("Server",t.message,"danger"),this.$emit("refresh")})},resetPeerData(t){this.saving=!0,kt(`/api/resetPeerData/${this.$route.params.id}`,{id:this.data.id,type:t},e=>{this.saving=!1,e.status?this.dashboardConfigurationStore.newMessage("Server","Peer data usage reset successfully","success"):this.dashboardConfigurationStore.newMessage("Server",e.message,"danger"),this.$emit("refresh")})}},beforeMount(){this.reset()},mounted(){this.$el.querySelectorAll("input").forEach(t=>{t.addEventListener("keyup",()=>{this.dataChanged=!0})})}},Xl=t=>(bn("data-v-2c571abb"),t=t(),wn(),t),eX={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},tX={class:"container d-flex h-100 w-100"},nX={class:"m-auto modal-dialog-centered dashboardModal"},iX={class:"card rounded-3 shadow flex-grow-1"},sX={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},rX={class:"mb-0"},oX={key:0,class:"card-body px-4 pb-4"},aX={class:"d-flex flex-column gap-2 mb-4"},lX={class:"d-flex align-items-center"},cX={class:"text-muted"},uX={class:"ms-auto"},dX={for:"peer_name_textbox",class:"form-label"},hX={class:"text-muted"},fX=["disabled"],gX={class:"d-flex position-relative"},pX={for:"peer_private_key_textbox",class:"form-label"},mX={class:"text-muted"},_X=["type","disabled"],yX={for:"peer_allowed_ip_textbox",class:"form-label"},vX={class:"text-muted"},bX=["disabled"],wX={for:"peer_endpoint_allowed_ips",class:"form-label"},xX={class:"text-muted"},EX=["disabled"],SX={for:"peer_DNS_textbox",class:"form-label"},CX={class:"text-muted"},TX=["disabled"],kX={class:"accordion mt-3",id:"peerSettingsAccordion"},AX={class:"accordion-item"},MX={class:"accordion-header"},IX={class:"accordion-button rounded-3 collapsed",type:"button","data-bs-toggle":"collapse","data-bs-target":"#peerSettingsAccordionOptional"},PX={id:"peerSettingsAccordionOptional",class:"accordion-collapse collapse","data-bs-parent":"#peerSettingsAccordion"},RX={class:"accordion-body d-flex flex-column gap-2 mb-2"},DX={for:"peer_preshared_key_textbox",class:"form-label"},$X={class:"text-muted"},LX=["disabled"],OX={for:"peer_mtu",class:"form-label"},NX={class:"text-muted"},FX=["disabled"],BX={for:"peer_keep_alive",class:"form-label"},VX={class:"text-muted"},zX=["disabled"],WX=Xl(()=>g("hr",null,null,-1)),HX={class:"d-flex gap-2 align-items-center"},YX={class:"d-flex gap-2 ms-auto"},jX=Xl(()=>g("i",{class:"bi bi-arrow-down-up me-2"},null,-1)),KX=Xl(()=>g("i",{class:"bi bi-arrow-down me-2"},null,-1)),UX=Xl(()=>g("i",{class:"bi bi-arrow-up me-2"},null,-1)),GX={class:"d-flex align-items-center gap-2"},XX=["disabled"],qX=Xl(()=>g("i",{class:"bi bi-arrow-clockwise ms-2"},null,-1)),ZX=["disabled"],JX=Xl(()=>g("i",{class:"bi bi-save-fill ms-2"},null,-1));function QX(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",eX,[g("div",tX,[g("div",nX,[g("div",iX,[g("div",sX,[g("h4",rX,[B(o,{t:"Peer Settings"})]),g("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=a=>this.$emit("close"))})]),this.data?(D(),V("div",oX,[g("div",aX,[g("div",lX,[g("small",cX,[B(o,{t:"Public Key"})]),g("small",uX,[g("samp",null,xe(this.data.id),1)])]),g("div",null,[g("label",dX,[g("small",hX,[B(o,{t:"Name"})])]),Oe(g("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":e[1]||(e[1]=a=>this.data.name=a),id:"peer_name_textbox",placeholder:""},null,8,fX),[[Ke,this.data.name]])]),g("div",null,[g("div",gX,[g("label",pX,[g("small",mX,[B(o,{t:"Private Key"}),g("code",null,[B(o,{t:"(Required for QR Code and Download)"})])])]),g("a",{role:"button",class:"ms-auto text-decoration-none toggleShowKey",onClick:e[2]||(e[2]=a=>this.showKey=!this.showKey)},[g("i",{class:Me(["bi",[this.showKey?"bi-eye-slash-fill":"bi-eye-fill"]])},null,2)])]),Oe(g("input",{type:[this.showKey?"text":"password"],class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":e[3]||(e[3]=a=>this.data.private_key=a),id:"peer_private_key_textbox",style:{"padding-right":"40px"}},null,8,_X),[[QE,this.data.private_key]])]),g("div",null,[g("label",yX,[g("small",vX,[B(o,{t:"Allowed IPs"}),g("code",null,[B(o,{t:"(Required)"})])])]),Oe(g("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":e[4]||(e[4]=a=>this.data.allowed_ip=a),id:"peer_allowed_ip_textbox"},null,8,bX),[[Ke,this.data.allowed_ip]])]),g("div",null,[g("label",wX,[g("small",xX,[B(o,{t:"Endpoint Allowed IPs"}),g("code",null,[B(o,{t:"(Required)"})])])]),Oe(g("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":e[5]||(e[5]=a=>this.data.endpoint_allowed_ip=a),id:"peer_endpoint_allowed_ips"},null,8,EX),[[Ke,this.data.endpoint_allowed_ip]])]),g("div",null,[g("label",SX,[g("small",CX,[B(o,{t:"DNS"})])]),Oe(g("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":e[6]||(e[6]=a=>this.data.DNS=a),id:"peer_DNS_textbox"},null,8,TX),[[Ke,this.data.DNS]])]),g("div",kX,[g("div",AX,[g("h2",MX,[g("button",IX,[B(o,{t:"Optional Settings"})])]),g("div",PX,[g("div",RX,[g("div",null,[g("label",DX,[g("small",$X,[B(o,{t:"Pre-Shared Key"})])]),Oe(g("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":e[7]||(e[7]=a=>this.data.preshared_key=a),id:"peer_preshared_key_textbox"},null,8,LX),[[Ke,this.data.preshared_key]])]),g("div",null,[g("label",OX,[g("small",NX,[B(o,{t:"MTU"})])]),Oe(g("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":e[8]||(e[8]=a=>this.data.mtu=a),id:"peer_mtu"},null,8,FX),[[Ke,this.data.mtu]])]),g("div",null,[g("label",BX,[g("small",VX,[B(o,{t:"Persistent Keepalive"})])]),Oe(g("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":e[9]||(e[9]=a=>this.data.keepalive=a),id:"peer_keep_alive"},null,8,zX),[[Ke,this.data.keepalive]])])])])])]),WX,g("div",HX,[g("strong",null,[B(o,{t:"Reset Data Usage"})]),g("div",YX,[g("button",{class:"btn bg-primary-subtle text-primary-emphasis rounded-3 flex-grow-1 shadow-sm",onClick:e[10]||(e[10]=a=>this.resetPeerData("total"))},[jX,B(o,{t:"Total"})]),g("button",{class:"btn bg-primary-subtle text-primary-emphasis rounded-3 flex-grow-1 shadow-sm",onClick:e[11]||(e[11]=a=>this.resetPeerData("receive"))},[KX,B(o,{t:"Received"})]),g("button",{class:"btn bg-primary-subtle text-primary-emphasis rounded-3 flex-grow-1 shadow-sm",onClick:e[12]||(e[12]=a=>this.resetPeerData("sent"))},[UX,B(o,{t:"Sent"})])])])]),g("div",GX,[g("button",{class:"btn btn-secondary rounded-3 shadow",onClick:e[13]||(e[13]=a=>this.reset()),disabled:!this.dataChanged||this.saving},[B(o,{t:"Revert"}),qX],8,XX),g("button",{class:"ms-auto btn btn-dark btn-brand rounded-3 px-3 py-2 shadow",disabled:!this.dataChanged||this.saving,onClick:e[14]||(e[14]=a=>this.savePeer())},[B(o,{t:"Save Peer"}),JX],8,ZX)])])):ce("",!0)])])])])}const e9=He(Q7,[["render",QX],["__scopeId","data-v-2c571abb"]]);var va={},t9=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},TT={},Pi={};let uy;const n9=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];Pi.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};Pi.getSymbolTotalCodewords=function(e){return n9[e]};Pi.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};Pi.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');uy=e};Pi.isKanjiModeEnabled=function(){return typeof uy<"u"};Pi.toSJIS=function(e){return uy(e)};var Mf={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+n)}}t.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},t.from=function(i,s){if(t.isValid(i))return i;try{return e(i)}catch{return s}}})(Mf);function kT(){this.buffer=[],this.length=0}kT.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let n=0;n>>e-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var i9=kT;function Yu(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}Yu.prototype.set=function(t,e,n,i){const s=t*this.size+e;this.data[s]=n,i&&(this.reservedBit[s]=!0)};Yu.prototype.get=function(t,e){return this.data[t*this.size+e]};Yu.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n};Yu.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var s9=Yu,AT={};(function(t){const e=Pi.getSymbolSize;t.getRowColCoords=function(i){if(i===1)return[];const s=Math.floor(i/7)+2,r=e(i),o=r===145?26:Math.ceil((r-13)/(2*s-2))*2,a=[r-7];for(let l=1;l=0&&s<=7},t.from=function(s){return t.isValid(s)?parseInt(s,10):void 0},t.getPenaltyN1=function(s){const r=s.size;let o=0,a=0,l=0,c=null,u=null;for(let d=0;d=5&&(o+=e.N1+(a-5)),c=f,a=1),f=s.get(h,d),f===u?l++:(l>=5&&(o+=e.N1+(l-5)),u=f,l=1)}a>=5&&(o+=e.N1+(a-5)),l>=5&&(o+=e.N1+(l-5))}return o},t.getPenaltyN2=function(s){const r=s.size;let o=0;for(let a=0;a=10&&(a===1488||a===93)&&o++,l=l<<1&2047|s.get(u,c),u>=10&&(l===1488||l===93)&&o++}return o*e.N3},t.getPenaltyN4=function(s){let r=0;const o=s.data.length;for(let l=0;l=0;){const o=r[0];for(let l=0;l0){const r=new Uint8Array(this.degree);return r.set(i,s),r}return i};var o9=dy,DT={},wo={},hy={};hy.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var Bs={};const $T="[0-9]+",a9="[A-Z $%*+\\-./:]+";let pu="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";pu=pu.replace(/u/g,"\\u");const l9="(?:(?![A-Z0-9 $%*+\\-./:]|"+pu+`)(?:.|[\r +]))+`;Bs.KANJI=new RegExp(pu,"g");Bs.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Bs.BYTE=new RegExp(l9,"g");Bs.NUMERIC=new RegExp($T,"g");Bs.ALPHANUMERIC=new RegExp(a9,"g");const c9=new RegExp("^"+pu+"$"),u9=new RegExp("^"+$T+"$"),d9=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Bs.testKanji=function(e){return c9.test(e)};Bs.testNumeric=function(e){return u9.test(e)};Bs.testAlphanumeric=function(e){return d9.test(e)};(function(t){const e=hy,n=Bs;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(r,o){if(!r.ccBits)throw new Error("Invalid mode: "+r);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?r.ccBits[0]:o<27?r.ccBits[1]:r.ccBits[2]},t.getBestModeForData=function(r){return n.testNumeric(r)?t.NUMERIC:n.testAlphanumeric(r)?t.ALPHANUMERIC:n.testKanji(r)?t.KANJI:t.BYTE},t.toString=function(r){if(r&&r.id)return r.id;throw new Error("Invalid mode")},t.isValid=function(r){return r&&r.bit&&r.ccBits};function i(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+s)}}t.from=function(r,o){if(t.isValid(r))return r;try{return i(r)}catch{return o}}})(wo);(function(t){const e=Pi,n=If,i=Mf,s=wo,r=hy,o=7973,a=e.getBCHDigit(o);function l(h,f,p){for(let m=1;m<=40;m++)if(f<=t.getCapacity(m,p,h))return m}function c(h,f){return s.getCharCountIndicator(h,f)+4}function u(h,f){let p=0;return h.forEach(function(m){const y=c(m.mode,f);p+=y+m.getBitsLength()}),p}function d(h,f){for(let p=1;p<=40;p++)if(u(h,p)<=t.getCapacity(p,f,s.MIXED))return p}t.from=function(f,p){return r.isValid(f)?parseInt(f,10):p},t.getCapacity=function(f,p,m){if(!r.isValid(f))throw new Error("Invalid QR Code version");typeof m>"u"&&(m=s.BYTE);const y=e.getSymbolTotalCodewords(f),v=n.getTotalCodewordsCount(f,p),b=(y-v)*8;if(m===s.MIXED)return b;const E=b-c(m,f);switch(m){case s.NUMERIC:return Math.floor(E/10*3);case s.ALPHANUMERIC:return Math.floor(E/11*2);case s.KANJI:return Math.floor(E/13);case s.BYTE:default:return Math.floor(E/8)}},t.getBestVersionForData=function(f,p){let m;const y=i.from(p,i.M);if(Array.isArray(f)){if(f.length>1)return d(f,y);if(f.length===0)return 1;m=f[0]}else m=f;return l(m.mode,m.getLength(),y)},t.getEncodedBits=function(f){if(!r.isValid(f)||f<7)throw new Error("Invalid QR Code version");let p=f<<12;for(;e.getBCHDigit(p)-a>=0;)p^=o<=0;)s^=OT<0&&(i=this.data.substr(n),s=parseInt(i,10),e.put(s,r*3+1))};var g9=Pl;const p9=wo,ip=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Rl(t){this.mode=p9.ALPHANUMERIC,this.data=t}Rl.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};Rl.prototype.getLength=function(){return this.data.length};Rl.prototype.getBitsLength=function(){return Rl.getBitsLength(this.data.length)};Rl.prototype.write=function(e){let n;for(n=0;n+2<=this.data.length;n+=2){let i=ip.indexOf(this.data[n])*45;i+=ip.indexOf(this.data[n+1]),e.put(i,11)}this.data.length%2&&e.put(ip.indexOf(this.data[n]),6)};var m9=Rl,_9=function(e){for(var n=[],i=e.length,s=0;s=55296&&r<=56319&&i>s+1){var o=e.charCodeAt(s+1);o>=56320&&o<=57343&&(r=(r-55296)*1024+o-56320+65536,s+=1)}if(r<128){n.push(r);continue}if(r<2048){n.push(r>>6|192),n.push(r&63|128);continue}if(r<55296||r>=57344&&r<65536){n.push(r>>12|224),n.push(r>>6&63|128),n.push(r&63|128);continue}if(r>=65536&&r<=1114111){n.push(r>>18|240),n.push(r>>12&63|128),n.push(r>>6&63|128),n.push(r&63|128);continue}n.push(239,191,189)}return new Uint8Array(n).buffer};const y9=_9,v9=wo;function Dl(t){this.mode=v9.BYTE,typeof t=="string"&&(t=y9(t)),this.data=new Uint8Array(t)}Dl.getBitsLength=function(e){return e*8};Dl.prototype.getLength=function(){return this.data.length};Dl.prototype.getBitsLength=function(){return Dl.getBitsLength(this.data.length)};Dl.prototype.write=function(t){for(let e=0,n=this.data.length;e=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+` +Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),t.put(n,13)}};var E9=$l,FT={exports:{}};(function(t){var e={single_source_shortest_paths:function(n,i,s){var r={},o={};o[i]=0;var a=e.PriorityQueue.make();a.push(i,0);for(var l,c,u,d,h,f,p,m,y;!a.empty();){l=a.pop(),c=l.value,d=l.cost,h=n[c]||{};for(u in h)h.hasOwnProperty(u)&&(f=h[u],p=d+f,m=o[u],y=typeof o[u]>"u",(y||m>p)&&(o[u]=p,a.push(u,p),r[u]=c))}if(typeof s<"u"&&typeof o[s]>"u"){var v=["Could not find a path from ",i," to ",s,"."].join("");throw new Error(v)}return r},extract_shortest_path_from_predecessor_list:function(n,i){for(var s=[],r=i;r;)s.push(r),n[r],r=n[r];return s.reverse(),s},find_path:function(n,i,s){var r=e.single_source_shortest_paths(n,i,s);return e.extract_shortest_path_from_predecessor_list(r,s)},PriorityQueue:{make:function(n){var i=e.PriorityQueue,s={},r;n=n||{};for(r in i)i.hasOwnProperty(r)&&(s[r]=i[r]);return s.queue=[],s.sorter=n.sorter||i.default_sorter,s},default_sorter:function(n,i){return n.cost-i.cost},push:function(n,i){var s={value:n,cost:i};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(FT);var S9=FT.exports;(function(t){const e=wo,n=g9,i=m9,s=b9,r=E9,o=Bs,a=Pi,l=S9;function c(v){return unescape(encodeURIComponent(v)).length}function u(v,b,E){const C=[];let w;for(;(w=v.exec(E))!==null;)C.push({data:w[0],index:w.index,mode:b,length:w[0].length});return C}function d(v){const b=u(o.NUMERIC,e.NUMERIC,v),E=u(o.ALPHANUMERIC,e.ALPHANUMERIC,v);let C,w;return a.isKanjiModeEnabled()?(C=u(o.BYTE,e.BYTE,v),w=u(o.KANJI,e.KANJI,v)):(C=u(o.BYTE_KANJI,e.BYTE,v),w=[]),b.concat(E,C,w).sort(function(T,k){return T.index-k.index}).map(function(T){return{data:T.data,mode:T.mode,length:T.length}})}function h(v,b){switch(b){case e.NUMERIC:return n.getBitsLength(v);case e.ALPHANUMERIC:return i.getBitsLength(v);case e.KANJI:return r.getBitsLength(v);case e.BYTE:return s.getBitsLength(v)}}function f(v){return v.reduce(function(b,E){const C=b.length-1>=0?b[b.length-1]:null;return C&&C.mode===E.mode?(b[b.length-1].data+=E.data,b):(b.push(E),b)},[])}function p(v){const b=[];for(let E=0;E=0&&a<=6&&(l===0||l===6)||l>=0&&l<=6&&(a===0||a===6)||a>=2&&a<=4&&l>=2&&l<=4?t.set(r+a,o+l,!0,!0):t.set(r+a,o+l,!1,!0))}}function D9(t){const e=t.size;for(let n=8;n>a&1)===1,t.set(s,r,o,!0),t.set(r,s,o,!0)}function op(t,e,n){const i=t.size,s=I9.getEncodedBits(e,n);let r,o;for(r=0;r<15;r++)o=(s>>r&1)===1,r<6?t.set(r,8,o,!0):r<8?t.set(r+1,8,o,!0):t.set(i-15+r,8,o,!0),r<8?t.set(8,i-r-1,o,!0):r<9?t.set(8,15-r-1+1,o,!0):t.set(8,15-r-1,o,!0);t.set(i-8,8,1,!0)}function O9(t,e){const n=t.size;let i=-1,s=n-1,r=7,o=0;for(let a=n-1;a>0;a-=2)for(a===6&&a--;;){for(let l=0;l<2;l++)if(!t.isReserved(s,a-l)){let c=!1;o>>r&1)===1),t.set(s,a-l,c),r--,r===-1&&(o++,r=7)}if(s+=i,s<0||n<=s){s-=i,i=-i;break}}}function N9(t,e,n){const i=new C9;n.forEach(function(l){i.put(l.mode.bit,4),i.put(l.getLength(),P9.getCharCountIndicator(l.mode,t)),l.write(i)});const s=Rf.getSymbolTotalCodewords(t),r=wm.getTotalCodewordsCount(t,e),o=(s-r)*8;for(i.getLengthInBits()+4<=o&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);const a=(o-i.getLengthInBits())/8;for(let l=0;l=7&&h9(l,e),f9(l,o),isNaN(i)&&(i=bm.getBestMask(l,op.bind(null,l,n))),bm.applyMask(i,l),op(l,n,i),{modules:l,version:e,errorCorrectionLevel:n,maskPattern:i,segments:s}}TT.create=function(e,n){if(typeof e>"u"||e==="")throw new Error("No input text");let i=sp.M,s,r;return typeof n<"u"&&(i=sp.from(n.errorCorrectionLevel,sp.M),s=Ph.from(n.version),r=bm.from(n.maskPattern),n.toSJISFunc&&Rf.setToSJISFunction(n.toSJISFunc)),m9(e,s,i,r)};var BT={},fy={};(function(t){function e(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let i=n.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+n);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(r){return[r,r]}))),i.length===6&&i.push("F","F");const s=parseInt(i.join(""),16);return{r:s>>24&255,g:s>>16&255,b:s>>8&255,a:s&255,hex:"#"+i.slice(0,6).join("")}}t.getOptions=function(i){i||(i={}),i.color||(i.color={});const s=typeof i.margin>"u"||i.margin===null||i.margin<0?4:i.margin,r=i.width&&i.width>=21?i.width:void 0,o=i.scale||4;return{width:r,scale:r?4:o,margin:s,color:{dark:e(i.color.dark||"#000000ff"),light:e(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},t.getScale=function(i,s){return s.width&&s.width>=i+s.margin*2?s.width/(i+s.margin*2):s.scale},t.getImageWidth=function(i,s){const r=t.getScale(i,s);return Math.floor((i+s.margin*2)*r)},t.qrToImageData=function(i,s,r){const o=s.modules.size,a=s.modules.data,l=t.getScale(o,r),c=Math.floor((o+r.margin*2)*l),u=r.margin*l,d=[r.color.light,r.color.dark];for(let h=0;h=u&&f>=u&&h"u"&&(!o||!o.getContext)&&(l=o,o=void 0),o||(c=i()),l=e.getOptions(l);const u=e.getImageWidth(r.modules.size,l),d=c.getContext("2d"),h=d.createImageData(u,u);return e.qrToImageData(h.data,r,l),n(d,c,u),d.putImageData(h,0,0),c},t.renderToDataURL=function(r,o,a){let l=a;typeof l>"u"&&(!o||!o.getContext)&&(l=o,o=void 0),l||(l={});const c=t.render(r,o,l),u=l.type||"image/png",d=l.rendererOpts||{};return c.toDataURL(u,d.quality)}})(BT);var VT={};const _9=fy;function aw(t,e){const n=t.a/255,i=e+'="'+t.hex+'"';return n<1?i+" "+e+'-opacity="'+n.toFixed(2).slice(1)+'"':i}function ap(t,e,n){let i=t+e;return typeof n<"u"&&(i+=" "+n),i}function y9(t,e,n){let i="",s=0,r=!1,o=0;for(let a=0;a0&&l>0&&t[a-1]||(i+=r?ap("M",l+n,.5+c+n):ap("m",s,0),s=0,r=!1),l+1':"",c="',u='viewBox="0 0 '+a+" "+a+'"',h=''+l+c+` -`;return typeof i=="function"&&i(null,h),h};const v9=RX,xm=TT,zT=BT,b9=VT;function gy(t,e,n,i,s){const r=[].slice.call(arguments,1),o=r.length,a=typeof r[o-1]=="function";if(!a&&!v9())throw new Error("Callback required as last argument");if(a){if(o<2)throw new Error("Too few arguments provided");o===2?(s=n,n=e,e=i=void 0):o===3&&(e.getContext&&typeof s>"u"?(s=i,i=void 0):(s=i,i=n,n=e,e=void 0))}else{if(o<1)throw new Error("Too few arguments provided");return o===1?(n=e,e=i=void 0):o===2&&!e.getContext&&(i=n,n=e,e=void 0),new Promise(function(l,c){try{const u=xm.create(n,i);l(t(u,e,i))}catch(u){c(u)}})}try{const l=xm.create(n,i);s(null,t(l,e,i))}catch(l){s(l)}}va.create=xm.create;va.toCanvas=gy.bind(null,zT.render);va.toDataURL=gy.bind(null,zT.renderToDataURL);va.toString=gy.bind(null,function(t,e,n){return b9.render(t,n)});const w9={name:"peerQRCode",components:{LocaleText:Qe},props:{peerConfigData:String},mounted(){va.toCanvas(document.querySelector("#qrcode"),this.peerConfigData,t=>{t&&console.error(t)})}},x9={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0"},E9={class:"container d-flex h-100 w-100"},S9={class:"m-auto modal-dialog-centered dashboardModal justify-content-center"},C9={class:"card rounded-3 shadow"},T9={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-0"},k9={class:"mb-0"},A9={class:"card-body"},M9={id:"qrcode",class:"rounded-3 shadow",ref:"qrcode"};function I9(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",x9,[g("div",E9,[g("div",S9,[g("div",C9,[g("div",T9,[g("h4",k9,[B(o,{t:"QR Code"})]),g("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=a=>this.$emit("close"))})]),g("div",A9,[g("canvas",M9,null,512)])])])])])}const P9=Ye(w9,[["render",I9]]),R9={name:"nameInput",components:{LocaleText:Qe},props:{bulk:Boolean,data:Object,saving:Boolean}},D9={for:"peer_name_textbox",class:"form-label"},$9={class:"text-muted"},L9=["disabled"];function O9(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",{class:Ie({inactiveField:this.bulk})},[g("label",D9,[g("small",$9,[B(o,{t:"Name"})])]),Ne(g("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving||this.bulk,"onUpdate:modelValue":e[0]||(e[0]=a=>this.data.name=a),id:"peer_name_textbox",placeholder:""},null,8,L9),[[Ke,this.data.name]])],2)}const N9=Ye(R9,[["render",O9]]),F9={name:"privatePublicKeyInput",components:{LocaleText:Qe},props:{data:Object,saving:Boolean,bulk:Boolean},setup(){return{dashboardStore:st()}},data(){return{keypair:{publicKey:"",privateKey:"",presharedKey:""},editKey:!1,error:!1}},methods:{genKeyPair(){this.editKey=!1,this.keypair=window.wireguard.generateKeypair(),this.data.private_key=this.keypair.privateKey,this.data.public_key=this.keypair.publicKey},testKey(t){return/^[A-Za-z0-9+/]{43}=?=?$/.test(t)},checkMatching(){try{this.keypair.privateKey&&this.testKey(this.keypair.privateKey)&&(this.keypair.publicKey=window.wireguard.generatePublicKey(this.keypair.privateKey),window.wireguard.generatePublicKey(this.keypair.privateKey)!==this.keypair.publicKey?(this.error=!0,this.dashboardStore.newMessage("WGDashboard","Private key does not match with the public key","danger")):(this.data.private_key=this.keypair.privateKey,this.data.public_key=this.keypair.publicKey))}catch{this.error=!0,this.data.private_key="",this.data.public_key=""}}},mounted(){this.genKeyPair()},watch:{keypair:{deep:!0,handler(){this.error=!1,this.checkMatching()}}}},B9={for:"peer_private_key_textbox",class:"form-label"},V9={class:"text-muted"},z9={class:"input-group"},W9=["disabled"],H9=["disabled"],Y9=g("i",{class:"bi bi-arrow-repeat"},null,-1),j9=[Y9],K9={class:"d-flex"},U9={for:"public_key",class:"form-label"},G9={class:"text-muted"},X9={class:"form-check form-switch ms-auto"},q9=["disabled"],Z9={class:"form-check-label",for:"enablePublicKeyEdit"},J9=["disabled"];function Q9(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",{class:Ie(["d-flex gap-2 flex-column",{inactiveField:this.bulk}])},[g("div",null,[g("label",B9,[g("small",V9,[B(o,{t:"Private Key"}),g("code",null,[B(o,{t:"(Required for QR Code and Download)"})])])]),g("div",z9,[Ne(g("input",{type:"text",class:Ie(["form-control form-control-sm rounded-start-3",{"is-invalid":this.error}]),"onUpdate:modelValue":e[0]||(e[0]=a=>this.keypair.privateKey=a),disabled:!this.editKey||this.bulk,onBlur:e[1]||(e[1]=a=>this.checkMatching()),id:"peer_private_key_textbox"},null,42,W9),[[Ke,this.keypair.privateKey]]),g("button",{class:"btn btn-outline-info btn-sm rounded-end-3",onClick:e[2]||(e[2]=a=>this.genKeyPair()),disabled:this.bulk,type:"button",id:"button-addon2"},j9,8,H9)])]),g("div",null,[g("div",K9,[g("label",U9,[g("small",G9,[B(o,{t:"Public Key"}),g("code",null,[B(o,{t:"(Required)"})])])]),g("div",X9,[Ne(g("input",{class:"form-check-input",type:"checkbox",role:"switch",disabled:this.bulk,id:"enablePublicKeyEdit","onUpdate:modelValue":e[3]||(e[3]=a=>this.editKey=a)},null,8,q9),[[Jn,this.editKey]]),g("label",Z9,[g("small",null,[B(o,{t:"Use your own Private and Public Key"})])])])]),Ne(g("input",{class:Ie(["form-control-sm form-control rounded-3",{"is-invalid":this.error}]),"onUpdate:modelValue":e[4]||(e[4]=a=>this.keypair.publicKey=a),onBlur:e[5]||(e[5]=a=>this.checkMatching()),disabled:!this.editKey||this.bulk,type:"text",id:"public_key"},null,42,J9),[[Ke,this.keypair.publicKey]])])],2)}const eq=Ye(F9,[["render",Q9]]),tq={name:"allowedIPsInput",components:{LocaleText:Qe},props:{data:Object,saving:Boolean,bulk:Boolean,availableIp:void 0},data(){return{allowedIp:[],availableIpSearchString:"",customAvailableIp:"",allowedIpFormatError:!1}},setup(){const t=vi(),e=st();return{store:t,dashboardStore:e}},computed:{searchAvailableIps(){return this.availableIpSearchString?this.availableIp.filter(t=>t.includes(this.availableIpSearchString)&&!this.data.allowed_ips.includes(t)):this.availableIp.filter(t=>!this.data.allowed_ips.includes(t))},inputGetLocale(){return Tt("Enter IP Address/CIDR")}},methods:{addAllowedIp(t){return this.store.checkCIDR(t)?(this.data.allowed_ips.push(t),this.customAvailableIp="",!0):(this.allowedIpFormatError=!0,this.dashboardStore.newMessage("WGDashboard","Allowed IPs is invalid","danger"),!1)}},watch:{customAvailableIp(){this.allowedIpFormatError=!1},availableIp(){this.availableIp!==void 0&&this.availableIp.length>0&&this.addAllowedIp(this.availableIp[0])}},mounted(){}},Df=t=>(bn("data-v-6d5fc831"),t=t(),wn(),t),nq={for:"peer_allowed_ip_textbox",class:"form-label"},iq={class:"text-muted"},sq=["onClick"],rq=Df(()=>g("i",{class:"bi bi-x-circle-fill ms-1"},null,-1)),oq=[rq],aq={class:"d-flex gap-2 align-items-center"},lq={class:"input-group"},cq=["placeholder","disabled"],uq=["disabled"],dq=Df(()=>g("i",{class:"bi bi-plus-lg"},null,-1)),hq=[dq],fq={class:"text-muted"},gq={class:"dropdown flex-grow-1"},pq=["disabled"],mq=Df(()=>g("i",{class:"bi bi-filter-circle me-2"},null,-1)),_q={key:0,class:"dropdown-menu mt-2 shadow w-100 dropdown-menu-end rounded-3",style:{"overflow-y":"scroll","max-height":"270px",width:"300px !important"}},yq={class:"px-3 pb-2 pt-1 d-flex gap-3 align-items-center"},vq=Df(()=>g("label",{for:"availableIpSearchString",class:"text-muted"},[g("i",{class:"bi bi-search"})],-1)),bq=["onClick"],wq={class:"me-auto"},xq={key:0},Eq={class:"px-3 text-muted"};function Sq(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",{class:Ie({inactiveField:this.bulk})},[g("label",nq,[g("small",iq,[B(o,{t:"Allowed IPs"}),g("code",null,[B(o,{t:"(Required)"})])])]),g("div",{class:Ie(["d-flex gap-2 flex-wrap",{"mb-2":this.data.allowed_ips.length>0}])},[B(jl,{name:"list"},{default:Re(()=>[(D(!0),V($e,null,Xe(this.data.allowed_ips,(a,l)=>(D(),V("span",{class:"badge rounded-pill text-bg-success",key:a},[He(Ee(a)+" ",1),g("a",{role:"button",onClick:c=>this.data.allowed_ips.splice(l,1)},oq,8,sq)]))),128))]),_:1})],2),g("div",aq,[g("div",lq,[Ne(g("input",{type:"text",class:Ie(["form-control form-control-sm rounded-start-3",{"is-invalid":this.allowedIpFormatError}]),placeholder:this.inputGetLocale,"onUpdate:modelValue":e[0]||(e[0]=a=>s.customAvailableIp=a),disabled:n.bulk},null,10,cq),[[Ke,s.customAvailableIp]]),g("button",{class:"btn btn-outline-success btn-sm rounded-end-3",disabled:n.bulk||!this.customAvailableIp,onClick:e[1]||(e[1]=a=>this.addAllowedIp(this.customAvailableIp)),type:"button",id:"button-addon2"},hq,8,uq)]),g("small",fq,[B(o,{t:"or"})]),g("div",gq,[g("button",{class:"btn btn-outline-secondary btn-sm dropdown-toggle rounded-3 w-100",disabled:!n.availableIp||n.bulk,"data-bs-auto-close":"outside",type:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[mq,B(o,{t:"Pick Available IP"})],8,pq),this.availableIp?(D(),V("ul",_q,[g("li",null,[g("div",yq,[vq,Ne(g("input",{id:"availableIpSearchString",class:"form-control form-control-sm rounded-3","onUpdate:modelValue":e[2]||(e[2]=a=>this.availableIpSearchString=a)},null,512),[[Ke,this.availableIpSearchString]])])]),(D(!0),V($e,null,Xe(this.searchAvailableIps,a=>(D(),V("li",null,[g("a",{class:"dropdown-item d-flex",role:"button",onClick:l=>this.addAllowedIp(a)},[g("span",wq,[g("small",null,Ee(a),1)])],8,bq)]))),256)),this.searchAvailableIps.length===0?(D(),V("li",xq,[g("small",Eq,[B(o,{t:"No available IP containing"}),He(' "'+Ee(this.availableIpSearchString)+'"',1)])])):ce("",!0)])):ce("",!0)])])],2)}const Cq=Ye(tq,[["render",Sq],["__scopeId","data-v-6d5fc831"]]),Tq={name:"dnsInput",components:{LocaleText:Qe},props:{data:Object,saving:Boolean},data(){return{error:!1,dns:JSON.parse(JSON.stringify(this.data.DNS))}},setup(){const t=vi(),e=st();return{store:t,dashboardStore:e}},methods:{checkDNS(){if(this.dns){let t=this.dns.split(",").map(e=>e.replaceAll(" ",""));for(let e in t)if(!this.store.regexCheckIP(t[e])){this.error||this.dashboardStore.newMessage("WGDashboard","DNS format is incorrect","danger"),this.error=!0,this.data.DNS="";return}this.error=!1,this.data.DNS=this.dns}}},watch:{dns(){this.checkDNS()}}},kq={for:"peer_DNS_textbox",class:"form-label"},Aq={class:"text-muted"},Mq=["disabled"];function Iq(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",null,[g("label",kq,[g("small",Aq,[B(o,{t:"DNS"})])]),Ne(g("input",{type:"text",class:Ie(["form-control form-control-sm rounded-3",{"is-invalid":this.error}]),disabled:this.saving,"onUpdate:modelValue":e[0]||(e[0]=a=>this.dns=a),id:"peer_DNS_textbox"},null,10,Mq),[[Ke,this.dns]])])}const Pq=Ye(Tq,[["render",Iq]]),Rq={name:"endpointAllowedIps",components:{LocaleText:Qe},props:{data:Object,saving:Boolean},setup(){const t=vi(),e=st();return{store:t,dashboardStore:e}},data(){return{endpointAllowedIps:JSON.parse(JSON.stringify(this.data.endpoint_allowed_ip)),error:!1}},methods:{checkAllowedIP(){let t=this.endpointAllowedIps.split(",").map(e=>e.replaceAll(" ",""));for(let e in t)if(!this.store.checkCIDR(t[e])){this.error||this.dashboardStore.newMessage("WGDashboard","Endpoint Allowed IPs format is incorrect","danger"),this.data.endpoint_allowed_ip="",this.error=!0;return}this.error=!1,this.data.endpoint_allowed_ip=this.endpointAllowedIps}},watch:{endpointAllowedIps(){this.checkAllowedIP()}}},Dq={for:"peer_endpoint_allowed_ips",class:"form-label"},$q={class:"text-muted"},Lq=["disabled"];function Oq(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",null,[g("label",Dq,[g("small",$q,[B(o,{t:"Endpoint Allowed IPs"}),g("code",null,[B(o,{t:"(Required)"})])])]),Ne(g("input",{type:"text",class:Ie(["form-control form-control-sm rounded-3",{"is-invalid":s.error}]),disabled:this.saving,"onUpdate:modelValue":e[0]||(e[0]=a=>this.endpointAllowedIps=a),onBlur:e[1]||(e[1]=a=>this.checkAllowedIP()),id:"peer_endpoint_allowed_ips"},null,42,Lq),[[Ke,this.endpointAllowedIps]])])}const Nq=Ye(Rq,[["render",Oq]]),Fq={name:"presharedKeyInput",components:{LocaleText:Qe},props:{data:Object,saving:Boolean},data(){return{enable:!1}},watch:{enable(){this.enable?this.data.preshared_key=window.wireguard.generateKeypair().presharedKey:this.data.preshared_key=""}}},Bq={class:"d-flex align-items-start"},Vq={for:"peer_preshared_key_textbox",class:"form-label"},zq={class:"text-muted"},Wq={class:"form-check form-switch ms-auto"},Hq=["disabled"];function Yq(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",null,[g("div",Bq,[g("label",Vq,[g("small",zq,[B(o,{t:"Pre-Shared Key"})])]),g("div",Wq,[Ne(g("input",{class:"form-check-input",type:"checkbox",role:"switch","onUpdate:modelValue":e[0]||(e[0]=a=>this.enable=a),id:"peer_preshared_key_switch"},null,512),[[Jn,this.enable]])])]),Ne(g("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving||!this.enable,"onUpdate:modelValue":e[1]||(e[1]=a=>this.data.preshared_key=a),id:"peer_preshared_key_textbox"},null,8,Hq),[[Ke,this.data.preshared_key]])])}const jq=Ye(Fq,[["render",Yq]]),Kq={name:"mtuInput",components:{LocaleText:Qe},props:{data:Object,saving:Boolean}},Uq={for:"peer_mtu",class:"form-label"},Gq={class:"text-muted"},Xq=["disabled"];function qq(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",null,[g("label",Uq,[g("small",Gq,[B(o,{t:"MTU"})])]),Ne(g("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":e[0]||(e[0]=a=>this.data.mtu=a),min:"0",id:"peer_mtu"},null,8,Xq),[[Ke,this.data.mtu]])])}const Zq=Ye(Kq,[["render",qq]]),Jq={name:"persistentKeepAliveInput",components:{LocaleText:Qe},props:{data:Object,saving:Boolean}},Qq={for:"peer_keep_alive",class:"form-label"},eZ={class:"text-muted"},tZ=["disabled"];function nZ(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",null,[g("label",Qq,[g("small",eZ,[B(o,{t:"Persistent Keepalive"})])]),Ne(g("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":e[0]||(e[0]=a=>this.data.keepalive=a),id:"peer_keep_alive"},null,8,tZ),[[Ke,this.data.keepalive]])])}const iZ=Ye(Jq,[["render",nZ]]),sZ={name:"bulkAdd",components:{LocaleText:Qe},props:{saving:Boolean,data:Object,availableIp:void 0},computed:{bulkAddGetLocale(){return Tt("How many peers you want to add?")}}},rZ={class:"form-check form-switch"},oZ=["disabled"],aZ={class:"form-check-label me-2",for:"bulk_add"},lZ={class:"text-muted d-block"},cZ={key:0,class:"form-group"},uZ=["max","placeholder"],dZ={class:"text-muted"};function hZ(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",null,[g("div",rZ,[Ne(g("input",{class:"form-check-input",type:"checkbox",role:"switch",disabled:!this.availableIp,id:"bulk_add","onUpdate:modelValue":e[0]||(e[0]=a=>this.data.bulkAdd=a)},null,8,oZ),[[Jn,this.data.bulkAdd]]),g("label",aZ,[g("small",null,[g("strong",null,[B(o,{t:"Bulk Add"})])])])]),g("p",{class:Ie({"mb-0":!this.data.bulkAdd})},[g("small",lZ,[B(o,{t:"By adding peers by bulk, each peer's name will be auto generated, and Allowed IP will be assign to the next available IP."})])],2),this.data.bulkAdd?(D(),V("div",cZ,[Ne(g("input",{class:"form-control form-control-sm rounded-3 mb-1",type:"number",min:"1",max:this.availableIp.length,"onUpdate:modelValue":e[1]||(e[1]=a=>this.data.bulkAddAmount=a),placeholder:this.bulkAddGetLocale},null,8,uZ),[[Ke,this.data.bulkAddAmount]]),g("small",dZ,[B(o,{t:"You can add up to "+this.availableIp.length+" peers"},null,8,["t"])])])):ce("",!0)])}const fZ=Ye(sZ,[["render",hZ]]),gZ={name:"peerCreate",components:{LocaleText:Qe,BulkAdd:fZ,PersistentKeepAliveInput:iZ,MtuInput:Zq,PresharedKeyInput:jq,EndpointAllowedIps:Nq,DnsInput:Pq,AllowedIPsInput:Cq,PrivatePublicKeyInput:eq,NameInput:N9},data(){return{data:{bulkAdd:!1,bulkAddAmount:0,name:"",allowed_ips:[],private_key:"",public_key:"",DNS:this.dashboardStore.Configuration.Peers.peer_global_dns,endpoint_allowed_ip:this.dashboardStore.Configuration.Peers.peer_endpoint_allowed_ip,keepalive:parseInt(this.dashboardStore.Configuration.Peers.peer_keep_alive),mtu:parseInt(this.dashboardStore.Configuration.Peers.peer_mtu),preshared_key:"",preshared_key_bulkAdd:!1},availableIp:void 0,availableIpSearchString:"",saving:!1,allowedIpDropdown:void 0}},mounted(){Vt("/api/getAvailableIPs/"+this.$route.params.id,{},t=>{t.status&&(this.availableIp=t.data)})},setup(){const t=vi(),e=st();return{store:t,dashboardStore:e}},methods:{peerCreate(){this.saving=!0,kt("/api/addPeers/"+this.$route.params.id,this.data,t=>{t.status?(this.$router.push(`/configuration/${this.$route.params.id}/peers`),this.dashboardStore.newMessage("Server","Peer created successfully","success")):this.dashboardStore.newMessage("Server",t.message,"danger"),this.saving=!1})}},computed:{allRequireFieldsFilled(){let t=!0;return this.data.bulkAdd?(this.data.bulkAddAmount.length===0||this.data.bulkAddAmount>this.availableIp.length)&&(t=!1):["allowed_ips","private_key","public_key","endpoint_allowed_ip","keepalive","mtu"].forEach(n=>{this.data[n].length===0&&(t=!1)}),t}},watch:{bulkAdd(t){t||(this.data.bulkAddAmount="")},"data.bulkAddAmount"(){this.data.bulkAddAmount>this.availableIp.length&&(this.data.bulkAddAmount=this.availableIp.length)}}},py=t=>(bn("data-v-3f34f584"),t=t(),wn(),t),pZ={class:"container"},mZ={class:"mb-4"},_Z=py(()=>g("h3",{class:"mb-0 text-body"},[g("i",{class:"bi bi-chevron-left"})],-1)),yZ={class:"text-body mb-0"},vZ={class:"d-flex flex-column gap-2"},bZ=py(()=>g("hr",{class:"mb-0 mt-2"},null,-1)),wZ=py(()=>g("hr",{class:"mb-0 mt-2"},null,-1)),xZ={class:"row gy-3"},EZ={key:0,class:"col-sm"},SZ={class:"col-sm"},CZ={class:"col-sm"},TZ={key:1,class:"col-12"},kZ={class:"form-check form-switch"},AZ={class:"form-check-label",for:"bullAdd_PresharedKey_Switch"},MZ={class:"fw-bold"},IZ={class:"d-flex mt-2"},PZ=["disabled"],RZ={key:0,class:"bi bi-plus-circle-fill me-2"};function DZ(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("RouterLink"),l=Se("BulkAdd"),c=Se("NameInput"),u=Se("PrivatePublicKeyInput"),d=Se("AllowedIPsInput"),h=Se("EndpointAllowedIps"),f=Se("DnsInput"),p=Se("PresharedKeyInput"),m=Se("MtuInput"),y=Se("PersistentKeepAliveInput");return D(),V("div",pZ,[g("div",mZ,[B(a,{to:"peers",is:"div",class:"d-flex align-items-center gap-4 text-decoration-none"},{default:Re(()=>[_Z,g("h3",yZ,[B(o,{t:"Add Peers"})])]),_:1})]),g("div",vZ,[B(l,{saving:s.saving,data:this.data,availableIp:this.availableIp},null,8,["saving","data","availableIp"]),bZ,this.data.bulkAdd?ce("",!0):(D(),Ce(c,{key:0,saving:s.saving,data:this.data},null,8,["saving","data"])),this.data.bulkAdd?ce("",!0):(D(),Ce(u,{key:1,saving:s.saving,data:s.data},null,8,["saving","data"])),this.data.bulkAdd?ce("",!0):(D(),Ce(d,{key:2,availableIp:this.availableIp,saving:s.saving,data:s.data},null,8,["availableIp","saving","data"])),B(h,{saving:s.saving,data:s.data},null,8,["saving","data"]),B(f,{saving:s.saving,data:s.data},null,8,["saving","data"]),wZ,g("div",xZ,[this.data.bulkAdd?ce("",!0):(D(),V("div",EZ,[B(p,{saving:s.saving,data:s.data,bulk:this.data.bulkAdd},null,8,["saving","data","bulk"])])),g("div",SZ,[B(m,{saving:s.saving,data:s.data},null,8,["saving","data"])]),g("div",CZ,[B(y,{saving:s.saving,data:s.data},null,8,["saving","data"])]),this.data.bulkAdd?(D(),V("div",TZ,[g("div",kZ,[Ne(g("input",{class:"form-check-input",type:"checkbox",role:"switch","onUpdate:modelValue":e[0]||(e[0]=v=>this.data.preshared_key_bulkAdd=v),id:"bullAdd_PresharedKey_Switch",checked:""},null,512),[[Jn,this.data.preshared_key_bulkAdd]]),g("label",AZ,[g("small",MZ,[B(o,{t:"Pre-Shared Key"}),this.data.preshared_key_bulkAdd?(D(),Ce(o,{key:0,t:"Enabled"})):(D(),Ce(o,{key:1,t:"Disabled"}))])])])])):ce("",!0)]),g("div",IZ,[g("button",{class:"ms-auto btn btn-dark btn-brand rounded-3 px-3 py-2 shadow",disabled:!this.allRequireFieldsFilled||this.saving,onClick:e[1]||(e[1]=v=>this.peerCreate())},[this.saving?ce("",!0):(D(),V("i",RZ)),this.saving?(D(),Ce(o,{key:1,t:"Adding..."})):(D(),Ce(o,{key:2,t:"Add"}))],8,PZ)])])])}const WT=Ye(gZ,[["render",DZ],["__scopeId","data-v-3f34f584"]]),$Z={name:"scheduleDropdown",props:{options:Array,data:String,edit:!1},setup(t){t.data===void 0&&this.$emit("update",this.options[0].value)},computed:{currentSelection(){return this.options.find(t=>t.value===this.data)}}},LZ={class:"dropdown scheduleDropdown"},OZ={class:"dropdown-menu rounded-3 shadow",style:{"font-size":"0.875rem",width:"200px"}},NZ=["onClick"],FZ={key:0,class:"bi bi-check ms-auto"};function BZ(t,e,n,i,s,r){return D(),V("div",LZ,[g("button",{class:Ie(["btn btn-sm btn-outline-primary rounded-3",{"disabled border-transparent":!n.edit}]),type:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[g("samp",null,Ee(this.currentSelection.display),1)],2),g("ul",OZ,[n.edit?(D(!0),V($e,{key:0},Xe(this.options,o=>(D(),V("li",null,[g("a",{class:"dropdown-item d-flex align-items-center",role:"button",onClick:a=>t.$emit("update",o.value)},[g("samp",null,Ee(o.display),1),o.value===this.currentSelection.value?(D(),V("i",FZ)):ce("",!0)],8,NZ)]))),256)):ce("",!0)])])}const HT=Ye($Z,[["render",BZ],["__scopeId","data-v-6a5aba2a"]]),VZ={name:"schedulePeerJob",components:{LocaleText:Qe,VueDatePicker:Bu,ScheduleDropdown:HT},props:{dropdowns:Array[Object],pjob:Object,viewOnly:!1},setup(t){const e=we({}),n=we(!1),i=we(!1);e.value=JSON.parse(JSON.stringify(t.pjob)),e.value.CreationDate||(n.value=!0,i.value=!0);const s=st();return{job:e,edit:n,newJob:i,store:s}},data(){return{inputType:void 0}},watch:{pjob:{deep:!0,immediate:!0,handler(t){this.edit||(this.job=JSON.parse(JSON.stringify(t)))}}},methods:{save(){this.job.Field&&this.job.Operator&&this.job.Action&&this.job.Value?kt("/api/savePeerScheduleJob/",{Job:this.job},t=>{t.status?(this.edit=!1,this.store.newMessage("Server","Peer job saved","success"),console.log(t.data),this.$emit("refresh",t.data[0]),this.newJob=!1):this.store.newMessage("Server",t.message,"danger")}):this.alert()},alert(){let t="animate__flash",e=this.$el.querySelectorAll(".scheduleDropdown"),n=this.$el.querySelectorAll("input");e.forEach(i=>i.classList.add("animate__animated",t)),n.forEach(i=>i.classList.add("animate__animated",t)),setTimeout(()=>{e.forEach(i=>i.classList.remove("animate__animated",t)),n.forEach(i=>i.classList.remove("animate__animated",t))},2e3)},reset(){this.job.CreationDate?(this.job=JSON.parse(JSON.stringify(this.pjob)),this.edit=!1):this.$emit("delete")},delete(){this.job.CreationDate&&kt("/api/deletePeerScheduleJob/",{Job:this.job},t=>{t.status?this.store.newMessage("Server","Peer job deleted","success"):(this.store.newMessage("Server",t.message,"danger"),this.$emit("delete"))}),this.$emit("delete")},parseTime(t){t&&(this.job.Value=pi(t).format("YYYY-MM-DD HH:mm:ss"))}}},zZ=t=>(bn("data-v-8f3f1b93"),t=t(),wn(),t),WZ={class:"card-header bg-transparent text-muted border-0"},HZ={key:0,class:"d-flex"},YZ={class:"me-auto"},jZ={key:1},KZ={class:"badge text-bg-warning"},UZ={class:"card-body pt-1",style:{"font-family":"var(--bs-font-monospace)"}},GZ={class:"d-flex gap-2 align-items-center mb-2"},XZ=["disabled"],qZ={class:"px-5 d-flex gap-2 align-items-center"},ZZ={class:"d-flex gap-3"},JZ=zZ(()=>g("samp",null,"}",-1)),QZ={key:0,class:"ms-auto d-flex gap-3"},eJ={key:1,class:"ms-auto d-flex gap-3"};function tJ(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("ScheduleDropdown"),l=Se("VueDatePicker");return D(),V("div",{class:Ie(["card shadow-sm rounded-3 mb-2",{"border-warning-subtle":this.newJob}])},[g("div",WZ,[this.newJob?(D(),V("small",jZ,[g("span",KZ,[B(o,{t:"Unsaved Job"})])])):(D(),V("small",HZ,[g("strong",YZ,[B(o,{t:"Job ID"})]),g("samp",null,Ee(this.job.JobID),1)]))]),g("div",UZ,[g("div",GZ,[g("samp",null,[B(o,{t:"if"})]),B(a,{edit:i.edit,options:this.dropdowns.Field,data:this.job.Field,onUpdate:e[0]||(e[0]=c=>{this.job.Field=c})},null,8,["edit","options","data"]),g("samp",null,[B(o,{t:"is"})]),B(a,{edit:i.edit,options:this.dropdowns.Operator,data:this.job.Operator,onUpdate:e[1]||(e[1]=c=>this.job.Operator=c)},null,8,["edit","options","data"]),this.job.Field==="date"?(D(),Ce(l,{key:0,is24:!0,"min-date":new Date,"model-value":this.job.Value,"onUpdate:modelValue":this.parseTime,"time-picker-inline":"",format:"yyyy-MM-dd HH:mm:ss","preview-format":"yyyy-MM-dd HH:mm:ss",clearable:!1,disabled:!i.edit,dark:this.store.Configuration.Server.dashboard_theme==="dark"},null,8,["min-date","model-value","onUpdate:modelValue","disabled","dark"])):Ne((D(),V("input",{key:1,class:"form-control form-control-sm form-control-dark rounded-3 flex-grow-1",disabled:!i.edit,"onUpdate:modelValue":e[2]||(e[2]=c=>this.job.Value=c),style:{width:"auto"}},null,8,XZ)),[[Ke,this.job.Value]]),g("samp",null,Ee(this.dropdowns.Field.find(c=>c.value===this.job.Field)?.unit)+" { ",1)]),g("div",qZ,[g("samp",null,[B(o,{t:"then"})]),B(a,{edit:i.edit,options:this.dropdowns.Action,data:this.job.Action,onUpdate:e[3]||(e[3]=c=>this.job.Action=c)},null,8,["edit","options","data"])]),g("div",ZZ,[JZ,this.edit?(D(),V("div",eJ,[g("a",{role:"button",class:"text-secondary text-decoration-none",onClick:e[6]||(e[6]=c=>this.reset())},[He("[C] "),B(o,{t:"Cancel"})]),g("a",{role:"button",class:"text-primary ms-auto text-decoration-none",onClick:e[7]||(e[7]=c=>this.save())},[He("[S] "),B(o,{t:"Save"})])])):(D(),V("div",QZ,[g("a",{role:"button",class:"ms-auto text-decoration-none",onClick:e[4]||(e[4]=c=>this.edit=!0)},[He("[E] "),B(o,{t:"Edit"})]),g("a",{role:"button",onClick:e[5]||(e[5]=c=>this.delete()),class:"text-danger text-decoration-none"},[He("[D] "),B(o,{t:"Delete"})])]))])])],2)}const YT=Ye(VZ,[["render",tJ],["__scopeId","data-v-8f3f1b93"]]),nJ={name:"peerJobs",setup(){return{store:vi()}},props:{selectedPeer:Object},components:{LocaleText:Qe,SchedulePeerJob:YT,ScheduleDropdown:HT},data(){return{}},methods:{deleteJob(t){this.selectedPeer.jobs=this.selectedPeer.jobs.filter(e=>e.JobID!==t.JobID)},addJob(){this.selectedPeer.jobs.unshift(JSON.parse(JSON.stringify({JobID:Os().toString(),Configuration:this.selectedPeer.configuration.Name,Peer:this.selectedPeer.id,Field:this.store.PeerScheduleJobs.dropdowns.Field[0].value,Operator:this.store.PeerScheduleJobs.dropdowns.Operator[0].value,Value:"",CreationDate:"",ExpireDate:"",Action:this.store.PeerScheduleJobs.dropdowns.Action[0].value})))}}},iJ=t=>(bn("data-v-5bbdd42b"),t=t(),wn(),t),sJ={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},rJ={class:"container d-flex h-100 w-100"},oJ={class:"m-auto modal-dialog-centered dashboardModal"},aJ={class:"card rounded-3 shadow",style:{width:"700px"}},lJ={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},cJ={class:"mb-0 fw-normal"},uJ={class:"card-body px-4 pb-4 pt-2 position-relative"},dJ={class:"d-flex align-items-center mb-3"},hJ=iJ(()=>g("i",{class:"bi bi-plus-lg me-2"},null,-1)),fJ={class:"card shadow-sm",key:"none",style:{height:"153px"}},gJ={class:"card-body text-muted text-center d-flex"},pJ={class:"m-auto"};function mJ(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("SchedulePeerJob");return D(),V("div",sJ,[g("div",rJ,[g("div",oJ,[g("div",aJ,[g("div",lJ,[g("h4",cJ,[B(o,{t:"Schedule Jobs"})]),g("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=l=>this.$emit("close"))})]),g("div",uJ,[g("div",dJ,[g("button",{class:"btn bg-primary-subtle border-1 border-primary-subtle text-primary-emphasis rounded-3 shadow",onClick:e[1]||(e[1]=l=>this.addJob())},[hJ,B(o,{t:"Job"})])]),B(jl,{name:"schedulePeerJobTransition",tag:"div",class:"position-relative"},{default:Re(()=>[(D(!0),V($e,null,Xe(this.selectedPeer.jobs,(l,c)=>(D(),Ce(a,{onRefresh:e[2]||(e[2]=u=>this.$emit("refresh")),onDelete:u=>this.deleteJob(l),dropdowns:this.store.PeerScheduleJobs.dropdowns,key:l.JobID,pjob:l},null,8,["onDelete","dropdowns","pjob"]))),128)),this.selectedPeer.jobs.length===0?(D(),V("div",fJ,[g("div",gJ,[g("h6",pJ,[B(o,{t:"This peer does not have any job yet."})])])])):ce("",!0)]),_:1})])])])])])}const _J=Ye(nJ,[["render",mJ],["__scopeId","data-v-5bbdd42b"]]),yJ={name:"peerJobsAllModal",setup(){return{store:vi()}},components:{LocaleText:Qe,SchedulePeerJob:YT},props:{configurationPeers:Array[Object]},methods:{getuuid(){return Os()}},computed:{getAllJobs(){return this.configurationPeers.filter(t=>t.jobs.length>0)}}},vJ={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},bJ={class:"container d-flex h-100 w-100"},wJ={class:"m-auto modal-dialog-centered dashboardModal"},xJ={class:"card rounded-3 shadow",style:{width:"700px"}},EJ={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},SJ={class:"mb-0 fw-normal"},CJ={class:"card-body px-4 pb-4 pt-2"},TJ={key:0,class:"accordion",id:"peerJobsLogsModalAccordion"},kJ={class:"accordion-header"},AJ=["data-bs-target"],MJ={key:0},IJ={class:"text-muted"},PJ=["id"],RJ={class:"accordion-body"},DJ={key:1,class:"card shadow-sm",style:{height:"153px"}},$J={class:"card-body text-muted text-center d-flex"},LJ={class:"m-auto"};function OJ(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("SchedulePeerJob");return D(),V("div",vJ,[g("div",bJ,[g("div",wJ,[g("div",xJ,[g("div",EJ,[g("h4",SJ,[B(o,{t:"All Active Jobs"})]),g("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=l=>this.$emit("close"))})]),g("div",CJ,[this.getAllJobs.length>0?(D(),V("div",TJ,[(D(!0),V($e,null,Xe(this.getAllJobs,(l,c)=>(D(),V("div",{class:"accordion-item",key:l.id},[g("h2",kJ,[g("button",{class:"accordion-button collapsed",type:"button","data-bs-toggle":"collapse","data-bs-target":"#collapse_"+c},[g("small",null,[g("strong",null,[l.name?(D(),V("span",MJ,Ee(l.name)+" • ",1)):ce("",!0),g("samp",IJ,Ee(l.id),1)])])],8,AJ)]),g("div",{id:"collapse_"+c,class:"accordion-collapse collapse","data-bs-parent":"#peerJobsLogsModalAccordion"},[g("div",RJ,[(D(!0),V($e,null,Xe(l.jobs,u=>(D(),Ce(a,{onDelete:e[1]||(e[1]=d=>this.$emit("refresh")),onRefresh:e[2]||(e[2]=d=>this.$emit("refresh")),dropdowns:this.store.PeerScheduleJobs.dropdowns,viewOnly:!0,key:u.JobID,pjob:u},null,8,["dropdowns","pjob"]))),128))])],8,PJ)]))),128))])):(D(),V("div",DJ,[g("div",$J,[g("span",LJ,[B(o,{t:"No active job at the moment."})])])]))])])])])])}const NJ=Ye(yJ,[["render",OJ]]),FJ={name:"peerJobsLogsModal",components:{LocaleText:Qe},props:{configurationInfo:Object},data(){return{dataLoading:!0,data:[],logFetchTime:void 0,showLogID:!1,showJobID:!0,showSuccessJob:!0,showFailedJob:!0,showLogAmount:10}},async mounted(){await this.fetchLog()},methods:{async fetchLog(){this.dataLoading=!0,await Vt(`/api/getPeerScheduleJobLogs/${this.configurationInfo.Name}`,{},t=>{this.data=t.data,this.logFetchTime=pi().format("YYYY-MM-DD HH:mm:ss"),this.dataLoading=!1})}},computed:{getLogs(){return this.data.filter(t=>this.showSuccessJob&&t.Status==="1"||this.showFailedJob&&t.Status==="0")},showLogs(){return this.getLogs.slice(0,this.showLogAmount)}}},BJ={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},VJ={class:"container-fluid d-flex h-100 w-100"},zJ={class:"m-auto mt-0 modal-dialog-centered dashboardModal",style:{width:"100%"}},WJ={class:"card rounded-3 shadow w-100"},HJ={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-0"},YJ={class:"mb-0"},jJ={class:"card-body px-4 pb-4 pt-2"},KJ={key:0},UJ={class:"mb-2 d-flex gap-3"},GJ=g("i",{class:"bi bi-arrow-clockwise me-2"},null,-1),XJ={class:"d-flex gap-3 align-items-center"},qJ={class:"text-muted"},ZJ={class:"form-check"},JJ={class:"form-check-label",for:"jobLogsShowSuccessCheck"},QJ={class:"badge text-success-emphasis bg-success-subtle"},eQ={class:"form-check"},tQ={class:"form-check-label",for:"jobLogsShowFailedCheck"},nQ={class:"badge text-danger-emphasis bg-danger-subtle"},iQ={class:"d-flex gap-3 align-items-center ms-auto"},sQ={class:"text-muted"},rQ={class:"form-check"},oQ={class:"form-check-label",for:"jobLogsShowJobIDCheck"},aQ={class:"form-check"},lQ={class:"form-check-label",for:"jobLogsShowLogIDCheck"},cQ={class:"table"},uQ={scope:"col"},dQ={key:0,scope:"col"},hQ={key:1,scope:"col"},fQ={scope:"col"},gQ={scope:"col"},pQ={style:{"font-size":"0.875rem"}},mQ={scope:"row"},_Q={key:0},yQ={class:"text-muted"},vQ={key:1},bQ={class:"text-muted"},wQ={class:"d-flex gap-2"},xQ=g("i",{class:"bi bi-chevron-down me-2"},null,-1),EQ=g("i",{class:"bi bi-chevron-up me-2"},null,-1),SQ={key:1,class:"d-flex align-items-center flex-column"},CQ=g("div",{class:"spinner-border text-body",role:"status"},[g("span",{class:"visually-hidden"},"Loading...")],-1),TQ=[CQ];function kQ(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",BJ,[g("div",VJ,[g("div",zJ,[g("div",WJ,[g("div",HJ,[g("h4",YJ,[B(o,{t:"Jobs Logs"})]),g("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=a=>this.$emit("close"))})]),g("div",jJ,[this.dataLoading?(D(),V("div",SQ,TQ)):(D(),V("div",KJ,[g("p",null,[B(o,{t:"Updated at"}),He(" : "+Ee(this.logFetchTime),1)]),g("div",UJ,[g("button",{onClick:e[1]||(e[1]=a=>this.fetchLog()),class:"btn btn-sm rounded-3 shadow-sm text-info-emphasis bg-info-subtle border-1 border-info-subtle me-1"},[GJ,B(o,{t:"Refresh"})]),g("div",XJ,[g("span",qJ,[B(o,{t:"Filter"})]),g("div",ZJ,[Ne(g("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[2]||(e[2]=a=>this.showSuccessJob=a),id:"jobLogsShowSuccessCheck"},null,512),[[Jn,this.showSuccessJob]]),g("label",JJ,[g("span",QJ,[B(o,{t:"Success"})])])]),g("div",eQ,[Ne(g("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[3]||(e[3]=a=>this.showFailedJob=a),id:"jobLogsShowFailedCheck"},null,512),[[Jn,this.showFailedJob]]),g("label",tQ,[g("span",nQ,[B(o,{t:"Failed"})])])])]),g("div",iQ,[g("span",sQ,[B(o,{t:"Display"})]),g("div",rQ,[Ne(g("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[4]||(e[4]=a=>s.showJobID=a),id:"jobLogsShowJobIDCheck"},null,512),[[Jn,s.showJobID]]),g("label",oQ,[B(o,{t:"Job ID"})])]),g("div",aQ,[Ne(g("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[5]||(e[5]=a=>s.showLogID=a),id:"jobLogsShowLogIDCheck"},null,512),[[Jn,s.showLogID]]),g("label",lQ,[B(o,{t:"Log ID"})])])])]),g("table",cQ,[g("thead",null,[g("tr",null,[g("th",uQ,[B(o,{t:"Date"})]),s.showLogID?(D(),V("th",dQ,[B(o,{t:"Log ID"})])):ce("",!0),s.showJobID?(D(),V("th",hQ,[B(o,{t:"Job ID"})])):ce("",!0),g("th",fQ,[B(o,{t:"Status"})]),g("th",gQ,[B(o,{t:"Message"})])])]),g("tbody",null,[(D(!0),V($e,null,Xe(this.showLogs,a=>(D(),V("tr",pQ,[g("th",mQ,Ee(a.LogDate),1),s.showLogID?(D(),V("td",_Q,[g("samp",yQ,Ee(a.LogID),1)])):ce("",!0),s.showJobID?(D(),V("td",vQ,[g("samp",bQ,Ee(a.JobID),1)])):ce("",!0),g("td",null,[g("span",{class:Ie(["badge",[a.Status==="1"?"text-success-emphasis bg-success-subtle":"text-danger-emphasis bg-danger-subtle"]])},Ee(a.Status==="1"?"Success":"Failed"),3)]),g("td",null,Ee(a.Message),1)]))),256))])]),g("div",wQ,[this.getLogs.length>this.showLogAmount?(D(),V("button",{key:0,onClick:e[6]||(e[6]=a=>this.showLogAmount+=20),class:"btn btn-sm rounded-3 shadow-sm text-primary-emphasis bg-primary-subtle border-1 border-primary-subtle"},[xQ,He(" Show More ")])):ce("",!0),this.showLogAmount>20?(D(),V("button",{key:1,onClick:e[7]||(e[7]=a=>this.showLogAmount=20),class:"btn btn-sm rounded-3 shadow-sm text-primary-emphasis bg-primary-subtle border-1 border-primary-subtle"},[EQ,He(" Collapse ")])):ce("",!0)])]))])])])])])}const AQ=Ye(FJ,[["render",kQ]]),MQ={name:"peerShareLinkModal",props:{peer:Object},components:{LocaleText:Qe,VueDatePicker:Bu},data(){return{dataCopy:void 0,loading:!1}},setup(){return{store:st()}},mounted(){this.dataCopy=JSON.parse(JSON.stringify(this.peer.ShareLink)).at(0)},watch:{"peer.ShareLink":{deep:!0,handler(t,e){e.length!==t.length&&(this.dataCopy=JSON.parse(JSON.stringify(this.peer.ShareLink)).at(0))}}},methods:{startSharing(){this.loading=!0,kt("/api/sharePeer/create",{Configuration:this.peer.configuration.Name,Peer:this.peer.id,ExpireDate:pi().add(7,"d").format("YYYY-MM-DD HH:mm:ss")},t=>{t.status?(this.peer.ShareLink=t.data,this.dataCopy=t.data.at(0)):this.store.newMessage("Server","Share link failed to create. Reason: "+t.message,"danger"),this.loading=!1})},updateLinkExpireDate(){kt("/api/sharePeer/update",this.dataCopy,t=>{t.status?(this.dataCopy=t.data.at(0),this.peer.ShareLink=t.data,this.store.newMessage("Server","Link expire date updated","success")):this.store.newMessage("Server","Link expire date failed to update. Reason: "+t.message,"danger"),this.loading=!1})},stopSharing(){this.loading=!0,this.dataCopy.ExpireDate=pi().format("YYYY-MM-DD HH:mm:ss"),this.updateLinkExpireDate()},parseTime(t){t?this.dataCopy.ExpireDate=pi(t).format("YYYY-MM-DD HH:mm:ss"):this.dataCopy.ExpireDate=void 0,this.updateLinkExpireDate()}},computed:{getUrl(){const t=this.store.getActiveCrossServer();return t?`${t.host}/${this.$router.resolve({path:"/share",query:{ShareID:this.dataCopy.ShareID}}).href}`:window.location.origin+window.location.pathname+this.$router.resolve({path:"/share",query:{ShareID:this.dataCopy.ShareID}}).href}}},IQ={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},PQ={class:"container d-flex h-100 w-100"},RQ={class:"m-auto modal-dialog-centered dashboardModal",style:{width:"500px"}},DQ={class:"card rounded-3 shadow flex-grow-1"},$Q={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4"},LQ={class:"mb-0"},OQ={key:0,class:"card-body px-4 pb-4"},NQ={key:0},FQ={class:"mb-3 text-muted"},BQ=["disabled"],VQ=g("i",{class:"bi bi-send-fill me-2"},null,-1),zQ=[VQ],WQ={key:1},HQ={class:"d-flex gap-2 mb-4"},YQ=g("i",{class:"bi bi-link-45deg"},null,-1),jQ=["href"],KQ={class:"d-flex flex-column gap-2 mb-3"},UQ=g("i",{class:"bi bi-calendar me-2"},null,-1),GQ=["disabled"],XQ=g("i",{class:"bi bi-send-slash-fill me-2"},null,-1),qQ=[XQ];function ZQ(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("VueDatePicker");return D(),V("div",IQ,[g("div",PQ,[g("div",RQ,[g("div",DQ,[g("div",$Q,[g("h4",LQ,[B(o,{t:"Share Peer"})]),g("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=l=>this.$emit("close"))})]),this.peer.ShareLink?(D(),V("div",OQ,[this.dataCopy?(D(),V("div",WQ,[g("div",HQ,[YQ,g("a",{href:this.getUrl,class:"text-decoration-none",target:"_blank"},Ee(r.getUrl),9,jQ)]),g("div",KQ,[g("small",null,[UQ,B(o,{t:"Expire At"})]),B(a,{is24:!0,"min-date":new Date,"model-value":this.dataCopy.ExpireDate,"onUpdate:modelValue":this.parseTime,"time-picker-inline":"",format:"yyyy-MM-dd HH:mm:ss","preview-format":"yyyy-MM-dd HH:mm:ss",dark:this.store.Configuration.Server.dashboard_theme==="dark"},null,8,["min-date","model-value","onUpdate:modelValue","dark"])]),g("button",{onClick:e[2]||(e[2]=l=>this.stopSharing()),disabled:this.loading,class:"w-100 btn bg-danger-subtle text-danger-emphasis border-1 border-danger-subtle rounded-3 shadow-sm"},[g("span",{class:Ie({"animate__animated animate__flash animate__infinite animate__slower":this.loading})},qQ,2),this.loading?(D(),Ce(o,{key:0,t:"Stop Sharing..."})):(D(),Ce(o,{key:1,t:"Stop Sharing"}))],8,GQ)])):(D(),V("div",NQ,[g("h6",FQ,[B(o,{t:"Currently the peer is not sharing"})]),g("button",{onClick:e[1]||(e[1]=l=>this.startSharing()),disabled:this.loading,class:"w-100 btn bg-success-subtle text-success-emphasis border-1 border-success-subtle rounded-3 shadow-sm"},[g("span",{class:Ie({"animate__animated animate__flash animate__infinite animate__slower":this.loading})},zQ,2),this.loading?(D(),Ce(o,{key:0,t:"Sharing..."})):(D(),Ce(o,{key:1,t:"Start Sharing"}))],8,BQ)]))])):ce("",!0)])])])])}const JQ=Ye(MQ,[["render",ZQ]]);Tf.register(rU,kf,wU,pU,jC,Fj,KC,UC,zj,Vj,Wj,Hj,dG,fG,mG,IG,hm,$G,CU,jU,ZU,QU,aG);const QQ={name:"peerList",components:{LocaleText:Qe,PeerShareLinkModal:JQ,PeerJobsLogsModal:AQ,PeerJobsAllModal:NJ,PeerJobs:_J,PeerCreate:WT,PeerQRCode:P9,PeerSettings:PX,PeerSearch:D8,Peer:AH,Line:HG,Bar:WG},setup(){const t=st(),e=vi(),n=we(void 0);return{dashboardConfigurationStore:t,wireguardConfigurationStore:e,interval:n}},data(){return{configurationToggling:!1,loading:!1,error:null,configurationInfo:[],configurationPeers:[],historyDataSentDifference:[],historyDataReceivedDifference:[],historySentData:{labels:[],datasets:[{label:"Data Sent",data:[],fill:!1,borderColor:"#198754",tension:0}]},historyReceiveData:{labels:[],datasets:[{label:"Data Received",data:[],fill:!1,borderColor:"#0d6efd",tension:0}]},peerSetting:{modalOpen:!1,selectedPeer:void 0},peerScheduleJobs:{modalOpen:!1,selectedPeer:void 0},peerQRCode:{modalOpen:!1,peerConfigData:void 0},peerCreate:{modalOpen:!1},peerScheduleJobsAll:{modalOpen:!1},peerScheduleJobsLogs:{modalOpen:!1},peerShare:{modalOpen:!1,selectedPeer:void 0}}},mounted(){},watch:{$route:{immediate:!0,handler(){clearInterval(this.dashboardConfigurationStore.Peers.RefreshInterval),this.loading=!0;let t=this.$route.params.id;this.configurationInfo=[],this.configurationPeers=[],t&&(this.getPeers(t),this.setPeerInterval())}},"dashboardConfigurationStore.Configuration.Server.dashboard_refresh_interval"(){clearInterval(this.dashboardConfigurationStore.Peers.RefreshInterval),this.setPeerInterval()}},beforeRouteLeave(){clearInterval(this.dashboardConfigurationStore.Peers.RefreshInterval)},methods:{toggle(){this.configurationToggling=!0,Vt("/api/toggleWireguardConfiguration/",{configurationName:this.configurationInfo.Name},t=>{t.status?this.dashboardConfigurationStore.newMessage("Server",`${this.configurationInfo.Name} ${t.data?"is on":"is off"}`,"success"):this.dashboardConfigurationStore.newMessage("Server",t.message,"danger"),this.configurationInfo.Status=t.data,this.configurationToggling=!1})},getPeers(t=this.$route.params.id){Vt("/api/getWireguardConfigurationInfo",{configurationName:t},e=>{if(this.configurationInfo=e.data.configurationInfo,this.configurationPeers=e.data.configurationPeers,this.configurationPeers.forEach(n=>{n.restricted=!1}),e.data.configurationRestrictedPeers.forEach(n=>{n.restricted=!0,this.configurationPeers.push(n)}),this.loading=!1,this.configurationPeers.length>0){const n=this.configurationPeers.map(s=>s.total_sent+s.cumu_sent).reduce((s,r)=>s+r).toFixed(4),i=this.configurationPeers.map(s=>s.total_receive+s.cumu_receive).reduce((s,r)=>s+r).toFixed(4);this.historyDataSentDifference[this.historyDataSentDifference.length-1]!==n&&(this.historyDataSentDifference.length>0&&(this.historySentData={labels:[...this.historySentData.labels,pi().format("HH:mm:ss A")],datasets:[{label:"Data Sent",data:[...this.historySentData.datasets[0].data,((n-this.historyDataSentDifference[this.historyDataSentDifference.length-1])*1e3).toFixed(4)],fill:!1,borderColor:"#198754",tension:0}]}),this.historyDataSentDifference.push(n)),this.historyDataReceivedDifference[this.historyDataReceivedDifference.length-1]!==i&&(this.historyDataReceivedDifference.length>0&&(this.historyReceiveData={labels:[...this.historyReceiveData.labels,pi().format("HH:mm:ss A")],datasets:[{label:"Data Received",data:[...this.historyReceiveData.datasets[0].data,((i-this.historyDataReceivedDifference[this.historyDataReceivedDifference.length-1])*1e3).toFixed(4)],fill:!1,borderColor:"#0d6efd",tension:0}]}),this.historyDataReceivedDifference.push(i))}})},setPeerInterval(){this.dashboardConfigurationStore.Peers.RefreshInterval=setInterval(()=>{this.getPeers()},parseInt(this.dashboardConfigurationStore.Configuration.Server.dashboard_refresh_interval))}},computed:{configurationSummary(){return{connectedPeers:this.configurationPeers.filter(e=>e.status==="running").length,totalUsage:this.configurationPeers.length>0?this.configurationPeers.filter(e=>!e.restricted).map(e=>e.total_data+e.cumu_data).reduce((e,n)=>e+n,0).toFixed(4):0,totalReceive:this.configurationPeers.length>0?this.configurationPeers.filter(e=>!e.restricted).map(e=>e.total_receive+e.cumu_receive).reduce((e,n)=>e+n,0).toFixed(4):0,totalSent:this.configurationPeers.length>0?this.configurationPeers.filter(e=>!e.restricted).map(e=>e.total_sent+e.cumu_sent).reduce((e,n)=>e+n,0).toFixed(4):0}},receiveData(){return this.historyReceiveData},sentData(){return this.historySentData},individualDataUsage(){return{labels:this.configurationPeers.map(t=>t.name?t.name:`Untitled Peer - ${t.id}`),datasets:[{label:"Total Data Usage",data:this.configurationPeers.map(t=>t.cumu_data+t.total_data),backgroundColor:this.configurationPeers.map(t=>"#0dcaf0"),tooltip:{callbacks:{label:t=>`${t.formattedValue} GB`}}}]}},individualDataUsageChartOption(){return{responsive:!0,plugins:{legend:{display:!1}},scales:{x:{ticks:{display:!1},grid:{display:!1}},y:{ticks:{callback:(t,e)=>`${t} GB`},grid:{display:!1}}}}},chartOptions(){return{responsive:!0,plugins:{legend:{display:!1},tooltip:{callbacks:{label:t=>`${t.formattedValue} MB/s`}}},scales:{x:{ticks:{display:!1},grid:{display:!1}},y:{ticks:{callback:(t,e)=>`${t} MB/s`},grid:{display:!1}}}}},searchPeers(){new Gl(this.configurationPeers,{keys:["name","id","allowed_ip"]});const t=this.wireguardConfigurationStore.searchString?this.configurationPeers.filter(e=>e.name.includes(this.wireguardConfigurationStore.searchString)||e.id.includes(this.wireguardConfigurationStore.searchString)||e.allowed_ip.includes(this.wireguardConfigurationStore.searchString)):this.configurationPeers;return this.dashboardConfigurationStore.Configuration.Server.dashboard_sort==="restricted"?t.slice().sort((e,n)=>e[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]n[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]?-1:0):t.slice().sort((e,n)=>e[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]n[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]?1:0)}}},$f=t=>(bn("data-v-dc7f794a"),t=t(),wn(),t),eee={key:0,class:"container-md"},tee={class:"d-flex align-items-center"},nee={CLASS:"text-muted"},iee={class:"d-flex align-items-center gap-3"},see={class:"mb-0"},ree={class:"card rounded-3 bg-transparent shadow-sm ms-auto"},oee={class:"card-body py-2 d-flex align-items-center"},aee={class:"mb-0 text-muted"},lee={class:"form-check form-switch ms-auto"},cee=["for"],uee={key:4,class:"spinner-border spinner-border-sm ms-2","aria-hidden":"true"},dee=["disabled","id"],hee={class:"row mt-3 gy-2 gx-2 mb-2"},fee={class:"col-6 col-lg-3"},gee={class:"card rounded-3 bg-transparent shadow-sm"},pee={class:"card-body py-2"},mee={class:"mb-0 text-muted"},_ee={class:"col-6 col-lg-3"},yee={class:"card rounded-3 bg-transparent shadow-sm"},vee={class:"card-body py-2"},bee={class:"mb-0 text-muted"},wee={style:{"word-break":"break-all"},class:"col-12 col-lg-6"},xee={class:"card rounded-3 bg-transparent shadow-sm"},Eee={class:"card-body py-2"},See={class:"mb-0 text-muted"},Cee={class:"row gx-2 gy-2 mb-2"},Tee={class:"col-6 col-lg-3"},kee={class:"card rounded-3 bg-transparent shadow-sm"},Aee={class:"card-body d-flex"},Mee={class:"mb-0 text-muted"},Iee={class:"h4"},Pee=$f(()=>g("i",{class:"bi bi-ethernet ms-auto h2 text-muted"},null,-1)),Ree={class:"col-6 col-lg-3"},Dee={class:"card rounded-3 bg-transparent shadow-sm"},$ee={class:"card-body d-flex"},Lee={class:"mb-0 text-muted"},Oee={class:"h4"},Nee=$f(()=>g("i",{class:"bi bi-arrow-down-up ms-auto h2 text-muted"},null,-1)),Fee={class:"col-6 col-lg-3"},Bee={class:"card rounded-3 bg-transparent shadow-sm"},Vee={class:"card-body d-flex"},zee={class:"mb-0 text-muted"},Wee={class:"h4 text-primary"},Hee=$f(()=>g("i",{class:"bi bi-arrow-down ms-auto h2 text-muted"},null,-1)),Yee={class:"col-6 col-lg-3"},jee={class:"card rounded-3 bg-transparent shadow-sm"},Kee={class:"card-body d-flex"},Uee={class:"mb-0 text-muted"},Gee={class:"h4 text-success"},Xee=$f(()=>g("i",{class:"bi bi-arrow-up ms-auto h2 text-muted"},null,-1)),qee={class:"row gx-2 gy-2 mb-3"},Zee={class:"col-12 col-lg-6"},Jee={class:"card rounded-3 bg-transparent shadow-sm",style:{height:"270px"}},Qee={class:"card-header bg-transparent border-0"},ete={class:"text-muted"},tte={class:"card-body pt-1"},nte={class:"col-sm col-lg-3"},ite={class:"card rounded-3 bg-transparent shadow-sm",style:{height:"270px"}},ste={class:"card-header bg-transparent border-0"},rte={class:"text-muted"},ote={class:"card-body pt-1"},ate={class:"col-sm col-lg-3"},lte={class:"card rounded-3 bg-transparent shadow-sm",style:{height:"270px"}},cte={class:"card-header bg-transparent border-0"},ute={class:"text-muted"},dte={class:"card-body pt-1"},hte={class:"mb-3"};function fte(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("Bar"),l=Se("Line"),c=Se("PeerSearch"),u=Se("Peer"),d=Se("PeerSettings"),h=Se("PeerQRCode"),f=Se("PeerJobs"),p=Se("PeerJobsAllModal"),m=Se("PeerJobsLogsModal"),y=Se("PeerShareLinkModal");return this.loading?ce("",!0):(D(),V("div",eee,[g("div",tee,[g("div",null,[g("small",nee,[B(o,{t:"CONFIGURATION"})]),g("div",iee,[g("h1",see,[g("samp",null,Ee(this.configurationInfo.Name),1)])])]),g("div",ree,[g("div",oee,[g("div",null,[g("p",aee,[g("small",null,[B(o,{t:"Status"})])]),g("div",lee,[g("label",{class:"form-check-label",style:{cursor:"pointer"},for:"switch"+this.configurationInfo.id},[!this.configurationInfo.Status&&this.configurationToggling?(D(),Ce(o,{key:0,t:"Turning Off..."})):this.configurationInfo.Status&&this.configurationToggling?(D(),Ce(o,{key:1,t:"Turning On..."})):this.configurationInfo.Status&&!this.configurationToggling?(D(),Ce(o,{key:2,t:"On"})):!this.configurationInfo.Status&&!this.configurationToggling?(D(),Ce(o,{key:3,t:"Off"})):ce("",!0),this.configurationToggling?(D(),V("span",uee)):ce("",!0)],8,cee),Ne(g("input",{class:"form-check-input",style:{cursor:"pointer"},disabled:this.configurationToggling,type:"checkbox",role:"switch",id:"switch"+this.configurationInfo.id,onChange:e[0]||(e[0]=v=>this.toggle()),"onUpdate:modelValue":e[1]||(e[1]=v=>this.configurationInfo.Status=v)},null,40,dee),[[Jn,this.configurationInfo.Status]])])]),g("div",{class:Ie(["dot ms-5",{active:this.configurationInfo.Status}])},null,2)])])]),g("div",hee,[g("div",fee,[g("div",gee,[g("div",pee,[g("p",mee,[g("small",null,[B(o,{t:"Address"})])]),He(" "+Ee(this.configurationInfo.Address),1)])])]),g("div",_ee,[g("div",yee,[g("div",vee,[g("p",bee,[g("small",null,[B(o,{t:"Listen Port"})])]),He(" "+Ee(this.configurationInfo.ListenPort),1)])])]),g("div",wee,[g("div",xee,[g("div",Eee,[g("p",See,[g("small",null,[B(o,{t:"Public Key"})])]),g("samp",null,Ee(this.configurationInfo.PublicKey),1)])])])]),g("div",Cee,[g("div",Tee,[g("div",kee,[g("div",Aee,[g("div",null,[g("p",Mee,[g("small",null,[B(o,{t:"Connected Peers"})])]),g("strong",Iee,Ee(r.configurationSummary.connectedPeers),1)]),Pee])])]),g("div",Ree,[g("div",Dee,[g("div",$ee,[g("div",null,[g("p",Lee,[g("small",null,[B(o,{t:"Total Usage"})])]),g("strong",Oee,Ee(r.configurationSummary.totalUsage)+" GB",1)]),Nee])])]),g("div",Fee,[g("div",Bee,[g("div",Vee,[g("div",null,[g("p",zee,[g("small",null,[B(o,{t:"Total Received"})])]),g("strong",Wee,Ee(r.configurationSummary.totalReceive)+" GB",1)]),Hee])])]),g("div",Yee,[g("div",jee,[g("div",Kee,[g("div",null,[g("p",Uee,[g("small",null,[B(o,{t:"Total Sent"})])]),g("strong",Gee,Ee(r.configurationSummary.totalSent)+" GB",1)]),Xee])])])]),g("div",qee,[g("div",Zee,[g("div",Jee,[g("div",Qee,[g("small",ete,[B(o,{t:"Peers Data Usage"})])]),g("div",tte,[B(a,{data:r.individualDataUsage,options:r.individualDataUsageChartOption,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["data","options"])])])]),g("div",nte,[g("div",ite,[g("div",ste,[g("small",rte,[B(o,{t:"Real Time Received Data Usage"})])]),g("div",ote,[B(l,{options:r.chartOptions,data:r.receiveData,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["options","data"])])])]),g("div",ate,[g("div",lte,[g("div",cte,[g("small",ute,[B(o,{t:"Real Time Sent Data Usage"})])]),g("div",dte,[B(l,{options:r.chartOptions,data:r.sentData,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["options","data"])])])])]),g("div",hte,[B(c,{onJobsAll:e[2]||(e[2]=v=>this.peerScheduleJobsAll.modalOpen=!0),onJobLogs:e[3]||(e[3]=v=>this.peerScheduleJobsLogs.modalOpen=!0),configuration:this.configurationInfo},null,8,["configuration"]),B(jl,{name:"list",tag:"div",class:"row gx-2 gy-2 z-0"},{default:Re(()=>[(D(!0),V($e,null,Xe(this.searchPeers,v=>(D(),V("div",{class:"col-12 col-lg-6 col-xl-4",key:v.id},[B(u,{Peer:v,onShare:b=>{this.peerShare.selectedPeer=v.id,this.peerShare.modalOpen=!0},onRefresh:e[4]||(e[4]=b=>this.getPeers()),onJobs:b=>{s.peerScheduleJobs.modalOpen=!0,s.peerScheduleJobs.selectedPeer=this.configurationPeers.find(E=>E.id===v.id)},onSetting:b=>{s.peerSetting.modalOpen=!0,s.peerSetting.selectedPeer=this.configurationPeers.find(E=>E.id===v.id)},onQrcode:e[5]||(e[5]=b=>{this.peerQRCode.peerConfigData=b,this.peerQRCode.modalOpen=!0})},null,8,["Peer","onShare","onJobs","onSetting"])]))),128))]),_:1})]),B(Rt,{name:"zoom"},{default:Re(()=>[this.peerSetting.modalOpen?(D(),Ce(d,{key:"settings",selectedPeer:this.peerSetting.selectedPeer,onRefresh:e[6]||(e[6]=v=>this.getPeers()),onClose:e[7]||(e[7]=v=>this.peerSetting.modalOpen=!1)},null,8,["selectedPeer"])):ce("",!0)]),_:1}),B(Rt,{name:"zoom"},{default:Re(()=>[s.peerQRCode.modalOpen?(D(),Ce(h,{peerConfigData:this.peerQRCode.peerConfigData,key:"qrcode",onClose:e[8]||(e[8]=v=>this.peerQRCode.modalOpen=!1)},null,8,["peerConfigData"])):ce("",!0)]),_:1}),B(Rt,{name:"zoom"},{default:Re(()=>[this.peerScheduleJobs.modalOpen?(D(),Ce(f,{key:0,onRefresh:e[9]||(e[9]=v=>this.getPeers()),selectedPeer:this.peerScheduleJobs.selectedPeer,onClose:e[10]||(e[10]=v=>this.peerScheduleJobs.modalOpen=!1)},null,8,["selectedPeer"])):ce("",!0)]),_:1}),B(Rt,{name:"zoom"},{default:Re(()=>[this.peerScheduleJobsAll.modalOpen?(D(),Ce(p,{key:0,onRefresh:e[11]||(e[11]=v=>this.getPeers()),onClose:e[12]||(e[12]=v=>this.peerScheduleJobsAll.modalOpen=!1),configurationPeers:this.configurationPeers},null,8,["configurationPeers"])):ce("",!0)]),_:1}),B(Rt,{name:"zoom"},{default:Re(()=>[this.peerScheduleJobsLogs.modalOpen?(D(),Ce(m,{key:0,onClose:e[13]||(e[13]=v=>this.peerScheduleJobsLogs.modalOpen=!1),configurationInfo:this.configurationInfo},null,8,["configurationInfo"])):ce("",!0)]),_:1}),B(Rt,{name:"zoom"},{default:Re(()=>[this.peerShare.modalOpen?(D(),Ce(y,{key:0,onClose:e[14]||(e[14]=v=>{this.peerShare.modalOpen=!1,this.peerShare.selectedPeer=void 0}),peer:this.configurationPeers.find(v=>v.id===this.peerShare.selectedPeer)},null,8,["peer"])):ce("",!0)]),_:1})]))}const gte=Ye(QQ,[["render",fte],["__scopeId","data-v-dc7f794a"]]);class br{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}const Ll={PROPERTYCHANGE:"propertychange"};class Lf{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function pte(t,e,n){let i,s;n=n||cr;let r=0,o=t.length,a=!1;for(;r>1),s=+n(t[i],e),s<0?r=i+1:(o=i,a=!s);return a?r:~r}function cr(t,e){return t>e?1:t0?s-1:s}return i-1}if(n>0){for(let s=1;s0||n&&o===0)})}function mu(){return!0}function Nf(){return!1}function Ol(){}function jT(t){let e,n,i;return function(){const s=Array.prototype.slice.call(arguments);return(!n||this!==i||!xo(s,n))&&(i=this,n=s,e=t.apply(this,arguments)),e}}function yte(t){function e(){let n;try{n=t()}catch(i){return Promise.reject(i)}return n instanceof Promise?n:Promise.resolve(n)}return e()}function ju(t){for(const e in t)delete t[e]}function Nl(t){let e;for(e in t)return!1;return!e}class Ff extends Lf{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,n){if(!e||!n)return;const i=this.listeners_||(this.listeners_={}),s=i[e]||(i[e]=[]);s.includes(n)||s.push(n)}dispatchEvent(e){const n=typeof e=="string",i=n?e:e.type,s=this.listeners_&&this.listeners_[i];if(!s)return;const r=n?new br(e):e;r.target||(r.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in o||(o[i]=0,a[i]=0),++o[i];let l;for(let c=0,u=s.length;c0:!1}removeEventListener(e,n){if(!this.listeners_)return;const i=this.listeners_[e];if(!i)return;const s=i.indexOf(n);s!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(i[s]=Ol,++this.pendingRemovals_[e]):(i.splice(s,1),i.length===0&&delete this.listeners_[e]))}}const et={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function ft(t,e,n,i,s){if(s){const o=n;n=function(){t.removeEventListener(e,n),o.apply(i??this,arguments)}}else i&&i!==t&&(n=n.bind(i));const r={target:t,type:e,listener:n};return t.addEventListener(e,n),r}function Rh(t,e,n,i){return ft(t,e,n,i,!0)}function Dt(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),ju(t))}class Ku extends Ff{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(et.CHANGE)}getRevision(){return this.revision_}onInternal(e,n){if(Array.isArray(e)){const i=e.length,s=new Array(i);for(let r=0;r0;)this.pop()}extend(e){for(let n=0,i=e.length;nthis.getLength())throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(n),this.array_.splice(e,0,n),this.updateLength_(),this.dispatchEvent(new Bd(ci.ADD,n,e))}pop(){return this.removeAt(this.getLength()-1)}push(e){this.unique_&&this.assertUnique_(e);const n=this.getLength();return this.insertAt(n,e),this.getLength()}remove(e){const n=this.array_;for(let i=0,s=n.length;i=this.getLength())return;const n=this.array_[e];return this.array_.splice(e,1),this.updateLength_(),this.dispatchEvent(new Bd(ci.REMOVE,n,e)),n}setAt(e,n){const i=this.getLength();if(e>=i){this.insertAt(e,n);return}if(e<0)throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(n,e);const s=this.array_[e];this.array_[e]=n,this.dispatchEvent(new Bd(ci.REMOVE,s,e)),this.dispatchEvent(new Bd(ci.ADD,n,e))}updateLength_(){this.set(cw.LENGTH,this.array_.length)}assertUnique_(e,n){for(let i=0,s=this.array_.length;i1?(n=s,i=r):l>0&&(n+=o*l,i+=a*l)}return al(t,e,n,i)}function al(t,e,n,i){const s=n-t,r=i-e;return s*s+r*r}function xte(t){const e=t.length;for(let i=0;ir&&(r=l,s=a)}if(r===0)return null;const o=t[s];t[s]=t[i],t[i]=o;for(let a=i+1;a=0;i--){n[i]=t[i][e]/t[i][i];for(let s=i-1;s>=0;s--)t[s][e]-=t[s][i]*n[i]}return n}function ah(t){return t*Math.PI/180}function ll(t,e){const n=t%e;return n*e<0?n+e:n}function Ti(t,e,n){return t+n*(e-t)}function _y(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}function Vd(t,e){return Math.floor(_y(t,e))}function zd(t,e){return Math.ceil(_y(t,e))}class KT extends Vs{constructor(e){super(),this.on,this.once,this.un,this.background_=e.background;const n=Object.assign({},e);typeof e.properties=="object"&&(delete n.properties,Object.assign(n,e.properties)),n[xt.OPACITY]=e.opacity!==void 0?e.opacity:1,mt(typeof n[xt.OPACITY]=="number","Layer opacity must be a number"),n[xt.VISIBLE]=e.visible!==void 0?e.visible:!0,n[xt.Z_INDEX]=e.zIndex,n[xt.MAX_RESOLUTION]=e.maxResolution!==void 0?e.maxResolution:1/0,n[xt.MIN_RESOLUTION]=e.minResolution!==void 0?e.minResolution:0,n[xt.MIN_ZOOM]=e.minZoom!==void 0?e.minZoom:-1/0,n[xt.MAX_ZOOM]=e.maxZoom!==void 0?e.maxZoom:1/0,this.className_=n.className!==void 0?n.className:"ol-layer",delete n.className,this.setProperties(n),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(e){const n=this.state_||{layer:this,managed:e===void 0?!0:e},i=this.getZIndex();return n.opacity=Jt(Math.round(this.getOpacity()*100)/100,0,1),n.visible=this.getVisible(),n.extent=this.getExtent(),n.zIndex=i===void 0&&!n.managed?1/0:i,n.maxResolution=this.getMaxResolution(),n.minResolution=Math.max(this.getMinResolution(),0),n.minZoom=this.getMinZoom(),n.maxZoom=this.getMaxZoom(),this.state_=n,n}getLayersArray(e){return pt()}getLayerStatesArray(e){return pt()}getExtent(){return this.get(xt.EXTENT)}getMaxResolution(){return this.get(xt.MAX_RESOLUTION)}getMinResolution(){return this.get(xt.MIN_RESOLUTION)}getMinZoom(){return this.get(xt.MIN_ZOOM)}getMaxZoom(){return this.get(xt.MAX_ZOOM)}getOpacity(){return this.get(xt.OPACITY)}getSourceState(){return pt()}getVisible(){return this.get(xt.VISIBLE)}getZIndex(){return this.get(xt.Z_INDEX)}setBackground(e){this.background_=e,this.changed()}setExtent(e){this.set(xt.EXTENT,e)}setMaxResolution(e){this.set(xt.MAX_RESOLUTION,e)}setMinResolution(e){this.set(xt.MIN_RESOLUTION,e)}setMaxZoom(e){this.set(xt.MAX_ZOOM,e)}setMinZoom(e){this.set(xt.MIN_ZOOM,e)}setOpacity(e){mt(typeof e=="number","Layer opacity must be a number"),this.set(xt.OPACITY,e)}setVisible(e){this.set(xt.VISIBLE,e)}setZIndex(e){this.set(xt.Z_INDEX,e)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const Hi={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"},Vn={ANIMATING:0,INTERACTING:1},Qi={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},Ete=42,yy=256,_u={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class UT{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent!==void 0?e.extent:null,this.worldExtent_=e.worldExtent!==void 0?e.worldExtent:null,this.axisOrientation_=e.axisOrientation!==void 0?e.axisOrientation:"enu",this.global_=e.global!==void 0?e.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||_u[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const Uu=6378137,Ja=Math.PI*Uu,Ste=[-Ja,-Ja,Ja,Ja],Cte=[-180,-85,180,85],Wd=Uu*Math.log(Math.tan(Math.PI/2));class Oa extends UT{constructor(e){super({code:e,units:"m",extent:Ste,global:!0,worldExtent:Cte,getPointResolution:function(n,i){return n/Math.cosh(i[1]/Uu)}})}}const uw=[new Oa("EPSG:3857"),new Oa("EPSG:102100"),new Oa("EPSG:102113"),new Oa("EPSG:900913"),new Oa("http://www.opengis.net/def/crs/EPSG/0/3857"),new Oa("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Tte(t,e,n,i){const s=t.length;n=n>1?n:2,i=i??n,e===void 0&&(n>2?e=t.slice():e=new Array(s));for(let r=0;rWd?o=Wd:o<-Wd&&(o=-Wd),e[r+1]=o}return e}function kte(t,e,n,i){const s=t.length;n=n>1?n:2,i=i??n,e===void 0&&(n>2?e=t.slice():e=new Array(s));for(let r=0;rs&&(l=l|kn.RIGHT),ar&&(l=l|kn.ABOVE),l===kn.UNKNOWN&&(l=kn.INTERSECTING),l}function Ui(){return[1/0,1/0,-1/0,-1/0]}function co(t,e,n,i,s){return s?(s[0]=t,s[1]=e,s[2]=n,s[3]=i,s):[t,e,n,i]}function Bf(t){return co(1/0,1/0,-1/0,-1/0,t)}function qT(t,e){const n=t[0],i=t[1];return co(n,i,n,i,e)}function wy(t,e,n,i,s){const r=Bf(s);return ZT(r,t,e,n,i)}function yu(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Dte(t,e){return e[0]t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t}function Gc(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function ZT(t,e,n,i,s){for(;ne[0]?i[0]=t[0]:i[0]=e[0],t[1]>e[1]?i[1]=t[1]:i[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Hf(t){return t[2]=o&&m<=l),!i&&r&kn.RIGHT&&!(s&kn.RIGHT)&&(y=f-(h-l)*p,i=y>=a&&y<=c),!i&&r&kn.BELOW&&!(s&kn.BELOW)&&(m=h-(f-a)/p,i=m>=o&&m<=l),!i&&r&kn.LEFT&&!(s&kn.LEFT)&&(y=f-(h-o)*p,i=y>=a&&y<=c)}return i}function QT(t,e){const n=e.getExtent(),i=da(t);if(e.canWrapX()&&(i[0]=n[2])){const s=vt(n),o=Math.floor((i[0]-n[0])/s)*s;t[0]-=o,t[2]-=o}return t}function xy(t,e,n){if(e.canWrapX()){const i=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[i[0],t[1],i[2],t[3]]];QT(t,e);const s=vt(i);if(vt(t)>s&&!n)return[[i[0],t[1],i[2],t[3]]];if(t[0]i[2])return[[t[0],t[1],i[2],t[3]],[i[0],t[1],t[2]-s,t[3]]]}return[t]}function Bte(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function $h(t,e){let n=!0;for(let i=t.length-1;i>=0;--i)if(t[i]!=e[i]){n=!1;break}return n}function Ey(t,e){const n=Math.cos(e),i=Math.sin(e),s=t[0]*n-t[1]*i,r=t[1]*n+t[0]*i;return t[0]=s,t[1]=r,t}function Vte(t,e){return t[0]*=e,t[1]*=e,t}function ek(t,e){if(e.canWrapX()){const n=vt(e.getExtent()),i=zte(t,e,n);i&&(t[0]-=i*n)}return t}function zte(t,e,n){const i=e.getExtent();let s=0;return e.canWrapX()&&(t[0]i[2])&&(n=n||vt(i),s=Math.floor((t[0]-i[0])/n)),s}const Wte=63710088e-1;function gw(t,e,n){n=n||Wte;const i=ah(t[1]),s=ah(e[1]),r=(s-i)/2,o=ah(e[0]-t[0])/2,a=Math.sin(r)*Math.sin(r)+Math.sin(o)*Math.sin(o)*Math.cos(i)*Math.cos(s);return 2*n*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function tk(...t){console.warn(...t)}let Tm=!0;function nk(t){Tm=!(t===void 0?!0:t)}function Sy(t,e){if(e!==void 0){for(let n=0,i=t.length;n=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(Tm=!1,tk("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function Ty(t,e){return t}function Xr(t,e){return t}function Gte(){mw(uw),mw(hw),jte(hw,uw,Tte,kte)}Gte();function _w(t,e,n){return function(i,s,r,o,a){if(!i)return;if(!s&&!e)return i;const l=e?0:r[0]*s,c=e?0:r[1]*s,u=a?a[0]:0,d=a?a[1]:0;let h=t[0]+l/2+u,f=t[2]-l/2+u,p=t[1]+c/2+d,m=t[3]-c/2+d;h>f&&(h=(f+h)/2,f=h),p>m&&(p=(m+p)/2,m=p);let y=Jt(i[0],h,f),v=Jt(i[1],p,m);if(o&&n&&s){const b=30*s;y+=-b*Math.log(1+Math.max(0,h-i[0])/b)+b*Math.log(1+Math.max(0,i[0]-f)/b),v+=-b*Math.log(1+Math.max(0,p-i[1])/b)+b*Math.log(1+Math.max(0,i[1]-m)/b)}return[y,v]}}function Xte(t){return t}function ky(t,e,n,i){const s=vt(e)/n[0],r=Yn(e)/n[1];return i?Math.min(t,Math.max(s,r)):Math.min(t,Math.min(s,r))}function Ay(t,e,n){let i=Math.min(t,e);const s=50;return i*=Math.log(1+s*Math.max(0,t/e-1))/s+1,n&&(i=Math.max(i,n),i/=Math.log(1+s*Math.max(0,n/t-1))/s+1),Jt(i,n/2,e*2)}function qte(t,e,n,i){return e=e!==void 0?e:!0,function(s,r,o,a){if(s!==void 0){const l=t[0],c=t[t.length-1],u=n?ky(l,n,o,i):l;if(a)return e?Ay(s,u,c):Jt(s,c,u);const d=Math.min(u,s),h=Math.floor(my(t,d,r));return t[h]>u&&hMath.round(n*bw[i])/bw[i]).join(", ")+")"}function no(t,e,n,i,s,r,o){r=r||[],o=o||2;let a=0;for(let l=e;l{if(!i)return this.getSimplifiedGeometry(n);const s=this.clone();return s.applyTransform(i),s.getSimplifiedGeometry(n)})}simplifyTransformed(e,n){return this.simplifyTransformedInternal(this.getRevision(),e,n)}clone(){return pt()}closestPointXY(e,n,i,s){return pt()}containsXY(e,n){const i=this.getClosestPoint([e,n]);return i[0]===e&&i[1]===n}getClosestPoint(e,n){return n=n||[NaN,NaN],this.closestPointXY(e[0],e[1],n,1/0),n}intersectsCoordinate(e){return this.containsXY(e[0],e[1])}computeExtent(e){return pt()}getExtent(e){if(this.extentRevision_!=this.getRevision()){const n=this.computeExtent(this.extent_);(isNaN(n[0])||isNaN(n[1]))&&Bf(n),this.extentRevision_=this.getRevision()}return Nte(this.extent_,e)}rotate(e,n){pt()}scale(e,n,i){pt()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return pt()}getType(){return pt()}applyTransform(e){pt()}intersectsExtent(e){return pt()}translate(e,n){pt()}transform(e,n){const i=Gi(e),s=i.getUnits()=="tile-pixels"?function(r,o,a){const l=i.getExtent(),c=i.getWorldExtent(),u=Yn(c)/Yn(l);return _r(ww,c[0],c[3],u,-u,0,0,0),no(r,0,r.length,a,ww,o),Lh(i,n)(r,o,a)}:Lh(i,n);return this.applyTransform(s),this}}class jf extends ane{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(e){return wy(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return pt()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const n=this.getSimplifiedGeometryInternal(e);return n.getFlatCoordinates().length1)d=n;else if(h>0){for(let f=0;fs&&(s=c),r=a,o=l}return s}function une(t,e,n,i,s){for(let r=0,o=n.length;r0;){const d=c.pop(),h=c.pop();let f=0;const p=t[h],m=t[h+1],y=t[d],v=t[d+1];for(let b=h+i;bf&&(u=b,f=w)}f>s&&(l[(u-e)/i]=1,h+i0&&m>f)&&(p<0&&y0&&y>p)){c=d,u=h;continue}r[o++]=c,r[o++]=u,a=c,l=u,c=d,u=h}return r[o++]=c,r[o++]=u,o}function lk(t,e,n,i,s,r,o,a){for(let l=0,c=n.length;lr&&(c-a)*(r-l)-(s-a)*(u-l)>0&&o++:u<=r&&(c-a)*(r-l)-(s-a)*(u-l)<0&&o--,a=c,l=u}return o!==0}function uk(t,e,n,i,s,r){if(n.length===0||!Go(t,e,n[0],i,s,r))return!1;for(let o=1,a=n.length;ov&&(c=(u+d)/2,uk(t,e,n,i,c,p)&&(y=c,v=b)),u=d}return isNaN(y)&&(y=s[r]),o?(o.push(y,p,v),o):[y,p,v]}function yne(t,e,n,i,s){let r=[];for(let o=0,a=n.length;o=s[0]&&r[2]<=s[2]||r[1]>=s[1]&&r[3]<=s[3]?!0:dk(t,e,n,i,function(o,a){return Fte(s,o,a)}):!1}function hk(t,e,n,i,s){return!!($y(t,e,n,i,s)||Go(t,e,n,i,s[0],s[1])||Go(t,e,n,i,s[0],s[3])||Go(t,e,n,i,s[2],s[1])||Go(t,e,n,i,s[2],s[3]))}function vne(t,e,n,i,s){if(!hk(t,e,n[0],i,s))return!1;if(n.length===1)return!0;for(let r=1,o=n.length;r0}function wne(t,e,n,i,s){s=s!==void 0?s:!1;for(let r=0,o=n.length;r1&&typeof arguments[n-1]=="function"&&(i=arguments[n-1],--n);let s=0;for(;s0}getInteracting(){return this.hints_[Vn.INTERACTING]>0}cancelAnimations(){this.setHint(Vn.ANIMATING,-this.hints_[Vn.ANIMATING]);let e;for(let n=0,i=this.animations_.length;n=0;--i){const s=this.animations_[i];let r=!0;for(let o=0,a=s.length;o0?c/l.duration:1;u>=1?(l.complete=!0,u=1):r=!1;const d=l.easing(u);if(l.sourceCenter){const h=l.sourceCenter[0],f=l.sourceCenter[1],p=l.targetCenter[0],m=l.targetCenter[1];this.nextCenter_=l.targetCenter;const y=h+d*(p-h),v=f+d*(m-f);this.targetCenter_=[y,v]}if(l.sourceResolution&&l.targetResolution){const h=d===1?l.targetResolution:l.sourceResolution+d*(l.targetResolution-l.sourceResolution);if(l.anchor){const f=this.getViewportSize_(this.getRotation()),p=this.constraints_.resolution(h,0,f,!0);this.targetCenter_=this.calculateCenterZoom(p,l.anchor)}this.nextResolution_=l.targetResolution,this.targetResolution_=h,this.applyTargetState_(!0)}if(l.sourceRotation!==void 0&&l.targetRotation!==void 0){const h=d===1?ll(l.targetRotation+Math.PI,2*Math.PI)-Math.PI:l.sourceRotation+d*(l.targetRotation-l.sourceRotation);if(l.anchor){const f=this.constraints_.rotation(h,!0);this.targetCenter_=this.calculateCenterRotate(f,l.anchor)}this.nextRotation_=l.targetRotation,this.targetRotation_=h}if(this.applyTargetState_(!0),n=!0,!l.complete)break}if(r){this.animations_[i]=null,this.setHint(Vn.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=s[0].callback;o&&Hd(o,!0)}}this.animations_=this.animations_.filter(Boolean),n&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(e,n){let i;const s=this.getCenterInternal();return s!==void 0&&(i=[s[0]-n[0],s[1]-n[1]],Ey(i,e-this.getRotation()),Bte(i,n)),i}calculateCenterZoom(e,n){let i;const s=this.getCenterInternal(),r=this.getResolution();if(s!==void 0&&r!==void 0){const o=n[0]-e*(n[0]-s[0])/r,a=n[1]-e*(n[1]-s[1])/r;i=[o,a]}return i}getViewportSize_(e){const n=this.viewportSize_;if(e){const i=n[0],s=n[1];return[Math.abs(i*Math.cos(e))+Math.abs(s*Math.sin(e)),Math.abs(i*Math.sin(e))+Math.abs(s*Math.cos(e))]}return n}setViewportSize(e){this.viewportSize_=Array.isArray(e)?e.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const e=this.getCenterInternal();return e&&km(e,this.getProjection())}getCenterInternal(){return this.get(Qi.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(e){return e!==void 0?(e[0]=this.hints_[0],e[1]=this.hints_[1],e):this.hints_.slice()}calculateExtent(e){const n=this.calculateExtentInternal(e);return Ty(n,this.getProjection())}calculateExtentInternal(e){e=e||this.getViewportSizeMinusPadding_();const n=this.getCenterInternal();mt(n,"The view center is not defined");const i=this.getResolution();mt(i!==void 0,"The view resolution is not defined");const s=this.getRotation();return mt(s!==void 0,"The view rotation is not defined"),Cm(n,i,s,e)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(e){this.applyOptions_(this.getUpdatedOptions_({maxZoom:e}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(e){this.applyOptions_(this.getUpdatedOptions_({minZoom:e}))}setConstrainResolution(e){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:e}))}getProjection(){return this.projection_}getResolution(){return this.get(Qi.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(e,n){return this.getResolutionForExtentInternal(Xr(e,this.getProjection()),n)}getResolutionForExtentInternal(e,n){n=n||this.getViewportSizeMinusPadding_();const i=vt(e)/n[0],s=Yn(e)/n[1];return Math.max(i,s)}getResolutionForValueFunction(e){e=e||2;const n=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,s=Math.log(n/i)/Math.log(e);return function(r){return n/Math.pow(e,r*s)}}getRotation(){return this.get(Qi.ROTATION)}getValueForResolutionFunction(e){const n=Math.log(e||2),i=this.getConstrainedResolution(this.maxResolution_),s=this.minResolution_,r=Math.log(i/s)/n;return function(o){return Math.log(i/o)/n/r}}getViewportSizeMinusPadding_(e){let n=this.getViewportSize_(e);const i=this.padding_;return i&&(n=[n[0]-i[1]-i[3],n[1]-i[0]-i[2]]),n}getState(){const e=this.getProjection(),n=this.getResolution(),i=this.getRotation();let s=this.getCenterInternal();const r=this.padding_;if(r){const o=this.getViewportSizeMinusPadding_();s=dp(s,this.getViewportSize_(),[o[0]/2+r[3],o[1]/2+r[0]],n,i)}return{center:s.slice(0),projection:e!==void 0?e:null,resolution:n,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let e;const n=this.getResolution();return n!==void 0&&(e=this.getZoomForResolution(n)),e}getZoomForResolution(e){let n=this.minZoom_||0,i,s;if(this.resolutions_){const r=my(this.resolutions_,e,1);n=r,i=this.resolutions_[r],r==this.resolutions_.length-1?s=2:s=i/this.resolutions_[r+1]}else i=this.maxResolution_,s=this.zoomFactor_;return n+Math.log(i/e)/Math.log(s)}getResolutionForZoom(e){if(this.resolutions_?.length){if(this.resolutions_.length===1)return this.resolutions_[0];const n=Jt(Math.floor(e),0,this.resolutions_.length-2),i=this.resolutions_[n]/this.resolutions_[n+1];return this.resolutions_[n]/Math.pow(i,Jt(e-n,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,e-this.minZoom_)}fit(e,n){let i;if(mt(Array.isArray(e)||typeof e.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(e)){mt(!Hf(e),"Cannot fit empty extent provided as `geometry`");const s=Xr(e,this.getProjection());i=Tw(s)}else if(e.getType()==="Circle"){const s=Xr(e.getExtent(),this.getProjection());i=Tw(s),i.rotate(this.getRotation(),da(s))}else i=e;this.fitInternal(i,n)}rotatedExtentForGeometry(e){const n=this.getRotation(),i=Math.cos(n),s=Math.sin(-n),r=e.getFlatCoordinates(),o=e.getStride();let a=1/0,l=1/0,c=-1/0,u=-1/0;for(let d=0,h=r.length;d{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(e){return this.renderer_?this.renderer_.getFeatures(e):Promise.resolve([])}getData(e){return!this.renderer_||!this.rendered?null:this.renderer_.getData(e)}isVisible(e){let n;const i=this.getMapInternal();!e&&i&&(e=i.getView()),e instanceof Ss?n={viewState:e.getState(),extent:e.calculateExtent()}:n=e,!n.layerStatesArray&&i&&(n.layerStatesArray=i.getLayerGroup().getLayerStatesArray());let s;n.layerStatesArray?s=n.layerStatesArray.find(o=>o.layer===this):s=this.getLayerState();const r=this.getExtent();return Oy(s,n.viewState)&&(!r||fi(r,n.extent))}getAttributions(e){if(!this.isVisible(e))return[];const n=this.getSource()?.getAttributions();if(!n)return[];const i=e instanceof Ss?e.getViewStateAndExtent():e;let s=n(i);return Array.isArray(s)||(s=[s]),s}render(e,n){const i=this.getRenderer();return i.prepareFrame(e)?(this.rendered=!0,i.renderFrame(e,n)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(e,n){}renderDeferred(e){const n=this.getRenderer();n&&n.renderDeferred(e)}setMapInternal(e){e||this.unrender(),this.set(xt.MAP,e)}getMapInternal(){return this.get(xt.MAP)}setMap(e){this.mapPrecomposeKey_&&(Dt(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),e||this.changed(),this.mapRenderKey_&&(Dt(this.mapRenderKey_),this.mapRenderKey_=null),e&&(this.mapPrecomposeKey_=ft(e,Hi.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=ft(this,et.CHANGE,e.render,e),this.changed())}handlePrecompose_(e){const n=e.frameState.layerStatesArray,i=this.getLayerState(!1);mt(!n.some(s=>s.layer===i.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),n.push(i)}setSource(e){this.set(xt.SOURCE,e)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}}function Oy(t,e){if(!t.visible)return!1;const n=e.resolution;if(n=t.maxResolution)return!1;const i=e.zoom;return i>t.minZoom&&i<=t.maxZoom}function fk(t,e,n=0,i=t.length-1,s=Ane){for(;i>n;){if(i-n>600){const l=i-n+1,c=e-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),f=Math.max(n,Math.floor(e-c*d/l+h)),p=Math.min(i,Math.floor(e+(l-c)*d/l+h));fk(t,e,f,p,s)}const r=t[e];let o=n,a=i;for(pc(t,n,e),s(t[i],r)>0&&pc(t,n,i);o0;)a--}s(t[n],r)===0?pc(t,n,a):(a++,pc(t,a,i)),a<=e&&(n=a+1),e<=a&&(i=a-1)}}function pc(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function Ane(t,e){return te?1:0}let gk=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let n=this.data;const i=[];if(!jd(e,n))return i;const s=this.toBBox,r=[];for(;n;){for(let o=0;o=0&&r[n].children.length>this._maxEntries;)this._split(r,n),n--;this._adjustParentBBoxes(s,r,n)}_split(e,n){const i=e[n],s=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,s);const o=this._chooseSplitIndex(i,r,s),a=Ua(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,Na(i,this.toBBox),Na(a,this.toBBox),n?e[n-1].children.push(a):this._splitRoot(i,a)}_splitRoot(e,n){this.data=Ua([e,n]),this.data.height=e.height+1,this.data.leaf=!1,Na(this.data,this.toBBox)}_chooseSplitIndex(e,n,i){let s,r=1/0,o=1/0;for(let a=n;a<=i-n;a++){const l=Cc(e,0,a,this.toBBox),c=Cc(e,a,i,this.toBBox),u=Dne(l,c),d=hp(l)+hp(c);u=n;c--){const u=e.children[c];Tc(a,e.leaf?r(u):u),l+=Yd(a)}return l}_adjustParentBBoxes(e,n,i){for(let s=i;s>=0;s--)Tc(n[s],e)}_condense(e){for(let n=e.length-1,i;n>=0;n--)e[n].children.length===0?n>0?(i=e[n-1].children,i.splice(i.indexOf(e[n]),1)):this.clear():Na(e[n],this.toBBox)}};function Mne(t,e,n){if(!n)return e.indexOf(t);for(let i=0;i=t.minX&&e.maxY>=t.minY}function Ua(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function kw(t,e,n,i,s){const r=[e,n];for(;r.length;){if(n=r.pop(),e=r.pop(),n-e<=i)continue;const o=e+Math.ceil((n-e)/i/2)*i;fk(t,o,e,n,s),r.push(e,o,o,n)}}const ot={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function Aw(t){return t[0]>0&&t[1]>0}function $ne(t,e,n){return n===void 0&&(n=[0,0]),n[0]=t[0]*e+.5|0,n[1]=t[1]*e+.5|0,n}function mi(t,e){return Array.isArray(t)?t:(e===void 0?e=[t,t]:(e[0]=t,e[1]=t),e)}class Gf{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=mi(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}clone(){const e=this.getScale();return new Gf({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return pt()}getImage(e){return pt()}getHitDetectionImage(){return pt()}getPixelRatio(e){return 1}getImageState(){return pt()}getImageSize(){return pt()}getOrigin(){return pt()}getSize(){return pt()}setDisplacement(e){this.displacement_=e}setOpacity(e){this.opacity_=e}setRotateWithView(e){this.rotateWithView_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=mi(e)}listenImageChange(e){pt()}load(){pt()}unlistenImageChange(e){pt()}ready(){return Promise.resolve()}}const Eu={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};var Ln={name:"xyz",min:[0,0,0],channel:["X","Y","Z"],alias:["XYZ","ciexyz","cie1931"]};Ln.whitepoint={2:{A:[109.85,100,35.585],C:[98.074,100,118.232],D50:[96.422,100,82.521],D55:[95.682,100,92.149],D65:[95.045592705167,100,108.9057750759878],D75:[94.972,100,122.638],F2:[99.187,100,67.395],F7:[95.044,100,108.755],F11:[100.966,100,64.37],E:[100,100,100]},10:{A:[111.144,100,35.2],C:[97.285,100,116.145],D50:[96.72,100,81.427],D55:[95.799,100,90.926],D65:[94.811,100,107.304],D75:[94.416,100,120.641],F2:[103.28,100,69.026],F7:[95.792,100,107.687],F11:[103.866,100,65.627],E:[100,100,100]}};Ln.max=Ln.whitepoint[2].D65;Ln.rgb=function(t,e){e=e||Ln.whitepoint[2].E;var n=t[0]/e[0],i=t[1]/e[1],s=t[2]/e[2],r,o,a;return r=n*3.240969941904521+i*-1.537383177570093+s*-.498610760293,o=n*-.96924363628087+i*1.87596750150772+s*.041555057407175,a=n*.055630079696993+i*-.20397695888897+s*1.056971514242878,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:r=r*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o=o*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a=a*12.92,r=Math.min(Math.max(0,r),1),o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),[r*255,o*255,a*255]};Eu.xyz=function(t,e){var n=t[0]/255,i=t[1]/255,s=t[2]/255;n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,s=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92;var r=n*.41239079926595+i*.35758433938387+s*.18048078840183,o=n*.21263900587151+i*.71516867876775+s*.072192315360733,a=n*.019330818715591+i*.11919477979462+s*.95053215224966;return e=e||Ln.whitepoint[2].E,[r*e[0],o*e[1],a*e[2]]};const Ny={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(t,e,n){var i,s,r,o,a,l,c,u,d,h,f,p,m;if(r=t[0],o=t[1],a=t[2],r===0)return[0,0,0];var y=.0011070564598794539;return e=e||"D65",n=n||2,d=Ln.whitepoint[n][e][0],h=Ln.whitepoint[n][e][1],f=Ln.whitepoint[n][e][2],p=4*d/(d+15*h+3*f),m=9*h/(d+15*h+3*f),i=o/(13*r)+p||0,s=a/(13*r)+m||0,c=r>8?h*Math.pow((r+16)/116,3):h*r*y,l=c*9*i/(4*s)||0,u=c*(12-3*i-20*s)/(4*s)||0,[l,c,u]}};Ln.luv=function(t,e,n){var i,s,r,o,a,l,c,u,d,h,f,p,m,y=.008856451679035631,v=903.2962962962961;e=e||"D65",n=n||2,d=Ln.whitepoint[n][e][0],h=Ln.whitepoint[n][e][1],f=Ln.whitepoint[n][e][2],p=4*d/(d+15*h+3*f),m=9*h/(d+15*h+3*f),l=t[0],c=t[1],u=t[2],i=4*l/(l+15*c+3*u)||0,s=9*c/(l+15*c+3*u)||0;var b=c/h;return r=b<=y?v*b:116*Math.pow(b,1/3)-16,o=13*r*(i-p),a=13*r*(s-m),[r,o,a]};var pk={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(t){var e=t[0],n=t[1],i=t[2],s,r,o;return o=i/360*2*Math.PI,s=n*Math.cos(o),r=n*Math.sin(o),[e,s,r]},xyz:function(t){return Ny.xyz(pk.luv(t))}};Ny.lchuv=function(t){var e=t[0],n=t[1],i=t[2],s=Math.sqrt(n*n+i*i),r=Math.atan2(i,n),o=r*360/2/Math.PI;return o<0&&(o+=360),[e,s,o]};Ln.lchuv=function(t){return Ny.lchuv(Ln.luv(t))};const Mw={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};var Iw={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function Lne(t){var e,n=[],i=1,s;if(typeof t=="number")return{space:"rgb",values:[t>>>16,(t&65280)>>>8,t&255],alpha:1};if(typeof t=="number")return{space:"rgb",values:[t>>>16,(t&65280)>>>8,t&255],alpha:1};if(t=String(t).toLowerCase(),Mw[t])n=Mw[t].slice(),s="rgb";else if(t==="transparent")i=0,s="rgb",n=[0,0,0];else if(t[0]==="#"){var r=t.slice(1),o=r.length,a=o<=4;i=1,a?(n=[parseInt(r[0]+r[0],16),parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16)],o===4&&(i=parseInt(r[3]+r[3],16)/255)):(n=[parseInt(r[0]+r[1],16),parseInt(r[2]+r[3],16),parseInt(r[4]+r[5],16)],o===8&&(i=parseInt(r[6]+r[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),s="rgb"}else if(e=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(t)){var l=e[1];s=l.replace(/a$/,"");var c=s==="cmyk"?4:s==="gray"?1:3;n=e[2].trim().split(/\s*[,\/]\s*|\s+/),s==="color"&&(s=n.shift()),n=n.map(function(u,d){if(u[u.length-1]==="%")return u=parseFloat(u)/100,d===3?u:s==="rgb"?u*255:s[0]==="h"||s[0]==="l"&&!d?u*100:s==="lab"?u*125:s==="lch"?d<2?u*150:u*360:s[0]==="o"&&!d?u:s==="oklab"?u*.4:s==="oklch"?d<2?u*.4:u*360:u;if(s[d]==="h"||d===2&&s[s.length-1]==="h"){if(Iw[u]!==void 0)return Iw[u];if(u.endsWith("deg"))return parseFloat(u);if(u.endsWith("turn"))return parseFloat(u)*360;if(u.endsWith("grad"))return parseFloat(u)*360/400;if(u.endsWith("rad"))return parseFloat(u)*180/Math.PI}return u==="none"?0:parseFloat(u)}),i=n.length>c?n.pop():1}else/[0-9](?:\s|\/|,)/.test(t)&&(n=t.match(/([0-9]+)/g).map(function(u){return parseFloat(u)}),s=t.match(/([a-z])/ig)?.join("")?.toLowerCase()||"rgb");return{space:s,values:n,alpha:i}}const gp={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e=t[0]/360,n=t[1]/100,i=t[2]/100,s,r,o,a,l,c=0;if(n===0)return l=i*255,[l,l,l];for(r=i<.5?i*(1+n):i+n-i*n,s=2*i-r,a=[0,0,0];c<3;)o=e+1/3*-(c-1),o<0?o++:o>1&&o--,l=6*o<1?s+(r-s)*6*o:2*o<1?r:3*o<2?s+(r-s)*(2/3-o)*6:s,a[c++]=l*255;return a}};Eu.hsl=function(t){var e=t[0]/255,n=t[1]/255,i=t[2]/255,s=Math.min(e,n,i),r=Math.max(e,n,i),o=r-s,a,l,c;return r===s?a=0:e===r?a=(n-i)/o:n===r?a=2+(i-e)/o:i===r&&(a=4+(e-n)/o),a=Math.min(a*60,360),a<0&&(a+=360),c=(s+r)/2,r===s?l=0:c<=.5?l=o/(r+s):l=o/(2-r-s),[a,l*100,c*100]};function One(t){Array.isArray(t)&&t.raw&&(t=String.raw(...arguments)),t instanceof Number&&(t=+t);var e,n=Lne(t);if(!n.space)return[];const i=n.space[0]==="h"?gp.min:Eu.min,s=n.space[0]==="h"?gp.max:Eu.max;return e=Array(3),e[0]=Math.min(Math.max(n.values[0],i[0]),s[0]),e[1]=Math.min(Math.max(n.values[1],i[1]),s[1]),e[2]=Math.min(Math.max(n.values[2],i[2]),s[2]),n.space[0]==="h"&&(e=gp.rgb(e)),e.push(Math.min(Math.max(n.alpha,0),1)),e}const Fy=[NaN,NaN,NaN,0];function Nne(t){return typeof t=="string"?t:Vy(t)}const Fne=1024,mc={};let pp=0;function Bne(t){if(t.length===4)return t;const e=t.slice();return e[3]=1,e}function Pw(t){const e=Ln.lchuv(Eu.xyz(t));return e[3]=t[3],e}function Vne(t){const e=Ln.rgb(pk.xyz(t));return e[3]=t[3],e}function By(t){if(t==="none")return Fy;if(mc.hasOwnProperty(t))return mc[t];if(pp>=Fne){let n=0;for(const i in mc)n++&3||(delete mc[i],--pp)}const e=One(t);if(e.length!==4)throw new Error('failed to parse "'+t+'" as color');for(const n of e)if(isNaN(n))throw new Error('failed to parse "'+t+'" as color');return mk(e),mc[t]=e,++pp,e}function Su(t){return Array.isArray(t)?t:By(t)}function mk(t){return t[0]=Jt(t[0]+.5|0,0,255),t[1]=Jt(t[1]+.5|0,0,255),t[2]=Jt(t[2]+.5|0,0,255),t[3]=Jt(t[3],0,1),t}function Vy(t){let e=t[0];e!=(e|0)&&(e=e+.5|0);let n=t[1];n!=(n|0)&&(n=n+.5|0);let i=t[2];i!=(i|0)&&(i=i+.5|0);const s=t[3]===void 0?1:Math.round(t[3]*1e3)/1e3;return"rgba("+e+","+n+","+i+","+s+")"}const uo=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",zne=uo.includes("firefox"),Wne=uo.includes("safari")&&!uo.includes("chrom");Wne&&(uo.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(uo));const Hne=uo.includes("webkit")&&!uo.includes("edge"),_k=uo.includes("macintosh"),yk=typeof devicePixelRatio<"u"?devicePixelRatio:1,vk=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,bk=typeof Image<"u"&&Image.prototype.decode,wk=function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return t}();function an(t,e,n,i){let s;return n&&n.length?s=n.shift():vk?s=new OffscreenCanvas(t||300,e||300):s=document.createElement("canvas"),t&&(s.width=t),e&&(s.height=e),s.getContext("2d",i)}let mp;function Nh(){return mp||(mp=an(1,1)),mp}function Bl(t){const e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function Rw(t,e){const n=e.parentNode;n&&n.replaceChild(t,e)}function Yne(t){for(;t.lastChild;)t.lastChild.remove()}function jne(t,e){const n=t.childNodes;for(let i=0;;++i){const s=n[i],r=e[i];if(!s&&!r)break;if(s!==r){if(!s){t.appendChild(r);continue}if(!r){t.removeChild(s),--i;continue}t.insertBefore(r,s)}}}function Kne(t,e,n){const i=t;let s=!0,r=!1,o=!1;const a=[Rh(i,et.LOAD,function(){o=!0,r||e()})];return i.src&&bk?(r=!0,i.decode().then(function(){s&&e()}).catch(function(l){s&&(o?e():n())})):a.push(Rh(i,et.ERROR,n)),function(){s=!1,a.forEach(Dt)}}function Une(t,e){return new Promise((n,i)=>{function s(){o(),n(t)}function r(){o(),i(new Error("Image load error"))}function o(){t.removeEventListener("load",s),t.removeEventListener("error",r)}t.addEventListener("load",s),t.addEventListener("error",r),e&&(t.src=e)})}function Gne(t,e){return e&&(t.src=e),t.src&&bk?new Promise((n,i)=>t.decode().then(()=>n(t)).catch(s=>t.complete&&t.width?n(t):i(s))):Une(t)}class Xne{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let e=0;for(const n in this.cache_){const i=this.cache_[n];!(e++&3)&&!i.hasListener()&&(delete this.cache_[n],delete this.patternCache_[n],--this.cacheSize_)}}}get(e,n,i){const s=_p(e,n,i);return s in this.cache_?this.cache_[s]:null}getPattern(e,n,i){const s=_p(e,n,i);return s in this.patternCache_?this.patternCache_[s]:null}set(e,n,i,s,r){const o=_p(e,n,i),a=o in this.cache_;this.cache_[o]=s,r&&(s.getImageState()===ot.IDLE&&s.load(),s.getImageState()===ot.LOADING?s.ready().then(()=>{this.patternCache_[o]=Nh().createPattern(s.getImage(1),"repeat")}):this.patternCache_[o]=Nh().createPattern(s.getImage(1),"repeat")),a||++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}}function _p(t,e,n){const i=n?Su(n):"null";return e+":"+t+":"+i}const Ms=new Xne;let _c=null;class qne extends Ff{constructor(e,n,i,s,r){super(),this.hitDetectionImage_=null,this.image_=e,this.crossOrigin_=i,this.canvas_={},this.color_=r,this.imageState_=s===void 0?ot.IDLE:s,this.size_=e&&e.width&&e.height?[e.width,e.height]:null,this.src_=n,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===ot.LOADED){_c||(_c=an(1,1,void 0,{willReadFrequently:!0})),_c.drawImage(this.image_,0,0);try{_c.getImageData(0,0,1,1),this.tainted_=!1}catch{_c=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(et.CHANGE)}handleImageError_(){this.imageState_=ot.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=ot.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(e){return this.image_||this.initializeImage_(),this.replaceColor_(e),this.canvas_[e]?this.canvas_[e]:this.image_}getPixelRatio(e){return this.replaceColor_(e),this.canvas_[e]?e:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const e=this.size_[0],n=this.size_[1],i=an(e,n);i.fillRect(0,0,e,n),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===ot.IDLE){this.image_||this.initializeImage_(),this.imageState_=ot.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&Gne(this.image_,this.src_).then(e=>{this.image_=e,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(e){if(!this.color_||this.canvas_[e]||this.imageState_!==ot.LOADED)return;const n=this.image_,i=an(Math.ceil(n.width*e),Math.ceil(n.height*e)),s=i.canvas;i.scale(e,e),i.drawImage(n,0,0),i.globalCompositeOperation="multiply",i.fillStyle=Nne(this.color_),i.fillRect(0,0,s.width/e,s.height/e),i.globalCompositeOperation="destination-in",i.drawImage(n,0,0),this.canvas_[e]=s}ready(){return this.ready_||(this.ready_=new Promise(e=>{if(this.imageState_===ot.LOADED||this.imageState_===ot.ERROR)e();else{const n=()=>{(this.imageState_===ot.LOADED||this.imageState_===ot.ERROR)&&(this.removeEventListener(et.CHANGE,n),e())};this.addEventListener(et.CHANGE,n)}})),this.ready_}}function zy(t,e,n,i,s,r){let o=e===void 0?void 0:Ms.get(e,n,s);return o||(o=new qne(t,t&&"src"in t?t.src||void 0:e,n,i,s),Ms.set(e,n,s,o,r)),r&&o&&!Ms.getPattern(e,n,s)&&Ms.set(e,n,s,o,r),o}function Is(t){return t?Array.isArray(t)?Vy(t):typeof t=="object"&&"src"in t?Zne(t):t:null}function Zne(t){if(!t.offset||!t.size)return Ms.getPattern(t.src,"anonymous",t.color);const e=t.src+":"+t.offset,n=Ms.getPattern(e,void 0,t.color);if(n)return n;const i=Ms.get(t.src,"anonymous",null);if(i.getImageState()!==ot.LOADED)return null;const s=an(t.size[0],t.size[1]);return s.drawImage(i.getImage(1),t.offset[0],t.offset[1],t.size[0],t.size[1],0,0,t.size[0],t.size[1]),zy(s.canvas,e,void 0,ot.LOADED,t.color,!0),Ms.getPattern(e,void 0,t.color)}const Kd="ol-hidden",Xf="ol-unselectable",Wy="ol-control",Dw="ol-collapsed",Jne=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),$w=["style","variant","weight","size","lineHeight","family"],xk=function(t){const e=t.match(Jne);if(!e)return null;const n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let i=0,s=$w.length;i=7&&L9(l,e),O9(l,o),isNaN(i)&&(i=bm.getBestMask(l,op.bind(null,l,n))),bm.applyMask(i,l),op(l,n,i),{modules:l,version:e,errorCorrectionLevel:n,maskPattern:i,segments:s}}TT.create=function(e,n){if(typeof e>"u"||e==="")throw new Error("No input text");let i=sp.M,s,r;return typeof n<"u"&&(i=sp.from(n.errorCorrectionLevel,sp.M),s=Ph.from(n.version),r=bm.from(n.maskPattern),n.toSJISFunc&&Rf.setToSJISFunction(n.toSJISFunc)),B9(e,s,i,r)};var BT={},fy={};(function(t){function e(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let i=n.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+n);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(r){return[r,r]}))),i.length===6&&i.push("F","F");const s=parseInt(i.join(""),16);return{r:s>>24&255,g:s>>16&255,b:s>>8&255,a:s&255,hex:"#"+i.slice(0,6).join("")}}t.getOptions=function(i){i||(i={}),i.color||(i.color={});const s=typeof i.margin>"u"||i.margin===null||i.margin<0?4:i.margin,r=i.width&&i.width>=21?i.width:void 0,o=i.scale||4;return{width:r,scale:r?4:o,margin:s,color:{dark:e(i.color.dark||"#000000ff"),light:e(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},t.getScale=function(i,s){return s.width&&s.width>=i+s.margin*2?s.width/(i+s.margin*2):s.scale},t.getImageWidth=function(i,s){const r=t.getScale(i,s);return Math.floor((i+s.margin*2)*r)},t.qrToImageData=function(i,s,r){const o=s.modules.size,a=s.modules.data,l=t.getScale(o,r),c=Math.floor((o+r.margin*2)*l),u=r.margin*l,d=[r.color.light,r.color.dark];for(let h=0;h=u&&f>=u&&h"u"&&(!o||!o.getContext)&&(l=o,o=void 0),o||(c=i()),l=e.getOptions(l);const u=e.getImageWidth(r.modules.size,l),d=c.getContext("2d"),h=d.createImageData(u,u);return e.qrToImageData(h.data,r,l),n(d,c,u),d.putImageData(h,0,0),c},t.renderToDataURL=function(r,o,a){let l=a;typeof l>"u"&&(!o||!o.getContext)&&(l=o,o=void 0),l||(l={});const c=t.render(r,o,l),u=l.type||"image/png",d=l.rendererOpts||{};return c.toDataURL(u,d.quality)}})(BT);var VT={};const V9=fy;function aw(t,e){const n=t.a/255,i=e+'="'+t.hex+'"';return n<1?i+" "+e+'-opacity="'+n.toFixed(2).slice(1)+'"':i}function ap(t,e,n){let i=t+e;return typeof n<"u"&&(i+=" "+n),i}function z9(t,e,n){let i="",s=0,r=!1,o=0;for(let a=0;a0&&l>0&&t[a-1]||(i+=r?ap("M",l+n,.5+c+n):ap("m",s,0),s=0,r=!1),l+1':"",c="',u='viewBox="0 0 '+a+" "+a+'"',h=''+l+c+` +`;return typeof i=="function"&&i(null,h),h};const W9=t9,xm=TT,zT=BT,H9=VT;function gy(t,e,n,i,s){const r=[].slice.call(arguments,1),o=r.length,a=typeof r[o-1]=="function";if(!a&&!W9())throw new Error("Callback required as last argument");if(a){if(o<2)throw new Error("Too few arguments provided");o===2?(s=n,n=e,e=i=void 0):o===3&&(e.getContext&&typeof s>"u"?(s=i,i=void 0):(s=i,i=n,n=e,e=void 0))}else{if(o<1)throw new Error("Too few arguments provided");return o===1?(n=e,e=i=void 0):o===2&&!e.getContext&&(i=n,n=e,e=void 0),new Promise(function(l,c){try{const u=xm.create(n,i);l(t(u,e,i))}catch(u){c(u)}})}try{const l=xm.create(n,i);s(null,t(l,e,i))}catch(l){s(l)}}va.create=xm.create;va.toCanvas=gy.bind(null,zT.render);va.toDataURL=gy.bind(null,zT.renderToDataURL);va.toString=gy.bind(null,function(t,e,n){return H9.render(t,n)});const Y9={name:"peerQRCode",components:{LocaleText:Qe},props:{peerConfigData:String},mounted(){va.toCanvas(document.querySelector("#qrcode"),this.peerConfigData,t=>{t&&console.error(t)})}},j9={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0"},K9={class:"container d-flex h-100 w-100"},U9={class:"m-auto modal-dialog-centered dashboardModal justify-content-center"},G9={class:"card rounded-3 shadow"},X9={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-0"},q9={class:"mb-0"},Z9={class:"card-body"},J9={id:"qrcode",class:"rounded-3 shadow",ref:"qrcode"};function Q9(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",j9,[g("div",K9,[g("div",U9,[g("div",G9,[g("div",X9,[g("h4",q9,[B(o,{t:"QR Code"})]),g("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=a=>this.$emit("close"))})]),g("div",Z9,[g("canvas",J9,null,512)])])])])])}const eq=He(Y9,[["render",Q9]]),tq={name:"nameInput",components:{LocaleText:Qe},props:{bulk:Boolean,data:Object,saving:Boolean}},nq={for:"peer_name_textbox",class:"form-label"},iq={class:"text-muted"},sq=["disabled"];function rq(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",{class:Me({inactiveField:this.bulk})},[g("label",nq,[g("small",iq,[B(o,{t:"Name"})])]),Oe(g("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving||this.bulk,"onUpdate:modelValue":e[0]||(e[0]=a=>this.data.name=a),id:"peer_name_textbox",placeholder:""},null,8,sq),[[Ke,this.data.name]])],2)}const oq=He(tq,[["render",rq]]),aq={name:"privatePublicKeyInput",components:{LocaleText:Qe},props:{data:Object,saving:Boolean,bulk:Boolean},setup(){return{dashboardStore:nt()}},data(){return{keypair:{publicKey:"",privateKey:"",presharedKey:""},editKey:!1,error:!1}},methods:{genKeyPair(){this.editKey=!1,this.keypair=window.wireguard.generateKeypair(),this.data.private_key=this.keypair.privateKey,this.data.public_key=this.keypair.publicKey},testKey(t){return/^[A-Za-z0-9+/]{43}=?=?$/.test(t)},checkMatching(){try{this.keypair.privateKey&&this.testKey(this.keypair.privateKey)&&(this.keypair.publicKey=window.wireguard.generatePublicKey(this.keypair.privateKey),window.wireguard.generatePublicKey(this.keypair.privateKey)!==this.keypair.publicKey?(this.error=!0,this.dashboardStore.newMessage("WGDashboard","Private key does not match with the public key","danger")):(this.data.private_key=this.keypair.privateKey,this.data.public_key=this.keypair.publicKey))}catch{this.error=!0,this.data.private_key="",this.data.public_key=""}}},mounted(){this.genKeyPair()},watch:{keypair:{deep:!0,handler(){this.error=!1,this.checkMatching()}}}},lq={for:"peer_private_key_textbox",class:"form-label"},cq={class:"text-muted"},uq={class:"input-group"},dq=["disabled"],hq=["disabled"],fq=g("i",{class:"bi bi-arrow-repeat"},null,-1),gq=[fq],pq={class:"d-flex"},mq={for:"public_key",class:"form-label"},_q={class:"text-muted"},yq={class:"form-check form-switch ms-auto"},vq=["disabled"],bq={class:"form-check-label",for:"enablePublicKeyEdit"},wq=["disabled"];function xq(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",{class:Me(["d-flex gap-2 flex-column",{inactiveField:this.bulk}])},[g("div",null,[g("label",lq,[g("small",cq,[B(o,{t:"Private Key"}),g("code",null,[B(o,{t:"(Required for QR Code and Download)"})])])]),g("div",uq,[Oe(g("input",{type:"text",class:Me(["form-control form-control-sm rounded-start-3",{"is-invalid":this.error}]),"onUpdate:modelValue":e[0]||(e[0]=a=>this.keypair.privateKey=a),disabled:!this.editKey||this.bulk,onBlur:e[1]||(e[1]=a=>this.checkMatching()),id:"peer_private_key_textbox"},null,42,dq),[[Ke,this.keypair.privateKey]]),g("button",{class:"btn btn-outline-info btn-sm rounded-end-3",onClick:e[2]||(e[2]=a=>this.genKeyPair()),disabled:this.bulk,type:"button",id:"button-addon2"},gq,8,hq)])]),g("div",null,[g("div",pq,[g("label",mq,[g("small",_q,[B(o,{t:"Public Key"}),g("code",null,[B(o,{t:"(Required)"})])])]),g("div",yq,[Oe(g("input",{class:"form-check-input",type:"checkbox",role:"switch",disabled:this.bulk,id:"enablePublicKeyEdit","onUpdate:modelValue":e[3]||(e[3]=a=>this.editKey=a)},null,8,vq),[[Jn,this.editKey]]),g("label",bq,[g("small",null,[B(o,{t:"Use your own Private and Public Key"})])])])]),Oe(g("input",{class:Me(["form-control-sm form-control rounded-3",{"is-invalid":this.error}]),"onUpdate:modelValue":e[4]||(e[4]=a=>this.keypair.publicKey=a),onBlur:e[5]||(e[5]=a=>this.checkMatching()),disabled:!this.editKey||this.bulk,type:"text",id:"public_key"},null,42,wq),[[Ke,this.keypair.publicKey]])])],2)}const Eq=He(aq,[["render",xq]]),Sq={name:"allowedIPsInput",components:{LocaleText:Qe},props:{data:Object,saving:Boolean,bulk:Boolean,availableIp:void 0},data(){return{allowedIp:[],availableIpSearchString:"",customAvailableIp:"",allowedIpFormatError:!1}},setup(){const t=vi(),e=nt();return{store:t,dashboardStore:e}},computed:{searchAvailableIps(){return this.availableIpSearchString?this.availableIp.filter(t=>t.includes(this.availableIpSearchString)&&!this.data.allowed_ips.includes(t)):this.availableIp.filter(t=>!this.data.allowed_ips.includes(t))},inputGetLocale(){return Tt("Enter IP Address/CIDR")}},methods:{addAllowedIp(t){return this.store.checkCIDR(t)?(this.data.allowed_ips.push(t),this.customAvailableIp="",!0):(this.allowedIpFormatError=!0,this.dashboardStore.newMessage("WGDashboard","Allowed IPs is invalid","danger"),!1)}},watch:{customAvailableIp(){this.allowedIpFormatError=!1},availableIp(){this.availableIp!==void 0&&this.availableIp.length>0&&this.addAllowedIp(this.availableIp[0])}},mounted(){}},Df=t=>(bn("data-v-6d5fc831"),t=t(),wn(),t),Cq={for:"peer_allowed_ip_textbox",class:"form-label"},Tq={class:"text-muted"},kq=["onClick"],Aq=Df(()=>g("i",{class:"bi bi-x-circle-fill ms-1"},null,-1)),Mq=[Aq],Iq={class:"d-flex gap-2 align-items-center"},Pq={class:"input-group"},Rq=["placeholder","disabled"],Dq=["disabled"],$q=Df(()=>g("i",{class:"bi bi-plus-lg"},null,-1)),Lq=[$q],Oq={class:"text-muted"},Nq={class:"dropdown flex-grow-1"},Fq=["disabled"],Bq=Df(()=>g("i",{class:"bi bi-filter-circle me-2"},null,-1)),Vq={key:0,class:"dropdown-menu mt-2 shadow w-100 dropdown-menu-end rounded-3",style:{"overflow-y":"scroll","max-height":"270px",width:"300px !important"}},zq={class:"px-3 pb-2 pt-1 d-flex gap-3 align-items-center"},Wq=Df(()=>g("label",{for:"availableIpSearchString",class:"text-muted"},[g("i",{class:"bi bi-search"})],-1)),Hq=["onClick"],Yq={class:"me-auto"},jq={key:0},Kq={class:"px-3 text-muted"};function Uq(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",{class:Me({inactiveField:this.bulk})},[g("label",Cq,[g("small",Tq,[B(o,{t:"Allowed IPs"}),g("code",null,[B(o,{t:"(Required)"})])])]),g("div",{class:Me(["d-flex gap-2 flex-wrap",{"mb-2":this.data.allowed_ips.length>0}])},[B(jl,{name:"list"},{default:Re(()=>[(D(!0),V($e,null,Xe(this.data.allowed_ips,(a,l)=>(D(),V("span",{class:"badge rounded-pill text-bg-success",key:a},[Ye(xe(a)+" ",1),g("a",{role:"button",onClick:c=>this.data.allowed_ips.splice(l,1)},Mq,8,kq)]))),128))]),_:1})],2),g("div",Iq,[g("div",Pq,[Oe(g("input",{type:"text",class:Me(["form-control form-control-sm rounded-start-3",{"is-invalid":this.allowedIpFormatError}]),placeholder:this.inputGetLocale,"onUpdate:modelValue":e[0]||(e[0]=a=>s.customAvailableIp=a),disabled:n.bulk},null,10,Rq),[[Ke,s.customAvailableIp]]),g("button",{class:"btn btn-outline-success btn-sm rounded-end-3",disabled:n.bulk||!this.customAvailableIp,onClick:e[1]||(e[1]=a=>this.addAllowedIp(this.customAvailableIp)),type:"button",id:"button-addon2"},Lq,8,Dq)]),g("small",Oq,[B(o,{t:"or"})]),g("div",Nq,[g("button",{class:"btn btn-outline-secondary btn-sm dropdown-toggle rounded-3 w-100",disabled:!n.availableIp||n.bulk,"data-bs-auto-close":"outside",type:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[Bq,B(o,{t:"Pick Available IP"})],8,Fq),this.availableIp?(D(),V("ul",Vq,[g("li",null,[g("div",zq,[Wq,Oe(g("input",{id:"availableIpSearchString",class:"form-control form-control-sm rounded-3","onUpdate:modelValue":e[2]||(e[2]=a=>this.availableIpSearchString=a)},null,512),[[Ke,this.availableIpSearchString]])])]),(D(!0),V($e,null,Xe(this.searchAvailableIps,a=>(D(),V("li",null,[g("a",{class:"dropdown-item d-flex",role:"button",onClick:l=>this.addAllowedIp(a)},[g("span",Yq,[g("small",null,xe(a),1)])],8,Hq)]))),256)),this.searchAvailableIps.length===0?(D(),V("li",jq,[g("small",Kq,[B(o,{t:"No available IP containing"}),Ye(' "'+xe(this.availableIpSearchString)+'"',1)])])):ce("",!0)])):ce("",!0)])])],2)}const Gq=He(Sq,[["render",Uq],["__scopeId","data-v-6d5fc831"]]),Xq={name:"dnsInput",components:{LocaleText:Qe},props:{data:Object,saving:Boolean},data(){return{error:!1,dns:JSON.parse(JSON.stringify(this.data.DNS))}},setup(){const t=vi(),e=nt();return{store:t,dashboardStore:e}},methods:{checkDNS(){if(this.dns){let t=this.dns.split(",").map(e=>e.replaceAll(" ",""));for(let e in t)if(!this.store.regexCheckIP(t[e])){this.error||this.dashboardStore.newMessage("WGDashboard","DNS format is incorrect","danger"),this.error=!0,this.data.DNS="";return}this.error=!1,this.data.DNS=this.dns}}},watch:{dns(){this.checkDNS()}}},qq={for:"peer_DNS_textbox",class:"form-label"},Zq={class:"text-muted"},Jq=["disabled"];function Qq(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",null,[g("label",qq,[g("small",Zq,[B(o,{t:"DNS"})])]),Oe(g("input",{type:"text",class:Me(["form-control form-control-sm rounded-3",{"is-invalid":this.error}]),disabled:this.saving,"onUpdate:modelValue":e[0]||(e[0]=a=>this.dns=a),id:"peer_DNS_textbox"},null,10,Jq),[[Ke,this.dns]])])}const eZ=He(Xq,[["render",Qq]]),tZ={name:"endpointAllowedIps",components:{LocaleText:Qe},props:{data:Object,saving:Boolean},setup(){const t=vi(),e=nt();return{store:t,dashboardStore:e}},data(){return{endpointAllowedIps:JSON.parse(JSON.stringify(this.data.endpoint_allowed_ip)),error:!1}},methods:{checkAllowedIP(){let t=this.endpointAllowedIps.split(",").map(e=>e.replaceAll(" ",""));for(let e in t)if(!this.store.checkCIDR(t[e])){this.error||this.dashboardStore.newMessage("WGDashboard","Endpoint Allowed IPs format is incorrect","danger"),this.data.endpoint_allowed_ip="",this.error=!0;return}this.error=!1,this.data.endpoint_allowed_ip=this.endpointAllowedIps}},watch:{endpointAllowedIps(){this.checkAllowedIP()}}},nZ={for:"peer_endpoint_allowed_ips",class:"form-label"},iZ={class:"text-muted"},sZ=["disabled"];function rZ(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",null,[g("label",nZ,[g("small",iZ,[B(o,{t:"Endpoint Allowed IPs"}),g("code",null,[B(o,{t:"(Required)"})])])]),Oe(g("input",{type:"text",class:Me(["form-control form-control-sm rounded-3",{"is-invalid":s.error}]),disabled:this.saving,"onUpdate:modelValue":e[0]||(e[0]=a=>this.endpointAllowedIps=a),onBlur:e[1]||(e[1]=a=>this.checkAllowedIP()),id:"peer_endpoint_allowed_ips"},null,42,sZ),[[Ke,this.endpointAllowedIps]])])}const oZ=He(tZ,[["render",rZ]]),aZ={name:"presharedKeyInput",components:{LocaleText:Qe},props:{data:Object,saving:Boolean},data(){return{enable:!1}},watch:{enable(){this.enable?this.data.preshared_key=window.wireguard.generateKeypair().presharedKey:this.data.preshared_key=""}}},lZ={class:"d-flex align-items-start"},cZ={for:"peer_preshared_key_textbox",class:"form-label"},uZ={class:"text-muted"},dZ={class:"form-check form-switch ms-auto"},hZ=["disabled"];function fZ(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",null,[g("div",lZ,[g("label",cZ,[g("small",uZ,[B(o,{t:"Pre-Shared Key"})])]),g("div",dZ,[Oe(g("input",{class:"form-check-input",type:"checkbox",role:"switch","onUpdate:modelValue":e[0]||(e[0]=a=>this.enable=a),id:"peer_preshared_key_switch"},null,512),[[Jn,this.enable]])])]),Oe(g("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving||!this.enable,"onUpdate:modelValue":e[1]||(e[1]=a=>this.data.preshared_key=a),id:"peer_preshared_key_textbox"},null,8,hZ),[[Ke,this.data.preshared_key]])])}const gZ=He(aZ,[["render",fZ]]),pZ={name:"mtuInput",components:{LocaleText:Qe},props:{data:Object,saving:Boolean}},mZ={for:"peer_mtu",class:"form-label"},_Z={class:"text-muted"},yZ=["disabled"];function vZ(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",null,[g("label",mZ,[g("small",_Z,[B(o,{t:"MTU"})])]),Oe(g("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":e[0]||(e[0]=a=>this.data.mtu=a),min:"0",id:"peer_mtu"},null,8,yZ),[[Ke,this.data.mtu]])])}const bZ=He(pZ,[["render",vZ]]),wZ={name:"persistentKeepAliveInput",components:{LocaleText:Qe},props:{data:Object,saving:Boolean}},xZ={for:"peer_keep_alive",class:"form-label"},EZ={class:"text-muted"},SZ=["disabled"];function CZ(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",null,[g("label",xZ,[g("small",EZ,[B(o,{t:"Persistent Keepalive"})])]),Oe(g("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":e[0]||(e[0]=a=>this.data.keepalive=a),id:"peer_keep_alive"},null,8,SZ),[[Ke,this.data.keepalive]])])}const TZ=He(wZ,[["render",CZ]]),kZ={name:"bulkAdd",components:{LocaleText:Qe},props:{saving:Boolean,data:Object,availableIp:void 0},computed:{bulkAddGetLocale(){return Tt("How many peers you want to add?")}}},AZ={class:"form-check form-switch"},MZ=["disabled"],IZ={class:"form-check-label me-2",for:"bulk_add"},PZ={class:"text-muted d-block"},RZ={key:0,class:"form-group"},DZ=["max","placeholder"],$Z={class:"text-muted"};function LZ(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",null,[g("div",AZ,[Oe(g("input",{class:"form-check-input",type:"checkbox",role:"switch",disabled:!this.availableIp,id:"bulk_add","onUpdate:modelValue":e[0]||(e[0]=a=>this.data.bulkAdd=a)},null,8,MZ),[[Jn,this.data.bulkAdd]]),g("label",IZ,[g("small",null,[g("strong",null,[B(o,{t:"Bulk Add"})])])])]),g("p",{class:Me({"mb-0":!this.data.bulkAdd})},[g("small",PZ,[B(o,{t:"By adding peers by bulk, each peer's name will be auto generated, and Allowed IP will be assign to the next available IP."})])],2),this.data.bulkAdd?(D(),V("div",RZ,[Oe(g("input",{class:"form-control form-control-sm rounded-3 mb-1",type:"number",min:"1",max:this.availableIp.length,"onUpdate:modelValue":e[1]||(e[1]=a=>this.data.bulkAddAmount=a),placeholder:this.bulkAddGetLocale},null,8,DZ),[[Ke,this.data.bulkAddAmount]]),g("small",$Z,[B(o,{t:"You can add up to "+this.availableIp.length+" peers"},null,8,["t"])])])):ce("",!0)])}const OZ=He(kZ,[["render",LZ]]),NZ={name:"peerCreate",components:{LocaleText:Qe,BulkAdd:OZ,PersistentKeepAliveInput:TZ,MtuInput:bZ,PresharedKeyInput:gZ,EndpointAllowedIps:oZ,DnsInput:eZ,AllowedIPsInput:Gq,PrivatePublicKeyInput:Eq,NameInput:oq},data(){return{data:{bulkAdd:!1,bulkAddAmount:0,name:"",allowed_ips:[],private_key:"",public_key:"",DNS:this.dashboardStore.Configuration.Peers.peer_global_dns,endpoint_allowed_ip:this.dashboardStore.Configuration.Peers.peer_endpoint_allowed_ip,keepalive:parseInt(this.dashboardStore.Configuration.Peers.peer_keep_alive),mtu:parseInt(this.dashboardStore.Configuration.Peers.peer_mtu),preshared_key:"",preshared_key_bulkAdd:!1},availableIp:void 0,availableIpSearchString:"",saving:!1,allowedIpDropdown:void 0}},mounted(){Vt("/api/getAvailableIPs/"+this.$route.params.id,{},t=>{t.status&&(this.availableIp=t.data)})},setup(){const t=vi(),e=nt();return{store:t,dashboardStore:e}},methods:{peerCreate(){this.saving=!0,kt("/api/addPeers/"+this.$route.params.id,this.data,t=>{t.status?(this.$router.push(`/configuration/${this.$route.params.id}/peers`),this.dashboardStore.newMessage("Server","Peer created successfully","success")):this.dashboardStore.newMessage("Server",t.message,"danger"),this.saving=!1})}},computed:{allRequireFieldsFilled(){let t=!0;return this.data.bulkAdd?(this.data.bulkAddAmount.length===0||this.data.bulkAddAmount>this.availableIp.length)&&(t=!1):["allowed_ips","private_key","public_key","endpoint_allowed_ip","keepalive","mtu"].forEach(n=>{this.data[n].length===0&&(t=!1)}),t}},watch:{bulkAdd(t){t||(this.data.bulkAddAmount="")},"data.bulkAddAmount"(){this.data.bulkAddAmount>this.availableIp.length&&(this.data.bulkAddAmount=this.availableIp.length)}}},py=t=>(bn("data-v-3f34f584"),t=t(),wn(),t),FZ={class:"container"},BZ={class:"mb-4"},VZ=py(()=>g("h3",{class:"mb-0 text-body"},[g("i",{class:"bi bi-chevron-left"})],-1)),zZ={class:"text-body mb-0"},WZ={class:"d-flex flex-column gap-2"},HZ=py(()=>g("hr",{class:"mb-0 mt-2"},null,-1)),YZ=py(()=>g("hr",{class:"mb-0 mt-2"},null,-1)),jZ={class:"row gy-3"},KZ={key:0,class:"col-sm"},UZ={class:"col-sm"},GZ={class:"col-sm"},XZ={key:1,class:"col-12"},qZ={class:"form-check form-switch"},ZZ={class:"form-check-label",for:"bullAdd_PresharedKey_Switch"},JZ={class:"fw-bold"},QZ={class:"d-flex mt-2"},eJ=["disabled"],tJ={key:0,class:"bi bi-plus-circle-fill me-2"};function nJ(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("RouterLink"),l=Se("BulkAdd"),c=Se("NameInput"),u=Se("PrivatePublicKeyInput"),d=Se("AllowedIPsInput"),h=Se("EndpointAllowedIps"),f=Se("DnsInput"),p=Se("PresharedKeyInput"),m=Se("MtuInput"),y=Se("PersistentKeepAliveInput");return D(),V("div",FZ,[g("div",BZ,[B(a,{to:"peers",is:"div",class:"d-flex align-items-center gap-4 text-decoration-none"},{default:Re(()=>[VZ,g("h3",zZ,[B(o,{t:"Add Peers"})])]),_:1})]),g("div",WZ,[B(l,{saving:s.saving,data:this.data,availableIp:this.availableIp},null,8,["saving","data","availableIp"]),HZ,this.data.bulkAdd?ce("",!0):(D(),Ce(c,{key:0,saving:s.saving,data:this.data},null,8,["saving","data"])),this.data.bulkAdd?ce("",!0):(D(),Ce(u,{key:1,saving:s.saving,data:s.data},null,8,["saving","data"])),this.data.bulkAdd?ce("",!0):(D(),Ce(d,{key:2,availableIp:this.availableIp,saving:s.saving,data:s.data},null,8,["availableIp","saving","data"])),B(h,{saving:s.saving,data:s.data},null,8,["saving","data"]),B(f,{saving:s.saving,data:s.data},null,8,["saving","data"]),YZ,g("div",jZ,[this.data.bulkAdd?ce("",!0):(D(),V("div",KZ,[B(p,{saving:s.saving,data:s.data,bulk:this.data.bulkAdd},null,8,["saving","data","bulk"])])),g("div",UZ,[B(m,{saving:s.saving,data:s.data},null,8,["saving","data"])]),g("div",GZ,[B(y,{saving:s.saving,data:s.data},null,8,["saving","data"])]),this.data.bulkAdd?(D(),V("div",XZ,[g("div",qZ,[Oe(g("input",{class:"form-check-input",type:"checkbox",role:"switch","onUpdate:modelValue":e[0]||(e[0]=v=>this.data.preshared_key_bulkAdd=v),id:"bullAdd_PresharedKey_Switch",checked:""},null,512),[[Jn,this.data.preshared_key_bulkAdd]]),g("label",ZZ,[g("small",JZ,[B(o,{t:"Pre-Shared Key"}),this.data.preshared_key_bulkAdd?(D(),Ce(o,{key:0,t:"Enabled"})):(D(),Ce(o,{key:1,t:"Disabled"}))])])])])):ce("",!0)]),g("div",QZ,[g("button",{class:"ms-auto btn btn-dark btn-brand rounded-3 px-3 py-2 shadow",disabled:!this.allRequireFieldsFilled||this.saving,onClick:e[1]||(e[1]=v=>this.peerCreate())},[this.saving?ce("",!0):(D(),V("i",tJ)),this.saving?(D(),Ce(o,{key:1,t:"Adding..."})):(D(),Ce(o,{key:2,t:"Add"}))],8,eJ)])])])}const WT=He(NZ,[["render",nJ],["__scopeId","data-v-3f34f584"]]),iJ={name:"scheduleDropdown",props:{options:Array,data:String,edit:!1},setup(t){t.data===void 0&&this.$emit("update",this.options[0].value)},computed:{currentSelection(){return this.options.find(t=>t.value===this.data)}}},sJ={class:"dropdown scheduleDropdown"},rJ={class:"dropdown-menu rounded-3 shadow",style:{"font-size":"0.875rem",width:"200px"}},oJ=["onClick"],aJ={key:0,class:"bi bi-check ms-auto"};function lJ(t,e,n,i,s,r){return D(),V("div",sJ,[g("button",{class:Me(["btn btn-sm btn-outline-primary rounded-3",{"disabled border-transparent":!n.edit}]),type:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[g("samp",null,xe(this.currentSelection.display),1)],2),g("ul",rJ,[n.edit?(D(!0),V($e,{key:0},Xe(this.options,o=>(D(),V("li",null,[g("a",{class:"dropdown-item d-flex align-items-center",role:"button",onClick:a=>t.$emit("update",o.value)},[g("samp",null,xe(o.display),1),o.value===this.currentSelection.value?(D(),V("i",aJ)):ce("",!0)],8,oJ)]))),256)):ce("",!0)])])}const HT=He(iJ,[["render",lJ],["__scopeId","data-v-6a5aba2a"]]),cJ={name:"schedulePeerJob",components:{LocaleText:Qe,VueDatePicker:Bu,ScheduleDropdown:HT},props:{dropdowns:Array[Object],pjob:Object,viewOnly:!1},setup(t){const e=we({}),n=we(!1),i=we(!1);e.value=JSON.parse(JSON.stringify(t.pjob)),e.value.CreationDate||(n.value=!0,i.value=!0);const s=nt();return{job:e,edit:n,newJob:i,store:s}},data(){return{inputType:void 0}},watch:{pjob:{deep:!0,immediate:!0,handler(t){this.edit||(this.job=JSON.parse(JSON.stringify(t)))}}},methods:{save(){this.job.Field&&this.job.Operator&&this.job.Action&&this.job.Value?kt("/api/savePeerScheduleJob/",{Job:this.job},t=>{t.status?(this.edit=!1,this.store.newMessage("Server","Peer job saved","success"),console.log(t.data),this.$emit("refresh",t.data[0]),this.newJob=!1):this.store.newMessage("Server",t.message,"danger")}):this.alert()},alert(){let t="animate__flash",e=this.$el.querySelectorAll(".scheduleDropdown"),n=this.$el.querySelectorAll("input");e.forEach(i=>i.classList.add("animate__animated",t)),n.forEach(i=>i.classList.add("animate__animated",t)),setTimeout(()=>{e.forEach(i=>i.classList.remove("animate__animated",t)),n.forEach(i=>i.classList.remove("animate__animated",t))},2e3)},reset(){this.job.CreationDate?(this.job=JSON.parse(JSON.stringify(this.pjob)),this.edit=!1):this.$emit("delete")},delete(){this.job.CreationDate&&kt("/api/deletePeerScheduleJob/",{Job:this.job},t=>{t.status?this.store.newMessage("Server","Peer job deleted","success"):(this.store.newMessage("Server",t.message,"danger"),this.$emit("delete"))}),this.$emit("delete")},parseTime(t){t&&(this.job.Value=pi(t).format("YYYY-MM-DD HH:mm:ss"))}}},uJ=t=>(bn("data-v-8f3f1b93"),t=t(),wn(),t),dJ={class:"card-header bg-transparent text-muted border-0"},hJ={key:0,class:"d-flex"},fJ={class:"me-auto"},gJ={key:1},pJ={class:"badge text-bg-warning"},mJ={class:"card-body pt-1",style:{"font-family":"var(--bs-font-monospace)"}},_J={class:"d-flex gap-2 align-items-center mb-2"},yJ=["disabled"],vJ={class:"px-5 d-flex gap-2 align-items-center"},bJ={class:"d-flex gap-3"},wJ=uJ(()=>g("samp",null,"}",-1)),xJ={key:0,class:"ms-auto d-flex gap-3"},EJ={key:1,class:"ms-auto d-flex gap-3"};function SJ(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("ScheduleDropdown"),l=Se("VueDatePicker");return D(),V("div",{class:Me(["card shadow-sm rounded-3 mb-2",{"border-warning-subtle":this.newJob}])},[g("div",dJ,[this.newJob?(D(),V("small",gJ,[g("span",pJ,[B(o,{t:"Unsaved Job"})])])):(D(),V("small",hJ,[g("strong",fJ,[B(o,{t:"Job ID"})]),g("samp",null,xe(this.job.JobID),1)]))]),g("div",mJ,[g("div",_J,[g("samp",null,[B(o,{t:"if"})]),B(a,{edit:i.edit,options:this.dropdowns.Field,data:this.job.Field,onUpdate:e[0]||(e[0]=c=>{this.job.Field=c})},null,8,["edit","options","data"]),g("samp",null,[B(o,{t:"is"})]),B(a,{edit:i.edit,options:this.dropdowns.Operator,data:this.job.Operator,onUpdate:e[1]||(e[1]=c=>this.job.Operator=c)},null,8,["edit","options","data"]),this.job.Field==="date"?(D(),Ce(l,{key:0,is24:!0,"min-date":new Date,"model-value":this.job.Value,"onUpdate:modelValue":this.parseTime,"time-picker-inline":"",format:"yyyy-MM-dd HH:mm:ss","preview-format":"yyyy-MM-dd HH:mm:ss",clearable:!1,disabled:!i.edit,dark:this.store.Configuration.Server.dashboard_theme==="dark"},null,8,["min-date","model-value","onUpdate:modelValue","disabled","dark"])):Oe((D(),V("input",{key:1,class:"form-control form-control-sm form-control-dark rounded-3 flex-grow-1",disabled:!i.edit,"onUpdate:modelValue":e[2]||(e[2]=c=>this.job.Value=c),style:{width:"auto"}},null,8,yJ)),[[Ke,this.job.Value]]),g("samp",null,xe(this.dropdowns.Field.find(c=>c.value===this.job.Field)?.unit)+" { ",1)]),g("div",vJ,[g("samp",null,[B(o,{t:"then"})]),B(a,{edit:i.edit,options:this.dropdowns.Action,data:this.job.Action,onUpdate:e[3]||(e[3]=c=>this.job.Action=c)},null,8,["edit","options","data"])]),g("div",bJ,[wJ,this.edit?(D(),V("div",EJ,[g("a",{role:"button",class:"text-secondary text-decoration-none",onClick:e[6]||(e[6]=c=>this.reset())},[Ye("[C] "),B(o,{t:"Cancel"})]),g("a",{role:"button",class:"text-primary ms-auto text-decoration-none",onClick:e[7]||(e[7]=c=>this.save())},[Ye("[S] "),B(o,{t:"Save"})])])):(D(),V("div",xJ,[g("a",{role:"button",class:"ms-auto text-decoration-none",onClick:e[4]||(e[4]=c=>this.edit=!0)},[Ye("[E] "),B(o,{t:"Edit"})]),g("a",{role:"button",onClick:e[5]||(e[5]=c=>this.delete()),class:"text-danger text-decoration-none"},[Ye("[D] "),B(o,{t:"Delete"})])]))])])],2)}const YT=He(cJ,[["render",SJ],["__scopeId","data-v-8f3f1b93"]]),CJ={name:"peerJobs",setup(){return{store:vi()}},props:{selectedPeer:Object},components:{LocaleText:Qe,SchedulePeerJob:YT,ScheduleDropdown:HT},data(){return{}},methods:{deleteJob(t){this.selectedPeer.jobs=this.selectedPeer.jobs.filter(e=>e.JobID!==t.JobID)},addJob(){this.selectedPeer.jobs.unshift(JSON.parse(JSON.stringify({JobID:Os().toString(),Configuration:this.selectedPeer.configuration.Name,Peer:this.selectedPeer.id,Field:this.store.PeerScheduleJobs.dropdowns.Field[0].value,Operator:this.store.PeerScheduleJobs.dropdowns.Operator[0].value,Value:"",CreationDate:"",ExpireDate:"",Action:this.store.PeerScheduleJobs.dropdowns.Action[0].value})))}}},TJ=t=>(bn("data-v-5bbdd42b"),t=t(),wn(),t),kJ={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},AJ={class:"container d-flex h-100 w-100"},MJ={class:"m-auto modal-dialog-centered dashboardModal"},IJ={class:"card rounded-3 shadow",style:{width:"700px"}},PJ={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},RJ={class:"mb-0 fw-normal"},DJ={class:"card-body px-4 pb-4 pt-2 position-relative"},$J={class:"d-flex align-items-center mb-3"},LJ=TJ(()=>g("i",{class:"bi bi-plus-lg me-2"},null,-1)),OJ={class:"card shadow-sm",key:"none",style:{height:"153px"}},NJ={class:"card-body text-muted text-center d-flex"},FJ={class:"m-auto"};function BJ(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("SchedulePeerJob");return D(),V("div",kJ,[g("div",AJ,[g("div",MJ,[g("div",IJ,[g("div",PJ,[g("h4",RJ,[B(o,{t:"Schedule Jobs"})]),g("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=l=>this.$emit("close"))})]),g("div",DJ,[g("div",$J,[g("button",{class:"btn bg-primary-subtle border-1 border-primary-subtle text-primary-emphasis rounded-3 shadow",onClick:e[1]||(e[1]=l=>this.addJob())},[LJ,B(o,{t:"Job"})])]),B(jl,{name:"schedulePeerJobTransition",tag:"div",class:"position-relative"},{default:Re(()=>[(D(!0),V($e,null,Xe(this.selectedPeer.jobs,(l,c)=>(D(),Ce(a,{onRefresh:e[2]||(e[2]=u=>this.$emit("refresh")),onDelete:u=>this.deleteJob(l),dropdowns:this.store.PeerScheduleJobs.dropdowns,key:l.JobID,pjob:l},null,8,["onDelete","dropdowns","pjob"]))),128)),this.selectedPeer.jobs.length===0?(D(),V("div",OJ,[g("div",NJ,[g("h6",FJ,[B(o,{t:"This peer does not have any job yet."})])])])):ce("",!0)]),_:1})])])])])])}const VJ=He(CJ,[["render",BJ],["__scopeId","data-v-5bbdd42b"]]),zJ={name:"peerJobsAllModal",setup(){return{store:vi()}},components:{LocaleText:Qe,SchedulePeerJob:YT},props:{configurationPeers:Array[Object]},methods:{getuuid(){return Os()}},computed:{getAllJobs(){return this.configurationPeers.filter(t=>t.jobs.length>0)}}},WJ={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},HJ={class:"container d-flex h-100 w-100"},YJ={class:"m-auto modal-dialog-centered dashboardModal"},jJ={class:"card rounded-3 shadow",style:{width:"700px"}},KJ={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},UJ={class:"mb-0 fw-normal"},GJ={class:"card-body px-4 pb-4 pt-2"},XJ={key:0,class:"accordion",id:"peerJobsLogsModalAccordion"},qJ={class:"accordion-header"},ZJ=["data-bs-target"],JJ={key:0},QJ={class:"text-muted"},eQ=["id"],tQ={class:"accordion-body"},nQ={key:1,class:"card shadow-sm",style:{height:"153px"}},iQ={class:"card-body text-muted text-center d-flex"},sQ={class:"m-auto"};function rQ(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("SchedulePeerJob");return D(),V("div",WJ,[g("div",HJ,[g("div",YJ,[g("div",jJ,[g("div",KJ,[g("h4",UJ,[B(o,{t:"All Active Jobs"})]),g("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=l=>this.$emit("close"))})]),g("div",GJ,[this.getAllJobs.length>0?(D(),V("div",XJ,[(D(!0),V($e,null,Xe(this.getAllJobs,(l,c)=>(D(),V("div",{class:"accordion-item",key:l.id},[g("h2",qJ,[g("button",{class:"accordion-button collapsed",type:"button","data-bs-toggle":"collapse","data-bs-target":"#collapse_"+c},[g("small",null,[g("strong",null,[l.name?(D(),V("span",JJ,xe(l.name)+" • ",1)):ce("",!0),g("samp",QJ,xe(l.id),1)])])],8,ZJ)]),g("div",{id:"collapse_"+c,class:"accordion-collapse collapse","data-bs-parent":"#peerJobsLogsModalAccordion"},[g("div",tQ,[(D(!0),V($e,null,Xe(l.jobs,u=>(D(),Ce(a,{onDelete:e[1]||(e[1]=d=>this.$emit("refresh")),onRefresh:e[2]||(e[2]=d=>this.$emit("refresh")),dropdowns:this.store.PeerScheduleJobs.dropdowns,viewOnly:!0,key:u.JobID,pjob:u},null,8,["dropdowns","pjob"]))),128))])],8,eQ)]))),128))])):(D(),V("div",nQ,[g("div",iQ,[g("span",sQ,[B(o,{t:"No active job at the moment."})])])]))])])])])])}const oQ=He(zJ,[["render",rQ]]),aQ={name:"peerJobsLogsModal",components:{LocaleText:Qe},props:{configurationInfo:Object},data(){return{dataLoading:!0,data:[],logFetchTime:void 0,showLogID:!1,showJobID:!0,showSuccessJob:!0,showFailedJob:!0,showLogAmount:10}},async mounted(){await this.fetchLog()},methods:{async fetchLog(){this.dataLoading=!0,await Vt(`/api/getPeerScheduleJobLogs/${this.configurationInfo.Name}`,{},t=>{this.data=t.data,this.logFetchTime=pi().format("YYYY-MM-DD HH:mm:ss"),this.dataLoading=!1})}},computed:{getLogs(){return this.data.filter(t=>this.showSuccessJob&&t.Status==="1"||this.showFailedJob&&t.Status==="0")},showLogs(){return this.getLogs.slice(0,this.showLogAmount)}}},lQ={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},cQ={class:"container-fluid d-flex h-100 w-100"},uQ={class:"m-auto mt-0 modal-dialog-centered dashboardModal",style:{width:"100%"}},dQ={class:"card rounded-3 shadow w-100"},hQ={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-0"},fQ={class:"mb-0"},gQ={class:"card-body px-4 pb-4 pt-2"},pQ={key:0},mQ={class:"mb-2 d-flex gap-3"},_Q=g("i",{class:"bi bi-arrow-clockwise me-2"},null,-1),yQ={class:"d-flex gap-3 align-items-center"},vQ={class:"text-muted"},bQ={class:"form-check"},wQ={class:"form-check-label",for:"jobLogsShowSuccessCheck"},xQ={class:"badge text-success-emphasis bg-success-subtle"},EQ={class:"form-check"},SQ={class:"form-check-label",for:"jobLogsShowFailedCheck"},CQ={class:"badge text-danger-emphasis bg-danger-subtle"},TQ={class:"d-flex gap-3 align-items-center ms-auto"},kQ={class:"text-muted"},AQ={class:"form-check"},MQ={class:"form-check-label",for:"jobLogsShowJobIDCheck"},IQ={class:"form-check"},PQ={class:"form-check-label",for:"jobLogsShowLogIDCheck"},RQ={class:"table"},DQ={scope:"col"},$Q={key:0,scope:"col"},LQ={key:1,scope:"col"},OQ={scope:"col"},NQ={scope:"col"},FQ={style:{"font-size":"0.875rem"}},BQ={scope:"row"},VQ={key:0},zQ={class:"text-muted"},WQ={key:1},HQ={class:"text-muted"},YQ={class:"d-flex gap-2"},jQ=g("i",{class:"bi bi-chevron-down me-2"},null,-1),KQ=g("i",{class:"bi bi-chevron-up me-2"},null,-1),UQ={key:1,class:"d-flex align-items-center flex-column"},GQ=g("div",{class:"spinner-border text-body",role:"status"},[g("span",{class:"visually-hidden"},"Loading...")],-1),XQ=[GQ];function qQ(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",lQ,[g("div",cQ,[g("div",uQ,[g("div",dQ,[g("div",hQ,[g("h4",fQ,[B(o,{t:"Jobs Logs"})]),g("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=a=>this.$emit("close"))})]),g("div",gQ,[this.dataLoading?(D(),V("div",UQ,XQ)):(D(),V("div",pQ,[g("p",null,[B(o,{t:"Updated at"}),Ye(" : "+xe(this.logFetchTime),1)]),g("div",mQ,[g("button",{onClick:e[1]||(e[1]=a=>this.fetchLog()),class:"btn btn-sm rounded-3 shadow-sm text-info-emphasis bg-info-subtle border-1 border-info-subtle me-1"},[_Q,B(o,{t:"Refresh"})]),g("div",yQ,[g("span",vQ,[B(o,{t:"Filter"})]),g("div",bQ,[Oe(g("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[2]||(e[2]=a=>this.showSuccessJob=a),id:"jobLogsShowSuccessCheck"},null,512),[[Jn,this.showSuccessJob]]),g("label",wQ,[g("span",xQ,[B(o,{t:"Success"})])])]),g("div",EQ,[Oe(g("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[3]||(e[3]=a=>this.showFailedJob=a),id:"jobLogsShowFailedCheck"},null,512),[[Jn,this.showFailedJob]]),g("label",SQ,[g("span",CQ,[B(o,{t:"Failed"})])])])]),g("div",TQ,[g("span",kQ,[B(o,{t:"Display"})]),g("div",AQ,[Oe(g("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[4]||(e[4]=a=>s.showJobID=a),id:"jobLogsShowJobIDCheck"},null,512),[[Jn,s.showJobID]]),g("label",MQ,[B(o,{t:"Job ID"})])]),g("div",IQ,[Oe(g("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[5]||(e[5]=a=>s.showLogID=a),id:"jobLogsShowLogIDCheck"},null,512),[[Jn,s.showLogID]]),g("label",PQ,[B(o,{t:"Log ID"})])])])]),g("table",RQ,[g("thead",null,[g("tr",null,[g("th",DQ,[B(o,{t:"Date"})]),s.showLogID?(D(),V("th",$Q,[B(o,{t:"Log ID"})])):ce("",!0),s.showJobID?(D(),V("th",LQ,[B(o,{t:"Job ID"})])):ce("",!0),g("th",OQ,[B(o,{t:"Status"})]),g("th",NQ,[B(o,{t:"Message"})])])]),g("tbody",null,[(D(!0),V($e,null,Xe(this.showLogs,a=>(D(),V("tr",FQ,[g("th",BQ,xe(a.LogDate),1),s.showLogID?(D(),V("td",VQ,[g("samp",zQ,xe(a.LogID),1)])):ce("",!0),s.showJobID?(D(),V("td",WQ,[g("samp",HQ,xe(a.JobID),1)])):ce("",!0),g("td",null,[g("span",{class:Me(["badge",[a.Status==="1"?"text-success-emphasis bg-success-subtle":"text-danger-emphasis bg-danger-subtle"]])},xe(a.Status==="1"?"Success":"Failed"),3)]),g("td",null,xe(a.Message),1)]))),256))])]),g("div",YQ,[this.getLogs.length>this.showLogAmount?(D(),V("button",{key:0,onClick:e[6]||(e[6]=a=>this.showLogAmount+=20),class:"btn btn-sm rounded-3 shadow-sm text-primary-emphasis bg-primary-subtle border-1 border-primary-subtle"},[jQ,Ye(" Show More ")])):ce("",!0),this.showLogAmount>20?(D(),V("button",{key:1,onClick:e[7]||(e[7]=a=>this.showLogAmount=20),class:"btn btn-sm rounded-3 shadow-sm text-primary-emphasis bg-primary-subtle border-1 border-primary-subtle"},[KQ,Ye(" Collapse ")])):ce("",!0)])]))])])])])])}const ZQ=He(aQ,[["render",qQ]]),JQ={name:"peerShareLinkModal",props:{peer:Object},components:{LocaleText:Qe,VueDatePicker:Bu},data(){return{dataCopy:void 0,loading:!1}},setup(){return{store:nt()}},mounted(){this.dataCopy=JSON.parse(JSON.stringify(this.peer.ShareLink)).at(0)},watch:{"peer.ShareLink":{deep:!0,handler(t,e){e.length!==t.length&&(this.dataCopy=JSON.parse(JSON.stringify(this.peer.ShareLink)).at(0))}}},methods:{startSharing(){this.loading=!0,kt("/api/sharePeer/create",{Configuration:this.peer.configuration.Name,Peer:this.peer.id,ExpireDate:pi().add(7,"d").format("YYYY-MM-DD HH:mm:ss")},t=>{t.status?(this.peer.ShareLink=t.data,this.dataCopy=t.data.at(0)):this.store.newMessage("Server","Share link failed to create. Reason: "+t.message,"danger"),this.loading=!1})},updateLinkExpireDate(){kt("/api/sharePeer/update",this.dataCopy,t=>{t.status?(this.dataCopy=t.data.at(0),this.peer.ShareLink=t.data,this.store.newMessage("Server","Link expire date updated","success")):this.store.newMessage("Server","Link expire date failed to update. Reason: "+t.message,"danger"),this.loading=!1})},stopSharing(){this.loading=!0,this.dataCopy.ExpireDate=pi().format("YYYY-MM-DD HH:mm:ss"),this.updateLinkExpireDate()},parseTime(t){t?this.dataCopy.ExpireDate=pi(t).format("YYYY-MM-DD HH:mm:ss"):this.dataCopy.ExpireDate=void 0,this.updateLinkExpireDate()}},computed:{getUrl(){const t=this.store.getActiveCrossServer();return t?`${t.host}/${this.$router.resolve({path:"/share",query:{ShareID:this.dataCopy.ShareID}}).href}`:window.location.origin+window.location.pathname+this.$router.resolve({path:"/share",query:{ShareID:this.dataCopy.ShareID}}).href}}},QQ={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},eee={class:"container d-flex h-100 w-100"},tee={class:"m-auto modal-dialog-centered dashboardModal",style:{width:"500px"}},nee={class:"card rounded-3 shadow flex-grow-1"},iee={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4"},see={class:"mb-0"},ree={key:0,class:"card-body px-4 pb-4"},oee={key:0},aee={class:"mb-3 text-muted"},lee=["disabled"],cee=g("i",{class:"bi bi-send-fill me-2"},null,-1),uee=[cee],dee={key:1},hee={class:"d-flex gap-2 mb-4"},fee=g("i",{class:"bi bi-link-45deg"},null,-1),gee=["href"],pee={class:"d-flex flex-column gap-2 mb-3"},mee=g("i",{class:"bi bi-calendar me-2"},null,-1),_ee=["disabled"],yee=g("i",{class:"bi bi-send-slash-fill me-2"},null,-1),vee=[yee];function bee(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("VueDatePicker");return D(),V("div",QQ,[g("div",eee,[g("div",tee,[g("div",nee,[g("div",iee,[g("h4",see,[B(o,{t:"Share Peer"})]),g("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=l=>this.$emit("close"))})]),this.peer.ShareLink?(D(),V("div",ree,[this.dataCopy?(D(),V("div",dee,[g("div",hee,[fee,g("a",{href:this.getUrl,class:"text-decoration-none",target:"_blank"},xe(r.getUrl),9,gee)]),g("div",pee,[g("small",null,[mee,B(o,{t:"Expire At"})]),B(a,{is24:!0,"min-date":new Date,"model-value":this.dataCopy.ExpireDate,"onUpdate:modelValue":this.parseTime,"time-picker-inline":"",format:"yyyy-MM-dd HH:mm:ss","preview-format":"yyyy-MM-dd HH:mm:ss",dark:this.store.Configuration.Server.dashboard_theme==="dark"},null,8,["min-date","model-value","onUpdate:modelValue","dark"])]),g("button",{onClick:e[2]||(e[2]=l=>this.stopSharing()),disabled:this.loading,class:"w-100 btn bg-danger-subtle text-danger-emphasis border-1 border-danger-subtle rounded-3 shadow-sm"},[g("span",{class:Me({"animate__animated animate__flash animate__infinite animate__slower":this.loading})},vee,2),this.loading?(D(),Ce(o,{key:0,t:"Stop Sharing..."})):(D(),Ce(o,{key:1,t:"Stop Sharing"}))],8,_ee)])):(D(),V("div",oee,[g("h6",aee,[B(o,{t:"Currently the peer is not sharing"})]),g("button",{onClick:e[1]||(e[1]=l=>this.startSharing()),disabled:this.loading,class:"w-100 btn bg-success-subtle text-success-emphasis border-1 border-success-subtle rounded-3 shadow-sm"},[g("span",{class:Me({"animate__animated animate__flash animate__infinite animate__slower":this.loading})},uee,2),this.loading?(D(),Ce(o,{key:0,t:"Sharing..."})):(D(),Ce(o,{key:1,t:"Start Sharing"}))],8,lee)]))])):ce("",!0)])])])])}const wee=He(JQ,[["render",bee]]);Tf.register(AU,kf,YU,FU,jC,aK,KC,UC,uK,cK,dK,hK,$G,OG,BG,QG,hm,i7,GU,gG,bG,xG,IG);const xee={name:"peerList",components:{LocaleText:Qe,PeerShareLinkModal:wee,PeerJobsLogsModal:ZQ,PeerJobsAllModal:oQ,PeerJobs:VJ,PeerCreate:WT,PeerQRCode:eq,PeerSettings:e9,PeerSearch:nH,Peer:ZH,Line:h7,Bar:d7},setup(){const t=nt(),e=vi(),n=we(void 0);return{dashboardConfigurationStore:t,wireguardConfigurationStore:e,interval:n}},data(){return{configurationToggling:!1,loading:!1,error:null,configurationInfo:[],configurationPeers:[],historyDataSentDifference:[],historyDataReceivedDifference:[],historySentData:{labels:[],datasets:[{label:"Data Sent",data:[],fill:!1,borderColor:"#198754",tension:0}]},historyReceiveData:{labels:[],datasets:[{label:"Data Received",data:[],fill:!1,borderColor:"#0d6efd",tension:0}]},peerSetting:{modalOpen:!1,selectedPeer:void 0},peerScheduleJobs:{modalOpen:!1,selectedPeer:void 0},peerQRCode:{modalOpen:!1,peerConfigData:void 0},peerCreate:{modalOpen:!1},peerScheduleJobsAll:{modalOpen:!1},peerScheduleJobsLogs:{modalOpen:!1},peerShare:{modalOpen:!1,selectedPeer:void 0}}},mounted(){},watch:{$route:{immediate:!0,handler(){clearInterval(this.dashboardConfigurationStore.Peers.RefreshInterval),this.loading=!0;let t=this.$route.params.id;this.configurationInfo=[],this.configurationPeers=[],t&&(this.getPeers(t),this.setPeerInterval())}},"dashboardConfigurationStore.Configuration.Server.dashboard_refresh_interval"(){clearInterval(this.dashboardConfigurationStore.Peers.RefreshInterval),this.setPeerInterval()}},beforeRouteLeave(){clearInterval(this.dashboardConfigurationStore.Peers.RefreshInterval)},methods:{toggle(){this.configurationToggling=!0,Vt("/api/toggleWireguardConfiguration/",{configurationName:this.configurationInfo.Name},t=>{t.status?this.dashboardConfigurationStore.newMessage("Server",`${this.configurationInfo.Name} ${t.data?"is on":"is off"}`,"success"):this.dashboardConfigurationStore.newMessage("Server",t.message,"danger"),this.configurationInfo.Status=t.data,this.configurationToggling=!1})},getPeers(t=this.$route.params.id){Vt("/api/getWireguardConfigurationInfo",{configurationName:t},e=>{if(this.configurationInfo=e.data.configurationInfo,this.configurationPeers=e.data.configurationPeers,this.configurationPeers.forEach(n=>{n.restricted=!1}),e.data.configurationRestrictedPeers.forEach(n=>{n.restricted=!0,this.configurationPeers.push(n)}),this.loading=!1,this.configurationPeers.length>0){const n=this.configurationPeers.map(s=>s.total_sent+s.cumu_sent).reduce((s,r)=>s+r).toFixed(4),i=this.configurationPeers.map(s=>s.total_receive+s.cumu_receive).reduce((s,r)=>s+r).toFixed(4);this.historyDataSentDifference[this.historyDataSentDifference.length-1]!==n&&(this.historyDataSentDifference.length>0&&(this.historySentData={labels:[...this.historySentData.labels,pi().format("HH:mm:ss A")],datasets:[{label:"Data Sent",data:[...this.historySentData.datasets[0].data,((n-this.historyDataSentDifference[this.historyDataSentDifference.length-1])*1e3).toFixed(4)],fill:!1,borderColor:"#198754",tension:0}]}),this.historyDataSentDifference.push(n)),this.historyDataReceivedDifference[this.historyDataReceivedDifference.length-1]!==i&&(this.historyDataReceivedDifference.length>0&&(this.historyReceiveData={labels:[...this.historyReceiveData.labels,pi().format("HH:mm:ss A")],datasets:[{label:"Data Received",data:[...this.historyReceiveData.datasets[0].data,((i-this.historyDataReceivedDifference[this.historyDataReceivedDifference.length-1])*1e3).toFixed(4)],fill:!1,borderColor:"#0d6efd",tension:0}]}),this.historyDataReceivedDifference.push(i))}})},setPeerInterval(){this.dashboardConfigurationStore.Peers.RefreshInterval=setInterval(()=>{this.getPeers()},parseInt(this.dashboardConfigurationStore.Configuration.Server.dashboard_refresh_interval))}},computed:{configurationSummary(){return{connectedPeers:this.configurationPeers.filter(e=>e.status==="running").length,totalUsage:this.configurationPeers.length>0?this.configurationPeers.filter(e=>!e.restricted).map(e=>e.total_data+e.cumu_data).reduce((e,n)=>e+n,0).toFixed(4):0,totalReceive:this.configurationPeers.length>0?this.configurationPeers.filter(e=>!e.restricted).map(e=>e.total_receive+e.cumu_receive).reduce((e,n)=>e+n,0).toFixed(4):0,totalSent:this.configurationPeers.length>0?this.configurationPeers.filter(e=>!e.restricted).map(e=>e.total_sent+e.cumu_sent).reduce((e,n)=>e+n,0).toFixed(4):0}},receiveData(){return this.historyReceiveData},sentData(){return this.historySentData},individualDataUsage(){return{labels:this.configurationPeers.map(t=>t.name?t.name:`Untitled Peer - ${t.id}`),datasets:[{label:"Total Data Usage",data:this.configurationPeers.map(t=>t.cumu_data+t.total_data),backgroundColor:this.configurationPeers.map(t=>"#0dcaf0"),tooltip:{callbacks:{label:t=>`${t.formattedValue} GB`}}}]}},individualDataUsageChartOption(){return{responsive:!0,plugins:{legend:{display:!1}},scales:{x:{ticks:{display:!1},grid:{display:!1}},y:{ticks:{callback:(t,e)=>`${t} GB`},grid:{display:!1}}}}},chartOptions(){return{responsive:!0,plugins:{legend:{display:!1},tooltip:{callbacks:{label:t=>`${t.formattedValue} MB/s`}}},scales:{x:{ticks:{display:!1},grid:{display:!1}},y:{ticks:{callback:(t,e)=>`${t} MB/s`},grid:{display:!1}}}}},searchPeers(){new Gl(this.configurationPeers,{keys:["name","id","allowed_ip"]});const t=this.wireguardConfigurationStore.searchString?this.configurationPeers.filter(e=>e.name.includes(this.wireguardConfigurationStore.searchString)||e.id.includes(this.wireguardConfigurationStore.searchString)||e.allowed_ip.includes(this.wireguardConfigurationStore.searchString)):this.configurationPeers;return this.dashboardConfigurationStore.Configuration.Server.dashboard_sort==="restricted"?t.slice().sort((e,n)=>e[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]n[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]?-1:0):t.slice().sort((e,n)=>e[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]n[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]?1:0)}}},$f=t=>(bn("data-v-dc7f794a"),t=t(),wn(),t),Eee={key:0,class:"container-md"},See={class:"d-flex align-items-center"},Cee={CLASS:"text-muted"},Tee={class:"d-flex align-items-center gap-3"},kee={class:"mb-0"},Aee={class:"card rounded-3 bg-transparent shadow-sm ms-auto"},Mee={class:"card-body py-2 d-flex align-items-center"},Iee={class:"mb-0 text-muted"},Pee={class:"form-check form-switch ms-auto"},Ree=["for"],Dee={key:4,class:"spinner-border spinner-border-sm ms-2","aria-hidden":"true"},$ee=["disabled","id"],Lee={class:"row mt-3 gy-2 gx-2 mb-2"},Oee={class:"col-6 col-lg-3"},Nee={class:"card rounded-3 bg-transparent shadow-sm"},Fee={class:"card-body py-2"},Bee={class:"mb-0 text-muted"},Vee={class:"col-6 col-lg-3"},zee={class:"card rounded-3 bg-transparent shadow-sm"},Wee={class:"card-body py-2"},Hee={class:"mb-0 text-muted"},Yee={style:{"word-break":"break-all"},class:"col-12 col-lg-6"},jee={class:"card rounded-3 bg-transparent shadow-sm"},Kee={class:"card-body py-2"},Uee={class:"mb-0 text-muted"},Gee={class:"row gx-2 gy-2 mb-2"},Xee={class:"col-6 col-lg-3"},qee={class:"card rounded-3 bg-transparent shadow-sm"},Zee={class:"card-body d-flex"},Jee={class:"mb-0 text-muted"},Qee={class:"h4"},ete=$f(()=>g("i",{class:"bi bi-ethernet ms-auto h2 text-muted"},null,-1)),tte={class:"col-6 col-lg-3"},nte={class:"card rounded-3 bg-transparent shadow-sm"},ite={class:"card-body d-flex"},ste={class:"mb-0 text-muted"},rte={class:"h4"},ote=$f(()=>g("i",{class:"bi bi-arrow-down-up ms-auto h2 text-muted"},null,-1)),ate={class:"col-6 col-lg-3"},lte={class:"card rounded-3 bg-transparent shadow-sm"},cte={class:"card-body d-flex"},ute={class:"mb-0 text-muted"},dte={class:"h4 text-primary"},hte=$f(()=>g("i",{class:"bi bi-arrow-down ms-auto h2 text-muted"},null,-1)),fte={class:"col-6 col-lg-3"},gte={class:"card rounded-3 bg-transparent shadow-sm"},pte={class:"card-body d-flex"},mte={class:"mb-0 text-muted"},_te={class:"h4 text-success"},yte=$f(()=>g("i",{class:"bi bi-arrow-up ms-auto h2 text-muted"},null,-1)),vte={class:"row gx-2 gy-2 mb-3"},bte={class:"col-12 col-lg-6"},wte={class:"card rounded-3 bg-transparent shadow-sm",style:{height:"270px"}},xte={class:"card-header bg-transparent border-0"},Ete={class:"text-muted"},Ste={class:"card-body pt-1"},Cte={class:"col-sm col-lg-3"},Tte={class:"card rounded-3 bg-transparent shadow-sm",style:{height:"270px"}},kte={class:"card-header bg-transparent border-0"},Ate={class:"text-muted"},Mte={class:"card-body pt-1"},Ite={class:"col-sm col-lg-3"},Pte={class:"card rounded-3 bg-transparent shadow-sm",style:{height:"270px"}},Rte={class:"card-header bg-transparent border-0"},Dte={class:"text-muted"},$te={class:"card-body pt-1"},Lte={class:"mb-3"};function Ote(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("Bar"),l=Se("Line"),c=Se("PeerSearch"),u=Se("Peer"),d=Se("PeerSettings"),h=Se("PeerQRCode"),f=Se("PeerJobs"),p=Se("PeerJobsAllModal"),m=Se("PeerJobsLogsModal"),y=Se("PeerShareLinkModal");return this.loading?ce("",!0):(D(),V("div",Eee,[g("div",See,[g("div",null,[g("small",Cee,[B(o,{t:"CONFIGURATION"})]),g("div",Tee,[g("h1",kee,[g("samp",null,xe(this.configurationInfo.Name),1)])])]),g("div",Aee,[g("div",Mee,[g("div",null,[g("p",Iee,[g("small",null,[B(o,{t:"Status"})])]),g("div",Pee,[g("label",{class:"form-check-label",style:{cursor:"pointer"},for:"switch"+this.configurationInfo.id},[!this.configurationInfo.Status&&this.configurationToggling?(D(),Ce(o,{key:0,t:"Turning Off..."})):this.configurationInfo.Status&&this.configurationToggling?(D(),Ce(o,{key:1,t:"Turning On..."})):this.configurationInfo.Status&&!this.configurationToggling?(D(),Ce(o,{key:2,t:"On"})):!this.configurationInfo.Status&&!this.configurationToggling?(D(),Ce(o,{key:3,t:"Off"})):ce("",!0),this.configurationToggling?(D(),V("span",Dee)):ce("",!0)],8,Ree),Oe(g("input",{class:"form-check-input",style:{cursor:"pointer"},disabled:this.configurationToggling,type:"checkbox",role:"switch",id:"switch"+this.configurationInfo.id,onChange:e[0]||(e[0]=v=>this.toggle()),"onUpdate:modelValue":e[1]||(e[1]=v=>this.configurationInfo.Status=v)},null,40,$ee),[[Jn,this.configurationInfo.Status]])])]),g("div",{class:Me(["dot ms-5",{active:this.configurationInfo.Status}])},null,2)])])]),g("div",Lee,[g("div",Oee,[g("div",Nee,[g("div",Fee,[g("p",Bee,[g("small",null,[B(o,{t:"Address"})])]),Ye(" "+xe(this.configurationInfo.Address),1)])])]),g("div",Vee,[g("div",zee,[g("div",Wee,[g("p",Hee,[g("small",null,[B(o,{t:"Listen Port"})])]),Ye(" "+xe(this.configurationInfo.ListenPort),1)])])]),g("div",Yee,[g("div",jee,[g("div",Kee,[g("p",Uee,[g("small",null,[B(o,{t:"Public Key"})])]),g("samp",null,xe(this.configurationInfo.PublicKey),1)])])])]),g("div",Gee,[g("div",Xee,[g("div",qee,[g("div",Zee,[g("div",null,[g("p",Jee,[g("small",null,[B(o,{t:"Connected Peers"})])]),g("strong",Qee,xe(r.configurationSummary.connectedPeers),1)]),ete])])]),g("div",tte,[g("div",nte,[g("div",ite,[g("div",null,[g("p",ste,[g("small",null,[B(o,{t:"Total Usage"})])]),g("strong",rte,xe(r.configurationSummary.totalUsage)+" GB",1)]),ote])])]),g("div",ate,[g("div",lte,[g("div",cte,[g("div",null,[g("p",ute,[g("small",null,[B(o,{t:"Total Received"})])]),g("strong",dte,xe(r.configurationSummary.totalReceive)+" GB",1)]),hte])])]),g("div",fte,[g("div",gte,[g("div",pte,[g("div",null,[g("p",mte,[g("small",null,[B(o,{t:"Total Sent"})])]),g("strong",_te,xe(r.configurationSummary.totalSent)+" GB",1)]),yte])])])]),g("div",vte,[g("div",bte,[g("div",wte,[g("div",xte,[g("small",Ete,[B(o,{t:"Peers Data Usage"})])]),g("div",Ste,[B(a,{data:r.individualDataUsage,options:r.individualDataUsageChartOption,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["data","options"])])])]),g("div",Cte,[g("div",Tte,[g("div",kte,[g("small",Ate,[B(o,{t:"Real Time Received Data Usage"})])]),g("div",Mte,[B(l,{options:r.chartOptions,data:r.receiveData,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["options","data"])])])]),g("div",Ite,[g("div",Pte,[g("div",Rte,[g("small",Dte,[B(o,{t:"Real Time Sent Data Usage"})])]),g("div",$te,[B(l,{options:r.chartOptions,data:r.sentData,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["options","data"])])])])]),g("div",Lte,[B(c,{onJobsAll:e[2]||(e[2]=v=>this.peerScheduleJobsAll.modalOpen=!0),onJobLogs:e[3]||(e[3]=v=>this.peerScheduleJobsLogs.modalOpen=!0),configuration:this.configurationInfo},null,8,["configuration"]),B(jl,{name:"list",tag:"div",class:"row gx-2 gy-2 z-0"},{default:Re(()=>[(D(!0),V($e,null,Xe(this.searchPeers,v=>(D(),V("div",{class:"col-12 col-lg-6 col-xl-4",key:v.id},[B(u,{Peer:v,onShare:b=>{this.peerShare.selectedPeer=v.id,this.peerShare.modalOpen=!0},onRefresh:e[4]||(e[4]=b=>this.getPeers()),onJobs:b=>{s.peerScheduleJobs.modalOpen=!0,s.peerScheduleJobs.selectedPeer=this.configurationPeers.find(E=>E.id===v.id)},onSetting:b=>{s.peerSetting.modalOpen=!0,s.peerSetting.selectedPeer=this.configurationPeers.find(E=>E.id===v.id)},onQrcode:e[5]||(e[5]=b=>{this.peerQRCode.peerConfigData=b,this.peerQRCode.modalOpen=!0})},null,8,["Peer","onShare","onJobs","onSetting"])]))),128))]),_:1})]),B(Rt,{name:"zoom"},{default:Re(()=>[this.peerSetting.modalOpen?(D(),Ce(d,{key:"settings",selectedPeer:this.peerSetting.selectedPeer,onRefresh:e[6]||(e[6]=v=>this.getPeers()),onClose:e[7]||(e[7]=v=>this.peerSetting.modalOpen=!1)},null,8,["selectedPeer"])):ce("",!0)]),_:1}),B(Rt,{name:"zoom"},{default:Re(()=>[s.peerQRCode.modalOpen?(D(),Ce(h,{peerConfigData:this.peerQRCode.peerConfigData,key:"qrcode",onClose:e[8]||(e[8]=v=>this.peerQRCode.modalOpen=!1)},null,8,["peerConfigData"])):ce("",!0)]),_:1}),B(Rt,{name:"zoom"},{default:Re(()=>[this.peerScheduleJobs.modalOpen?(D(),Ce(f,{key:0,onRefresh:e[9]||(e[9]=v=>this.getPeers()),selectedPeer:this.peerScheduleJobs.selectedPeer,onClose:e[10]||(e[10]=v=>this.peerScheduleJobs.modalOpen=!1)},null,8,["selectedPeer"])):ce("",!0)]),_:1}),B(Rt,{name:"zoom"},{default:Re(()=>[this.peerScheduleJobsAll.modalOpen?(D(),Ce(p,{key:0,onRefresh:e[11]||(e[11]=v=>this.getPeers()),onClose:e[12]||(e[12]=v=>this.peerScheduleJobsAll.modalOpen=!1),configurationPeers:this.configurationPeers},null,8,["configurationPeers"])):ce("",!0)]),_:1}),B(Rt,{name:"zoom"},{default:Re(()=>[this.peerScheduleJobsLogs.modalOpen?(D(),Ce(m,{key:0,onClose:e[13]||(e[13]=v=>this.peerScheduleJobsLogs.modalOpen=!1),configurationInfo:this.configurationInfo},null,8,["configurationInfo"])):ce("",!0)]),_:1}),B(Rt,{name:"zoom"},{default:Re(()=>[this.peerShare.modalOpen?(D(),Ce(y,{key:0,onClose:e[14]||(e[14]=v=>{this.peerShare.modalOpen=!1,this.peerShare.selectedPeer=void 0}),peer:this.configurationPeers.find(v=>v.id===this.peerShare.selectedPeer)},null,8,["peer"])):ce("",!0)]),_:1})]))}const Nte=He(xee,[["render",Ote],["__scopeId","data-v-dc7f794a"]]);class br{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}const Ll={PROPERTYCHANGE:"propertychange"};class Lf{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function Fte(t,e,n){let i,s;n=n||cr;let r=0,o=t.length,a=!1;for(;r>1),s=+n(t[i],e),s<0?r=i+1:(o=i,a=!s);return a?r:~r}function cr(t,e){return t>e?1:t0?s-1:s}return i-1}if(n>0){for(let s=1;s0||n&&o===0)})}function mu(){return!0}function Nf(){return!1}function Ol(){}function jT(t){let e,n,i;return function(){const s=Array.prototype.slice.call(arguments);return(!n||this!==i||!xo(s,n))&&(i=this,n=s,e=t.apply(this,arguments)),e}}function zte(t){function e(){let n;try{n=t()}catch(i){return Promise.reject(i)}return n instanceof Promise?n:Promise.resolve(n)}return e()}function ju(t){for(const e in t)delete t[e]}function Nl(t){let e;for(e in t)return!1;return!e}class Ff extends Lf{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,n){if(!e||!n)return;const i=this.listeners_||(this.listeners_={}),s=i[e]||(i[e]=[]);s.includes(n)||s.push(n)}dispatchEvent(e){const n=typeof e=="string",i=n?e:e.type,s=this.listeners_&&this.listeners_[i];if(!s)return;const r=n?new br(e):e;r.target||(r.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in o||(o[i]=0,a[i]=0),++o[i];let l;for(let c=0,u=s.length;c0:!1}removeEventListener(e,n){if(!this.listeners_)return;const i=this.listeners_[e];if(!i)return;const s=i.indexOf(n);s!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(i[s]=Ol,++this.pendingRemovals_[e]):(i.splice(s,1),i.length===0&&delete this.listeners_[e]))}}const et={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function ft(t,e,n,i,s){if(s){const o=n;n=function(){t.removeEventListener(e,n),o.apply(i??this,arguments)}}else i&&i!==t&&(n=n.bind(i));const r={target:t,type:e,listener:n};return t.addEventListener(e,n),r}function Rh(t,e,n,i){return ft(t,e,n,i,!0)}function Dt(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),ju(t))}class Ku extends Ff{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(et.CHANGE)}getRevision(){return this.revision_}onInternal(e,n){if(Array.isArray(e)){const i=e.length,s=new Array(i);for(let r=0;r0;)this.pop()}extend(e){for(let n=0,i=e.length;nthis.getLength())throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(n),this.array_.splice(e,0,n),this.updateLength_(),this.dispatchEvent(new Bd(ci.ADD,n,e))}pop(){return this.removeAt(this.getLength()-1)}push(e){this.unique_&&this.assertUnique_(e);const n=this.getLength();return this.insertAt(n,e),this.getLength()}remove(e){const n=this.array_;for(let i=0,s=n.length;i=this.getLength())return;const n=this.array_[e];return this.array_.splice(e,1),this.updateLength_(),this.dispatchEvent(new Bd(ci.REMOVE,n,e)),n}setAt(e,n){const i=this.getLength();if(e>=i){this.insertAt(e,n);return}if(e<0)throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(n,e);const s=this.array_[e];this.array_[e]=n,this.dispatchEvent(new Bd(ci.REMOVE,s,e)),this.dispatchEvent(new Bd(ci.ADD,n,e))}updateLength_(){this.set(cw.LENGTH,this.array_.length)}assertUnique_(e,n){for(let i=0,s=this.array_.length;i1?(n=s,i=r):l>0&&(n+=o*l,i+=a*l)}return al(t,e,n,i)}function al(t,e,n,i){const s=n-t,r=i-e;return s*s+r*r}function jte(t){const e=t.length;for(let i=0;ir&&(r=l,s=a)}if(r===0)return null;const o=t[s];t[s]=t[i],t[i]=o;for(let a=i+1;a=0;i--){n[i]=t[i][e]/t[i][i];for(let s=i-1;s>=0;s--)t[s][e]-=t[s][i]*n[i]}return n}function ah(t){return t*Math.PI/180}function ll(t,e){const n=t%e;return n*e<0?n+e:n}function Ti(t,e,n){return t+n*(e-t)}function _y(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}function Vd(t,e){return Math.floor(_y(t,e))}function zd(t,e){return Math.ceil(_y(t,e))}class KT extends Vs{constructor(e){super(),this.on,this.once,this.un,this.background_=e.background;const n=Object.assign({},e);typeof e.properties=="object"&&(delete n.properties,Object.assign(n,e.properties)),n[xt.OPACITY]=e.opacity!==void 0?e.opacity:1,mt(typeof n[xt.OPACITY]=="number","Layer opacity must be a number"),n[xt.VISIBLE]=e.visible!==void 0?e.visible:!0,n[xt.Z_INDEX]=e.zIndex,n[xt.MAX_RESOLUTION]=e.maxResolution!==void 0?e.maxResolution:1/0,n[xt.MIN_RESOLUTION]=e.minResolution!==void 0?e.minResolution:0,n[xt.MIN_ZOOM]=e.minZoom!==void 0?e.minZoom:-1/0,n[xt.MAX_ZOOM]=e.maxZoom!==void 0?e.maxZoom:1/0,this.className_=n.className!==void 0?n.className:"ol-layer",delete n.className,this.setProperties(n),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(e){const n=this.state_||{layer:this,managed:e===void 0?!0:e},i=this.getZIndex();return n.opacity=Jt(Math.round(this.getOpacity()*100)/100,0,1),n.visible=this.getVisible(),n.extent=this.getExtent(),n.zIndex=i===void 0&&!n.managed?1/0:i,n.maxResolution=this.getMaxResolution(),n.minResolution=Math.max(this.getMinResolution(),0),n.minZoom=this.getMinZoom(),n.maxZoom=this.getMaxZoom(),this.state_=n,n}getLayersArray(e){return pt()}getLayerStatesArray(e){return pt()}getExtent(){return this.get(xt.EXTENT)}getMaxResolution(){return this.get(xt.MAX_RESOLUTION)}getMinResolution(){return this.get(xt.MIN_RESOLUTION)}getMinZoom(){return this.get(xt.MIN_ZOOM)}getMaxZoom(){return this.get(xt.MAX_ZOOM)}getOpacity(){return this.get(xt.OPACITY)}getSourceState(){return pt()}getVisible(){return this.get(xt.VISIBLE)}getZIndex(){return this.get(xt.Z_INDEX)}setBackground(e){this.background_=e,this.changed()}setExtent(e){this.set(xt.EXTENT,e)}setMaxResolution(e){this.set(xt.MAX_RESOLUTION,e)}setMinResolution(e){this.set(xt.MIN_RESOLUTION,e)}setMaxZoom(e){this.set(xt.MAX_ZOOM,e)}setMinZoom(e){this.set(xt.MIN_ZOOM,e)}setOpacity(e){mt(typeof e=="number","Layer opacity must be a number"),this.set(xt.OPACITY,e)}setVisible(e){this.set(xt.VISIBLE,e)}setZIndex(e){this.set(xt.Z_INDEX,e)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const Hi={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"},Vn={ANIMATING:0,INTERACTING:1},Qi={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},Kte=42,yy=256,_u={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class UT{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent!==void 0?e.extent:null,this.worldExtent_=e.worldExtent!==void 0?e.worldExtent:null,this.axisOrientation_=e.axisOrientation!==void 0?e.axisOrientation:"enu",this.global_=e.global!==void 0?e.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||_u[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const Uu=6378137,Ja=Math.PI*Uu,Ute=[-Ja,-Ja,Ja,Ja],Gte=[-180,-85,180,85],Wd=Uu*Math.log(Math.tan(Math.PI/2));class Oa extends UT{constructor(e){super({code:e,units:"m",extent:Ute,global:!0,worldExtent:Gte,getPointResolution:function(n,i){return n/Math.cosh(i[1]/Uu)}})}}const uw=[new Oa("EPSG:3857"),new Oa("EPSG:102100"),new Oa("EPSG:102113"),new Oa("EPSG:900913"),new Oa("http://www.opengis.net/def/crs/EPSG/0/3857"),new Oa("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Xte(t,e,n,i){const s=t.length;n=n>1?n:2,i=i??n,e===void 0&&(n>2?e=t.slice():e=new Array(s));for(let r=0;rWd?o=Wd:o<-Wd&&(o=-Wd),e[r+1]=o}return e}function qte(t,e,n,i){const s=t.length;n=n>1?n:2,i=i??n,e===void 0&&(n>2?e=t.slice():e=new Array(s));for(let r=0;rs&&(l=l|kn.RIGHT),ar&&(l=l|kn.ABOVE),l===kn.UNKNOWN&&(l=kn.INTERSECTING),l}function Ui(){return[1/0,1/0,-1/0,-1/0]}function co(t,e,n,i,s){return s?(s[0]=t,s[1]=e,s[2]=n,s[3]=i,s):[t,e,n,i]}function Bf(t){return co(1/0,1/0,-1/0,-1/0,t)}function qT(t,e){const n=t[0],i=t[1];return co(n,i,n,i,e)}function wy(t,e,n,i,s){const r=Bf(s);return ZT(r,t,e,n,i)}function yu(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function nne(t,e){return e[0]t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t}function Gc(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function ZT(t,e,n,i,s){for(;ne[0]?i[0]=t[0]:i[0]=e[0],t[1]>e[1]?i[1]=t[1]:i[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Hf(t){return t[2]=o&&m<=l),!i&&r&kn.RIGHT&&!(s&kn.RIGHT)&&(y=f-(h-l)*p,i=y>=a&&y<=c),!i&&r&kn.BELOW&&!(s&kn.BELOW)&&(m=h-(f-a)/p,i=m>=o&&m<=l),!i&&r&kn.LEFT&&!(s&kn.LEFT)&&(y=f-(h-o)*p,i=y>=a&&y<=c)}return i}function QT(t,e){const n=e.getExtent(),i=da(t);if(e.canWrapX()&&(i[0]=n[2])){const s=vt(n),o=Math.floor((i[0]-n[0])/s)*s;t[0]-=o,t[2]-=o}return t}function xy(t,e,n){if(e.canWrapX()){const i=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[i[0],t[1],i[2],t[3]]];QT(t,e);const s=vt(i);if(vt(t)>s&&!n)return[[i[0],t[1],i[2],t[3]]];if(t[0]i[2])return[[t[0],t[1],i[2],t[3]],[i[0],t[1],t[2]-s,t[3]]]}return[t]}function lne(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function $h(t,e){let n=!0;for(let i=t.length-1;i>=0;--i)if(t[i]!=e[i]){n=!1;break}return n}function Ey(t,e){const n=Math.cos(e),i=Math.sin(e),s=t[0]*n-t[1]*i,r=t[1]*n+t[0]*i;return t[0]=s,t[1]=r,t}function cne(t,e){return t[0]*=e,t[1]*=e,t}function ek(t,e){if(e.canWrapX()){const n=vt(e.getExtent()),i=une(t,e,n);i&&(t[0]-=i*n)}return t}function une(t,e,n){const i=e.getExtent();let s=0;return e.canWrapX()&&(t[0]i[2])&&(n=n||vt(i),s=Math.floor((t[0]-i[0])/n)),s}const dne=63710088e-1;function gw(t,e,n){n=n||dne;const i=ah(t[1]),s=ah(e[1]),r=(s-i)/2,o=ah(e[0]-t[0])/2,a=Math.sin(r)*Math.sin(r)+Math.sin(o)*Math.sin(o)*Math.cos(i)*Math.cos(s);return 2*n*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function tk(...t){console.warn(...t)}let Tm=!0;function nk(t){Tm=!(t===void 0?!0:t)}function Sy(t,e){if(e!==void 0){for(let n=0,i=t.length;n=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(Tm=!1,tk("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function Ty(t,e){return t}function Xr(t,e){return t}function _ne(){mw(uw),mw(hw),gne(hw,uw,Xte,qte)}_ne();function _w(t,e,n){return function(i,s,r,o,a){if(!i)return;if(!s&&!e)return i;const l=e?0:r[0]*s,c=e?0:r[1]*s,u=a?a[0]:0,d=a?a[1]:0;let h=t[0]+l/2+u,f=t[2]-l/2+u,p=t[1]+c/2+d,m=t[3]-c/2+d;h>f&&(h=(f+h)/2,f=h),p>m&&(p=(m+p)/2,m=p);let y=Jt(i[0],h,f),v=Jt(i[1],p,m);if(o&&n&&s){const b=30*s;y+=-b*Math.log(1+Math.max(0,h-i[0])/b)+b*Math.log(1+Math.max(0,i[0]-f)/b),v+=-b*Math.log(1+Math.max(0,p-i[1])/b)+b*Math.log(1+Math.max(0,i[1]-m)/b)}return[y,v]}}function yne(t){return t}function ky(t,e,n,i){const s=vt(e)/n[0],r=Yn(e)/n[1];return i?Math.min(t,Math.max(s,r)):Math.min(t,Math.min(s,r))}function Ay(t,e,n){let i=Math.min(t,e);const s=50;return i*=Math.log(1+s*Math.max(0,t/e-1))/s+1,n&&(i=Math.max(i,n),i/=Math.log(1+s*Math.max(0,n/t-1))/s+1),Jt(i,n/2,e*2)}function vne(t,e,n,i){return e=e!==void 0?e:!0,function(s,r,o,a){if(s!==void 0){const l=t[0],c=t[t.length-1],u=n?ky(l,n,o,i):l;if(a)return e?Ay(s,u,c):Jt(s,c,u);const d=Math.min(u,s),h=Math.floor(my(t,d,r));return t[h]>u&&hMath.round(n*bw[i])/bw[i]).join(", ")+")"}function no(t,e,n,i,s,r,o){r=r||[],o=o||2;let a=0;for(let l=e;l{if(!i)return this.getSimplifiedGeometry(n);const s=this.clone();return s.applyTransform(i),s.getSimplifiedGeometry(n)})}simplifyTransformed(e,n){return this.simplifyTransformedInternal(this.getRevision(),e,n)}clone(){return pt()}closestPointXY(e,n,i,s){return pt()}containsXY(e,n){const i=this.getClosestPoint([e,n]);return i[0]===e&&i[1]===n}getClosestPoint(e,n){return n=n||[NaN,NaN],this.closestPointXY(e[0],e[1],n,1/0),n}intersectsCoordinate(e){return this.containsXY(e[0],e[1])}computeExtent(e){return pt()}getExtent(e){if(this.extentRevision_!=this.getRevision()){const n=this.computeExtent(this.extent_);(isNaN(n[0])||isNaN(n[1]))&&Bf(n),this.extentRevision_=this.getRevision()}return one(this.extent_,e)}rotate(e,n){pt()}scale(e,n,i){pt()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return pt()}getType(){return pt()}applyTransform(e){pt()}intersectsExtent(e){return pt()}translate(e,n){pt()}transform(e,n){const i=Gi(e),s=i.getUnits()=="tile-pixels"?function(r,o,a){const l=i.getExtent(),c=i.getWorldExtent(),u=Yn(c)/Yn(l);return _r(ww,c[0],c[3],u,-u,0,0,0),no(r,0,r.length,a,ww,o),Lh(i,n)(r,o,a)}:Lh(i,n);return this.applyTransform(s),this}}class jf extends Ine{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(e){return wy(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return pt()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const n=this.getSimplifiedGeometryInternal(e);return n.getFlatCoordinates().length1)d=n;else if(h>0){for(let f=0;fs&&(s=c),r=a,o=l}return s}function Dne(t,e,n,i,s){for(let r=0,o=n.length;r0;){const d=c.pop(),h=c.pop();let f=0;const p=t[h],m=t[h+1],y=t[d],v=t[d+1];for(let b=h+i;bf&&(u=b,f=w)}f>s&&(l[(u-e)/i]=1,h+i0&&m>f)&&(p<0&&y0&&y>p)){c=d,u=h;continue}r[o++]=c,r[o++]=u,a=c,l=u,c=d,u=h}return r[o++]=c,r[o++]=u,o}function lk(t,e,n,i,s,r,o,a){for(let l=0,c=n.length;lr&&(c-a)*(r-l)-(s-a)*(u-l)>0&&o++:u<=r&&(c-a)*(r-l)-(s-a)*(u-l)<0&&o--,a=c,l=u}return o!==0}function uk(t,e,n,i,s,r){if(n.length===0||!Go(t,e,n[0],i,s,r))return!1;for(let o=1,a=n.length;ov&&(c=(u+d)/2,uk(t,e,n,i,c,p)&&(y=c,v=b)),u=d}return isNaN(y)&&(y=s[r]),o?(o.push(y,p,v),o):[y,p,v]}function zne(t,e,n,i,s){let r=[];for(let o=0,a=n.length;o=s[0]&&r[2]<=s[2]||r[1]>=s[1]&&r[3]<=s[3]?!0:dk(t,e,n,i,function(o,a){return ane(s,o,a)}):!1}function hk(t,e,n,i,s){return!!($y(t,e,n,i,s)||Go(t,e,n,i,s[0],s[1])||Go(t,e,n,i,s[0],s[3])||Go(t,e,n,i,s[2],s[1])||Go(t,e,n,i,s[2],s[3]))}function Wne(t,e,n,i,s){if(!hk(t,e,n[0],i,s))return!1;if(n.length===1)return!0;for(let r=1,o=n.length;r0}function Yne(t,e,n,i,s){s=s!==void 0?s:!1;for(let r=0,o=n.length;r1&&typeof arguments[n-1]=="function"&&(i=arguments[n-1],--n);let s=0;for(;s0}getInteracting(){return this.hints_[Vn.INTERACTING]>0}cancelAnimations(){this.setHint(Vn.ANIMATING,-this.hints_[Vn.ANIMATING]);let e;for(let n=0,i=this.animations_.length;n=0;--i){const s=this.animations_[i];let r=!0;for(let o=0,a=s.length;o0?c/l.duration:1;u>=1?(l.complete=!0,u=1):r=!1;const d=l.easing(u);if(l.sourceCenter){const h=l.sourceCenter[0],f=l.sourceCenter[1],p=l.targetCenter[0],m=l.targetCenter[1];this.nextCenter_=l.targetCenter;const y=h+d*(p-h),v=f+d*(m-f);this.targetCenter_=[y,v]}if(l.sourceResolution&&l.targetResolution){const h=d===1?l.targetResolution:l.sourceResolution+d*(l.targetResolution-l.sourceResolution);if(l.anchor){const f=this.getViewportSize_(this.getRotation()),p=this.constraints_.resolution(h,0,f,!0);this.targetCenter_=this.calculateCenterZoom(p,l.anchor)}this.nextResolution_=l.targetResolution,this.targetResolution_=h,this.applyTargetState_(!0)}if(l.sourceRotation!==void 0&&l.targetRotation!==void 0){const h=d===1?ll(l.targetRotation+Math.PI,2*Math.PI)-Math.PI:l.sourceRotation+d*(l.targetRotation-l.sourceRotation);if(l.anchor){const f=this.constraints_.rotation(h,!0);this.targetCenter_=this.calculateCenterRotate(f,l.anchor)}this.nextRotation_=l.targetRotation,this.targetRotation_=h}if(this.applyTargetState_(!0),n=!0,!l.complete)break}if(r){this.animations_[i]=null,this.setHint(Vn.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=s[0].callback;o&&Hd(o,!0)}}this.animations_=this.animations_.filter(Boolean),n&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(e,n){let i;const s=this.getCenterInternal();return s!==void 0&&(i=[s[0]-n[0],s[1]-n[1]],Ey(i,e-this.getRotation()),lne(i,n)),i}calculateCenterZoom(e,n){let i;const s=this.getCenterInternal(),r=this.getResolution();if(s!==void 0&&r!==void 0){const o=n[0]-e*(n[0]-s[0])/r,a=n[1]-e*(n[1]-s[1])/r;i=[o,a]}return i}getViewportSize_(e){const n=this.viewportSize_;if(e){const i=n[0],s=n[1];return[Math.abs(i*Math.cos(e))+Math.abs(s*Math.sin(e)),Math.abs(i*Math.sin(e))+Math.abs(s*Math.cos(e))]}return n}setViewportSize(e){this.viewportSize_=Array.isArray(e)?e.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const e=this.getCenterInternal();return e&&km(e,this.getProjection())}getCenterInternal(){return this.get(Qi.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(e){return e!==void 0?(e[0]=this.hints_[0],e[1]=this.hints_[1],e):this.hints_.slice()}calculateExtent(e){const n=this.calculateExtentInternal(e);return Ty(n,this.getProjection())}calculateExtentInternal(e){e=e||this.getViewportSizeMinusPadding_();const n=this.getCenterInternal();mt(n,"The view center is not defined");const i=this.getResolution();mt(i!==void 0,"The view resolution is not defined");const s=this.getRotation();return mt(s!==void 0,"The view rotation is not defined"),Cm(n,i,s,e)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(e){this.applyOptions_(this.getUpdatedOptions_({maxZoom:e}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(e){this.applyOptions_(this.getUpdatedOptions_({minZoom:e}))}setConstrainResolution(e){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:e}))}getProjection(){return this.projection_}getResolution(){return this.get(Qi.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(e,n){return this.getResolutionForExtentInternal(Xr(e,this.getProjection()),n)}getResolutionForExtentInternal(e,n){n=n||this.getViewportSizeMinusPadding_();const i=vt(e)/n[0],s=Yn(e)/n[1];return Math.max(i,s)}getResolutionForValueFunction(e){e=e||2;const n=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,s=Math.log(n/i)/Math.log(e);return function(r){return n/Math.pow(e,r*s)}}getRotation(){return this.get(Qi.ROTATION)}getValueForResolutionFunction(e){const n=Math.log(e||2),i=this.getConstrainedResolution(this.maxResolution_),s=this.minResolution_,r=Math.log(i/s)/n;return function(o){return Math.log(i/o)/n/r}}getViewportSizeMinusPadding_(e){let n=this.getViewportSize_(e);const i=this.padding_;return i&&(n=[n[0]-i[1]-i[3],n[1]-i[0]-i[2]]),n}getState(){const e=this.getProjection(),n=this.getResolution(),i=this.getRotation();let s=this.getCenterInternal();const r=this.padding_;if(r){const o=this.getViewportSizeMinusPadding_();s=dp(s,this.getViewportSize_(),[o[0]/2+r[3],o[1]/2+r[0]],n,i)}return{center:s.slice(0),projection:e!==void 0?e:null,resolution:n,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let e;const n=this.getResolution();return n!==void 0&&(e=this.getZoomForResolution(n)),e}getZoomForResolution(e){let n=this.minZoom_||0,i,s;if(this.resolutions_){const r=my(this.resolutions_,e,1);n=r,i=this.resolutions_[r],r==this.resolutions_.length-1?s=2:s=i/this.resolutions_[r+1]}else i=this.maxResolution_,s=this.zoomFactor_;return n+Math.log(i/e)/Math.log(s)}getResolutionForZoom(e){if(this.resolutions_?.length){if(this.resolutions_.length===1)return this.resolutions_[0];const n=Jt(Math.floor(e),0,this.resolutions_.length-2),i=this.resolutions_[n]/this.resolutions_[n+1];return this.resolutions_[n]/Math.pow(i,Jt(e-n,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,e-this.minZoom_)}fit(e,n){let i;if(mt(Array.isArray(e)||typeof e.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(e)){mt(!Hf(e),"Cannot fit empty extent provided as `geometry`");const s=Xr(e,this.getProjection());i=Tw(s)}else if(e.getType()==="Circle"){const s=Xr(e.getExtent(),this.getProjection());i=Tw(s),i.rotate(this.getRotation(),da(s))}else i=e;this.fitInternal(i,n)}rotatedExtentForGeometry(e){const n=this.getRotation(),i=Math.cos(n),s=Math.sin(-n),r=e.getFlatCoordinates(),o=e.getStride();let a=1/0,l=1/0,c=-1/0,u=-1/0;for(let d=0,h=r.length;d{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(e){return this.renderer_?this.renderer_.getFeatures(e):Promise.resolve([])}getData(e){return!this.renderer_||!this.rendered?null:this.renderer_.getData(e)}isVisible(e){let n;const i=this.getMapInternal();!e&&i&&(e=i.getView()),e instanceof Ss?n={viewState:e.getState(),extent:e.calculateExtent()}:n=e,!n.layerStatesArray&&i&&(n.layerStatesArray=i.getLayerGroup().getLayerStatesArray());let s;n.layerStatesArray?s=n.layerStatesArray.find(o=>o.layer===this):s=this.getLayerState();const r=this.getExtent();return Oy(s,n.viewState)&&(!r||fi(r,n.extent))}getAttributions(e){if(!this.isVisible(e))return[];const n=this.getSource()?.getAttributions();if(!n)return[];const i=e instanceof Ss?e.getViewStateAndExtent():e;let s=n(i);return Array.isArray(s)||(s=[s]),s}render(e,n){const i=this.getRenderer();return i.prepareFrame(e)?(this.rendered=!0,i.renderFrame(e,n)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(e,n){}renderDeferred(e){const n=this.getRenderer();n&&n.renderDeferred(e)}setMapInternal(e){e||this.unrender(),this.set(xt.MAP,e)}getMapInternal(){return this.get(xt.MAP)}setMap(e){this.mapPrecomposeKey_&&(Dt(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),e||this.changed(),this.mapRenderKey_&&(Dt(this.mapRenderKey_),this.mapRenderKey_=null),e&&(this.mapPrecomposeKey_=ft(e,Hi.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=ft(this,et.CHANGE,e.render,e),this.changed())}handlePrecompose_(e){const n=e.frameState.layerStatesArray,i=this.getLayerState(!1);mt(!n.some(s=>s.layer===i.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),n.push(i)}setSource(e){this.set(xt.SOURCE,e)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}}function Oy(t,e){if(!t.visible)return!1;const n=e.resolution;if(n=t.maxResolution)return!1;const i=e.zoom;return i>t.minZoom&&i<=t.maxZoom}function fk(t,e,n=0,i=t.length-1,s=Zne){for(;i>n;){if(i-n>600){const l=i-n+1,c=e-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),f=Math.max(n,Math.floor(e-c*d/l+h)),p=Math.min(i,Math.floor(e+(l-c)*d/l+h));fk(t,e,f,p,s)}const r=t[e];let o=n,a=i;for(pc(t,n,e),s(t[i],r)>0&&pc(t,n,i);o0;)a--}s(t[n],r)===0?pc(t,n,a):(a++,pc(t,a,i)),a<=e&&(n=a+1),e<=a&&(i=a-1)}}function pc(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function Zne(t,e){return te?1:0}let gk=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let n=this.data;const i=[];if(!jd(e,n))return i;const s=this.toBBox,r=[];for(;n;){for(let o=0;o=0&&r[n].children.length>this._maxEntries;)this._split(r,n),n--;this._adjustParentBBoxes(s,r,n)}_split(e,n){const i=e[n],s=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,s);const o=this._chooseSplitIndex(i,r,s),a=Ua(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,Na(i,this.toBBox),Na(a,this.toBBox),n?e[n-1].children.push(a):this._splitRoot(i,a)}_splitRoot(e,n){this.data=Ua([e,n]),this.data.height=e.height+1,this.data.leaf=!1,Na(this.data,this.toBBox)}_chooseSplitIndex(e,n,i){let s,r=1/0,o=1/0;for(let a=n;a<=i-n;a++){const l=Cc(e,0,a,this.toBBox),c=Cc(e,a,i,this.toBBox),u=nie(l,c),d=hp(l)+hp(c);u=n;c--){const u=e.children[c];Tc(a,e.leaf?r(u):u),l+=Yd(a)}return l}_adjustParentBBoxes(e,n,i){for(let s=i;s>=0;s--)Tc(n[s],e)}_condense(e){for(let n=e.length-1,i;n>=0;n--)e[n].children.length===0?n>0?(i=e[n-1].children,i.splice(i.indexOf(e[n]),1)):this.clear():Na(e[n],this.toBBox)}};function Jne(t,e,n){if(!n)return e.indexOf(t);for(let i=0;i=t.minX&&e.maxY>=t.minY}function Ua(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function kw(t,e,n,i,s){const r=[e,n];for(;r.length;){if(n=r.pop(),e=r.pop(),n-e<=i)continue;const o=e+Math.ceil((n-e)/i/2)*i;fk(t,o,e,n,s),r.push(e,o,o,n)}}const ot={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function Aw(t){return t[0]>0&&t[1]>0}function iie(t,e,n){return n===void 0&&(n=[0,0]),n[0]=t[0]*e+.5|0,n[1]=t[1]*e+.5|0,n}function mi(t,e){return Array.isArray(t)?t:(e===void 0?e=[t,t]:(e[0]=t,e[1]=t),e)}class Gf{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=mi(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}clone(){const e=this.getScale();return new Gf({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return pt()}getImage(e){return pt()}getHitDetectionImage(){return pt()}getPixelRatio(e){return 1}getImageState(){return pt()}getImageSize(){return pt()}getOrigin(){return pt()}getSize(){return pt()}setDisplacement(e){this.displacement_=e}setOpacity(e){this.opacity_=e}setRotateWithView(e){this.rotateWithView_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=mi(e)}listenImageChange(e){pt()}load(){pt()}unlistenImageChange(e){pt()}ready(){return Promise.resolve()}}const Eu={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};var Ln={name:"xyz",min:[0,0,0],channel:["X","Y","Z"],alias:["XYZ","ciexyz","cie1931"]};Ln.whitepoint={2:{A:[109.85,100,35.585],C:[98.074,100,118.232],D50:[96.422,100,82.521],D55:[95.682,100,92.149],D65:[95.045592705167,100,108.9057750759878],D75:[94.972,100,122.638],F2:[99.187,100,67.395],F7:[95.044,100,108.755],F11:[100.966,100,64.37],E:[100,100,100]},10:{A:[111.144,100,35.2],C:[97.285,100,116.145],D50:[96.72,100,81.427],D55:[95.799,100,90.926],D65:[94.811,100,107.304],D75:[94.416,100,120.641],F2:[103.28,100,69.026],F7:[95.792,100,107.687],F11:[103.866,100,65.627],E:[100,100,100]}};Ln.max=Ln.whitepoint[2].D65;Ln.rgb=function(t,e){e=e||Ln.whitepoint[2].E;var n=t[0]/e[0],i=t[1]/e[1],s=t[2]/e[2],r,o,a;return r=n*3.240969941904521+i*-1.537383177570093+s*-.498610760293,o=n*-.96924363628087+i*1.87596750150772+s*.041555057407175,a=n*.055630079696993+i*-.20397695888897+s*1.056971514242878,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:r=r*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o=o*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a=a*12.92,r=Math.min(Math.max(0,r),1),o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),[r*255,o*255,a*255]};Eu.xyz=function(t,e){var n=t[0]/255,i=t[1]/255,s=t[2]/255;n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,s=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92;var r=n*.41239079926595+i*.35758433938387+s*.18048078840183,o=n*.21263900587151+i*.71516867876775+s*.072192315360733,a=n*.019330818715591+i*.11919477979462+s*.95053215224966;return e=e||Ln.whitepoint[2].E,[r*e[0],o*e[1],a*e[2]]};const Ny={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(t,e,n){var i,s,r,o,a,l,c,u,d,h,f,p,m;if(r=t[0],o=t[1],a=t[2],r===0)return[0,0,0];var y=.0011070564598794539;return e=e||"D65",n=n||2,d=Ln.whitepoint[n][e][0],h=Ln.whitepoint[n][e][1],f=Ln.whitepoint[n][e][2],p=4*d/(d+15*h+3*f),m=9*h/(d+15*h+3*f),i=o/(13*r)+p||0,s=a/(13*r)+m||0,c=r>8?h*Math.pow((r+16)/116,3):h*r*y,l=c*9*i/(4*s)||0,u=c*(12-3*i-20*s)/(4*s)||0,[l,c,u]}};Ln.luv=function(t,e,n){var i,s,r,o,a,l,c,u,d,h,f,p,m,y=.008856451679035631,v=903.2962962962961;e=e||"D65",n=n||2,d=Ln.whitepoint[n][e][0],h=Ln.whitepoint[n][e][1],f=Ln.whitepoint[n][e][2],p=4*d/(d+15*h+3*f),m=9*h/(d+15*h+3*f),l=t[0],c=t[1],u=t[2],i=4*l/(l+15*c+3*u)||0,s=9*c/(l+15*c+3*u)||0;var b=c/h;return r=b<=y?v*b:116*Math.pow(b,1/3)-16,o=13*r*(i-p),a=13*r*(s-m),[r,o,a]};var pk={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(t){var e=t[0],n=t[1],i=t[2],s,r,o;return o=i/360*2*Math.PI,s=n*Math.cos(o),r=n*Math.sin(o),[e,s,r]},xyz:function(t){return Ny.xyz(pk.luv(t))}};Ny.lchuv=function(t){var e=t[0],n=t[1],i=t[2],s=Math.sqrt(n*n+i*i),r=Math.atan2(i,n),o=r*360/2/Math.PI;return o<0&&(o+=360),[e,s,o]};Ln.lchuv=function(t){return Ny.lchuv(Ln.luv(t))};const Mw={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};var Iw={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function sie(t){var e,n=[],i=1,s;if(typeof t=="number")return{space:"rgb",values:[t>>>16,(t&65280)>>>8,t&255],alpha:1};if(typeof t=="number")return{space:"rgb",values:[t>>>16,(t&65280)>>>8,t&255],alpha:1};if(t=String(t).toLowerCase(),Mw[t])n=Mw[t].slice(),s="rgb";else if(t==="transparent")i=0,s="rgb",n=[0,0,0];else if(t[0]==="#"){var r=t.slice(1),o=r.length,a=o<=4;i=1,a?(n=[parseInt(r[0]+r[0],16),parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16)],o===4&&(i=parseInt(r[3]+r[3],16)/255)):(n=[parseInt(r[0]+r[1],16),parseInt(r[2]+r[3],16),parseInt(r[4]+r[5],16)],o===8&&(i=parseInt(r[6]+r[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),s="rgb"}else if(e=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(t)){var l=e[1];s=l.replace(/a$/,"");var c=s==="cmyk"?4:s==="gray"?1:3;n=e[2].trim().split(/\s*[,\/]\s*|\s+/),s==="color"&&(s=n.shift()),n=n.map(function(u,d){if(u[u.length-1]==="%")return u=parseFloat(u)/100,d===3?u:s==="rgb"?u*255:s[0]==="h"||s[0]==="l"&&!d?u*100:s==="lab"?u*125:s==="lch"?d<2?u*150:u*360:s[0]==="o"&&!d?u:s==="oklab"?u*.4:s==="oklch"?d<2?u*.4:u*360:u;if(s[d]==="h"||d===2&&s[s.length-1]==="h"){if(Iw[u]!==void 0)return Iw[u];if(u.endsWith("deg"))return parseFloat(u);if(u.endsWith("turn"))return parseFloat(u)*360;if(u.endsWith("grad"))return parseFloat(u)*360/400;if(u.endsWith("rad"))return parseFloat(u)*180/Math.PI}return u==="none"?0:parseFloat(u)}),i=n.length>c?n.pop():1}else/[0-9](?:\s|\/|,)/.test(t)&&(n=t.match(/([0-9]+)/g).map(function(u){return parseFloat(u)}),s=t.match(/([a-z])/ig)?.join("")?.toLowerCase()||"rgb");return{space:s,values:n,alpha:i}}const gp={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e=t[0]/360,n=t[1]/100,i=t[2]/100,s,r,o,a,l,c=0;if(n===0)return l=i*255,[l,l,l];for(r=i<.5?i*(1+n):i+n-i*n,s=2*i-r,a=[0,0,0];c<3;)o=e+1/3*-(c-1),o<0?o++:o>1&&o--,l=6*o<1?s+(r-s)*6*o:2*o<1?r:3*o<2?s+(r-s)*(2/3-o)*6:s,a[c++]=l*255;return a}};Eu.hsl=function(t){var e=t[0]/255,n=t[1]/255,i=t[2]/255,s=Math.min(e,n,i),r=Math.max(e,n,i),o=r-s,a,l,c;return r===s?a=0:e===r?a=(n-i)/o:n===r?a=2+(i-e)/o:i===r&&(a=4+(e-n)/o),a=Math.min(a*60,360),a<0&&(a+=360),c=(s+r)/2,r===s?l=0:c<=.5?l=o/(r+s):l=o/(2-r-s),[a,l*100,c*100]};function rie(t){Array.isArray(t)&&t.raw&&(t=String.raw(...arguments)),t instanceof Number&&(t=+t);var e,n=sie(t);if(!n.space)return[];const i=n.space[0]==="h"?gp.min:Eu.min,s=n.space[0]==="h"?gp.max:Eu.max;return e=Array(3),e[0]=Math.min(Math.max(n.values[0],i[0]),s[0]),e[1]=Math.min(Math.max(n.values[1],i[1]),s[1]),e[2]=Math.min(Math.max(n.values[2],i[2]),s[2]),n.space[0]==="h"&&(e=gp.rgb(e)),e.push(Math.min(Math.max(n.alpha,0),1)),e}const Fy=[NaN,NaN,NaN,0];function oie(t){return typeof t=="string"?t:Vy(t)}const aie=1024,mc={};let pp=0;function lie(t){if(t.length===4)return t;const e=t.slice();return e[3]=1,e}function Pw(t){const e=Ln.lchuv(Eu.xyz(t));return e[3]=t[3],e}function cie(t){const e=Ln.rgb(pk.xyz(t));return e[3]=t[3],e}function By(t){if(t==="none")return Fy;if(mc.hasOwnProperty(t))return mc[t];if(pp>=aie){let n=0;for(const i in mc)n++&3||(delete mc[i],--pp)}const e=rie(t);if(e.length!==4)throw new Error('failed to parse "'+t+'" as color');for(const n of e)if(isNaN(n))throw new Error('failed to parse "'+t+'" as color');return mk(e),mc[t]=e,++pp,e}function Su(t){return Array.isArray(t)?t:By(t)}function mk(t){return t[0]=Jt(t[0]+.5|0,0,255),t[1]=Jt(t[1]+.5|0,0,255),t[2]=Jt(t[2]+.5|0,0,255),t[3]=Jt(t[3],0,1),t}function Vy(t){let e=t[0];e!=(e|0)&&(e=e+.5|0);let n=t[1];n!=(n|0)&&(n=n+.5|0);let i=t[2];i!=(i|0)&&(i=i+.5|0);const s=t[3]===void 0?1:Math.round(t[3]*1e3)/1e3;return"rgba("+e+","+n+","+i+","+s+")"}const uo=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",uie=uo.includes("firefox"),die=uo.includes("safari")&&!uo.includes("chrom");die&&(uo.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(uo));const hie=uo.includes("webkit")&&!uo.includes("edge"),_k=uo.includes("macintosh"),yk=typeof devicePixelRatio<"u"?devicePixelRatio:1,vk=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,bk=typeof Image<"u"&&Image.prototype.decode,wk=function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return t}();function an(t,e,n,i){let s;return n&&n.length?s=n.shift():vk?s=new OffscreenCanvas(t||300,e||300):s=document.createElement("canvas"),t&&(s.width=t),e&&(s.height=e),s.getContext("2d",i)}let mp;function Nh(){return mp||(mp=an(1,1)),mp}function Bl(t){const e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function Rw(t,e){const n=e.parentNode;n&&n.replaceChild(t,e)}function fie(t){for(;t.lastChild;)t.lastChild.remove()}function gie(t,e){const n=t.childNodes;for(let i=0;;++i){const s=n[i],r=e[i];if(!s&&!r)break;if(s!==r){if(!s){t.appendChild(r);continue}if(!r){t.removeChild(s),--i;continue}t.insertBefore(r,s)}}}function pie(t,e,n){const i=t;let s=!0,r=!1,o=!1;const a=[Rh(i,et.LOAD,function(){o=!0,r||e()})];return i.src&&bk?(r=!0,i.decode().then(function(){s&&e()}).catch(function(l){s&&(o?e():n())})):a.push(Rh(i,et.ERROR,n)),function(){s=!1,a.forEach(Dt)}}function mie(t,e){return new Promise((n,i)=>{function s(){o(),n(t)}function r(){o(),i(new Error("Image load error"))}function o(){t.removeEventListener("load",s),t.removeEventListener("error",r)}t.addEventListener("load",s),t.addEventListener("error",r),e&&(t.src=e)})}function _ie(t,e){return e&&(t.src=e),t.src&&bk?new Promise((n,i)=>t.decode().then(()=>n(t)).catch(s=>t.complete&&t.width?n(t):i(s))):mie(t)}class yie{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let e=0;for(const n in this.cache_){const i=this.cache_[n];!(e++&3)&&!i.hasListener()&&(delete this.cache_[n],delete this.patternCache_[n],--this.cacheSize_)}}}get(e,n,i){const s=_p(e,n,i);return s in this.cache_?this.cache_[s]:null}getPattern(e,n,i){const s=_p(e,n,i);return s in this.patternCache_?this.patternCache_[s]:null}set(e,n,i,s,r){const o=_p(e,n,i),a=o in this.cache_;this.cache_[o]=s,r&&(s.getImageState()===ot.IDLE&&s.load(),s.getImageState()===ot.LOADING?s.ready().then(()=>{this.patternCache_[o]=Nh().createPattern(s.getImage(1),"repeat")}):this.patternCache_[o]=Nh().createPattern(s.getImage(1),"repeat")),a||++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}}function _p(t,e,n){const i=n?Su(n):"null";return e+":"+t+":"+i}const Ms=new yie;let _c=null;class vie extends Ff{constructor(e,n,i,s,r){super(),this.hitDetectionImage_=null,this.image_=e,this.crossOrigin_=i,this.canvas_={},this.color_=r,this.imageState_=s===void 0?ot.IDLE:s,this.size_=e&&e.width&&e.height?[e.width,e.height]:null,this.src_=n,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===ot.LOADED){_c||(_c=an(1,1,void 0,{willReadFrequently:!0})),_c.drawImage(this.image_,0,0);try{_c.getImageData(0,0,1,1),this.tainted_=!1}catch{_c=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(et.CHANGE)}handleImageError_(){this.imageState_=ot.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=ot.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(e){return this.image_||this.initializeImage_(),this.replaceColor_(e),this.canvas_[e]?this.canvas_[e]:this.image_}getPixelRatio(e){return this.replaceColor_(e),this.canvas_[e]?e:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const e=this.size_[0],n=this.size_[1],i=an(e,n);i.fillRect(0,0,e,n),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===ot.IDLE){this.image_||this.initializeImage_(),this.imageState_=ot.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&_ie(this.image_,this.src_).then(e=>{this.image_=e,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(e){if(!this.color_||this.canvas_[e]||this.imageState_!==ot.LOADED)return;const n=this.image_,i=an(Math.ceil(n.width*e),Math.ceil(n.height*e)),s=i.canvas;i.scale(e,e),i.drawImage(n,0,0),i.globalCompositeOperation="multiply",i.fillStyle=oie(this.color_),i.fillRect(0,0,s.width/e,s.height/e),i.globalCompositeOperation="destination-in",i.drawImage(n,0,0),this.canvas_[e]=s}ready(){return this.ready_||(this.ready_=new Promise(e=>{if(this.imageState_===ot.LOADED||this.imageState_===ot.ERROR)e();else{const n=()=>{(this.imageState_===ot.LOADED||this.imageState_===ot.ERROR)&&(this.removeEventListener(et.CHANGE,n),e())};this.addEventListener(et.CHANGE,n)}})),this.ready_}}function zy(t,e,n,i,s,r){let o=e===void 0?void 0:Ms.get(e,n,s);return o||(o=new vie(t,t&&"src"in t?t.src||void 0:e,n,i,s),Ms.set(e,n,s,o,r)),r&&o&&!Ms.getPattern(e,n,s)&&Ms.set(e,n,s,o,r),o}function Is(t){return t?Array.isArray(t)?Vy(t):typeof t=="object"&&"src"in t?bie(t):t:null}function bie(t){if(!t.offset||!t.size)return Ms.getPattern(t.src,"anonymous",t.color);const e=t.src+":"+t.offset,n=Ms.getPattern(e,void 0,t.color);if(n)return n;const i=Ms.get(t.src,"anonymous",null);if(i.getImageState()!==ot.LOADED)return null;const s=an(t.size[0],t.size[1]);return s.drawImage(i.getImage(1),t.offset[0],t.offset[1],t.size[0],t.size[1],0,0,t.size[0],t.size[1]),zy(s.canvas,e,void 0,ot.LOADED,t.color,!0),Ms.getPattern(e,void 0,t.color)}const Kd="ol-hidden",Xf="ol-unselectable",Wy="ol-control",Dw="ol-collapsed",wie=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),$w=["style","variant","weight","size","lineHeight","family"],xk=function(t){const e=t.match(wie);if(!e)return null;const n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let i=0,s=$w.length;iMath.max(s,Bh(t,r)),0);return n[e]=i,i}function tie(t,e){const n=[],i=[],s=[];let r=0,o=0,a=0,l=0;for(let c=0,u=e.length;c<=u;c+=2){const d=e[c];if(d===` -`||c===u){r=Math.max(r,o),s.push(o),o=0,a+=l,l=0;continue}const h=e[c+1]||t.font,f=Bh(h,d);n.push(f),o+=f;const p=eie(h);i.push(p),l=Math.max(l,p)}return{width:r,height:a,widths:n,heights:i,lineWidths:s}}function nie(t,e,n,i,s,r,o,a,l,c,u){t.save(),n!==1&&(t.globalAlpha===void 0?t.globalAlpha=d=>d.globalAlpha*=n:t.globalAlpha*=n),e&&t.transform.apply(t,e),i.contextInstructions?(t.translate(l,c),t.scale(u[0],u[1]),iie(i,t)):u[0]<0||u[1]<0?(t.translate(l,c),t.scale(u[0],u[1]),t.drawImage(i,s,r,o,a,0,0,o,a)):t.drawImage(i,s,r,o,a,l,c,o*u[0],a*u[1]),t.restore()}function iie(t,e){const n=t.contextInstructions;for(let i=0,s=n.length;ithis.imageState_=ot.LOADED),this.render()}clone(){const e=this.getScale(),n=new qf({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n}getAnchor(){const e=this.size_,n=this.getDisplacement(),i=this.getScaleArray();return[e[0]/2-n[0]/i[0],e[1]/2+n[1]/i[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(e){this.fill_=e,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(e){let n=this.canvases_[e];if(!n){const i=this.renderOptions_,s=an(i.size*e,i.size*e);this.draw_(i,s,e),n=s.canvas,this.canvases_[e]=n}return n}getPixelRatio(e){return e}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e,this.render()}listenImageChange(e){}load(){}unlistenImageChange(e){}calculateLineJoinSize_(e,n,i){if(n===0||this.points_===1/0||e!=="bevel"&&e!=="miter")return n;let s=this.radius,r=this.radius2_===void 0?s:this.radius2_;if(s{this.patternImage_=null}),n.getImageState()===ot.IDLE&&n.load(),n.getImageState()===ot.LOADING&&(this.patternImage_=n)}this.color_=e}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}const Zf=jy;class Ky{constructor(e){e=e||{},this.color_=e.color!==void 0?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=e.lineDash!==void 0?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}clone(){const e=this.getColor();return new Ky({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(e){this.color_=e}setLineCap(e){this.lineCap_=e}setLineDash(e){this.lineDash_=e}setLineDashOffset(e){this.lineDashOffset_=e}setLineJoin(e){this.lineJoin_=e}setMiterLimit(e){this.miterLimit_=e}setWidth(e){this.width_=e}}const Vh=Ky;class Jf{constructor(e){e=e||{},this.geometry_=null,this.geometryFunction_=Ow,e.geometry!==void 0&&this.setGeometry(e.geometry),this.fill_=e.fill!==void 0?e.fill:null,this.image_=e.image!==void 0?e.image:null,this.renderer_=e.renderer!==void 0?e.renderer:null,this.hitDetectionRenderer_=e.hitDetectionRenderer!==void 0?e.hitDetectionRenderer:null,this.stroke_=e.stroke!==void 0?e.stroke:null,this.text_=e.text!==void 0?e.text:null,this.zIndex_=e.zIndex}clone(){let e=this.getGeometry();return e&&typeof e=="object"&&(e=e.clone()),new Jf({geometry:e??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(e){this.renderer_=e}setHitDetectionRenderer(e){this.hitDetectionRenderer_=e}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(e){this.fill_=e}getImage(){return this.image_}setImage(e){this.image_=e}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e}getText(){return this.text_}setText(e){this.text_=e}getZIndex(){return this.zIndex_}setGeometry(e){typeof e=="function"?this.geometryFunction_=e:typeof e=="string"?this.geometryFunction_=function(n){return n.get(e)}:e?e!==void 0&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=Ow,this.geometry_=e}setZIndex(e){this.zIndex_=e}}function sie(t){let e;if(typeof t=="function")e=t;else{let n;Array.isArray(t)?n=t:(mt(typeof t.getZIndex=="function","Expected an `Style` or an array of `Style`"),n=[t]),e=function(){return n}}return e}let yp=null;function Ck(t,e){if(!yp){const n=new Zf({color:"rgba(255,255,255,0.4)"}),i=new Vh({color:"#3399CC",width:1.25});yp=[new Jf({image:new Yy({fill:n,stroke:i,radius:5}),fill:n,stroke:i})]}return yp}function Ow(t){return t.getGeometry()}const ul=Jf;function Nw(t,e,n,i){return n!==void 0&&i!==void 0?[n/t,i/e]:n!==void 0?n/t:i!==void 0?i/e:1}class Qf extends Gf{constructor(e){e=e||{};const n=e.opacity!==void 0?e.opacity:1,i=e.rotation!==void 0?e.rotation:0,s=e.scale!==void 0?e.scale:1,r=e.rotateWithView!==void 0?e.rotateWithView:!1;super({opacity:n,rotation:i,scale:s,displacement:e.displacement!==void 0?e.displacement:[0,0],rotateWithView:r,declutterMode:e.declutterMode}),this.anchor_=e.anchor!==void 0?e.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=e.anchorOrigin!==void 0?e.anchorOrigin:"top-left",this.anchorXUnits_=e.anchorXUnits!==void 0?e.anchorXUnits:"fraction",this.anchorYUnits_=e.anchorYUnits!==void 0?e.anchorYUnits:"fraction",this.crossOrigin_=e.crossOrigin!==void 0?e.crossOrigin:null;const o=e.img!==void 0?e.img:null;let a=e.src;mt(!(a!==void 0&&o),"`image` and `src` cannot be provided at the same time"),(a===void 0||a.length===0)&&o&&(a=o.src||wt(o)),mt(a!==void 0&&a.length>0,"A defined and non-empty `src` or `image` must be provided"),mt(!((e.width!==void 0||e.height!==void 0)&&e.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let l;if(e.src!==void 0?l=ot.IDLE:o!==void 0&&("complete"in o?o.complete?l=o.src?ot.LOADED:ot.IDLE:l=ot.LOADING:l=ot.LOADED),this.color_=e.color!==void 0?Su(e.color):null,this.iconImage_=zy(o,a,this.crossOrigin_,l,this.color_),this.offset_=e.offset!==void 0?e.offset:[0,0],this.offsetOrigin_=e.offsetOrigin!==void 0?e.offsetOrigin:"top-left",this.origin_=null,this.size_=e.size!==void 0?e.size:null,this.initialOptions_,e.width!==void 0||e.height!==void 0){let c,u;if(e.size)[c,u]=e.size;else{const d=this.getImage(1);if(d.width&&d.height)c=d.width,u=d.height;else if(d instanceof HTMLImageElement){this.initialOptions_=e;const h=()=>{if(this.unlistenImageChange(h),!this.initialOptions_)return;const f=this.iconImage_.getSize();this.setScale(Nw(f[0],f[1],e.width,e.height))};this.listenImageChange(h);return}}c!==void 0&&this.setScale(Nw(c,u,e.width,e.height))}}clone(){let e,n,i;return this.initialOptions_?(n=this.initialOptions_.width,i=this.initialOptions_.height):(e=this.getScale(),e=Array.isArray(e)?e.slice():e),new Qf({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:e,width:n,height:i,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let e=this.normalizedAnchor_;if(!e){e=this.anchor_;const s=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!s)return null;e=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(e[0]*=s[0]),this.anchorYUnits_=="fraction"&&(e[1]*=s[1])}if(this.anchorOrigin_!="top-left"){if(!s)return null;e===this.anchor_&&(e=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(e[0]=-e[0]+s[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(e[1]=-e[1]+s[1])}this.normalizedAnchor_=e}const n=this.getDisplacement(),i=this.getScaleArray();return[e[0]-n[0]/i[0],e[1]+n[1]/i[1]]}setAnchor(e){this.anchor_=e,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(e){return this.iconImage_.getImage(e)}getPixelRatio(e){return this.iconImage_.getPixelRatio(e)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let e=this.offset_;if(this.offsetOrigin_!="top-left"){const n=this.getSize(),i=this.iconImage_.getSize();if(!n||!i)return null;e=e.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(e[0]=i[0]-n[0]-e[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(e[1]=i[1]-n[1]-e[1])}return this.origin_=e,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const e=this.getScaleArray();if(this.size_)return this.size_[0]*e[0];if(this.iconImage_.getImageState()==ot.LOADED)return this.iconImage_.getSize()[0]*e[0]}getHeight(){const e=this.getScaleArray();if(this.size_)return this.size_[1]*e[1];if(this.iconImage_.getImageState()==ot.LOADED)return this.iconImage_.getSize()[1]*e[1]}setScale(e){delete this.initialOptions_,super.setScale(e)}listenImageChange(e){this.iconImage_.addEventListener(et.CHANGE,e)}load(){this.iconImage_.load()}unlistenImageChange(e){this.iconImage_.removeEventListener(et.CHANGE,e)}ready(){return this.iconImage_.ready()}}const rie="#333";class Uy{constructor(e){e=e||{},this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=mi(e.scale!==void 0?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.justify_=e.justify,this.repeat_=e.repeat,this.textBaseline_=e.textBaseline,this.fill_=e.fill!==void 0?e.fill:new Zf({color:rie}),this.maxAngle_=e.maxAngle!==void 0?e.maxAngle:Math.PI/4,this.placement_=e.placement!==void 0?e.placement:"point",this.overflow_=!!e.overflow,this.stroke_=e.stroke!==void 0?e.stroke:null,this.offsetX_=e.offsetX!==void 0?e.offsetX:0,this.offsetY_=e.offsetY!==void 0?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=e.padding===void 0?null:e.padding,this.declutterMode_=e.declutterMode}clone(){const e=this.getScale();return new Uy({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0,declutterMode:this.getDeclutterMode()})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}getDeclutterMode(){return this.declutterMode_}setOverflow(e){this.overflow_=e}setFont(e){this.font_=e}setMaxAngle(e){this.maxAngle_=e}setOffsetX(e){this.offsetX_=e}setOffsetY(e){this.offsetY_=e}setPlacement(e){this.placement_=e}setRepeat(e){this.repeat_=e}setRotateWithView(e){this.rotateWithView_=e}setFill(e){this.fill_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=mi(e!==void 0?e:1)}setStroke(e){this.stroke_=e}setText(e){this.text_=e}setTextAlign(e){this.textAlign_=e}setJustify(e){this.justify_=e}setTextBaseline(e){this.textBaseline_=e}setBackgroundFill(e){this.backgroundFill_=e}setBackgroundStroke(e){this.backgroundStroke_=e}setPadding(e){this.padding_=e}}let wa=0;const qn=1<",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",Multiply:"*",Divide:"/",Add:"+",Subtract:"-",Clamp:"clamp",Mod:"%",Pow:"^",Abs:"abs",Floor:"floor",Ceil:"ceil",Round:"round",Sin:"sin",Cos:"cos",Atan:"atan",Sqrt:"sqrt",Match:"match",Between:"between",Interpolate:"interpolate",Coalesce:"coalesce",Case:"case",In:"in",Number:"number",String:"string",Array:"array",Color:"color",Id:"id",Band:"band",Palette:"palette",ToString:"to-string",Has:"has"},cie={[_e.Get]:Ue(it(1,1/0),Fw),[_e.Var]:Ue(it(1,1),uie),[_e.Has]:Ue(it(1,1/0),Fw),[_e.Id]:Ue(die,Fa),[_e.Concat]:Ue(it(2,1/0),_t(di)),[_e.GeometryType]:Ue(hie,Fa),[_e.LineMetric]:Ue(Fa),[_e.Resolution]:Ue(Fa),[_e.Zoom]:Ue(Fa),[_e.Time]:Ue(Fa),[_e.Any]:Ue(it(2,1/0),_t(qn)),[_e.All]:Ue(it(2,1/0),_t(qn)),[_e.Not]:Ue(it(1,1),_t(qn)),[_e.Equal]:Ue(it(2,2),_t(Ud)),[_e.NotEqual]:Ue(it(2,2),_t(Ud)),[_e.GreaterThan]:Ue(it(2,2),_t(dt)),[_e.GreaterThanOrEqualTo]:Ue(it(2,2),_t(dt)),[_e.LessThan]:Ue(it(2,2),_t(dt)),[_e.LessThanOrEqualTo]:Ue(it(2,2),_t(dt)),[_e.Multiply]:Ue(it(2,1/0),Bw),[_e.Coalesce]:Ue(it(2,1/0),Bw),[_e.Divide]:Ue(it(2,2),_t(dt)),[_e.Add]:Ue(it(2,1/0),_t(dt)),[_e.Subtract]:Ue(it(2,2),_t(dt)),[_e.Clamp]:Ue(it(3,3),_t(dt)),[_e.Mod]:Ue(it(2,2),_t(dt)),[_e.Pow]:Ue(it(2,2),_t(dt)),[_e.Abs]:Ue(it(1,1),_t(dt)),[_e.Floor]:Ue(it(1,1),_t(dt)),[_e.Ceil]:Ue(it(1,1),_t(dt)),[_e.Round]:Ue(it(1,1),_t(dt)),[_e.Sin]:Ue(it(1,1),_t(dt)),[_e.Cos]:Ue(it(1,1),_t(dt)),[_e.Atan]:Ue(it(1,2),_t(dt)),[_e.Sqrt]:Ue(it(1,1),_t(dt)),[_e.Match]:Ue(it(4,1/0),Vw,gie),[_e.Between]:Ue(it(3,3),_t(dt)),[_e.Interpolate]:Ue(it(6,1/0),Vw,pie),[_e.Case]:Ue(it(3,1/0),fie,mie),[_e.In]:Ue(it(2,2),_ie),[_e.Number]:Ue(it(1,1/0),_t(Ud)),[_e.String]:Ue(it(1,1/0),_t(Ud)),[_e.Array]:Ue(it(1,1/0),_t(dt)),[_e.Color]:Ue(it(1,4),_t(dt)),[_e.Band]:Ue(it(1,3),_t(dt)),[_e.Palette]:Ue(it(2,2),yie),[_e.ToString]:Ue(it(1,1),_t(qn|dt|di|os))};function Fw(t,e,n){const i=t.length-1,s=new Array(i);for(let r=0;re){const a=e===1/0?`${t} or more`:`${t} to ${e}`;throw new Error(`expected ${a} arguments for ${r}, got ${o}`)}}}function Bw(t,e,n){const i=t.length-1,s=new Array(i);for(let r=0;ri.featureId;case _e.GeometryType:return i=>i.geometryType;case _e.Concat:{const i=t.args.map(s=>gs(s));return s=>"".concat(...i.map(r=>r(s).toString()))}case _e.Resolution:return i=>i.resolution;case _e.Any:case _e.All:case _e.Between:case _e.In:case _e.Not:return Eie(t);case _e.Equal:case _e.NotEqual:case _e.LessThan:case _e.LessThanOrEqualTo:case _e.GreaterThan:case _e.GreaterThanOrEqualTo:return xie(t);case _e.Multiply:case _e.Divide:case _e.Add:case _e.Subtract:case _e.Clamp:case _e.Mod:case _e.Pow:case _e.Abs:case _e.Floor:case _e.Ceil:case _e.Round:case _e.Sin:case _e.Cos:case _e.Atan:case _e.Sqrt:return Sie(t);case _e.Case:return Cie(t);case _e.Match:return Tie(t);case _e.Interpolate:return kie(t);case _e.ToString:return Aie(t);default:throw new Error(`Unsupported operator ${n}`)}}function bie(t,e){const n=t.operator,i=t.args.length,s=new Array(i);for(let r=0;r{for(let o=0;o{for(let o=0;o{const r=t.args;let o=s.properties[i];for(let a=1,l=r.length;as.variables[i];case _e.Has:return s=>{const r=t.args;if(!(i in s.properties))return!1;let o=s.properties[i];for(let a=1,l=r.length;ai(r)===s(r);case _e.NotEqual:return r=>i(r)!==s(r);case _e.LessThan:return r=>i(r)i(r)<=s(r);case _e.GreaterThan:return r=>i(r)>s(r);case _e.GreaterThanOrEqualTo:return r=>i(r)>=s(r);default:throw new Error(`Unsupported comparison operator ${n}`)}}function Eie(t,e){const n=t.operator,i=t.args.length,s=new Array(i);for(let r=0;r{for(let o=0;o{for(let o=0;o{const o=s[0](r),a=s[1](r),l=s[2](r);return o>=a&&o<=l};case _e.In:return r=>{const o=s[0](r);for(let a=1;a!s[0](r);default:throw new Error(`Unsupported logical operator ${n}`)}}function Sie(t,e){const n=t.operator,i=t.args.length,s=new Array(i);for(let r=0;r{let o=1;for(let a=0;as[0](r)/s[1](r);case _e.Add:return r=>{let o=0;for(let a=0;as[0](r)-s[1](r);case _e.Clamp:return r=>{const o=s[0](r),a=s[1](r);if(ol?l:o};case _e.Mod:return r=>s[0](r)%s[1](r);case _e.Pow:return r=>Math.pow(s[0](r),s[1](r));case _e.Abs:return r=>Math.abs(s[0](r));case _e.Floor:return r=>Math.floor(s[0](r));case _e.Ceil:return r=>Math.ceil(s[0](r));case _e.Round:return r=>Math.round(s[0](r));case _e.Sin:return r=>Math.sin(s[0](r));case _e.Cos:return r=>Math.cos(s[0](r));case _e.Atan:return i===2?r=>Math.atan2(s[0](r),s[1](r)):r=>Math.atan(s[0](r));case _e.Sqrt:return r=>Math.sqrt(s[0](r));default:throw new Error(`Unsupported numeric operator ${n}`)}}function Cie(t,e){const n=t.args.length,i=new Array(n);for(let s=0;s{for(let r=0;r{const r=i[0](s);for(let o=1;o{const r=i[0](s),o=i[1](s);let a,l;for(let c=2;c=o)return c===2?d:h?Mie(r,o,a,l,u,d):Ic(r,o,a,l,u,d);a=u,l=d}return l}}function Aie(t,e){const n=t.operator,i=t.args.length,s=new Array(i);for(let r=0;r{const o=s[0](r);return t.args[0].type===os?Vy(o):o.toString()};default:throw new Error(`Unsupported convert operator ${n}`)}}function Ic(t,e,n,i,s,r){const o=s-n;if(o===0)return i;const a=e-n,l=t===1?a/o:(Math.pow(t,a)-1)/(Math.pow(t,o)-1);return i+l*(r-i)}function Mie(t,e,n,i,s,r){if(s-n===0)return i;const a=Pw(i),l=Pw(r);let c=l[2]-a[2];c>180?c-=360:c<-180&&(c+=360);const u=[Ic(t,e,n,a[0],s,l[0]),Ic(t,e,n,a[1],s,l[1]),a[2]+Ic(t,e,n,0,s,c),Ic(t,e,n,i[3],s,r[3])];return mk(Vne(u))}function Iie(t){return!0}function Pie(t){const e=Tk(),n=Rie(t,e),i=Ak();return function(s,r){if(i.properties=s.getPropertiesInternal(),i.resolution=r,e.featureId){const o=s.getId();o!==void 0?i.featureId=o:i.featureId=null}return e.geometryType&&(i.geometryType=kk(s.getGeometry())),n(i)}}function zw(t){const e=Tk(),n=t.length,i=new Array(n);for(let o=0;onull;i=Xy(t,e+"fill-color",n)}if(!i)return null;const s=new Zf;return function(r){const o=i(r);return o===Fy?null:(s.setColor(o),s)}}function Iu(t,e,n){const i=gi(t,e+"stroke-width",n),s=Xy(t,e+"stroke-color",n);if(!i&&!s)return null;const r=nr(t,e+"stroke-line-cap",n),o=nr(t,e+"stroke-line-join",n),a=Mk(t,e+"stroke-line-dash",n),l=gi(t,e+"stroke-line-dash-offset",n),c=gi(t,e+"stroke-miter-limit",n),u=new Vh;return function(d){if(s){const h=s(d);if(h===Fy)return null;u.setColor(h)}if(i&&u.setWidth(i(d)),r){const h=r(d);if(h!=="butt"&&h!=="round"&&h!=="square")throw new Error("Expected butt, round, or square line cap");u.setLineCap(h)}if(o){const h=o(d);if(h!=="bevel"&&h!=="round"&&h!=="miter")throw new Error("Expected bevel, round, or miter line join");u.setLineJoin(h)}return a&&u.setLineDash(a(d)),l&&u.setLineDashOffset(l(d)),c&&u.setMiterLimit(c(d)),u}}function Die(t,e){const n="text-",i=nr(t,n+"value",e);if(!i)return null;const s=Mu(t,n,e),r=Mu(t,n+"background-",e),o=Iu(t,n,e),a=Iu(t,n+"background-",e),l=nr(t,n+"font",e),c=gi(t,n+"max-angle",e),u=gi(t,n+"offset-x",e),d=gi(t,n+"offset-y",e),h=Pu(t,n+"overflow",e),f=nr(t,n+"placement",e),p=gi(t,n+"repeat",e),m=eg(t,n+"scale",e),y=Pu(t,n+"rotate-with-view",e),v=gi(t,n+"rotation",e),b=nr(t,n+"align",e),E=nr(t,n+"justify",e),C=nr(t,n+"baseline",e),w=Mk(t,n+"padding",e),x=tg(t,n+"declutter-mode"),T=new Uy({declutterMode:x});return function(k){if(T.setText(i(k)),s&&T.setFill(s(k)),r&&T.setBackgroundFill(r(k)),o&&T.setStroke(o(k)),a&&T.setBackgroundStroke(a(k)),l&&T.setFont(l(k)),c&&T.setMaxAngle(c(k)),u&&T.setOffsetX(u(k)),d&&T.setOffsetY(d(k)),h&&T.setOverflow(h(k)),f){const A=f(k);if(A!=="point"&&A!=="line")throw new Error("Expected point or line for text-placement");T.setPlacement(A)}if(p&&T.setRepeat(p(k)),m&&T.setScale(m(k)),y&&T.setRotateWithView(y(k)),v&&T.setRotation(v(k)),b){const A=b(k);if(A!=="left"&&A!=="center"&&A!=="right"&&A!=="end"&&A!=="start")throw new Error("Expected left, right, center, start, or end for text-align");T.setTextAlign(A)}if(E){const A=E(k);if(A!=="left"&&A!=="right"&&A!=="center")throw new Error("Expected left, right, or center for text-justify");T.setJustify(A)}if(C){const A=C(k);if(A!=="bottom"&&A!=="top"&&A!=="middle"&&A!=="alphabetic"&&A!=="hanging")throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");T.setTextBaseline(A)}return w&&T.setPadding(w(k)),T}}function $ie(t,e){return"icon-src"in t?Lie(t,e):"shape-points"in t?Oie(t,e):"circle-radius"in t?Nie(t,e):null}function Lie(t,e){const n="icon-",i=n+"src",s=Ik(t[i],i),r=zh(t,n+"anchor",e),o=eg(t,n+"scale",e),a=gi(t,n+"opacity",e),l=zh(t,n+"displacement",e),c=gi(t,n+"rotation",e),u=Pu(t,n+"rotate-with-view",e),d=Hw(t,n+"anchor-origin"),h=Yw(t,n+"anchor-x-units"),f=Yw(t,n+"anchor-y-units"),p=Wie(t,n+"color"),m=Vie(t,n+"cross-origin"),y=zie(t,n+"offset"),v=Hw(t,n+"offset-origin"),b=Wh(t,n+"width"),E=Wh(t,n+"height"),C=Bie(t,n+"size"),w=tg(t,n+"declutter-mode"),x=new Qf({src:s,anchorOrigin:d,anchorXUnits:h,anchorYUnits:f,color:p,crossOrigin:m,offset:y,offsetOrigin:v,height:E,width:b,size:C,declutterMode:w});return function(T){return a&&x.setOpacity(a(T)),l&&x.setDisplacement(l(T)),c&&x.setRotation(c(T)),u&&x.setRotateWithView(u(T)),o&&x.setScale(o(T)),r&&x.setAnchor(r(T)),x}}function Oie(t,e){const n="shape-",i=n+"points",s=n+"radius",r=Pm(t[i],i),o=Pm(t[s],s),a=Mu(t,n,e),l=Iu(t,n,e),c=eg(t,n+"scale",e),u=zh(t,n+"displacement",e),d=gi(t,n+"rotation",e),h=Pu(t,n+"rotate-with-view",e),f=Wh(t,n+"radius2"),p=Wh(t,n+"angle"),m=tg(t,n+"declutter-mode"),y=new qf({points:r,radius:o,radius2:f,angle:p,declutterMode:m});return function(v){return a&&y.setFill(a(v)),l&&y.setStroke(l(v)),u&&y.setDisplacement(u(v)),d&&y.setRotation(d(v)),h&&y.setRotateWithView(h(v)),c&&y.setScale(c(v)),y}}function Nie(t,e){const n="circle-",i=Mu(t,n,e),s=Iu(t,n,e),r=gi(t,n+"radius",e),o=eg(t,n+"scale",e),a=zh(t,n+"displacement",e),l=gi(t,n+"rotation",e),c=Pu(t,n+"rotate-with-view",e),u=tg(t,n+"declutter-mode"),d=new Yy({radius:5,declutterMode:u});return function(h){return r&&d.setRadius(r(h)),i&&d.setFill(i(h)),s&&d.setStroke(s(h)),a&&d.setDisplacement(a(h)),l&&d.setRotation(l(h)),c&&d.setRotateWithView(c(h)),o&&d.setScale(o(h)),d}}function gi(t,e,n){if(!(e in t))return;const i=wr(t[e],dt,n);return function(s){return Pm(i(s),e)}}function nr(t,e,n){if(!(e in t))return null;const i=wr(t[e],di,n);return function(s){return Ik(i(s),e)}}function Fie(t,e,n){const i=nr(t,e+"pattern-src",n),s=Ww(t,e+"pattern-offset",n),r=Ww(t,e+"pattern-size",n),o=Xy(t,e+"color",n);return function(a){return{src:i(a),offset:s&&s(a),size:r&&r(a),color:o&&o(a)}}}function Pu(t,e,n){if(!(e in t))return null;const i=wr(t[e],qn,n);return function(s){const r=i(s);if(typeof r!="boolean")throw new Error(`Expected a boolean for ${e}`);return r}}function Xy(t,e,n){if(!(e in t))return null;const i=wr(t[e],os,n);return function(s){return Pk(i(s),e)}}function Mk(t,e,n){if(!(e in t))return null;const i=wr(t[e],ha,n);return function(s){return Gu(i(s),e)}}function zh(t,e,n){if(!(e in t))return null;const i=wr(t[e],ha,n);return function(s){const r=Gu(i(s),e);if(r.length!==2)throw new Error(`Expected two numbers for ${e}`);return r}}function Ww(t,e,n){if(!(e in t))return null;const i=wr(t[e],ha,n);return function(s){return Rk(i(s),e)}}function eg(t,e,n){if(!(e in t))return null;const i=wr(t[e],ha|dt,n);return function(s){return Hie(i(s),e)}}function Wh(t,e){const n=t[e];if(n!==void 0){if(typeof n!="number")throw new Error(`Expected a number for ${e}`);return n}}function Bie(t,e){const n=t[e];if(n!==void 0){if(typeof n=="number")return mi(n);if(!Array.isArray(n))throw new Error(`Expected a number or size array for ${e}`);if(n.length!==2||typeof n[0]!="number"||typeof n[1]!="number")throw new Error(`Expected a number or size array for ${e}`);return n}}function Vie(t,e){const n=t[e];if(n!==void 0){if(typeof n!="string")throw new Error(`Expected a string for ${e}`);return n}}function Hw(t,e){const n=t[e];if(n!==void 0){if(n!=="bottom-left"&&n!=="bottom-right"&&n!=="top-left"&&n!=="top-right")throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${e}`);return n}}function Yw(t,e){const n=t[e];if(n!==void 0){if(n!=="pixels"&&n!=="fraction")throw new Error(`Expected pixels or fraction for ${e}`);return n}}function zie(t,e){const n=t[e];if(n!==void 0)return Gu(n,e)}function tg(t,e){const n=t[e];if(n!==void 0){if(typeof n!="string")throw new Error(`Expected a string for ${e}`);if(n!=="declutter"&&n!=="obstacle"&&n!=="none")throw new Error(`Expected declutter, obstacle, or none for ${e}`);return n}}function Wie(t,e){const n=t[e];if(n!==void 0)return Pk(n,e)}function Gu(t,e){if(!Array.isArray(t))throw new Error(`Expected an array for ${e}`);const n=t.length;for(let i=0;i4)throw new Error(`Expected a color with 3 or 4 values for ${e}`);return n}function Rk(t,e){const n=Gu(t,e);if(n.length!==2)throw new Error(`Expected an array of two numbers for ${e}`);return n}function Hie(t,e){return typeof t=="number"?t:Rk(t,e)}const jw={RENDER_ORDER:"renderOrder"};class Dk extends Uf{constructor(e){e=e||{};const n=Object.assign({},e);delete n.style,delete n.renderBuffer,delete n.updateWhileAnimating,delete n.updateWhileInteracting,super(n),this.declutter_=e.declutter?String(e.declutter):void 0,this.renderBuffer_=e.renderBuffer!==void 0?e.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(e.style),this.updateWhileAnimating_=e.updateWhileAnimating!==void 0?e.updateWhileAnimating:!1,this.updateWhileInteracting_=e.updateWhileInteracting!==void 0?e.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(e){return super.getFeatures(e)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(jw.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(e,n){const i=this.getDeclutter();i in e.declutter||(e.declutter[i]=new gk(9)),this.getRenderer().renderDeclutter(e,n)}setRenderOrder(e){this.set(jw.RENDER_ORDER,e)}setStyle(e){this.style_=e===void 0?Ck:e;const n=Yie(e);this.styleFunction_=e===null?void 0:sie(n),this.changed()}}function Yie(t){if(t===void 0)return Ck;if(!t)return null;if(typeof t=="function"||t instanceof ul)return t;if(!Array.isArray(t))return zw([t]);if(t.length===0)return[];const e=t.length,n=t[0];if(n instanceof ul){const s=new Array(e);for(let r=0;r=0;--w){const x=m[w],T=x.layer;if(T.hasRenderer()&&Oy(x,u)&&a.call(l,T)){const k=T.getRenderer(),A=T.getSource();if(k&&A){const P=A.getWrapX()?f:e,F=d.bind(null,x.managed);b[0]=P[0]+p[C][0],b[1]=P[1]+p[C][1],c=k.forEachFeatureAtCoordinate(b,n,i,F,v)}if(c)return c}}if(v.length===0)return;const E=1/v.length;return v.forEach((C,w)=>C.distanceSq+=w*E),v.sort((C,w)=>C.distanceSq-w.distanceSq),v.some(C=>c=C.callback(C.feature,C.layer,C.geometry)),c}hasFeatureAtCoordinate(e,n,i,s,r,o){return this.forEachFeatureAtCoordinate(e,n,i,s,mu,this,r,o)!==void 0}getMap(){return this.map_}renderFrame(e){pt()}scheduleExpireIconCache(e){Ms.canExpireCache()&&e.postRenderFunctions.push(Kie)}}function Kie(t,e){Ms.expire()}class $k extends br{constructor(e,n,i,s){super(e),this.inversePixelTransform=n,this.frameState=i,this.context=s}}class Uie extends jie{constructor(e){super(e),this.fontChangeListenerKey_=ft(Js,Ll.PROPERTYCHANGE,e.redrawText,e),this.element_=document.createElement("div");const n=this.element_.style;n.position="absolute",n.width="100%",n.height="100%",n.zIndex="0",this.element_.className=Xf+" ol-layers";const i=e.getViewport();i.insertBefore(this.element_,i.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(e,n){const i=this.getMap();if(i.hasListener(e)){const s=new $k(e,void 0,n);i.dispatchEvent(s)}}disposeInternal(){Dt(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(e){if(!e){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(e),this.dispatchRenderEvent(Hi.PRECOMPOSE,e);const n=e.layerStatesArray.sort((a,l)=>a.zIndex-l.zIndex);n.some(a=>a.layer instanceof Dk&&a.layer.getDeclutter())&&(e.declutter={});const s=e.viewState;this.children_.length=0;const r=[];let o=null;for(let a=0,l=n.length;a=0;--i){const s=n[i],r=s.layer;r.getDeclutter()&&r.renderDeclutter(e,s)}n.forEach(i=>i.layer.renderDeferred(e))}}}class zr extends br{constructor(e,n){super(e),this.layer=n}}const vp={LAYERS:"layers"};class Zl extends KT{constructor(e){e=e||{};const n=Object.assign({},e);delete n.layers;let i=e.layers;super(n),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(vp.LAYERS,this.handleLayersChanged_),i?Array.isArray(i)?i=new As(i.slice(),{unique:!0}):mt(typeof i.getArray=="function","Expected `layers` to be an array or a `Collection`"):i=new As(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(Dt),this.layersListenerKeys_.length=0;const e=this.getLayers();this.layersListenerKeys_.push(ft(e,ci.ADD,this.handleLayersAdd_,this),ft(e,ci.REMOVE,this.handleLayersRemove_,this));for(const i in this.listenerKeys_)this.listenerKeys_[i].forEach(Dt);ju(this.listenerKeys_);const n=e.getArray();for(let i=0,s=n.length;i{this.clickTimeoutId_=void 0;const i=new Lr(Gt.SINGLECLICK,this.map_,e);this.dispatchEvent(i)},250)}updateActivePointers_(e){const n=e,i=n.pointerId;if(n.type==Gt.POINTERUP||n.type==Gt.POINTERCANCEL){delete this.trackedTouches_[i];for(const s in this.trackedTouches_)if(this.trackedTouches_[s].target!==n.target){delete this.trackedTouches_[s];break}}else(n.type==Gt.POINTERDOWN||n.type==Gt.POINTERMOVE)&&(this.trackedTouches_[i]=n);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(e){this.updateActivePointers_(e);const n=new Lr(Gt.POINTERUP,this.map_,e,void 0,void 0,this.activePointers_);this.dispatchEvent(n),this.emulateClicks_&&!n.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(e)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(Dt),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(e){return e.button===0}handlePointerDown_(e){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(e);const n=new Lr(Gt.POINTERDOWN,this.map_,e,void 0,void 0,this.activePointers_);if(this.dispatchEvent(n),this.down_=new PointerEvent(e.type,e),Object.defineProperty(this.down_,"target",{writable:!1,value:e.target}),this.dragListenerKeys_.length===0){const i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(ft(i,Gt.POINTERMOVE,this.handlePointerMove_,this),ft(i,Gt.POINTERUP,this.handlePointerUp_,this),ft(this.element_,Gt.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(ft(this.element_.getRootNode(),Gt.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(e){if(this.isMoving_(e)){this.updateActivePointers_(e),this.dragging_=!0;const n=new Lr(Gt.POINTERDRAG,this.map_,e,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(n)}}relayMoveEvent_(e){this.originalPointerMoveEvent_=e;const n=!!(this.down_&&this.isMoving_(e));this.dispatchEvent(new Lr(Gt.POINTERMOVE,this.map_,e,n))}handleTouchMove_(e){const n=this.originalPointerMoveEvent_;(!n||n.defaultPrevented)&&(typeof e.cancelable!="boolean"||e.cancelable===!0)&&e.preventDefault()}isMoving_(e){return this.dragging_||Math.abs(e.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(e.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(Dt(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(et.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Dt(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Dt),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const Or={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},Fn={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},Hh=1/0;class Xie{constructor(e,n){this.priorityFunction_=e,this.keyFunction_=n,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,ju(this.queuedElements_)}dequeue(){const e=this.elements_,n=this.priorities_,i=e[0];e.length==1?(e.length=0,n.length=0):(e[0]=e.pop(),n[0]=n.pop(),this.siftUp_(0));const s=this.keyFunction_(i);return delete this.queuedElements_[s],i}enqueue(e){mt(!(this.keyFunction_(e)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const n=this.priorityFunction_(e);return n!=Hh?(this.elements_.push(e),this.priorities_.push(n),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(e){return e*2+1}getRightChildIndex_(e){return e*2+2}getParentIndex_(e){return e-1>>1}heapify_(){let e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)}isEmpty(){return this.elements_.length===0}isKeyQueued(e){return e in this.queuedElements_}isQueued(e){return this.isKeyQueued(this.keyFunction_(e))}siftUp_(e){const n=this.elements_,i=this.priorities_,s=n.length,r=n[e],o=i[e],a=e;for(;e>1;){const l=this.getLeftChildIndex_(e),c=this.getRightChildIndex_(e),u=ce;){const a=this.getParentIndex_(n);if(s[a]>o)i[n]=i[a],s[n]=s[a],n=a;else break}i[n]=r,s[n]=o}reprioritize(){const e=this.priorityFunction_,n=this.elements_,i=this.priorities_;let s=0;const r=n.length;let o,a,l;for(a=0;a0;){const s=this.dequeue()[0],r=s.getKey();s.getState()===Fe.IDLE&&!(r in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++i,s.load())}}}function Zie(t,e,n,i,s){if(!t||!(n in t.wantedTiles)||!t.wantedTiles[n][e.getKey()])return Hh;const r=t.viewState.center,o=i[0]-r[0],a=i[1]-r[1];return 65536*Math.log(s)+Math.sqrt(o*o+a*a)/s}class qy extends Vs{constructor(e){super();const n=e.element;n&&!e.target&&!n.style.pointerEvents&&(n.style.pointerEvents="auto"),this.element=n||null,this.target_=null,this.map_=null,this.listenerKeys=[],e.render&&(this.render=e.render),e.target&&this.setTarget(e.target)}disposeInternal(){this.element?.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(e){this.map_&&this.element?.remove();for(let n=0,i=this.listenerKeys.length;ns.getAttributions(e)));if(this.attributions_!==void 0&&(Array.isArray(this.attributions_)?this.attributions_.forEach(s=>i.add(s)):i.add(this.attributions_)),!this.overrideCollapsible_){const s=!n.some(r=>r.getSource()?.getAttributionsCollapsible()===!1);this.setCollapsible(s)}return Array.from(i)}async updateElement_(e){if(!e){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const n=await Promise.all(this.collectSourceAttributions_(e).map(s=>yte(()=>s))),i=n.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!xo(n,this.renderedAttributions_)){Yne(this.ulElement_);for(let s=0,r=n.length;s0&&i%(2*Math.PI)!==0?n.animate({rotation:0,duration:this.duration_,easing:ql}):n.setRotation(0))}render(e){const n=e.frameState;if(!n)return;const i=n.viewState.rotation;if(i!=this.rotation_){const s="rotate("+i+"rad)";if(this.autoHide_){const r=this.element.classList.contains(Kd);!r&&i===0?this.element.classList.add(Kd):r&&i!==0&&this.element.classList.remove(Kd)}this.label_.style.transform=s}this.rotation_=i}}const tse=ese;class nse extends qy{constructor(e){e=e||{},super({element:document.createElement("div"),target:e.target});const n=e.className!==void 0?e.className:"ol-zoom",i=e.delta!==void 0?e.delta:1,s=e.zoomInClassName!==void 0?e.zoomInClassName:n+"-in",r=e.zoomOutClassName!==void 0?e.zoomOutClassName:n+"-out",o=e.zoomInLabel!==void 0?e.zoomInLabel:"+",a=e.zoomOutLabel!==void 0?e.zoomOutLabel:"–",l=e.zoomInTipLabel!==void 0?e.zoomInTipLabel:"Zoom in",c=e.zoomOutTipLabel!==void 0?e.zoomOutTipLabel:"Zoom out",u=document.createElement("button");u.className=s,u.setAttribute("type","button"),u.title=l,u.appendChild(typeof o=="string"?document.createTextNode(o):o),u.addEventListener(et.CLICK,this.handleClick_.bind(this,i),!1);const d=document.createElement("button");d.className=r,d.setAttribute("type","button"),d.title=c,d.appendChild(typeof a=="string"?document.createTextNode(a):a),d.addEventListener(et.CLICK,this.handleClick_.bind(this,-i),!1);const h=n+" "+Xf+" "+Wy,f=this.element;f.className=h,f.appendChild(u),f.appendChild(d),this.duration_=e.duration!==void 0?e.duration:250}handleClick_(e,n){n.preventDefault(),this.zoomByDelta_(e)}zoomByDelta_(e){const i=this.getMap().getView();if(!i)return;const s=i.getZoom();if(s!==void 0){const r=i.getConstrainedZoom(s+e);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:r,duration:this.duration_,easing:ql})):i.setZoom(r)}}}const ise=nse;function sse(t){t=t||{};const e=new As;return(t.zoom!==void 0?t.zoom:!0)&&e.push(new ise(t.zoomOptions)),(t.rotate!==void 0?t.rotate:!0)&&e.push(new tse(t.rotateOptions)),(t.attribution!==void 0?t.attribution:!0)&&e.push(new Qie(t.attributionOptions)),e}const Kw={ACTIVE:"active"};class Xu extends Vs{constructor(e){super(),this.on,this.once,this.un,e&&e.handleEvent&&(this.handleEvent=e.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(Kw.ACTIVE)}getMap(){return this.map_}handleEvent(e){return!0}setActive(e){this.set(Kw.ACTIVE,e)}setMap(e){this.map_=e}}function rse(t,e,n){const i=t.getCenterInternal();if(i){const s=[i[0]+e[0],i[1]+e[1]];t.animateInternal({duration:n!==void 0?n:250,easing:tne,center:t.getConstrainedCenter(s)})}}function Zy(t,e,n,i){const s=t.getZoom();if(s===void 0)return;const r=t.getConstrainedZoom(s+e),o=t.getResolutionForZoom(r);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:o,anchor:n,duration:i!==void 0?i:250,easing:ql})}class ose extends Xu{constructor(e){super(),e=e||{},this.delta_=e.delta?e.delta:1,this.duration_=e.duration!==void 0?e.duration:250}handleEvent(e){let n=!1;if(e.type==Gt.DBLCLICK){const i=e.originalEvent,s=e.map,r=e.coordinate,o=i.shiftKey?-this.delta_:this.delta_,a=s.getView();Zy(a,o,r,this.duration_),i.preventDefault(),n=!0}return!n}}const ase=ose;class qu extends Xu{constructor(e){e=e||{},super(e),e.handleDownEvent&&(this.handleDownEvent=e.handleDownEvent),e.handleDragEvent&&(this.handleDragEvent=e.handleDragEvent),e.handleMoveEvent&&(this.handleMoveEvent=e.handleMoveEvent),e.handleUpEvent&&(this.handleUpEvent=e.handleUpEvent),e.stopDown&&(this.stopDown=e.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(e){return!1}handleDragEvent(e){}handleEvent(e){if(!e.originalEvent)return!0;let n=!1;if(this.updateTrackedPointers_(e),this.handlingDownUpSequence){if(e.type==Gt.POINTERDRAG)this.handleDragEvent(e),e.originalEvent.preventDefault();else if(e.type==Gt.POINTERUP){const i=this.handleUpEvent(e);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(e.type==Gt.POINTERDOWN){const i=this.handleDownEvent(e);this.handlingDownUpSequence=i,n=this.stopDown(i)}else e.type==Gt.POINTERMOVE&&this.handleMoveEvent(e);return!n}handleMoveEvent(e){}handleUpEvent(e){return!1}stopDown(e){return e}updateTrackedPointers_(e){e.activePointers&&(this.targetPointers=e.activePointers)}}function Jy(t){const e=t.length;let n=0,i=0;for(let s=0;s0&&this.condition_(e)){const i=e.map.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}const pse=gse;class mse extends qu{constructor(e){e=e||{},super({stopDown:Nf}),this.condition_=e.condition?e.condition:lse,this.lastAngle_=void 0,this.duration_=e.duration!==void 0?e.duration:250}handleDragEvent(e){if(!bp(e))return;const n=e.map,i=n.getView();if(i.getConstraints().rotation===My)return;const s=n.getSize(),r=e.pixel,o=Math.atan2(s[1]/2-r[1],r[0]-s[0]/2);if(this.lastAngle_!==void 0){const a=o-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=o}handleUpEvent(e){return bp(e)?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){return bp(e)&&Ok(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}class _se extends Lf{constructor(e){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+e,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const e=this.startPixel_,n=this.endPixel_,i="px",s=this.element_.style;s.left=Math.min(e[0],n[0])+i,s.top=Math.min(e[1],n[1])+i,s.width=Math.abs(n[0]-e[0])+i,s.height=Math.abs(n[1]-e[1])+i}setMap(e){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const n=this.element_.style;n.left="inherit",n.top="inherit",n.width="inherit",n.height="inherit"}this.map_=e,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(e,n){this.startPixel_=e,this.endPixel_=n,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;const e=this.startPixel_,n=this.endPixel_,s=[e,[e[0],n[1]],n,[n[0],e[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);s[4]=s[0].slice(),this.geometry_?this.geometry_.setCoordinates([s]):this.geometry_=new xu([s])}getGeometry(){return this.geometry_}}const Ba={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class yc extends br{constructor(e,n,i){super(e),this.coordinate=n,this.mapBrowserEvent=i}}class yse extends qu{constructor(e){super(),this.on,this.once,this.un,e=e??{},this.box_=new _se(e.className||"ol-dragbox"),this.minArea_=e.minArea??64,e.onBoxEnd&&(this.onBoxEnd=e.onBoxEnd),this.startPixel_=null,this.condition_=e.condition??Ok,this.boxEndCondition_=e.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(e,n,i){const s=i[0]-n[0],r=i[1]-n[1];return s*s+r*r>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(e){this.startPixel_&&(this.box_.setPixels(this.startPixel_,e.pixel),this.dispatchEvent(new yc(Ba.BOXDRAG,e.coordinate,e)))}handleUpEvent(e){if(!this.startPixel_)return!1;const n=this.boxEndCondition_(e,this.startPixel_,e.pixel);return n&&this.onBoxEnd(e),this.dispatchEvent(new yc(n?Ba.BOXEND:Ba.BOXCANCEL,e.coordinate,e)),this.box_.setMap(null),this.startPixel_=null,!1}handleDownEvent(e){return this.condition_(e)?(this.startPixel_=e.pixel,this.box_.setMap(e.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new yc(Ba.BOXSTART,e.coordinate,e)),!0):!1}onBoxEnd(e){}setActive(e){e||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new yc(Ba.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setActive(e)}setMap(e){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new yc(Ba.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setMap(e)}}class vse extends yse{constructor(e){e=e||{};const n=e.condition?e.condition:hse;super({condition:n,className:e.className||"ol-dragzoom",minArea:e.minArea}),this.duration_=e.duration!==void 0?e.duration:200,this.out_=e.out!==void 0?e.out:!1}onBoxEnd(e){const i=this.getMap().getView();let s=this.getGeometry();if(this.out_){const r=i.rotatedExtentForGeometry(s),o=i.getResolutionForExtentInternal(r),a=i.getResolution()/o;s=s.clone(),s.scale(a*a)}i.fitInternal(s,{duration:this.duration_,easing:ql})}}const bse=vse,Fo={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class wse extends Xu{constructor(e){super(),e=e||{},this.defaultCondition_=function(n){return Nk(n)&&Fk(n)},this.condition_=e.condition!==void 0?e.condition:this.defaultCondition_,this.duration_=e.duration!==void 0?e.duration:100,this.pixelDelta_=e.pixelDelta!==void 0?e.pixelDelta:128}handleEvent(e){let n=!1;if(e.type==et.KEYDOWN){const i=e.originalEvent,s=i.key;if(this.condition_(e)&&(s==Fo.DOWN||s==Fo.LEFT||s==Fo.RIGHT||s==Fo.UP)){const o=e.map.getView(),a=o.getResolution()*this.pixelDelta_;let l=0,c=0;s==Fo.DOWN?c=-a:s==Fo.LEFT?l=-a:s==Fo.RIGHT?l=a:c=a;const u=[l,c];Ey(u,o.getRotation()),rse(o,u,this.duration_),i.preventDefault(),n=!0}}return!n}}class xse extends Xu{constructor(e){super(),e=e||{},this.condition_=e.condition?e.condition:function(n){return!dse(n)&&Fk(n)},this.delta_=e.delta?e.delta:1,this.duration_=e.duration!==void 0?e.duration:100}handleEvent(e){let n=!1;if(e.type==et.KEYDOWN||e.type==et.KEYPRESS){const i=e.originalEvent,s=i.key;if(this.condition_(e)&&(s==="+"||s==="-")){const r=e.map,o=s==="+"?this.delta_:-this.delta_,a=r.getView();Zy(a,o,void 0,this.duration_),i.preventDefault(),n=!0}}return!n}}const Ese=xse;class Sse{constructor(e,n,i){this.decay_=e,this.minVelocity_=n,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(e,n){this.points_.push(e,n,Date.now())}end(){if(this.points_.length<6)return!1;const e=Date.now()-this.delay_,n=this.points_.length-3;if(this.points_[n+2]0&&this.points_[i+2]>e;)i-=3;const s=this.points_[n+2]-this.points_[i+2];if(s<1e3/60)return!1;const r=this.points_[n]-this.points_[i],o=this.points_[n+1]-this.points_[i+1];return this.angle_=Math.atan2(o,r),this.initialVelocity_=Math.sqrt(r*r+o*o)/s,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}class Cse extends Xu{constructor(e){e=e||{},super(e),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=e.maxDelta!==void 0?e.maxDelta:1,this.duration_=e.duration!==void 0?e.duration:250,this.timeout_=e.timeout!==void 0?e.timeout:80,this.useAnchor_=e.useAnchor!==void 0?e.useAnchor:!0,this.constrainResolution_=e.constrainResolution!==void 0?e.constrainResolution:!1;const n=e.condition?e.condition:use;this.condition_=e.onFocusOnly?Dm(Lk,n):n,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;const e=this.getMap();if(!e)return;e.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(e){if(!this.condition_(e)||e.type!==et.WHEEL)return!0;const i=e.map,s=e.originalEvent;s.preventDefault(),this.useAnchor_&&(this.lastAnchor_=e.pixel);let r;if(e.type==et.WHEEL&&(r=s.deltaY,zne&&s.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(r/=yk),s.deltaMode===WheelEvent.DOM_DELTA_LINE&&(r*=40)),r===0)return!1;this.lastDelta_=r;const o=Date.now();this.startTime_===void 0&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(r)<4?"trackpad":"wheel");const a=i.getView();if(this.mode_==="trackpad"&&!(a.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-r/this.deltaPerZoom_,this.lastAnchor_?i.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=o,!1;this.totalDelta_+=r;const l=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),l),!1}handleWheelZoom_(e){const n=e.getView();n.getAnimating()&&n.cancelAnimations();let i=-Jt(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(n.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),Zy(n,i,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(e){this.useAnchor_=e,e||(this.lastAnchor_=null)}}const Tse=Cse;class kse extends qu{constructor(e){e=e||{};const n=e;n.stopDown||(n.stopDown=Nf),super(n),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=e.threshold!==void 0?e.threshold:.3,this.duration_=e.duration!==void 0?e.duration:250}handleDragEvent(e){let n=0;const i=this.targetPointers[0],s=this.targetPointers[1],r=Math.atan2(s.clientY-i.clientY,s.clientX-i.clientX);if(this.lastAngle_!==void 0){const l=r-this.lastAngle_;this.rotationDelta_+=l,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),n=l}this.lastAngle_=r;const o=e.map,a=o.getView();a.getConstraints().rotation!==My&&(this.anchor_=o.getCoordinateFromPixelInternal(o.getEventPixel(Jy(this.targetPointers))),this.rotating_&&(o.render(),a.adjustRotationInternal(n,this.anchor_)))}handleUpEvent(e){return this.targetPointers.length<2?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){if(this.targetPointers.length>=2){const n=e.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||n.getView().beginInteraction(),!0}return!1}}class Ase extends qu{constructor(e){e=e||{};const n=e;n.stopDown||(n.stopDown=Nf),super(n),this.anchor_=null,this.duration_=e.duration!==void 0?e.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(e){let n=1;const i=this.targetPointers[0],s=this.targetPointers[1],r=i.clientX-s.clientX,o=i.clientY-s.clientY,a=Math.sqrt(r*r+o*o);this.lastDistance_!==void 0&&(n=this.lastDistance_/a),this.lastDistance_=a;const l=e.map,c=l.getView();n!=1&&(this.lastScaleDelta_=n),this.anchor_=l.getCoordinateFromPixelInternal(l.getEventPixel(Jy(this.targetPointers))),l.render(),c.adjustResolutionInternal(n,this.anchor_)}handleUpEvent(e){if(this.targetPointers.length<2){const i=e.map.getView(),s=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,s),!1}return!0}handleDownEvent(e){if(this.targetPointers.length>=2){const n=e.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||n.getView().beginInteraction(),!0}return!1}}const Mse=Ase;function Ise(t){t=t||{};const e=new As,n=new Sse(-.005,.05,100);return(t.altShiftDragRotate!==void 0?t.altShiftDragRotate:!0)&&e.push(new mse),(t.doubleClickZoom!==void 0?t.doubleClickZoom:!0)&&e.push(new ase({delta:t.zoomDelta,duration:t.zoomDuration})),(t.dragPan!==void 0?t.dragPan:!0)&&e.push(new pse({onFocusOnly:t.onFocusOnly,kinetic:n})),(t.pinchRotate!==void 0?t.pinchRotate:!0)&&e.push(new kse),(t.pinchZoom!==void 0?t.pinchZoom:!0)&&e.push(new Mse({duration:t.zoomDuration})),(t.keyboard!==void 0?t.keyboard:!0)&&(e.push(new wse),e.push(new Ese({delta:t.zoomDelta,duration:t.zoomDuration}))),(t.mouseWheelZoom!==void 0?t.mouseWheelZoom:!0)&&e.push(new Tse({onFocusOnly:t.onFocusOnly,duration:t.zoomDuration})),(t.shiftDragZoom!==void 0?t.shiftDragZoom:!0)&&e.push(new bse({duration:t.zoomDuration})),e}function Bk(t){if(t instanceof Uf){t.setMapInternal(null);return}t instanceof Zl&&t.getLayers().forEach(Bk)}function Vk(t,e){if(t instanceof Uf){t.setMapInternal(e);return}if(t instanceof Zl){const n=t.getLayers().getArray();for(let i=0,s=n.length;ithis.updateSize()),this.controls=n.controls||sse(),this.interactions=n.interactions||Ise({onFocusOnly:!0}),this.overlays_=n.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new qie(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(Fn.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(Fn.VIEW,this.handleViewChanged_),this.addChangeListener(Fn.SIZE,this.handleSizeChanged_),this.addChangeListener(Fn.TARGET,this.handleTargetChanged_),this.setProperties(n.values);const i=this;e.view&&!(e.view instanceof Ss)&&e.view.then(function(s){i.setView(new Ss(s))}),this.controls.addEventListener(ci.ADD,s=>{s.element.setMap(this)}),this.controls.addEventListener(ci.REMOVE,s=>{s.element.setMap(null)}),this.interactions.addEventListener(ci.ADD,s=>{s.element.setMap(this)}),this.interactions.addEventListener(ci.REMOVE,s=>{s.element.setMap(null)}),this.overlays_.addEventListener(ci.ADD,s=>{this.addOverlayInternal_(s.element)}),this.overlays_.addEventListener(ci.REMOVE,s=>{const r=s.element.getId();r!==void 0&&delete this.overlayIdIndex_[r.toString()],s.element.setMap(null)}),this.controls.forEach(s=>{s.setMap(this)}),this.interactions.forEach(s=>{s.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(e){this.getControls().push(e)}addInteraction(e){this.getInteractions().push(e)}addLayer(e){this.getLayerGroup().getLayers().push(e)}handleLayerAdd_(e){Vk(e.layer,this)}addOverlay(e){this.getOverlays().push(e)}addOverlayInternal_(e){const n=e.getId();n!==void 0&&(this.overlayIdIndex_[n.toString()]=e),e.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(e,n,i){if(!this.frameState_||!this.renderer_)return;const s=this.getCoordinateFromPixelInternal(e);i=i!==void 0?i:{};const r=i.hitTolerance!==void 0?i.hitTolerance:0,o=i.layerFilter!==void 0?i.layerFilter:mu,a=i.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(s,this.frameState_,r,a,n,null,o,null)}getFeaturesAtPixel(e,n){const i=[];return this.forEachFeatureAtPixel(e,function(s){i.push(s)},n),i}getAllLayers(){const e=[];function n(i){i.forEach(function(s){s instanceof Zl?n(s.getLayers()):e.push(s)})}return n(this.getLayers()),e}hasFeatureAtPixel(e,n){if(!this.frameState_||!this.renderer_)return!1;const i=this.getCoordinateFromPixelInternal(e);n=n!==void 0?n:{};const s=n.layerFilter!==void 0?n.layerFilter:mu,r=n.hitTolerance!==void 0?n.hitTolerance:0,o=n.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,r,o,s,null)}getEventCoordinate(e){return this.getCoordinateFromPixel(this.getEventPixel(e))}getEventCoordinateInternal(e){return this.getCoordinateFromPixelInternal(this.getEventPixel(e))}getEventPixel(e){const i=this.viewport_.getBoundingClientRect(),s=this.getSize(),r=i.width/s[0],o=i.height/s[1],a="changedTouches"in e?e.changedTouches[0]:e;return[(a.clientX-i.left)/r,(a.clientY-i.top)/o]}getTarget(){return this.get(Fn.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(e){return km(this.getCoordinateFromPixelInternal(e),this.getView().getProjection())}getCoordinateFromPixelInternal(e){const n=this.frameState_;return n?$n(n.pixelToCoordinateTransform,e.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(e){const n=this.overlayIdIndex_[e.toString()];return n!==void 0?n:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(Fn.LAYERGROUP)}setLayers(e){const n=this.getLayerGroup();if(e instanceof As){n.setLayers(e);return}const i=n.getLayers();i.clear(),i.extend(e)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const e=this.getLayerGroup().getLayerStatesArray();for(let n=0,i=e.length;n=0;r--){const o=s[r];if(o.getMap()!==this||!o.getActive()||!this.getTargetElement())continue;if(!o.handleEvent(e)||e.propagationStopped)break}}}handlePostRender(){const e=this.frameState_,n=this.tileQueue_;if(!n.isEmpty()){let s=this.maxTilesLoading_,r=s;if(e){const o=e.viewHints;if(o[Vn.ANIMATING]||o[Vn.INTERACTING]){const a=Date.now()-e.time>8;s=a?0:8,r=a?0:2}}n.getTilesLoading(){this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(e){const n=this.getLayerGroup();n&&this.handleLayerRemove_(new zr("removelayer",n)),this.set(Fn.LAYERGROUP,e)}setSize(e){this.set(Fn.SIZE,e)}setTarget(e){this.set(Fn.TARGET,e)}setView(e){if(!e||e instanceof Ss){this.set(Fn.VIEW,e);return}this.set(Fn.VIEW,new Ss);const n=this;e.then(function(i){n.setView(new Ss(i))})}updateSize(){const e=this.getTargetElement();let n;if(e){const s=getComputedStyle(e),r=e.offsetWidth-parseFloat(s.borderLeftWidth)-parseFloat(s.paddingLeft)-parseFloat(s.paddingRight)-parseFloat(s.borderRightWidth),o=e.offsetHeight-parseFloat(s.borderTopWidth)-parseFloat(s.paddingTop)-parseFloat(s.paddingBottom)-parseFloat(s.borderBottomWidth);!isNaN(r)&&!isNaN(o)&&(n=[Math.max(0,r),Math.max(0,o)],!Aw(n)&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)&&tk("No map visible because the map container's width or height are 0."))}const i=this.getSize();n&&(!i||!xo(n,i))&&(this.setSize(n),this.updateViewportSize_(n))}updateViewportSize_(e){const n=this.getView();n&&n.setViewportSize(e)}};function Rse(t){let e=null;t.keyboardEventTarget!==void 0&&(e=typeof t.keyboardEventTarget=="string"?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);const n={},i=t.layers&&typeof t.layers.getLayers=="function"?t.layers:new Zl({layers:t.layers});n[Fn.LAYERGROUP]=i,n[Fn.TARGET]=t.target,n[Fn.VIEW]=t.view instanceof Ss?t.view:new Ss;let s;t.controls!==void 0&&(Array.isArray(t.controls)?s=new As(t.controls.slice()):(mt(typeof t.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),s=t.controls));let r;t.interactions!==void 0&&(Array.isArray(t.interactions)?r=new As(t.interactions.slice()):(mt(typeof t.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),r=t.interactions));let o;return t.overlays!==void 0?Array.isArray(t.overlays)?o=new As(t.overlays.slice()):(mt(typeof t.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),o=t.overlays):o=new As,{controls:s,interactions:r,keyboardEventTarget:e,overlays:o,values:n}}const Dse=Pse;class Qy extends Ff{constructor(e,n,i){super(),i=i||{},this.tileCoord=e,this.state=n,this.key="",this.transition_=i.transition===void 0?250:i.transition,this.transitionStarts_={},this.interpolate=!!i.interpolate}changed(){this.dispatchEvent(et.CHANGE)}release(){this.state===Fe.ERROR&&this.setState(Fe.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(e){if(this.state!==Fe.ERROR&&this.state>e)throw new Error("Tile load sequence violation");this.state=e,this.changed()}load(){pt()}getAlpha(e,n){if(!this.transition_)return 1;let i=this.transitionStarts_[e];if(!i)i=n,this.transitionStarts_[e]=i;else if(i===-1)return 1;const s=n-i+1e3/60;return s>=this.transition_?1:rk(s/this.transition_)}inTransition(e){return this.transition_?this.transitionStarts_[e]!==-1:!1}endTransition(e){this.transition_&&(this.transitionStarts_[e]=-1)}disposeInternal(){this.release(),super.disposeInternal()}}class zk extends Qy{constructor(e,n,i,s,r,o){super(e,n,o),this.crossOrigin_=s,this.src_=i,this.key=i,this.image_=new Image,s!==null&&(this.image_.crossOrigin=s),this.unlisten_=null,this.tileLoadFunction_=r}getImage(){return this.image_}setImage(e){this.image_=e,this.state=Fe.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=Fe.ERROR,this.unlistenImage_(),this.image_=$se(),this.changed()}handleImageLoad_(){const e=this.image_;e.naturalWidth&&e.naturalHeight?this.state=Fe.LOADED:this.state=Fe.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==Fe.ERROR&&(this.state=Fe.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Fe.IDLE&&(this.state=Fe.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Kne(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}}function $se(){const t=an(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}const Wk=.5,Lse=10,Uw=.25;class Hk{constructor(e,n,i,s,r,o){this.sourceProj_=e,this.targetProj_=n;let a={};const l=Lh(this.targetProj_,this.sourceProj_);this.transformInv_=function(b){const E=b[0]+"/"+b[1];return a[E]||(a[E]=l(b)),a[E]},this.maxSourceExtent_=s,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!s&&!!this.sourceProj_.getExtent()&&vt(s)>=vt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?vt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?vt(this.targetProj_.getExtent()):null;const c=ba(i),u=Wf(i),d=zf(i),h=Vf(i),f=this.transformInv_(c),p=this.transformInv_(u),m=this.transformInv_(d),y=this.transformInv_(h),v=Lse+(o?Math.max(0,Math.ceil(Math.log2(vu(i)/(o*o*256*256)))):0);if(this.addQuad_(c,u,d,h,f,p,m,y,v),this.wrapsXInSource_){let b=1/0;this.triangles_.forEach(function(E,C,w){b=Math.min(b,E.source[0][0],E.source[1][0],E.source[2][0])}),this.triangles_.forEach(E=>{if(Math.max(E.source[0][0],E.source[1][0],E.source[2][0])-b>this.sourceWorldWidth_/2){const C=[[E.source[0][0],E.source[0][1]],[E.source[1][0],E.source[1][1]],[E.source[2][0],E.source[2][1]]];C[0][0]-b>this.sourceWorldWidth_/2&&(C[0][0]-=this.sourceWorldWidth_),C[1][0]-b>this.sourceWorldWidth_/2&&(C[1][0]-=this.sourceWorldWidth_),C[2][0]-b>this.sourceWorldWidth_/2&&(C[2][0]-=this.sourceWorldWidth_);const w=Math.min(C[0][0],C[1][0],C[2][0]);Math.max(C[0][0],C[1][0],C[2][0])-w.5&&d<1;let p=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const y=fw([e,n,i,s]);p=vt(y)/this.targetWorldWidth_>Uw||p}!f&&this.sourceProj_.isGlobal()&&d&&(p=d>Uw||p)}if(!p&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3])&&!fi(u,this.maxSourceExtent_))return;let m=0;if(!p&&(!isFinite(r[0])||!isFinite(r[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(c>0)p=!0;else if(m=(!isFinite(r[0])||!isFinite(r[1])?8:0)+(!isFinite(o[0])||!isFinite(o[1])?4:0)+(!isFinite(a[0])||!isFinite(a[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),m!=1&&m!=2&&m!=4&&m!=8)return}if(c>0){if(!p){const y=[(e[0]+i[0])/2,(e[1]+i[1])/2],v=this.transformInv_(y);let b;f?b=(ll(r[0],h)+ll(a[0],h))/2-ll(v[0],h):b=(r[0]+a[0])/2-v[0];const E=(r[1]+a[1])/2-v[1];p=b*b+E*E>this.errorThresholdSquared_}if(p){if(Math.abs(e[0]-i[0])<=Math.abs(e[1]-i[1])){const y=[(n[0]+i[0])/2,(n[1]+i[1])/2],v=this.transformInv_(y),b=[(s[0]+e[0])/2,(s[1]+e[1])/2],E=this.transformInv_(b);this.addQuad_(e,n,y,b,r,o,v,E,c-1),this.addQuad_(b,y,i,s,E,v,a,l,c-1)}else{const y=[(e[0]+n[0])/2,(e[1]+n[1])/2],v=this.transformInv_(y),b=[(i[0]+s[0])/2,(i[1]+s[1])/2],E=this.transformInv_(b);this.addQuad_(e,y,b,s,r,v,E,l,c-1),this.addQuad_(y,n,i,b,v,o,a,E,c-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}m&11||this.addTriangle_(e,i,s,r,a,l),m&14||this.addTriangle_(e,i,n,r,a,o),m&&(m&13||this.addTriangle_(n,s,e,o,l,r),m&7||this.addTriangle_(n,s,i,o,l,a))}calculateSourceExtent(){const e=Ui();return this.triangles_.forEach(function(n,i,s){const r=n.source;Gc(e,r[0]),Gc(e,r[1]),Gc(e,r[2])}),e}getTriangles(){return this.triangles_}}let wp;const hr=[];function Gw(t,e,n,i,s){t.beginPath(),t.moveTo(0,0),t.lineTo(e,n),t.lineTo(i,s),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,i)+1,Math.max(n,s)),t.restore()}function xp(t,e){return Math.abs(t[e*4]-210)>2||Math.abs(t[e*4+3]-.75*255)>2}function Ose(){if(wp===void 0){const t=an(6,6,hr);t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",Gw(t,4,5,4,0),Gw(t,4,5,0,5);const e=t.getImageData(0,0,3,3).data;wp=xp(e,0)||xp(e,4)||xp(e,8),Bl(t),hr.push(t.canvas)}return wp}function Xw(t,e,n,i){const s=sk(n,e,t);let r=pw(e,i,n);const o=e.getMetersPerUnit();o!==void 0&&(r*=o);const a=t.getMetersPerUnit();a!==void 0&&(r/=a);const l=t.getExtent();if(!l||Fl(l,s)){const c=pw(t,r,s)/r;isFinite(c)&&c>0&&(r/=c)}return r}function Yk(t,e,n,i){const s=da(n);let r=Xw(t,e,s,i);return(!isFinite(r)||r<=0)&&JT(n,function(o){return r=Xw(t,e,o,i),isFinite(r)&&r>0}),r}function jk(t,e,n,i,s,r,o,a,l,c,u,d,h,f){const p=an(Math.round(n*t),Math.round(n*e),hr);if(d||(p.imageSmoothingEnabled=!1),l.length===0)return p.canvas;p.scale(n,n);function m(w){return Math.round(w*n)/n}p.globalCompositeOperation="lighter";const y=Ui();l.forEach(function(w,x,T){Dte(y,w.extent)});let v;const b=n/i,E=(d?1:1+Math.pow(2,-24))/b;if(!h||l.length!==1||c!==0){if(v=an(Math.round(vt(y)*b),Math.round(Yn(y)*b),hr),d||(v.imageSmoothingEnabled=!1),s&&f){const w=(s[0]-y[0])*b,x=-(s[3]-y[3])*b,T=vt(s)*b,k=Yn(s)*b;v.rect(w,x,T,k),v.clip()}l.forEach(function(w,x,T){if(w.image.width>0&&w.image.height>0){if(w.clipExtent){v.save();const H=(w.clipExtent[0]-y[0])*b,te=-(w.clipExtent[3]-y[3])*b,N=vt(w.clipExtent)*b,L=Yn(w.clipExtent)*b;v.rect(d?H:Math.round(H),d?te:Math.round(te),d?N:Math.round(H+N)-Math.round(H),d?L:Math.round(te+L)-Math.round(te)),v.clip()}const k=(w.extent[0]-y[0])*b,A=-(w.extent[3]-y[3])*b,P=vt(w.extent)*b,F=Yn(w.extent)*b;v.drawImage(w.image,c,c,w.image.width-2*c,w.image.height-2*c,d?k:Math.round(k),d?A:Math.round(A),d?P:Math.round(k+P)-Math.round(k),d?F:Math.round(A+F)-Math.round(A)),w.clipExtent&&v.restore()}})}const C=ba(o);return a.getTriangles().forEach(function(w,x,T){const k=w.source,A=w.target;let P=k[0][0],F=k[0][1],H=k[1][0],te=k[1][1],N=k[2][0],L=k[2][1];const I=m((A[0][0]-C[0])/r),W=m(-(A[0][1]-C[1])/r),X=m((A[1][0]-C[0])/r),J=m(-(A[1][1]-C[1])/r),ne=m((A[2][0]-C[0])/r),ue=m(-(A[2][1]-C[1])/r),Y=P,Z=F;P=0,F=0,H-=Y,te-=Z,N-=Y,L-=Z;const M=[[H,te,0,0,X-I],[N,L,0,0,ne-I],[0,0,H,te,J-W],[0,0,N,L,ue-W]],ie=xte(M);if(!ie)return;if(p.save(),p.beginPath(),Ose()||!d){p.moveTo(X,J);const $=4,oe=I-X,de=W-J;for(let ve=0;ve<$;ve++)p.lineTo(X+m((ve+1)*oe/$),J+m(ve*de/($-1))),ve!=$-1&&p.lineTo(X+m((ve+1)*oe/$),J+m((ve+1)*de/($-1)));p.lineTo(ne,ue)}else p.moveTo(X,J),p.lineTo(I,W),p.lineTo(ne,ue);p.clip(),p.transform(ie[0],ie[2],ie[1],ie[3],I,W),p.translate(y[0]-Y,y[3]-Z);let le;if(v)le=v.canvas,p.scale(E,-E);else{const $=l[0],oe=$.extent;le=$.image,p.scale(vt(oe)/le.width,-Yn(oe)/le.height)}p.drawImage(le,0,0),p.restore()}),v&&(Bl(v),hr.push(v.canvas)),u&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,a.getTriangles().forEach(function(w,x,T){const k=w.target,A=(k[0][0]-C[0])/r,P=-(k[0][1]-C[1])/r,F=(k[1][0]-C[0])/r,H=-(k[1][1]-C[1])/r,te=(k[2][0]-C[0])/r,N=-(k[2][1]-C[1])/r;p.beginPath(),p.moveTo(F,H),p.lineTo(A,P),p.lineTo(te,N),p.closePath(),p.stroke()}),p.restore()),p.canvas}class $m extends Qy{constructor(e,n,i,s,r,o,a,l,c,u,d,h){super(r,Fe.IDLE,h),this.renderEdges_=d!==void 0?d:!1,this.pixelRatio_=a,this.gutter_=l,this.canvas_=null,this.sourceTileGrid_=n,this.targetTileGrid_=s,this.wrappedTileCoord_=o||r,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=e.canWrapX()?e.getExtent():void 0;const f=s.getTileCoordExtent(this.wrappedTileCoord_),p=this.targetTileGrid_.getExtent();let m=this.sourceTileGrid_.getExtent();const y=p?ls(f,p):f;if(vu(y)===0){this.state=Fe.EMPTY;return}const v=e.getExtent();v&&(m?m=ls(m,v):m=v);const b=s.getResolution(this.wrappedTileCoord_[0]),E=Yk(e,i,y,b);if(!isFinite(E)||E<=0){this.state=Fe.EMPTY;return}const C=u!==void 0?u:Wk;if(this.triangulation_=new Hk(e,i,y,m,E*C,b),this.triangulation_.getTriangles().length===0){this.state=Fe.EMPTY;return}this.sourceZ_=n.getZForResolution(E);let w=this.triangulation_.calculateSourceExtent();if(m&&(e.canWrapX()?(w[1]=Jt(w[1],m[1],m[3]),w[3]=Jt(w[3],m[1],m[3])):w=ls(w,m)),!vu(w))this.state=Fe.EMPTY;else{let x=0,T=0;e.canWrapX()&&(x=vt(v),T=Math.floor((w[0]-v[0])/x)),xy(w.slice(),e,!0).forEach(A=>{const P=n.getTileRangeForExtentAndZ(A,this.sourceZ_);for(let F=P.minX;F<=P.maxX;F++)for(let H=P.minY;H<=P.maxY;H++){const te=c(this.sourceZ_,F,H,a);if(te){const N=T*x;this.sourceTiles_.push({tile:te,offset:N})}}++T}),this.sourceTiles_.length===0&&(this.state=Fe.EMPTY)}}getImage(){return this.canvas_}reproject_(){const e=[];if(this.sourceTiles_.forEach(n=>{const i=n.tile;if(i&&i.getState()==Fe.LOADED){const s=this.sourceTileGrid_.getTileCoordExtent(i.tileCoord);s[0]+=n.offset,s[2]+=n.offset;const r=this.clipExtent_?.slice();r&&(r[0]+=n.offset,r[2]+=n.offset),e.push({extent:s,clipExtent:r,image:i.getImage()})}}),this.sourceTiles_.length=0,e.length===0)this.state=Fe.ERROR;else{const n=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(n),s=typeof i=="number"?i:i[0],r=typeof i=="number"?i:i[1],o=this.targetTileGrid_.getResolution(n),a=this.sourceTileGrid_.getResolution(this.sourceZ_),l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=jk(s,r,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,e,this.gutter_,this.renderEdges_,this.interpolate),this.state=Fe.LOADED}this.changed()}load(){if(this.state==Fe.IDLE){this.state=Fe.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:n})=>{const i=n.getState();if(i==Fe.IDLE||i==Fe.LOADING){e++;const s=ft(n,et.CHANGE,r=>{const o=n.getState();(o==Fe.LOADED||o==Fe.ERROR||o==Fe.EMPTY)&&(Dt(s),e--,e===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(s)}}),e===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:n},i,s){n.getState()==Fe.IDLE&&n.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(Dt),this.sourcesListenerKeys_=null}release(){this.canvas_&&(Bl(this.canvas_.getContext("2d")),hr.push(this.canvas_),this.canvas_=null),super.release()}}const Ep={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};class Kk extends Vs{constructor(e){super(),this.projection=Gi(e.projection),this.attributions_=qw(e.attributions),this.attributionsCollapsible_=e.attributionsCollapsible??!0,this.loading=!1,this.state_=e.state!==void 0?e.state:"ready",this.wrapX_=e.wrapX!==void 0?e.wrapX:!1,this.interpolate_=!!e.interpolate,this.viewResolver=null,this.viewRejector=null;const n=this;this.viewPromise_=new Promise(function(i,s){n.viewResolver=i,n.viewRejector=s})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(e){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(e){this.attributions_=qw(e),this.changed()}setState(e){this.state_=e,this.changed()}}function qw(t){return t?typeof t=="function"?t:(Array.isArray(t)||(t=[t]),e=>t):null}class e0{constructor(e,n,i,s){this.minX=e,this.maxX=n,this.minY=i,this.maxY=s}contains(e){return this.containsXY(e[1],e[2])}containsTileRange(e){return this.minX<=e.minX&&e.maxX<=this.maxX&&this.minY<=e.minY&&e.maxY<=this.maxY}containsXY(e,n){return this.minX<=e&&e<=this.maxX&&this.minY<=n&&n<=this.maxY}equals(e){return this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY}extend(e){e.minXthis.maxX&&(this.maxX=e.maxX),e.minYthis.maxY&&(this.maxY=e.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY}}function Va(t,e,n,i,s){return s!==void 0?(s.minX=t,s.maxX=e,s.minY=n,s.maxY=i,s):new e0(t,e,n,i)}function Yh(t,e,n,i){return i!==void 0?(i[0]=t,i[1]=e,i[2]=n,i):[t,e,n]}function Nse(t,e,n){return t+"/"+e+"/"+n}function Fse(t){return Bse(t[0],t[1],t[2])}function Bse(t,e,n){return(e<n||n>e.getMaxZoom())return!1;const r=e.getFullTileRange(n);return r?r.containsXY(i,s):!0}const za=[0,0,0],Mr=5;class zse{constructor(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,mt(_te(this.resolutions_,(s,r)=>r-s,!0),"`resolutions` must be sorted in descending order");let n;if(!e.origins){for(let s=0,r=this.resolutions_.length-1;s{const o=new e0(Math.min(0,s[0]),Math.max(s[0]-1,-1),Math.min(0,s[1]),Math.max(s[1]-1,-1));if(i){const a=this.getTileRangeForExtentAndZ(i,r);o.minX=Math.max(a.minX,o.minX),o.maxX=Math.min(a.maxX,o.maxX),o.minY=Math.max(a.minY,o.minY),o.maxY=Math.min(a.maxY,o.maxY)}return o}):i&&this.calculateTileRanges_(i)}forEachTileCoord(e,n,i){const s=this.getTileRangeForExtentAndZ(e,n);for(let r=s.minX,o=s.maxX;r<=o;++r)for(let a=s.minY,l=s.maxY;a<=l;++a)i([n,r,a])}forEachTileCoordParentTileRange(e,n,i,s){let r,o,a,l=null,c=e[0]-1;for(this.zoomFactor_===2?(o=e[1],a=e[2]):l=this.getTileCoordExtent(e,s);c>=this.minZoom;){if(o!==void 0&&a!==void 0?(o=Math.floor(o/2),a=Math.floor(a/2),r=Va(o,o,a,a,i)):r=this.getTileRangeForExtentAndZ(l,c,i),n(c,r))return!0;--c}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(e){return this.origin_?this.origin_:this.origins_[e]}getResolution(e){return this.resolutions_[e]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(e,n,i){if(e[0]this.maxZoom||n0?i:Math.max(r/n[0],s/n[1]);const o=e+1,a=new Array(o);for(let l=0;lthis.getTileInternal(f,p,m,y,o),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return h.key=l,h}getTileInternal(e,n,i,s,r){const o=this.getKey();return this.createTile_(e,n,i,s,r,o)}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,n){const i=Gi(e);if(i){const s=wt(i);s in this.tileGridForProjection||(this.tileGridForProjection[s]=n)}}}function sre(t,e){t.getImage().src=e}class rre extends ire{constructor(e){e=e||{};const n=e.projection!==void 0?e.projection:"EPSG:3857",i=e.tileGrid!==void 0?e.tileGrid:Yse({extent:t0(n),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize});super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:n,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.gutter_=e.gutter!==void 0?e.gutter:0}getGutter(){return this.gutter_}}const ore='© OpenStreetMap contributors.';class are extends rre{constructor(e){e=e||{};let n;e.attributions!==void 0?n=e.attributions:n=[ore];const i=e.crossOrigin!==void 0?e.crossOrigin:"anonymous",s=e.url!==void 0?e.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:n,attributionsCollapsible:!1,cacheSize:e.cacheSize,crossOrigin:i,interpolate:e.interpolate,maxZoom:e.maxZoom!==void 0?e.maxZoom:19,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:s,wrapX:e.wrapX,zDirection:e.zDirection})}}const Gd={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class lre extends Uf{constructor(e){e=e||{};const n=Object.assign({},e),i=e.cacheSize;delete e.cacheSize,delete n.preload,delete n.useInterimTilesOnError,super(n),this.on,this.once,this.un,this.cacheSize_=i,this.setPreload(e.preload!==void 0?e.preload:0),this.setUseInterimTilesOnError(e.useInterimTilesOnError!==void 0?e.useInterimTilesOnError:!0)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(Gd.PRELOAD)}setPreload(e){this.set(Gd.PRELOAD,e)}getUseInterimTilesOnError(){return this.get(Gd.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(e){this.set(Gd.USE_INTERIM_TILES_ON_ERROR,e)}getData(e){return super.getData(e)}}const cre=5;class ure extends Ku{constructor(e){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=e,this.staleKeys_=new Array,this.maxStaleKeys=cre}getStaleKeys(){return this.staleKeys_}prependStaleKey(e){this.staleKeys_.unshift(e),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(e){return pt()}getData(e){return null}prepareFrame(e){return pt()}renderFrame(e,n){return pt()}forEachFeatureAtCoordinate(e,n,i,s,r){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(e){const n=e.target;(n.getState()===ot.LOADED||n.getState()===ot.ERROR)&&this.renderIfReadyAndVisible()}loadImage(e){let n=e.getState();return n!=ot.LOADED&&n!=ot.ERROR&&e.addEventListener(et.CHANGE,this.boundHandleImageChange_),n==ot.IDLE&&(e.load(),n=e.getState()),n==ot.LOADED}renderIfReadyAndVisible(){const e=this.getLayer();e&&e.getVisible()&&e.getSourceState()==="ready"&&e.changed()}renderDeferred(e){}disposeInternal(){delete this.layer_,super.disposeInternal()}}class qk{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(Nh(),{get:(e,n)=>{if(typeof Nh()[n]=="function")return this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(n),this.pushMethodArgs_},set:(e,n,i)=>(this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(n,i),!0)})}pushMethodArgs_=(...e)=>(this.instructions_[this.zIndex+this.offset_].push(e),this);pushFunction(e){this.instructions_[this.zIndex+this.offset_].push(e)}getContext(){return this.context_}draw(e){this.instructions_.forEach(n=>{for(let i=0,s=n.length;i0&&this.getCount()>this.highWaterMark}expireCache(e){for(;this.canExpireCache();){const n=this.pop();n instanceof Lf&&n.dispose()}}clear(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}containsKey(e){return this.entries_.hasOwnProperty(e)}forEach(e){let n=this.oldest_;for(;n;)e(n.value_,n.key_,this),n=n.newer}get(e,n){const i=this.entries_[e];return mt(i!==void 0,"Tried to get a value for a key that does not exist in the cache"),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_}remove(e){const n=this.entries_[e];return mt(n!==void 0,"Tried to get a value for a key that does not exist in the cache"),n===this.newest_?(this.newest_=n.older,this.newest_&&(this.newest_.newer=null)):n===this.oldest_?(this.oldest_=n.newer,this.oldest_&&(this.oldest_.older=null)):(n.newer.older=n.older,n.older.newer=n.newer),delete this.entries_[e],--this.count_,n.value_}getCount(){return this.count_}getKeys(){const e=new Array(this.count_);let n=0,i;for(i=this.newest_;i;i=i.older)e[n++]=i.key_;return e}getValues(){const e=new Array(this.count_);let n=0,i;for(i=this.newest_;i;i=i.older)e[n++]=i.value_;return e}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(e){return this.entries_[e]?.value_}pop(){const e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_}replace(e,n){this.get(e),this.entries_[e].value_=n}set(e,n){mt(!(e in this.entries_),"Tried to set a value for a key that is used already");const i={key_:e,newer:null,older:this.newest_,value_:n};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[e]=i,++this.count_}setSize(e){this.highWaterMark=e}}class _re extends Lm{constructor(e){super({tileCoord:e.tileCoord,loader:()=>Promise.resolve(new Uint8ClampedArray(4)),interpolate:e.interpolate,transition:e.transition}),this.pixelRatio_=e.pixelRatio,this.gutter_=e.gutter,this.reprojData_=null,this.reprojError_=null,this.reprojSize_=void 0,this.sourceTileGrid_=e.sourceTileGrid,this.targetTileGrid_=e.targetTileGrid,this.wrappedTileCoord_=e.wrappedTileCoord||e.tileCoord,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const n=e.sourceProj,i=n.getExtent(),s=e.sourceTileGrid.getExtent();this.clipExtent_=n.canWrapX()?s?ls(i,s):i:s;const r=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),o=this.targetTileGrid_.getExtent();let a=this.sourceTileGrid_.getExtent();const l=o?ls(r,o):r;if(vu(l)===0){this.state=Fe.EMPTY;return}i&&(a?a=ls(a,i):a=i);const c=this.targetTileGrid_.getResolution(this.wrappedTileCoord_[0]),u=e.targetProj,d=Yk(n,u,l,c);if(!isFinite(d)||d<=0){this.state=Fe.EMPTY;return}const h=e.errorThreshold!==void 0?e.errorThreshold:Wk;if(this.triangulation_=new Hk(n,u,l,a,d*h,c),this.triangulation_.getTriangles().length===0){this.state=Fe.EMPTY;return}this.sourceZ_=this.sourceTileGrid_.getZForResolution(d);let f=this.triangulation_.calculateSourceExtent();if(a&&(n.canWrapX()?(f[1]=Jt(f[1],a[1],a[3]),f[3]=Jt(f[3],a[1],a[3])):f=ls(f,a)),!vu(f))this.state=Fe.EMPTY;else{let p=0,m=0;n.canWrapX()&&(p=vt(i),m=Math.floor((f[0]-i[0])/p)),xy(f.slice(),n,!0).forEach(v=>{const b=this.sourceTileGrid_.getTileRangeForExtentAndZ(v,this.sourceZ_),E=e.getTileFunction;for(let C=b.minX;C<=b.maxX;C++)for(let w=b.minY;w<=b.maxY;w++){const x=E(this.sourceZ_,C,w,this.pixelRatio_);if(x){const T=m*p;this.sourceTiles_.push({tile:x,offset:T})}}++m}),this.sourceTiles_.length===0&&(this.state=Fe.EMPTY)}}getSize(){return this.reprojSize_}getData(){return this.reprojData_}getError(){return this.reprojError_}reproject_(){const e=[];let n=!1;if(this.sourceTiles_.forEach(p=>{const m=p.tile;if(!m||m.getState()!==Fe.LOADED)return;const y=m.getSize(),v=this.gutter_;let b;const E=hre(m.getData());E?b=E:(n=!0,b=gre(jh(m.getData())));const C=[y[0]+2*v,y[1]+2*v],w=b instanceof Float32Array,x=C[0]*C[1],T=w?Float32Array:Uint8ClampedArray,k=new T(b.buffer),A=T.BYTES_PER_ELEMENT,P=A*k.length/x,F=k.byteLength/C[1],H=Math.floor(F/A/C[0]),te=x*H;let N=k;if(k.length!==te){N=new T(te);let W=0,X=0;const J=C[0]*H;for(let ne=0;ne=0;--p){const m=[];for(let w=0,x=e.length;w{const i=n.getState();if(i!==Fe.IDLE&&i!==Fe.LOADING)return;e++;const s=ft(n,et.CHANGE,()=>{const r=n.getState();(r==Fe.LOADED||r==Fe.ERROR||r==Fe.EMPTY)&&(Dt(s),e--,e===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(s)}),e===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:n}){n.getState()==Fe.IDLE&&n.load()})}unlistenSources_(){this.sourcesListenerKeys_.forEach(Dt),this.sourcesListenerKeys_=null}}function Sp(t,e,n,i){return`${t},${Nse(e,n,i)}`}function Cp(t,e,n){if(!(n in t))return t[n]=new Set([e]),!0;const i=t[n],s=i.has(e);return s||i.add(e),!s}function yre(t,e,n){const i=t[n];return i?i.delete(e):!1}function Jw(t,e){const n=t.layerStatesArray[t.layerIndex];n.extent&&(e=ls(e,Xr(n.extent,t.viewState.projection)));const i=n.layer.getRenderSource();if(!i.getWrapX()){const s=i.getTileGridForProjection(t.viewState.projection).getExtent();s&&(e=ls(e,s))}return e}class vre extends Zk{constructor(e,n){super(e),n=n||{},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=Ui(),this.tempTileRange_=new e0(0,0,0,0),this.tempTileCoord_=Yh(0,0,0);const i=n.cacheSize!==void 0?n.cacheSize:512;this.tileCache_=new mre(i),this.renderedProjection_=void 0,this.maxStaleKeys=i*.5}getTileCache(){return this.tileCache_}getOrCreateTile(e,n,i,s){const r=this.tileCache_,a=this.getLayer().getSource(),l=Sp(a.getKey(),e,n,i);let c;if(r.containsKey(l))c=r.get(l);else{if(c=a.getTile(e,n,i,s.pixelRatio,s.viewState.projection),!c)return null;r.set(l,c)}return c}getTile(e,n,i,s){const r=this.getOrCreateTile(e,n,i,s);return r||null}getData(e){const n=this.frameState;if(!n)return null;const i=this.getLayer(),s=$n(n.pixelToCoordinateTransform,e.slice()),r=i.getExtent();if(r&&!Fl(r,s))return null;const o=n.viewState,a=i.getRenderSource(),l=a.getTileGridForProjection(o.projection),c=a.getTilePixelRatio(n.pixelRatio);for(let u=l.getZForResolution(o.resolution);u>=l.getMinZoom();--u){const d=l.getTileCoordForCoordAndZ(s,u),h=this.getTile(u,d[1],d[2],n);if(!h||h.getState()!==Fe.LOADED)continue;const f=l.getOrigin(u),p=mi(l.getTileSize(u)),m=l.getResolution(u);let y;if(h instanceof zk||h instanceof $m)y=h.getImage();else if(h instanceof Lm){if(y=jh(h.getData()),!y)continue}else continue;const v=Math.floor(c*((s[0]-f[0])/m-d[1]*p[0])),b=Math.floor(c*((f[1]-s[1])/m-d[2]*p[1])),E=Math.round(c*a.getGutterForProjection(o.projection));return this.getImageData(y,v+E,b+E)}return null}prepareFrame(e){this.renderedProjection_?e.viewState.projection!==this.renderedProjection_&&(this.tileCache_.clear(),this.renderedProjection_=e.viewState.projection):this.renderedProjection_=e.viewState.projection;const n=this.getLayer().getSource();if(!n)return!1;const i=n.getRevision();return this.renderedRevision_?this.renderedRevision_!==i&&(this.renderedRevision_=i,this.renderedSourceKey_===n.getKey()&&this.tileCache_.clear()):this.renderedRevision_=i,!0}enqueueTiles(e,n,i,s,r){const o=e.viewState,a=this.getLayer(),l=a.getRenderSource(),c=l.getTileGridForProjection(o.projection),u=wt(l);u in e.wantedTiles||(e.wantedTiles[u]={});const d=e.wantedTiles[u],h=a.getMapInternal(),f=Math.max(i-r,c.getMinZoom(),c.getZForResolution(Math.min(a.getMaxResolution(),h?h.getView().getResolutionForZoom(Math.max(a.getMinZoom(),0)):c.getResolution(0)),l.zDirection));for(let p=i;p>=f;--p){const m=c.getTileRangeForExtentAndZ(n,p,this.tempTileRange_),y=c.getResolution(p);for(let v=m.minX;v<=m.maxX;++v)for(let b=m.minY;b<=m.maxY;++b){const E=this.getTile(p,v,b,e);if(!E||!Cp(s,E,p))continue;const w=E.getKey();if(d[w]=!0,E.getState()===Fe.IDLE&&!e.tileQueue.isKeyQueued(w)){const x=Yh(p,v,b,this.tempTileCoord_);e.tileQueue.enqueue([E,u,c.getTileCoordCenter(x),y])}}}}findStaleTile_(e,n){const i=this.tileCache_,s=e[0],r=e[1],o=e[2],a=this.getStaleKeys();for(let l=0;l0&&setTimeout(()=>{this.enqueueTiles(e,P,f-1,k,A-1)},0),!(f in k))return this.container;const F=wt(this),H=e.time;for(const ne of k[f]){const ue=ne.getState();if((ne instanceof $m||ne instanceof _re)&&ue===Fe.EMPTY)continue;const Y=ne.tileCoord;if(ue===Fe.LOADED&&ne.getAlpha(F,H)===1){ne.endTransition(F);continue}if(this.renderComplete=!1,this.findStaleTile_(Y,k)){yre(k,ne,f),e.animate=!0;continue}if(this.findAltTiles_(h,Y,f+1,k))continue;const ie=h.getMinZoom();for(let le=f-1;le>=ie&&!this.findAltTiles_(h,Y,le,k);--le);}const te=p/o*l/v,N=this.getRenderContext(e);_r(this.tempTransform,b/2,E/2,te,te,0,-b/2,-E/2),i.extent&&this.clipUnrotated(N,e,C),u.getInterpolate()||(N.imageSmoothingEnabled=!1),this.preRender(N,e);const L=Object.keys(k).map(Number);L.sort(cr);let I;const W=[],X=[];for(let ne=L.length-1;ne>=0;--ne){const ue=L[ne],Y=u.getTilePixelSize(ue,l,r),M=h.getResolution(ue)/p,ie=Y[0]*M*te,le=Y[1]*M*te,$=h.getTileCoordForCoordAndZ(ba(T),ue),oe=h.getTileCoordExtent($),de=$n(this.tempTransform,[v*(oe[0]-T[0])/p,v*(T[3]-oe[3])/p]),ve=v*u.getGutterForProjection(r);for(const z of k[ue]){if(z.getState()!==Fe.LOADED)continue;const ge=z.tileCoord,S=$[1]-ge[1],O=Math.round(de[0]-(S-1)*ie),K=$[2]-ge[2],U=Math.round(de[1]-(K-1)*le),re=Math.round(de[0]-S*ie),j=Math.round(de[1]-K*le),se=O-re,ee=U-j,fe=L.length===1;let me=!1;I=[re,j,re+se,j,re+se,j+ee,re,j+ee];for(let pe=0,Le=W.length;pe{const Y=wt(u),Z=ue.wantedTiles[Y],M=Z?Object.keys(Z).length:0;this.updateCacheSize(M),this.tileCache_.expireCache()};return e.postRenderFunctions.push(J),this.container}updateCacheSize(e){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,e*2)}drawTile(e,n,i,s,r,o,a,l){let c;if(e instanceof Lm){if(c=jh(e.getData()),!c)throw new Error("Rendering array data is not yet supported")}else c=this.getTileImage(e);if(!c)return;const u=this.getRenderContext(n),d=wt(this),h=n.layerStatesArray[n.layerIndex],f=h.opacity*(l?e.getAlpha(d,n.time):1),p=f!==u.globalAlpha;p&&(u.save(),u.globalAlpha=f),u.drawImage(c,a,a,c.width-2*a,c.height-2*a,i,s,r,o),p&&u.restore(),f!==h.opacity?n.animate=!0:l&&e.endTransition(d)}getImage(){const e=this.context;return e?e.canvas:null}getTileImage(e){return e.getImage()}updateUsedTiles(e,n,i){const s=wt(n);s in e||(e[s]={}),e[s][i.getKey()]=!0}}class bre extends lre{constructor(e){super(e)}createRenderer(){return new vre(this,{cacheSize:this.getCacheSize()})}}const wre=bre;class i0 extends Vs{constructor(e){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),e)if(typeof e.getSimplifiedGeometry=="function"){const n=e;this.setGeometry(n)}else{const n=e;this.setProperties(n)}}clone(){const e=new i0(this.hasProperties()?this.getProperties():null);e.setGeometryName(this.getGeometryName());const n=this.getGeometry();n&&e.setGeometry(n.clone());const i=this.getStyle();return i&&e.setStyle(i),e}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(Dt(this.geometryChangeKey_),this.geometryChangeKey_=null);const e=this.getGeometry();e&&(this.geometryChangeKey_=ft(e,et.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e,this.styleFunction_=e?xre(e):void 0,this.changed()}setId(e){this.id_=e,this.changed()}setGeometryName(e){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=e,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function xre(t){if(typeof t=="function")return t;let e;return Array.isArray(t)?e=t:(mt(typeof t.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),e=[t]),function(){return e}}const Tp=i0;function Om(t,e,n,i,s,r,o){let a,l;const c=(n-e)/i;if(c===1)a=e;else if(c===2)a=e,l=s;else if(c!==0){let u=t[e],d=t[e+1],h=0;const f=[0];for(let y=e+i;y1?o:2,r=r||new Array(o);for(let u=0;u>1;sl&&(this.instructions.push([je.CUSTOM,l,u,e,i,Uo,r]),this.hitDetectionInstructions.push([je.CUSTOM,l,u,e,s||i,Uo,r]));break;case"Point":c=e.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),u=this.coordinates.length,this.instructions.push([je.CUSTOM,l,u,e,i,void 0,r]),this.hitDetectionInstructions.push([je.CUSTOM,l,u,e,s||i,void 0,r]);break}this.endGeometry(n)}beginGeometry(e,n,i){this.beginGeometryInstruction1_=[je.BEGIN_GEOMETRY,n,0,e,i],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[je.BEGIN_GEOMETRY,n,0,e,i],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const e=this.hitDetectionInstructions;e.reverse();let n;const i=e.length;let s,r,o=-1;for(n=0;nthis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0}createFill(e){const n=e.fillStyle,i=[je.SET_FILL_STYLE,n];return typeof n!="string"&&i.push(e.fillPatternScale),i}applyStroke(e){this.instructions.push(this.createStroke(e))}createStroke(e){return[je.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth*this.pixelRatio,e.lineCap,e.lineJoin,e.miterLimit,this.applyPixelRatio(e.lineDash),e.lineDashOffset*this.pixelRatio]}updateFillStyle(e,n){const i=e.fillStyle;(typeof i!="string"||e.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(n.call(this,e)),e.currentFillStyle=i)}updateStrokeStyle(e,n){const i=e.strokeStyle,s=e.lineCap,r=e.lineDash,o=e.lineDashOffset,a=e.lineJoin,l=e.lineWidth,c=e.miterLimit;(e.currentStrokeStyle!=i||e.currentLineCap!=s||r!=e.currentLineDash&&!xo(e.currentLineDash,r)||e.currentLineDashOffset!=o||e.currentLineJoin!=a||e.currentLineWidth!=l||e.currentMiterLimit!=c)&&(i!==void 0&&n.call(this,e),e.currentStrokeStyle=i,e.currentLineCap=s,e.currentLineDash=r,e.currentLineDashOffset=o,e.currentLineJoin=a,e.currentLineWidth=l,e.currentMiterLimit=c)}endGeometry(e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const n=[je.END_GEOMETRY,e];this.instructions.push(n),this.hitDetectionInstructions.push(n)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=GT(this.maxExtent),this.maxLineWidth>0)){const e=this.resolution*(this.maxLineWidth+1)/2;vy(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class Sre extends Zu{constructor(e,n,i,s){super(e,n,i,s),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(e,n,i){if(!this.image_||this.maxExtent&&!Fl(this.maxExtent,e.getFlatCoordinates()))return;this.beginGeometry(e,n,i);const s=e.getFlatCoordinates(),r=e.getStride(),o=this.coordinates.length,a=this.appendFlatPointCoordinates(s,r);this.instructions.push([je.DRAW_IMAGE,o,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([je.DRAW_IMAGE,o,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(n)}drawMultiPoint(e,n,i){if(!this.image_)return;this.beginGeometry(e,n,i);const s=e.getFlatCoordinates(),r=[];for(let l=0,c=s.length;l=t){const p=(t-a+f)/f,m=Ti(c,d,p),y=Ti(u,h,p);l.push(m,y),r.push(l),l=[m,y],a==t&&(o+=s),a=0}else if(a0&&r.push(l),r}function Ire(t,e,n,i,s){let r=n,o=n,a=0,l=0,c=n,u,d,h,f,p,m,y,v,b,E;for(d=n;dt&&(l>a&&(a=l,r=c,o=d),l=0,c=d-s)),h=f,y=b,v=E),p=C,m=w}return l+=f,l>a?[c,d]:[r,o]}const Uh={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class Pre extends Zu{constructor(e,n,i,s){super(e,n,i,s),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[ui]={fillStyle:ui},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){const e=super.finish();return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e}drawText(e,n,i){const s=this.textFillState_,r=this.textStrokeState_,o=this.textState_;if(this.text_===""||!o||!s&&!r)return;const a=this.coordinates;let l=a.length;const c=e.getType();let u=null,d=e.getStride();if(o.placement==="line"&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!fi(this.maxExtent,e.getExtent()))return;let h;if(u=e.getFlatCoordinates(),c=="LineString")h=[u.length];else if(c=="MultiLineString")h=e.getEnds();else if(c=="Polygon")h=e.getEnds().slice(0,1);else if(c=="MultiPolygon"){const y=e.getEndss();h=[];for(let v=0,b=y.length;v{const w=a[(b+C)*2]===u[C*d]&&a[(b+C)*2+1]===u[C*d+1];return w||--b,w})}this.saveTextStates_(),(o.backgroundFill||o.backgroundStroke)&&(this.setFillStrokeStyle(o.backgroundFill,o.backgroundStroke),o.backgroundFill&&this.updateFillStyle(this.state,this.createFill),o.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(e,n,i);let p=o.padding;if(p!=Xo&&(o.scale[0]<0||o.scale[1]<0)){let b=o.padding[0],E=o.padding[1],C=o.padding[2],w=o.padding[3];o.scale[0]<0&&(E=-E,w=-w),o.scale[1]<0&&(b=-b,C=-C),p=[b,E,C,w]}const m=this.pixelRatio;this.instructions.push([je.DRAW_IMAGE,l,f,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,p==Xo?Xo:p.map(function(b){return b*m}),!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]);const y=1/m,v=this.state.fillStyle;o.backgroundFill&&(this.state.fillStyle=ui,this.hitDetectionInstructions.push(this.createFill(this.state))),this.hitDetectionInstructions.push([je.DRAW_IMAGE,l,f,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[y,y],NaN,this.declutterMode_,this.declutterImageWithText_,p,!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?ui:this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]),o.backgroundFill&&(this.state.fillStyle=v,this.hitDetectionInstructions.push(this.createFill(this.state))),this.endGeometry(n)}}saveTextStates_(){const e=this.textStrokeState_,n=this.textState_,i=this.textFillState_,s=this.strokeKey_;e&&(s in this.strokeStates||(this.strokeStates[s]={strokeStyle:e.strokeStyle,lineCap:e.lineCap,lineDashOffset:e.lineDashOffset,lineWidth:e.lineWidth,lineJoin:e.lineJoin,miterLimit:e.miterLimit,lineDash:e.lineDash}));const r=this.textKey_;r in this.textStates||(this.textStates[r]={font:n.font,textAlign:n.textAlign||ku,justify:n.justify,textBaseline:n.textBaseline||Fh,scale:n.scale});const o=this.fillKey_;i&&(o in this.fillStates||(this.fillStates[o]={fillStyle:i.fillStyle}))}drawChars_(e,n){const i=this.textStrokeState_,s=this.textState_,r=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();const l=this.pixelRatio,c=Uh[s.textBaseline],u=this.textOffsetY_*l,d=this.text_,h=i?i.lineWidth*Math.abs(s.scale[0])/2:0;this.instructions.push([je.DRAW_CHARS,e,n,c,s.overflow,a,s.maxAngle,l,u,r,h*l,d,o,1,this.declutterMode_]),this.hitDetectionInstructions.push([je.DRAW_CHARS,e,n,c,s.overflow,a&&ui,s.maxAngle,l,u,r,h*l,d,o,1/l,this.declutterMode_])}setTextStyle(e,n){let i,s,r;if(!e)this.text_="";else{const o=e.getFill();o?(s=this.textFillState_,s||(s={},this.textFillState_=s),s.fillStyle=Is(o.getColor()||ui)):(s=null,this.textFillState_=s);const a=e.getStroke();if(!a)r=null,this.textStrokeState_=r;else{r=this.textStrokeState_,r||(r={},this.textStrokeState_=r);const p=a.getLineDash(),m=a.getLineDashOffset(),y=a.getWidth(),v=a.getMiterLimit();r.lineCap=a.getLineCap()||Vl,r.lineDash=p?p.slice():ur,r.lineDashOffset=m===void 0?dr:m,r.lineJoin=a.getLineJoin()||zl,r.lineWidth=y===void 0?Au:y,r.miterLimit=v===void 0?Cu:v,r.strokeStyle=Is(a.getColor()||Tu)}i=this.textState_;const l=e.getFont()||Ek;Qne(l);const c=e.getScaleArray();i.overflow=e.getOverflow(),i.font=l,i.maxAngle=e.getMaxAngle(),i.placement=e.getPlacement(),i.textAlign=e.getTextAlign(),i.repeat=e.getRepeat(),i.justify=e.getJustify(),i.textBaseline=e.getTextBaseline()||Fh,i.backgroundFill=e.getBackgroundFill(),i.backgroundStroke=e.getBackgroundStroke(),i.padding=e.getPadding()||Xo,i.scale=c===void 0?[1,1]:c;const u=e.getOffsetX(),d=e.getOffsetY(),h=e.getRotateWithView(),f=e.getRotation();this.text_=e.getText()||"",this.textOffsetX_=u===void 0?0:u,this.textOffsetY_=d===void 0?0:d,this.textRotateWithView_=h===void 0?!1:h,this.textRotation_=f===void 0?0:f,this.strokeKey_=r?(typeof r.strokeStyle=="string"?r.strokeStyle:wt(r.strokeStyle))+r.lineCap+r.lineDashOffset+"|"+r.lineWidth+r.lineJoin+r.miterLimit+"["+r.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.repeat||"?")+(i.justify||"?")+(i.textBaseline||"?"),this.fillKey_=s&&s.fillStyle?typeof s.fillStyle=="string"?s.fillStyle:"|"+wt(s.fillStyle):""}this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=n}}const Rre={Circle:ex,Default:Zu,Image:Cre,LineString:kre,Polygon:ex,Text:Pre};class Dre{constructor(e,n,i,s){this.tolerance_=e,this.maxExtent_=n,this.pixelRatio_=s,this.resolution_=i,this.buildersByZIndex_={}}finish(){const e={};for(const n in this.buildersByZIndex_){e[n]=e[n]||{};const i=this.buildersByZIndex_[n];for(const s in i){const r=i[s].finish();e[n][s]=r}}return e}getBuilder(e,n){const i=e!==void 0?e.toString():"0";let s=this.buildersByZIndex_[i];s===void 0&&(s={},this.buildersByZIndex_[i]=s);let r=s[n];if(r===void 0){const o=Rre[n];r=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),s[n]=r}return r}}function $re(t,e,n,i,s,r,o,a,l,c,u,d){let h=t[e],f=t[e+1],p=0,m=0,y=0,v=0;function b(){p=h,m=f,e+=i,h=t[e],f=t[e+1],v+=y,y=Math.sqrt((h-p)*(h-p)+(f-m)*(f-m))}do b();while(eI[2]}else F=C>A;const H=Math.PI,te=[],N=x+i===e;e=x,y=0,v=T,h=t[e],f=t[e+1];let L;if(N){b(),L=Math.atan2(f-m,h-p),F&&(L+=L>0?-H:H);const I=(A+C)/2,W=(P+w)/2;return te[0]=[I,W,(k-r)/2,L,s],te}s=s.replace(/\n/g," ");for(let I=0,W=s.length;I0?-H:H),L!==void 0){let M=X-L;if(M+=M>H?-2*H:M<-H?2*H:0,Math.abs(M)>o)return null}L=X;const J=I;let ne=0;for(;I0&&t.push(` -`,""),t.push(e,""),t}class Ore{constructor(e,n,i,s,r){this.overlaps=i,this.pixelRatio=n,this.resolution=e,this.alignAndScaleFill_,this.instructions=s.instructions,this.coordinates=s.coordinates,this.coordinateCache_={},this.renderedTransform_=ds(),this.hitDetectionInstructions=s.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=s.fillStates||{},this.strokeStates=s.strokeStates||{},this.textStates=s.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=r?new qk:null}getZIndexContext(){return this.zIndexContext_}createLabel(e,n,i,s){const r=e+n+i+s;if(this.labels_[r])return this.labels_[r];const o=s?this.strokeStates[s]:null,a=i?this.fillStates[i]:null,l=this.textStates[n],c=this.pixelRatio,u=[l.scale[0]*c,l.scale[1]*c],d=l.justify?Uh[l.justify]:kp(Array.isArray(e)?e[0]:e,l.textAlign||ku),h=s&&o.lineWidth?o.lineWidth:0,f=Array.isArray(e)?e:String(e).split(` -`).reduce(Lre,[]),{width:p,height:m,widths:y,heights:v,lineWidths:b}=tie(l,f),E=p+h,C=[],w=(E+2)*u[0],x=(m+h)*u[1],T={width:w<0?Math.floor(w):Math.ceil(w),height:x<0?Math.floor(x):Math.ceil(x),contextInstructions:C};(u[0]!=1||u[1]!=1)&&C.push("scale",u),s&&(C.push("strokeStyle",o.strokeStyle),C.push("lineWidth",h),C.push("lineCap",o.lineCap),C.push("lineJoin",o.lineJoin),C.push("miterLimit",o.miterLimit),C.push("setLineDash",[o.lineDash]),C.push("lineDashOffset",o.lineDashOffset)),i&&C.push("fillStyle",a.fillStyle),C.push("textBaseline","middle"),C.push("textAlign","center");const k=.5-d;let A=d*E+k*h;const P=[],F=[];let H=0,te=0,N=0,L=0,I;for(let W=0,X=f.length;We?e-c:r,C=o+u>n?n-u:o,w=p[3]+E*h[0]+p[1],x=p[0]+C*h[1]+p[2],T=v-p[3],k=b-p[0];(m||d!==0)&&(Ir[0]=T,Pr[0]=T,Ir[1]=k,Ks[1]=k,Ks[0]=T+w,Us[0]=Ks[0],Us[1]=k+x,Pr[1]=Us[1]);let A;return d!==0?(A=_r(ds(),i,s,1,1,d,-i,-s),$n(A,Ir),$n(A,Ks),$n(A,Us),$n(A,Pr),co(Math.min(Ir[0],Ks[0],Us[0],Pr[0]),Math.min(Ir[1],Ks[1],Us[1],Pr[1]),Math.max(Ir[0],Ks[0],Us[0],Pr[0]),Math.max(Ir[1],Ks[1],Us[1],Pr[1]),Ha)):co(Math.min(T,T+w),Math.min(k,k+x),Math.max(T,T+w),Math.max(k,k+x),Ha),f&&(v=Math.round(v),b=Math.round(b)),{drawImageX:v,drawImageY:b,drawImageW:E,drawImageH:C,originX:c,originY:u,declutterBox:{minX:Ha[0],minY:Ha[1],maxX:Ha[2],maxY:Ha[3],value:y},canvasTransform:A,scale:h}}replayImageOrLabel_(e,n,i,s,r,o,a){const l=!!(o||a),c=s.declutterBox,u=a?a[2]*s.scale[0]/2:0;return c.minX-u<=n[0]&&c.maxX+u>=0&&c.minY-u<=n[1]&&c.maxY+u>=0&&(l&&this.replayTextBackground_(e,Ir,Ks,Us,Pr,o,a),nie(e,s.canvasTransform,r,i,s.originX,s.originY,s.drawImageW,s.drawImageH,s.drawImageX,s.drawImageY,s.scale)),!0}fill_(e){const n=this.alignAndScaleFill_;if(n){const i=$n(this.renderedTransform_,[0,0]),s=512*this.pixelRatio;e.save(),e.translate(i[0]%s,i[1]%s),n!==1&&e.scale(n,n),e.rotate(this.viewRotation_)}e.fill(),n&&e.restore()}setStrokeStyle_(e,n){e.strokeStyle=n[1],e.lineWidth=n[2],e.lineCap=n[3],e.lineJoin=n[4],e.miterLimit=n[5],e.lineDashOffset=n[7],e.setLineDash(n[6])}drawLabelWithPointPlacement_(e,n,i,s){const r=this.textStates[n],o=this.createLabel(e,n,s,i),a=this.strokeStates[i],l=this.pixelRatio,c=kp(Array.isArray(e)?e[0]:e,r.textAlign||ku),u=Uh[r.textBaseline||Fh],d=a&&a.lineWidth?a.lineWidth:0,h=o.width/l-2*r.scale[0],f=c*h+2*(.5-c)*d,p=u*o.height/l+2*(.5-u)*d;return{label:o,anchorX:f,anchorY:p}}execute_(e,n,i,s,r,o,a,l){const c=this.zIndexContext_;let u;this.pixelCoordinates_&&xo(i,this.renderedTransform_)?u=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),u=no(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),nne(this.renderedTransform_,i));let d=0;const h=s.length;let f=0,p,m,y,v,b,E,C,w,x,T,k,A,P,F=0,H=0,te=null,N=null;const L=this.coordinateCache_,I=this.viewRotation_,W=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,X={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:I},J=this.instructions!=s||this.overlaps?0:200;let ne,ue,Y,Z;for(;dJ&&(this.fill_(e),F=0),H>J&&(e.stroke(),H=0),!F&&!H&&(e.beginPath(),b=NaN,E=NaN),++d;break;case je.CIRCLE:f=M[1];const le=u[f],$=u[f+1],oe=u[f+2],de=u[f+3],ve=oe-le,z=de-$,ge=Math.sqrt(ve*ve+z*z);e.moveTo(le+ge,$),e.arc(le,$,ge,0,2*Math.PI,!0),++d;break;case je.CLOSE_PATH:e.closePath(),++d;break;case je.CUSTOM:f=M[1],p=M[2];const S=M[3],O=M[4],K=M[5];X.geometry=S,X.feature=ne,d in L||(L[d]=[]);const U=L[d];K?K(u,f,p,2,U):(U[0]=u[f],U[1]=u[f+1],U.length=2),c&&(c.zIndex=M[6]),O(U,X),++d;break;case je.DRAW_IMAGE:f=M[1],p=M[2],x=M[3],m=M[4],y=M[5];let re=M[6];const j=M[7],se=M[8],ee=M[9],fe=M[10];let me=M[11];const pe=M[12];let Le=M[13];v=M[14]||"declutter";const Ae=M[15];if(!x&&M.length>=20){T=M[19],k=M[20],A=M[21],P=M[22];const dn=this.drawLabelWithPointPlacement_(T,k,A,P);x=dn.label,M[3]=x;const En=M[23];m=(dn.anchorX-En)*this.pixelRatio,M[4]=m;const Sn=M[24];y=(dn.anchorY-Sn)*this.pixelRatio,M[5]=y,re=x.height,M[6]=re,Le=x.width,M[13]=Le}let ze;M.length>25&&(ze=M[25]);let Be,nt,Ze;M.length>17?(Be=M[16],nt=M[17],Ze=M[18]):(Be=Xo,nt=!1,Ze=!1),fe&&W?me+=I:!fe&&!W&&(me-=I);let Mt=0;for(;f!eA.includes(t));class Fre{constructor(e,n,i,s,r,o,a){this.maxExtent_=e,this.overlaps_=s,this.pixelRatio_=i,this.resolution_=n,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=ds(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(r,a)}clip(e,n){const i=this.getClipCoords(n);e.beginPath(),e.moveTo(i[0],i[1]),e.lineTo(i[2],i[3]),e.lineTo(i[4],i[5]),e.lineTo(i[6],i[7]),e.clip()}createExecutors_(e,n){for(const i in e){let s=this.executorsByZIndex_[i];s===void 0&&(s={},this.executorsByZIndex_[i]=s);const r=e[i];for(const o in r){const a=r[o];s[o]=new Ore(this.resolution_,this.pixelRatio_,this.overlaps_,a,n)}}}hasExecutors(e){for(const n in this.executorsByZIndex_){const i=this.executorsByZIndex_[n];for(let s=0,r=e.length;s0){if(!o||T==="none"||f!=="Image"&&f!=="Text"||o.includes(w)){const F=(h[A]-3)/4,H=s-F%a,te=s-(F/a|0),N=r(w,x,H*H+te*te);if(N)return N}u.clearRect(0,0,a,a);break}}const m=Object.keys(this.executorsByZIndex_).map(Number);m.sort(cr);let y,v,b,E,C;for(y=m.length-1;y>=0;--y){const w=m[y].toString();for(b=this.executorsByZIndex_[w],v=el.length-1;v>=0;--v)if(f=el[v],E=b[f],E!==void 0&&(C=E.executeHitDetection(u,l,i,p,d),C))return C}}getClipCoords(e){const n=this.maxExtent_;if(!n)return null;const i=n[0],s=n[1],r=n[2],o=n[3],a=[i,s,i,o,r,o,r,s];return no(a,0,8,2,e,a),a}isEmpty(){return Nl(this.executorsByZIndex_)}execute(e,n,i,s,r,o,a){const l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(cr),o=o||el;const c=el.length;let u,d,h,f,p;for(a&&l.reverse(),u=0,d=l.length;uv.execute(w,n,i,s,r,a)),C&&E.restore(),b){b.offset();const w=l[u]*c+h;this.deferredZIndexContexts_[w]||(this.deferredZIndexContexts_[w]=[]),this.deferredZIndexContexts_[w].push(b)}}}}this.renderedContext_=e}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const e=this.deferredZIndexContexts_,n=Object.keys(e).map(Number).sort(cr);for(let i=0,s=n.length;i{r.draw(this.renderedContext_),r.clear()}),e[n[i]].length=0}}const Ap={};function Bre(t){if(Ap[t]!==void 0)return Ap[t];const e=t*2+1,n=t*t,i=new Array(n+1);for(let r=0;r<=t;++r)for(let o=0;o<=t;++o){const a=r*r+o*o;if(a>n)break;let l=i[a];l||(l=[],i[a]=l),l.push(((t+r)*e+(t+o))*4+3),r>0&&l.push(((t-r)*e+(t+o))*4+3),o>0&&(l.push(((t+r)*e+(t-o))*4+3),r>0&&l.push(((t-r)*e+(t-o))*4+3))}const s=[];for(let r=0,o=i.length;rd*this.pixelRatio_),lineDashOffset:(o||dr)*this.pixelRatio_,lineJoin:a!==void 0?a:zl,lineWidth:(l!==void 0?l:Au)*this.pixelRatio_,miterLimit:c!==void 0?c:Cu,strokeStyle:Is(i||Tu)}}}setImageStyle(e){let n;if(!e||!(n=e.getSize())){this.image_=null;return}const i=e.getPixelRatio(this.pixelRatio_),s=e.getAnchor(),r=e.getOrigin();this.image_=e.getImage(this.pixelRatio_),this.imageAnchorX_=s[0]*i,this.imageAnchorY_=s[1]*i,this.imageHeight_=n[1]*i,this.imageOpacity_=e.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=e.getRotateWithView(),this.imageRotation_=e.getRotation();const o=e.getScaleArray();this.imageScale_=[o[0]*this.pixelRatio_/i,o[1]*this.pixelRatio_/i],this.imageWidth_=n[0]*i}setTextStyle(e){if(!e)this.text_="";else{const n=e.getFill();if(!n)this.textFillState_=null;else{const f=n.getColor();this.textFillState_={fillStyle:Is(f||ui)}}const i=e.getStroke();if(!i)this.textStrokeState_=null;else{const f=i.getColor(),p=i.getLineCap(),m=i.getLineDash(),y=i.getLineDashOffset(),v=i.getLineJoin(),b=i.getWidth(),E=i.getMiterLimit();this.textStrokeState_={lineCap:p!==void 0?p:Vl,lineDash:m||ur,lineDashOffset:y||dr,lineJoin:v!==void 0?v:zl,lineWidth:b!==void 0?b:Au,miterLimit:E!==void 0?E:Cu,strokeStyle:Is(f||Tu)}}const s=e.getFont(),r=e.getOffsetX(),o=e.getOffsetY(),a=e.getRotateWithView(),l=e.getRotation(),c=e.getScaleArray(),u=e.getText(),d=e.getTextAlign(),h=e.getTextBaseline();this.textState_={font:s!==void 0?s:Ek,textAlign:d!==void 0?d:ku,textBaseline:h!==void 0?h:Fh},this.text_=u!==void 0?Array.isArray(u)?u.reduce((f,p,m)=>f+=m%2?" ":p,""):u:"",this.textOffsetX_=r!==void 0?this.pixelRatio_*r:0,this.textOffsetY_=o!==void 0?this.pixelRatio_*o:0,this.textRotateWithView_=a!==void 0?a:!1,this.textRotation_=l!==void 0?l:0,this.textScale_=[this.pixelRatio_*c[0],this.pixelRatio_*c[1]]}}}const zre=Vre,Cs=.5;function Wre(t,e,n,i,s,r,o,a,l){const c=l?Ty(s):s,u=t[0]*Cs,d=t[1]*Cs,h=an(u,d);h.imageSmoothingEnabled=!1;const f=h.canvas,p=new zre(h,Cs,s,null,o,a,l?Yf(Ute(),l):null),m=n.length,y=Math.floor((256*256*256-1)/m),v={};for(let E=1;E<=m;++E){const C=n[E-1],w=C.getStyleFunction()||i;if(!w)continue;let x=w(C,r);if(!x)continue;Array.isArray(x)||(x=[x]);const k=(E*y).toString(16).padStart(7,"#00000");for(let A=0,P=x.length;A0;return d&&Promise.all(l).then(()=>s(null)),Ure(t,e,n,i,r,o,a),d}function Ure(t,e,n,i,s,r,o){const a=n.getGeometryFunction()(e);if(!a)return;const l=a.simplifyTransformed(i,s);if(n.getRenderer())iA(t,l,n,e,o);else{const u=tA[l.getType()];u(t,l,n,e,o,r)}}function iA(t,e,n,i,s){if(e.getType()=="GeometryCollection"){const o=e.getGeometries();for(let a=0,l=o.length;a{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const i=this.frameState.size.slice(),s=this.renderedCenter_,r=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,l=this.wrappedRenderedExtent_,c=this.getLayer(),u=[],d=i[0]*Cs,h=i[1]*Cs;u.push(this.getRenderTransform(s,r,o,Cs,d,h,0).slice());const f=c.getSource(),p=a.getExtent();if(f.getWrapX()&&a.canWrapX()&&!Qa(p,l)){let m=l[0];const y=vt(p);let v=0,b;for(;mp[2];)++v,b=y*v,u.push(this.getRenderTransform(s,r,o,Cs,d,h,b).slice()),m-=y}this.hitDetectionImageData_=Wre(i,u,this.renderedFeatures_,c.getStyleFunction(),l,r,o,ix(r,this.renderedPixelRatio_),null)}n(Hre(e,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(e,n,i,s,r){if(!this.replayGroup_)return;const o=n.viewState.resolution,a=n.viewState.rotation,l=this.getLayer(),c={},u=function(p,m,y){const v=wt(p),b=c[v];if(b){if(b!==!0&&yd=p.forEachFeatureAtCoordinate(e,o,a,i,u,f&&n.declutter[f]?n.declutter[f].all().map(m=>m.value):null)),d}handleFontsChanged(){const e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}prepareFrame(e){const n=this.getLayer(),i=n.getSource();if(!i)return!1;const s=e.viewHints[Vn.ANIMATING],r=e.viewHints[Vn.INTERACTING],o=n.getUpdateWhileAnimating(),a=n.getUpdateWhileInteracting();if(this.ready&&!o&&s||!a&&r)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const l=e.extent,c=e.viewState,u=c.projection,d=c.resolution,h=e.pixelRatio,f=n.getRevision(),p=n.getRenderBuffer();let m=n.getRenderOrder();m===void 0&&(m=jre);const y=c.center.slice(),v=vy(l,p*d),b=v.slice(),E=[v.slice()],C=u.getExtent();if(i.getWrapX()&&u.canWrapX()&&!Qa(C,e.extent)){const N=vt(C),L=Math.max(vt(v)/2,N);v[0]=C[0]-L,v[2]=C[2]+L,ek(y,u);const I=QT(E[0],u);I[0]C[0]&&I[2]>C[2]&&E.push([I[0]-N,I[1],I[2]-N,I[3]])}if(this.ready&&this.renderedResolution_==d&&this.renderedRevision_==f&&this.renderedRenderOrder_==m&&this.renderedFrameDeclutter_===!!e.declutter&&Qa(this.wrappedRenderedExtent_,v))return xo(this.renderedExtent_,b)||(this.hitDetectionImageData_=null,this.renderedExtent_=b),this.renderedCenter_=y,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const w=new Dre(nA(d,h),v,d,h);let x;for(let N=0,L=E.length;N{let I;const W=N.getStyleFunction()||n.getStyleFunction();if(W&&(I=W(N,d)),I){const X=this.renderFeature(N,T,I,w,x,this.getLayer().getDeclutter(),L);k=k&&!X}},P=Ty(v),F=i.getFeaturesInExtent(P);m&&F.sort(m);for(let N=0,L=F.length;N{if(e===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),n&&this.simplifiedGeometry_.applyTransform(n);const i=this.simplifiedGeometry_.getFlatCoordinates();let s;switch(this.type_){case"LineString":i.length=Kf(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,e,i,0),s=[i.length];break;case"MultiLineString":s=[],i.length=gne(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,e,i,0,s);break;case"Polygon":s=[],i.length=lk(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(e),i,0,s);break}return s&&(this.simplifiedGeometry_=new is(this.type_,i,s,2,this.properties_,this.id_)),this.squaredTolerance_=e,this.simplifiedGeometry_}),this}}is.prototype.getFlatCoordinates=is.prototype.getOrientedFlatCoordinates;const Bi={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};function soe(t,e){return[[-1/0,-1/0,1/0,1/0]]}let roe=!1;function ooe(t,e,n,i,s,r,o){const a=new XMLHttpRequest;a.open("GET",typeof t=="function"?t(n,i,s):t,!0),e.getType()=="arraybuffer"&&(a.responseType="arraybuffer"),a.withCredentials=roe,a.onload=function(l){if(!a.status||a.status>=200&&a.status<300){const c=e.getType();try{let u;c=="text"||c=="json"?u=a.responseText:c=="xml"?u=a.responseXML||a.responseText:c=="arraybuffer"&&(u=a.response),u?r(e.readFeatures(u,{extent:n,featureProjection:s}),e.readProjection(u)):o()}catch{o()}}else o()},a.onerror=o,a.send()}function ax(t,e){return function(n,i,s,r,o){const a=this;ooe(t,e,n,i,s,function(l,c){a.addFeatures(l),r!==void 0&&r(l)},o||Ol)}}class Rr extends br{constructor(e,n,i){super(e),this.feature=n,this.features=i}}class aoe extends Kk{constructor(e){e=e||{},super({attributions:e.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:e.wrapX!==void 0?e.wrapX:!0}),this.on,this.once,this.un,this.loader_=Ol,this.format_=e.format||null,this.overlaps_=e.overlaps===void 0?!0:e.overlaps,this.url_=e.url,e.loader!==void 0?this.loader_=e.loader:this.url_!==void 0&&(mt(this.format_,"`format` must be set when `url` is set"),this.loader_=ax(this.url_,this.format_)),this.strategy_=e.strategy!==void 0?e.strategy:soe;const n=e.useSpatialIndex!==void 0?e.useSpatialIndex:!0;this.featuresRtree_=n?new rx:null,this.loadedExtentsRtree_=new rx,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let i,s;Array.isArray(e.features)?s=e.features:e.features&&(i=e.features,s=i.getArray()),!n&&i===void 0&&(i=new As(s)),s!==void 0&&this.addFeaturesInternal(s),i!==void 0&&this.bindFeaturesCollection_(i)}addFeature(e){this.addFeatureInternal(e),this.changed()}addFeatureInternal(e){const n=wt(e);if(!this.addToIndex_(n,e)){this.featuresCollection_&&this.featuresCollection_.remove(e);return}this.setupChangeEvents_(n,e);const i=e.getGeometry();if(i){const s=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(s,e)}else this.nullGeometryFeatures_[n]=e;this.dispatchEvent(new Rr(Bi.ADDFEATURE,e))}setupChangeEvents_(e,n){n instanceof is||(this.featureChangeKeys_[e]=[ft(n,et.CHANGE,this.handleFeatureChange_,this),ft(n,Ll.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(e,n){let i=!0;if(n.getId()!==void 0){const s=String(n.getId());if(!(s in this.idIndex_))this.idIndex_[s]=n;else if(n instanceof is){const r=this.idIndex_[s];r instanceof is?Array.isArray(r)?r.push(n):this.idIndex_[s]=[r,n]:i=!1}else i=!1}return i&&(mt(!(e in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[e]=n),i}addFeatures(e){this.addFeaturesInternal(e),this.changed()}addFeaturesInternal(e){const n=[],i=[],s=[];for(let r=0,o=e.length;r{n||(n=!0,this.addFeature(i.element),n=!1)}),e.addEventListener(ci.REMOVE,i=>{n||(n=!0,this.removeFeature(i.element),n=!1)}),this.featuresCollection_=e}clear(e){if(e){for(const i in this.featureChangeKeys_)this.featureChangeKeys_[i].forEach(Dt);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){const i=s=>{this.removeFeatureInternal(s)};this.featuresRtree_.forEach(i);for(const s in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[s])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const n=new Rr(Bi.CLEAR);this.dispatchEvent(n),this.changed()}forEachFeature(e){if(this.featuresRtree_)return this.featuresRtree_.forEach(e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureAtCoordinateDirect(e,n){const i=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(i,function(s){const r=s.getGeometry();if(r instanceof is||r.intersectsCoordinate(e))return n(s)})}forEachFeatureInExtent(e,n){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(e,n);this.featuresCollection_&&this.featuresCollection_.forEach(n)}forEachFeatureIntersectingExtent(e,n){return this.forEachFeatureInExtent(e,function(i){const s=i.getGeometry();if(s instanceof is||s.intersectsExtent(e)){const r=n(i);if(r)return r}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let e;return this.featuresCollection_?e=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(e=this.featuresRtree_.getAll(),Nl(this.nullGeometryFeatures_)||Of(e,Object.values(this.nullGeometryFeatures_))),e}getFeaturesAtCoordinate(e){const n=[];return this.forEachFeatureAtCoordinateDirect(e,function(i){n.push(i)}),n}getFeaturesInExtent(e,n){if(this.featuresRtree_){if(!(n&&n.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(e);const s=xy(e,n);return[].concat(...s.map(r=>this.featuresRtree_.getInExtent(r)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(e,n){const i=e[0],s=e[1];let r=null;const o=[NaN,NaN];let a=1/0;const l=[-1/0,-1/0,1/0,1/0];return n=n||mu,this.featuresRtree_.forEachInExtent(l,function(c){if(n(c)){const u=c.getGeometry(),d=a;if(a=u instanceof is?0:u.closestPointXY(i,s,o,a),a{--this.loadingExtentsCount_,this.dispatchEvent(new Rr(Bi.FEATURESLOADEND,void 0,u))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new Rr(Bi.FEATURESLOADERROR))}),s.insert(l,{extent:l.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(e){const n=this.loadedExtentsRtree_;let i;n.forEachInExtent(e,function(s){if(yu(s.extent,e))return i=s,!0}),i&&n.remove(i)}removeFeatures(e){let n=!1;for(let i=0,s=e.length;ie.geo&&e.geo.lat&&e.geo.lon);return t?[t.geo.lon,t.geo.lat]:[0,0]}return[this.d.geo.lon,this.d.geo.lat]}},mounted(){const t=new Dse({target:"map",layers:[new wre({source:new are})],view:new Ss({center:lp(this.getLastLonLat()),zoom:this.type==="traceroute"?3:10})}),e=[],n=new aoe;if(this.type==="traceroute")console.log(this.getLastLonLat()),this.d.forEach(o=>{if(o.geo&&o.geo.lat&&o.geo.lon){const a=lp([o.geo.lon,o.geo.lat]);e.push(a);const l=this.getLastLonLat();console.log(o.geo.lon,o.geo.lat),console.log(o.geo.lon===l[0]&&o.geo.lat===l[1]);const c=new Tp({geometry:new wu(a),last:o.geo.lon===l[0]&&o.geo.lat===l[1]});n.addFeature(c)}});else{const o=lp([this.d.geo.lon,this.d.geo.lat]);e.push(o);const a=new Tp({geometry:new wu(o)});n.addFeature(a)}const i=new Kh(e),s=new Tp({geometry:i});n.addFeature(s);const r=new noe({source:n,style:function(o){if(o.getGeometry().getType()==="Point")return new ul({image:new Yy({radius:10,fill:new Zf({color:o.get("last")?"#dc3545":"#0d6efd"}),stroke:new Vh({color:"white",width:5})})});if(o.getGeometry().getType()==="LineString")return new ul({stroke:new Vh({color:"#0d6efd",width:2})})}});t.addLayer(r)}},coe={id:"map",class:"w-100 rounded-3"};function uoe(t,e,n,i,s,r){return D(),V("div",coe)}const sA=Ye(loe,[["render",uoe]]),doe={name:"ping",components:{OSMap:sA,LocaleText:Qe},data(){return{loading:!1,cips:{},selectedConfiguration:void 0,selectedPeer:void 0,selectedIp:void 0,count:4,pingResult:void 0,pinging:!1}},setup(){return{store:st()}},mounted(){Vt("/api/ping/getAllPeersIpAddress",{},t=>{t.status&&(this.loading=!0,this.cips=t.data,console.log(this.cips))})},methods:{execute(){this.selectedIp&&(this.pinging=!0,this.pingResult=void 0,Vt("/api/ping/execute",{ipAddress:this.selectedIp,count:this.count},t=>{t.status?this.pingResult=t.data:this.store.newMessage("Server",t.message,"danger"),this.pinging=!1}))}},watch:{selectedConfiguration(){this.selectedPeer=void 0,this.selectedIp=void 0},selectedPeer(){this.selectedIp=void 0}}},bi=t=>(bn("data-v-f5cd36ce"),t=t(),wn(),t),hoe={class:"mt-md-5 mt-3 text-body"},foe={class:"container"},goe=bi(()=>g("h3",{class:"mb-3 text-body"},"Ping",-1)),poe={class:"row"},moe={class:"col-sm-4 d-flex gap-2 flex-column"},_oe={class:"mb-1 text-muted",for:"configuration"},yoe=["disabled"],voe=bi(()=>g("option",{disabled:"",selected:"",value:void 0},null,-1)),boe=["value"],woe={class:"mb-1 text-muted",for:"peer"},xoe=["disabled"],Eoe=bi(()=>g("option",{disabled:"",selected:"",value:void 0},null,-1)),Soe=["value"],Coe={class:"mb-1 text-muted",for:"ip"},Toe=["disabled"],koe=bi(()=>g("option",{disabled:"",selected:"",value:void 0},null,-1)),Aoe={class:"d-flex align-items-center gap-2"},Moe=bi(()=>g("div",{class:"flex-grow-1 border-top"},null,-1)),Ioe={class:"text-muted"},Poe=bi(()=>g("div",{class:"flex-grow-1 border-top"},null,-1)),Roe={class:"mb-1 text-muted",for:"ipAddress"},Doe=["disabled"],$oe=bi(()=>g("div",{class:"w-100 border-top my-2"},null,-1)),Loe={class:"mb-1 text-muted",for:"count"},Ooe={class:"d-flex gap-3 align-items-center"},Noe=["disabled"],Foe=bi(()=>g("i",{class:"bi bi-dash-lg"},null,-1)),Boe=[Foe],Voe=bi(()=>g("i",{class:"bi bi-plus-lg"},null,-1)),zoe=[Voe],Woe=["disabled"],Hoe={key:0,class:"d-block"},Yoe=bi(()=>g("i",{class:"bi bi-person-walking me-2"},null,-1)),joe={key:1,class:"d-block"},Koe=bi(()=>g("span",{class:"spinner-border spinner-border-sm","aria-hidden":"true"},null,-1)),Uoe=bi(()=>g("span",{class:"visually-hidden",role:"status"},"Loading...",-1)),Goe=[Koe,Uoe],Xoe={class:"col-sm-8 position-relative"},qoe={key:"pingPlaceholder"},Zoe=bi(()=>g("div",{class:"pingPlaceholder bg-body-secondary rounded-3 mb-3",style:{height:"300px"}},null,-1)),Joe={key:"pingResult",class:"d-flex flex-column gap-2 w-100"},Qoe={class:"card rounded-3 bg-transparent shadow-sm animate__animated animate__fadeIn",style:{"animation-delay":"0.15s"}},eae={class:"card-body row"},tae={class:"col-sm"},nae={class:"mb-0 text-muted"},iae={key:0,class:"col-sm"},sae={class:"mb-0 text-muted"},rae={class:"card rounded-3 bg-transparent shadow-sm animate__animated animate__fadeIn",style:{"animation-delay":"0.3s"}},oae={class:"card-body"},aae=bi(()=>g("p",{class:"mb-0 text-muted"},[g("small",null,"Is Alive")],-1)),lae={class:"card rounded-3 bg-transparent shadow-sm animate__animated animate__fadeIn",style:{"animation-delay":"0.45s"}},cae={class:"card-body"},uae={class:"mb-0 text-muted"},dae={class:"card rounded-3 bg-transparent shadow-sm animate__animated animate__fadeIn",style:{"animation-delay":"0.6s"}},hae={class:"card-body"},fae={class:"mb-0 text-muted"};function gae(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("OSMap");return D(),V("div",hoe,[g("div",foe,[goe,g("div",poe,[g("div",moe,[g("div",null,[g("label",_oe,[g("small",null,[B(o,{t:"Configuration"})])]),Ne(g("select",{class:"form-select","onUpdate:modelValue":e[0]||(e[0]=l=>this.selectedConfiguration=l),disabled:this.pinging},[voe,(D(!0),V($e,null,Xe(this.cips,(l,c)=>(D(),V("option",{value:c},Ee(c),9,boe))),256))],8,yoe),[[ih,this.selectedConfiguration]])]),g("div",null,[g("label",woe,[g("small",null,[B(o,{t:"Peer"})])]),Ne(g("select",{id:"peer",class:"form-select","onUpdate:modelValue":e[1]||(e[1]=l=>this.selectedPeer=l),disabled:this.selectedConfiguration===void 0||this.pinging},[Eoe,this.selectedConfiguration!==void 0?(D(!0),V($e,{key:0},Xe(this.cips[this.selectedConfiguration],(l,c)=>(D(),V("option",{value:c},Ee(c),9,Soe))),256)):ce("",!0)],8,xoe),[[ih,this.selectedPeer]])]),g("div",null,[g("label",Coe,[g("small",null,[B(o,{t:"IP Address"})])]),Ne(g("select",{id:"ip",class:"form-select","onUpdate:modelValue":e[2]||(e[2]=l=>this.selectedIp=l),disabled:this.selectedPeer===void 0||this.pinging},[koe,this.selectedPeer!==void 0?(D(!0),V($e,{key:0},Xe(this.cips[this.selectedConfiguration][this.selectedPeer].allowed_ips,l=>(D(),V("option",null,Ee(l),1))),256)):ce("",!0)],8,Toe),[[ih,this.selectedIp]])]),g("div",Aoe,[Moe,g("small",Ioe,[B(o,{t:"OR"})]),Poe]),g("div",null,[g("label",Roe,[g("small",null,[B(o,{t:"Enter IP Address / Hostname"})])]),Ne(g("input",{class:"form-control",type:"text",id:"ipAddress",disabled:this.pinging,"onUpdate:modelValue":e[3]||(e[3]=l=>this.selectedIp=l)},null,8,Doe),[[Ke,this.selectedIp]])]),$oe,g("div",null,[g("label",Loe,[g("small",null,[B(o,{t:"Count"})])]),g("div",Ooe,[g("button",{onClick:e[4]||(e[4]=l=>this.count--),disabled:this.count===1,class:"btn btn-sm bg-secondary-subtle text-secondary-emphasis"},Boe,8,Noe),g("strong",null,Ee(this.count),1),g("button",{role:"button",onClick:e[5]||(e[5]=l=>this.count++),class:"btn btn-sm bg-secondary-subtle text-secondary-emphasis"},zoe)])]),g("button",{class:"btn btn-primary rounded-3 mt-3 position-relative",disabled:!this.selectedIp||this.pinging,onClick:e[6]||(e[6]=l=>this.execute())},[B(Rt,{name:"slide"},{default:Re(()=>[this.pinging?(D(),V("span",joe,Goe)):(D(),V("span",Hoe,[Yoe,He("Ping! ")]))]),_:1})],8,Woe)]),g("div",Xoe,[B(Rt,{name:"ping"},{default:Re(()=>[this.pingResult?(D(),V("div",Joe,[this.pingResult.geo&&this.pingResult.geo.status==="success"?(D(),Ce(a,{key:0,d:this.pingResult},null,8,["d"])):ce("",!0),g("div",Qoe,[g("div",eae,[g("div",tae,[g("p",nae,[g("small",null,[B(o,{t:"IP Address"})])]),He(" "+Ee(this.pingResult.address),1)]),this.pingResult.geo&&this.pingResult.geo.status==="success"?(D(),V("div",iae,[g("p",sae,[g("small",null,[B(o,{t:"Geolocation"})])]),He(" "+Ee(this.pingResult.geo.city)+", "+Ee(this.pingResult.geo.country),1)])):ce("",!0)])]),g("div",rae,[g("div",oae,[aae,g("span",{class:Ie([this.pingResult.is_alive?"text-success":"text-danger"])},[g("i",{class:Ie(["bi me-1",[this.pingResult.is_alive?"bi-check-circle-fill":"bi-x-circle-fill"]])},null,2),He(" "+Ee(this.pingResult.is_alive?"Yes":"No"),1)],2)])]),g("div",lae,[g("div",cae,[g("p",uae,[g("small",null,[B(o,{t:"Average / Min / Max Round Trip Time"})])]),g("samp",null,Ee(this.pingResult.avg_rtt)+"ms / "+Ee(this.pingResult.min_rtt)+"ms / "+Ee(this.pingResult.max_rtt)+"ms ",1)])]),g("div",dae,[g("div",hae,[g("p",fae,[g("small",null,[B(o,{t:"Sent / Received / Lost Package"})])]),g("samp",null,Ee(this.pingResult.package_sent)+" / "+Ee(this.pingResult.package_received)+" / "+Ee(this.pingResult.package_loss),1)])])])):(D(),V("div",qoe,[Zoe,(D(),V($e,null,Xe(4,l=>g("div",{class:Ie(["pingPlaceholder bg-body-secondary rounded-3 mb-3",{"animate__animated animate__flash animate__slower animate__infinite":this.pinging}]),style:Mn({"animation-delay":`${l*.15}s`})},null,6)),64))]))]),_:1})])])])])}const pae=Ye(doe,[["render",gae],["__scopeId","data-v-f5cd36ce"]]),mae={name:"traceroute",components:{LocaleText:Qe,OSMap:sA},data(){return{tracing:!1,ipAddress:void 0,tracerouteResult:void 0}},setup(){return{store:vi()}},methods:{execute(){this.ipAddress&&(this.tracing=!0,this.tracerouteResult=void 0,Vt("/api/traceroute/execute",{ipAddress:this.ipAddress},t=>{t.status?this.tracerouteResult=t.data:this.store.newMessage("Server",t.message,"danger"),this.tracing=!1}))}}},Jl=t=>(bn("data-v-d80ce3c9"),t=t(),wn(),t),_ae={class:"mt-md-5 mt-3 text-body"},yae={class:"container-md"},vae=Jl(()=>g("h3",{class:"mb-3 text-body"},"Traceroute",-1)),bae={class:"d-flex gap-2 flex-column mb-5"},wae={class:"mb-1 text-muted",for:"ipAddress"},xae=["disabled"],Eae=["disabled"],Sae={key:0,class:"d-block"},Cae=Jl(()=>g("i",{class:"bi bi-person-walking me-2"},null,-1)),Tae={key:1,class:"d-block"},kae=Jl(()=>g("span",{class:"spinner-border spinner-border-sm","aria-hidden":"true"},null,-1)),Aae=Jl(()=>g("span",{class:"visually-hidden",role:"status"},"Loading...",-1)),Mae=[kae,Aae],Iae={class:"position-relative"},Pae={key:"pingPlaceholder"},Rae=Jl(()=>g("div",{class:"pingPlaceholder bg-body-secondary rounded-3 mb-3",style:{height:"300px !important"}},null,-1)),Dae={key:1},$ae={key:"table",class:"w-100 mt-2"},Lae={class:"table table-sm rounded-3 w-100"},Oae=Jl(()=>g("thead",null,[g("tr",null,[g("th",{scope:"col"},"Hop"),g("th",{scope:"col"},"IP Address"),g("th",{scope:"col"},"Average RTT (ms)"),g("th",{scope:"col"},"Min RTT (ms)"),g("th",{scope:"col"},"Max RTT (ms)"),g("th",{scope:"col"},"Geolocation")])],-1)),Nae={key:0};function Fae(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("OSMap");return D(),V("div",_ae,[g("div",yae,[vae,g("div",bae,[g("div",null,[g("label",wae,[g("small",null,[B(o,{t:"Enter IP Address / Hostname"})])]),Ne(g("input",{disabled:this.tracing,id:"ipAddress",class:"form-control","onUpdate:modelValue":e[0]||(e[0]=l=>this.ipAddress=l),onKeyup:e[1]||(e[1]=eS(l=>this.execute(),["enter"])),type:"text"},null,40,xae),[[Ke,this.ipAddress]])]),g("button",{class:"btn btn-primary rounded-3 mt-3 position-relative",disabled:this.tracing||!this.ipAddress,onClick:e[2]||(e[2]=l=>this.execute())},[B(Rt,{name:"slide"},{default:Re(()=>[this.tracing?(D(),V("span",Tae,Mae)):(D(),V("span",Sae,[Cae,He("Trace! ")]))]),_:1})],8,Eae)]),g("div",Iae,[B(Rt,{name:"ping"},{default:Re(()=>[this.tracerouteResult?(D(),V("div",Dae,[B(a,{d:this.tracerouteResult,type:"traceroute"},null,8,["d"]),g("div",$ae,[g("table",Lae,[Oae,g("tbody",null,[(D(!0),V($e,null,Xe(this.tracerouteResult,(l,c)=>(D(),V("tr",null,[g("td",null,[g("small",null,Ee(l.hop),1)]),g("td",null,[g("small",null,Ee(l.ip),1)]),g("td",null,[g("small",null,Ee(l.avg_rtt),1)]),g("td",null,[g("small",null,Ee(l.min_rtt),1)]),g("td",null,[g("small",null,Ee(l.max_rtt),1)]),g("td",null,[l.geo.city&&l.geo.country?(D(),V("span",Nae,[g("small",null,Ee(l.geo.city)+", "+Ee(l.geo.country),1)])):ce("",!0)])]))),256))])])])])):(D(),V("div",Pae,[Rae,(D(),V($e,null,Xe(5,l=>g("div",{class:Ie(["pingPlaceholder bg-body-secondary rounded-3 mb-3",{"animate__animated animate__flash animate__slower animate__infinite":this.tracing}]),style:Mn({"animation-delay":`${l*.05}s`})},null,6)),64))]))]),_:1})])])])}const Bae=Ye(mae,[["render",Fae],["__scopeId","data-v-d80ce3c9"]]),Vae={name:"totp",components:{LocaleText:Qe},async setup(){const t=st();let e="";return await Vt("/api/Welcome_GetTotpLink",{},n=>{n.status&&(e=n.data)}),{l:e,store:t}},mounted(){this.l&&va.toCanvas(document.getElementById("qrcode"),this.l,function(t){})},data(){return{totp:"",totpInvalidMessage:"",verified:!1}},methods:{validateTotp(){}},watch:{totp(t){const e=document.querySelector("#totp");e.classList.remove("is-invalid","is-valid"),t.length===6&&(console.log(t),/[0-9]{6}/.test(t)?kt("/api/Welcome_VerifyTotpLink",{totp:t},n=>{n.status?(this.verified=!0,e.classList.add("is-valid"),this.$emit("verified")):(e.classList.add("is-invalid"),this.totpInvalidMessage="TOTP does not match.")}):(e.classList.add("is-invalid"),this.totpInvalidMessage="TOTP can only contain numbers"))}}},zae=["data-bs-theme"],Wae={class:"m-auto text-body",style:{width:"500px"}},Hae={class:"d-flex flex-column"},Yae={class:"dashboardLogo display-4"},jae={class:"mb-2"},Kae={class:"text-muted"},Uae=g("canvas",{id:"qrcode",class:"rounded-3 mb-2"},null,-1),Gae={class:"p-3 bg-body-secondary rounded-3 border mb-3"},Xae={class:"text-muted mb-0"},qae=["href"],Zae={style:{"line-break":"anywhere"}},Jae={for:"totp",class:"mb-2"},Qae={class:"text-muted"},ele={class:"form-group mb-2"},tle=["disabled"],nle={class:"invalid-feedback"},ile={class:"valid-feedback"},sle=g("hr",null,null,-1),rle={class:"d-flex gap-3 mt-5 flex-column"},ole=g("i",{class:"bi bi-chevron-right ms-auto"},null,-1),ale=g("i",{class:"bi bi-chevron-right ms-auto"},null,-1);function lle(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("RouterLink");return D(),V("div",{class:"container-fluid login-container-fluid d-flex main pt-5 overflow-scroll","data-bs-theme":this.store.Configuration.Server.dashboard_theme},[g("div",Wae,[g("div",Hae,[g("div",null,[g("h1",Yae,[B(o,{t:"Multi-Factor Authentication (MFA)"})]),g("p",jae,[g("small",Kae,[B(o,{t:"1. Please scan the following QR Code to generate TOTP with your choice of authenticator"})])]),Uae,g("div",Gae,[g("p",Xae,[g("small",null,[B(o,{t:"Or you can click the link below:"})])]),g("a",{href:this.l},[g("code",Zae,Ee(this.l),1)],8,qae)]),g("label",Jae,[g("small",Qae,[B(o,{t:"2. Enter the TOTP generated by your authenticator to verify"})])]),g("div",ele,[Ne(g("input",{class:"form-control text-center totp",id:"totp",maxlength:"6",type:"text",inputmode:"numeric",autocomplete:"one-time-code","onUpdate:modelValue":e[0]||(e[0]=l=>this.totp=l),disabled:this.verified},null,8,tle),[[Ke,this.totp]]),g("div",nle,[B(o,{t:this.totpInvalidMessage},null,8,["t"])]),g("div",ile,[B(o,{t:"TOTP verified!"})])])]),sle,g("div",rle,[this.verified?(D(),Ce(a,{key:1,to:"/",class:"btn btn-dark btn-lg d-flex btn-brand shadow align-items-center flex-grow-1 rounded-3"},{default:Re(()=>[B(o,{t:"Complete"}),ale]),_:1})):(D(),Ce(a,{key:0,to:"/",class:"btn bg-secondary-subtle text-secondary-emphasis rounded-3 flex-grow-1 btn-lg border-1 border-secondary-subtle shadow d-flex"},{default:Re(()=>[B(o,{t:"I don't need MFA"}),ole]),_:1}))])])])],8,zae)}const cle=Ye(Vae,[["render",lle]]),ule={name:"share",components:{LocaleText:Qe},async setup(){const t=iL(),e=we(!1),n=st(),i=we(""),s=we(void 0),r=we(new Blob);await Vt("/api/getDashboardTheme",{},a=>{i.value=a.data});const o=t.query.ShareID;return o===void 0||o.length===0?(s.value=void 0,e.value=!0):await Vt("/api/sharePeer/get",{ShareID:o},a=>{a.status?(s.value=a.data,r.value=new Blob([s.value.file],{type:"text/plain"})):s.value=void 0,e.value=!0}),{store:n,theme:i,peerConfiguration:s,blob:r}},mounted(){this.peerConfiguration&&va.toCanvas(document.querySelector("#qrcode"),this.peerConfiguration.file,t=>{t&&console.error(t)})},methods:{download(){const t=new Blob([this.peerConfiguration.file],{type:"text/plain"}),e=URL.createObjectURL(t),n=`${this.peerConfiguration.fileName}.conf`,i=document.createElement("a");i.href=e,i.download=n,i.click()}},computed:{getBlob(){return URL.createObjectURL(this.blob)}}},ng=t=>(bn("data-v-1b44aacd"),t=t(),wn(),t),dle=["data-bs-theme"],hle={class:"m-auto text-body",style:{width:"500px"}},fle={key:0,class:"text-center position-relative",style:{}},gle=ng(()=>g("div",{class:"animate__animated animate__fadeInUp"},[g("h1",{style:{"font-size":"20rem",filter:"blur(1rem)","animation-duration":"7s"},class:"animate__animated animate__flash animate__infinite"},[g("i",{class:"bi bi-file-binary"})])],-1)),ple={class:"position-absolute w-100 h-100 top-0 start-0 d-flex animate__animated animate__fadeInUp",style:{"animation-delay":"0.1s"}},mle={class:"m-auto"},_le={key:1,class:"d-flex align-items-center flex-column gap-3"},yle={class:"h1 dashboardLogo text-center animate__animated animate__fadeInUp"},vle=ng(()=>g("h6",null,"WGDashboard",-1)),ble={id:"qrcode",class:"rounded-3 shadow animate__animated animate__fadeInUp mb-3",ref:"qrcode"},wle={class:"text-muted animate__animated animate__fadeInUp mb-1",style:{"animation-delay":"0.2s"}},xle=ng(()=>g("samp",null,".conf",-1)),Ele=["download","href"],Sle=ng(()=>g("i",{class:"bi bi-download"},null,-1)),Cle=[Sle];function Tle(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",{class:"container-fluid login-container-fluid d-flex main pt-5 overflow-scroll","data-bs-theme":this.theme},[g("div",hle,[this.peerConfiguration?(D(),V("div",_le,[g("div",yle,[vle,B(o,{t:"Scan QR Code with the WireGuard App to add peer"})]),g("canvas",ble,null,512),g("p",wle,[B(o,{t:"or click the button below to download the "}),xle,B(o,{t:" file"})]),g("a",{download:this.peerConfiguration.fileName+".conf",href:r.getBlob,class:"btn btn-lg bg-primary-subtle text-primary-emphasis border-1 border-primary-subtle animate__animated animate__fadeInUp shadow-sm",style:{"animation-delay":"0.25s"}},Cle,8,Ele)])):(D(),V("div",fle,[gle,g("div",ple,[g("h3",mle,[B(o,{t:"Oh no... This link is either expired or invalid."})])])]))])],8,dle)}const kle=Ye(ule,[["render",Tle],["__scopeId","data-v-1b44aacd"]]),Ale=async()=>{let t=!1;return await Vt("/api/validateAuthentication",{},e=>{t=e.status}),t},Ju=tL({history:y$(),routes:[{name:"Index",path:"/",component:tO,meta:{requiresAuth:!0},children:[{name:"Configuration List",path:"",component:qN,meta:{title:"WireGuard Configurations"}},{name:"Settings",path:"/settings",component:lz,meta:{title:"Settings"}},{path:"/ping",name:"Ping",component:pae},{path:"/traceroute",name:"Traceroute",component:Bae},{name:"New Configuration",path:"/new_configuration",component:jW,meta:{title:"New Configuration"}},{name:"Configuration",path:"/configuration/:id",component:XW,meta:{title:"Configuration"},children:[{name:"Peers List",path:"peers",component:gte},{name:"Peers Create",path:"create",component:WT}]}]},{path:"/signin",component:fN,meta:{title:"Sign In"}},{path:"/welcome",component:Mz,meta:{requiresAuth:!0,title:"Welcome to WGDashboard"}},{path:"/2FASetup",component:cle,meta:{requiresAuth:!0,title:"Multi-Factor Authentication Setup"}},{path:"/share",component:kle,meta:{title:"Share"}}]});Ju.beforeEach(async(t,e,n)=>{const i=vi(),s=st();t.meta.title?t.params.id?document.title=t.params.id+" | WGDashboard":document.title=t.meta.title+" | WGDashboard":document.title="WGDashboard",s.ShowNavBar=!1,t.meta.requiresAuth?s.getActiveCrossServer()?(await s.getConfiguration(),!i.Configurations&&t.name!=="Configuration List"&&await i.getConfigurations(),n()):sL.getCookie("authToken")&&await Ale()?(await s.getConfiguration(),!i.Configurations&&t.name!=="Configuration List"&&await i.getConfigurations(),s.Redirect=void 0,n()):(s.Redirect=t,n("/signin"),s.newMessage("WGDashboard","Sign in session ended, please sign in again","warning")):n()});const rA=()=>{let t={"content-type":"application/json"};const n=st().getActiveCrossServer();return n&&(t["wg-dashboard-apikey"]=n.apiKey),t},oA=t=>{const n=st().getActiveCrossServer();return n?`${n.host}${t}`:`${window.location.protocol}//${(window.location.host+window.location.pathname+t).replace(/\/\//g,"/")}`},Vt=async(t,e=void 0,n=void 0)=>{const i=new URLSearchParams(e);await fetch(`${oA(t)}?${i.toString()}`,{headers:rA()}).then(s=>{const r=st();if(s.ok)return s.json();if(s.status!==200)throw s.status===401&&r.newMessage("WGDashboard","Sign in session ended, please sign in again","warning"),new Error(s.statusText)}).then(s=>n?n(s):void 0).catch(s=>{console.log(s),Ju.push({path:"/signin"})})},kt=async(t,e,n)=>{await fetch(`${oA(t)}`,{headers:rA(),method:"POST",body:JSON.stringify(e)}).then(i=>{const s=st();if(i.ok)return i.json();if(i.status!==200)throw i.status===401&&s.newMessage("WGDashboard","Sign in session ended, please sign in again","warning"),new Error(i.statusText)}).then(i=>n?n(i):void 0).catch(i=>{console.log(i),Ju.push({path:"/signin"})})},st=x_("DashboardConfigurationStore",{state:()=>({Redirect:void 0,Configuration:void 0,Messages:[],Peers:{Selecting:!1,RefreshInterval:void 0},CrossServerConfiguration:{Enable:!1,ServerList:{}},ActiveServerConfiguration:void 0,IsElectronApp:!1,ShowNavBar:!1,Locale:void 0}),actions:{initCrossServerConfiguration(){const t=localStorage.getItem("CrossServerConfiguration");localStorage.getItem("ActiveCrossServerConfiguration")!==null&&(this.ActiveServerConfiguration=localStorage.getItem("ActiveCrossServerConfiguration")),t===null?window.localStorage.setItem("CrossServerConfiguration",JSON.stringify(this.CrossServerConfiguration)):this.CrossServerConfiguration=JSON.parse(t)},syncCrossServerConfiguration(){window.localStorage.setItem("CrossServerConfiguration",JSON.stringify(this.CrossServerConfiguration))},addCrossServerConfiguration(){this.CrossServerConfiguration.ServerList[Os().toString()]={host:"",apiKey:"",active:!1}},deleteCrossServerConfiguration(t){delete this.CrossServerConfiguration.ServerList[t]},getActiveCrossServer(){const t=localStorage.getItem("ActiveCrossServerConfiguration");if(t!==null)return this.CrossServerConfiguration.ServerList[t]},setActiveCrossServer(t){this.ActiveServerConfiguration=t,localStorage.setItem("ActiveCrossServerConfiguration",t)},removeActiveCrossServer(){this.ActiveServerConfiguration=void 0,localStorage.removeItem("ActiveCrossServerConfiguration")},async getConfiguration(){await Vt("/api/getDashboardConfiguration",{},t=>{t.status&&(this.Configuration=t.data)})},async signOut(){await Vt("/api/signout",{},t=>{this.removeActiveCrossServer(),this.$router.go("/signin")})},newMessage(t,e,n){this.Messages.push({id:Os(),from:Tt(t),content:Tt(e),type:n,show:!0})},applyLocale(t){if(this.Locale===null)return t;const n=Object.keys(this.Locale).filter(i=>t.match(new RegExp("^"+i+"$","g"))!==null);return console.log(n),n.length===0||n.length>1?t:this.Locale[n[0]]}}}),s0=t=>(bn("data-v-822f113b"),t=t(),wn(),t),Mle={class:"navbar bg-dark sticky-top","data-bs-theme":"dark"},Ile={class:"container-fluid d-flex text-body align-items-center"},Ple=s0(()=>g("span",{class:"navbar-brand mb-0 h1"},"WGDashboard",-1)),Rle={key:0,class:"ms-auto text-muted"},Dle=s0(()=>g("i",{class:"bi bi-server me-2"},null,-1)),$le=s0(()=>g("i",{class:"bi bi-list"},null,-1)),Lle=[$le],Ole={__name:"App",setup(t){const e=st();e.initCrossServerConfiguration(),window.IS_WGDASHBOARD_DESKTOP&&(e.IsElectronApp=!0,e.CrossServerConfiguration.Enable=!0),fn(e.CrossServerConfiguration,()=>{e.syncCrossServerConfiguration()},{deep:!0});const n=be(()=>{if(e.ActiveServerConfiguration)return e.CrossServerConfiguration.ServerList[e.ActiveServerConfiguration]});return(i,s)=>(D(),V($e,null,[g("nav",Mle,[g("div",Ile,[Ple,n.value!==void 0?(D(),V("small",Rle,[Dle,He(Ee(n.value.host),1)])):ce("",!0),g("a",{role:"button",class:"navbarBtn text-body",onClick:s[0]||(s[0]=r=>Q(e).ShowNavBar=!Q(e).ShowNavBar),style:{"line-height":"0","font-size":"2rem"}},Lle)])]),(D(),Ce(f_,null,{default:Re(()=>[B(Q(mS),null,{default:Re(({Component:r})=>[B(Rt,{name:"app",mode:"out-in"},{default:Re(()=>[(D(),Ce(ga(r)))]),_:2},1024)]),_:1})]),_:1}))],64))}},Nle=Ye(Ole,[["__scopeId","data-v-822f113b"]]);let aA;await fetch("/api/locale").then(t=>t.json()).then(t=>aA=t.data);const r0=YD(Nle);r0.use(Ju);const lA=GD();lA.use(({store:t})=>{t.$router=sf(Ju)});r0.use(lA);const Fle=st();Fle.Locale=aA;r0.mount("#app"); +`+p;Js.get(m)===void 0&&(Js.set(m,100,!0),a(u.style,u.weight,p)||(Js.set(m,0,!0),r===void 0&&(r=setInterval(l,32))))}}}(),Eie=function(){let t;return function(e){let n=Mm[e];if(n==null){if(vk){const i=xk(e),s=Sk(e,"Žg");n=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(s.actualBoundingBoxAscent+s.actualBoundingBoxDescent)}else t||(t=document.createElement("div"),t.innerHTML="M",t.style.minHeight="0",t.style.maxHeight="none",t.style.height="auto",t.style.padding="0",t.style.border="none",t.style.position="absolute",t.style.display="block",t.style.left="-99999px"),t.style.font=e,document.body.appendChild(t),n=t.offsetHeight,document.body.removeChild(t);Mm[e]=n}return n}}();function Sk(t,e){return Ga||(Ga=an(1,1)),t!=Am&&(Ga.font=t,Am=Ga.font),Ga.measureText(e)}function Bh(t,e){return Sk(t,e).width}function Lw(t,e,n){if(e in n)return n[e];const i=e.split(` +`).reduce((s,r)=>Math.max(s,Bh(t,r)),0);return n[e]=i,i}function Sie(t,e){const n=[],i=[],s=[];let r=0,o=0,a=0,l=0;for(let c=0,u=e.length;c<=u;c+=2){const d=e[c];if(d===` +`||c===u){r=Math.max(r,o),s.push(o),o=0,a+=l,l=0;continue}const h=e[c+1]||t.font,f=Bh(h,d);n.push(f),o+=f;const p=Eie(h);i.push(p),l=Math.max(l,p)}return{width:r,height:a,widths:n,heights:i,lineWidths:s}}function Cie(t,e,n,i,s,r,o,a,l,c,u){t.save(),n!==1&&(t.globalAlpha===void 0?t.globalAlpha=d=>d.globalAlpha*=n:t.globalAlpha*=n),e&&t.transform.apply(t,e),i.contextInstructions?(t.translate(l,c),t.scale(u[0],u[1]),Tie(i,t)):u[0]<0||u[1]<0?(t.translate(l,c),t.scale(u[0],u[1]),t.drawImage(i,s,r,o,a,0,0,o,a)):t.drawImage(i,s,r,o,a,l,c,o*u[0],a*u[1]),t.restore()}function Tie(t,e){const n=t.contextInstructions;for(let i=0,s=n.length;ithis.imageState_=ot.LOADED),this.render()}clone(){const e=this.getScale(),n=new qf({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n}getAnchor(){const e=this.size_,n=this.getDisplacement(),i=this.getScaleArray();return[e[0]/2-n[0]/i[0],e[1]/2+n[1]/i[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(e){this.fill_=e,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(e){let n=this.canvases_[e];if(!n){const i=this.renderOptions_,s=an(i.size*e,i.size*e);this.draw_(i,s,e),n=s.canvas,this.canvases_[e]=n}return n}getPixelRatio(e){return e}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e,this.render()}listenImageChange(e){}load(){}unlistenImageChange(e){}calculateLineJoinSize_(e,n,i){if(n===0||this.points_===1/0||e!=="bevel"&&e!=="miter")return n;let s=this.radius,r=this.radius2_===void 0?s:this.radius2_;if(s{this.patternImage_=null}),n.getImageState()===ot.IDLE&&n.load(),n.getImageState()===ot.LOADING&&(this.patternImage_=n)}this.color_=e}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}const Zf=jy;class Ky{constructor(e){e=e||{},this.color_=e.color!==void 0?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=e.lineDash!==void 0?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}clone(){const e=this.getColor();return new Ky({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(e){this.color_=e}setLineCap(e){this.lineCap_=e}setLineDash(e){this.lineDash_=e}setLineDashOffset(e){this.lineDashOffset_=e}setLineJoin(e){this.lineJoin_=e}setMiterLimit(e){this.miterLimit_=e}setWidth(e){this.width_=e}}const Vh=Ky;class Jf{constructor(e){e=e||{},this.geometry_=null,this.geometryFunction_=Ow,e.geometry!==void 0&&this.setGeometry(e.geometry),this.fill_=e.fill!==void 0?e.fill:null,this.image_=e.image!==void 0?e.image:null,this.renderer_=e.renderer!==void 0?e.renderer:null,this.hitDetectionRenderer_=e.hitDetectionRenderer!==void 0?e.hitDetectionRenderer:null,this.stroke_=e.stroke!==void 0?e.stroke:null,this.text_=e.text!==void 0?e.text:null,this.zIndex_=e.zIndex}clone(){let e=this.getGeometry();return e&&typeof e=="object"&&(e=e.clone()),new Jf({geometry:e??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(e){this.renderer_=e}setHitDetectionRenderer(e){this.hitDetectionRenderer_=e}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(e){this.fill_=e}getImage(){return this.image_}setImage(e){this.image_=e}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e}getText(){return this.text_}setText(e){this.text_=e}getZIndex(){return this.zIndex_}setGeometry(e){typeof e=="function"?this.geometryFunction_=e:typeof e=="string"?this.geometryFunction_=function(n){return n.get(e)}:e?e!==void 0&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=Ow,this.geometry_=e}setZIndex(e){this.zIndex_=e}}function kie(t){let e;if(typeof t=="function")e=t;else{let n;Array.isArray(t)?n=t:(mt(typeof t.getZIndex=="function","Expected an `Style` or an array of `Style`"),n=[t]),e=function(){return n}}return e}let yp=null;function Ck(t,e){if(!yp){const n=new Zf({color:"rgba(255,255,255,0.4)"}),i=new Vh({color:"#3399CC",width:1.25});yp=[new Jf({image:new Yy({fill:n,stroke:i,radius:5}),fill:n,stroke:i})]}return yp}function Ow(t){return t.getGeometry()}const ul=Jf;function Nw(t,e,n,i){return n!==void 0&&i!==void 0?[n/t,i/e]:n!==void 0?n/t:i!==void 0?i/e:1}class Qf extends Gf{constructor(e){e=e||{};const n=e.opacity!==void 0?e.opacity:1,i=e.rotation!==void 0?e.rotation:0,s=e.scale!==void 0?e.scale:1,r=e.rotateWithView!==void 0?e.rotateWithView:!1;super({opacity:n,rotation:i,scale:s,displacement:e.displacement!==void 0?e.displacement:[0,0],rotateWithView:r,declutterMode:e.declutterMode}),this.anchor_=e.anchor!==void 0?e.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=e.anchorOrigin!==void 0?e.anchorOrigin:"top-left",this.anchorXUnits_=e.anchorXUnits!==void 0?e.anchorXUnits:"fraction",this.anchorYUnits_=e.anchorYUnits!==void 0?e.anchorYUnits:"fraction",this.crossOrigin_=e.crossOrigin!==void 0?e.crossOrigin:null;const o=e.img!==void 0?e.img:null;let a=e.src;mt(!(a!==void 0&&o),"`image` and `src` cannot be provided at the same time"),(a===void 0||a.length===0)&&o&&(a=o.src||wt(o)),mt(a!==void 0&&a.length>0,"A defined and non-empty `src` or `image` must be provided"),mt(!((e.width!==void 0||e.height!==void 0)&&e.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let l;if(e.src!==void 0?l=ot.IDLE:o!==void 0&&("complete"in o?o.complete?l=o.src?ot.LOADED:ot.IDLE:l=ot.LOADING:l=ot.LOADED),this.color_=e.color!==void 0?Su(e.color):null,this.iconImage_=zy(o,a,this.crossOrigin_,l,this.color_),this.offset_=e.offset!==void 0?e.offset:[0,0],this.offsetOrigin_=e.offsetOrigin!==void 0?e.offsetOrigin:"top-left",this.origin_=null,this.size_=e.size!==void 0?e.size:null,this.initialOptions_,e.width!==void 0||e.height!==void 0){let c,u;if(e.size)[c,u]=e.size;else{const d=this.getImage(1);if(d.width&&d.height)c=d.width,u=d.height;else if(d instanceof HTMLImageElement){this.initialOptions_=e;const h=()=>{if(this.unlistenImageChange(h),!this.initialOptions_)return;const f=this.iconImage_.getSize();this.setScale(Nw(f[0],f[1],e.width,e.height))};this.listenImageChange(h);return}}c!==void 0&&this.setScale(Nw(c,u,e.width,e.height))}}clone(){let e,n,i;return this.initialOptions_?(n=this.initialOptions_.width,i=this.initialOptions_.height):(e=this.getScale(),e=Array.isArray(e)?e.slice():e),new Qf({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:e,width:n,height:i,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let e=this.normalizedAnchor_;if(!e){e=this.anchor_;const s=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!s)return null;e=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(e[0]*=s[0]),this.anchorYUnits_=="fraction"&&(e[1]*=s[1])}if(this.anchorOrigin_!="top-left"){if(!s)return null;e===this.anchor_&&(e=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(e[0]=-e[0]+s[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(e[1]=-e[1]+s[1])}this.normalizedAnchor_=e}const n=this.getDisplacement(),i=this.getScaleArray();return[e[0]-n[0]/i[0],e[1]+n[1]/i[1]]}setAnchor(e){this.anchor_=e,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(e){return this.iconImage_.getImage(e)}getPixelRatio(e){return this.iconImage_.getPixelRatio(e)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let e=this.offset_;if(this.offsetOrigin_!="top-left"){const n=this.getSize(),i=this.iconImage_.getSize();if(!n||!i)return null;e=e.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(e[0]=i[0]-n[0]-e[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(e[1]=i[1]-n[1]-e[1])}return this.origin_=e,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const e=this.getScaleArray();if(this.size_)return this.size_[0]*e[0];if(this.iconImage_.getImageState()==ot.LOADED)return this.iconImage_.getSize()[0]*e[0]}getHeight(){const e=this.getScaleArray();if(this.size_)return this.size_[1]*e[1];if(this.iconImage_.getImageState()==ot.LOADED)return this.iconImage_.getSize()[1]*e[1]}setScale(e){delete this.initialOptions_,super.setScale(e)}listenImageChange(e){this.iconImage_.addEventListener(et.CHANGE,e)}load(){this.iconImage_.load()}unlistenImageChange(e){this.iconImage_.removeEventListener(et.CHANGE,e)}ready(){return this.iconImage_.ready()}}const Aie="#333";class Uy{constructor(e){e=e||{},this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=mi(e.scale!==void 0?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.justify_=e.justify,this.repeat_=e.repeat,this.textBaseline_=e.textBaseline,this.fill_=e.fill!==void 0?e.fill:new Zf({color:Aie}),this.maxAngle_=e.maxAngle!==void 0?e.maxAngle:Math.PI/4,this.placement_=e.placement!==void 0?e.placement:"point",this.overflow_=!!e.overflow,this.stroke_=e.stroke!==void 0?e.stroke:null,this.offsetX_=e.offsetX!==void 0?e.offsetX:0,this.offsetY_=e.offsetY!==void 0?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=e.padding===void 0?null:e.padding,this.declutterMode_=e.declutterMode}clone(){const e=this.getScale();return new Uy({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0,declutterMode:this.getDeclutterMode()})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}getDeclutterMode(){return this.declutterMode_}setOverflow(e){this.overflow_=e}setFont(e){this.font_=e}setMaxAngle(e){this.maxAngle_=e}setOffsetX(e){this.offsetX_=e}setOffsetY(e){this.offsetY_=e}setPlacement(e){this.placement_=e}setRepeat(e){this.repeat_=e}setRotateWithView(e){this.rotateWithView_=e}setFill(e){this.fill_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=mi(e!==void 0?e:1)}setStroke(e){this.stroke_=e}setText(e){this.text_=e}setTextAlign(e){this.textAlign_=e}setJustify(e){this.justify_=e}setTextBaseline(e){this.textBaseline_=e}setBackgroundFill(e){this.backgroundFill_=e}setBackgroundStroke(e){this.backgroundStroke_=e}setPadding(e){this.padding_=e}}let wa=0;const qn=1<",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",Multiply:"*",Divide:"/",Add:"+",Subtract:"-",Clamp:"clamp",Mod:"%",Pow:"^",Abs:"abs",Floor:"floor",Ceil:"ceil",Round:"round",Sin:"sin",Cos:"cos",Atan:"atan",Sqrt:"sqrt",Match:"match",Between:"between",Interpolate:"interpolate",Coalesce:"coalesce",Case:"case",In:"in",Number:"number",String:"string",Array:"array",Color:"color",Id:"id",Band:"band",Palette:"palette",ToString:"to-string",Has:"has"},Rie={[_e.Get]:Ue(st(1,1/0),Fw),[_e.Var]:Ue(st(1,1),Die),[_e.Has]:Ue(st(1,1/0),Fw),[_e.Id]:Ue($ie,Fa),[_e.Concat]:Ue(st(2,1/0),_t(di)),[_e.GeometryType]:Ue(Lie,Fa),[_e.LineMetric]:Ue(Fa),[_e.Resolution]:Ue(Fa),[_e.Zoom]:Ue(Fa),[_e.Time]:Ue(Fa),[_e.Any]:Ue(st(2,1/0),_t(qn)),[_e.All]:Ue(st(2,1/0),_t(qn)),[_e.Not]:Ue(st(1,1),_t(qn)),[_e.Equal]:Ue(st(2,2),_t(Ud)),[_e.NotEqual]:Ue(st(2,2),_t(Ud)),[_e.GreaterThan]:Ue(st(2,2),_t(dt)),[_e.GreaterThanOrEqualTo]:Ue(st(2,2),_t(dt)),[_e.LessThan]:Ue(st(2,2),_t(dt)),[_e.LessThanOrEqualTo]:Ue(st(2,2),_t(dt)),[_e.Multiply]:Ue(st(2,1/0),Bw),[_e.Coalesce]:Ue(st(2,1/0),Bw),[_e.Divide]:Ue(st(2,2),_t(dt)),[_e.Add]:Ue(st(2,1/0),_t(dt)),[_e.Subtract]:Ue(st(2,2),_t(dt)),[_e.Clamp]:Ue(st(3,3),_t(dt)),[_e.Mod]:Ue(st(2,2),_t(dt)),[_e.Pow]:Ue(st(2,2),_t(dt)),[_e.Abs]:Ue(st(1,1),_t(dt)),[_e.Floor]:Ue(st(1,1),_t(dt)),[_e.Ceil]:Ue(st(1,1),_t(dt)),[_e.Round]:Ue(st(1,1),_t(dt)),[_e.Sin]:Ue(st(1,1),_t(dt)),[_e.Cos]:Ue(st(1,1),_t(dt)),[_e.Atan]:Ue(st(1,2),_t(dt)),[_e.Sqrt]:Ue(st(1,1),_t(dt)),[_e.Match]:Ue(st(4,1/0),Vw,Nie),[_e.Between]:Ue(st(3,3),_t(dt)),[_e.Interpolate]:Ue(st(6,1/0),Vw,Fie),[_e.Case]:Ue(st(3,1/0),Oie,Bie),[_e.In]:Ue(st(2,2),Vie),[_e.Number]:Ue(st(1,1/0),_t(Ud)),[_e.String]:Ue(st(1,1/0),_t(Ud)),[_e.Array]:Ue(st(1,1/0),_t(dt)),[_e.Color]:Ue(st(1,4),_t(dt)),[_e.Band]:Ue(st(1,3),_t(dt)),[_e.Palette]:Ue(st(2,2),zie),[_e.ToString]:Ue(st(1,1),_t(qn|dt|di|os))};function Fw(t,e,n){const i=t.length-1,s=new Array(i);for(let r=0;re){const a=e===1/0?`${t} or more`:`${t} to ${e}`;throw new Error(`expected ${a} arguments for ${r}, got ${o}`)}}}function Bw(t,e,n){const i=t.length-1,s=new Array(i);for(let r=0;ri.featureId;case _e.GeometryType:return i=>i.geometryType;case _e.Concat:{const i=t.args.map(s=>gs(s));return s=>"".concat(...i.map(r=>r(s).toString()))}case _e.Resolution:return i=>i.resolution;case _e.Any:case _e.All:case _e.Between:case _e.In:case _e.Not:return Kie(t);case _e.Equal:case _e.NotEqual:case _e.LessThan:case _e.LessThanOrEqualTo:case _e.GreaterThan:case _e.GreaterThanOrEqualTo:return jie(t);case _e.Multiply:case _e.Divide:case _e.Add:case _e.Subtract:case _e.Clamp:case _e.Mod:case _e.Pow:case _e.Abs:case _e.Floor:case _e.Ceil:case _e.Round:case _e.Sin:case _e.Cos:case _e.Atan:case _e.Sqrt:return Uie(t);case _e.Case:return Gie(t);case _e.Match:return Xie(t);case _e.Interpolate:return qie(t);case _e.ToString:return Zie(t);default:throw new Error(`Unsupported operator ${n}`)}}function Hie(t,e){const n=t.operator,i=t.args.length,s=new Array(i);for(let r=0;r{for(let o=0;o{for(let o=0;o{const r=t.args;let o=s.properties[i];for(let a=1,l=r.length;as.variables[i];case _e.Has:return s=>{const r=t.args;if(!(i in s.properties))return!1;let o=s.properties[i];for(let a=1,l=r.length;ai(r)===s(r);case _e.NotEqual:return r=>i(r)!==s(r);case _e.LessThan:return r=>i(r)i(r)<=s(r);case _e.GreaterThan:return r=>i(r)>s(r);case _e.GreaterThanOrEqualTo:return r=>i(r)>=s(r);default:throw new Error(`Unsupported comparison operator ${n}`)}}function Kie(t,e){const n=t.operator,i=t.args.length,s=new Array(i);for(let r=0;r{for(let o=0;o{for(let o=0;o{const o=s[0](r),a=s[1](r),l=s[2](r);return o>=a&&o<=l};case _e.In:return r=>{const o=s[0](r);for(let a=1;a!s[0](r);default:throw new Error(`Unsupported logical operator ${n}`)}}function Uie(t,e){const n=t.operator,i=t.args.length,s=new Array(i);for(let r=0;r{let o=1;for(let a=0;as[0](r)/s[1](r);case _e.Add:return r=>{let o=0;for(let a=0;as[0](r)-s[1](r);case _e.Clamp:return r=>{const o=s[0](r),a=s[1](r);if(ol?l:o};case _e.Mod:return r=>s[0](r)%s[1](r);case _e.Pow:return r=>Math.pow(s[0](r),s[1](r));case _e.Abs:return r=>Math.abs(s[0](r));case _e.Floor:return r=>Math.floor(s[0](r));case _e.Ceil:return r=>Math.ceil(s[0](r));case _e.Round:return r=>Math.round(s[0](r));case _e.Sin:return r=>Math.sin(s[0](r));case _e.Cos:return r=>Math.cos(s[0](r));case _e.Atan:return i===2?r=>Math.atan2(s[0](r),s[1](r)):r=>Math.atan(s[0](r));case _e.Sqrt:return r=>Math.sqrt(s[0](r));default:throw new Error(`Unsupported numeric operator ${n}`)}}function Gie(t,e){const n=t.args.length,i=new Array(n);for(let s=0;s{for(let r=0;r{const r=i[0](s);for(let o=1;o{const r=i[0](s),o=i[1](s);let a,l;for(let c=2;c=o)return c===2?d:h?Jie(r,o,a,l,u,d):Ic(r,o,a,l,u,d);a=u,l=d}return l}}function Zie(t,e){const n=t.operator,i=t.args.length,s=new Array(i);for(let r=0;r{const o=s[0](r);return t.args[0].type===os?Vy(o):o.toString()};default:throw new Error(`Unsupported convert operator ${n}`)}}function Ic(t,e,n,i,s,r){const o=s-n;if(o===0)return i;const a=e-n,l=t===1?a/o:(Math.pow(t,a)-1)/(Math.pow(t,o)-1);return i+l*(r-i)}function Jie(t,e,n,i,s,r){if(s-n===0)return i;const a=Pw(i),l=Pw(r);let c=l[2]-a[2];c>180?c-=360:c<-180&&(c+=360);const u=[Ic(t,e,n,a[0],s,l[0]),Ic(t,e,n,a[1],s,l[1]),a[2]+Ic(t,e,n,0,s,c),Ic(t,e,n,i[3],s,r[3])];return mk(cie(u))}function Qie(t){return!0}function ese(t){const e=Tk(),n=tse(t,e),i=Ak();return function(s,r){if(i.properties=s.getPropertiesInternal(),i.resolution=r,e.featureId){const o=s.getId();o!==void 0?i.featureId=o:i.featureId=null}return e.geometryType&&(i.geometryType=kk(s.getGeometry())),n(i)}}function zw(t){const e=Tk(),n=t.length,i=new Array(n);for(let o=0;onull;i=Xy(t,e+"fill-color",n)}if(!i)return null;const s=new Zf;return function(r){const o=i(r);return o===Fy?null:(s.setColor(o),s)}}function Iu(t,e,n){const i=gi(t,e+"stroke-width",n),s=Xy(t,e+"stroke-color",n);if(!i&&!s)return null;const r=nr(t,e+"stroke-line-cap",n),o=nr(t,e+"stroke-line-join",n),a=Mk(t,e+"stroke-line-dash",n),l=gi(t,e+"stroke-line-dash-offset",n),c=gi(t,e+"stroke-miter-limit",n),u=new Vh;return function(d){if(s){const h=s(d);if(h===Fy)return null;u.setColor(h)}if(i&&u.setWidth(i(d)),r){const h=r(d);if(h!=="butt"&&h!=="round"&&h!=="square")throw new Error("Expected butt, round, or square line cap");u.setLineCap(h)}if(o){const h=o(d);if(h!=="bevel"&&h!=="round"&&h!=="miter")throw new Error("Expected bevel, round, or miter line join");u.setLineJoin(h)}return a&&u.setLineDash(a(d)),l&&u.setLineDashOffset(l(d)),c&&u.setMiterLimit(c(d)),u}}function nse(t,e){const n="text-",i=nr(t,n+"value",e);if(!i)return null;const s=Mu(t,n,e),r=Mu(t,n+"background-",e),o=Iu(t,n,e),a=Iu(t,n+"background-",e),l=nr(t,n+"font",e),c=gi(t,n+"max-angle",e),u=gi(t,n+"offset-x",e),d=gi(t,n+"offset-y",e),h=Pu(t,n+"overflow",e),f=nr(t,n+"placement",e),p=gi(t,n+"repeat",e),m=eg(t,n+"scale",e),y=Pu(t,n+"rotate-with-view",e),v=gi(t,n+"rotation",e),b=nr(t,n+"align",e),E=nr(t,n+"justify",e),C=nr(t,n+"baseline",e),w=Mk(t,n+"padding",e),x=tg(t,n+"declutter-mode"),T=new Uy({declutterMode:x});return function(k){if(T.setText(i(k)),s&&T.setFill(s(k)),r&&T.setBackgroundFill(r(k)),o&&T.setStroke(o(k)),a&&T.setBackgroundStroke(a(k)),l&&T.setFont(l(k)),c&&T.setMaxAngle(c(k)),u&&T.setOffsetX(u(k)),d&&T.setOffsetY(d(k)),h&&T.setOverflow(h(k)),f){const A=f(k);if(A!=="point"&&A!=="line")throw new Error("Expected point or line for text-placement");T.setPlacement(A)}if(p&&T.setRepeat(p(k)),m&&T.setScale(m(k)),y&&T.setRotateWithView(y(k)),v&&T.setRotation(v(k)),b){const A=b(k);if(A!=="left"&&A!=="center"&&A!=="right"&&A!=="end"&&A!=="start")throw new Error("Expected left, right, center, start, or end for text-align");T.setTextAlign(A)}if(E){const A=E(k);if(A!=="left"&&A!=="right"&&A!=="center")throw new Error("Expected left, right, or center for text-justify");T.setJustify(A)}if(C){const A=C(k);if(A!=="bottom"&&A!=="top"&&A!=="middle"&&A!=="alphabetic"&&A!=="hanging")throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");T.setTextBaseline(A)}return w&&T.setPadding(w(k)),T}}function ise(t,e){return"icon-src"in t?sse(t,e):"shape-points"in t?rse(t,e):"circle-radius"in t?ose(t,e):null}function sse(t,e){const n="icon-",i=n+"src",s=Ik(t[i],i),r=zh(t,n+"anchor",e),o=eg(t,n+"scale",e),a=gi(t,n+"opacity",e),l=zh(t,n+"displacement",e),c=gi(t,n+"rotation",e),u=Pu(t,n+"rotate-with-view",e),d=Hw(t,n+"anchor-origin"),h=Yw(t,n+"anchor-x-units"),f=Yw(t,n+"anchor-y-units"),p=dse(t,n+"color"),m=cse(t,n+"cross-origin"),y=use(t,n+"offset"),v=Hw(t,n+"offset-origin"),b=Wh(t,n+"width"),E=Wh(t,n+"height"),C=lse(t,n+"size"),w=tg(t,n+"declutter-mode"),x=new Qf({src:s,anchorOrigin:d,anchorXUnits:h,anchorYUnits:f,color:p,crossOrigin:m,offset:y,offsetOrigin:v,height:E,width:b,size:C,declutterMode:w});return function(T){return a&&x.setOpacity(a(T)),l&&x.setDisplacement(l(T)),c&&x.setRotation(c(T)),u&&x.setRotateWithView(u(T)),o&&x.setScale(o(T)),r&&x.setAnchor(r(T)),x}}function rse(t,e){const n="shape-",i=n+"points",s=n+"radius",r=Pm(t[i],i),o=Pm(t[s],s),a=Mu(t,n,e),l=Iu(t,n,e),c=eg(t,n+"scale",e),u=zh(t,n+"displacement",e),d=gi(t,n+"rotation",e),h=Pu(t,n+"rotate-with-view",e),f=Wh(t,n+"radius2"),p=Wh(t,n+"angle"),m=tg(t,n+"declutter-mode"),y=new qf({points:r,radius:o,radius2:f,angle:p,declutterMode:m});return function(v){return a&&y.setFill(a(v)),l&&y.setStroke(l(v)),u&&y.setDisplacement(u(v)),d&&y.setRotation(d(v)),h&&y.setRotateWithView(h(v)),c&&y.setScale(c(v)),y}}function ose(t,e){const n="circle-",i=Mu(t,n,e),s=Iu(t,n,e),r=gi(t,n+"radius",e),o=eg(t,n+"scale",e),a=zh(t,n+"displacement",e),l=gi(t,n+"rotation",e),c=Pu(t,n+"rotate-with-view",e),u=tg(t,n+"declutter-mode"),d=new Yy({radius:5,declutterMode:u});return function(h){return r&&d.setRadius(r(h)),i&&d.setFill(i(h)),s&&d.setStroke(s(h)),a&&d.setDisplacement(a(h)),l&&d.setRotation(l(h)),c&&d.setRotateWithView(c(h)),o&&d.setScale(o(h)),d}}function gi(t,e,n){if(!(e in t))return;const i=wr(t[e],dt,n);return function(s){return Pm(i(s),e)}}function nr(t,e,n){if(!(e in t))return null;const i=wr(t[e],di,n);return function(s){return Ik(i(s),e)}}function ase(t,e,n){const i=nr(t,e+"pattern-src",n),s=Ww(t,e+"pattern-offset",n),r=Ww(t,e+"pattern-size",n),o=Xy(t,e+"color",n);return function(a){return{src:i(a),offset:s&&s(a),size:r&&r(a),color:o&&o(a)}}}function Pu(t,e,n){if(!(e in t))return null;const i=wr(t[e],qn,n);return function(s){const r=i(s);if(typeof r!="boolean")throw new Error(`Expected a boolean for ${e}`);return r}}function Xy(t,e,n){if(!(e in t))return null;const i=wr(t[e],os,n);return function(s){return Pk(i(s),e)}}function Mk(t,e,n){if(!(e in t))return null;const i=wr(t[e],ha,n);return function(s){return Gu(i(s),e)}}function zh(t,e,n){if(!(e in t))return null;const i=wr(t[e],ha,n);return function(s){const r=Gu(i(s),e);if(r.length!==2)throw new Error(`Expected two numbers for ${e}`);return r}}function Ww(t,e,n){if(!(e in t))return null;const i=wr(t[e],ha,n);return function(s){return Rk(i(s),e)}}function eg(t,e,n){if(!(e in t))return null;const i=wr(t[e],ha|dt,n);return function(s){return hse(i(s),e)}}function Wh(t,e){const n=t[e];if(n!==void 0){if(typeof n!="number")throw new Error(`Expected a number for ${e}`);return n}}function lse(t,e){const n=t[e];if(n!==void 0){if(typeof n=="number")return mi(n);if(!Array.isArray(n))throw new Error(`Expected a number or size array for ${e}`);if(n.length!==2||typeof n[0]!="number"||typeof n[1]!="number")throw new Error(`Expected a number or size array for ${e}`);return n}}function cse(t,e){const n=t[e];if(n!==void 0){if(typeof n!="string")throw new Error(`Expected a string for ${e}`);return n}}function Hw(t,e){const n=t[e];if(n!==void 0){if(n!=="bottom-left"&&n!=="bottom-right"&&n!=="top-left"&&n!=="top-right")throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${e}`);return n}}function Yw(t,e){const n=t[e];if(n!==void 0){if(n!=="pixels"&&n!=="fraction")throw new Error(`Expected pixels or fraction for ${e}`);return n}}function use(t,e){const n=t[e];if(n!==void 0)return Gu(n,e)}function tg(t,e){const n=t[e];if(n!==void 0){if(typeof n!="string")throw new Error(`Expected a string for ${e}`);if(n!=="declutter"&&n!=="obstacle"&&n!=="none")throw new Error(`Expected declutter, obstacle, or none for ${e}`);return n}}function dse(t,e){const n=t[e];if(n!==void 0)return Pk(n,e)}function Gu(t,e){if(!Array.isArray(t))throw new Error(`Expected an array for ${e}`);const n=t.length;for(let i=0;i4)throw new Error(`Expected a color with 3 or 4 values for ${e}`);return n}function Rk(t,e){const n=Gu(t,e);if(n.length!==2)throw new Error(`Expected an array of two numbers for ${e}`);return n}function hse(t,e){return typeof t=="number"?t:Rk(t,e)}const jw={RENDER_ORDER:"renderOrder"};class Dk extends Uf{constructor(e){e=e||{};const n=Object.assign({},e);delete n.style,delete n.renderBuffer,delete n.updateWhileAnimating,delete n.updateWhileInteracting,super(n),this.declutter_=e.declutter?String(e.declutter):void 0,this.renderBuffer_=e.renderBuffer!==void 0?e.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(e.style),this.updateWhileAnimating_=e.updateWhileAnimating!==void 0?e.updateWhileAnimating:!1,this.updateWhileInteracting_=e.updateWhileInteracting!==void 0?e.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(e){return super.getFeatures(e)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(jw.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(e,n){const i=this.getDeclutter();i in e.declutter||(e.declutter[i]=new gk(9)),this.getRenderer().renderDeclutter(e,n)}setRenderOrder(e){this.set(jw.RENDER_ORDER,e)}setStyle(e){this.style_=e===void 0?Ck:e;const n=fse(e);this.styleFunction_=e===null?void 0:kie(n),this.changed()}}function fse(t){if(t===void 0)return Ck;if(!t)return null;if(typeof t=="function"||t instanceof ul)return t;if(!Array.isArray(t))return zw([t]);if(t.length===0)return[];const e=t.length,n=t[0];if(n instanceof ul){const s=new Array(e);for(let r=0;r=0;--w){const x=m[w],T=x.layer;if(T.hasRenderer()&&Oy(x,u)&&a.call(l,T)){const k=T.getRenderer(),A=T.getSource();if(k&&A){const P=A.getWrapX()?f:e,F=d.bind(null,x.managed);b[0]=P[0]+p[C][0],b[1]=P[1]+p[C][1],c=k.forEachFeatureAtCoordinate(b,n,i,F,v)}if(c)return c}}if(v.length===0)return;const E=1/v.length;return v.forEach((C,w)=>C.distanceSq+=w*E),v.sort((C,w)=>C.distanceSq-w.distanceSq),v.some(C=>c=C.callback(C.feature,C.layer,C.geometry)),c}hasFeatureAtCoordinate(e,n,i,s,r,o){return this.forEachFeatureAtCoordinate(e,n,i,s,mu,this,r,o)!==void 0}getMap(){return this.map_}renderFrame(e){pt()}scheduleExpireIconCache(e){Ms.canExpireCache()&&e.postRenderFunctions.push(pse)}}function pse(t,e){Ms.expire()}class $k extends br{constructor(e,n,i,s){super(e),this.inversePixelTransform=n,this.frameState=i,this.context=s}}class mse extends gse{constructor(e){super(e),this.fontChangeListenerKey_=ft(Js,Ll.PROPERTYCHANGE,e.redrawText,e),this.element_=document.createElement("div");const n=this.element_.style;n.position="absolute",n.width="100%",n.height="100%",n.zIndex="0",this.element_.className=Xf+" ol-layers";const i=e.getViewport();i.insertBefore(this.element_,i.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(e,n){const i=this.getMap();if(i.hasListener(e)){const s=new $k(e,void 0,n);i.dispatchEvent(s)}}disposeInternal(){Dt(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(e){if(!e){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(e),this.dispatchRenderEvent(Hi.PRECOMPOSE,e);const n=e.layerStatesArray.sort((a,l)=>a.zIndex-l.zIndex);n.some(a=>a.layer instanceof Dk&&a.layer.getDeclutter())&&(e.declutter={});const s=e.viewState;this.children_.length=0;const r=[];let o=null;for(let a=0,l=n.length;a=0;--i){const s=n[i],r=s.layer;r.getDeclutter()&&r.renderDeclutter(e,s)}n.forEach(i=>i.layer.renderDeferred(e))}}}class zr extends br{constructor(e,n){super(e),this.layer=n}}const vp={LAYERS:"layers"};class Zl extends KT{constructor(e){e=e||{};const n=Object.assign({},e);delete n.layers;let i=e.layers;super(n),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(vp.LAYERS,this.handleLayersChanged_),i?Array.isArray(i)?i=new As(i.slice(),{unique:!0}):mt(typeof i.getArray=="function","Expected `layers` to be an array or a `Collection`"):i=new As(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(Dt),this.layersListenerKeys_.length=0;const e=this.getLayers();this.layersListenerKeys_.push(ft(e,ci.ADD,this.handleLayersAdd_,this),ft(e,ci.REMOVE,this.handleLayersRemove_,this));for(const i in this.listenerKeys_)this.listenerKeys_[i].forEach(Dt);ju(this.listenerKeys_);const n=e.getArray();for(let i=0,s=n.length;i{this.clickTimeoutId_=void 0;const i=new Lr(Gt.SINGLECLICK,this.map_,e);this.dispatchEvent(i)},250)}updateActivePointers_(e){const n=e,i=n.pointerId;if(n.type==Gt.POINTERUP||n.type==Gt.POINTERCANCEL){delete this.trackedTouches_[i];for(const s in this.trackedTouches_)if(this.trackedTouches_[s].target!==n.target){delete this.trackedTouches_[s];break}}else(n.type==Gt.POINTERDOWN||n.type==Gt.POINTERMOVE)&&(this.trackedTouches_[i]=n);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(e){this.updateActivePointers_(e);const n=new Lr(Gt.POINTERUP,this.map_,e,void 0,void 0,this.activePointers_);this.dispatchEvent(n),this.emulateClicks_&&!n.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(e)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(Dt),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(e){return e.button===0}handlePointerDown_(e){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(e);const n=new Lr(Gt.POINTERDOWN,this.map_,e,void 0,void 0,this.activePointers_);if(this.dispatchEvent(n),this.down_=new PointerEvent(e.type,e),Object.defineProperty(this.down_,"target",{writable:!1,value:e.target}),this.dragListenerKeys_.length===0){const i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(ft(i,Gt.POINTERMOVE,this.handlePointerMove_,this),ft(i,Gt.POINTERUP,this.handlePointerUp_,this),ft(this.element_,Gt.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(ft(this.element_.getRootNode(),Gt.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(e){if(this.isMoving_(e)){this.updateActivePointers_(e),this.dragging_=!0;const n=new Lr(Gt.POINTERDRAG,this.map_,e,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(n)}}relayMoveEvent_(e){this.originalPointerMoveEvent_=e;const n=!!(this.down_&&this.isMoving_(e));this.dispatchEvent(new Lr(Gt.POINTERMOVE,this.map_,e,n))}handleTouchMove_(e){const n=this.originalPointerMoveEvent_;(!n||n.defaultPrevented)&&(typeof e.cancelable!="boolean"||e.cancelable===!0)&&e.preventDefault()}isMoving_(e){return this.dragging_||Math.abs(e.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(e.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(Dt(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(et.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Dt(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Dt),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const Or={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},Fn={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},Hh=1/0;class yse{constructor(e,n){this.priorityFunction_=e,this.keyFunction_=n,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,ju(this.queuedElements_)}dequeue(){const e=this.elements_,n=this.priorities_,i=e[0];e.length==1?(e.length=0,n.length=0):(e[0]=e.pop(),n[0]=n.pop(),this.siftUp_(0));const s=this.keyFunction_(i);return delete this.queuedElements_[s],i}enqueue(e){mt(!(this.keyFunction_(e)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const n=this.priorityFunction_(e);return n!=Hh?(this.elements_.push(e),this.priorities_.push(n),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(e){return e*2+1}getRightChildIndex_(e){return e*2+2}getParentIndex_(e){return e-1>>1}heapify_(){let e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)}isEmpty(){return this.elements_.length===0}isKeyQueued(e){return e in this.queuedElements_}isQueued(e){return this.isKeyQueued(this.keyFunction_(e))}siftUp_(e){const n=this.elements_,i=this.priorities_,s=n.length,r=n[e],o=i[e],a=e;for(;e>1;){const l=this.getLeftChildIndex_(e),c=this.getRightChildIndex_(e),u=ce;){const a=this.getParentIndex_(n);if(s[a]>o)i[n]=i[a],s[n]=s[a],n=a;else break}i[n]=r,s[n]=o}reprioritize(){const e=this.priorityFunction_,n=this.elements_,i=this.priorities_;let s=0;const r=n.length;let o,a,l;for(a=0;a0;){const s=this.dequeue()[0],r=s.getKey();s.getState()===Fe.IDLE&&!(r in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++i,s.load())}}}function bse(t,e,n,i,s){if(!t||!(n in t.wantedTiles)||!t.wantedTiles[n][e.getKey()])return Hh;const r=t.viewState.center,o=i[0]-r[0],a=i[1]-r[1];return 65536*Math.log(s)+Math.sqrt(o*o+a*a)/s}class qy extends Vs{constructor(e){super();const n=e.element;n&&!e.target&&!n.style.pointerEvents&&(n.style.pointerEvents="auto"),this.element=n||null,this.target_=null,this.map_=null,this.listenerKeys=[],e.render&&(this.render=e.render),e.target&&this.setTarget(e.target)}disposeInternal(){this.element?.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(e){this.map_&&this.element?.remove();for(let n=0,i=this.listenerKeys.length;ns.getAttributions(e)));if(this.attributions_!==void 0&&(Array.isArray(this.attributions_)?this.attributions_.forEach(s=>i.add(s)):i.add(this.attributions_)),!this.overrideCollapsible_){const s=!n.some(r=>r.getSource()?.getAttributionsCollapsible()===!1);this.setCollapsible(s)}return Array.from(i)}async updateElement_(e){if(!e){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const n=await Promise.all(this.collectSourceAttributions_(e).map(s=>zte(()=>s))),i=n.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!xo(n,this.renderedAttributions_)){fie(this.ulElement_);for(let s=0,r=n.length;s0&&i%(2*Math.PI)!==0?n.animate({rotation:0,duration:this.duration_,easing:ql}):n.setRotation(0))}render(e){const n=e.frameState;if(!n)return;const i=n.viewState.rotation;if(i!=this.rotation_){const s="rotate("+i+"rad)";if(this.autoHide_){const r=this.element.classList.contains(Kd);!r&&i===0?this.element.classList.add(Kd):r&&i!==0&&this.element.classList.remove(Kd)}this.label_.style.transform=s}this.rotation_=i}}const Sse=Ese;class Cse extends qy{constructor(e){e=e||{},super({element:document.createElement("div"),target:e.target});const n=e.className!==void 0?e.className:"ol-zoom",i=e.delta!==void 0?e.delta:1,s=e.zoomInClassName!==void 0?e.zoomInClassName:n+"-in",r=e.zoomOutClassName!==void 0?e.zoomOutClassName:n+"-out",o=e.zoomInLabel!==void 0?e.zoomInLabel:"+",a=e.zoomOutLabel!==void 0?e.zoomOutLabel:"–",l=e.zoomInTipLabel!==void 0?e.zoomInTipLabel:"Zoom in",c=e.zoomOutTipLabel!==void 0?e.zoomOutTipLabel:"Zoom out",u=document.createElement("button");u.className=s,u.setAttribute("type","button"),u.title=l,u.appendChild(typeof o=="string"?document.createTextNode(o):o),u.addEventListener(et.CLICK,this.handleClick_.bind(this,i),!1);const d=document.createElement("button");d.className=r,d.setAttribute("type","button"),d.title=c,d.appendChild(typeof a=="string"?document.createTextNode(a):a),d.addEventListener(et.CLICK,this.handleClick_.bind(this,-i),!1);const h=n+" "+Xf+" "+Wy,f=this.element;f.className=h,f.appendChild(u),f.appendChild(d),this.duration_=e.duration!==void 0?e.duration:250}handleClick_(e,n){n.preventDefault(),this.zoomByDelta_(e)}zoomByDelta_(e){const i=this.getMap().getView();if(!i)return;const s=i.getZoom();if(s!==void 0){const r=i.getConstrainedZoom(s+e);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:r,duration:this.duration_,easing:ql})):i.setZoom(r)}}}const Tse=Cse;function kse(t){t=t||{};const e=new As;return(t.zoom!==void 0?t.zoom:!0)&&e.push(new Tse(t.zoomOptions)),(t.rotate!==void 0?t.rotate:!0)&&e.push(new Sse(t.rotateOptions)),(t.attribution!==void 0?t.attribution:!0)&&e.push(new xse(t.attributionOptions)),e}const Kw={ACTIVE:"active"};class Xu extends Vs{constructor(e){super(),this.on,this.once,this.un,e&&e.handleEvent&&(this.handleEvent=e.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(Kw.ACTIVE)}getMap(){return this.map_}handleEvent(e){return!0}setActive(e){this.set(Kw.ACTIVE,e)}setMap(e){this.map_=e}}function Ase(t,e,n){const i=t.getCenterInternal();if(i){const s=[i[0]+e[0],i[1]+e[1]];t.animateInternal({duration:n!==void 0?n:250,easing:Sne,center:t.getConstrainedCenter(s)})}}function Zy(t,e,n,i){const s=t.getZoom();if(s===void 0)return;const r=t.getConstrainedZoom(s+e),o=t.getResolutionForZoom(r);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:o,anchor:n,duration:i!==void 0?i:250,easing:ql})}class Mse extends Xu{constructor(e){super(),e=e||{},this.delta_=e.delta?e.delta:1,this.duration_=e.duration!==void 0?e.duration:250}handleEvent(e){let n=!1;if(e.type==Gt.DBLCLICK){const i=e.originalEvent,s=e.map,r=e.coordinate,o=i.shiftKey?-this.delta_:this.delta_,a=s.getView();Zy(a,o,r,this.duration_),i.preventDefault(),n=!0}return!n}}const Ise=Mse;class qu extends Xu{constructor(e){e=e||{},super(e),e.handleDownEvent&&(this.handleDownEvent=e.handleDownEvent),e.handleDragEvent&&(this.handleDragEvent=e.handleDragEvent),e.handleMoveEvent&&(this.handleMoveEvent=e.handleMoveEvent),e.handleUpEvent&&(this.handleUpEvent=e.handleUpEvent),e.stopDown&&(this.stopDown=e.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(e){return!1}handleDragEvent(e){}handleEvent(e){if(!e.originalEvent)return!0;let n=!1;if(this.updateTrackedPointers_(e),this.handlingDownUpSequence){if(e.type==Gt.POINTERDRAG)this.handleDragEvent(e),e.originalEvent.preventDefault();else if(e.type==Gt.POINTERUP){const i=this.handleUpEvent(e);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(e.type==Gt.POINTERDOWN){const i=this.handleDownEvent(e);this.handlingDownUpSequence=i,n=this.stopDown(i)}else e.type==Gt.POINTERMOVE&&this.handleMoveEvent(e);return!n}handleMoveEvent(e){}handleUpEvent(e){return!1}stopDown(e){return e}updateTrackedPointers_(e){e.activePointers&&(this.targetPointers=e.activePointers)}}function Jy(t){const e=t.length;let n=0,i=0;for(let s=0;s0&&this.condition_(e)){const i=e.map.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}const Fse=Nse;class Bse extends qu{constructor(e){e=e||{},super({stopDown:Nf}),this.condition_=e.condition?e.condition:Pse,this.lastAngle_=void 0,this.duration_=e.duration!==void 0?e.duration:250}handleDragEvent(e){if(!bp(e))return;const n=e.map,i=n.getView();if(i.getConstraints().rotation===My)return;const s=n.getSize(),r=e.pixel,o=Math.atan2(s[1]/2-r[1],r[0]-s[0]/2);if(this.lastAngle_!==void 0){const a=o-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=o}handleUpEvent(e){return bp(e)?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){return bp(e)&&Ok(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}class Vse extends Lf{constructor(e){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+e,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const e=this.startPixel_,n=this.endPixel_,i="px",s=this.element_.style;s.left=Math.min(e[0],n[0])+i,s.top=Math.min(e[1],n[1])+i,s.width=Math.abs(n[0]-e[0])+i,s.height=Math.abs(n[1]-e[1])+i}setMap(e){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const n=this.element_.style;n.left="inherit",n.top="inherit",n.width="inherit",n.height="inherit"}this.map_=e,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(e,n){this.startPixel_=e,this.endPixel_=n,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;const e=this.startPixel_,n=this.endPixel_,s=[e,[e[0],n[1]],n,[n[0],e[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);s[4]=s[0].slice(),this.geometry_?this.geometry_.setCoordinates([s]):this.geometry_=new xu([s])}getGeometry(){return this.geometry_}}const Ba={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class yc extends br{constructor(e,n,i){super(e),this.coordinate=n,this.mapBrowserEvent=i}}class zse extends qu{constructor(e){super(),this.on,this.once,this.un,e=e??{},this.box_=new Vse(e.className||"ol-dragbox"),this.minArea_=e.minArea??64,e.onBoxEnd&&(this.onBoxEnd=e.onBoxEnd),this.startPixel_=null,this.condition_=e.condition??Ok,this.boxEndCondition_=e.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(e,n,i){const s=i[0]-n[0],r=i[1]-n[1];return s*s+r*r>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(e){this.startPixel_&&(this.box_.setPixels(this.startPixel_,e.pixel),this.dispatchEvent(new yc(Ba.BOXDRAG,e.coordinate,e)))}handleUpEvent(e){if(!this.startPixel_)return!1;const n=this.boxEndCondition_(e,this.startPixel_,e.pixel);return n&&this.onBoxEnd(e),this.dispatchEvent(new yc(n?Ba.BOXEND:Ba.BOXCANCEL,e.coordinate,e)),this.box_.setMap(null),this.startPixel_=null,!1}handleDownEvent(e){return this.condition_(e)?(this.startPixel_=e.pixel,this.box_.setMap(e.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new yc(Ba.BOXSTART,e.coordinate,e)),!0):!1}onBoxEnd(e){}setActive(e){e||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new yc(Ba.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setActive(e)}setMap(e){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new yc(Ba.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setMap(e)}}class Wse extends zse{constructor(e){e=e||{};const n=e.condition?e.condition:Lse;super({condition:n,className:e.className||"ol-dragzoom",minArea:e.minArea}),this.duration_=e.duration!==void 0?e.duration:200,this.out_=e.out!==void 0?e.out:!1}onBoxEnd(e){const i=this.getMap().getView();let s=this.getGeometry();if(this.out_){const r=i.rotatedExtentForGeometry(s),o=i.getResolutionForExtentInternal(r),a=i.getResolution()/o;s=s.clone(),s.scale(a*a)}i.fitInternal(s,{duration:this.duration_,easing:ql})}}const Hse=Wse,Fo={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class Yse extends Xu{constructor(e){super(),e=e||{},this.defaultCondition_=function(n){return Nk(n)&&Fk(n)},this.condition_=e.condition!==void 0?e.condition:this.defaultCondition_,this.duration_=e.duration!==void 0?e.duration:100,this.pixelDelta_=e.pixelDelta!==void 0?e.pixelDelta:128}handleEvent(e){let n=!1;if(e.type==et.KEYDOWN){const i=e.originalEvent,s=i.key;if(this.condition_(e)&&(s==Fo.DOWN||s==Fo.LEFT||s==Fo.RIGHT||s==Fo.UP)){const o=e.map.getView(),a=o.getResolution()*this.pixelDelta_;let l=0,c=0;s==Fo.DOWN?c=-a:s==Fo.LEFT?l=-a:s==Fo.RIGHT?l=a:c=a;const u=[l,c];Ey(u,o.getRotation()),Ase(o,u,this.duration_),i.preventDefault(),n=!0}}return!n}}class jse extends Xu{constructor(e){super(),e=e||{},this.condition_=e.condition?e.condition:function(n){return!$se(n)&&Fk(n)},this.delta_=e.delta?e.delta:1,this.duration_=e.duration!==void 0?e.duration:100}handleEvent(e){let n=!1;if(e.type==et.KEYDOWN||e.type==et.KEYPRESS){const i=e.originalEvent,s=i.key;if(this.condition_(e)&&(s==="+"||s==="-")){const r=e.map,o=s==="+"?this.delta_:-this.delta_,a=r.getView();Zy(a,o,void 0,this.duration_),i.preventDefault(),n=!0}}return!n}}const Kse=jse;class Use{constructor(e,n,i){this.decay_=e,this.minVelocity_=n,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(e,n){this.points_.push(e,n,Date.now())}end(){if(this.points_.length<6)return!1;const e=Date.now()-this.delay_,n=this.points_.length-3;if(this.points_[n+2]0&&this.points_[i+2]>e;)i-=3;const s=this.points_[n+2]-this.points_[i+2];if(s<1e3/60)return!1;const r=this.points_[n]-this.points_[i],o=this.points_[n+1]-this.points_[i+1];return this.angle_=Math.atan2(o,r),this.initialVelocity_=Math.sqrt(r*r+o*o)/s,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}class Gse extends Xu{constructor(e){e=e||{},super(e),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=e.maxDelta!==void 0?e.maxDelta:1,this.duration_=e.duration!==void 0?e.duration:250,this.timeout_=e.timeout!==void 0?e.timeout:80,this.useAnchor_=e.useAnchor!==void 0?e.useAnchor:!0,this.constrainResolution_=e.constrainResolution!==void 0?e.constrainResolution:!1;const n=e.condition?e.condition:Dse;this.condition_=e.onFocusOnly?Dm(Lk,n):n,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;const e=this.getMap();if(!e)return;e.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(e){if(!this.condition_(e)||e.type!==et.WHEEL)return!0;const i=e.map,s=e.originalEvent;s.preventDefault(),this.useAnchor_&&(this.lastAnchor_=e.pixel);let r;if(e.type==et.WHEEL&&(r=s.deltaY,uie&&s.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(r/=yk),s.deltaMode===WheelEvent.DOM_DELTA_LINE&&(r*=40)),r===0)return!1;this.lastDelta_=r;const o=Date.now();this.startTime_===void 0&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(r)<4?"trackpad":"wheel");const a=i.getView();if(this.mode_==="trackpad"&&!(a.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-r/this.deltaPerZoom_,this.lastAnchor_?i.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=o,!1;this.totalDelta_+=r;const l=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),l),!1}handleWheelZoom_(e){const n=e.getView();n.getAnimating()&&n.cancelAnimations();let i=-Jt(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(n.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),Zy(n,i,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(e){this.useAnchor_=e,e||(this.lastAnchor_=null)}}const Xse=Gse;class qse extends qu{constructor(e){e=e||{};const n=e;n.stopDown||(n.stopDown=Nf),super(n),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=e.threshold!==void 0?e.threshold:.3,this.duration_=e.duration!==void 0?e.duration:250}handleDragEvent(e){let n=0;const i=this.targetPointers[0],s=this.targetPointers[1],r=Math.atan2(s.clientY-i.clientY,s.clientX-i.clientX);if(this.lastAngle_!==void 0){const l=r-this.lastAngle_;this.rotationDelta_+=l,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),n=l}this.lastAngle_=r;const o=e.map,a=o.getView();a.getConstraints().rotation!==My&&(this.anchor_=o.getCoordinateFromPixelInternal(o.getEventPixel(Jy(this.targetPointers))),this.rotating_&&(o.render(),a.adjustRotationInternal(n,this.anchor_)))}handleUpEvent(e){return this.targetPointers.length<2?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){if(this.targetPointers.length>=2){const n=e.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||n.getView().beginInteraction(),!0}return!1}}class Zse extends qu{constructor(e){e=e||{};const n=e;n.stopDown||(n.stopDown=Nf),super(n),this.anchor_=null,this.duration_=e.duration!==void 0?e.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(e){let n=1;const i=this.targetPointers[0],s=this.targetPointers[1],r=i.clientX-s.clientX,o=i.clientY-s.clientY,a=Math.sqrt(r*r+o*o);this.lastDistance_!==void 0&&(n=this.lastDistance_/a),this.lastDistance_=a;const l=e.map,c=l.getView();n!=1&&(this.lastScaleDelta_=n),this.anchor_=l.getCoordinateFromPixelInternal(l.getEventPixel(Jy(this.targetPointers))),l.render(),c.adjustResolutionInternal(n,this.anchor_)}handleUpEvent(e){if(this.targetPointers.length<2){const i=e.map.getView(),s=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,s),!1}return!0}handleDownEvent(e){if(this.targetPointers.length>=2){const n=e.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||n.getView().beginInteraction(),!0}return!1}}const Jse=Zse;function Qse(t){t=t||{};const e=new As,n=new Use(-.005,.05,100);return(t.altShiftDragRotate!==void 0?t.altShiftDragRotate:!0)&&e.push(new Bse),(t.doubleClickZoom!==void 0?t.doubleClickZoom:!0)&&e.push(new Ise({delta:t.zoomDelta,duration:t.zoomDuration})),(t.dragPan!==void 0?t.dragPan:!0)&&e.push(new Fse({onFocusOnly:t.onFocusOnly,kinetic:n})),(t.pinchRotate!==void 0?t.pinchRotate:!0)&&e.push(new qse),(t.pinchZoom!==void 0?t.pinchZoom:!0)&&e.push(new Jse({duration:t.zoomDuration})),(t.keyboard!==void 0?t.keyboard:!0)&&(e.push(new Yse),e.push(new Kse({delta:t.zoomDelta,duration:t.zoomDuration}))),(t.mouseWheelZoom!==void 0?t.mouseWheelZoom:!0)&&e.push(new Xse({onFocusOnly:t.onFocusOnly,duration:t.zoomDuration})),(t.shiftDragZoom!==void 0?t.shiftDragZoom:!0)&&e.push(new Hse({duration:t.zoomDuration})),e}function Bk(t){if(t instanceof Uf){t.setMapInternal(null);return}t instanceof Zl&&t.getLayers().forEach(Bk)}function Vk(t,e){if(t instanceof Uf){t.setMapInternal(e);return}if(t instanceof Zl){const n=t.getLayers().getArray();for(let i=0,s=n.length;ithis.updateSize()),this.controls=n.controls||kse(),this.interactions=n.interactions||Qse({onFocusOnly:!0}),this.overlays_=n.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new vse(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(Fn.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(Fn.VIEW,this.handleViewChanged_),this.addChangeListener(Fn.SIZE,this.handleSizeChanged_),this.addChangeListener(Fn.TARGET,this.handleTargetChanged_),this.setProperties(n.values);const i=this;e.view&&!(e.view instanceof Ss)&&e.view.then(function(s){i.setView(new Ss(s))}),this.controls.addEventListener(ci.ADD,s=>{s.element.setMap(this)}),this.controls.addEventListener(ci.REMOVE,s=>{s.element.setMap(null)}),this.interactions.addEventListener(ci.ADD,s=>{s.element.setMap(this)}),this.interactions.addEventListener(ci.REMOVE,s=>{s.element.setMap(null)}),this.overlays_.addEventListener(ci.ADD,s=>{this.addOverlayInternal_(s.element)}),this.overlays_.addEventListener(ci.REMOVE,s=>{const r=s.element.getId();r!==void 0&&delete this.overlayIdIndex_[r.toString()],s.element.setMap(null)}),this.controls.forEach(s=>{s.setMap(this)}),this.interactions.forEach(s=>{s.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(e){this.getControls().push(e)}addInteraction(e){this.getInteractions().push(e)}addLayer(e){this.getLayerGroup().getLayers().push(e)}handleLayerAdd_(e){Vk(e.layer,this)}addOverlay(e){this.getOverlays().push(e)}addOverlayInternal_(e){const n=e.getId();n!==void 0&&(this.overlayIdIndex_[n.toString()]=e),e.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(e,n,i){if(!this.frameState_||!this.renderer_)return;const s=this.getCoordinateFromPixelInternal(e);i=i!==void 0?i:{};const r=i.hitTolerance!==void 0?i.hitTolerance:0,o=i.layerFilter!==void 0?i.layerFilter:mu,a=i.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(s,this.frameState_,r,a,n,null,o,null)}getFeaturesAtPixel(e,n){const i=[];return this.forEachFeatureAtPixel(e,function(s){i.push(s)},n),i}getAllLayers(){const e=[];function n(i){i.forEach(function(s){s instanceof Zl?n(s.getLayers()):e.push(s)})}return n(this.getLayers()),e}hasFeatureAtPixel(e,n){if(!this.frameState_||!this.renderer_)return!1;const i=this.getCoordinateFromPixelInternal(e);n=n!==void 0?n:{};const s=n.layerFilter!==void 0?n.layerFilter:mu,r=n.hitTolerance!==void 0?n.hitTolerance:0,o=n.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,r,o,s,null)}getEventCoordinate(e){return this.getCoordinateFromPixel(this.getEventPixel(e))}getEventCoordinateInternal(e){return this.getCoordinateFromPixelInternal(this.getEventPixel(e))}getEventPixel(e){const i=this.viewport_.getBoundingClientRect(),s=this.getSize(),r=i.width/s[0],o=i.height/s[1],a="changedTouches"in e?e.changedTouches[0]:e;return[(a.clientX-i.left)/r,(a.clientY-i.top)/o]}getTarget(){return this.get(Fn.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(e){return km(this.getCoordinateFromPixelInternal(e),this.getView().getProjection())}getCoordinateFromPixelInternal(e){const n=this.frameState_;return n?$n(n.pixelToCoordinateTransform,e.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(e){const n=this.overlayIdIndex_[e.toString()];return n!==void 0?n:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(Fn.LAYERGROUP)}setLayers(e){const n=this.getLayerGroup();if(e instanceof As){n.setLayers(e);return}const i=n.getLayers();i.clear(),i.extend(e)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const e=this.getLayerGroup().getLayerStatesArray();for(let n=0,i=e.length;n=0;r--){const o=s[r];if(o.getMap()!==this||!o.getActive()||!this.getTargetElement())continue;if(!o.handleEvent(e)||e.propagationStopped)break}}}handlePostRender(){const e=this.frameState_,n=this.tileQueue_;if(!n.isEmpty()){let s=this.maxTilesLoading_,r=s;if(e){const o=e.viewHints;if(o[Vn.ANIMATING]||o[Vn.INTERACTING]){const a=Date.now()-e.time>8;s=a?0:8,r=a?0:2}}n.getTilesLoading(){this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(e){const n=this.getLayerGroup();n&&this.handleLayerRemove_(new zr("removelayer",n)),this.set(Fn.LAYERGROUP,e)}setSize(e){this.set(Fn.SIZE,e)}setTarget(e){this.set(Fn.TARGET,e)}setView(e){if(!e||e instanceof Ss){this.set(Fn.VIEW,e);return}this.set(Fn.VIEW,new Ss);const n=this;e.then(function(i){n.setView(new Ss(i))})}updateSize(){const e=this.getTargetElement();let n;if(e){const s=getComputedStyle(e),r=e.offsetWidth-parseFloat(s.borderLeftWidth)-parseFloat(s.paddingLeft)-parseFloat(s.paddingRight)-parseFloat(s.borderRightWidth),o=e.offsetHeight-parseFloat(s.borderTopWidth)-parseFloat(s.paddingTop)-parseFloat(s.paddingBottom)-parseFloat(s.borderBottomWidth);!isNaN(r)&&!isNaN(o)&&(n=[Math.max(0,r),Math.max(0,o)],!Aw(n)&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)&&tk("No map visible because the map container's width or height are 0."))}const i=this.getSize();n&&(!i||!xo(n,i))&&(this.setSize(n),this.updateViewportSize_(n))}updateViewportSize_(e){const n=this.getView();n&&n.setViewportSize(e)}};function tre(t){let e=null;t.keyboardEventTarget!==void 0&&(e=typeof t.keyboardEventTarget=="string"?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);const n={},i=t.layers&&typeof t.layers.getLayers=="function"?t.layers:new Zl({layers:t.layers});n[Fn.LAYERGROUP]=i,n[Fn.TARGET]=t.target,n[Fn.VIEW]=t.view instanceof Ss?t.view:new Ss;let s;t.controls!==void 0&&(Array.isArray(t.controls)?s=new As(t.controls.slice()):(mt(typeof t.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),s=t.controls));let r;t.interactions!==void 0&&(Array.isArray(t.interactions)?r=new As(t.interactions.slice()):(mt(typeof t.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),r=t.interactions));let o;return t.overlays!==void 0?Array.isArray(t.overlays)?o=new As(t.overlays.slice()):(mt(typeof t.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),o=t.overlays):o=new As,{controls:s,interactions:r,keyboardEventTarget:e,overlays:o,values:n}}const nre=ere;class Qy extends Ff{constructor(e,n,i){super(),i=i||{},this.tileCoord=e,this.state=n,this.key="",this.transition_=i.transition===void 0?250:i.transition,this.transitionStarts_={},this.interpolate=!!i.interpolate}changed(){this.dispatchEvent(et.CHANGE)}release(){this.state===Fe.ERROR&&this.setState(Fe.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(e){if(this.state!==Fe.ERROR&&this.state>e)throw new Error("Tile load sequence violation");this.state=e,this.changed()}load(){pt()}getAlpha(e,n){if(!this.transition_)return 1;let i=this.transitionStarts_[e];if(!i)i=n,this.transitionStarts_[e]=i;else if(i===-1)return 1;const s=n-i+1e3/60;return s>=this.transition_?1:rk(s/this.transition_)}inTransition(e){return this.transition_?this.transitionStarts_[e]!==-1:!1}endTransition(e){this.transition_&&(this.transitionStarts_[e]=-1)}disposeInternal(){this.release(),super.disposeInternal()}}class zk extends Qy{constructor(e,n,i,s,r,o){super(e,n,o),this.crossOrigin_=s,this.src_=i,this.key=i,this.image_=new Image,s!==null&&(this.image_.crossOrigin=s),this.unlisten_=null,this.tileLoadFunction_=r}getImage(){return this.image_}setImage(e){this.image_=e,this.state=Fe.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=Fe.ERROR,this.unlistenImage_(),this.image_=ire(),this.changed()}handleImageLoad_(){const e=this.image_;e.naturalWidth&&e.naturalHeight?this.state=Fe.LOADED:this.state=Fe.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==Fe.ERROR&&(this.state=Fe.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Fe.IDLE&&(this.state=Fe.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=pie(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}}function ire(){const t=an(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}const Wk=.5,sre=10,Uw=.25;class Hk{constructor(e,n,i,s,r,o){this.sourceProj_=e,this.targetProj_=n;let a={};const l=Lh(this.targetProj_,this.sourceProj_);this.transformInv_=function(b){const E=b[0]+"/"+b[1];return a[E]||(a[E]=l(b)),a[E]},this.maxSourceExtent_=s,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!s&&!!this.sourceProj_.getExtent()&&vt(s)>=vt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?vt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?vt(this.targetProj_.getExtent()):null;const c=ba(i),u=Wf(i),d=zf(i),h=Vf(i),f=this.transformInv_(c),p=this.transformInv_(u),m=this.transformInv_(d),y=this.transformInv_(h),v=sre+(o?Math.max(0,Math.ceil(Math.log2(vu(i)/(o*o*256*256)))):0);if(this.addQuad_(c,u,d,h,f,p,m,y,v),this.wrapsXInSource_){let b=1/0;this.triangles_.forEach(function(E,C,w){b=Math.min(b,E.source[0][0],E.source[1][0],E.source[2][0])}),this.triangles_.forEach(E=>{if(Math.max(E.source[0][0],E.source[1][0],E.source[2][0])-b>this.sourceWorldWidth_/2){const C=[[E.source[0][0],E.source[0][1]],[E.source[1][0],E.source[1][1]],[E.source[2][0],E.source[2][1]]];C[0][0]-b>this.sourceWorldWidth_/2&&(C[0][0]-=this.sourceWorldWidth_),C[1][0]-b>this.sourceWorldWidth_/2&&(C[1][0]-=this.sourceWorldWidth_),C[2][0]-b>this.sourceWorldWidth_/2&&(C[2][0]-=this.sourceWorldWidth_);const w=Math.min(C[0][0],C[1][0],C[2][0]);Math.max(C[0][0],C[1][0],C[2][0])-w.5&&d<1;let p=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const y=fw([e,n,i,s]);p=vt(y)/this.targetWorldWidth_>Uw||p}!f&&this.sourceProj_.isGlobal()&&d&&(p=d>Uw||p)}if(!p&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3])&&!fi(u,this.maxSourceExtent_))return;let m=0;if(!p&&(!isFinite(r[0])||!isFinite(r[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(c>0)p=!0;else if(m=(!isFinite(r[0])||!isFinite(r[1])?8:0)+(!isFinite(o[0])||!isFinite(o[1])?4:0)+(!isFinite(a[0])||!isFinite(a[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),m!=1&&m!=2&&m!=4&&m!=8)return}if(c>0){if(!p){const y=[(e[0]+i[0])/2,(e[1]+i[1])/2],v=this.transformInv_(y);let b;f?b=(ll(r[0],h)+ll(a[0],h))/2-ll(v[0],h):b=(r[0]+a[0])/2-v[0];const E=(r[1]+a[1])/2-v[1];p=b*b+E*E>this.errorThresholdSquared_}if(p){if(Math.abs(e[0]-i[0])<=Math.abs(e[1]-i[1])){const y=[(n[0]+i[0])/2,(n[1]+i[1])/2],v=this.transformInv_(y),b=[(s[0]+e[0])/2,(s[1]+e[1])/2],E=this.transformInv_(b);this.addQuad_(e,n,y,b,r,o,v,E,c-1),this.addQuad_(b,y,i,s,E,v,a,l,c-1)}else{const y=[(e[0]+n[0])/2,(e[1]+n[1])/2],v=this.transformInv_(y),b=[(i[0]+s[0])/2,(i[1]+s[1])/2],E=this.transformInv_(b);this.addQuad_(e,y,b,s,r,v,E,l,c-1),this.addQuad_(y,n,i,b,v,o,a,E,c-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}m&11||this.addTriangle_(e,i,s,r,a,l),m&14||this.addTriangle_(e,i,n,r,a,o),m&&(m&13||this.addTriangle_(n,s,e,o,l,r),m&7||this.addTriangle_(n,s,i,o,l,a))}calculateSourceExtent(){const e=Ui();return this.triangles_.forEach(function(n,i,s){const r=n.source;Gc(e,r[0]),Gc(e,r[1]),Gc(e,r[2])}),e}getTriangles(){return this.triangles_}}let wp;const hr=[];function Gw(t,e,n,i,s){t.beginPath(),t.moveTo(0,0),t.lineTo(e,n),t.lineTo(i,s),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,i)+1,Math.max(n,s)),t.restore()}function xp(t,e){return Math.abs(t[e*4]-210)>2||Math.abs(t[e*4+3]-.75*255)>2}function rre(){if(wp===void 0){const t=an(6,6,hr);t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",Gw(t,4,5,4,0),Gw(t,4,5,0,5);const e=t.getImageData(0,0,3,3).data;wp=xp(e,0)||xp(e,4)||xp(e,8),Bl(t),hr.push(t.canvas)}return wp}function Xw(t,e,n,i){const s=sk(n,e,t);let r=pw(e,i,n);const o=e.getMetersPerUnit();o!==void 0&&(r*=o);const a=t.getMetersPerUnit();a!==void 0&&(r/=a);const l=t.getExtent();if(!l||Fl(l,s)){const c=pw(t,r,s)/r;isFinite(c)&&c>0&&(r/=c)}return r}function Yk(t,e,n,i){const s=da(n);let r=Xw(t,e,s,i);return(!isFinite(r)||r<=0)&&JT(n,function(o){return r=Xw(t,e,o,i),isFinite(r)&&r>0}),r}function jk(t,e,n,i,s,r,o,a,l,c,u,d,h,f){const p=an(Math.round(n*t),Math.round(n*e),hr);if(d||(p.imageSmoothingEnabled=!1),l.length===0)return p.canvas;p.scale(n,n);function m(w){return Math.round(w*n)/n}p.globalCompositeOperation="lighter";const y=Ui();l.forEach(function(w,x,T){nne(y,w.extent)});let v;const b=n/i,E=(d?1:1+Math.pow(2,-24))/b;if(!h||l.length!==1||c!==0){if(v=an(Math.round(vt(y)*b),Math.round(Yn(y)*b),hr),d||(v.imageSmoothingEnabled=!1),s&&f){const w=(s[0]-y[0])*b,x=-(s[3]-y[3])*b,T=vt(s)*b,k=Yn(s)*b;v.rect(w,x,T,k),v.clip()}l.forEach(function(w,x,T){if(w.image.width>0&&w.image.height>0){if(w.clipExtent){v.save();const H=(w.clipExtent[0]-y[0])*b,te=-(w.clipExtent[3]-y[3])*b,N=vt(w.clipExtent)*b,L=Yn(w.clipExtent)*b;v.rect(d?H:Math.round(H),d?te:Math.round(te),d?N:Math.round(H+N)-Math.round(H),d?L:Math.round(te+L)-Math.round(te)),v.clip()}const k=(w.extent[0]-y[0])*b,A=-(w.extent[3]-y[3])*b,P=vt(w.extent)*b,F=Yn(w.extent)*b;v.drawImage(w.image,c,c,w.image.width-2*c,w.image.height-2*c,d?k:Math.round(k),d?A:Math.round(A),d?P:Math.round(k+P)-Math.round(k),d?F:Math.round(A+F)-Math.round(A)),w.clipExtent&&v.restore()}})}const C=ba(o);return a.getTriangles().forEach(function(w,x,T){const k=w.source,A=w.target;let P=k[0][0],F=k[0][1],H=k[1][0],te=k[1][1],N=k[2][0],L=k[2][1];const I=m((A[0][0]-C[0])/r),W=m(-(A[0][1]-C[1])/r),X=m((A[1][0]-C[0])/r),J=m(-(A[1][1]-C[1])/r),ne=m((A[2][0]-C[0])/r),ue=m(-(A[2][1]-C[1])/r),Y=P,Z=F;P=0,F=0,H-=Y,te-=Z,N-=Y,L-=Z;const M=[[H,te,0,0,X-I],[N,L,0,0,ne-I],[0,0,H,te,J-W],[0,0,N,L,ue-W]],ie=jte(M);if(!ie)return;if(p.save(),p.beginPath(),rre()||!d){p.moveTo(X,J);const $=4,oe=I-X,de=W-J;for(let ve=0;ve<$;ve++)p.lineTo(X+m((ve+1)*oe/$),J+m(ve*de/($-1))),ve!=$-1&&p.lineTo(X+m((ve+1)*oe/$),J+m((ve+1)*de/($-1)));p.lineTo(ne,ue)}else p.moveTo(X,J),p.lineTo(I,W),p.lineTo(ne,ue);p.clip(),p.transform(ie[0],ie[2],ie[1],ie[3],I,W),p.translate(y[0]-Y,y[3]-Z);let le;if(v)le=v.canvas,p.scale(E,-E);else{const $=l[0],oe=$.extent;le=$.image,p.scale(vt(oe)/le.width,-Yn(oe)/le.height)}p.drawImage(le,0,0),p.restore()}),v&&(Bl(v),hr.push(v.canvas)),u&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,a.getTriangles().forEach(function(w,x,T){const k=w.target,A=(k[0][0]-C[0])/r,P=-(k[0][1]-C[1])/r,F=(k[1][0]-C[0])/r,H=-(k[1][1]-C[1])/r,te=(k[2][0]-C[0])/r,N=-(k[2][1]-C[1])/r;p.beginPath(),p.moveTo(F,H),p.lineTo(A,P),p.lineTo(te,N),p.closePath(),p.stroke()}),p.restore()),p.canvas}class $m extends Qy{constructor(e,n,i,s,r,o,a,l,c,u,d,h){super(r,Fe.IDLE,h),this.renderEdges_=d!==void 0?d:!1,this.pixelRatio_=a,this.gutter_=l,this.canvas_=null,this.sourceTileGrid_=n,this.targetTileGrid_=s,this.wrappedTileCoord_=o||r,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=e.canWrapX()?e.getExtent():void 0;const f=s.getTileCoordExtent(this.wrappedTileCoord_),p=this.targetTileGrid_.getExtent();let m=this.sourceTileGrid_.getExtent();const y=p?ls(f,p):f;if(vu(y)===0){this.state=Fe.EMPTY;return}const v=e.getExtent();v&&(m?m=ls(m,v):m=v);const b=s.getResolution(this.wrappedTileCoord_[0]),E=Yk(e,i,y,b);if(!isFinite(E)||E<=0){this.state=Fe.EMPTY;return}const C=u!==void 0?u:Wk;if(this.triangulation_=new Hk(e,i,y,m,E*C,b),this.triangulation_.getTriangles().length===0){this.state=Fe.EMPTY;return}this.sourceZ_=n.getZForResolution(E);let w=this.triangulation_.calculateSourceExtent();if(m&&(e.canWrapX()?(w[1]=Jt(w[1],m[1],m[3]),w[3]=Jt(w[3],m[1],m[3])):w=ls(w,m)),!vu(w))this.state=Fe.EMPTY;else{let x=0,T=0;e.canWrapX()&&(x=vt(v),T=Math.floor((w[0]-v[0])/x)),xy(w.slice(),e,!0).forEach(A=>{const P=n.getTileRangeForExtentAndZ(A,this.sourceZ_);for(let F=P.minX;F<=P.maxX;F++)for(let H=P.minY;H<=P.maxY;H++){const te=c(this.sourceZ_,F,H,a);if(te){const N=T*x;this.sourceTiles_.push({tile:te,offset:N})}}++T}),this.sourceTiles_.length===0&&(this.state=Fe.EMPTY)}}getImage(){return this.canvas_}reproject_(){const e=[];if(this.sourceTiles_.forEach(n=>{const i=n.tile;if(i&&i.getState()==Fe.LOADED){const s=this.sourceTileGrid_.getTileCoordExtent(i.tileCoord);s[0]+=n.offset,s[2]+=n.offset;const r=this.clipExtent_?.slice();r&&(r[0]+=n.offset,r[2]+=n.offset),e.push({extent:s,clipExtent:r,image:i.getImage()})}}),this.sourceTiles_.length=0,e.length===0)this.state=Fe.ERROR;else{const n=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(n),s=typeof i=="number"?i:i[0],r=typeof i=="number"?i:i[1],o=this.targetTileGrid_.getResolution(n),a=this.sourceTileGrid_.getResolution(this.sourceZ_),l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=jk(s,r,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,e,this.gutter_,this.renderEdges_,this.interpolate),this.state=Fe.LOADED}this.changed()}load(){if(this.state==Fe.IDLE){this.state=Fe.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:n})=>{const i=n.getState();if(i==Fe.IDLE||i==Fe.LOADING){e++;const s=ft(n,et.CHANGE,r=>{const o=n.getState();(o==Fe.LOADED||o==Fe.ERROR||o==Fe.EMPTY)&&(Dt(s),e--,e===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(s)}}),e===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:n},i,s){n.getState()==Fe.IDLE&&n.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(Dt),this.sourcesListenerKeys_=null}release(){this.canvas_&&(Bl(this.canvas_.getContext("2d")),hr.push(this.canvas_),this.canvas_=null),super.release()}}const Ep={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};class Kk extends Vs{constructor(e){super(),this.projection=Gi(e.projection),this.attributions_=qw(e.attributions),this.attributionsCollapsible_=e.attributionsCollapsible??!0,this.loading=!1,this.state_=e.state!==void 0?e.state:"ready",this.wrapX_=e.wrapX!==void 0?e.wrapX:!1,this.interpolate_=!!e.interpolate,this.viewResolver=null,this.viewRejector=null;const n=this;this.viewPromise_=new Promise(function(i,s){n.viewResolver=i,n.viewRejector=s})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(e){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(e){this.attributions_=qw(e),this.changed()}setState(e){this.state_=e,this.changed()}}function qw(t){return t?typeof t=="function"?t:(Array.isArray(t)||(t=[t]),e=>t):null}class e0{constructor(e,n,i,s){this.minX=e,this.maxX=n,this.minY=i,this.maxY=s}contains(e){return this.containsXY(e[1],e[2])}containsTileRange(e){return this.minX<=e.minX&&e.maxX<=this.maxX&&this.minY<=e.minY&&e.maxY<=this.maxY}containsXY(e,n){return this.minX<=e&&e<=this.maxX&&this.minY<=n&&n<=this.maxY}equals(e){return this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY}extend(e){e.minXthis.maxX&&(this.maxX=e.maxX),e.minYthis.maxY&&(this.maxY=e.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY}}function Va(t,e,n,i,s){return s!==void 0?(s.minX=t,s.maxX=e,s.minY=n,s.maxY=i,s):new e0(t,e,n,i)}function Yh(t,e,n,i){return i!==void 0?(i[0]=t,i[1]=e,i[2]=n,i):[t,e,n]}function ore(t,e,n){return t+"/"+e+"/"+n}function are(t){return lre(t[0],t[1],t[2])}function lre(t,e,n){return(e<n||n>e.getMaxZoom())return!1;const r=e.getFullTileRange(n);return r?r.containsXY(i,s):!0}const za=[0,0,0],Mr=5;class ure{constructor(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,mt(Vte(this.resolutions_,(s,r)=>r-s,!0),"`resolutions` must be sorted in descending order");let n;if(!e.origins){for(let s=0,r=this.resolutions_.length-1;s{const o=new e0(Math.min(0,s[0]),Math.max(s[0]-1,-1),Math.min(0,s[1]),Math.max(s[1]-1,-1));if(i){const a=this.getTileRangeForExtentAndZ(i,r);o.minX=Math.max(a.minX,o.minX),o.maxX=Math.min(a.maxX,o.maxX),o.minY=Math.max(a.minY,o.minY),o.maxY=Math.min(a.maxY,o.maxY)}return o}):i&&this.calculateTileRanges_(i)}forEachTileCoord(e,n,i){const s=this.getTileRangeForExtentAndZ(e,n);for(let r=s.minX,o=s.maxX;r<=o;++r)for(let a=s.minY,l=s.maxY;a<=l;++a)i([n,r,a])}forEachTileCoordParentTileRange(e,n,i,s){let r,o,a,l=null,c=e[0]-1;for(this.zoomFactor_===2?(o=e[1],a=e[2]):l=this.getTileCoordExtent(e,s);c>=this.minZoom;){if(o!==void 0&&a!==void 0?(o=Math.floor(o/2),a=Math.floor(a/2),r=Va(o,o,a,a,i)):r=this.getTileRangeForExtentAndZ(l,c,i),n(c,r))return!0;--c}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(e){return this.origin_?this.origin_:this.origins_[e]}getResolution(e){return this.resolutions_[e]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(e,n,i){if(e[0]this.maxZoom||n0?i:Math.max(r/n[0],s/n[1]);const o=e+1,a=new Array(o);for(let l=0;lthis.getTileInternal(f,p,m,y,o),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return h.key=l,h}getTileInternal(e,n,i,s,r){const o=this.getKey();return this.createTile_(e,n,i,s,r,o)}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,n){const i=Gi(e);if(i){const s=wt(i);s in this.tileGridForProjection||(this.tileGridForProjection[s]=n)}}}function kre(t,e){t.getImage().src=e}class Are extends Tre{constructor(e){e=e||{};const n=e.projection!==void 0?e.projection:"EPSG:3857",i=e.tileGrid!==void 0?e.tileGrid:fre({extent:t0(n),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize});super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:n,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.gutter_=e.gutter!==void 0?e.gutter:0}getGutter(){return this.gutter_}}const Mre='© OpenStreetMap contributors.';class Ire extends Are{constructor(e){e=e||{};let n;e.attributions!==void 0?n=e.attributions:n=[Mre];const i=e.crossOrigin!==void 0?e.crossOrigin:"anonymous",s=e.url!==void 0?e.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:n,attributionsCollapsible:!1,cacheSize:e.cacheSize,crossOrigin:i,interpolate:e.interpolate,maxZoom:e.maxZoom!==void 0?e.maxZoom:19,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:s,wrapX:e.wrapX,zDirection:e.zDirection})}}const Gd={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class Pre extends Uf{constructor(e){e=e||{};const n=Object.assign({},e),i=e.cacheSize;delete e.cacheSize,delete n.preload,delete n.useInterimTilesOnError,super(n),this.on,this.once,this.un,this.cacheSize_=i,this.setPreload(e.preload!==void 0?e.preload:0),this.setUseInterimTilesOnError(e.useInterimTilesOnError!==void 0?e.useInterimTilesOnError:!0)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(Gd.PRELOAD)}setPreload(e){this.set(Gd.PRELOAD,e)}getUseInterimTilesOnError(){return this.get(Gd.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(e){this.set(Gd.USE_INTERIM_TILES_ON_ERROR,e)}getData(e){return super.getData(e)}}const Rre=5;class Dre extends Ku{constructor(e){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=e,this.staleKeys_=new Array,this.maxStaleKeys=Rre}getStaleKeys(){return this.staleKeys_}prependStaleKey(e){this.staleKeys_.unshift(e),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(e){return pt()}getData(e){return null}prepareFrame(e){return pt()}renderFrame(e,n){return pt()}forEachFeatureAtCoordinate(e,n,i,s,r){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(e){const n=e.target;(n.getState()===ot.LOADED||n.getState()===ot.ERROR)&&this.renderIfReadyAndVisible()}loadImage(e){let n=e.getState();return n!=ot.LOADED&&n!=ot.ERROR&&e.addEventListener(et.CHANGE,this.boundHandleImageChange_),n==ot.IDLE&&(e.load(),n=e.getState()),n==ot.LOADED}renderIfReadyAndVisible(){const e=this.getLayer();e&&e.getVisible()&&e.getSourceState()==="ready"&&e.changed()}renderDeferred(e){}disposeInternal(){delete this.layer_,super.disposeInternal()}}class qk{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(Nh(),{get:(e,n)=>{if(typeof Nh()[n]=="function")return this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(n),this.pushMethodArgs_},set:(e,n,i)=>(this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(n,i),!0)})}pushMethodArgs_=(...e)=>(this.instructions_[this.zIndex+this.offset_].push(e),this);pushFunction(e){this.instructions_[this.zIndex+this.offset_].push(e)}getContext(){return this.context_}draw(e){this.instructions_.forEach(n=>{for(let i=0,s=n.length;i0&&this.getCount()>this.highWaterMark}expireCache(e){for(;this.canExpireCache();){const n=this.pop();n instanceof Lf&&n.dispose()}}clear(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}containsKey(e){return this.entries_.hasOwnProperty(e)}forEach(e){let n=this.oldest_;for(;n;)e(n.value_,n.key_,this),n=n.newer}get(e,n){const i=this.entries_[e];return mt(i!==void 0,"Tried to get a value for a key that does not exist in the cache"),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_}remove(e){const n=this.entries_[e];return mt(n!==void 0,"Tried to get a value for a key that does not exist in the cache"),n===this.newest_?(this.newest_=n.older,this.newest_&&(this.newest_.newer=null)):n===this.oldest_?(this.oldest_=n.newer,this.oldest_&&(this.oldest_.older=null)):(n.newer.older=n.older,n.older.newer=n.newer),delete this.entries_[e],--this.count_,n.value_}getCount(){return this.count_}getKeys(){const e=new Array(this.count_);let n=0,i;for(i=this.newest_;i;i=i.older)e[n++]=i.key_;return e}getValues(){const e=new Array(this.count_);let n=0,i;for(i=this.newest_;i;i=i.older)e[n++]=i.value_;return e}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(e){return this.entries_[e]?.value_}pop(){const e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_}replace(e,n){this.get(e),this.entries_[e].value_=n}set(e,n){mt(!(e in this.entries_),"Tried to set a value for a key that is used already");const i={key_:e,newer:null,older:this.newest_,value_:n};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[e]=i,++this.count_}setSize(e){this.highWaterMark=e}}class Vre extends Lm{constructor(e){super({tileCoord:e.tileCoord,loader:()=>Promise.resolve(new Uint8ClampedArray(4)),interpolate:e.interpolate,transition:e.transition}),this.pixelRatio_=e.pixelRatio,this.gutter_=e.gutter,this.reprojData_=null,this.reprojError_=null,this.reprojSize_=void 0,this.sourceTileGrid_=e.sourceTileGrid,this.targetTileGrid_=e.targetTileGrid,this.wrappedTileCoord_=e.wrappedTileCoord||e.tileCoord,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const n=e.sourceProj,i=n.getExtent(),s=e.sourceTileGrid.getExtent();this.clipExtent_=n.canWrapX()?s?ls(i,s):i:s;const r=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),o=this.targetTileGrid_.getExtent();let a=this.sourceTileGrid_.getExtent();const l=o?ls(r,o):r;if(vu(l)===0){this.state=Fe.EMPTY;return}i&&(a?a=ls(a,i):a=i);const c=this.targetTileGrid_.getResolution(this.wrappedTileCoord_[0]),u=e.targetProj,d=Yk(n,u,l,c);if(!isFinite(d)||d<=0){this.state=Fe.EMPTY;return}const h=e.errorThreshold!==void 0?e.errorThreshold:Wk;if(this.triangulation_=new Hk(n,u,l,a,d*h,c),this.triangulation_.getTriangles().length===0){this.state=Fe.EMPTY;return}this.sourceZ_=this.sourceTileGrid_.getZForResolution(d);let f=this.triangulation_.calculateSourceExtent();if(a&&(n.canWrapX()?(f[1]=Jt(f[1],a[1],a[3]),f[3]=Jt(f[3],a[1],a[3])):f=ls(f,a)),!vu(f))this.state=Fe.EMPTY;else{let p=0,m=0;n.canWrapX()&&(p=vt(i),m=Math.floor((f[0]-i[0])/p)),xy(f.slice(),n,!0).forEach(v=>{const b=this.sourceTileGrid_.getTileRangeForExtentAndZ(v,this.sourceZ_),E=e.getTileFunction;for(let C=b.minX;C<=b.maxX;C++)for(let w=b.minY;w<=b.maxY;w++){const x=E(this.sourceZ_,C,w,this.pixelRatio_);if(x){const T=m*p;this.sourceTiles_.push({tile:x,offset:T})}}++m}),this.sourceTiles_.length===0&&(this.state=Fe.EMPTY)}}getSize(){return this.reprojSize_}getData(){return this.reprojData_}getError(){return this.reprojError_}reproject_(){const e=[];let n=!1;if(this.sourceTiles_.forEach(p=>{const m=p.tile;if(!m||m.getState()!==Fe.LOADED)return;const y=m.getSize(),v=this.gutter_;let b;const E=Lre(m.getData());E?b=E:(n=!0,b=Nre(jh(m.getData())));const C=[y[0]+2*v,y[1]+2*v],w=b instanceof Float32Array,x=C[0]*C[1],T=w?Float32Array:Uint8ClampedArray,k=new T(b.buffer),A=T.BYTES_PER_ELEMENT,P=A*k.length/x,F=k.byteLength/C[1],H=Math.floor(F/A/C[0]),te=x*H;let N=k;if(k.length!==te){N=new T(te);let W=0,X=0;const J=C[0]*H;for(let ne=0;ne=0;--p){const m=[];for(let w=0,x=e.length;w{const i=n.getState();if(i!==Fe.IDLE&&i!==Fe.LOADING)return;e++;const s=ft(n,et.CHANGE,()=>{const r=n.getState();(r==Fe.LOADED||r==Fe.ERROR||r==Fe.EMPTY)&&(Dt(s),e--,e===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(s)}),e===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:n}){n.getState()==Fe.IDLE&&n.load()})}unlistenSources_(){this.sourcesListenerKeys_.forEach(Dt),this.sourcesListenerKeys_=null}}function Sp(t,e,n,i){return`${t},${ore(e,n,i)}`}function Cp(t,e,n){if(!(n in t))return t[n]=new Set([e]),!0;const i=t[n],s=i.has(e);return s||i.add(e),!s}function zre(t,e,n){const i=t[n];return i?i.delete(e):!1}function Jw(t,e){const n=t.layerStatesArray[t.layerIndex];n.extent&&(e=ls(e,Xr(n.extent,t.viewState.projection)));const i=n.layer.getRenderSource();if(!i.getWrapX()){const s=i.getTileGridForProjection(t.viewState.projection).getExtent();s&&(e=ls(e,s))}return e}class Wre extends Zk{constructor(e,n){super(e),n=n||{},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=Ui(),this.tempTileRange_=new e0(0,0,0,0),this.tempTileCoord_=Yh(0,0,0);const i=n.cacheSize!==void 0?n.cacheSize:512;this.tileCache_=new Bre(i),this.renderedProjection_=void 0,this.maxStaleKeys=i*.5}getTileCache(){return this.tileCache_}getOrCreateTile(e,n,i,s){const r=this.tileCache_,a=this.getLayer().getSource(),l=Sp(a.getKey(),e,n,i);let c;if(r.containsKey(l))c=r.get(l);else{if(c=a.getTile(e,n,i,s.pixelRatio,s.viewState.projection),!c)return null;r.set(l,c)}return c}getTile(e,n,i,s){const r=this.getOrCreateTile(e,n,i,s);return r||null}getData(e){const n=this.frameState;if(!n)return null;const i=this.getLayer(),s=$n(n.pixelToCoordinateTransform,e.slice()),r=i.getExtent();if(r&&!Fl(r,s))return null;const o=n.viewState,a=i.getRenderSource(),l=a.getTileGridForProjection(o.projection),c=a.getTilePixelRatio(n.pixelRatio);for(let u=l.getZForResolution(o.resolution);u>=l.getMinZoom();--u){const d=l.getTileCoordForCoordAndZ(s,u),h=this.getTile(u,d[1],d[2],n);if(!h||h.getState()!==Fe.LOADED)continue;const f=l.getOrigin(u),p=mi(l.getTileSize(u)),m=l.getResolution(u);let y;if(h instanceof zk||h instanceof $m)y=h.getImage();else if(h instanceof Lm){if(y=jh(h.getData()),!y)continue}else continue;const v=Math.floor(c*((s[0]-f[0])/m-d[1]*p[0])),b=Math.floor(c*((f[1]-s[1])/m-d[2]*p[1])),E=Math.round(c*a.getGutterForProjection(o.projection));return this.getImageData(y,v+E,b+E)}return null}prepareFrame(e){this.renderedProjection_?e.viewState.projection!==this.renderedProjection_&&(this.tileCache_.clear(),this.renderedProjection_=e.viewState.projection):this.renderedProjection_=e.viewState.projection;const n=this.getLayer().getSource();if(!n)return!1;const i=n.getRevision();return this.renderedRevision_?this.renderedRevision_!==i&&(this.renderedRevision_=i,this.renderedSourceKey_===n.getKey()&&this.tileCache_.clear()):this.renderedRevision_=i,!0}enqueueTiles(e,n,i,s,r){const o=e.viewState,a=this.getLayer(),l=a.getRenderSource(),c=l.getTileGridForProjection(o.projection),u=wt(l);u in e.wantedTiles||(e.wantedTiles[u]={});const d=e.wantedTiles[u],h=a.getMapInternal(),f=Math.max(i-r,c.getMinZoom(),c.getZForResolution(Math.min(a.getMaxResolution(),h?h.getView().getResolutionForZoom(Math.max(a.getMinZoom(),0)):c.getResolution(0)),l.zDirection));for(let p=i;p>=f;--p){const m=c.getTileRangeForExtentAndZ(n,p,this.tempTileRange_),y=c.getResolution(p);for(let v=m.minX;v<=m.maxX;++v)for(let b=m.minY;b<=m.maxY;++b){const E=this.getTile(p,v,b,e);if(!E||!Cp(s,E,p))continue;const w=E.getKey();if(d[w]=!0,E.getState()===Fe.IDLE&&!e.tileQueue.isKeyQueued(w)){const x=Yh(p,v,b,this.tempTileCoord_);e.tileQueue.enqueue([E,u,c.getTileCoordCenter(x),y])}}}}findStaleTile_(e,n){const i=this.tileCache_,s=e[0],r=e[1],o=e[2],a=this.getStaleKeys();for(let l=0;l0&&setTimeout(()=>{this.enqueueTiles(e,P,f-1,k,A-1)},0),!(f in k))return this.container;const F=wt(this),H=e.time;for(const ne of k[f]){const ue=ne.getState();if((ne instanceof $m||ne instanceof Vre)&&ue===Fe.EMPTY)continue;const Y=ne.tileCoord;if(ue===Fe.LOADED&&ne.getAlpha(F,H)===1){ne.endTransition(F);continue}if(this.renderComplete=!1,this.findStaleTile_(Y,k)){zre(k,ne,f),e.animate=!0;continue}if(this.findAltTiles_(h,Y,f+1,k))continue;const ie=h.getMinZoom();for(let le=f-1;le>=ie&&!this.findAltTiles_(h,Y,le,k);--le);}const te=p/o*l/v,N=this.getRenderContext(e);_r(this.tempTransform,b/2,E/2,te,te,0,-b/2,-E/2),i.extent&&this.clipUnrotated(N,e,C),u.getInterpolate()||(N.imageSmoothingEnabled=!1),this.preRender(N,e);const L=Object.keys(k).map(Number);L.sort(cr);let I;const W=[],X=[];for(let ne=L.length-1;ne>=0;--ne){const ue=L[ne],Y=u.getTilePixelSize(ue,l,r),M=h.getResolution(ue)/p,ie=Y[0]*M*te,le=Y[1]*M*te,$=h.getTileCoordForCoordAndZ(ba(T),ue),oe=h.getTileCoordExtent($),de=$n(this.tempTransform,[v*(oe[0]-T[0])/p,v*(T[3]-oe[3])/p]),ve=v*u.getGutterForProjection(r);for(const z of k[ue]){if(z.getState()!==Fe.LOADED)continue;const ge=z.tileCoord,S=$[1]-ge[1],O=Math.round(de[0]-(S-1)*ie),K=$[2]-ge[2],U=Math.round(de[1]-(K-1)*le),re=Math.round(de[0]-S*ie),j=Math.round(de[1]-K*le),se=O-re,ee=U-j,fe=L.length===1;let me=!1;I=[re,j,re+se,j,re+se,j+ee,re,j+ee];for(let pe=0,Le=W.length;pe{const Y=wt(u),Z=ue.wantedTiles[Y],M=Z?Object.keys(Z).length:0;this.updateCacheSize(M),this.tileCache_.expireCache()};return e.postRenderFunctions.push(J),this.container}updateCacheSize(e){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,e*2)}drawTile(e,n,i,s,r,o,a,l){let c;if(e instanceof Lm){if(c=jh(e.getData()),!c)throw new Error("Rendering array data is not yet supported")}else c=this.getTileImage(e);if(!c)return;const u=this.getRenderContext(n),d=wt(this),h=n.layerStatesArray[n.layerIndex],f=h.opacity*(l?e.getAlpha(d,n.time):1),p=f!==u.globalAlpha;p&&(u.save(),u.globalAlpha=f),u.drawImage(c,a,a,c.width-2*a,c.height-2*a,i,s,r,o),p&&u.restore(),f!==h.opacity?n.animate=!0:l&&e.endTransition(d)}getImage(){const e=this.context;return e?e.canvas:null}getTileImage(e){return e.getImage()}updateUsedTiles(e,n,i){const s=wt(n);s in e||(e[s]={}),e[s][i.getKey()]=!0}}class Hre extends Pre{constructor(e){super(e)}createRenderer(){return new Wre(this,{cacheSize:this.getCacheSize()})}}const Yre=Hre;class i0 extends Vs{constructor(e){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),e)if(typeof e.getSimplifiedGeometry=="function"){const n=e;this.setGeometry(n)}else{const n=e;this.setProperties(n)}}clone(){const e=new i0(this.hasProperties()?this.getProperties():null);e.setGeometryName(this.getGeometryName());const n=this.getGeometry();n&&e.setGeometry(n.clone());const i=this.getStyle();return i&&e.setStyle(i),e}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(Dt(this.geometryChangeKey_),this.geometryChangeKey_=null);const e=this.getGeometry();e&&(this.geometryChangeKey_=ft(e,et.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e,this.styleFunction_=e?jre(e):void 0,this.changed()}setId(e){this.id_=e,this.changed()}setGeometryName(e){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=e,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function jre(t){if(typeof t=="function")return t;let e;return Array.isArray(t)?e=t:(mt(typeof t.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),e=[t]),function(){return e}}const Tp=i0;function Om(t,e,n,i,s,r,o){let a,l;const c=(n-e)/i;if(c===1)a=e;else if(c===2)a=e,l=s;else if(c!==0){let u=t[e],d=t[e+1],h=0;const f=[0];for(let y=e+i;y1?o:2,r=r||new Array(o);for(let u=0;u>1;sl&&(this.instructions.push([je.CUSTOM,l,u,e,i,Uo,r]),this.hitDetectionInstructions.push([je.CUSTOM,l,u,e,s||i,Uo,r]));break;case"Point":c=e.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),u=this.coordinates.length,this.instructions.push([je.CUSTOM,l,u,e,i,void 0,r]),this.hitDetectionInstructions.push([je.CUSTOM,l,u,e,s||i,void 0,r]);break}this.endGeometry(n)}beginGeometry(e,n,i){this.beginGeometryInstruction1_=[je.BEGIN_GEOMETRY,n,0,e,i],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[je.BEGIN_GEOMETRY,n,0,e,i],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const e=this.hitDetectionInstructions;e.reverse();let n;const i=e.length;let s,r,o=-1;for(n=0;nthis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0}createFill(e){const n=e.fillStyle,i=[je.SET_FILL_STYLE,n];return typeof n!="string"&&i.push(e.fillPatternScale),i}applyStroke(e){this.instructions.push(this.createStroke(e))}createStroke(e){return[je.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth*this.pixelRatio,e.lineCap,e.lineJoin,e.miterLimit,this.applyPixelRatio(e.lineDash),e.lineDashOffset*this.pixelRatio]}updateFillStyle(e,n){const i=e.fillStyle;(typeof i!="string"||e.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(n.call(this,e)),e.currentFillStyle=i)}updateStrokeStyle(e,n){const i=e.strokeStyle,s=e.lineCap,r=e.lineDash,o=e.lineDashOffset,a=e.lineJoin,l=e.lineWidth,c=e.miterLimit;(e.currentStrokeStyle!=i||e.currentLineCap!=s||r!=e.currentLineDash&&!xo(e.currentLineDash,r)||e.currentLineDashOffset!=o||e.currentLineJoin!=a||e.currentLineWidth!=l||e.currentMiterLimit!=c)&&(i!==void 0&&n.call(this,e),e.currentStrokeStyle=i,e.currentLineCap=s,e.currentLineDash=r,e.currentLineDashOffset=o,e.currentLineJoin=a,e.currentLineWidth=l,e.currentMiterLimit=c)}endGeometry(e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const n=[je.END_GEOMETRY,e];this.instructions.push(n),this.hitDetectionInstructions.push(n)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=GT(this.maxExtent),this.maxLineWidth>0)){const e=this.resolution*(this.maxLineWidth+1)/2;vy(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class Ure extends Zu{constructor(e,n,i,s){super(e,n,i,s),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(e,n,i){if(!this.image_||this.maxExtent&&!Fl(this.maxExtent,e.getFlatCoordinates()))return;this.beginGeometry(e,n,i);const s=e.getFlatCoordinates(),r=e.getStride(),o=this.coordinates.length,a=this.appendFlatPointCoordinates(s,r);this.instructions.push([je.DRAW_IMAGE,o,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([je.DRAW_IMAGE,o,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(n)}drawMultiPoint(e,n,i){if(!this.image_)return;this.beginGeometry(e,n,i);const s=e.getFlatCoordinates(),r=[];for(let l=0,c=s.length;l=t){const p=(t-a+f)/f,m=Ti(c,d,p),y=Ti(u,h,p);l.push(m,y),r.push(l),l=[m,y],a==t&&(o+=s),a=0}else if(a0&&r.push(l),r}function Qre(t,e,n,i,s){let r=n,o=n,a=0,l=0,c=n,u,d,h,f,p,m,y,v,b,E;for(d=n;dt&&(l>a&&(a=l,r=c,o=d),l=0,c=d-s)),h=f,y=b,v=E),p=C,m=w}return l+=f,l>a?[c,d]:[r,o]}const Uh={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class eoe extends Zu{constructor(e,n,i,s){super(e,n,i,s),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[ui]={fillStyle:ui},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){const e=super.finish();return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e}drawText(e,n,i){const s=this.textFillState_,r=this.textStrokeState_,o=this.textState_;if(this.text_===""||!o||!s&&!r)return;const a=this.coordinates;let l=a.length;const c=e.getType();let u=null,d=e.getStride();if(o.placement==="line"&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!fi(this.maxExtent,e.getExtent()))return;let h;if(u=e.getFlatCoordinates(),c=="LineString")h=[u.length];else if(c=="MultiLineString")h=e.getEnds();else if(c=="Polygon")h=e.getEnds().slice(0,1);else if(c=="MultiPolygon"){const y=e.getEndss();h=[];for(let v=0,b=y.length;v{const w=a[(b+C)*2]===u[C*d]&&a[(b+C)*2+1]===u[C*d+1];return w||--b,w})}this.saveTextStates_(),(o.backgroundFill||o.backgroundStroke)&&(this.setFillStrokeStyle(o.backgroundFill,o.backgroundStroke),o.backgroundFill&&this.updateFillStyle(this.state,this.createFill),o.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(e,n,i);let p=o.padding;if(p!=Xo&&(o.scale[0]<0||o.scale[1]<0)){let b=o.padding[0],E=o.padding[1],C=o.padding[2],w=o.padding[3];o.scale[0]<0&&(E=-E,w=-w),o.scale[1]<0&&(b=-b,C=-C),p=[b,E,C,w]}const m=this.pixelRatio;this.instructions.push([je.DRAW_IMAGE,l,f,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,p==Xo?Xo:p.map(function(b){return b*m}),!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]);const y=1/m,v=this.state.fillStyle;o.backgroundFill&&(this.state.fillStyle=ui,this.hitDetectionInstructions.push(this.createFill(this.state))),this.hitDetectionInstructions.push([je.DRAW_IMAGE,l,f,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[y,y],NaN,this.declutterMode_,this.declutterImageWithText_,p,!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?ui:this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]),o.backgroundFill&&(this.state.fillStyle=v,this.hitDetectionInstructions.push(this.createFill(this.state))),this.endGeometry(n)}}saveTextStates_(){const e=this.textStrokeState_,n=this.textState_,i=this.textFillState_,s=this.strokeKey_;e&&(s in this.strokeStates||(this.strokeStates[s]={strokeStyle:e.strokeStyle,lineCap:e.lineCap,lineDashOffset:e.lineDashOffset,lineWidth:e.lineWidth,lineJoin:e.lineJoin,miterLimit:e.miterLimit,lineDash:e.lineDash}));const r=this.textKey_;r in this.textStates||(this.textStates[r]={font:n.font,textAlign:n.textAlign||ku,justify:n.justify,textBaseline:n.textBaseline||Fh,scale:n.scale});const o=this.fillKey_;i&&(o in this.fillStates||(this.fillStates[o]={fillStyle:i.fillStyle}))}drawChars_(e,n){const i=this.textStrokeState_,s=this.textState_,r=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();const l=this.pixelRatio,c=Uh[s.textBaseline],u=this.textOffsetY_*l,d=this.text_,h=i?i.lineWidth*Math.abs(s.scale[0])/2:0;this.instructions.push([je.DRAW_CHARS,e,n,c,s.overflow,a,s.maxAngle,l,u,r,h*l,d,o,1,this.declutterMode_]),this.hitDetectionInstructions.push([je.DRAW_CHARS,e,n,c,s.overflow,a&&ui,s.maxAngle,l,u,r,h*l,d,o,1/l,this.declutterMode_])}setTextStyle(e,n){let i,s,r;if(!e)this.text_="";else{const o=e.getFill();o?(s=this.textFillState_,s||(s={},this.textFillState_=s),s.fillStyle=Is(o.getColor()||ui)):(s=null,this.textFillState_=s);const a=e.getStroke();if(!a)r=null,this.textStrokeState_=r;else{r=this.textStrokeState_,r||(r={},this.textStrokeState_=r);const p=a.getLineDash(),m=a.getLineDashOffset(),y=a.getWidth(),v=a.getMiterLimit();r.lineCap=a.getLineCap()||Vl,r.lineDash=p?p.slice():ur,r.lineDashOffset=m===void 0?dr:m,r.lineJoin=a.getLineJoin()||zl,r.lineWidth=y===void 0?Au:y,r.miterLimit=v===void 0?Cu:v,r.strokeStyle=Is(a.getColor()||Tu)}i=this.textState_;const l=e.getFont()||Ek;xie(l);const c=e.getScaleArray();i.overflow=e.getOverflow(),i.font=l,i.maxAngle=e.getMaxAngle(),i.placement=e.getPlacement(),i.textAlign=e.getTextAlign(),i.repeat=e.getRepeat(),i.justify=e.getJustify(),i.textBaseline=e.getTextBaseline()||Fh,i.backgroundFill=e.getBackgroundFill(),i.backgroundStroke=e.getBackgroundStroke(),i.padding=e.getPadding()||Xo,i.scale=c===void 0?[1,1]:c;const u=e.getOffsetX(),d=e.getOffsetY(),h=e.getRotateWithView(),f=e.getRotation();this.text_=e.getText()||"",this.textOffsetX_=u===void 0?0:u,this.textOffsetY_=d===void 0?0:d,this.textRotateWithView_=h===void 0?!1:h,this.textRotation_=f===void 0?0:f,this.strokeKey_=r?(typeof r.strokeStyle=="string"?r.strokeStyle:wt(r.strokeStyle))+r.lineCap+r.lineDashOffset+"|"+r.lineWidth+r.lineJoin+r.miterLimit+"["+r.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.repeat||"?")+(i.justify||"?")+(i.textBaseline||"?"),this.fillKey_=s&&s.fillStyle?typeof s.fillStyle=="string"?s.fillStyle:"|"+wt(s.fillStyle):""}this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=n}}const toe={Circle:ex,Default:Zu,Image:Gre,LineString:qre,Polygon:ex,Text:eoe};class noe{constructor(e,n,i,s){this.tolerance_=e,this.maxExtent_=n,this.pixelRatio_=s,this.resolution_=i,this.buildersByZIndex_={}}finish(){const e={};for(const n in this.buildersByZIndex_){e[n]=e[n]||{};const i=this.buildersByZIndex_[n];for(const s in i){const r=i[s].finish();e[n][s]=r}}return e}getBuilder(e,n){const i=e!==void 0?e.toString():"0";let s=this.buildersByZIndex_[i];s===void 0&&(s={},this.buildersByZIndex_[i]=s);let r=s[n];if(r===void 0){const o=toe[n];r=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),s[n]=r}return r}}function ioe(t,e,n,i,s,r,o,a,l,c,u,d){let h=t[e],f=t[e+1],p=0,m=0,y=0,v=0;function b(){p=h,m=f,e+=i,h=t[e],f=t[e+1],v+=y,y=Math.sqrt((h-p)*(h-p)+(f-m)*(f-m))}do b();while(eI[2]}else F=C>A;const H=Math.PI,te=[],N=x+i===e;e=x,y=0,v=T,h=t[e],f=t[e+1];let L;if(N){b(),L=Math.atan2(f-m,h-p),F&&(L+=L>0?-H:H);const I=(A+C)/2,W=(P+w)/2;return te[0]=[I,W,(k-r)/2,L,s],te}s=s.replace(/\n/g," ");for(let I=0,W=s.length;I0?-H:H),L!==void 0){let M=X-L;if(M+=M>H?-2*H:M<-H?2*H:0,Math.abs(M)>o)return null}L=X;const J=I;let ne=0;for(;I0&&t.push(` +`,""),t.push(e,""),t}class roe{constructor(e,n,i,s,r){this.overlaps=i,this.pixelRatio=n,this.resolution=e,this.alignAndScaleFill_,this.instructions=s.instructions,this.coordinates=s.coordinates,this.coordinateCache_={},this.renderedTransform_=ds(),this.hitDetectionInstructions=s.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=s.fillStates||{},this.strokeStates=s.strokeStates||{},this.textStates=s.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=r?new qk:null}getZIndexContext(){return this.zIndexContext_}createLabel(e,n,i,s){const r=e+n+i+s;if(this.labels_[r])return this.labels_[r];const o=s?this.strokeStates[s]:null,a=i?this.fillStates[i]:null,l=this.textStates[n],c=this.pixelRatio,u=[l.scale[0]*c,l.scale[1]*c],d=l.justify?Uh[l.justify]:kp(Array.isArray(e)?e[0]:e,l.textAlign||ku),h=s&&o.lineWidth?o.lineWidth:0,f=Array.isArray(e)?e:String(e).split(` +`).reduce(soe,[]),{width:p,height:m,widths:y,heights:v,lineWidths:b}=Sie(l,f),E=p+h,C=[],w=(E+2)*u[0],x=(m+h)*u[1],T={width:w<0?Math.floor(w):Math.ceil(w),height:x<0?Math.floor(x):Math.ceil(x),contextInstructions:C};(u[0]!=1||u[1]!=1)&&C.push("scale",u),s&&(C.push("strokeStyle",o.strokeStyle),C.push("lineWidth",h),C.push("lineCap",o.lineCap),C.push("lineJoin",o.lineJoin),C.push("miterLimit",o.miterLimit),C.push("setLineDash",[o.lineDash]),C.push("lineDashOffset",o.lineDashOffset)),i&&C.push("fillStyle",a.fillStyle),C.push("textBaseline","middle"),C.push("textAlign","center");const k=.5-d;let A=d*E+k*h;const P=[],F=[];let H=0,te=0,N=0,L=0,I;for(let W=0,X=f.length;We?e-c:r,C=o+u>n?n-u:o,w=p[3]+E*h[0]+p[1],x=p[0]+C*h[1]+p[2],T=v-p[3],k=b-p[0];(m||d!==0)&&(Ir[0]=T,Pr[0]=T,Ir[1]=k,Ks[1]=k,Ks[0]=T+w,Us[0]=Ks[0],Us[1]=k+x,Pr[1]=Us[1]);let A;return d!==0?(A=_r(ds(),i,s,1,1,d,-i,-s),$n(A,Ir),$n(A,Ks),$n(A,Us),$n(A,Pr),co(Math.min(Ir[0],Ks[0],Us[0],Pr[0]),Math.min(Ir[1],Ks[1],Us[1],Pr[1]),Math.max(Ir[0],Ks[0],Us[0],Pr[0]),Math.max(Ir[1],Ks[1],Us[1],Pr[1]),Ha)):co(Math.min(T,T+w),Math.min(k,k+x),Math.max(T,T+w),Math.max(k,k+x),Ha),f&&(v=Math.round(v),b=Math.round(b)),{drawImageX:v,drawImageY:b,drawImageW:E,drawImageH:C,originX:c,originY:u,declutterBox:{minX:Ha[0],minY:Ha[1],maxX:Ha[2],maxY:Ha[3],value:y},canvasTransform:A,scale:h}}replayImageOrLabel_(e,n,i,s,r,o,a){const l=!!(o||a),c=s.declutterBox,u=a?a[2]*s.scale[0]/2:0;return c.minX-u<=n[0]&&c.maxX+u>=0&&c.minY-u<=n[1]&&c.maxY+u>=0&&(l&&this.replayTextBackground_(e,Ir,Ks,Us,Pr,o,a),Cie(e,s.canvasTransform,r,i,s.originX,s.originY,s.drawImageW,s.drawImageH,s.drawImageX,s.drawImageY,s.scale)),!0}fill_(e){const n=this.alignAndScaleFill_;if(n){const i=$n(this.renderedTransform_,[0,0]),s=512*this.pixelRatio;e.save(),e.translate(i[0]%s,i[1]%s),n!==1&&e.scale(n,n),e.rotate(this.viewRotation_)}e.fill(),n&&e.restore()}setStrokeStyle_(e,n){e.strokeStyle=n[1],e.lineWidth=n[2],e.lineCap=n[3],e.lineJoin=n[4],e.miterLimit=n[5],e.lineDashOffset=n[7],e.setLineDash(n[6])}drawLabelWithPointPlacement_(e,n,i,s){const r=this.textStates[n],o=this.createLabel(e,n,s,i),a=this.strokeStates[i],l=this.pixelRatio,c=kp(Array.isArray(e)?e[0]:e,r.textAlign||ku),u=Uh[r.textBaseline||Fh],d=a&&a.lineWidth?a.lineWidth:0,h=o.width/l-2*r.scale[0],f=c*h+2*(.5-c)*d,p=u*o.height/l+2*(.5-u)*d;return{label:o,anchorX:f,anchorY:p}}execute_(e,n,i,s,r,o,a,l){const c=this.zIndexContext_;let u;this.pixelCoordinates_&&xo(i,this.renderedTransform_)?u=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),u=no(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),Cne(this.renderedTransform_,i));let d=0;const h=s.length;let f=0,p,m,y,v,b,E,C,w,x,T,k,A,P,F=0,H=0,te=null,N=null;const L=this.coordinateCache_,I=this.viewRotation_,W=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,X={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:I},J=this.instructions!=s||this.overlaps?0:200;let ne,ue,Y,Z;for(;dJ&&(this.fill_(e),F=0),H>J&&(e.stroke(),H=0),!F&&!H&&(e.beginPath(),b=NaN,E=NaN),++d;break;case je.CIRCLE:f=M[1];const le=u[f],$=u[f+1],oe=u[f+2],de=u[f+3],ve=oe-le,z=de-$,ge=Math.sqrt(ve*ve+z*z);e.moveTo(le+ge,$),e.arc(le,$,ge,0,2*Math.PI,!0),++d;break;case je.CLOSE_PATH:e.closePath(),++d;break;case je.CUSTOM:f=M[1],p=M[2];const S=M[3],O=M[4],K=M[5];X.geometry=S,X.feature=ne,d in L||(L[d]=[]);const U=L[d];K?K(u,f,p,2,U):(U[0]=u[f],U[1]=u[f+1],U.length=2),c&&(c.zIndex=M[6]),O(U,X),++d;break;case je.DRAW_IMAGE:f=M[1],p=M[2],x=M[3],m=M[4],y=M[5];let re=M[6];const j=M[7],se=M[8],ee=M[9],fe=M[10];let me=M[11];const pe=M[12];let Le=M[13];v=M[14]||"declutter";const Ae=M[15];if(!x&&M.length>=20){T=M[19],k=M[20],A=M[21],P=M[22];const dn=this.drawLabelWithPointPlacement_(T,k,A,P);x=dn.label,M[3]=x;const En=M[23];m=(dn.anchorX-En)*this.pixelRatio,M[4]=m;const Sn=M[24];y=(dn.anchorY-Sn)*this.pixelRatio,M[5]=y,re=x.height,M[6]=re,Le=x.width,M[13]=Le}let ze;M.length>25&&(ze=M[25]);let Be,it,Ze;M.length>17?(Be=M[16],it=M[17],Ze=M[18]):(Be=Xo,it=!1,Ze=!1),fe&&W?me+=I:!fe&&!W&&(me-=I);let Mt=0;for(;f!eA.includes(t));class aoe{constructor(e,n,i,s,r,o,a){this.maxExtent_=e,this.overlaps_=s,this.pixelRatio_=i,this.resolution_=n,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=ds(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(r,a)}clip(e,n){const i=this.getClipCoords(n);e.beginPath(),e.moveTo(i[0],i[1]),e.lineTo(i[2],i[3]),e.lineTo(i[4],i[5]),e.lineTo(i[6],i[7]),e.clip()}createExecutors_(e,n){for(const i in e){let s=this.executorsByZIndex_[i];s===void 0&&(s={},this.executorsByZIndex_[i]=s);const r=e[i];for(const o in r){const a=r[o];s[o]=new roe(this.resolution_,this.pixelRatio_,this.overlaps_,a,n)}}}hasExecutors(e){for(const n in this.executorsByZIndex_){const i=this.executorsByZIndex_[n];for(let s=0,r=e.length;s0){if(!o||T==="none"||f!=="Image"&&f!=="Text"||o.includes(w)){const F=(h[A]-3)/4,H=s-F%a,te=s-(F/a|0),N=r(w,x,H*H+te*te);if(N)return N}u.clearRect(0,0,a,a);break}}const m=Object.keys(this.executorsByZIndex_).map(Number);m.sort(cr);let y,v,b,E,C;for(y=m.length-1;y>=0;--y){const w=m[y].toString();for(b=this.executorsByZIndex_[w],v=el.length-1;v>=0;--v)if(f=el[v],E=b[f],E!==void 0&&(C=E.executeHitDetection(u,l,i,p,d),C))return C}}getClipCoords(e){const n=this.maxExtent_;if(!n)return null;const i=n[0],s=n[1],r=n[2],o=n[3],a=[i,s,i,o,r,o,r,s];return no(a,0,8,2,e,a),a}isEmpty(){return Nl(this.executorsByZIndex_)}execute(e,n,i,s,r,o,a){const l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(cr),o=o||el;const c=el.length;let u,d,h,f,p;for(a&&l.reverse(),u=0,d=l.length;uv.execute(w,n,i,s,r,a)),C&&E.restore(),b){b.offset();const w=l[u]*c+h;this.deferredZIndexContexts_[w]||(this.deferredZIndexContexts_[w]=[]),this.deferredZIndexContexts_[w].push(b)}}}}this.renderedContext_=e}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const e=this.deferredZIndexContexts_,n=Object.keys(e).map(Number).sort(cr);for(let i=0,s=n.length;i{r.draw(this.renderedContext_),r.clear()}),e[n[i]].length=0}}const Ap={};function loe(t){if(Ap[t]!==void 0)return Ap[t];const e=t*2+1,n=t*t,i=new Array(n+1);for(let r=0;r<=t;++r)for(let o=0;o<=t;++o){const a=r*r+o*o;if(a>n)break;let l=i[a];l||(l=[],i[a]=l),l.push(((t+r)*e+(t+o))*4+3),r>0&&l.push(((t-r)*e+(t+o))*4+3),o>0&&(l.push(((t+r)*e+(t-o))*4+3),r>0&&l.push(((t-r)*e+(t-o))*4+3))}const s=[];for(let r=0,o=i.length;rd*this.pixelRatio_),lineDashOffset:(o||dr)*this.pixelRatio_,lineJoin:a!==void 0?a:zl,lineWidth:(l!==void 0?l:Au)*this.pixelRatio_,miterLimit:c!==void 0?c:Cu,strokeStyle:Is(i||Tu)}}}setImageStyle(e){let n;if(!e||!(n=e.getSize())){this.image_=null;return}const i=e.getPixelRatio(this.pixelRatio_),s=e.getAnchor(),r=e.getOrigin();this.image_=e.getImage(this.pixelRatio_),this.imageAnchorX_=s[0]*i,this.imageAnchorY_=s[1]*i,this.imageHeight_=n[1]*i,this.imageOpacity_=e.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=e.getRotateWithView(),this.imageRotation_=e.getRotation();const o=e.getScaleArray();this.imageScale_=[o[0]*this.pixelRatio_/i,o[1]*this.pixelRatio_/i],this.imageWidth_=n[0]*i}setTextStyle(e){if(!e)this.text_="";else{const n=e.getFill();if(!n)this.textFillState_=null;else{const f=n.getColor();this.textFillState_={fillStyle:Is(f||ui)}}const i=e.getStroke();if(!i)this.textStrokeState_=null;else{const f=i.getColor(),p=i.getLineCap(),m=i.getLineDash(),y=i.getLineDashOffset(),v=i.getLineJoin(),b=i.getWidth(),E=i.getMiterLimit();this.textStrokeState_={lineCap:p!==void 0?p:Vl,lineDash:m||ur,lineDashOffset:y||dr,lineJoin:v!==void 0?v:zl,lineWidth:b!==void 0?b:Au,miterLimit:E!==void 0?E:Cu,strokeStyle:Is(f||Tu)}}const s=e.getFont(),r=e.getOffsetX(),o=e.getOffsetY(),a=e.getRotateWithView(),l=e.getRotation(),c=e.getScaleArray(),u=e.getText(),d=e.getTextAlign(),h=e.getTextBaseline();this.textState_={font:s!==void 0?s:Ek,textAlign:d!==void 0?d:ku,textBaseline:h!==void 0?h:Fh},this.text_=u!==void 0?Array.isArray(u)?u.reduce((f,p,m)=>f+=m%2?" ":p,""):u:"",this.textOffsetX_=r!==void 0?this.pixelRatio_*r:0,this.textOffsetY_=o!==void 0?this.pixelRatio_*o:0,this.textRotateWithView_=a!==void 0?a:!1,this.textRotation_=l!==void 0?l:0,this.textScale_=[this.pixelRatio_*c[0],this.pixelRatio_*c[1]]}}}const uoe=coe,Cs=.5;function doe(t,e,n,i,s,r,o,a,l){const c=l?Ty(s):s,u=t[0]*Cs,d=t[1]*Cs,h=an(u,d);h.imageSmoothingEnabled=!1;const f=h.canvas,p=new uoe(h,Cs,s,null,o,a,l?Yf(mne(),l):null),m=n.length,y=Math.floor((256*256*256-1)/m),v={};for(let E=1;E<=m;++E){const C=n[E-1],w=C.getStyleFunction()||i;if(!w)continue;let x=w(C,r);if(!x)continue;Array.isArray(x)||(x=[x]);const k=(E*y).toString(16).padStart(7,"#00000");for(let A=0,P=x.length;A0;return d&&Promise.all(l).then(()=>s(null)),moe(t,e,n,i,r,o,a),d}function moe(t,e,n,i,s,r,o){const a=n.getGeometryFunction()(e);if(!a)return;const l=a.simplifyTransformed(i,s);if(n.getRenderer())iA(t,l,n,e,o);else{const u=tA[l.getType()];u(t,l,n,e,o,r)}}function iA(t,e,n,i,s){if(e.getType()=="GeometryCollection"){const o=e.getGeometries();for(let a=0,l=o.length;a{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const i=this.frameState.size.slice(),s=this.renderedCenter_,r=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,l=this.wrappedRenderedExtent_,c=this.getLayer(),u=[],d=i[0]*Cs,h=i[1]*Cs;u.push(this.getRenderTransform(s,r,o,Cs,d,h,0).slice());const f=c.getSource(),p=a.getExtent();if(f.getWrapX()&&a.canWrapX()&&!Qa(p,l)){let m=l[0];const y=vt(p);let v=0,b;for(;mp[2];)++v,b=y*v,u.push(this.getRenderTransform(s,r,o,Cs,d,h,b).slice()),m-=y}this.hitDetectionImageData_=doe(i,u,this.renderedFeatures_,c.getStyleFunction(),l,r,o,ix(r,this.renderedPixelRatio_),null)}n(hoe(e,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(e,n,i,s,r){if(!this.replayGroup_)return;const o=n.viewState.resolution,a=n.viewState.rotation,l=this.getLayer(),c={},u=function(p,m,y){const v=wt(p),b=c[v];if(b){if(b!==!0&&yd=p.forEachFeatureAtCoordinate(e,o,a,i,u,f&&n.declutter[f]?n.declutter[f].all().map(m=>m.value):null)),d}handleFontsChanged(){const e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}prepareFrame(e){const n=this.getLayer(),i=n.getSource();if(!i)return!1;const s=e.viewHints[Vn.ANIMATING],r=e.viewHints[Vn.INTERACTING],o=n.getUpdateWhileAnimating(),a=n.getUpdateWhileInteracting();if(this.ready&&!o&&s||!a&&r)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const l=e.extent,c=e.viewState,u=c.projection,d=c.resolution,h=e.pixelRatio,f=n.getRevision(),p=n.getRenderBuffer();let m=n.getRenderOrder();m===void 0&&(m=goe);const y=c.center.slice(),v=vy(l,p*d),b=v.slice(),E=[v.slice()],C=u.getExtent();if(i.getWrapX()&&u.canWrapX()&&!Qa(C,e.extent)){const N=vt(C),L=Math.max(vt(v)/2,N);v[0]=C[0]-L,v[2]=C[2]+L,ek(y,u);const I=QT(E[0],u);I[0]C[0]&&I[2]>C[2]&&E.push([I[0]-N,I[1],I[2]-N,I[3]])}if(this.ready&&this.renderedResolution_==d&&this.renderedRevision_==f&&this.renderedRenderOrder_==m&&this.renderedFrameDeclutter_===!!e.declutter&&Qa(this.wrappedRenderedExtent_,v))return xo(this.renderedExtent_,b)||(this.hitDetectionImageData_=null,this.renderedExtent_=b),this.renderedCenter_=y,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const w=new noe(nA(d,h),v,d,h);let x;for(let N=0,L=E.length;N{let I;const W=N.getStyleFunction()||n.getStyleFunction();if(W&&(I=W(N,d)),I){const X=this.renderFeature(N,T,I,w,x,this.getLayer().getDeclutter(),L);k=k&&!X}},P=Ty(v),F=i.getFeaturesInExtent(P);m&&F.sort(m);for(let N=0,L=F.length;N{if(e===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),n&&this.simplifiedGeometry_.applyTransform(n);const i=this.simplifiedGeometry_.getFlatCoordinates();let s;switch(this.type_){case"LineString":i.length=Kf(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,e,i,0),s=[i.length];break;case"MultiLineString":s=[],i.length=Nne(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,e,i,0,s);break;case"Polygon":s=[],i.length=lk(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(e),i,0,s);break}return s&&(this.simplifiedGeometry_=new is(this.type_,i,s,2,this.properties_,this.id_)),this.squaredTolerance_=e,this.simplifiedGeometry_}),this}}is.prototype.getFlatCoordinates=is.prototype.getOrientedFlatCoordinates;const Bi={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};function koe(t,e){return[[-1/0,-1/0,1/0,1/0]]}let Aoe=!1;function Moe(t,e,n,i,s,r,o){const a=new XMLHttpRequest;a.open("GET",typeof t=="function"?t(n,i,s):t,!0),e.getType()=="arraybuffer"&&(a.responseType="arraybuffer"),a.withCredentials=Aoe,a.onload=function(l){if(!a.status||a.status>=200&&a.status<300){const c=e.getType();try{let u;c=="text"||c=="json"?u=a.responseText:c=="xml"?u=a.responseXML||a.responseText:c=="arraybuffer"&&(u=a.response),u?r(e.readFeatures(u,{extent:n,featureProjection:s}),e.readProjection(u)):o()}catch{o()}}else o()},a.onerror=o,a.send()}function ax(t,e){return function(n,i,s,r,o){const a=this;Moe(t,e,n,i,s,function(l,c){a.addFeatures(l),r!==void 0&&r(l)},o||Ol)}}class Rr extends br{constructor(e,n,i){super(e),this.feature=n,this.features=i}}class Ioe extends Kk{constructor(e){e=e||{},super({attributions:e.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:e.wrapX!==void 0?e.wrapX:!0}),this.on,this.once,this.un,this.loader_=Ol,this.format_=e.format||null,this.overlaps_=e.overlaps===void 0?!0:e.overlaps,this.url_=e.url,e.loader!==void 0?this.loader_=e.loader:this.url_!==void 0&&(mt(this.format_,"`format` must be set when `url` is set"),this.loader_=ax(this.url_,this.format_)),this.strategy_=e.strategy!==void 0?e.strategy:koe;const n=e.useSpatialIndex!==void 0?e.useSpatialIndex:!0;this.featuresRtree_=n?new rx:null,this.loadedExtentsRtree_=new rx,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let i,s;Array.isArray(e.features)?s=e.features:e.features&&(i=e.features,s=i.getArray()),!n&&i===void 0&&(i=new As(s)),s!==void 0&&this.addFeaturesInternal(s),i!==void 0&&this.bindFeaturesCollection_(i)}addFeature(e){this.addFeatureInternal(e),this.changed()}addFeatureInternal(e){const n=wt(e);if(!this.addToIndex_(n,e)){this.featuresCollection_&&this.featuresCollection_.remove(e);return}this.setupChangeEvents_(n,e);const i=e.getGeometry();if(i){const s=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(s,e)}else this.nullGeometryFeatures_[n]=e;this.dispatchEvent(new Rr(Bi.ADDFEATURE,e))}setupChangeEvents_(e,n){n instanceof is||(this.featureChangeKeys_[e]=[ft(n,et.CHANGE,this.handleFeatureChange_,this),ft(n,Ll.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(e,n){let i=!0;if(n.getId()!==void 0){const s=String(n.getId());if(!(s in this.idIndex_))this.idIndex_[s]=n;else if(n instanceof is){const r=this.idIndex_[s];r instanceof is?Array.isArray(r)?r.push(n):this.idIndex_[s]=[r,n]:i=!1}else i=!1}return i&&(mt(!(e in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[e]=n),i}addFeatures(e){this.addFeaturesInternal(e),this.changed()}addFeaturesInternal(e){const n=[],i=[],s=[];for(let r=0,o=e.length;r{n||(n=!0,this.addFeature(i.element),n=!1)}),e.addEventListener(ci.REMOVE,i=>{n||(n=!0,this.removeFeature(i.element),n=!1)}),this.featuresCollection_=e}clear(e){if(e){for(const i in this.featureChangeKeys_)this.featureChangeKeys_[i].forEach(Dt);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){const i=s=>{this.removeFeatureInternal(s)};this.featuresRtree_.forEach(i);for(const s in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[s])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const n=new Rr(Bi.CLEAR);this.dispatchEvent(n),this.changed()}forEachFeature(e){if(this.featuresRtree_)return this.featuresRtree_.forEach(e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureAtCoordinateDirect(e,n){const i=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(i,function(s){const r=s.getGeometry();if(r instanceof is||r.intersectsCoordinate(e))return n(s)})}forEachFeatureInExtent(e,n){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(e,n);this.featuresCollection_&&this.featuresCollection_.forEach(n)}forEachFeatureIntersectingExtent(e,n){return this.forEachFeatureInExtent(e,function(i){const s=i.getGeometry();if(s instanceof is||s.intersectsExtent(e)){const r=n(i);if(r)return r}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let e;return this.featuresCollection_?e=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(e=this.featuresRtree_.getAll(),Nl(this.nullGeometryFeatures_)||Of(e,Object.values(this.nullGeometryFeatures_))),e}getFeaturesAtCoordinate(e){const n=[];return this.forEachFeatureAtCoordinateDirect(e,function(i){n.push(i)}),n}getFeaturesInExtent(e,n){if(this.featuresRtree_){if(!(n&&n.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(e);const s=xy(e,n);return[].concat(...s.map(r=>this.featuresRtree_.getInExtent(r)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(e,n){const i=e[0],s=e[1];let r=null;const o=[NaN,NaN];let a=1/0;const l=[-1/0,-1/0,1/0,1/0];return n=n||mu,this.featuresRtree_.forEachInExtent(l,function(c){if(n(c)){const u=c.getGeometry(),d=a;if(a=u instanceof is?0:u.closestPointXY(i,s,o,a),a{--this.loadingExtentsCount_,this.dispatchEvent(new Rr(Bi.FEATURESLOADEND,void 0,u))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new Rr(Bi.FEATURESLOADERROR))}),s.insert(l,{extent:l.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(e){const n=this.loadedExtentsRtree_;let i;n.forEachInExtent(e,function(s){if(yu(s.extent,e))return i=s,!0}),i&&n.remove(i)}removeFeatures(e){let n=!1;for(let i=0,s=e.length;ie.geo&&e.geo.lat&&e.geo.lon);return t?[t.geo.lon,t.geo.lat]:[0,0]}return[this.d.geo.lon,this.d.geo.lat]}},async mounted(){await fetch("https://tile.openstreetmap.org/",{signal:AbortSignal.timeout(1500)}).then(t=>{const e=new nre({target:"map",layers:[new Yre({source:new Ire})],view:new Ss({center:lp(this.getLastLonLat()),zoom:this.type==="traceroute"?3:10})}),n=[],i=new Ioe;if(this.type==="traceroute")console.log(this.getLastLonLat()),this.d.forEach(a=>{if(a.geo&&a.geo.lat&&a.geo.lon){const l=lp([a.geo.lon,a.geo.lat]);n.push(l);const c=this.getLastLonLat();console.log(a.geo.lon,a.geo.lat),console.log(a.geo.lon===c[0]&&a.geo.lat===c[1]);const u=new Tp({geometry:new wu(l),last:a.geo.lon===c[0]&&a.geo.lat===c[1]});i.addFeature(u)}});else{const a=lp([this.d.geo.lon,this.d.geo.lat]);n.push(a);const l=new Tp({geometry:new wu(a)});i.addFeature(l)}const s=new Kh(n),r=new Tp({geometry:s});i.addFeature(r);const o=new Coe({source:i,style:function(a){if(a.getGeometry().getType()==="Point")return new ul({image:new Yy({radius:10,fill:new Zf({color:a.get("last")?"#dc3545":"#0d6efd"}),stroke:new Vh({color:"white",width:5})})});if(a.getGeometry().getType()==="LineString")return new ul({stroke:new Vh({color:"#0d6efd",width:2})})}});e.addLayer(o),this.store.Configuration.Server.dashboard_theme==="dark"&&e.on("postcompose",function(a){document.querySelector("#map").style.filter="grayscale(80%) invert(100%) "})}).catch(t=>{this.osmAvailable=!1})}},Roe={key:0,id:"map",class:"w-100 rounded-3"};function Doe(t,e,n,i,s,r){return this.osmAvailable?(D(),V("div",Roe)):ce("",!0)}const sA=He(Poe,[["render",Doe]]),$oe={name:"ping",components:{OSMap:sA,LocaleText:Qe},data(){return{loading:!1,cips:{},selectedConfiguration:void 0,selectedPeer:void 0,selectedIp:void 0,count:4,pingResult:void 0,pinging:!1}},setup(){return{store:nt()}},mounted(){Vt("/api/ping/getAllPeersIpAddress",{},t=>{t.status&&(this.loading=!0,this.cips=t.data,console.log(this.cips))})},methods:{execute(){this.selectedIp&&(this.pinging=!0,this.pingResult=void 0,Vt("/api/ping/execute",{ipAddress:this.selectedIp,count:this.count},t=>{t.status?this.pingResult=t.data:this.store.newMessage("Server",t.message,"danger"),this.pinging=!1}))}},watch:{selectedConfiguration(){this.selectedPeer=void 0,this.selectedIp=void 0},selectedPeer(){this.selectedIp=void 0}}},bi=t=>(bn("data-v-f5cd36ce"),t=t(),wn(),t),Loe={class:"mt-md-5 mt-3 text-body"},Ooe={class:"container"},Noe=bi(()=>g("h3",{class:"mb-3 text-body"},"Ping",-1)),Foe={class:"row"},Boe={class:"col-sm-4 d-flex gap-2 flex-column"},Voe={class:"mb-1 text-muted",for:"configuration"},zoe=["disabled"],Woe=bi(()=>g("option",{disabled:"",selected:"",value:void 0},null,-1)),Hoe=["value"],Yoe={class:"mb-1 text-muted",for:"peer"},joe=["disabled"],Koe=bi(()=>g("option",{disabled:"",selected:"",value:void 0},null,-1)),Uoe=["value"],Goe={class:"mb-1 text-muted",for:"ip"},Xoe=["disabled"],qoe=bi(()=>g("option",{disabled:"",selected:"",value:void 0},null,-1)),Zoe={class:"d-flex align-items-center gap-2"},Joe=bi(()=>g("div",{class:"flex-grow-1 border-top"},null,-1)),Qoe={class:"text-muted"},eae=bi(()=>g("div",{class:"flex-grow-1 border-top"},null,-1)),tae={class:"mb-1 text-muted",for:"ipAddress"},nae=["disabled"],iae=bi(()=>g("div",{class:"w-100 border-top my-2"},null,-1)),sae={class:"mb-1 text-muted",for:"count"},rae={class:"d-flex gap-3 align-items-center"},oae=["disabled"],aae=bi(()=>g("i",{class:"bi bi-dash-lg"},null,-1)),lae=[aae],cae=bi(()=>g("i",{class:"bi bi-plus-lg"},null,-1)),uae=[cae],dae=["disabled"],hae={key:0,class:"d-block"},fae=bi(()=>g("i",{class:"bi bi-person-walking me-2"},null,-1)),gae={key:1,class:"d-block"},pae=bi(()=>g("span",{class:"spinner-border spinner-border-sm","aria-hidden":"true"},null,-1)),mae=bi(()=>g("span",{class:"visually-hidden",role:"status"},"Loading...",-1)),_ae=[pae,mae],yae={class:"col-sm-8 position-relative"},vae={key:"pingPlaceholder"},bae=bi(()=>g("div",{class:"pingPlaceholder bg-body-secondary rounded-3 mb-3",style:{height:"300px"}},null,-1)),wae={key:"pingResult",class:"d-flex flex-column gap-2 w-100"},xae={class:"card rounded-3 bg-transparent shadow-sm animate__animated animate__fadeIn",style:{"animation-delay":"0.15s"}},Eae={class:"card-body row"},Sae={class:"col-sm"},Cae={class:"mb-0 text-muted"},Tae={key:0,class:"col-sm"},kae={class:"mb-0 text-muted"},Aae={class:"card rounded-3 bg-transparent shadow-sm animate__animated animate__fadeIn",style:{"animation-delay":"0.3s"}},Mae={class:"card-body"},Iae=bi(()=>g("p",{class:"mb-0 text-muted"},[g("small",null,"Is Alive")],-1)),Pae={class:"card rounded-3 bg-transparent shadow-sm animate__animated animate__fadeIn",style:{"animation-delay":"0.45s"}},Rae={class:"card-body"},Dae={class:"mb-0 text-muted"},$ae={class:"card rounded-3 bg-transparent shadow-sm animate__animated animate__fadeIn",style:{"animation-delay":"0.6s"}},Lae={class:"card-body"},Oae={class:"mb-0 text-muted"};function Nae(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("OSMap");return D(),V("div",Loe,[g("div",Ooe,[Noe,g("div",Foe,[g("div",Boe,[g("div",null,[g("label",Voe,[g("small",null,[B(o,{t:"Configuration"})])]),Oe(g("select",{class:"form-select","onUpdate:modelValue":e[0]||(e[0]=l=>this.selectedConfiguration=l),disabled:this.pinging},[Woe,(D(!0),V($e,null,Xe(this.cips,(l,c)=>(D(),V("option",{value:c},xe(c),9,Hoe))),256))],8,zoe),[[ih,this.selectedConfiguration]])]),g("div",null,[g("label",Yoe,[g("small",null,[B(o,{t:"Peer"})])]),Oe(g("select",{id:"peer",class:"form-select","onUpdate:modelValue":e[1]||(e[1]=l=>this.selectedPeer=l),disabled:this.selectedConfiguration===void 0||this.pinging},[Koe,this.selectedConfiguration!==void 0?(D(!0),V($e,{key:0},Xe(this.cips[this.selectedConfiguration],(l,c)=>(D(),V("option",{value:c},xe(c),9,Uoe))),256)):ce("",!0)],8,joe),[[ih,this.selectedPeer]])]),g("div",null,[g("label",Goe,[g("small",null,[B(o,{t:"IP Address"})])]),Oe(g("select",{id:"ip",class:"form-select","onUpdate:modelValue":e[2]||(e[2]=l=>this.selectedIp=l),disabled:this.selectedPeer===void 0||this.pinging},[qoe,this.selectedPeer!==void 0?(D(!0),V($e,{key:0},Xe(this.cips[this.selectedConfiguration][this.selectedPeer].allowed_ips,l=>(D(),V("option",null,xe(l),1))),256)):ce("",!0)],8,Xoe),[[ih,this.selectedIp]])]),g("div",Zoe,[Joe,g("small",Qoe,[B(o,{t:"OR"})]),eae]),g("div",null,[g("label",tae,[g("small",null,[B(o,{t:"Enter IP Address / Hostname"})])]),Oe(g("input",{class:"form-control",type:"text",id:"ipAddress",disabled:this.pinging,"onUpdate:modelValue":e[3]||(e[3]=l=>this.selectedIp=l)},null,8,nae),[[Ke,this.selectedIp]])]),iae,g("div",null,[g("label",sae,[g("small",null,[B(o,{t:"Count"})])]),g("div",rae,[g("button",{onClick:e[4]||(e[4]=l=>this.count--),disabled:this.count===1,class:"btn btn-sm bg-secondary-subtle text-secondary-emphasis"},lae,8,oae),g("strong",null,xe(this.count),1),g("button",{role:"button",onClick:e[5]||(e[5]=l=>this.count++),class:"btn btn-sm bg-secondary-subtle text-secondary-emphasis"},uae)])]),g("button",{class:"btn btn-primary rounded-3 mt-3 position-relative",disabled:!this.selectedIp||this.pinging,onClick:e[6]||(e[6]=l=>this.execute())},[B(Rt,{name:"slide"},{default:Re(()=>[this.pinging?(D(),V("span",gae,_ae)):(D(),V("span",hae,[fae,Ye("Ping! ")]))]),_:1})],8,dae)]),g("div",yae,[B(Rt,{name:"ping"},{default:Re(()=>[this.pingResult?(D(),V("div",wae,[this.pingResult.geo&&this.pingResult.geo.status==="success"?(D(),Ce(a,{key:0,d:this.pingResult},null,8,["d"])):ce("",!0),g("div",xae,[g("div",Eae,[g("div",Sae,[g("p",Cae,[g("small",null,[B(o,{t:"IP Address"})])]),Ye(" "+xe(this.pingResult.address),1)]),this.pingResult.geo&&this.pingResult.geo.status==="success"?(D(),V("div",Tae,[g("p",kae,[g("small",null,[B(o,{t:"Geolocation"})])]),Ye(" "+xe(this.pingResult.geo.city)+", "+xe(this.pingResult.geo.country),1)])):ce("",!0)])]),g("div",Aae,[g("div",Mae,[Iae,g("span",{class:Me([this.pingResult.is_alive?"text-success":"text-danger"])},[g("i",{class:Me(["bi me-1",[this.pingResult.is_alive?"bi-check-circle-fill":"bi-x-circle-fill"]])},null,2),Ye(" "+xe(this.pingResult.is_alive?"Yes":"No"),1)],2)])]),g("div",Pae,[g("div",Rae,[g("p",Dae,[g("small",null,[B(o,{t:"Average / Min / Max Round Trip Time"})])]),g("samp",null,xe(this.pingResult.avg_rtt)+"ms / "+xe(this.pingResult.min_rtt)+"ms / "+xe(this.pingResult.max_rtt)+"ms ",1)])]),g("div",$ae,[g("div",Lae,[g("p",Oae,[g("small",null,[B(o,{t:"Sent / Received / Lost Package"})])]),g("samp",null,xe(this.pingResult.package_sent)+" / "+xe(this.pingResult.package_received)+" / "+xe(this.pingResult.package_loss),1)])])])):(D(),V("div",vae,[bae,(D(),V($e,null,Xe(4,l=>g("div",{class:Me(["pingPlaceholder bg-body-secondary rounded-3 mb-3",{"animate__animated animate__flash animate__slower animate__infinite":this.pinging}]),style:Mn({"animation-delay":`${l*.15}s`})},null,6)),64))]))]),_:1})])])])])}const Fae=He($oe,[["render",Nae],["__scopeId","data-v-f5cd36ce"]]),Bae={name:"traceroute",components:{LocaleText:Qe,OSMap:sA},data(){return{tracing:!1,ipAddress:void 0,tracerouteResult:void 0}},setup(){return{store:vi()}},methods:{execute(){this.ipAddress&&(this.tracing=!0,this.tracerouteResult=void 0,Vt("/api/traceroute/execute",{ipAddress:this.ipAddress},t=>{t.status?this.tracerouteResult=t.data:this.store.newMessage("Server",t.message,"danger"),this.tracing=!1}))}}},Jl=t=>(bn("data-v-d80ce3c9"),t=t(),wn(),t),Vae={class:"mt-md-5 mt-3 text-body"},zae={class:"container-md"},Wae=Jl(()=>g("h3",{class:"mb-3 text-body"},"Traceroute",-1)),Hae={class:"d-flex gap-2 flex-column mb-5"},Yae={class:"mb-1 text-muted",for:"ipAddress"},jae=["disabled"],Kae=["disabled"],Uae={key:0,class:"d-block"},Gae=Jl(()=>g("i",{class:"bi bi-person-walking me-2"},null,-1)),Xae={key:1,class:"d-block"},qae=Jl(()=>g("span",{class:"spinner-border spinner-border-sm","aria-hidden":"true"},null,-1)),Zae=Jl(()=>g("span",{class:"visually-hidden",role:"status"},"Loading...",-1)),Jae=[qae,Zae],Qae={class:"position-relative"},ele={key:"pingPlaceholder"},tle=Jl(()=>g("div",{class:"pingPlaceholder bg-body-secondary rounded-3 mb-3",style:{height:"300px !important"}},null,-1)),nle={key:1},ile={key:"table",class:"w-100 mt-2"},sle={class:"table table-sm rounded-3 w-100"},rle=Jl(()=>g("thead",null,[g("tr",null,[g("th",{scope:"col"},"Hop"),g("th",{scope:"col"},"IP Address"),g("th",{scope:"col"},"Average RTT (ms)"),g("th",{scope:"col"},"Min RTT (ms)"),g("th",{scope:"col"},"Max RTT (ms)"),g("th",{scope:"col"},"Geolocation")])],-1)),ole={key:0};function ale(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("OSMap");return D(),V("div",Vae,[g("div",zae,[Wae,g("div",Hae,[g("div",null,[g("label",Yae,[g("small",null,[B(o,{t:"Enter IP Address / Hostname"})])]),Oe(g("input",{disabled:this.tracing,id:"ipAddress",class:"form-control","onUpdate:modelValue":e[0]||(e[0]=l=>this.ipAddress=l),onKeyup:e[1]||(e[1]=eS(l=>this.execute(),["enter"])),type:"text"},null,40,jae),[[Ke,this.ipAddress]])]),g("button",{class:"btn btn-primary rounded-3 mt-3 position-relative",disabled:this.tracing||!this.ipAddress,onClick:e[2]||(e[2]=l=>this.execute())},[B(Rt,{name:"slide"},{default:Re(()=>[this.tracing?(D(),V("span",Xae,Jae)):(D(),V("span",Uae,[Gae,Ye("Trace! ")]))]),_:1})],8,Kae)]),g("div",Qae,[B(Rt,{name:"ping"},{default:Re(()=>[this.tracerouteResult?(D(),V("div",nle,[B(a,{d:this.tracerouteResult,type:"traceroute"},null,8,["d"]),g("div",ile,[g("table",sle,[rle,g("tbody",null,[(D(!0),V($e,null,Xe(this.tracerouteResult,(l,c)=>(D(),V("tr",null,[g("td",null,[g("small",null,xe(l.hop),1)]),g("td",null,[g("small",null,xe(l.ip),1)]),g("td",null,[g("small",null,xe(l.avg_rtt),1)]),g("td",null,[g("small",null,xe(l.min_rtt),1)]),g("td",null,[g("small",null,xe(l.max_rtt),1)]),g("td",null,[l.geo.city&&l.geo.country?(D(),V("span",ole,[g("small",null,xe(l.geo.city)+", "+xe(l.geo.country),1)])):ce("",!0)])]))),256))])])])])):(D(),V("div",ele,[tle,(D(),V($e,null,Xe(5,l=>g("div",{class:Me(["pingPlaceholder bg-body-secondary rounded-3 mb-3",{"animate__animated animate__flash animate__slower animate__infinite":this.tracing}]),style:Mn({"animation-delay":`${l*.05}s`})},null,6)),64))]))]),_:1})])])])}const lle=He(Bae,[["render",ale],["__scopeId","data-v-d80ce3c9"]]),cle={name:"totp",components:{LocaleText:Qe},async setup(){const t=nt();let e="";return await Vt("/api/Welcome_GetTotpLink",{},n=>{n.status&&(e=n.data)}),{l:e,store:t}},mounted(){this.l&&va.toCanvas(document.getElementById("qrcode"),this.l,function(t){})},data(){return{totp:"",totpInvalidMessage:"",verified:!1}},methods:{validateTotp(){}},watch:{totp(t){const e=document.querySelector("#totp");e.classList.remove("is-invalid","is-valid"),t.length===6&&(console.log(t),/[0-9]{6}/.test(t)?kt("/api/Welcome_VerifyTotpLink",{totp:t},n=>{n.status?(this.verified=!0,e.classList.add("is-valid"),this.$emit("verified")):(e.classList.add("is-invalid"),this.totpInvalidMessage="TOTP does not match.")}):(e.classList.add("is-invalid"),this.totpInvalidMessage="TOTP can only contain numbers"))}}},ule=["data-bs-theme"],dle={class:"m-auto text-body",style:{width:"500px"}},hle={class:"d-flex flex-column"},fle={class:"dashboardLogo display-4"},gle={class:"mb-2"},ple={class:"text-muted"},mle=g("canvas",{id:"qrcode",class:"rounded-3 mb-2"},null,-1),_le={class:"p-3 bg-body-secondary rounded-3 border mb-3"},yle={class:"text-muted mb-0"},vle=["href"],ble={style:{"line-break":"anywhere"}},wle={for:"totp",class:"mb-2"},xle={class:"text-muted"},Ele={class:"form-group mb-2"},Sle=["disabled"],Cle={class:"invalid-feedback"},Tle={class:"valid-feedback"},kle=g("hr",null,null,-1),Ale={class:"d-flex gap-3 mt-5 flex-column"},Mle=g("i",{class:"bi bi-chevron-right ms-auto"},null,-1),Ile=g("i",{class:"bi bi-chevron-right ms-auto"},null,-1);function Ple(t,e,n,i,s,r){const o=Se("LocaleText"),a=Se("RouterLink");return D(),V("div",{class:"container-fluid login-container-fluid d-flex main pt-5 overflow-scroll","data-bs-theme":this.store.Configuration.Server.dashboard_theme},[g("div",dle,[g("div",hle,[g("div",null,[g("h1",fle,[B(o,{t:"Multi-Factor Authentication (MFA)"})]),g("p",gle,[g("small",ple,[B(o,{t:"1. Please scan the following QR Code to generate TOTP with your choice of authenticator"})])]),mle,g("div",_le,[g("p",yle,[g("small",null,[B(o,{t:"Or you can click the link below:"})])]),g("a",{href:this.l},[g("code",ble,xe(this.l),1)],8,vle)]),g("label",wle,[g("small",xle,[B(o,{t:"2. Enter the TOTP generated by your authenticator to verify"})])]),g("div",Ele,[Oe(g("input",{class:"form-control text-center totp",id:"totp",maxlength:"6",type:"text",inputmode:"numeric",autocomplete:"one-time-code","onUpdate:modelValue":e[0]||(e[0]=l=>this.totp=l),disabled:this.verified},null,8,Sle),[[Ke,this.totp]]),g("div",Cle,[B(o,{t:this.totpInvalidMessage},null,8,["t"])]),g("div",Tle,[B(o,{t:"TOTP verified!"})])])]),kle,g("div",Ale,[this.verified?(D(),Ce(a,{key:1,to:"/",class:"btn btn-dark btn-lg d-flex btn-brand shadow align-items-center flex-grow-1 rounded-3"},{default:Re(()=>[B(o,{t:"Complete"}),Ile]),_:1})):(D(),Ce(a,{key:0,to:"/",class:"btn bg-secondary-subtle text-secondary-emphasis rounded-3 flex-grow-1 btn-lg border-1 border-secondary-subtle shadow d-flex"},{default:Re(()=>[B(o,{t:"I don't need MFA"}),Mle]),_:1}))])])])],8,ule)}const Rle=He(cle,[["render",Ple]]),Dle={name:"share",components:{LocaleText:Qe},async setup(){const t=iL(),e=we(!1),n=nt(),i=we(""),s=we(void 0),r=we(new Blob);await Vt("/api/getDashboardTheme",{},a=>{i.value=a.data});const o=t.query.ShareID;return o===void 0||o.length===0?(s.value=void 0,e.value=!0):await Vt("/api/sharePeer/get",{ShareID:o},a=>{a.status?(s.value=a.data,r.value=new Blob([s.value.file],{type:"text/plain"})):s.value=void 0,e.value=!0}),{store:n,theme:i,peerConfiguration:s,blob:r}},mounted(){this.peerConfiguration&&va.toCanvas(document.querySelector("#qrcode"),this.peerConfiguration.file,t=>{t&&console.error(t)})},methods:{download(){const t=new Blob([this.peerConfiguration.file],{type:"text/plain"}),e=URL.createObjectURL(t),n=`${this.peerConfiguration.fileName}.conf`,i=document.createElement("a");i.href=e,i.download=n,i.click()}},computed:{getBlob(){return URL.createObjectURL(this.blob)}}},ng=t=>(bn("data-v-1b44aacd"),t=t(),wn(),t),$le=["data-bs-theme"],Lle={class:"m-auto text-body",style:{width:"500px"}},Ole={key:0,class:"text-center position-relative",style:{}},Nle=ng(()=>g("div",{class:"animate__animated animate__fadeInUp"},[g("h1",{style:{"font-size":"20rem",filter:"blur(1rem)","animation-duration":"7s"},class:"animate__animated animate__flash animate__infinite"},[g("i",{class:"bi bi-file-binary"})])],-1)),Fle={class:"position-absolute w-100 h-100 top-0 start-0 d-flex animate__animated animate__fadeInUp",style:{"animation-delay":"0.1s"}},Ble={class:"m-auto"},Vle={key:1,class:"d-flex align-items-center flex-column gap-3"},zle={class:"h1 dashboardLogo text-center animate__animated animate__fadeInUp"},Wle=ng(()=>g("h6",null,"WGDashboard",-1)),Hle={id:"qrcode",class:"rounded-3 shadow animate__animated animate__fadeInUp mb-3",ref:"qrcode"},Yle={class:"text-muted animate__animated animate__fadeInUp mb-1",style:{"animation-delay":"0.2s"}},jle=ng(()=>g("samp",null,".conf",-1)),Kle=["download","href"],Ule=ng(()=>g("i",{class:"bi bi-download"},null,-1)),Gle=[Ule];function Xle(t,e,n,i,s,r){const o=Se("LocaleText");return D(),V("div",{class:"container-fluid login-container-fluid d-flex main pt-5 overflow-scroll","data-bs-theme":this.theme},[g("div",Lle,[this.peerConfiguration?(D(),V("div",Vle,[g("div",zle,[Wle,B(o,{t:"Scan QR Code with the WireGuard App to add peer"})]),g("canvas",Hle,null,512),g("p",Yle,[B(o,{t:"or click the button below to download the "}),jle,B(o,{t:" file"})]),g("a",{download:this.peerConfiguration.fileName+".conf",href:r.getBlob,class:"btn btn-lg bg-primary-subtle text-primary-emphasis border-1 border-primary-subtle animate__animated animate__fadeInUp shadow-sm",style:{"animation-delay":"0.25s"}},Gle,8,Kle)])):(D(),V("div",Ole,[Nle,g("div",Fle,[g("h3",Ble,[B(o,{t:"Oh no... This link is either expired or invalid."})])])]))])],8,$le)}const qle=He(Dle,[["render",Xle],["__scopeId","data-v-1b44aacd"]]),Zle=async()=>{let t=!1;return await Vt("/api/validateAuthentication",{},e=>{t=e.status}),t},Ju=tL({history:y$(),routes:[{name:"Index",path:"/",component:tO,meta:{requiresAuth:!0},children:[{name:"Configuration List",path:"",component:qN,meta:{title:"WireGuard Configurations"}},{name:"Settings",path:"/settings",component:Pz,meta:{title:"Settings"}},{path:"/ping",name:"Ping",component:Fae},{path:"/traceroute",name:"Traceroute",component:lle},{name:"New Configuration",path:"/new_configuration",component:g8,meta:{title:"New Configuration"}},{name:"Configuration",path:"/configuration/:id",component:y8,meta:{title:"Configuration"},children:[{name:"Peers List",path:"peers",component:Nte},{name:"Peers Create",path:"create",component:WT}]}]},{path:"/signin",component:fN,meta:{title:"Sign In"}},{path:"/welcome",component:Jz,meta:{requiresAuth:!0,title:"Welcome to WGDashboard"}},{path:"/2FASetup",component:Rle,meta:{requiresAuth:!0,title:"Multi-Factor Authentication Setup"}},{path:"/share",component:qle,meta:{title:"Share"}}]});Ju.beforeEach(async(t,e,n)=>{const i=vi(),s=nt();t.meta.title?t.params.id?document.title=t.params.id+" | WGDashboard":document.title=t.meta.title+" | WGDashboard":document.title="WGDashboard",s.ShowNavBar=!1,t.meta.requiresAuth?s.getActiveCrossServer()?(await s.getConfiguration(),!i.Configurations&&t.name!=="Configuration List"&&await i.getConfigurations(),n()):sL.getCookie("authToken")&&await Zle()?(await s.getConfiguration(),!i.Configurations&&t.name!=="Configuration List"&&await i.getConfigurations(),s.Redirect=void 0,n()):(s.Redirect=t,n("/signin"),s.newMessage("WGDashboard","Sign in session ended, please sign in again","warning")):n()});const rA=()=>{let t={"content-type":"application/json"};const n=nt().getActiveCrossServer();return n&&(t["wg-dashboard-apikey"]=n.apiKey),t},oA=t=>{const n=nt().getActiveCrossServer();return n?`${n.host}${t}`:`${window.location.protocol}//${(window.location.host+window.location.pathname+t).replace(/\/\//g,"/")}`},Vt=async(t,e=void 0,n=void 0)=>{const i=new URLSearchParams(e);await fetch(`${oA(t)}?${i.toString()}`,{headers:rA()}).then(s=>{const r=nt();if(s.ok)return s.json();if(s.status!==200)throw s.status===401&&r.newMessage("WGDashboard","Sign in session ended, please sign in again","warning"),new Error(s.statusText)}).then(s=>n?n(s):void 0).catch(s=>{console.log(s),Ju.push({path:"/signin"})})},kt=async(t,e,n)=>{await fetch(`${oA(t)}`,{headers:rA(),method:"POST",body:JSON.stringify(e)}).then(i=>{const s=nt();if(i.ok)return i.json();if(i.status!==200)throw i.status===401&&s.newMessage("WGDashboard","Sign in session ended, please sign in again","warning"),new Error(i.statusText)}).then(i=>n?n(i):void 0).catch(i=>{console.log(i),Ju.push({path:"/signin"})})},nt=x_("DashboardConfigurationStore",{state:()=>({Redirect:void 0,Configuration:void 0,Messages:[],Peers:{Selecting:!1,RefreshInterval:void 0},CrossServerConfiguration:{Enable:!1,ServerList:{}},ActiveServerConfiguration:void 0,IsElectronApp:!1,ShowNavBar:!1,Locale:void 0}),actions:{initCrossServerConfiguration(){const t=localStorage.getItem("CrossServerConfiguration");localStorage.getItem("ActiveCrossServerConfiguration")!==null&&(this.ActiveServerConfiguration=localStorage.getItem("ActiveCrossServerConfiguration")),t===null?window.localStorage.setItem("CrossServerConfiguration",JSON.stringify(this.CrossServerConfiguration)):this.CrossServerConfiguration=JSON.parse(t)},syncCrossServerConfiguration(){window.localStorage.setItem("CrossServerConfiguration",JSON.stringify(this.CrossServerConfiguration))},addCrossServerConfiguration(){this.CrossServerConfiguration.ServerList[Os().toString()]={host:"",apiKey:"",active:!1}},deleteCrossServerConfiguration(t){delete this.CrossServerConfiguration.ServerList[t]},getActiveCrossServer(){const t=localStorage.getItem("ActiveCrossServerConfiguration");if(t!==null)return this.CrossServerConfiguration.ServerList[t]},setActiveCrossServer(t){this.ActiveServerConfiguration=t,localStorage.setItem("ActiveCrossServerConfiguration",t)},removeActiveCrossServer(){this.ActiveServerConfiguration=void 0,localStorage.removeItem("ActiveCrossServerConfiguration")},async getConfiguration(){await Vt("/api/getDashboardConfiguration",{},t=>{t.status&&(this.Configuration=t.data)})},async signOut(){await Vt("/api/signout",{},t=>{this.removeActiveCrossServer(),this.$router.go("/signin")})},newMessage(t,e,n){this.Messages.push({id:Os(),from:Tt(t),content:Tt(e),type:n,show:!0})},applyLocale(t){if(this.Locale===null)return t;const n=Object.keys(this.Locale).filter(i=>t.match(new RegExp("^"+i+"$","g"))!==null);return console.log(n),n.length===0||n.length>1?t:this.Locale[n[0]]}}}),s0=t=>(bn("data-v-822f113b"),t=t(),wn(),t),Jle={class:"navbar bg-dark sticky-top","data-bs-theme":"dark"},Qle={class:"container-fluid d-flex text-body align-items-center"},ece=s0(()=>g("span",{class:"navbar-brand mb-0 h1"},"WGDashboard",-1)),tce={key:0,class:"ms-auto text-muted"},nce=s0(()=>g("i",{class:"bi bi-server me-2"},null,-1)),ice=s0(()=>g("i",{class:"bi bi-list"},null,-1)),sce=[ice],rce={__name:"App",setup(t){const e=nt();e.initCrossServerConfiguration(),window.IS_WGDASHBOARD_DESKTOP&&(e.IsElectronApp=!0,e.CrossServerConfiguration.Enable=!0),fn(e.CrossServerConfiguration,()=>{e.syncCrossServerConfiguration()},{deep:!0});const n=be(()=>{if(e.ActiveServerConfiguration)return e.CrossServerConfiguration.ServerList[e.ActiveServerConfiguration]});return(i,s)=>(D(),V($e,null,[g("nav",Jle,[g("div",Qle,[ece,n.value!==void 0?(D(),V("small",tce,[nce,Ye(xe(n.value.host),1)])):ce("",!0),g("a",{role:"button",class:"navbarBtn text-body",onClick:s[0]||(s[0]=r=>Q(e).ShowNavBar=!Q(e).ShowNavBar),style:{"line-height":"0","font-size":"2rem"}},sce)])]),(D(),Ce(f_,null,{default:Re(()=>[B(Q(mS),null,{default:Re(({Component:r})=>[B(Rt,{name:"app",mode:"out-in"},{default:Re(()=>[(D(),Ce(ga(r)))]),_:2},1024)]),_:1})]),_:1}))],64))}},oce=He(rce,[["__scopeId","data-v-822f113b"]]);let aA;await fetch("/api/locale").then(t=>t.json()).then(t=>aA=t.data);const r0=YD(oce);r0.use(Ju);const lA=GD();lA.use(({store:t})=>{t.$router=sf(Ju)});r0.use(lA);const ace=nt();ace.Locale=aA;r0.mount("#app"); diff --git a/src/static/app/src/components/settingsComponent/accountSettingsInputUsername.vue b/src/static/app/src/components/settingsComponent/accountSettingsInputUsername.vue index 63b7e92..bca37f0 100644 --- a/src/static/app/src/components/settingsComponent/accountSettingsInputUsername.vue +++ b/src/static/app/src/components/settingsComponent/accountSettingsInputUsername.vue @@ -31,7 +31,8 @@ export default { this.value = this.store.Configuration.Account[this.targetData]; }, methods:{ - async useValidation(){ + async useValidation(e){ + if (this.changed){ this.updating = true await fetchPost("/api/updateDashboardConfigurationItem", { diff --git a/src/static/app/src/components/settingsComponent/dashboardIPPortInput.vue b/src/static/app/src/components/settingsComponent/dashboardIPPortInput.vue new file mode 100644 index 0000000..0f91167 --- /dev/null +++ b/src/static/app/src/components/settingsComponent/dashboardIPPortInput.vue @@ -0,0 +1,116 @@ + + + + + \ No newline at end of file diff --git a/src/static/app/src/components/settingsComponent/dashboardLanguage.vue b/src/static/app/src/components/settingsComponent/dashboardLanguage.vue index ce7aff3..f721919 100644 --- a/src/static/app/src/components/settingsComponent/dashboardLanguage.vue +++ b/src/static/app/src/components/settingsComponent/dashboardLanguage.vue @@ -59,7 +59,7 @@ export default { -