/*!
 * BookiFlex Admin (Free Edition)
 * License: GPL-2.0-or-later
 * © 2026 BookiFlex
 *
 * Uses external libraries: Vue.js (MIT), Shoelace (MIT)
 * Uses WordPress-provided libraries: @wordpress/i18n (GPL-2.0-or-later)
 */
!function(e){"use strict";
/*!
  Turbo 8.0.23
  Copyright © 2026 37signals LLC
   */const t={eager:"eager",lazy:"lazy"};class o extends HTMLElement{static delegateConstructor=void 0;loaded=Promise.resolve();static get observedAttributes(){return["disabled","loading","src"]}constructor(){super(),this.delegate=new o.delegateConstructor(this)}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}reload(){return this.delegate.sourceURLReloaded()}attributeChangedCallback(e){"loading"==e?this.delegate.loadingStyleChanged():"src"==e?this.delegate.sourceURLChanged():"disabled"==e&&this.delegate.disabledChanged()}get src(){return this.getAttribute("src")}set src(e){e?this.setAttribute("src",e):this.removeAttribute("src")}get refresh(){return this.getAttribute("refresh")}set refresh(e){e?this.setAttribute("refresh",e):this.removeAttribute("refresh")}get shouldReloadWithMorph(){return this.src&&"morph"===this.refresh}get loading(){return function(e){if("lazy"===e.toLowerCase())return t.lazy;return t.eager}(this.getAttribute("loading")||"")}set loading(e){e?this.setAttribute("loading",e):this.removeAttribute("loading")}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get autoscroll(){return this.hasAttribute("autoscroll")}set autoscroll(e){e?this.setAttribute("autoscroll",""):this.removeAttribute("autoscroll")}get complete(){return!this.delegate.isLoading}get isActive(){return this.ownerDocument===document&&!this.isPreview}get isPreview(){return this.ownerDocument?.documentElement?.hasAttribute("data-turbo-preview")}}const i={enabled:!0,progressBarDelay:500,unvisitableExtensions:new Set([".7z",".aac",".apk",".avi",".bmp",".bz2",".css",".csv",".deb",".dmg",".doc",".docx",".exe",".gif",".gz",".heic",".heif",".ico",".iso",".jpeg",".jpg",".js",".json",".m4a",".mkv",".mov",".mp3",".mp4",".mpeg",".mpg",".msi",".ogg",".ogv",".pdf",".pkg",".png",".ppt",".pptx",".rar",".rtf",".svg",".tar",".tif",".tiff",".txt",".wav",".webm",".webp",".wma",".wmv",".xls",".xlsx",".xml",".zip"])};function n(e){if("false"==e.getAttribute("data-turbo-eval"))return e;{const t=document.createElement("script"),o=k();return o&&(t.nonce=o),t.textContent=e.textContent,t.async=!1,function(e,t){for(const{name:o,value:i}of t.attributes)e.setAttribute(o,i)}(t,e),t}}function r(e,{target:t,cancelable:o,detail:i}={}){const n=new CustomEvent(e,{cancelable:o,bubbles:!0,composed:!0,detail:i});return t&&t.isConnected?t.dispatchEvent(n):document.documentElement.dispatchEvent(n),n}function s(e){e.preventDefault(),e.stopImmediatePropagation()}function a(){return"hidden"===document.visibilityState?c():l()}function l(){return new Promise(e=>requestAnimationFrame(()=>e()))}function c(){return new Promise(e=>setTimeout(()=>e(),0))}function d(e=""){return(new DOMParser).parseFromString(e,"text/html")}function u(e,...t){const o=function(e,t){return e.reduce((e,o,i)=>e+o+(null==t[i]?"":t[i]),"")}(e,t).replace(/^\n/,"").split("\n"),i=o[0].match(/^\s+/),n=i?i[0].length:0;return o.map(e=>e.slice(n)).join("\n")}function h(){return Array.from({length:36}).map((e,t)=>8==t||13==t||18==t||23==t?"-":14==t?"4":19==t?(Math.floor(4*Math.random())+8).toString(16):Math.floor(16*Math.random()).toString(16)).join("")}function p(e,...t){for(const o of t.map(t=>t?.getAttribute(e)))if("string"==typeof o)return o;return null}function m(...e){for(const t of e)"turbo-frame"==t.localName&&t.setAttribute("busy",""),t.setAttribute("aria-busy","true")}function f(...e){for(const t of e)"turbo-frame"==t.localName&&t.removeAttribute("busy"),t.removeAttribute("aria-busy")}function g(e,t=2e3){return new Promise(o=>{const i=()=>{e.removeEventListener("error",i),e.removeEventListener("load",i),o()};e.addEventListener("load",i,{once:!0}),e.addEventListener("error",i,{once:!0}),setTimeout(o,t)})}function v(e){switch(e){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function b(...e){const t=p("data-turbo-action",...e);return function(e){return"advance"==e||"replace"==e||"restore"==e}(t)?t:null}function y(e){return document.querySelector(`meta[name="${e}"]`)}function w(e){const t=y(e);return t&&t.content}function k(){const e=y("csp-nonce");if(e){const{nonce:t,content:o}=e;return""==t?o:t}}function _(e,t){if(e instanceof Element)return e.closest(t)||_(e.assignedSlot||e.getRootNode()?.host,t)}function x(e){return!!e&&null==e.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])")&&"function"==typeof e.focus}function E(e){return Array.from(e.querySelectorAll("[autofocus]")).find(x)}function S(e){if("_blank"===e)return!1;if(e){for(const t of document.getElementsByName(e))if(t instanceof HTMLIFrameElement)return!1;return!0}return!0}function C(e){const t=_(e,"a[href], a[xlink\\:href]");if(!t)return null;if(t.href.startsWith("#"))return null;if(t.hasAttribute("download"))return null;const o=t.getAttribute("target");return o&&"_self"!==o?null:t}const A={"aria-disabled":{beforeSubmit:e=>{e.setAttribute("aria-disabled","true"),e.addEventListener("click",s)},afterSubmit:e=>{e.removeAttribute("aria-disabled"),e.removeEventListener("click",s)}},disabled:{beforeSubmit:e=>e.disabled=!0,afterSubmit:e=>e.disabled=!1}};const T=new class{#e=null;constructor(e){Object.assign(this,e)}get submitter(){return this.#e}set submitter(e){this.#e=A[e]||e}}({mode:"on",submitter:"disabled"}),N={drive:i,forms:T};function P(e){return new URL(e.toString(),document.baseURI)}function R(e){let t;return e.hash?e.hash.slice(1):(t=e.href.match(/#(.*)$/))?t[1]:void 0}function B(e,t){return P(t?.getAttribute("formaction")||e.getAttribute("action")||e.action)}function V(e){return(function(e){return function(e){return e.pathname.split("/").slice(1)}(e).slice(-1)[0]}(e).match(/\.[^.]*$/)||[])[0]||""}function D(e,t){return function(e,t){const o=M(t.origin+t.pathname);return M(e.href)===o||e.href.startsWith(o)}(e,t)&&!N.drive.unvisitableExtensions.has(V(e))}function L(e){return P(e.getAttribute("href")||"")}function $(e){return function(e){const t=R(e);return null!=t?e.href.slice(0,-(t.length+1)):e.href}(e)}function F(e,t){return P(e).href==P(t).href}function M(e){return e.endsWith("/")?e:e+"/"}class O{constructor(e){this.response=e}get succeeded(){return this.response.ok}get failed(){return!this.succeeded}get clientError(){return this.statusCode>=400&&this.statusCode<=499}get serverError(){return this.statusCode>=500&&this.statusCode<=599}get redirected(){return this.response.redirected}get location(){return P(this.response.url)}get isHTML(){return this.contentType&&this.contentType.match(/^(?:text\/([^\s;,]+\b)?html|application\/xhtml\+xml)\b/)}get statusCode(){return this.response.status}get contentType(){return this.header("Content-Type")}get responseText(){return this.response.clone().text()}get responseHTML(){return this.isHTML?this.response.clone().text():Promise.resolve(void 0)}header(e){return this.response.headers.get(e)}}class I extends Set{constructor(e){super(),this.maxSize=e}add(e){if(this.size>=this.maxSize){const e=this.values().next().value;this.delete(e)}super.add(e)}}const z=new I(20);function q(e,t={}){const o=new Headers(t.headers||{}),i=h();return z.add(i),o.append("X-Turbo-Request-Id",i),window.fetch(e,{...t,headers:o})}function H(e){switch(e.toLowerCase()){case"get":return U.get;case"post":return U.post;case"put":return U.put;case"patch":return U.patch;case"delete":return U.delete}}const U={get:"get",post:"post",put:"put",patch:"patch",delete:"delete"};function W(e){switch(e.toLowerCase()){case j.multipart:return j.multipart;case j.plain:return j.plain;default:return j.urlEncoded}}const j={urlEncoded:"application/x-www-form-urlencoded",multipart:"multipart/form-data",plain:"text/plain"};class K{abortController=new AbortController;#t=e=>{};constructor(e,t,o,i=new URLSearchParams,n=null,r=j.urlEncoded){const[s,a]=X(P(o),t,i,r);this.delegate=e,this.url=s,this.target=n,this.fetchOptions={credentials:"same-origin",redirect:"follow",method:t.toUpperCase(),headers:{...this.defaultHeaders},body:a,signal:this.abortSignal,referrer:this.delegate.referrer?.href},this.enctype=r}get method(){return this.fetchOptions.method}set method(e){const t=this.isSafe?this.url.searchParams:this.fetchOptions.body||new FormData,o=H(e)||U.get;this.url.search="";const[i,n]=X(this.url,o,t,this.enctype);this.url=i,this.fetchOptions.body=n,this.fetchOptions.method=o.toUpperCase()}get headers(){return this.fetchOptions.headers}set headers(e){this.fetchOptions.headers=e}get body(){return this.isSafe?this.url.searchParams:this.fetchOptions.body}set body(e){this.fetchOptions.body=e}get location(){return this.url}get params(){return this.url.searchParams}get entries(){return this.body?Array.from(this.body.entries()):[]}cancel(){this.abortController.abort()}async perform(){const{fetchOptions:e}=this;this.delegate.prepareRequest(this);const t=await this.#o(e);try{this.delegate.requestStarted(this),t.detail.fetchRequest?this.response=t.detail.fetchRequest.response:this.response=q(this.url.href,e);const o=await this.response;return await this.receive(o)}catch(o){if("AbortError"!==o.name)throw this.#i(o)&&this.delegate.requestErrored(this,o),o}finally{this.delegate.requestFinished(this)}}async receive(e){const t=new O(e);return r("turbo:before-fetch-response",{cancelable:!0,detail:{fetchResponse:t},target:this.target}).defaultPrevented?this.delegate.requestPreventedHandlingResponse(this,t):t.succeeded?this.delegate.requestSucceededWithResponse(this,t):this.delegate.requestFailedWithResponse(this,t),t}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}get isSafe(){return G(this.method)}get abortSignal(){return this.abortController.signal}acceptResponseType(e){this.headers.Accept=[e,this.headers.Accept].join(", ")}async#o(e){const t=new Promise(e=>this.#t=e),o=r("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:e,url:this.url,resume:this.#t},target:this.target});return this.url=o.detail.url,o.defaultPrevented&&await t,o}#i(e){return!r("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:e}}).defaultPrevented}}function G(e){return H(e)==U.get}function X(e,t,o,i){const n=Array.from(o).length>0?new URLSearchParams(Q(o)):e.searchParams;return G(t)?[Y(e,n),null]:i==j.urlEncoded?[e,n]:[e,o]}function Q(e){const t=[];for(const[o,i]of e)i instanceof File||t.push([o,i]);return t}function Y(e,t){const o=new URLSearchParams(Q(t));return e.search=o.toString(),e}class J{started=!1;constructor(e,t){this.delegate=e,this.element=t,this.intersectionObserver=new IntersectionObserver(this.intersect)}start(){this.started||(this.started=!0,this.intersectionObserver.observe(this.element))}stop(){this.started&&(this.started=!1,this.intersectionObserver.unobserve(this.element))}intersect=e=>{const t=e.slice(-1)[0];t?.isIntersecting&&this.delegate.elementAppearedInViewport(this.element)}}class Z{static contentType="text/vnd.turbo-stream.html";static wrap(e){return"string"==typeof e?new this(function(e){const t=document.createElement("template");return t.innerHTML=e,t.content}(e)):e}constructor(e){this.fragment=function(e){for(const t of e.querySelectorAll("turbo-stream")){const e=document.importNode(t,!0);for(const t of e.templateElement.content.querySelectorAll("script"))t.replaceWith(n(t));t.replaceWith(e)}return e}(e)}}const ee=e=>e;class te{keys=[];entries={};#n;constructor(e,t=ee){this.size=e,this.#n=t}has(e){return this.#n(e)in this.entries}get(e){if(this.has(e)){const t=this.read(e);return this.touch(e),t}}put(e,t){return this.write(e,t),this.touch(e),t}clear(){for(const e of Object.keys(this.entries))this.evict(e)}read(e){return this.entries[this.#n(e)]}write(e,t){this.entries[this.#n(e)]=t}touch(e){e=this.#n(e);const t=this.keys.indexOf(e);t>-1&&this.keys.splice(t,1),this.keys.unshift(e),this.trim()}trim(){for(const e of this.keys.splice(this.size))this.evict(e)}evict(e){delete this.entries[e]}}const oe=1e4,ie=new class extends te{#r=null;#s={};constructor(e=1,t=100){super(e,$),this.prefetchDelay=t}putLater(e,t,o){this.#r=setTimeout(()=>{t.perform(),this.put(e,t,o),this.#r=null},this.prefetchDelay)}put(e,t,o=oe){super.put(e,t),this.#s[$(e)]=new Date((new Date).getTime()+o)}clear(){super.clear(),this.#r&&clearTimeout(this.#r)}evict(e){super.evict(e),delete this.#s[e]}has(e){if(super.has(e)){const t=this.#s[$(e)];return t&&t>Date.now()}return!1}},ne={initialized:"initialized",requesting:"requesting",waiting:"waiting",receiving:"receiving",stopping:"stopping",stopped:"stopped"};class re{state=ne.initialized;static confirmMethod(e){return Promise.resolve(confirm(e))}constructor(e,t,o,i=!1){const n=function(e,t){const o=t?.getAttribute("formmethod")||e.getAttribute("method")||"";return H(o.toLowerCase())||U.get}(t,o),r=function(e,t){const o=P(e);G(t)&&(o.search="");return o}(function(e,t){const o="string"==typeof e.action?e.action:null;return t?.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||o||""}(t,o),n),s=function(e,t){const o=new FormData(e),i=t?.getAttribute("name"),n=t?.getAttribute("value");i&&o.append(i,n||"");return o}(t,o),a=function(e,t){return W(t?.getAttribute("formenctype")||e.enctype)}(t,o);this.delegate=e,this.formElement=t,this.submitter=o,this.fetchRequest=new K(this,n,r,s,t,a),this.mustRedirect=i}get method(){return this.fetchRequest.method}set method(e){this.fetchRequest.method=e}get action(){return this.fetchRequest.url.toString()}set action(e){this.fetchRequest.url=P(e)}get body(){return this.fetchRequest.body}get enctype(){return this.fetchRequest.enctype}get isSafe(){return this.fetchRequest.isSafe}get location(){return this.fetchRequest.url}async start(){const{initialized:e,requesting:t}=ne,o=p("data-turbo-confirm",this.submitter,this.formElement);if("string"==typeof o){const e="function"==typeof N.forms.confirm?N.forms.confirm:re.confirmMethod;if(!(await e(o,this.formElement,this.submitter)))return}if(this.state==e)return this.state=t,this.fetchRequest.perform()}stop(){const{stopping:e,stopped:t}=ne;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareRequest(e){if(!e.isSafe){const t=function(e){if(null!=e){const t=(document.cookie?document.cookie.split("; "):[]).find(t=>t.startsWith(e));if(t){const e=t.split("=").slice(1).join("=");return e?decodeURIComponent(e):void 0}}}(w("csrf-param"))||w("csrf-token");t&&(e.headers["X-CSRF-Token"]=t)}this.requestAcceptsTurboStreamResponse(e)&&e.acceptResponseType(Z.contentType)}requestStarted(e){this.state=ne.waiting,this.submitter&&N.forms.submitter.beforeSubmit(this.submitter),this.setSubmitsWith(),m(this.formElement),r("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){ie.clear(),this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){if(t.clientError||t.serverError)this.delegate.formSubmissionFailedWithResponse(this,t);else if(ie.clear(),this.requestMustRedirect(e)&&function(e){return 200==e.statusCode&&!e.redirected}(t)){const e=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,e)}else this.state=ne.receiving,this.result={success:!0,fetchResponse:t},this.delegate.formSubmissionSucceededWithResponse(this,t)}requestFailedWithResponse(e,t){this.result={success:!1,fetchResponse:t},this.delegate.formSubmissionFailedWithResponse(this,t)}requestErrored(e,t){this.result={success:!1,error:t},this.delegate.formSubmissionErrored(this,t)}requestFinished(e){this.state=ne.stopped,this.submitter&&N.forms.submitter.afterSubmit(this.submitter),this.resetSubmitterText(),f(this.formElement),r("turbo:submit-end",{target:this.formElement,detail:{formSubmission:this,...this.result}}),this.delegate.formSubmissionFinished(this)}setSubmitsWith(){if(this.submitter&&this.submitsWith)if(this.submitter.matches("button"))this.originalSubmitText=this.submitter.innerHTML,this.submitter.innerHTML=this.submitsWith;else if(this.submitter.matches("input")){const e=this.submitter;this.originalSubmitText=e.value,e.value=this.submitsWith}}resetSubmitterText(){if(this.submitter&&this.originalSubmitText)if(this.submitter.matches("button"))this.submitter.innerHTML=this.originalSubmitText;else if(this.submitter.matches("input")){this.submitter.value=this.originalSubmitText}}requestMustRedirect(e){return!e.isSafe&&this.mustRedirect}requestAcceptsTurboStreamResponse(e){return!e.isSafe||function(e,...t){return t.some(t=>t&&t.hasAttribute(e))}("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){return this.submitter?.getAttribute("data-turbo-submits-with")}}class se{constructor(e){this.element=e}get activeElement(){return this.element.ownerDocument.activeElement}get children(){return[...this.element.children]}hasAnchor(e){return null!=this.getElementForAnchor(e)}getElementForAnchor(e){return e?this.element.querySelector(`[id='${e}'], a[name='${e}']`):null}get isConnected(){return this.element.isConnected}get firstAutofocusableElement(){return E(this.element)}get permanentElements(){return le(this.element)}getPermanentElementById(e){return ae(this.element,e)}getPermanentElementMapForSnapshot(e){const t={};for(const o of this.permanentElements){const{id:i}=o,n=e.getPermanentElementById(i);n&&(t[i]=[o,n])}return t}}function ae(e,t){return e.querySelector(`#${t}[data-turbo-permanent]`)}function le(e){return e.querySelectorAll("[id][data-turbo-permanent]")}class ce{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("submit",this.submitCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("submit",this.submitCaptured,!0),this.started=!1)}submitCaptured=()=>{this.eventTarget.removeEventListener("submit",this.submitBubbled,!1),this.eventTarget.addEventListener("submit",this.submitBubbled,!1)};submitBubbled=e=>{if(!e.defaultPrevented){const t=e.target instanceof HTMLFormElement?e.target:void 0,o=e.submitter||void 0;t&&function(e,t){const o=t?.getAttribute("formmethod")||e.getAttribute("method");return"dialog"!=o}(t,o)&&function(e,t){const o=t?.getAttribute("formtarget")||e.getAttribute("target");return S(o)}(t,o)&&this.delegate.willSubmitForm(t,o)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmitted(t,o))}}}class de{#a=e=>{};#l=e=>{};constructor(e,t){this.delegate=e,this.element=t}scrollToAnchor(e){const t=this.snapshot.getElementForAnchor(e);t?(this.focusElement(t),this.scrollToElement(t)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(e){this.scrollToAnchor(R(e))}scrollToElement(e){e.scrollIntoView()}focusElement(e){e instanceof HTMLElement&&(e.hasAttribute("tabindex")?e.focus():(e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")))}scrollToPosition({x:e,y:t}){this.scrollRoot.scrollTo(e,t)}scrollToTop(){this.scrollToPosition({x:0,y:0})}get scrollRoot(){return window}async render(e){const{isPreview:t,shouldRender:o,willRender:i,newSnapshot:n}=e,r=i;if(o)try{this.renderPromise=new Promise(e=>this.#a=e),this.renderer=e,await this.prepareToRenderSnapshot(e);const o=new Promise(e=>this.#l=e),i={resume:this.#l,render:this.renderer.renderElement,renderMethod:this.renderer.renderMethod};this.delegate.allowsImmediateRender(n,i)||await o,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(n,t,this.renderer.renderMethod),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(e)}finally{delete this.renderer,this.#a(void 0),delete this.renderPromise}else r&&this.invalidate(e.reloadReason)}invalidate(e){this.delegate.viewInvalidated(e)}async prepareToRenderSnapshot(e){this.markAsPreview(e.isPreview),await e.prepareToRender()}markAsPreview(e){e?this.element.setAttribute("data-turbo-preview",""):this.element.removeAttribute("data-turbo-preview")}markVisitDirection(e){this.element.setAttribute("data-turbo-visit-direction",e)}unmarkVisitDirection(){this.element.removeAttribute("data-turbo-visit-direction")}async renderSnapshot(e){await e.render()}finishRenderingSnapshot(e){e.finishRendering()}}class ue extends de{missing(){this.element.innerHTML='<strong class="turbo-frame-error">Content missing</strong>'}get snapshot(){return new se(this.element)}}class he{constructor(e,t){this.delegate=e,this.element=t}start(){this.element.addEventListener("click",this.clickBubbled),document.addEventListener("turbo:click",this.linkClicked),document.addEventListener("turbo:before-visit",this.willVisit)}stop(){this.element.removeEventListener("click",this.clickBubbled),document.removeEventListener("turbo:click",this.linkClicked),document.removeEventListener("turbo:before-visit",this.willVisit)}clickBubbled=e=>{this.clickEventIsSignificant(e)?this.clickEvent=e:delete this.clickEvent};linkClicked=e=>{this.clickEvent&&this.clickEventIsSignificant(e)&&this.delegate.shouldInterceptLinkClick(e.target,e.detail.url,e.detail.originalEvent)&&(this.clickEvent.preventDefault(),e.preventDefault(),this.delegate.linkClickIntercepted(e.target,e.detail.url,e.detail.originalEvent)),delete this.clickEvent};willVisit=e=>{delete this.clickEvent};clickEventIsSignificant(e){const t=e.composed?e.target?.parentElement:e.target,o=C(t)||t;return o instanceof Element&&o.closest("turbo-frame, html")==this.element}}class pe{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("click",this.clickCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("click",this.clickCaptured,!0),this.started=!1)}clickCaptured=()=>{this.eventTarget.removeEventListener("click",this.clickBubbled,!1),this.eventTarget.addEventListener("click",this.clickBubbled,!1)};clickBubbled=e=>{if(e instanceof MouseEvent&&this.clickEventIsSignificant(e)){const t=C(e.composedPath&&e.composedPath()[0]||e.target);if(t&&S(t.target)){const o=L(t);this.delegate.willFollowLinkToLocation(t,o,e)&&(e.preventDefault(),this.delegate.followedLinkToLocation(t,o))}}};clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}}class me{constructor(e,t){this.delegate=e,this.linkInterceptor=new pe(this,t)}start(){this.linkInterceptor.start()}stop(){this.linkInterceptor.stop()}canPrefetchRequestToLocation(e,t){return!1}prefetchAndCacheRequestToLocation(e,t){}willFollowLinkToLocation(e,t,o){return this.delegate.willSubmitFormLinkToLocation(e,t,o)&&(e.hasAttribute("data-turbo-method")||e.hasAttribute("data-turbo-stream"))}followedLinkToLocation(e,t){const o=document.createElement("form");for(const[l,c]of t.searchParams)o.append(Object.assign(document.createElement("input"),{type:"hidden",name:l,value:c}));const i=Object.assign(t,{search:""});o.setAttribute("data-turbo","true"),o.setAttribute("action",i.href),o.setAttribute("hidden","");const n=e.getAttribute("data-turbo-method");n&&o.setAttribute("method",n);const r=e.getAttribute("data-turbo-frame");r&&o.setAttribute("data-turbo-frame",r);const s=b(e);s&&o.setAttribute("data-turbo-action",s);const a=e.getAttribute("data-turbo-confirm");a&&o.setAttribute("data-turbo-confirm",a);e.hasAttribute("data-turbo-stream")&&o.setAttribute("data-turbo-stream",""),this.delegate.submittedFormLinkToLocation(e,t,o),document.body.appendChild(o),o.addEventListener("turbo:submit-end",()=>o.remove(),{once:!0}),requestAnimationFrame(()=>o.requestSubmit())}}class fe{static async preservingPermanentElements(e,t,o){const i=new this(e,t);i.enter(),await o(),i.leave()}constructor(e,t){this.delegate=e,this.permanentElementMap=t}enter(){for(const e in this.permanentElementMap){const[t,o]=this.permanentElementMap[e];this.delegate.enteringBardo(t,o),this.replaceNewPermanentElementWithPlaceholder(o)}}leave(){for(const e in this.permanentElementMap){const[t]=this.permanentElementMap[e];this.replaceCurrentPermanentElementWithClone(t),this.replacePlaceholderWithPermanentElement(t),this.delegate.leavingBardo(t)}}replaceNewPermanentElementWithPlaceholder(e){const t=function(e){const t=document.createElement("meta");return t.setAttribute("name","turbo-permanent-placeholder"),t.setAttribute("content",e.id),t}(e);e.replaceWith(t)}replaceCurrentPermanentElementWithClone(e){const t=e.cloneNode(!0);e.replaceWith(t)}replacePlaceholderWithPermanentElement(e){const t=this.getPlaceholderById(e.id);t?.replaceWith(e)}getPlaceholderById(e){return this.placeholders.find(t=>t.content==e)}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}}class ge{#c=null;static renderElement(e,t){}constructor(e,t,o,i=!0){this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=o,this.willRender=i,this.renderElement=this.constructor.renderElement,this.promise=new Promise((e,t)=>this.resolvingFunctions={resolve:e,reject:t})}get shouldRender(){return!0}get shouldAutofocus(){return!0}get reloadReason(){}prepareToRender(){}render(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}async preservingPermanentElements(e){await fe.preservingPermanentElements(this,this.permanentElementMap,e)}focusFirstAutofocusableElement(){if(this.shouldAutofocus){const e=this.connectedSnapshot.firstAutofocusableElement;e&&e.focus()}}enteringBardo(e){this.#c||e.contains(this.currentSnapshot.activeElement)&&(this.#c=this.currentSnapshot.activeElement)}leavingBardo(e){e.contains(this.#c)&&this.#c instanceof HTMLElement&&(this.#c.focus(),this.#c=null)}get connectedSnapshot(){return this.newSnapshot.isConnected?this.newSnapshot:this.currentSnapshot}get currentElement(){return this.currentSnapshot.element}get newElement(){return this.newSnapshot.element}get permanentElementMap(){return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot)}get renderMethod(){return"replace"}}class ve extends ge{static renderElement(e,t){const o=document.createRange();o.selectNodeContents(e),o.deleteContents();const i=t,n=i.ownerDocument?.createRange();n&&(n.selectNodeContents(i),e.appendChild(n.extractContents()))}constructor(e,t,o,i,n,r=!0){super(t,o,i,n,r),this.delegate=e}get shouldRender(){return!0}async render(){await a(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await a(),this.focusFirstAutofocusableElement(),await a(),this.activateScriptElements()}loadFrameElement(){this.delegate.willRenderFrame(this.currentElement,this.newElement),this.renderElement(this.currentElement,this.newElement)}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){const e=this.currentElement.firstElementChild,t=function(e,t){return"end"==e||"start"==e||"center"==e||"nearest"==e?e:t}(this.currentElement.getAttribute("data-autoscroll-block"),"end"),o=function(e,t){return"auto"==e||"smooth"==e?e:t}(this.currentElement.getAttribute("data-autoscroll-behavior"),"auto");if(e)return e.scrollIntoView({block:t,behavior:o}),!0}return!1}activateScriptElements(){for(const e of this.newScriptElements){const t=n(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}}var be=function(){const e=()=>{},t={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:e,afterNodeAdded:e,beforeNodeMorphed:e,afterNodeMorphed:e,beforeNodeRemoved:e,afterNodeRemoved:e,beforeAttributeUpdated:e},head:{style:"merge",shouldPreserve:e=>"true"===e.getAttribute("im-preserve"),shouldReAppend:e=>"true"===e.getAttribute("im-re-append"),shouldRemove:e,afterHeadMorphed:e},restoreFocus:!0};const o=function(){function e(e,t,o,n){if(!1===n.callbacks.beforeNodeAdded(t))return null;if(n.idMap.has(t)){const r=document.createElement(t.tagName);return e.insertBefore(r,o),i(r,t,n),n.callbacks.afterNodeAdded(r),r}{const i=document.importNode(t,!0);return e.insertBefore(i,o),n.callbacks.afterNodeAdded(i),i}}const t=function(){function e(e,t,o){let i=e.idMap.get(t),n=e.idMap.get(o);if(!n||!i)return!1;for(const r of i)if(n.has(r))return!0;return!1}function t(e,t){const o=e,i=t;return o.nodeType===i.nodeType&&o.tagName===i.tagName&&(!o.getAttribute?.("id")||o.getAttribute?.("id")===i.getAttribute?.("id"))}return function(o,i,n,r){let s=null,a=i.nextSibling,l=0,c=n;for(;c&&c!=r;){if(t(c,i)){if(e(o,c,i))return c;null===s&&(o.idMap.has(c)||(s=c))}if(null===s&&a&&t(c,a)&&(l++,a=a.nextSibling,l>=2&&(s=void 0)),o.activeElementAndParents.includes(c))break;c=c.nextSibling}return s||null}}();function o(e,t){if(e.idMap.has(t))s(e.pantry,t,null);else{if(!1===e.callbacks.beforeNodeRemoved(t))return;t.parentNode?.removeChild(t),e.callbacks.afterNodeRemoved(t)}}function n(e,t,i){let n=t;for(;n&&n!==i;){let t=n;n=n.nextSibling,o(e,t)}return n}function r(e,t,o,i){const n=i.target.getAttribute?.("id")===t&&i.target||i.target.querySelector(`[id="${t}"]`)||i.pantry.querySelector(`[id="${t}"]`);return function(e,t){const o=e.getAttribute("id");for(;e=e.parentNode;){let i=t.idMap.get(e);i&&(i.delete(o),i.size||t.idMap.delete(e))}}(n,i),s(e,n,o),n}function s(e,t,o){if(e.moveBefore)try{e.moveBefore(t,o)}catch(da){e.insertBefore(t,o)}else e.insertBefore(t,o)}return function(s,a,l,c=null,d=null){a instanceof HTMLTemplateElement&&l instanceof HTMLTemplateElement&&(a=a.content,l=l.content),c||=a.firstChild;for(const o of l.childNodes){if(c&&c!=d){const e=t(s,o,c,d);if(e){e!==c&&n(s,c,e),i(e,o,s),c=e.nextSibling;continue}}if(o instanceof Element){const e=o.getAttribute("id");if(s.persistentIds.has(e)){const t=r(a,e,c,s);i(t,o,s),c=t.nextSibling;continue}}const l=e(a,o,c,s);l&&(c=l.nextSibling)}for(;c&&c!=d;){const e=c;c=c.nextSibling,o(s,e)}}}(),i=function(){function e(e,o,i,n){const r=o[i];if(r!==e[i]){const s=t(i,e,"update",n);s||(e[i]=o[i]),r?s||e.setAttribute(i,""):t(i,e,"remove",n)||e.removeAttribute(i)}}function t(e,t,o,i){return!("value"!==e||!i.ignoreActiveValue||t!==document.activeElement)||!1===i.callbacks.beforeAttributeUpdated(e,t,o)}function i(e,t){return!!t.ignoreActiveValue&&e===document.activeElement&&e!==document.body}return function(r,s,a){return a.ignoreActive&&r===document.activeElement?null:(!1===a.callbacks.beforeNodeMorphed(r,s)||(r instanceof HTMLHeadElement&&a.head.ignore||(r instanceof HTMLHeadElement&&"morph"!==a.head.style?n(r,s,a):(!function(o,n,r){let s=n.nodeType;if(1===s){const s=o,a=n,l=s.attributes,c=a.attributes;for(const e of c)t(e.name,s,"update",r)||s.getAttribute(e.name)!==e.value&&s.setAttribute(e.name,e.value);for(let e=l.length-1;0<=e;e--){const o=l[e];if(o&&!a.hasAttribute(o.name)){if(t(o.name,s,"remove",r))continue;s.removeAttribute(o.name)}}i(s,r)||function(o,i,n){if(o instanceof HTMLInputElement&&i instanceof HTMLInputElement&&"file"!==i.type){let r=i.value,s=o.value;e(o,i,"checked",n),e(o,i,"disabled",n),i.hasAttribute("value")?s!==r&&(t("value",o,"update",n)||(o.setAttribute("value",r),o.value=r)):t("value",o,"remove",n)||(o.value="",o.removeAttribute("value"))}else if(o instanceof HTMLOptionElement&&i instanceof HTMLOptionElement)e(o,i,"selected",n);else if(o instanceof HTMLTextAreaElement&&i instanceof HTMLTextAreaElement){let e=i.value,r=o.value;if(t("value",o,"update",n))return;e!==r&&(o.value=e),o.firstChild&&o.firstChild.nodeValue!==e&&(o.firstChild.nodeValue=e)}}(s,a,r)}8!==s&&3!==s||o.nodeValue!==n.nodeValue&&(o.nodeValue=n.nodeValue)}(r,s,a),i(r,a)||o(a,r,s))),a.callbacks.afterNodeMorphed(r,s)),r)}}();function n(e,t,o){let i=[],n=[],r=[],s=[],a=new Map;for(const c of t.children)a.set(c.outerHTML,c);for(const c of e.children){let e=a.has(c.outerHTML),t=o.head.shouldReAppend(c),i=o.head.shouldPreserve(c);e||i?t?n.push(c):(a.delete(c.outerHTML),r.push(c)):"append"===o.head.style?t&&(n.push(c),s.push(c)):!1!==o.head.shouldRemove(c)&&n.push(c)}s.push(...a.values());let l=[];for(const c of s){let t=document.createRange().createContextualFragment(c.outerHTML).firstChild;if(!1!==o.callbacks.beforeNodeAdded(t)){if("href"in t&&t.href||"src"in t&&t.src){let e,o=new Promise(function(t){e=t});t.addEventListener("load",function(){e()}),l.push(o)}e.appendChild(t),o.callbacks.afterNodeAdded(t),i.push(t)}}for(const c of n)!1!==o.callbacks.beforeNodeRemoved(c)&&(e.removeChild(c),o.callbacks.afterNodeRemoved(c));return o.head.afterHeadMorphed(e,{added:i,kept:r,removed:n}),l}const r=function(){function e(){const e=document.createElement("div");return e.hidden=!0,document.body.insertAdjacentElement("afterend",e),e}function o(e){let t=[],o=document.activeElement;if("BODY"!==o?.tagName&&e.contains(o))for(;o&&(t.push(o),o!==e);)o=o.parentElement;return t}function i(e){let t=Array.from(e.querySelectorAll("[id]"));return e.getAttribute?.("id")&&t.push(e),t}function n(e,t,o,i){for(const n of i){const i=n.getAttribute("id");if(t.has(i)){let t=n;for(;t;){let n=e.get(t);if(null==n&&(n=new Set,e.set(t,n)),n.add(i),t===o)break;t=t.parentElement}}}}return function(r,s,a){const{persistentIds:l,idMap:c}=function(e,t){const o=i(e),r=i(t),s=function(e,t){let o=new Set,i=new Map;for(const{id:r,tagName:s}of e)i.has(r)?o.add(r):i.set(r,s);let n=new Set;for(const{id:r,tagName:s}of t)n.has(r)?o.add(r):i.get(r)===s&&n.add(r);for(const r of o)n.delete(r);return n}(o,r);let a=new Map;n(a,s,e,o);const l=t.__idiomorphRoot||t;return n(a,s,l,r),{persistentIds:s,idMap:a}}(r,s),d=function(e){let o=Object.assign({},t);return Object.assign(o,e),o.callbacks=Object.assign({},t.callbacks,e.callbacks),o.head=Object.assign({},t.head,e.head),o}(a),u=d.morphStyle||"outerHTML";if(!["innerHTML","outerHTML"].includes(u))throw`Do not understand how to morph style ${u}`;return{target:r,newContent:s,config:d,morphStyle:u,ignoreActive:d.ignoreActive,ignoreActiveValue:d.ignoreActiveValue,restoreFocus:d.restoreFocus,idMap:c,persistentIds:l,pantry:e(),activeElementAndParents:o(r),callbacks:d.callbacks,head:d.head}}}(),{normalizeElement:s,normalizeParent:a}=function(){const e=new WeakSet;class t{constructor(e){this.originalNode=e,this.realParentNode=e.parentNode,this.previousSibling=e.previousSibling,this.nextSibling=e.nextSibling}get childNodes(){const e=[];let t=this.previousSibling?this.previousSibling.nextSibling:this.realParentNode.firstChild;for(;t&&t!=this.nextSibling;)e.push(t),t=t.nextSibling;return e}querySelectorAll(e){return this.childNodes.reduce((t,o)=>{if(o instanceof Element){o.matches(e)&&t.push(o);const i=o.querySelectorAll(e);for(let e=0;e<i.length;e++)t.push(i[e])}return t},[])}insertBefore(e,t){return this.realParentNode.insertBefore(e,t)}moveBefore(e,t){return this.realParentNode.moveBefore(e,t)}get __idiomorphRoot(){return this.originalNode}}return{normalizeElement:function(e){return e instanceof Document?e.documentElement:e},normalizeParent:function o(i){if(null==i)return document.createElement("div");if("string"==typeof i)return o(function(t){let o=new DOMParser,i=t.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");if(i.match(/<\/html>/)||i.match(/<\/head>/)||i.match(/<\/body>/)){let n=o.parseFromString(t,"text/html");if(i.match(/<\/html>/))return e.add(n),n;{let t=n.firstChild;return t&&e.add(t),t}}{let i=o.parseFromString("<body><template>"+t+"</template></body>","text/html").body.querySelector("template").content;return e.add(i),i}}(i));if(e.has(i))return i;if(i instanceof Node){if(i.parentNode)return new t(i);{const e=document.createElement("div");return e.append(i),e}}{const e=document.createElement("div");for(const t of[...i])e.append(t);return e}}}}();return{morph:function(e,t,i={}){e=s(e);const l=a(t),c=r(e,l,i),d=function(e,t){if(!e.config.restoreFocus)return t();let o=document.activeElement;if(!(o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement))return t();const{id:i,selectionStart:n,selectionEnd:r}=o,s=t();i&&i!==document.activeElement?.getAttribute("id")&&(o=e.target.querySelector(`[id="${i}"]`),o?.focus());o&&!o.selectionEnd&&r&&o.setSelectionRange(n,r);return s}(c,()=>function(e,t,o,i){if(e.head.block){const r=t.querySelector("head"),s=o.querySelector("head");if(r&&s){const t=n(r,s,e);return Promise.all(t).then(()=>{const t=Object.assign(e,{head:{block:!1,ignore:!0}});return i(t)})}}return i(e)}(c,e,l,t=>"innerHTML"===t.morphStyle?(o(t,e,l),Array.from(e.childNodes)):function(e,t,i){const n=a(t);return o(e,n,i,t,t.nextSibling),Array.from(n.childNodes)}(t,e,l)));return c.pantry.remove(),d},defaults:t}}();function ye(e,t,{callbacks:o,...i}={}){be.morph(e,t,{...i,callbacks:new xe(o)})}function we(e,t,o={}){ye(e,t.childNodes,{...o,morphStyle:"innerHTML"})}function ke(e,t){return e instanceof o&&e.shouldReloadWithMorph&&(!t||function(e,t){return t instanceof Element&&"TURBO-FRAME"===t.nodeName&&e.id===t.id&&(!t.getAttribute("src")||F(e.src,t.getAttribute("src")))}(e,t))&&!e.closest("[data-turbo-permanent]")}function _e(e){return e.parentElement.closest("turbo-frame[src][refresh=morph]")}class xe{#d;constructor({beforeNodeMorphed:e}={}){this.#d=e||(()=>!0)}beforeNodeAdded=e=>!(e.id&&e.hasAttribute("data-turbo-permanent")&&document.getElementById(e.id));beforeNodeMorphed=(e,t)=>{if(e instanceof Element){if(!e.hasAttribute("data-turbo-permanent")&&this.#d(e,t)){return!r("turbo:before-morph-element",{cancelable:!0,target:e,detail:{currentElement:e,newElement:t}}).defaultPrevented}return!1}};beforeAttributeUpdated=(e,t,o)=>!r("turbo:before-morph-attribute",{cancelable:!0,target:t,detail:{attributeName:e,mutationType:o}}).defaultPrevented;beforeNodeRemoved=e=>this.beforeNodeMorphed(e);afterNodeMorphed=(e,t)=>{e instanceof Element&&r("turbo:morph-element",{target:e,detail:{currentElement:e,newElement:t}})}}class Ee extends ve{static renderElement(e,t){r("turbo:before-frame-morph",{target:e,detail:{currentElement:e,newElement:t}}),we(e,t,{callbacks:{beforeNodeMorphed:(t,o)=>!ke(t,o)||_e(t)!==e||(t.reload(),!1)}})}async preservingPermanentElements(e){return await e()}}class Se{static animationDuration=300;static get defaultCSS(){return u`
      .turbo-progress-bar {
        position: fixed;
        display: block;
        top: 0;
        left: 0;
        height: 3px;
        background: #0076ff;
        z-index: 2147483647;
        transition:
          width ${Se.animationDuration}ms ease-out,
          opacity ${Se.animationDuration/2}ms ${Se.animationDuration/2}ms ease-in;
        transform: translate3d(0, 0, 0);
      }
    `}hiding=!1;value=0;visible=!1;constructor(){this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.installStylesheetElement(),this.setValue(0)}show(){this.visible||(this.visible=!0,this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement(()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1}))}setValue(e){this.value=e,this.refresh()}installStylesheetElement(){document.head.insertBefore(this.stylesheetElement,document.head.firstChild)}installProgressElement(){this.progressElement.style.width="0",this.progressElement.style.opacity="1",document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()}fadeProgressElement(e){this.progressElement.style.opacity="0",setTimeout(e,1.5*Se.animationDuration)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,Se.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}trickle=()=>{this.setValue(this.value+Math.random()/100)};refresh(){requestAnimationFrame(()=>{this.progressElement.style.width=10+90*this.value+"%"})}createStylesheetElement(){const e=document.createElement("style");e.type="text/css",e.textContent=Se.defaultCSS;const t=k();return t&&(e.nonce=t),e}createProgressElement(){const e=document.createElement("div");return e.className="turbo-progress-bar",e}}class Ce extends se{detailsByOuterHTML=this.children.filter(e=>!function(e){const t=e.localName;return"noscript"==t}(e)).map(e=>function(e){e.hasAttribute("nonce")&&e.setAttribute("nonce","");return e}(e)).reduce((e,t)=>{const{outerHTML:o}=t,i=o in e?e[o]:{type:Ae(t),tracked:Te(t),elements:[]};return{...e,[o]:{...i,elements:[...i.elements,t]}}},{});get trackedElementSignature(){return Object.keys(this.detailsByOuterHTML).filter(e=>this.detailsByOuterHTML[e].tracked).join("")}getScriptElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("script",e)}getStylesheetElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("stylesheet",e)}getElementsMatchingTypeNotInSnapshot(e,t){return Object.keys(this.detailsByOuterHTML).filter(e=>!(e in t.detailsByOuterHTML)).map(e=>this.detailsByOuterHTML[e]).filter(({type:t})=>t==e).map(({elements:[e]})=>e)}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce((e,t)=>{const{type:o,tracked:i,elements:n}=this.detailsByOuterHTML[t];return null!=o||i?n.length>1?[...e,...n.slice(1)]:e:[...e,...n]},[])}getMetaValue(e){const t=this.findMetaElementByName(e);return t?t.getAttribute("content"):null}findMetaElementByName(e){return Object.keys(this.detailsByOuterHTML).reduce((t,o)=>{const{elements:[i]}=this.detailsByOuterHTML[o];return function(e,t){const o=e.localName;return"meta"==o&&e.getAttribute("name")==t}(i,e)?i:t},0)}}function Ae(e){return function(e){const t=e.localName;return"script"==t}(e)?"script":function(e){const t=e.localName;return"style"==t||"link"==t&&"stylesheet"==e.getAttribute("rel")}(e)?"stylesheet":void 0}function Te(e){return"reload"==e.getAttribute("data-turbo-track")}class Ne extends se{static fromHTMLString(e=""){return this.fromDocument(d(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({documentElement:e,body:t,head:o}){return new this(e,t,new Ce(o))}constructor(e,t,o){super(t),this.documentElement=e,this.headSnapshot=o}clone(){const e=this.element.cloneNode(!0),t=this.element.querySelectorAll("select"),o=e.querySelectorAll("select");for(const[i,n]of t.entries()){const e=o[i];for(const t of e.selectedOptions)t.selected=!1;for(const t of n.selectedOptions)e.options[t.index].selected=!0}for(const i of e.querySelectorAll('input[type="password"]'))i.value="";for(const i of e.querySelectorAll("noscript"))i.remove();return new Ne(this.documentElement,e,this.headSnapshot)}get lang(){return this.documentElement.getAttribute("lang")}get dir(){return this.documentElement.getAttribute("dir")}get headElement(){return this.headSnapshot.element}get rootLocation(){return P(this.getSetting("root")??"/")}get cacheControlValue(){return this.getSetting("cache-control")}get isPreviewable(){return"no-preview"!=this.cacheControlValue}get isCacheable(){return"no-cache"!=this.cacheControlValue}get isVisitable(){return"reload"!=this.getSetting("visit-control")}get prefersViewTransitions(){return("true"===this.getSetting("view-transition")||"same-origin"===this.headSnapshot.getMetaValue("view-transition"))&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches}get refreshMethod(){return this.getSetting("refresh-method")}get refreshScroll(){return this.getSetting("refresh-scroll")}getSetting(e){return this.headSnapshot.getMetaValue(`turbo-${e}`)}}class Pe{#u=!1;#h=Promise.resolve();renderChange(e,t){return e&&this.viewTransitionsAvailable&&!this.#u?(this.#u=!0,this.#h=this.#h.then(async()=>{await document.startViewTransition(t).finished})):this.#h=this.#h.then(t),this.#h}get viewTransitionsAvailable(){return document.startViewTransition}}const Re={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1,refresh:{}},Be="visitStart",Ve="requestStart",De="requestEnd",Le="visitEnd",$e="initialized",Fe="started",Me="canceled",Oe="failed",Ie="completed",ze=0,qe=-1,He=-2,Ue={advance:"forward",restore:"back",replace:"none"};class We{identifier=h();timingMetrics={};followedRedirect=!1;historyChanged=!1;scrolled=!1;shouldCacheSnapshot=!0;acceptsStreamResponse=!1;snapshotCached=!1;state=$e;viewTransitioner=new Pe;constructor(e,t,o,i={}){this.delegate=e,this.location=t,this.restorationIdentifier=o||h();const{action:n,historyChanged:r,referrer:s,snapshot:a,snapshotHTML:l,response:c,visitCachedSnapshot:d,willRender:u,updateHistory:p,shouldCacheSnapshot:m,acceptsStreamResponse:f,direction:g,refresh:v}={...Re,...i};this.action=n,this.historyChanged=r,this.referrer=s,this.snapshot=a,this.snapshotHTML=l,this.response=c,this.isPageRefresh=this.view.isPageRefresh(this),this.visitCachedSnapshot=d,this.willRender=u,this.updateHistory=p,this.scrolled=!u,this.shouldCacheSnapshot=m,this.acceptsStreamResponse=f,this.direction=g||Ue[n],this.refresh=v}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}get restorationData(){return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)}start(){this.state==$e&&(this.recordTimingMetric(Be),this.state=Fe,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==Fe&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=Me)}complete(){this.state==Fe&&(this.recordTimingMetric(Le),this.adapter.visitCompleted(this),this.state=Ie,this.followRedirect(),this.followedRedirect||this.delegate.visitCompleted(this))}fail(){this.state==Fe&&(this.state=Oe,this.adapter.visitFailed(this),this.delegate.visitCompleted(this))}changeHistory(){if(!this.historyChanged&&this.updateHistory){const e=v(this.location.href===this.referrer?.href?"replace":this.action);this.history.update(e,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new K(this,U.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(Ve),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){const{statusCode:t}=e;je(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(De),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){const{statusCode:e,responseHTML:t}=this.response;this.render(async()=>{if(this.shouldCacheSnapshot&&this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,je(e)&&null!=t){const e=Ne.fromHTMLString(t);await this.renderPageSnapshot(e,!1),this.adapter.visitRendered(this),this.complete()}else await this.view.renderError(Ne.fromHTMLString(t),this),this.adapter.visitRendered(this),this.fail()})}}getCachedSnapshot(){const e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!R(this.location)||e.hasAnchor(R(this.location)))&&("restore"==this.action||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return Ne.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return null!=this.getCachedSnapshot()}loadCachedSnapshot(){const e=this.getCachedSnapshot();if(e){const t=this.shouldIssueRequest();this.render(async()=>{this.cacheSnapshot(),this.isPageRefresh?this.adapter.visitRendered(this):(this.view.renderPromise&&await this.view.renderPromise,await this.renderPageSnapshot(e,t),this.adapter.visitRendered(this),t||this.complete())})}}followRedirect(){this.redirectedToLocation&&!this.followedRedirect&&this.response?.redirected&&(this.adapter.visitProposedToLocation(this.redirectedToLocation,{action:"replace",response:this.response,shouldCacheSnapshot:!1,willRender:!1}),this.followedRedirect=!0)}prepareRequest(e){this.acceptsStreamResponse&&e.acceptResponseType(Z.contentType)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){const o=await t.responseHTML,{redirected:i,statusCode:n}=t;null==o?this.recordResponse({statusCode:He,redirected:i}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:n,responseHTML:o,redirected:i}))}async requestFailedWithResponse(e,t){const o=await t.responseHTML,{redirected:i,statusCode:n}=t;null==o?this.recordResponse({statusCode:He,redirected:i}):this.recordResponse({statusCode:n,responseHTML:o,redirected:i})}requestErrored(e,t){this.recordResponse({statusCode:ze,redirected:!1})}requestFinished(){this.finishRequest()}performScroll(){this.scrolled||this.view.forceReloaded||this.view.shouldPreserveScrollPosition(this)||("restore"==this.action?this.scrollToRestoredPosition()||this.scrollToAnchor()||this.view.scrollToTop():this.scrollToAnchor()||this.view.scrollToTop(),this.scrolled=!0)}scrollToRestoredPosition(){const{scrollPosition:e}=this.restorationData;if(e)return this.view.scrollToPosition(e),!0}scrollToAnchor(){const e=R(this.location);if(null!=e)return this.view.scrollToAnchor(e),!0}recordTimingMetric(e){this.timingMetrics[e]=(new Date).getTime()}getTimingMetrics(){return{...this.timingMetrics}}hasPreloadedResponse(){return"object"==typeof this.response}shouldIssueRequest(){return"restore"==this.action?!this.hasCachedSnapshot():this.willRender}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot(this.snapshot).then(e=>e&&this.visitCachedSnapshot(e)),this.snapshotCached=!0)}async render(e){this.cancelRender(),await new Promise(e=>{this.frame="hidden"===document.visibilityState?setTimeout(()=>e(),0):requestAnimationFrame(()=>e())}),await e(),delete this.frame}async renderPageSnapshot(e,t){await this.viewTransitioner.renderChange(this.view.shouldTransitionTo(e),async()=>{await this.view.renderPage(e,t,this.willRender,this),this.performScroll()})}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}}function je(e){return e>=200&&e<300}class Ke{progressBar=new Se;constructor(e){this.session=e}visitProposedToLocation(e,t){D(e,this.navigator.rootLocation)?this.navigator.startVisit(e,t?.restorationIdentifier||h(),t):window.location.href=e.toString()}visitStarted(e){this.location=e.location,this.redirectedToLocation=null,e.loadCachedSnapshot(),e.issueRequest()}visitRequestStarted(e){this.progressBar.setValue(0),e.hasCachedSnapshot()||"restore"!=e.action?this.showVisitProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(e){e.loadResponse(),e.response.redirected&&(this.redirectedToLocation=e.redirectedToLocation)}visitRequestFailedWithStatusCode(e,t){switch(t){case ze:case qe:case He:return this.reload({reason:"request_failed",context:{statusCode:t}});default:return e.loadResponse()}}visitRequestFinished(e){}visitCompleted(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}pageInvalidated(e){this.reload(e)}visitFailed(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}visitRendered(e){}linkPrefetchingIsEnabledForLocation(e){return!0}formSubmissionStarted(e){this.progressBar.setValue(0),this.showFormProgressBarAfterDelay()}formSubmissionFinished(e){this.progressBar.setValue(1),this.hideFormProgressBar()}showVisitProgressBarAfterDelay(){this.visitProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideVisitProgressBar(){this.progressBar.hide(),null!=this.visitProgressBarTimeout&&(window.clearTimeout(this.visitProgressBarTimeout),delete this.visitProgressBarTimeout)}showFormProgressBarAfterDelay(){null==this.formProgressBarTimeout&&(this.formProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay))}hideFormProgressBar(){this.progressBar.hide(),null!=this.formProgressBarTimeout&&(window.clearTimeout(this.formProgressBarTimeout),delete this.formProgressBarTimeout)}showProgressBar=()=>{this.progressBar.show()};reload(e){r("turbo:reload",{detail:e}),window.location.href=(this.redirectedToLocation||this.location)?.toString()||window.location.href}get navigator(){return this.session.navigator}}class Ge{selector="[data-turbo-temporary]";started=!1;start(){this.started||(this.started=!0,addEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}removeTemporaryElements=e=>{for(const t of this.temporaryElements)t.remove()};get temporaryElements(){return[...document.querySelectorAll(this.selector)]}}class Xe{constructor(e,t){this.session=e,this.element=t,this.linkInterceptor=new he(this,t),this.formSubmitObserver=new ce(this,t)}start(){this.linkInterceptor.start(),this.formSubmitObserver.start()}stop(){this.linkInterceptor.stop(),this.formSubmitObserver.stop()}shouldInterceptLinkClick(e,t,o){return this.#p(e)}linkClickIntercepted(e,t,o){const i=this.#m(e);i&&i.delegate.linkClickIntercepted(e,t,o)}willSubmitForm(e,t){return null==e.closest("turbo-frame")&&this.#f(e,t)&&this.#p(e,t)}formSubmitted(e,t){const o=this.#m(e,t);o&&o.delegate.formSubmitted(e,t)}#f(e,t){const o=B(e,t),i=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),n=P(i?.content??"/");return this.#p(e,t)&&D(o,n)}#p(e,t){if(e instanceof HTMLFormElement?this.session.submissionIsNavigatable(e,t):this.session.elementIsNavigatable(e)){const o=this.#m(e,t);return!!o&&o!=e.closest("turbo-frame")}return!1}#m(e,t){const i=t?.getAttribute("data-turbo-frame")||e.getAttribute("data-turbo-frame");if(i&&"_top"!=i){const e=this.element.querySelector(`#${i}:not([disabled])`);if(e instanceof o)return e}}}class Qe{location;restorationIdentifier=h();restorationData={};started=!1;currentIndex=0;constructor(e){this.delegate=e}start(){this.started||(addEventListener("popstate",this.onPopState,!1),this.currentIndex=history.state?.turbo?.restorationIndex||0,this.started=!0,this.replace(new URL(window.location.href)))}stop(){this.started&&(removeEventListener("popstate",this.onPopState,!1),this.started=!1)}push(e,t){this.update(history.pushState,e,t)}replace(e,t){this.update(history.replaceState,e,t)}update(e,t,o=h()){e===history.pushState&&++this.currentIndex;const i={turbo:{restorationIdentifier:o,restorationIndex:this.currentIndex}};e.call(history,i,"",t.href),this.location=t,this.restorationIdentifier=o}getRestorationDataForIdentifier(e){return this.restorationData[e]||{}}updateRestorationData(e){const{restorationIdentifier:t}=this,o=this.restorationData[t];this.restorationData[t]={...o,...e}}assumeControlOfScrollRestoration(){this.previousScrollRestoration||(this.previousScrollRestoration=history.scrollRestoration??"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}onPopState=e=>{const{turbo:t}=e.state||{};if(this.location=new URL(window.location.href),t){const{restorationIdentifier:e,restorationIndex:o}=t;this.restorationIdentifier=e;const i=o>this.currentIndex?"forward":"back";this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location,e,i),this.currentIndex=o}else this.currentIndex++,this.delegate.historyPoppedWithEmptyState(this.location)}}class Ye{started=!1;#g=null;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||("loading"===this.eventTarget.readyState?this.eventTarget.addEventListener("DOMContentLoaded",this.#v,{once:!0}):this.#v())}stop(){this.started&&(this.eventTarget.removeEventListener("mouseenter",this.#b,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("mouseleave",this.#y,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("turbo:before-fetch-request",this.#w,!0),this.started=!1)}#v=()=>{this.eventTarget.addEventListener("mouseenter",this.#b,{capture:!0,passive:!0}),this.eventTarget.addEventListener("mouseleave",this.#y,{capture:!0,passive:!0}),this.eventTarget.addEventListener("turbo:before-fetch-request",this.#w,!0),this.started=!0};#b=e=>{if("false"===w("turbo-prefetch"))return;const t=e.target;if(t.matches&&t.matches("a[href]:not([target^=_]):not([download])")&&this.#k(t)){const e=t,o=L(e);if(this.delegate.canPrefetchRequestToLocation(e,o)){this.#g=e;const i=new K(this,U.get,o,new URLSearchParams,t);i.fetchOptions.priority="low",ie.putLater(o,i,this.#_)}}};#y=e=>{e.target===this.#g&&this.#x()};#x=()=>{ie.clear(),this.#g=null};#w=e=>{if("FORM"!==e.target.tagName&&"GET"===e.detail.fetchOptions.method){const t=ie.get(e.detail.url);t&&(e.detail.fetchRequest=t),ie.clear()}};prepareRequest(e){const t=e.target;e.headers["X-Sec-Purpose"]="prefetch";const o=t.closest("turbo-frame"),i=t.getAttribute("data-turbo-frame")||o?.getAttribute("target")||o?.id;i&&"_top"!==i&&(e.headers["Turbo-Frame"]=i)}requestSucceededWithResponse(){}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}get#_(){return Number(w("turbo-prefetch-cache-time"))||oe}#k(e){return!!e.getAttribute("href")&&(!Je(e)&&(!Ze(e)&&(!et(e)&&(!tt(e)&&!it(e)))))}}const Je=e=>e.origin!==document.location.origin||!["http:","https:"].includes(e.protocol)||e.hasAttribute("target"),Ze=e=>e.pathname+e.search===document.location.pathname+document.location.search||e.href.startsWith("#"),et=e=>{if("false"===e.getAttribute("data-turbo-prefetch"))return!0;if("false"===e.getAttribute("data-turbo"))return!0;const t=_(e,"[data-turbo-prefetch]");return!(!t||"false"!==t.getAttribute("data-turbo-prefetch"))},tt=e=>{const t=e.getAttribute("data-turbo-method");return!(!t||"get"===t.toLowerCase())||(!!ot(e)||(!!e.hasAttribute("data-turbo-confirm")||!!e.hasAttribute("data-turbo-stream")))},ot=e=>e.hasAttribute("data-remote")||e.hasAttribute("data-behavior")||e.hasAttribute("data-confirm")||e.hasAttribute("data-method"),it=e=>r("turbo:before-prefetch",{target:e,cancelable:!0}).defaultPrevented;class nt{constructor(e){this.delegate=e}proposeVisit(e,t={}){this.delegate.allowsVisitingLocationWithAction(e,t.action)&&this.delegate.visitProposedToLocation(e,t)}startVisit(e,t,o={}){this.stop(),this.currentVisit=new We(this,P(e),t,{referrer:this.location,...o}),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new re(this,e,t,!0),this.formSubmission.start()}stop(){this.formSubmission&&(this.formSubmission.stop(),delete this.formSubmission),this.currentVisit&&(this.currentVisit.cancel(),delete this.currentVisit)}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get rootLocation(){return this.view.snapshot.rootLocation}get history(){return this.delegate.history}formSubmissionStarted(e){"function"==typeof this.adapter.formSubmissionStarted&&this.adapter.formSubmissionStarted(e)}async formSubmissionSucceededWithResponse(e,t){if(e==this.formSubmission){const o=await t.responseHTML;if(o){const i=e.isSafe;i||this.view.clearSnapshotCache();const{statusCode:n,redirected:r}=t,s={action:this.#E(e,t),shouldCacheSnapshot:i,response:{statusCode:n,responseHTML:o,redirected:r}};this.proposeVisit(t.location,s)}}}async formSubmissionFailedWithResponse(e,t){const o=await t.responseHTML;if(o){const e=Ne.fromHTMLString(o);t.serverError?await this.view.renderError(e,this.currentVisit):await this.view.renderPage(e,!1,!0,this.currentVisit),"preserve"!==e.refreshScroll&&this.view.scrollToTop(),this.view.clearSnapshotCache()}}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished(e){"function"==typeof this.adapter.formSubmissionFinished&&this.adapter.formSubmissionFinished(e)}linkPrefetchingIsEnabledForLocation(e){return"function"!=typeof this.adapter.linkPrefetchingIsEnabledForLocation||this.adapter.linkPrefetchingIsEnabledForLocation(e)}visitStarted(e){this.delegate.visitStarted(e)}visitCompleted(e){this.delegate.visitCompleted(e),delete this.currentVisit}locationWithActionIsSamePage(e,t){return!1}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}#E(e,t){const{submitter:o,formElement:i}=e;return b(o,i)||this.#S(t)}#S(e){return e.redirected&&e.location.href===this.location?.href?"replace":"advance"}}const rt=0,st=1,at=2,lt=3;class ct{stage=rt;started=!1;constructor(e){this.delegate=e}start(){this.started||(this.stage==rt&&(this.stage=st),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&&(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}interpretReadyState=()=>{const{readyState:e}=this;"interactive"==e?this.pageIsInteractive():"complete"==e&&this.pageIsComplete()};pageIsInteractive(){this.stage==st&&(this.stage=at,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==at&&(this.stage=lt,this.delegate.pageLoaded())}pageWillUnload=()=>{this.delegate.pageWillUnload()};get readyState(){return document.readyState}}class dt{started=!1;constructor(e){this.delegate=e}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}onScroll=()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})};updatePosition(e){this.delegate.scrollPositionChanged(e)}}class ut{render({fragment:e}){fe.preservingPermanentElements(this,function(e){const t=le(document.documentElement),o={};for(const i of t){const{id:t}=i;for(const n of e.querySelectorAll("turbo-stream")){const e=ae(n.templateElement.content,t);e&&(o[t]=[i,e])}}return o}(e),()=>{!async function(e,t){const o=`turbo-stream-autofocus-${h()}`,i=e.querySelectorAll("turbo-stream"),n=function(e){for(const t of e){const e=E(t.templateElement.content);if(e)return e}return null}(i);let r=null;n&&(r=n.id?n.id:o,n.id=r);t(),await a();if((null==document.activeElement||document.activeElement==document.body)&&r){const e=document.getElementById(r);x(e)&&e.focus(),e&&e.id==o&&e.removeAttribute("id")}}(e,()=>{!async function(e){const[t,o]=await async function(e,t){const o=t();return e(),await l(),[o,t()]}(e,()=>document.activeElement),i=t&&t.id;if(i){const e=document.getElementById(i);x(e)&&e!=o&&e.focus()}}(()=>{document.documentElement.appendChild(e)})})})}enteringBardo(e,t){t.replaceWith(e.cloneNode(!0))}leavingBardo(){}}class ht{sources=new Set;#C=!1;constructor(e){this.delegate=e}start(){this.#C||(this.#C=!0,addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){this.#C&&(this.#C=!1,removeEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}connectStreamSource(e){this.streamSourceIsConnected(e)||(this.sources.add(e),e.addEventListener("message",this.receiveMessageEvent,!1))}disconnectStreamSource(e){this.streamSourceIsConnected(e)&&(this.sources.delete(e),e.removeEventListener("message",this.receiveMessageEvent,!1))}streamSourceIsConnected(e){return this.sources.has(e)}inspectFetchResponse=e=>{const t=function(e){const t=e.detail?.fetchResponse;if(t instanceof O)return t}(e);t&&function(e){const t=e.contentType??"";return t.startsWith(Z.contentType)}(t)&&(e.preventDefault(),this.receiveMessageResponse(t))};receiveMessageEvent=e=>{this.#C&&"string"==typeof e.data&&this.receiveMessageHTML(e.data)};async receiveMessageResponse(e){const t=await e.responseHTML;t&&this.receiveMessageHTML(t)}receiveMessageHTML(e){this.delegate.receivedMessageFromStream(Z.wrap(e))}}class pt extends ge{static renderElement(e,t){const{documentElement:o,body:i}=document;o.replaceChild(t,i)}async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){const{documentElement:e,head:t}=document;e.replaceChild(this.newHead,t),this.renderElement(this.currentElement,this.newElement)}activateScriptElements(){for(const e of this.scriptElements){const t=e.parentNode;if(t){const o=n(e);t.replaceChild(o,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}}class mt extends ge{static renderElement(e,t){document.body&&t instanceof HTMLBodyElement?document.body.replaceWith(t):document.documentElement.appendChild(t)}get shouldRender(){return this.newSnapshot.isVisitable&&this.trackedElementsAreIdentical}get reloadReason(){return this.newSnapshot.isVisitable?this.trackedElementsAreIdentical?void 0:{reason:"tracked_element_mismatch"}:{reason:"turbo_visit_control_is_reload"}}async prepareToRender(){this.#A(),await this.mergeHead()}async render(){this.willRender&&await this.replaceBody()}finishRendering(){super.finishRendering(),this.isPreview||this.focusFirstAutofocusableElement()}get currentHeadSnapshot(){return this.currentSnapshot.headSnapshot}get newHeadSnapshot(){return this.newSnapshot.headSnapshot}get newElement(){return this.newSnapshot.element}#A(){const{documentElement:e}=this.currentSnapshot,{dir:t,lang:o}=this.newSnapshot;o?e.setAttribute("lang",o):e.removeAttribute("lang"),t?e.setAttribute("dir",t):e.removeAttribute("dir")}async mergeHead(){const e=this.mergeProvisionalElements(),t=this.copyNewHeadStylesheetElements();this.copyNewHeadScriptElements(),await e,await t,this.willRender&&this.removeUnusedDynamicStylesheetElements()}async replaceBody(){await this.preservingPermanentElements(async()=>{this.activateNewBody(),await this.assignNewBody()})}get trackedElementsAreIdentical(){return this.currentHeadSnapshot.trackedElementSignature==this.newHeadSnapshot.trackedElementSignature}async copyNewHeadStylesheetElements(){const e=[];for(const t of this.newHeadStylesheetElements)e.push(g(t)),document.head.appendChild(t);await Promise.all(e)}copyNewHeadScriptElements(){for(const e of this.newHeadScriptElements)document.head.appendChild(n(e))}removeUnusedDynamicStylesheetElements(){for(const e of this.unusedDynamicStylesheetElements)document.head.removeChild(e)}async mergeProvisionalElements(){const e=[...this.newHeadProvisionalElements];for(const t of this.currentHeadProvisionalElements)this.isCurrentElementInElementList(t,e)||document.head.removeChild(t);for(const t of e)document.head.appendChild(t)}isCurrentElementInElementList(e,t){for(const[o,i]of t.entries()){if("TITLE"==e.tagName){if("TITLE"!=i.tagName)continue;if(e.innerHTML==i.innerHTML)return t.splice(o,1),!0}if(i.isEqualNode(e))return t.splice(o,1),!0}return!1}removeCurrentHeadProvisionalElements(){for(const e of this.currentHeadProvisionalElements)document.head.removeChild(e)}copyNewHeadProvisionalElements(){for(const e of this.newHeadProvisionalElements)document.head.appendChild(e)}activateNewBody(){document.adoptNode(this.newElement),this.removeNoscriptElements(),this.activateNewBodyScriptElements()}removeNoscriptElements(){for(const e of this.newElement.querySelectorAll("noscript"))e.remove()}activateNewBodyScriptElements(){for(const e of this.newBodyScriptElements){const t=n(e);e.replaceWith(t)}}async assignNewBody(){await this.renderElement(this.currentElement,this.newElement)}get unusedDynamicStylesheetElements(){return this.oldHeadStylesheetElements.filter(e=>"dynamic"===e.getAttribute("data-turbo-track"))}get oldHeadStylesheetElements(){return this.currentHeadSnapshot.getStylesheetElementsNotInSnapshot(this.newHeadSnapshot)}get newHeadStylesheetElements(){return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)}get newHeadScriptElements(){return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)}get currentHeadProvisionalElements(){return this.currentHeadSnapshot.provisionalElements}get newHeadProvisionalElements(){return this.newHeadSnapshot.provisionalElements}get newBodyScriptElements(){return this.newElement.querySelectorAll("script")}}class ft extends mt{static renderElement(e,t){ye(e,t,{callbacks:{beforeNodeMorphed:(e,t)=>!(ke(e,t)&&!_e(e))||(e.reload(),!1)}}),r("turbo:morph",{detail:{currentElement:e,newElement:t}})}async preservingPermanentElements(e){return await e()}get renderMethod(){return"morph"}get shouldAutofocus(){return!1}}class gt extends te{constructor(e){super(e,$)}get snapshots(){return this.entries}}class vt extends de{snapshotCache=new gt(10);lastRenderedLocation=new URL(location.href);forceReloaded=!1;shouldTransitionTo(e){return this.snapshot.prefersViewTransitions&&e.prefersViewTransitions}renderPage(e,t=!1,o=!0,i){const n=new(this.isPageRefresh(i)&&"morph"===(i?.refresh?.method||this.snapshot.refreshMethod)?ft:mt)(this.snapshot,e,t,o);return n.shouldRender?i?.changeHistory():this.forceReloaded=!0,this.render(n)}renderError(e,t){t?.changeHistory();const o=new pt(this.snapshot,e,!1);return this.render(o)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(e=this.snapshot){if(e.isCacheable){this.delegate.viewWillCacheSnapshot();const{lastRenderedLocation:t}=this;await c();const o=e.clone();return this.snapshotCache.put(t,o),o}}getCachedSnapshotForLocation(e){return this.snapshotCache.get(e)}isPageRefresh(e){return!e||this.lastRenderedLocation.pathname===e.location.pathname&&"replace"===e.action}shouldPreserveScrollPosition(e){return this.isPageRefresh(e)&&"preserve"===(e?.refresh?.scroll||this.snapshot.refreshScroll)}get snapshot(){return Ne.fromElement(this.element)}}class bt{selector="a[data-turbo-preload]";constructor(e,t){this.delegate=e,this.snapshotCache=t}start(){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",this.#T):this.preloadOnLoadLinksForView(document.body)}stop(){document.removeEventListener("DOMContentLoaded",this.#T)}preloadOnLoadLinksForView(e){for(const t of e.querySelectorAll(this.selector))this.delegate.shouldPreloadLink(t)&&this.preloadURL(t)}async preloadURL(e){const t=new URL(e.href);if(this.snapshotCache.has(t))return;const o=new K(this,U.get,t,new URLSearchParams,e);await o.perform()}prepareRequest(e){e.headers["X-Sec-Purpose"]="prefetch"}async requestSucceededWithResponse(e,t){try{const o=await t.responseHTML,i=Ne.fromHTMLString(o);this.snapshotCache.put(e.url,i)}catch(li){}}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}#T=()=>{this.preloadOnLoadLinksForView(document.body)}}class yt{constructor(e){this.session=e}clear(){this.session.clearCache()}resetCacheControl(){this.#N("")}exemptPageFromCache(){this.#N("no-cache")}exemptPageFromPreview(){this.#N("no-preview")}#N(e){!function(e,t){let o=y(e);o||(o=document.createElement("meta"),o.setAttribute("name",e),document.head.appendChild(o)),o.setAttribute("content",t)}("turbo-cache-control",e)}}function wt(e){Object.defineProperties(e,kt)}const kt={absoluteURL:{get(){return this.toString()}}},_t=new class{navigator=new nt(this);history=new Qe(this);view=new vt(this,document.documentElement);adapter=new Ke(this);pageObserver=new ct(this);cacheObserver=new Ge;linkPrefetchObserver=new Ye(this,document);linkClickObserver=new pe(this,window);formSubmitObserver=new ce(this,document);scrollObserver=new dt(this);streamObserver=new ht(this);formLinkClickObserver=new me(this,document.documentElement);frameRedirector=new Xe(this,document.documentElement);streamMessageRenderer=new ut;cache=new yt(this);enabled=!0;started=!1;#P=150;constructor(e){this.recentRequests=e,this.preloader=new bt(this,this.view.snapshotCache),this.debouncedRefresh=this.refresh,this.pageRefreshDebouncePeriod=this.pageRefreshDebouncePeriod}start(){this.started||(this.pageObserver.start(),this.cacheObserver.start(),this.linkPrefetchObserver.start(),this.formLinkClickObserver.start(),this.linkClickObserver.start(),this.formSubmitObserver.start(),this.scrollObserver.start(),this.streamObserver.start(),this.frameRedirector.start(),this.history.start(),this.preloader.start(),this.started=!0,this.enabled=!0)}disable(){this.enabled=!1}stop(){this.started&&(this.pageObserver.stop(),this.cacheObserver.stop(),this.linkPrefetchObserver.stop(),this.formLinkClickObserver.stop(),this.linkClickObserver.stop(),this.formSubmitObserver.stop(),this.scrollObserver.stop(),this.streamObserver.stop(),this.frameRedirector.stop(),this.history.stop(),this.preloader.stop(),this.started=!1)}registerAdapter(e){this.adapter=e}visit(e,t={}){const i=t.frame?document.getElementById(t.frame):null;if(i instanceof o){const o=t.action||b(i);i.delegate.proposeVisitIfNavigatedWithAction(i,o),i.src=e.toString()}else this.navigator.proposeVisit(P(e),t)}refresh(e,t={}){t="string"==typeof t?{requestId:t}:t;const{method:o,requestId:i,scroll:n}=t,r=i&&this.recentRequests.has(i),s=e===document.baseURI;r||this.navigator.currentVisit||!s||this.visit(e,{action:"replace",shouldCacheSnapshot:!1,refresh:{method:o,scroll:n}})}connectStreamSource(e){this.streamObserver.connectStreamSource(e)}disconnectStreamSource(e){this.streamObserver.disconnectStreamSource(e)}renderStreamMessage(e){this.streamMessageRenderer.render(Z.wrap(e))}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(e){console.warn("Please replace `session.setProgressBarDelay(delay)` with `session.progressBarDelay = delay`. The function is deprecated and will be removed in a future version of Turbo.`"),this.progressBarDelay=e}set progressBarDelay(e){N.drive.progressBarDelay=e}get progressBarDelay(){return N.drive.progressBarDelay}set drive(e){N.drive.enabled=e}get drive(){return N.drive.enabled}set formMode(e){N.forms.mode=e}get formMode(){return N.forms.mode}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}get pageRefreshDebouncePeriod(){return this.#P}set pageRefreshDebouncePeriod(e){this.refresh=function(e,t){let o=null;return(...i)=>{clearTimeout(o),o=setTimeout(()=>e.apply(this,i),t)}}(this.debouncedRefresh.bind(this),e),this.#P=e}shouldPreloadLink(e){const t=e.hasAttribute("data-turbo-method"),i=e.hasAttribute("data-turbo-stream"),n=e.getAttribute("data-turbo-frame"),r="_top"==n?null:document.getElementById(n)||_(e,"turbo-frame:not([disabled])");if(t||i||r instanceof o)return!1;{const t=new URL(e.href);return this.elementIsNavigatable(e)&&D(t,this.snapshot.rootLocation)}}historyPoppedToLocationWithRestorationIdentifierAndDirection(e,t,o){this.enabled?this.navigator.startVisit(e,t,{action:"restore",historyChanged:!0,direction:o}):this.adapter.pageInvalidated({reason:"turbo_disabled"})}historyPoppedWithEmptyState(e){this.history.replace(e),this.view.lastRenderedLocation=e,this.view.cacheSnapshot()}scrollPositionChanged(e){this.history.updateRestorationData({scrollPosition:e})}willSubmitFormLinkToLocation(e,t){return this.elementIsNavigatable(e)&&D(t,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}canPrefetchRequestToLocation(e,t){return this.elementIsNavigatable(e)&&D(t,this.snapshot.rootLocation)&&this.navigator.linkPrefetchingIsEnabledForLocation(t)}willFollowLinkToLocation(e,t,o){return this.elementIsNavigatable(e)&&D(t,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(e,t,o)}followedLinkToLocation(e,t){const o=this.getActionForLink(e),i=e.hasAttribute("data-turbo-stream");this.visit(t.href,{action:o,acceptsStreamResponse:i})}allowsVisitingLocationWithAction(e,t){return this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,t){wt(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){e.acceptsStreamResponse||(m(document.documentElement),this.view.markVisitDirection(e.direction)),wt(e.location),this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.view.unmarkVisitDirection(),f(document.documentElement),this.notifyApplicationAfterPageLoad(e.getTimingMetrics())}willSubmitForm(e,t){const o=B(e,t);return this.submissionIsNavigatable(e,t)&&D(P(o),this.snapshot.rootLocation)}formSubmitted(e,t){this.navigator.submitForm(e,t)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(e){this.renderStreamMessage(e)}viewWillCacheSnapshot(){this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:e},t){const o=this.notifyApplicationBeforeRender(e,t),{defaultPrevented:i,detail:{render:n}}=o;return this.view.renderer&&n&&(this.view.renderer.renderElement=n),!i}viewRenderedSnapshot(e,t,o){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender(o)}preloadOnLoadLinksForView(e){this.preloader.preloadOnLoadLinksForView(e)}viewInvalidated(e){this.adapter.pageInvalidated(e)}frameLoaded(e){this.notifyApplicationAfterFrameLoad(e)}frameRendered(e,t){this.notifyApplicationAfterFrameRender(e,t)}applicationAllowsFollowingLinkToLocation(e,t,o){return!this.notifyApplicationAfterClickingLinkToLocation(e,t,o).defaultPrevented}applicationAllowsVisitingLocation(e){return!this.notifyApplicationBeforeVisitingLocation(e).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(e,t,o){return r("turbo:click",{target:e,detail:{url:t.href,originalEvent:o},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return r("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,t){return r("turbo:visit",{detail:{url:e.href,action:t}})}notifyApplicationBeforeCachingSnapshot(){return r("turbo:before-cache")}notifyApplicationBeforeRender(e,t){return r("turbo:before-render",{detail:{newBody:e,...t},cancelable:!0})}notifyApplicationAfterRender(e){return r("turbo:render",{detail:{renderMethod:e}})}notifyApplicationAfterPageLoad(e={}){return r("turbo:load",{detail:{url:this.location.href,timing:e}})}notifyApplicationAfterFrameLoad(e){return r("turbo:frame-load",{target:e})}notifyApplicationAfterFrameRender(e,t){return r("turbo:frame-render",{detail:{fetchResponse:e},target:t,cancelable:!0})}submissionIsNavigatable(e,t){if("off"==N.forms.mode)return!1;{const o=!t||this.elementIsNavigatable(t);return"optin"==N.forms.mode?o&&null!=e.closest('[data-turbo="true"]'):o&&this.elementIsNavigatable(e)}}elementIsNavigatable(e){const t=_(e,"[data-turbo]"),o=_(e,"turbo-frame");return N.drive.enabled||o?!t||"false"!=t.getAttribute("data-turbo"):!!t&&"true"==t.getAttribute("data-turbo")}getActionForLink(e){return b(e)||"advance"}get snapshot(){return this.view.snapshot}}(z),{cache:xt,navigator:Et}=_t;function St(){_t.start()}function Ct(e){_t.registerAdapter(e)}function At(e,t){_t.visit(e,t)}function Tt(e){_t.connectStreamSource(e)}function Nt(e){_t.disconnectStreamSource(e)}function Pt(e){_t.renderStreamMessage(e)}function Rt(e){console.warn("Please replace `Turbo.setProgressBarDelay(delay)` with `Turbo.config.drive.progressBarDelay = delay`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),N.drive.progressBarDelay=e}function Bt(e){console.warn("Please replace `Turbo.setConfirmMethod(confirmMethod)` with `Turbo.config.forms.confirm = confirmMethod`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),N.forms.confirm=e}function Vt(e){console.warn("Please replace `Turbo.setFormMode(mode)` with `Turbo.config.forms.mode = mode`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),N.forms.mode=e}function Dt(e,t){ft.renderElement(e,t)}function Lt(e,t){Ee.renderElement(e,t)}var $t=Object.freeze({__proto__:null,PageRenderer:mt,PageSnapshot:Ne,FrameRenderer:ve,fetch:q,config:N,session:_t,cache:xt,navigator:Et,start:St,registerAdapter:Ct,visit:At,connectStreamSource:Tt,disconnectStreamSource:Nt,renderStreamMessage:Pt,setProgressBarDelay:Rt,setConfirmMethod:Bt,setFormMode:Vt,morphBodyElements:Dt,morphTurboFrameElements:Lt,morphChildren:we,morphElements:ye});class Ft extends Error{}function Mt(e,t){if(e){const i=e.getAttribute("src");if(null!=i&&null!=t&&F(i,t))throw new Error(`Matching <turbo-frame id="${e.id}"> element has a source URL which references itself`);if(e.ownerDocument!==document&&(e=document.importNode(e,!0)),e instanceof o)return e.connectedCallback(),e.disconnectedCallback(),e}}const Ot={after(){this.removeDuplicateTargetSiblings(),this.targetElements.forEach(e=>e.parentElement?.insertBefore(this.templateContent,e.nextSibling))},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(e=>e.append(this.templateContent))},before(){this.removeDuplicateTargetSiblings(),this.targetElements.forEach(e=>e.parentElement?.insertBefore(this.templateContent,e))},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(e=>e.prepend(this.templateContent))},remove(){this.targetElements.forEach(e=>e.remove())},replace(){const e=this.getAttribute("method");this.targetElements.forEach(t=>{"morph"===e?ye(t,this.templateContent):t.replaceWith(this.templateContent)})},update(){const e=this.getAttribute("method");this.targetElements.forEach(t=>{"morph"===e?we(t,this.templateContent):(t.innerHTML="",t.append(this.templateContent))})},refresh(){const e=this.getAttribute("method"),t=this.requestId,o=this.getAttribute("scroll");_t.refresh(this.baseURI,{method:e,requestId:t,scroll:o})}};class It extends HTMLElement{static async renderElement(e){await e.performAction()}async connectedCallback(){try{await this.render()}catch(e){console.error(e)}finally{this.disconnect()}}async render(){return this.renderPromise??=(async()=>{const e=this.beforeRenderEvent;this.dispatchEvent(e)&&(await a(),await e.detail.render(this))})()}disconnect(){try{this.remove()}catch{}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(e=>e.remove())}get duplicateChildren(){const e=this.targetElements.flatMap(e=>[...e.children]).filter(e=>!!e.getAttribute("id")),t=[...this.templateContent?.children||[]].filter(e=>!!e.getAttribute("id")).map(e=>e.getAttribute("id"));return e.filter(e=>t.includes(e.getAttribute("id")))}removeDuplicateTargetSiblings(){this.duplicateSiblings.forEach(e=>e.remove())}get duplicateSiblings(){const e=this.targetElements.flatMap(e=>[...e.parentElement.children]).filter(e=>!!e.id),t=[...this.templateContent?.children||[]].filter(e=>!!e.id).map(e=>e.id);return e.filter(e=>t.includes(e.id))}get performAction(){if(this.action){const e=Ot[this.action];if(e)return e;this.#R("unknown action")}this.#R("action attribute is missing")}get targetElements(){return this.target?this.targetElementsById:this.targets?this.targetElementsByQuery:void this.#R("target or targets attribute is missing")}get templateContent(){return this.templateElement.content.cloneNode(!0)}get templateElement(){if(null===this.firstElementChild){const e=this.ownerDocument.createElement("template");return this.appendChild(e),e}if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;this.#R("first child element must be a <template> element")}get action(){return this.getAttribute("action")}get target(){return this.getAttribute("target")}get targets(){return this.getAttribute("targets")}get requestId(){return this.getAttribute("request-id")}#R(e){throw new Error(`${this.description}: ${e}`)}get description(){return(this.outerHTML.match(/<[^>]+>/)??[])[0]??"<turbo-stream>"}get beforeRenderEvent(){return new CustomEvent("turbo:before-stream-render",{bubbles:!0,cancelable:!0,detail:{newStream:this,render:It.renderElement}})}get targetElementsById(){const e=this.ownerDocument?.getElementById(this.target);return null!==e?[e]:[]}get targetElementsByQuery(){const e=this.ownerDocument?.querySelectorAll(this.targets);return 0!==e.length?Array.prototype.slice.call(e):[]}}class zt extends HTMLElement{streamSource=null;connectedCallback(){this.streamSource=this.src.match(/^ws{1,2}:/)?new WebSocket(this.src):new EventSource(this.src),Tt(this.streamSource)}disconnectedCallback(){this.streamSource&&(this.streamSource.close(),Nt(this.streamSource))}get src(){return this.getAttribute("src")||""}}o.delegateConstructor=class{fetchResponseLoaded=e=>Promise.resolve();#B=null;#V=()=>{};#D=!1;#L=!1;#$=new Set;#F=!1;action=null;constructor(e){this.element=e,this.view=new ue(this,this.element),this.appearanceObserver=new J(this,this.element),this.formLinkClickObserver=new me(this,this.element),this.linkInterceptor=new he(this,this.element),this.restorationIdentifier=h(),this.formSubmitObserver=new ce(this,this.element)}connect(){this.#D||(this.#D=!0,this.loadingStyle==t.lazy?this.appearanceObserver.start():this.#M(),this.formLinkClickObserver.start(),this.linkInterceptor.start(),this.formSubmitObserver.start())}disconnect(){this.#D&&(this.#D=!1,this.appearanceObserver.stop(),this.formLinkClickObserver.stop(),this.linkInterceptor.stop(),this.formSubmitObserver.stop(),this.element.hasAttribute("recurse")||this.#B?.cancel())}disabledChanged(){this.disabled?this.#B?.cancel():this.loadingStyle==t.eager&&this.#M()}sourceURLChanged(){this.#O("src")||(this.sourceURL||this.#B?.cancel(),this.element.isConnected&&(this.complete=!1),(this.loadingStyle==t.eager||this.#L)&&this.#M())}sourceURLReloaded(){const{refresh:e,src:t}=this.element;return this.#F=t&&"morph"===e,this.element.removeAttribute("complete"),this.element.src=null,this.element.src=t,this.element.loaded}loadingStyleChanged(){this.loadingStyle==t.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.#M())}async#M(){this.enabled&&this.isActive&&!this.complete&&this.sourceURL&&(this.element.loaded=this.#I(P(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,this.#L=!0)}async loadResponse(e){(e.redirected||e.succeeded&&e.isHTML)&&(this.sourceURL=e.response.url);try{const t=await e.responseHTML;if(t){const o=d(t);Ne.fromDocument(o).isVisitable?await this.#z(e,o):await this.#q(e)}}finally{this.#F=!1,this.fetchResponseLoaded=()=>Promise.resolve()}}elementAppearedInViewport(e){this.proposeVisitIfNavigatedWithAction(e,b(e)),this.#M()}willSubmitFormLinkToLocation(e){return this.#H(e)}submittedFormLinkToLocation(e,t,o){const i=this.#m(e);i&&o.setAttribute("data-turbo-frame",i.id)}shouldInterceptLinkClick(e,t,o){return this.#H(e)}linkClickIntercepted(e,t){this.#U(e,t)}willSubmitForm(e,t){return e.closest("turbo-frame")==this.element&&this.#H(e,t)}formSubmitted(e,t){this.formSubmission&&this.formSubmission.stop(),this.formSubmission=new re(this,e,t);const{fetchRequest:o}=this.formSubmission,i=this.#m(e,t);this.prepareRequest(o,i),this.formSubmission.start()}prepareRequest(e,t=this){e.headers["Turbo-Frame"]=t.id,this.currentNavigationElement?.hasAttribute("data-turbo-stream")&&e.acceptResponseType(Z.contentType)}requestStarted(e){m(this.element)}requestPreventedHandlingResponse(e,t){this.#V()}async requestSucceededWithResponse(e,t){await this.loadResponse(t),this.#V()}async requestFailedWithResponse(e,t){await this.loadResponse(t),this.#V()}requestErrored(e,t){console.error(t),this.#V()}requestFinished(e){f(this.element)}formSubmissionStarted({formElement:e}){m(e,this.#m(e))}formSubmissionSucceededWithResponse(e,t){const o=this.#m(e.formElement,e.submitter);o.delegate.proposeVisitIfNavigatedWithAction(o,b(e.submitter,e.formElement,o)),o.delegate.loadResponse(t),e.isSafe||_t.clearCache()}formSubmissionFailedWithResponse(e,t){this.element.delegate.loadResponse(t),_t.clearCache()}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished({formElement:e}){f(e,this.#m(e))}allowsImmediateRender({element:e},t){const o=r("turbo:before-frame-render",{target:this.element,detail:{newFrame:e,...t},cancelable:!0}),{defaultPrevented:i,detail:{render:n}}=o;return this.view.renderer&&n&&(this.view.renderer.renderElement=n),!i}viewRenderedSnapshot(e,t,o){}preloadOnLoadLinksForView(e){_t.preloadOnLoadLinksForView(e)}viewInvalidated(){}willRenderFrame(e,t){this.previousFrameElement=e.cloneNode(!0)}visitCachedSnapshot=({element:e})=>{const t=e.querySelector("#"+this.element.id);t&&this.previousFrameElement&&t.replaceChildren(...this.previousFrameElement.children),delete this.previousFrameElement};async#z(e,t){const o=await this.extractForeignFrameElement(t.body),i=this.#F?Ee:ve;if(o){const t=new se(o),n=new i(this,this.view.snapshot,t,!1,!1);this.view.renderPromise&&await this.view.renderPromise,this.changeHistory(),await this.view.render(n),this.complete=!0,_t.frameRendered(e,this.element),_t.frameLoaded(this.element),await this.fetchResponseLoaded(e)}else this.#W(e)&&this.#j(e)}async#I(e){const t=new K(this,U.get,e,new URLSearchParams,this.element);return this.#B?.cancel(),this.#B=t,new Promise(e=>{this.#V=()=>{this.#V=()=>{},this.#B=null,e()},t.perform()})}#U(e,t,o){const i=this.#m(e,o);i.delegate.proposeVisitIfNavigatedWithAction(i,b(o,e,i)),this.#K(e,()=>{i.src=t})}proposeVisitIfNavigatedWithAction(e,t=null){if(this.action=t,this.action){const t=Ne.fromElement(e).clone(),{visitCachedSnapshot:o}=e.delegate;e.delegate.fetchResponseLoaded=async i=>{if(e.src){const{statusCode:n,redirected:r}=i,s={response:{statusCode:n,redirected:r,responseHTML:await i.responseHTML},visitCachedSnapshot:o,willRender:!1,updateHistory:!1,restorationIdentifier:this.restorationIdentifier,snapshot:t};this.action&&(s.action=this.action),_t.visit(e.src,s)}}}}changeHistory(){if(this.action){const e=v(this.action);_t.history.update(e,P(this.element.src||""),this.restorationIdentifier)}}async#q(e){console.warn(`The response (${e.statusCode}) from <turbo-frame id="${this.element.id}"> is performing a full page visit due to turbo-visit-control.`),await this.#G(e.response)}#W(e){this.element.setAttribute("complete","");const t=e.response;return!r("turbo:frame-missing",{target:this.element,detail:{response:t,visit:async(e,t)=>{e instanceof Response?this.#G(e):_t.visit(e,t)}},cancelable:!0}).defaultPrevented}#j(e){this.view.missing(),this.#X(e)}#X(e){const t=`The response (${e.statusCode}) did not contain the expected <turbo-frame id="${this.element.id}"> and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;throw new Ft(t)}async#G(e){const t=new O(e),o=await t.responseHTML,{location:i,redirected:n,statusCode:r}=t;return _t.visit(i,{response:{redirected:n,statusCode:r,responseHTML:o}})}#m(e,t){const i=p("data-turbo-frame",t,e)||this.element.getAttribute("target"),n=this.#Q(i);return n instanceof o?n:this.element}async extractForeignFrameElement(e){let t;const i=CSS.escape(this.id);try{if(t=Mt(e.querySelector(`turbo-frame#${i}`),this.sourceURL),t)return t;if(t=Mt(e.querySelector(`turbo-frame[src][recurse~=${i}]`),this.sourceURL),t)return await t.loaded,await this.extractForeignFrameElement(t)}catch(n){return console.error(n),new o}return null}#Y(e,t){return D(P(B(e,t)),this.rootLocation)}#H(e,t){const o=p("data-turbo-frame",t,e)||this.element.getAttribute("target");if(e instanceof HTMLFormElement&&!this.#Y(e,t))return!1;if(!this.enabled||"_top"==o)return!1;if(o){const e=this.#Q(o);if(e)return!e.disabled;if("_parent"==o)return!1}return!!_t.elementIsNavigatable(e)&&!(t&&!_t.elementIsNavigatable(t))}get id(){return this.element.id}get disabled(){return this.element.disabled}get enabled(){return!this.disabled}get sourceURL(){if(this.element.src)return this.element.src}set sourceURL(e){this.#J("src",()=>{this.element.src=e??null})}get loadingStyle(){return this.element.loading}get isLoading(){return void 0!==this.formSubmission||void 0!==this.#V()}get complete(){return this.element.hasAttribute("complete")}set complete(e){e?this.element.setAttribute("complete",""):this.element.removeAttribute("complete")}get isActive(){return this.element.isActive&&this.#D}get rootLocation(){const e=this.element.ownerDocument.querySelector('meta[name="turbo-root"]');return P(e?.content??"/")}#O(e){return this.#$.has(e)}#J(e,t){this.#$.add(e),t(),this.#$.delete(e)}#K(e,t){this.currentNavigationElement=e,t(),delete this.currentNavigationElement}#Q(e){if(null!=e){const t="_parent"===e?this.element.parentElement.closest("turbo-frame"):document.getElementById(e);if(t instanceof o)return t}}},void 0===customElements.get("turbo-frame")&&customElements.define("turbo-frame",o),void 0===customElements.get("turbo-stream")&&customElements.define("turbo-stream",It),void 0===customElements.get("turbo-stream-source")&&customElements.define("turbo-stream-source",zt),(()=>{const e=document.currentScript;if(!e)return;if(e.hasAttribute("data-turbo-suppress-warning"))return;let t=e.parentElement;for(;t;){if(t==document.body)return console.warn(u`
        You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do!

        Load your application’s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.

        For more information, see: https://turbo.hotwired.dev/handbook/building#working-with-script-elements

        ——
        Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s
      `,e.outerHTML);t=t.parentElement}})(),window.Turbo={...$t,StreamActions:Ot},St();const qt=Object.freeze(Object.defineProperty({__proto__:null,FetchEnctype:j,FetchMethod:U,FetchRequest:K,FetchResponse:O,FrameElement:o,FrameLoadingStyle:t,FrameRenderer:ve,PageRenderer:mt,PageSnapshot:Ne,StreamActions:Ot,StreamElement:It,StreamSourceElement:zt,cache:xt,config:N,connectStreamSource:Tt,disconnectStreamSource:Nt,fetch:q,fetchEnctypeFromString:W,fetchMethodFromString:H,isSafe:G,morphBodyElements:Dt,morphChildren:we,morphElements:ye,morphTurboFrameElements:Lt,navigator:Et,registerAdapter:Ct,renderStreamMessage:Pt,session:_t,setConfirmMethod:Bt,setFormMode:Vt,setProgressBarDelay:Rt,start:St,visit:At},Symbol.toStringTag,{value:"Module"}));_t.drive=!1,window.Turbo=qt;const Ht=async(e,{method:t="GET",body:o}={})=>{const i=()=>fetch(e,{method:t,headers:{"X-WP-Nonce":window.BookiFlex.nonce,"Content-Type":"application/json"},body:void 0!==o?JSON.stringify(o):void 0,credentials:"include"}),n=await i(),r=await n.json();if("rest_cookie_invalid_nonce"===r.code)try{return await(async()=>{const e=await fetch(`${window.ajaxurl}?action=rest-nonce`,{credentials:"include"}),t=await e.text();window.BookiFlex.nonce=t.trim()})(),await(async e=>{const t=await e.json();if(e.ok&&"success"===t.status)return t.result;const o=t.message||"Unknown API error",i=t.code||"api_error",n=new Error(o);throw n.code=i,n.data=t.data,n.status=e.status,n})(await i())}catch{return window.location.reload(),new Promise(()=>{})}if(n.ok&&"success"===r.status)return r.result;const s=r.message||"Unknown API error",a=r.code||"api_error",l=new Error(s);throw l.code=a,l.data=r.data,l.status=n.status,l},Ut=async(e,t)=>{const o=`${window.wpApiSettings.root}bflex/v1/payment/token/capture`;try{return await Ht(o,{method:"POST",body:{paymentId:e,reservationSid:t}})}catch(i){throw console.error("Failed to create payment token:",i),i}},Wt=async(e,t)=>{const o=`${window.wpApiSettings.root}bflex/v1/payment/token/cancel`;try{return await Ht(o,{method:"POST",body:{paymentId:e,reservationSid:t}})}catch(i){throw console.error("Failed to create payment token:",i),i}},jt=async e=>{const t=`${window.wpApiSettings.root}bflex/v1/dateUnits`;try{return await Ht(t,{method:"POST",body:e})}catch(o){throw console.error("Failed to synchronization:",o),o}},Kt="WAITING_CONFIRMATION",Gt="WAITING_PAYMENT",Xt="OVERDUE",Qt="CONFIRMED",Yt="CANCELLED",Jt="IN_HOUSE",Zt="NO_SHOW",eo="COMPLETED",to="WAITING",oo="AUTHORIZED",io=(e="bflex-custom-tables")=>{globalThis.window&&window.Turbo&&document.getElementById(e)&&window.Turbo.visit(window.location.href,{frame:e,action:"replace"})};function no(e,t="USD"){const o=e/100;try{return new Intl.NumberFormat(window.navigator.language,{style:"currency",currency:t,minimumFractionDigits:2,maximumFractionDigits:2}).format(o)}catch(da){return`${t} ${o.toFixed(2)}`}}function ro(e){const[t,o,i]=e.match(/([+-])(\d{1,2}):(\d{2})/).slice(1),n=(60*parseInt(o,10)+parseInt(i,10))*("+"===t?1:-1),r=(new Date).getTime()+60*n*1e3,s=new Date(r);return`${s.getUTCFullYear()}-${String(s.getUTCMonth()+1).padStart(2,"0")}-${String(s.getUTCDate()).padStart(2,"0")}`}function so(e){return new Date(e).toLocaleDateString(void 0,{day:"numeric",month:"short"})}function ao(){if(!window.jQuery)return void console.warn("jQuery not available for WP List Table reinitialization");const e=window.jQuery,t=e(".wp-list-table");0!==t.length&&(t.off("click",".toggle-row"),t.on("click",".toggle-row",function(t){t.preventDefault();e(this).closest("tr").toggleClass("is-expanded")}),t.find("tbody tr").each(function(){const t=e(this);if(0===t.find(".toggle-row").length&&t.find(".row-actions").length>0){t.attr("id");const e='<button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>',o=t.find(".column-primary");o.length>0&&!o.find(".toggle-row").length&&o.append(e)}}))}var lo="";function co(e){lo=e}var uo=Object.defineProperty,ho=Object.defineProperties,po=Object.getOwnPropertyDescriptor,mo=Object.getOwnPropertyDescriptors,fo=Object.getOwnPropertySymbols,go=Object.prototype.hasOwnProperty,vo=Object.prototype.propertyIsEnumerable,bo=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),yo=e=>{throw TypeError(e)},wo=(e,t,o)=>t in e?uo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,ko=(e,t)=>{for(var o in t||(t={}))go.call(t,o)&&wo(e,o,t[o]);if(fo)for(var o of fo(t))vo.call(t,o)&&wo(e,o,t[o]);return e},_o=(e,t)=>ho(e,mo(t)),xo=(e,t,o,i)=>{for(var n,r=i>1?void 0:i?po(t,o):t,s=e.length-1;s>=0;s--)(n=e[s])&&(r=(i?n(t,o,r):n(r))||r);return i&&r&&uo(t,o,r),r},Eo=(e,t,o)=>t.has(e)||yo("Cannot "+o),So=function(e,t){this[0]=e,this[1]=t};const Co=globalThis,Ao=Co.ShadowRoot&&(void 0===Co.ShadyCSS||Co.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,To=Symbol(),No=new WeakMap;let Po=class{constructor(e,t,o){if(this._$cssResult$=!0,o!==To)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(Ao&&void 0===e){const o=void 0!==t&&1===t.length;o&&(e=No.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),o&&No.set(t,e))}return e}toString(){return this.cssText}};const Ro=(e,...t)=>{const o=1===e.length?e[0]:t.reduce((t,o,i)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+e[i+1],e[0]);return new Po(o,e,To)},Bo=Ao?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const o of e.cssRules)t+=o.cssText;return(e=>new Po("string"==typeof e?e:e+"",void 0,To))(t)})(e):e,{is:Vo,defineProperty:Do,getOwnPropertyDescriptor:Lo,getOwnPropertyNames:$o,getOwnPropertySymbols:Fo,getPrototypeOf:Mo}=Object,Oo=globalThis,Io=Oo.trustedTypes,zo=Io?Io.emptyScript:"",qo=Oo.reactiveElementPolyfillSupport,Ho=(e,t)=>e,Uo={toAttribute(e,t){switch(t){case Boolean:e=e?zo:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let o=e;switch(t){case Boolean:o=null!==e;break;case Number:o=null===e?null:Number(e);break;case Object:case Array:try{o=JSON.parse(e)}catch(e){o=null}}return o}},Wo=(e,t)=>!Vo(e,t),jo={attribute:!0,type:String,converter:Uo,reflect:!1,useDefault:!1,hasChanged:Wo};Symbol.metadata??=Symbol("metadata"),Oo.litPropertyMetadata??=new WeakMap;let Ko=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=jo){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const o=Symbol(),i=this.getPropertyDescriptor(e,o,t);void 0!==i&&Do(this.prototype,e,i)}}static getPropertyDescriptor(e,t,o){const{get:i,set:n}=Lo(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:i,set(t){const r=i?.call(this);n?.call(this,t),this.requestUpdate(e,r,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??jo}static _$Ei(){if(this.hasOwnProperty(Ho("elementProperties")))return;const e=Mo(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Ho("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ho("properties"))){const e=this.properties,t=[...$o(e),...Fo(e)];for(const o of t)this.createProperty(o,e[o])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,o]of t)this.elementProperties.set(e,o)}this._$Eh=new Map;for(const[t,o]of this.elementProperties){const e=this._$Eu(t,o);void 0!==e&&this._$Eh.set(e,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const o=new Set(e.flat(1/0).reverse());for(const e of o)t.unshift(Bo(e))}else void 0!==e&&t.push(Bo(e));return t}static _$Eu(e,t){const o=t.attribute;return!1===o?void 0:"string"==typeof o?o:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const o of t.keys())this.hasOwnProperty(o)&&(e.set(o,this[o]),delete this[o]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(Ao)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const o of t){const t=document.createElement("style"),i=Co.litNonce;void 0!==i&&t.setAttribute("nonce",i),t.textContent=o.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,o){this._$AK(e,o)}_$ET(e,t){const o=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,o);if(void 0!==i&&!0===o.reflect){const n=(void 0!==o.converter?.toAttribute?o.converter:Uo).toAttribute(t,o.type);this._$Em=e,null==n?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(e,t){const o=this.constructor,i=o._$Eh.get(e);if(void 0!==i&&this._$Em!==i){const e=o.getPropertyOptions(i),n="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:Uo;this._$Em=i;const r=n.fromAttribute(t,e.type);this[i]=r??this._$Ej?.get(i)??r,this._$Em=null}}requestUpdate(e,t,o,i=!1,n){if(void 0!==e){const r=this.constructor;if(!1===i&&(n=this[e]),o??=r.getPropertyOptions(e),!((o.hasChanged??Wo)(n,t)||o.useDefault&&o.reflect&&n===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,o))))return;this.C(e,t,o)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:o,reflect:i,wrapped:n},r){o&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,r??t??this[e]),!0!==n||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||o||(t=void 0),this._$AL.set(e,t)),!0===i&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,o]of e){const{wrapped:e}=o,i=this[t];!0!==e||this._$AL.has(t)||void 0===i||this.C(t,void 0,o,i)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};Ko.elementStyles=[],Ko.shadowRootOptions={mode:"open"},Ko[Ho("elementProperties")]=new Map,Ko[Ho("finalized")]=new Map,qo?.({ReactiveElement:Ko}),(Oo.reactiveElementVersions??=[]).push("2.1.2");const Go=globalThis,Xo=e=>e,Qo=Go.trustedTypes,Yo=Qo?Qo.createPolicy("lit-html",{createHTML:e=>e}):void 0,Jo="$lit$",Zo=`lit$${Math.random().toFixed(9).slice(2)}$`,ei="?"+Zo,ti=`<${ei}>`,oi=document,ii=()=>oi.createComment(""),ni=e=>null===e||"object"!=typeof e&&"function"!=typeof e,ri=Array.isArray,si="[ \t\n\f\r]",ai=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,li=/-->/g,ci=/>/g,di=RegExp(`>|${si}(?:([^\\s"'>=/]+)(${si}*=${si}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),ui=/'/g,hi=/"/g,pi=/^(?:script|style|textarea|title)$/i,mi=(e=>(t,...o)=>({_$litType$:e,strings:t,values:o}))(1),fi=Symbol.for("lit-noChange"),gi=Symbol.for("lit-nothing"),vi=new WeakMap,bi=oi.createTreeWalker(oi,129);function yi(e,t){if(!ri(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==Yo?Yo.createHTML(t):t}const wi=(e,t)=>{const o=e.length-1,i=[];let n,r=2===t?"<svg>":3===t?"<math>":"",s=ai;for(let a=0;a<o;a++){const t=e[a];let o,l,c=-1,d=0;for(;d<t.length&&(s.lastIndex=d,l=s.exec(t),null!==l);)d=s.lastIndex,s===ai?"!--"===l[1]?s=li:void 0!==l[1]?s=ci:void 0!==l[2]?(pi.test(l[2])&&(n=RegExp("</"+l[2],"g")),s=di):void 0!==l[3]&&(s=di):s===di?">"===l[0]?(s=n??ai,c=-1):void 0===l[1]?c=-2:(c=s.lastIndex-l[2].length,o=l[1],s=void 0===l[3]?di:'"'===l[3]?hi:ui):s===hi||s===ui?s=di:s===li||s===ci?s=ai:(s=di,n=void 0);const u=s===di&&e[a+1].startsWith("/>")?" ":"";r+=s===ai?t+ti:c>=0?(i.push(o),t.slice(0,c)+Jo+t.slice(c)+Zo+u):t+Zo+(-2===c?a:u)}return[yi(e,r+(e[o]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),i]};class ki{constructor({strings:e,_$litType$:t},o){let i;this.parts=[];let n=0,r=0;const s=e.length-1,a=this.parts,[l,c]=wi(e,t);if(this.el=ki.createElement(l,o),bi.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(i=bi.nextNode())&&a.length<s;){if(1===i.nodeType){if(i.hasAttributes())for(const e of i.getAttributeNames())if(e.endsWith(Jo)){const t=c[r++],o=i.getAttribute(e).split(Zo),s=/([.?@])?(.*)/.exec(t);a.push({type:1,index:n,name:s[2],strings:o,ctor:"."===s[1]?Ci:"?"===s[1]?Ai:"@"===s[1]?Ti:Si}),i.removeAttribute(e)}else e.startsWith(Zo)&&(a.push({type:6,index:n}),i.removeAttribute(e));if(pi.test(i.tagName)){const e=i.textContent.split(Zo),t=e.length-1;if(t>0){i.textContent=Qo?Qo.emptyScript:"";for(let o=0;o<t;o++)i.append(e[o],ii()),bi.nextNode(),a.push({type:2,index:++n});i.append(e[t],ii())}}}else if(8===i.nodeType)if(i.data===ei)a.push({type:2,index:n});else{let e=-1;for(;-1!==(e=i.data.indexOf(Zo,e+1));)a.push({type:7,index:n}),e+=Zo.length-1}n++}}static createElement(e,t){const o=oi.createElement("template");return o.innerHTML=e,o}}function _i(e,t,o=e,i){if(t===fi)return t;let n=void 0!==i?o._$Co?.[i]:o._$Cl;const r=ni(t)?void 0:t._$litDirective$;return n?.constructor!==r&&(n?._$AO?.(!1),void 0===r?n=void 0:(n=new r(e),n._$AT(e,o,i)),void 0!==i?(o._$Co??=[])[i]=n:o._$Cl=n),void 0!==n&&(t=_i(e,n._$AS(e,t.values),n,i)),t}class xi{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:o}=this._$AD,i=(e?.creationScope??oi).importNode(t,!0);bi.currentNode=i;let n=bi.nextNode(),r=0,s=0,a=o[0];for(;void 0!==a;){if(r===a.index){let t;2===a.type?t=new Ei(n,n.nextSibling,this,e):1===a.type?t=new a.ctor(n,a.name,a.strings,this,e):6===a.type&&(t=new Ni(n,this,e)),this._$AV.push(t),a=o[++s]}r!==a?.index&&(n=bi.nextNode(),r++)}return bi.currentNode=oi,i}p(e){let t=0;for(const o of this._$AV)void 0!==o&&(void 0!==o.strings?(o._$AI(e,o,t),t+=o.strings.length-2):o._$AI(e[t])),t++}}class Ei{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,o,i){this.type=2,this._$AH=gi,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=o,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=_i(this,e,t),ni(e)?e===gi||null==e||""===e?(this._$AH!==gi&&this._$AR(),this._$AH=gi):e!==this._$AH&&e!==fi&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>ri(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==gi&&ni(this._$AH)?this._$AA.nextSibling.data=e:this.T(oi.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:o}=e,i="number"==typeof o?this._$AC(e):(void 0===o.el&&(o.el=ki.createElement(yi(o.h,o.h[0]),this.options)),o);if(this._$AH?._$AD===i)this._$AH.p(t);else{const e=new xi(i,this),o=e.u(this.options);e.p(t),this.T(o),this._$AH=e}}_$AC(e){let t=vi.get(e.strings);return void 0===t&&vi.set(e.strings,t=new ki(e)),t}k(e){ri(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let o,i=0;for(const n of e)i===t.length?t.push(o=new Ei(this.O(ii()),this.O(ii()),this,this.options)):o=t[i],o._$AI(n),i++;i<t.length&&(this._$AR(o&&o._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=Xo(e).nextSibling;Xo(e).remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class Si{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,o,i,n){this.type=1,this._$AH=gi,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=n,o.length>2||""!==o[0]||""!==o[1]?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=gi}_$AI(e,t=this,o,i){const n=this.strings;let r=!1;if(void 0===n)e=_i(this,e,t,0),r=!ni(e)||e!==this._$AH&&e!==fi,r&&(this._$AH=e);else{const i=e;let s,a;for(e=n[0],s=0;s<n.length-1;s++)a=_i(this,i[o+s],t,s),a===fi&&(a=this._$AH[s]),r||=!ni(a)||a!==this._$AH[s],a===gi?e=gi:e!==gi&&(e+=(a??"")+n[s+1]),this._$AH[s]=a}r&&!i&&this.j(e)}j(e){e===gi?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Ci extends Si{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===gi?void 0:e}}class Ai extends Si{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==gi)}}class Ti extends Si{constructor(e,t,o,i,n){super(e,t,o,i,n),this.type=5}_$AI(e,t=this){if((e=_i(this,e,t,0)??gi)===fi)return;const o=this._$AH,i=e===gi&&o!==gi||e.capture!==o.capture||e.once!==o.once||e.passive!==o.passive,n=e!==gi&&(o===gi||i);i&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class Ni{constructor(e,t,o){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(e){_i(this,e)}}const Pi=Go.litHtmlPolyfillSupport;Pi?.(ki,Ei),(Go.litHtmlVersions??=[]).push("3.3.2");const Ri=globalThis;let Bi=class extends Ko{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,o)=>{const i=o?.renderBefore??t;let n=i._$litPart$;if(void 0===n){const e=o?.renderBefore??null;i._$litPart$=n=new Ei(t.insertBefore(ii(),e),e,void 0,o??{})}return n._$AI(e),n})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return fi}};Bi._$litElement$=!0,Bi.finalized=!0,Ri.litElementHydrateSupport?.({LitElement:Bi});const Vi=Ri.litElementPolyfillSupport;Vi?.({LitElement:Bi}),(Ri.litElementVersions??=[]).push("4.2.2");var Di=Ro`
  :host {
    --track-width: 2px;
    --track-color: rgb(128 128 128 / 25%);
    --indicator-color: var(--sl-color-primary-600);
    --speed: 2s;

    display: inline-flex;
    width: 1em;
    height: 1em;
    flex: none;
  }

  .spinner {
    flex: 1 1 auto;
    height: 100%;
    width: 100%;
  }

  .spinner__track,
  .spinner__indicator {
    fill: none;
    stroke-width: var(--track-width);
    r: calc(0.5em - var(--track-width) / 2);
    cx: 0.5em;
    cy: 0.5em;
    transform-origin: 50% 50%;
  }

  .spinner__track {
    stroke: var(--track-color);
    transform-origin: 0% 0%;
  }

  .spinner__indicator {
    stroke: var(--indicator-color);
    stroke-linecap: round;
    stroke-dasharray: 150% 75%;
    animation: spin var(--speed) linear infinite;
  }

  @keyframes spin {
    0% {
      transform: rotate(0deg);
      stroke-dasharray: 0.05em, 3em;
    }

    50% {
      transform: rotate(450deg);
      stroke-dasharray: 1.375em, 1.375em;
    }

    100% {
      transform: rotate(1080deg);
      stroke-dasharray: 0.05em, 3em;
    }
  }
`;const Li=new Set,$i=new Map;let Fi,Mi="ltr",Oi="en";const Ii="undefined"!=typeof MutationObserver&&"undefined"!=typeof document&&void 0!==document.documentElement;if(Ii){const e=new MutationObserver(qi);Mi=document.documentElement.dir||"ltr",Oi=document.documentElement.lang||navigator.language,e.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]})}function zi(...e){e.map(e=>{const t=e.$code.toLowerCase();$i.has(t)?$i.set(t,Object.assign(Object.assign({},$i.get(t)),e)):$i.set(t,e),Fi||(Fi=e)}),qi()}function qi(){Ii&&(Mi=document.documentElement.dir||"ltr",Oi=document.documentElement.lang||navigator.language),[...Li.keys()].map(e=>{"function"==typeof e.requestUpdate&&e.requestUpdate()})}let Hi=class{constructor(e){this.host=e,this.host.addController(this)}hostConnected(){Li.add(this.host)}hostDisconnected(){Li.delete(this.host)}dir(){return`${this.host.dir||Mi}`.toLowerCase()}lang(){return`${this.host.lang||Oi}`.toLowerCase()}getTranslationData(e){var t,o;const i=new Intl.Locale(e.replace(/_/g,"-")),n=null==i?void 0:i.language.toLowerCase(),r=null!==(o=null===(t=null==i?void 0:i.region)||void 0===t?void 0:t.toLowerCase())&&void 0!==o?o:"";return{locale:i,language:n,region:r,primary:$i.get(`${n}-${r}`),secondary:$i.get(n)}}exists(e,t){var o;const{primary:i,secondary:n}=this.getTranslationData(null!==(o=t.lang)&&void 0!==o?o:this.lang());return t=Object.assign({includeFallback:!1},t),!!(i&&i[e]||n&&n[e]||t.includeFallback&&Fi&&Fi[e])}term(e,...t){const{primary:o,secondary:i}=this.getTranslationData(this.lang());let n;if(o&&o[e])n=o[e];else if(i&&i[e])n=i[e];else{if(!Fi||!Fi[e])return console.error(`No translation found for: ${String(e)}`),String(e);n=Fi[e]}return"function"==typeof n?n(...t):n}date(e,t){return e=new Date(e),new Intl.DateTimeFormat(this.lang(),t).format(e)}number(e,t){return e=Number(e),isNaN(e)?"":new Intl.NumberFormat(this.lang(),t).format(e)}relativeTime(e,t,o){return new Intl.RelativeTimeFormat(this.lang(),o).format(e,t)}};var Ui={$code:"en",$name:"English",$dir:"ltr",carousel:"Carousel",clearEntry:"Clear entry",close:"Close",copied:"Copied",copy:"Copy",currentValue:"Current value",error:"Error",goToSlide:(e,t)=>`Go to slide ${e} of ${t}`,hidePassword:"Hide password",loading:"Loading",nextSlide:"Next slide",numOptionsSelected:e=>0===e?"No options selected":1===e?"1 option selected":`${e} options selected`,previousSlide:"Previous slide",progress:"Progress",remove:"Remove",resize:"Resize",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",showPassword:"Show password",slideNum:e=>`Slide ${e}`,toggleColorFormat:"Toggle color format"};zi(Ui);var Wi=Ui,ji=class extends Hi{};zi(Wi);var Ki=Ro`
  :host {
    box-sizing: border-box;
  }

  :host *,
  :host *::before,
  :host *::after {
    box-sizing: inherit;
  }

  [hidden] {
    display: none !important;
  }
`;const Gi={attribute:!0,type:String,converter:Uo,reflect:!1,hasChanged:Wo},Xi=(e=Gi,t,o)=>{const{kind:i,metadata:n}=o;let r=globalThis.litPropertyMetadata.get(n);if(void 0===r&&globalThis.litPropertyMetadata.set(n,r=new Map),"setter"===i&&((e=Object.create(e)).wrapped=!0),r.set(o.name,e),"accessor"===i){const{name:i}=o;return{set(o){const n=t.get.call(this);t.set.call(this,o),this.requestUpdate(i,n,e,!0,o)},init(t){return void 0!==t&&this.C(i,void 0,e,t),t}}}if("setter"===i){const{name:i}=o;return function(o){const n=this[i];t.call(this,o),this.requestUpdate(i,n,e,!0,o)}}throw Error("Unsupported decorator location: "+i)};function Qi(e){return(t,o)=>"object"==typeof o?Xi(e,t,o):((e,t,o)=>{const i=t.hasOwnProperty(o);return t.constructor.createProperty(o,e),i?Object.getOwnPropertyDescriptor(t,o):void 0})(e,t,o)}function Yi(e){return Qi({...e,state:!0,attribute:!1})}function Ji(e,t){return(t,o,i)=>((e,t,o)=>(o.configurable=!0,o.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,o),o))(t,o,{get(){return(t=>t.renderRoot?.querySelector(e)??null)(this)}})}var Zi,en=class extends Bi{constructor(){var e,t,o;super(),e=this,o=!1,(t=Zi).has(e)?yo("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,o),this.initialReflectedProperties=new Map,Object.entries(this.constructor.dependencies).forEach(([e,t])=>{this.constructor.define(e,t)})}emit(e,t){const o=new CustomEvent(e,ko({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(o),o}static define(e,t=this,o={}){const i=customElements.get(e);if(!i){try{customElements.define(e,t,o)}catch(s){customElements.define(e,class extends t{},o)}return}let n=" (unknown version)",r=n;"version"in t&&t.version&&(n=" v"+t.version),"version"in i&&i.version&&(r=" v"+i.version),n&&r&&n===r||console.warn(`Attempted to register <${e}>${n}, but <${e}>${r} has already been registered.`)}attributeChangedCallback(e,t,o){var i,n;Eo(i=this,n=Zi,"read from private field"),n.get(i)||(this.constructor.elementProperties.forEach((e,t)=>{e.reflect&&null!=this[t]&&this.initialReflectedProperties.set(t,this[t])}),((e,t,o)=>{Eo(e,t,"write to private field"),t.set(e,o)})(this,Zi,!0)),super.attributeChangedCallback(e,t,o)}willUpdate(e){super.willUpdate(e),this.initialReflectedProperties.forEach((t,o)=>{e.has(o)&&null==this[o]&&(this[o]=t)})}};Zi=new WeakMap,en.version="2.20.1",en.dependencies={},xo([Qi()],en.prototype,"dir",2),xo([Qi()],en.prototype,"lang",2);var tn=class extends en{constructor(){super(...arguments),this.localize=new ji(this)}render(){return mi`
      <svg part="base" class="spinner" role="progressbar" aria-label=${this.localize.term("loading")}>
        <circle class="spinner__track"></circle>
        <circle class="spinner__indicator"></circle>
      </svg>
    `}};tn.styles=[Ki,Di];var on=new WeakMap,nn=new WeakMap,rn=new WeakMap,sn=new WeakSet,an=new WeakMap,ln=class{constructor(e,t){this.handleFormData=e=>{const t=this.options.disabled(this.host),o=this.options.name(this.host),i=this.options.value(this.host),n="sl-button"===this.host.tagName.toLowerCase();this.host.isConnected&&!t&&!n&&"string"==typeof o&&o.length>0&&void 0!==i&&(Array.isArray(i)?i.forEach(t=>{e.formData.append(o,t.toString())}):e.formData.append(o,i.toString()))},this.handleFormSubmit=e=>{var t;const o=this.options.disabled(this.host),i=this.options.reportValidity;this.form&&!this.form.noValidate&&(null==(t=on.get(this.form))||t.forEach(e=>{this.setUserInteracted(e,!0)})),!this.form||this.form.noValidate||o||i(this.host)||(e.preventDefault(),e.stopImmediatePropagation())},this.handleFormReset=()=>{this.options.setValue(this.host,this.options.defaultValue(this.host)),this.setUserInteracted(this.host,!1),an.set(this.host,[])},this.handleInteraction=e=>{const t=an.get(this.host);t.includes(e.type)||t.push(e.type),t.length===this.options.assumeInteractionOn.length&&this.setUserInteracted(this.host,!0)},this.checkFormValidity=()=>{if(this.form&&!this.form.noValidate){const e=this.form.querySelectorAll("*");for(const t of e)if("function"==typeof t.checkValidity&&!t.checkValidity())return!1}return!0},this.reportFormValidity=()=>{if(this.form&&!this.form.noValidate){const e=this.form.querySelectorAll("*");for(const t of e)if("function"==typeof t.reportValidity&&!t.reportValidity())return!1}return!0},(this.host=e).addController(this),this.options=ko({form:e=>{const t=e.form;if(t){const o=e.getRootNode().querySelector(`#${t}`);if(o)return o}return e.closest("form")},name:e=>e.name,value:e=>e.value,defaultValue:e=>e.defaultValue,disabled:e=>{var t;return null!=(t=e.disabled)&&t},reportValidity:e=>"function"!=typeof e.reportValidity||e.reportValidity(),checkValidity:e=>"function"!=typeof e.checkValidity||e.checkValidity(),setValue:(e,t)=>e.value=t,assumeInteractionOn:["sl-input"]},t)}hostConnected(){const e=this.options.form(this.host);e&&this.attachForm(e),an.set(this.host,[]),this.options.assumeInteractionOn.forEach(e=>{this.host.addEventListener(e,this.handleInteraction)})}hostDisconnected(){this.detachForm(),an.delete(this.host),this.options.assumeInteractionOn.forEach(e=>{this.host.removeEventListener(e,this.handleInteraction)})}hostUpdated(){const e=this.options.form(this.host);e||this.detachForm(),e&&this.form!==e&&(this.detachForm(),this.attachForm(e)),this.host.hasUpdated&&this.setValidity(this.host.validity.valid)}attachForm(e){e?(this.form=e,on.has(this.form)?on.get(this.form).add(this.host):on.set(this.form,new Set([this.host])),this.form.addEventListener("formdata",this.handleFormData),this.form.addEventListener("submit",this.handleFormSubmit),this.form.addEventListener("reset",this.handleFormReset),nn.has(this.form)||(nn.set(this.form,this.form.reportValidity),this.form.reportValidity=()=>this.reportFormValidity()),rn.has(this.form)||(rn.set(this.form,this.form.checkValidity),this.form.checkValidity=()=>this.checkFormValidity())):this.form=void 0}detachForm(){if(!this.form)return;const e=on.get(this.form);e&&(e.delete(this.host),e.size<=0&&(this.form.removeEventListener("formdata",this.handleFormData),this.form.removeEventListener("submit",this.handleFormSubmit),this.form.removeEventListener("reset",this.handleFormReset),nn.has(this.form)&&(this.form.reportValidity=nn.get(this.form),nn.delete(this.form)),rn.has(this.form)&&(this.form.checkValidity=rn.get(this.form),rn.delete(this.form)),this.form=void 0))}setUserInteracted(e,t){t?sn.add(e):sn.delete(e),e.requestUpdate()}doAction(e,t){if(this.form){const o=document.createElement("button");o.type=e,o.style.position="absolute",o.style.width="0",o.style.height="0",o.style.clipPath="inset(50%)",o.style.overflow="hidden",o.style.whiteSpace="nowrap",t&&(o.name=t.name,o.value=t.value,["formaction","formenctype","formmethod","formnovalidate","formtarget"].forEach(e=>{t.hasAttribute(e)&&o.setAttribute(e,t.getAttribute(e))})),this.form.append(o),o.click(),o.remove()}}getForm(){var e;return null!=(e=this.form)?e:null}reset(e){this.doAction("reset",e)}submit(e){this.doAction("submit",e)}setValidity(e){const t=this.host,o=Boolean(sn.has(t)),i=Boolean(t.required);t.toggleAttribute("data-required",i),t.toggleAttribute("data-optional",!i),t.toggleAttribute("data-invalid",!e),t.toggleAttribute("data-valid",e),t.toggleAttribute("data-user-invalid",!e&&o),t.toggleAttribute("data-user-valid",e&&o)}updateValidity(){const e=this.host;this.setValidity(e.validity.valid)}emitInvalidEvent(e){const t=new CustomEvent("sl-invalid",{bubbles:!1,composed:!1,cancelable:!0,detail:{}});e||t.preventDefault(),this.host.dispatchEvent(t)||null==e||e.preventDefault()}},cn=Object.freeze({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1}),dn=Object.freeze(_o(ko({},cn),{valid:!1,valueMissing:!0})),un=Object.freeze(_o(ko({},cn),{valid:!1,customError:!0})),hn=Ro`
  :host {
    display: inline-block;
    position: relative;
    width: auto;
    cursor: pointer;
  }

  .button {
    display: inline-flex;
    align-items: stretch;
    justify-content: center;
    width: 100%;
    border-style: solid;
    border-width: var(--sl-input-border-width);
    font-family: var(--sl-input-font-family);
    font-weight: var(--sl-font-weight-semibold);
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    white-space: nowrap;
    vertical-align: middle;
    padding: 0;
    transition:
      var(--sl-transition-x-fast) background-color,
      var(--sl-transition-x-fast) color,
      var(--sl-transition-x-fast) border,
      var(--sl-transition-x-fast) box-shadow;
    cursor: inherit;
  }

  .button::-moz-focus-inner {
    border: 0;
  }

  .button:focus {
    outline: none;
  }

  .button:focus-visible {
    outline: var(--sl-focus-ring);
    outline-offset: var(--sl-focus-ring-offset);
  }

  .button--disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  /* When disabled, prevent mouse events from bubbling up from children */
  .button--disabled * {
    pointer-events: none;
  }

  .button__prefix,
  .button__suffix {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    pointer-events: none;
  }

  .button__label {
    display: inline-block;
  }

  .button__label::slotted(sl-icon) {
    vertical-align: -2px;
  }

  /*
   * Standard buttons
   */

  /* Default */
  .button--standard.button--default {
    background-color: var(--sl-color-neutral-0);
    border-color: var(--sl-input-border-color);
    color: var(--sl-color-neutral-700);
  }

  .button--standard.button--default:hover:not(.button--disabled) {
    background-color: var(--sl-color-primary-50);
    border-color: var(--sl-color-primary-300);
    color: var(--sl-color-primary-700);
  }

  .button--standard.button--default:active:not(.button--disabled) {
    background-color: var(--sl-color-primary-100);
    border-color: var(--sl-color-primary-400);
    color: var(--sl-color-primary-700);
  }

  /* Primary */
  .button--standard.button--primary {
    background-color: var(--sl-color-primary-600);
    border-color: var(--sl-color-primary-600);
    color: var(--sl-color-neutral-0);
  }

  .button--standard.button--primary:hover:not(.button--disabled) {
    background-color: var(--sl-color-primary-500);
    border-color: var(--sl-color-primary-500);
    color: var(--sl-color-neutral-0);
  }

  .button--standard.button--primary:active:not(.button--disabled) {
    background-color: var(--sl-color-primary-600);
    border-color: var(--sl-color-primary-600);
    color: var(--sl-color-neutral-0);
  }

  /* Success */
  .button--standard.button--success {
    background-color: var(--sl-color-success-600);
    border-color: var(--sl-color-success-600);
    color: var(--sl-color-neutral-0);
  }

  .button--standard.button--success:hover:not(.button--disabled) {
    background-color: var(--sl-color-success-500);
    border-color: var(--sl-color-success-500);
    color: var(--sl-color-neutral-0);
  }

  .button--standard.button--success:active:not(.button--disabled) {
    background-color: var(--sl-color-success-600);
    border-color: var(--sl-color-success-600);
    color: var(--sl-color-neutral-0);
  }

  /* Neutral */
  .button--standard.button--neutral {
    background-color: var(--sl-color-neutral-600);
    border-color: var(--sl-color-neutral-600);
    color: var(--sl-color-neutral-0);
  }

  .button--standard.button--neutral:hover:not(.button--disabled) {
    background-color: var(--sl-color-neutral-500);
    border-color: var(--sl-color-neutral-500);
    color: var(--sl-color-neutral-0);
  }

  .button--standard.button--neutral:active:not(.button--disabled) {
    background-color: var(--sl-color-neutral-600);
    border-color: var(--sl-color-neutral-600);
    color: var(--sl-color-neutral-0);
  }

  /* Warning */
  .button--standard.button--warning {
    background-color: var(--sl-color-warning-600);
    border-color: var(--sl-color-warning-600);
    color: var(--sl-color-neutral-0);
  }
  .button--standard.button--warning:hover:not(.button--disabled) {
    background-color: var(--sl-color-warning-500);
    border-color: var(--sl-color-warning-500);
    color: var(--sl-color-neutral-0);
  }

  .button--standard.button--warning:active:not(.button--disabled) {
    background-color: var(--sl-color-warning-600);
    border-color: var(--sl-color-warning-600);
    color: var(--sl-color-neutral-0);
  }

  /* Danger */
  .button--standard.button--danger {
    background-color: var(--sl-color-danger-600);
    border-color: var(--sl-color-danger-600);
    color: var(--sl-color-neutral-0);
  }

  .button--standard.button--danger:hover:not(.button--disabled) {
    background-color: var(--sl-color-danger-500);
    border-color: var(--sl-color-danger-500);
    color: var(--sl-color-neutral-0);
  }

  .button--standard.button--danger:active:not(.button--disabled) {
    background-color: var(--sl-color-danger-600);
    border-color: var(--sl-color-danger-600);
    color: var(--sl-color-neutral-0);
  }

  /*
   * Outline buttons
   */

  .button--outline {
    background: none;
    border: solid 1px;
  }

  /* Default */
  .button--outline.button--default {
    border-color: var(--sl-input-border-color);
    color: var(--sl-color-neutral-700);
  }

  .button--outline.button--default:hover:not(.button--disabled),
  .button--outline.button--default.button--checked:not(.button--disabled) {
    border-color: var(--sl-color-primary-600);
    background-color: var(--sl-color-primary-600);
    color: var(--sl-color-neutral-0);
  }

  .button--outline.button--default:active:not(.button--disabled) {
    border-color: var(--sl-color-primary-700);
    background-color: var(--sl-color-primary-700);
    color: var(--sl-color-neutral-0);
  }

  /* Primary */
  .button--outline.button--primary {
    border-color: var(--sl-color-primary-600);
    color: var(--sl-color-primary-600);
  }

  .button--outline.button--primary:hover:not(.button--disabled),
  .button--outline.button--primary.button--checked:not(.button--disabled) {
    background-color: var(--sl-color-primary-600);
    color: var(--sl-color-neutral-0);
  }

  .button--outline.button--primary:active:not(.button--disabled) {
    border-color: var(--sl-color-primary-700);
    background-color: var(--sl-color-primary-700);
    color: var(--sl-color-neutral-0);
  }

  /* Success */
  .button--outline.button--success {
    border-color: var(--sl-color-success-600);
    color: var(--sl-color-success-600);
  }

  .button--outline.button--success:hover:not(.button--disabled),
  .button--outline.button--success.button--checked:not(.button--disabled) {
    background-color: var(--sl-color-success-600);
    color: var(--sl-color-neutral-0);
  }

  .button--outline.button--success:active:not(.button--disabled) {
    border-color: var(--sl-color-success-700);
    background-color: var(--sl-color-success-700);
    color: var(--sl-color-neutral-0);
  }

  /* Neutral */
  .button--outline.button--neutral {
    border-color: var(--sl-color-neutral-600);
    color: var(--sl-color-neutral-600);
  }

  .button--outline.button--neutral:hover:not(.button--disabled),
  .button--outline.button--neutral.button--checked:not(.button--disabled) {
    background-color: var(--sl-color-neutral-600);
    color: var(--sl-color-neutral-0);
  }

  .button--outline.button--neutral:active:not(.button--disabled) {
    border-color: var(--sl-color-neutral-700);
    background-color: var(--sl-color-neutral-700);
    color: var(--sl-color-neutral-0);
  }

  /* Warning */
  .button--outline.button--warning {
    border-color: var(--sl-color-warning-600);
    color: var(--sl-color-warning-600);
  }

  .button--outline.button--warning:hover:not(.button--disabled),
  .button--outline.button--warning.button--checked:not(.button--disabled) {
    background-color: var(--sl-color-warning-600);
    color: var(--sl-color-neutral-0);
  }

  .button--outline.button--warning:active:not(.button--disabled) {
    border-color: var(--sl-color-warning-700);
    background-color: var(--sl-color-warning-700);
    color: var(--sl-color-neutral-0);
  }

  /* Danger */
  .button--outline.button--danger {
    border-color: var(--sl-color-danger-600);
    color: var(--sl-color-danger-600);
  }

  .button--outline.button--danger:hover:not(.button--disabled),
  .button--outline.button--danger.button--checked:not(.button--disabled) {
    background-color: var(--sl-color-danger-600);
    color: var(--sl-color-neutral-0);
  }

  .button--outline.button--danger:active:not(.button--disabled) {
    border-color: var(--sl-color-danger-700);
    background-color: var(--sl-color-danger-700);
    color: var(--sl-color-neutral-0);
  }

  @media (forced-colors: active) {
    .button.button--outline.button--checked:not(.button--disabled) {
      outline: solid 2px transparent;
    }
  }

  /*
   * Text buttons
   */

  .button--text {
    background-color: transparent;
    border-color: transparent;
    color: var(--sl-color-primary-600);
  }

  .button--text:hover:not(.button--disabled) {
    background-color: transparent;
    border-color: transparent;
    color: var(--sl-color-primary-500);
  }

  .button--text:focus-visible:not(.button--disabled) {
    background-color: transparent;
    border-color: transparent;
    color: var(--sl-color-primary-500);
  }

  .button--text:active:not(.button--disabled) {
    background-color: transparent;
    border-color: transparent;
    color: var(--sl-color-primary-700);
  }

  /*
   * Size modifiers
   */

  .button--small {
    height: auto;
    min-height: var(--sl-input-height-small);
    font-size: var(--sl-button-font-size-small);
    line-height: calc(var(--sl-input-height-small) - var(--sl-input-border-width) * 2);
    border-radius: var(--sl-input-border-radius-small);
  }

  .button--medium {
    height: auto;
    min-height: var(--sl-input-height-medium);
    font-size: var(--sl-button-font-size-medium);
    line-height: calc(var(--sl-input-height-medium) - var(--sl-input-border-width) * 2);
    border-radius: var(--sl-input-border-radius-medium);
  }

  .button--large {
    height: auto;
    min-height: var(--sl-input-height-large);
    font-size: var(--sl-button-font-size-large);
    line-height: calc(var(--sl-input-height-large) - var(--sl-input-border-width) * 2);
    border-radius: var(--sl-input-border-radius-large);
  }

  /*
   * Pill modifier
   */

  .button--pill.button--small {
    border-radius: var(--sl-input-height-small);
  }

  .button--pill.button--medium {
    border-radius: var(--sl-input-height-medium);
  }

  .button--pill.button--large {
    border-radius: var(--sl-input-height-large);
  }

  /*
   * Circle modifier
   */

  .button--circle {
    padding-left: 0;
    padding-right: 0;
  }

  .button--circle.button--small {
    width: var(--sl-input-height-small);
    border-radius: 50%;
  }

  .button--circle.button--medium {
    width: var(--sl-input-height-medium);
    border-radius: 50%;
  }

  .button--circle.button--large {
    width: var(--sl-input-height-large);
    border-radius: 50%;
  }

  .button--circle .button__prefix,
  .button--circle .button__suffix,
  .button--circle .button__caret {
    display: none;
  }

  /*
   * Caret modifier
   */

  .button--caret .button__suffix {
    display: none;
  }

  .button--caret .button__caret {
    height: auto;
  }

  /*
   * Loading modifier
   */

  .button--loading {
    position: relative;
    cursor: wait;
  }

  .button--loading .button__prefix,
  .button--loading .button__label,
  .button--loading .button__suffix,
  .button--loading .button__caret {
    visibility: hidden;
  }

  .button--loading sl-spinner {
    --indicator-color: currentColor;
    position: absolute;
    font-size: 1em;
    height: 1em;
    width: 1em;
    top: calc(50% - 0.5em);
    left: calc(50% - 0.5em);
  }

  /*
   * Badges
   */

  .button ::slotted(sl-badge) {
    position: absolute;
    top: 0;
    right: 0;
    translate: 50% -50%;
    pointer-events: none;
  }

  .button--rtl ::slotted(sl-badge) {
    right: auto;
    left: 0;
    translate: -50% -50%;
  }

  /*
   * Button spacing
   */

  .button--has-label.button--small .button__label {
    padding: 0 var(--sl-spacing-small);
  }

  .button--has-label.button--medium .button__label {
    padding: 0 var(--sl-spacing-medium);
  }

  .button--has-label.button--large .button__label {
    padding: 0 var(--sl-spacing-large);
  }

  .button--has-prefix.button--small {
    padding-inline-start: var(--sl-spacing-x-small);
  }

  .button--has-prefix.button--small .button__label {
    padding-inline-start: var(--sl-spacing-x-small);
  }

  .button--has-prefix.button--medium {
    padding-inline-start: var(--sl-spacing-small);
  }

  .button--has-prefix.button--medium .button__label {
    padding-inline-start: var(--sl-spacing-small);
  }

  .button--has-prefix.button--large {
    padding-inline-start: var(--sl-spacing-small);
  }

  .button--has-prefix.button--large .button__label {
    padding-inline-start: var(--sl-spacing-small);
  }

  .button--has-suffix.button--small,
  .button--caret.button--small {
    padding-inline-end: var(--sl-spacing-x-small);
  }

  .button--has-suffix.button--small .button__label,
  .button--caret.button--small .button__label {
    padding-inline-end: var(--sl-spacing-x-small);
  }

  .button--has-suffix.button--medium,
  .button--caret.button--medium {
    padding-inline-end: var(--sl-spacing-small);
  }

  .button--has-suffix.button--medium .button__label,
  .button--caret.button--medium .button__label {
    padding-inline-end: var(--sl-spacing-small);
  }

  .button--has-suffix.button--large,
  .button--caret.button--large {
    padding-inline-end: var(--sl-spacing-small);
  }

  .button--has-suffix.button--large .button__label,
  .button--caret.button--large .button__label {
    padding-inline-end: var(--sl-spacing-small);
  }

  /*
   * Button groups support a variety of button types (e.g. buttons with tooltips, buttons as dropdown triggers, etc.).
   * This means buttons aren't always direct descendants of the button group, thus we can't target them with the
   * ::slotted selector. To work around this, the button group component does some magic to add these special classes to
   * buttons and we style them here instead.
   */

  :host([data-sl-button-group__button--first]:not([data-sl-button-group__button--last])) .button {
    border-start-end-radius: 0;
    border-end-end-radius: 0;
  }

  :host([data-sl-button-group__button--inner]) .button {
    border-radius: 0;
  }

  :host([data-sl-button-group__button--last]:not([data-sl-button-group__button--first])) .button {
    border-start-start-radius: 0;
    border-end-start-radius: 0;
  }

  /* All except the first */
  :host([data-sl-button-group__button]:not([data-sl-button-group__button--first])) {
    margin-inline-start: calc(-1 * var(--sl-input-border-width));
  }

  /* Add a visual separator between solid buttons */
  :host(
      [data-sl-button-group__button]:not(
          [data-sl-button-group__button--first],
          [data-sl-button-group__button--radio],
          [variant='default']
        ):not(:hover)
    )
    .button:after {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    bottom: 0;
    border-left: solid 1px rgb(128 128 128 / 33%);
    mix-blend-mode: multiply;
  }

  /* Bump hovered, focused, and checked buttons up so their focus ring isn't clipped */
  :host([data-sl-button-group__button--hover]) {
    z-index: 1;
  }

  /* Focus and checked are always on top */
  :host([data-sl-button-group__button--focus]),
  :host([data-sl-button-group__button][checked]) {
    z-index: 2;
  }
`,pn=class{constructor(e,...t){this.slotNames=[],this.handleSlotChange=e=>{const t=e.target;(this.slotNames.includes("[default]")&&!t.name||t.name&&this.slotNames.includes(t.name))&&this.host.requestUpdate()},(this.host=e).addController(this),this.slotNames=t}hasDefaultSlot(){return[...this.host.childNodes].some(e=>{if(e.nodeType===e.TEXT_NODE&&""!==e.textContent.trim())return!0;if(e.nodeType===e.ELEMENT_NODE){const t=e;if("sl-visually-hidden"===t.tagName.toLowerCase())return!1;if(!t.hasAttribute("slot"))return!0}return!1})}hasNamedSlot(e){return null!==this.host.querySelector(`:scope > [slot="${e}"]`)}test(e){return"[default]"===e?this.hasDefaultSlot():this.hasNamedSlot(e)}hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange)}},mn={name:"default",resolver:e=>function(e=""){if(!lo){const e=[...document.getElementsByTagName("script")],t=e.find(e=>e.hasAttribute("data-shoelace"));if(t)co(t.getAttribute("data-shoelace"));else{const t=e.find(e=>/shoelace(\.min)?\.js($|\?)/.test(e.src)||/shoelace-autoloader(\.min)?\.js($|\?)/.test(e.src));let o="";t&&(o=t.getAttribute("src")),co(o.split("/").slice(0,-1).join("/"))}}return lo.replace(/\/$/,"")+(e?`/${e.replace(/^\//,"")}`:"")}(`assets/icons/${e}.svg`)},fn={caret:'\n    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n      <polyline points="6 9 12 15 18 9"></polyline>\n    </svg>\n  ',check:'\n    <svg part="checked-icon" class="checkbox__icon" viewBox="0 0 16 16">\n      <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">\n        <g stroke="currentColor">\n          <g transform="translate(3.428571, 3.428571)">\n            <path d="M0,5.71428571 L3.42857143,9.14285714"></path>\n            <path d="M9.14285714,0 L3.42857143,9.14285714"></path>\n          </g>\n        </g>\n      </g>\n    </svg>\n  ',"chevron-down":'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16">\n      <path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/>\n    </svg>\n  ',"chevron-left":'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-left" viewBox="0 0 16 16">\n      <path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"/>\n    </svg>\n  ',"chevron-right":'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-right" viewBox="0 0 16 16">\n      <path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/>\n    </svg>\n  ',copy:'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-copy" viewBox="0 0 16 16">\n      <path fill-rule="evenodd" d="M4 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V2Zm2-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H6ZM2 5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-1h1v1a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1v1H2Z"/>\n    </svg>\n  ',eye:'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16">\n      <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>\n      <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>\n    </svg>\n  ',"eye-slash":'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye-slash" viewBox="0 0 16 16">\n      <path d="M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7.028 7.028 0 0 0-2.79.588l.77.771A5.944 5.944 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.134 13.134 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755-.165.165-.337.328-.517.486l.708.709z"/>\n      <path d="M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829l.822.822zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829z"/>\n      <path d="M3.35 5.47c-.18.16-.353.322-.518.487A13.134 13.134 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7.029 7.029 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884-12-12 .708-.708 12 12-.708.708z"/>\n    </svg>\n  ',eyedropper:'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eyedropper" viewBox="0 0 16 16">\n      <path d="M13.354.646a1.207 1.207 0 0 0-1.708 0L8.5 3.793l-.646-.647a.5.5 0 1 0-.708.708L8.293 5l-7.147 7.146A.5.5 0 0 0 1 12.5v1.793l-.854.853a.5.5 0 1 0 .708.707L1.707 15H3.5a.5.5 0 0 0 .354-.146L11 7.707l1.146 1.147a.5.5 0 0 0 .708-.708l-.647-.646 3.147-3.146a1.207 1.207 0 0 0 0-1.708l-2-2zM2 12.707l7-7L10.293 7l-7 7H2v-1.293z"></path>\n    </svg>\n  ',"grip-vertical":'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-grip-vertical" viewBox="0 0 16 16">\n      <path d="M7 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"></path>\n    </svg>\n  ',indeterminate:'\n    <svg part="indeterminate-icon" class="checkbox__icon" viewBox="0 0 16 16">\n      <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">\n        <g stroke="currentColor" stroke-width="2">\n          <g transform="translate(2.285714, 6.857143)">\n            <path d="M10.2857143,1.14285714 L1.14285714,1.14285714"></path>\n          </g>\n        </g>\n      </g>\n    </svg>\n  ',"person-fill":'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person-fill" viewBox="0 0 16 16">\n      <path d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/>\n    </svg>\n  ',"play-fill":'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-play-fill" viewBox="0 0 16 16">\n      <path d="m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z"></path>\n    </svg>\n  ',"pause-fill":'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pause-fill" viewBox="0 0 16 16">\n      <path d="M5.5 3.5A1.5 1.5 0 0 1 7 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5zm5 0A1.5 1.5 0 0 1 12 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5z"></path>\n    </svg>\n  ',radio:'\n    <svg part="checked-icon" class="radio__icon" viewBox="0 0 16 16">\n      <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n        <g fill="currentColor">\n          <circle cx="8" cy="8" r="3.42857143"></circle>\n        </g>\n      </g>\n    </svg>\n  ',"star-fill":'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16">\n      <path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>\n    </svg>\n  ',"x-lg":'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-lg" viewBox="0 0 16 16">\n      <path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>\n    </svg>\n  ',"x-circle-fill":'\n    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-circle-fill" viewBox="0 0 16 16">\n      <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z"></path>\n    </svg>\n  '},gn=[mn,{name:"system",resolver:e=>e in fn?`data:image/svg+xml,${encodeURIComponent(fn[e])}`:""}],vn=[];function bn(e){return gn.find(t=>t.name===e)}var yn=Ro`
  :host {
    display: inline-block;
    width: 1em;
    height: 1em;
    box-sizing: content-box !important;
  }

  svg {
    display: block;
    height: 100%;
    width: 100%;
  }
`;function wn(e,t){const o=ko({waitUntilFirstUpdate:!1},t);return(t,i)=>{const{update:n}=t,r=Array.isArray(e)?e:[e];t.update=function(e){r.forEach(t=>{const n=t;if(e.has(n)){const t=e.get(n),r=this[n];t!==r&&(o.waitUntilFirstUpdate&&!this.hasUpdated||this[i](t,r))}}),n.call(this,e)}}}const kn={};var xn,En=Symbol(),Sn=Symbol(),Cn=new Map,An=class extends en{constructor(){super(...arguments),this.initialRender=!1,this.svg=null,this.label="",this.library="default"}async resolveIcon(e,t){var o;let i;if(null==t?void 0:t.spriteSheet)return this.svg=mi`<svg part="svg">
        <use part="use" href="${e}"></use>
      </svg>`,this.svg;try{if(i=await fetch(e,{mode:"cors"}),!i.ok)return 410===i.status?En:Sn}catch(da){return Sn}try{const e=document.createElement("div");e.innerHTML=await i.text();const t=e.firstElementChild;if("svg"!==(null==(o=null==t?void 0:t.tagName)?void 0:o.toLowerCase()))return En;xn||(xn=new DOMParser);const n=xn.parseFromString(t.outerHTML,"text/html").body.querySelector("svg");return n?(n.part.add("svg"),document.adoptNode(n)):En}catch(da){return En}}connectedCallback(){var e;super.connectedCallback(),e=this,vn.push(e)}firstUpdated(){this.initialRender=!0,this.setIcon()}disconnectedCallback(){var e;super.disconnectedCallback(),e=this,vn=vn.filter(t=>t!==e)}getIconSource(){const e=bn(this.library);return this.name&&e?{url:e.resolver(this.name),fromLibrary:!0}:{url:this.src,fromLibrary:!1}}handleLabelChange(){"string"==typeof this.label&&this.label.length>0?(this.setAttribute("role","img"),this.setAttribute("aria-label",this.label),this.removeAttribute("aria-hidden")):(this.removeAttribute("role"),this.removeAttribute("aria-label"),this.setAttribute("aria-hidden","true"))}async setIcon(){var e;const{url:t,fromLibrary:o}=this.getIconSource(),i=o?bn(this.library):void 0;if(!t)return void(this.svg=null);let n=Cn.get(t);if(n||(n=this.resolveIcon(t,i),Cn.set(t,n)),!this.initialRender)return;const r=await n;if(r===Sn&&Cn.delete(t),t===this.getIconSource().url)if((e=>void 0!==e?._$litType$)(r)){if(this.svg=r,i){await this.updateComplete;const e=this.shadowRoot.querySelector("[part='svg']");"function"==typeof i.mutator&&e&&i.mutator(e)}}else switch(r){case Sn:case En:this.svg=null,this.emit("sl-error");break;default:this.svg=r.cloneNode(!0),null==(e=null==i?void 0:i.mutator)||e.call(i,this.svg),this.emit("sl-load")}}render(){return this.svg}};An.styles=[Ki,yn],xo([Yi()],An.prototype,"svg",2),xo([Qi({reflect:!0})],An.prototype,"name",2),xo([Qi()],An.prototype,"src",2),xo([Qi()],An.prototype,"label",2),xo([Qi({reflect:!0})],An.prototype,"library",2),xo([wn("label")],An.prototype,"handleLabelChange",1),xo([wn(["name","src","library"])],An.prototype,"setIcon",1);const Tn=1,Nn=2,Pn=3,Rn=4,Bn=e=>(...t)=>({_$litDirective$:e,values:t});let Vn=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,o){this._$Ct=e,this._$AM=t,this._$Ci=o}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};const Dn=Bn(class extends Vn{constructor(e){if(super(e),e.type!==Tn||"class"!==e.name||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){if(void 0===this.st){this.st=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(e=>""!==e)));for(const e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}const o=e.element.classList;for(const i of this.st)i in t||(o.remove(i),this.st.delete(i));for(const i in t){const e=!!t[i];e===this.st.has(i)||this.nt?.has(i)||(e?(o.add(i),this.st.add(i)):(o.remove(i),this.st.delete(i)))}return fi}}),Ln=Symbol.for(""),$n=e=>{if(e?.r===Ln)return e?._$litStatic$},Fn=(e,...t)=>({_$litStatic$:t.reduce((t,o,i)=>t+(e=>{if(void 0!==e._$litStatic$)return e._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${e}. Use 'unsafeStatic' to pass non-literal values, but\n            take care to ensure page security.`)})(o)+e[i+1],e[0]),r:Ln}),Mn=new Map,On=(e=>(t,...o)=>{const i=o.length;let n,r;const s=[],a=[];let l,c=0,d=!1;for(;c<i;){for(l=t[c];c<i&&void 0!==(r=o[c],n=$n(r));)l+=n+t[++c],d=!0;c!==i&&a.push(r),s.push(l),c++}if(c===i&&s.push(t[i]),d){const e=s.join("$$lit$$");void 0===(t=Mn.get(e))&&(s.raw=s,Mn.set(e,t=s)),o=a}return e(t,...o)})(mi),In=e=>e??gi;var zn=class extends en{constructor(){super(...arguments),this.formControlController=new ln(this,{assumeInteractionOn:["click"]}),this.hasSlotController=new pn(this,"[default]","prefix","suffix"),this.localize=new ji(this),this.hasFocus=!1,this.invalid=!1,this.title="",this.variant="default",this.size="medium",this.caret=!1,this.disabled=!1,this.loading=!1,this.outline=!1,this.pill=!1,this.circle=!1,this.type="button",this.name="",this.value="",this.href="",this.rel="noreferrer noopener"}get validity(){return this.isButton()?this.button.validity:cn}get validationMessage(){return this.isButton()?this.button.validationMessage:""}firstUpdated(){this.isButton()&&this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleClick(){"submit"===this.type&&this.formControlController.submit(this),"reset"===this.type&&this.formControlController.reset(this)}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e)}isButton(){return!this.href}isLink(){return!!this.href}handleDisabledChange(){this.isButton()&&this.formControlController.setValidity(this.disabled)}click(){this.button.click()}focus(e){this.button.focus(e)}blur(){this.button.blur()}checkValidity(){return!this.isButton()||this.button.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return!this.isButton()||this.button.reportValidity()}setCustomValidity(e){this.isButton()&&(this.button.setCustomValidity(e),this.formControlController.updateValidity())}render(){const e=this.isLink(),t=e?Fn`a`:Fn`button`;return On`
      <${t}
        part="base"
        class=${Dn({button:!0,"button--default":"default"===this.variant,"button--primary":"primary"===this.variant,"button--success":"success"===this.variant,"button--neutral":"neutral"===this.variant,"button--warning":"warning"===this.variant,"button--danger":"danger"===this.variant,"button--text":"text"===this.variant,"button--small":"small"===this.size,"button--medium":"medium"===this.size,"button--large":"large"===this.size,"button--caret":this.caret,"button--circle":this.circle,"button--disabled":this.disabled,"button--focused":this.hasFocus,"button--loading":this.loading,"button--standard":!this.outline,"button--outline":this.outline,"button--pill":this.pill,"button--rtl":"rtl"===this.localize.dir(),"button--has-label":this.hasSlotController.test("[default]"),"button--has-prefix":this.hasSlotController.test("prefix"),"button--has-suffix":this.hasSlotController.test("suffix")})}
        ?disabled=${In(e?void 0:this.disabled)}
        type=${In(e?void 0:this.type)}
        title=${this.title}
        name=${In(e?void 0:this.name)}
        value=${In(e?void 0:this.value)}
        href=${In(e&&!this.disabled?this.href:void 0)}
        target=${In(e?this.target:void 0)}
        download=${In(e?this.download:void 0)}
        rel=${In(e?this.rel:void 0)}
        role=${In(e?void 0:"button")}
        aria-disabled=${this.disabled?"true":"false"}
        tabindex=${this.disabled?"-1":"0"}
        @blur=${this.handleBlur}
        @focus=${this.handleFocus}
        @invalid=${this.isButton()?this.handleInvalid:null}
        @click=${this.handleClick}
      >
        <slot name="prefix" part="prefix" class="button__prefix"></slot>
        <slot part="label" class="button__label"></slot>
        <slot name="suffix" part="suffix" class="button__suffix"></slot>
        ${this.caret?On` <sl-icon part="caret" class="button__caret" library="system" name="caret"></sl-icon> `:""}
        ${this.loading?On`<sl-spinner part="spinner"></sl-spinner>`:""}
      </${t}>
    `}};zn.styles=[Ki,hn],zn.dependencies={"sl-icon":An,"sl-spinner":tn},xo([Ji(".button")],zn.prototype,"button",2),xo([Yi()],zn.prototype,"hasFocus",2),xo([Yi()],zn.prototype,"invalid",2),xo([Qi()],zn.prototype,"title",2),xo([Qi({reflect:!0})],zn.prototype,"variant",2),xo([Qi({reflect:!0})],zn.prototype,"size",2),xo([Qi({type:Boolean,reflect:!0})],zn.prototype,"caret",2),xo([Qi({type:Boolean,reflect:!0})],zn.prototype,"disabled",2),xo([Qi({type:Boolean,reflect:!0})],zn.prototype,"loading",2),xo([Qi({type:Boolean,reflect:!0})],zn.prototype,"outline",2),xo([Qi({type:Boolean,reflect:!0})],zn.prototype,"pill",2),xo([Qi({type:Boolean,reflect:!0})],zn.prototype,"circle",2),xo([Qi()],zn.prototype,"type",2),xo([Qi()],zn.prototype,"name",2),xo([Qi()],zn.prototype,"value",2),xo([Qi()],zn.prototype,"href",2),xo([Qi()],zn.prototype,"target",2),xo([Qi()],zn.prototype,"rel",2),xo([Qi()],zn.prototype,"download",2),xo([Qi()],zn.prototype,"form",2),xo([Qi({attribute:"formaction"})],zn.prototype,"formAction",2),xo([Qi({attribute:"formenctype"})],zn.prototype,"formEnctype",2),xo([Qi({attribute:"formmethod"})],zn.prototype,"formMethod",2),xo([Qi({attribute:"formnovalidate",type:Boolean})],zn.prototype,"formNoValidate",2),xo([Qi({attribute:"formtarget"})],zn.prototype,"formTarget",2),xo([wn("disabled",{waitUntilFirstUpdate:!0})],zn.prototype,"handleDisabledChange",1),zn.define("sl-button");var qn=Ro`
  :host {
    display: inline-block;
  }

  .button-group {
    display: flex;
    flex-wrap: nowrap;
  }
`,Hn=class extends en{constructor(){super(...arguments),this.disableRole=!1,this.label=""}handleFocus(e){const t=Un(e.target);null==t||t.toggleAttribute("data-sl-button-group__button--focus",!0)}handleBlur(e){const t=Un(e.target);null==t||t.toggleAttribute("data-sl-button-group__button--focus",!1)}handleMouseOver(e){const t=Un(e.target);null==t||t.toggleAttribute("data-sl-button-group__button--hover",!0)}handleMouseOut(e){const t=Un(e.target);null==t||t.toggleAttribute("data-sl-button-group__button--hover",!1)}handleSlotChange(){const e=[...this.defaultSlot.assignedElements({flatten:!0})];e.forEach(t=>{const o=e.indexOf(t),i=Un(t);i&&(i.toggleAttribute("data-sl-button-group__button",!0),i.toggleAttribute("data-sl-button-group__button--first",0===o),i.toggleAttribute("data-sl-button-group__button--inner",o>0&&o<e.length-1),i.toggleAttribute("data-sl-button-group__button--last",o===e.length-1),i.toggleAttribute("data-sl-button-group__button--radio","sl-radio-button"===i.tagName.toLowerCase()))})}render(){return mi`
      <div
        part="base"
        class="button-group"
        role="${this.disableRole?"presentation":"group"}"
        aria-label=${this.label}
        @focusout=${this.handleBlur}
        @focusin=${this.handleFocus}
        @mouseover=${this.handleMouseOver}
        @mouseout=${this.handleMouseOut}
      >
        <slot @slotchange=${this.handleSlotChange}></slot>
      </div>
    `}};function Un(e){var t;const o="sl-button, sl-radio-button";return null!=(t=e.closest(o))?t:e.querySelector(o)}Hn.styles=[Ki,qn],xo([Ji("slot")],Hn.prototype,"defaultSlot",2),xo([Yi()],Hn.prototype,"disableRole",2),xo([Qi()],Hn.prototype,"label",2),Hn.define("sl-button-group");var Wn=Ro`
  :host {
    display: inline-flex;
  }

  .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: max(12px, 0.75em);
    font-weight: var(--sl-font-weight-semibold);
    letter-spacing: var(--sl-letter-spacing-normal);
    line-height: 1;
    border-radius: var(--sl-border-radius-small);
    border: solid 1px var(--sl-color-neutral-0);
    white-space: nowrap;
    padding: 0.35em 0.6em;
    user-select: none;
    -webkit-user-select: none;
    cursor: inherit;
  }

  /* Variant modifiers */
  .badge--primary {
    background-color: var(--sl-color-primary-600);
    color: var(--sl-color-neutral-0);
  }

  .badge--success {
    background-color: var(--sl-color-success-600);
    color: var(--sl-color-neutral-0);
  }

  .badge--neutral {
    background-color: var(--sl-color-neutral-600);
    color: var(--sl-color-neutral-0);
  }

  .badge--warning {
    background-color: var(--sl-color-warning-600);
    color: var(--sl-color-neutral-0);
  }

  .badge--danger {
    background-color: var(--sl-color-danger-600);
    color: var(--sl-color-neutral-0);
  }

  /* Pill modifier */
  .badge--pill {
    border-radius: var(--sl-border-radius-pill);
  }

  /* Pulse modifier */
  .badge--pulse {
    animation: pulse 1.5s infinite;
  }

  .badge--pulse.badge--primary {
    --pulse-color: var(--sl-color-primary-600);
  }

  .badge--pulse.badge--success {
    --pulse-color: var(--sl-color-success-600);
  }

  .badge--pulse.badge--neutral {
    --pulse-color: var(--sl-color-neutral-600);
  }

  .badge--pulse.badge--warning {
    --pulse-color: var(--sl-color-warning-600);
  }

  .badge--pulse.badge--danger {
    --pulse-color: var(--sl-color-danger-600);
  }

  @keyframes pulse {
    0% {
      box-shadow: 0 0 0 0 var(--pulse-color);
    }
    70% {
      box-shadow: 0 0 0 0.5rem transparent;
    }
    100% {
      box-shadow: 0 0 0 0 transparent;
    }
  }
`,jn=class extends en{constructor(){super(...arguments),this.variant="primary",this.pill=!1,this.pulse=!1}render(){return mi`
      <span
        part="base"
        class=${Dn({badge:!0,"badge--primary":"primary"===this.variant,"badge--success":"success"===this.variant,"badge--neutral":"neutral"===this.variant,"badge--warning":"warning"===this.variant,"badge--danger":"danger"===this.variant,"badge--pill":this.pill,"badge--pulse":this.pulse})}
        role="status"
      >
        <slot></slot>
      </span>
    `}};jn.styles=[Ki,Wn],xo([Qi({reflect:!0})],jn.prototype,"variant",2),xo([Qi({type:Boolean,reflect:!0})],jn.prototype,"pill",2),xo([Qi({type:Boolean,reflect:!0})],jn.prototype,"pulse",2),jn.define("sl-badge");var Kn=Ro`
  :host {
    --size: 25rem;
    --header-spacing: var(--sl-spacing-large);
    --body-spacing: var(--sl-spacing-large);
    --footer-spacing: var(--sl-spacing-large);

    display: contents;
  }

  .drawer {
    top: 0;
    inset-inline-start: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
  }

  .drawer--contained {
    position: absolute;
    z-index: initial;
  }

  .drawer--fixed {
    position: fixed;
    z-index: var(--sl-z-index-drawer);
  }

  .drawer__panel {
    position: absolute;
    display: flex;
    flex-direction: column;
    z-index: 2;
    max-width: 100%;
    max-height: 100%;
    background-color: var(--sl-panel-background-color);
    box-shadow: var(--sl-shadow-x-large);
    overflow: auto;
    pointer-events: all;
  }

  .drawer__panel:focus {
    outline: none;
  }

  .drawer--top .drawer__panel {
    top: 0;
    inset-inline-end: auto;
    bottom: auto;
    inset-inline-start: 0;
    width: 100%;
    height: var(--size);
  }

  .drawer--end .drawer__panel {
    top: 0;
    inset-inline-end: 0;
    bottom: auto;
    inset-inline-start: auto;
    width: var(--size);
    height: 100%;
  }

  .drawer--bottom .drawer__panel {
    top: auto;
    inset-inline-end: auto;
    bottom: 0;
    inset-inline-start: 0;
    width: 100%;
    height: var(--size);
  }

  .drawer--start .drawer__panel {
    top: 0;
    inset-inline-end: auto;
    bottom: auto;
    inset-inline-start: 0;
    width: var(--size);
    height: 100%;
  }

  .drawer__header {
    display: flex;
  }

  .drawer__title {
    flex: 1 1 auto;
    font: inherit;
    font-size: var(--sl-font-size-large);
    line-height: var(--sl-line-height-dense);
    padding: var(--header-spacing);
    margin: 0;
  }

  .drawer__header-actions {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: end;
    gap: var(--sl-spacing-2x-small);
    padding: 0 var(--header-spacing);
  }

  .drawer__header-actions sl-icon-button,
  .drawer__header-actions ::slotted(sl-icon-button) {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    font-size: var(--sl-font-size-medium);
  }

  .drawer__body {
    flex: 1 1 auto;
    display: block;
    padding: var(--body-spacing);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .drawer__footer {
    text-align: right;
    padding: var(--footer-spacing);
  }

  .drawer__footer ::slotted(sl-button:not(:last-of-type)) {
    margin-inline-end: var(--sl-spacing-x-small);
  }

  .drawer:not(.drawer--has-footer) .drawer__footer {
    display: none;
  }

  .drawer__overlay {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: var(--sl-overlay-background-color);
    pointer-events: all;
  }

  .drawer--contained .drawer__overlay {
    display: none;
  }

  @media (forced-colors: active) {
    .drawer__panel {
      border: solid 1px var(--sl-color-neutral-0);
    }
  }
`;function*Gn(e=document.activeElement){var t,o,i,n,r;null!=e&&(yield e,"shadowRoot"in e&&e.shadowRoot&&"closed"!==e.shadowRoot.mode&&(yield*(t=Gn(e.shadowRoot.activeElement),i=t[bo("asyncIterator")],n=!1,r={},null==i?(i=t[bo("iterator")](),o=e=>r[e]=t=>i[e](t)):(i=i.call(t),o=e=>r[e]=t=>{if(n){if(n=!1,"throw"===e)throw t;return t}return n=!0,{done:!1,value:new So(new Promise(o=>{var n=i[e](t);n instanceof Object||yo("Object expected"),o(n)}),1)}}),r[bo("iterator")]=()=>r,o("next"),"throw"in i?o("throw"):r.throw=e=>{throw e},"return"in i&&o("return"),r)))}var Xn=new WeakMap;function Qn(e){let t=Xn.get(e);return t||(t=window.getComputedStyle(e,null),Xn.set(e,t)),t}function Yn(e){const t=e.tagName.toLowerCase(),o=Number(e.getAttribute("tabindex"));if(e.hasAttribute("tabindex")&&(isNaN(o)||o<=-1))return!1;if(e.hasAttribute("disabled"))return!1;if(e.closest("[inert]"))return!1;if("input"===t&&"radio"===e.getAttribute("type")){const t=e.getRootNode(),o=`input[type='radio'][name="${e.getAttribute("name")}"]`,i=t.querySelector(`${o}:checked`);if(i)return i===e;return t.querySelector(o)===e}if(!function(e){if("function"==typeof e.checkVisibility)return e.checkVisibility({checkOpacity:!1,checkVisibilityCSS:!0});const t=Qn(e);return"hidden"!==t.visibility&&"none"!==t.display}(e))return!1;if(("audio"===t||"video"===t)&&e.hasAttribute("controls"))return!0;if(e.hasAttribute("tabindex"))return!0;if(e.hasAttribute("contenteditable")&&"false"!==e.getAttribute("contenteditable"))return!0;return!!["button","input","select","textarea","a","audio","video","summary","iframe"].includes(t)||function(e){const t=Qn(e),{overflowY:o,overflowX:i}=t;return"scroll"===o||"scroll"===i||"auto"===o&&"auto"===i&&(e.scrollHeight>e.clientHeight&&"auto"===o||!(!(e.scrollWidth>e.clientWidth)||"auto"!==i))}(e)}function Jn(e){const t=new WeakMap,o=[];return function i(n){if(n instanceof Element){if(n.hasAttribute("inert")||n.closest("[inert]"))return;if(t.has(n))return;t.set(n,!0),!o.includes(n)&&Yn(n)&&o.push(n),n instanceof HTMLSlotElement&&function(e,t){var o;return(null==(o=e.getRootNode({composed:!0}))?void 0:o.host)!==t}(n,e)&&n.assignedElements({flatten:!0}).forEach(e=>{i(e)}),null!==n.shadowRoot&&"open"===n.shadowRoot.mode&&i(n.shadowRoot)}for(const e of n.children)i(e)}(e),o.sort((e,t)=>{const o=Number(e.getAttribute("tabindex"))||0;return(Number(t.getAttribute("tabindex"))||0)-o})}var Zn=[],er=class{constructor(e){this.tabDirection="forward",this.handleFocusIn=()=>{this.isActive()&&this.checkFocus()},this.handleKeyDown=e=>{var t;if("Tab"!==e.key||this.isExternalActivated)return;if(!this.isActive())return;const o=[...Gn()].pop();if(this.previousFocus=o,this.previousFocus&&this.possiblyHasTabbableChildren(this.previousFocus))return;e.shiftKey?this.tabDirection="backward":this.tabDirection="forward";const i=Jn(this.element);let n=i.findIndex(e=>e===o);this.previousFocus=this.currentFocus;const r="forward"===this.tabDirection?1:-1;for(;;){n+r>=i.length?n=0:n+r<0?n=i.length-1:n+=r,this.previousFocus=this.currentFocus;const o=i[n];if("backward"===this.tabDirection&&this.previousFocus&&this.possiblyHasTabbableChildren(this.previousFocus))return;if(o&&this.possiblyHasTabbableChildren(o))return;e.preventDefault(),this.currentFocus=o,null==(t=this.currentFocus)||t.focus({preventScroll:!1});const s=[...Gn()];if(s.includes(this.currentFocus)||!s.includes(this.previousFocus))break}setTimeout(()=>this.checkFocus())},this.handleKeyUp=()=>{this.tabDirection="forward"},this.element=e,this.elementsWithTabbableControls=["iframe"]}activate(){Zn.push(this.element),document.addEventListener("focusin",this.handleFocusIn),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}deactivate(){Zn=Zn.filter(e=>e!==this.element),this.currentFocus=null,document.removeEventListener("focusin",this.handleFocusIn),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)}isActive(){return Zn[Zn.length-1]===this.element}activateExternal(){this.isExternalActivated=!0}deactivateExternal(){this.isExternalActivated=!1}checkFocus(){if(this.isActive()&&!this.isExternalActivated){const e=Jn(this.element);if(!this.element.matches(":focus-within")){const t=e[0],o=e[e.length-1],i="forward"===this.tabDirection?t:o;"function"==typeof(null==i?void 0:i.focus)&&(this.currentFocus=i,i.focus({preventScroll:!1}))}}}possiblyHasTabbableChildren(e){return this.elementsWithTabbableControls.includes(e.tagName.toLowerCase())||e.hasAttribute("controls")}};var tr=new Set;function or(e){if(tr.add(e),!document.documentElement.classList.contains("sl-scroll-lock")){const e=function(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}()+function(){const e=Number(getComputedStyle(document.body).paddingRight.replace(/px/,""));return isNaN(e)||!e?0:e}();let t=getComputedStyle(document.documentElement).scrollbarGutter;t&&"auto"!==t||(t="stable"),e<2&&(t=""),document.documentElement.style.setProperty("--sl-scroll-lock-gutter",t),document.documentElement.classList.add("sl-scroll-lock"),document.documentElement.style.setProperty("--sl-scroll-lock-size",`${e}px`)}}function ir(e){tr.delete(e),0===tr.size&&(document.documentElement.classList.remove("sl-scroll-lock"),document.documentElement.style.removeProperty("--sl-scroll-lock-size"))}function nr(e,t,o="vertical",i="smooth"){const n=function(e,t){return{top:Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top),left:Math.round(e.getBoundingClientRect().left-t.getBoundingClientRect().left)}}(e,t),r=n.top+t.scrollTop,s=n.left+t.scrollLeft,a=t.scrollLeft,l=t.scrollLeft+t.offsetWidth,c=t.scrollTop,d=t.scrollTop+t.offsetHeight;"horizontal"!==o&&"both"!==o||(s<a?t.scrollTo({left:s,behavior:i}):s+e.clientWidth>l&&t.scrollTo({left:s-t.offsetWidth+e.clientWidth,behavior:i})),"vertical"!==o&&"both"!==o||(r<c?t.scrollTo({top:r,behavior:i}):r+e.clientHeight>d&&t.scrollTo({top:r-t.offsetHeight+e.clientHeight,behavior:i}))}var rr=e=>{var t;const{activeElement:o}=document;o&&e.contains(o)&&(null==(t=document.activeElement)||t.blur())},sr=Ro`
  :host {
    display: inline-block;
    color: var(--sl-color-neutral-600);
  }

  .icon-button {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    background: none;
    border: none;
    border-radius: var(--sl-border-radius-medium);
    font-size: inherit;
    color: inherit;
    padding: var(--sl-spacing-x-small);
    cursor: pointer;
    transition: var(--sl-transition-x-fast) color;
    -webkit-appearance: none;
  }

  .icon-button:hover:not(.icon-button--disabled),
  .icon-button:focus-visible:not(.icon-button--disabled) {
    color: var(--sl-color-primary-600);
  }

  .icon-button:active:not(.icon-button--disabled) {
    color: var(--sl-color-primary-700);
  }

  .icon-button:focus {
    outline: none;
  }

  .icon-button--disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .icon-button:focus-visible {
    outline: var(--sl-focus-ring);
    outline-offset: var(--sl-focus-ring-offset);
  }

  .icon-button__icon {
    pointer-events: none;
  }
`,ar=class extends en{constructor(){super(...arguments),this.hasFocus=!1,this.label="",this.disabled=!1}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleClick(e){this.disabled&&(e.preventDefault(),e.stopPropagation())}click(){this.button.click()}focus(e){this.button.focus(e)}blur(){this.button.blur()}render(){const e=!!this.href,t=e?Fn`a`:Fn`button`;return On`
      <${t}
        part="base"
        class=${Dn({"icon-button":!0,"icon-button--disabled":!e&&this.disabled,"icon-button--focused":this.hasFocus})}
        ?disabled=${In(e?void 0:this.disabled)}
        type=${In(e?void 0:"button")}
        href=${In(e?this.href:void 0)}
        target=${In(e?this.target:void 0)}
        download=${In(e?this.download:void 0)}
        rel=${In(e&&this.target?"noreferrer noopener":void 0)}
        role=${In(e?void 0:"button")}
        aria-disabled=${this.disabled?"true":"false"}
        aria-label="${this.label}"
        tabindex=${this.disabled?"-1":"0"}
        @blur=${this.handleBlur}
        @focus=${this.handleFocus}
        @click=${this.handleClick}
      >
        <sl-icon
          class="icon-button__icon"
          name=${In(this.name)}
          library=${In(this.library)}
          src=${In(this.src)}
          aria-hidden="true"
        ></sl-icon>
      </${t}>
    `}};ar.styles=[Ki,sr],ar.dependencies={"sl-icon":An},xo([Ji(".icon-button")],ar.prototype,"button",2),xo([Yi()],ar.prototype,"hasFocus",2),xo([Qi()],ar.prototype,"name",2),xo([Qi()],ar.prototype,"library",2),xo([Qi()],ar.prototype,"src",2),xo([Qi()],ar.prototype,"href",2),xo([Qi()],ar.prototype,"target",2),xo([Qi()],ar.prototype,"download",2),xo([Qi()],ar.prototype,"label",2),xo([Qi({type:Boolean,reflect:!0})],ar.prototype,"disabled",2);var lr=new Map,cr=new WeakMap;function dr(e,t){return"rtl"===t.toLowerCase()?{keyframes:e.rtlKeyframes||e.keyframes,options:e.options}:e}function ur(e,t){lr.set(e,function(e){return null!=e?e:{keyframes:[],options:{duration:0}}}(t))}function hr(e,t,o){const i=cr.get(e);if(null==i?void 0:i[t])return dr(i[t],o.dir);const n=lr.get(t);return n?dr(n,o.dir):{keyframes:[],options:{duration:0}}}function pr(e,t){return new Promise(o=>{e.addEventListener(t,function i(n){n.target===e&&(e.removeEventListener(t,i),o())})})}function mr(e,t,o){return new Promise(i=>{if((null==o?void 0:o.duration)===1/0)throw new Error("Promise-based animations must be finite.");const n=e.animate(t,_o(ko({},o),{duration:gr()?0:o.duration}));n.addEventListener("cancel",i,{once:!0}),n.addEventListener("finish",i,{once:!0})})}function fr(e){return(e=e.toString().toLowerCase()).indexOf("ms")>-1?parseFloat(e):e.indexOf("s")>-1?1e3*parseFloat(e):parseFloat(e)}function gr(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}function vr(e){return Promise.all(e.getAnimations().map(e=>new Promise(t=>{e.cancel(),requestAnimationFrame(t)})))}function br(e){return e.charAt(0).toUpperCase()+e.slice(1)}var yr=class extends en{constructor(){super(...arguments),this.hasSlotController=new pn(this,"footer"),this.localize=new ji(this),this.modal=new er(this),this.open=!1,this.label="",this.placement="end",this.contained=!1,this.noHeader=!1,this.handleDocumentKeyDown=e=>{this.contained||"Escape"===e.key&&this.modal.isActive()&&this.open&&(e.stopImmediatePropagation(),this.requestClose("keyboard"))}}firstUpdated(){this.drawer.hidden=!this.open,this.open&&(this.addOpenListeners(),this.contained||(this.modal.activate(),or(this)))}disconnectedCallback(){super.disconnectedCallback(),ir(this),this.removeOpenListeners()}requestClose(e){if(this.emit("sl-request-close",{cancelable:!0,detail:{source:e}}).defaultPrevented){const e=hr(this,"drawer.denyClose",{dir:this.localize.dir()});return void mr(this.panel,e.keyframes,e.options)}this.hide()}addOpenListeners(){var e;"CloseWatcher"in window?(null==(e=this.closeWatcher)||e.destroy(),this.contained||(this.closeWatcher=new CloseWatcher,this.closeWatcher.onclose=()=>this.requestClose("keyboard"))):document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){var e;document.removeEventListener("keydown",this.handleDocumentKeyDown),null==(e=this.closeWatcher)||e.destroy()}async handleOpenChange(){if(this.open){this.emit("sl-show"),this.addOpenListeners(),this.originalTrigger=document.activeElement,this.contained||(this.modal.activate(),or(this));const e=this.querySelector("[autofocus]");e&&e.removeAttribute("autofocus"),await Promise.all([vr(this.drawer),vr(this.overlay)]),this.drawer.hidden=!1,requestAnimationFrame(()=>{this.emit("sl-initial-focus",{cancelable:!0}).defaultPrevented||(e?e.focus({preventScroll:!0}):this.panel.focus({preventScroll:!0})),e&&e.setAttribute("autofocus","")});const t=hr(this,`drawer.show${br(this.placement)}`,{dir:this.localize.dir()}),o=hr(this,"drawer.overlay.show",{dir:this.localize.dir()});await Promise.all([mr(this.panel,t.keyframes,t.options),mr(this.overlay,o.keyframes,o.options)]),this.emit("sl-after-show")}else{rr(this),this.emit("sl-hide"),this.removeOpenListeners(),this.contained||(this.modal.deactivate(),ir(this)),await Promise.all([vr(this.drawer),vr(this.overlay)]);const e=hr(this,`drawer.hide${br(this.placement)}`,{dir:this.localize.dir()}),t=hr(this,"drawer.overlay.hide",{dir:this.localize.dir()});await Promise.all([mr(this.overlay,t.keyframes,t.options).then(()=>{this.overlay.hidden=!0}),mr(this.panel,e.keyframes,e.options).then(()=>{this.panel.hidden=!0})]),this.drawer.hidden=!0,this.overlay.hidden=!1,this.panel.hidden=!1;const o=this.originalTrigger;"function"==typeof(null==o?void 0:o.focus)&&setTimeout(()=>o.focus()),this.emit("sl-after-hide")}}handleNoModalChange(){this.open&&!this.contained&&(this.modal.activate(),or(this)),this.open&&this.contained&&(this.modal.deactivate(),ir(this))}async show(){if(!this.open)return this.open=!0,pr(this,"sl-after-show")}async hide(){if(this.open)return this.open=!1,pr(this,"sl-after-hide")}render(){return mi`
      <div
        part="base"
        class=${Dn({drawer:!0,"drawer--open":this.open,"drawer--top":"top"===this.placement,"drawer--end":"end"===this.placement,"drawer--bottom":"bottom"===this.placement,"drawer--start":"start"===this.placement,"drawer--contained":this.contained,"drawer--fixed":!this.contained,"drawer--rtl":"rtl"===this.localize.dir(),"drawer--has-footer":this.hasSlotController.test("footer")})}
      >
        <div part="overlay" class="drawer__overlay" @click=${()=>this.requestClose("overlay")} tabindex="-1"></div>

        <div
          part="panel"
          class="drawer__panel"
          role="dialog"
          aria-modal="true"
          aria-hidden=${this.open?"false":"true"}
          aria-label=${In(this.noHeader?this.label:void 0)}
          aria-labelledby=${In(this.noHeader?void 0:"title")}
          tabindex="0"
        >
          ${this.noHeader?"":mi`
                <header part="header" class="drawer__header">
                  <h2 part="title" class="drawer__title" id="title">
                    <!-- If there's no label, use an invisible character to prevent the header from collapsing -->
                    <slot name="label"> ${this.label.length>0?this.label:String.fromCharCode(65279)} </slot>
                  </h2>
                  <div part="header-actions" class="drawer__header-actions">
                    <slot name="header-actions"></slot>
                    <sl-icon-button
                      part="close-button"
                      exportparts="base:close-button__base"
                      class="drawer__close"
                      name="x-lg"
                      label=${this.localize.term("close")}
                      library="system"
                      @click=${()=>this.requestClose("close-button")}
                    ></sl-icon-button>
                  </div>
                </header>
              `}

          <slot part="body" class="drawer__body"></slot>

          <footer part="footer" class="drawer__footer">
            <slot name="footer"></slot>
          </footer>
        </div>
      </div>
    `}};yr.styles=[Ki,Kn],yr.dependencies={"sl-icon-button":ar},xo([Ji(".drawer")],yr.prototype,"drawer",2),xo([Ji(".drawer__panel")],yr.prototype,"panel",2),xo([Ji(".drawer__overlay")],yr.prototype,"overlay",2),xo([Qi({type:Boolean,reflect:!0})],yr.prototype,"open",2),xo([Qi({reflect:!0})],yr.prototype,"label",2),xo([Qi({reflect:!0})],yr.prototype,"placement",2),xo([Qi({type:Boolean,reflect:!0})],yr.prototype,"contained",2),xo([Qi({attribute:"no-header",type:Boolean,reflect:!0})],yr.prototype,"noHeader",2),xo([wn("open",{waitUntilFirstUpdate:!0})],yr.prototype,"handleOpenChange",1),xo([wn("contained",{waitUntilFirstUpdate:!0})],yr.prototype,"handleNoModalChange",1),ur("drawer.showTop",{keyframes:[{opacity:0,translate:"0 -100%"},{opacity:1,translate:"0 0"}],options:{duration:250,easing:"ease"}}),ur("drawer.hideTop",{keyframes:[{opacity:1,translate:"0 0"},{opacity:0,translate:"0 -100%"}],options:{duration:250,easing:"ease"}}),ur("drawer.showEnd",{keyframes:[{opacity:0,translate:"100%"},{opacity:1,translate:"0"}],rtlKeyframes:[{opacity:0,translate:"-100%"},{opacity:1,translate:"0"}],options:{duration:250,easing:"ease"}}),ur("drawer.hideEnd",{keyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"100%"}],rtlKeyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"-100%"}],options:{duration:250,easing:"ease"}}),ur("drawer.showBottom",{keyframes:[{opacity:0,translate:"0 100%"},{opacity:1,translate:"0 0"}],options:{duration:250,easing:"ease"}}),ur("drawer.hideBottom",{keyframes:[{opacity:1,translate:"0 0"},{opacity:0,translate:"0 100%"}],options:{duration:250,easing:"ease"}}),ur("drawer.showStart",{keyframes:[{opacity:0,translate:"-100%"},{opacity:1,translate:"0"}],rtlKeyframes:[{opacity:0,translate:"100%"},{opacity:1,translate:"0"}],options:{duration:250,easing:"ease"}}),ur("drawer.hideStart",{keyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"-100%"}],rtlKeyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"100%"}],options:{duration:250,easing:"ease"}}),ur("drawer.denyClose",{keyframes:[{scale:1},{scale:1.01},{scale:1}],options:{duration:250}}),ur("drawer.overlay.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:250}}),ur("drawer.overlay.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:250}}),yr.define("sl-drawer"),An.define("sl-icon"),ar.define("sl-icon-button");var wr=Ro`
  :host {
    --max-width: 20rem;
    --hide-delay: 0ms;
    --show-delay: 150ms;

    display: contents;
  }

  .tooltip {
    --arrow-size: var(--sl-tooltip-arrow-size);
    --arrow-color: var(--sl-tooltip-background-color);
  }

  .tooltip::part(popup) {
    z-index: var(--sl-z-index-tooltip);
  }

  .tooltip[placement^='top']::part(popup) {
    transform-origin: bottom;
  }

  .tooltip[placement^='bottom']::part(popup) {
    transform-origin: top;
  }

  .tooltip[placement^='left']::part(popup) {
    transform-origin: right;
  }

  .tooltip[placement^='right']::part(popup) {
    transform-origin: left;
  }

  .tooltip__body {
    display: block;
    width: max-content;
    max-width: var(--max-width);
    border-radius: var(--sl-tooltip-border-radius);
    background-color: var(--sl-tooltip-background-color);
    font-family: var(--sl-tooltip-font-family);
    font-size: var(--sl-tooltip-font-size);
    font-weight: var(--sl-tooltip-font-weight);
    line-height: var(--sl-tooltip-line-height);
    text-align: start;
    white-space: normal;
    color: var(--sl-tooltip-color);
    padding: var(--sl-tooltip-padding);
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
  }
`,kr=Ro`
  :host {
    --arrow-color: var(--sl-color-neutral-1000);
    --arrow-size: 6px;

    /*
     * These properties are computed to account for the arrow's dimensions after being rotated 45º. The constant
     * 0.7071 is derived from sin(45), which is the diagonal size of the arrow's container after rotating.
     */
    --arrow-size-diagonal: calc(var(--arrow-size) * 0.7071);
    --arrow-padding-offset: calc(var(--arrow-size-diagonal) - var(--arrow-size));

    display: contents;
  }

  .popup {
    position: absolute;
    isolation: isolate;
    max-width: var(--auto-size-available-width, none);
    max-height: var(--auto-size-available-height, none);
  }

  .popup--fixed {
    position: fixed;
  }

  .popup:not(.popup--active) {
    display: none;
  }

  .popup__arrow {
    position: absolute;
    width: calc(var(--arrow-size-diagonal) * 2);
    height: calc(var(--arrow-size-diagonal) * 2);
    rotate: 45deg;
    background: var(--arrow-color);
    z-index: -1;
  }

  /* Hover bridge */
  .popup-hover-bridge:not(.popup-hover-bridge--visible) {
    display: none;
  }

  .popup-hover-bridge {
    position: fixed;
    z-index: calc(var(--sl-z-index-dropdown) - 1);
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    clip-path: polygon(
      var(--hover-bridge-top-left-x, 0) var(--hover-bridge-top-left-y, 0),
      var(--hover-bridge-top-right-x, 0) var(--hover-bridge-top-right-y, 0),
      var(--hover-bridge-bottom-right-x, 0) var(--hover-bridge-bottom-right-y, 0),
      var(--hover-bridge-bottom-left-x, 0) var(--hover-bridge-bottom-left-y, 0)
    );
  }
`;const _r=Math.min,xr=Math.max,Er=Math.round,Sr=Math.floor,Cr=e=>({x:e,y:e}),Ar={left:"right",right:"left",bottom:"top",top:"bottom"};function Tr(e,t,o){return xr(e,_r(t,o))}function Nr(e,t){return"function"==typeof e?e(t):e}function Pr(e){return e.split("-")[0]}function Rr(e){return e.split("-")[1]}function Br(e){return"x"===e?"y":"x"}function Vr(e){return"y"===e?"height":"width"}function Dr(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function Lr(e){return Br(Dr(e))}function $r(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Fr=["left","right"],Mr=["right","left"],Or=["top","bottom"],Ir=["bottom","top"];function zr(e,t,o,i){const n=Rr(e);let r=function(e,t,o){switch(e){case"top":case"bottom":return o?t?Mr:Fr:t?Fr:Mr;case"left":case"right":return t?Or:Ir;default:return[]}}(Pr(e),"start"===o,i);return n&&(r=r.map(e=>e+"-"+n),t&&(r=r.concat(r.map($r)))),r}function qr(e){const t=Pr(e);return Ar[t]+e.slice(t.length)}function Hr(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Ur(e){const{x:t,y:o,width:i,height:n}=e;return{width:i,height:n,top:o,left:t,right:t+i,bottom:o+n,x:t,y:o}}function Wr(e,t,o){let{reference:i,floating:n}=e;const r=Dr(t),s=Lr(t),a=Vr(s),l=Pr(t),c="y"===r,d=i.x+i.width/2-n.width/2,u=i.y+i.height/2-n.height/2,h=i[a]/2-n[a]/2;let p;switch(l){case"top":p={x:d,y:i.y-n.height};break;case"bottom":p={x:d,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:u};break;case"left":p={x:i.x-n.width,y:u};break;default:p={x:i.x,y:i.y}}switch(Rr(t)){case"start":p[s]-=h*(o&&c?-1:1);break;case"end":p[s]+=h*(o&&c?-1:1)}return p}async function jr(e,t){var o;void 0===t&&(t={});const{x:i,y:n,platform:r,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:p=0}=Nr(t,e),m=Hr(p),f=a[h?"floating"===u?"reference":"floating":u],g=Ur(await r.getClippingRect({element:null==(o=await(null==r.isElement?void 0:r.isElement(f)))||o?f:f.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),v="floating"===u?{x:i,y:n,width:s.floating.width,height:s.floating.height}:s.reference,b=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),y=await(null==r.isElement?void 0:r.isElement(b))&&await(null==r.getScale?void 0:r.getScale(b))||{x:1,y:1},w=Ur(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:b,strategy:l}):v);return{top:(g.top-w.top+m.top)/y.y,bottom:(w.bottom-g.bottom+m.bottom)/y.y,left:(g.left-w.left+m.left)/y.x,right:(w.right-g.right+m.right)/y.x}}const Kr=new Set(["left","top"]);function Gr(){return"undefined"!=typeof window}function Xr(e){return Jr(e)?(e.nodeName||"").toLowerCase():"#document"}function Qr(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Yr(e){var t;return null==(t=(Jr(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Jr(e){return!!Gr()&&(e instanceof Node||e instanceof Qr(e).Node)}function Zr(e){return!!Gr()&&(e instanceof Element||e instanceof Qr(e).Element)}function es(e){return!!Gr()&&(e instanceof HTMLElement||e instanceof Qr(e).HTMLElement)}function ts(e){return!(!Gr()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Qr(e).ShadowRoot)}function os(e){const{overflow:t,overflowX:o,overflowY:i,display:n}=hs(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+o)&&"inline"!==n&&"contents"!==n}function is(e){return/^(table|td|th)$/.test(Xr(e))}function ns(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}const rs=/transform|translate|scale|rotate|perspective|filter/,ss=/paint|layout|strict|content/,as=e=>!!e&&"none"!==e;let ls;function cs(e){const t=Zr(e)?hs(e):e;return as(t.transform)||as(t.translate)||as(t.scale)||as(t.rotate)||as(t.perspective)||!ds()&&(as(t.backdropFilter)||as(t.filter))||rs.test(t.willChange||"")||ss.test(t.contain||"")}function ds(){return null==ls&&(ls="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ls}function us(e){return/^(html|body|#document)$/.test(Xr(e))}function hs(e){return Qr(e).getComputedStyle(e)}function ps(e){return Zr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ms(e){if("html"===Xr(e))return e;const t=e.assignedSlot||e.parentNode||ts(e)&&e.host||Yr(e);return ts(t)?t.host:t}function fs(e){const t=ms(e);return us(t)?e.ownerDocument?e.ownerDocument.body:e.body:es(t)&&os(t)?t:fs(t)}function gs(e,t,o){var i;void 0===t&&(t=[]),void 0===o&&(o=!0);const n=fs(e),r=n===(null==(i=e.ownerDocument)?void 0:i.body),s=Qr(n);if(r){const e=vs(s);return t.concat(s,s.visualViewport||[],os(n)?n:[],e&&o?gs(e):[])}return t.concat(n,gs(n,[],o))}function vs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bs(e){const t=hs(e);let o=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const n=es(e),r=n?e.offsetWidth:o,s=n?e.offsetHeight:i,a=Er(o)!==r||Er(i)!==s;return a&&(o=r,i=s),{width:o,height:i,$:a}}function ys(e){return Zr(e)?e:e.contextElement}function ws(e){const t=ys(e);if(!es(t))return Cr(1);const o=t.getBoundingClientRect(),{width:i,height:n,$:r}=bs(t);let s=(r?Er(o.width):o.width)/i,a=(r?Er(o.height):o.height)/n;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const ks=Cr(0);function _s(e){const t=Qr(e);return ds()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ks}function xs(e,t,o,i){void 0===t&&(t=!1),void 0===o&&(o=!1);const n=e.getBoundingClientRect(),r=ys(e);let s=Cr(1);t&&(i?Zr(i)&&(s=ws(i)):s=ws(e));const a=function(e,t,o){return void 0===t&&(t=!1),!(!o||t&&o!==Qr(e))&&t}(r,o,i)?_s(r):Cr(0);let l=(n.left+a.x)/s.x,c=(n.top+a.y)/s.y,d=n.width/s.x,u=n.height/s.y;if(r){const e=Qr(r),t=i&&Zr(i)?Qr(i):i;let o=e,n=vs(o);for(;n&&i&&t!==o;){const e=ws(n),t=n.getBoundingClientRect(),i=hs(n),r=t.left+(n.clientLeft+parseFloat(i.paddingLeft))*e.x,s=t.top+(n.clientTop+parseFloat(i.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=r,c+=s,o=Qr(n),n=vs(o)}}return Ur({width:d,height:u,x:l,y:c})}function Es(e,t){const o=ps(e).scrollLeft;return t?t.left+o:xs(Yr(e)).left+o}function Ss(e,t){const o=e.getBoundingClientRect();return{x:o.left+t.scrollLeft-Es(e,o),y:o.top+t.scrollTop}}function Cs(e,t,o){let i;if("viewport"===t)i=function(e,t){const o=Qr(e),i=Yr(e),n=o.visualViewport;let r=i.clientWidth,s=i.clientHeight,a=0,l=0;if(n){r=n.width,s=n.height;const e=ds();(!e||e&&"fixed"===t)&&(a=n.offsetLeft,l=n.offsetTop)}const c=Es(i);if(c<=0){const e=i.ownerDocument,t=e.body,o=getComputedStyle(t),n="CSS1Compat"===e.compatMode&&parseFloat(o.marginLeft)+parseFloat(o.marginRight)||0,s=Math.abs(i.clientWidth-t.clientWidth-n);s<=25&&(r-=s)}else c<=25&&(r+=c);return{width:r,height:s,x:a,y:l}}(e,o);else if("document"===t)i=function(e){const t=Yr(e),o=ps(e),i=e.ownerDocument.body,n=xr(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),r=xr(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let s=-o.scrollLeft+Es(e);const a=-o.scrollTop;return"rtl"===hs(i).direction&&(s+=xr(t.clientWidth,i.clientWidth)-n),{width:n,height:r,x:s,y:a}}(Yr(e));else if(Zr(t))i=function(e,t){const o=xs(e,!0,"fixed"===t),i=o.top+e.clientTop,n=o.left+e.clientLeft,r=es(e)?ws(e):Cr(1);return{width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:n*r.x,y:i*r.y}}(t,o);else{const o=_s(e);i={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Ur(i)}function As(e,t){const o=ms(e);return!(o===t||!Zr(o)||us(o))&&("fixed"===hs(o).position||As(o,t))}function Ts(e,t,o){const i=es(t),n=Yr(t),r="fixed"===o,s=xs(e,!0,r,t);let a={scrollLeft:0,scrollTop:0};const l=Cr(0);function c(){l.x=Es(n)}if(i||!i&&!r)if(("body"!==Xr(t)||os(n))&&(a=ps(t)),i){const e=xs(t,!0,r,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else n&&c();r&&!i&&n&&c();const d=!n||i||r?Cr(0):Ss(n,a);return{x:s.left+a.scrollLeft-l.x-d.x,y:s.top+a.scrollTop-l.y-d.y,width:s.width,height:s.height}}function Ns(e){return"static"===hs(e).position}function Ps(e,t){if(!es(e)||"fixed"===hs(e).position)return null;if(t)return t(e);let o=e.offsetParent;return Yr(e)===o&&(o=o.ownerDocument.body),o}function Rs(e,t){const o=Qr(e);if(ns(e))return o;if(!es(e)){let t=ms(e);for(;t&&!us(t);){if(Zr(t)&&!Ns(t))return t;t=ms(t)}return o}let i=Ps(e,t);for(;i&&is(i)&&Ns(i);)i=Ps(i,t);return i&&us(i)&&Ns(i)&&!cs(i)?o:i||function(e){let t=ms(e);for(;es(t)&&!us(t);){if(cs(t))return t;if(ns(t))return null;t=ms(t)}return null}(e)||o}const Bs={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:o,offsetParent:i,strategy:n}=e;const r="fixed"===n,s=Yr(i),a=!!t&&ns(t.floating);if(i===s||a&&r)return o;let l={scrollLeft:0,scrollTop:0},c=Cr(1);const d=Cr(0),u=es(i);if((u||!u&&!r)&&(("body"!==Xr(i)||os(s))&&(l=ps(i)),u)){const e=xs(i);c=ws(i),d.x=e.x+i.clientLeft,d.y=e.y+i.clientTop}const h=!s||u||r?Cr(0):Ss(s,l);return{width:o.width*c.x,height:o.height*c.y,x:o.x*c.x-l.scrollLeft*c.x+d.x+h.x,y:o.y*c.y-l.scrollTop*c.y+d.y+h.y}},getDocumentElement:Yr,getClippingRect:function(e){let{element:t,boundary:o,rootBoundary:i,strategy:n}=e;const r="clippingAncestors"===o?ns(t)?[]:function(e,t){const o=t.get(e);if(o)return o;let i=gs(e,[],!1).filter(e=>Zr(e)&&"body"!==Xr(e)),n=null;const r="fixed"===hs(e).position;let s=r?ms(e):e;for(;Zr(s)&&!us(s);){const t=hs(s),o=cs(s);o||"fixed"!==t.position||(n=null),(r?!o&&!n:!o&&"static"===t.position&&n&&("absolute"===n.position||"fixed"===n.position)||os(s)&&!o&&As(e,s))?i=i.filter(e=>e!==s):n=t,s=ms(s)}return t.set(e,i),i}(t,this._c):[].concat(o),s=[...r,i],a=Cs(t,s[0],n);let l=a.top,c=a.right,d=a.bottom,u=a.left;for(let h=1;h<s.length;h++){const e=Cs(t,s[h],n);l=xr(e.top,l),c=_r(e.right,c),d=_r(e.bottom,d),u=xr(e.left,u)}return{width:c-u,height:d-l,x:u,y:l}},getOffsetParent:Rs,getElementRects:async function(e){const t=this.getOffsetParent||Rs,o=this.getDimensions,i=await o(e.floating);return{reference:Ts(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:o}=bs(e);return{width:t,height:o}},getScale:ws,isElement:Zr,isRTL:function(e){return"rtl"===hs(e).direction}};function Vs(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ds(e,t,o,i){void 0===i&&(i={});const{ancestorScroll:n=!0,ancestorResize:r=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=i,c=ys(e),d=n||r?[...c?gs(c):[],...t?gs(t):[]]:[];d.forEach(e=>{n&&e.addEventListener("scroll",o,{passive:!0}),r&&e.addEventListener("resize",o)});const u=c&&a?function(e,t){let o,i=null;const n=Yr(e);function r(){var e;clearTimeout(o),null==(e=i)||e.disconnect(),i=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),r();const c=e.getBoundingClientRect(),{left:d,top:u,width:h,height:p}=c;if(a||t(),!h||!p)return;const m={rootMargin:-Sr(u)+"px "+-Sr(n.clientWidth-(d+h))+"px "+-Sr(n.clientHeight-(u+p))+"px "+-Sr(d)+"px",threshold:xr(0,_r(1,l))||1};let f=!0;function g(t){const i=t[0].intersectionRatio;if(i!==l){if(!f)return s();i?s(!1,i):o=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==i||Vs(c,e.getBoundingClientRect())||s(),f=!1}try{i=new IntersectionObserver(g,{...m,root:n.ownerDocument})}catch(v){i=new IntersectionObserver(g,m)}i.observe(e)}(!0),r}(c,o):null;let h,p=-1,m=null;s&&(m=new ResizeObserver(e=>{let[i]=e;i&&i.target===c&&m&&t&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),o()}),c&&!l&&m.observe(c),t&&m.observe(t));let f=l?xs(e):null;return l&&function t(){const i=xs(e);f&&!Vs(f,i)&&o();f=i,h=requestAnimationFrame(t)}(),o(),()=>{var e;d.forEach(e=>{n&&e.removeEventListener("scroll",o),r&&e.removeEventListener("resize",o)}),null==u||u(),null==(e=m)||e.disconnect(),m=null,l&&cancelAnimationFrame(h)}}const Ls=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var o,i;const{x:n,y:r,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:o,platform:i,elements:n}=e,r=await(null==i.isRTL?void 0:i.isRTL(n.floating)),s=Pr(o),a=Rr(o),l="y"===Dr(o),c=Kr.has(s)?-1:1,d=r&&l?-1:1,u=Nr(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:m}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&"number"==typeof m&&(p="end"===a?-1*m:m),l?{x:p*d,y:h*c}:{x:h*c,y:p*d}}(t,e);return s===(null==(o=a.offset)?void 0:o.placement)&&null!=(i=a.arrow)&&i.alignmentOffset?{}:{x:n+l.x,y:r+l.y,data:{...l,placement:s}}}}},$s=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:o,y:i,placement:n,platform:r}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:e=>{let{x:t,y:o}=e;return{x:t,y:o}}},...c}=Nr(e,t),d={x:o,y:i},u=await r.detectOverflow(t,c),h=Dr(Pr(n)),p=Br(h);let m=d[p],f=d[h];if(s){const e="y"===p?"bottom":"right";m=Tr(m+u["y"===p?"top":"left"],m,m-u[e])}if(a){const e="y"===h?"bottom":"right";f=Tr(f+u["y"===h?"top":"left"],f,f-u[e])}const g=l.fn({...t,[p]:m,[h]:f});return{...g,data:{x:g.x-o,y:g.y-i,enabled:{[p]:s,[h]:a}}}}}},Fs=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var o,i;const{placement:n,middlewareData:r,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:f=!0,...g}=Nr(e,t);if(null!=(o=r.arrow)&&o.alignmentOffset)return{};const v=Pr(n),b=Dr(a),y=Pr(a)===a,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),k=h||(y||!f?[qr(a)]:function(e){const t=qr(e);return[$r(e),t,$r(t)]}(a)),_="none"!==m;!h&&_&&k.push(...zr(a,f,m,w));const x=[a,...k],E=await l.detectOverflow(t,g),S=[];let C=(null==(i=r.flip)?void 0:i.overflows)||[];if(d&&S.push(E[v]),u){const e=function(e,t,o){void 0===o&&(o=!1);const i=Rr(e),n=Lr(e),r=Vr(n);let s="x"===n?i===(o?"end":"start")?"right":"left":"start"===i?"bottom":"top";return t.reference[r]>t.floating[r]&&(s=qr(s)),[s,qr(s)]}(n,s,w);S.push(E[e[0]],E[e[1]])}if(C=[...C,{placement:n,overflows:S}],!S.every(e=>e<=0)){var A,T;const e=((null==(A=r.flip)?void 0:A.index)||0)+1,t=x[e];if(t){if(!("alignment"===u&&b!==Dr(t))||C.every(e=>Dr(e.placement)!==b||e.overflows[0]>0))return{data:{index:e,overflows:C},reset:{placement:t}}}let o=null==(T=C.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:T.placement;if(!o)switch(p){case"bestFit":{var N;const e=null==(N=C.filter(e=>{if(_){const t=Dr(e.placement);return t===b||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:N[0];e&&(o=e);break}case"initialPlacement":o=a}if(n!==o)return{reset:{placement:o}}}return{}}}},Ms=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var o,i;const{placement:n,rects:r,platform:s,elements:a}=t,{apply:l=()=>{},...c}=Nr(e,t),d=await s.detectOverflow(t,c),u=Pr(n),h=Rr(n),p="y"===Dr(n),{width:m,height:f}=r.floating;let g,v;"top"===u||"bottom"===u?(g=u,v=h===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=u,g="end"===h?"top":"bottom");const b=f-d.top-d.bottom,y=m-d.left-d.right,w=_r(f-d[g],b),k=_r(m-d[v],y),_=!t.middlewareData.shift;let x=w,E=k;if(null!=(o=t.middlewareData.shift)&&o.enabled.x&&(E=y),null!=(i=t.middlewareData.shift)&&i.enabled.y&&(x=b),_&&!h){const e=xr(d.left,0),t=xr(d.right,0),o=xr(d.top,0),i=xr(d.bottom,0);p?E=m-2*(0!==e||0!==t?e+t:xr(d.left,d.right)):x=f-2*(0!==o||0!==i?o+i:xr(d.top,d.bottom))}await l({...t,availableWidth:E,availableHeight:x});const S=await s.getDimensions(a.floating);return m!==S.width||f!==S.height?{reset:{rects:!0}}:{}}}},Os=e=>({name:"arrow",options:e,async fn(t){const{x:o,y:i,placement:n,rects:r,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=Nr(e,t)||{};if(null==c)return{};const u=Hr(d),h={x:o,y:i},p=Lr(n),m=Vr(p),f=await s.getDimensions(c),g="y"===p,v=g?"top":"left",b=g?"bottom":"right",y=g?"clientHeight":"clientWidth",w=r.reference[m]+r.reference[p]-h[p]-r.floating[m],k=h[p]-r.reference[p],_=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let x=_?_[y]:0;x&&await(null==s.isElement?void 0:s.isElement(_))||(x=a.floating[y]||r.floating[m]);const E=w/2-k/2,S=x/2-f[m]/2-1,C=_r(u[v],S),A=_r(u[b],S),T=C,N=x-f[m]-A,P=x/2-f[m]/2+E,R=Tr(T,P,N),B=!l.arrow&&null!=Rr(n)&&P!==R&&r.reference[m]/2-(P<T?C:A)-f[m]/2<0,V=B?P<T?P-T:P-N:0;return{[p]:h[p]+V,data:{[p]:R,centerOffset:P-R-V,...B&&{alignmentOffset:V}},reset:B}}}),Is=(e,t,o)=>{const i=new Map,n={platform:Bs,...o},r={...n.platform,_c:i};return(async(e,t,o)=>{const{placement:i="bottom",strategy:n="absolute",middleware:r=[],platform:s}=o,a=s.detectOverflow?s:{...s,detectOverflow:jr},l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:n}),{x:d,y:u}=Wr(c,i,l),h=i,p=0;const m={};for(let f=0;f<r.length;f++){const o=r[f];if(!o)continue;const{name:g,fn:v}=o,{x:b,y:y,data:w,reset:k}=await v({x:d,y:u,initialPlacement:i,placement:h,strategy:n,middlewareData:m,rects:c,platform:a,elements:{reference:e,floating:t}});d=null!=b?b:d,u=null!=y?y:u,m[g]={...m[g],...w},k&&p<50&&(p++,"object"==typeof k&&(k.placement&&(h=k.placement),k.rects&&(c=!0===k.rects?await s.getElementRects({reference:e,floating:t,strategy:n}):k.rects),({x:d,y:u}=Wr(c,h,l))),f=-1)}return{x:d,y:u,placement:h,strategy:n,middlewareData:m}})(e,t,{...n,platform:r})};function zs(e){return function(e){for(let t=e;t;t=qs(t))if(t instanceof Element&&"none"===getComputedStyle(t).display)return null;for(let t=qs(e);t;t=qs(t)){if(!(t instanceof Element))continue;const e=getComputedStyle(t);if("contents"!==e.display){if("static"!==e.position||cs(e))return t;if("BODY"===t.tagName)return t}}return null}(e)}function qs(e){return e.assignedSlot?e.assignedSlot:e.parentNode instanceof ShadowRoot?e.parentNode.host:e.parentNode}var Hs=class extends en{constructor(){super(...arguments),this.localize=new ji(this),this.active=!1,this.placement="top",this.strategy="absolute",this.distance=0,this.skidding=0,this.arrow=!1,this.arrowPlacement="anchor",this.arrowPadding=10,this.flip=!1,this.flipFallbackPlacements="",this.flipFallbackStrategy="best-fit",this.flipPadding=0,this.shift=!1,this.shiftPadding=0,this.autoSizePadding=0,this.hoverBridge=!1,this.updateHoverBridge=()=>{if(this.hoverBridge&&this.anchorEl){const e=this.anchorEl.getBoundingClientRect(),t=this.popup.getBoundingClientRect();let o=0,i=0,n=0,r=0,s=0,a=0,l=0,c=0;this.placement.includes("top")||this.placement.includes("bottom")?e.top<t.top?(o=e.left,i=e.bottom,n=e.right,r=e.bottom,s=t.left,a=t.top,l=t.right,c=t.top):(o=t.left,i=t.bottom,n=t.right,r=t.bottom,s=e.left,a=e.top,l=e.right,c=e.top):e.left<t.left?(o=e.right,i=e.top,n=t.left,r=t.top,s=e.right,a=e.bottom,l=t.left,c=t.bottom):(o=t.right,i=t.top,n=e.left,r=e.top,s=t.right,a=t.bottom,l=e.left,c=e.bottom),this.style.setProperty("--hover-bridge-top-left-x",`${o}px`),this.style.setProperty("--hover-bridge-top-left-y",`${i}px`),this.style.setProperty("--hover-bridge-top-right-x",`${n}px`),this.style.setProperty("--hover-bridge-top-right-y",`${r}px`),this.style.setProperty("--hover-bridge-bottom-left-x",`${s}px`),this.style.setProperty("--hover-bridge-bottom-left-y",`${a}px`),this.style.setProperty("--hover-bridge-bottom-right-x",`${l}px`),this.style.setProperty("--hover-bridge-bottom-right-y",`${c}px`)}}}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start()}disconnectedCallback(){super.disconnectedCallback(),this.stop()}async updated(e){super.updated(e),e.has("active")&&(this.active?this.start():this.stop()),e.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}async handleAnchorChange(){if(await this.stop(),this.anchor&&"string"==typeof this.anchor){const e=this.getRootNode();this.anchorEl=e.getElementById(this.anchor)}else this.anchor instanceof Element||function(e){return null!==e&&"object"==typeof e&&"getBoundingClientRect"in e&&(!("contextElement"in e)||e.contextElement instanceof Element)}(this.anchor)?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),this.anchorEl&&this.active&&this.start()}start(){this.anchorEl&&this.active&&(this.cleanup=Ds(this.anchorEl,this.popup,()=>{this.reposition()}))}async stop(){return new Promise(e=>{this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame(()=>e())):e()})}reposition(){if(!this.active||!this.anchorEl)return;const e=[Ls({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?e.push(Ms({apply:({rects:e})=>{const t="width"===this.sync||"both"===this.sync,o="height"===this.sync||"both"===this.sync;this.popup.style.width=t?`${e.reference.width}px`:"",this.popup.style.height=o?`${e.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&e.push(Fs({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:"best-fit"===this.flipFallbackStrategy?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&e.push($s({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?e.push(Ms({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:e,availableHeight:t})=>{"vertical"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-height",`${t}px`):this.style.removeProperty("--auto-size-available-height"),"horizontal"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-width",`${e}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&e.push(Os({element:this.arrowEl,padding:this.arrowPadding}));const t="absolute"===this.strategy?e=>Bs.getOffsetParent(e,zs):Bs.getOffsetParent;Is(this.anchorEl,this.popup,{placement:this.placement,middleware:e,strategy:this.strategy,platform:_o(ko({},Bs),{getOffsetParent:t})}).then(({x:e,y:t,middlewareData:o,placement:i})=>{const n="rtl"===this.localize.dir(),r={top:"bottom",right:"left",bottom:"top",left:"right"}[i.split("-")[0]];if(this.setAttribute("data-current-placement",i),Object.assign(this.popup.style,{left:`${e}px`,top:`${t}px`}),this.arrow){const e=o.arrow.x,t=o.arrow.y;let i="",s="",a="",l="";if("start"===this.arrowPlacement){const o="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";i="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",s=n?o:"",l=n?"":o}else if("end"===this.arrowPlacement){const o="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";s=n?"":o,l=n?o:"",a="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else"center"===this.arrowPlacement?(l="number"==typeof e?"calc(50% - var(--arrow-size-diagonal))":"",i="number"==typeof t?"calc(50% - var(--arrow-size-diagonal))":""):(l="number"==typeof e?`${e}px`:"",i="number"==typeof t?`${t}px`:"");Object.assign(this.arrowEl.style,{top:i,right:s,bottom:a,left:l,[r]:"calc(var(--arrow-size-diagonal) * -1)"})}}),requestAnimationFrame(()=>this.updateHoverBridge()),this.emit("sl-reposition")}render(){return mi`
      <slot name="anchor" @slotchange=${this.handleAnchorChange}></slot>

      <span
        part="hover-bridge"
        class=${Dn({"popup-hover-bridge":!0,"popup-hover-bridge--visible":this.hoverBridge&&this.active})}
      ></span>

      <div
        part="popup"
        class=${Dn({popup:!0,"popup--active":this.active,"popup--fixed":"fixed"===this.strategy,"popup--has-arrow":this.arrow})}
      >
        <slot></slot>
        ${this.arrow?mi`<div part="arrow" class="popup__arrow" role="presentation"></div>`:""}
      </div>
    `}};Hs.styles=[Ki,kr],xo([Ji(".popup")],Hs.prototype,"popup",2),xo([Ji(".popup__arrow")],Hs.prototype,"arrowEl",2),xo([Qi()],Hs.prototype,"anchor",2),xo([Qi({type:Boolean,reflect:!0})],Hs.prototype,"active",2),xo([Qi({reflect:!0})],Hs.prototype,"placement",2),xo([Qi({reflect:!0})],Hs.prototype,"strategy",2),xo([Qi({type:Number})],Hs.prototype,"distance",2),xo([Qi({type:Number})],Hs.prototype,"skidding",2),xo([Qi({type:Boolean})],Hs.prototype,"arrow",2),xo([Qi({attribute:"arrow-placement"})],Hs.prototype,"arrowPlacement",2),xo([Qi({attribute:"arrow-padding",type:Number})],Hs.prototype,"arrowPadding",2),xo([Qi({type:Boolean})],Hs.prototype,"flip",2),xo([Qi({attribute:"flip-fallback-placements",converter:{fromAttribute:e=>e.split(" ").map(e=>e.trim()).filter(e=>""!==e),toAttribute:e=>e.join(" ")}})],Hs.prototype,"flipFallbackPlacements",2),xo([Qi({attribute:"flip-fallback-strategy"})],Hs.prototype,"flipFallbackStrategy",2),xo([Qi({type:Object})],Hs.prototype,"flipBoundary",2),xo([Qi({attribute:"flip-padding",type:Number})],Hs.prototype,"flipPadding",2),xo([Qi({type:Boolean})],Hs.prototype,"shift",2),xo([Qi({type:Object})],Hs.prototype,"shiftBoundary",2),xo([Qi({attribute:"shift-padding",type:Number})],Hs.prototype,"shiftPadding",2),xo([Qi({attribute:"auto-size"})],Hs.prototype,"autoSize",2),xo([Qi()],Hs.prototype,"sync",2),xo([Qi({type:Object})],Hs.prototype,"autoSizeBoundary",2),xo([Qi({attribute:"auto-size-padding",type:Number})],Hs.prototype,"autoSizePadding",2),xo([Qi({attribute:"hover-bridge",type:Boolean})],Hs.prototype,"hoverBridge",2);var Us=class extends en{constructor(){super(),this.localize=new ji(this),this.content="",this.placement="top",this.disabled=!1,this.distance=8,this.open=!1,this.skidding=0,this.trigger="hover focus",this.hoist=!1,this.handleBlur=()=>{this.hasTrigger("focus")&&this.hide()},this.handleClick=()=>{this.hasTrigger("click")&&(this.open?this.hide():this.show())},this.handleFocus=()=>{this.hasTrigger("focus")&&this.show()},this.handleDocumentKeyDown=e=>{"Escape"===e.key&&(e.stopPropagation(),this.hide())},this.handleMouseOver=()=>{if(this.hasTrigger("hover")){const e=fr(getComputedStyle(this).getPropertyValue("--show-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(()=>this.show(),e)}},this.handleMouseOut=()=>{if(this.hasTrigger("hover")){const e=fr(getComputedStyle(this).getPropertyValue("--hide-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(()=>this.hide(),e)}},this.addEventListener("blur",this.handleBlur,!0),this.addEventListener("focus",this.handleFocus,!0),this.addEventListener("click",this.handleClick),this.addEventListener("mouseover",this.handleMouseOver),this.addEventListener("mouseout",this.handleMouseOut)}disconnectedCallback(){var e;super.disconnectedCallback(),null==(e=this.closeWatcher)||e.destroy(),document.removeEventListener("keydown",this.handleDocumentKeyDown)}firstUpdated(){this.body.hidden=!this.open,this.open&&(this.popup.active=!0,this.popup.reposition())}hasTrigger(e){return this.trigger.split(" ").includes(e)}async handleOpenChange(){var e,t;if(this.open){if(this.disabled)return;this.emit("sl-show"),"CloseWatcher"in window?(null==(e=this.closeWatcher)||e.destroy(),this.closeWatcher=new CloseWatcher,this.closeWatcher.onclose=()=>{this.hide()}):document.addEventListener("keydown",this.handleDocumentKeyDown),await vr(this.body),this.body.hidden=!1,this.popup.active=!0;const{keyframes:t,options:o}=hr(this,"tooltip.show",{dir:this.localize.dir()});await mr(this.popup.popup,t,o),this.popup.reposition(),this.emit("sl-after-show")}else{this.emit("sl-hide"),null==(t=this.closeWatcher)||t.destroy(),document.removeEventListener("keydown",this.handleDocumentKeyDown),await vr(this.body);const{keyframes:e,options:o}=hr(this,"tooltip.hide",{dir:this.localize.dir()});await mr(this.popup.popup,e,o),this.popup.active=!1,this.body.hidden=!0,this.emit("sl-after-hide")}}async handleOptionsChange(){this.hasUpdated&&(await this.updateComplete,this.popup.reposition())}handleDisabledChange(){this.disabled&&this.open&&this.hide()}async show(){if(!this.open)return this.open=!0,pr(this,"sl-after-show")}async hide(){if(this.open)return this.open=!1,pr(this,"sl-after-hide")}render(){return mi`
      <sl-popup
        part="base"
        exportparts="
          popup:base__popup,
          arrow:base__arrow
        "
        class=${Dn({tooltip:!0,"tooltip--open":this.open})}
        placement=${this.placement}
        distance=${this.distance}
        skidding=${this.skidding}
        strategy=${this.hoist?"fixed":"absolute"}
        flip
        shift
        arrow
        hover-bridge
      >
        ${""}
        <slot slot="anchor" aria-describedby="tooltip"></slot>

        ${""}
        <div part="body" id="tooltip" class="tooltip__body" role="tooltip" aria-live=${this.open?"polite":"off"}>
          <slot name="content">${this.content}</slot>
        </div>
      </sl-popup>
    `}};Us.styles=[Ki,wr],Us.dependencies={"sl-popup":Hs},xo([Ji("slot:not([name])")],Us.prototype,"defaultSlot",2),xo([Ji(".tooltip__body")],Us.prototype,"body",2),xo([Ji("sl-popup")],Us.prototype,"popup",2),xo([Qi()],Us.prototype,"content",2),xo([Qi()],Us.prototype,"placement",2),xo([Qi({type:Boolean,reflect:!0})],Us.prototype,"disabled",2),xo([Qi({type:Number})],Us.prototype,"distance",2),xo([Qi({type:Boolean,reflect:!0})],Us.prototype,"open",2),xo([Qi({type:Number})],Us.prototype,"skidding",2),xo([Qi()],Us.prototype,"trigger",2),xo([Qi({type:Boolean})],Us.prototype,"hoist",2),xo([wn("open",{waitUntilFirstUpdate:!0})],Us.prototype,"handleOpenChange",1),xo([wn(["content","distance","hoist","placement","skidding"])],Us.prototype,"handleOptionsChange",1),xo([wn("disabled")],Us.prototype,"handleDisabledChange",1),ur("tooltip.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:150,easing:"ease"}}),ur("tooltip.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:150,easing:"ease"}}),Us.define("sl-tooltip");var Ws=Ro`
  :host {
    --color: var(--sl-panel-border-color);
    --width: var(--sl-panel-border-width);
    --spacing: var(--sl-spacing-medium);
  }

  :host(:not([vertical])) {
    display: block;
    border-top: solid var(--width) var(--color);
    margin: var(--spacing) 0;
  }

  :host([vertical]) {
    display: inline-block;
    height: 100%;
    border-left: solid var(--width) var(--color);
    margin: 0 var(--spacing);
  }
`,js=class extends en{constructor(){super(...arguments),this.vertical=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","separator")}handleVerticalChange(){this.setAttribute("aria-orientation",this.vertical?"vertical":"horizontal")}};js.styles=[Ki,Ws],xo([Qi({type:Boolean,reflect:!0})],js.prototype,"vertical",2),xo([wn("vertical")],js.prototype,"handleVerticalChange",1),js.define("sl-divider");var Ks=Ro`
  :host {
    --width: 31rem;
    --header-spacing: var(--sl-spacing-large);
    --body-spacing: var(--sl-spacing-large);
    --footer-spacing: var(--sl-spacing-large);

    display: contents;
  }

  .dialog {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: var(--sl-z-index-dialog);
  }

  .dialog__panel {
    display: flex;
    flex-direction: column;
    z-index: 2;
    width: var(--width);
    max-width: calc(100% - var(--sl-spacing-2x-large));
    max-height: calc(100% - var(--sl-spacing-2x-large));
    background-color: var(--sl-panel-background-color);
    border-radius: var(--sl-border-radius-medium);
    box-shadow: var(--sl-shadow-x-large);
  }

  .dialog__panel:focus {
    outline: none;
  }

  /* Ensure there's enough vertical padding for phones that don't update vh when chrome appears (e.g. iPhone) */
  @media screen and (max-width: 420px) {
    .dialog__panel {
      max-height: 80vh;
    }
  }

  .dialog--open .dialog__panel {
    display: flex;
    opacity: 1;
  }

  .dialog__header {
    flex: 0 0 auto;
    display: flex;
  }

  .dialog__title {
    flex: 1 1 auto;
    font: inherit;
    font-size: var(--sl-font-size-large);
    line-height: var(--sl-line-height-dense);
    padding: var(--header-spacing);
    margin: 0;
  }

  .dialog__header-actions {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: end;
    gap: var(--sl-spacing-2x-small);
    padding: 0 var(--header-spacing);
  }

  .dialog__header-actions sl-icon-button,
  .dialog__header-actions ::slotted(sl-icon-button) {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    font-size: var(--sl-font-size-medium);
  }

  .dialog__body {
    flex: 1 1 auto;
    display: block;
    padding: var(--body-spacing);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dialog__footer {
    flex: 0 0 auto;
    text-align: right;
    padding: var(--footer-spacing);
  }

  .dialog__footer ::slotted(sl-button:not(:first-of-type)) {
    margin-inline-start: var(--sl-spacing-x-small);
  }

  .dialog:not(.dialog--has-footer) .dialog__footer {
    display: none;
  }

  .dialog__overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: var(--sl-overlay-background-color);
  }

  @media (forced-colors: active) {
    .dialog__panel {
      border: solid 1px var(--sl-color-neutral-0);
    }
  }
`,Gs=class extends en{constructor(){super(...arguments),this.hasSlotController=new pn(this,"footer"),this.localize=new ji(this),this.modal=new er(this),this.open=!1,this.label="",this.noHeader=!1,this.handleDocumentKeyDown=e=>{"Escape"===e.key&&this.modal.isActive()&&this.open&&(e.stopPropagation(),this.requestClose("keyboard"))}}firstUpdated(){this.dialog.hidden=!this.open,this.open&&(this.addOpenListeners(),this.modal.activate(),or(this))}disconnectedCallback(){super.disconnectedCallback(),this.modal.deactivate(),ir(this),this.removeOpenListeners()}requestClose(e){if(this.emit("sl-request-close",{cancelable:!0,detail:{source:e}}).defaultPrevented){const e=hr(this,"dialog.denyClose",{dir:this.localize.dir()});return void mr(this.panel,e.keyframes,e.options)}this.hide()}addOpenListeners(){var e;"CloseWatcher"in window?(null==(e=this.closeWatcher)||e.destroy(),this.closeWatcher=new CloseWatcher,this.closeWatcher.onclose=()=>this.requestClose("keyboard")):document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){var e;null==(e=this.closeWatcher)||e.destroy(),document.removeEventListener("keydown",this.handleDocumentKeyDown)}async handleOpenChange(){if(this.open){this.emit("sl-show"),this.addOpenListeners(),this.originalTrigger=document.activeElement,this.modal.activate(),or(this);const e=this.querySelector("[autofocus]");e&&e.removeAttribute("autofocus"),await Promise.all([vr(this.dialog),vr(this.overlay)]),this.dialog.hidden=!1,requestAnimationFrame(()=>{this.emit("sl-initial-focus",{cancelable:!0}).defaultPrevented||(e?e.focus({preventScroll:!0}):this.panel.focus({preventScroll:!0})),e&&e.setAttribute("autofocus","")});const t=hr(this,"dialog.show",{dir:this.localize.dir()}),o=hr(this,"dialog.overlay.show",{dir:this.localize.dir()});await Promise.all([mr(this.panel,t.keyframes,t.options),mr(this.overlay,o.keyframes,o.options)]),this.emit("sl-after-show")}else{rr(this),this.emit("sl-hide"),this.removeOpenListeners(),this.modal.deactivate(),await Promise.all([vr(this.dialog),vr(this.overlay)]);const e=hr(this,"dialog.hide",{dir:this.localize.dir()}),t=hr(this,"dialog.overlay.hide",{dir:this.localize.dir()});await Promise.all([mr(this.overlay,t.keyframes,t.options).then(()=>{this.overlay.hidden=!0}),mr(this.panel,e.keyframes,e.options).then(()=>{this.panel.hidden=!0})]),this.dialog.hidden=!0,this.overlay.hidden=!1,this.panel.hidden=!1,ir(this);const o=this.originalTrigger;"function"==typeof(null==o?void 0:o.focus)&&setTimeout(()=>o.focus()),this.emit("sl-after-hide")}}async show(){if(!this.open)return this.open=!0,pr(this,"sl-after-show")}async hide(){if(this.open)return this.open=!1,pr(this,"sl-after-hide")}render(){return mi`
      <div
        part="base"
        class=${Dn({dialog:!0,"dialog--open":this.open,"dialog--has-footer":this.hasSlotController.test("footer")})}
      >
        <div part="overlay" class="dialog__overlay" @click=${()=>this.requestClose("overlay")} tabindex="-1"></div>

        <div
          part="panel"
          class="dialog__panel"
          role="dialog"
          aria-modal="true"
          aria-hidden=${this.open?"false":"true"}
          aria-label=${In(this.noHeader?this.label:void 0)}
          aria-labelledby=${In(this.noHeader?void 0:"title")}
          tabindex="-1"
        >
          ${this.noHeader?"":mi`
                <header part="header" class="dialog__header">
                  <h2 part="title" class="dialog__title" id="title">
                    <slot name="label"> ${this.label.length>0?this.label:String.fromCharCode(65279)} </slot>
                  </h2>
                  <div part="header-actions" class="dialog__header-actions">
                    <slot name="header-actions"></slot>
                    <sl-icon-button
                      part="close-button"
                      exportparts="base:close-button__base"
                      class="dialog__close"
                      name="x-lg"
                      label=${this.localize.term("close")}
                      library="system"
                      @click="${()=>this.requestClose("close-button")}"
                    ></sl-icon-button>
                  </div>
                </header>
              `}
          ${""}
          <div part="body" class="dialog__body" tabindex="-1"><slot></slot></div>

          <footer part="footer" class="dialog__footer">
            <slot name="footer"></slot>
          </footer>
        </div>
      </div>
    `}};Gs.styles=[Ki,Ks],Gs.dependencies={"sl-icon-button":ar},xo([Ji(".dialog")],Gs.prototype,"dialog",2),xo([Ji(".dialog__panel")],Gs.prototype,"panel",2),xo([Ji(".dialog__overlay")],Gs.prototype,"overlay",2),xo([Qi({type:Boolean,reflect:!0})],Gs.prototype,"open",2),xo([Qi({reflect:!0})],Gs.prototype,"label",2),xo([Qi({attribute:"no-header",type:Boolean,reflect:!0})],Gs.prototype,"noHeader",2),xo([wn("open",{waitUntilFirstUpdate:!0})],Gs.prototype,"handleOpenChange",1),ur("dialog.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:250,easing:"ease"}}),ur("dialog.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:250,easing:"ease"}}),ur("dialog.denyClose",{keyframes:[{scale:1},{scale:1.02},{scale:1}],options:{duration:250}}),ur("dialog.overlay.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:250}}),ur("dialog.overlay.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:250}}),Gs.define("sl-dialog");var Xs=Ro`
  :host {
    display: block;
  }

  .input {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: stretch;
    justify-content: start;
    position: relative;
    width: 100%;
    font-family: var(--sl-input-font-family);
    font-weight: var(--sl-input-font-weight);
    letter-spacing: var(--sl-input-letter-spacing);
    vertical-align: middle;
    overflow: hidden;
    cursor: text;
    transition:
      var(--sl-transition-fast) color,
      var(--sl-transition-fast) border,
      var(--sl-transition-fast) box-shadow,
      var(--sl-transition-fast) background-color;
  }

  /* Standard inputs */
  .input--standard {
    background-color: var(--sl-input-background-color);
    border: solid var(--sl-input-border-width) var(--sl-input-border-color);
  }

  .input--standard:hover:not(.input--disabled) {
    background-color: var(--sl-input-background-color-hover);
    border-color: var(--sl-input-border-color-hover);
  }

  .input--standard.input--focused:not(.input--disabled) {
    background-color: var(--sl-input-background-color-focus);
    border-color: var(--sl-input-border-color-focus);
    box-shadow: 0 0 0 var(--sl-focus-ring-width) var(--sl-input-focus-ring-color);
  }

  .input--standard.input--focused:not(.input--disabled) .input__control {
    color: var(--sl-input-color-focus);
  }

  .input--standard.input--disabled {
    background-color: var(--sl-input-background-color-disabled);
    border-color: var(--sl-input-border-color-disabled);
    opacity: 0.5;
    cursor: not-allowed;
  }

  .input--standard.input--disabled .input__control {
    color: var(--sl-input-color-disabled);
  }

  .input--standard.input--disabled .input__control::placeholder {
    color: var(--sl-input-placeholder-color-disabled);
  }

  /* Filled inputs */
  .input--filled {
    border: none;
    background-color: var(--sl-input-filled-background-color);
    color: var(--sl-input-color);
  }

  .input--filled:hover:not(.input--disabled) {
    background-color: var(--sl-input-filled-background-color-hover);
  }

  .input--filled.input--focused:not(.input--disabled) {
    background-color: var(--sl-input-filled-background-color-focus);
    outline: var(--sl-focus-ring);
    outline-offset: var(--sl-focus-ring-offset);
  }

  .input--filled.input--disabled {
    background-color: var(--sl-input-filled-background-color-disabled);
    opacity: 0.5;
    cursor: not-allowed;
  }

  .input__control {
    flex: 1 1 auto;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    min-width: 0;
    height: 100%;
    color: var(--sl-input-color);
    border: none;
    background: inherit;
    box-shadow: none;
    padding: 0;
    margin: 0;
    cursor: inherit;
    -webkit-appearance: none;
  }

  .input__control::-webkit-search-decoration,
  .input__control::-webkit-search-cancel-button,
  .input__control::-webkit-search-results-button,
  .input__control::-webkit-search-results-decoration {
    -webkit-appearance: none;
  }

  .input__control:-webkit-autofill,
  .input__control:-webkit-autofill:hover,
  .input__control:-webkit-autofill:focus,
  .input__control:-webkit-autofill:active {
    box-shadow: 0 0 0 var(--sl-input-height-large) var(--sl-input-background-color-hover) inset !important;
    -webkit-text-fill-color: var(--sl-color-primary-500);
    caret-color: var(--sl-input-color);
  }

  .input--filled .input__control:-webkit-autofill,
  .input--filled .input__control:-webkit-autofill:hover,
  .input--filled .input__control:-webkit-autofill:focus,
  .input--filled .input__control:-webkit-autofill:active {
    box-shadow: 0 0 0 var(--sl-input-height-large) var(--sl-input-filled-background-color) inset !important;
  }

  .input__control::placeholder {
    color: var(--sl-input-placeholder-color);
    user-select: none;
    -webkit-user-select: none;
  }

  .input:hover:not(.input--disabled) .input__control {
    color: var(--sl-input-color-hover);
  }

  .input__control:focus {
    outline: none;
  }

  .input__prefix,
  .input__suffix {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    cursor: default;
  }

  .input__prefix ::slotted(sl-icon),
  .input__suffix ::slotted(sl-icon) {
    color: var(--sl-input-icon-color);
  }

  /*
   * Size modifiers
   */

  .input--small {
    border-radius: var(--sl-input-border-radius-small);
    font-size: var(--sl-input-font-size-small);
    height: var(--sl-input-height-small);
  }

  .input--small .input__control {
    height: calc(var(--sl-input-height-small) - var(--sl-input-border-width) * 2);
    padding: 0 var(--sl-input-spacing-small);
  }

  .input--small .input__clear,
  .input--small .input__password-toggle {
    width: calc(1em + var(--sl-input-spacing-small) * 2);
  }

  .input--small .input__prefix ::slotted(*) {
    margin-inline-start: var(--sl-input-spacing-small);
  }

  .input--small .input__suffix ::slotted(*) {
    margin-inline-end: var(--sl-input-spacing-small);
  }

  .input--medium {
    border-radius: var(--sl-input-border-radius-medium);
    font-size: var(--sl-input-font-size-medium);
    height: var(--sl-input-height-medium);
  }

  .input--medium .input__control {
    height: calc(var(--sl-input-height-medium) - var(--sl-input-border-width) * 2);
    padding: 0 var(--sl-input-spacing-medium);
  }

  .input--medium .input__clear,
  .input--medium .input__password-toggle {
    width: calc(1em + var(--sl-input-spacing-medium) * 2);
  }

  .input--medium .input__prefix ::slotted(*) {
    margin-inline-start: var(--sl-input-spacing-medium);
  }

  .input--medium .input__suffix ::slotted(*) {
    margin-inline-end: var(--sl-input-spacing-medium);
  }

  .input--large {
    border-radius: var(--sl-input-border-radius-large);
    font-size: var(--sl-input-font-size-large);
    height: var(--sl-input-height-large);
  }

  .input--large .input__control {
    height: calc(var(--sl-input-height-large) - var(--sl-input-border-width) * 2);
    padding: 0 var(--sl-input-spacing-large);
  }

  .input--large .input__clear,
  .input--large .input__password-toggle {
    width: calc(1em + var(--sl-input-spacing-large) * 2);
  }

  .input--large .input__prefix ::slotted(*) {
    margin-inline-start: var(--sl-input-spacing-large);
  }

  .input--large .input__suffix ::slotted(*) {
    margin-inline-end: var(--sl-input-spacing-large);
  }

  /*
   * Pill modifier
   */

  .input--pill.input--small {
    border-radius: var(--sl-input-height-small);
  }

  .input--pill.input--medium {
    border-radius: var(--sl-input-height-medium);
  }

  .input--pill.input--large {
    border-radius: var(--sl-input-height-large);
  }

  /*
   * Clearable + Password Toggle
   */

  .input__clear,
  .input__password-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: inherit;
    color: var(--sl-input-icon-color);
    border: none;
    background: none;
    padding: 0;
    transition: var(--sl-transition-fast) color;
    cursor: pointer;
  }

  .input__clear:hover,
  .input__password-toggle:hover {
    color: var(--sl-input-icon-color-hover);
  }

  .input__clear:focus,
  .input__password-toggle:focus {
    outline: none;
  }

  /* Don't show the browser's password toggle in Edge */
  ::-ms-reveal {
    display: none;
  }

  /* Hide the built-in number spinner */
  .input--no-spin-buttons input[type='number']::-webkit-outer-spin-button,
  .input--no-spin-buttons input[type='number']::-webkit-inner-spin-button {
    -webkit-appearance: none;
    display: none;
  }

  .input--no-spin-buttons input[type='number'] {
    -moz-appearance: textfield;
  }
`,Qs=(e="value")=>(t,o)=>{const i=t.constructor,n=i.prototype.attributeChangedCallback;i.prototype.attributeChangedCallback=function(t,r,s){var a;const l=i.getPropertyOptions(e);if(t===("string"==typeof l.attribute?l.attribute:e)){const t=l.converter||Uo,i=("function"==typeof t?t:null!=(a=null==t?void 0:t.fromAttribute)?a:Uo.fromAttribute)(s,l.type);this[e]!==i&&(this[o]=i)}n.call(this,t,r,s)}},Ys=Ro`
  .form-control .form-control__label {
    display: none;
  }

  .form-control .form-control__help-text {
    display: none;
  }

  /* Label */
  .form-control--has-label .form-control__label {
    display: inline-block;
    color: var(--sl-input-label-color);
    margin-bottom: var(--sl-spacing-3x-small);
  }

  .form-control--has-label.form-control--small .form-control__label {
    font-size: var(--sl-input-label-font-size-small);
  }

  .form-control--has-label.form-control--medium .form-control__label {
    font-size: var(--sl-input-label-font-size-medium);
  }

  .form-control--has-label.form-control--large .form-control__label {
    font-size: var(--sl-input-label-font-size-large);
  }

  :host([required]) .form-control--has-label .form-control__label::after {
    content: var(--sl-input-required-content);
    margin-inline-start: var(--sl-input-required-content-offset);
    color: var(--sl-input-required-content-color);
  }

  /* Help text */
  .form-control--has-help-text .form-control__help-text {
    display: block;
    color: var(--sl-input-help-text-color);
    margin-top: var(--sl-spacing-3x-small);
  }

  .form-control--has-help-text.form-control--small .form-control__help-text {
    font-size: var(--sl-input-help-text-font-size-small);
  }

  .form-control--has-help-text.form-control--medium .form-control__help-text {
    font-size: var(--sl-input-help-text-font-size-medium);
  }

  .form-control--has-help-text.form-control--large .form-control__help-text {
    font-size: var(--sl-input-help-text-font-size-large);
  }

  .form-control--has-help-text.form-control--radio-group .form-control__help-text {
    margin-top: var(--sl-spacing-2x-small);
  }
`;const Js=Bn(class extends Vn{constructor(e){if(super(e),e.type!==Pn&&e.type!==Tn&&e.type!==Rn)throw Error("The `live` directive is not allowed on child or event bindings");if(!(e=>void 0===e.strings)(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===fi||t===gi)return t;const o=e.element,i=e.name;if(e.type===Pn){if(t===o[i])return fi}else if(e.type===Rn){if(!!t===o.hasAttribute(i))return fi}else if(e.type===Tn&&o.getAttribute(i)===t+"")return fi;return((e,t=kn)=>{e._$AH=t})(e),t}});var Zs=class extends en{constructor(){super(...arguments),this.formControlController=new ln(this,{assumeInteractionOn:["sl-blur","sl-input"]}),this.hasSlotController=new pn(this,"help-text","label"),this.localize=new ji(this),this.hasFocus=!1,this.title="",this.__numberInput=Object.assign(document.createElement("input"),{type:"number"}),this.__dateInput=Object.assign(document.createElement("input"),{type:"date"}),this.type="text",this.name="",this.value="",this.defaultValue="",this.size="medium",this.filled=!1,this.pill=!1,this.label="",this.helpText="",this.clearable=!1,this.disabled=!1,this.placeholder="",this.readonly=!1,this.passwordToggle=!1,this.passwordVisible=!1,this.noSpinButtons=!1,this.form="",this.required=!1,this.spellcheck=!0}get valueAsDate(){var e;return this.__dateInput.type=this.type,this.__dateInput.value=this.value,(null==(e=this.input)?void 0:e.valueAsDate)||this.__dateInput.valueAsDate}set valueAsDate(e){this.__dateInput.type=this.type,this.__dateInput.valueAsDate=e,this.value=this.__dateInput.value}get valueAsNumber(){var e;return this.__numberInput.value=this.value,(null==(e=this.input)?void 0:e.valueAsNumber)||this.__numberInput.valueAsNumber}set valueAsNumber(e){this.__numberInput.valueAsNumber=e,this.value=this.__numberInput.value}get validity(){return this.input.validity}get validationMessage(){return this.input.validationMessage}firstUpdated(){this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleChange(){this.value=this.input.value,this.emit("sl-change")}handleClearClick(e){e.preventDefault(),""!==this.value&&(this.value="",this.emit("sl-clear"),this.emit("sl-input"),this.emit("sl-change")),this.input.focus()}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleInput(){this.value=this.input.value,this.formControlController.updateValidity(),this.emit("sl-input")}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e)}handleKeyDown(e){const t=e.metaKey||e.ctrlKey||e.shiftKey||e.altKey;"Enter"!==e.key||t||setTimeout(()=>{e.defaultPrevented||e.isComposing||this.formControlController.submit()})}handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleStepChange(){this.input.step=String(this.step),this.formControlController.updateValidity()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity()}focus(e){this.input.focus(e)}blur(){this.input.blur()}select(){this.input.select()}setSelectionRange(e,t,o="none"){this.input.setSelectionRange(e,t,o)}setRangeText(e,t,o,i="preserve"){const n=null!=t?t:this.input.selectionStart,r=null!=o?o:this.input.selectionEnd;this.input.setRangeText(e,n,r,i),this.value!==this.input.value&&(this.value=this.input.value)}showPicker(){"showPicker"in HTMLInputElement.prototype&&this.input.showPicker()}stepUp(){this.input.stepUp(),this.value!==this.input.value&&(this.value=this.input.value)}stepDown(){this.input.stepDown(),this.value!==this.input.value&&(this.value=this.input.value)}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){const e=this.hasSlotController.test("label"),t=this.hasSlotController.test("help-text"),o=!!this.label||!!e,i=!!this.helpText||!!t,n=this.clearable&&!this.disabled&&!this.readonly&&("number"==typeof this.value||this.value.length>0);return mi`
      <div
        part="form-control"
        class=${Dn({"form-control":!0,"form-control--small":"small"===this.size,"form-control--medium":"medium"===this.size,"form-control--large":"large"===this.size,"form-control--has-label":o,"form-control--has-help-text":i})}
      >
        <label
          part="form-control-label"
          class="form-control__label"
          for="input"
          aria-hidden=${o?"false":"true"}
        >
          <slot name="label">${this.label}</slot>
        </label>

        <div part="form-control-input" class="form-control-input">
          <div
            part="base"
            class=${Dn({input:!0,"input--small":"small"===this.size,"input--medium":"medium"===this.size,"input--large":"large"===this.size,"input--pill":this.pill,"input--standard":!this.filled,"input--filled":this.filled,"input--disabled":this.disabled,"input--focused":this.hasFocus,"input--empty":!this.value,"input--no-spin-buttons":this.noSpinButtons})}
          >
            <span part="prefix" class="input__prefix">
              <slot name="prefix"></slot>
            </span>

            <input
              part="input"
              id="input"
              class="input__control"
              type=${"password"===this.type&&this.passwordVisible?"text":this.type}
              title=${this.title}
              name=${In(this.name)}
              ?disabled=${this.disabled}
              ?readonly=${this.readonly}
              ?required=${this.required}
              placeholder=${In(this.placeholder)}
              minlength=${In(this.minlength)}
              maxlength=${In(this.maxlength)}
              min=${In(this.min)}
              max=${In(this.max)}
              step=${In(this.step)}
              .value=${Js(this.value)}
              autocapitalize=${In(this.autocapitalize)}
              autocomplete=${In(this.autocomplete)}
              autocorrect=${In(this.autocorrect)}
              ?autofocus=${this.autofocus}
              spellcheck=${this.spellcheck}
              pattern=${In(this.pattern)}
              enterkeyhint=${In(this.enterkeyhint)}
              inputmode=${In(this.inputmode)}
              aria-describedby="help-text"
              @change=${this.handleChange}
              @input=${this.handleInput}
              @invalid=${this.handleInvalid}
              @keydown=${this.handleKeyDown}
              @focus=${this.handleFocus}
              @blur=${this.handleBlur}
            />

            ${n?mi`
                  <button
                    part="clear-button"
                    class="input__clear"
                    type="button"
                    aria-label=${this.localize.term("clearEntry")}
                    @click=${this.handleClearClick}
                    tabindex="-1"
                  >
                    <slot name="clear-icon">
                      <sl-icon name="x-circle-fill" library="system"></sl-icon>
                    </slot>
                  </button>
                `:""}
            ${this.passwordToggle&&!this.disabled?mi`
                  <button
                    part="password-toggle-button"
                    class="input__password-toggle"
                    type="button"
                    aria-label=${this.localize.term(this.passwordVisible?"hidePassword":"showPassword")}
                    @click=${this.handlePasswordToggle}
                    tabindex="-1"
                  >
                    ${this.passwordVisible?mi`
                          <slot name="show-password-icon">
                            <sl-icon name="eye-slash" library="system"></sl-icon>
                          </slot>
                        `:mi`
                          <slot name="hide-password-icon">
                            <sl-icon name="eye" library="system"></sl-icon>
                          </slot>
                        `}
                  </button>
                `:""}

            <span part="suffix" class="input__suffix">
              <slot name="suffix"></slot>
            </span>
          </div>
        </div>

        <div
          part="form-control-help-text"
          id="help-text"
          class="form-control__help-text"
          aria-hidden=${i?"false":"true"}
        >
          <slot name="help-text">${this.helpText}</slot>
        </div>
      </div>
    `}};Zs.styles=[Ki,Ys,Xs],Zs.dependencies={"sl-icon":An},xo([Ji(".input__control")],Zs.prototype,"input",2),xo([Yi()],Zs.prototype,"hasFocus",2),xo([Qi()],Zs.prototype,"title",2),xo([Qi({reflect:!0})],Zs.prototype,"type",2),xo([Qi()],Zs.prototype,"name",2),xo([Qi()],Zs.prototype,"value",2),xo([Qs()],Zs.prototype,"defaultValue",2),xo([Qi({reflect:!0})],Zs.prototype,"size",2),xo([Qi({type:Boolean,reflect:!0})],Zs.prototype,"filled",2),xo([Qi({type:Boolean,reflect:!0})],Zs.prototype,"pill",2),xo([Qi()],Zs.prototype,"label",2),xo([Qi({attribute:"help-text"})],Zs.prototype,"helpText",2),xo([Qi({type:Boolean})],Zs.prototype,"clearable",2),xo([Qi({type:Boolean,reflect:!0})],Zs.prototype,"disabled",2),xo([Qi()],Zs.prototype,"placeholder",2),xo([Qi({type:Boolean,reflect:!0})],Zs.prototype,"readonly",2),xo([Qi({attribute:"password-toggle",type:Boolean})],Zs.prototype,"passwordToggle",2),xo([Qi({attribute:"password-visible",type:Boolean})],Zs.prototype,"passwordVisible",2),xo([Qi({attribute:"no-spin-buttons",type:Boolean})],Zs.prototype,"noSpinButtons",2),xo([Qi({reflect:!0})],Zs.prototype,"form",2),xo([Qi({type:Boolean,reflect:!0})],Zs.prototype,"required",2),xo([Qi()],Zs.prototype,"pattern",2),xo([Qi({type:Number})],Zs.prototype,"minlength",2),xo([Qi({type:Number})],Zs.prototype,"maxlength",2),xo([Qi()],Zs.prototype,"min",2),xo([Qi()],Zs.prototype,"max",2),xo([Qi()],Zs.prototype,"step",2),xo([Qi()],Zs.prototype,"autocapitalize",2),xo([Qi()],Zs.prototype,"autocorrect",2),xo([Qi()],Zs.prototype,"autocomplete",2),xo([Qi({type:Boolean})],Zs.prototype,"autofocus",2),xo([Qi()],Zs.prototype,"enterkeyhint",2),xo([Qi({type:Boolean,converter:{fromAttribute:e=>!(!e||"false"===e),toAttribute:e=>e?"true":"false"}})],Zs.prototype,"spellcheck",2),xo([Qi()],Zs.prototype,"inputmode",2),xo([wn("disabled",{waitUntilFirstUpdate:!0})],Zs.prototype,"handleDisabledChange",1),xo([wn("step",{waitUntilFirstUpdate:!0})],Zs.prototype,"handleStepChange",1),xo([wn("value",{waitUntilFirstUpdate:!0})],Zs.prototype,"handleValueChange",1),Zs.define("sl-input");var ea=Ro`
  :host {
    display: contents;

    /* For better DX, we'll reset the margin here so the base part can inherit it */
    margin: 0;
  }

  .alert {
    position: relative;
    display: flex;
    align-items: stretch;
    background-color: var(--sl-panel-background-color);
    border: solid var(--sl-panel-border-width) var(--sl-panel-border-color);
    border-top-width: calc(var(--sl-panel-border-width) * 3);
    border-radius: var(--sl-border-radius-medium);
    font-family: var(--sl-font-sans);
    font-size: var(--sl-font-size-small);
    font-weight: var(--sl-font-weight-normal);
    line-height: 1.6;
    color: var(--sl-color-neutral-700);
    margin: inherit;
    overflow: hidden;
  }

  .alert:not(.alert--has-icon) .alert__icon,
  .alert:not(.alert--closable) .alert__close-button {
    display: none;
  }

  .alert__icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    font-size: var(--sl-font-size-large);
    padding-inline-start: var(--sl-spacing-large);
  }

  .alert--has-countdown {
    border-bottom: none;
  }

  .alert--primary {
    border-top-color: var(--sl-color-primary-600);
  }

  .alert--primary .alert__icon {
    color: var(--sl-color-primary-600);
  }

  .alert--success {
    border-top-color: var(--sl-color-success-600);
  }

  .alert--success .alert__icon {
    color: var(--sl-color-success-600);
  }

  .alert--neutral {
    border-top-color: var(--sl-color-neutral-600);
  }

  .alert--neutral .alert__icon {
    color: var(--sl-color-neutral-600);
  }

  .alert--warning {
    border-top-color: var(--sl-color-warning-600);
  }

  .alert--warning .alert__icon {
    color: var(--sl-color-warning-600);
  }

  .alert--danger {
    border-top-color: var(--sl-color-danger-600);
  }

  .alert--danger .alert__icon {
    color: var(--sl-color-danger-600);
  }

  .alert__message {
    flex: 1 1 auto;
    display: block;
    padding: var(--sl-spacing-large);
    overflow: hidden;
  }

  .alert__close-button {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    font-size: var(--sl-font-size-medium);
    margin-inline-end: var(--sl-spacing-medium);
    align-self: center;
  }

  .alert__countdown {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(var(--sl-panel-border-width) * 3);
    background-color: var(--sl-panel-border-color);
    display: flex;
  }

  .alert__countdown--ltr {
    justify-content: flex-end;
  }

  .alert__countdown .alert__countdown-elapsed {
    height: 100%;
    width: 0;
  }

  .alert--primary .alert__countdown-elapsed {
    background-color: var(--sl-color-primary-600);
  }

  .alert--success .alert__countdown-elapsed {
    background-color: var(--sl-color-success-600);
  }

  .alert--neutral .alert__countdown-elapsed {
    background-color: var(--sl-color-neutral-600);
  }

  .alert--warning .alert__countdown-elapsed {
    background-color: var(--sl-color-warning-600);
  }

  .alert--danger .alert__countdown-elapsed {
    background-color: var(--sl-color-danger-600);
  }

  .alert__timer {
    display: none;
  }
`,ta=class e extends en{constructor(){super(...arguments),this.hasSlotController=new pn(this,"icon","suffix"),this.localize=new ji(this),this.open=!1,this.closable=!1,this.variant="primary",this.duration=1/0,this.remainingTime=this.duration}static get toastStack(){return this.currentToastStack||(this.currentToastStack=Object.assign(document.createElement("div"),{className:"sl-toast-stack"})),this.currentToastStack}firstUpdated(){this.base.hidden=!this.open}restartAutoHide(){this.handleCountdownChange(),clearTimeout(this.autoHideTimeout),clearInterval(this.remainingTimeInterval),this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout(()=>this.hide(),this.duration),this.remainingTime=this.duration,this.remainingTimeInterval=window.setInterval(()=>{this.remainingTime-=100},100))}pauseAutoHide(){var e;null==(e=this.countdownAnimation)||e.pause(),clearTimeout(this.autoHideTimeout),clearInterval(this.remainingTimeInterval)}resumeAutoHide(){var e;this.duration<1/0&&(this.autoHideTimeout=window.setTimeout(()=>this.hide(),this.remainingTime),this.remainingTimeInterval=window.setInterval(()=>{this.remainingTime-=100},100),null==(e=this.countdownAnimation)||e.play())}handleCountdownChange(){if(this.open&&this.duration<1/0&&this.countdown){const{countdownElement:e}=this,t="100%",o="0";this.countdownAnimation=e.animate([{width:t},{width:o}],{duration:this.duration,easing:"linear"})}}handleCloseClick(){this.hide()}async handleOpenChange(){if(this.open){this.emit("sl-show"),this.duration<1/0&&this.restartAutoHide(),await vr(this.base),this.base.hidden=!1;const{keyframes:e,options:t}=hr(this,"alert.show",{dir:this.localize.dir()});await mr(this.base,e,t),this.emit("sl-after-show")}else{rr(this),this.emit("sl-hide"),clearTimeout(this.autoHideTimeout),clearInterval(this.remainingTimeInterval),await vr(this.base);const{keyframes:e,options:t}=hr(this,"alert.hide",{dir:this.localize.dir()});await mr(this.base,e,t),this.base.hidden=!0,this.emit("sl-after-hide")}}handleDurationChange(){this.restartAutoHide()}async show(){if(!this.open)return this.open=!0,pr(this,"sl-after-show")}async hide(){if(this.open)return this.open=!1,pr(this,"sl-after-hide")}async toast(){return new Promise(t=>{this.handleCountdownChange(),null===e.toastStack.parentElement&&document.body.append(e.toastStack),e.toastStack.appendChild(this),requestAnimationFrame(()=>{this.clientWidth,this.show()}),this.addEventListener("sl-after-hide",()=>{e.toastStack.removeChild(this),t(),null===e.toastStack.querySelector("sl-alert")&&e.toastStack.remove()},{once:!0})})}render(){return mi`
      <div
        part="base"
        class=${Dn({alert:!0,"alert--open":this.open,"alert--closable":this.closable,"alert--has-countdown":!!this.countdown,"alert--has-icon":this.hasSlotController.test("icon"),"alert--primary":"primary"===this.variant,"alert--success":"success"===this.variant,"alert--neutral":"neutral"===this.variant,"alert--warning":"warning"===this.variant,"alert--danger":"danger"===this.variant})}
        role="alert"
        aria-hidden=${this.open?"false":"true"}
        @mouseenter=${this.pauseAutoHide}
        @mouseleave=${this.resumeAutoHide}
      >
        <div part="icon" class="alert__icon">
          <slot name="icon"></slot>
        </div>

        <div part="message" class="alert__message" aria-live="polite">
          <slot></slot>
        </div>

        ${this.closable?mi`
              <sl-icon-button
                part="close-button"
                exportparts="base:close-button__base"
                class="alert__close-button"
                name="x-lg"
                library="system"
                label=${this.localize.term("close")}
                @click=${this.handleCloseClick}
              ></sl-icon-button>
            `:""}

        <div role="timer" class="alert__timer">${this.remainingTime}</div>

        ${this.countdown?mi`
              <div
                class=${Dn({alert__countdown:!0,"alert__countdown--ltr":"ltr"===this.countdown})}
              >
                <div class="alert__countdown-elapsed"></div>
              </div>
            `:""}
      </div>
    `}};ta.styles=[Ki,ea],ta.dependencies={"sl-icon-button":ar},xo([Ji('[part~="base"]')],ta.prototype,"base",2),xo([Ji(".alert__countdown-elapsed")],ta.prototype,"countdownElement",2),xo([Qi({type:Boolean,reflect:!0})],ta.prototype,"open",2),xo([Qi({type:Boolean,reflect:!0})],ta.prototype,"closable",2),xo([Qi({reflect:!0})],ta.prototype,"variant",2),xo([Qi({type:Number})],ta.prototype,"duration",2),xo([Qi({type:String,reflect:!0})],ta.prototype,"countdown",2),xo([Yi()],ta.prototype,"remainingTime",2),xo([wn("open",{waitUntilFirstUpdate:!0})],ta.prototype,"handleOpenChange",1),xo([wn("duration")],ta.prototype,"handleDurationChange",1);var oa=ta;ur("alert.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:250,easing:"ease"}}),ur("alert.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:250,easing:"ease"}}),oa.define("sl-alert");var ia=Ro`
  :host {
    display: inline-block;
  }

  .checkbox {
    position: relative;
    display: inline-flex;
    align-items: flex-start;
    font-family: var(--sl-input-font-family);
    font-weight: var(--sl-input-font-weight);
    color: var(--sl-input-label-color);
    vertical-align: middle;
    cursor: pointer;
  }

  .checkbox--small {
    --toggle-size: var(--sl-toggle-size-small);
    font-size: var(--sl-input-font-size-small);
  }

  .checkbox--medium {
    --toggle-size: var(--sl-toggle-size-medium);
    font-size: var(--sl-input-font-size-medium);
  }

  .checkbox--large {
    --toggle-size: var(--sl-toggle-size-large);
    font-size: var(--sl-input-font-size-large);
  }

  .checkbox__control {
    flex: 0 0 auto;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--toggle-size);
    height: var(--toggle-size);
    border: solid var(--sl-input-border-width) var(--sl-input-border-color);
    border-radius: 2px;
    background-color: var(--sl-input-background-color);
    color: var(--sl-color-neutral-0);
    transition:
      var(--sl-transition-fast) border-color,
      var(--sl-transition-fast) background-color,
      var(--sl-transition-fast) color,
      var(--sl-transition-fast) box-shadow;
  }

  .checkbox__input {
    position: absolute;
    opacity: 0;
    padding: 0;
    margin: 0;
    pointer-events: none;
  }

  .checkbox__checked-icon,
  .checkbox__indeterminate-icon {
    display: inline-flex;
    width: var(--toggle-size);
    height: var(--toggle-size);
  }

  /* Hover */
  .checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__control:hover {
    border-color: var(--sl-input-border-color-hover);
    background-color: var(--sl-input-background-color-hover);
  }

  /* Focus */
  .checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control {
    outline: var(--sl-focus-ring);
    outline-offset: var(--sl-focus-ring-offset);
  }

  /* Checked/indeterminate */
  .checkbox--checked .checkbox__control,
  .checkbox--indeterminate .checkbox__control {
    border-color: var(--sl-color-primary-600);
    background-color: var(--sl-color-primary-600);
  }

  /* Checked/indeterminate + hover */
  .checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__control:hover,
  .checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__control:hover {
    border-color: var(--sl-color-primary-500);
    background-color: var(--sl-color-primary-500);
  }

  /* Checked/indeterminate + focus */
  .checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control,
  .checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control {
    outline: var(--sl-focus-ring);
    outline-offset: var(--sl-focus-ring-offset);
  }

  /* Disabled */
  .checkbox--disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .checkbox__label {
    display: inline-block;
    color: var(--sl-input-label-color);
    line-height: var(--toggle-size);
    margin-inline-start: 0.5em;
    user-select: none;
    -webkit-user-select: none;
  }

  :host([required]) .checkbox__label::after {
    content: var(--sl-input-required-content);
    color: var(--sl-input-required-content-color);
    margin-inline-start: var(--sl-input-required-content-offset);
  }
`,na=class extends en{constructor(){super(...arguments),this.formControlController=new ln(this,{value:e=>e.checked?e.value||"on":void 0,defaultValue:e=>e.defaultChecked,setValue:(e,t)=>e.checked=t}),this.hasSlotController=new pn(this,"help-text"),this.hasFocus=!1,this.title="",this.name="",this.size="medium",this.disabled=!1,this.checked=!1,this.indeterminate=!1,this.defaultChecked=!1,this.form="",this.required=!1,this.helpText=""}get validity(){return this.input.validity}get validationMessage(){return this.input.validationMessage}firstUpdated(){this.formControlController.updateValidity()}handleClick(){this.checked=!this.checked,this.indeterminate=!1,this.emit("sl-change")}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleInput(){this.emit("sl-input")}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e)}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate,this.formControlController.updateValidity()}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){const e=this.hasSlotController.test("help-text"),t=!!this.helpText||!!e;return mi`
      <div
        class=${Dn({"form-control":!0,"form-control--small":"small"===this.size,"form-control--medium":"medium"===this.size,"form-control--large":"large"===this.size,"form-control--has-help-text":t})}
      >
        <label
          part="base"
          class=${Dn({checkbox:!0,"checkbox--checked":this.checked,"checkbox--disabled":this.disabled,"checkbox--focused":this.hasFocus,"checkbox--indeterminate":this.indeterminate,"checkbox--small":"small"===this.size,"checkbox--medium":"medium"===this.size,"checkbox--large":"large"===this.size})}
        >
          <input
            class="checkbox__input"
            type="checkbox"
            title=${this.title}
            name=${this.name}
            value=${In(this.value)}
            .indeterminate=${Js(this.indeterminate)}
            .checked=${Js(this.checked)}
            .disabled=${this.disabled}
            .required=${this.required}
            aria-checked=${this.checked?"true":"false"}
            aria-describedby="help-text"
            @click=${this.handleClick}
            @input=${this.handleInput}
            @invalid=${this.handleInvalid}
            @blur=${this.handleBlur}
            @focus=${this.handleFocus}
          />

          <span
            part="control${this.checked?" control--checked":""}${this.indeterminate?" control--indeterminate":""}"
            class="checkbox__control"
          >
            ${this.checked?mi`
                  <sl-icon part="checked-icon" class="checkbox__checked-icon" library="system" name="check"></sl-icon>
                `:""}
            ${!this.checked&&this.indeterminate?mi`
                  <sl-icon
                    part="indeterminate-icon"
                    class="checkbox__indeterminate-icon"
                    library="system"
                    name="indeterminate"
                  ></sl-icon>
                `:""}
          </span>

          <div part="label" class="checkbox__label">
            <slot></slot>
          </div>
        </label>

        <div
          aria-hidden=${t?"false":"true"}
          class="form-control__help-text"
          id="help-text"
          part="form-control-help-text"
        >
          <slot name="help-text">${this.helpText}</slot>
        </div>
      </div>
    `}};na.styles=[Ki,Ys,ia],na.dependencies={"sl-icon":An},xo([Ji('input[type="checkbox"]')],na.prototype,"input",2),xo([Yi()],na.prototype,"hasFocus",2),xo([Qi()],na.prototype,"title",2),xo([Qi()],na.prototype,"name",2),xo([Qi()],na.prototype,"value",2),xo([Qi({reflect:!0})],na.prototype,"size",2),xo([Qi({type:Boolean,reflect:!0})],na.prototype,"disabled",2),xo([Qi({type:Boolean,reflect:!0})],na.prototype,"checked",2),xo([Qi({type:Boolean,reflect:!0})],na.prototype,"indeterminate",2),xo([Qs("checked")],na.prototype,"defaultChecked",2),xo([Qi({reflect:!0})],na.prototype,"form",2),xo([Qi({type:Boolean,reflect:!0})],na.prototype,"required",2),xo([Qi({attribute:"help-text"})],na.prototype,"helpText",2),xo([wn("disabled",{waitUntilFirstUpdate:!0})],na.prototype,"handleDisabledChange",1),xo([wn(["checked","indeterminate"],{waitUntilFirstUpdate:!0})],na.prototype,"handleStateChange",1),na.define("sl-checkbox");var ra=Ro`
  :host {
    display: inline-block;
  }

  :host([size='small']) {
    --height: var(--sl-toggle-size-small);
    --thumb-size: calc(var(--sl-toggle-size-small) + 4px);
    --width: calc(var(--height) * 2);

    font-size: var(--sl-input-font-size-small);
  }

  :host([size='medium']) {
    --height: var(--sl-toggle-size-medium);
    --thumb-size: calc(var(--sl-toggle-size-medium) + 4px);
    --width: calc(var(--height) * 2);

    font-size: var(--sl-input-font-size-medium);
  }

  :host([size='large']) {
    --height: var(--sl-toggle-size-large);
    --thumb-size: calc(var(--sl-toggle-size-large) + 4px);
    --width: calc(var(--height) * 2);

    font-size: var(--sl-input-font-size-large);
  }

  .switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    font-family: var(--sl-input-font-family);
    font-size: inherit;
    font-weight: var(--sl-input-font-weight);
    color: var(--sl-input-label-color);
    vertical-align: middle;
    cursor: pointer;
  }

  .switch__control {
    flex: 0 0 auto;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--width);
    height: var(--height);
    background-color: var(--sl-color-neutral-400);
    border: solid var(--sl-input-border-width) var(--sl-color-neutral-400);
    border-radius: var(--height);
    transition:
      var(--sl-transition-fast) border-color,
      var(--sl-transition-fast) background-color;
  }

  .switch__control .switch__thumb {
    width: var(--thumb-size);
    height: var(--thumb-size);
    background-color: var(--sl-color-neutral-0);
    border-radius: 50%;
    border: solid var(--sl-input-border-width) var(--sl-color-neutral-400);
    translate: calc((var(--width) - var(--height)) / -2);
    transition:
      var(--sl-transition-fast) translate ease,
      var(--sl-transition-fast) background-color,
      var(--sl-transition-fast) border-color,
      var(--sl-transition-fast) box-shadow;
  }

  .switch__input {
    position: absolute;
    opacity: 0;
    padding: 0;
    margin: 0;
    pointer-events: none;
  }

  /* Hover */
  .switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover {
    background-color: var(--sl-color-neutral-400);
    border-color: var(--sl-color-neutral-400);
  }

  .switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover .switch__thumb {
    background-color: var(--sl-color-neutral-0);
    border-color: var(--sl-color-neutral-400);
  }

  /* Focus */
  .switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control {
    background-color: var(--sl-color-neutral-400);
    border-color: var(--sl-color-neutral-400);
  }

  .switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb {
    background-color: var(--sl-color-neutral-0);
    border-color: var(--sl-color-primary-600);
    outline: var(--sl-focus-ring);
    outline-offset: var(--sl-focus-ring-offset);
  }

  /* Checked */
  .switch--checked .switch__control {
    background-color: var(--sl-color-primary-600);
    border-color: var(--sl-color-primary-600);
  }

  .switch--checked .switch__control .switch__thumb {
    background-color: var(--sl-color-neutral-0);
    border-color: var(--sl-color-primary-600);
    translate: calc((var(--width) - var(--height)) / 2);
  }

  /* Checked + hover */
  .switch.switch--checked:not(.switch--disabled) .switch__control:hover {
    background-color: var(--sl-color-primary-600);
    border-color: var(--sl-color-primary-600);
  }

  .switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb {
    background-color: var(--sl-color-neutral-0);
    border-color: var(--sl-color-primary-600);
  }

  /* Checked + focus */
  .switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control {
    background-color: var(--sl-color-primary-600);
    border-color: var(--sl-color-primary-600);
  }

  .switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb {
    background-color: var(--sl-color-neutral-0);
    border-color: var(--sl-color-primary-600);
    outline: var(--sl-focus-ring);
    outline-offset: var(--sl-focus-ring-offset);
  }

  /* Disabled */
  .switch--disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .switch__label {
    display: inline-block;
    line-height: var(--height);
    margin-inline-start: 0.5em;
    user-select: none;
    -webkit-user-select: none;
  }

  :host([required]) .switch__label::after {
    content: var(--sl-input-required-content);
    color: var(--sl-input-required-content-color);
    margin-inline-start: var(--sl-input-required-content-offset);
  }

  @media (forced-colors: active) {
    .switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb,
    .switch--checked .switch__control .switch__thumb {
      background-color: ButtonText;
    }
  }
`,sa=class extends en{constructor(){super(...arguments),this.formControlController=new ln(this,{value:e=>e.checked?e.value||"on":void 0,defaultValue:e=>e.defaultChecked,setValue:(e,t)=>e.checked=t}),this.hasSlotController=new pn(this,"help-text"),this.hasFocus=!1,this.title="",this.name="",this.size="medium",this.disabled=!1,this.checked=!1,this.defaultChecked=!1,this.form="",this.required=!1,this.helpText=""}get validity(){return this.input.validity}get validationMessage(){return this.input.validationMessage}firstUpdated(){this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleInput(){this.emit("sl-input")}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e)}handleClick(){this.checked=!this.checked,this.emit("sl-change")}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleKeyDown(e){"ArrowLeft"===e.key&&(e.preventDefault(),this.checked=!1,this.emit("sl-change"),this.emit("sl-input")),"ArrowRight"===e.key&&(e.preventDefault(),this.checked=!0,this.emit("sl-change"),this.emit("sl-input"))}handleCheckedChange(){this.input.checked=this.checked,this.formControlController.updateValidity()}handleDisabledChange(){this.formControlController.setValidity(!0)}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){const e=this.hasSlotController.test("help-text"),t=!!this.helpText||!!e;return mi`
      <div
        class=${Dn({"form-control":!0,"form-control--small":"small"===this.size,"form-control--medium":"medium"===this.size,"form-control--large":"large"===this.size,"form-control--has-help-text":t})}
      >
        <label
          part="base"
          class=${Dn({switch:!0,"switch--checked":this.checked,"switch--disabled":this.disabled,"switch--focused":this.hasFocus,"switch--small":"small"===this.size,"switch--medium":"medium"===this.size,"switch--large":"large"===this.size})}
        >
          <input
            class="switch__input"
            type="checkbox"
            title=${this.title}
            name=${this.name}
            value=${In(this.value)}
            .checked=${Js(this.checked)}
            .disabled=${this.disabled}
            .required=${this.required}
            role="switch"
            aria-checked=${this.checked?"true":"false"}
            aria-describedby="help-text"
            @click=${this.handleClick}
            @input=${this.handleInput}
            @invalid=${this.handleInvalid}
            @blur=${this.handleBlur}
            @focus=${this.handleFocus}
            @keydown=${this.handleKeyDown}
          />

          <span part="control" class="switch__control">
            <span part="thumb" class="switch__thumb"></span>
          </span>

          <div part="label" class="switch__label">
            <slot></slot>
          </div>
        </label>

        <div
          aria-hidden=${t?"false":"true"}
          class="form-control__help-text"
          id="help-text"
          part="form-control-help-text"
        >
          <slot name="help-text">${this.helpText}</slot>
        </div>
      </div>
    `}};sa.styles=[Ki,Ys,ra],xo([Ji('input[type="checkbox"]')],sa.prototype,"input",2),xo([Yi()],sa.prototype,"hasFocus",2),xo([Qi()],sa.prototype,"title",2),xo([Qi()],sa.prototype,"name",2),xo([Qi()],sa.prototype,"value",2),xo([Qi({reflect:!0})],sa.prototype,"size",2),xo([Qi({type:Boolean,reflect:!0})],sa.prototype,"disabled",2),xo([Qi({type:Boolean,reflect:!0})],sa.prototype,"checked",2),xo([Qs("checked")],sa.prototype,"defaultChecked",2),xo([Qi({reflect:!0})],sa.prototype,"form",2),xo([Qi({type:Boolean,reflect:!0})],sa.prototype,"required",2),xo([Qi({attribute:"help-text"})],sa.prototype,"helpText",2),xo([wn("checked",{waitUntilFirstUpdate:!0})],sa.prototype,"handleCheckedChange",1),xo([wn("disabled",{waitUntilFirstUpdate:!0})],sa.prototype,"handleDisabledChange",1),sa.define("sl-switch");var aa=Ro`
  :host {
    display: inline-block;
  }

  .tag {
    display: flex;
    align-items: center;
    border: solid 1px;
    line-height: 1;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
  }

  .tag__remove::part(base) {
    color: inherit;
    padding: 0;
  }

  /*
   * Variant modifiers
   */

  .tag--primary {
    background-color: var(--sl-color-primary-50);
    border-color: var(--sl-color-primary-200);
    color: var(--sl-color-primary-800);
  }

  .tag--primary:active > sl-icon-button {
    color: var(--sl-color-primary-600);
  }

  .tag--success {
    background-color: var(--sl-color-success-50);
    border-color: var(--sl-color-success-200);
    color: var(--sl-color-success-800);
  }

  .tag--success:active > sl-icon-button {
    color: var(--sl-color-success-600);
  }

  .tag--neutral {
    background-color: var(--sl-color-neutral-50);
    border-color: var(--sl-color-neutral-200);
    color: var(--sl-color-neutral-800);
  }

  .tag--neutral:active > sl-icon-button {
    color: var(--sl-color-neutral-600);
  }

  .tag--warning {
    background-color: var(--sl-color-warning-50);
    border-color: var(--sl-color-warning-200);
    color: var(--sl-color-warning-800);
  }

  .tag--warning:active > sl-icon-button {
    color: var(--sl-color-warning-600);
  }

  .tag--danger {
    background-color: var(--sl-color-danger-50);
    border-color: var(--sl-color-danger-200);
    color: var(--sl-color-danger-800);
  }

  .tag--danger:active > sl-icon-button {
    color: var(--sl-color-danger-600);
  }

  /*
   * Size modifiers
   */

  .tag--small {
    font-size: var(--sl-button-font-size-small);
    height: calc(var(--sl-input-height-small) * 0.8);
    line-height: calc(var(--sl-input-height-small) - var(--sl-input-border-width) * 2);
    border-radius: var(--sl-input-border-radius-small);
    padding: 0 var(--sl-spacing-x-small);
  }

  .tag--medium {
    font-size: var(--sl-button-font-size-medium);
    height: calc(var(--sl-input-height-medium) * 0.8);
    line-height: calc(var(--sl-input-height-medium) - var(--sl-input-border-width) * 2);
    border-radius: var(--sl-input-border-radius-medium);
    padding: 0 var(--sl-spacing-small);
  }

  .tag--large {
    font-size: var(--sl-button-font-size-large);
    height: calc(var(--sl-input-height-large) * 0.8);
    line-height: calc(var(--sl-input-height-large) - var(--sl-input-border-width) * 2);
    border-radius: var(--sl-input-border-radius-large);
    padding: 0 var(--sl-spacing-medium);
  }

  .tag__remove {
    margin-inline-start: var(--sl-spacing-x-small);
  }

  /*
   * Pill modifier
   */

  .tag--pill {
    border-radius: var(--sl-border-radius-pill);
  }
`,la=class extends en{constructor(){super(...arguments),this.localize=new ji(this),this.variant="neutral",this.size="medium",this.pill=!1,this.removable=!1}handleRemoveClick(){this.emit("sl-remove")}render(){return mi`
      <span
        part="base"
        class=${Dn({tag:!0,"tag--primary":"primary"===this.variant,"tag--success":"success"===this.variant,"tag--neutral":"neutral"===this.variant,"tag--warning":"warning"===this.variant,"tag--danger":"danger"===this.variant,"tag--text":"text"===this.variant,"tag--small":"small"===this.size,"tag--medium":"medium"===this.size,"tag--large":"large"===this.size,"tag--pill":this.pill,"tag--removable":this.removable})}
      >
        <slot part="content" class="tag__content"></slot>

        ${this.removable?mi`
              <sl-icon-button
                part="remove-button"
                exportparts="base:remove-button__base"
                name="x-lg"
                library="system"
                label=${this.localize.term("remove")}
                class="tag__remove"
                @click=${this.handleRemoveClick}
                tabindex="-1"
              ></sl-icon-button>
            `:""}
      </span>
    `}};la.styles=[Ki,aa],la.dependencies={"sl-icon-button":ar},xo([Qi({reflect:!0})],la.prototype,"variant",2),xo([Qi({reflect:!0})],la.prototype,"size",2),xo([Qi({type:Boolean,reflect:!0})],la.prototype,"pill",2),xo([Qi({type:Boolean})],la.prototype,"removable",2);var ca=Ro`
  :host {
    display: block;
  }

  /** The popup */
  .select {
    flex: 1 1 auto;
    display: inline-flex;
    width: 100%;
    position: relative;
    vertical-align: middle;
  }

  .select::part(popup) {
    z-index: var(--sl-z-index-dropdown);
  }

  .select[data-current-placement^='top']::part(popup) {
    transform-origin: bottom;
  }

  .select[data-current-placement^='bottom']::part(popup) {
    transform-origin: top;
  }

  /* Combobox */
  .select__combobox {
    flex: 1;
    display: flex;
    width: 100%;
    min-width: 0;
    position: relative;
    align-items: center;
    justify-content: start;
    font-family: var(--sl-input-font-family);
    font-weight: var(--sl-input-font-weight);
    letter-spacing: var(--sl-input-letter-spacing);
    vertical-align: middle;
    overflow: hidden;
    cursor: pointer;
    transition:
      var(--sl-transition-fast) color,
      var(--sl-transition-fast) border,
      var(--sl-transition-fast) box-shadow,
      var(--sl-transition-fast) background-color;
  }

  .select__display-input {
    position: relative;
    width: 100%;
    font: inherit;
    border: none;
    background: none;
    color: var(--sl-input-color);
    cursor: inherit;
    overflow: hidden;
    padding: 0;
    margin: 0;
    -webkit-appearance: none;
  }

  .select__display-input::placeholder {
    color: var(--sl-input-placeholder-color);
  }

  .select:not(.select--disabled):hover .select__display-input {
    color: var(--sl-input-color-hover);
  }

  .select__display-input:focus {
    outline: none;
  }

  /* Visually hide the display input when multiple is enabled */
  .select--multiple:not(.select--placeholder-visible) .select__display-input {
    position: absolute;
    z-index: -1;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
  }

  .select__value-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    opacity: 0;
    z-index: -1;
  }

  .select__tags {
    display: flex;
    flex: 1;
    align-items: center;
    flex-wrap: wrap;
    margin-inline-start: var(--sl-spacing-2x-small);
  }

  .select__tags::slotted(sl-tag) {
    cursor: pointer !important;
  }

  .select--disabled .select__tags,
  .select--disabled .select__tags::slotted(sl-tag) {
    cursor: not-allowed !important;
  }

  /* Standard selects */
  .select--standard .select__combobox {
    background-color: var(--sl-input-background-color);
    border: solid var(--sl-input-border-width) var(--sl-input-border-color);
  }

  .select--standard.select--disabled .select__combobox {
    background-color: var(--sl-input-background-color-disabled);
    border-color: var(--sl-input-border-color-disabled);
    color: var(--sl-input-color-disabled);
    opacity: 0.5;
    cursor: not-allowed;
    outline: none;
  }

  .select--standard:not(.select--disabled).select--open .select__combobox,
  .select--standard:not(.select--disabled).select--focused .select__combobox {
    background-color: var(--sl-input-background-color-focus);
    border-color: var(--sl-input-border-color-focus);
    box-shadow: 0 0 0 var(--sl-focus-ring-width) var(--sl-input-focus-ring-color);
  }

  /* Filled selects */
  .select--filled .select__combobox {
    border: none;
    background-color: var(--sl-input-filled-background-color);
    color: var(--sl-input-color);
  }

  .select--filled:hover:not(.select--disabled) .select__combobox {
    background-color: var(--sl-input-filled-background-color-hover);
  }

  .select--filled.select--disabled .select__combobox {
    background-color: var(--sl-input-filled-background-color-disabled);
    opacity: 0.5;
    cursor: not-allowed;
  }

  .select--filled:not(.select--disabled).select--open .select__combobox,
  .select--filled:not(.select--disabled).select--focused .select__combobox {
    background-color: var(--sl-input-filled-background-color-focus);
    outline: var(--sl-focus-ring);
  }

  /* Sizes */
  .select--small .select__combobox {
    border-radius: var(--sl-input-border-radius-small);
    font-size: var(--sl-input-font-size-small);
    min-height: var(--sl-input-height-small);
    padding-block: 0;
    padding-inline: var(--sl-input-spacing-small);
  }

  .select--small .select__clear {
    margin-inline-start: var(--sl-input-spacing-small);
  }

  .select--small .select__prefix::slotted(*) {
    margin-inline-end: var(--sl-input-spacing-small);
  }

  .select--small.select--multiple:not(.select--placeholder-visible) .select__prefix::slotted(*) {
    margin-inline-start: var(--sl-input-spacing-small);
  }

  .select--small.select--multiple:not(.select--placeholder-visible) .select__combobox {
    padding-block: 2px;
    padding-inline-start: 0;
  }

  .select--small .select__tags {
    gap: 2px;
  }

  .select--medium .select__combobox {
    border-radius: var(--sl-input-border-radius-medium);
    font-size: var(--sl-input-font-size-medium);
    min-height: var(--sl-input-height-medium);
    padding-block: 0;
    padding-inline: var(--sl-input-spacing-medium);
  }

  .select--medium .select__clear {
    margin-inline-start: var(--sl-input-spacing-medium);
  }

  .select--medium .select__prefix::slotted(*) {
    margin-inline-end: var(--sl-input-spacing-medium);
  }

  .select--medium.select--multiple:not(.select--placeholder-visible) .select__prefix::slotted(*) {
    margin-inline-start: var(--sl-input-spacing-medium);
  }

  .select--medium.select--multiple:not(.select--placeholder-visible) .select__combobox {
    padding-inline-start: 0;
    padding-block: 3px;
  }

  .select--medium .select__tags {
    gap: 3px;
  }

  .select--large .select__combobox {
    border-radius: var(--sl-input-border-radius-large);
    font-size: var(--sl-input-font-size-large);
    min-height: var(--sl-input-height-large);
    padding-block: 0;
    padding-inline: var(--sl-input-spacing-large);
  }

  .select--large .select__clear {
    margin-inline-start: var(--sl-input-spacing-large);
  }

  .select--large .select__prefix::slotted(*) {
    margin-inline-end: var(--sl-input-spacing-large);
  }

  .select--large.select--multiple:not(.select--placeholder-visible) .select__prefix::slotted(*) {
    margin-inline-start: var(--sl-input-spacing-large);
  }

  .select--large.select--multiple:not(.select--placeholder-visible) .select__combobox {
    padding-inline-start: 0;
    padding-block: 4px;
  }

  .select--large .select__tags {
    gap: 4px;
  }

  /* Pills */
  .select--pill.select--small .select__combobox {
    border-radius: var(--sl-input-height-small);
  }

  .select--pill.select--medium .select__combobox {
    border-radius: var(--sl-input-height-medium);
  }

  .select--pill.select--large .select__combobox {
    border-radius: var(--sl-input-height-large);
  }

  /* Prefix and Suffix */
  .select__prefix,
  .select__suffix {
    flex: 0;
    display: inline-flex;
    align-items: center;
    color: var(--sl-input-placeholder-color);
  }

  .select__suffix::slotted(*) {
    margin-inline-start: var(--sl-spacing-small);
  }

  /* Clear button */
  .select__clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: inherit;
    color: var(--sl-input-icon-color);
    border: none;
    background: none;
    padding: 0;
    transition: var(--sl-transition-fast) color;
    cursor: pointer;
  }

  .select__clear:hover {
    color: var(--sl-input-icon-color-hover);
  }

  .select__clear:focus {
    outline: none;
  }

  /* Expand icon */
  .select__expand-icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    transition: var(--sl-transition-medium) rotate ease;
    rotate: 0;
    margin-inline-start: var(--sl-spacing-small);
  }

  .select--open .select__expand-icon {
    rotate: -180deg;
  }

  /* Listbox */
  .select__listbox {
    display: block;
    position: relative;
    font-family: var(--sl-font-sans);
    font-size: var(--sl-font-size-medium);
    font-weight: var(--sl-font-weight-normal);
    box-shadow: var(--sl-shadow-large);
    background: var(--sl-panel-background-color);
    border: solid var(--sl-panel-border-width) var(--sl-panel-border-color);
    border-radius: var(--sl-border-radius-medium);
    padding-block: var(--sl-spacing-x-small);
    padding-inline: 0;
    overflow: auto;
    overscroll-behavior: none;

    /* Make sure it adheres to the popup's auto size */
    max-width: var(--auto-size-available-width);
    max-height: var(--auto-size-available-height);
  }

  .select__listbox ::slotted(sl-divider) {
    --spacing: var(--sl-spacing-x-small);
  }

  .select__listbox ::slotted(small) {
    display: block;
    font-size: var(--sl-font-size-small);
    font-weight: var(--sl-font-weight-semibold);
    color: var(--sl-color-neutral-500);
    padding-block: var(--sl-spacing-2x-small);
    padding-inline: var(--sl-spacing-x-large);
  }
`;class da extends Vn{constructor(e){if(super(e),this.it=gi,e.type!==Nn)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===gi||null==e)return this._t=void 0,this.it=e;if(e===fi)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}da.directiveName="unsafeHTML",da.resultType=1;const ua=Bn(da);var ha=class extends en{constructor(){super(...arguments),this.formControlController=new ln(this,{assumeInteractionOn:["sl-blur","sl-input"]}),this.hasSlotController=new pn(this,"help-text","label"),this.localize=new ji(this),this.typeToSelectString="",this.hasFocus=!1,this.displayLabel="",this.selectedOptions=[],this.valueHasChanged=!1,this.name="",this._value="",this.defaultValue="",this.size="medium",this.placeholder="",this.multiple=!1,this.maxOptionsVisible=3,this.disabled=!1,this.clearable=!1,this.open=!1,this.hoist=!1,this.filled=!1,this.pill=!1,this.label="",this.placement="bottom",this.helpText="",this.form="",this.required=!1,this.getTag=e=>mi`
      <sl-tag
        part="tag"
        exportparts="
              base:tag__base,
              content:tag__content,
              remove-button:tag__remove-button,
              remove-button__base:tag__remove-button__base
            "
        ?pill=${this.pill}
        size=${this.size}
        removable
        @sl-remove=${t=>this.handleTagRemove(t,e)}
      >
        ${e.getTextLabel()}
      </sl-tag>
    `,this.handleDocumentFocusIn=e=>{const t=e.composedPath();this&&!t.includes(this)&&this.hide()},this.handleDocumentKeyDown=e=>{const t=e.target,o=null!==t.closest(".select__clear"),i=null!==t.closest("sl-icon-button");if(!o&&!i){if("Escape"===e.key&&this.open&&!this.closeWatcher&&(e.preventDefault(),e.stopPropagation(),this.hide(),this.displayInput.focus({preventScroll:!0})),"Enter"===e.key||" "===e.key&&""===this.typeToSelectString)return e.preventDefault(),e.stopImmediatePropagation(),this.open?void(this.currentOption&&!this.currentOption.disabled&&(this.valueHasChanged=!0,this.multiple?this.toggleOptionSelection(this.currentOption):this.setSelectedOptions(this.currentOption),this.updateComplete.then(()=>{this.emit("sl-input"),this.emit("sl-change")}),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))):void this.show();if(["ArrowUp","ArrowDown","Home","End"].includes(e.key)){const t=this.getAllOptions(),o=t.indexOf(this.currentOption);let i=Math.max(0,o);if(e.preventDefault(),!this.open&&(this.show(),this.currentOption))return;"ArrowDown"===e.key?(i=o+1,i>t.length-1&&(i=0)):"ArrowUp"===e.key?(i=o-1,i<0&&(i=t.length-1)):"Home"===e.key?i=0:"End"===e.key&&(i=t.length-1),this.setCurrentOption(t[i])}if(e.key&&1===e.key.length||"Backspace"===e.key){const t=this.getAllOptions();if(e.metaKey||e.ctrlKey||e.altKey)return;if(!this.open){if("Backspace"===e.key)return;this.show()}e.stopPropagation(),e.preventDefault(),clearTimeout(this.typeToSelectTimeout),this.typeToSelectTimeout=window.setTimeout(()=>this.typeToSelectString="",1e3),"Backspace"===e.key?this.typeToSelectString=this.typeToSelectString.slice(0,-1):this.typeToSelectString+=e.key.toLowerCase();for(const e of t){if(e.getTextLabel().toLowerCase().startsWith(this.typeToSelectString)){this.setCurrentOption(e);break}}}}},this.handleDocumentMouseDown=e=>{const t=e.composedPath();this&&!t.includes(this)&&this.hide()}}get value(){return this._value}set value(e){e=this.multiple?Array.isArray(e)?e:e.split(" "):Array.isArray(e)?e.join(" "):e,this._value!==e&&(this.valueHasChanged=!0,this._value=e)}get validity(){return this.valueInput.validity}get validationMessage(){return this.valueInput.validationMessage}connectedCallback(){super.connectedCallback(),setTimeout(()=>{this.handleDefaultSlotChange()}),this.open=!1}addOpenListeners(){var e;document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().addEventListener("focusin",this.handleDocumentFocusIn),"CloseWatcher"in window&&(null==(e=this.closeWatcher)||e.destroy(),this.closeWatcher=new CloseWatcher,this.closeWatcher.onclose=()=>{this.open&&(this.hide(),this.displayInput.focus({preventScroll:!0}))})}removeOpenListeners(){var e;document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().removeEventListener("focusin",this.handleDocumentFocusIn),null==(e=this.closeWatcher)||e.destroy()}handleFocus(){this.hasFocus=!0,this.displayInput.setSelectionRange(0,0),this.emit("sl-focus")}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleLabelClick(){this.displayInput.focus()}handleComboboxMouseDown(e){const t=e.composedPath().some(e=>e instanceof Element&&"sl-icon-button"===e.tagName.toLowerCase());this.disabled||t||(e.preventDefault(),this.displayInput.focus({preventScroll:!0}),this.open=!this.open)}handleComboboxKeyDown(e){"Tab"!==e.key&&(e.stopPropagation(),this.handleDocumentKeyDown(e))}handleClearClick(e){e.stopPropagation(),this.valueHasChanged=!0,""!==this.value&&(this.setSelectedOptions([]),this.displayInput.focus({preventScroll:!0}),this.updateComplete.then(()=>{this.emit("sl-clear"),this.emit("sl-input"),this.emit("sl-change")}))}handleClearMouseDown(e){e.stopPropagation(),e.preventDefault()}handleOptionClick(e){const t=e.target.closest("sl-option"),o=this.value;t&&!t.disabled&&(this.valueHasChanged=!0,this.multiple?this.toggleOptionSelection(t):this.setSelectedOptions(t),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})),this.value!==o&&this.updateComplete.then(()=>{this.emit("sl-input"),this.emit("sl-change")}),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))}handleDefaultSlotChange(){customElements.get("sl-option")||customElements.whenDefined("sl-option").then(()=>this.handleDefaultSlotChange());const e=this.getAllOptions(),t=this.valueHasChanged?this.value:this.defaultValue,o=Array.isArray(t)?t:[t],i=[];e.forEach(e=>i.push(e.value)),this.setSelectedOptions(e.filter(e=>o.includes(e.value)))}handleTagRemove(e,t){e.stopPropagation(),this.valueHasChanged=!0,this.disabled||(this.toggleOptionSelection(t,!1),this.updateComplete.then(()=>{this.emit("sl-input"),this.emit("sl-change")}))}getAllOptions(){return[...this.querySelectorAll("sl-option")]}getFirstOption(){return this.querySelector("sl-option")}setCurrentOption(e){this.getAllOptions().forEach(e=>{e.current=!1,e.tabIndex=-1}),e&&(this.currentOption=e,e.current=!0,e.tabIndex=0,e.focus())}setSelectedOptions(e){const t=this.getAllOptions(),o=Array.isArray(e)?e:[e];t.forEach(e=>e.selected=!1),o.length&&o.forEach(e=>e.selected=!0),this.selectionChanged()}toggleOptionSelection(e,t){e.selected=!0===t||!1===t?t:!e.selected,this.selectionChanged()}selectionChanged(){var e,t,o;const i=this.getAllOptions();this.selectedOptions=i.filter(e=>e.selected);const n=this.valueHasChanged;if(this.multiple)this.value=this.selectedOptions.map(e=>e.value),this.placeholder&&0===this.value.length?this.displayLabel="":this.displayLabel=this.localize.term("numOptionsSelected",this.selectedOptions.length);else{const i=this.selectedOptions[0];this.value=null!=(e=null==i?void 0:i.value)?e:"",this.displayLabel=null!=(o=null==(t=null==i?void 0:i.getTextLabel)?void 0:t.call(i))?o:""}this.valueHasChanged=n,this.updateComplete.then(()=>{this.formControlController.updateValidity()})}get tags(){return this.selectedOptions.map((e,t)=>{if(t<this.maxOptionsVisible||this.maxOptionsVisible<=0){const o=this.getTag(e,t);return mi`<div @sl-remove=${t=>this.handleTagRemove(t,e)}>
          ${"string"==typeof o?ua(o):o}
        </div>`}return t===this.maxOptionsVisible?mi`<sl-tag size=${this.size}>+${this.selectedOptions.length-t}</sl-tag>`:mi``})}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e)}handleDisabledChange(){this.disabled&&(this.open=!1,this.handleOpenChange())}attributeChangedCallback(e,t,o){if(super.attributeChangedCallback(e,t,o),"value"===e){const e=this.valueHasChanged;this.value=this.defaultValue,this.valueHasChanged=e}}handleValueChange(){if(!this.valueHasChanged){const e=this.valueHasChanged;this.value=this.defaultValue,this.valueHasChanged=e}const e=this.getAllOptions(),t=Array.isArray(this.value)?this.value:[this.value];this.setSelectedOptions(e.filter(e=>t.includes(e.value)))}async handleOpenChange(){if(this.open&&!this.disabled){this.setCurrentOption(this.selectedOptions[0]||this.getFirstOption()),this.emit("sl-show"),this.addOpenListeners(),await vr(this),this.listbox.hidden=!1,this.popup.active=!0,requestAnimationFrame(()=>{this.setCurrentOption(this.currentOption)});const{keyframes:e,options:t}=hr(this,"select.show",{dir:this.localize.dir()});await mr(this.popup.popup,e,t),this.currentOption&&nr(this.currentOption,this.listbox,"vertical","auto"),this.emit("sl-after-show")}else{this.emit("sl-hide"),this.removeOpenListeners(),await vr(this);const{keyframes:e,options:t}=hr(this,"select.hide",{dir:this.localize.dir()});await mr(this.popup.popup,e,t),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sl-after-hide")}}async show(){if(!this.open&&!this.disabled)return this.open=!0,pr(this,"sl-after-show");this.open=!1}async hide(){if(this.open&&!this.disabled)return this.open=!1,pr(this,"sl-after-hide");this.open=!1}checkValidity(){return this.valueInput.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.valueInput.reportValidity()}setCustomValidity(e){this.valueInput.setCustomValidity(e),this.formControlController.updateValidity()}focus(e){this.displayInput.focus(e)}blur(){this.displayInput.blur()}render(){const e=this.hasSlotController.test("label"),t=this.hasSlotController.test("help-text"),o=!!this.label||!!e,i=!!this.helpText||!!t,n=this.clearable&&!this.disabled&&this.value.length>0,r=this.placeholder&&this.value&&this.value.length<=0;return mi`
      <div
        part="form-control"
        class=${Dn({"form-control":!0,"form-control--small":"small"===this.size,"form-control--medium":"medium"===this.size,"form-control--large":"large"===this.size,"form-control--has-label":o,"form-control--has-help-text":i})}
      >
        <label
          id="label"
          part="form-control-label"
          class="form-control__label"
          aria-hidden=${o?"false":"true"}
          @click=${this.handleLabelClick}
        >
          <slot name="label">${this.label}</slot>
        </label>

        <div part="form-control-input" class="form-control-input">
          <sl-popup
            class=${Dn({select:!0,"select--standard":!0,"select--filled":this.filled,"select--pill":this.pill,"select--open":this.open,"select--disabled":this.disabled,"select--multiple":this.multiple,"select--focused":this.hasFocus,"select--placeholder-visible":r,"select--top":"top"===this.placement,"select--bottom":"bottom"===this.placement,"select--small":"small"===this.size,"select--medium":"medium"===this.size,"select--large":"large"===this.size})}
            placement=${this.placement}
            strategy=${this.hoist?"fixed":"absolute"}
            flip
            shift
            sync="width"
            auto-size="vertical"
            auto-size-padding="10"
          >
            <div
              part="combobox"
              class="select__combobox"
              slot="anchor"
              @keydown=${this.handleComboboxKeyDown}
              @mousedown=${this.handleComboboxMouseDown}
            >
              <slot part="prefix" name="prefix" class="select__prefix"></slot>

              <input
                part="display-input"
                class="select__display-input"
                type="text"
                placeholder=${this.placeholder}
                .disabled=${this.disabled}
                .value=${this.displayLabel}
                autocomplete="off"
                spellcheck="false"
                autocapitalize="off"
                readonly
                aria-controls="listbox"
                aria-expanded=${this.open?"true":"false"}
                aria-haspopup="listbox"
                aria-labelledby="label"
                aria-disabled=${this.disabled?"true":"false"}
                aria-describedby="help-text"
                role="combobox"
                tabindex="0"
                @focus=${this.handleFocus}
                @blur=${this.handleBlur}
              />

              ${this.multiple?mi`<div part="tags" class="select__tags">${this.tags}</div>`:""}

              <input
                class="select__value-input"
                type="text"
                ?disabled=${this.disabled}
                ?required=${this.required}
                .value=${Array.isArray(this.value)?this.value.join(", "):this.value}
                tabindex="-1"
                aria-hidden="true"
                @focus=${()=>this.focus()}
                @invalid=${this.handleInvalid}
              />

              ${n?mi`
                    <button
                      part="clear-button"
                      class="select__clear"
                      type="button"
                      aria-label=${this.localize.term("clearEntry")}
                      @mousedown=${this.handleClearMouseDown}
                      @click=${this.handleClearClick}
                      tabindex="-1"
                    >
                      <slot name="clear-icon">
                        <sl-icon name="x-circle-fill" library="system"></sl-icon>
                      </slot>
                    </button>
                  `:""}

              <slot name="suffix" part="suffix" class="select__suffix"></slot>

              <slot name="expand-icon" part="expand-icon" class="select__expand-icon">
                <sl-icon library="system" name="chevron-down"></sl-icon>
              </slot>
            </div>

            <div
              id="listbox"
              role="listbox"
              aria-expanded=${this.open?"true":"false"}
              aria-multiselectable=${this.multiple?"true":"false"}
              aria-labelledby="label"
              part="listbox"
              class="select__listbox"
              tabindex="-1"
              @mouseup=${this.handleOptionClick}
              @slotchange=${this.handleDefaultSlotChange}
            >
              <slot></slot>
            </div>
          </sl-popup>
        </div>

        <div
          part="form-control-help-text"
          id="help-text"
          class="form-control__help-text"
          aria-hidden=${i?"false":"true"}
        >
          <slot name="help-text">${this.helpText}</slot>
        </div>
      </div>
    `}};ha.styles=[Ki,Ys,ca],ha.dependencies={"sl-icon":An,"sl-popup":Hs,"sl-tag":la},xo([Ji(".select")],ha.prototype,"popup",2),xo([Ji(".select__combobox")],ha.prototype,"combobox",2),xo([Ji(".select__display-input")],ha.prototype,"displayInput",2),xo([Ji(".select__value-input")],ha.prototype,"valueInput",2),xo([Ji(".select__listbox")],ha.prototype,"listbox",2),xo([Yi()],ha.prototype,"hasFocus",2),xo([Yi()],ha.prototype,"displayLabel",2),xo([Yi()],ha.prototype,"currentOption",2),xo([Yi()],ha.prototype,"selectedOptions",2),xo([Yi()],ha.prototype,"valueHasChanged",2),xo([Qi()],ha.prototype,"name",2),xo([Yi()],ha.prototype,"value",1),xo([Qi({attribute:"value"})],ha.prototype,"defaultValue",2),xo([Qi({reflect:!0})],ha.prototype,"size",2),xo([Qi()],ha.prototype,"placeholder",2),xo([Qi({type:Boolean,reflect:!0})],ha.prototype,"multiple",2),xo([Qi({attribute:"max-options-visible",type:Number})],ha.prototype,"maxOptionsVisible",2),xo([Qi({type:Boolean,reflect:!0})],ha.prototype,"disabled",2),xo([Qi({type:Boolean})],ha.prototype,"clearable",2),xo([Qi({type:Boolean,reflect:!0})],ha.prototype,"open",2),xo([Qi({type:Boolean})],ha.prototype,"hoist",2),xo([Qi({type:Boolean,reflect:!0})],ha.prototype,"filled",2),xo([Qi({type:Boolean,reflect:!0})],ha.prototype,"pill",2),xo([Qi()],ha.prototype,"label",2),xo([Qi({reflect:!0})],ha.prototype,"placement",2),xo([Qi({attribute:"help-text"})],ha.prototype,"helpText",2),xo([Qi({reflect:!0})],ha.prototype,"form",2),xo([Qi({type:Boolean,reflect:!0})],ha.prototype,"required",2),xo([Qi()],ha.prototype,"getTag",2),xo([wn("disabled",{waitUntilFirstUpdate:!0})],ha.prototype,"handleDisabledChange",1),xo([wn(["defaultValue","value"],{waitUntilFirstUpdate:!0})],ha.prototype,"handleValueChange",1),xo([wn("open",{waitUntilFirstUpdate:!0})],ha.prototype,"handleOpenChange",1),ur("select.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),ur("select.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}}),ha.define("sl-select");var pa=Ro`
  :host {
    display: block;
    user-select: none;
    -webkit-user-select: none;
  }

  :host(:focus) {
    outline: none;
  }

  .option {
    position: relative;
    display: flex;
    align-items: center;
    font-family: var(--sl-font-sans);
    font-size: var(--sl-font-size-medium);
    font-weight: var(--sl-font-weight-normal);
    line-height: var(--sl-line-height-normal);
    letter-spacing: var(--sl-letter-spacing-normal);
    color: var(--sl-color-neutral-700);
    padding: var(--sl-spacing-x-small) var(--sl-spacing-medium) var(--sl-spacing-x-small) var(--sl-spacing-x-small);
    transition: var(--sl-transition-fast) fill;
    cursor: pointer;
  }

  .option--hover:not(.option--current):not(.option--disabled) {
    background-color: var(--sl-color-neutral-100);
    color: var(--sl-color-neutral-1000);
  }

  .option--current,
  .option--current.option--disabled {
    background-color: var(--sl-color-primary-600);
    color: var(--sl-color-neutral-0);
    opacity: 1;
  }

  .option--disabled {
    outline: none;
    opacity: 0.5;
    cursor: not-allowed;
  }

  .option__label {
    flex: 1 1 auto;
    display: inline-block;
    line-height: var(--sl-line-height-dense);
  }

  .option .option__check {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    padding-inline-end: var(--sl-spacing-2x-small);
  }

  .option--selected .option__check {
    visibility: visible;
  }

  .option__prefix,
  .option__suffix {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
  }

  .option__prefix::slotted(*) {
    margin-inline-end: var(--sl-spacing-x-small);
  }

  .option__suffix::slotted(*) {
    margin-inline-start: var(--sl-spacing-x-small);
  }

  @media (forced-colors: active) {
    :host(:hover:not([aria-disabled='true'])) .option {
      outline: dashed 1px SelectedItem;
      outline-offset: -1px;
    }
  }
`,ma=class extends en{constructor(){super(...arguments),this.localize=new ji(this),this.isInitialized=!1,this.current=!1,this.selected=!1,this.hasHover=!1,this.value="",this.disabled=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","option"),this.setAttribute("aria-selected","false")}handleDefaultSlotChange(){this.isInitialized?customElements.whenDefined("sl-select").then(()=>{const e=this.closest("sl-select");e&&e.handleDefaultSlotChange()}):this.isInitialized=!0}handleMouseEnter(){this.hasHover=!0}handleMouseLeave(){this.hasHover=!1}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleSelectedChange(){this.setAttribute("aria-selected",this.selected?"true":"false")}handleValueChange(){"string"!=typeof this.value&&(this.value=String(this.value)),this.value.includes(" ")&&(console.error("Option values cannot include a space. All spaces have been replaced with underscores.",this),this.value=this.value.replace(/ /g,"_"))}getTextLabel(){const e=this.childNodes;let t="";return[...e].forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&(e.hasAttribute("slot")||(t+=e.textContent)),e.nodeType===Node.TEXT_NODE&&(t+=e.textContent)}),t.trim()}render(){return mi`
      <div
        part="base"
        class=${Dn({option:!0,"option--current":this.current,"option--disabled":this.disabled,"option--selected":this.selected,"option--hover":this.hasHover})}
        @mouseenter=${this.handleMouseEnter}
        @mouseleave=${this.handleMouseLeave}
      >
        <sl-icon part="checked-icon" class="option__check" name="check" library="system" aria-hidden="true"></sl-icon>
        <slot part="prefix" name="prefix" class="option__prefix"></slot>
        <slot part="label" class="option__label" @slotchange=${this.handleDefaultSlotChange}></slot>
        <slot part="suffix" name="suffix" class="option__suffix"></slot>
      </div>
    `}};ma.styles=[Ki,pa],ma.dependencies={"sl-icon":An},xo([Ji(".option__label")],ma.prototype,"defaultSlot",2),xo([Yi()],ma.prototype,"current",2),xo([Yi()],ma.prototype,"selected",2),xo([Yi()],ma.prototype,"hasHover",2),xo([Qi({reflect:!0})],ma.prototype,"value",2),xo([Qi({type:Boolean,reflect:!0})],ma.prototype,"disabled",2),xo([wn("disabled")],ma.prototype,"handleDisabledChange",1),xo([wn("selected")],ma.prototype,"handleSelectedChange",1),xo([wn("value")],ma.prototype,"handleValueChange",1),ma.define("sl-option");var fa=Ro`
  ${hn}

  .button__prefix,
  .button__suffix,
  .button__label {
    display: inline-flex;
    position: relative;
    align-items: center;
  }

  /* We use a hidden input so constraint validation errors work, since they don't appear to show when used with buttons.
    We can't actually hide it, though, otherwise the messages will be suppressed by the browser. */
  .hidden-input {
    all: unset;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    outline: dotted 1px red;
    opacity: 0;
    z-index: -1;
  }
`,ga=class extends en{constructor(){super(...arguments),this.hasSlotController=new pn(this,"[default]","prefix","suffix"),this.hasFocus=!1,this.checked=!1,this.disabled=!1,this.size="medium",this.pill=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","presentation")}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleClick(e){if(this.disabled)return e.preventDefault(),void e.stopPropagation();this.checked=!0}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}focus(e){this.input.focus(e)}blur(){this.input.blur()}render(){return On`
      <div part="base" role="presentation">
        <button
          part="${"button"+(this.checked?" button--checked":"")}"
          role="radio"
          aria-checked="${this.checked}"
          class=${Dn({button:!0,"button--default":!0,"button--small":"small"===this.size,"button--medium":"medium"===this.size,"button--large":"large"===this.size,"button--checked":this.checked,"button--disabled":this.disabled,"button--focused":this.hasFocus,"button--outline":!0,"button--pill":this.pill,"button--has-label":this.hasSlotController.test("[default]"),"button--has-prefix":this.hasSlotController.test("prefix"),"button--has-suffix":this.hasSlotController.test("suffix")})}
          aria-disabled=${this.disabled}
          type="button"
          value=${In(this.value)}
          @blur=${this.handleBlur}
          @focus=${this.handleFocus}
          @click=${this.handleClick}
        >
          <slot name="prefix" part="prefix" class="button__prefix"></slot>
          <slot part="label" class="button__label"></slot>
          <slot name="suffix" part="suffix" class="button__suffix"></slot>
        </button>
      </div>
    `}};ga.styles=[Ki,fa],xo([Ji(".button")],ga.prototype,"input",2),xo([Ji(".hidden-input")],ga.prototype,"hiddenInput",2),xo([Yi()],ga.prototype,"hasFocus",2),xo([Qi({type:Boolean,reflect:!0})],ga.prototype,"checked",2),xo([Qi()],ga.prototype,"value",2),xo([Qi({type:Boolean,reflect:!0})],ga.prototype,"disabled",2),xo([Qi({reflect:!0})],ga.prototype,"size",2),xo([Qi({type:Boolean,reflect:!0})],ga.prototype,"pill",2),xo([wn("disabled",{waitUntilFirstUpdate:!0})],ga.prototype,"handleDisabledChange",1),ga.define("sl-radio-button");var va=Ro`
  :host {
    display: block;
  }

  .form-control {
    position: relative;
    border: none;
    padding: 0;
    margin: 0;
  }

  .form-control__label {
    padding: 0;
  }

  .radio-group--required .radio-group__label::after {
    content: var(--sl-input-required-content);
    margin-inline-start: var(--sl-input-required-content-offset);
  }

  .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
`,ba=class extends en{constructor(){super(...arguments),this.formControlController=new ln(this),this.hasSlotController=new pn(this,"help-text","label"),this.customValidityMessage="",this.hasButtonGroup=!1,this.errorMessage="",this.defaultValue="",this.label="",this.helpText="",this.name="option",this.value="",this.size="medium",this.form="",this.required=!1}get validity(){const e=this.required&&!this.value;return""!==this.customValidityMessage?un:e?dn:cn}get validationMessage(){const e=this.required&&!this.value;return""!==this.customValidityMessage?this.customValidityMessage:e?this.validationInput.validationMessage:""}connectedCallback(){super.connectedCallback(),this.defaultValue=this.value}firstUpdated(){this.formControlController.updateValidity()}getAllRadios(){return[...this.querySelectorAll("sl-radio, sl-radio-button")]}handleRadioClick(e){const t=e.target.closest("sl-radio, sl-radio-button"),o=this.getAllRadios(),i=this.value;t&&!t.disabled&&(this.value=t.value,o.forEach(e=>e.checked=e===t),this.value!==i&&(this.emit("sl-change"),this.emit("sl-input")))}handleKeyDown(e){var t;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," "].includes(e.key))return;const o=this.getAllRadios().filter(e=>!e.disabled),i=null!=(t=o.find(e=>e.checked))?t:o[0],n=" "===e.key?0:["ArrowUp","ArrowLeft"].includes(e.key)?-1:1,r=this.value;let s=o.indexOf(i)+n;s<0&&(s=o.length-1),s>o.length-1&&(s=0),this.getAllRadios().forEach(e=>{e.checked=!1,this.hasButtonGroup||e.setAttribute("tabindex","-1")}),this.value=o[s].value,o[s].checked=!0,this.hasButtonGroup?o[s].shadowRoot.querySelector("button").focus():(o[s].setAttribute("tabindex","0"),o[s].focus()),this.value!==r&&(this.emit("sl-change"),this.emit("sl-input")),e.preventDefault()}handleLabelClick(){this.focus()}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e)}async syncRadioElements(){var e,t;const o=this.getAllRadios();if(await Promise.all(o.map(async e=>{await e.updateComplete,e.checked=e.value===this.value,e.size=this.size})),this.hasButtonGroup=o.some(e=>"sl-radio-button"===e.tagName.toLowerCase()),o.length>0&&!o.some(e=>e.checked))if(this.hasButtonGroup){const t=null==(e=o[0].shadowRoot)?void 0:e.querySelector("button");t&&t.setAttribute("tabindex","0")}else o[0].setAttribute("tabindex","0");if(this.hasButtonGroup){const e=null==(t=this.shadowRoot)?void 0:t.querySelector("sl-button-group");e&&(e.disableRole=!0)}}syncRadios(){customElements.get("sl-radio")&&customElements.get("sl-radio-button")?this.syncRadioElements():(customElements.get("sl-radio")?this.syncRadioElements():customElements.whenDefined("sl-radio").then(()=>this.syncRadios()),customElements.get("sl-radio-button")?this.syncRadioElements():customElements.whenDefined("sl-radio-button").then(()=>this.syncRadios()))}updateCheckedRadio(){this.getAllRadios().forEach(e=>e.checked=e.value===this.value),this.formControlController.setValidity(this.validity.valid)}handleSizeChange(){this.syncRadios()}handleValueChange(){this.hasUpdated&&this.updateCheckedRadio()}checkValidity(){const e=this.required&&!this.value,t=""!==this.customValidityMessage;return!e&&!t||(this.formControlController.emitInvalidEvent(),!1)}getForm(){return this.formControlController.getForm()}reportValidity(){const e=this.validity.valid;return this.errorMessage=this.customValidityMessage||e?"":this.validationInput.validationMessage,this.formControlController.setValidity(e),this.validationInput.hidden=!0,clearTimeout(this.validationTimeout),e||(this.validationInput.hidden=!1,this.validationInput.reportValidity(),this.validationTimeout=setTimeout(()=>this.validationInput.hidden=!0,1e4)),e}setCustomValidity(e=""){this.customValidityMessage=e,this.errorMessage=e,this.validationInput.setCustomValidity(e),this.formControlController.updateValidity()}focus(e){const t=this.getAllRadios(),o=t.find(e=>e.checked),i=t.find(e=>!e.disabled),n=o||i;n&&n.focus(e)}render(){const e=this.hasSlotController.test("label"),t=this.hasSlotController.test("help-text"),o=!!this.label||!!e,i=!!this.helpText||!!t,n=mi`
      <slot @slotchange=${this.syncRadios} @click=${this.handleRadioClick} @keydown=${this.handleKeyDown}></slot>
    `;return mi`
      <fieldset
        part="form-control"
        class=${Dn({"form-control":!0,"form-control--small":"small"===this.size,"form-control--medium":"medium"===this.size,"form-control--large":"large"===this.size,"form-control--radio-group":!0,"form-control--has-label":o,"form-control--has-help-text":i})}
        role="radiogroup"
        aria-labelledby="label"
        aria-describedby="help-text"
        aria-errormessage="error-message"
      >
        <label
          part="form-control-label"
          id="label"
          class="form-control__label"
          aria-hidden=${o?"false":"true"}
          @click=${this.handleLabelClick}
        >
          <slot name="label">${this.label}</slot>
        </label>

        <div part="form-control-input" class="form-control-input">
          <div class="visually-hidden">
            <div id="error-message" aria-live="assertive">${this.errorMessage}</div>
            <label class="radio-group__validation">
              <input
                type="text"
                class="radio-group__validation-input"
                ?required=${this.required}
                tabindex="-1"
                hidden
                @invalid=${this.handleInvalid}
              />
            </label>
          </div>

          ${this.hasButtonGroup?mi`
                <sl-button-group part="button-group" exportparts="base:button-group__base" role="presentation">
                  ${n}
                </sl-button-group>
              `:n}
        </div>

        <div
          part="form-control-help-text"
          id="help-text"
          class="form-control__help-text"
          aria-hidden=${i?"false":"true"}
        >
          <slot name="help-text">${this.helpText}</slot>
        </div>
      </fieldset>
    `}};ba.styles=[Ki,Ys,va],ba.dependencies={"sl-button-group":Hn},xo([Ji("slot:not([name])")],ba.prototype,"defaultSlot",2),xo([Ji(".radio-group__validation-input")],ba.prototype,"validationInput",2),xo([Yi()],ba.prototype,"hasButtonGroup",2),xo([Yi()],ba.prototype,"errorMessage",2),xo([Yi()],ba.prototype,"defaultValue",2),xo([Qi()],ba.prototype,"label",2),xo([Qi({attribute:"help-text"})],ba.prototype,"helpText",2),xo([Qi()],ba.prototype,"name",2),xo([Qi({reflect:!0})],ba.prototype,"value",2),xo([Qi({reflect:!0})],ba.prototype,"size",2),xo([Qi({reflect:!0})],ba.prototype,"form",2),xo([Qi({type:Boolean,reflect:!0})],ba.prototype,"required",2),xo([wn("size",{waitUntilFirstUpdate:!0})],ba.prototype,"handleSizeChange",1),xo([wn("value")],ba.prototype,"handleValueChange",1),ba.define("sl-radio-group");var ya=Ro`
  :host {
    --border-color: var(--sl-color-neutral-200);
    --border-radius: var(--sl-border-radius-medium);
    --border-width: 1px;
    --padding: var(--sl-spacing-large);

    display: inline-block;
  }

  .card {
    display: flex;
    flex-direction: column;
    background-color: var(--sl-panel-background-color);
    box-shadow: var(--sl-shadow-x-small);
    border: solid var(--border-width) var(--border-color);
    border-radius: var(--border-radius);
  }

  .card__image {
    display: flex;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    margin: calc(-1 * var(--border-width));
    overflow: hidden;
  }

  .card__image::slotted(img) {
    display: block;
    width: 100%;
  }

  .card:not(.card--has-image) .card__image {
    display: none;
  }

  .card__header {
    display: block;
    border-bottom: solid var(--border-width) var(--border-color);
    padding: calc(var(--padding) / 2) var(--padding);
  }

  .card:not(.card--has-header) .card__header {
    display: none;
  }

  .card:not(.card--has-image) .card__header {
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
  }

  .card__body {
    display: block;
    padding: var(--padding);
  }

  .card--has-footer .card__footer {
    display: block;
    border-top: solid var(--border-width) var(--border-color);
    padding: var(--padding);
  }

  .card:not(.card--has-footer) .card__footer {
    display: none;
  }
`,wa=class extends en{constructor(){super(...arguments),this.hasSlotController=new pn(this,"footer","header","image")}render(){return mi`
      <div
        part="base"
        class=${Dn({card:!0,"card--has-footer":this.hasSlotController.test("footer"),"card--has-image":this.hasSlotController.test("image"),"card--has-header":this.hasSlotController.test("header")})}
      >
        <slot name="image" part="image" class="card__image"></slot>
        <slot name="header" part="header" class="card__header"></slot>
        <slot part="body" class="card__body"></slot>
        <slot name="footer" part="footer" class="card__footer"></slot>
      </div>
    `}};wa.styles=[Ki,ya],wa.define("sl-card");const ka=new class{constructor(){this.errorHandlers=[]}onError(e){return this.errorHandlers.push(e),()=>{const t=this.errorHandlers.indexOf(e);t>-1&&this.errorHandlers.splice(t,1)}}handle(e,t={}){const o=this.parseError(e);return this.errorHandlers.forEach(e=>e(o,t)),this.notifyError(o),o}parseError(e){return e.response?{type:"server",status:e.response.status,message:e.response.data?.message||this.getDefaultMessage(e.response.status),details:e.response.data,timestamp:(new Date).toISOString()}:e.request?{type:"network",message:"Network error. Please check your connection.",details:e.message,timestamp:(new Date).toISOString()}:{type:"client",message:e.message||"An unexpected error occurred",details:e,timestamp:(new Date).toISOString()}}getDefaultMessage(e){return{400:"Invalid request",401:"Authentication required",403:"Access denied",404:"Resource not found",409:"Conflict with current state",422:"Validation failed",500:"Server error",502:"Service temporarily unavailable",503:"Service unavailable"}[e]||`Error ${e}`}notifyError(e){window.BookiFlex?.notifications?window.BookiFlex.notifications.error(e.message,{title:"Error",duration:5e3}):window.dispatchEvent(new CustomEvent("bflex:notification",{detail:{type:"error",message:e.message,duration:5e3}}))}};function _a(){const t=e.ref(null),o=e.ref(!1),i=(e,i={})=>(t.value=ka.handle(e,i),o.value=!0,t.value),n=()=>{t.value=null,o.value=!1};return{error:t,isError:o,handleError:i,clearError:n,withErrorHandling:async(e,t={})=>{n();try{return{data:await e(),error:null}}catch(o){return{data:null,error:i(o,t)}}}}}const xa="confirm",Ea="alert",Sa="prompt",Ca="primary",Aa="success",Ta="warning",Na="danger";const Pa=new class{constructor(){this.activeDialog=e.ref(null),this.dialogQueue=e.ref([]),this.nextId=1,this.defaultOptions=e.reactive({type:xa,variant:Ca,confirmText:"Confirm",cancelText:"Cancel",showCancel:!0,closeOnOverlay:!0,size:"small"})}setDefaults(e){Object.assign(this.defaultOptions,e)}show(e){return new Promise((t,o)=>{const i={id:this.nextId++,title:e.title||"",message:e.message||"",type:e.type||this.defaultOptions.type,variant:e.variant||this.defaultOptions.variant,confirmText:e.confirmText||this.defaultOptions.confirmText,cancelText:e.cancelText||this.defaultOptions.cancelText,showCancel:void 0!==e.showCancel?e.showCancel:this.defaultOptions.showCancel,size:e.size||this.defaultOptions.size,closeOnOverlay:void 0!==e.closeOnOverlay?e.closeOnOverlay:this.defaultOptions.closeOnOverlay,inputValue:e.inputValue||"",inputPlaceholder:e.inputPlaceholder||"",validator:e.validator||null,component:e.component||null,componentProps:e.componentProps||{},resolve:t,reject:o,open:!0,createdAt:Date.now()};return this.activeDialog.value?this.dialogQueue.value.push(i):this.activeDialog.value=i,i.promise})}resolve(e){if(!this.activeDialog.value)return;const t=this.activeDialog.value;t.open=!1,t.resolve&&t.resolve(e),setTimeout(()=>{this.processNext()},300)}cancel(){if(!this.activeDialog.value)return;const e=this.activeDialog.value;if(e.open=!1,e.resolve){const t=e.type!==xa&&null;e.resolve(t)}setTimeout(()=>{this.processNext()},300)}processNext(){this.activeDialog.value=null,this.dialogQueue.value.length>0&&(this.activeDialog.value=this.dialogQueue.value.shift())}confirm(e,t={}){return this.show({...t,message:e,type:xa,showCancel:!0})}alert(e,t={}){return this.show({...t,message:e,type:Ea,showCancel:!1})}prompt(e,t={}){return this.show({...t,message:e,type:Sa,showCancel:!0})}error(e,t={}){return this.show({...t,message:e,type:Ea,variant:Na,title:t.title||"Error",showCancel:!1})}warning(e,t={}){return this.show({...t,message:e,type:xa,variant:Ta,title:t.title||"Warning"})}success(e,t={}){return this.show({...t,message:e,type:Ea,variant:Aa,title:t.title||"Success",showCancel:!1})}};function Ra(){return{activeDialog:Pa.activeDialog,dialogQueue:Pa.dialogQueue,show:Pa.show.bind(Pa),confirm:Pa.confirm.bind(Pa),alert:Pa.alert.bind(Pa),prompt:Pa.prompt.bind(Pa),error:Pa.error.bind(Pa),warning:Pa.warning.bind(Pa),success:Pa.success.bind(Pa),resolve:Pa.resolve.bind(Pa),cancel:Pa.cancel.bind(Pa),setDefaults:Pa.setDefaults.bind(Pa)}}const Ba="primary",Va="success",Da="neutral",La="warning",$a="danger",Fa={TOP_LEFT:"top-left",TOP_CENTER:"top-center",TOP_RIGHT:"top-right",BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right"},Ma={[Ba]:"info-circle",[Va]:"check-circle",[Da]:"info-circle",[La]:"exclamation-triangle",[$a]:"exclamation-octagon"};const Oa=new class{constructor(){this.notifications=e.ref([]),this.nextId=1,this.defaultOptions=e.reactive({position:Fa.BOTTOM_LEFT,duration:5e3,closable:!0,showIcon:!0})}setDefaults(e){Object.assign(this.defaultOptions,e)}show(e){if(!e.message)return console.error("Notification message is required"),null;const t={id:this.nextId++,message:e.message,type:e.type||Da,title:e.title||null,duration:void 0!==e.duration?e.duration:this.defaultOptions.duration,closable:void 0!==e.closable?e.closable:this.defaultOptions.closable,icon:e.icon||(!1!==e.showIcon?Ma[e.type||Da]:null),showIcon:void 0!==e.showIcon?e.showIcon:this.defaultOptions.showIcon,position:e.position||this.defaultOptions.position,onClose:e.onClose||null,action:e.action||null,createdAt:Date.now(),open:!0};return this.notifications.value.push(t),t.duration>0&&setTimeout(()=>{this.close(t.id)},t.duration),t.id}close(e){const t=this.notifications.value.findIndex(t=>t.id===e);if(-1!==t){const o=this.notifications.value[t];o.open=!1,o.onClose&&o.onClose(),setTimeout(()=>{this.remove(e)},300)}}remove(e){const t=this.notifications.value.findIndex(t=>t.id===e);-1!==t&&this.notifications.value.splice(t,1)}closeAll(){this.notifications.value.forEach(e=>{this.close(e.id)})}success(e,t={}){return this.show({...t,message:e,type:Va})}error(e,t={}){return this.show({...t,message:e,type:$a})}warning(e,t={}){return this.show({...t,message:e,type:La})}info(e,t={}){return this.show({...t,message:e,type:Ba})}getByPosition(e){return this.notifications.value.filter(t=>t.position===e)}getActivePositions(){const e=new Set;return this.notifications.value.forEach(t=>e.add(t.position)),Array.from(e)}};function Ia(){return{notifications:e.computed(()=>Oa.notifications.value),notificationsByPosition:e.computed(()=>{const e={};return Object.values(Fa).forEach(t=>{e[t]=Oa.getByPosition(t)}),e}),activePositions:e.computed(()=>Oa.getActivePositions()),show:Oa.show.bind(Oa),close:Oa.close.bind(Oa),closeAll:Oa.closeAll.bind(Oa),success:Oa.success.bind(Oa),error:Oa.error.bind(Oa),warning:Oa.warning.bind(Oa),info:Oa.info.bind(Oa),setDefaults:Oa.setDefaults.bind(Oa)}}function za(e){const{type:t,message:o,title:i,...n}=e.detail||{};if(!o)return;const r="error"===t?$a:t;Oa.show({message:o,title:i,type:r,...n})}let qa=null;function Ha(){return qa||(qa=function(){const t=e.shallowRef(null),o=e.ref([]),i=e.ref(!1),n=()=>o.value.length>0;return{activeDrawer:t,navigationStack:o,isNavigating:i,navigateTo:async e=>{i.value=!0;try{t.value&&!1!==e.addToStack&&o.value.push({...t.value,timestamp:Date.now()}),t.value={component:e.component,props:e.props||{},key:e.key||`${e.component}-${Date.now()}`}}finally{i.value=!1}},navigateBack:async()=>{if(!n())return!1;i.value=!0;try{const e=o.value.pop();return!!e&&(t.value=e,!0)}finally{i.value=!1}},closeAll:()=>{t.value=null,o.value=[],i.value=!1},canNavigateBack:n,getNavigationDepth:()=>o.value.length,replaceDrawer:async e=>{i.value=!0;try{t.value={component:e.component,props:e.props||{},key:e.key||`${e.component}-${Date.now()}`}}finally{i.value=!1}}}}()),qa}function Ua(){const t=e.ref(null),o=e.ref(null),i=e.ref(!1),{error:n,isError:r,withErrorHandling:s,clearError:a}=_a(),l=async e=>{if(!e)return{success:!1,error:"Reservation ID is required"};i.value=!0,a();try{const{data:i,error:r}=await s(()=>(async e=>{const t=`${window.wpApiSettings.root}bflex/v1/reservation/${e}`;try{return await Ht(t)}catch(n){throw console.error("Failed to load reservation:",n),n}})(e),{operation:"loadReservation",reservationId:e});return r?{success:!1,error:r}:i?.reservations?.[0]?(t.value=i.reservations[0],o.value=i.totals,{success:!0,data:t.value}):{success:!1,error:"Invalid response format"}}finally{i.value=!1}},c=e.computed(()=>"CANCELLED"===t.value?.status),d=e.computed(()=>"CONFIRMED"===t.value?.status),u=e.computed(()=>"WAITING_CONFIRMATION"===t.value?.status),h=e.computed(()=>t.value?.payment?.amounts?.paid>=t.value?.totalAmount),p=e.computed(()=>t.value?.payment?.transactions?.length>0),m=e.computed(()=>t.value?.payment?.status?.isWaitingPayment),f=e.computed(()=>t.value?.stay?.checkInDate||""),g=e.computed(()=>t.value?.stay?.checkOutDate||""),v=e.computed(()=>{if(!t.value?.customer)return"";const{firstName:e,lastName:o}=t.value.customer;return`${e||""} ${o||""}`.trim()}),b=e.computed(()=>t.value?.accommodation?.type?.name||""),y=e.computed(()=>t.value?.accommodation?.ratePlan?.name||"");return{reservation:t,totals:o,isLoading:i,error:n,isError:r,load:l,reload:async()=>t.value?.id?await l(t.value.id):{success:!1,error:"No reservation to reload"},clear:()=>{t.value=null,o.value=null,a()},isCancelled:c,isConfirmed:d,isWaitingConfirmation:u,isPaid:h,hasPayments:p,needsPayment:m,formattedCheckIn:f,formattedCheckOut:g,guestFullName:v,accommodationName:b,ratePlanName:y}}function Wa(){const t=e.ref(null),o=e.ref(!1),{error:i,isError:n,withErrorHandling:r,clearError:s}=_a(),a=async e=>{if(!e)return{success:!1,error:"Payment ID is required"};o.value=!0,s();try{const{data:o,error:n}=await r(()=>(async e=>{const t=`${window.wpApiSettings.root}bflex/v1/payment/item/${e.id}`;try{return await Ht(t)}catch(i){throw console.error("Failed to load payment:",i),i}})({id:e}),{operation:"findPayment",paymentId:e});return n?{success:!1,error:n}:o?.payment?(t.value=o.payment,{success:!0,data:t.value}):{success:!1,error:"Invalid response format"}}finally{o.value=!1}},l=e.computed(()=>"PAID"===t.value?.status),c=e.computed(()=>"PENDING"===t.value?.status),d=e.computed(()=>"FAILED"===t.value?.status),u=e.computed(()=>"REFUNDED"===t.value?.status),h=e.computed(()=>"PARTIALLY_REFUNDED"===t.value?.status),p=e.computed(()=>"CANCELLED"===t.value?.status),m=e.computed(()=>{if(!t.value?.allocations?.length)return null;const e=t.value.allocations.find(e=>e.reservation?.paymentType?.gatewayName===t.value.gatewayName)??t.value.allocations[0];return e?.reservation||null}),f=e.computed(()=>t.value?.allocations?.length>0),g=e.computed(()=>t.value?.amount?function(e,t){const o="string"==typeof e?parseFloat(e):e;try{return new Intl.NumberFormat("en-US",{style:"currency",currency:t||"EUR"}).format(o)}catch(da){return`${t||""} ${o.toFixed(2)}`}}(t.value.amount.amount,t.value.amount.currency):""),v=e.computed(()=>{if(!t.value?.client)return"";const{firstName:e,lastName:o}=t.value.client;return`${e||""} ${o||""}`.trim()}),b=e.computed(()=>t.value?.client?.email||""),y=e.computed(()=>t.value?.client?.phone||""),w=e.computed(()=>t.value?.details&&(Array.isArray(t.value.details)?t.value.details.length>0:Object.keys(t.value.details).length>0));return{payment:t,isLoading:o,error:i,isError:n,load:a,reload:async()=>t.value?.id?await a(t.value.id):{success:!1,error:"No payment to reload"},clear:()=>{t.value=null,s()},isPaid:l,isPending:c,isFailed:d,isRefunded:u,isPartiallyRefunded:h,isCancelled:p,getRelatedReservation:m,hasAllocations:f,formattedAmount:g,clientFullName:v,clientEmail:b,clientPhone:y,hasGatewayDetails:w}}const ja=["placement"],Ka={slot:"label"},Ga={key:0,slot:"header-actions"},Xa={key:1,slot:"header-actions"},Qa={__name:"BaseDrawer",props:{label:{type:String,default:""},showBack:{type:Boolean,default:!1},placement:{type:String,default:"end"},autoShow:{type:Boolean,default:!0},contentClass:{type:String,default:"drawer-content"}},emits:["close","back","show","hide","afterShow","afterHide"],setup(t,{expose:o,emit:i}){const n=t,r=i,{drawerRef:s,isVisible:a,show:l,hide:c,close:d,canNavigateBack:u}=function(){const t=e.ref(null),o=e.ref(!1),i=e.ref([]),n=async()=>{await e.nextTick(),t.value&&(t.value.show(),o.value=!0)},r=async()=>{t.value&&(t.value.hide(),o.value=!1)};return e.onUnmounted(()=>{i.value=[]}),{drawerRef:t,isVisible:o,show:n,hide:r,close:()=>(i.value=[],o.value=!1,!0),navigateTo:async(e,t=null)=>{t&&i.value.push(t),await r()},navigateBack:async()=>{const e=i.value.pop();return e?(await n(),e):null},canNavigateBack:()=>i.value.length>0,navigationStack:i}}(),h=()=>(r("close"),d()),p=()=>{r("back")},m=()=>{a.value=!0,r("afterShow")},f=()=>{a.value=!1,r("afterHide")},g=e.computed(()=>n.showBack||u());return e.onMounted(()=>{n.autoShow&&l()}),e.watch(a,e=>{r(e?"show":"hide")}),o({show:l,hide:c,close:d,isVisible:a}),(o,i)=>(e.openBlock(),e.createElementBlock("sl-drawer",{ref_key:"drawerRef",ref:s,placement:t.placement,onSlRequestClose:h,onSlAfterShow:m,onSlAfterHide:f},[e.createElementVNode("div",Ka,[e.renderSlot(o.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)])]),g.value?(e.openBlock(),e.createElementBlock("div",Ga,[e.createElementVNode("sl-icon-button",{name:"arrow-left",onClick:p,style:{color:"#ffffff","margin-right":"5px"}}),e.renderSlot(o.$slots,"header-actions")])):(e.openBlock(),e.createElementBlock("div",Xa,[e.renderSlot(o.$slots,"header-actions")])),e.createElementVNode("div",{class:e.normalizeClass(t.contentClass)},[e.renderSlot(o.$slots,"default")],2),e.renderSlot(o.$slots,"footer")],40,ja))}},Ya=(e,t)=>{const o=e.__vccOpts||e;for(const[i,n]of t)o[i]=n;return o},Ja=["label","size"],Za={key:0,class:"dialog-content"},el={key:0,class:"dialog-message"},tl={key:1,class:"dialog-input"},ol=["placeholder"],il={key:0,variant:"danger",open:""},nl={key:1,slot:"footer",class:"dialog-footer"},rl=["variant","disabled"],sl=Ya({__name:"DialogComponent",setup(t){const{activeDialog:o,resolve:i,cancel:n}=Ra(),r=e.ref(null),s=e.ref(null),a=e.ref(""),l=e.ref(""),c=async()=>{if(!o.value)return;const e=o.value;if("prompt"===e.type){if(e.validator){const t=await e.validator(a.value);if(!0!==t)return void(l.value=t||"Invalid input")}i(a.value)}else i(!0)},d=()=>{n()},u=e=>{const t=o.value;"overlay"!==e.detail.source||t?.closeOnOverlay?d():e.preventDefault()},h=e.computed(()=>o.value?.variant||"primary");e.watch(o,async t=>{t&&(a.value=t.inputValue||"",l.value="",await e.nextTick(),r.value&&r.value.show())},{immediate:!0});const p=e=>{"Enter"===e.key&&"prompt"===o.value?.type&&c()},m=()=>{o.value&&!o.value.open&&setTimeout(()=>{o.value&&o.value.open},100)};return(t,f)=>(e.openBlock(),e.createElementBlock("sl-dialog",{ref_key:"dialogRef",ref:r,label:e.unref(o)?.title||"",size:e.unref(o)?.size||"small",onSlRequestClose:u,onSlAfterHide:m,class:"dialog-component",style:e.normalizeStyle({display:e.unref(o)?"block":"none"})},[e.unref(o)?(e.openBlock(),e.createElementBlock("div",Za,[e.unref(o).message?(e.openBlock(),e.createElementBlock("div",el,e.toDisplayString(e.unref(o).message),1)):e.createCommentVNode("",!0),"prompt"===e.unref(o).type?(e.openBlock(),e.createElementBlock("div",tl,[e.withDirectives(e.createElementVNode("sl-input",{ref_key:"inputRef",ref:s,"onUpdate:modelValue":f[0]||(f[0]=e=>a.value=e),placeholder:e.unref(o).inputPlaceholder,onKeydown:p,class:e.normalizeClass({"input-invalid":l.value})},null,42,ol),[[e.vModelText,a.value]]),l.value?(e.openBlock(),e.createElementBlock("sl-alert",il,[f[1]||(f[1]=e.createElementVNode("sl-icon",{slot:"icon",name:"exclamation-octagon"},null,-1)),e.createTextVNode(" "+e.toDisplayString(l.value),1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),"custom"===e.unref(o).type&&e.unref(o).component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(o).component),e.mergeProps({key:2},e.unref(o).componentProps,{onResolve:e.unref(i),onCancel:e.unref(n)}),null,16,["onResolve","onCancel"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.unref(o)?(e.openBlock(),e.createElementBlock("div",nl,[e.unref(o).showCancel?(e.openBlock(),e.createElementBlock("sl-button",{key:0,variant:"neutral",onClick:d},e.toDisplayString(e.unref(o).cancelText),1)):e.createCommentVNode("",!0),e.createElementVNode("sl-button",{variant:h.value,onClick:c,disabled:"custom"===e.unref(o).type},e.toDisplayString(e.unref(o).confirmText),9,rl)])):e.createCommentVNode("",!0)],44,Ja))}},[["__scopeId","data-v-5b3ce1c2"]]),al=["variant","open","closable"],ll=["name"],cl={key:1},dl={class:"notification-message"},ul=["variant","size"],hl=Ya({__name:"NotificationAlert",props:{notification:{type:Object,required:!0}},emits:["close","action"],setup(t,{emit:o}){const i=t,n=o,r=e.ref(null),s=e.ref(!0),a=()=>{s.value=!1,setTimeout(()=>{n("close",i.notification.id)},150)},l=()=>{n("action",i.notification),i.notification.action?.keepOpen||a()};return e.watch(()=>i.notification.open,e=>{e||a()}),e.onMounted(()=>{r.value&&!i.notification.open&&r.value.hide()}),(o,i)=>(e.openBlock(),e.createElementBlock("sl-alert",{ref_key:"alertRef",ref:r,variant:t.notification.type,open:s.value,closable:t.notification.closable,onSlRequestClose:a,class:"notification-alert"},[t.notification.showIcon&&t.notification.icon?(e.openBlock(),e.createElementBlock("sl-icon",{key:0,slot:"icon",name:t.notification.icon},null,8,ll)):e.createCommentVNode("",!0),t.notification.title?(e.openBlock(),e.createElementBlock("strong",cl,e.toDisplayString(t.notification.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",dl,e.toDisplayString(t.notification.message),1),t.notification.action?(e.openBlock(),e.createElementBlock("sl-button",{key:2,slot:"suffix",variant:t.notification.action.variant||"text",size:t.notification.action.size||"small",onClick:l},e.toDisplayString(t.notification.action.label),9,ul)):e.createCommentVNode("",!0)],40,al))}},[["__scopeId","data-v-e0d55458"]]),pl=Ya({__name:"NotificationContainer",props:{position:{type:String,required:!0,validator:e=>Object.values(Fa).includes(e)},visible:{type:Boolean,default:!0},maxWidth:{type:String,default:"400px"},offset:{type:String,default:"1rem"},gap:{type:String,default:"0.5rem"}},setup(t){const o=t,{notificationsByPosition:i,close:n}=Ia(),r=e.computed(()=>i.value[o.position]||[]),s=e.computed(()=>{const e=["notification-container"],[t,i]=o.position.split("-");return e.push(`notification-container--${t}`),e.push(`notification-container--${i}`),e}),a=e.computed(()=>{const[e,t]=o.position.split("-"),i={"--notification-max-width":o.maxWidth,"--notification-gap":o.gap};return"top"===e?i.top=o.offset:i.bottom=o.offset,"left"===t?i.left=o.offset:"right"===t?i.right=o.offset:(i.left="50%",i.transform="translateX(-50%)"),i}),l=e=>{n(e)},c=e=>{e.action&&e.action.handler&&e.action.handler(e)};return(o,i)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(s.value),style:e.normalizeStyle(a.value)},[e.createVNode(e.TransitionGroup,{name:"notification",tag:"div",class:"notification-list"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,t=>(e.openBlock(),e.createBlock(hl,{key:t.id,notification:t,onClose:l,onAction:c},null,8,["notification"]))),128))]),_:1})],6),[[e.vShow,t.visible&&r.value.length>0]])]))}},[["__scopeId","data-v-634eb23f"]]),ml={__name:"DialogProvider",props:{defaultOptions:{type:Object,default:()=>({})}},setup(t){const o=t,{setDefaults:i}=Ra();let n=null;return e.onMounted(()=>{o.defaultOptions&&Object.keys(o.defaultOptions).length>0&&i(o.defaultOptions),window.addEventListener("bflex:show-dialog",e=>{Pa.show(e.detail)}),n=()=>{window.removeEventListener("bflex:show-dialog",e=>{Pa.show(e.detail)})}}),e.onUnmounted(()=>{n&&n()}),(t,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(sl),e.renderSlot(t.$slots,"default")],64))}},fl={__name:"NotificationProvider",props:{positions:{type:Array,default:()=>Object.values(Fa)},defaultOptions:{type:Object,default:()=>({})},maxWidth:{type:String,default:"400px"},offset:{type:String,default:"1rem"},gap:{type:String,default:"0.5rem"}},setup(t){const o=t,{setDefaults:i,activePositions:n}=Ia();let r=null;return e.onMounted(()=>{o.defaultOptions&&Object.keys(o.defaultOptions).length>0&&i(o.defaultOptions),window.addEventListener("bflex:notification",za),window.addEventListener("bflex:notify",e=>{Oa.show(e.detail)}),r=()=>{window.removeEventListener("bflex:notification",za),window.removeEventListener("bflex:notify",e=>{Oa.show(e.detail)})}}),e.onUnmounted(()=>{r&&r()}),(o,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.positions,o=>(e.openBlock(),e.createBlock(pl,{key:o,position:o,visible:e.unref(n).includes(o),"max-width":t.maxWidth,offset:t.offset,gap:t.gap},null,8,["position","visible","max-width","offset","gap"]))),128)),e.renderSlot(o.$slots,"default")],64))}},gl=["variant"],vl={__name:"PaymentStatus",props:{status:{type:String,required:!0}},setup(t){const o=t,i={paid:window.wp.i18n.__("Paid","bookiflex"),waiting:window.wp.i18n.__("Waiting","bookiflex"),authorized:window.wp.i18n.__("Authorized","bookiflex"),cancelled:window.wp.i18n.__("Cancelled","bookiflex"),expired:window.wp.i18n.__("Expired","bookiflex")},n=e.computed(()=>{switch(o.status){case"PAID":return{label:i.paid,variant:"success"};case to:return{label:i.waiting,variant:"warning"};case oo:return{label:i.authorized,variant:"primary"};case"CANCELLED":return{label:i.cancelled,variant:"danger"};case"EXPIRED":return{label:i.expired,variant:"neutral"};default:return null}});return(t,o)=>n.value?(e.openBlock(),e.createElementBlock("sl-badge",{key:0,variant:n.value.variant},e.toDisplayString(n.value.label),9,gl)):e.createCommentVNode("",!0)}},bl={class:"payment-actions",style:{"margin-top":"24px"}},yl=["loading","disabled","title"],wl=["loading","disabled"],kl=["loading","disabled"],_l=["loading","disabled"],xl="capture",El="cancel",Sl="sync",Cl="markAsPaid",Al={__name:"PaymentStatusManager",props:{reservation:{type:Object,required:!0},payment:{type:Object,required:!0}},emits:["updated"],setup(t,{emit:o}){const i=t,n=o,{confirm:r}=Ra(),{success:s,error:a}=Ia(),l={
/* translators: %s: payment action name (e.g. captured, authorized, cancelled) */
paymentSuccess:window.wp.i18n.__("Payment %s successfully","bookiflex"),
/* translators: %s: payment action name (e.g. capture, cancel) */
failedToAction:window.wp.i18n.__("Failed to %s payment","bookiflex"),cancelMessage:window.wp.i18n.__("Cancel this pending payment. It will no longer be available for completion by the guest.","bookiflex"),cancelPayment:window.wp.i18n.__("Cancel Payment","bookiflex"),keepPayment:window.wp.i18n.__("Keep Payment","bookiflex"),captureMessage:window.wp.i18n.__("Capture the authorized payment amount. The funds will be transferred according to the payment provider's rules.","bookiflex"),capturePayment:window.wp.i18n.__("Capture Payment","bookiflex"),captureFunds:window.wp.i18n.__("Capture Funds","bookiflex"),cancel:window.wp.i18n.__("Cancel","bookiflex"),capture:window.wp.i18n.__("Capture","bookiflex"),syncStatus:window.wp.i18n.__("Sync Status","bookiflex"),syncMessage:window.wp.i18n.__("Re-check the payment status with the gateway. Use this if the payment was completed but the status was not updated automatically.","bookiflex"),syncPayment:window.wp.i18n.__("Sync Payment","bookiflex"),syncFailed:window.wp.i18n.__("Failed to sync payment status","bookiflex"),synced:window.wp.i18n.__("synced","bookiflex"),markAsPaid:window.wp.i18n.__("Mark as Paid","bookiflex"),markAsPaidMessage:window.wp.i18n.__("This will manually mark the payment as paid, bypassing the payment gateway. Use this only if the guest paid through an alternative method (e.g. cash or bank transfer).","bookiflex"),markAsPaidConfirm:window.wp.i18n.__("Mark as Paid","bookiflex"),markAsPaidFailed:window.wp.i18n.__("Failed to mark payment as paid","bookiflex"),paid:window.wp.i18n.__("confirmed","bookiflex")},c=e.ref(null),d=e.ref(!1),u=e.computed(()=>[to,oo].includes(i.payment.status)),h=e.computed(()=>[oo].includes(i.payment.status)||"offline"===i.payment.gatewayName&&[to].includes(i.payment.status)),p=e.computed(()=>"offline"!==i.payment.gatewayName&&[to].includes(i.payment.status)),m=e.computed(()=>"offline"!==i.payment.gatewayName&&[to].includes(i.payment.status)&&i.reservation.status!==Xt),f=async e=>{c.value=e,d.value=!0;try{const t=await g(e);if(t?.token){await(async e=>{try{const t=await fetch(e,{method:"GET",credentials:"include",redirect:"follow"});return Promise.resolve({status:200===t.status?"success":"failure"})}catch(a){throw console.error("Failed to create payment token:",a),a}})(t.token),await v();const o=e===xl?"captured":"cancelled";s(window.wp.i18n.sprintf(l.paymentSuccess,o))}}catch(t){console.error("Payment processing error:",t),a(window.wp.i18n.sprintf(l.failedToAction,e),{duration:8e3})}finally{c.value=null,d.value=!1}},g=async e=>{const t={[xl]:Ut,[El]:Wt}[e];if(!t)throw new Error(`Unknown action: ${e}`);return await t(i.payment.id,i.reservation.sid)},v=async()=>{n("updated",{reservationId:i.reservation.id}),window.dispatchEvent(new CustomEvent("bflex:reservation:updated",{detail:{id:i.reservation.id}})),io()},b=async()=>{if(await r(l.syncMessage,{title:l.syncStatus,variant:"default",confirmText:l.syncPayment,cancelText:l.cancel})){c.value=Sl,d.value=!0;try{await(async e=>{const t=`${window.wpApiSettings.root}bflex/v1/payment/sync`;try{return await Ht(t,{method:"POST",body:{paymentId:e}})}catch(a){throw console.error("Failed to sync payment:",a),a}})(i.payment.id),await v(),s(window.wp.i18n.sprintf(l.paymentSuccess,l.synced))}catch(e){console.error("Payment sync error:",e),a(l.syncFailed,{duration:8e3})}finally{c.value=null,d.value=!1}}},y=async()=>{if(await r(l.markAsPaidMessage,{title:l.markAsPaid,variant:"success",confirmText:l.markAsPaidConfirm,cancelText:l.cancel})){c.value=Cl,d.value=!0;try{await(async e=>{const t=`${window.wpApiSettings.root}bflex/v1/payment/markAsPaid`;try{return await Ht(t,{method:"POST",body:{paymentId:e}})}catch(a){throw console.error("Failed to mark payment as paid:",a),a}})(i.payment.id),await v(),s(window.wp.i18n.sprintf(l.paymentSuccess,l.paid))}catch(e){console.error("Mark as paid error:",e),a(l.markAsPaidFailed,{duration:8e3})}finally{c.value=null,d.value=!1}}},w=async()=>{await r(l.cancelMessage,{title:l.cancelPayment,variant:"danger",confirmText:l.cancelPayment,cancelText:l.keepPayment})&&await f(El)},k=async()=>{await r(l.captureMessage,{title:l.capturePayment,variant:"success",confirmText:l.captureFunds,cancelText:l.cancel})&&await f(xl)};return(t,o)=>(e.openBlock(),e.createElementBlock("div",bl,[p.value?(e.openBlock(),e.createElementBlock("sl-button",{key:0,onClick:b,loading:c.value===Sl,disabled:d.value,variant:"default",size:"small",title:l.syncStatus},[...o[0]||(o[0]=[e.createElementVNode("sl-icon",{slot:"prefix",name:"arrow-repeat"},null,-1)])],8,yl)):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("sl-button",{key:1,onClick:y,loading:c.value===Cl,disabled:d.value,variant:"success",size:"small"},[o[1]||(o[1]=e.createElementVNode("sl-icon",{slot:"prefix",name:"check-circle"},null,-1)),e.createTextVNode(" "+e.toDisplayString(l.markAsPaid),1)],8,wl)):e.createCommentVNode("",!0),h.value?(e.openBlock(),e.createElementBlock("sl-button",{key:2,onClick:k,loading:c.value===xl,disabled:d.value,variant:"success",size:"small"},e.toDisplayString(l.capture),9,kl)):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createElementBlock("sl-button",{key:3,onClick:w,loading:c.value===El,disabled:d.value,variant:"danger",outline:"",size:"small"},[o[2]||(o[2]=e.createElementVNode("sl-icon",{slot:"prefix",name:"x-circle"},null,-1)),e.createTextVNode(" "+e.toDisplayString(l.cancel),1)],8,_l)):e.createCommentVNode("",!0),o[3]||(o[3]=e.createElementVNode("div",{style:{flex:"auto"}},null,-1)),e.renderSlot(t.$slots,"default")]))}},Tl={class:"payment-item"},Nl={class:"payment-content"},Pl={class:"payment-header"},Rl={class:"payment-info"},Bl={class:"payment-amount"},Vl={class:"payment-method"},Dl=["title"],Ll={__name:"PaymentLineCard",props:{transaction:{type:Object,required:!0},reservation:{type:Object,required:!0}},emits:["actionClick"],setup(t,{emit:o}){const i=t,n={details:window.wp.i18n.__("Details","bookiflex")},r=o,s=(e,t)=>{r("actionClick",{type:e,id:t})},a=e.computed(()=>{if(!i.transaction.gatewayName)return"";const e=i.transaction.gatewayName.replace(/_/g," ");return e.charAt(0).toUpperCase()+e.slice(1)});return(o,i)=>(e.openBlock(),e.createElementBlock("sl-card",Tl,[e.createElementVNode("div",Nl,[e.createElementVNode("div",Pl,[e.createElementVNode("div",Rl,[e.createElementVNode("div",Bl,e.toDisplayString(e.unref(no)(t.transaction.amount,t.transaction.currency)),1),e.createElementVNode("div",Vl,e.toDisplayString(a.value),1)]),e.createVNode(vl,{status:t.transaction.status},null,8,["status"])]),e.createVNode(Al,{payment:t.transaction,reservation:t.reservation,onUpdated:i[1]||(i[1]=()=>s("updated",t.transaction.id))},{default:e.withCtx(()=>[e.createElementVNode("sl-button",{variant:"neutral",outline:"",size:"small",onClick:i[0]||(i[0]=()=>s("details",t.transaction.id)),title:n.details},[...i[2]||(i[2]=[e.createElementVNode("sl-icon",{slot:"prefix",name:"eye"},null,-1)])],8,Dl)]),_:1},8,["payment","reservation"])])]))}},$l={class:"section"},Fl={class:"section-title"},Ml={class:"guest-info"},Ol={class:"info-item"},Il={class:"info-label"},zl={class:"info-value"},ql={class:"info-item"},Hl={class:"info-label"},Ul={class:"info-value"},Wl={class:"info-item"},jl={class:"info-label"},Kl={class:"info-value"},Gl={__name:"GuestInformation",props:{customer:{type:Object,required:!0}},setup(t){const o={guestInformation:window.wp.i18n.__("Guest information","bookiflex"),person:window.wp.i18n.__("Person","bookiflex"),email:window.wp.i18n.__("Email","bookiflex"),phone:window.wp.i18n.__("Phone","bookiflex")};return(i,n)=>(e.openBlock(),e.createElementBlock("div",$l,[e.createElementVNode("div",Fl,e.toDisplayString(o.guestInformation),1),e.createElementVNode("div",Ml,[e.createElementVNode("div",Ol,[e.createElementVNode("div",Il,e.toDisplayString(o.person),1),e.createElementVNode("div",zl,e.toDisplayString(t.customer.firstName)+" "+e.toDisplayString(t.customer.lastName),1)]),e.createElementVNode("div",ql,[e.createElementVNode("div",Hl,e.toDisplayString(o.email),1),e.createElementVNode("div",Ul,e.toDisplayString(t.customer.email),1)]),e.createElementVNode("div",Wl,[e.createElementVNode("div",jl,e.toDisplayString(o.phone),1),e.createElementVNode("div",Kl,e.toDisplayString(t.customer.phone||"-"),1)])]),e.renderSlot(i.$slots,"default")]))}},Xl={class:"section reservation-section"},Ql={class:"section-title"},Yl={class:"dates-grid"},Jl={class:"date-item"},Zl={class:"date-label"},ec={class:"date-value"},tc={class:"date-item"},oc={class:"date-label"},ic={class:"date-value"},nc={class:"date-item"},rc={class:"date-label"},sc={class:"date-value"},ac={class:"accommodation-info"},lc={class:"info-item"},cc={class:"info-label"},dc={class:"info-value"},uc={class:"info-item"},hc={class:"info-label"},pc={class:"info-value"},mc={class:"info-item"},fc={class:"info-label"},gc={class:"info-value"},vc={class:"info-item"},bc={class:"info-label"},yc={class:"info-value"},wc={class:"info-item"},kc={class:"info-label"},_c={class:"info-value"},xc={class:"info-item"},Ec={class:"info-label"},Sc={class:"info-value"},Cc={__name:"ReservationDetails",props:{reservation:{type:Object,required:!0}},setup(t){const o={reservationDetails:window.wp.i18n.__("Reservation details","bookiflex"),checkIn:window.wp.i18n.__("Check-in","bookiflex"),checkOut:window.wp.i18n.__("Check-out","bookiflex"),nights:window.wp.i18n.__("Nights","bookiflex"),accommodationType:window.wp.i18n.__("Rental unit","bookiflex"),guests:window.wp.i18n.__("Guests","bookiflex"),adults:window.wp.i18n.__("adults","bookiflex"),ratePlan:window.wp.i18n.__("Rate plan","bookiflex"),cancellationPolicy:window.wp.i18n.__("Cancellation policy","bookiflex"),paymentType:window.wp.i18n.__("Payment type","bookiflex"),waitingPaymentUntil:window.wp.i18n.__("Waiting payment until","bookiflex")};return(i,n)=>(e.openBlock(),e.createElementBlock("div",Xl,[e.createElementVNode("div",Ql,e.toDisplayString(o.reservationDetails),1),e.createElementVNode("div",Yl,[e.createElementVNode("div",Jl,[e.createElementVNode("div",Zl,e.toDisplayString(o.checkIn),1),e.createElementVNode("div",ec,e.toDisplayString(e.unref(so)(t.reservation.stay.checkInDate)),1)]),e.createElementVNode("div",tc,[e.createElementVNode("div",oc,e.toDisplayString(o.checkOut),1),e.createElementVNode("div",ic,e.toDisplayString(e.unref(so)(t.reservation.stay.checkOutDate)),1)]),e.createElementVNode("div",nc,[e.createElementVNode("div",rc,e.toDisplayString(o.nights),1),e.createElementVNode("div",sc,e.toDisplayString(t.reservation.stay.los),1)])]),e.createElementVNode("div",ac,[e.createElementVNode("div",lc,[e.createElementVNode("div",cc,e.toDisplayString(o.accommodationType),1),e.createElementVNode("div",dc,e.toDisplayString(t.reservation.accommodation.type.name)+" ("+e.toDisplayString(t.reservation.accommodation.type.code)+")",1)]),e.createElementVNode("div",uc,[e.createElementVNode("div",hc,e.toDisplayString(o.guests),1),e.createElementVNode("div",pc,e.toDisplayString(t.reservation.stay.guests.adults)+" "+e.toDisplayString(o.adults)+" "+e.toDisplayString(t.reservation.stay.guests.children.length?`children [${t.reservation.stay.guests.children.join(", ")}]`:""),1)]),e.createElementVNode("div",mc,[e.createElementVNode("div",fc,e.toDisplayString(o.ratePlan),1),e.createElementVNode("div",gc,e.toDisplayString(t.reservation.accommodation.ratePlan.name)+" ("+e.toDisplayString(t.reservation.accommodation.ratePlan.code)+")",1)]),e.createElementVNode("div",vc,[e.createElementVNode("div",bc,e.toDisplayString(o.cancellationPolicy),1),e.createElementVNode("div",yc,e.toDisplayString(t.reservation.cancellation.policy.name),1)]),e.createElementVNode("div",wc,[e.createElementVNode("div",kc,e.toDisplayString(o.paymentType),1),e.createElementVNode("div",_c,e.toDisplayString(t.reservation.payment.method.name),1)]),e.createElementVNode("div",xc,[e.createElementVNode("div",Ec,e.toDisplayString(o.waitingPaymentUntil),1),e.createElementVNode("div",Sc,e.toDisplayString(t.reservation.payment.status.waitingUntil||"-"),1)])]),e.renderSlot(i.$slots,"default")]))}},Ac={class:"section"},Tc={class:"section-title"},Nc={class:"financial-summary"},Pc={class:"financial-row"},Rc={class:"financial-label"},Bc={class:"financial-row"},Vc={class:"financial-label"},Dc={class:"financial-value"},Lc={key:0,class:"financial-row"},$c={class:"financial-label"},Fc={class:"financial-value total-value"},Mc={key:1,class:"financial-row"},Oc={class:"financial-label"},Ic={class:"financial-value total-value"},zc={__name:"FinancialSummary",props:{payment:{type:Object,required:!0},penalties:{type:Array,required:!0},total:{type:Number,required:!0},currency:{type:String,required:!0},isCancelled:{type:Boolean,required:!0}},emits:["actionClick"],setup(t,{emit:o}){const i=t,n={financialSummary:window.wp.i18n.__("Financial summary","bookiflex"),total:window.wp.i18n.__("Total","bookiflex"),paid:window.wp.i18n.__("Paid","bookiflex"),penalty:window.wp.i18n.__("Penalty","bookiflex"),onArrival:window.wp.i18n.__("On arrival","bookiflex")},r=o,s=()=>{r("actionClick")},a=e.computed(()=>i.penalties.reduce((e,t)=>e+=t.amount,0));return(o,i)=>(e.openBlock(),e.createElementBlock("div",Ac,[e.createElementVNode("div",Tc,e.toDisplayString(n.financialSummary),1),e.createElementVNode("sl-card",Nc,[e.createElementVNode("div",Pc,[e.createElementVNode("span",Rc,e.toDisplayString(n.total),1),e.createElementVNode("span",{class:"financial-value details-value",onClick:s},e.toDisplayString(e.unref(no)(t.total,t.currency)),1)]),e.createElementVNode("div",Bc,[e.createElementVNode("span",Vc,e.toDisplayString(n.paid),1),e.createElementVNode("span",Dc,e.toDisplayString(e.unref(no)(t.payment.amounts.paid,t.currency)),1)]),t.isCancelled?(e.openBlock(),e.createElementBlock("div",Lc,[e.createElementVNode("span",$c,e.toDisplayString(n.penalty),1),e.createElementVNode("span",Fc,e.toDisplayString(e.unref(no)(a.value,t.currency)),1)])):(e.openBlock(),e.createElementBlock("div",Mc,[e.createElementVNode("span",Oc,e.toDisplayString(n.onArrival),1),e.createElementVNode("span",Ic,e.toDisplayString(e.unref(no)(t.payment.amounts.onArrival,t.currency)),1)]))]),e.renderSlot(o.$slots,"default")]))}},qc={class:"reservation-actions"},Hc=["loading","disabled"],Uc=["loading","disabled"],Wc=["loading","disabled"],jc=["loading","disabled"],Kc=["loading","disabled"],Gc=["loading","disabled"],Xc={__name:"ReservationStatusManager",props:{reservation:{type:Object,required:!0}},emits:["updated"],setup(t,{emit:o}){const i=t,n=o,{confirm:r,prompt:s}=Ra(),{success:a,error:l}=Ia(),c={
/* translators: %s: new reservation status name (e.g. Confirmed, Cancelled) */
statusChanged:window.wp.i18n.__("Reservation status changed to %s","bookiflex"),failedToChange:window.wp.i18n.__("Failed to change reservation status","bookiflex"),confirmCancelMessage:window.wp.i18n.__("Confirm that this reservation is no longer valid and will be cancelled.","bookiflex"),cancelReservation:window.wp.i18n.__("Cancel Reservation","bookiflex"),keepReservation:window.wp.i18n.__("Keep Reservation","bookiflex"),confirmInHouseMessage:window.wp.i18n.__("Confirm that the guest has checked in and is currently staying at the property.","bookiflex"),markAsInHouse:window.wp.i18n.__("Mark as In-House","bookiflex"),checkIn:window.wp.i18n.__("Check In","bookiflex"),cancel:window.wp.i18n.__("Cancel","bookiflex"),confirmNoShowMessage:window.wp.i18n.__("Confirm that the guest did not arrive and did not cancel the reservation.","bookiflex"),markAsNoShow:window.wp.i18n.__("Mark as No-Show","bookiflex"),markNoShow:window.wp.i18n.__("Mark No-Show","bookiflex"),confirmCompleteMessage:window.wp.i18n.__("Confirm that the guest has checked out and the stay is fully completed.","bookiflex"),markAsCompleted:window.wp.i18n.__("Mark as Completed","bookiflex"),complete:window.wp.i18n.__("Complete","bookiflex"),confirmReservationMessage:window.wp.i18n.__("Confirm that this reservation is accepted and guaranteed according to accommodation policy.","bookiflex"),confirmReservation:window.wp.i18n.__("Confirm Reservation","bookiflex"),confirm:window.wp.i18n.__("Confirm","bookiflex"),prolongMessage:window.wp.i18n.__("Extend the time given to the guest (+12h) for completing the payment and reactivate the reservation.","bookiflex"),prolongPaymentDeadline:window.wp.i18n.__("Prolong Payment Deadline","bookiflex"),extendDeadline:window.wp.i18n.__("Extend Deadline","bookiflex"),prolong:window.wp.i18n.__("Prolong","bookiflex"),inHouse:window.wp.i18n.__("In House","bookiflex"),noShow:window.wp.i18n.__("No Show","bookiflex"),cancellationReasonPlaceholder:window.wp.i18n.__("Enter cancellation reason (optional)","bookiflex")},d=e.ref(!1),u=e.ref(null),h=window.BookiFlex?.localeTimeZone||"+00:00",p=e.computed(()=>[Kt,Gt,Xt,Qt].includes(i.reservation.status)),m=e.computed(()=>[Kt].includes(i.reservation.status)),f=e.computed(()=>i.reservation.status===Xt),g=e.computed(()=>{const e=ro(h);return i.reservation.status===Qt&&e>=i.reservation.stay.checkInDate}),v=e.computed(()=>{const e=ro(h);return i.reservation.status===Qt&&e>=i.reservation.stay.checkInDate}),b=e.computed(()=>i.reservation.status===Jt),y=async e=>{u.value=e.status,d.value=!0;try{const t=await(async e=>{const t=`${window.wpApiSettings.root}bflex/v1/reservation/status/update`;try{return await Ht(t,{method:"POST",body:e})}catch(l){throw console.error("Failed to change status:",l),l}})(e);t&&(io(),a(window.wp.i18n.sprintf(c.statusChanged,e.status)),n("updated",{reservationId:i.reservation.id}),window.dispatchEvent(new CustomEvent("bflex:reservation:updated",{detail:{id:i.reservation.id}})))}catch(t){l(c.failedToChange,{duration:8e3}),console.error("Status change error:",t)}finally{d.value=!1,u.value=null}},w=async()=>{const e=await s(c.confirmCancelMessage,{title:c.cancelReservation,variant:"danger",confirmText:c.cancelReservation,cancelText:c.keepReservation,inputPlaceholder:c.cancellationReasonPlaceholder,inputValue:""});null!==e&&await y({id:i.reservation.id,status:Yt,reason:e||void 0})},k=async()=>{await r(c.confirmInHouseMessage,{title:c.markAsInHouse,variant:"primary",confirmText:c.checkIn,cancelText:c.cancel})&&await y({id:i.reservation.id,status:Jt})},_=async()=>{await r(c.confirmNoShowMessage,{title:c.markAsNoShow,variant:"danger",confirmText:c.markNoShow,cancelText:c.cancel})&&await y({id:i.reservation.id,status:Zt})},x=async()=>{await r(c.confirmCompleteMessage,{title:c.markAsCompleted,variant:"success",confirmText:c.complete,cancelText:c.cancel})&&await y({id:i.reservation.id,status:eo})},E=async()=>{await r(c.confirmReservationMessage,{title:c.confirmReservation,variant:"success",confirmText:c.confirm,cancelText:c.cancel})&&await y({id:i.reservation.id,status:Qt})},S=async()=>{await r(c.prolongMessage,{title:c.prolongPaymentDeadline,variant:"warning",confirmText:c.extendDeadline,cancelText:c.cancel})&&await y({id:i.reservation.id,status:Gt})};return(t,o)=>(e.openBlock(),e.createElementBlock("div",qc,[p.value?(e.openBlock(),e.createElementBlock("sl-button",{key:0,onClick:w,loading:u.value===e.unref(Yt),disabled:d.value,variant:"danger",size:"small",outline:""},e.toDisplayString(c.cancel),9,Hc)):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("sl-button",{key:1,onClick:S,loading:u.value===e.unref(Gt),disabled:d.value,variant:"warning",size:"small",outline:""},e.toDisplayString(c.prolong),9,Uc)):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("sl-button",{key:2,onClick:E,loading:u.value===e.unref(Qt),disabled:d.value,variant:"success",size:"small"},e.toDisplayString(c.confirm),9,Wc)):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("sl-button",{key:3,onClick:k,loading:u.value===e.unref(Jt),disabled:d.value,variant:"primary",size:"small"},e.toDisplayString(c.inHouse),9,jc)):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("sl-button",{key:4,onClick:_,loading:u.value===e.unref(Zt),disabled:d.value,variant:"danger",size:"small"},e.toDisplayString(c.noShow),9,Kc)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("sl-button",{key:5,onClick:x,loading:u.value===e.unref(eo),disabled:d.value,variant:"neutral",size:"small"},e.toDisplayString(c.complete),9,Gc)):e.createCommentVNode("",!0)]))}},Qc=["variant"],Yc={__name:"ReservationStatus",props:{status:{type:String,required:!0}},setup(t){const o=t,i={waitingForPayment:window.wp.i18n.__("Waiting for payment","bookiflex"),needConfirmation:window.wp.i18n.__("Need confirmation","bookiflex"),inHouse:window.wp.i18n.__("In house","bookiflex"),confirmed:window.wp.i18n.__("Confirmed","bookiflex"),completed:window.wp.i18n.__("Completed","bookiflex"),noShow:window.wp.i18n.__("No Show","bookiflex"),cancelled:window.wp.i18n.__("Cancelled","bookiflex"),overdue:window.wp.i18n.__("Overdue","bookiflex")},n=e.computed(()=>{switch(o.status){case Gt:return{label:i.waitingForPayment,variant:"warning"};case Kt:return{label:i.needConfirmation,variant:"primary"};case Jt:return{label:i.inHouse,variant:"primary"};case Qt:return{label:i.confirmed,variant:"success"};case eo:return{label:i.completed,variant:"neutral"};case Zt:return{label:i.noShow,variant:"danger"};case Yt:return{label:i.cancelled,variant:"danger"};case Xt:return{label:i.overdue,variant:"danger"};default:return null}});return(t,o)=>n.value?(e.openBlock(),e.createElementBlock("sl-badge",{key:0,variant:n.value.variant},e.toDisplayString(n.value.label),9,Qc)):e.createCommentVNode("",!0)}},Jc={key:0,class:"penalty-status__resolved"},Zc={class:"penalty-status__header"},ed={class:"penalty-status__details"},td={key:0},od={key:1},id={key:1,class:"penalty-status__pending"},nd={class:"penalty-status__header"},rd={class:"penalty-status__content"},sd={key:0,class:"penalty-status__description"},ad={class:"text-muted"},ld={key:0,class:"penalty-status__actions"},cd=["variant","loading"],dd={__name:"PenaltyStatus",props:{penalty:{type:Object,required:!0},prepaidAmount:{type:Number,default:0},currency:{type:String,default:"EUR"}},emits:["resolved"],setup(t,{emit:o}){const i=t,n=o,{prompt:r}=Ra(),{success:s,error:a}=Ia(),l={noActionRequired:window.wp.i18n.__("No action required","bookiflex"),noActionMessage:window.wp.i18n.__("No prepayment and no penalty. No further action required.","bookiflex"),penaltyToCollect:window.wp.i18n.__("Penalty to collect","bookiflex"),
/* translators: %s: penalty amount with currency symbol (e.g. $50.00) */
penaltyToCollectMessage:window.wp.i18n.__("No prepayment was taken. Penalty of %s is calculated, but must be collected manually if applicable.","bookiflex"),fullyCovered:window.wp.i18n.__("Fully covered","bookiflex"),fullyCoveredMessage:window.wp.i18n.__("The penalty equals the prepayment. The prepayment fully covers the penalty. No refund or additional action is required.","bookiflex"),refundRequired:window.wp.i18n.__("Refund required","bookiflex"),
/* translators: %1$s: prepayment amount, %2$s: penalty amount, %3$s: refund amount (all with currency symbol) */
refundRequiredMessage:window.wp.i18n.__("The prepayment (%1$s) is higher than the penalty (%2$s). Refund %3$s to the guest manually via your payment provider.","bookiflex"),additionalCollectionPossible:window.wp.i18n.__("Additional collection possible","bookiflex"),
/* translators: %1$s: prepayment amount, %2$s: penalty amount, %3$s: additional amount to collect (all with currency symbol) */
additionalCollectionMessage:window.wp.i18n.__("The prepayment (%1$s) is lower than the penalty (%2$s). The guest loses the prepayment. Additional amount %3$s can be collected manually if required.","bookiflex"),penaltyResolved:window.wp.i18n.__("Penalty Resolved","bookiflex"),amount:window.wp.i18n.__("Amount","bookiflex"),resolvedAt:window.wp.i18n.__("Resolved at","bookiflex"),comment:window.wp.i18n.__("Comment","bookiflex"),recommendation:window.wp.i18n.__("Recommendation","bookiflex"),markAsResolved:window.wp.i18n.__("Mark as resolved","bookiflex"),provideNotes:window.wp.i18n.__("Please provide any additional notes about resolving this penalty (optional):","bookiflex"),markPenaltyAsResolved:window.wp.i18n.__("Mark Penalty as Resolved","bookiflex"),confirm:window.wp.i18n.__("Confirm","bookiflex"),cancel:window.wp.i18n.__("Cancel","bookiflex"),enterComment:window.wp.i18n.__("Enter your comment here...","bookiflex"),penaltyMarkedResolved:window.wp.i18n.__("Penalty marked as resolved successfully","bookiflex"),failedToResolve:window.wp.i18n.__("Failed to resolve penalty. Please try again.","bookiflex")},c=e.ref(!1),d=e.computed(()=>i.penalty?.amount||0),u=e.computed(()=>"resolved"===i.penalty?.status),h=e.computed(()=>{const e=i.prepaidAmount,t=d.value;if(0===e&&0===t)return{type:"info",title:l.noActionRequired,message:l.noActionMessage,showButton:!1};if(0===e&&t>0)return{type:"warning",title:l.penaltyToCollect,message:window.wp.i18n.sprintf(l.penaltyToCollectMessage,no(t,i.currency)),showButton:!0};if(e===t)return{type:"success",title:l.fullyCovered,message:l.fullyCoveredMessage,showButton:!0};if(e>t){const o=e-t;return{type:"warning",title:l.refundRequired,message:window.wp.i18n.sprintf(l.refundRequiredMessage,no(e,i.currency),no(t,i.currency),no(o,i.currency)),showButton:!0}}if(e<t){const o=t-e;return{type:"warning",title:l.additionalCollectionPossible,message:window.wp.i18n.sprintf(l.additionalCollectionMessage,no(e,i.currency),no(t,i.currency),no(o,i.currency)),showButton:!0}}return{type:"info",title:"",message:"",showButton:!1}}),p=async()=>{const e=await r(l.provideNotes,{title:l.markPenaltyAsResolved,confirmText:l.confirm,cancelText:l.cancel,inputPlaceholder:l.enterComment,inputValue:""});if(null!==e){c.value=!0;try{await(async(e,t)=>{const o=`${window.wpApiSettings.root}bflex/v1/reservation/penalty/resolve`;try{return await Ht(o,{method:"POST",body:{id:e,comment:t}})}catch(a){throw console.error("Failed to resole a penalty:",a),a}})(i.penalty.id,e||null),s(l.penaltyMarkedResolved),n("resolved",{penaltyId:i.penalty.id,comment:e})}catch(t){a(l.failedToResolve),console.error("Error resolving penalty:",t)}finally{c.value=!1}}};return e.computed(()=>{if(u.value)return"success";const e=h.value.type;return"warning"===e?"warning":"success"===e?"primary":"default"}),(o,i)=>(e.openBlock(),e.createElementBlock("sl-card",{class:e.normalizeClass(["penalty-status",{"penalty-status--resolved":u.value,[`penalty-status--${h.value.type}`]:!u.value}])},[u.value?(e.openBlock(),e.createElementBlock("div",Jc,[e.createElementVNode("div",Zc,[i[0]||(i[0]=e.createElementVNode("sl-icon",{name:"check-circle-fill",class:"icon-success"},null,-1)),e.createElementVNode("h3",null,e.toDisplayString(l.penaltyResolved),1)]),e.createElementVNode("div",ed,[e.createElementVNode("p",null,[e.createElementVNode("strong",null,e.toDisplayString(l.amount)+":",1),e.createTextVNode(" "+e.toDisplayString(e.unref(no)(d.value,t.currency)),1)]),t.penalty.appliedAt?(e.openBlock(),e.createElementBlock("p",td,[e.createElementVNode("strong",null,e.toDisplayString(l.resolvedAt)+":",1),e.createTextVNode(" "+e.toDisplayString(new Date(t.penalty.appliedAt).toLocaleString()),1)])):e.createCommentVNode("",!0),t.penalty.comment?(e.openBlock(),e.createElementBlock("p",od,[e.createElementVNode("strong",null,e.toDisplayString(l.comment)+":",1),e.createTextVNode(" "+e.toDisplayString(t.penalty.comment),1)])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createElementBlock("div",id,[e.createElementVNode("div",nd,[e.createElementVNode("h3",null,e.toDisplayString(h.value.title||l.recommendation),1)]),e.createElementVNode("div",rd,[e.createElementVNode("p",null,e.toDisplayString(h.value.message),1),t.penalty.description?(e.openBlock(),e.createElementBlock("div",sd,[i[1]||(i[1]=e.createElementVNode("sl-divider",null,null,-1)),e.createElementVNode("p",ad,[e.createElementVNode("small",null,e.toDisplayString(t.penalty.description),1)])])):e.createCommentVNode("",!0)]),h.value.showButton?(e.openBlock(),e.createElementBlock("div",ld,[e.createElementVNode("sl-button",{size:"small",variant:0===d.value?"success":"primary",loading:c.value,onClick:p},[i[2]||(i[2]=e.createElementVNode("sl-icon",{slot:"prefix",name:"check2-square"},null,-1)),e.createTextVNode(" "+e.toDisplayString(l.markAsResolved),1)],8,cd)])):e.createCommentVNode("",!0)]))],2))}},ud=Ya(dd,[["__scopeId","data-v-2ad1652a"]]),hd={failedToLoad:window.wp.i18n.__("Failed to load calendar data","bookiflex"),syncConfirmMessage:window.wp.i18n.__("This will sync all prices and restrictions with the parent rate plan. Current settings will be overwritten.","bookiflex"),syncConfirmTitle:window.wp.i18n.__("Sync with parent rate plan","bookiflex"),sync:window.wp.i18n.__("Sync","bookiflex"),cancel:window.wp.i18n.__("Cancel","bookiflex"),syncing:window.wp.i18n.__("Syncing with parent rate plan...","bookiflex"),syncSuccess:window.wp.i18n.__("Successfully synced with parent rate plan","bookiflex"),syncFailed:window.wp.i18n.__("Failed to sync with parent rate plan","bookiflex"),retry:window.wp.i18n.__("Retry","bookiflex"),refreshing:window.wp.i18n.__("Refreshing calendar data...","bookiflex")};function pd(){const t=e.ref({ratePlan:null,accommodationTypes:[],dateUnits:{}}),o=e.ref(!1),i=e.ref(!1),{success:n,error:r,info:s}=Ia(),{confirm:a}=Ra(),l=async e=>{const{dateFrom:i,dateTo:n,ratePlan:s}=e;if(!i||!n||!s)return null;o.value=!0;try{t.value=await(async e=>{const t=`${window.wpApiSettings.root}bflex/v1/dateUnits/calendar`;try{return await Ht(t,{method:"POST",body:e})}catch(r){throw console.error("Failed to load reservation:",r),r}})({dateFrom:i,dateTo:n,ratePlan:s})}catch(a){return r(hd.failedToLoad,{duration:5e3}),console.error("Calendar load error:",a),null}finally{o.value=!1}},c=async(e,t,o)=>{if(!(await a(hd.syncConfirmMessage,{title:hd.syncConfirmTitle,variant:"warning",confirmText:hd.sync,cancelText:hd.cancel})))return!1;i.value=!0,s(hd.syncing,{duration:0,closable:!1});try{const i=await(async e=>{const t=`${window.wpApiSettings.root}bflex/v1/dateUnits/sync`;try{return await Ht(t,{method:"POST",body:e})}catch(r){throw console.error("Failed to synchronization:",r),r}})({ratePlan:e,accommodationType:t});if("ok"===i)return n(hd.syncSuccess,{title:o,duration:5e3}),!0;throw new Error(i?.message||"Sync failed")}catch(l){return r(hd.syncFailed,{duration:7e3,action:{label:hd.retry,handler:()=>c(e,t,o)}}),console.error("Sync error:",l),!1}finally{i.value=!1}},d=e.computed(()=>t.value.ratePlan),u=e.computed(()=>t.value.accommodationTypes||[]),h=e.computed(()=>t.value.accommodationTypes?.length>0);return{calendarData:t,ratePlanInfo:d,accommodationTypes:u,getAccommodationData:e=>t.value.dateUnits[e]||{},hasData:h,isLoading:o,isSyncing:i,loadCalendar:l,syncWithParent:c,reloadCalendar:async e=>(s(hd.refreshing,{duration:2e3}),await l(e))}}const md={class:"rate-plan-calendar__header"},fd={class:"rate-plan-calendar__header-wrapper"},gd={class:"dates-container"},vd={class:"dates-container__month-header"},bd={class:"dates-container__data"},yd=["title"],wd={style:{"font-size":"0.8em",padding:"0.5em"}},kd={__name:"CalendarHeader",props:{monthsRange:{type:String,default:""},dateRange:{type:Array,default:()=>[]}},setup(t){const o=e.inject("registerScrollElement",null),i=e.ref(null);return e.onMounted(()=>{o&&i.value&&o(i.value)}),(o,n)=>(e.openBlock(),e.createElementBlock("div",md,[e.createElementVNode("div",fd,[e.createElementVNode("div",gd,[e.createElementVNode("div",vd,[e.createElementVNode("strong",null,e.toDisplayString(t.monthsRange),1)]),e.createElementVNode("div",{ref_key:"scrollableContainer",ref:i,class:"scroll-container"},[n[1]||(n[1]=e.createElementVNode("div",{class:"dates-container__label"},null,-1)),e.createElementVNode("div",bd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.dateRange,t=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dates-container__data-item",{weekend:t.isWeekend}]),key:t.iso8601},[e.createElementVNode("div",{class:"day-cell",title:t.month},[e.createElementVNode("div",wd,[e.createTextVNode(e.toDisplayString(t.weekday),1),n[0]||(n[0]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(e.toDisplayString(t.day),1)])],8,yd)],2))),128))])],512)])])]))}};const _d={class:"rate-plan-calendar__body"},xd={class:"rate-plan-calendar__body-wrapper"},Ed={class:"rate-plan-calendar__actions"},Sd={class:"dates-container"},Cd={class:"dates-container__label"},Ad={class:"dates-container__data"},Td={class:"day-cell"},Nd=["onClick"],Pd={key:0,class:"day-cell__item restriction boolean"},Rd={key:1,class:"day-cell__item restriction"},Bd=["onClick"],Vd=["value","disabled","onKeydown","onBlur"],Dd={__name:"CalendarBody",props:{accommodationType:{type:Object,required:!0},dateUnits:{type:Object,default:()=>({})},dateRange:{type:Array,default:()=>[]},inheritRules:{type:Object,default:null},showRestrictions:{type:Boolean,default:!0},ratePlanId:{type:[Number,String],default:null}},emits:["action","cellUpdate"],setup(t,{emit:o}){const i=e.inject("additionalRestrictions",e.ref([])),n={editPrices:window.wp.i18n.__("Edit prices","bookiflex"),editRestrictions:window.wp.i18n.__("Edit restrictions","bookiflex"),syncWithParent:window.wp.i18n.__("Sync with parent","bookiflex"),stopSale:window.wp.i18n.__("StopSale","bookiflex")},r=t,s=o,{cancelEditing:a,editValue:l,isEditableDate:c,isEditing:d,isSaving:u,savePrice:h,startEditing:p,toggleStopSale:m}=function({props:t,onCellUpdate:o}){const{error:i}=Ia(),n=(new Date).toISOString().split("T")[0],r=e.ref(null),s=e.ref(""),a=e.ref(!1),l=()=>{r.value=null,s.value=""};return{isEditableDate:e=>e.iso8601>=n,isEditing:(e,t)=>r.value?.date===e.iso8601&&r.value?.capacityIndex===t,startEditing:(o,i,n)=>{if(a.value)return;const l=t.dateUnits?.[o.iso8601]?.price?.value?.[i.scenario]?.[i.variant];r.value={date:o.iso8601,capacityIndex:n},s.value=null!=l?String(l):"",e.nextTick(()=>{const e=document.querySelector(".inline-price-input");e&&(e.focus(),e.select())})},editValue:s,savePrice:async(e,n)=>{if(a.value)return;if(!r.value)return;const c=s.value.trim(),d=""===c?0:Math.round(100*parseFloat(c)),u=t.dateUnits?.[e.iso8601]?.price?.value?.[n.scenario]?.[n.variant];if(d!==u){a.value=!0;try{await jt({ratePlan:t.ratePlanId,accommodationType:t.accommodationType.id,dates:[{dateFrom:e.iso8601,dateTo:e.iso8601,mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!0,sun:!0}],prices:[{variant:n.variant,scenario:n.scenario,value:d,cancel:!1}]}),l(),o()}catch(da){i(da.message||"Failed to save price")}finally{a.value=!1}}else l()},cancelEditing:l,isSaving:a,toggleStopSale:async e=>{if(a.value)return;const n=t.dateUnits?.[e.iso8601]?.stopSale??!1;a.value=!0;try{await jt({ratePlan:t.ratePlanId,accommodationType:t.accommodationType.id,dates:[{dateFrom:e.iso8601,dateTo:e.iso8601,mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!0,sun:!0}],restrictions:{stopSale:!n}}),o()}catch(da){i(da.message||"Failed to update StopSale")}finally{a.value=!1}}}}({props:r,onCellUpdate:e=>s("cellUpdate",e)}),f=e.inject("registerScrollElement",null),g=e.ref(null),v=e.computed(()=>Object.keys(r.dateUnits).length>0),b=e=>{s("action",{actionType:e,accommodationType:r.accommodationType.id})};return e.onMounted(()=>{f&&g.value&&f(g.value)}),(o,r)=>(e.openBlock(),e.createElementBlock("div",_d,[e.createElementVNode("div",xd,[e.createElementVNode("div",Ed,[e.createElementVNode("h2",null,e.toDisplayString(t.accommodationType.name),1),e.createElementVNode("div",null,[t.accommodationType.isSync||v.value?(e.openBlock(),e.createElementBlock("sl-button",{key:0,size:"small",variant:"default",onClick:r[0]||(r[0]=e.withModifiers(e=>b("editPrices"),["stop"])),outline:""},e.toDisplayString(n.editPrices),1)):e.createCommentVNode("",!0),t.accommodationType.isSync||v.value?(e.openBlock(),e.createElementBlock("sl-button",{key:1,size:"small",variant:"default",onClick:r[1]||(r[1]=e.withModifiers(e=>b("editRestrictions"),["stop"])),outline:""},e.toDisplayString(n.editRestrictions),1)):e.createCommentVNode("",!0),t.accommodationType.isSync?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("sl-button",{key:2,size:"small",variant:"warning",onClick:r[2]||(r[2]=e.withModifiers(e=>b("syncDateUnits"),["stop"])),outline:""},e.toDisplayString(n.syncWithParent),1))])]),e.createElementVNode("div",Sd,[e.createElementVNode("div",{ref_key:"scrollableContainer",ref:g,class:"scroll-container"},[e.createElementVNode("div",Cd,[r[6]||(r[6]=e.createElementVNode("div",{class:"dates-container__label-item half"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dates-container__label-item",{inherited:t.inheritRules?.stopSale}])},e.toDisplayString(n.stopSale),3),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i),o=>(e.openBlock(),e.createElementBlock("div",{key:o.key,class:e.normalizeClass(["dates-container__label-item restriction",{inherited:t.inheritRules?.[o.key]}])},e.toDisplayString(o.label),3))),128)),r[7]||(r[7]=e.createElementVNode("div",{class:"dates-container__label-item half"},null,-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.accommodationType.capacities,(t,o)=>(e.openBlock(),e.createElementBlock("div",{key:o,class:"dates-container__label-item"},e.toDisplayString(t.name),1))),128))]),e.createElementVNode("div",Ad,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.dateRange,o=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dates-container__data-item",{weekend:o.isWeekend}]),key:o.iso8601},[e.createElementVNode("div",Td,[r[8]||(r[8]=e.createElementVNode("div",{class:"day-cell__item half"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["day-cell__item boolean",{editable:e.unref(c)(o)}]),onClick:t=>e.unref(c)(o)&&e.unref(m)(o)},[e.createElementVNode("span",{class:e.normalizeClass({active:t.dateUnits?.[o.iso8601]?.stopSale??!1})},"x",2)],10,Nd),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i),i=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i.key},["boolean"===i.type?(e.openBlock(),e.createElementBlock("div",Pd,[e.createElementVNode("span",{class:e.normalizeClass({active:t.dateUnits?.[o.iso8601]?.[i.key]??!1})},"x",2)])):(e.openBlock(),e.createElementBlock("div",Rd,e.toDisplayString(null===t.dateUnits?.[o.iso8601]?.[i.key]?"-":t.dateUnits?.[o.iso8601]?.[i.key]),1))],64))),128)),r[9]||(r[9]=e.createElementVNode("div",{class:"day-cell__item half"},null,-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.accommodationType.capacities,(i,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["day-cell__item",{editable:e.unref(c)(o)}]),key:n,onClick:t=>e.unref(c)(o)&&!e.unref(d)(o,n)&&e.unref(p)(o,i,n)},[e.unref(d)(o,n)?(e.openBlock(),e.createElementBlock("input",{key:0,value:e.unref(l),type:"text",inputmode:"decimal",class:"inline-price-input",disabled:e.unref(u),onInput:r[3]||(r[3]=e=>l.value=e.target.value.replace(/[^0-9]/g,".").replace(/\.(?=.*\.)/g,"")),onKeydown:[e.withKeys(e.withModifiers(t=>e.unref(h)(o,i),["prevent"]),["enter"]),r[4]||(r[4]=e.withKeys(e.withModifiers(t=>e.unref(a)(),["prevent"]),["escape"]))],onBlur:t=>e.unref(h)(o,i),onClick:r[5]||(r[5]=e.withModifiers(()=>{},["stop"]))},null,40,Vd)):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass({overridden:t.dateUnits?.[o.iso8601]?.price?.overridden,inherited:t.dateUnits?.[o.iso8601]?.price?.inherited})},e.toDisplayString(t.dateUnits?.[o.iso8601]?.price?.value?.[i.scenario]?.[i.variant]??"-"),3))],10,Bd))),128))])],2))),128))])],512)])])]))}},Ld={id:"rate-plan-calendar-app"},$d={class:"rate-plan-navigation"},Fd={class:"rate-plan-navigation__date-range"},Md=["value","placeholder"],Od=["value"],Id={value:"14"},zd={value:"30"},qd={value:"90"},Hd={label:"Navigation",style:{"margin-left":"0.5em"}},Ud=["value"],Wd={key:0,class:"rate-plan-calendar"},jd={key:1,class:"calendar-loading"},Kd={key:2,class:"calendar-empty"},Gd={type:"info",open:""},Xd={__name:"RatePlanCalendar",props:{ratePlanId:{type:[Number,String],default:null},additionalRestrictions:{type:Array,default:()=>[]},showRestrictionsToggle:{type:Boolean,default:!1}},setup(t){const o={periodChanged:window.wp.i18n.__("Period changed. Loading data...","bookiflex"),from:window.wp.i18n.__("From","bookiflex"),twoWeeks:window.wp.i18n.__("2 weeks","bookiflex"),oneMonth:window.wp.i18n.__("1 month","bookiflex"),threeMonths:window.wp.i18n.__("3 month","bookiflex"),showRestrictions:window.wp.i18n.__("Show restrictions","bookiflex"),loadingCalendar:window.wp.i18n.__("Loading calendar data...","bookiflex"),noData:window.wp.i18n.__("No data available. Please check the date range and rate plan.","bookiflex")},i=t,{navigateTo:n}=Ha(),{success:r,info:s}=Ia(),{ratePlanInfo:a,accommodationTypes:l,getAccommodationData:c,hasData:d,isLoading:u,loadCalendar:h,syncWithParent:p,reloadCalendar:m}=pd(),{registerScrollElement:f}=function(){const t=e.ref([]),o=e.ref(!1);let i=null;const n=e=>{o.value||(i&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{o.value=!0;const i=e.target,n=i.scrollLeft;t.value.forEach(e=>{e!==i&&(e.scrollLeft=n)}),setTimeout(()=>{o.value=!1},10)}))},r=()=>{i&&cancelAnimationFrame(i),t.value.forEach(e=>{e.removeEventListener("scroll",n)}),t.value=[]};return e.onUnmounted(r),{registerScrollElement:e=>{e&&!t.value.includes(e)&&(e.addEventListener("scroll",n,{passive:!0}),t.value.push(e))},unregisterScrollElement:e=>{if(!e)return;const o=t.value.indexOf(e);o>-1&&(e.removeEventListener("scroll",n),t.value.splice(o,1))},cleanup:r,scrollElements:t}}(),{dateFrom:g,dateTo:v,dateRange:b,navigateForward:y,navigateBackward:w,setPeriodLength:k}=function(){const t=e.ref((new Date).toISOString().split("T")[0]),o=e.ref(30),i=e.computed(()=>{const e=new Date(t.value);return e.setDate(e.getDate()+Number(o.value)-1),e.toISOString().split("T")[0]}),n=e.computed(()=>{const e=[];if(!t.value||!i.value)return e;const o=new Date(t.value),n=new Date(i.value),r=new Date(o),s=["January","February","March","April","May","June","July","August","September","October","November","December"],a=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];for(;r<=n;)e.push({iso8601:r.toISOString().split("T")[0],weekday:a[r.getDay()],day:r.getDate(),month:s[r.getMonth()],year:r.getFullYear(),isWeekend:0===r.getDay()||6===r.getDay()}),r.setDate(r.getDate()+1);return e}),r=e.computed(()=>{const e=n.value;if(!e.length)return"";const t=e[0].month,o=e[e.length-1].month,i=e[0].year,r=e[e.length-1].year;return t===o&&i===r?`${t} ${i}`:i===r?`${t} - ${o} ${i}`:`${t} ${i} - ${o} ${r}`});return{dateFrom:t,dateTo:i,periodLength:o,periodOptions:[{value:14,label:"2 weeks"},{value:30,label:"1 month"},{value:90,label:"3 months"}],dateRange:n,monthsRange:r,navigateForward:()=>{const e=new Date(i.value);e.setDate(e.getDate()+1),t.value=e.toISOString().split("T")[0]},navigateBackward:()=>{const e=new Date(t.value);e.setDate(e.getDate()-Number(o.value)),t.value=e.toISOString().split("T")[0]},navigateToToday:()=>{t.value=(new Date).toISOString().split("T")[0]},navigateToDate:e=>{e instanceof Date?t.value=e.toISOString().split("T")[0]:"string"==typeof e&&(t.value=e)},setPeriodLength:e=>{[14,30,90].includes(Number(e))&&(o.value=Number(e))}}}(),_=e.ref(i.ratePlanId),x=e.ref(!1),E=e.ref("30");e.provide("registerScrollElement",f),e.provide("syncScrollElements",f),e.provide("additionalRestrictions",e.computed(()=>i.additionalRestrictions)),e.provide("showRestrictionsToggle",i.showRestrictionsToggle);const S=e.computed(()=>{const e=[];return b.value.forEach(({month:t})=>{e.includes(t)||e.push(t)}),e.length>1?[e[0],e[e.length-1]]:[e[0]]}),C=e=>{"forward"===e?y():"back"===e&&w()},A=e=>{E.value=e.target.value,k(Number(e.target.value))},T=async()=>{_.value&&await h({dateFrom:g.value,dateTo:v.value,ratePlan:_.value})},N=async({actionType:e,accommodationType:t})=>{const o=l.value.find(e=>e.id===t);switch(e){case"editPrices":n({component:"EditPricesDialog",props:{accommodationTypes:l.value,activeAccommodationType:t,ratePlan:_.value,onUpdate:P}});break;case"editRestrictions":n({component:"EditRestrictionsDialog",props:{accommodationTypes:l.value,activeAccommodationType:t,ratePlan:_.value,onUpdate:P}});break;case"syncDateUnits":await p(_.value,t,o?.name)&&await T();break}},P=async e=>{"success"===e?.status&&await m({dateFrom:g.value,dateTo:v.value,ratePlan:_.value})};return e.onMounted(()=>{if(!_.value&&void 0!==window.pagenow&&"bflex-rate-plan"===window.pagenow){const e=document.getElementById("post_ID");e&&(_.value=Number(e.value))}_.value&&T()}),e.watch([g,v,_],()=>{_.value&&T()}),e.watch(E,()=>{s(o.periodChanged,{duration:2e3})}),(i,n)=>(e.openBlock(),e.createElementBlock("div",Ld,[e.createElementVNode("div",$d,[e.createElementVNode("div",Fd,[e.createElementVNode("sl-input",{type:"date",name:"dateFrom",value:e.unref(g),onSlChange:n[0]||(n[0]=e=>g.value=e.target.value),placeholder:o.from,size:"small"},null,40,Md),e.createElementVNode("sl-radio-group",{size:"small",name:"longPeriod",value:E.value,onSlChange:A,style:{"margin-left":"0.5em"}},[e.createElementVNode("sl-radio-button",Id,e.toDisplayString(o.twoWeeks),1),e.createElementVNode("sl-radio-button",zd,e.toDisplayString(o.oneMonth),1),e.createElementVNode("sl-radio-button",qd,e.toDisplayString(o.threeMonths),1)],40,Od),e.createElementVNode("sl-button-group",Hd,[e.createElementVNode("sl-button",{size:"small",onClick:n[1]||(n[1]=e.withModifiers(e=>C("back"),["stop"]))},[...n[5]||(n[5]=[e.createElementVNode("sl-icon",{name:"arrow-left",label:"Back"},null,-1)])]),e.createElementVNode("sl-button",{size:"small",onClick:n[2]||(n[2]=e.withModifiers(e=>C("forward"),["stop"]))},[...n[6]||(n[6]=[e.createElementVNode("sl-icon",{name:"arrow-right",label:"Forward"},null,-1)])])])]),t.showRestrictionsToggle?(e.openBlock(),e.createElementBlock("sl-switch",{key:0,value:x.value,onSlChange:n[3]||(n[3]=e=>x.value=!!e.target.checked),size:"small"},e.toDisplayString(o.showRestrictions),41,Ud)):e.createCommentVNode("",!0)]),e.unref(d)?(e.openBlock(),e.createElementBlock("div",Wd,[e.createVNode(kd,{"months-range":S.value.join(" - "),"date-range":e.unref(b)},null,8,["months-range","date-range"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l),t=>(e.openBlock(),e.createBlock(Dd,{key:t.id,onAction:N,onCellUpdate:n[4]||(n[4]=e=>P({status:"success"})),"accommodation-type":t,"date-units":e.unref(c)(t.id),"date-range":e.unref(b),"inherit-rules":e.unref(a)?.inheritRules,"rate-plan-id":_.value,class:e.normalizeClass({"restriction-visible-hide":!x.value})},null,8,["accommodation-type","date-units","date-range","inherit-rules","rate-plan-id","class"]))),128))])):e.unref(u)?(e.openBlock(),e.createElementBlock("div",jd,[n[7]||(n[7]=e.createElementVNode("sl-spinner",null,null,-1)),e.createElementVNode("p",null,e.toDisplayString(o.loadingCalendar),1)])):(e.openBlock(),e.createElementBlock("div",Kd,[e.createElementVNode("sl-alert",Gd,[n[8]||(n[8]=e.createElementVNode("sl-icon",{slot:"icon",name:"info-circle"},null,-1)),e.createTextVNode(" "+e.toDisplayString(o.noData),1)])]))]))}},Qd={class:"date-range__container"},Yd={class:"date-range__items"},Jd={class:"date-range__dates"},Zd=["value","onSlChange"],eu=["value","min","onSlChange"],tu={class:"date-range__days"},ou=["checked","onInput"],iu=["checked","onInput"],nu=["checked","onInput"],ru=["checked","onInput"],su=["checked","onInput"],au=["checked","onInput"],lu=["checked","onInput"],cu={style:{display:"flex","justify-content":"end"}},du=["disabled"],uu=["disabled"],hu={__name:"DateRange",emits:["input"],setup(t,{emit:o}){const i={mo:window.wp.i18n.__("Mo","bookiflex"),tu:window.wp.i18n.__("Tu","bookiflex"),we:window.wp.i18n.__("We","bookiflex"),th:window.wp.i18n.__("Th","bookiflex"),fr:window.wp.i18n.__("Fr","bookiflex"),sa:window.wp.i18n.__("Sa","bookiflex"),su:window.wp.i18n.__("Su","bookiflex"),removePeriod:window.wp.i18n.__("Remove period","bookiflex"),addPeriod:window.wp.i18n.__("Add period","bookiflex")},n=o,r=e.ref([]),s=()=>{const e=0===r.value.length?(new Date).toISOString().split("T")[0]:"";r.value.push({dateFrom:e,dateTo:"",mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!0,sun:!0})},a=()=>{r.value.length>1&&r.value.pop()},l=e.computed(()=>r.value.length>=5||r.value.some(e=>!e.dateFrom||!e.dateTo)),c=e.computed(()=>1===r.value.length);return e.watch(r,()=>{n("input",r.value)},{deep:!0}),e.onMounted(()=>{s()}),(t,o)=>(e.openBlock(),e.createElementBlock("div",Qd,[e.createElementVNode("div",Yd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(t,n)=>(e.openBlock(),e.createElementBlock("div",{class:"date-range__item",key:n},[e.createElementVNode("div",Jd,[e.createElementVNode("sl-input",{value:t.dateFrom,onSlChange:e=>t.dateFrom=e.target.value,type:"date","value-as-date":"",required:""},null,40,Zd),o[0]||(o[0]=e.createElementVNode("div",{class:"date-range__separator"},"-",-1)),e.createElementVNode("sl-input",{value:t.dateTo,min:t.dateFrom,onSlChange:e=>t.dateTo=e.target.value,type:"date","value-as-date":"",required:""},null,40,eu)]),e.createElementVNode("div",tu,[e.createElementVNode("sl-checkbox",{size:"small",checked:t.mon,onInput:e=>t.mon=e.target.checked},e.toDisplayString(i.mo),41,ou),e.createElementVNode("sl-checkbox",{size:"small",checked:t.tue,onInput:e=>t.tue=e.target.checked},e.toDisplayString(i.tu),41,iu),e.createElementVNode("sl-checkbox",{size:"small",checked:t.wed,onInput:e=>t.wed=e.target.checked},e.toDisplayString(i.we),41,nu),e.createElementVNode("sl-checkbox",{size:"small",checked:t.thu,onInput:e=>t.thu=e.target.checked},e.toDisplayString(i.th),41,ru),e.createElementVNode("sl-checkbox",{size:"small",checked:t.fri,onInput:e=>t.fri=e.target.checked},e.toDisplayString(i.fr),41,su),e.createElementVNode("sl-checkbox",{size:"small",checked:t.sat,onInput:e=>t.sat=e.target.checked},e.toDisplayString(i.sa),41,au),e.createElementVNode("sl-checkbox",{size:"small",checked:t.sun,onInput:e=>t.sun=e.target.checked},e.toDisplayString(i.su),41,lu)])]))),128))]),e.createElementVNode("div",cu,[e.createElementVNode("sl-button",{id:"remove-period",onClick:e.withModifiers(a,["stop"]),variant:"text",size:"medium",disabled:c.value},e.toDisplayString(i.removePeriod),9,du),e.createElementVNode("sl-button",{id:"add-period",onClick:e.withModifiers(s,["stop"]),variant:"text",size:"medium",disabled:l.value},e.toDisplayString(i.addPeriod),9,uu)])]))}},pu=["value","placeholder","disabled"],mu={slot:"prefix"},fu={__name:"CurrencyInput",props:{modelValue:{type:[Number,String],default:0,normalize:e=>{if("string"==typeof e){const t=parseFloat(e.replace(/[^0-9.-]+/g,""));return isNaN(t)?0:Math.round(100*t)}return Math.round(100*e)}},currencySymbol:{type:String,default:"EUR"},placeholder:{type:String,default:"Enter amount"},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:o}){const i=t,n=o,r=e.ref((i.modelValue/100).toFixed(2).replace(".",""));e.watch(()=>i.modelValue,e=>{r.value=(e/100).toFixed(2).replace(".","")});const s=e=>{const t=e.replace(/[^\d]/g,"");return`${t.slice(0,-2)||"0"}.${t.slice(-2).padStart(2,"0")}`},a=e=>{const t=e.target.value.replace(/[^\d]/g,"");r.value=t;const o=parseInt(t||"0",10);n("update:modelValue",o)},l=(e,t="en-US")=>{try{const o=new Intl.NumberFormat(t,{style:"currency",currency:e,minimumFractionDigits:0,maximumFractionDigits:0}),i=o.formatToParts(0).find(e=>"currency"===e.type);return i?i.value:null}catch(o){return console.error(`Error getting currency symbol for code "${e}":`,o),null}};return(o,i)=>(e.openBlock(),e.createElementBlock("sl-input",{value:s(r.value),onInput:a,type:"text",placeholder:t.placeholder,disabled:t.disabled},[e.createElementVNode("div",mu,e.toDisplayString(l(t.currencySymbol)),1)],40,pu))}},gu={class:"form-container"};const vu=Ya({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("div",gu,[e.renderSlot(t.$slots,"default")])}]]),bu={class:"form-section"},yu={class:"section-title"},wu=["value"],ku={class:"form-section"},_u={class:"section-title"},xu={class:"form-section"},Eu={class:"section-title"},Su={class:"price-controls"},Cu=["onUpdate:modelValue","title","checked","value","onSlChange"],Au=["disabled","checked","value","onSlChange"],Tu={slot:"footer"},Nu={class:"drawer-footer"},Pu=["loading","disabled"],Ru={__name:"EditPricesDialog",props:{accommodationTypes:{type:Array,default:()=>[]},ratePlan:{type:Number,required:!0},activeAccommodationType:{type:Number,required:!0},onUpdate:{type:Function,default:null}},emits:["close","back"],setup(t,{emit:o}){const i={updatePrices:window.wp.i18n.__("Update prices","bookiflex"),accommodationType:window.wp.i18n.__("Rental unit","bookiflex"),onDates:window.wp.i18n.__("On dates","bookiflex"),applyPrices:window.wp.i18n.__("Apply prices","bookiflex"),edit:window.wp.i18n.__("Edit","bookiflex"),editThisPrice:window.wp.i18n.__("Edit this price","bookiflex"),enterPrice:window.wp.i18n.__("Enter price","bookiflex"),removePrice:window.wp.i18n.__("Remove price","bookiflex"),cancel:window.wp.i18n.__("Cancel","bookiflex"),applyChanges:window.wp.i18n.__("Apply changes","bookiflex"),pleaseSelectDates:window.wp.i18n.__("Please select dates and at least one price to update","bookiflex"),pricesUpdated:window.wp.i18n.__("Prices updated successfully","bookiflex"),failedToUpdate:window.wp.i18n.__("Failed to update prices","bookiflex")},n=t,r=o,{success:s,error:a,info:l}=Ia(),c=e.ref(n.activeAccommodationType.toString()),d=e.ref([]),u=e.ref([]),h=e.ref(!1),p=e.computed(()=>n.accommodationTypes.find(e=>e.id===+c.value)),m=e.computed(()=>({ratePlan:n.ratePlan,accommodationType:p.value?.id,dates:d.value.filter(e=>e.dateFrom&&e.dateTo),prices:u.value.filter(e=>e.active).map(e=>({variant:e.variant,scenario:e.scenario,value:+e.value,cancel:!!e.cancel}))})),f=e.computed(()=>m.value.dates.length>0&&m.value.prices.length>0);e.watchEffect(()=>{c.value=n.activeAccommodationType.toString()}),e.watch(p,e=>{e&&(u.value=[],e.capacities.forEach(e=>{u.value.push({active:!1,name:e.name,variant:e.variant,scenario:e.scenario,value:"",cancel:!1})}))},{immediate:!0});const g=async()=>{if(f.value){h.value=!0;try{const e=await jt(m.value);if("ok"!==e)throw new Error(e?.message||"Update failed");s(i.pricesUpdated,{duration:3e3}),n.onUpdate&&n.onUpdate({status:"success"}),r("close")}catch(e){a(i.failedToUpdate,{duration:5e3}),n.onUpdate&&n.onUpdate({status:"fail",message:e.message}),console.error("Price update error:",e)}finally{h.value=!1}}else a(i.pleaseSelectDates)},v=()=>{r("close")};return(o,n)=>(e.openBlock(),e.createBlock(Qa,{label:i.updatePrices,"show-back":!1,onClose:v},{footer:e.withCtx(()=>[e.createElementVNode("div",Tu,[n[2]||(n[2]=e.createElementVNode("sl-divider",null,null,-1)),e.createElementVNode("div",Nu,[e.createElementVNode("sl-button",{variant:"default",onClick:v},e.toDisplayString(i.cancel),1),e.createElementVNode("sl-button",{variant:"primary",loading:h.value,disabled:!f.value,onClick:g},e.toDisplayString(i.applyChanges),9,Pu)])])]),default:e.withCtx(()=>[e.createVNode(vu,null,{default:e.withCtx(()=>[e.createElementVNode("form",{onSubmit:e.withModifiers(g,["prevent"]),class:"edit-prices-form"},[e.createElementVNode("div",bu,[e.createElementVNode("div",yu,e.toDisplayString(i.accommodationType),1),e.withDirectives(e.createElementVNode("sl-select",{"onUpdate:modelValue":n[0]||(n[0]=e=>c.value=e),required:""},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.accommodationTypes,t=>(e.openBlock(),e.createElementBlock("sl-option",{key:t.id,value:t.id.toString()},e.toDisplayString(t.name),9,wu))),128))],512),[[e.vModelText,c.value]])]),e.createElementVNode("div",ku,[e.createElementVNode("div",_u,e.toDisplayString(i.onDates),1),e.createVNode(hu,{onInput:n[1]||(n[1]=e=>d.value=e)})]),e.createElementVNode("div",xu,[e.createElementVNode("div",Eu,e.toDisplayString(i.applyPrices),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,t=>(e.openBlock(),e.createElementBlock("fieldset",{key:`${t.scenario}-${t.variant}`},[e.createElementVNode("legend",null,e.toDisplayString(t.name),1),e.createElementVNode("div",Su,[e.withDirectives(e.createElementVNode("sl-switch",{"onUpdate:modelValue":e=>t.active=e,size:"small",title:i.editThisPrice,checked:t.active,value:t.active,onSlChange:e=>t.active=!!e.target.checked},e.toDisplayString(i.edit),41,Cu),[[e.vModelText,t.active]]),e.createVNode(fu,{modelValue:t.value,"onUpdate:modelValue":e=>t.value=e,disabled:!t.active||t.cancel,placeholder:i.enterPrice,style:{"max-width":"150px"}},null,8,["modelValue","onUpdate:modelValue","disabled","placeholder"]),e.createElementVNode("sl-checkbox",{size:"small",disabled:!t.active,checked:t.cancel,value:t.cancel,onSlChange:e=>t.cancel=!!e.target.checked},e.toDisplayString(i.removePrice),41,Au)])]))),128))])],32)]),_:1})]),_:1},8,["label"]))}},Bu=Ya(Ru,[["__scopeId","data-v-e66770ea"]]),Vu={class:"form-section"},Du={class:"section-title"},Lu=["value"],$u={class:"form-section"},Fu={class:"section-title"},Mu={class:"form-section"},Ou={class:"restriction-controls"},Iu=["value","checked","onSlChange"],zu=["value","onSlChange"],qu=["disabled"],Hu=["disabled"],Uu=["value","onSlChange","min","max","disabled"],Wu={slot:"suffix"},ju=["disabled","value","checked","onSlChange"],Ku={slot:"footer"},Gu={class:"drawer-footer"},Xu={key:0,class:"footer-hint"},Qu={class:"footer-actions"},Yu=["loading","disabled"],Ju={__name:"EditRestrictionsDialog",props:{accommodationTypes:{type:Array,default:()=>[]},ratePlan:{type:Number,required:!0},activeAccommodationType:{type:Number,required:!0},onUpdate:{type:Function,default:null}},emits:["close","back"],setup(t,{emit:o}){const i={updateRestrictions:window.wp.i18n.__("Update restrictions","bookiflex"),accommodationType:window.wp.i18n.__("Rental unit","bookiflex"),onDates:window.wp.i18n.__("On dates","bookiflex"),bookingRestrictions:window.wp.i18n.__("Booking restrictions","bookiflex"),stopSale:window.wp.i18n.__("StopSale","bookiflex"),minLengthOfStay:window.wp.i18n.__("Minimum Length of Stay","bookiflex"),maxLengthOfStay:window.wp.i18n.__("Maximum Length of Stay","bookiflex"),arrivalRestrictions:window.wp.i18n.__("Arrival restrictions","bookiflex"),minLosOnArrival:window.wp.i18n.__("Min LoS on Arrival","bookiflex"),maxLosOnArrival:window.wp.i18n.__("Max LoS on Arrival","bookiflex"),advanceBooking:window.wp.i18n.__("Advance booking","bookiflex"),minAdvanceBooking:window.wp.i18n.__("Min Advance Booking","bookiflex"),maxAdvanceBooking:window.wp.i18n.__("Max Advance Booking","bookiflex"),arrivalDeparture:window.wp.i18n.__("Arrival/Departure","bookiflex"),closedToArrival:window.wp.i18n.__("Closed to Arrival (CTA)","bookiflex"),closedToDeparture:window.wp.i18n.__("Closed to Departure (CTD)","bookiflex"),apply:window.wp.i18n.__("Apply","bookiflex"),set:window.wp.i18n.__("Set","bookiflex"),unset:window.wp.i18n.__("Unset","bookiflex"),days:window.wp.i18n.__("days","bookiflex"),removeRestriction:window.wp.i18n.__("Remove restriction","bookiflex"),activeRestrictions:window.wp.i18n.__("Active restrictions will be applied to selected dates","bookiflex"),cancel:window.wp.i18n.__("Cancel","bookiflex"),applyChanges:window.wp.i18n.__("Apply changes","bookiflex"),pleaseSelectDates:window.wp.i18n.__("Please select dates and at least one restriction to update","bookiflex"),restrictionsUpdated:window.wp.i18n.__("Restrictions updated successfully","bookiflex"),failedToUpdate:window.wp.i18n.__("Failed to update restrictions","bookiflex")},n=t,r=o,{success:s,error:a,info:l}=Ia(),c=e.ref(n.activeAccommodationType.toString()),d=e.ref([]),u=e.ref(!1),h=e.ref({stopSale:{active:!1,value:"1"},minLos:{active:!1,value:"",cancel:!1},maxLos:{active:!1,value:"",cancel:!1},minLosArrival:{active:!1,value:"",cancel:!1},maxLosArrival:{active:!1,value:"",cancel:!1},minAdvBooking:{active:!1,value:"",cancel:!1},maxAdvBooking:{active:!1,value:"",cancel:!1},cta:{active:!1,value:"1"},ctd:{active:!1,value:"1"}}),p=e.computed(()=>n.accommodationTypes.find(e=>e.id===+c.value)),m=e.computed(()=>({ratePlan:n.ratePlan,accommodationType:p.value?.id,dates:d.value.filter(e=>e.dateFrom&&e.dateTo),restrictions:Object.keys(h.value).map(e=>({name:e,active:h.value[e].active,value:h.value[e].value,cancel:h.value[e].cancel})).filter(e=>e.active).reduce((e,t)=>(e[t.name]=t.cancel?null:+t.value,e),{})})),f=e.computed(()=>m.value.dates.length>0&&Object.keys(m.value.restrictions).length>0),g=e.computed(()=>Object.values(h.value).some(e=>e.active));e.watchEffect(()=>{c.value=n.activeAccommodationType.toString()});const v=async()=>{if(f.value){u.value=!0;try{const e=await jt(m.value);if("ok"!==e)throw new Error(e?.message||"Update failed");s(i.restrictionsUpdated,{duration:3e3}),n.onUpdate&&n.onUpdate({status:"success"}),r("close")}catch(e){a(i.failedToUpdate,{duration:5e3}),n.onUpdate&&n.onUpdate({status:"fail",message:e.message}),console.error("Restrictions update error:",e)}finally{u.value=!1}}else a(i.pleaseSelectDates)},b=()=>{r("close")},y=[{title:i.bookingRestrictions,items:[{key:"stopSale",label:i.stopSale,type:"toggle"}]}];return(o,n)=>(e.openBlock(),e.createBlock(e.unref(Qa),{label:i.updateRestrictions,"show-back":!1,onClose:b},{footer:e.withCtx(()=>[e.createElementVNode("div",Ku,[n[3]||(n[3]=e.createElementVNode("sl-divider",null,null,-1)),e.createElementVNode("div",Gu,[g.value?(e.openBlock(),e.createElementBlock("div",Xu,[n[2]||(n[2]=e.createElementVNode("sl-icon",{name:"info-circle"},null,-1)),e.createTextVNode(" "+e.toDisplayString(i.activeRestrictions),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",Qu,[e.createElementVNode("sl-button",{variant:"default",onClick:b},e.toDisplayString(i.cancel),1),e.createElementVNode("sl-button",{variant:"primary",loading:u.value,disabled:!f.value,onClick:v},e.toDisplayString(i.applyChanges),9,Yu)])])])]),default:e.withCtx(()=>[e.createVNode(e.unref(vu),null,{default:e.withCtx(()=>[e.createElementVNode("form",{onSubmit:e.withModifiers(v,["prevent"]),class:"edit-restrictions-form"},[e.createElementVNode("div",Vu,[e.createElementVNode("div",Du,e.toDisplayString(i.accommodationType),1),e.withDirectives(e.createElementVNode("sl-select",{"onUpdate:modelValue":n[0]||(n[0]=e=>c.value=e),required:""},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.accommodationTypes,t=>(e.openBlock(),e.createElementBlock("sl-option",{key:t.id,value:t.id.toString()},e.toDisplayString(t.name),9,Lu))),128))],512),[[e.vModelText,c.value]])]),e.createElementVNode("div",$u,[e.createElementVNode("div",Fu,e.toDisplayString(i.onDates),1),e.createVNode(e.unref(hu),{onInput:n[1]||(n[1]=e=>d.value=e)})]),e.createElementVNode("div",Mu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(y,t=>e.createElementVNode("div",{key:t.title,class:"restriction-group"},[e.createElementVNode("h4",null,e.toDisplayString(t.title),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,t=>(e.openBlock(),e.createElementBlock("fieldset",{key:t.key},[e.createElementVNode("legend",null,e.toDisplayString(t.label),1),e.createElementVNode("div",Ou,[e.createElementVNode("sl-switch",{size:"small",value:h.value[t.key].active,checked:h.value[t.key].active,onSlChange:e=>h.value[t.key].active=!!e.target.checked},e.toDisplayString(i.apply),41,Iu),"toggle"===t.type?(e.openBlock(),e.createElementBlock("sl-radio-group",{key:0,size:"small",value:h.value[t.key].value,onSlChange:e=>h.value[t.key].value=e.target.value},[e.createElementVNode("sl-radio-button",{value:"1",disabled:!h.value[t.key].active},e.toDisplayString(i.set),9,qu),e.createElementVNode("sl-radio-button",{value:"0",disabled:!h.value[t.key].active},e.toDisplayString(i.unset),9,Hu)],40,zu)):"number"===t.type?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("sl-input",{value:h.value[t.key].value,onSlChange:e=>h.value[t.key].value=e.target.value,type:"number",min:t.min,max:t.max,disabled:!h.value[t.key].active||h.value[t.key].cancel,size:"small",style:{"max-width":"100px"}},[e.createElementVNode("span",Wu,e.toDisplayString(i.days),1)],40,Uu),e.createElementVNode("sl-checkbox",{size:"small",disabled:!h.value[t.key].active,value:h.value[t.key].cancel,checked:h.value[t.key].cancel,onSlChange:e=>h.value[t.key].cancel=!!e.target.checked},e.toDisplayString(i.removeRestriction),41,ju)],64)):e.createCommentVNode("",!0)])]))),128))])),64))])],32)]),_:1})]),_:1},8,["label"]))}},Zu=Ya(Ju,[["__scopeId","data-v-061188f9"]]),eh={__name:"NotificationLogApp",setup(t){const o=Ra(),i=Ia(),n=e=>{const t=e.target.closest('[data-action="resend-notification"]');if(t)return e.preventDefault(),e.stopPropagation(),void(async e=>{if(await o.confirm(window.wp.i18n.__("Resend this notification?","bookiflex"),{title:window.wp.i18n.__("Resend Notification","bookiflex"),variant:"warning",confirmText:window.wp.i18n.__("Resend","bookiflex"),cancelText:window.wp.i18n.__("Cancel","bookiflex")}))try{const t=`${window.wpApiSettings.root}bflex/v1/notification-log/${encodeURIComponent(e)}/resend`,o=await fetch(t,{method:"POST",headers:{"X-WP-Nonce":window.BookiFlex.nonce,"Content-Type":"application/json"},credentials:"include"}),n=await o.json();if(o.ok&&"success"===n.status)i.success(window.wp.i18n.__("Notification queued for resend.","bookiflex")),window.Turbo?window.Turbo.visit(window.location.href,{action:"replace"}):window.location.reload();else{const e=n.message||window.wp.i18n.__("Failed to resend notification.","bookiflex");i.error(e)}}catch{i.error(window.wp.i18n.__("Failed to resend notification.","bookiflex"))}})(t.dataset.sid);const n=e.target.closest('[data-action="preview-notification"]');n&&(e.preventDefault(),e.stopPropagation(),(async e=>{try{const t=`${window.wpApiSettings.root}bflex/v1/notification-log/${encodeURIComponent(e)}/preview`,o=await fetch(t,{headers:{"X-WP-Nonce":window.BookiFlex.nonce},credentials:"include"});if(!o.ok){const e=await o.json().catch(()=>({}));return void i.error(e.message||window.wp.i18n.__("Failed to load notification preview.","bookiflex"))}const n=await o.text(),r=new Blob([n],{type:"text/html"}),s=URL.createObjectURL(r);window.open(s,"_blank")}catch{i.error(window.wp.i18n.__("Failed to load notification preview.","bookiflex"))}})(n.dataset.sid))};return e.onMounted(()=>{document.body.addEventListener("click",n)}),e.onUnmounted(()=>{document.body.removeEventListener("click",n)}),(e,t)=>null}},th={style:{display:"flex","align-items":"center","justify-content":"center",gap:"5px"}},oh={class:"section"},ih={class:"section-title"},nh={class:"payment-details-info"},rh={class:"info-item"},sh={class:"info-label"},ah={class:"info-value"},lh={class:"info-item"},ch={class:"info-label"},dh={class:"info-value"},uh={class:"info-item"},hh={class:"info-label"},ph={class:"info-value"},mh={class:"info-item"},fh={class:"info-label"},gh={class:"info-value"},vh={key:0,class:"section"},bh={class:"section-title"},yh={class:"allocation-content"},wh={class:"allocation-header"},kh={class:"allocation-info"},_h={class:"allocation-amount"},xh={class:"allocation-source"},Eh={key:1,class:"section"},Sh={class:"section-title"},Ch={class:"card-block"},Ah={class:"bg--grey"},Th={style:{overflow:"auto"}},Nh={key:1,class:"loading-state"},Ph={key:2,class:"error-state"},Rh={type:"danger",open:""},Bh={__name:"PaymentDetails",props:{paymentId:{type:[String,Number],required:!0}},emits:["close","back"],setup(t,{emit:o}){const i={paymentDetails:window.wp.i18n.__("Payment details","bookiflex"),generalInformation:window.wp.i18n.__("General information","bookiflex"),number:window.wp.i18n.__("Number","bookiflex"),createdAt:window.wp.i18n.__("Created at","bookiflex"),amount:window.wp.i18n.__("Amount","bookiflex"),gatewayName:window.wp.i18n.__("Gateway name","bookiflex"),allocations:window.wp.i18n.__("Allocations","bookiflex"),paymentGatewayResponse:window.wp.i18n.__("Payment gateway response","bookiflex"),loadingPaymentDetails:window.wp.i18n.__("Loading payment details...","bookiflex"),errorLoadingPayment:window.wp.i18n.__("Error loading payment","bookiflex")},n=t,r=o,{payment:s,isLoading:a,error:l,load:c,reload:d,getRelatedReservation:u,hasAllocations:h,hasGatewayDetails:p}=Wa(),m=async()=>{await d(),io()},f=()=>{r("close")},g=()=>{r("back")};return e.onMounted(async()=>{await c(n.paymentId)}),(t,o)=>(e.openBlock(),e.createBlock(e.unref(Qa),{"auto-show":!0,"show-back":!0,onClose:f,onBack:g},{label:e.withCtx(()=>[e.createElementVNode("div",th,[e.createTextVNode(e.toDisplayString(i.paymentDetails)+" ",1),e.unref(s)?(e.openBlock(),e.createBlock(e.unref(vl),{key:0,status:e.unref(s).status},null,8,["status"])):e.createCommentVNode("",!0)])]),default:e.withCtx(()=>[e.unref(s)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(Gl),{customer:e.unref(s).client},null,8,["customer"]),e.createElementVNode("div",oh,[e.createElementVNode("div",ih,e.toDisplayString(i.generalInformation),1),e.createElementVNode("div",nh,[e.createElementVNode("div",rh,[e.createElementVNode("div",sh,e.toDisplayString(i.number),1),e.createElementVNode("div",ah,e.toDisplayString(e.unref(s).number),1)]),e.createElementVNode("div",lh,[e.createElementVNode("div",ch,e.toDisplayString(i.createdAt),1),e.createElementVNode("div",dh,e.toDisplayString(e.unref(s).createdAt),1)]),e.createElementVNode("div",uh,[e.createElementVNode("div",hh,e.toDisplayString(i.amount),1),e.createElementVNode("div",ph,e.toDisplayString(e.unref(no)(e.unref(s).amount,e.unref(s).currency)),1)]),e.createElementVNode("div",mh,[e.createElementVNode("div",fh,e.toDisplayString(i.gatewayName),1),e.createElementVNode("div",gh,e.toDisplayString(e.unref(s).gatewayName),1)])]),e.createVNode(e.unref(Al),{payment:e.unref(s),reservation:e.unref(u),onUpdated:m},null,8,["payment","reservation"])]),e.unref(h)?(e.openBlock(),e.createElementBlock("div",vh,[e.createElementVNode("div",bh,e.toDisplayString(i.allocations),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s).allocations,(t,o)=>(e.openBlock(),e.createElementBlock("sl-card",{class:"allocation-item",key:o},[e.createElementVNode("div",yh,[e.createElementVNode("div",wh,[e.createElementVNode("div",kh,[e.createElementVNode("div",_h,e.toDisplayString(e.unref(no)(t.amount,e.unref(s).currency)),1),e.createElementVNode("div",xh,e.toDisplayString(t.reservation.number),1)]),e.createVNode(e.unref(Yc),{status:t.reservation.status},null,8,["status"])])])]))),128))])):e.createCommentVNode("",!0),e.unref(p)?(e.openBlock(),e.createElementBlock("div",Eh,[e.createElementVNode("div",Sh,e.toDisplayString(i.paymentGatewayResponse),1),e.createElementVNode("div",Ch,[e.createElementVNode("section",Ah,[e.createElementVNode("pre",Th,e.toDisplayString(JSON.stringify(e.unref(s).details,null,2)),1)])])])):e.createCommentVNode("",!0)],64)):e.unref(a)?(e.openBlock(),e.createElementBlock("div",Nh,[o[0]||(o[0]=e.createElementVNode("sl-spinner",null,null,-1)),e.createElementVNode("p",null,e.toDisplayString(i.loadingPaymentDetails),1)])):e.unref(l)?(e.openBlock(),e.createElementBlock("div",Ph,[e.createElementVNode("sl-alert",Rh,[o[1]||(o[1]=e.createElementVNode("sl-icon",{slot:"icon",name:"exclamation-octagon"},null,-1)),e.createElementVNode("strong",null,e.toDisplayString(i.errorLoadingPayment),1),o[2]||(o[2]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(l).message),1)])])):e.createCommentVNode("",!0)]),_:1}))}},Vh={style:{display:"flex","align-items":"center","justify-content":"center",gap:"5px"}},Dh={key:0,class:"guest-request"},Lh={class:"info-item"},$h={class:"info-label"},Fh={class:"info-value"},Mh={class:"section payment-section"},Oh={class:"section-title"},Ih={key:0},zh={key:1,class:"loading-state"},qh={key:2,class:"error-state"},Hh={type:"danger",open:""},Uh={__name:"ReservationDetails",props:{reservationId:{type:[String,Number],required:!0}},emits:["close"],setup(t,{emit:o}){const i={loading:window.wp.i18n.__("Loading...","bookiflex"),specialRequest:window.wp.i18n.__("Special request","bookiflex"),payments:window.wp.i18n.__("Payments","bookiflex"),noPaymentsFound:window.wp.i18n.__("No payments found.","bookiflex"),loadingReservationDetails:window.wp.i18n.__("Loading reservation details...","bookiflex"),errorLoadingReservation:window.wp.i18n.__("Error loading reservation","bookiflex")},n=t,r=o,{reservation:s,totals:a,isLoading:l,error:c,load:d,reload:u,isCancelled:h}=Ua(),{navigateTo:p}=Ha(),m=async({type:e,id:t})=>{"details"===e?await p({component:"PaymentDetails",props:{paymentId:t},addToStack:!0}):"updated"===e&&(await u(),io())},f=async()=>{await u()},g=async()=>{s.value&&await p({component:"FinancialSummaryDetails",props:{number:s.value.number,totals:a.value},addToStack:!0})},v=async()=>{await u(),io()},b=()=>{r("close")},y=()=>{r("close")};return e.onMounted(async()=>{await d(n.reservationId)}),(t,o)=>(e.openBlock(),e.createBlock(e.unref(Qa),{"auto-show":!0,onClose:y,onBack:b},{label:e.withCtx(()=>[e.createElementVNode("div",Vh,[e.unref(s)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(e.unref(s).number)+" ",1),e.createVNode(e.unref(Yc),{status:e.unref(s).status},null,8,["status"])],64)):e.unref(l)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(i.loading),1)],64)):e.createCommentVNode("",!0)])]),default:e.withCtx(()=>[e.unref(s)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(Gl),{customer:e.unref(s).customer},{default:e.withCtx(()=>[e.unref(s).specialRequest?(e.openBlock(),e.createElementBlock("div",Dh,[e.createElementVNode("div",Lh,[e.createElementVNode("div",$h,e.toDisplayString(i.specialRequest),1),e.createElementVNode("div",Fh,e.toDisplayString(e.unref(s).specialRequest),1)])])):e.createCommentVNode("",!0)]),_:1},8,["customer"]),e.createVNode(e.unref(Cc),{reservation:e.unref(s)},{default:e.withCtx(()=>[e.createVNode(e.unref(Xc),{style:{"margin-top":"12px"},reservation:e.unref(s),onUpdated:v},null,8,["reservation"])]),_:1},8,["reservation"]),e.createElementVNode("div",Mh,[e.createElementVNode("div",Oh,e.toDisplayString(i.payments),1),e.unref(s).payment.transactions.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ih,e.toDisplayString(i.noPaymentsFound),1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s).payment.transactions,t=>(e.openBlock(),e.createBlock(e.unref(Ll),{key:t.id,transaction:t,reservation:e.unref(s),onActionClick:m},null,8,["transaction","reservation"]))),128))]),e.createVNode(e.unref(zc),{isCancelled:e.unref(h),payment:e.unref(s).payment,penalties:e.unref(s).cancellation.penalties,total:e.unref(a).total,currency:e.unref(a).currency,onActionClick:g},{default:e.withCtx(()=>[e.unref(s).status===e.unref(Yt)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(s).cancellation.penalties,t=>(e.openBlock(),e.createBlock(e.unref(ud),{currency:e.unref(a).currency,"prepaid-amount":e.unref(s).payment.amounts.paid,penalty:t,onResolved:f},null,8,["currency","prepaid-amount","penalty"]))),256)):e.createCommentVNode("",!0)]),_:1},8,["isCancelled","payment","penalties","total","currency"])],64)):e.unref(l)?(e.openBlock(),e.createElementBlock("div",zh,[o[0]||(o[0]=e.createElementVNode("sl-spinner",null,null,-1)),e.createElementVNode("p",null,e.toDisplayString(i.loadingReservationDetails),1)])):e.unref(c)?(e.openBlock(),e.createElementBlock("div",qh,[e.createElementVNode("sl-alert",Hh,[o[1]||(o[1]=e.createElementVNode("sl-icon",{slot:"icon",name:"exclamation-octagon"},null,-1)),e.createElementVNode("strong",null,e.toDisplayString(i.errorLoadingReservation),1),o[2]||(o[2]=e.createElementVNode("br",null,null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(c).message),1)])])):e.createCommentVNode("",!0)]),_:1}))}},Wh={style:{display:"flex","align-items":"center","justify-content":"center",gap:"5px"}},jh={class:"reservation-summary"},Kh={class:"price-line"},Gh={class:"subtotal"},Xh={key:0,class:"section charges-section"},Qh={class:"section total-section"},Yh={__name:"FinancialSummaryDetails",props:{totals:{type:Object,required:!0},number:{type:String,required:!0}},emits:["close","back"],setup(t,{emit:o}){const i={night:window.wp.i18n.__("Night","bookiflex"),roomRate:window.wp.i18n.__("Room rate","bookiflex"),subtotal:window.wp.i18n.__("Subtotal","bookiflex"),additionalFees:window.wp.i18n.__("Additional fees","bookiflex"),total:window.wp.i18n.__("TOTAL","bookiflex")},n=t,r=o,{nightsBreakdown:s,reservationModifiers:a,grandTotal:l}=function(t){const{currency:o}=t.value,i=e=>({vat:"VAT",city_tax:"City tax",city:"City tax",service_fee:"Service fee",cleaning_fee:"Cleaning fee",early_bird:"Early bird discount",promo:"Promo code"}[e]||e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())),n=e.computed(()=>t.value?.breakdown?Object.entries(t.value.breakdown).filter(([e,t])=>"accommodation"===t.type&&"daily"===t.scope).sort((e,t)=>{const o=e[1].context.date,i=t[1].context.date;return o.localeCompare(i)}).map(([e,n])=>{const r=n.context.date,s=t.value.modifiers.filter(e=>Object.values(e.sources||{}).some(e=>"accommodation"===e.type&&e.context?.date===r)).map(e=>{const t=Object.values(e.sources||{}).find(e=>"accommodation"===e.type&&e.context?.date===r);return{type:e.type,code:e.code,name:i(e.code),amount:t?.amount||0,percentage:"PCT"===e.adjustmentType?e.value:null}});return{date:r,basePrice:n.subtotal,basePriceFormatted:no(n.subtotal,o),modifiers:{taxes:s.filter(e=>"taxes"===e.type),charges:s.filter(e=>"charges"===e.type),discounts:s.filter(e=>"discounts"===e.type)},total:n.total,totalFormatted:no(n.total,o)}}):[]);return{nightsBreakdown:n,extras:e.computed(()=>t.value?.breakdown?Object.entries(t.value.breakdown).filter(([e,t])=>"extra"===t.type).map(([e,t])=>({code:t.context.code||e,name:t.context.name||i(t.context.code||e),total:t.total,totalFormatted:no(t.total,o),quantity:t.context.quantity||1,refundable:t.context.refundable})):[]),reservationModifiers:e.computed(()=>{if(!t.value?.modifiers)return{charges:[],discounts:[]};const e={charges:[],discounts:[]};return t.value.modifiers.forEach(t=>{if(Object.values(t.sources||{}).some(e=>"reservation"===e.type)){const n={code:t.code,name:i(t.code),amount:t.amount,formatted:no(Math.abs(t.amount),o)};"charges"===t.type?e.charges.push(n):"discounts"===t.type&&e.discounts.push(n)}}),e}),totals:e.computed(()=>{const e=t.value?.summary||{};return{base:e.base||0,baseFormatted:no(e.base||0,o),taxes:e.taxes||0,taxesFormatted:no(e.taxes||0,o),charges:e.charges||0,chargesFormatted:no(e.charges||0,o),discounts:e.discounts||0,discountsFormatted:no(e.discounts||0,o)}}),grandTotal:e.computed(()=>({amount:t.value?.total||0,formatted:no(t.value?.total||0,o)}))}}(e.computed(()=>n.totals)),c=()=>{r("close")},d=()=>{r("back")};return(o,n)=>(e.openBlock(),e.createBlock(e.unref(Qa),{"auto-show":!0,"show-back":!0,onClose:c,onBack:d},{label:e.withCtx(()=>[e.createElementVNode("div",Wh,e.toDisplayString(t.number),1)]),default:e.withCtx(()=>[e.createElementVNode("div",jh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),(o,r)=>(e.openBlock(),e.createElementBlock("div",{key:o.date,class:"section night-breakdown"},[e.createElementVNode("h4",null,e.toDisplayString(i.night)+" "+e.toDisplayString(r+1)+" ("+e.toDisplayString(o.date)+"):",1),e.createElementVNode("div",Kh,[e.createElementVNode("span",null,e.toDisplayString(i.roomRate)+":",1),n[0]||(n[0]=e.createElementVNode("span",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(o.basePriceFormatted),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.modifiers.taxes,o=>(e.openBlock(),e.createElementBlock("div",{key:o.code,class:"price-line modifier"},[e.createElementVNode("span",null," + "+e.toDisplayString(o.name)+" "+e.toDisplayString(o.percentage?`(${o.percentage}%)`:"")+": ",1),e.createElementVNode("span",null,e.toDisplayString(e.unref(no)(o.amount,t.totals.currency)),1)]))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.modifiers.charges,o=>(e.openBlock(),e.createElementBlock("div",{key:o.code,class:"price-line modifier"},[e.createElementVNode("span",null,"+ "+e.toDisplayString(o.name)+":",1),e.createElementVNode("span",null,e.toDisplayString(e.unref(no)(o.amount,t.totals.currency)),1)]))),128)),e.createElementVNode("div",Gh,[e.createElementVNode("span",null,e.toDisplayString(i.subtotal)+":",1),e.createElementVNode("span",null,e.toDisplayString(o.totalFormatted),1)])]))),128)),e.unref(a).charges.length?(e.openBlock(),e.createElementBlock("div",Xh,[e.createElementVNode("h4",null,e.toDisplayString(i.additionalFees)+":",1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a).charges,t=>(e.openBlock(),e.createElementBlock("div",{key:t.code,class:"price-line"},[e.createElementVNode("span",null,e.toDisplayString(t.name)+":",1),e.createElementVNode("span",null,e.toDisplayString(t.formatted),1)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Qh,[e.createElementVNode("strong",null,e.toDisplayString(i.total)+": "+e.toDisplayString(e.unref(l).formatted),1)])])]),_:1}))}},Jh={class:"bflex-app__container"},Zh={__name:"AppController",setup(t){const o={PaymentDetails:Bh,ReservationDetails:Uh,FinancialSummaryDetails:Yh,EditPricesDialog:Bu,EditRestrictionsDialog:Zu},{activeDrawer:i,navigateTo:n,navigateBack:r,closeAll:s,canNavigateBack:a}=Ha(),l=e.computed(()=>i.value?.component&&o[i.value.component]||null),c=e=>{const{id:t}=e.detail;n({component:"PaymentDetails",props:{paymentId:t}})},d=e=>{const{id:t}=e.detail;n({component:"ReservationDetails",props:{reservationId:t}})},u=()=>{s()},h=()=>{a()?r():s()};return e.onMounted(()=>{window.addEventListener("bflex:payment:details",c),window.addEventListener("bflex:reservation:details",d)}),e.onUnmounted(()=>{window.removeEventListener("bflex:payment:details",c),window.removeEventListener("bflex:reservation:details",d)}),(t,o)=>(e.openBlock(),e.createElementBlock("div",Jh,[l.value&&e.unref(i)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps({key:0},e.unref(i).props,{key:e.unref(i).key,onClose:u,onBack:h}),null,16)):e.createCommentVNode("",!0)]))}},ep={__name:"RootApp",setup(t){const o=e.reactive({app:!1,ratePlanCalendar:!1,notificationLog:!1}),i={app:{selector:"#bflex-app--app",key:"app"},ratePlanCalendar:{selector:"#bflex-app--rate-plan-calendar-app",key:"ratePlanCalendar"},notificationLog:{selector:"#bflex-app--notification-log-app",key:"notificationLog"}},n=()=>{Object.entries(i).forEach(([e,t])=>{const i=!!document.querySelector(t.selector);o[t.key]!==i&&(o[t.key]=i)})};let r=null;const s=()=>{n(),ao()},a=()=>{n(),ao()};return e.onMounted(()=>{n(),r=new MutationObserver(e=>{e.some(e=>"childList"===e.type&&(e.addedNodes.length>0||e.removedNodes.length>0))&&n()}),r.observe(document.body,{childList:!0,subtree:!0}),(()=>{const e=Ia(),t=Ra(),o=Ha();window.BookiFlex=window.BookiFlex||{},window.BookiFlex.notifications=e,window.BookiFlex.dialogs=t,window.BookiFlex.navigation=o})(),[{selector:'[data-action="show-reservation"]',eventName:"bflex:reservation:details"},{selector:'[data-action="confirm-payment"]',eventName:"bflex:payment:confirm"},{selector:'[data-action="show-payment-details"]',eventName:"bflex:payment:details"},{selector:'[data-action="show-customer-details"]',eventName:"bflex:customer:details"}].forEach(({selector:e,eventName:t})=>{document.body.addEventListener("click",o=>{const i=o.target.closest(e);i&&!i.dataset.listenerAttached&&(o.preventDefault(),o.stopPropagation(),"sl-icon"!==o.target.tagName&&window.dispatchEvent(new CustomEvent(t,{detail:{id:i.dataset.id}})))})}),document.addEventListener("turbo:frame-load",s),document.addEventListener("turbo:render",a)}),e.onUnmounted(()=>{r&&r.disconnect(),document.removeEventListener("turbo:frame-load",s),document.removeEventListener("turbo:render",a)}),(t,n)=>(e.openBlock(),e.createBlock(e.unref(ml),{"default-options":{variant:"primary",size:"small",closeOnOverlay:!0}},{default:e.withCtx(()=>[e.createVNode(e.unref(fl),{"default-options":{position:"bottom-left",duration:5e3,closable:!0},"max-width":"400px",offset:"1rem",gap:"0.5rem"},{default:e.withCtx(()=>[o.app?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:i.app.selector},[e.createVNode(Zh)],8,["to"])):e.createCommentVNode("",!0),o.ratePlanCalendar?(e.openBlock(),e.createBlock(e.Teleport,{key:1,to:i.ratePlanCalendar.selector},[e.createVNode(e.unref(Xd))],8,["to"])):e.createCommentVNode("",!0),o.notificationLog?(e.openBlock(),e.createBlock(e.Teleport,{key:2,to:i.notificationLog.selector},[e.createVNode(e.unref(eh))],8,["to"])):e.createCommentVNode("",!0),n[0]||(n[0]=e.createElementVNode("div",{class:"bflex-service-container",style:{display:"none"}},null,-1))]),_:1})]),_:1}))}};!function(){const e=window.BookiFlex?.shoelaceBasePath;e&&co(e)}(),(()=>{const e=[];if(void 0===window.Vue&&e.push("Vue.js (window.Vue)"),void 0!==window.wp&&void 0!==window.wp.i18n||e.push("WordPress i18n (window.wp.i18n)"),e.length>0){const t=`[BookiFlex] Critical dependencies not loaded from CDN:\n- ${e.join("\n- ")}\n\nPlease ensure CDN scripts are loaded before this application.`;throw console.error(t),new Error(t)}})(),window.BookiFlex=window.BookiFlex||{},window.BookiFlex.edition="free";const tp=()=>{if(window.BookiFlex.app)return;let t=document.getElementById("bflex-root");t||(t=document.createElement("div"),t.id="bflex-root",document.body.appendChild(t));const o=e.createApp(ep),i=o.mount(t);window.BookiFlex.app=o,window.BookiFlex.instance=i};window.BookiFlex.init=tp,window.BookiFlex.destroy=()=>{window.BookiFlex.app&&(window.BookiFlex.app.unmount(),window.BookiFlex.app=null,window.BookiFlex.instance=null)},window.BookiFlex.registerWidget=(e,t)=>{console.warn("Dynamic widget registration not yet implemented. Add widget to RootApp.vue")},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",tp):tp(),document.addEventListener("turbo:load",()=>{window.BookiFlex.app||tp()}),document.addEventListener("turbo:frame-load",()=>{window.BookiFlex.instance}),document.addEventListener("turbo:render",()=>{window.BookiFlex.app||tp()})}(Vue);
