From 19fd276f21908315bbb6a859fd13fd7f20123940 Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Sat, 14 Nov 2026 20:45:01 -0500 Subject: [PATCH] Update vendored scripts, .NET framework versions --- src/Common/wwwroot/htmax.min.js | 2 +- src/Common/wwwroot/htmx.min.js | 2 +- src/Directory.Build.props | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Common/wwwroot/htmax.min.js b/src/Common/wwwroot/htmax.min.js index a8d8ceb..bfc03b5 100644 --- a/src/Common/wwwroot/htmax.min.js +++ b/src/Common/wwwroot/htmax.min.js @@ -1 +1 @@ -var htmx=(()=>{const e={parse(t){if(!t)return{};if(t.startsWith("{"))return JSON.parse(t);let r=/(?:"([^"]+)"|'([^']+)'|([^\s,:]+))(?:\s*:\s*(?:"([^"]*)"|'([^']*)'|<((?:[^/]|\/(?!>))+)\/>|([^\s,]+)))?(?=\s|,|$)/g,i={};for(let n of t.matchAll(r)){let[,t,r,s,o,a,l,c]=n,h=t??r??s,u=(o??a??l??c??"true").trim();try{u=JSON.parse(u)}catch{}let d=s?.includes("."),f=d?h.split(".").reduceRight((e,t)=>({[t]:e}),u):{[h]:u};e.merge(f,i)}return i},split:e=>e.split(/,(?![^\[]*\])(?![^(]*\))(?![^<]*\/>)(?=(?:[^"']|"[^"]*"|'[^']*')*$)/),merge(t,r){"string"==typeof t&&(t=e.parse(t));for(let[i,n]of Object.entries(t)){if(["__proto__","constructor","prototype"].includes(i))continue;let t=n?.constructor===Object,s=r[i]?.constructor===Object;t&&s?e.merge(n,r[i]):r[i]=n}return r}};class t{#e=null;#t=[];admit(e,t,r){if(!this.#e)return this.#e={strategy:e,abort:r},"run";if("replace"===e||"abort"!==e&&"abort"===this.#e.strategy)return this.#t=[],this.#e.abort?.(),this.#e={strategy:e,abort:r},"run";if("queue all"===e)this.#t.push(t);else if("queue last"===e)this.#t=[t];else{if("abort"===e||"drop"===e||0!==this.#t.length)return"dropped";this.#t.push(t)}return"queued"}continue(){this.#e=null,this.#t.shift()?.()}abort(){this.#e?.abort?.()}}return new class{#r=e;#i=new Map;#n="";#s=new Set;_loc=window.location;#o;#a=Function;#l=Object.getPrototypeOf(async function(){}).constructor;#c={createHTML:e=>e,createScript:e=>e};#h;#u="a,form";#d=["get","post","put","patch","delete","query"];#f;#m;#p;#g;#x;constructor(){this.#b(),this.#y(),this.#h=this.#v("[hx-action],[hx-get],[hx-post],[hx-put],[hx-patch],[hx-delete],[hx-query]"),this.#f=(new XPathEvaluator).createExpression(`.//*[@*[${this.#w("hx-on").map(e=>`starts-with(name(), "${e}")`).join(" or ")}]]`),this.#o={HCON:e,attributeValue:this.#S.bind(this),parseTriggerSpecs:this.#E.bind(this),determineMethodAndAction:this.#A.bind(this),createRequestContext:this.#C.bind(this),collectFormData:this.#q.bind(this),getAttributeObject:this.#T.bind(this),insertContent:this.#_.bind(this),morph:this.#O.bind(this),isSoftMatch:this.#N.bind(this),initSecurity:(e,t,r)=>{e&&(this.#c=e),t&&(this.#a=t),r&&(this.#l=r)},onTrigger:this.#H.bind(this),htmxProp:this.#k.bind(this),triggerHtmxEvent:this.#M.bind(this),executeJavaScript:this.#I.bind(this)};let t=()=>this.initialize();"loading"===document.readyState?document.addEventListener("DOMContentLoaded",t):setTimeout(t)}#b(){this.version="4.0.0",this.config={logAll:!1,prefix:"data-hx-",transitions:!1,history:!0,mode:"same-origin",defaultSwap:"innerHTML",defaultFocusScroll:!1,indicatorClass:"htmx-indicator",requestClass:"htmx-request",includeIndicatorCSS:!0,defaultTimeout:6e4,extensions:"",morphIgnore:["data-htmx-powered"],morphSkip:"[hx-morph-skip]",morphSkipChildren:"[hx-morph-skip-children]",morphScanLimit:10,noSwap:[204,304],implicitInheritance:!1,defaultSettleDelay:1,allowEmptySwapAfterOOB:!1};let t=document.querySelector('meta[name="htmx-config"]');t&&e.merge(t.content,this.config),this.#n=this.config.extensions}#y(){if(!1!==this.config.includeIndicatorCSS){let e=this.config.indicatorClass,t=this.config.requestClass,r=new CSSStyleSheet;r.replaceSync(`.${e}{opacity:0;visibility: hidden} .${t} .${e}, .${t}.${e}{opacity:1;visibility: visible;transition: opacity 200ms ease-in}`),document.adoptedStyleSheets=[...document.adoptedStyleSheets,r]}}registerExtension(e,t){return!(this.#n&&!this.#n.split(/,\s*/).includes(e))&&(!this.#s.has(e)&&(this.#s.add(e),t.init&&t.init(this.#o),void Object.entries(t).forEach(([e,t])=>{this.#i.get(e)?.push(t)||this.#i.set(e,[t])})))}#L(e){let t=this.config.prefix;return!e.closest||null!=e.closest("[hx-ignore]")||t&&null!=e.closest(`[${t}ignore]`)}#P(e,t){let r=this.config.prefix;return e.getAttribute(t)??(r?e.getAttribute(t.replace("hx-",r)):null)}#D(e,t){let r=this.config.prefix&&t.replace("hx-",this.config.prefix);return e.hasAttribute(t)?t:r&&e.hasAttribute(r)?r:null}#v(e){return this.#w(e).join(",")}#w(e){let t=[e];return this.config.prefix&&t.push(e.replaceAll("hx-",this.config.prefix)),t}#j(e,t){let r=[...e.querySelectorAll?.(t)??[]];return e.matches?.(t)&&r.unshift(e),r}#V(e){return"before"===e?"beforebegin":"after"===e?"afterend":"prepend"===e?"afterbegin":"append"===e?"beforeend":e}#R(e,t){let r=[];return this.#S(e,t,void 0,(e,t)=>{e?.split(/\s*[,:]\s*/).includes("this")&&r.push(t)}),r}#S(e,t,r,i){t=this.#W(t);let n=this.#W(":inherited"),s=this.#W(":append"),o=this.#P(e,t)??this.#P(e,t+n);if(null!=o)return i?i(o,e):o;let a=CSS.escape(this.config.implicitInheritance?t:t+n),l=CSS.escape(t+n+s),c=this.#v(`[${a}],[${l}]`),h=this.#D(e,t+s)??this.#D(e,t+n+s);if(h){let r=e.getAttribute(h),n=e.parentNode?.closest?.(c);if(i&&i(r,e),n){let e=this.#S(n,t,void 0,i);return e?(e+","+r).replace(/[{}]/g,""):r}return r}let u=e.parentNode?.closest?.(c);return u?(o=this.#S(u,t,void 0,i),!i&&o&&this.config.implicitInheritance&&this.#$(e,"htmx:after:implicitInheritance",{elt:e,name:t,parent:u}),o):r}#E(t){return e.split(t).flatMap(t=>{let[,r,i]=t.match(/^\s*(\S+\[[^\]]*\]|\S+)\s*(.*?)\s*$/)??[];if(!r)return[];if(/\[[^\]]*$/.test(r))throw"unterminated:"+r;return[{name:r,...e.parse(i)}]})}#A(e,t){let r=this.#S(e,"hx-method"),i=this.#S(e,"hx-action");if(!i)for(let t of this.#d){let n=this.#S(e,"hx-"+t);if(null!=n){i=n,r=t;break}}return this.#B(e)&&(i||=t.submitter?.getAttribute?.("formAction")||e.getAttribute(e.matches("a")?"href":"action")),r||=t.submitter?.getAttribute?.("formmethod")||e.getAttribute("method")||"GET",{action:i,method:r.toUpperCase()}}#k(e){return e._htmx||(e._htmx={listeners:[],triggerSpecs:[]},e.setAttribute("data-htmx-powered","true")),e._htmx}#F(e){return e._htmx_state||={}}#z(e){if(this.#U(e)&&this.#M(e,"htmx:before:init",{},!0)){let t=this.#k(e);t.initialized=!0,t.eventHandler=this.#J(e),this.#Q(e),this.#M(e,"htmx:after:init",{},!0)}}#J(e){return async t=>{try{let r=this.#C(e,t);await this.#G(r)}catch(t){this.#M(e,"htmx:error",{error:t})}}}#C(t,r){let{action:i,method:n}=this.#A(t,r),[s,o]=(i||"").split("#"),a=new AbortController,l={sourceElement:t,sourceEvent:r,status:"created",select:this.#S(t,"hx-select"),selectOOB:this.#S(t,"hx-select-oob"),target:this.#S(t,"hx-target"),swap:this.#S(t,"hx-swap")??this.config.defaultSwap,push:this.#S(t,"hx-push-url"),replace:this.#S(t,"hx-replace-url"),transition:this.config.transitions,confirm:this.#S(t,"hx-confirm"),request:{validate:"true"===this.#S(t,"hx-validate",!t.matches("form")||t.noValidate||r.submitter?.formNoValidate?"false":"true"),action:s,anchor:o,method:n,headers:this.#X(t),abort:a.abort.bind(a),credentials:"same-origin",signal:a.signal,mode:this.config.mode}};t._htmx?.boosted&&e.merge(t._htmx.boosted,l),l.target=this.#K(t,l.target),l.target&&(l.request.headers["HX-Target"]=this.#Y(l.target));let c=this.#S(t,"hx-config");return c&&(e.merge(c,l.request),l.request.mode=this.config.mode),l}#Y(e){return`${e.tagName.toLowerCase()}${e.id?"#"+encodeURI(e.id):""}`}#X(e){let t={"HX-Request":"true","HX-Source":this.#Y(e),"HX-Current-URL":location.href,Accept:"text/html"};return this.#B(e)&&(t["HX-Boosted"]="true"),t}#Z(e,t){return this.#T(e,"hx-headers",e=>{for(let r in e)t.request.headers[r]=String(e[r])},{ctx:t})}#K(e,t){return t instanceof Element?t:null!=t?this.#ee(e,t,"hx-target"):this.#B(e)?document.body:e}#B(e){return e?._htmx?.boosted}async#G(e){let t=e.sourceElement,r=e.sourceEvent;if(!t.isConnected)return;if(this.#te(r))return;this.#re(r)&&r.preventDefault();let i=/GET|DELETE/.test(e.request.method),n=i?t.matches("form")?t:null:t.form||t.closest("form"),s=this.#q(t,n,r.submitter,e.request.validate,i);if(!s)return;let o=this.#T(t,"hx-vals",t=>{e.vals=t;for(let e in t)s.set(e,t[e])},{ctx:e});if(o&&await o,e.values)for(let t in e.values)s.delete(t),s.append(t,e.values[t]);let a=this.#Z(t,e);if(a&&await a,Object.assign(e.request,{form:n,submitter:r.submitter,body:s}),!this.#M(t,"htmx:config:request",{ctx:e}))return;if("DIALOG"===e.request.method)return;let l=this.#ie(e.request.action);if(null!=l){let t=Object.fromEntries(e.request.body);return void await this.#I(e.sourceElement,t,l,!1)}if(i){let t=new URL(e.request.action,document.baseURI);for(let r of e.request.body.keys())t.searchParams.delete(r);for(let[r,i]of e.request.body)t.searchParams.append(r,i);t.origin===location.origin?e.request.action=t.pathname+t.search:e.request.action=t.href,e.request.body=null}else"multipart/form-data"!==(this.#S(t,"hx-encoding")??n?.enctype)&&(e.request.body=new URLSearchParams(e.request.body));await this.#ne(e)}async#ne(e){let t=e.sourceElement,r=this.#se(t),i=this.#oe(t);if(this.#ae(t),"run"!==i.admit(r,()=>this.#ne(e),()=>e.request?.abort?.()))return;e.status="issuing";let n=[],s=[];try{if(e.confirm){if(!await new Promise(r=>{let i={ctx:e,issueRequest:()=>r(!0),dropRequest:()=>r(!1)};if(this.#M(t,"htmx:confirm",i)){let i=this.#ie(e.confirm);r(i?this.#I(t,{ctx:e},i,!0):window.confirm(e.confirm))}}))return}if(this.#le(e),n=this.#ce(t),s=this.#he(t),e.fetch||=window.fetch.bind(window),e.request.headers["HX-Request-Type"]=e.target===document.body||e.select?"full":"partial",!this.#M(t,"htmx:before:request",{ctx:e}))return;let r=await e.fetch(e.request.action,e.request);if(e.response={raw:r,status:r.status,headers:r.headers},this.#ue(e),!this.#M(t,"htmx:before:response",{ctx:e}))return;if(e.text=await r.text(),!this.#M(t,"htmx:after:request",{ctx:e}))return;if(e.response.status>=400&&this.#M(t,"htmx:response:error",{ctx:e}),this.#de(e))return void(e.keepIndicators=!0);"issuing"===e.status&&(e.hx.retarget&&(e.target=e.hx.retarget),e.hx.reswap&&(e.swap=e.hx.reswap),e.hx.reselect&&(e.select=e.hx.reselect),e.status="response received",this.#fe(e),await this.swap(e),e.status="swapped")}catch(r){e.status="error: "+r,this.#M(t,"htmx:error",{ctx:e,error:r})}finally{await(e.extensionPromise?.catch(()=>{})),clearTimeout(e.requestTimeout),e.hx?.trigger&&this.#me(e.hx.trigger,e.sourceElement),this.#M(t,"htmx:finally:request",{ctx:e}),e.keepIndicators||(this.#pe(n),this.#ge(s)),i.continue()}}#ue(e){e.hx={};for(let[t,r]of e.response.raw.headers)t.toLowerCase().startsWith("hx-")&&(e.hx[t.slice(3).toLowerCase().replace(/-/g,"")]=r)}#de(t){if("true"===t.hx.refresh)return this._loc.reload(),!0;if(t.hx.redirect)return this._loc.href=t.hx.redirect,!0;if(t.hx.location){let r=t.hx.location,i={},n=e.parse(r);return"{"!==r[0]&&null==n.path||(i=n,r=i.path,delete i.path),null==i.push&&null==i.replace&&(i.push="true"),this.ajax("GET",r,i),!0}}#le(e){let t=null!=e.request.timeout?this.parseInterval(e.request.timeout):this.config.defaultTimeout;t&&(e.requestTimeout=setTimeout(()=>e.request?.abort?.(),t))}#se(e){let t=this.#S(e,"hx-sync");if(!t)return"queue first";let r=t.split(":").pop().trim();return/^(drop|abort|replace|queue)/.test(r)?r:"queue first"}#oe(e){let r=this.#S(e,"hx-sync"),i=e;if(r){let t=r.includes(":")?r.slice(0,r.lastIndexOf(":")).trim():/^(drop|abort|replace|queue)/.test(r)?null:r;t&&(i=this.#ee(e,t,"hx-sync")||e)}return this.#F(i).rq||=new t}#te(e){return"click"===e.type&&(e.ctrlKey||e.metaKey||e.shiftKey)&&!!e.currentTarget?.closest?.("a[href]")}#re(e){let t=e.currentTarget;if("submit"===e.type&&"FORM"===t?.tagName)return!0;if(!("click"===e.type&&0===e.button))return!1;let r=t?.closest?.('button, input[type="submit"], input[type="image"]'),i=r?.form||r?.closest("form");if(r&&!r.disabled&&i&&("submit"===r.type||"image"===r.type||!r.type&&"BUTTON"===r.tagName))return!0;let n=t?.closest?.("a");if(!n||!n.href)return!1;let s=n.getAttribute("href");return!(s&&s.startsWith("#")&&s.length>1)}#Q(e,t=e._htmx.eventHandler){let r=this.#S(e,"hx-trigger")||(e.matches("form")?"submit":e.matches("input:not([type=button]):not([type=submit]),select,textarea")?"change":"click");this.#H(e,r,t)}#H(e,t,r){let i=this.#E(t);this.#k(e).triggerSpecs.push(...i);for(let t of i){t.listeners=[];let[i,n]=this.#xe(t.name),s=[e];"outside"===t.from?s=[document]:t.from&&"self"!==t.from&&(s=this.#be(e,t.from));let o=e=>{if((t.halt||t.prevent)&&e.preventDefault(),(t.halt||t.stop||t.consume)&&e.stopPropagation(),t.once)for(let e of t.listeners)e.fromElt.removeEventListener(e.eventName,e.handler,e);r(e)},a=o;if(t.delay?a=e=>{clearTimeout(t.timeout),t.timeout=setTimeout(()=>o(e),this.parseInterval(t.delay))}:t.throttle&&(a=e=>{t.throttled?t.throttledEvent=e:(t.throttled=!0,o(e),t.throttleTimeout=setTimeout(()=>{if(t.throttled=!1,t.throttledEvent){let e=t.throttledEvent;t.throttledEvent=null,a(e)}},this.parseInterval(t.throttle)))}),t.handler=r=>{if(("self"!==t.from||r.target===e)&&("outside"!==t.from||!e.contains(r.target))&&(!t.target||r.target?.matches?.(t.target))){if(t.changed){let e=t.values??=new WeakMap,r=!1;for(let t of s)e.get(t)!==t.value&&(r=!0,e.set(t,t.value));if(!r)return}if(n){this.#re(r)&&r.preventDefault();let t={};for(let e in r)t[e]=r[e];if(!this.#I(e,t,n,!0,!1))return}a(r)}},"intersect"===i||"revealed"===i){let r={rootMargin:t.rootMargin};t.root&&(r.root=this.#ee(e,t.root)),t.threshold&&(r.threshold=parseFloat(t.threshold));let n="revealed"===i;t.observer=new IntersectionObserver(r=>{for(let i=0;i"name"!==e);t.interval=setInterval(()=>{e.isConnected?this.#M(e,"every",{},!1):clearInterval(t.interval)},this.parseInterval(r))}if("load"!==i)for(let r of s){let n={fromElt:r,eventName:i,handler:t.handler,capture:!!t.capture,passive:!!t.passive};e._htmx.listeners.push(n),t.listeners.push(n),r.addEventListener(i,t.handler,n)}else t.handler(new CustomEvent("load"))}}#xe(e){let t=e.match(/^([^\[]*)\[([^\]]*)]/);return t?[t[1],t[2]]:[e,null]}#me(t,r){if("{"===t[0]){let i=e.parse(t);for(let e in i){let t=i[e],n=r;t?.target&&(n=this.find(t.target)),this.trigger(n,e,"object"==typeof t?t:{value:t})}}else t.split(",").forEach(e=>this.trigger(r,e.trim(),{}))}#ye(e){let t={},r=Object.getPrototypeOf(this);for(let i of Object.getOwnPropertyNames(r))"constructor"!==i&&"function"==typeof this[i]&&(["find","findAll"].includes(i)?t[i]=(t,r)=>void 0===r?this[i](e,t):this[i](t,r):t[i]=this[i].bind(this));return t}#I(e,t,r,i=!0,n=!0,s=!1){let o={};Object.assign(o,this.#ye(e));let a={},l={scope:a,code:r};this.#$(e,"htmx:scope",l),r=l.code,Object.assign(o,a),Object.assign(o,t);let c=Object.keys(o),h=Object.values(o),u=new(n?this.#l:this.#a)(...c,i?`return (${r})`:r);return s?()=>u.call(e,...h):u.call(e,...h)}process(e,t){if(!e?.isConnected)return;if(!(e instanceof Element)){for(let r of e.children||[])this.process(r,t);return}if(t&&this.#ve(e,!0),this.#L(e))return;if(!this.#M(e,"htmx:before:process"))return;let r=[e],i=this.#f.evaluate(e),n=null;for(;n=i.iterateNext();)r.push(n);for(let e of r)!this.#L(e)&&this.#M(e,"htmx:before:on:init",{},!0)&&this.#we(e);for(let t of this.#j(e,this.#h))this.#z(t);for(let t of this.#j(e,this.#u))this.#Se(t);this.#M(e,"htmx:after:process")}#Se(e){let t=this.#S(e,"hx-boost");if(t&&"false"!==t&&this.#Ee(e)&&this.#M(e,"htmx:before:init",{},!0)){let r=this.#k(e);r.initialized=!0,r.eventHandler=this.#J(e),r.boosted=t;let i=e.matches("a")?"click":"submit";e._htmx.listeners.push({fromElt:e,eventName:i,handler:e._htmx.eventHandler}),e.addEventListener(i,e._htmx.eventHandler),this.#M(e,"htmx:after:init",{},!0)}}#Ee(e){if(this.#U(e))if("A"===e.tagName){if(""===e.target||"_self"===e.target)return!e.hasAttribute("download")&&!e.getAttribute("href")?.startsWith?.("#")&&this.#Ae(e.href)}else if("FORM"===e.tagName)return"dialog"!==e.method&&this.#Ae(e.action)}#Ae(e){try{return new URL(e,window.location.href).origin===window.location.origin}catch(e){return!1}}#U(e){return!e._htmx?.initialized&&!this.#L(e)}#ve(e,t){let r=[e,...e.querySelectorAll?.("[data-htmx-powered]")??[]];for(let e of r)if(e._htmx){this.#M(e,"htmx:before:cleanup");for(let t of e._htmx.triggerSpecs||[])t.interval&&clearInterval(t.interval),t.timeout&&clearTimeout(t.timeout),t.throttleTimeout&&clearTimeout(t.throttleTimeout),t.observer?.disconnect();for(let t of e._htmx.listeners||[])t.fromElt.removeEventListener(t.eventName,t.handler,t);e.removeAttribute("data-htmx-powered"),this.#M(e,"htmx:after:cleanup"),t&&delete e._htmx}}#Ce(e){let t=document.createElement("div");t.hidden=!0,document.body.insertAdjacentElement("afterend",t);let r=e.querySelectorAll?.(this.#v("[hx-preserve]"))||[];for(let e of r){let r=document.getElementById(e.id);r&&this.#qe(t,r,null)}return t}#Te(e){for(let t of[...e.children]){let e=document.getElementById(t.id);e&&(this.#qe(e.parentNode,t,e),this.#ve(e),e.remove())}e.remove()}#_e(e){let t=this.#c.createHTML(e);return Document.parseHTMLUnsafe?.(t)||(new DOMParser).parseFromString(t,"text/html")}#Oe(e){let t=e.replace(/)/gi,'"),r="";t=t.replace(/]*)?>[\s\S]*?<\/head>/i,e=>(r=this.#_e(e).title,""));let i,n,s=t.match(/<([a-z][^\/>\x20\t\r\n\f]*)/i)?.[1]?.toLowerCase();if("html"===s||"body"===s?(i=this.#_e(t),n=document.createDocumentFragment(),n.append(i.body)):(i=this.#_e(``),n=i.querySelector("template").content),!r){let e=n.querySelector("title:not(svg title)");e&&(r=e.textContent,e.remove())}return this.#Ne(n),{fragment:n,title:r}}#He(e,t,r,i){let n=t.id?"#"+CSS.escape(t.id):null;"true"!==r&&r&&!r.includes(" ")&&([r,n=n]=r.split(/:(.*)/)),"true"!==r&&r||(r="outerHTML");let s=this.#ke(r);if(n=s.target||n,s.strip??=!s.style.startsWith("outer"),!n)return;let o=[...document.querySelectorAll(n)];for(let r of o){let n=document.createDocumentFragment();n.append(t.cloneNode(!0)),e.push({type:"oob",fragment:n,target:r,swapSpec:s,sourceElement:i})}t.remove()}#Me(e,t,r){let i=[];if(r)for(let n of r.split(",")){let[r,s="true"]=n.split(/:(.*)/);for(let n of e.querySelectorAll(r))this.#He(i,n,s,t)}for(let r of e.querySelectorAll(this.#v("[hx-swap-oob]"))){let e=this.#D(r,"hx-swap-oob"),n=r.getAttribute(e);r.removeAttribute(e),this.#He(i,r,n,t)}return i}#Ie(e,t,r){t?t.before(...r.childNodes):e.append(...r.childNodes)}#ke(t){t=t.trim();let r=this.config.defaultSwap;if(t&&!/^\S*:/.test(t)){let e=t.match(/^(\S+)\s*(.*)$/);r=e[1],t=e[2]}return{style:this.#V(r),...e.parse(t)}}#Le(e,t){let r=[];for(let i of e.querySelectorAll("template[hx]")){let e=i.getAttribute("type");if("partial"===e){let e=this.#P(i,"hx-target")||(i.id?"#"+CSS.escape(i.id):null);if(e){this.#Ne(i.content);let n=this.#ke(this.#P(i,"hx-swap")||this.config.defaultSwap),s=this.#be(t.sourceElement,e);for(let e of s.length?s:[null])r.push({type:"partial",fragment:i.content.cloneNode(!0),target:e,swapSpec:n,sourceElement:t.sourceElement})}}else this.#$(i,"htmx:process:"+e,{ctx:t,tasks:r});i.remove()}return r}#Pe(e,t,r,i){try{null!=r&&e.setSelectionRange&&e.setSelectionRange(r,i),e.focus(t)}catch(e){}}#De(e){let t=this.#j(e,"[autofocus]")[0];t&&this.#Pe(t)}#je(e,t){if(e.scroll){let r=e.scrollTarget?this.#Ve(e.scrollTarget):t;r&&("top"===e.scroll?r.scrollTop=0:"bottom"===e.scroll&&(r.scrollTop=r.scrollHeight))}if("top"===e.show||"bottom"===e.show){let r=e.showTarget?this.#Ve(e.showTarget):t;r?.scrollIntoView?.("top"===e.show)}}#Re(e){e.request?.anchor&&document.getElementById(e.request.anchor)?.scrollIntoView({block:"start",behavior:"auto"})}#Ne(e){let t=this.#j(e,"script");for(let e of t){let t=document.createElement("script");for(let r of e.attributes)t.setAttribute(r.name,r.value);this.config.inlineScriptNonce&&(t.nonce=this.config.inlineScriptNonce),t.textContent=this.#c.createScript(e.textContent),e.replaceWith(t)}}initialize(){this.config.history&&!this.#g&&(this.#g=!0,history.state||history.replaceState({htmx:!0},"",location.href),window.navigation&&!/firefox/i.test(navigator.userAgent)?navigation.addEventListener("navigate",e=>{"traverse"===e.navigationType&&e.canIntercept&&!e.hashChange&&e.intercept({handler:()=>this.#We()})}):window.addEventListener("popstate",e=>this.#We(e.state))),this.process(document.body)}async swap(e){try{this.#$e(e);let{fragment:t,title:r}=this.#Oe(e.text);e.title=r;let i=[],n=this.#Me(t,e.sourceElement,e.selectOOB),s=this.#Le(t,e);i.push(...n,...s);let o=s.length||n.length&&!this.config.allowEmptySwapAfterOOB,a=this.#Be(e,t,o);if(a&&i.unshift(a),!this.#M(e.sourceElement,"htmx:before:swap",{ctx:e,tasks:i}))return;let l=[],c=[];for(let t of i)t.swapSpec?.transition??a?.transition??e.transition?c.push(t):l.push(this.#_(t));if(c.length>0){let t=async()=>{for(let e of c)await this.#_(e,!1)};l.push(this.#Fe(t,e))}await Promise.all(l),!e.sourceElement?.isConnected&&a?.target?.isConnected&&(e.sourceElement=a.target),this.#M(e.sourceElement,"htmx:after:swap",{ctx:e}),e.title&&!a?.swapSpec?.ignoreTitle&&(document.title=e.title),this.#Re(e)}finally{this.#M(e.sourceElement,"htmx:finally:swap",{ctx:e})}}#Be(e,t,r){let i=this.#ke(e.swap||this.config.defaultSwap);if("delete"===i.style||t.childElementCount>0||t.textContent.trim()||(i.swapEmpty??!r)){if(e.select){let r=t.querySelectorAll(e.select);(t=document.createDocumentFragment()).append(...r)}return this.#B(e.sourceElement)&&(i.show||="top"),{type:"main",fragment:t,target:this.#K(e.sourceElement||document.body,i.target||e.target),swapSpec:i,sourceElement:e.sourceElement,transition:e.transition&&!1!==i.transition}}}async#_(e,t=!0){let{target:r,swapSpec:i,fragment:n}=e;if("string"==typeof r&&(r=document.querySelector(r)),!r)return;"string"==typeof i&&(i=this.#ke(i));let s,o=i.style;if("none"===o)return;if("BODY"===n.firstElementChild?.tagName){const e=r===document.body&&o.startsWith("outer");e&&"outerHTML"===o&&(o="outerSync"),i.strip??=!e}if(i.strip&&n.firstElementChild&&(n=document.createDocumentFragment(),n.append(...(e.fragment.firstElementChild.content||e.fragment.firstElementChild).childNodes)),this.#ze(r,"htmx-swapping"),t&&e.swapSpec?.swap&&await this.timeout(e.swapSpec?.swap),"delete"===o)return void(r.parentNode&&(this.#ve(r),r.parentNode.removeChild(r)));let a=[],l=i.settle??this.config.defaultSettleDelay,c=r.parentNode;if("innerHTML"===o||"outerHTML"===o&&c){let e=document.activeElement;if(e?.id){let t,r;try{t=e.selectionStart,r=e.selectionEnd}catch(e){}s={elt:e,start:t,end:r}}a=t&&l?this.#Ue(n,r):[]}let h=this.#Ce(n),u=[...n.childNodes];try{if("innerHTML"===o){for(const e of r.children)this.#ve(e);r.replaceChildren(...n.childNodes)}else if("textContent"===o){for(const e of r.querySelectorAll("[data-htmx-powered]"))this.#ve(e);r.textContent=n.textContent}else if("outerHTML"===o)c&&(this.#Ie(c,r,n),this.#ve(r),c.removeChild(r),r=u[0]||c);else if("outerSync"===o){this.#Je(r,n.firstElementChild);for(const e of r.children)this.#ve(e);r.replaceChildren(...n.firstElementChild.childNodes),u=[r]}else if("innerMorph"===o)this.#O(r,n,!0),u=[...r.childNodes];else if("outerMorph"===o)this.#O(r,n,!1),u.push(r);else if("beforebegin"===o)c&&this.#Ie(c,r,n);else if("afterbegin"===o)this.#Ie(r,r.firstChild,n);else if("beforeend"===o)this.#Ie(r,null,n);else if("afterend"===o)c&&this.#Ie(c,r.nextSibling,n);else{let e=this.#i.get("handle_swap")||[],t=!1;for(const s of e){let e=s(o,r,n,i);if(e){t=!0,Array.isArray(e)&&(u=e);break}}if(!t)throw new Error(`Unknown swap style: ${o}`)}}finally{this.#Qe(r,"htmx-swapping")}if(e.target=r,this.#Te(h),s&&!s.elt.matches(":focus")){let e=document.getElementById(s.elt.id);if(e){let t={preventScroll:void 0!==i.focusScroll?!i.focusScroll:!this.config.defaultFocusScroll};this.#Pe(e,t,s.start,s.end)}}this.#M(r,"htmx:before:settle",{task:e,newContent:u,settleTasks:a});for(const e of u)this.#ze(e,"htmx-added");if(t&&a.length>0){this.#ze(r,"htmx-settling"),await this.timeout(l);for(let e of a)e();this.#Qe(r,"htmx-settling")}this.#M(r,"htmx:after:settle",{task:e,newContent:u,settleTasks:a});for(const e of u)this.#Qe(e,"htmx-added"),this.process(e),this.#De(e);this.#je(i,r)}#M(e,t,r={},i=!0){if(r.error){let i=`htmx: ${t}: ${r.error.message??r.error}`;r.error instanceof Error?console.error(i,r.error,{elt:e,detail:r}):console.error(i,{elt:e,detail:r})}else r.warn?console.warn(`htmx: ${t}: ${r.warn}`,{elt:e,detail:r}):this.config.logAll&&console.log(`htmx: ${t}`,{elt:e,detail:r});return e=this.#Ge(e),this.#$(e,t,r),this.trigger(e,this.#W(t),r,i)}#$(e,t,r={}){let i=this.#i.get(t.replace(/:/g,"_"));if(i){r.cancelled=!1;for(const t of i)if(!1===t(e,r)||r.cancelled)return r.cancelled=!0,!1}return!0}timeout(e){if((e=this.parseInterval(e))>0)return new Promise(t=>setTimeout(t,e))}onLoad(e){this.on(this.#W("htmx:after:process"),t=>{e(t.target)})}on(e,t,r){let i,n=document;return void 0===r?(i=e,r=t):(n=this.#Ge(e),i=t),n.addEventListener(i,r),r}find(e,t){return this.#Ve(e,t)}findAll(e,t){return this.#be(e,t)}parseInterval(e){if("number"==typeof e)return e;let[,t,r]=e?.match(/^([\d.]+)(ms|s|m)?$/)||[],i=parseFloat(t)*({ms:1,s:1e3,m:6e4}[r]||1);return isNaN(i)?void 0:i}trigger(e,t,r={},i=!0){e=this.#Ge(e);let n=new CustomEvent(t,{detail:r,cancelable:!0,bubbles:i,composed:!0}),s=e?.isConnected?e:document;return!r.cancelled&&s.dispatchEvent(n)}ajax(e,t,r){(!r||r instanceof Element||"string"==typeof r)&&(r={target:r});let i="string"==typeof r.source?document.querySelector(r.source):r.source;if("string"==typeof r.source&&!i)return Promise.reject(new Error("Source not found"));if(r.target){let e=this.#K(document.body,r.target);if(!e)return Promise.reject(new Error("Target not found"));i||=e}i||=document.body;let n=this.#C(i,r.event||{});return Object.assign(n,r),r.target&&(n.target=this.#K(document.body,r.target)),Object.assign(n.request,{action:t,method:e.toUpperCase()}),r.headers&&Object.assign(n.request.headers,r.headers),this.#G(n)}#Xe(e){this.config.history&&(history.state||history.replaceState({htmx:!0},"",location.href),history.pushState({htmx:!0},"",e),this.#M(document,"htmx:after:history:push",{path:e}))}#Ke(e){this.config.history&&(history.replaceState({htmx:!0},"",e),this.#M(document,"htmx:after:history:replace",{path:e}))}async#We(e,t){if(await this.timeout(1),e??=history.state,!e?.htmx)return;this.#p?.abort(),t=t||location.pathname+location.search;let r=document.querySelector(this.#v("[hx-history-elt]"))||document.body;if(this.#M(document,"htmx:before:history:restore",{path:t,cacheMiss:!0})){if("reload"!==this.config.history)return this.#p=new AbortController,this.ajax("GET",t,{target:r,swap:"outerSync",select:r!==document.body?this.#v("[hx-history-elt]"):void 0,request:{headers:{"HX-History-Restore-Request":"true"},signal:this.#p.signal}});this._loc.reload()}}#Ye(e){let{sourceElement:t,push:r,replace:i,hx:n,response:s}=e;if((n?.pushurl||n?.replaceurl)&&(r=n.pushurl,i=n.replaceurl),null==r&&null==i&&this.#B(t)&&(r="true"),"false"!==r&&!1!==r||(r=null),"false"!==i&&!1!==i||(i=null),!r&&!i)return null;let o=r||i;if("true"===o){let t=s?.raw?.url||e.request.action,r=new URL(t,location.href);o=r.pathname+r.search+(e.request.anchor?"#"+e.request.anchor:"")}return{type:r?"push":"replace",path:o}}#$e(e){if(!this.config.history)return;let t=this.#Ye(e);if(!t)return;let r={history:t,sourceElement:e.sourceElement,response:e.response};this.#M(document,"htmx:before:history:update",r)&&("push"===t.type?this.#Xe(t.path):this.#Ke(t.path),this.#M(document,"htmx:after:history:update",r))}#we(e){if(e._htmx?.onInitialized)return;let t=this.#w("hx-on"),r=this.config.metaCharacter||":",i=t=>async r=>{try{await this.#I(e,{event:r},`with(event?.detail||{}){${t}}`,!1)}catch(t){"symbol"!=typeof t&&this.#M(e,"htmx:error",{error:t})}};for(let n of e.getAttributeNames()){let s=t.find(e=>n.startsWith(e));if(!s)continue;this.#k(e).onInitialized=!0;let o=n.substring(s.length),a=e.getAttribute(n);if(!o){for(let t of a.split(/;(?=[^;]*->)/)){let r=t.indexOf("->");-1!==r&&this.#H(e,t.substring(0,r).trim(),i(t.substring(r+2).trim()))}continue}if(o[0]!==r)continue;let l=o.substring(1);l.startsWith(r)&&(l="htmx"+r+l.substring(1)),this.#H(e,l,i(a))}}#ce(e){let t,r=this.#S(e,"hx-indicator");if(r)t=this.#be(e,r,"hx-indicator");else{if(e===document.body)return[];t=[e]}for(const e of t){let t=this.#F(e);t.rc=(t.rc||0)+1,this.#ze(e,this.config.requestClass)}return t}#pe(e){for(let t of e){let e=this.#F(t);e.rc&&--e.rc<=0&&(this.#Qe(t,this.config.requestClass),delete e.rc)}}#he(e){let t=this.#S(e,"hx-disable"),r=[];if(t){r=this.#be(e,t,"hx-disable");for(let e of r){let t=this.#F(e);t.dc=(t.dc||0)+1,e.disabled=!0}}return r}#ge(e){for(const t of e){let e=this.#F(t);e.dc&&--e.dc<=0&&(t.disabled=!1,delete e.dc)}}#q(e,t,r,i,n){if(i&&t&&!t.reportValidity())return;let s=t?new FormData(t):new FormData,o=t?new Set(t.elements):new Set;if(!t){if(i&&e.reportValidity&&!e.reportValidity())return;this.#Ze(e,o,s,n)}r&&r.name&&(s.append(r.name,r.value),o.add(r));let a=this.#S(e,"hx-include");if(a)for(let t of this.#be(e,a)){if(i&&t.reportValidity&&!t.reportValidity())return;this.#Ze(t,o,s)}return s}#Ze(e,t,r,i){let n=e.tagName,s=[];"BUTTON"===n||n.includes("-")?s=[e]:!["INPUT","SELECT","TEXTAREA","FIELDSET"].includes(n)&&i||(s=this.#j(e,"[name]:not(button)"));for(let e of s){let i=e.name||e.getAttribute?.("name");if(!i||e.matches(":disabled")||t.has(e))continue;t.add(e);let n=e.type;if("checkbox"===n||"radio"===n||"INPUT"!==e.tagName&&"checked"in e)e.checked&&r.append(i,e.value);else if("file"===n)for(let t of e.files)r.append(i,t);else if("select-multiple"===n)for(let t of e.selectedOptions)r.append(i,t.value);else if(Array.isArray(e.value))for(let t of e.value)r.append(i,t);else r.append(i,e.value)}}#T(t,r,i,n={}){let s=this.#S(t,r);if(!s)return null;let o=this.#ie(s);if(o)return 0!==o.indexOf("{")&&(o="{"+o+"}"),this.#I(t,n,o,!0).then(e=>{i(e)});i(e.parse(s))}#et(e){let t=e.trim();return t.startsWith("<")&&t.endsWith("/>")?t.slice(1,-2):t}#be(t,r,i,n){let s=r??t,o=r?this.#Ge(t)||document.body:document;if(s.startsWith("global "))return this.#be(o,s.slice(7),i,!0);let a=s?e.split(s):[],l=[],c=[];for(const e of a){let t,r=this.#et(e);if(r.startsWith("closest "))t=o.closest(r.slice(8));else if(r.startsWith("find "))t=o.querySelector(r.slice(5));else if(r.startsWith("findAll "))l.push(...o.querySelectorAll(r.slice(8)));else if("next"===r||"nextElementSibling"===r)t=o.nextElementSibling;else if(r.startsWith("next "))t=this.#tt(o,r.slice(5),!!n);else if("previous"===r||"previousElementSibling"===r)t=o.previousElementSibling;else if(r.startsWith("previous "))t=this.#rt(o,r.slice(9),!!n);else if("document"===r)t=document;else if("window"===r)t=window;else if("body"===r)t=document.body;else if("host"===r)t=o.getRootNode().host;else if("this"===r){if(i){l.push(...this.#R(o,i));continue}t=o}else c.push(r);t&&l.push(t)}if(c.length>0){let e=c.join(","),t=this.#it(o,!!n);l.push(...t.querySelectorAll(e))}return[...new Set(l)]}#tt(e,t,r){return this.#nt(this.#it(e,r).querySelectorAll(t),e,Node.DOCUMENT_POSITION_PRECEDING)}#rt(e,t,r){let i=[...this.#it(e,r).querySelectorAll(t)].reverse();return this.#nt(i,e,Node.DOCUMENT_POSITION_FOLLOWING)}#nt(e,t,r){for(const i of e)if(i.compareDocumentPosition(t)===r)return i}#it(e,t){return e.isConnected&&e.getRootNode?e.getRootNode?.({composed:t}):document}#ee(e,t,r){let i=this.#be(e,t,r)[0];return i||console.warn(`htmx: '${t}' on ${r} did not match any element`,{elt:e,selector:t,attr:r}),i}#Ve(e,t,r){return this.#be(e,t,r)[0]}#ie(e){if(null!=e){if(e.startsWith("js:"))return e.substring(3);if(e.startsWith("javascript:"))return e.substring(11)}}#ae(e){let t=this.#k(e);if(t.abortInitialized)return;t.abortInitialized=!0;let r=()=>{this.#oe(e).abort()};e.addEventListener("htmx:abort",r),t.listeners.push({fromElt:e,eventName:"htmx:abort",handler:r})}#O(e,t,r){let{persistentIds:i,idMap:n}=this.#st(e,t),s=document.createElement("div");s.hidden=!0,document.body.after(s);let o={target:e,idMap:n,persistentIds:i,pantry:s,futureMatches:new WeakSet};r?this.#ot(o,e,t):this.#ot(o,e.parentNode,t,e,e.nextSibling),this.#ve(s),s.remove()}#ot(e,t,r,i=null,n=null){t instanceof HTMLTemplateElement&&r instanceof HTMLTemplateElement&&(t=t.content,r=r.content),i||=t.firstChild;let s=r.firstChild;for(;s;){let r;if(i&&i!=n&&(r=this.#at(e,s,i,n),r&&r!==i)){let o=i;for(;o&&o!==r;){let r=o;o=o.nextSibling,r instanceof Element&&(e.idMap.has(r)||this.#lt(e,r,s))?this.#qe(t,r,n):this.#ct(e,r)}}if(!r&&s instanceof Element&&e.persistentIds.has(s.id)){let n=CSS.escape(s.id);r=e.target.id===s.id&&e.target||e.target.querySelector(`[id="${n}"]`)||e.pantry.querySelector(`[id="${n}"]`);let o=r;for(;o=o.parentNode;){let t=e.idMap.get(o);t&&(t.delete(r.id),t.size||e.idMap.delete(o))}this.#qe(t,r,i)}if(r){this.#ht(r,s,e),i=r.nextSibling,s=s.nextSibling;continue}let o=s.nextSibling;if(e.idMap.has(s)){let r=document.createElement(s.tagName);t.insertBefore(r,i),this.#ht(r,s,e),this.process(r),i=r.nextSibling}else t.insertBefore(s,i),i=s.nextSibling;s=o}for(;i&&i!=n;){let t=i;i=i.nextSibling,this.#ct(e,t)}}#lt(e,t,r){if(e.futureMatches.has(t))return!0;for(let i=r.nextSibling,n=0;i&&na.has(e)))return c;if(!r){if(o>0&&c.isEqualNode(t))return c;n||(n=c)}}if(s+=r?.size||0,s>l)break;if(null!=document.activeElement?.selectionStart&&c.contains(document.activeElement))break;if(--o<1&&0===l)break;c=c.nextSibling}return n&&this.#lt(e,n,t)?null:n}#N(e,t){return e instanceof Element&&e.tagName===t.tagName&&(!("SCRIPT"===e.tagName&&!e.isEqualNode(t))&&(!e.id||e.id===t.id))}#ct(e,t){e.idMap.has(t)?this.#qe(e.pantry,t,null):(this.#ve(t),t.remove())}#qe(e,t,r){if(e.moveBefore)try{return void e.moveBefore(t,r)}catch(e){}e.insertBefore(t,r)}#ht(e,t,r){if(3===e.nodeType)return void(e.nodeValue!==t.nodeValue&&(e.nodeValue=t.nodeValue));if(this.config.morphSkip&&e.matches?.(this.config.morphSkip))return;if(!this.#$(e,"htmx:before:morph:node",{oldNode:e,newNode:t}))return;this.#Je(e,t),e instanceof HTMLTextAreaElement&&document.activeElement!==e&&e.defaultValue!=t.defaultValue&&(e.value=t.value),this.config.morphSkipChildren&&e.matches?.(this.config.morphSkipChildren)||e.isEqualNode(t)&&"TEMPLATE"!==t.tagName&&!t.querySelector?.("template")||this.#ot(r,e,t)}#Je(e,t){let r=this.config.morphIgnore||[],i=!1,n=e=>this.#w("hx-").some(t=>e.startsWith(t));for(const s of t.attributes)if(!r.some(e=>s.name.startsWith(e))&&e.getAttribute(s.name)!==s.value){if(n(s.name)&&(i=!0),!this.#$(e,"htmx:before:morph:attr",{attrName:s.name,newValue:s.value}))continue;e.setAttribute(s.name,s.value),"value"===s.name&&e instanceof HTMLInputElement&&"file"!==e.type&&document.activeElement!==e&&(e.value=s.value)}for(let s=e.attributes.length-1;s>=0;s--){let o=e.attributes[s];if(o&&!t.hasAttribute(o.name)&&!r.some(e=>o.name.startsWith(e))){if(n(o.name)&&(i=!0),!this.#$(e,"htmx:before:morph:attr",{attrName:o.name,newValue:null}))continue;e.removeAttribute(o.name)}}i&&this.#ve(e,!0)}#ut(e,t,r,i){for(const n of i)if(t.has(n.id)){let t=n;for(;t&&t!==r;){let r=e.get(t);null==r&&(r=new Set,e.set(t,r)),r.add(n.id),t=t.parentElement}}}#st(e,t){let r=this.#j(e,"[id]"),i=t.querySelectorAll("[id]"),n=this.#dt(r,i),s=new Map;return this.#ut(s,n,e.parentElement,r),this.#ut(s,n,t,i),{persistentIds:n,idMap:s}}#dt(e,t){let r=new Set,i=new Map;for(const{id:t,tagName:n}of e)i.has(t)?r.add(t):t&&i.set(t,n);let n=new Set;for(const{id:e,tagName:s}of t)n.has(e)?r.add(e):i.get(e)===s&&n.add(e);for(const e of r)n.delete(e);return n}#fe(t){let r=t.response.raw.status,i=this.config.noSwap.map(e=>e+""),n=r+"";for(let r of[n,n.slice(0,2)+"x",n[0]+"xx"]){if(i.includes(r))return void(t.swap="none");let n=this.#S(t.sourceElement,"hx-status:"+r);if(n)return void e.merge(n,t)}}#Fe(e,t){return new Promise(r=>{this.#m||=[],this.#m.push({task:e,resolve:r,ctx:t}),this.#x||this.#ft()})}async#ft(){if(0===this.#m.length||this.#x)return;this.#x=!0;let{task:e,resolve:t,ctx:r}=this.#m.shift();try{if(document.startViewTransition){let t={task:e,ctx:r};this.#M(r.sourceElement,"htmx:before:viewTransition",t),await document.startViewTransition(t.task).finished,this.#M(r.sourceElement,"htmx:after:viewTransition",t)}else await e()}catch(e){}finally{this.#x=!1,t(),this.#ft()}}#Ue(e,t){let r=t.querySelectorAll("[id]"),i=Object.fromEntries([...r].map(e=>[e.id,e])),n=e.querySelectorAll("[id]"),s=[];for(let e of n){let t=i[e.id];if(t?.tagName===e.tagName){let r=e.cloneNode(!1);this.#Je(e,t),s.push(()=>{this.#Je(e,r)})}}return s}#ze(e,t){e?.classList?.add?.(t)}#Qe(e,t){e?.classList?.remove?.(t),0===e?.classList?.length&&e.removeAttribute("class")}#Ge(e){return"string"==typeof e?this.find(e):e}#W(e){return this.config.metaCharacter?e.replace(/:/g,this.config.metaCharacter):e}}})();htmx.version+="-htmax",htmx.config.historyCache??={disable:!0},(()=>{let e,t=new Set;function r(e){for(let t of Object.keys(e))"last-event-id"===t.toLowerCase()&&delete e[t]}async function*i(e){let t=e.reader,r=e.lastEventId,i=new TextDecoder,n="",s=!1,o=!1,a={data:"",event:"",retry:null},l=!0;try{for(;;){let{done:e,value:c}=await t.read();if(e)break;let h=i.decode(c,{stream:!0});l&&(65279===h.charCodeAt(0)&&(h=h.slice(1)),l=!1),n+=h;let u=n.split(/\r\n|\r|\n/);n=u.pop()||"";for(let e of u){if(!e){(s||o||a.event)&&(yield{...a,id:r,hasData:s,hasId:o}),s=!1,o=!1,a={data:"",event:"",retry:null};continue}let t,i,n=e.indexOf(":");if(0!==n)if(n<0?(t=e,i=""):(t=e.slice(0,n),i=e.slice(n+1)," "===i[0]&&(i=i.slice(1))),"data"===t)a.data+=(s?"\n":"")+i,s=!0;else if("event"===t)a.event=i;else if("id"===t)i.includes("\0")||(r=i,o=!0);else if("retry"===t){let e=parseInt(i,10);isNaN(e)||(a.retry=e)}}}}finally{t.releaseLock(),e.reader=null}}async function n(t,n){let o=t.sourceElement,a=function(t){let r=null!=e.attributeValue(t,"hx-sse:connect"),i=e.HCON.parse(e.attributeValue(t,"hx-config")).sse||{};return{reconnect:r,reconnectDelay:500,reconnectMaxDelay:6e4,reconnectMaxAttempts:1/0,reconnectJitter:.3,pauseOnBackground:r,releaseOn:r?"immediate":"end",...htmx.config.sse,...i}}(o),l=!1;function c(){n&&(n(),n=null)}"immediate"===a.releaseOn&&c();let h={url:t.request.action,config:a,abortController:{abort:t.request.abort,signal:t.request.signal},reader:null,lastEventId:"",delayCanceller:null,visibilityHandler:null,attempt:0,cancelled:!1,status:null};e.htmxProp(o).sse=h;let u=!1,d=null;if(a.pauseOnBackground){let e=()=>{document.hidden?(u=!0,h.reader?.cancel()):u&&(u=!1,d&&d())};document.addEventListener("visibilitychange",e),h.visibilityHandler=e}if(h.cancelled=!1,!e.triggerHtmxEvent(o,"htmx:sse:before:connection",{connection:h})||h.cancelled)return void s(o,"cancelled");h.status=t.response.status,e.triggerHtmxEvent(o,"htmx:sse:after:connection",{connection:h});let f=t.response.raw;try{for(;o.isConnected;){if(h.attempt>0){if(u){if(await new Promise(e=>{d=e}),d=null,!o.isConnected)break;h.attempt=1,l=!0}if(!l&&(!a.reconnect||h.attempt>a.reconnectMaxAttempts))break;let i=htmx.parseInterval(a.reconnectDelay)??a.reconnectDelay,n=htmx.parseInterval(a.reconnectMaxDelay)??a.reconnectMaxDelay,s=Math.min(i*Math.pow(2,h.attempt-1),n);if(a.reconnectJitter>0){let e=s*a.reconnectJitter;s=Math.max(0,s+(2*Math.random()-1)*e)}if(h.cancelled=!1,!e.triggerHtmxEvent(o,"htmx:sse:before:connection",{connection:h})||h.cancelled)break;if(await new Promise(e=>{h.delayCanceller=e,setTimeout(e,s)}),h.delayCanceller=null,!o.isConnected)break;let c=new AbortController;h.abortController=c;try{r(t.request.headers),h.lastEventId&&(t.request.headers["Last-Event-ID"]=h.lastEventId),f=await fetch(t.request.action,{...t.request,signal:c.signal})}catch(t){if(c.signal.aborted)break;e.triggerHtmxEvent(o,"htmx:sse:error",{connection:h,error:t}),l=!1,h.attempt++;continue}if(!f.ok){e.triggerHtmxEvent(o,"htmx:sse:error",{connection:h,error:new Error(`SSE reconnect failed with status ${f.status}`),status:f.status}),l=!1,h.attempt++;continue}h.status=f.status,e.triggerHtmxEvent(o,"htmx:sse:after:connection",{connection:h}),h.attempt=0}l=!1;try{h.reader=f.body.getReader();for await(let n of i(h)){if(!o.isConnected||l)break;if(n.hasId&&(h.lastEventId=n.id,n.id||r(t.request.headers)),!n.hasData&&!n.event)continue;let i=[],u={connection:h,message:{data:n.data,event:n.event,id:n.id},cancelled:!1,waitUntil:e=>i.push(Promise.resolve(e))},d=e.triggerHtmxEvent(o,"htmx:sse:before:message",u);if(await Promise.all(i),d&&!u.cancelled){if(null!=n.retry&&(a.reconnectDelay=n.retry),u.message.event){"hx:release"===u.message.event&&c(),htmx.trigger(o,u.message.event,{data:u.message.data,id:u.message.id}),e.triggerHtmxEvent(o,"htmx:sse:after:message",{connection:h,message:u.message});let t=e.attributeValue(o,"hx-sse:close");if(t&&u.message.event===t)return void s(o,"message");continue}t.text=u.message.data,t.swap.includes("swapEmpty")||(t.swap+=" swapEmpty:false"),await htmx.swap(t),"first"===a.releaseOn&&c(),e.triggerHtmxEvent(o,"htmx:sse:after:message",{connection:h,message:u.message})}}}catch(t){h.abortController?.signal?.aborted||"AbortError"===t.name||e.triggerHtmxEvent(o,"htmx:sse:error",{connection:h,error:t})}if(!o.isConnected)break;h.attempt++}}finally{c(),s(o,o.isConnected?"ended":"removed")}}function s(t,r){let i=t?._htmx?.sse;i&&(i.abortController?.abort(),i.reader?.cancel?.(),i.delayCanceller&&i.delayCanceller(),i.visibilityHandler&&document.removeEventListener("visibilitychange",i.visibilityHandler),e.triggerHtmxEvent(t,"htmx:sse:close",{connection:i,reason:r||"cleanup"}),delete t._htmx.sse)}htmx.registerExtension("sse",{init:t=>{e=t},htmx_config_request:(e,{ctx:{request:t}})=>{t.headers.Accept=`${t.headers.Accept??t.headers.accept??"text/html"}, text/event-stream`},htmx_before_response:(t,r)=>{let i,s=r.ctx,o=s.response.raw.headers.get("Content-Type");if(o?.includes("text/event-stream"))return clearTimeout(s.requestTimeout),s.extensionPromise=new Promise(e=>i=e),n(s,i).catch(r=>{"AbortError"!==r.name&&e.triggerHtmxEvent(t,"htmx:sse:error",{error:r,url:s.request.action})}),!1},htmx_after_process:r=>{let i=htmx.config.metaCharacter||":",n=r=>{!function(e){for(let r of["sse-connect","sse-close","sse-swap"])e.hasAttribute(r)&&!t.has(r)&&("sse-swap"===r?console.warn("htmx: [hx-sse] sse-swap is removed in htmx 4. Unnamed SSE messages are swapped automatically. Named events are dispatched as DOM events."):console.warn(`htmx: [hx-sse] legacy attribute ${r} is deprecated; use hx-sse:${r.slice(4)} instead`),t.add(r))}(r);for(let e of["connect","close"]){let t=`sse-${e}`;if(!r.hasAttribute(t))continue;let n=(htmx.config.prefix||"hx-")+"sse"+i+e;r.hasAttribute(n)||r.setAttribute(n,r.getAttribute(t))}!function(t){let r=e.attributeValue(t,"hx-sse:connect");if(!r)return;if(t._htmx?.sse)return;let i=e.attributeValue(t,"hx-trigger")||"load";e.onTrigger(t,i,()=>{t._htmx?.sse||htmx.ajax("GET",r,{source:t})})}(r)};n(r);let s=`[${CSS.escape("hx-sse"+i+"connect")}]`;htmx.config.prefix&&(s+=`,[${CSS.escape(htmx.config.prefix+"sse"+i+"connect")}]`),r.querySelectorAll(`${s},[sse-connect],[sse-close],[sse-swap]`).forEach(n)},htmx_before_cleanup:e=>{s(e)}})})(),(()=>{let e;function t(e){let t=htmx.config.metaCharacter||":",r=`[${CSS.escape("hx-ws"+t+e)}]`;return htmx.config.prefix&&(r+=`,[${CSS.escape(htmx.config.prefix+"ws"+t+e)}]`),r}function r(t){let r=e.HCON.parse(e.attributeValue(t,"hx-config")).ws||{};return{reconnect:!0,reconnectCodes:[1001,1005,1006,1011,1012,1013,1014],reconnectDelay:500,reconnectMaxDelay:6e4,reconnectMaxAttempts:1/0,reconnectJitter:.3,pauseOnBackground:!0,maxOutgoingMessagesQueueSize:100,...htmx.config.ws,...r}}function i(e){if(e.startsWith("ws://")||e.startsWith("wss://"))return e;if(e.startsWith("http://"))return"ws://"+e.slice(7);if(e.startsWith("https://"))return"wss://"+e.slice(8);let t="https:"===window.location.protocol?"wss:":"ws:",r=window.location.host;return e.startsWith("//")?t+e:e.startsWith("/")?t+"//"+r+e:t+"//"+r+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/")+1)+e}const n=new Set;function s(e,t){if(t.timer&&clearTimeout(t.timer),t.visibilityHandler&&document.removeEventListener("visibilitychange",t.visibilityHandler),t.abortController&&t.abortController.abort(),t.queue.length=0,t.socket)try{t.socket.readyState!==WebSocket.OPEN&&t.socket.readyState!==WebSocket.CONNECTING||t.socket.close()}catch(e){}e._htmx?.ws?.connection===t&&delete e._htmx.ws.connection,n.delete(t)}function o(t,r){let i=r.url;if(r.abortController&&r.abortController.abort(),r.socket){let e=r.socket;r.socket=null;try{e.readyState!==WebSocket.OPEN&&e.readyState!==WebSocket.CONNECTING||e.close()}catch(e){}}try{r.socket=new WebSocket(i,r.config?.protocols);let l=new AbortController;r.abortController=l;let c={signal:l.signal};r.socket.addEventListener("open",()=>{t.isConnected?(e.triggerHtmxEvent(t,"htmx:ws:after:connection",{connection:r}),r.attempt=0,function(e){for(;e.queue.length&&e.socket?.readyState===WebSocket.OPEN;){let t=e.queue.shift();a(e,t.element,t.message)}}(r)):s(t,r)},c),r.socket.addEventListener("message",i=>{r.receiving=r.receiving.then(()=>async function(t,r,i){let n=[],o={data:i.data,text(){let e=o.data;return"string"==typeof e?Promise.resolve(e):e instanceof Blob?e.text():Promise.resolve((new TextDecoder).decode(e))},json:()=>o.text().then(JSON.parse)};if(!t.isConnected)return void s(t,r);let a={connection:r,message:o,cancelled:!1,waitUntil(e){n.push(Promise.resolve(e))}},l=e.triggerHtmxEvent(t,"htmx:ws:before:message:incoming",a);if(await Promise.all(n),!l||a.cancelled)return;let c,h=null;if("string"==typeof o.data)try{h=await o.json()}catch(e){c=await o.text()}h&&(void 0!==h.content?c=h.content:void 0!==h.payload&&(c=h.payload,r._payloadWarnFired||(console.warn("htmx: [hx-ws] json.payload is deprecated; use json.content instead"),r._payloadWarnFired=!0)));if(null!=c){let r=h?.target||e.attributeValue(t,"hx-target"),i=h?.swap||e.attributeValue(t,"hx-swap")||htmx.config.defaultSwap;/(?:^|\s)swapEmpty(?::(?:true|false))?(?=\s|$)/.test(i)||(i+=" swapEmpty:false"),await htmx.swap({sourceElement:t,target:r||t,swap:i,select:h?.select??e.attributeValue(t,"hx-select"),selectOOB:e.attributeValue(t,"hx-select-oob"),text:c,transition:!1})}e.triggerHtmxEvent(t,"htmx:ws:after:message:incoming",{connection:r,message:o})}(t,r,i)).catch(i=>{t.isConnected&&e.triggerHtmxEvent(t,"htmx:ws:error",{connection:r,error:i})})},c),r.socket.addEventListener("close",i=>{if(i.target!==r.socket)return;if(t.isConnected&&e.triggerHtmxEvent(t,"htmx:ws:close",{connection:r,reason:"closed",code:i.code}),!n.has(r))return;let a=r.config;a.pauseOnBackground&&document.hidden||(a.reconnect&&a.reconnectCodes.includes(i.code)&&t.isConnected?function(t,r){let i=r.config;r.attempt++;let n=r.attempt;if(!i.reconnect||n>i.reconnectMaxAttempts)return void s(t,r);let a=htmx.parseInterval(i.reconnectDelay)??i.reconnectDelay,l=htmx.parseInterval(i.reconnectMaxDelay)??i.reconnectMaxDelay,c=Math.min(a*Math.pow(2,n-1),l);if(i.reconnectJitter>0){let e=c*i.reconnectJitter;c=Math.max(0,c+(2*Math.random()-1)*e)}if(!t.isConnected)return void s(t,r);if(r.cancelled=!1,!e.triggerHtmxEvent(t,"htmx:ws:before:connection",{connection:r})||r.cancelled)return e.triggerHtmxEvent(t,"htmx:ws:close",{connection:r,reason:"cancelled",code:null}),void s(t,r);r.timer=setTimeout(()=>{t.isConnected?o(t,r):s(t,r)},c)}(t,r):s(t,r))},c),r.socket.addEventListener("error",i=>{t.isConnected&&e.triggerHtmxEvent(t,"htmx:ws:error",{connection:r,error:i})},c)}catch(i){t.isConnected&&e.triggerHtmxEvent(t,"htmx:ws:error",{connection:r,error:i})}}function a(t,r,i){try{t.socket.send(i.data),e.triggerHtmxEvent(r,"htmx:ws:after:message:outgoing",{connection:t,message:i})}catch(i){e.triggerHtmxEvent(r,"htmx:ws:error",{connection:t,error:i})}}function l(t){if(e.htmxProp(t).ws??={},t._htmx.ws.initialized)return;let s=e.attributeValue(t,"hx-ws:connect");if(!s)return;let a=e.attributeValue(t,"hx-trigger")||"load";e.onTrigger(t,a,()=>{!function(t,s){if(s._htmx.ws.connection)return s._htmx.ws.connection;let a={url:i(t),config:r(s),socket:null,attempt:0,timer:null,queue:[],receiving:Promise.resolve(),sending:Promise.resolve(),abortController:null,visibilityHandler:null,cancelled:!1};!e.triggerHtmxEvent(s,"htmx:ws:before:connection",{connection:a})||a.cancelled?e.triggerHtmxEvent(s,"htmx:ws:close",{connection:a,reason:"cancelled",code:null}):(s._htmx.ws.connection=a,n.add(a),o(s,a),a.config.pauseOnBackground&&(a.visibilityHandler=()=>{document.hidden?a.socket&&a.socket.readyState===WebSocket.OPEN&&a.socket.close():a.socket&&a.socket.readyState!==WebSocket.CLOSED||(a.attempt=0,o(s,a))},document.addEventListener("visibilitychange",a.visibilityHandler)))}(s,t)}),t._htmx.ws.initialized=!0}function c(r){if(e.htmxProp(r).ws??={},r._htmx.ws.sendInitialized)return;let s=e.attributeValue(r,"hx-trigger");s||(s=r.matches("form")?"submit":r.matches("input:not([type=button]):not([type=submit]),select,textarea")?"change":"click"),e.onTrigger(r,s,async s=>{r.matches("form")&&"submit"===s.type&&s.preventDefault(),await async function(r,s){let o=r.closest(t("connect")),l=o&&e.attributeValue(o,"hx-ws:connect");if(!l)return void e.triggerHtmxEvent(r,"htmx:ws:error",{url:null,error:"No WebSocket connection found for element"});let c=i(l),h=o._htmx?.ws?.connection;if(!h)return void e.triggerHtmxEvent(r,"htmx:ws:error",{url:c,error:"Connection not open"});let u={...e.createRequestContext(r,s).request.headers};delete u.Accept;let d=r.form||r.closest("form"),f=e.collectFormData(r,d,s.submitter),m={};for(let[e,t]of f)m[e]=e in m?[].concat(m[e],t):t;let p=e.getAttributeObject(r,"hx-vals",e=>Object.assign(m,e)),g=h.sending.then(async()=>{p&&await p,delete m.headers;let t=[],i={headers:u,values:m,data:void 0},s={connection:h,message:i,cancelled:!1,waitUntil(e){t.push(Promise.resolve(e))}},o=e.triggerHtmxEvent(r,"htmx:ws:before:message:outgoing",s);try{if(await Promise.all(t),!o||s.cancelled)return;if(i.data??=JSON.stringify({...i.values,headers:i.headers}),!n.has(h))return void e.triggerHtmxEvent(r,"htmx:ws:error",{connection:h,error:"Connection closed"});h.socket?.readyState===WebSocket.OPEN?a(h,r,i):h.queue.length>=h.config.maxOutgoingMessagesQueueSize?e.triggerHtmxEvent(r,"htmx:ws:error",{connection:h,error:"Outgoing messages queue is full"}):h.queue.push({element:r,message:i})}catch(t){e.triggerHtmxEvent(r,"htmx:ws:error",{connection:h,error:t})}});h.sending=g.catch(()=>{}),await g}(r,s)}),r._htmx.ws.sendInitialized=!0}htmx.registerExtension("ws",{init:t=>{e=t,htmx.config.ws||(htmx.config.ws={})},htmx_after_process:r=>{const i=t=>{!function(e){if(e.hasAttribute("ws-connect")||e.hasAttribute("ws-send")){if(console.warn("htmx: [hx-ws] legacy attributes ws-connect and ws-send are deprecated; use hx-ws:connect and hx-ws:send instead"),e.hasAttribute("ws-connect")){let t=e.getAttribute("ws-connect"),r=htmx.config.metaCharacter||":",i=(htmx.config.prefix||"hx-")+"ws"+r+"connect";e.hasAttribute(i)||e.setAttribute(i,t)}if(e.hasAttribute("ws-send")){let t=htmx.config.metaCharacter||":",r=(htmx.config.prefix||"hx-")+"ws"+t+"send";e.hasAttribute(r)||e.setAttribute(r,"")}}}(t);let r=e.attributeValue(t,"hx-ws:send");null!=e.attributeValue(t,"hx-ws:connect")&&l(t),null!=r&&c(t)};i(r);let n=t("connect")+","+t("send")+",[ws-connect],[ws-send]";r.querySelectorAll(n).forEach(i)},htmx_before_cleanup:t=>{!function(t){let r=t._htmx?.ws?.connection;r&&(e.triggerHtmxEvent(t,"htmx:ws:close",{connection:r,reason:"removed",code:null}),s(t,r))}(t)}}),"undefined"!=typeof window&&window.htmx&&window.addEventListener("pagehide",()=>{n.forEach(e=>{e.socket&&e.socket.close(1e3,"page navigating away")})})})(),(()=>{let e;htmx.registerExtension("preload",{init:t=>{e=t},htmx_after_init:t=>{!function(t){let r=e.attributeValue(t,"hx-preload");if(null==r&&!t._htmx?.boosted)return;let i=[],n=5e3;if(r){let t=e.parseTriggerSpecs(r);if(0===t.length)return;for(const e of t)i.push(e.name),e.timeout&&(n=htmx.parseInterval(e.timeout))}else{let r=t._htmx?.boosted&&"A"===t.tagName,s=null!=e.attributeValue(t,"hx-get");if(!r&&!s)return;if(r&&!1===htmx.config?.preload?.autoBoost)return;htmx.config?.preload?.boostTimeout&&(n=htmx.parseInterval(htmx.config.preload.boostTimeout)),i.push(htmx.config?.preload?.boostEvent||"mousedown"),i.push("touchstart")}let s=async r=>{let{method:i}=e.determineMethodAndAction(t,r);if("GET"!==i)return;if(t._htmx?.preload)return;let s=e.createRequestContext(t,r),o=t.form||t.closest("form"),a=e.collectFormData(t,o,r.submitter),l=e.getAttributeObject(t,"hx-vals",e=>{for(let t in e)a.set(t,e[t])});l&&await l;let c=s.request.action.replace?.(/#.*$/,""),h=new URLSearchParams(a);h.size&&(c+=(/\?/.test(c)?"&":"?")+h);let u=new URL(c,location.href);t._htmx.preload={prefetch:fetch(c,s.request),action:u.origin===location.origin?u.pathname+u.search:u.href,expiresAt:Date.now()+n};try{await t._htmx.preload.prefetch}catch(e){delete t._htmx.preload}};for(let e of i)t.addEventListener(e,s,{passive:!0});t._htmx.preloadListener=s,t._htmx.preloadEvents=i}(t)},htmx_before_request:(e,t)=>{let{ctx:r}=t;if(e._htmx?.preload&&e._htmx.preload.action===r.request.action&&Date.now()t,delete e._htmx.preload}else e._htmx&&delete e._htmx.preload},htmx_before_cleanup:e=>{if(e._htmx?.preloadListener)for(let t of e._htmx.preloadEvents)e.removeEventListener(t,e._htmx.preloadListener)}})})(),(()=>{if("undefined"==typeof navigation)return;let e,t=0,r=new Set,i=null;function n(){navigation.addEventListener("navigate",e=>{if(!e.canIntercept)return;let n,s=history.state;e.intercept({handler:()=>new Promise(e=>{n=e}),scroll:"manual",focusReset:"manual"}),e.signal.addEventListener("abort",()=>{t>0&&(r.forEach(e=>e()),r.clear(),t=0),i=null}),i=()=>{n(),history.replaceState(s,"")}},{once:!0}),navigation.navigate(location.href,{history:"replace"})}function s(){i&&(i(),i=null)}htmx.registerExtension("browser-indicator",{init:t=>{e=t},htmx_before_history_update:()=>{s()},htmx_before_request:(i,s)=>{(function(t){let r=e.attributeValue(t,"hx-browser-indicator");return null!=r&&"false"!==r||!(!htmx.config.boostBrowserIndicator||!t._htmx?.boosted)})(i)&&(s.ctx._browserIndicator=!0,t++,1===t&&n(),s.ctx.request?.abort&&r.add(s.ctx.request.abort))},htmx_finally_request:(e,i)=>{i.ctx._browserIndicator&&(i.ctx.request?.abort&&r.delete(i.ctx.request.abort),0!==t&&(t--,0===t&&s()))}})})(),(()=>{let e;function t(t,r,i){return(async()=>{let n=+r.headers.get("Content-Length")||null;e.triggerHtmxEvent(t,"htmx:download:start",{total:n});let s=r.body.getReader(),o=[],a=0;for(;;){let{done:r,value:i}=await s.read();if(r)break;o.push(i),a+=i.length,e.triggerHtmxEvent(t,"htmx:download:progress",{loaded:a,total:n,percent:n?Math.round(a/n*100):null})}let l=new Blob(o,{type:r.headers.get("Content-Type")||"application/octet-stream"}),c=function(e,t){let r=e.get("Content-Disposition");if(r){let e=r.match(/filename\*?=['"]?(?:UTF-8'')?([^'";]+)/i);if(e)return decodeURIComponent(e[1])}return t.split("/").pop().split("?")[0]||"download"}(r.headers,i),h=URL.createObjectURL(l);Object.assign(document.createElement("a"),{href:h,download:c}).click(),URL.revokeObjectURL(h),e.triggerHtmxEvent(t,"htmx:download:complete",{filename:c,size:l.size})})()}htmx.registerExtension("download",{init:t=>{e=t},htmx_before_response:(e,{ctx:r})=>{let i=r.response.headers.get("HX-Download");if(i)return void(async()=>{t(r.sourceElement,await fetch(i),i)})();let n=r.response.headers.get("Content-Disposition");return"download"===r.swap||n?.includes("attachment")?(clearTimeout(r.requestTimeout),r.extensionPromise=t(r.sourceElement,r.response.raw,r.request.action),!1):void 0}})})(),(()=>{let e;function t(e){if(e.pendingDiv){e.pendingDiv.remove();for(let t of e.pendingHidden)t.style.display=""}}htmx.registerExtension("hx-pending",{init:t=>{e=t},htmx_config_request:(e,t)=>{let r=t.ctx.request.body;r?.entries&&(t.ctx.pendingBody=r)},htmx_before_request:(t,r)=>{!function(t){if(t.pending=e.attributeValue(t.sourceElement,"hx-pending"),!t.pending)return;let r=document.querySelector(t.pending);if(!r)return;let i=t.target;if("string"==typeof i&&(i=document.querySelector(i)),!i)return;let n=document.createElement("div");n.style.cssText="all: initial",n.classList.add("hx-pending");let s=r instanceof HTMLTemplateElement?r.content.childNodes:r.childNodes;for(let e of s)n.appendChild(e.cloneNode(!0));if(t.pendingBody){let e=new Set(t.pendingBody.keys());for(let r of e){let e=t.pendingBody.getAll(r).filter(e=>"string"==typeof e);if(!e.length)continue;let i=1===e.length?e[0]:JSON.stringify(e);try{n.dataset[r]=i}catch(e){try{n.setAttribute("data-"+r,i)}catch(e){}}}}let o="before"===(a=t.swap)?"beforebegin":"after"===a?"afterend":"prepend"===a?"afterbegin":"append"===a?"beforeend":a;var a;if(t.pendingHidden=[],"innerHTML"===o){for(let e of i.children)e.style.display="none",t.pendingHidden.push(e);i.appendChild(n)}else["beforebegin","afterbegin","beforeend","afterend"].includes(o)?i.insertAdjacentElement(o,n):(i.style.display="none",t.pendingHidden.push(i),i.after(n));t.pendingDiv=n,htmx.process(n)}(r.ctx)},htmx_error:(e,r)=>{t(r.ctx)},htmx_before_swap:(e,r)=>{t(r.ctx)}})})(),(()=>{let e;htmx.registerExtension("hx-targets",{init:t=>{e=t},htmx_before_swap:(t,r)=>{let{ctx:i,tasks:n}=r,s=e.attributeValue(i.sourceElement,"hx-targets");if(!s)return;let o=htmx.findAll(i.sourceElement,s);if(!o.length)return void console.warn(`htmx: '${s}' on hx-targets did not match any elements`,{selector:s});let a=n.findIndex(e=>"main"===e.type);if(-1===a)return;let l=n[a],c=Array.from(o).map(e=>({...l,fragment:l.fragment.cloneNode(!0),target:e}));n.splice(a,1,...c)}})})(),(()=>{let e,t=new Set,r=!1,i=Symbol(),n=null,s=null,o=null,a=0,l=!1;const c={childList:!0,subtree:!0,attributes:!0,characterData:!0};let h=null;function u(){r||a>0||(r=!0,queueMicrotask(()=>{n?.disconnect();let e=performance.now();t.forEach(e=>e());let i=performance.now()-e;!l&&i>16&&(console.warn(`htmx: hx-live expressions took ${i.toFixed(1)}ms.`),l=!0),0===t.size?n&&(clearTimeout(h),h=null,document.removeEventListener("input",o,!0),o=null,document.removeEventListener("change",s,!0),n.disconnect(),n=null,s=null,l=!1):n.observe(document.documentElement,c),r=!1}))}let d=new Set("disabled required readonly open inert multiple autofocus novalidate default reversed loop muted controls autoplay playsinline formnovalidate async defer ismap typemustmatch allowfullscreen itemscope nomodule alpha headingreset".split(" ")),f=new Set("checked value selected hidden".split(" ")),m=new Set("contenteditable draggable spellcheck writingsuggestions".split(" ")),p=new Set("tabindex colspan rowspan maxlength minlength size span start rows cols width height min max step low high optimum".split(" "));function g(e,t){return e instanceof HTMLElement?t.toLowerCase():t}function x(e,t){if((t=g(e,t)).startsWith("aria-"))return function(e,t){let r=e?.getAttribute("aria-"+t);return null==r?void 0:O.has(t)?r:N.has(t)?r.trim()?r.trim().split(/\s+/):[]:q(r)}(e,t.slice(5));if(t.startsWith("data-"))return function(e,t){let r=e.getAttribute(t);return null===r?void 0:q(r)}(e,t);if("value"===t&&("number"===e.type||"range"===e.type))return""===e.value?null:e.valueAsNumber;if(f.has(t))return e[t];if(d.has(t)||t.startsWith("shadowroot")&&"shadowrootmode"!==t&&"shadowrootslotassignment"!==t)return e.hasAttribute(t);let r=e.getAttribute(t);if(null!=r&&m.has(t))try{return JSON.parse(r.toLowerCase())}catch{}return p.has(t)&&r?.trim()&&isFinite(r)?+r:r}function b(e,t,r){if(t=g(e,t),"function"==typeof r&&(r=r(x(e,t)),"function"==typeof r?.then))throw new TypeError("hx-live: assignment returned a promise");t.startsWith("aria-")?function(e,t,r){let i="aria-"+t;null==r?e.removeAttribute(i):e.setAttribute(i,N.has(t)&&Array.isArray(r)?r.join(" "):String(r))}(e,t.slice(5),r):t.startsWith("data-")?function(e,t,r){void 0===r?e.removeAttribute(t):e.setAttribute(t,"object"==typeof r||q(r)!==r?JSON.stringify(r):r)}(e,t,r):f.has(t)?function(e,t,r){if("checked"===t||"selected"===t){let i=!!r;e[t]=i,e.toggleAttribute(t,i)}else!1===r||null==r?(e[t]="boolean"!=typeof e[t]&&"",e.removeAttribute(t)):!0===r?(e[t]=!0,e.setAttribute(t,"")):(e[t]=r,e.setAttribute(t,String(r)))}(e,t,r):d.has(t)||t.startsWith("shadowroot")&&"shadowrootmode"!==t&&"shadowrootslotassignment"!==t?e.toggleAttribute(t,!!r):null==r?e.removeAttribute(t):e.setAttribute(t,String(r))}function y(e,t){return t?new Set(e.map(t)):e}function v(e,t){let r=e.prefix;return r+("data-"===r?C(t):r?t.toLowerCase():t)}function w(e,t,r){if(!e.cascades)return e.prefix?t.hasAttribute(r)&&t:t;for(;t&&!t.hasAttribute(r);)t=t.parentElement;return t}function S(e,t,r,i){if("string"!=typeof t)return!1;let n=v(e,t);return y(e.elts,e.cascades&&(t=>w(e,t,n)||!i&&t)).forEach(e=>e&&b(e,n,r)),!0}let E={get:(e,t)=>{if(!e.prefix&&"class"===t)return e.scope.class;if("string"!=typeof t)return;let r=v(e,t),i=e.elts[0]&&w(e,e.elts[0],r);return i?x(i,r):void 0},set:(e,t,r)=>S(e,t,r),deleteProperty:(e,t)=>S(e,t,void 0,!0),has:(e,t)=>"data-"===e.prefix&&"string"==typeof t&&!!e.elts[0]&&!!w(e,e.elts[0],v(e,t)),ownKeys:e=>{if("data-"!==e.prefix)return[];let t=[],r=new Set;for(let i=e.elts[0];i;i=e.cascades?i.parentElement:null)for(let e of Object.keys(i.dataset))"htmxPowered"===e||r.has(e)||(r.add(e),t.push(e));return t},getOwnPropertyDescriptor:(e,t)=>{if("data-"===e.prefix&&"string"==typeof t&&"htmxPowered"!==t)return e.elts[0]&&w(e,e.elts[0],v(e,t))?{enumerable:!0,configurable:!0}:void 0}};function A(e,t,r,i=""){return new Proxy({elts:e,cascades:t,scope:r,prefix:i},E)}function C(e){return e.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function q(e){try{return JSON.parse(e)}catch{return e}}let T=/(['"`\/])(?:\\.|(?!\1).)*\1|(?t?"`"===t?e.replace(/\$\{((?:[^{}]|\{[^{}]*\})*)\}/g,(e,t)=>"${"+_(t)+"}"):e:"attr.class")}let O=new Set("activedescendant details errormessage keyshortcuts label placeholder roledescription valuetext".split(" ")),N=new Set("controls describedby dropeffect flowto labelledby owns relevant".split(" "));function H(e,t){return!!e?.classList.contains(t)}function k(e,t,r){if("function"==typeof r&&(r=r(H(e,t)),"function"==typeof r?.then))throw new TypeError("hx-live: assignment returned a promise");e.classList.toggle(t,!!r),e.classList.length||e.removeAttribute("class")}function M(e,t){let r,i,n,s,o={get data(){return r||=A(e,t,null,"data-")},get aria(){return i||=A(e,t,null,"aria-")},get class(){return n||=function(e,t=!1){let r=e[0],i=(e,r)=>t?e.closest("."+CSS.escape(r)):e,n=e=>H(r&&i(r,e),e),s=(t,r)=>y(e,e=>i(e,t)||e).forEach(e=>k(e,t,r)),o={assign(t){t&&"object"==typeof t&&!Array.isArray(t)?P(s,t):console.warn("hx-live: class.assign expects an object.",{elts:e})},add:(...e)=>e.forEach(e=>s(e,!0)),remove:(...e)=>e.forEach(e=>s(e,!1)),contains:n,toggle(e,t){let r=t??!n(e);return s(e,e=>t??!e),r},replace(r,i){if(t)return!!n(r)&&(s(r,!1),s(i,!0),!0);let o;for(let t=0;t{if("string"==typeof i&&o[i])return o[i];let s=!t&&r?.classList;if(s&&i in s){let e=s[i];return"function"==typeof e?e.bind(s):e}return r?"string"==typeof i?n(i):void 0:i===Symbol.iterator?()=>[][Symbol.iterator]():void 0},set:(r,i,n)=>{if("string"!=typeof i)return!1;if(t||"value"!==i)s(i,n);else for(let t of e)t.classList.value=n;return!0},deleteProperty:(e,t)=>"string"==typeof t&&(s(t,!1),!0),has:(e,t)=>"string"==typeof t&&n(t),ownKeys:()=>!t&&r?[...r.classList]:[],getOwnPropertyDescriptor:(e,r)=>!t&&n(r)?{enumerable:!0,configurable:!0}:void 0})}(e,t)},get attr(){return s||=A(e,t,o)}};return o}function I(e){let t;return new Proxy(function(){},{apply:(t,r,[i])=>{let n=new Set;for(let t of e){let e=t.closest?.(i);e&&n.add(e)}return X([...n])},get:(r,i)=>(t||=M(e,!0))[i]})}function L(t,r,i){"class"===r?function(t,r){let i=e.htmxProp(t),n=i.liveClasses||new Set,s=new Set(P((e,r)=>k(t,e,r),r));for(let e of n)s.has(e)||k(t,e,!1);i.liveClasses=s}(t,i):k(t,r.slice(1),i)}function P(e,t){let r=[];if("string"==typeof t&&(t={[t]:!0}),t&&"object"==typeof t)for(let[i,n]of Object.entries(t))for(let t of i.trim().split(/\s+/).filter(Boolean))r.push(t),e(t,!!n);return r}function D(e,t,r){let i=t.startsWith("."),n=i?t.slice(1):t,s=t.startsWith("aria-"),o=i?"."+n:"["+t+"]",a=null==r?e[0]?.parentElement:r.nodeType?r:null,l=a?[a,...a.querySelectorAll(o)]:e.length?document.querySelectorAll("string"==typeof r?r:r?.from||o):[],c=new Set(e);for(let e of l)c.has(e)||(i?(e.classList?.remove(n),0===e.classList?.length&&e.removeAttribute("class")):s?e.setAttribute(t,"false"):e.removeAttribute(t));for(let r of e)i?r.classList?.add(n):s?r.setAttribute(t,"true"):r.setAttribute(t,"")}function j(e,...t){let r=e||document;for(let e of t)e?.addEventListener&&(r=e);return new Promise(e=>{let i=[],n=!1,s=t=>{if(!n){n=!0;for(let e of i)e();e(t)}};for(let e of t){if(null==e||e?.addEventListener)continue;let t="number"==typeof e?e:"string"==typeof e?htmx.parseInterval(e):void 0;if(t>0){let r=setTimeout(()=>s(e),t);i.push(()=>clearTimeout(r))}else"string"==typeof e&&(r.addEventListener(e,s,{once:!0}),i.push(()=>r.removeEventListener(e,s)))}})}function V(e,t,...r){let i=t.startsWith("."),n=i?t.slice(1):t,s=t.startsWith("aria-"),o=r.length>1?r:r[0];if("string"==typeof o&&(o=o.split("|").map(e=>e.trim())),o)if(i){let t=o.findIndex(t=>t&&e.classList.contains(t));t>=0&&e.classList.remove(o[t]);let r=o[(t+1)%o.length];r&&e.classList.add(r)}else{let r=o.indexOf(x(e,t)??""),i=o[(r+1)%o.length];b(e,t,""===i?void 0:i)}else if(i)e.classList.toggle(n);else if(s){let r=e.getAttribute(t);e.setAttribute(t,"true"===r?"false":"true")}else e.toggleAttribute(t)}function R(){let e=new Map;return(t,r)=>{let n=(s=r?r.toString():null,e.get(s)||(e.set(s,{last:0,reject:null}),e.get(s)));var s;n.reject?.(i),n.reject=null;let o=++n.last;if(!r)return new Promise((e,r)=>{n.reject=r,setTimeout(()=>{o===n.last&&(n.reject=null,e())},t)});setTimeout(()=>o===n.last&&r(),t)}}function W(t){let r=e.htmxProp(t);return r.debounce||(r.debounce=R())}function $(e,t=document){return r=>{if("string"!=typeof r)return X(r?.nodeType?[r]:[...r||[]]);let i=r,n=i.match(/^(.+)\s+in\s+(.+)$/),s=[t];if(n&&(i=n[1],s="this"===n[2]||"me"===n[2]?[e]:[...document.querySelectorAll(n[2])]),!s.length)return X([]);let o,a=e=>{if(1===s.length)return[...s[0].querySelectorAll(e)];let t=[],r=new Set;for(let i of s)for(let n of i.querySelectorAll(e))r.has(n)||(r.add(n),t.push(n));return t.sort((e,t)=>4&e.compareDocumentPosition(t)?-1:1)},l=i.match(/^(next|previous|closest|first|last)\s+(.+)$/);if(l){let[,t,r]=l,i=t=>e.compareDocumentPosition(t);if("closest"===t){let t=e.closest?.(r);o=t?[t]:[]}else{let e=a(r);if("first"===t)o=e.slice(0,1);else if("last"===t)o=e.slice(-1);else if("next"===t){let t=e.find(e=>4&i(e));o=t?[t]:[]}else{let t=e.reverse().find(e=>2&i(e));o=t?[t]:[]}}}else o=a(i);return X(o)}}let B="map filter reduce reduceRight forEach some every find findIndex findLast findLastIndex flatMap flat slice indexOf lastIndexOf includes join at".split(" "),F={before:"beforebegin",after:"afterend",start:"afterbegin",end:"beforeend"};function z(e,t,r){let i=e.parentElement;"into"===t?e.innerHTML=r:"replace"===t?e.outerHTML=r:e.insertAdjacentHTML(F[t],r),htmx.process(i)}let U,J,Q,G=()=>{};function X(e){let t,r,i=new Proxy({},{get:(n,s)=>{if("count"===s)return e.length;if("arr"===s)return()=>e.slice();if(s===Symbol.iterator)return()=>e.values();if("q"===s)return t=>{let r=new Set;for(let i of e)for(let e of $(i,i)(t).arr())r.add(e);return X([...r])};if("trigger"===s)return(t,r,n)=>(e.forEach(e=>htmx.trigger(e,t,r,n)),i);if("insert"===s)return(t,r)=>(e.forEach(e=>z(e,t,r)),i);if("take"===s)return(t,r)=>(D(e,t,r),i);if("toggle"===s)return(t,...r)=>(e.forEach(e=>V(e,t,...r)),i);if("attr"===s||"class"===s||"aria"===s)return(t||=M(e,!1))[s];if("data"===s)return(r||=I(e)).data;if("local"===s)return t||=M(e,!1);if("closest"===s)return r||=I(e);if(B.includes(s))return e[s].bind(e);if(!e.length)return"function"==typeof function(e){for(let t=HTMLElement.prototype;t;t=Object.getPrototypeOf(t)){let r=Object.getOwnPropertyDescriptor(t,e);if(r)return r}}(s)?.value?G:void 0;let o=e[0]?.[s];return"function"==typeof o?(...t)=>e.map(e=>e[s](...t))[0]:o&&"object"==typeof o?X(e.map(e=>e[s])):o},set:(t,r,i)=>(e.forEach(e=>{let t=e[r];if(null==t||"function"==typeof t)e[r]=i;else if("function"==typeof i){let n=i(t);if("function"==typeof n?.then)throw new TypeError("hx-live: assignment returned a promise");e[r]=n}else e[r]=i}),u(),!0)});return i}function K(){let e=htmx.config.metaCharacter||":",t=htmx.config.prefix;J=["hx-live"+e],t&&J.push(t+"live"+e);let r=htmx.config.live?.bindPrefix;void 0===r&&(window.Alpine?(r="",console.warn("hx-live: Alpine detected; set config.live.bindPrefix.")):r=":"),r&&J.push(r),Q=["hx-live"],t&&Q.push(t+"live");let i=J.map(e=>`starts-with(name(), "${e}")`).join(" or "),n=Q.map(e=>`@${e}`).join(" or ");U=(new XPathEvaluator).createExpression(`.//*[@*[${i}] or ${n}]`)}function Y(e){for(let t of J)if(e.startsWith(t)&&e.length>t.length)return e.slice(t.length)}function Z(e){let r=e._htmx;if(r?.liveRuns){for(let e of r.liveRuns)t.delete(e);delete r.liveRuns,delete r.effectRegistered,delete r.bindings}}function ee(t){if(t.closest("[hx-ignore]"))return;let r=e.htmxProp(t);if(!r.effectRegistered){let e=Q.find(e=>t.hasAttribute(e));e&&(r.effectRegistered=!0,te(t,t.getAttribute(e)))}r.bindings||=new Set;for(let e of t.attributes){let i=Y(e.name);i&&!r.bindings.has(i)&&(r.bindings.add(i),te(t,e.value,i))}}function te(r,a,l){!function(){if(n)return;s=()=>u();let e=htmx.parseInterval(htmx.config.live?.inputDebounce??100)??100;o=()=>{clearTimeout(h),h=setTimeout(u,e)},document.addEventListener("input",o,!0),document.addEventListener("change",s,!0),n=new MutationObserver(s),n.observe(document.documentElement,c)}();let d,f=void 0!==l,m=W(r),p=/\bawait\b/.test(a),g=!f&&p,y=!f||p,v=!1,w=async()=>{if(r.isConnected){if(!g||!v){v=g;try{d||=e.executeJavaScript(r,{debounce:m},a,f,y,!0);let t=y?await d():d();f&&(!function(t,r,i){if("function"==typeof i)throw new TypeError("hx-live: binding returned a function");if("text"===r){let e=null==i?"":String(i);return void(t.textContent!==e&&(t.textContent=e))}if("html"===r){let e=null==i?"":String(i);return void(t.innerHTML!==e&&(t.innerHTML=e))}if("style"===r)return void function(t,r){let i=e.htmxProp(t),n=i.liveStyles||new Set,s=[];if("string"==typeof r)for(let e of r.split(";")){let t=e.indexOf(":");if(t<0)continue;let r=e.slice(0,t).trim(),i=e.slice(t+1).trim();r&&s.push([r,i])}else if(r&&"object"==typeof r)for(let[e,t]of Object.entries(r))s.push([C(e),null==t||""===t?null:String(t)]);let o=new Set(s.map(([e])=>e));for(let e of n)o.has(e)||t.style.removeProperty(e);for(let[e,r]of s)null==r?t.style.removeProperty(e):t.style.setProperty(e,r);0===t.style.length&&t.removeAttribute("style"),i.liveStyles=o}(t,i);if("class"===r||r.startsWith("."))return void L(t,r,i);if(x(t,r)===i)return;b(t,r,i)}(r,l,t),y&&n?.takeRecords())}catch(e){e!==i&&console.error("hx-live expression failed",e,f?{elt:r,attr:l}:{elt:r})}finally{g&&queueMicrotask(()=>v=!1)}}}else t.delete(w)};t.add(w);let S=e.htmxProp(r);S.liveRuns=S.liveRuns||new Set,S.liveRuns.add(w),w()}htmx.live={q:e=>$(document.documentElement)(e),debounce:R(),refresh:()=>u(),take:(e,t,r)=>D(htmx.live.q(e).arr(),t,r),toggle:(e,t,...r)=>htmx.live.q(e).forEach(e=>V(e,t,...r)),forEvent:(...e)=>j(null,...e),nextFrame:()=>new Promise(e=>requestAnimationFrame(e))},htmx.live.$=htmx.live.q,htmx.registerExtension("hx-live",{init:t=>{e=t},htmx_before_cleanup:e=>{Z(e)},htmx_before_morph_attr:(e,t)=>{U||K(),J.some(e=>t.attrName.startsWith(e))&&Z(e)},htmx_after_process:e=>{!function(e){U||K(),1===e.nodeType&&ee(e);let t,r=U.evaluate(e),i=[];for(;t=r.iterateNext();)i.push(t);for(t of i)ee(t)}(e)},htmx_before_swap:()=>{a++},htmx_finally_swap:()=>{0===--a&&t.size>0&&u()},htmx_scope:(t,r)=>{let i=e.htmxProp(t);Object.assign(r.scope,i.liveScope||=function(e){let t=M([e],!1),r=I([e]);return{q:$(e),forEvent:(...t)=>j(e,...t),nextFrame:()=>new Promise(e=>requestAnimationFrame(e)),trigger:(t,r,i)=>htmx.trigger(e,t,r,i),debounce:W(e),take:(t,r)=>D([e],t,r),toggle:(t,...r)=>V(e,t,...r),attr:t.attr,insert:(t,r)=>z(e,t,r),matches:t=>e.matches(t),style:e.style,data:r.data,aria:t.aria,local:t,closest:r}}(t)),r.code=_(r.code),htmx.config.live?.useDollar&&(r.scope.$=r.scope.q)}})})(),(()=>{let e,t=null;const r="htmx-history-index";function i(){return htmx.config.historyCache}function n(e){let t=[e];return htmx.config.prefix&&t.push(e.replaceAll("hx-",htmx.config.prefix)),t.join(",")}function s(){try{return sessionStorage.setItem("__htmx_test__","1"),sessionStorage.removeItem("__htmx_test__"),!0}catch(e){return!1}}function o(){return htmx.find(n("[hx-history-elt]"))||document.body}const a="data-htmx-history-value",l="data-htmx-history-checked",c="data-htmx-history-scroll";function h(){let e=history.state||{htmx:!0},r=e.htmxId;r||(r=crypto.randomUUID?.()??Math.random().toString(36).slice(2),history.replaceState({...e,htmxId:r},"",location.href)),t=r}function u(e){sessionStorage.setItem(r,JSON.stringify(e))}function d(e,t){if(!s()||i().size<=0)return!1;let n=function(){try{return JSON.parse(sessionStorage.getItem(r))||[]}catch{return[]}}().filter(t=>t!==e);for(;n.length>=i().size;)sessionStorage.removeItem("htmx-history-"+n.shift());let o=JSON.stringify(t);for(;;)try{return sessionStorage.setItem("htmx-history-"+e,o),n.push(e),u(n),!0}catch(e){if(0===n.length)return!1;sessionStorage.removeItem("htmx-history-"+n.shift())}}function f(r){if(!(r=r||t))return;if(htmx.find(n('[hx-history="false"]')))return;let i=o();var s;(s=i).querySelectorAll("input, textarea, select").forEach(e=>{let t=e.type?.toLowerCase();if("file"!==t&&"password"!==t)if("checkbox"===t||"radio"===t)e.checked&&e.setAttribute(l,"1");else if("SELECT"===e.tagName&&e.multiple){let t=Array.from(e.options).filter(e=>e.selected).map(e=>e.value);t.length&&e.setAttribute(a,JSON.stringify(t))}else e.value&&e.setAttribute(a,e.value)}),s.querySelectorAll("*").forEach(e=>{(e.scrollTop>0||e.scrollLeft>0)&&e.setAttribute(c,`${e.scrollTop},${e.scrollLeft}`)});let h=document.head.outerHTML,u=window.scrollY,f=document.title,m={target:i,head:h};if(!1===e.triggerHtmxEvent(document,"htmx:history:cache:before:save",m))return;let p=function(e){let t=e.cloneNode(!0);return t.querySelectorAll(".htmx-request").forEach(e=>e.classList.remove("htmx-request")),t.querySelectorAll("[disabled][data-disabled-by-htmx]").forEach(e=>{e.removeAttribute("disabled"),e.removeAttribute("data-disabled-by-htmx")}),t.outerHTML}(i);h=m.head,d(r,{content:p,head:h,scroll:u,title:f}),e.triggerHtmxEvent(document,"htmx:history:cache:after:save",{content:p,head:h,scroll:u,title:f})}function m(){let e=history.state?.htmxId;return e&&s()?function(e){try{return JSON.parse(sessionStorage.getItem("htmx-history-"+e))}catch{return null}}(e):null}async function p(t){let r={head:t.head,ready:null};e.triggerHtmxEvent(document,"htmx:history:cache:before:restore",r),r.ready&&await r.ready;let n=t.content,s=o(),h=i().swapStyle,u={sourceElement:document.body,target:s,swap:h,text:n,transition:!1};await htmx.swap(u),document.title=t.title||document.title,requestAnimationFrame(()=>{var i;window.scrollTo(0,t.scroll||0),(i=o()).querySelectorAll(`[${l}]`).forEach(e=>{e.checked=!0,e.removeAttribute(l)}),i.querySelectorAll(`[${a}]`).forEach(e=>{let t=e.getAttribute(a);if("SELECT"===e.tagName&&e.multiple){let r=JSON.parse(t);Array.from(e.options).forEach(e=>{e.selected=r.includes(e.value)})}else e.value=t;e.removeAttribute(a)}),i.querySelectorAll(`[${c}]`).forEach(e=>{let[t,r]=e.getAttribute(c).split(",").map(Number);e.scrollTop=t,e.scrollLeft=r,e.removeAttribute(c)}),r.item=t,e.triggerHtmxEvent(document,"htmx:history:cache:after:restore",r)})}htmx.registerExtension("history-cache",{init:t=>{e=t,htmx.config.historyCache??={},htmx.config.historyCache.size??=10,htmx.config.historyCache.refreshOnMiss??=!1,htmx.config.historyCache.disable??=!1,htmx.config.historyCache.swapStyle??="outerSync",h()},htmx_before_history_update:(e,t)=>{i().disable||(h(),f())},htmx_after_history_update:()=>{i().disable||h()},htmx_before_history_restore:(r,n)=>{if(i().disable)return;let s=t,o=history.state?.htmxId;s&&s!==o&&f(s),o?t=o:h();let a=m();if(!a){let t={path:n.path,refreshOnMiss:i().refreshOnMiss};return e.triggerHtmxEvent(document,"htmx:history:cache:miss",t),t.refreshOnMiss?(location.reload(),!1):void 0}let l={path:n.path,item:a};return!1!==e.triggerHtmxEvent(document,"htmx:history:cache:hit",l)?(n.cancelled=!0,p(l.item),!1):void 0}})})(),(()=>{let e;htmx.registerExtension("upsert",{init:t=>{e=t},htmx_process_upsert:(t,r)=>{let{ctx:i,tasks:n}=r,s={style:"upsert"},o=t.getAttribute("key"),a=t.getAttribute("sort"),l=t.hasAttribute("prepend");o&&(s.key=o),null!==a&&(s.sort=a||!0),l&&(s.prepend=!0),n.push({type:"partial",fragment:t.content.cloneNode(!0),target:e.attributeValue(t,"hx-target"),swapSpec:s,sourceElement:i.sourceElement})},handle_swap:(e,t,r,i)=>{if("upsert"===e){let e=i.key||"id",n="desc"===i.sort,s=t.firstChild,o=t=>t.getAttribute(e)||t.id,a=(e,t)=>{let r=e.localeCompare(t,void 0,{numeric:!0});return n?-r:r};for(let e of Array.from(r.children)){let r=e.id;if(r){let t=document.getElementById(r);if(t){t.replaceWith(e);continue}}let n=o(e);if(!n){i.prepend?t.insertBefore(e,s):t.appendChild(e);continue}let l=!1;for(let r of t.children){let i=o(r);if(i&&a(n,i)<0){t.insertBefore(e,r),l=!0;break}}l||t.appendChild(e)}return!0}return!1}})})(),(()=>{let e,t=0;function r(){t>0&&t--,0===t&&window.Alpine?.flushAndStopDeferringMutations&&window.Alpine.flushAndStopDeferringMutations()}htmx.registerExtension("alpine-compat",{init:t=>{e=t;let r=e.isSoftMatch;e.isSoftMatch=function(e,t){return e._x_bindings?.id&&t.matches?.("[\\:id], [x-bind\\:id]")?e instanceof Element&&e.tagName===t.tagName:r(e,t)}},htmx_before_swap:(e,r)=>{if(!window.Alpine?.closestDataStack||!window.Alpine?.cloneNode||!window.Alpine?.deferMutations)return;0===t&&window.Alpine.deferMutations(),t++;let{tasks:i}=r;for(let e of i)if("innerMorph"===e.swapSpec.style||"outerMorph"===e.swapSpec.style){if(!e.fragment||!e.target)continue;if(!("string"==typeof e.target?document.querySelector(e.target):e.target))continue}},htmx_before_morph_node:(t,r)=>{if(!window.Alpine?.closestDataStack||!window.Alpine?.cloneNode)return;let{oldNode:i,newNode:n}=r,s=window.Alpine.closestDataStack(i);if(n._x_dataStack=s,i.isConnected&&(window.Alpine.cloneNode(i,n),i._x_teleport&&n._x_teleport)){let t=document.createDocumentFragment();t.append(n._x_teleport),e.morph(i._x_teleport,t,!1)}},htmx_history_cache_before_save:(e,t)=>{window.Alpine?.destroyTree&&(t.target.querySelectorAll("[x-data]").forEach(e=>{e._x_dataStack&&e.setAttribute("data-alpine-state",JSON.stringify(e._x_dataStack[0]))}),window.Alpine.destroyTree(t.target))},htmx_history_cache_after_restore:(e,t)=>{window.Alpine&&document.querySelectorAll("[data-alpine-state]").forEach(e=>{let t=JSON.parse(e.getAttribute("data-alpine-state"));if(e.removeAttribute("data-alpine-state"),e._x_dataStack)for(let r in t)try{e._x_dataStack[0][r]=t[r]}catch{}})},htmx_after_swap:(e,t)=>{t.ctx._alpineFlushed=!0,r()},htmx_finally_request:(e,t)=>{t.ctx._alpineFlushed||r()}})})(); \ No newline at end of file +var htmx=(()=>{const e={parse(t){if(!t)return{};if(t.startsWith("{"))return JSON.parse(t);let r=/(?:"([^"]+)"|'([^']+)'|([^\s,:]+))(?:\s*:\s*(?:"([^"]*)"|'([^']*)'|<((?:[^/]|\/(?!>))+)\/>|([^\s,]+)))?(?=\s|,|$)/g,i={};for(let n of t.matchAll(r)){let[,t,r,s,o,a,l,c]=n,u=t??r??s,h=(o??a??l??c??"true").trim();try{h=JSON.parse(h)}catch{}let d=s?.includes("."),f=d?u.split(".").reduceRight((e,t)=>({[t]:e}),h):{[u]:h};e.merge(f,i)}return i},split:e=>e.split(/,(?![^\[]*\])(?![^(]*\))(?![^<]*\/>)(?=(?:[^"']|"[^"]*"|'[^']*')*$)/),merge(t,r){"string"==typeof t&&(t=e.parse(t));for(let[i,n]of Object.entries(t)){if(["__proto__","constructor","prototype"].includes(i))continue;let t=n?.constructor===Object,s=r[i]?.constructor===Object;t&&s?e.merge(n,r[i]):r[i]=n}return r}};class t{#e=null;#t=[];admit(e,t,r){if(!this.#e)return this.#e={strategy:e,abort:r},"run";if("replace"===e||"abort"!==e&&"abort"===this.#e.strategy)return this.#t=[],this.#e.abort?.(),this.#e={strategy:e,abort:r},"run";if("queue all"===e)this.#t.push(t);else if("queue last"===e)this.#t=[t];else{if("abort"===e||"drop"===e||0!==this.#t.length)return"dropped";this.#t.push(t)}return"queued"}continue(e){this.#e?.abort===e&&(this.#e=null,this.#t.shift()?.())}abort(){this.#e?.abort?.()}}return new class{#r=e;#i=new Map;#n="";#s=new Set;_loc=window.location;#o;#a=Function;#l=Object.getPrototypeOf(async function(){}).constructor;#c={createHTML:e=>e,createScript:e=>e};#u;#h="a,form";#d=["get","post","put","patch","delete","query"];#f;#m;#p;#g;#x;constructor(){this.#b(),this.#y(),this.#u=this.#v("[hx-action],[hx-get],[hx-post],[hx-put],[hx-patch],[hx-delete],[hx-query]"),this.#f=(new XPathEvaluator).createExpression(`.//*[@*[${this.#w("hx-on").map(e=>`starts-with(name(), "${e}")`).join(" or ")}]]`),this.#o={HCON:e,attributeValue:this.#S.bind(this),parseTriggerSpecs:this.#E.bind(this),determineMethodAndAction:this.#A.bind(this),createRequestContext:this.#C.bind(this),collectFormData:this.#T.bind(this),getAttributeObject:this.#q.bind(this),insertContent:this.#_.bind(this),morph:this.#O.bind(this),isSoftMatch:this.#N.bind(this),initSecurity:(e,t,r)=>{e&&(this.#c=e),t&&(this.#a=t),r&&(this.#l=r)},onTrigger:this.#H.bind(this),htmxProp:this.#k.bind(this),triggerHtmxEvent:this.#M.bind(this),executeJavaScript:this.#I.bind(this)};let t=()=>this.initialize();"loading"===document.readyState?document.addEventListener("DOMContentLoaded",t):setTimeout(t)}#b(){this.version="4.0.1",this.config={logAll:!1,prefix:"data-hx-",transitions:!1,history:!0,mode:"same-origin",defaultSwap:"innerHTML",defaultFocusScroll:!1,indicatorClass:"htmx-indicator",requestClass:"htmx-request",includeIndicatorCSS:!0,defaultTimeout:6e4,extensions:"",morphIgnore:["data-htmx-powered"],morphSkip:"[hx-morph-skip]",morphSkipChildren:"[hx-morph-skip-children]",morphScanLimit:10,noSwap:[204,304],implicitInheritance:!1,defaultSettleDelay:1,allowEmptySwapAfterOOB:!1};let t=document.querySelector('meta[name="htmx-config"]');t&&e.merge(t.content,this.config),this.#n=this.config.extensions}#y(){if(!1!==this.config.includeIndicatorCSS){let e=this.config.indicatorClass,t=this.config.requestClass;try{this.indicatorStyleSheet=new CSSStyleSheet,this.indicatorStyleSheet.replaceSync(`.${e}{opacity:0;visibility: hidden} .${t} .${e}, .${t}.${e}{opacity:1;visibility: visible;transition: opacity 200ms ease-in}`),document.adoptedStyleSheets.push(this.indicatorStyleSheet)}catch{}}}registerExtension(e,t){return!(this.#n&&!this.#n.split(/,\s*/).includes(e))&&(!this.#s.has(e)&&(this.#s.add(e),t.init&&t.init(this.#o),void Object.entries(t).forEach(([e,t])=>{this.#i.get(e)?.push(t)||this.#i.set(e,[t])})))}#L(e){let t=this.config.prefix;return!e.closest||null!=e.closest("[hx-ignore]")||t&&null!=e.closest(`[${t}ignore]`)}#P(e,t){let r=this.config.prefix;return e.getAttribute(t)??(r?e.getAttribute(t.replace("hx-",r)):null)}#D(e,t){let r=this.config.prefix&&t.replace("hx-",this.config.prefix);return e.hasAttribute(t)?t:r&&e.hasAttribute(r)?r:null}#v(e){return this.#w(e).join(",")}#w(e){let t=[e];return this.config.prefix&&t.push(e.replaceAll("hx-",this.config.prefix)),t}#j(e,t){let r=[...e.querySelectorAll?.(t)??[]];return e.matches?.(t)&&r.unshift(e),r}#V(e){return"before"===e?"beforebegin":"after"===e?"afterend":"prepend"===e?"afterbegin":"append"===e?"beforeend":e}#R(e,t){let r=[];return this.#S(e,t,void 0,(e,t)=>{e?.split(/\s*[,:]\s*/).includes("this")&&r.push(t)}),r}#S(e,t,r,i,n=this.config.implicitInheritance){t=this.#$(t);let s=this.#$(":inherited"),o=this.#$(":append"),a=this.#P(e,t)??this.#P(e,t+s);if(null!=a)return i?i(a,e):a;let l=CSS.escape(n?t:t+s),c=CSS.escape(t+s+o),u=this.#v(`[${l}],[${c}]`),h=this.#D(e,t+o)??this.#D(e,t+s+o);if(h){let r=e.getAttribute(h),s=e.parentNode?.closest?.(u);if(i&&i(r,e),s){let e=this.#S(s,t,void 0,i,n);return e?(e+","+r).replace(/[{}]/g,""):r}return r}let d=e.parentNode?.closest?.(u);return d?(a=this.#S(d,t,void 0,i),!i&&a&&n&&this.#W(e,"htmx:after:implicitInheritance",{elt:e,name:t,parent:d}),a):r}#E(t){return e.split(t).flatMap(t=>{t=t.replace(/^\s*every\s+(\S+?)\s*(\[[^\]]*\])/,"every$2 $1");let[,r,i]=t.match(/^\s*(\S+\[[^\]]*\]|\S+)\s*(.*?)\s*$/)??[];if(!r)return[];if(/\[[^\]]*$/.test(r))throw"unterminated:"+r;return[{name:r,...e.parse(i)}]})}#A(e,t){let r=this.#S(e,"hx-method"),i=this.#S(e,"hx-action",void 0,void 0,!1);if(!i)for(let t of this.#d){let n=this.#S(e,"hx-"+t,void 0,void 0,!1);if(null!=n){i=n,r=t;break}}return this.#B(e)&&(i||=t.submitter?.getAttribute?.("formAction")||e.getAttribute(e.matches("a")?"href":"action")),r||=t.submitter?.getAttribute?.("formmethod")||e.getAttribute("method")||"GET",{action:i,method:r.toUpperCase()}}#k(e){return e._htmx||(e._htmx={listeners:[],triggerSpecs:[]},e.setAttribute("data-htmx-powered","true")),e._htmx}#z(e){return e._htmx_state||={}}#F(e){if(this.#U(e)&&this.#M(e,"htmx:before:init",{},!0)){let t=this.#k(e);t.initialized=!0,t.eventHandler=this.#J(e),this.#Q(e),this.#M(e,"htmx:after:init",{},!0)}}#J(e){return async t=>{try{let r=this.#C(e,t);await this.#X(r)}catch(t){this.#M(e,"htmx:error",{error:t})}}}#C(t,r){let{action:i,method:n}=this.#A(t,r),[s,o]=(i||"").split("#"),a=new AbortController,l={sourceElement:t,sourceEvent:r,status:"created",select:this.#S(t,"hx-select"),selectOOB:this.#S(t,"hx-select-oob"),target:this.#S(t,"hx-target"),swap:this.#S(t,"hx-swap")??this.config.defaultSwap,push:this.#S(t,"hx-push-url"),replace:this.#S(t,"hx-replace-url"),transition:this.config.transitions,confirm:this.#S(t,"hx-confirm"),request:{validate:"true"===this.#S(t,"hx-validate",!t.matches("form")||t.noValidate||r.submitter?.formNoValidate?"false":"true",void 0,!1),action:s,anchor:o,method:n,headers:this.#G(t),abort:a.abort.bind(a),credentials:"same-origin",signal:a.signal,mode:this.config.mode}};t._htmx?.boosted&&e.merge(t._htmx.boosted,l),l.target=this.#K(t,l.target),l.target&&(l.request.headers["HX-Target"]=this.#Y(l.target));let c=this.#S(t,"hx-config");return c&&(e.merge(c,l.request),l.request.mode=this.config.mode),l}#Y(e){return`${e.tagName.toLowerCase()}${e.id?"#"+encodeURI(e.id):""}`}#G(e){let t={"HX-Request":"true","HX-Source":this.#Y(e),"HX-Current-URL":location.href,Accept:"text/html"};return this.#B(e)&&(t["HX-Boosted"]="true"),t}#Z(e,t){return this.#q(e,"hx-headers",e=>{for(let r in e)t.request.headers[r]=String(e[r])},{ctx:t})}#K(e,t){return t instanceof Element?t:null!=t?this.#ee(e,t,"hx-target"):this.#B(e)?document.body:e}#B(e){return e?._htmx?.boosted}async#X(e){let t=e.sourceElement,r=e.sourceEvent;if(!t.isConnected)return;if(this.#te(r))return;this.#re(r)&&r.preventDefault();let i=/GET|DELETE/.test(e.request.method),n=i?t.matches("form")?t:null:t.form||t.closest("form"),s=this.#T(t,n,r.submitter,e.request.validate,i);if(!s)return;let o=this.#q(t,"hx-vals",t=>{e.vals=t;for(let e in t)s.set(e,t[e])},{ctx:e});if(o&&await o,e.values)for(let t in e.values)s.delete(t),s.append(t,e.values[t]);let a=this.#Z(t,e);if(a&&await a,Object.assign(e.request,{form:n,submitter:r.submitter,body:s}),!this.#M(t,"htmx:config:request",{ctx:e}))return;if("DIALOG"===e.request.method)return;let l=this.#ie(e.request.action);if(null!=l){let t=Object.fromEntries(e.request.body);return void await this.#I(e.sourceElement,t,l,!1)}if(i){let t=new URL(e.request.action,document.baseURI);for(let r of e.request.body.keys())t.searchParams.delete(r);for(let[r,i]of e.request.body)t.searchParams.append(r,i);t.origin===location.origin?e.request.action=t.pathname+t.search:e.request.action=t.href,e.request.body=null}else"multipart/form-data"!==(this.#S(t,"hx-encoding")??n?.enctype)&&(e.request.body=new URLSearchParams(e.request.body));await this.#ne(e)}async#ne(e){let t=e.sourceElement,r=this.#se(t),i=this.#oe(t);this.#ae(t);let n=()=>e.request?.abort?.();if("run"===i.admit(r,()=>this.#ne(e),n)){e.status="issuing",e.indicators??=[],e.disabledElements??=[];try{if(e.confirm){if(!await new Promise(r=>{let i={ctx:e,issueRequest:()=>r(!0),dropRequest:()=>r(!1)};if(this.#M(t,"htmx:confirm",i)){let i=this.#ie(e.confirm);r(i?this.#I(t,{ctx:e},i,!0):window.confirm(e.confirm))}}))return}if(this.#le(e),this.#ce(e),this.#ue(e),e.fetch||=window.fetch.bind(window),e.request.headers["HX-Request-Type"]=e.target===document.body||e.select?"full":"partial",!this.#M(t,"htmx:before:request",{ctx:e}))return;let r=await e.fetch(e.request.action,e.request);if(e.response={raw:r,status:r.status,headers:r.headers},this.#he(e),!this.#M(t,"htmx:before:response",{ctx:e}))return;if(e.text=await r.text(),!this.#M(t,"htmx:after:request",{ctx:e}))return;if(e.response.status>=400&&this.#M(t,"htmx:response:error",{ctx:e}),this.#de(e))return void(e.keepIndicators=!0);if("issuing"===e.status){if(e.hx.retarget&&(e.target=e.hx.retarget),e.hx.reswap&&(e.swap=e.hx.reswap),e.hx.reselect&&(e.select=e.hx.reselect),!1===e.target?.isConnected)return;e.status="response received",this.#fe(e),await this.swap(e),e.status="swapped"}}catch(r){e.status="error: "+r,"AbortError"===r?.name&&"timeout"!==e.request.signal.reason||this.#M(t,"htmx:error",{ctx:e,error:r})}finally{await(e.extensionPromise?.catch(()=>{})),clearTimeout(e.requestTimeout),e.hx?.trigger&&this.#me(e.hx.trigger,e.sourceElement),this.#M(t,"htmx:finally:request",{ctx:e}),e.keepIndicators||(this.#pe(e.indicators),this.#ge(e.disabledElements)),i.continue(n)}}}#he(e){e.hx={};for(let[t,r]of e.response.raw.headers)t.toLowerCase().startsWith("hx-")&&(e.hx[t.slice(3).toLowerCase().replace(/-/g,"")]=r)}#de(t){if("true"===t.hx.refresh)return this._loc.reload(),!0;if(t.hx.redirect)return this._loc.href=t.hx.redirect,!0;if(t.hx.location){let r=t.hx.location,i={},n=e.parse(r);return"{"!==r[0]&&null==n.path||(i=n,r=i.path,delete i.path),null==i.push&&null==i.replace&&(i.push="true"),i.indicators=t.indicators,i.disabledElements=t.disabledElements,this.ajax("GET",r,i),!0}}#le(e){let t=null!=e.request.timeout?this.parseInterval(e.request.timeout):this.config.defaultTimeout;t&&(e.requestTimeout=setTimeout(()=>e.request?.abort?.("timeout"),t))}#se(e){let t=this.#S(e,"hx-sync");if(!t)return"queue first";let r=t.split(":").pop().trim();return/^(drop|abort|replace|queue)/.test(r)?r:"queue first"}#oe(e){let r=this.#S(e,"hx-sync"),i=e;if(r){let t=r.includes(":")?r.slice(0,r.lastIndexOf(":")).trim():/^(drop|abort|replace|queue)/.test(r)?null:r;t&&(i=this.#ee(e,t,"hx-sync")||e)}return this.#z(i).rq||=new t}#te(e){return"click"===e.type&&(e.ctrlKey||e.metaKey||e.shiftKey)&&!!e.currentTarget?.closest?.("a[href]")}#re(e){let t=e.currentTarget;if("submit"===e.type&&"FORM"===t?.tagName)return!0;if(!("click"===e.type&&0===e.button))return!1;let r=t?.closest?.('button, input[type="submit"], input[type="image"]'),i=r?.form||r?.closest("form");if(r&&!r.disabled&&i&&("submit"===r.type||"image"===r.type||!r.type&&"BUTTON"===r.tagName))return!0;let n=t?.closest?.("a");if(!n||!n.href)return!1;let s=n.getAttribute("href");return!(s&&s.startsWith("#")&&s.length>1)}#Q(e,t=e._htmx.eventHandler){let r=this.#S(e,"hx-trigger",void 0,void 0,!1)||(e.matches("form")?"submit":e.matches("input:not([type=button]):not([type=submit]),select,textarea")?"change":"click");this.#H(e,r,t)}#H(e,t,r){let i=this.#E(t);this.#k(e).triggerSpecs.push(...i);for(let t of i){t.listeners=[];let[i,n]=this.#xe(t.name),s=[e];"outside"===t.from?s=[document]:t.from&&"self"!==t.from&&(s=this.#be(e,t.from));let o=i=>{if((t.halt||t.prevent)&&i.preventDefault(),(t.halt||t.stop||t.consume)&&i.stopPropagation(),t.changed){let t=this.#z(e).changedValues??=new WeakMap,r=i.target;if(!["checkbox","radio"].includes(r?.type)){let e=r?.value;if(t.has(r)&&t.get(r)===e)return;t.set(r,e)}}if(t.once)for(let e of t.listeners)e.fromElt.removeEventListener(e.eventName,e.handler,e);r(i)},a=o;if(t.delay?a=e=>{clearTimeout(t.timeout),t.timeout=setTimeout(()=>o(e),this.parseInterval(t.delay))}:t.throttle&&(a=e=>{t.throttled?t.throttledEvent=e:(t.throttled=!0,o(e),t.throttleTimeout=setTimeout(()=>{if(t.throttled=!1,t.throttledEvent){let e=t.throttledEvent;t.throttledEvent=null,a(e)}},this.parseInterval(t.throttle)))}),t.handler=r=>{if(this.#re(r)&&r.preventDefault(),("self"!==t.from||r.target===e)&&("outside"!==t.from||!e.contains(r.target))&&(!t.target||r.target?.matches?.(t.target))){if(n){let t={};for(let e in r)/^[a-z]+$/i.test(e)&&(t[e]=r[e]);if(!this.#I(e,t,n,!0,!1))return}if("every"!==i)for(let t of this.#k(e).triggerSpecs)clearTimeout(t.timeout),t.throttledEvent=null;a(r)}},"intersect"===i||"revealed"===i){let r={rootMargin:t.rootMargin};t.root&&(r.root=this.#ee(e,t.root)),t.threshold&&(r.threshold=parseFloat(t.threshold));let n="revealed"===i;t.observer=new IntersectionObserver(e=>{for(let r=0;r"name"!==e);t.interval=setInterval(()=>{e.isConnected?this.#M(e,"every",{},!1):clearInterval(t.interval)},this.parseInterval(r))}if("load"!==i)for(let r of s){let n={fromElt:r,eventName:i,handler:t.handler,capture:!!t.capture,passive:!!t.passive};e._htmx.listeners.push(n),t.listeners.push(n),r.addEventListener(i,t.handler,n)}else t.handler(new CustomEvent("load"))}}#xe(e){let t=e.match(/^([^\[]*)\[([^\]]*)]/);return t?[t[1],t[2]]:[e,null]}#me(t,r){if("{"===t[0]){let i=e.parse(t);for(let e in i){let t=i[e],n=r;t?.target&&(n=this.find(t.target)),this.trigger(n,e,"object"==typeof t?t:{value:t})}}else t.split(",").forEach(e=>this.trigger(r,e.trim(),{}))}#ye(e){let t={},r=Object.getPrototypeOf(this);for(let i of Object.getOwnPropertyNames(r))"constructor"!==i&&"function"==typeof this[i]&&(["find","findAll"].includes(i)?t[i]=(t,r)=>void 0===r?this[i](e,t):this[i](t,r):t[i]=this[i].bind(this));return t}#I(e,t,r,i=!0,n=!0,s=!1){let o={};Object.assign(o,this.#ye(e));let a={},l={scope:a,code:r};this.#W(e,"htmx:scope",l),r=l.code,Object.assign(o,a),Object.assign(o,t);let c=Object.keys(o),u=Object.values(o),h=new(n?this.#l:this.#a)(...c,i?`return (${r})`:r);return s?()=>h.call(e,...u):h.call(e,...u)}process(e,t){if(!e?.isConnected)return;if(!(e instanceof Element)){for(let r of e.children||[])this.process(r,t);return}if(t&&this.#ve(e,!0),this.#L(e))return;if(!this.#M(e,"htmx:before:process"))return;let r=[e],i=this.#f.evaluate(e),n=null;for(;n=i.iterateNext();)r.push(n);for(let e of r)!this.#L(e)&&this.#M(e,"htmx:before:on:init",{},!0)&&this.#we(e);for(let t of this.#j(e,this.#u))this.#F(t);for(let t of this.#j(e,this.#h))this.#Se(t);this.#M(e,"htmx:after:process")}#Se(e){let t=this.#S(e,"hx-boost");if(t&&"false"!==t&&this.#Ee(e)&&this.#M(e,"htmx:before:init",{},!0)){let r=this.#k(e);r.initialized=!0,r.eventHandler=this.#J(e),r.boosted=t,this.#Q(e),this.#M(e,"htmx:after:init",{},!0)}}#Ee(e){if(this.#U(e))if("A"===e.tagName){if(""===e.target||"_self"===e.target)return!e.hasAttribute("download")&&!e.getAttribute("href")?.startsWith?.("#")&&this.#Ae(e.href)}else if("FORM"===e.tagName)return"dialog"!==e.method&&this.#Ae(e.action)}#Ae(e){try{return new URL(e,window.location.href).origin===window.location.origin}catch(e){return!1}}#U(e){return!e._htmx?.initialized&&!this.#L(e)}#ve(e,t){let r=[e,...e.querySelectorAll?.("[data-htmx-powered]")??[]];for(let e of r)if(e._htmx){this.#M(e,"htmx:before:cleanup");for(let t of e._htmx.triggerSpecs||[])t.interval&&clearInterval(t.interval),t.timeout&&clearTimeout(t.timeout),t.throttleTimeout&&clearTimeout(t.throttleTimeout),t.observer?.disconnect();for(let t of e._htmx.listeners||[])t.fromElt.removeEventListener(t.eventName,t.handler,t);e.removeAttribute("data-htmx-powered"),this.#M(e,"htmx:after:cleanup"),t&&delete e._htmx}}#Ce(e){let t=document.createElement("div");t.hidden=!0,document.body.insertAdjacentElement("afterend",t);let r=e.querySelectorAll?.(this.#v("[hx-preserve]"))||[];for(let e of r){let r=document.getElementById(e.id);r&&this.#Te(t,r,null)}return t}#qe(e){for(let t of[...e.children]){let e=document.getElementById(t.id);e&&(this.#Te(e.parentNode,t,e),this.#ve(e),e.remove())}e.remove()}#_e(e){let t=this.#c.createHTML(e);return Document.parseHTMLUnsafe?.(t,{})||(new DOMParser).parseFromString(t,"text/html")}#Oe(e){let t=e.replace(/)/gi,'"),r="";t=t.replace(/]*)?>[\s\S]*?<\/head>/i,e=>(r=this.#_e(e).title,""));let i,n,s=t.match(/<([a-z][^\/>\x20\t\r\n\f]*)/i)?.[1]?.toLowerCase();if("html"===s||"body"===s?(i=this.#_e(t),n=document.createDocumentFragment(),n.append(i.body)):(i=this.#_e(``),n=i.querySelector("template").content),!r){let e=n.querySelector("title:not(svg title)");e&&(r=e.textContent,e.remove())}return this.#Ne(n),{fragment:n,title:r}}#He(e,t,r,i){let n=t.id?"#"+CSS.escape(t.id):null,[,s,o]=r.match(/^(\S+):(.+)/)??[];s&&([r,n]=[s,o||n]),"true"!==r&&r||(r="outerHTML");let a=this.#ke(r);if(n=a.target||n,a.strip??=!a.style.startsWith("outer"),!n)return;let l=this.#be(i,n);for(let r of l){let n=document.createDocumentFragment();n.append(t.cloneNode(!0)),e.push({type:"oob",fragment:n,target:r,swapSpec:a,sourceElement:i})}t.remove()}#Me(e,t,r){let i=[];if(r)for(let n of r.split(",")){let[r,s="true"]=n.split(/:(.*)/);for(let n of e.querySelectorAll(r))this.#He(i,n,s,t)}for(let r of e.querySelectorAll(this.#v("[hx-swap-oob]"))){let e=this.#D(r,"hx-swap-oob"),n=r.getAttribute(e);r.removeAttribute(e),this.#He(i,r,n,t)}return i}#Ie(e,t,r){t?t.before(...r.childNodes):e.append(...r.childNodes)}#ke(t){t=t.trim();let r=this.config.defaultSwap;if(t&&!/^\S*:/.test(t)){let e=t.match(/^(\S+)\s*(.*)$/);r=e[1],t=e[2]}return{style:this.#V(r),...e.parse(t)}}#Le(e,t){let r=[];for(let i of e.querySelectorAll("template[hx]")){let e=i.getAttribute("type");if("partial"===e){let e=this.#P(i,"hx-target")||(i.id?"#"+CSS.escape(i.id):null);if(e){this.#Ne(i.content);let n=this.#ke(this.#P(i,"hx-swap")||this.config.defaultSwap);n.ignoreTitle&&(t.title=null);let s=this.#be(t.sourceElement,e);for(let e of s.length?s:[null])r.push({type:"partial",fragment:i.content.cloneNode(!0),target:e,swapSpec:n,sourceElement:t.sourceElement})}}else this.#W(i,"htmx:process:"+e,{ctx:t,tasks:r});i.remove()}return r}#Pe(e,t,r,i){try{null!=r&&e.setSelectionRange&&e.setSelectionRange(r,i),e.focus(t)}catch(e){}}#De(e){let t=this.#j(e,"[autofocus]")[0];t&&this.#Pe(t)}#je(e){return e===window||e===document?document.scrollingElement:e}#Ve(e,t){if(e.scroll){let r=e.scrollTarget?this.#je(this.#Re(t,e.scrollTarget)):t;r&&("top"===e.scroll?r.scrollTop=0:"bottom"===e.scroll&&(r.scrollTop=r.scrollHeight))}if("top"===e.show||"bottom"===e.show){let r=e.showTarget?this.#je(this.#Re(t,e.showTarget)):t;r?.scrollIntoView?.("top"===e.show)}}#$e(e){e.request?.anchor&&document.getElementById(e.request.anchor)?.scrollIntoView({block:"start",behavior:"auto"})}#Ne(e){let t=this.#j(e,"script");for(let e of t){let t=document.createElement("script");for(let r of e.attributes)t.setAttribute(r.name,r.value);this.config.inlineScriptNonce&&(t.nonce=this.config.inlineScriptNonce),t.textContent=this.#c.createScript(e.textContent),e.replaceWith(t)}}initialize(){this.config.history&&!this.#g&&(this.#g=!0,window.navigation&&!/firefox/i.test(navigator.userAgent)?navigation.addEventListener("navigate",e=>{"traverse"===e.navigationType&&e.canIntercept&&!e.hashChange&&e.intercept({handler:()=>this.#We()})}):window.addEventListener("popstate",e=>this.#We(e.state))),this.process(document.body)}async swap(e){try{let{fragment:t,title:r}=this.#Oe(e.text);e.title=r;let i=[],n=this.#Me(t,e.sourceElement,e.selectOOB),s=this.#Le(t,e);i.push(...n,...s);let o=s.length||n.length&&!this.config.allowEmptySwapAfterOOB,a=this.#Be(e,t,o);if(a&&i.unshift(a),!this.#M(e.sourceElement,"htmx:before:swap",{ctx:e,tasks:i}))return;this.#ze(e);let l=[],c=[];for(let t of i)t.swapSpec?.transition??a?.transition??e.transition?c.push(t):l.push(this.#_(t));if(c.length>0){let t=async()=>{for(let e of c)await this.#_(e,!1)};l.push(this.#Fe(t,e))}await Promise.all(l),!e.sourceElement?.isConnected&&a?.target?.isConnected&&(e.sourceElement=a.target),this.#M(e.sourceElement,"htmx:after:swap",{ctx:e}),e.title&&"none"!==e.swap&&(document.title=e.title),this.#$e(e)}finally{this.#M(e.sourceElement,"htmx:finally:swap",{ctx:e})}}#Be(e,t,r){let i=this.#ke(e.swap||this.config.defaultSwap);if(i.ignoreTitle&&(e.title=null),"delete"===i.style||(t.querySelector("body")||t).childElementCount>0||t.textContent.trim()||(i.swapEmpty??!r)){if(e.select){let r=t.querySelectorAll(e.select);(t=document.createDocumentFragment()).append(...r)}return this.#B(e.sourceElement)&&(i.show||="top"),{type:"main",fragment:t,target:this.#K(e.sourceElement||document.body,i.target||e.target),swapSpec:i,sourceElement:e.sourceElement,transition:e.transition&&!1!==i.transition}}}async#_(e,t=!0){let{target:r,swapSpec:i,fragment:n}=e;if("string"==typeof r&&(r=document.querySelector(r)),!r)return;"string"==typeof i&&(i=this.#ke(i));let s,o=i.style;if("none"===o)return;if("BODY"===n.firstElementChild?.tagName){const e=r===document.body&&o.startsWith("outer");e&&"outerHTML"===o&&(o="outerSync"),i.strip??=!e}if(i.strip&&n.firstElementChild&&(n=document.createDocumentFragment(),n.append(...(e.fragment.firstElementChild.content||e.fragment.firstElementChild).childNodes)),this.#Ue(r,"htmx-swapping"),t&&e.swapSpec?.swap&&await this.timeout(e.swapSpec?.swap),"delete"===o)return void(r.parentNode&&(this.#ve(r),r.parentNode.removeChild(r)));let a=[],l=i.settle??this.config.defaultSettleDelay,c=r.parentNode;if("innerHTML"===o||"outerHTML"===o&&c){let e=document.activeElement;if(e?.id){let t,r;try{t=e.selectionStart,r=e.selectionEnd}catch(e){}s={elt:e,start:t,end:r}}a=t&&l?this.#Je(n,r):[]}let u=this.#Ce(n),h=[...n.childNodes];try{if("innerHTML"===o){for(const e of r.children)this.#ve(e);r.replaceChildren(...n.childNodes)}else if("textContent"===o){for(const e of r.querySelectorAll("[data-htmx-powered]"))this.#ve(e);r.textContent=n.textContent}else if("outerHTML"===o)c&&(this.#Ie(c,r,n),this.#ve(r),c.removeChild(r),r=h.find(e=>1===e.nodeType)||c);else if("outerSync"===o){this.#Qe(r,n.firstElementChild);for(const e of r.children)this.#ve(e);r.replaceChildren(...n.firstElementChild.childNodes),h=[r]}else if("innerMorph"===o)this.#O(r,n,!0),h=[...r.childNodes];else if("outerMorph"===o)this.#O(r,n,!1),h.push(r);else if("beforebegin"===o)c&&this.#Ie(c,r,n);else if("afterbegin"===o)this.#Ie(r,r.firstChild,n);else if("beforeend"===o)this.#Ie(r,null,n);else if("afterend"===o)c&&this.#Ie(c,r.nextSibling,n);else{let e=this.#i.get("handle_swap")||[],t=!1;for(const s of e){let e=s(o,r,n,i);if(e){t=!0,Array.isArray(e)&&(h=e);break}}if(!t)throw new Error(`Unknown swap style: ${o}`)}}finally{this.#Xe(r,"htmx-swapping")}if(e.target=r,this.#qe(u),s&&!s.elt.matches(":focus")){let e=document.getElementById(s.elt.id);if(e){let t={preventScroll:void 0!==i.focusScroll?!i.focusScroll:!this.config.defaultFocusScroll};this.#Pe(e,t,s.start,s.end)}}this.#M(r,"htmx:before:settle",{task:e,newContent:h,settleTasks:a});for(const e of h)this.#Ue(e,"htmx-added");if(t&&a.length>0){this.#Ue(r,"htmx-settling"),await this.timeout(l);for(let e of a)e();this.#Xe(r,"htmx-settling")}this.#M(r,"htmx:after:settle",{task:e,newContent:h,settleTasks:a});for(const e of h)this.#Xe(e,"htmx-added"),this.process(e),this.#De(e);this.#Ve(i,r)}#M(e,t,r={},i=!0){if(r.error){let i=`htmx: ${t}: ${r.error.message??r.error}`;r.error instanceof Error?console.error(i,r.error,{elt:e,detail:r}):console.error(i,{elt:e,detail:r})}else r.warn?console.warn(`htmx: ${t}: ${r.warn}`,{elt:e,detail:r}):this.config.logAll&&console.log(`htmx: ${t}`,{elt:e,detail:r});return e=this.#Ge(e),this.#W(e,t,r),this.trigger(e,this.#$(t),r,i)}#W(e,t,r={}){let i=this.#i.get(t.replace(/:/g,"_"));if(i){r.cancelled=!1;for(const t of i)if(!1===t(e,r)||r.cancelled)return r.cancelled=!0,!1}return!0}timeout(e){if((e=this.parseInterval(e))>0)return new Promise(t=>setTimeout(t,e))}onLoad(e){this.on(this.#$("htmx:after:process"),t=>{e(t.target)})}on(e,t,r){let i,n=document;return void 0===r?(i=e,r=t):(n=this.#Ge(e),i=t),n.addEventListener(i,r),r}find(e,t){return this.#Re(e,t)}findAll(e,t){return this.#be(e,t)}parseInterval(e){if("number"==typeof e)return e;let[,t,r]=e?.match(/^([\d.]+)(ms|s|m)?$/)||[],i=parseFloat(t)*({ms:1,s:1e3,m:6e4}[r]||1);return isNaN(i)?void 0:i}trigger(e,t,r={},i=!0){e=this.#Ge(e);let n=new CustomEvent(t,{detail:r,cancelable:!0,bubbles:i,composed:!0}),s=e?.isConnected?e:document;return!r?.cancelled&&s.dispatchEvent(n)}ajax(e,t,r){(!r||r instanceof Element||"string"==typeof r)&&(r={target:r});let i="string"==typeof r.source?document.querySelector(r.source):r.source;if("string"==typeof r.source&&!i)return Promise.reject(new Error("Source not found"));i||=document.body;let n=this.#C(i,r.event||{});return Object.assign(n,r),r.target&&(n.target=this.#K(document.body,r.target),!n.target)?Promise.reject(new Error("Target not found")):(Object.assign(n.request,{action:t,method:e.toUpperCase()}),r.headers&&Object.assign(n.request.headers,r.headers),this.#X(n))}#Ke(e){this.config.history&&(history.pushState({htmx:!0},"",e),this.#M(document,"htmx:after:history:push",{path:e}))}#Ye(e){this.config.history&&(history.replaceState({htmx:!0},"",e),this.#M(document,"htmx:after:history:replace",{path:e}))}async#We(e,t){if(await this.timeout(1),e??=history.state,!e?.htmx)return;this.#p?.abort(),t=t||location.pathname+location.search;let r=document.querySelector(this.#v("[hx-history-elt]"))||document.body;if(this.#M(document,"htmx:before:history:restore",{path:t,cacheMiss:!0})){if("reload"!==this.config.history)return this.#p=new AbortController,this.ajax("GET",t,{target:r,swap:"outerSync",select:r!==document.body?this.#v("[hx-history-elt]"):void 0,request:{headers:{"HX-History-Restore-Request":"true"},signal:this.#p.signal}});this._loc.reload()}}#Ze(e){let{sourceElement:t,push:r,replace:i,hx:n,response:s}=e;if((n?.pushurl||n?.replaceurl)&&(r=n.pushurl,i=n.replaceurl),null==r&&null==i&&this.#B(t)&&(r="true"),"false"!==r&&!1!==r||(r=null),"false"!==i&&!1!==i||(i=null),!r&&!i)return null;let o=r||i;if("true"===o){let t=s?.raw?.url||e.request.action,r=new URL(t,location.href);o=r.pathname+r.search+(e.request.anchor?"#"+e.request.anchor:"")}return{type:r?"push":"replace",path:o}}#ze(e){if(!this.config.history)return;history.state?.htmx||history.replaceState({htmx:!0},"",location.href);let t=this.#Ze(e);if(!t)return;let r={history:t,sourceElement:e.sourceElement,response:e.response};this.#M(document,"htmx:before:history:update",r)&&("push"===t.type?this.#Ke(t.path):this.#Ye(t.path),this.#M(document,"htmx:after:history:update",r))}#we(e){if(e._htmx?.onInitialized)return;let t=this.#w("hx-on"),r=this.config.metaCharacter||":",i=t=>async r=>{try{await this.#I(e,{event:r},`with(event?.detail||{}){${t}}`,!1)}catch(t){"symbol"!=typeof t&&this.#M(e,"htmx:error",{error:t})}};for(let n of e.getAttributeNames()){let s=t.find(e=>n.startsWith(e));if(!s)continue;this.#k(e).onInitialized=!0;let o=n.substring(s.length),a=e.getAttribute(n);if(!o){for(let t of a.split(/;(?=[^;]*->)/)){let r=t.indexOf("->");-1!==r&&this.#H(e,t.substring(0,r).trim(),i(t.substring(r+2).trim()))}continue}if(o[0]!==r)continue;let l=o.substring(1);l.startsWith(r)&&(l="htmx"+r+l.substring(1)),this.#H(e,l,i(a))}}#ce(e){let t,r=e.sourceElement,i=this.#S(r,"hx-indicator");if(i)t=this.#be(r,i,"hx-indicator");else{if(r===document.body)return;t=[r]}for(const r of t){e.indicators.push(r);let t=this.#z(r);t.rc=(t.rc||0)+1,this.#Ue(r,this.config.requestClass)}}#pe(e){for(let t of e){let e=this.#z(t);e.rc&&--e.rc<=0&&(this.#Xe(t,this.config.requestClass),delete e.rc)}}#ue(e){let t=e.sourceElement,r=this.#S(t,"hx-disable");if(r)for(let i of this.#be(t,r,"hx-disable")){e.disabledElements.push(i);let t=this.#z(i);t.dc=(t.dc||0)+1,i.disabled=!0}}#ge(e){for(const t of e){let e=this.#z(t);e.dc&&--e.dc<=0&&(t.disabled=!1,delete e.dc)}}#T(e,t,r,i,n){if(i&&t&&!t.reportValidity())return;r??=t&&"submit"===e.type?e:null;let s=t?new FormData(t):new FormData,o=t?new Set(t.elements):new Set;if(!t){if(i&&e.reportValidity&&!e.reportValidity())return;this.#et(e,o,s,n)}r?.name&&(s.append(r.name,r.value),o.add(r));let a=this.#S(e,"hx-include");if(a)for(let t of this.#be(e,a)){if(i&&t.reportValidity&&!t.reportValidity())return;this.#et(t,o,s)}return s}#et(e,t,r,i){let n=e.tagName,s=[];"BUTTON"===n||n.includes("-")?s=[e]:(["INPUT","SELECT","TEXTAREA","FIELDSET"].includes(n)||!i&&e!==document.body)&&(s=this.#j(e,"[name]:not(button)"));for(let e of s){let i=e.name||e.getAttribute?.("name");if(!i||e.matches(":disabled")||t.has(e))continue;t.add(e);let n=e.type;if("checkbox"===n||"radio"===n||"INPUT"!==e.tagName&&"checked"in e)e.checked&&r.append(i,e.value);else if("file"===n)for(let t of e.files)r.append(i,t);else if("select-multiple"===n)for(let t of e.selectedOptions)r.append(i,t.value);else if(Array.isArray(e.value))for(let t of e.value)r.append(i,t);else r.append(i,e.value)}}#q(t,r,i,n={}){let s=this.#S(t,r);if(!s)return null;let o=this.#ie(s);if(o)return 0!==o.indexOf("{")&&(o="{"+o+"}"),this.#I(t,n,o,!0).then(e=>{i(e)});i(e.parse(s))}#tt(e){let t=e.trim();return t.startsWith("<")&&t.endsWith("/>")?t.slice(1,-2):t}#be(t,r,i,n){let s=r??t,o=r?this.#Ge(t)||document.body:document;if(s.startsWith("global "))return this.#be(o,s.slice(7),i,!0);let a=s?e.split(s):[],l=[],c=[];for(const e of a){let t,r=this.#tt(e);if(r.startsWith("closest "))t=o.closest(r.slice(8));else if(r.startsWith("find "))t=o.querySelector(r.slice(5));else if(r.startsWith("findAll "))l.push(...o.querySelectorAll(r.slice(8)));else if("next"===r||"nextElementSibling"===r)t=o.nextElementSibling;else if(r.startsWith("next "))t=this.#rt(o,r.slice(5),!!n);else if("previous"===r||"previousElementSibling"===r)t=o.previousElementSibling;else if(r.startsWith("previous "))t=this.#it(o,r.slice(9),!!n);else if("document"===r)t=document;else if("window"===r)t=window;else if("body"===r)t=document.body;else if("host"===r)t=o.getRootNode().host;else if("this"===r){if(i){l.push(...this.#R(o,i));continue}t=o}else c.push(r);t&&l.push(t)}if(c.length>0){let e=c.join(","),t=this.#nt(o,!!n);l.push(...t.querySelectorAll(e))}return[...new Set(l)]}#rt(e,t,r){return this.#st(this.#nt(e,r).querySelectorAll(t),e,Node.DOCUMENT_POSITION_PRECEDING)}#it(e,t,r){let i=[...this.#nt(e,r).querySelectorAll(t)].reverse();return this.#st(i,e,Node.DOCUMENT_POSITION_FOLLOWING)}#st(e,t,r){for(const i of e)if(i.compareDocumentPosition(t)===r)return i}#nt(e,t){return e.isConnected&&e.getRootNode?e.getRootNode?.({composed:t}):document}#ee(e,t,r){let i=this.#be(e,t,r)[0];return i||console.warn(`htmx: '${t}' on ${r} did not match any element`,{elt:e,selector:t,attr:r}),i}#Re(e,t,r){return this.#be(e,t,r)[0]}#ie(e){if(null!=e){if(e.startsWith("js:"))return e.substring(3);if(e.startsWith("javascript:"))return e.substring(11)}}#ae(e){let t=this.#k(e);if(t.abortInitialized)return;t.abortInitialized=!0;let r=()=>{this.#oe(e).abort()};e.addEventListener("htmx:abort",r),t.listeners.push({fromElt:e,eventName:"htmx:abort",handler:r})}#O(e,t,r){let{persistentIds:i,idMap:n}=this.#ot(e,t),s=document.createElement("div");s.hidden=!0,document.body.after(s);let o={target:e,idMap:n,persistentIds:i,pantry:s,futureMatches:new WeakSet};r?this.#at(o,e,t):this.#at(o,e.parentNode,t,e,e.nextSibling),this.#ve(s),s.remove()}#at(e,t,r,i=null,n=null){t instanceof HTMLTemplateElement&&r instanceof HTMLTemplateElement&&(t=t.content,r=r.content),i||=t.firstChild;let s=r.firstChild;for(;s;){let r;if(i&&i!=n&&(r=this.#lt(e,s,i,n),r&&r!==i)){let o=i;for(;o&&o!==r;){let r=o;o=o.nextSibling,r instanceof Element&&(e.idMap.has(r)||this.#ct(e,r,s))?this.#Te(t,r,n):this.#ut(e,r)}}if(!r&&s instanceof Element&&e.persistentIds.has(s.id)){let n=CSS.escape(s.id);r=e.target.id===s.id&&e.target||e.target.querySelector(`[id="${n}"]`)||e.pantry.querySelector(`[id="${n}"]`);let o=r;for(;o=o.parentNode;){let t=e.idMap.get(o);t&&(t.delete(r.id),t.size||e.idMap.delete(o))}this.#Te(t,r,i)}if(r){this.#ht(r,s,e),i=r.nextSibling,s=s.nextSibling;continue}let o=s.nextSibling;if(e.idMap.has(s)){let r=document.createElement(s.tagName);t.insertBefore(r,i),this.#ht(r,s,e),this.process(r),i=r.nextSibling}else t.insertBefore(s,i),i=s.nextSibling;s=o}for(;i&&i!=n;){let t=i;i=i.nextSibling,this.#ut(e,t)}}#ct(e,t,r){if(e.futureMatches.has(t))return!0;for(let i=r.nextSibling,n=0;i&&na.has(e)))return c;if(!r){if(o>0&&c.isEqualNode(t))return c;n||(n=c)}}if(s+=r?.size||0,s>l)break;if(null!=document.activeElement?.selectionStart&&c.contains(document.activeElement))break;if(--o<1&&0===l)break;c=c.nextSibling}return n&&this.#ct(e,n,t)?null:n}#N(e,t){return e instanceof Element&&e.tagName===t.tagName&&(!("SCRIPT"===e.tagName&&!e.isEqualNode(t))&&(!e.id||e.id===t.id))}#ut(e,t){e.idMap.has(t)?this.#Te(e.pantry,t,null):(this.#ve(t),t.remove())}#Te(e,t,r){if(e.moveBefore)try{return void e.moveBefore(t,r)}catch(e){}e.insertBefore(t,r)}#ht(e,t,r){if(3===e.nodeType)return void(e.nodeValue!==t.nodeValue&&(e.nodeValue=t.nodeValue));if(this.config.morphSkip&&e.matches?.(this.config.morphSkip))return;if(!this.#W(e,"htmx:before:morph:node",{oldNode:e,newNode:t}))return;this.#Qe(e,t),e instanceof HTMLTextAreaElement&&document.activeElement!==e&&e.defaultValue!=t.defaultValue&&(e.value=t.value),this.config.morphSkipChildren&&e.matches?.(this.config.morphSkipChildren)||e.isEqualNode(t)&&"TEMPLATE"!==t.tagName&&!t.querySelector?.("template")||this.#at(r,e,t)}#Qe(e,t){let r=this.config.morphIgnore||[],i=!1,n=e=>this.#w("hx-").some(t=>e.startsWith(t));for(const s of t.attributes)if(!r.some(e=>s.name.startsWith(e))&&e.getAttribute(s.name)!==s.value){if(n(s.name)&&(i=!0),!this.#W(e,"htmx:before:morph:attr",{attrName:s.name,newValue:s.value}))continue;e.setAttribute(s.name,s.value),"value"===s.name&&e instanceof HTMLInputElement&&"file"!==e.type&&document.activeElement!==e&&(e.value=s.value)}for(let s=e.attributes.length-1;s>=0;s--){let o=e.attributes[s];if(o&&!t.hasAttribute(o.name)&&!r.some(e=>o.name.startsWith(e))){if(n(o.name)&&(i=!0),!this.#W(e,"htmx:before:morph:attr",{attrName:o.name,newValue:null}))continue;e.removeAttribute(o.name)}}i&&this.#ve(e,!0)}#dt(e,t,r,i){for(const n of i)if(t.has(n.id)){let t=n;for(;t&&t!==r;){let r=e.get(t);null==r&&(r=new Set,e.set(t,r)),r.add(n.id),t=t.parentElement}}}#ot(e,t){let r=this.#j(e,"[id]"),i=t.querySelectorAll("[id]"),n=this.#ft(r,i),s=new Map;return this.#dt(s,n,e.parentElement,r),this.#dt(s,n,t,i),{persistentIds:n,idMap:s}}#ft(e,t){let r=new Set,i=new Map;for(const{id:t,tagName:n}of e)i.has(t)?r.add(t):t&&i.set(t,n);let n=new Set;for(const{id:e,tagName:s}of t)n.has(e)?r.add(e):i.get(e)===s&&n.add(e);for(const e of r)n.delete(e);return n}#fe(t){let r=t.response.raw.status,i=this.config.noSwap.map(e=>e+""),n=r+"";for(let r of[n,n.slice(0,2)+"x",n[0]+"xx"]){if(i.includes(r))return void(t.swap="none");let n=this.#S(t.sourceElement,"hx-status:"+r);if(n)return void e.merge(n,t)}}#Fe(e,t){return new Promise(r=>{this.#m||=[],this.#m.push({task:e,resolve:r,ctx:t}),this.#x||this.#mt()})}async#mt(){if(0===this.#m.length||this.#x)return;this.#x=!0;let{task:e,resolve:t,ctx:r}=this.#m.shift();try{if(document.startViewTransition){let t={task:e,ctx:r};this.#M(r.sourceElement,"htmx:before:viewTransition",t),await document.startViewTransition(t.task).finished,this.#M(r.sourceElement,"htmx:after:viewTransition",t)}else await e()}catch(e){}finally{this.#x=!1,t(),this.#mt()}}#Je(e,t){let r=["class","style","width","height"],i=t.querySelectorAll("[id]"),n=Object.fromEntries([...i].map(e=>[e.id,e])),s=e.querySelectorAll("[id]"),o=[];for(let e of s){let t=n[e.id];if(t?.tagName===e.tagName){let i=e.cloneNode(!1);for(let i of r)t.hasAttribute(i)?e.setAttribute(i,t.getAttribute(i)):e.removeAttribute(i);o.push(()=>{this.#Qe(e,i)})}}return o}#Ue(e,t){e?.classList?.add?.(t)}#Xe(e,t){e?.classList?.remove?.(t),0===e?.classList?.length&&e.removeAttribute("class")}#Ge(e){return"string"==typeof e?this.find(e):e}#$(e){return this.config.metaCharacter?e.replace(/:/g,this.config.metaCharacter):e}}})();htmx.version+="-htmax",htmx.config.historyCache??={disable:!0},(()=>{let e,t=new Set;function r(t){let r=null!=e.attributeValue(t,"hx-sse:connect"),i=e.HCON.parse(e.attributeValue(t,"hx-config")).sse||{};return{reconnect:r,reconnectDelay:500,reconnectMaxDelay:6e4,reconnectMaxAttempts:1/0,reconnectJitter:.3,connectTimeout:htmx.config.defaultTimeout,pauseOnBackground:r,releaseOn:r?"immediate":"end",...htmx.config.sse,...i}}function i(e){for(let t of Object.keys(e))"last-event-id"===t.toLowerCase()&&delete e[t]}async function*n(e){let t=e.reader,r=e.lastEventId,i=new TextDecoder,n="",s=!1,o=!1,a={data:"",event:"",retry:null},l=!0;try{for(;;){let{done:e,value:c}=await t.read();if(e)break;let u=i.decode(c,{stream:!0});l&&(65279===u.charCodeAt(0)&&(u=u.slice(1)),l=!1),n+=u;let h=n.split(/\r\n|\r|\n/);n=h.pop()||"";for(let e of h){if(!e){(s||o||a.event)&&(yield{...a,id:r,hasData:s,hasId:o}),s=!1,o=!1,a={data:"",event:"",retry:null};continue}let t,i,n=e.indexOf(":");if(0!==n)if(n<0?(t=e,i=""):(t=e.slice(0,n),i=e.slice(n+1)," "===i[0]&&(i=i.slice(1))),"data"===t)a.data+=(s?"\n":"")+i,s=!0;else if("event"===t)a.event=i;else if("id"===t)i.includes("\0")||(r=i,o=!0);else if("retry"===t){let e=parseInt(i,10);isNaN(e)||(a.retry=e)}}}}finally{t.releaseLock(),e.reader=null}}function s(t,r){let i=t?._htmx?.sse;i&&(i.reader?.cancel?.(),i.abortController?.abort(),i.delayCanceller&&i.delayCanceller(),i.visibilityHandler&&document.removeEventListener("visibilitychange",i.visibilityHandler),e.triggerHtmxEvent(t,"htmx:sse:close",{connection:i,reason:r||"cleanup"}),delete t._htmx.sse)}htmx.registerExtension("sse",{init:t=>{e=t},htmx_config_request:(e,{ctx:t})=>{t.request.headers.Accept=`${t.request.headers.Accept??t.request.headers.accept??"text/html"}, text/event-stream`,null!=t.timeout&&(t.request.timeout=t.timeout)},htmx_before_response:(t,o)=>{let a,l=o.ctx,c=l.response.raw.headers.get("Content-Type");if(c?.includes("text/event-stream"))return clearTimeout(l.requestTimeout),l.extensionPromise=new Promise(e=>a=e),async function(t,o){let a=t.sourceElement,l=r(a),c=!1,u=null;function h(){o&&(o(),o=null)}"immediate"===l.releaseOn&&h();let d={url:t.request.action,config:l,abortController:{abort:t.request.abort,signal:t.request.signal},reader:null,lastEventId:"",delayCanceller:null,visibilityHandler:null,attempt:0,cancelled:!1,status:null};e.htmxProp(a).sse=d;let f=!1,m=null;if(l.pauseOnBackground){let e=()=>{document.hidden?(f=!0,d.reader?.cancel()):f&&(f=!1,m&&m())};document.addEventListener("visibilitychange",e),d.visibilityHandler=e}if(d.cancelled=!1,!e.triggerHtmxEvent(a,"htmx:sse:before:connection",{connection:d})||d.cancelled)return void s(a,"cancelled");d.status=t.response.status,e.triggerHtmxEvent(a,"htmx:sse:after:connection",{connection:d});let p=t.response.raw;try{for(;a.isConnected;){if(d.attempt>0){if(f){if(await new Promise(e=>{m=e}),m=null,!a.isConnected)break;d.attempt=1,c=!0}if(!c&&(!l.reconnect||d.attempt>l.reconnectMaxAttempts))break;let r=htmx.parseInterval(l.reconnectDelay)??l.reconnectDelay,n=htmx.parseInterval(l.reconnectMaxDelay)??l.reconnectMaxDelay,s=Math.min(r*Math.pow(2,d.attempt-1),n);if(l.reconnectJitter>0){let e=s*l.reconnectJitter;s=Math.max(0,s+(2*Math.random()-1)*e)}if(d.cancelled=!1,!e.triggerHtmxEvent(a,"htmx:sse:before:connection",{connection:d})||d.cancelled)break;if(await new Promise(e=>{d.delayCanceller=e,setTimeout(e,s)}),d.delayCanceller=null,!a.isConnected)break;let o=new AbortController;d.abortController=o;let u=!1,h=htmx.parseInterval(l.connectTimeout)??l.connectTimeout,g=h>0?setTimeout(()=>{u=!0,o.abort()},h):null;try{i(t.request.headers),d.lastEventId&&(t.request.headers["Last-Event-ID"]=d.lastEventId),p=await fetch(t.request.action,{...t.request,signal:o.signal}),clearTimeout(g)}catch(t){if(clearTimeout(g),o.signal.aborted&&!u)break;e.triggerHtmxEvent(a,"htmx:sse:error",{connection:d,error:t}),c=!1,d.attempt++;continue}if(!p.ok){e.triggerHtmxEvent(a,"htmx:sse:error",{connection:d,error:new Error(`SSE reconnect failed with status ${p.status}`),status:p.status}),c=!1,d.attempt++;continue}d.status=p.status,e.triggerHtmxEvent(a,"htmx:sse:after:connection",{connection:d}),d.attempt=0}c=!1;try{d.reader=p.body.getReader();for await(let r of n(d)){if(!a.isConnected||c)break;if(r.hasId&&(d.lastEventId=r.id,r.id||i(t.request.headers)),!r.hasData&&!r.event)continue;let n=[],s={connection:d,message:{data:r.data,event:r.event,id:r.id},cancelled:!1,waitUntil:e=>n.push(Promise.resolve(e))},o=e.triggerHtmxEvent(a,"htmx:sse:before:message",s);if(await Promise.all(n),o&&!s.cancelled){if(null!=r.retry&&(l.reconnectDelay=r.retry),s.message.event){"hx:release"===s.message.event&&h(),htmx.trigger(a,s.message.event,{data:s.message.data,id:s.message.id}),e.triggerHtmxEvent(a,"htmx:sse:after:message",{connection:d,message:s.message});let t=e.attributeValue(a,"hx-sse:close");if(t&&s.message.event===t)return u="message",void d.reader?.cancel();continue}t.text=s.message.data,t.swap.includes("swapEmpty")||(t.swap+=" swapEmpty:false"),await htmx.swap(t),"first"===l.releaseOn&&h(),e.triggerHtmxEvent(a,"htmx:sse:after:message",{connection:d,message:s.message})}}}catch(t){d.abortController?.signal?.aborted||"AbortError"===t.name||e.triggerHtmxEvent(a,"htmx:sse:error",{connection:d,error:t})}if(!a.isConnected)break;d.attempt++}}finally{h(),s(a,u??(a.isConnected?"ended":"removed"))}}(l,a).catch(r=>{"AbortError"!==r.name&&e.triggerHtmxEvent(t,"htmx:sse:error",{error:r,url:l.request.action})}),!1},htmx_after_process:i=>{let n=htmx.config.metaCharacter||":",s=i=>{!function(e){for(let r of["sse-connect","sse-close","sse-swap"])e.hasAttribute(r)&&!t.has(r)&&("sse-swap"===r?console.warn("htmx: [hx-sse] sse-swap is removed in htmx 4. Unnamed SSE messages are swapped automatically. Named events are dispatched as DOM events."):console.warn(`htmx: [hx-sse] legacy attribute ${r} is deprecated; use hx-sse:${r.slice(4)} instead`),t.add(r))}(i);for(let e of["connect","close"]){let t=`sse-${e}`;if(!i.hasAttribute(t))continue;let r=(htmx.config.prefix||"hx-")+"sse"+n+e;i.hasAttribute(r)||i.setAttribute(r,i.getAttribute(t))}!function(t){let i=e.attributeValue(t,"hx-sse:connect");if(!i)return;if(t._htmx?.sse)return;let n=e.attributeValue(t,"hx-trigger")||"load";e.onTrigger(t,n,()=>{t._htmx?.sse||htmx.ajax("GET",i,{source:t,timeout:r(t).connectTimeout})})}(i)};s(i);let o=`[${CSS.escape("hx-sse"+n+"connect")}]`;htmx.config.prefix&&(o+=`,[${CSS.escape(htmx.config.prefix+"sse"+n+"connect")}]`),i.querySelectorAll(`${o},[sse-connect],[sse-close],[sse-swap]`).forEach(s)},htmx_before_cleanup:e=>{s(e)}})})(),(()=>{let e;function t(e){let t=htmx.config.metaCharacter||":",r=`[${CSS.escape("hx-ws"+t+e)}]`;return htmx.config.prefix&&(r+=`,[${CSS.escape(htmx.config.prefix+"ws"+t+e)}]`),r}function r(t){let r=e.HCON.parse(e.attributeValue(t,"hx-config")).ws||{};return{reconnect:!0,reconnectCodes:[1001,1005,1006,1011,1012,1013,1014],reconnectDelay:500,reconnectMaxDelay:6e4,reconnectMaxAttempts:1/0,reconnectJitter:.3,pauseOnBackground:!0,maxOutgoingMessagesQueueSize:100,...htmx.config.ws,...r}}function i(e){if(e.startsWith("ws://")||e.startsWith("wss://"))return e;if(e.startsWith("http://"))return"ws://"+e.slice(7);if(e.startsWith("https://"))return"wss://"+e.slice(8);let t="https:"===window.location.protocol?"wss:":"ws:",r=window.location.host;return e.startsWith("//")?t+e:e.startsWith("/")?t+"//"+r+e:t+"//"+r+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/")+1)+e}const n=new Set;function s(e,t){if(t.timer&&clearTimeout(t.timer),t.visibilityHandler&&document.removeEventListener("visibilitychange",t.visibilityHandler),t.abortController&&t.abortController.abort(),t.queue.length=0,t.socket)try{t.socket.readyState!==WebSocket.OPEN&&t.socket.readyState!==WebSocket.CONNECTING||t.socket.close()}catch(e){}e._htmx?.ws?.connection===t&&delete e._htmx.ws.connection,n.delete(t)}function o(t,r){let i=r.url;if(r.abortController&&r.abortController.abort(),r.socket){let e=r.socket;r.socket=null;try{e.readyState!==WebSocket.OPEN&&e.readyState!==WebSocket.CONNECTING||e.close()}catch(e){}}try{r.socket=new WebSocket(i,r.config?.protocols);let l=new AbortController;r.abortController=l;let c={signal:l.signal};r.socket.addEventListener("open",()=>{t.isConnected?(e.triggerHtmxEvent(t,"htmx:ws:after:connection",{connection:r}),r.attempt=0,function(e){for(;e.queue.length&&e.socket?.readyState===WebSocket.OPEN;){let t=e.queue.shift();a(e,t.element,t.message)}}(r)):s(t,r)},c),r.socket.addEventListener("message",i=>{r.receiving=r.receiving.then(()=>async function(t,r,i){let n=[],o={data:i.data,text(){let e=o.data;return"string"==typeof e?Promise.resolve(e):e instanceof Blob?e.text():Promise.resolve((new TextDecoder).decode(e))},json:()=>o.text().then(JSON.parse)};if(!t.isConnected)return void s(t,r);let a={connection:r,message:o,cancelled:!1,waitUntil(e){n.push(Promise.resolve(e))}},l=e.triggerHtmxEvent(t,"htmx:ws:before:message:incoming",a);if(await Promise.all(n),!l||a.cancelled)return;let c,u=null;if("string"==typeof o.data)try{u=await o.json()}catch(e){c=await o.text()}u&&(void 0!==u.content?c=u.content:void 0!==u.payload&&(c=u.payload,r._payloadWarnFired||(console.warn("htmx: [hx-ws] json.payload is deprecated; use json.content instead"),r._payloadWarnFired=!0)));if(null!=c){let r=u?.target||e.attributeValue(t,"hx-target"),i=u?.swap||e.attributeValue(t,"hx-swap")||htmx.config.defaultSwap;/(?:^|\s)swapEmpty(?::(?:true|false))?(?=\s|$)/.test(i)||(i+=" swapEmpty:false"),await htmx.swap({sourceElement:t,target:r||t,swap:i,select:u?.select??e.attributeValue(t,"hx-select"),selectOOB:e.attributeValue(t,"hx-select-oob"),text:c,transition:!1})}e.triggerHtmxEvent(t,"htmx:ws:after:message:incoming",{connection:r,message:o})}(t,r,i)).catch(i=>{t.isConnected&&e.triggerHtmxEvent(t,"htmx:ws:error",{connection:r,error:i})})},c),r.socket.addEventListener("close",i=>{if(i.target!==r.socket)return;if(t.isConnected&&e.triggerHtmxEvent(t,"htmx:ws:close",{connection:r,reason:"closed",code:i.code}),!n.has(r))return;let a=r.config;a.pauseOnBackground&&document.hidden||(a.reconnect&&a.reconnectCodes.includes(i.code)&&t.isConnected?function(t,r){let i=r.config;r.attempt++;let n=r.attempt;if(!i.reconnect||n>i.reconnectMaxAttempts)return void s(t,r);let a=htmx.parseInterval(i.reconnectDelay)??i.reconnectDelay,l=htmx.parseInterval(i.reconnectMaxDelay)??i.reconnectMaxDelay,c=Math.min(a*Math.pow(2,n-1),l);if(i.reconnectJitter>0){let e=c*i.reconnectJitter;c=Math.max(0,c+(2*Math.random()-1)*e)}if(!t.isConnected)return void s(t,r);if(r.cancelled=!1,!e.triggerHtmxEvent(t,"htmx:ws:before:connection",{connection:r})||r.cancelled)return e.triggerHtmxEvent(t,"htmx:ws:close",{connection:r,reason:"cancelled",code:null}),void s(t,r);r.timer=setTimeout(()=>{t.isConnected?o(t,r):s(t,r)},c)}(t,r):s(t,r))},c),r.socket.addEventListener("error",i=>{t.isConnected&&e.triggerHtmxEvent(t,"htmx:ws:error",{connection:r,error:i})},c)}catch(i){t.isConnected&&e.triggerHtmxEvent(t,"htmx:ws:error",{connection:r,error:i})}}function a(t,r,i){try{t.socket.send(i.data),e.triggerHtmxEvent(r,"htmx:ws:after:message:outgoing",{connection:t,message:i})}catch(i){e.triggerHtmxEvent(r,"htmx:ws:error",{connection:t,error:i})}}function l(t){if(e.htmxProp(t).ws??={},t._htmx.ws.initialized)return;let s=e.attributeValue(t,"hx-ws:connect");if(!s)return;let a=e.attributeValue(t,"hx-trigger")||"load";e.onTrigger(t,a,()=>{!function(t,s){if(s._htmx.ws.connection)return s._htmx.ws.connection;let a={url:i(t),config:r(s),socket:null,attempt:0,timer:null,queue:[],receiving:Promise.resolve(),sending:Promise.resolve(),abortController:null,visibilityHandler:null,cancelled:!1};!e.triggerHtmxEvent(s,"htmx:ws:before:connection",{connection:a})||a.cancelled?e.triggerHtmxEvent(s,"htmx:ws:close",{connection:a,reason:"cancelled",code:null}):(s._htmx.ws.connection=a,n.add(a),o(s,a),a.config.pauseOnBackground&&(a.visibilityHandler=()=>{document.hidden?a.socket&&a.socket.readyState===WebSocket.OPEN&&a.socket.close():a.socket&&a.socket.readyState!==WebSocket.CLOSED||(a.attempt=0,o(s,a))},document.addEventListener("visibilitychange",a.visibilityHandler)))}(s,t)}),t._htmx.ws.initialized=!0}function c(r){if(e.htmxProp(r).ws??={},r._htmx.ws.sendInitialized)return;let s=e.attributeValue(r,"hx-trigger");s||(s=r.matches("form")?"submit":r.matches("input:not([type=button]):not([type=submit]),select,textarea")?"change":"click"),e.onTrigger(r,s,async s=>{r.matches("form")&&"submit"===s.type&&s.preventDefault(),await async function(r,s){let o=r.closest(t("connect")),l=o&&e.attributeValue(o,"hx-ws:connect");if(!l)return void e.triggerHtmxEvent(r,"htmx:ws:error",{url:null,error:"No WebSocket connection found for element"});let c=i(l),u=o._htmx?.ws?.connection;if(!u)return void e.triggerHtmxEvent(r,"htmx:ws:error",{url:c,error:"Connection not open"});let h={...e.createRequestContext(r,s).request.headers};delete h.Accept;let d=r.form||r.closest("form"),f=e.collectFormData(r,d,s.submitter),m={};for(let[e,t]of f)m[e]=e in m?[].concat(m[e],t):t;let p=e.getAttributeObject(r,"hx-vals",e=>Object.assign(m,e)),g=u.sending.then(async()=>{p&&await p,delete m.headers;let t=[],i={headers:h,values:m,data:void 0},s={connection:u,message:i,cancelled:!1,waitUntil(e){t.push(Promise.resolve(e))}},o=e.triggerHtmxEvent(r,"htmx:ws:before:message:outgoing",s);try{if(await Promise.all(t),!o||s.cancelled)return;if(i.data??=JSON.stringify({...i.values,headers:i.headers}),!n.has(u))return void e.triggerHtmxEvent(r,"htmx:ws:error",{connection:u,error:"Connection closed"});u.socket?.readyState===WebSocket.OPEN?a(u,r,i):u.queue.length>=u.config.maxOutgoingMessagesQueueSize?e.triggerHtmxEvent(r,"htmx:ws:error",{connection:u,error:"Outgoing messages queue is full"}):u.queue.push({element:r,message:i})}catch(t){e.triggerHtmxEvent(r,"htmx:ws:error",{connection:u,error:t})}});u.sending=g.catch(()=>{}),await g}(r,s)}),r._htmx.ws.sendInitialized=!0}htmx.registerExtension("ws",{init:t=>{e=t,htmx.config.ws||(htmx.config.ws={})},htmx_after_process:r=>{const i=t=>{!function(e){if(e.hasAttribute("ws-connect")||e.hasAttribute("ws-send")){if(console.warn("htmx: [hx-ws] legacy attributes ws-connect and ws-send are deprecated; use hx-ws:connect and hx-ws:send instead"),e.hasAttribute("ws-connect")){let t=e.getAttribute("ws-connect"),r=htmx.config.metaCharacter||":",i=(htmx.config.prefix||"hx-")+"ws"+r+"connect";e.hasAttribute(i)||e.setAttribute(i,t)}if(e.hasAttribute("ws-send")){let t=htmx.config.metaCharacter||":",r=(htmx.config.prefix||"hx-")+"ws"+t+"send";e.hasAttribute(r)||e.setAttribute(r,"")}}}(t);let r=e.attributeValue(t,"hx-ws:send");null!=e.attributeValue(t,"hx-ws:connect")&&l(t),null!=r&&c(t)};i(r);let n=t("connect")+","+t("send")+",[ws-connect],[ws-send]";r.querySelectorAll(n).forEach(i)},htmx_before_cleanup:t=>{!function(t){let r=t._htmx?.ws?.connection;r&&(e.triggerHtmxEvent(t,"htmx:ws:close",{connection:r,reason:"removed",code:null}),s(t,r))}(t)}}),"undefined"!=typeof window&&window.htmx&&window.addEventListener("pagehide",()=>{n.forEach(e=>{e.socket&&e.socket.close(1e3,"page navigating away")})})})(),(()=>{let e;htmx.registerExtension("preload",{init:t=>{e=t},htmx_after_init:t=>{!function(t){let r=e.attributeValue(t,"hx-preload");if(null==r&&!t._htmx?.boosted)return;let i=[],n=5e3;if(r){let t=e.parseTriggerSpecs(r);if(0===t.length)return;for(const e of t)i.push(e.name),e.timeout&&(n=htmx.parseInterval(e.timeout))}else{let r=t._htmx?.boosted&&"A"===t.tagName,s=null!=e.attributeValue(t,"hx-get");if(!r&&!s)return;if(r&&!1===htmx.config?.preload?.autoBoost)return;htmx.config?.preload?.boostTimeout&&(n=htmx.parseInterval(htmx.config.preload.boostTimeout)),i.push(htmx.config?.preload?.boostEvent||"mousedown"),i.push("touchstart")}let s=async r=>{let{method:i}=e.determineMethodAndAction(t,r);if("GET"!==i)return;if(t._htmx?.preload)return;let s=e.createRequestContext(t,r),o=t.form||t.closest("form"),a=e.collectFormData(t,o,r.submitter),l=e.getAttributeObject(t,"hx-vals",e=>{for(let t in e)a.set(t,e[t])});l&&await l,s.request.headers["HX-Request-Type"]=s.target===document.body||s.select?"full":"partial";let c=s.request.action.replace?.(/#.*$/,""),u=new URLSearchParams(a);u.size&&(c+=(/\?/.test(c)?"&":"?")+u);let h=new URL(c,location.href);t._htmx.preload={prefetch:fetch(c,s.request),action:h.origin===location.origin?h.pathname+h.search:h.href,expiresAt:Date.now()+n};try{await t._htmx.preload.prefetch}catch(e){delete t._htmx.preload}};for(let e of i)t.addEventListener(e,s,{passive:!0});t._htmx.preloadListener=s,t._htmx.preloadEvents=i}(t)},htmx_before_request:(e,t)=>{let{ctx:r}=t;if(e._htmx?.preload&&e._htmx.preload.action===r.request.action&&Date.now()t,delete e._htmx.preload}else e._htmx&&delete e._htmx.preload},htmx_before_cleanup:e=>{if(e._htmx?.preloadListener)for(let t of e._htmx.preloadEvents)e.removeEventListener(t,e._htmx.preloadListener)}})})(),(()=>{if("undefined"==typeof navigation)return;let e,t=0,r=new Set,i=null;function n(){navigation.addEventListener("navigate",e=>{if(!e.canIntercept)return;let n,s=history.state;e.intercept({handler:()=>new Promise(e=>{n=e}),scroll:"manual",focusReset:"manual"}),e.signal.addEventListener("abort",()=>{t>0&&(r.forEach(e=>e()),r.clear(),t=0),i=null}),i=()=>{n(),history.replaceState(s,"")}},{once:!0}),navigation.navigate(location.href,{history:"replace"})}function s(){i&&(i(),i=null)}htmx.registerExtension("browser-indicator",{init:t=>{e=t},htmx_before_history_update:()=>{s()},htmx_before_request:(i,s)=>{(function(t){let r=e.attributeValue(t,"hx-browser-indicator");return null!=r&&"false"!==r||!(!htmx.config.boostBrowserIndicator||!t._htmx?.boosted)})(i)&&(s.ctx._browserIndicator=!0,t++,1===t&&n(),s.ctx.request?.abort&&r.add(s.ctx.request.abort))},htmx_finally_request:(e,i)=>{i.ctx._browserIndicator&&(i.ctx.request?.abort&&r.delete(i.ctx.request.abort),0!==t&&(t--,0===t&&s()))}})})(),(()=>{let e;function t(t,r,i){let n=t.sourceElement;return(async()=>{let s=+r.headers.get("Content-Length")||null;e.triggerHtmxEvent(n,"htmx:download:start",{total:s,ctx:t});let o=r.body.getReader(),a=[],l=0;for(;;){let{done:r,value:i}=await o.read();if(r)break;a.push(i),l+=i.length,e.triggerHtmxEvent(n,"htmx:download:progress",{loaded:l,total:s,ctx:t,percent:s?Math.round(l/s*100):null})}let c=new Blob(a,{type:r.headers.get("Content-Type")||"application/octet-stream"}),u=function(e,t){let r=e.get("Content-Disposition");if(r){let e=r.match(/filename\*\s*=\s*(?:UTF-8'')?([^;]+)/i);if(e){let t=e[1].trim().replace(/^["']|["']$/g,"");try{return decodeURIComponent(t)}catch{}}let t=r.match(/filename\s*=\s*(?:UTF-8'')?(?:"([^"]+)"|([^;]+))/i);if(t)return(t[1]||t[2]).trim()}return t.split("/").pop().split("?")[0]||"download"}(r.headers,i),h=URL.createObjectURL(c);Object.assign(document.createElement("a"),{href:h,download:u}).click(),URL.revokeObjectURL(h),e.triggerHtmxEvent(n,"htmx:download:complete",{filename:u,size:c.size,ctx:t})})()}htmx.registerExtension("download",{init:t=>{e=t},htmx_before_response:(e,{ctx:r})=>{let i=r.response.headers.get("HX-Download");if(i)return void(async()=>{t(r,await fetch(i),i)})();let n=r.response.headers.get("Content-Disposition");return"download"===r.swap||n?.includes("attachment")?(clearTimeout(r.requestTimeout),r.extensionPromise=t(r,r.response.raw,r.request.action),!1):void 0}})})(),(()=>{let e;function t(e){if(e.pendingDiv){e.pendingDiv.remove();for(let t of e.pendingHidden)t.style.display=""}}htmx.registerExtension("hx-pending",{init:t=>{e=t},htmx_config_request:(e,t)=>{let r=t.ctx.request.body;r?.entries&&(t.ctx.pendingBody=r)},htmx_before_request:(t,r)=>{!function(t){if(t.pending=e.attributeValue(t.sourceElement,"hx-pending"),!t.pending)return;let r=document.querySelector(t.pending);if(!r)return;let i=t.target;if("string"==typeof i&&(i=document.querySelector(i)),!i)return;let n=document.createElement("div");n.style.cssText="all: initial",n.classList.add("hx-pending");let s=r instanceof HTMLTemplateElement?r.content.childNodes:r.childNodes;for(let e of s)n.appendChild(e.cloneNode(!0));if(t.pendingBody){let e=new Set(t.pendingBody.keys());for(let r of e){let e=t.pendingBody.getAll(r).filter(e=>"string"==typeof e);if(!e.length)continue;let i=1===e.length?e[0]:JSON.stringify(e);try{n.dataset[r]=i}catch(e){try{n.setAttribute("data-"+r,i)}catch(e){}}}}let o="before"===(a=t.swap)?"beforebegin":"after"===a?"afterend":"prepend"===a?"afterbegin":"append"===a?"beforeend":a;var a;if(t.pendingHidden=[],"innerHTML"===o){for(let e of i.children)e.style.display="none",t.pendingHidden.push(e);i.appendChild(n)}else["beforebegin","afterbegin","beforeend","afterend"].includes(o)?i.insertAdjacentElement(o,n):(i.style.display="none",t.pendingHidden.push(i),i.after(n));t.pendingDiv=n,htmx.process(n)}(r.ctx)},htmx_error:(e,r)=>{t(r.ctx)},htmx_before_swap:(e,r)=>{t(r.ctx)}})})(),(()=>{let e;htmx.registerExtension("hx-targets",{init:t=>{e=t},htmx_before_swap:(t,r)=>{let{ctx:i,tasks:n}=r,s=e.attributeValue(i.sourceElement,"hx-targets");if(!s)return;let o=htmx.findAll(i.sourceElement,s);if(!o.length)return void console.warn(`htmx: '${s}' on hx-targets did not match any elements`,{selector:s});let a=n.findIndex(e=>"main"===e.type);if(-1===a)return;let l=n[a],c=Array.from(o).map(e=>({...l,fragment:l.fragment.cloneNode(!0),target:e}));n.splice(a,1,...c)}})})(),(()=>{let e,t=new Set,r=!1,i=Symbol(),n=null,s=null,o=null,a=0,l=!1;const c={childList:!0,subtree:!0,attributes:!0,characterData:!0};let u=null;function h(){r||a>0||(r=!0,queueMicrotask(()=>{n?.disconnect();let e=performance.now();t.forEach(e=>e());let i=performance.now()-e;!l&&i>16&&(console.warn(`htmx: hx-live expressions took ${i.toFixed(1)}ms.`),l=!0),0===t.size?n&&(clearTimeout(u),u=null,document.removeEventListener("input",o,!0),o=null,document.removeEventListener("change",s,!0),n.disconnect(),n=null,s=null,l=!1):n.observe(document.documentElement,c),r=!1}))}let d=new Set("disabled required readonly open inert multiple autofocus novalidate default reversed loop muted controls autoplay playsinline formnovalidate async defer ismap typemustmatch allowfullscreen itemscope nomodule alpha headingreset".split(" ")),f=new Set("checked value selected hidden".split(" ")),m=new Set("contenteditable draggable spellcheck writingsuggestions".split(" ")),p=new Set("tabindex colspan rowspan maxlength minlength size span start rows cols width height min max step low high optimum".split(" "));function g(e,t){return e instanceof HTMLElement?t.toLowerCase():t}function x(e,t){if((t=g(e,t)).startsWith("aria-"))return function(e,t){let r=e?.getAttribute("aria-"+t);return null==r?void 0:O.has(t)?r:N.has(t)?r.trim()?r.trim().split(/\s+/):[]:T(r)}(e,t.slice(5));if(t.startsWith("data-"))return function(e,t){let r=e.getAttribute(t);return null===r?void 0:T(r)}(e,t);if("value"===t&&("number"===e.type||"range"===e.type))return""===e.value?null:e.valueAsNumber;if(f.has(t))return e[t];if(d.has(t)||t.startsWith("shadowroot")&&"shadowrootmode"!==t&&"shadowrootslotassignment"!==t)return e.hasAttribute(t);let r=e.getAttribute(t);if(null!=r&&m.has(t))try{return JSON.parse(r.toLowerCase())}catch{}return p.has(t)&&r?.trim()&&isFinite(r)?+r:r}function b(e,t,r){if(t=g(e,t),"function"==typeof r&&(r=r(x(e,t)),"function"==typeof r?.then))throw new TypeError("hx-live: assignment returned a promise");t.startsWith("aria-")?function(e,t,r){let i="aria-"+t;null==r?e.removeAttribute(i):e.setAttribute(i,N.has(t)&&Array.isArray(r)?r.join(" "):String(r))}(e,t.slice(5),r):t.startsWith("data-")?function(e,t,r){void 0===r?e.removeAttribute(t):e.setAttribute(t,"object"==typeof r||T(r)!==r?JSON.stringify(r):r)}(e,t,r):f.has(t)?function(e,t,r){if("checked"===t||"selected"===t){let i=!!r;e[t]=i,e.toggleAttribute(t,i)}else!1===r||null==r?(e[t]="boolean"!=typeof e[t]&&"",e.removeAttribute(t)):!0===r?(e[t]=!0,e.setAttribute(t,"")):(e[t]=r,e.setAttribute(t,String(r)))}(e,t,r):d.has(t)||t.startsWith("shadowroot")&&"shadowrootmode"!==t&&"shadowrootslotassignment"!==t?e.toggleAttribute(t,!!r):null==r?e.removeAttribute(t):e.setAttribute(t,String(r))}function y(e,t){return t?new Set(e.map(t)):e}function v(e,t){let r=e.prefix;return r+("data-"===r?C(t):r?t.toLowerCase():t)}function w(e,t,r){if(!e.cascades)return e.prefix?t.hasAttribute(r)&&t:t;for(;t&&!t.hasAttribute(r);)t=t.parentElement;return t}function S(e,t,r,i){if("string"!=typeof t)return!1;let n=v(e,t);return y(e.elts,e.cascades&&(t=>w(e,t,n)||!i&&t)).forEach(e=>e&&b(e,n,r)),!0}let E={get:(e,t)=>{if(!e.prefix&&"class"===t)return e.scope.class;if("string"!=typeof t)return;let r=v(e,t),i=e.elts[0]&&w(e,e.elts[0],r);return i?x(i,r):void 0},set:(e,t,r)=>S(e,t,r),deleteProperty:(e,t)=>S(e,t,void 0,!0),has:(e,t)=>"data-"===e.prefix&&"string"==typeof t&&!!e.elts[0]&&!!w(e,e.elts[0],v(e,t)),ownKeys:e=>{if("data-"!==e.prefix)return[];let t=[],r=new Set;for(let i=e.elts[0];i;i=e.cascades?i.parentElement:null)for(let e of Object.keys(i.dataset))"htmxPowered"===e||r.has(e)||(r.add(e),t.push(e));return t},getOwnPropertyDescriptor:(e,t)=>{if("data-"===e.prefix&&"string"==typeof t&&"htmxPowered"!==t)return e.elts[0]&&w(e,e.elts[0],v(e,t))?{enumerable:!0,configurable:!0}:void 0}};function A(e,t,r,i=""){return new Proxy({elts:e,cascades:t,scope:r,prefix:i},E)}function C(e){return e.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function T(e){try{return JSON.parse(e)}catch{return e}}let q=/(['"`\/])(?:\\.|(?!\1).)*\1|(?t?"`"===t?e.replace(/\$\{((?:[^{}]|\{[^{}]*\})*)\}/g,(e,t)=>"${"+_(t)+"}"):e:"attr.class")}let O=new Set("activedescendant details errormessage keyshortcuts label placeholder roledescription valuetext".split(" ")),N=new Set("controls describedby dropeffect flowto labelledby owns relevant".split(" "));function H(e,t){return!!e?.classList.contains(t)}function k(e,t,r){if("function"==typeof r&&(r=r(H(e,t)),"function"==typeof r?.then))throw new TypeError("hx-live: assignment returned a promise");e.classList.toggle(t,!!r),e.classList.length||e.removeAttribute("class")}function M(e,t){let r,i,n,s,o={get data(){return r||=A(e,t,null,"data-")},get aria(){return i||=A(e,t,null,"aria-")},get class(){return n||=function(e,t=!1){let r=e[0],i=(e,r)=>t?e.closest("."+CSS.escape(r)):e,n=e=>H(r&&i(r,e),e),s=(t,r)=>y(e,e=>i(e,t)||e).forEach(e=>k(e,t,r)),o={assign(t){t&&"object"==typeof t&&!Array.isArray(t)?P(s,t):console.warn("hx-live: class.assign expects an object.",{elts:e})},add:(...e)=>e.forEach(e=>s(e,!0)),remove:(...e)=>e.forEach(e=>s(e,!1)),contains:n,toggle(e,t){let r=t??!n(e);return s(e,e=>t??!e),r},replace(r,i){if(t)return!!n(r)&&(s(r,!1),s(i,!0),!0);let o;for(let t=0;t{if("string"==typeof i&&o[i])return o[i];let s=!t&&r?.classList;if(s&&i in s){let e=s[i];return"function"==typeof e?e.bind(s):e}return r?"string"==typeof i?n(i):void 0:i===Symbol.iterator?()=>[][Symbol.iterator]():void 0},set:(r,i,n)=>{if("string"!=typeof i)return!1;if(t||"value"!==i)s(i,n);else for(let t of e)t.classList.value=n;return!0},deleteProperty:(e,t)=>"string"==typeof t&&(s(t,!1),!0),has:(e,t)=>"string"==typeof t&&n(t),ownKeys:()=>!t&&r?[...r.classList]:[],getOwnPropertyDescriptor:(e,r)=>!t&&n(r)?{enumerable:!0,configurable:!0}:void 0})}(e,t)},get attr(){return s||=A(e,t,o)}};return o}function I(e){let t;return new Proxy(function(){},{apply:(t,r,[i])=>{let n=new Set;for(let t of e){let e=t.closest?.(i);e&&n.add(e)}return G([...n])},get:(r,i)=>(t||=M(e,!0))[i]})}function L(t,r,i){"class"===r?function(t,r){let i=e.htmxProp(t),n=i.liveClasses||new Set,s=new Set(P((e,r)=>k(t,e,r),r));for(let e of n)s.has(e)||k(t,e,!1);i.liveClasses=s}(t,i):k(t,r.slice(1),i)}function P(e,t){let r=[];if("string"==typeof t&&(t={[t]:!0}),t&&"object"==typeof t)for(let[i,n]of Object.entries(t))for(let t of i.trim().split(/\s+/).filter(Boolean))r.push(t),e(t,!!n);return r}function D(e,t,r){let i=t.startsWith("."),n=i?t.slice(1):t,s=t.startsWith("aria-"),o=i?"."+n:"["+t+"]",a=null==r?e[0]?.parentElement:r.nodeType?r:null,l=a?[a,...a.querySelectorAll(o)]:e.length?document.querySelectorAll("string"==typeof r?r:r?.from||o):[],c=new Set(e);for(let e of l)c.has(e)||(i?(e.classList?.remove(n),0===e.classList?.length&&e.removeAttribute("class")):s?e.setAttribute(t,"false"):e.removeAttribute(t));for(let r of e)i?r.classList?.add(n):s?r.setAttribute(t,"true"):r.setAttribute(t,"")}function j(e,...t){let r=e||document;for(let e of t)e?.addEventListener&&(r=e);return new Promise(e=>{let i=[],n=!1,s=t=>{if(!n){n=!0;for(let e of i)e();e(t)}};for(let e of t){if(null==e||e?.addEventListener)continue;let t="number"==typeof e?e:"string"==typeof e?htmx.parseInterval(e):void 0;if(t>0){let r=setTimeout(()=>s(e),t);i.push(()=>clearTimeout(r))}else"string"==typeof e&&(r.addEventListener(e,s,{once:!0}),i.push(()=>r.removeEventListener(e,s)))}})}function V(e,t,...r){let i=t.startsWith("."),n=i?t.slice(1):t,s=t.startsWith("aria-"),o=r.length>1?r:r[0];if("string"==typeof o&&(o=o.split("|").map(e=>e.trim())),o)if(i){let t=o.findIndex(t=>t&&e.classList.contains(t));t>=0&&e.classList.remove(o[t]);let r=o[(t+1)%o.length];r&&e.classList.add(r)}else{let r=o.indexOf(x(e,t)??""),i=o[(r+1)%o.length];b(e,t,""===i?void 0:i)}else if(i)e.classList.toggle(n);else if(s){let r=e.getAttribute(t);e.setAttribute(t,"true"===r?"false":"true")}else e.toggleAttribute(t)}function R(){let e=new Map;return(t,r)=>{let n=(s=r?r.toString():null,e.get(s)||(e.set(s,{last:0,reject:null}),e.get(s)));var s;n.reject?.(i),n.reject=null;let o=++n.last;if(!r)return new Promise((e,r)=>{n.reject=r,setTimeout(()=>{o===n.last&&(n.reject=null,e())},t)});setTimeout(()=>o===n.last&&r(),t)}}function $(t){let r=e.htmxProp(t);return r.debounce||(r.debounce=R())}function W(e,t=document){return r=>{if("string"!=typeof r)return G(r?.nodeType?[r]:[...r||[]]);let i=r,n=i.match(/^(.+)\s+in\s+(.+)$/),s=[t];if(n&&(i=n[1],s="this"===n[2]||"me"===n[2]?[e]:[...document.querySelectorAll(n[2])]),!s.length)return G([]);let o,a=e=>{if(1===s.length)return[...s[0].querySelectorAll(e)];let t=[],r=new Set;for(let i of s)for(let n of i.querySelectorAll(e))r.has(n)||(r.add(n),t.push(n));return t.sort((e,t)=>4&e.compareDocumentPosition(t)?-1:1)},l=i.match(/^(next|previous|closest|first|last)\s+(.+)$/);if(l){let[,t,r]=l,i=t=>e.compareDocumentPosition(t);if("closest"===t){let t=e.closest?.(r);o=t?[t]:[]}else{let e=a(r);if("first"===t)o=e.slice(0,1);else if("last"===t)o=e.slice(-1);else if("next"===t){let t=e.find(e=>4&i(e));o=t?[t]:[]}else{let t=e.reverse().find(e=>2&i(e));o=t?[t]:[]}}}else o=a(i);return G(o)}}let B="map filter reduce reduceRight forEach some every find findIndex findLast findLastIndex flatMap flat slice indexOf lastIndexOf includes join at".split(" "),z={before:"beforebegin",after:"afterend",start:"afterbegin",end:"beforeend"};function F(e,t,r){let i=e.parentElement;"into"===t?e.innerHTML=r:"replace"===t?e.outerHTML=r:e.insertAdjacentHTML(z[t],r),htmx.process(i)}let U,J,Q,X=()=>{};function G(e){let t,r,i=new Proxy({},{get:(n,s)=>{if("count"===s)return e.length;if("arr"===s)return()=>e.slice();if(s===Symbol.iterator)return()=>e.values();if("q"===s)return t=>{let r=new Set,i=/^(next|previous)\s/.test(t);for(let n of e)for(let e of W(n,i?n.parentElement:n)(t).arr())r.add(e);return G([...r])};if("trigger"===s)return(t,r,n)=>(e.forEach(e=>htmx.trigger(e,t,r,n)),i);if("insert"===s)return(t,r)=>(e.forEach(e=>F(e,t,r)),i);if("take"===s)return(t,r)=>(D(e,t,r),i);if("toggle"===s)return(t,...r)=>(e.forEach(e=>V(e,t,...r)),i);if("attr"===s||"class"===s||"aria"===s)return(t||=M(e,!1))[s];if("data"===s)return(r||=I(e)).data;if("local"===s)return t||=M(e,!1);if("closest"===s)return r||=I(e);if(B.includes(s))return e[s].bind(e);if(!e.length)return"function"==typeof function(e){for(let t=HTMLElement.prototype;t;t=Object.getPrototypeOf(t)){let r=Object.getOwnPropertyDescriptor(t,e);if(r)return r}}(s)?.value?X:void 0;let o=e[0]?.[s];return"function"==typeof o?(...t)=>e.map(e=>e[s](...t))[0]:o&&"object"==typeof o?G(e.map(e=>e[s])):o},set:(t,r,i)=>(e.forEach(e=>{let t=e[r];if(null==t||"function"==typeof t)e[r]=i;else if("function"==typeof i){let n=i(t);if("function"==typeof n?.then)throw new TypeError("hx-live: assignment returned a promise");e[r]=n}else e[r]=i}),h(),!0)});return i}function K(){let e=htmx.config.metaCharacter||":",t=htmx.config.prefix;J=["hx-live"+e],t&&J.push(t+"live"+e);let r=htmx.config.live?.bindPrefix;void 0===r&&(window.Alpine?(r="",console.warn("hx-live: Alpine detected; set config.live.bindPrefix.")):r=":"),r&&J.push(r),Q=["hx-live"],t&&Q.push(t+"live");let i=J.map(e=>`starts-with(name(), "${e}")`).join(" or "),n=Q.map(e=>`@${e}`).join(" or ");U=(new XPathEvaluator).createExpression(`.//*[@*[${i}] or ${n}]`)}function Y(e){for(let t of J)if(e.startsWith(t)&&e.length>t.length)return e.slice(t.length)}function Z(e){let r=e._htmx;if(r?.liveRuns){for(let e of r.liveRuns)t.delete(e);delete r.liveRuns,delete r.effectRegistered,delete r.bindings}}function ee(t){if(t.closest("[hx-ignore]"))return;let r=e.htmxProp(t);if(!r.effectRegistered){let e=Q.find(e=>t.hasAttribute(e));e&&(r.effectRegistered=!0,te(t,t.getAttribute(e)))}r.bindings||=new Set;for(let e of t.attributes){let i=Y(e.name);i&&!r.bindings.has(i)&&(r.bindings.add(i),te(t,e.value,i))}}function te(r,a,l){!function(){if(n)return;s=()=>h();let e=htmx.parseInterval(htmx.config.live?.inputDebounce??100)??100;o=()=>{clearTimeout(u),u=setTimeout(h,e)},document.addEventListener("input",o,!0),document.addEventListener("change",s,!0),n=new MutationObserver(s),n.observe(document.documentElement,c)}();let d,f=void 0!==l,m=$(r),p=/\bawait\b/.test(a),g=!f&&p,y=!f||p,v=!1,w=async()=>{if(r.isConnected){if(!g||!v){v=g;try{d||=e.executeJavaScript(r,{debounce:m},a,f,y,!0);let t=y?await d():d();f&&(!function(t,r,i){if("function"==typeof i)throw new TypeError("hx-live: binding returned a function");if(r.startsWith("?"))return void t.toggleAttribute(r.slice(1),!!i);if("text"===r){let e=null==i?"":String(i);return void(t.textContent!==e&&(t.textContent=e))}if("html"===r){let e=null==i?"":String(i);return void(t.innerHTML!==e&&(t.innerHTML=e))}if("style"===r)return void function(t,r){let i=e.htmxProp(t),n=i.liveStyles||new Set,s=[];if("string"==typeof r)for(let e of r.split(";")){let t=e.indexOf(":");if(t<0)continue;let r=e.slice(0,t).trim(),i=e.slice(t+1).trim();r&&s.push([r,i])}else if(r&&"object"==typeof r)for(let[e,t]of Object.entries(r))s.push([C(e),null==t||""===t?null:String(t)]);let o=new Set(s.map(([e])=>e));for(let e of n)o.has(e)||t.style.removeProperty(e);for(let[e,r]of s)null==r?t.style.removeProperty(e):t.style.setProperty(e,r);0===t.style.length&&t.removeAttribute("style"),i.liveStyles=o}(t,i);if("class"===r||r.startsWith("."))return void L(t,r,i);if(x(t,r)===i)return;b(t,r,i)}(r,l,t),y&&n?.takeRecords())}catch(e){e!==i&&console.error("hx-live expression failed",e,f?{elt:r,attr:l}:{elt:r})}finally{g&&queueMicrotask(()=>v=!1)}}}else t.delete(w)};t.add(w);let S=e.htmxProp(r);S.liveRuns=S.liveRuns||new Set,S.liveRuns.add(w),w()}htmx.live={q:e=>W(document.documentElement)(e),debounce:R(),refresh:()=>h(),take:(e,t,r)=>D(htmx.live.q(e).arr(),t,r),toggle:(e,t,...r)=>htmx.live.q(e).forEach(e=>V(e,t,...r)),forEvent:(...e)=>j(null,...e),nextFrame:()=>new Promise(e=>requestAnimationFrame(e))},htmx.live.$=htmx.live.q,htmx.registerExtension("hx-live",{init:t=>{e=t},htmx_before_cleanup:e=>{Z(e)},htmx_before_morph_attr:(e,t)=>{U||K(),J.some(e=>t.attrName.startsWith(e))&&Z(e)},htmx_after_process:e=>{!function(e){U||K(),1===e.nodeType&&ee(e);let t,r=U.evaluate(e),i=[];for(;t=r.iterateNext();)i.push(t);for(t of i)ee(t)}(e)},htmx_before_swap:()=>{a++},htmx_finally_swap:()=>{0===--a&&t.size>0&&h()},htmx_scope:(t,r)=>{let i=e.htmxProp(t);Object.assign(r.scope,i.liveScope||=function(e){let t=M([e],!1),r=I([e]);return{q:W(e),forEvent:(...t)=>j(e,...t),nextFrame:()=>new Promise(e=>requestAnimationFrame(e)),trigger:(t,r,i)=>htmx.trigger(e,t,r,i),debounce:$(e),take:(t,r)=>D([e],t,r),toggle:(t,...r)=>V(e,t,...r),attr:t.attr,insert:(t,r)=>F(e,t,r),matches:t=>e.matches(t),style:e.style,data:r.data,aria:t.aria,local:t,closest:r}}(t)),r.code=_(r.code),htmx.config.live?.useDollar&&(r.scope.$=r.scope.q)}})})(),(()=>{let e,t=null;const r="htmx-history-index";function i(){return htmx.config.historyCache}function n(e){let t=[e];return htmx.config.prefix&&t.push(e.replaceAll("hx-",htmx.config.prefix)),t.join(",")}function s(){try{return sessionStorage.setItem("__htmx_test__","1"),sessionStorage.removeItem("__htmx_test__"),!0}catch(e){return!1}}function o(){return htmx.find(n("[hx-history-elt]"))||document.body}const a="data-htmx-history-value",l="data-htmx-history-checked",c="data-htmx-history-scroll";function u(){let e=history.state||{htmx:!0},r=e.htmxId;r||(r=crypto.randomUUID?.()??Math.random().toString(36).slice(2),history.replaceState({...e,htmxId:r},"",location.href)),t=r}function h(e){sessionStorage.setItem(r,JSON.stringify(e))}function d(e,t){if(!s()||i().size<=0)return!1;let n=function(){try{return JSON.parse(sessionStorage.getItem(r))||[]}catch{return[]}}().filter(t=>t!==e);for(;n.length>=i().size;)sessionStorage.removeItem("htmx-history-"+n.shift());let o=JSON.stringify(t);for(;;)try{return sessionStorage.setItem("htmx-history-"+e,o),n.push(e),h(n),!0}catch(e){if(0===n.length)return!1;sessionStorage.removeItem("htmx-history-"+n.shift())}}function f(r){if(!(r=r||t))return;if(htmx.find(n('[hx-history="false"]')))return;let i=o();var s;(s=i).querySelectorAll("input, textarea, select").forEach(e=>{let t=e.type?.toLowerCase();if("file"!==t&&"password"!==t)if("checkbox"===t||"radio"===t)e.checked&&e.setAttribute(l,"1");else if("SELECT"===e.tagName&&e.multiple){let t=Array.from(e.options).filter(e=>e.selected).map(e=>e.value);t.length&&e.setAttribute(a,JSON.stringify(t))}else e.value&&e.setAttribute(a,e.value)}),s.querySelectorAll("*").forEach(e=>{(e.scrollTop>0||e.scrollLeft>0)&&e.setAttribute(c,`${e.scrollTop},${e.scrollLeft}`)});let u=document.head.outerHTML,h=window.scrollY,f=document.title,m={target:i,head:u};if(!1===e.triggerHtmxEvent(document,"htmx:history:cache:before:save",m))return;let p=function(e){let t=e.cloneNode(!0);return t.querySelectorAll(".htmx-request").forEach(e=>e.classList.remove("htmx-request")),t.querySelectorAll("[disabled][data-disabled-by-htmx]").forEach(e=>{e.removeAttribute("disabled"),e.removeAttribute("data-disabled-by-htmx")}),t.outerHTML}(i);u=m.head,d(r,{content:p,head:u,scroll:h,title:f}),e.triggerHtmxEvent(document,"htmx:history:cache:after:save",{content:p,head:u,scroll:h,title:f})}function m(){let e=history.state?.htmxId;return e&&s()?function(e){try{return JSON.parse(sessionStorage.getItem("htmx-history-"+e))}catch{return null}}(e):null}async function p(t){let r={head:t.head,ready:null};e.triggerHtmxEvent(document,"htmx:history:cache:before:restore",r),r.ready&&await r.ready;let n=t.content,s=o(),u=i().swapStyle,h={sourceElement:document.body,target:s,swap:u,text:n,transition:htmx.config.transitions??!1};await htmx.swap(h),document.title=t.title||document.title,requestAnimationFrame(()=>{var i;window.scrollTo(0,t.scroll||0),(i=o()).querySelectorAll(`[${l}]`).forEach(e=>{e.checked=!0,e.removeAttribute(l)}),i.querySelectorAll(`[${a}]`).forEach(e=>{let t=e.getAttribute(a);if("SELECT"===e.tagName&&e.multiple){let r=JSON.parse(t);Array.from(e.options).forEach(e=>{e.selected=r.includes(e.value)})}else e.value=t;e.removeAttribute(a)}),i.querySelectorAll(`[${c}]`).forEach(e=>{let[t,r]=e.getAttribute(c).split(",").map(Number);e.scrollTop=t,e.scrollLeft=r,e.removeAttribute(c)}),r.item=t,e.triggerHtmxEvent(document,"htmx:history:cache:after:restore",r)})}htmx.registerExtension("history-cache",{init:t=>{e=t,htmx.config.historyCache??={},htmx.config.historyCache.size??=10,htmx.config.historyCache.refreshOnMiss??=!1,htmx.config.historyCache.disable??=!1,htmx.config.historyCache.swapStyle??="outerSync",history.state?.htmx&&u()},htmx_before_history_update:(e,t)=>{i().disable||(u(),f())},htmx_after_history_update:()=>{i().disable||u()},htmx_before_history_restore:(r,n)=>{if(i().disable)return;let s=t,o=history.state?.htmxId;s&&s!==o&&f(s),o?t=o:u();let a=m();if(!a){let t={path:n.path,refreshOnMiss:i().refreshOnMiss};return e.triggerHtmxEvent(document,"htmx:history:cache:miss",t),t.refreshOnMiss?(location.reload(),!1):void 0}let l={path:n.path,item:a};return!1!==e.triggerHtmxEvent(document,"htmx:history:cache:hit",l)?(n.cancelled=!0,p(l.item),!1):void 0}})})(),(()=>{let e;htmx.registerExtension("upsert",{init:t=>{e=t},htmx_process_upsert:(t,r)=>{let{ctx:i,tasks:n}=r,s={style:"upsert"},o=t.getAttribute("key"),a=t.getAttribute("sort"),l=t.hasAttribute("prepend");o&&(s.key=o),null!==a&&(s.sort=a||!0),l&&(s.prepend=!0),n.push({type:"partial",fragment:t.content.cloneNode(!0),target:e.attributeValue(t,"hx-target"),swapSpec:s,sourceElement:i.sourceElement})},handle_swap:(e,t,r,i)=>{if("upsert"===e){let e=i.key||"id",n="desc"===i.sort,s=t.firstChild,o=t=>t.getAttribute(e)||t.id,a=(e,t)=>{let r=e.localeCompare(t,void 0,{numeric:!0});return n?-r:r};for(let e of Array.from(r.children)){let r=e.id;if(r){let t=document.getElementById(r);if(t){t.replaceWith(e);continue}}let n=o(e);if(!n){i.prepend?t.insertBefore(e,s):t.appendChild(e);continue}let l=!1;for(let r of t.children){let i=o(r);if(i&&a(n,i)<0){t.insertBefore(e,r),l=!0;break}}l||t.appendChild(e)}return!0}return!1}})})(),(()=>{let e,t=0;function r(){t>0&&t--,0===t&&window.Alpine?.flushAndStopDeferringMutations&&window.Alpine.flushAndStopDeferringMutations()}htmx.registerExtension("alpine-compat",{init:t=>{e=t;let r=e.isSoftMatch;e.isSoftMatch=function(e,t){return e._x_bindings?.id&&t.matches?.("[\\:id], [x-bind\\:id]")?e instanceof Element&&e.tagName===t.tagName:r(e,t)}},htmx_before_swap:(e,r)=>{if(!window.Alpine?.closestDataStack||!window.Alpine?.cloneNode||!window.Alpine?.deferMutations)return;0===t&&window.Alpine.deferMutations(),t++;let{tasks:i}=r;for(let e of i)if("innerMorph"===e.swapSpec.style||"outerMorph"===e.swapSpec.style){if(!e.fragment||!e.target)continue;if(!("string"==typeof e.target?document.querySelector(e.target):e.target))continue}},htmx_before_morph_node:(t,r)=>{if(!window.Alpine?.closestDataStack||!window.Alpine?.cloneNode)return;let{oldNode:i,newNode:n}=r,s=window.Alpine.closestDataStack(i);if(n._x_dataStack=s,i.isConnected&&(window.Alpine.cloneNode(i,n),i._x_teleport&&n._x_teleport)){let t=document.createDocumentFragment();t.append(n._x_teleport),e.morph(i._x_teleport,t,!1)}},htmx_history_cache_before_save:(e,t)=>{window.Alpine?.destroyTree&&(t.target.querySelectorAll("[x-data]").forEach(e=>{e._x_dataStack&&e.setAttribute("data-alpine-state",JSON.stringify(e._x_dataStack[0]))}),window.Alpine.destroyTree(t.target))},htmx_history_cache_after_restore:(e,t)=>{window.Alpine&&document.querySelectorAll("[data-alpine-state]").forEach(e=>{let t=JSON.parse(e.getAttribute("data-alpine-state"));if(e.removeAttribute("data-alpine-state"),e._x_dataStack)for(let r in t)try{e._x_dataStack[0][r]=t[r]}catch{}})},htmx_after_swap:(e,t)=>{t.ctx._alpineFlushed=!0,r()},htmx_finally_request:(e,t)=>{t.ctx._alpineFlushed||r()}})})(); \ No newline at end of file diff --git a/src/Common/wwwroot/htmx.min.js b/src/Common/wwwroot/htmx.min.js index 6e099f1..b38faca 100644 --- a/src/Common/wwwroot/htmx.min.js +++ b/src/Common/wwwroot/htmx.min.js @@ -1 +1 @@ -var htmx=(()=>{const e={parse(t){if(!t)return{};if(t.startsWith("{"))return JSON.parse(t);let r=/(?:"([^"]+)"|'([^']+)'|([^\s,:]+))(?:\s*:\s*(?:"([^"]*)"|'([^']*)'|<((?:[^/]|\/(?!>))+)\/>|([^\s,]+)))?(?=\s|,|$)/g,i={};for(let s of t.matchAll(r)){let[,t,r,n,o,a,l,h]=s,c=t??r??n,u=(o??a??l??h??"true").trim();try{u=JSON.parse(u)}catch{}let d=n?.includes("."),f=d?c.split(".").reduceRight((e,t)=>({[t]:e}),u):{[c]:u};e.merge(f,i)}return i},split:e=>e.split(/,(?![^\[]*\])(?![^(]*\))(?![^<]*\/>)(?=(?:[^"']|"[^"]*"|'[^']*')*$)/),merge(t,r){"string"==typeof t&&(t=e.parse(t));for(let[i,s]of Object.entries(t)){if(["__proto__","constructor","prototype"].includes(i))continue;let t=s?.constructor===Object,n=r[i]?.constructor===Object;t&&n?e.merge(s,r[i]):r[i]=s}return r}};class t{#e=null;#t=[];admit(e,t,r){if(!this.#e)return this.#e={strategy:e,abort:r},"run";if("replace"===e||"abort"!==e&&"abort"===this.#e.strategy)return this.#t=[],this.#e.abort?.(),this.#e={strategy:e,abort:r},"run";if("queue all"===e)this.#t.push(t);else if("queue last"===e)this.#t=[t];else{if("abort"===e||"drop"===e||0!==this.#t.length)return"dropped";this.#t.push(t)}return"queued"}continue(){this.#e=null,this.#t.shift()?.()}abort(){this.#e?.abort?.()}}return new class{#r=e;#i=new Map;#s="";#n=new Set;_loc=window.location;#o;#a=Function;#l=Object.getPrototypeOf(async function(){}).constructor;#h={createHTML:e=>e,createScript:e=>e};#c;#u="a,form";#d=["get","post","put","patch","delete","query"];#f;#m;#p;#g;#x;constructor(){this.#b(),this.#y(),this.#c=this.#S("[hx-action],[hx-get],[hx-post],[hx-put],[hx-patch],[hx-delete],[hx-query]"),this.#f=(new XPathEvaluator).createExpression(`.//*[@*[${this.#v("hx-on").map(e=>`starts-with(name(), "${e}")`).join(" or ")}]]`),this.#o={HCON:e,attributeValue:this.#E.bind(this),parseTriggerSpecs:this.#w.bind(this),determineMethodAndAction:this.#A.bind(this),createRequestContext:this.#T.bind(this),collectFormData:this.#C.bind(this),getAttributeObject:this.#q.bind(this),insertContent:this.#N.bind(this),morph:this.#I.bind(this),isSoftMatch:this.#M.bind(this),initSecurity:(e,t,r)=>{e&&(this.#h=e),t&&(this.#a=t),r&&(this.#l=r)},onTrigger:this.#O.bind(this),htmxProp:this.#H.bind(this),triggerHtmxEvent:this.#L.bind(this),executeJavaScript:this.#k.bind(this)};let t=()=>this.initialize();"loading"===document.readyState?document.addEventListener("DOMContentLoaded",t):setTimeout(t)}#b(){this.version="4.0.0",this.config={logAll:!1,prefix:"data-hx-",transitions:!1,history:!0,mode:"same-origin",defaultSwap:"innerHTML",defaultFocusScroll:!1,indicatorClass:"htmx-indicator",requestClass:"htmx-request",includeIndicatorCSS:!0,defaultTimeout:6e4,extensions:"",morphIgnore:["data-htmx-powered"],morphSkip:"[hx-morph-skip]",morphSkipChildren:"[hx-morph-skip-children]",morphScanLimit:10,noSwap:[204,304],implicitInheritance:!1,defaultSettleDelay:1,allowEmptySwapAfterOOB:!1};let t=document.querySelector('meta[name="htmx-config"]');t&&e.merge(t.content,this.config),this.#s=this.config.extensions}#y(){if(!1!==this.config.includeIndicatorCSS){let e=this.config.indicatorClass,t=this.config.requestClass,r=new CSSStyleSheet;r.replaceSync(`.${e}{opacity:0;visibility: hidden} .${t} .${e}, .${t}.${e}{opacity:1;visibility: visible;transition: opacity 200ms ease-in}`),document.adoptedStyleSheets=[...document.adoptedStyleSheets,r]}}registerExtension(e,t){return!(this.#s&&!this.#s.split(/,\s*/).includes(e))&&(!this.#n.has(e)&&(this.#n.add(e),t.init&&t.init(this.#o),void Object.entries(t).forEach(([e,t])=>{this.#i.get(e)?.push(t)||this.#i.set(e,[t])})))}#V(e){let t=this.config.prefix;return!e.closest||null!=e.closest("[hx-ignore]")||t&&null!=e.closest(`[${t}ignore]`)}#P(e,t){let r=this.config.prefix;return e.getAttribute(t)??(r?e.getAttribute(t.replace("hx-",r)):null)}#R(e,t){let r=this.config.prefix&&t.replace("hx-",this.config.prefix);return e.hasAttribute(t)?t:r&&e.hasAttribute(r)?r:null}#S(e){return this.#v(e).join(",")}#v(e){let t=[e];return this.config.prefix&&t.push(e.replaceAll("hx-",this.config.prefix)),t}#j(e,t){let r=[...e.querySelectorAll?.(t)??[]];return e.matches?.(t)&&r.unshift(e),r}#B(e){return"before"===e?"beforebegin":"after"===e?"afterend":"prepend"===e?"afterbegin":"append"===e?"beforeend":e}#F(e,t){let r=[];return this.#E(e,t,void 0,(e,t)=>{e?.split(/\s*[,:]\s*/).includes("this")&&r.push(t)}),r}#E(e,t,r,i){t=this.#z(t);let s=this.#z(":inherited"),n=this.#z(":append"),o=this.#P(e,t)??this.#P(e,t+s);if(null!=o)return i?i(o,e):o;let a=CSS.escape(this.config.implicitInheritance?t:t+s),l=CSS.escape(t+s+n),h=this.#S(`[${a}],[${l}]`),c=this.#R(e,t+n)??this.#R(e,t+s+n);if(c){let r=e.getAttribute(c),s=e.parentNode?.closest?.(h);if(i&&i(r,e),s){let e=this.#E(s,t,void 0,i);return e?(e+","+r).replace(/[{}]/g,""):r}return r}let u=e.parentNode?.closest?.(h);return u?(o=this.#E(u,t,void 0,i),!i&&o&&this.config.implicitInheritance&&this.#_(e,"htmx:after:implicitInheritance",{elt:e,name:t,parent:u}),o):r}#w(t){return e.split(t).flatMap(t=>{let[,r,i]=t.match(/^\s*(\S+\[[^\]]*\]|\S+)\s*(.*?)\s*$/)??[];if(!r)return[];if(/\[[^\]]*$/.test(r))throw"unterminated:"+r;return[{name:r,...e.parse(i)}]})}#A(e,t){let r=this.#E(e,"hx-method"),i=this.#E(e,"hx-action");if(!i)for(let t of this.#d){let s=this.#E(e,"hx-"+t);if(null!=s){i=s,r=t;break}}return this.#D(e)&&(i||=t.submitter?.getAttribute?.("formAction")||e.getAttribute(e.matches("a")?"href":"action")),r||=t.submitter?.getAttribute?.("formmethod")||e.getAttribute("method")||"GET",{action:i,method:r.toUpperCase()}}#H(e){return e._htmx||(e._htmx={listeners:[],triggerSpecs:[]},e.setAttribute("data-htmx-powered","true")),e._htmx}#$(e){return e._htmx_state||={}}#W(e){if(this.#U(e)&&this.#L(e,"htmx:before:init",{},!0)){let t=this.#H(e);t.initialized=!0,t.eventHandler=this.#Q(e),this.#J(e),this.#L(e,"htmx:after:init",{},!0)}}#Q(e){return async t=>{try{let r=this.#T(e,t);await this.#X(r)}catch(t){this.#L(e,"htmx:error",{error:t})}}}#T(t,r){let{action:i,method:s}=this.#A(t,r),[n,o]=(i||"").split("#"),a=new AbortController,l={sourceElement:t,sourceEvent:r,status:"created",select:this.#E(t,"hx-select"),selectOOB:this.#E(t,"hx-select-oob"),target:this.#E(t,"hx-target"),swap:this.#E(t,"hx-swap")??this.config.defaultSwap,push:this.#E(t,"hx-push-url"),replace:this.#E(t,"hx-replace-url"),transition:this.config.transitions,confirm:this.#E(t,"hx-confirm"),request:{validate:"true"===this.#E(t,"hx-validate",!t.matches("form")||t.noValidate||r.submitter?.formNoValidate?"false":"true"),action:n,anchor:o,method:s,headers:this.#G(t),abort:a.abort.bind(a),credentials:"same-origin",signal:a.signal,mode:this.config.mode}};t._htmx?.boosted&&e.merge(t._htmx.boosted,l),l.target=this.#K(t,l.target),l.target&&(l.request.headers["HX-Target"]=this.#Y(l.target));let h=this.#E(t,"hx-config");return h&&(e.merge(h,l.request),l.request.mode=this.config.mode),l}#Y(e){return`${e.tagName.toLowerCase()}${e.id?"#"+encodeURI(e.id):""}`}#G(e){let t={"HX-Request":"true","HX-Source":this.#Y(e),"HX-Current-URL":location.href,Accept:"text/html"};return this.#D(e)&&(t["HX-Boosted"]="true"),t}#Z(e,t){return this.#q(e,"hx-headers",e=>{for(let r in e)t.request.headers[r]=String(e[r])},{ctx:t})}#K(e,t){return t instanceof Element?t:null!=t?this.#ee(e,t,"hx-target"):this.#D(e)?document.body:e}#D(e){return e?._htmx?.boosted}async#X(e){let t=e.sourceElement,r=e.sourceEvent;if(!t.isConnected)return;if(this.#te(r))return;this.#re(r)&&r.preventDefault();let i=/GET|DELETE/.test(e.request.method),s=i?t.matches("form")?t:null:t.form||t.closest("form"),n=this.#C(t,s,r.submitter,e.request.validate,i);if(!n)return;let o=this.#q(t,"hx-vals",t=>{e.vals=t;for(let e in t)n.set(e,t[e])},{ctx:e});if(o&&await o,e.values)for(let t in e.values)n.delete(t),n.append(t,e.values[t]);let a=this.#Z(t,e);if(a&&await a,Object.assign(e.request,{form:s,submitter:r.submitter,body:n}),!this.#L(t,"htmx:config:request",{ctx:e}))return;if("DIALOG"===e.request.method)return;let l=this.#ie(e.request.action);if(null!=l){let t=Object.fromEntries(e.request.body);return void await this.#k(e.sourceElement,t,l,!1)}if(i){let t=new URL(e.request.action,document.baseURI);for(let r of e.request.body.keys())t.searchParams.delete(r);for(let[r,i]of e.request.body)t.searchParams.append(r,i);t.origin===location.origin?e.request.action=t.pathname+t.search:e.request.action=t.href,e.request.body=null}else"multipart/form-data"!==(this.#E(t,"hx-encoding")??s?.enctype)&&(e.request.body=new URLSearchParams(e.request.body));await this.#se(e)}async#se(e){let t=e.sourceElement,r=this.#ne(t),i=this.#oe(t);if(this.#ae(t),"run"!==i.admit(r,()=>this.#se(e),()=>e.request?.abort?.()))return;e.status="issuing";let s=[],n=[];try{if(e.confirm){if(!await new Promise(r=>{let i={ctx:e,issueRequest:()=>r(!0),dropRequest:()=>r(!1)};if(this.#L(t,"htmx:confirm",i)){let i=this.#ie(e.confirm);r(i?this.#k(t,{ctx:e},i,!0):window.confirm(e.confirm))}}))return}if(this.#le(e),s=this.#he(t),n=this.#ce(t),e.fetch||=window.fetch.bind(window),e.request.headers["HX-Request-Type"]=e.target===document.body||e.select?"full":"partial",!this.#L(t,"htmx:before:request",{ctx:e}))return;let r=await e.fetch(e.request.action,e.request);if(e.response={raw:r,status:r.status,headers:r.headers},this.#ue(e),!this.#L(t,"htmx:before:response",{ctx:e}))return;if(e.text=await r.text(),!this.#L(t,"htmx:after:request",{ctx:e}))return;if(e.response.status>=400&&this.#L(t,"htmx:response:error",{ctx:e}),this.#de(e))return void(e.keepIndicators=!0);"issuing"===e.status&&(e.hx.retarget&&(e.target=e.hx.retarget),e.hx.reswap&&(e.swap=e.hx.reswap),e.hx.reselect&&(e.select=e.hx.reselect),e.status="response received",this.#fe(e),await this.swap(e),e.status="swapped")}catch(r){e.status="error: "+r,this.#L(t,"htmx:error",{ctx:e,error:r})}finally{await(e.extensionPromise?.catch(()=>{})),clearTimeout(e.requestTimeout),e.hx?.trigger&&this.#me(e.hx.trigger,e.sourceElement),this.#L(t,"htmx:finally:request",{ctx:e}),e.keepIndicators||(this.#pe(s),this.#ge(n)),i.continue()}}#ue(e){e.hx={};for(let[t,r]of e.response.raw.headers)t.toLowerCase().startsWith("hx-")&&(e.hx[t.slice(3).toLowerCase().replace(/-/g,"")]=r)}#de(t){if("true"===t.hx.refresh)return this._loc.reload(),!0;if(t.hx.redirect)return this._loc.href=t.hx.redirect,!0;if(t.hx.location){let r=t.hx.location,i={},s=e.parse(r);return"{"!==r[0]&&null==s.path||(i=s,r=i.path,delete i.path),null==i.push&&null==i.replace&&(i.push="true"),this.ajax("GET",r,i),!0}}#le(e){let t=null!=e.request.timeout?this.parseInterval(e.request.timeout):this.config.defaultTimeout;t&&(e.requestTimeout=setTimeout(()=>e.request?.abort?.(),t))}#ne(e){let t=this.#E(e,"hx-sync");if(!t)return"queue first";let r=t.split(":").pop().trim();return/^(drop|abort|replace|queue)/.test(r)?r:"queue first"}#oe(e){let r=this.#E(e,"hx-sync"),i=e;if(r){let t=r.includes(":")?r.slice(0,r.lastIndexOf(":")).trim():/^(drop|abort|replace|queue)/.test(r)?null:r;t&&(i=this.#ee(e,t,"hx-sync")||e)}return this.#$(i).rq||=new t}#te(e){return"click"===e.type&&(e.ctrlKey||e.metaKey||e.shiftKey)&&!!e.currentTarget?.closest?.("a[href]")}#re(e){let t=e.currentTarget;if("submit"===e.type&&"FORM"===t?.tagName)return!0;if(!("click"===e.type&&0===e.button))return!1;let r=t?.closest?.('button, input[type="submit"], input[type="image"]'),i=r?.form||r?.closest("form");if(r&&!r.disabled&&i&&("submit"===r.type||"image"===r.type||!r.type&&"BUTTON"===r.tagName))return!0;let s=t?.closest?.("a");if(!s||!s.href)return!1;let n=s.getAttribute("href");return!(n&&n.startsWith("#")&&n.length>1)}#J(e,t=e._htmx.eventHandler){let r=this.#E(e,"hx-trigger")||(e.matches("form")?"submit":e.matches("input:not([type=button]):not([type=submit]),select,textarea")?"change":"click");this.#O(e,r,t)}#O(e,t,r){let i=this.#w(t);this.#H(e).triggerSpecs.push(...i);for(let t of i){t.listeners=[];let[i,s]=this.#xe(t.name),n=[e];"outside"===t.from?n=[document]:t.from&&"self"!==t.from&&(n=this.#be(e,t.from));let o=e=>{if((t.halt||t.prevent)&&e.preventDefault(),(t.halt||t.stop||t.consume)&&e.stopPropagation(),t.once)for(let e of t.listeners)e.fromElt.removeEventListener(e.eventName,e.handler,e);r(e)},a=o;if(t.delay?a=e=>{clearTimeout(t.timeout),t.timeout=setTimeout(()=>o(e),this.parseInterval(t.delay))}:t.throttle&&(a=e=>{t.throttled?t.throttledEvent=e:(t.throttled=!0,o(e),t.throttleTimeout=setTimeout(()=>{if(t.throttled=!1,t.throttledEvent){let e=t.throttledEvent;t.throttledEvent=null,a(e)}},this.parseInterval(t.throttle)))}),t.handler=r=>{if(("self"!==t.from||r.target===e)&&("outside"!==t.from||!e.contains(r.target))&&(!t.target||r.target?.matches?.(t.target))){if(t.changed){let e=t.values??=new WeakMap,r=!1;for(let t of n)e.get(t)!==t.value&&(r=!0,e.set(t,t.value));if(!r)return}if(s){this.#re(r)&&r.preventDefault();let t={};for(let e in r)t[e]=r[e];if(!this.#k(e,t,s,!0,!1))return}a(r)}},"intersect"===i||"revealed"===i){let r={rootMargin:t.rootMargin};t.root&&(r.root=this.#ee(e,t.root)),t.threshold&&(r.threshold=parseFloat(t.threshold));let s="revealed"===i;t.observer=new IntersectionObserver(r=>{for(let i=0;i"name"!==e);t.interval=setInterval(()=>{e.isConnected?this.#L(e,"every",{},!1):clearInterval(t.interval)},this.parseInterval(r))}if("load"!==i)for(let r of n){let s={fromElt:r,eventName:i,handler:t.handler,capture:!!t.capture,passive:!!t.passive};e._htmx.listeners.push(s),t.listeners.push(s),r.addEventListener(i,t.handler,s)}else t.handler(new CustomEvent("load"))}}#xe(e){let t=e.match(/^([^\[]*)\[([^\]]*)]/);return t?[t[1],t[2]]:[e,null]}#me(t,r){if("{"===t[0]){let i=e.parse(t);for(let e in i){let t=i[e],s=r;t?.target&&(s=this.find(t.target)),this.trigger(s,e,"object"==typeof t?t:{value:t})}}else t.split(",").forEach(e=>this.trigger(r,e.trim(),{}))}#ye(e){let t={},r=Object.getPrototypeOf(this);for(let i of Object.getOwnPropertyNames(r))"constructor"!==i&&"function"==typeof this[i]&&(["find","findAll"].includes(i)?t[i]=(t,r)=>void 0===r?this[i](e,t):this[i](t,r):t[i]=this[i].bind(this));return t}#k(e,t,r,i=!0,s=!0,n=!1){let o={};Object.assign(o,this.#ye(e));let a={},l={scope:a,code:r};this.#_(e,"htmx:scope",l),r=l.code,Object.assign(o,a),Object.assign(o,t);let h=Object.keys(o),c=Object.values(o),u=new(s?this.#l:this.#a)(...h,i?`return (${r})`:r);return n?()=>u.call(e,...c):u.call(e,...c)}process(e,t){if(!e?.isConnected)return;if(!(e instanceof Element)){for(let r of e.children||[])this.process(r,t);return}if(t&&this.#Se(e,!0),this.#V(e))return;if(!this.#L(e,"htmx:before:process"))return;let r=[e],i=this.#f.evaluate(e),s=null;for(;s=i.iterateNext();)r.push(s);for(let e of r)!this.#V(e)&&this.#L(e,"htmx:before:on:init",{},!0)&&this.#ve(e);for(let t of this.#j(e,this.#c))this.#W(t);for(let t of this.#j(e,this.#u))this.#Ee(t);this.#L(e,"htmx:after:process")}#Ee(e){let t=this.#E(e,"hx-boost");if(t&&"false"!==t&&this.#we(e)&&this.#L(e,"htmx:before:init",{},!0)){let r=this.#H(e);r.initialized=!0,r.eventHandler=this.#Q(e),r.boosted=t;let i=e.matches("a")?"click":"submit";e._htmx.listeners.push({fromElt:e,eventName:i,handler:e._htmx.eventHandler}),e.addEventListener(i,e._htmx.eventHandler),this.#L(e,"htmx:after:init",{},!0)}}#we(e){if(this.#U(e))if("A"===e.tagName){if(""===e.target||"_self"===e.target)return!e.hasAttribute("download")&&!e.getAttribute("href")?.startsWith?.("#")&&this.#Ae(e.href)}else if("FORM"===e.tagName)return"dialog"!==e.method&&this.#Ae(e.action)}#Ae(e){try{return new URL(e,window.location.href).origin===window.location.origin}catch(e){return!1}}#U(e){return!e._htmx?.initialized&&!this.#V(e)}#Se(e,t){let r=[e,...e.querySelectorAll?.("[data-htmx-powered]")??[]];for(let e of r)if(e._htmx){this.#L(e,"htmx:before:cleanup");for(let t of e._htmx.triggerSpecs||[])t.interval&&clearInterval(t.interval),t.timeout&&clearTimeout(t.timeout),t.throttleTimeout&&clearTimeout(t.throttleTimeout),t.observer?.disconnect();for(let t of e._htmx.listeners||[])t.fromElt.removeEventListener(t.eventName,t.handler,t);e.removeAttribute("data-htmx-powered"),this.#L(e,"htmx:after:cleanup"),t&&delete e._htmx}}#Te(e){let t=document.createElement("div");t.hidden=!0,document.body.insertAdjacentElement("afterend",t);let r=e.querySelectorAll?.(this.#S("[hx-preserve]"))||[];for(let e of r){let r=document.getElementById(e.id);r&&this.#Ce(t,r,null)}return t}#qe(e){for(let t of[...e.children]){let e=document.getElementById(t.id);e&&(this.#Ce(e.parentNode,t,e),this.#Se(e),e.remove())}e.remove()}#Ne(e){let t=this.#h.createHTML(e);return Document.parseHTMLUnsafe?.(t)||(new DOMParser).parseFromString(t,"text/html")}#Ie(e){let t=e.replace(/)/gi,'"),r="";t=t.replace(/]*)?>[\s\S]*?<\/head>/i,e=>(r=this.#Ne(e).title,""));let i,s,n=t.match(/<([a-z][^\/>\x20\t\r\n\f]*)/i)?.[1]?.toLowerCase();if("html"===n||"body"===n?(i=this.#Ne(t),s=document.createDocumentFragment(),s.append(i.body)):(i=this.#Ne(``),s=i.querySelector("template").content),!r){let e=s.querySelector("title:not(svg title)");e&&(r=e.textContent,e.remove())}return this.#Me(s),{fragment:s,title:r}}#Oe(e,t,r,i){let s=t.id?"#"+CSS.escape(t.id):null;"true"!==r&&r&&!r.includes(" ")&&([r,s=s]=r.split(/:(.*)/)),"true"!==r&&r||(r="outerHTML");let n=this.#He(r);if(s=n.target||s,n.strip??=!n.style.startsWith("outer"),!s)return;let o=[...document.querySelectorAll(s)];for(let r of o){let s=document.createDocumentFragment();s.append(t.cloneNode(!0)),e.push({type:"oob",fragment:s,target:r,swapSpec:n,sourceElement:i})}t.remove()}#Le(e,t,r){let i=[];if(r)for(let s of r.split(",")){let[r,n="true"]=s.split(/:(.*)/);for(let s of e.querySelectorAll(r))this.#Oe(i,s,n,t)}for(let r of e.querySelectorAll(this.#S("[hx-swap-oob]"))){let e=this.#R(r,"hx-swap-oob"),s=r.getAttribute(e);r.removeAttribute(e),this.#Oe(i,r,s,t)}return i}#ke(e,t,r){t?t.before(...r.childNodes):e.append(...r.childNodes)}#He(t){t=t.trim();let r=this.config.defaultSwap;if(t&&!/^\S*:/.test(t)){let e=t.match(/^(\S+)\s*(.*)$/);r=e[1],t=e[2]}return{style:this.#B(r),...e.parse(t)}}#Ve(e,t){let r=[];for(let i of e.querySelectorAll("template[hx]")){let e=i.getAttribute("type");if("partial"===e){let e=this.#P(i,"hx-target")||(i.id?"#"+CSS.escape(i.id):null);if(e){this.#Me(i.content);let s=this.#He(this.#P(i,"hx-swap")||this.config.defaultSwap),n=this.#be(t.sourceElement,e);for(let e of n.length?n:[null])r.push({type:"partial",fragment:i.content.cloneNode(!0),target:e,swapSpec:s,sourceElement:t.sourceElement})}}else this.#_(i,"htmx:process:"+e,{ctx:t,tasks:r});i.remove()}return r}#Pe(e,t,r,i){try{null!=r&&e.setSelectionRange&&e.setSelectionRange(r,i),e.focus(t)}catch(e){}}#Re(e){let t=this.#j(e,"[autofocus]")[0];t&&this.#Pe(t)}#je(e,t){if(e.scroll){let r=e.scrollTarget?this.#Be(e.scrollTarget):t;r&&("top"===e.scroll?r.scrollTop=0:"bottom"===e.scroll&&(r.scrollTop=r.scrollHeight))}if("top"===e.show||"bottom"===e.show){let r=e.showTarget?this.#Be(e.showTarget):t;r?.scrollIntoView?.("top"===e.show)}}#Fe(e){e.request?.anchor&&document.getElementById(e.request.anchor)?.scrollIntoView({block:"start",behavior:"auto"})}#Me(e){let t=this.#j(e,"script");for(let e of t){let t=document.createElement("script");for(let r of e.attributes)t.setAttribute(r.name,r.value);this.config.inlineScriptNonce&&(t.nonce=this.config.inlineScriptNonce),t.textContent=this.#h.createScript(e.textContent),e.replaceWith(t)}}initialize(){this.config.history&&!this.#g&&(this.#g=!0,history.state||history.replaceState({htmx:!0},"",location.href),window.navigation&&!/firefox/i.test(navigator.userAgent)?navigation.addEventListener("navigate",e=>{"traverse"===e.navigationType&&e.canIntercept&&!e.hashChange&&e.intercept({handler:()=>this.#ze()})}):window.addEventListener("popstate",e=>this.#ze(e.state))),this.process(document.body)}async swap(e){try{this.#_e(e);let{fragment:t,title:r}=this.#Ie(e.text);e.title=r;let i=[],s=this.#Le(t,e.sourceElement,e.selectOOB),n=this.#Ve(t,e);i.push(...s,...n);let o=n.length||s.length&&!this.config.allowEmptySwapAfterOOB,a=this.#De(e,t,o);if(a&&i.unshift(a),!this.#L(e.sourceElement,"htmx:before:swap",{ctx:e,tasks:i}))return;let l=[],h=[];for(let t of i)t.swapSpec?.transition??a?.transition??e.transition?h.push(t):l.push(this.#N(t));if(h.length>0){let t=async()=>{for(let e of h)await this.#N(e,!1)};l.push(this.#$e(t,e))}await Promise.all(l),!e.sourceElement?.isConnected&&a?.target?.isConnected&&(e.sourceElement=a.target),this.#L(e.sourceElement,"htmx:after:swap",{ctx:e}),e.title&&!a?.swapSpec?.ignoreTitle&&(document.title=e.title),this.#Fe(e)}finally{this.#L(e.sourceElement,"htmx:finally:swap",{ctx:e})}}#De(e,t,r){let i=this.#He(e.swap||this.config.defaultSwap);if("delete"===i.style||t.childElementCount>0||t.textContent.trim()||(i.swapEmpty??!r)){if(e.select){let r=t.querySelectorAll(e.select);(t=document.createDocumentFragment()).append(...r)}return this.#D(e.sourceElement)&&(i.show||="top"),{type:"main",fragment:t,target:this.#K(e.sourceElement||document.body,i.target||e.target),swapSpec:i,sourceElement:e.sourceElement,transition:e.transition&&!1!==i.transition}}}async#N(e,t=!0){let{target:r,swapSpec:i,fragment:s}=e;if("string"==typeof r&&(r=document.querySelector(r)),!r)return;"string"==typeof i&&(i=this.#He(i));let n,o=i.style;if("none"===o)return;if("BODY"===s.firstElementChild?.tagName){const e=r===document.body&&o.startsWith("outer");e&&"outerHTML"===o&&(o="outerSync"),i.strip??=!e}if(i.strip&&s.firstElementChild&&(s=document.createDocumentFragment(),s.append(...(e.fragment.firstElementChild.content||e.fragment.firstElementChild).childNodes)),this.#We(r,"htmx-swapping"),t&&e.swapSpec?.swap&&await this.timeout(e.swapSpec?.swap),"delete"===o)return void(r.parentNode&&(this.#Se(r),r.parentNode.removeChild(r)));let a=[],l=i.settle??this.config.defaultSettleDelay,h=r.parentNode;if("innerHTML"===o||"outerHTML"===o&&h){let e=document.activeElement;if(e?.id){let t,r;try{t=e.selectionStart,r=e.selectionEnd}catch(e){}n={elt:e,start:t,end:r}}a=t&&l?this.#Ue(s,r):[]}let c=this.#Te(s),u=[...s.childNodes];try{if("innerHTML"===o){for(const e of r.children)this.#Se(e);r.replaceChildren(...s.childNodes)}else if("textContent"===o){for(const e of r.querySelectorAll("[data-htmx-powered]"))this.#Se(e);r.textContent=s.textContent}else if("outerHTML"===o)h&&(this.#ke(h,r,s),this.#Se(r),h.removeChild(r),r=u[0]||h);else if("outerSync"===o){this.#Qe(r,s.firstElementChild);for(const e of r.children)this.#Se(e);r.replaceChildren(...s.firstElementChild.childNodes),u=[r]}else if("innerMorph"===o)this.#I(r,s,!0),u=[...r.childNodes];else if("outerMorph"===o)this.#I(r,s,!1),u.push(r);else if("beforebegin"===o)h&&this.#ke(h,r,s);else if("afterbegin"===o)this.#ke(r,r.firstChild,s);else if("beforeend"===o)this.#ke(r,null,s);else if("afterend"===o)h&&this.#ke(h,r.nextSibling,s);else{let e=this.#i.get("handle_swap")||[],t=!1;for(const n of e){let e=n(o,r,s,i);if(e){t=!0,Array.isArray(e)&&(u=e);break}}if(!t)throw new Error(`Unknown swap style: ${o}`)}}finally{this.#Je(r,"htmx-swapping")}if(e.target=r,this.#qe(c),n&&!n.elt.matches(":focus")){let e=document.getElementById(n.elt.id);if(e){let t={preventScroll:void 0!==i.focusScroll?!i.focusScroll:!this.config.defaultFocusScroll};this.#Pe(e,t,n.start,n.end)}}this.#L(r,"htmx:before:settle",{task:e,newContent:u,settleTasks:a});for(const e of u)this.#We(e,"htmx-added");if(t&&a.length>0){this.#We(r,"htmx-settling"),await this.timeout(l);for(let e of a)e();this.#Je(r,"htmx-settling")}this.#L(r,"htmx:after:settle",{task:e,newContent:u,settleTasks:a});for(const e of u)this.#Je(e,"htmx-added"),this.process(e),this.#Re(e);this.#je(i,r)}#L(e,t,r={},i=!0){if(r.error){let i=`htmx: ${t}: ${r.error.message??r.error}`;r.error instanceof Error?console.error(i,r.error,{elt:e,detail:r}):console.error(i,{elt:e,detail:r})}else r.warn?console.warn(`htmx: ${t}: ${r.warn}`,{elt:e,detail:r}):this.config.logAll&&console.log(`htmx: ${t}`,{elt:e,detail:r});return e=this.#Xe(e),this.#_(e,t,r),this.trigger(e,this.#z(t),r,i)}#_(e,t,r={}){let i=this.#i.get(t.replace(/:/g,"_"));if(i){r.cancelled=!1;for(const t of i)if(!1===t(e,r)||r.cancelled)return r.cancelled=!0,!1}return!0}timeout(e){if((e=this.parseInterval(e))>0)return new Promise(t=>setTimeout(t,e))}onLoad(e){this.on(this.#z("htmx:after:process"),t=>{e(t.target)})}on(e,t,r){let i,s=document;return void 0===r?(i=e,r=t):(s=this.#Xe(e),i=t),s.addEventListener(i,r),r}find(e,t){return this.#Be(e,t)}findAll(e,t){return this.#be(e,t)}parseInterval(e){if("number"==typeof e)return e;let[,t,r]=e?.match(/^([\d.]+)(ms|s|m)?$/)||[],i=parseFloat(t)*({ms:1,s:1e3,m:6e4}[r]||1);return isNaN(i)?void 0:i}trigger(e,t,r={},i=!0){e=this.#Xe(e);let s=new CustomEvent(t,{detail:r,cancelable:!0,bubbles:i,composed:!0}),n=e?.isConnected?e:document;return!r.cancelled&&n.dispatchEvent(s)}ajax(e,t,r){(!r||r instanceof Element||"string"==typeof r)&&(r={target:r});let i="string"==typeof r.source?document.querySelector(r.source):r.source;if("string"==typeof r.source&&!i)return Promise.reject(new Error("Source not found"));if(r.target){let e=this.#K(document.body,r.target);if(!e)return Promise.reject(new Error("Target not found"));i||=e}i||=document.body;let s=this.#T(i,r.event||{});return Object.assign(s,r),r.target&&(s.target=this.#K(document.body,r.target)),Object.assign(s.request,{action:t,method:e.toUpperCase()}),r.headers&&Object.assign(s.request.headers,r.headers),this.#X(s)}#Ge(e){this.config.history&&(history.state||history.replaceState({htmx:!0},"",location.href),history.pushState({htmx:!0},"",e),this.#L(document,"htmx:after:history:push",{path:e}))}#Ke(e){this.config.history&&(history.replaceState({htmx:!0},"",e),this.#L(document,"htmx:after:history:replace",{path:e}))}async#ze(e,t){if(await this.timeout(1),e??=history.state,!e?.htmx)return;this.#p?.abort(),t=t||location.pathname+location.search;let r=document.querySelector(this.#S("[hx-history-elt]"))||document.body;if(this.#L(document,"htmx:before:history:restore",{path:t,cacheMiss:!0})){if("reload"!==this.config.history)return this.#p=new AbortController,this.ajax("GET",t,{target:r,swap:"outerSync",select:r!==document.body?this.#S("[hx-history-elt]"):void 0,request:{headers:{"HX-History-Restore-Request":"true"},signal:this.#p.signal}});this._loc.reload()}}#Ye(e){let{sourceElement:t,push:r,replace:i,hx:s,response:n}=e;if((s?.pushurl||s?.replaceurl)&&(r=s.pushurl,i=s.replaceurl),null==r&&null==i&&this.#D(t)&&(r="true"),"false"!==r&&!1!==r||(r=null),"false"!==i&&!1!==i||(i=null),!r&&!i)return null;let o=r||i;if("true"===o){let t=n?.raw?.url||e.request.action,r=new URL(t,location.href);o=r.pathname+r.search+(e.request.anchor?"#"+e.request.anchor:"")}return{type:r?"push":"replace",path:o}}#_e(e){if(!this.config.history)return;let t=this.#Ye(e);if(!t)return;let r={history:t,sourceElement:e.sourceElement,response:e.response};this.#L(document,"htmx:before:history:update",r)&&("push"===t.type?this.#Ge(t.path):this.#Ke(t.path),this.#L(document,"htmx:after:history:update",r))}#ve(e){if(e._htmx?.onInitialized)return;let t=this.#v("hx-on"),r=this.config.metaCharacter||":",i=t=>async r=>{try{await this.#k(e,{event:r},`with(event?.detail||{}){${t}}`,!1)}catch(t){"symbol"!=typeof t&&this.#L(e,"htmx:error",{error:t})}};for(let s of e.getAttributeNames()){let n=t.find(e=>s.startsWith(e));if(!n)continue;this.#H(e).onInitialized=!0;let o=s.substring(n.length),a=e.getAttribute(s);if(!o){for(let t of a.split(/;(?=[^;]*->)/)){let r=t.indexOf("->");-1!==r&&this.#O(e,t.substring(0,r).trim(),i(t.substring(r+2).trim()))}continue}if(o[0]!==r)continue;let l=o.substring(1);l.startsWith(r)&&(l="htmx"+r+l.substring(1)),this.#O(e,l,i(a))}}#he(e){let t,r=this.#E(e,"hx-indicator");if(r)t=this.#be(e,r,"hx-indicator");else{if(e===document.body)return[];t=[e]}for(const e of t){let t=this.#$(e);t.rc=(t.rc||0)+1,this.#We(e,this.config.requestClass)}return t}#pe(e){for(let t of e){let e=this.#$(t);e.rc&&--e.rc<=0&&(this.#Je(t,this.config.requestClass),delete e.rc)}}#ce(e){let t=this.#E(e,"hx-disable"),r=[];if(t){r=this.#be(e,t,"hx-disable");for(let e of r){let t=this.#$(e);t.dc=(t.dc||0)+1,e.disabled=!0}}return r}#ge(e){for(const t of e){let e=this.#$(t);e.dc&&--e.dc<=0&&(t.disabled=!1,delete e.dc)}}#C(e,t,r,i,s){if(i&&t&&!t.reportValidity())return;let n=t?new FormData(t):new FormData,o=t?new Set(t.elements):new Set;if(!t){if(i&&e.reportValidity&&!e.reportValidity())return;this.#Ze(e,o,n,s)}r&&r.name&&(n.append(r.name,r.value),o.add(r));let a=this.#E(e,"hx-include");if(a)for(let t of this.#be(e,a)){if(i&&t.reportValidity&&!t.reportValidity())return;this.#Ze(t,o,n)}return n}#Ze(e,t,r,i){let s=e.tagName,n=[];"BUTTON"===s||s.includes("-")?n=[e]:!["INPUT","SELECT","TEXTAREA","FIELDSET"].includes(s)&&i||(n=this.#j(e,"[name]:not(button)"));for(let e of n){let i=e.name||e.getAttribute?.("name");if(!i||e.matches(":disabled")||t.has(e))continue;t.add(e);let s=e.type;if("checkbox"===s||"radio"===s||"INPUT"!==e.tagName&&"checked"in e)e.checked&&r.append(i,e.value);else if("file"===s)for(let t of e.files)r.append(i,t);else if("select-multiple"===s)for(let t of e.selectedOptions)r.append(i,t.value);else if(Array.isArray(e.value))for(let t of e.value)r.append(i,t);else r.append(i,e.value)}}#q(t,r,i,s={}){let n=this.#E(t,r);if(!n)return null;let o=this.#ie(n);if(o)return 0!==o.indexOf("{")&&(o="{"+o+"}"),this.#k(t,s,o,!0).then(e=>{i(e)});i(e.parse(n))}#et(e){let t=e.trim();return t.startsWith("<")&&t.endsWith("/>")?t.slice(1,-2):t}#be(t,r,i,s){let n=r??t,o=r?this.#Xe(t)||document.body:document;if(n.startsWith("global "))return this.#be(o,n.slice(7),i,!0);let a=n?e.split(n):[],l=[],h=[];for(const e of a){let t,r=this.#et(e);if(r.startsWith("closest "))t=o.closest(r.slice(8));else if(r.startsWith("find "))t=o.querySelector(r.slice(5));else if(r.startsWith("findAll "))l.push(...o.querySelectorAll(r.slice(8)));else if("next"===r||"nextElementSibling"===r)t=o.nextElementSibling;else if(r.startsWith("next "))t=this.#tt(o,r.slice(5),!!s);else if("previous"===r||"previousElementSibling"===r)t=o.previousElementSibling;else if(r.startsWith("previous "))t=this.#rt(o,r.slice(9),!!s);else if("document"===r)t=document;else if("window"===r)t=window;else if("body"===r)t=document.body;else if("host"===r)t=o.getRootNode().host;else if("this"===r){if(i){l.push(...this.#F(o,i));continue}t=o}else h.push(r);t&&l.push(t)}if(h.length>0){let e=h.join(","),t=this.#it(o,!!s);l.push(...t.querySelectorAll(e))}return[...new Set(l)]}#tt(e,t,r){return this.#st(this.#it(e,r).querySelectorAll(t),e,Node.DOCUMENT_POSITION_PRECEDING)}#rt(e,t,r){let i=[...this.#it(e,r).querySelectorAll(t)].reverse();return this.#st(i,e,Node.DOCUMENT_POSITION_FOLLOWING)}#st(e,t,r){for(const i of e)if(i.compareDocumentPosition(t)===r)return i}#it(e,t){return e.isConnected&&e.getRootNode?e.getRootNode?.({composed:t}):document}#ee(e,t,r){let i=this.#be(e,t,r)[0];return i||console.warn(`htmx: '${t}' on ${r} did not match any element`,{elt:e,selector:t,attr:r}),i}#Be(e,t,r){return this.#be(e,t,r)[0]}#ie(e){if(null!=e){if(e.startsWith("js:"))return e.substring(3);if(e.startsWith("javascript:"))return e.substring(11)}}#ae(e){let t=this.#H(e);if(t.abortInitialized)return;t.abortInitialized=!0;let r=()=>{this.#oe(e).abort()};e.addEventListener("htmx:abort",r),t.listeners.push({fromElt:e,eventName:"htmx:abort",handler:r})}#I(e,t,r){let{persistentIds:i,idMap:s}=this.#nt(e,t),n=document.createElement("div");n.hidden=!0,document.body.after(n);let o={target:e,idMap:s,persistentIds:i,pantry:n,futureMatches:new WeakSet};r?this.#ot(o,e,t):this.#ot(o,e.parentNode,t,e,e.nextSibling),this.#Se(n),n.remove()}#ot(e,t,r,i=null,s=null){t instanceof HTMLTemplateElement&&r instanceof HTMLTemplateElement&&(t=t.content,r=r.content),i||=t.firstChild;let n=r.firstChild;for(;n;){let r;if(i&&i!=s&&(r=this.#at(e,n,i,s),r&&r!==i)){let o=i;for(;o&&o!==r;){let r=o;o=o.nextSibling,r instanceof Element&&(e.idMap.has(r)||this.#lt(e,r,n))?this.#Ce(t,r,s):this.#ht(e,r)}}if(!r&&n instanceof Element&&e.persistentIds.has(n.id)){let s=CSS.escape(n.id);r=e.target.id===n.id&&e.target||e.target.querySelector(`[id="${s}"]`)||e.pantry.querySelector(`[id="${s}"]`);let o=r;for(;o=o.parentNode;){let t=e.idMap.get(o);t&&(t.delete(r.id),t.size||e.idMap.delete(o))}this.#Ce(t,r,i)}if(r){this.#ct(r,n,e),i=r.nextSibling,n=n.nextSibling;continue}let o=n.nextSibling;if(e.idMap.has(n)){let r=document.createElement(n.tagName);t.insertBefore(r,i),this.#ct(r,n,e),this.process(r),i=r.nextSibling}else t.insertBefore(n,i),i=n.nextSibling;n=o}for(;i&&i!=s;){let t=i;i=i.nextSibling,this.#ht(e,t)}}#lt(e,t,r){if(e.futureMatches.has(t))return!0;for(let i=r.nextSibling,s=0;i&&sa.has(e)))return h;if(!r){if(o>0&&h.isEqualNode(t))return h;s||(s=h)}}if(n+=r?.size||0,n>l)break;if(null!=document.activeElement?.selectionStart&&h.contains(document.activeElement))break;if(--o<1&&0===l)break;h=h.nextSibling}return s&&this.#lt(e,s,t)?null:s}#M(e,t){return e instanceof Element&&e.tagName===t.tagName&&(!("SCRIPT"===e.tagName&&!e.isEqualNode(t))&&(!e.id||e.id===t.id))}#ht(e,t){e.idMap.has(t)?this.#Ce(e.pantry,t,null):(this.#Se(t),t.remove())}#Ce(e,t,r){if(e.moveBefore)try{return void e.moveBefore(t,r)}catch(e){}e.insertBefore(t,r)}#ct(e,t,r){if(3===e.nodeType)return void(e.nodeValue!==t.nodeValue&&(e.nodeValue=t.nodeValue));if(this.config.morphSkip&&e.matches?.(this.config.morphSkip))return;if(!this.#_(e,"htmx:before:morph:node",{oldNode:e,newNode:t}))return;this.#Qe(e,t),e instanceof HTMLTextAreaElement&&document.activeElement!==e&&e.defaultValue!=t.defaultValue&&(e.value=t.value),this.config.morphSkipChildren&&e.matches?.(this.config.morphSkipChildren)||e.isEqualNode(t)&&"TEMPLATE"!==t.tagName&&!t.querySelector?.("template")||this.#ot(r,e,t)}#Qe(e,t){let r=this.config.morphIgnore||[],i=!1,s=e=>this.#v("hx-").some(t=>e.startsWith(t));for(const n of t.attributes)if(!r.some(e=>n.name.startsWith(e))&&e.getAttribute(n.name)!==n.value){if(s(n.name)&&(i=!0),!this.#_(e,"htmx:before:morph:attr",{attrName:n.name,newValue:n.value}))continue;e.setAttribute(n.name,n.value),"value"===n.name&&e instanceof HTMLInputElement&&"file"!==e.type&&document.activeElement!==e&&(e.value=n.value)}for(let n=e.attributes.length-1;n>=0;n--){let o=e.attributes[n];if(o&&!t.hasAttribute(o.name)&&!r.some(e=>o.name.startsWith(e))){if(s(o.name)&&(i=!0),!this.#_(e,"htmx:before:morph:attr",{attrName:o.name,newValue:null}))continue;e.removeAttribute(o.name)}}i&&this.#Se(e,!0)}#ut(e,t,r,i){for(const s of i)if(t.has(s.id)){let t=s;for(;t&&t!==r;){let r=e.get(t);null==r&&(r=new Set,e.set(t,r)),r.add(s.id),t=t.parentElement}}}#nt(e,t){let r=this.#j(e,"[id]"),i=t.querySelectorAll("[id]"),s=this.#dt(r,i),n=new Map;return this.#ut(n,s,e.parentElement,r),this.#ut(n,s,t,i),{persistentIds:s,idMap:n}}#dt(e,t){let r=new Set,i=new Map;for(const{id:t,tagName:s}of e)i.has(t)?r.add(t):t&&i.set(t,s);let s=new Set;for(const{id:e,tagName:n}of t)s.has(e)?r.add(e):i.get(e)===n&&s.add(e);for(const e of r)s.delete(e);return s}#fe(t){let r=t.response.raw.status,i=this.config.noSwap.map(e=>e+""),s=r+"";for(let r of[s,s.slice(0,2)+"x",s[0]+"xx"]){if(i.includes(r))return void(t.swap="none");let s=this.#E(t.sourceElement,"hx-status:"+r);if(s)return void e.merge(s,t)}}#$e(e,t){return new Promise(r=>{this.#m||=[],this.#m.push({task:e,resolve:r,ctx:t}),this.#x||this.#ft()})}async#ft(){if(0===this.#m.length||this.#x)return;this.#x=!0;let{task:e,resolve:t,ctx:r}=this.#m.shift();try{if(document.startViewTransition){let t={task:e,ctx:r};this.#L(r.sourceElement,"htmx:before:viewTransition",t),await document.startViewTransition(t.task).finished,this.#L(r.sourceElement,"htmx:after:viewTransition",t)}else await e()}catch(e){}finally{this.#x=!1,t(),this.#ft()}}#Ue(e,t){let r=t.querySelectorAll("[id]"),i=Object.fromEntries([...r].map(e=>[e.id,e])),s=e.querySelectorAll("[id]"),n=[];for(let e of s){let t=i[e.id];if(t?.tagName===e.tagName){let r=e.cloneNode(!1);this.#Qe(e,t),n.push(()=>{this.#Qe(e,r)})}}return n}#We(e,t){e?.classList?.add?.(t)}#Je(e,t){e?.classList?.remove?.(t),0===e?.classList?.length&&e.removeAttribute("class")}#Xe(e){return"string"==typeof e?this.find(e):e}#z(e){return this.config.metaCharacter?e.replace(/:/g,this.config.metaCharacter):e}}})(); \ No newline at end of file +var htmx=(()=>{const e={parse(t){if(!t)return{};if(t.startsWith("{"))return JSON.parse(t);let r=/(?:"([^"]+)"|'([^']+)'|([^\s,:]+))(?:\s*:\s*(?:"([^"]*)"|'([^']*)'|<((?:[^/]|\/(?!>))+)\/>|([^\s,]+)))?(?=\s|,|$)/g,i={};for(let s of t.matchAll(r)){let[,t,r,n,o,a,l,h]=s,c=t??r??n,u=(o??a??l??h??"true").trim();try{u=JSON.parse(u)}catch{}let d=n?.includes("."),f=d?c.split(".").reduceRight((e,t)=>({[t]:e}),u):{[c]:u};e.merge(f,i)}return i},split:e=>e.split(/,(?![^\[]*\])(?![^(]*\))(?![^<]*\/>)(?=(?:[^"']|"[^"]*"|'[^']*')*$)/),merge(t,r){"string"==typeof t&&(t=e.parse(t));for(let[i,s]of Object.entries(t)){if(["__proto__","constructor","prototype"].includes(i))continue;let t=s?.constructor===Object,n=r[i]?.constructor===Object;t&&n?e.merge(s,r[i]):r[i]=s}return r}};class t{#e=null;#t=[];admit(e,t,r){if(!this.#e)return this.#e={strategy:e,abort:r},"run";if("replace"===e||"abort"!==e&&"abort"===this.#e.strategy)return this.#t=[],this.#e.abort?.(),this.#e={strategy:e,abort:r},"run";if("queue all"===e)this.#t.push(t);else if("queue last"===e)this.#t=[t];else{if("abort"===e||"drop"===e||0!==this.#t.length)return"dropped";this.#t.push(t)}return"queued"}continue(e){this.#e?.abort===e&&(this.#e=null,this.#t.shift()?.())}abort(){this.#e?.abort?.()}}return new class{#r=e;#i=new Map;#s="";#n=new Set;_loc=window.location;#o;#a=Function;#l=Object.getPrototypeOf(async function(){}).constructor;#h={createHTML:e=>e,createScript:e=>e};#c;#u="a,form";#d=["get","post","put","patch","delete","query"];#f;#m;#p;#g;#x;constructor(){this.#b(),this.#y(),this.#c=this.#S("[hx-action],[hx-get],[hx-post],[hx-put],[hx-patch],[hx-delete],[hx-query]"),this.#f=(new XPathEvaluator).createExpression(`.//*[@*[${this.#v("hx-on").map(e=>`starts-with(name(), "${e}")`).join(" or ")}]]`),this.#o={HCON:e,attributeValue:this.#E.bind(this),parseTriggerSpecs:this.#w.bind(this),determineMethodAndAction:this.#A.bind(this),createRequestContext:this.#T.bind(this),collectFormData:this.#C.bind(this),getAttributeObject:this.#q.bind(this),insertContent:this.#N.bind(this),morph:this.#I.bind(this),isSoftMatch:this.#M.bind(this),initSecurity:(e,t,r)=>{e&&(this.#h=e),t&&(this.#a=t),r&&(this.#l=r)},onTrigger:this.#O.bind(this),htmxProp:this.#H.bind(this),triggerHtmxEvent:this.#L.bind(this),executeJavaScript:this.#k.bind(this)};let t=()=>this.initialize();"loading"===document.readyState?document.addEventListener("DOMContentLoaded",t):setTimeout(t)}#b(){this.version="4.0.1",this.config={logAll:!1,prefix:"data-hx-",transitions:!1,history:!0,mode:"same-origin",defaultSwap:"innerHTML",defaultFocusScroll:!1,indicatorClass:"htmx-indicator",requestClass:"htmx-request",includeIndicatorCSS:!0,defaultTimeout:6e4,extensions:"",morphIgnore:["data-htmx-powered"],morphSkip:"[hx-morph-skip]",morphSkipChildren:"[hx-morph-skip-children]",morphScanLimit:10,noSwap:[204,304],implicitInheritance:!1,defaultSettleDelay:1,allowEmptySwapAfterOOB:!1};let t=document.querySelector('meta[name="htmx-config"]');t&&e.merge(t.content,this.config),this.#s=this.config.extensions}#y(){if(!1!==this.config.includeIndicatorCSS){let e=this.config.indicatorClass,t=this.config.requestClass;try{this.indicatorStyleSheet=new CSSStyleSheet,this.indicatorStyleSheet.replaceSync(`.${e}{opacity:0;visibility: hidden} .${t} .${e}, .${t}.${e}{opacity:1;visibility: visible;transition: opacity 200ms ease-in}`),document.adoptedStyleSheets.push(this.indicatorStyleSheet)}catch{}}}registerExtension(e,t){return!(this.#s&&!this.#s.split(/,\s*/).includes(e))&&(!this.#n.has(e)&&(this.#n.add(e),t.init&&t.init(this.#o),void Object.entries(t).forEach(([e,t])=>{this.#i.get(e)?.push(t)||this.#i.set(e,[t])})))}#V(e){let t=this.config.prefix;return!e.closest||null!=e.closest("[hx-ignore]")||t&&null!=e.closest(`[${t}ignore]`)}#P(e,t){let r=this.config.prefix;return e.getAttribute(t)??(r?e.getAttribute(t.replace("hx-",r)):null)}#R(e,t){let r=this.config.prefix&&t.replace("hx-",this.config.prefix);return e.hasAttribute(t)?t:r&&e.hasAttribute(r)?r:null}#S(e){return this.#v(e).join(",")}#v(e){let t=[e];return this.config.prefix&&t.push(e.replaceAll("hx-",this.config.prefix)),t}#j(e,t){let r=[...e.querySelectorAll?.(t)??[]];return e.matches?.(t)&&r.unshift(e),r}#B(e){return"before"===e?"beforebegin":"after"===e?"afterend":"prepend"===e?"afterbegin":"append"===e?"beforeend":e}#z(e,t){let r=[];return this.#E(e,t,void 0,(e,t)=>{e?.split(/\s*[,:]\s*/).includes("this")&&r.push(t)}),r}#E(e,t,r,i,s=this.config.implicitInheritance){t=this.#F(t);let n=this.#F(":inherited"),o=this.#F(":append"),a=this.#P(e,t)??this.#P(e,t+n);if(null!=a)return i?i(a,e):a;let l=CSS.escape(s?t:t+n),h=CSS.escape(t+n+o),c=this.#S(`[${l}],[${h}]`),u=this.#R(e,t+o)??this.#R(e,t+n+o);if(u){let r=e.getAttribute(u),n=e.parentNode?.closest?.(c);if(i&&i(r,e),n){let e=this.#E(n,t,void 0,i,s);return e?(e+","+r).replace(/[{}]/g,""):r}return r}let d=e.parentNode?.closest?.(c);return d?(a=this.#E(d,t,void 0,i),!i&&a&&s&&this.#$(e,"htmx:after:implicitInheritance",{elt:e,name:t,parent:d}),a):r}#w(t){return e.split(t).flatMap(t=>{t=t.replace(/^\s*every\s+(\S+?)\s*(\[[^\]]*\])/,"every$2 $1");let[,r,i]=t.match(/^\s*(\S+\[[^\]]*\]|\S+)\s*(.*?)\s*$/)??[];if(!r)return[];if(/\[[^\]]*$/.test(r))throw"unterminated:"+r;return[{name:r,...e.parse(i)}]})}#A(e,t){let r=this.#E(e,"hx-method"),i=this.#E(e,"hx-action",void 0,void 0,!1);if(!i)for(let t of this.#d){let s=this.#E(e,"hx-"+t,void 0,void 0,!1);if(null!=s){i=s,r=t;break}}return this.#D(e)&&(i||=t.submitter?.getAttribute?.("formAction")||e.getAttribute(e.matches("a")?"href":"action")),r||=t.submitter?.getAttribute?.("formmethod")||e.getAttribute("method")||"GET",{action:i,method:r.toUpperCase()}}#H(e){return e._htmx||(e._htmx={listeners:[],triggerSpecs:[]},e.setAttribute("data-htmx-powered","true")),e._htmx}#W(e){return e._htmx_state||={}}#_(e){if(this.#U(e)&&this.#L(e,"htmx:before:init",{},!0)){let t=this.#H(e);t.initialized=!0,t.eventHandler=this.#Q(e),this.#J(e),this.#L(e,"htmx:after:init",{},!0)}}#Q(e){return async t=>{try{let r=this.#T(e,t);await this.#X(r)}catch(t){this.#L(e,"htmx:error",{error:t})}}}#T(t,r){let{action:i,method:s}=this.#A(t,r),[n,o]=(i||"").split("#"),a=new AbortController,l={sourceElement:t,sourceEvent:r,status:"created",select:this.#E(t,"hx-select"),selectOOB:this.#E(t,"hx-select-oob"),target:this.#E(t,"hx-target"),swap:this.#E(t,"hx-swap")??this.config.defaultSwap,push:this.#E(t,"hx-push-url"),replace:this.#E(t,"hx-replace-url"),transition:this.config.transitions,confirm:this.#E(t,"hx-confirm"),request:{validate:"true"===this.#E(t,"hx-validate",!t.matches("form")||t.noValidate||r.submitter?.formNoValidate?"false":"true",void 0,!1),action:n,anchor:o,method:s,headers:this.#G(t),abort:a.abort.bind(a),credentials:"same-origin",signal:a.signal,mode:this.config.mode}};t._htmx?.boosted&&e.merge(t._htmx.boosted,l),l.target=this.#K(t,l.target),l.target&&(l.request.headers["HX-Target"]=this.#Y(l.target));let h=this.#E(t,"hx-config");return h&&(e.merge(h,l.request),l.request.mode=this.config.mode),l}#Y(e){return`${e.tagName.toLowerCase()}${e.id?"#"+encodeURI(e.id):""}`}#G(e){let t={"HX-Request":"true","HX-Source":this.#Y(e),"HX-Current-URL":location.href,Accept:"text/html"};return this.#D(e)&&(t["HX-Boosted"]="true"),t}#Z(e,t){return this.#q(e,"hx-headers",e=>{for(let r in e)t.request.headers[r]=String(e[r])},{ctx:t})}#K(e,t){return t instanceof Element?t:null!=t?this.#ee(e,t,"hx-target"):this.#D(e)?document.body:e}#D(e){return e?._htmx?.boosted}async#X(e){let t=e.sourceElement,r=e.sourceEvent;if(!t.isConnected)return;if(this.#te(r))return;this.#re(r)&&r.preventDefault();let i=/GET|DELETE/.test(e.request.method),s=i?t.matches("form")?t:null:t.form||t.closest("form"),n=this.#C(t,s,r.submitter,e.request.validate,i);if(!n)return;let o=this.#q(t,"hx-vals",t=>{e.vals=t;for(let e in t)n.set(e,t[e])},{ctx:e});if(o&&await o,e.values)for(let t in e.values)n.delete(t),n.append(t,e.values[t]);let a=this.#Z(t,e);if(a&&await a,Object.assign(e.request,{form:s,submitter:r.submitter,body:n}),!this.#L(t,"htmx:config:request",{ctx:e}))return;if("DIALOG"===e.request.method)return;let l=this.#ie(e.request.action);if(null!=l){let t=Object.fromEntries(e.request.body);return void await this.#k(e.sourceElement,t,l,!1)}if(i){let t=new URL(e.request.action,document.baseURI);for(let r of e.request.body.keys())t.searchParams.delete(r);for(let[r,i]of e.request.body)t.searchParams.append(r,i);t.origin===location.origin?e.request.action=t.pathname+t.search:e.request.action=t.href,e.request.body=null}else"multipart/form-data"!==(this.#E(t,"hx-encoding")??s?.enctype)&&(e.request.body=new URLSearchParams(e.request.body));await this.#se(e)}async#se(e){let t=e.sourceElement,r=this.#ne(t),i=this.#oe(t);this.#ae(t);let s=()=>e.request?.abort?.();if("run"===i.admit(r,()=>this.#se(e),s)){e.status="issuing",e.indicators??=[],e.disabledElements??=[];try{if(e.confirm){if(!await new Promise(r=>{let i={ctx:e,issueRequest:()=>r(!0),dropRequest:()=>r(!1)};if(this.#L(t,"htmx:confirm",i)){let i=this.#ie(e.confirm);r(i?this.#k(t,{ctx:e},i,!0):window.confirm(e.confirm))}}))return}if(this.#le(e),this.#he(e),this.#ce(e),e.fetch||=window.fetch.bind(window),e.request.headers["HX-Request-Type"]=e.target===document.body||e.select?"full":"partial",!this.#L(t,"htmx:before:request",{ctx:e}))return;let r=await e.fetch(e.request.action,e.request);if(e.response={raw:r,status:r.status,headers:r.headers},this.#ue(e),!this.#L(t,"htmx:before:response",{ctx:e}))return;if(e.text=await r.text(),!this.#L(t,"htmx:after:request",{ctx:e}))return;if(e.response.status>=400&&this.#L(t,"htmx:response:error",{ctx:e}),this.#de(e))return void(e.keepIndicators=!0);if("issuing"===e.status){if(e.hx.retarget&&(e.target=e.hx.retarget),e.hx.reswap&&(e.swap=e.hx.reswap),e.hx.reselect&&(e.select=e.hx.reselect),!1===e.target?.isConnected)return;e.status="response received",this.#fe(e),await this.swap(e),e.status="swapped"}}catch(r){e.status="error: "+r,"AbortError"===r?.name&&"timeout"!==e.request.signal.reason||this.#L(t,"htmx:error",{ctx:e,error:r})}finally{await(e.extensionPromise?.catch(()=>{})),clearTimeout(e.requestTimeout),e.hx?.trigger&&this.#me(e.hx.trigger,e.sourceElement),this.#L(t,"htmx:finally:request",{ctx:e}),e.keepIndicators||(this.#pe(e.indicators),this.#ge(e.disabledElements)),i.continue(s)}}}#ue(e){e.hx={};for(let[t,r]of e.response.raw.headers)t.toLowerCase().startsWith("hx-")&&(e.hx[t.slice(3).toLowerCase().replace(/-/g,"")]=r)}#de(t){if("true"===t.hx.refresh)return this._loc.reload(),!0;if(t.hx.redirect)return this._loc.href=t.hx.redirect,!0;if(t.hx.location){let r=t.hx.location,i={},s=e.parse(r);return"{"!==r[0]&&null==s.path||(i=s,r=i.path,delete i.path),null==i.push&&null==i.replace&&(i.push="true"),i.indicators=t.indicators,i.disabledElements=t.disabledElements,this.ajax("GET",r,i),!0}}#le(e){let t=null!=e.request.timeout?this.parseInterval(e.request.timeout):this.config.defaultTimeout;t&&(e.requestTimeout=setTimeout(()=>e.request?.abort?.("timeout"),t))}#ne(e){let t=this.#E(e,"hx-sync");if(!t)return"queue first";let r=t.split(":").pop().trim();return/^(drop|abort|replace|queue)/.test(r)?r:"queue first"}#oe(e){let r=this.#E(e,"hx-sync"),i=e;if(r){let t=r.includes(":")?r.slice(0,r.lastIndexOf(":")).trim():/^(drop|abort|replace|queue)/.test(r)?null:r;t&&(i=this.#ee(e,t,"hx-sync")||e)}return this.#W(i).rq||=new t}#te(e){return"click"===e.type&&(e.ctrlKey||e.metaKey||e.shiftKey)&&!!e.currentTarget?.closest?.("a[href]")}#re(e){let t=e.currentTarget;if("submit"===e.type&&"FORM"===t?.tagName)return!0;if(!("click"===e.type&&0===e.button))return!1;let r=t?.closest?.('button, input[type="submit"], input[type="image"]'),i=r?.form||r?.closest("form");if(r&&!r.disabled&&i&&("submit"===r.type||"image"===r.type||!r.type&&"BUTTON"===r.tagName))return!0;let s=t?.closest?.("a");if(!s||!s.href)return!1;let n=s.getAttribute("href");return!(n&&n.startsWith("#")&&n.length>1)}#J(e,t=e._htmx.eventHandler){let r=this.#E(e,"hx-trigger",void 0,void 0,!1)||(e.matches("form")?"submit":e.matches("input:not([type=button]):not([type=submit]),select,textarea")?"change":"click");this.#O(e,r,t)}#O(e,t,r){let i=this.#w(t);this.#H(e).triggerSpecs.push(...i);for(let t of i){t.listeners=[];let[i,s]=this.#xe(t.name),n=[e];"outside"===t.from?n=[document]:t.from&&"self"!==t.from&&(n=this.#be(e,t.from));let o=i=>{if((t.halt||t.prevent)&&i.preventDefault(),(t.halt||t.stop||t.consume)&&i.stopPropagation(),t.changed){let t=this.#W(e).changedValues??=new WeakMap,r=i.target;if(!["checkbox","radio"].includes(r?.type)){let e=r?.value;if(t.has(r)&&t.get(r)===e)return;t.set(r,e)}}if(t.once)for(let e of t.listeners)e.fromElt.removeEventListener(e.eventName,e.handler,e);r(i)},a=o;if(t.delay?a=e=>{clearTimeout(t.timeout),t.timeout=setTimeout(()=>o(e),this.parseInterval(t.delay))}:t.throttle&&(a=e=>{t.throttled?t.throttledEvent=e:(t.throttled=!0,o(e),t.throttleTimeout=setTimeout(()=>{if(t.throttled=!1,t.throttledEvent){let e=t.throttledEvent;t.throttledEvent=null,a(e)}},this.parseInterval(t.throttle)))}),t.handler=r=>{if(this.#re(r)&&r.preventDefault(),("self"!==t.from||r.target===e)&&("outside"!==t.from||!e.contains(r.target))&&(!t.target||r.target?.matches?.(t.target))){if(s){let t={};for(let e in r)/^[a-z]+$/i.test(e)&&(t[e]=r[e]);if(!this.#k(e,t,s,!0,!1))return}if("every"!==i)for(let t of this.#H(e).triggerSpecs)clearTimeout(t.timeout),t.throttledEvent=null;a(r)}},"intersect"===i||"revealed"===i){let r={rootMargin:t.rootMargin};t.root&&(r.root=this.#ee(e,t.root)),t.threshold&&(r.threshold=parseFloat(t.threshold));let s="revealed"===i;t.observer=new IntersectionObserver(e=>{for(let r=0;r"name"!==e);t.interval=setInterval(()=>{e.isConnected?this.#L(e,"every",{},!1):clearInterval(t.interval)},this.parseInterval(r))}if("load"!==i)for(let r of n){let s={fromElt:r,eventName:i,handler:t.handler,capture:!!t.capture,passive:!!t.passive};e._htmx.listeners.push(s),t.listeners.push(s),r.addEventListener(i,t.handler,s)}else t.handler(new CustomEvent("load"))}}#xe(e){let t=e.match(/^([^\[]*)\[([^\]]*)]/);return t?[t[1],t[2]]:[e,null]}#me(t,r){if("{"===t[0]){let i=e.parse(t);for(let e in i){let t=i[e],s=r;t?.target&&(s=this.find(t.target)),this.trigger(s,e,"object"==typeof t?t:{value:t})}}else t.split(",").forEach(e=>this.trigger(r,e.trim(),{}))}#ye(e){let t={},r=Object.getPrototypeOf(this);for(let i of Object.getOwnPropertyNames(r))"constructor"!==i&&"function"==typeof this[i]&&(["find","findAll"].includes(i)?t[i]=(t,r)=>void 0===r?this[i](e,t):this[i](t,r):t[i]=this[i].bind(this));return t}#k(e,t,r,i=!0,s=!0,n=!1){let o={};Object.assign(o,this.#ye(e));let a={},l={scope:a,code:r};this.#$(e,"htmx:scope",l),r=l.code,Object.assign(o,a),Object.assign(o,t);let h=Object.keys(o),c=Object.values(o),u=new(s?this.#l:this.#a)(...h,i?`return (${r})`:r);return n?()=>u.call(e,...c):u.call(e,...c)}process(e,t){if(!e?.isConnected)return;if(!(e instanceof Element)){for(let r of e.children||[])this.process(r,t);return}if(t&&this.#Se(e,!0),this.#V(e))return;if(!this.#L(e,"htmx:before:process"))return;let r=[e],i=this.#f.evaluate(e),s=null;for(;s=i.iterateNext();)r.push(s);for(let e of r)!this.#V(e)&&this.#L(e,"htmx:before:on:init",{},!0)&&this.#ve(e);for(let t of this.#j(e,this.#c))this.#_(t);for(let t of this.#j(e,this.#u))this.#Ee(t);this.#L(e,"htmx:after:process")}#Ee(e){let t=this.#E(e,"hx-boost");if(t&&"false"!==t&&this.#we(e)&&this.#L(e,"htmx:before:init",{},!0)){let r=this.#H(e);r.initialized=!0,r.eventHandler=this.#Q(e),r.boosted=t,this.#J(e),this.#L(e,"htmx:after:init",{},!0)}}#we(e){if(this.#U(e))if("A"===e.tagName){if(""===e.target||"_self"===e.target)return!e.hasAttribute("download")&&!e.getAttribute("href")?.startsWith?.("#")&&this.#Ae(e.href)}else if("FORM"===e.tagName)return"dialog"!==e.method&&this.#Ae(e.action)}#Ae(e){try{return new URL(e,window.location.href).origin===window.location.origin}catch(e){return!1}}#U(e){return!e._htmx?.initialized&&!this.#V(e)}#Se(e,t){let r=[e,...e.querySelectorAll?.("[data-htmx-powered]")??[]];for(let e of r)if(e._htmx){this.#L(e,"htmx:before:cleanup");for(let t of e._htmx.triggerSpecs||[])t.interval&&clearInterval(t.interval),t.timeout&&clearTimeout(t.timeout),t.throttleTimeout&&clearTimeout(t.throttleTimeout),t.observer?.disconnect();for(let t of e._htmx.listeners||[])t.fromElt.removeEventListener(t.eventName,t.handler,t);e.removeAttribute("data-htmx-powered"),this.#L(e,"htmx:after:cleanup"),t&&delete e._htmx}}#Te(e){let t=document.createElement("div");t.hidden=!0,document.body.insertAdjacentElement("afterend",t);let r=e.querySelectorAll?.(this.#S("[hx-preserve]"))||[];for(let e of r){let r=document.getElementById(e.id);r&&this.#Ce(t,r,null)}return t}#qe(e){for(let t of[...e.children]){let e=document.getElementById(t.id);e&&(this.#Ce(e.parentNode,t,e),this.#Se(e),e.remove())}e.remove()}#Ne(e){let t=this.#h.createHTML(e);return Document.parseHTMLUnsafe?.(t,{})||(new DOMParser).parseFromString(t,"text/html")}#Ie(e){let t=e.replace(/)/gi,'"),r="";t=t.replace(/]*)?>[\s\S]*?<\/head>/i,e=>(r=this.#Ne(e).title,""));let i,s,n=t.match(/<([a-z][^\/>\x20\t\r\n\f]*)/i)?.[1]?.toLowerCase();if("html"===n||"body"===n?(i=this.#Ne(t),s=document.createDocumentFragment(),s.append(i.body)):(i=this.#Ne(``),s=i.querySelector("template").content),!r){let e=s.querySelector("title:not(svg title)");e&&(r=e.textContent,e.remove())}return this.#Me(s),{fragment:s,title:r}}#Oe(e,t,r,i){let s=t.id?"#"+CSS.escape(t.id):null,[,n,o]=r.match(/^(\S+):(.+)/)??[];n&&([r,s]=[n,o||s]),"true"!==r&&r||(r="outerHTML");let a=this.#He(r);if(s=a.target||s,a.strip??=!a.style.startsWith("outer"),!s)return;let l=this.#be(i,s);for(let r of l){let s=document.createDocumentFragment();s.append(t.cloneNode(!0)),e.push({type:"oob",fragment:s,target:r,swapSpec:a,sourceElement:i})}t.remove()}#Le(e,t,r){let i=[];if(r)for(let s of r.split(",")){let[r,n="true"]=s.split(/:(.*)/);for(let s of e.querySelectorAll(r))this.#Oe(i,s,n,t)}for(let r of e.querySelectorAll(this.#S("[hx-swap-oob]"))){let e=this.#R(r,"hx-swap-oob"),s=r.getAttribute(e);r.removeAttribute(e),this.#Oe(i,r,s,t)}return i}#ke(e,t,r){t?t.before(...r.childNodes):e.append(...r.childNodes)}#He(t){t=t.trim();let r=this.config.defaultSwap;if(t&&!/^\S*:/.test(t)){let e=t.match(/^(\S+)\s*(.*)$/);r=e[1],t=e[2]}return{style:this.#B(r),...e.parse(t)}}#Ve(e,t){let r=[];for(let i of e.querySelectorAll("template[hx]")){let e=i.getAttribute("type");if("partial"===e){let e=this.#P(i,"hx-target")||(i.id?"#"+CSS.escape(i.id):null);if(e){this.#Me(i.content);let s=this.#He(this.#P(i,"hx-swap")||this.config.defaultSwap);s.ignoreTitle&&(t.title=null);let n=this.#be(t.sourceElement,e);for(let e of n.length?n:[null])r.push({type:"partial",fragment:i.content.cloneNode(!0),target:e,swapSpec:s,sourceElement:t.sourceElement})}}else this.#$(i,"htmx:process:"+e,{ctx:t,tasks:r});i.remove()}return r}#Pe(e,t,r,i){try{null!=r&&e.setSelectionRange&&e.setSelectionRange(r,i),e.focus(t)}catch(e){}}#Re(e){let t=this.#j(e,"[autofocus]")[0];t&&this.#Pe(t)}#je(e){return e===window||e===document?document.scrollingElement:e}#Be(e,t){if(e.scroll){let r=e.scrollTarget?this.#je(this.#ze(t,e.scrollTarget)):t;r&&("top"===e.scroll?r.scrollTop=0:"bottom"===e.scroll&&(r.scrollTop=r.scrollHeight))}if("top"===e.show||"bottom"===e.show){let r=e.showTarget?this.#je(this.#ze(t,e.showTarget)):t;r?.scrollIntoView?.("top"===e.show)}}#Fe(e){e.request?.anchor&&document.getElementById(e.request.anchor)?.scrollIntoView({block:"start",behavior:"auto"})}#Me(e){let t=this.#j(e,"script");for(let e of t){let t=document.createElement("script");for(let r of e.attributes)t.setAttribute(r.name,r.value);this.config.inlineScriptNonce&&(t.nonce=this.config.inlineScriptNonce),t.textContent=this.#h.createScript(e.textContent),e.replaceWith(t)}}initialize(){this.config.history&&!this.#g&&(this.#g=!0,window.navigation&&!/firefox/i.test(navigator.userAgent)?navigation.addEventListener("navigate",e=>{"traverse"===e.navigationType&&e.canIntercept&&!e.hashChange&&e.intercept({handler:()=>this.#$e()})}):window.addEventListener("popstate",e=>this.#$e(e.state))),this.process(document.body)}async swap(e){try{let{fragment:t,title:r}=this.#Ie(e.text);e.title=r;let i=[],s=this.#Le(t,e.sourceElement,e.selectOOB),n=this.#Ve(t,e);i.push(...s,...n);let o=n.length||s.length&&!this.config.allowEmptySwapAfterOOB,a=this.#De(e,t,o);if(a&&i.unshift(a),!this.#L(e.sourceElement,"htmx:before:swap",{ctx:e,tasks:i}))return;this.#We(e);let l=[],h=[];for(let t of i)t.swapSpec?.transition??a?.transition??e.transition?h.push(t):l.push(this.#N(t));if(h.length>0){let t=async()=>{for(let e of h)await this.#N(e,!1)};l.push(this.#_e(t,e))}await Promise.all(l),!e.sourceElement?.isConnected&&a?.target?.isConnected&&(e.sourceElement=a.target),this.#L(e.sourceElement,"htmx:after:swap",{ctx:e}),e.title&&"none"!==e.swap&&(document.title=e.title),this.#Fe(e)}finally{this.#L(e.sourceElement,"htmx:finally:swap",{ctx:e})}}#De(e,t,r){let i=this.#He(e.swap||this.config.defaultSwap);if(i.ignoreTitle&&(e.title=null),"delete"===i.style||(t.querySelector("body")||t).childElementCount>0||t.textContent.trim()||(i.swapEmpty??!r)){if(e.select){let r=t.querySelectorAll(e.select);(t=document.createDocumentFragment()).append(...r)}return this.#D(e.sourceElement)&&(i.show||="top"),{type:"main",fragment:t,target:this.#K(e.sourceElement||document.body,i.target||e.target),swapSpec:i,sourceElement:e.sourceElement,transition:e.transition&&!1!==i.transition}}}async#N(e,t=!0){let{target:r,swapSpec:i,fragment:s}=e;if("string"==typeof r&&(r=document.querySelector(r)),!r)return;"string"==typeof i&&(i=this.#He(i));let n,o=i.style;if("none"===o)return;if("BODY"===s.firstElementChild?.tagName){const e=r===document.body&&o.startsWith("outer");e&&"outerHTML"===o&&(o="outerSync"),i.strip??=!e}if(i.strip&&s.firstElementChild&&(s=document.createDocumentFragment(),s.append(...(e.fragment.firstElementChild.content||e.fragment.firstElementChild).childNodes)),this.#Ue(r,"htmx-swapping"),t&&e.swapSpec?.swap&&await this.timeout(e.swapSpec?.swap),"delete"===o)return void(r.parentNode&&(this.#Se(r),r.parentNode.removeChild(r)));let a=[],l=i.settle??this.config.defaultSettleDelay,h=r.parentNode;if("innerHTML"===o||"outerHTML"===o&&h){let e=document.activeElement;if(e?.id){let t,r;try{t=e.selectionStart,r=e.selectionEnd}catch(e){}n={elt:e,start:t,end:r}}a=t&&l?this.#Qe(s,r):[]}let c=this.#Te(s),u=[...s.childNodes];try{if("innerHTML"===o){for(const e of r.children)this.#Se(e);r.replaceChildren(...s.childNodes)}else if("textContent"===o){for(const e of r.querySelectorAll("[data-htmx-powered]"))this.#Se(e);r.textContent=s.textContent}else if("outerHTML"===o)h&&(this.#ke(h,r,s),this.#Se(r),h.removeChild(r),r=u.find(e=>1===e.nodeType)||h);else if("outerSync"===o){this.#Je(r,s.firstElementChild);for(const e of r.children)this.#Se(e);r.replaceChildren(...s.firstElementChild.childNodes),u=[r]}else if("innerMorph"===o)this.#I(r,s,!0),u=[...r.childNodes];else if("outerMorph"===o)this.#I(r,s,!1),u.push(r);else if("beforebegin"===o)h&&this.#ke(h,r,s);else if("afterbegin"===o)this.#ke(r,r.firstChild,s);else if("beforeend"===o)this.#ke(r,null,s);else if("afterend"===o)h&&this.#ke(h,r.nextSibling,s);else{let e=this.#i.get("handle_swap")||[],t=!1;for(const n of e){let e=n(o,r,s,i);if(e){t=!0,Array.isArray(e)&&(u=e);break}}if(!t)throw new Error(`Unknown swap style: ${o}`)}}finally{this.#Xe(r,"htmx-swapping")}if(e.target=r,this.#qe(c),n&&!n.elt.matches(":focus")){let e=document.getElementById(n.elt.id);if(e){let t={preventScroll:void 0!==i.focusScroll?!i.focusScroll:!this.config.defaultFocusScroll};this.#Pe(e,t,n.start,n.end)}}this.#L(r,"htmx:before:settle",{task:e,newContent:u,settleTasks:a});for(const e of u)this.#Ue(e,"htmx-added");if(t&&a.length>0){this.#Ue(r,"htmx-settling"),await this.timeout(l);for(let e of a)e();this.#Xe(r,"htmx-settling")}this.#L(r,"htmx:after:settle",{task:e,newContent:u,settleTasks:a});for(const e of u)this.#Xe(e,"htmx-added"),this.process(e),this.#Re(e);this.#Be(i,r)}#L(e,t,r={},i=!0){if(r.error){let i=`htmx: ${t}: ${r.error.message??r.error}`;r.error instanceof Error?console.error(i,r.error,{elt:e,detail:r}):console.error(i,{elt:e,detail:r})}else r.warn?console.warn(`htmx: ${t}: ${r.warn}`,{elt:e,detail:r}):this.config.logAll&&console.log(`htmx: ${t}`,{elt:e,detail:r});return e=this.#Ge(e),this.#$(e,t,r),this.trigger(e,this.#F(t),r,i)}#$(e,t,r={}){let i=this.#i.get(t.replace(/:/g,"_"));if(i){r.cancelled=!1;for(const t of i)if(!1===t(e,r)||r.cancelled)return r.cancelled=!0,!1}return!0}timeout(e){if((e=this.parseInterval(e))>0)return new Promise(t=>setTimeout(t,e))}onLoad(e){this.on(this.#F("htmx:after:process"),t=>{e(t.target)})}on(e,t,r){let i,s=document;return void 0===r?(i=e,r=t):(s=this.#Ge(e),i=t),s.addEventListener(i,r),r}find(e,t){return this.#ze(e,t)}findAll(e,t){return this.#be(e,t)}parseInterval(e){if("number"==typeof e)return e;let[,t,r]=e?.match(/^([\d.]+)(ms|s|m)?$/)||[],i=parseFloat(t)*({ms:1,s:1e3,m:6e4}[r]||1);return isNaN(i)?void 0:i}trigger(e,t,r={},i=!0){e=this.#Ge(e);let s=new CustomEvent(t,{detail:r,cancelable:!0,bubbles:i,composed:!0}),n=e?.isConnected?e:document;return!r?.cancelled&&n.dispatchEvent(s)}ajax(e,t,r){(!r||r instanceof Element||"string"==typeof r)&&(r={target:r});let i="string"==typeof r.source?document.querySelector(r.source):r.source;if("string"==typeof r.source&&!i)return Promise.reject(new Error("Source not found"));i||=document.body;let s=this.#T(i,r.event||{});return Object.assign(s,r),r.target&&(s.target=this.#K(document.body,r.target),!s.target)?Promise.reject(new Error("Target not found")):(Object.assign(s.request,{action:t,method:e.toUpperCase()}),r.headers&&Object.assign(s.request.headers,r.headers),this.#X(s))}#Ke(e){this.config.history&&(history.pushState({htmx:!0},"",e),this.#L(document,"htmx:after:history:push",{path:e}))}#Ye(e){this.config.history&&(history.replaceState({htmx:!0},"",e),this.#L(document,"htmx:after:history:replace",{path:e}))}async#$e(e,t){if(await this.timeout(1),e??=history.state,!e?.htmx)return;this.#p?.abort(),t=t||location.pathname+location.search;let r=document.querySelector(this.#S("[hx-history-elt]"))||document.body;if(this.#L(document,"htmx:before:history:restore",{path:t,cacheMiss:!0})){if("reload"!==this.config.history)return this.#p=new AbortController,this.ajax("GET",t,{target:r,swap:"outerSync",select:r!==document.body?this.#S("[hx-history-elt]"):void 0,request:{headers:{"HX-History-Restore-Request":"true"},signal:this.#p.signal}});this._loc.reload()}}#Ze(e){let{sourceElement:t,push:r,replace:i,hx:s,response:n}=e;if((s?.pushurl||s?.replaceurl)&&(r=s.pushurl,i=s.replaceurl),null==r&&null==i&&this.#D(t)&&(r="true"),"false"!==r&&!1!==r||(r=null),"false"!==i&&!1!==i||(i=null),!r&&!i)return null;let o=r||i;if("true"===o){let t=n?.raw?.url||e.request.action,r=new URL(t,location.href);o=r.pathname+r.search+(e.request.anchor?"#"+e.request.anchor:"")}return{type:r?"push":"replace",path:o}}#We(e){if(!this.config.history)return;history.state?.htmx||history.replaceState({htmx:!0},"",location.href);let t=this.#Ze(e);if(!t)return;let r={history:t,sourceElement:e.sourceElement,response:e.response};this.#L(document,"htmx:before:history:update",r)&&("push"===t.type?this.#Ke(t.path):this.#Ye(t.path),this.#L(document,"htmx:after:history:update",r))}#ve(e){if(e._htmx?.onInitialized)return;let t=this.#v("hx-on"),r=this.config.metaCharacter||":",i=t=>async r=>{try{await this.#k(e,{event:r},`with(event?.detail||{}){${t}}`,!1)}catch(t){"symbol"!=typeof t&&this.#L(e,"htmx:error",{error:t})}};for(let s of e.getAttributeNames()){let n=t.find(e=>s.startsWith(e));if(!n)continue;this.#H(e).onInitialized=!0;let o=s.substring(n.length),a=e.getAttribute(s);if(!o){for(let t of a.split(/;(?=[^;]*->)/)){let r=t.indexOf("->");-1!==r&&this.#O(e,t.substring(0,r).trim(),i(t.substring(r+2).trim()))}continue}if(o[0]!==r)continue;let l=o.substring(1);l.startsWith(r)&&(l="htmx"+r+l.substring(1)),this.#O(e,l,i(a))}}#he(e){let t,r=e.sourceElement,i=this.#E(r,"hx-indicator");if(i)t=this.#be(r,i,"hx-indicator");else{if(r===document.body)return;t=[r]}for(const r of t){e.indicators.push(r);let t=this.#W(r);t.rc=(t.rc||0)+1,this.#Ue(r,this.config.requestClass)}}#pe(e){for(let t of e){let e=this.#W(t);e.rc&&--e.rc<=0&&(this.#Xe(t,this.config.requestClass),delete e.rc)}}#ce(e){let t=e.sourceElement,r=this.#E(t,"hx-disable");if(r)for(let i of this.#be(t,r,"hx-disable")){e.disabledElements.push(i);let t=this.#W(i);t.dc=(t.dc||0)+1,i.disabled=!0}}#ge(e){for(const t of e){let e=this.#W(t);e.dc&&--e.dc<=0&&(t.disabled=!1,delete e.dc)}}#C(e,t,r,i,s){if(i&&t&&!t.reportValidity())return;r??=t&&"submit"===e.type?e:null;let n=t?new FormData(t):new FormData,o=t?new Set(t.elements):new Set;if(!t){if(i&&e.reportValidity&&!e.reportValidity())return;this.#et(e,o,n,s)}r?.name&&(n.append(r.name,r.value),o.add(r));let a=this.#E(e,"hx-include");if(a)for(let t of this.#be(e,a)){if(i&&t.reportValidity&&!t.reportValidity())return;this.#et(t,o,n)}return n}#et(e,t,r,i){let s=e.tagName,n=[];"BUTTON"===s||s.includes("-")?n=[e]:(["INPUT","SELECT","TEXTAREA","FIELDSET"].includes(s)||!i&&e!==document.body)&&(n=this.#j(e,"[name]:not(button)"));for(let e of n){let i=e.name||e.getAttribute?.("name");if(!i||e.matches(":disabled")||t.has(e))continue;t.add(e);let s=e.type;if("checkbox"===s||"radio"===s||"INPUT"!==e.tagName&&"checked"in e)e.checked&&r.append(i,e.value);else if("file"===s)for(let t of e.files)r.append(i,t);else if("select-multiple"===s)for(let t of e.selectedOptions)r.append(i,t.value);else if(Array.isArray(e.value))for(let t of e.value)r.append(i,t);else r.append(i,e.value)}}#q(t,r,i,s={}){let n=this.#E(t,r);if(!n)return null;let o=this.#ie(n);if(o)return 0!==o.indexOf("{")&&(o="{"+o+"}"),this.#k(t,s,o,!0).then(e=>{i(e)});i(e.parse(n))}#tt(e){let t=e.trim();return t.startsWith("<")&&t.endsWith("/>")?t.slice(1,-2):t}#be(t,r,i,s){let n=r??t,o=r?this.#Ge(t)||document.body:document;if(n.startsWith("global "))return this.#be(o,n.slice(7),i,!0);let a=n?e.split(n):[],l=[],h=[];for(const e of a){let t,r=this.#tt(e);if(r.startsWith("closest "))t=o.closest(r.slice(8));else if(r.startsWith("find "))t=o.querySelector(r.slice(5));else if(r.startsWith("findAll "))l.push(...o.querySelectorAll(r.slice(8)));else if("next"===r||"nextElementSibling"===r)t=o.nextElementSibling;else if(r.startsWith("next "))t=this.#rt(o,r.slice(5),!!s);else if("previous"===r||"previousElementSibling"===r)t=o.previousElementSibling;else if(r.startsWith("previous "))t=this.#it(o,r.slice(9),!!s);else if("document"===r)t=document;else if("window"===r)t=window;else if("body"===r)t=document.body;else if("host"===r)t=o.getRootNode().host;else if("this"===r){if(i){l.push(...this.#z(o,i));continue}t=o}else h.push(r);t&&l.push(t)}if(h.length>0){let e=h.join(","),t=this.#st(o,!!s);l.push(...t.querySelectorAll(e))}return[...new Set(l)]}#rt(e,t,r){return this.#nt(this.#st(e,r).querySelectorAll(t),e,Node.DOCUMENT_POSITION_PRECEDING)}#it(e,t,r){let i=[...this.#st(e,r).querySelectorAll(t)].reverse();return this.#nt(i,e,Node.DOCUMENT_POSITION_FOLLOWING)}#nt(e,t,r){for(const i of e)if(i.compareDocumentPosition(t)===r)return i}#st(e,t){return e.isConnected&&e.getRootNode?e.getRootNode?.({composed:t}):document}#ee(e,t,r){let i=this.#be(e,t,r)[0];return i||console.warn(`htmx: '${t}' on ${r} did not match any element`,{elt:e,selector:t,attr:r}),i}#ze(e,t,r){return this.#be(e,t,r)[0]}#ie(e){if(null!=e){if(e.startsWith("js:"))return e.substring(3);if(e.startsWith("javascript:"))return e.substring(11)}}#ae(e){let t=this.#H(e);if(t.abortInitialized)return;t.abortInitialized=!0;let r=()=>{this.#oe(e).abort()};e.addEventListener("htmx:abort",r),t.listeners.push({fromElt:e,eventName:"htmx:abort",handler:r})}#I(e,t,r){let{persistentIds:i,idMap:s}=this.#ot(e,t),n=document.createElement("div");n.hidden=!0,document.body.after(n);let o={target:e,idMap:s,persistentIds:i,pantry:n,futureMatches:new WeakSet};r?this.#at(o,e,t):this.#at(o,e.parentNode,t,e,e.nextSibling),this.#Se(n),n.remove()}#at(e,t,r,i=null,s=null){t instanceof HTMLTemplateElement&&r instanceof HTMLTemplateElement&&(t=t.content,r=r.content),i||=t.firstChild;let n=r.firstChild;for(;n;){let r;if(i&&i!=s&&(r=this.#lt(e,n,i,s),r&&r!==i)){let o=i;for(;o&&o!==r;){let r=o;o=o.nextSibling,r instanceof Element&&(e.idMap.has(r)||this.#ht(e,r,n))?this.#Ce(t,r,s):this.#ct(e,r)}}if(!r&&n instanceof Element&&e.persistentIds.has(n.id)){let s=CSS.escape(n.id);r=e.target.id===n.id&&e.target||e.target.querySelector(`[id="${s}"]`)||e.pantry.querySelector(`[id="${s}"]`);let o=r;for(;o=o.parentNode;){let t=e.idMap.get(o);t&&(t.delete(r.id),t.size||e.idMap.delete(o))}this.#Ce(t,r,i)}if(r){this.#ut(r,n,e),i=r.nextSibling,n=n.nextSibling;continue}let o=n.nextSibling;if(e.idMap.has(n)){let r=document.createElement(n.tagName);t.insertBefore(r,i),this.#ut(r,n,e),this.process(r),i=r.nextSibling}else t.insertBefore(n,i),i=n.nextSibling;n=o}for(;i&&i!=s;){let t=i;i=i.nextSibling,this.#ct(e,t)}}#ht(e,t,r){if(e.futureMatches.has(t))return!0;for(let i=r.nextSibling,s=0;i&&sa.has(e)))return h;if(!r){if(o>0&&h.isEqualNode(t))return h;s||(s=h)}}if(n+=r?.size||0,n>l)break;if(null!=document.activeElement?.selectionStart&&h.contains(document.activeElement))break;if(--o<1&&0===l)break;h=h.nextSibling}return s&&this.#ht(e,s,t)?null:s}#M(e,t){return e instanceof Element&&e.tagName===t.tagName&&(!("SCRIPT"===e.tagName&&!e.isEqualNode(t))&&(!e.id||e.id===t.id))}#ct(e,t){e.idMap.has(t)?this.#Ce(e.pantry,t,null):(this.#Se(t),t.remove())}#Ce(e,t,r){if(e.moveBefore)try{return void e.moveBefore(t,r)}catch(e){}e.insertBefore(t,r)}#ut(e,t,r){if(3===e.nodeType)return void(e.nodeValue!==t.nodeValue&&(e.nodeValue=t.nodeValue));if(this.config.morphSkip&&e.matches?.(this.config.morphSkip))return;if(!this.#$(e,"htmx:before:morph:node",{oldNode:e,newNode:t}))return;this.#Je(e,t),e instanceof HTMLTextAreaElement&&document.activeElement!==e&&e.defaultValue!=t.defaultValue&&(e.value=t.value),this.config.morphSkipChildren&&e.matches?.(this.config.morphSkipChildren)||e.isEqualNode(t)&&"TEMPLATE"!==t.tagName&&!t.querySelector?.("template")||this.#at(r,e,t)}#Je(e,t){let r=this.config.morphIgnore||[],i=!1,s=e=>this.#v("hx-").some(t=>e.startsWith(t));for(const n of t.attributes)if(!r.some(e=>n.name.startsWith(e))&&e.getAttribute(n.name)!==n.value){if(s(n.name)&&(i=!0),!this.#$(e,"htmx:before:morph:attr",{attrName:n.name,newValue:n.value}))continue;e.setAttribute(n.name,n.value),"value"===n.name&&e instanceof HTMLInputElement&&"file"!==e.type&&document.activeElement!==e&&(e.value=n.value)}for(let n=e.attributes.length-1;n>=0;n--){let o=e.attributes[n];if(o&&!t.hasAttribute(o.name)&&!r.some(e=>o.name.startsWith(e))){if(s(o.name)&&(i=!0),!this.#$(e,"htmx:before:morph:attr",{attrName:o.name,newValue:null}))continue;e.removeAttribute(o.name)}}i&&this.#Se(e,!0)}#dt(e,t,r,i){for(const s of i)if(t.has(s.id)){let t=s;for(;t&&t!==r;){let r=e.get(t);null==r&&(r=new Set,e.set(t,r)),r.add(s.id),t=t.parentElement}}}#ot(e,t){let r=this.#j(e,"[id]"),i=t.querySelectorAll("[id]"),s=this.#ft(r,i),n=new Map;return this.#dt(n,s,e.parentElement,r),this.#dt(n,s,t,i),{persistentIds:s,idMap:n}}#ft(e,t){let r=new Set,i=new Map;for(const{id:t,tagName:s}of e)i.has(t)?r.add(t):t&&i.set(t,s);let s=new Set;for(const{id:e,tagName:n}of t)s.has(e)?r.add(e):i.get(e)===n&&s.add(e);for(const e of r)s.delete(e);return s}#fe(t){let r=t.response.raw.status,i=this.config.noSwap.map(e=>e+""),s=r+"";for(let r of[s,s.slice(0,2)+"x",s[0]+"xx"]){if(i.includes(r))return void(t.swap="none");let s=this.#E(t.sourceElement,"hx-status:"+r);if(s)return void e.merge(s,t)}}#_e(e,t){return new Promise(r=>{this.#m||=[],this.#m.push({task:e,resolve:r,ctx:t}),this.#x||this.#mt()})}async#mt(){if(0===this.#m.length||this.#x)return;this.#x=!0;let{task:e,resolve:t,ctx:r}=this.#m.shift();try{if(document.startViewTransition){let t={task:e,ctx:r};this.#L(r.sourceElement,"htmx:before:viewTransition",t),await document.startViewTransition(t.task).finished,this.#L(r.sourceElement,"htmx:after:viewTransition",t)}else await e()}catch(e){}finally{this.#x=!1,t(),this.#mt()}}#Qe(e,t){let r=["class","style","width","height"],i=t.querySelectorAll("[id]"),s=Object.fromEntries([...i].map(e=>[e.id,e])),n=e.querySelectorAll("[id]"),o=[];for(let e of n){let t=s[e.id];if(t?.tagName===e.tagName){let i=e.cloneNode(!1);for(let i of r)t.hasAttribute(i)?e.setAttribute(i,t.getAttribute(i)):e.removeAttribute(i);o.push(()=>{this.#Je(e,i)})}}return o}#Ue(e,t){e?.classList?.add?.(t)}#Xe(e,t){e?.classList?.remove?.(t),0===e?.classList?.length&&e.removeAttribute("class")}#Ge(e){return"string"==typeof e?this.find(e):e}#F(e){return this.config.metaCharacter?e.replace(/:/g,this.config.metaCharacter):e}}})(); \ No newline at end of file diff --git a/src/Directory.Build.props b/src/Directory.Build.props index a93b0a7..3f36d17 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,7 +1,7 @@  - net8.0;net9.0;net10.0 + net8.0;net10.0;net11.0 4.0.0 true htmx 4.0.0 Initial Release