A container registry that uses the AT Protocol for manifest storage and S3 for blob storage. atcr.io
docker container atproto go
80
fork

Configure Feed

Select the types of activity you want to include in your feed.

update api endpoints to use post body rather than url based handlers

+83 -30
+23 -7
pkg/appview/handlers/api.go
··· 2 2 3 3 import ( 4 4 "bytes" 5 + "encoding/json" 5 6 "errors" 6 7 "fmt" 7 8 "html/template" ··· 11 12 "atcr.io/pkg/appview/db" 12 13 "atcr.io/pkg/appview/middleware" 13 14 "atcr.io/pkg/atproto" 14 - "github.com/go-chi/chi/v5" 15 15 "github.com/go-chi/render" 16 16 ) 17 17 ··· 20 20 BaseUIHandler 21 21 } 22 22 23 + // starRequest is the JSON body for star/unstar requests 24 + type starRequest struct { 25 + Handle string `json:"handle"` 26 + Repo string `json:"repo"` 27 + } 28 + 23 29 func (h *StarRepositoryHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { 24 30 // Get authenticated user from middleware 25 31 user := middleware.GetUser(r) ··· 28 34 return 29 35 } 30 36 31 - // Extract parameters 32 - handle := chi.URLParam(r, "handle") 33 - repository := chi.URLParam(r, "repository") 37 + // Parse JSON body 38 + var req starRequest 39 + if err := json.NewDecoder(r.Body).Decode(&req); err != nil { 40 + http.Error(w, "Invalid request body", http.StatusBadRequest) 41 + return 42 + } 43 + handle := req.Handle 44 + repository := req.Repo 34 45 35 46 // Resolve owner's handle to DID 36 47 ownerDID, err := atproto.ResolveHandleToDID(r.Context(), handle) ··· 93 104 return 94 105 } 95 106 96 - // Extract parameters 97 - handle := chi.URLParam(r, "handle") 98 - repository := chi.URLParam(r, "repository") 107 + // Parse JSON body 108 + var req starRequest 109 + if err := json.NewDecoder(r.Body).Decode(&req); err != nil { 110 + http.Error(w, "Invalid request body", http.StatusBadRequest) 111 + return 112 + } 113 + handle := req.Handle 114 + repository := req.Repo 99 115 100 116 // Resolve owner's handle to DID 101 117 ownerDID, err := atproto.ResolveHandleToDID(r.Context(), handle)
+37 -8
pkg/appview/handlers/images.go
··· 12 12 "atcr.io/pkg/appview/db" 13 13 "atcr.io/pkg/appview/middleware" 14 14 "atcr.io/pkg/atproto" 15 - "github.com/go-chi/chi/v5" 16 15 "github.com/go-chi/render" 17 16 ) 17 + 18 + // deleteTagRequest is the JSON body for delete tag requests 19 + type deleteTagRequest struct { 20 + Repo string `json:"repo"` 21 + Tag string `json:"tag"` 22 + } 18 23 19 24 // DeleteTagHandler handles deleting a tag 20 25 type DeleteTagHandler struct { ··· 28 33 return 29 34 } 30 35 31 - repo := chi.URLParam(r, "repository") 32 - tag := chi.URLParam(r, "tag") 36 + // Parse JSON body 37 + var req deleteTagRequest 38 + if err := json.NewDecoder(r.Body).Decode(&req); err != nil { 39 + http.Error(w, "Invalid request body", http.StatusBadRequest) 40 + return 41 + } 42 + repo := req.Repo 43 + tag := req.Tag 33 44 34 45 // Create ATProto client with session provider (uses DoWithSession for DPoP nonce safety) 35 46 pdsClient := atproto.NewClientWithSessionProvider(user.PDSEndpoint, user.DID, h.Refresher) ··· 59 70 w.WriteHeader(http.StatusOK) 60 71 } 61 72 73 + // deleteManifestRequest is the JSON body for delete manifest requests 74 + type deleteManifestRequest struct { 75 + Repo string `json:"repo"` 76 + Digest string `json:"digest"` 77 + Confirm bool `json:"confirm"` 78 + } 79 + 62 80 // DeleteManifestHandler handles deleting a manifest 63 81 type DeleteManifestHandler struct { 64 82 BaseUIHandler ··· 71 89 return 72 90 } 73 91 74 - repo := chi.URLParam(r, "repository") 75 - digest := chi.URLParam(r, "digest") 76 - confirmed := r.URL.Query().Get("confirm") == "true" 92 + // Parse JSON body 93 + var req deleteManifestRequest 94 + if err := json.NewDecoder(r.Body).Decode(&req); err != nil { 95 + http.Error(w, "Invalid request body", http.StatusBadRequest) 96 + return 97 + } 98 + repo := req.Repo 99 + digest := req.Digest 100 + confirmed := req.Confirm 77 101 78 102 // Check if manifest is tagged 79 103 tagged, err := db.IsManifestTagged(h.DB, user.DID, repo, digest) ··· 174 198 return 175 199 } 176 200 177 - repo := chi.URLParam(r, "repository") 178 - 179 201 // Parse multipart form (max 3MB to match lexicon maxSize) 180 202 if err := r.ParseMultipartForm(3 << 20); err != nil { 181 203 http.Error(w, "File too large (max 3MB)", http.StatusBadRequest) 204 + return 205 + } 206 + 207 + // Get repo from form field 208 + repo := r.FormValue("repo") 209 + if repo == "" { 210 + http.Error(w, "Missing repo field", http.StatusBadRequest) 182 211 return 183 212 } 184 213
+3 -3
pkg/appview/public/js/bundle.min.js
··· 1 - var Ie=(function(){"use strict";let htmx={onLoad:null,process:null,on:null,off:null,trigger:null,ajax:null,find:null,findAll:null,closest:null,values:function(e,t){return getInputValues(e,t||"post").values},remove:null,addClass:null,removeClass:null,toggleClass:null,takeClass:null,swap:null,defineExtension:null,removeExtension:null,logAll:null,logNone:null,logger:null,config:{historyEnabled:!0,historyCacheSize:10,refreshOnHistoryMiss:!1,defaultSwapStyle:"innerHTML",defaultSwapDelay:0,defaultSettleDelay:20,includeIndicatorStyles:!0,indicatorClass:"htmx-indicator",requestClass:"htmx-request",addedClass:"htmx-added",settlingClass:"htmx-settling",swappingClass:"htmx-swapping",allowEval:!0,allowScriptTags:!0,inlineScriptNonce:"",inlineStyleNonce:"",attributesToSettle:["class","style","width","height"],withCredentials:!1,timeout:0,wsReconnectDelay:"full-jitter",wsBinaryType:"blob",disableSelector:"[hx-disable], [data-hx-disable]",scrollBehavior:"instant",defaultFocusScroll:!1,getCacheBusterParam:!1,globalViewTransitions:!1,methodsThatUseUrlParams:["get","delete"],selfRequestsOnly:!0,ignoreTitle:!1,scrollIntoViewOnBoost:!0,triggerSpecsCache:null,disableInheritance:!1,responseHandling:[{code:"204",swap:!1},{code:"[23]..",swap:!0},{code:"[45]..",swap:!1,error:!0}],allowNestedOobSwaps:!0,historyRestoreAsHxRequest:!0,reportValidityOfForms:!1},parseInterval:null,location,_:null,version:"2.0.8"};htmx.onLoad=onLoadHelper,htmx.process=processNode,htmx.on=addEventListenerImpl,htmx.off=removeEventListenerImpl,htmx.trigger=triggerEvent,htmx.ajax=ajaxHelper,htmx.find=find,htmx.findAll=findAll,htmx.closest=closest,htmx.remove=removeElement,htmx.addClass=addClassToElement,htmx.removeClass=removeClassFromElement,htmx.toggleClass=toggleClassOnElement,htmx.takeClass=takeClassForElement,htmx.swap=swap,htmx.defineExtension=defineExtension,htmx.removeExtension=removeExtension,htmx.logAll=logAll,htmx.logNone=logNone,htmx.parseInterval=parseInterval,htmx._=internalEval;let internalAPI={addTriggerHandler,bodyContains,canAccessLocalStorage,findThisElement,filterValues,swap,hasAttribute,getAttributeValue,getClosestAttributeValue,getClosestMatch,getExpressionVars,getHeaders,getInputValues,getInternalData,getSwapSpecification,getTriggerSpecs,getTarget,makeFragment,mergeObjects,makeSettleInfo,oobSwap,querySelectorExt,settleImmediately,shouldCancel,triggerEvent,triggerErrorEvent,withExtensions},VERBS=["get","post","put","delete","patch"],VERB_SELECTOR=VERBS.map(function(e){return"[hx-"+e+"], [data-hx-"+e+"]"}).join(", ");function parseInterval(e){if(e==null)return;let t=NaN;return e.slice(-2)=="ms"?t=parseFloat(e.slice(0,-2)):e.slice(-1)=="s"?t=parseFloat(e.slice(0,-1))*1e3:e.slice(-1)=="m"?t=parseFloat(e.slice(0,-1))*1e3*60:t=parseFloat(e),isNaN(t)?void 0:t}function getRawAttribute(e,t){return e instanceof Element&&e.getAttribute(t)}function hasAttribute(e,t){return!!e.hasAttribute&&(e.hasAttribute(t)||e.hasAttribute("data-"+t))}function getAttributeValue(e,t){return getRawAttribute(e,t)||getRawAttribute(e,"data-"+t)}function parentElt(e){let t=e.parentElement;return!t&&e.parentNode instanceof ShadowRoot?e.parentNode:t}function getDocument(){return document}function getRootNode(e,t){return e.getRootNode?e.getRootNode({composed:t}):getDocument()}function getClosestMatch(e,t){for(;e&&!t(e);)e=parentElt(e);return e||null}function getAttributeValueWithDisinheritance(e,t,r){let a=getAttributeValue(t,r),o=getAttributeValue(t,"hx-disinherit");var s=getAttributeValue(t,"hx-inherit");if(e!==t){if(htmx.config.disableInheritance)return s&&(s==="*"||s.split(" ").indexOf(r)>=0)?a:null;if(o&&(o==="*"||o.split(" ").indexOf(r)>=0))return"unset"}return a}function getClosestAttributeValue(e,t){let r=null;if(getClosestMatch(e,function(a){return!!(r=getAttributeValueWithDisinheritance(e,asElement(a),t))}),r!=="unset")return r}function matches(e,t){return e instanceof Element&&e.matches(t)}function getStartTag(e){let r=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i.exec(e);return r?r[1].toLowerCase():""}function parseHTML(e){return"parseHTMLUnsafe"in Document?Document.parseHTMLUnsafe(e):new DOMParser().parseFromString(e,"text/html")}function takeChildrenFor(e,t){for(;t.childNodes.length>0;)e.append(t.childNodes[0])}function duplicateScript(e){let t=getDocument().createElement("script");return forEach(e.attributes,function(r){t.setAttribute(r.name,r.value)}),t.textContent=e.textContent,t.async=!1,htmx.config.inlineScriptNonce&&(t.nonce=htmx.config.inlineScriptNonce),t}function isJavaScriptScriptNode(e){return e.matches("script")&&(e.type==="text/javascript"||e.type==="module"||e.type==="")}function normalizeScriptTags(e){Array.from(e.querySelectorAll("script")).forEach(t=>{if(isJavaScriptScriptNode(t)){let r=duplicateScript(t),a=t.parentNode;try{a.insertBefore(r,t)}catch(o){logError(o)}finally{t.remove()}}})}function makeFragment(e){let t=e.replace(/<head(\s[^>]*)?>[\s\S]*?<\/head>/i,""),r=getStartTag(t),a;if(r==="html"){a=new DocumentFragment;let s=parseHTML(e);takeChildrenFor(a,s.body),a.title=s.title}else if(r==="body"){a=new DocumentFragment;let s=parseHTML(t);takeChildrenFor(a,s.body),a.title=s.title}else{let s=parseHTML('<body><template class="internal-htmx-wrapper">'+t+"</template></body>");a=s.querySelector("template").content,a.title=s.title;var o=a.querySelector("title");o&&o.parentNode===a&&(o.remove(),a.title=o.innerText)}return a&&(htmx.config.allowScriptTags?normalizeScriptTags(a):a.querySelectorAll("script").forEach(s=>s.remove())),a}function maybeCall(e){e&&e()}function isType(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function isFunction(e){return typeof e=="function"}function isRawObject(e){return isType(e,"Object")}function getInternalData(e){let t="htmx-internal-data",r=e[t];return r||(r=e[t]={}),r}function toArray(e){let t=[];if(e)for(let r=0;r<e.length;r++)t.push(e[r]);return t}function forEach(e,t){if(e)for(let r=0;r<e.length;r++)t(e[r])}function isScrolledIntoView(e){let t=e.getBoundingClientRect(),r=t.top,a=t.bottom;return r<window.innerHeight&&a>=0}function bodyContains(e){return e.getRootNode({composed:!0})===document}function splitOnWhitespace(e){return e.trim().split(/\s+/)}function mergeObjects(e,t){for(let r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}function parseJSON(e){try{return JSON.parse(e)}catch(t){return logError(t),null}}function canAccessLocalStorage(){let e="htmx:sessionStorageTest";try{return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch{return!1}}function normalizePath(e){let t=new URL(e,"http://x");return t&&(e=t.pathname+t.search),e!="/"&&(e=e.replace(/\/+$/,"")),e}function internalEval(str){return maybeEval(getDocument().body,function(){return eval(str)})}function onLoadHelper(e){return htmx.on("htmx:load",function(r){e(r.detail.elt)})}function logAll(){htmx.logger=function(e,t,r){console&&console.log(t,e,r)}}function logNone(){htmx.logger=null}function find(e,t){return typeof e!="string"?e.querySelector(t):find(getDocument(),e)}function findAll(e,t){return typeof e!="string"?e.querySelectorAll(t):findAll(getDocument(),e)}function getWindow(){return window}function removeElement(e,t){e=resolveTarget(e),t?getWindow().setTimeout(function(){removeElement(e),e=null},t):parentElt(e).removeChild(e)}function asElement(e){return e instanceof Element?e:null}function asHtmlElement(e){return e instanceof HTMLElement?e:null}function asString(e){return typeof e=="string"?e:null}function asParentNode(e){return e instanceof Element||e instanceof Document||e instanceof DocumentFragment?e:null}function addClassToElement(e,t,r){e=asElement(resolveTarget(e)),e&&(r?getWindow().setTimeout(function(){addClassToElement(e,t),e=null},r):e.classList&&e.classList.add(t))}function removeClassFromElement(e,t,r){let a=asElement(resolveTarget(e));a&&(r?getWindow().setTimeout(function(){removeClassFromElement(a,t),a=null},r):a.classList&&(a.classList.remove(t),a.classList.length===0&&a.removeAttribute("class")))}function toggleClassOnElement(e,t){e=resolveTarget(e),e.classList.toggle(t)}function takeClassForElement(e,t){e=resolveTarget(e),forEach(e.parentElement.children,function(r){removeClassFromElement(r,t)}),addClassToElement(asElement(e),t)}function closest(e,t){return e=asElement(resolveTarget(e)),e?e.closest(t):null}function startsWith(e,t){return e.substring(0,t.length)===t}function endsWith(e,t){return e.substring(e.length-t.length)===t}function normalizeSelector(e){let t=e.trim();return startsWith(t,"<")&&endsWith(t,"/>")?t.substring(1,t.length-2):t}function querySelectorAllExt(e,t,r){if(t.indexOf("global ")===0)return querySelectorAllExt(e,t.slice(7),!0);e=resolveTarget(e);let a=[];{let l=0,f=0;for(let n=0;n<t.length;n++){let u=t[n];if(u===","&&l===0){a.push(t.substring(f,n)),f=n+1;continue}u==="<"?l++:u==="/"&&n<t.length-1&&t[n+1]===">"&&l--}f<t.length&&a.push(t.substring(f))}let o=[],s=[];for(;a.length>0;){let l=normalizeSelector(a.shift()),f;l.indexOf("closest ")===0?f=closest(asElement(e),normalizeSelector(l.slice(8))):l.indexOf("find ")===0?f=find(asParentNode(e),normalizeSelector(l.slice(5))):l==="next"||l==="nextElementSibling"?f=asElement(e).nextElementSibling:l.indexOf("next ")===0?f=scanForwardQuery(e,normalizeSelector(l.slice(5)),!!r):l==="previous"||l==="previousElementSibling"?f=asElement(e).previousElementSibling:l.indexOf("previous ")===0?f=scanBackwardsQuery(e,normalizeSelector(l.slice(9)),!!r):l==="document"?f=document:l==="window"?f=window:l==="body"?f=document.body:l==="root"?f=getRootNode(e,!!r):l==="host"?f=e.getRootNode().host:s.push(l),f&&o.push(f)}if(s.length>0){let l=s.join(","),f=asParentNode(getRootNode(e,!!r));o.push(...toArray(f.querySelectorAll(l)))}return o}var scanForwardQuery=function(e,t,r){let a=asParentNode(getRootNode(e,r)).querySelectorAll(t);for(let o=0;o<a.length;o++){let s=a[o];if(s.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_PRECEDING)return s}},scanBackwardsQuery=function(e,t,r){let a=asParentNode(getRootNode(e,r)).querySelectorAll(t);for(let o=a.length-1;o>=0;o--){let s=a[o];if(s.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_FOLLOWING)return s}};function querySelectorExt(e,t){return typeof e!="string"?querySelectorAllExt(e,t)[0]:querySelectorAllExt(getDocument().body,e)[0]}function resolveTarget(e,t){return typeof e=="string"?find(asParentNode(t)||document,e):e}function processEventArgs(e,t,r,a){return isFunction(t)?{target:getDocument().body,event:asString(e),listener:t,options:r}:{target:resolveTarget(e),event:asString(t),listener:r,options:a}}function addEventListenerImpl(e,t,r,a){return ready(function(){let s=processEventArgs(e,t,r,a);s.target.addEventListener(s.event,s.listener,s.options)}),isFunction(t)?t:r}function removeEventListenerImpl(e,t,r){return ready(function(){let a=processEventArgs(e,t,r);a.target.removeEventListener(a.event,a.listener)}),isFunction(t)?t:r}let DUMMY_ELT=getDocument().createElement("output");function findAttributeTargets(e,t){let r=getClosestAttributeValue(e,t);if(r){if(r==="this")return[findThisElement(e,t)];{let a=querySelectorAllExt(e,r);if(/(^|,)(\s*)inherit(\s*)($|,)/.test(r)){let s=asElement(getClosestMatch(e,function(l){return l!==e&&hasAttribute(asElement(l),t)}));s&&a.push(...findAttributeTargets(s,t))}return a.length===0?(logError('The selector "'+r+'" on '+t+" returned no matches!"),[DUMMY_ELT]):a}}}function findThisElement(e,t){return asElement(getClosestMatch(e,function(r){return getAttributeValue(asElement(r),t)!=null}))}function getTarget(e){let t=getClosestAttributeValue(e,"hx-target");return t?t==="this"?findThisElement(e,"hx-target"):querySelectorExt(e,t):getInternalData(e).boosted?getDocument().body:e}function shouldSettleAttribute(e){return htmx.config.attributesToSettle.includes(e)}function cloneAttributes(e,t){forEach(Array.from(e.attributes),function(r){!t.hasAttribute(r.name)&&shouldSettleAttribute(r.name)&&e.removeAttribute(r.name)}),forEach(t.attributes,function(r){shouldSettleAttribute(r.name)&&e.setAttribute(r.name,r.value)})}function isInlineSwap(e,t){let r=getExtensions(t);for(let a=0;a<r.length;a++){let o=r[a];try{if(o.isInlineSwap(e))return!0}catch(s){logError(s)}}return e==="outerHTML"}function oobSwap(e,t,r,a){a=a||getDocument();let o="#"+CSS.escape(getRawAttribute(t,"id")),s="outerHTML";e==="true"||(e.indexOf(":")>0?(s=e.substring(0,e.indexOf(":")),o=e.substring(e.indexOf(":")+1)):s=e),t.removeAttribute("hx-swap-oob"),t.removeAttribute("data-hx-swap-oob");let l=querySelectorAllExt(a,o,!1);return l.length?(forEach(l,function(f){let n,u=t.cloneNode(!0);n=getDocument().createDocumentFragment(),n.appendChild(u),isInlineSwap(s,f)||(n=asParentNode(u));let c={shouldSwap:!0,target:f,fragment:n};triggerEvent(f,"htmx:oobBeforeSwap",c)&&(f=c.target,c.shouldSwap&&(handlePreservedElements(n),swapWithStyle(s,f,f,n,r),restorePreservedElements()),forEach(r.elts,function(i){triggerEvent(i,"htmx:oobAfterSwap",c)}))}),t.parentNode.removeChild(t)):(t.parentNode.removeChild(t),triggerErrorEvent(getDocument().body,"htmx:oobErrorNoTarget",{content:t})),e}function restorePreservedElements(){let e=find("#--htmx-preserve-pantry--");if(e){for(let t of[...e.children]){let r=find("#"+t.id);r.parentNode.moveBefore(t,r),r.remove()}e.remove()}}function handlePreservedElements(e){forEach(findAll(e,"[hx-preserve], [data-hx-preserve]"),function(t){let r=getAttributeValue(t,"id"),a=getDocument().getElementById(r);if(a!=null)if(t.moveBefore){let o=find("#--htmx-preserve-pantry--");o==null&&(getDocument().body.insertAdjacentHTML("afterend","<div id='--htmx-preserve-pantry--'></div>"),o=find("#--htmx-preserve-pantry--")),o.moveBefore(a,null)}else t.parentNode.replaceChild(a,t)})}function handleAttributes(e,t,r){forEach(t.querySelectorAll("[id]"),function(a){let o=getRawAttribute(a,"id");if(o&&o.length>0){let s=o.replace("'","\\'"),l=a.tagName.replace(":","\\:"),f=asParentNode(e),n=f&&f.querySelector(l+"[id='"+s+"']");if(n&&n!==f){let u=a.cloneNode();cloneAttributes(a,n),r.tasks.push(function(){cloneAttributes(a,u)})}}})}function makeAjaxLoadTask(e){return function(){removeClassFromElement(e,htmx.config.addedClass),processNode(asElement(e)),processFocus(asParentNode(e)),triggerEvent(e,"htmx:load")}}function processFocus(e){let t="[autofocus]",r=asHtmlElement(matches(e,t)?e:e.querySelector(t));r?.focus()}function insertNodesBefore(e,t,r,a){for(handleAttributes(e,r,a);r.childNodes.length>0;){let o=r.firstChild;addClassToElement(asElement(o),htmx.config.addedClass),e.insertBefore(o,t),o.nodeType!==Node.TEXT_NODE&&o.nodeType!==Node.COMMENT_NODE&&a.tasks.push(makeAjaxLoadTask(o))}}function stringHash(e,t){let r=0;for(;r<e.length;)t=(t<<5)-t+e.charCodeAt(r++)|0;return t}function attributeHash(e){let t=0;for(let r=0;r<e.attributes.length;r++){let a=e.attributes[r];a.value&&(t=stringHash(a.name,t),t=stringHash(a.value,t))}return t}function deInitOnHandlers(e){let t=getInternalData(e);if(t.onHandlers){for(let r=0;r<t.onHandlers.length;r++){let a=t.onHandlers[r];removeEventListenerImpl(e,a.event,a.listener)}delete t.onHandlers}}function deInitNode(e){let t=getInternalData(e);t.timeout&&clearTimeout(t.timeout),t.listenerInfos&&forEach(t.listenerInfos,function(r){r.on&&removeEventListenerImpl(r.on,r.trigger,r.listener)}),deInitOnHandlers(e),forEach(Object.keys(t),function(r){r!=="firstInitCompleted"&&delete t[r]})}function cleanUpElement(e){triggerEvent(e,"htmx:beforeCleanupElement"),deInitNode(e),forEach(e.children,function(t){cleanUpElement(t)})}function swapOuterHTML(e,t,r){if(e.tagName==="BODY")return swapInnerHTML(e,t,r);let a,o=e.previousSibling,s=parentElt(e);if(s){for(insertNodesBefore(s,e,t,r),o==null?a=s.firstChild:a=o.nextSibling,r.elts=r.elts.filter(function(l){return l!==e});a&&a!==e;)a instanceof Element&&r.elts.push(a),a=a.nextSibling;cleanUpElement(e),e.remove()}}function swapAfterBegin(e,t,r){return insertNodesBefore(e,e.firstChild,t,r)}function swapBeforeBegin(e,t,r){return insertNodesBefore(parentElt(e),e,t,r)}function swapBeforeEnd(e,t,r){return insertNodesBefore(e,null,t,r)}function swapAfterEnd(e,t,r){return insertNodesBefore(parentElt(e),e.nextSibling,t,r)}function swapDelete(e){cleanUpElement(e);let t=parentElt(e);if(t)return t.removeChild(e)}function swapInnerHTML(e,t,r){let a=e.firstChild;if(insertNodesBefore(e,a,t,r),a){for(;a.nextSibling;)cleanUpElement(a.nextSibling),e.removeChild(a.nextSibling);cleanUpElement(a),e.removeChild(a)}}function swapWithStyle(e,t,r,a,o){switch(e){case"none":return;case"outerHTML":swapOuterHTML(r,a,o);return;case"afterbegin":swapAfterBegin(r,a,o);return;case"beforebegin":swapBeforeBegin(r,a,o);return;case"beforeend":swapBeforeEnd(r,a,o);return;case"afterend":swapAfterEnd(r,a,o);return;case"delete":swapDelete(r);return;default:var s=getExtensions(t);for(let l=0;l<s.length;l++){let f=s[l];try{let n=f.handleSwap(e,r,a,o);if(n){if(Array.isArray(n))for(let u=0;u<n.length;u++){let c=n[u];c.nodeType!==Node.TEXT_NODE&&c.nodeType!==Node.COMMENT_NODE&&o.tasks.push(makeAjaxLoadTask(c))}return}}catch(n){logError(n)}}e==="innerHTML"?swapInnerHTML(r,a,o):swapWithStyle(htmx.config.defaultSwapStyle,t,r,a,o)}}function findAndSwapOobElements(e,t,r){var a=findAll(e,"[hx-swap-oob], [data-hx-swap-oob]");return forEach(a,function(o){if(htmx.config.allowNestedOobSwaps||o.parentElement===null){let s=getAttributeValue(o,"hx-swap-oob");s!=null&&oobSwap(s,o,t,r)}else o.removeAttribute("hx-swap-oob"),o.removeAttribute("data-hx-swap-oob")}),a.length>0}function swap(e,t,r,a){a||(a={});let o=null,s=null,l=function(){maybeCall(a.beforeSwapCallback),e=resolveTarget(e);let u=a.contextElement?getRootNode(a.contextElement,!1):getDocument(),c=document.activeElement,i={};i={elt:c,start:c?c.selectionStart:null,end:c?c.selectionEnd:null};let d=makeSettleInfo(e);if(r.swapStyle==="textContent")e.textContent=t;else{let m=makeFragment(t);if(d.title=a.title||m.title,a.historyRequest&&(m=m.querySelector("[hx-history-elt],[data-hx-history-elt]")||m),a.selectOOB){let C=a.selectOOB.split(",");for(let p=0;p<C.length;p++){let w=C[p].split(":",2),y=w[0].trim();y.indexOf("#")===0&&(y=y.substring(1));let g=w[1]||"true",x=m.querySelector("#"+y);x&&oobSwap(g,x,d,u)}}if(findAndSwapOobElements(m,d,u),forEach(findAll(m,"template"),function(C){C.content&&findAndSwapOobElements(C.content,d,u)&&C.remove()}),a.select){let C=getDocument().createDocumentFragment();forEach(m.querySelectorAll(a.select),function(p){C.appendChild(p)}),m=C}handlePreservedElements(m),swapWithStyle(r.swapStyle,a.contextElement,e,m,d),restorePreservedElements()}if(i.elt&&!bodyContains(i.elt)&&getRawAttribute(i.elt,"id")){let m=document.getElementById(getRawAttribute(i.elt,"id")),C={preventScroll:r.focusScroll!==void 0?!r.focusScroll:!htmx.config.defaultFocusScroll};if(m){if(i.start&&m.setSelectionRange)try{m.setSelectionRange(i.start,i.end)}catch{}m.focus(C)}}e.classList.remove(htmx.config.swappingClass),forEach(d.elts,function(m){m.classList&&m.classList.add(htmx.config.settlingClass),triggerEvent(m,"htmx:afterSwap",a.eventInfo)}),maybeCall(a.afterSwapCallback),r.ignoreTitle||handleTitle(d.title);let S=function(){if(forEach(d.tasks,function(m){m.call()}),forEach(d.elts,function(m){m.classList&&m.classList.remove(htmx.config.settlingClass),triggerEvent(m,"htmx:afterSettle",a.eventInfo)}),a.anchor){let m=asElement(resolveTarget("#"+a.anchor));m&&m.scrollIntoView({block:"start",behavior:"auto"})}updateScrollState(d.elts,r),maybeCall(a.afterSettleCallback),maybeCall(o)};r.settleDelay>0?getWindow().setTimeout(S,r.settleDelay):S()},f=htmx.config.globalViewTransitions;r.hasOwnProperty("transition")&&(f=r.transition);let n=a.contextElement||getDocument();if(f&&triggerEvent(n,"htmx:beforeTransition",a.eventInfo)&&typeof Promise<"u"&&document.startViewTransition){let u=new Promise(function(i,d){o=i,s=d}),c=l;l=function(){document.startViewTransition(function(){return c(),u})}}try{r?.swapDelay&&r.swapDelay>0?getWindow().setTimeout(l,r.swapDelay):l()}catch(u){throw triggerErrorEvent(n,"htmx:swapError",a.eventInfo),maybeCall(s),u}}function handleTriggerHeader(e,t,r){let a=e.getResponseHeader(t);if(a.indexOf("{")===0){let o=parseJSON(a);for(let s in o)if(o.hasOwnProperty(s)){let l=o[s];isRawObject(l)?r=l.target!==void 0?l.target:r:l={value:l},triggerEvent(r,s,l)}}else{let o=a.split(",");for(let s=0;s<o.length;s++)triggerEvent(r,o[s].trim(),[])}}let WHITESPACE=/\s/,WHITESPACE_OR_COMMA=/[\s,]/,SYMBOL_START=/[_$a-zA-Z]/,SYMBOL_CONT=/[_$a-zA-Z0-9]/,STRINGISH_START=['"',"'","/"],NOT_WHITESPACE=/[^\s]/,COMBINED_SELECTOR_START=/[{(]/,COMBINED_SELECTOR_END=/[})]/;function tokenizeString(e){let t=[],r=0;for(;r<e.length;){if(SYMBOL_START.exec(e.charAt(r))){for(var a=r;SYMBOL_CONT.exec(e.charAt(r+1));)r++;t.push(e.substring(a,r+1))}else if(STRINGISH_START.indexOf(e.charAt(r))!==-1){let o=e.charAt(r);var a=r;for(r++;r<e.length&&e.charAt(r)!==o;)e.charAt(r)==="\\"&&r++,r++;t.push(e.substring(a,r+1))}else{let o=e.charAt(r);t.push(o)}r++}return t}function isPossibleRelativeReference(e,t,r){return SYMBOL_START.exec(e.charAt(0))&&e!=="true"&&e!=="false"&&e!=="this"&&e!==r&&t!=="."}function maybeGenerateConditional(e,t,r){if(t[0]==="["){t.shift();let a=1,o=" return (function("+r+"){ return (",s=null;for(;t.length>0;){let l=t[0];if(l==="]"){if(a--,a===0){s===null&&(o=o+"true"),t.shift(),o+=")})";try{let f=maybeEval(e,function(){return Function(o)()},function(){return!0});return f.source=o,f}catch(f){return triggerErrorEvent(getDocument().body,"htmx:syntax:error",{error:f,source:o}),null}}}else l==="["&&a++;isPossibleRelativeReference(l,s,r)?o+="(("+r+"."+l+") ? ("+r+"."+l+") : (window."+l+"))":o=o+l,s=t.shift()}}}function consumeUntil(e,t){let r="";for(;e.length>0&&!t.test(e[0]);)r+=e.shift();return r}function consumeCSSSelector(e){let t;return e.length>0&&COMBINED_SELECTOR_START.test(e[0])?(e.shift(),t=consumeUntil(e,COMBINED_SELECTOR_END).trim(),e.shift()):t=consumeUntil(e,WHITESPACE_OR_COMMA),t}let INPUT_SELECTOR="input, textarea, select";function parseAndCacheTrigger(e,t,r){let a=[],o=tokenizeString(t);do{consumeUntil(o,NOT_WHITESPACE);let f=o.length,n=consumeUntil(o,/[,\[\s]/);if(n!=="")if(n==="every"){let u={trigger:"every"};consumeUntil(o,NOT_WHITESPACE),u.pollInterval=parseInterval(consumeUntil(o,/[,\[\s]/)),consumeUntil(o,NOT_WHITESPACE);var s=maybeGenerateConditional(e,o,"event");s&&(u.eventFilter=s),a.push(u)}else{let u={trigger:n};var s=maybeGenerateConditional(e,o,"event");for(s&&(u.eventFilter=s),consumeUntil(o,NOT_WHITESPACE);o.length>0&&o[0]!==",";){let i=o.shift();if(i==="changed")u.changed=!0;else if(i==="once")u.once=!0;else if(i==="consume")u.consume=!0;else if(i==="delay"&&o[0]===":")o.shift(),u.delay=parseInterval(consumeUntil(o,WHITESPACE_OR_COMMA));else if(i==="from"&&o[0]===":"){if(o.shift(),COMBINED_SELECTOR_START.test(o[0]))var l=consumeCSSSelector(o);else{var l=consumeUntil(o,WHITESPACE_OR_COMMA);if(l==="closest"||l==="find"||l==="next"||l==="previous"){o.shift();let S=consumeCSSSelector(o);S.length>0&&(l+=" "+S)}}u.from=l}else i==="target"&&o[0]===":"?(o.shift(),u.target=consumeCSSSelector(o)):i==="throttle"&&o[0]===":"?(o.shift(),u.throttle=parseInterval(consumeUntil(o,WHITESPACE_OR_COMMA))):i==="queue"&&o[0]===":"?(o.shift(),u.queue=consumeUntil(o,WHITESPACE_OR_COMMA)):i==="root"&&o[0]===":"?(o.shift(),u[i]=consumeCSSSelector(o)):i==="threshold"&&o[0]===":"?(o.shift(),u[i]=consumeUntil(o,WHITESPACE_OR_COMMA)):triggerErrorEvent(e,"htmx:syntax:error",{token:o.shift()});consumeUntil(o,NOT_WHITESPACE)}a.push(u)}o.length===f&&triggerErrorEvent(e,"htmx:syntax:error",{token:o.shift()}),consumeUntil(o,NOT_WHITESPACE)}while(o[0]===","&&o.shift());return r&&(r[t]=a),a}function getTriggerSpecs(e){let t=getAttributeValue(e,"hx-trigger"),r=[];if(t){let a=htmx.config.triggerSpecsCache;r=a&&a[t]||parseAndCacheTrigger(e,t,a)}return r.length>0?r:matches(e,"form")?[{trigger:"submit"}]:matches(e,'input[type="button"], input[type="submit"]')?[{trigger:"click"}]:matches(e,INPUT_SELECTOR)?[{trigger:"change"}]:[{trigger:"click"}]}function cancelPolling(e){getInternalData(e).cancelled=!0}function processPolling(e,t,r){let a=getInternalData(e);a.timeout=getWindow().setTimeout(function(){bodyContains(e)&&a.cancelled!==!0&&(maybeFilterEvent(r,e,makeEvent("hx:poll:trigger",{triggerSpec:r,target:e}))||t(e),processPolling(e,t,r))},r.pollInterval)}function isLocalLink(e){return location.hostname===e.hostname&&getRawAttribute(e,"href")&&getRawAttribute(e,"href").indexOf("#")!==0}function eltIsDisabled(e){return closest(e,htmx.config.disableSelector)}function boostElement(e,t,r){if(e instanceof HTMLAnchorElement&&isLocalLink(e)&&(e.target===""||e.target==="_self")||e.tagName==="FORM"&&String(getRawAttribute(e,"method")).toLowerCase()!=="dialog"){t.boosted=!0;let a,o;if(e.tagName==="A")a="get",o=getRawAttribute(e,"href");else{let s=getRawAttribute(e,"method");a=s?s.toLowerCase():"get",o=getRawAttribute(e,"action"),(o==null||o==="")&&(o=location.href),a==="get"&&o.includes("?")&&(o=o.replace(/\?[^#]+/,""))}r.forEach(function(s){addEventListener(e,function(l,f){let n=asElement(l);if(eltIsDisabled(n)){cleanUpElement(n);return}issueAjaxRequest(a,o,n,f)},t,s,!0)})}}function shouldCancel(e,t){if(e.type==="submit"&&t.tagName==="FORM")return!0;if(e.type==="click"){let r=t.closest('input[type="submit"], button');if(r&&r.form&&r.type==="submit")return!0;let a=t.closest("a"),o=/^#.+/;if(a&&a.href&&!o.test(a.getAttribute("href")))return!0}return!1}function ignoreBoostedAnchorCtrlClick(e,t){return getInternalData(e).boosted&&e instanceof HTMLAnchorElement&&t.type==="click"&&(t.ctrlKey||t.metaKey)}function maybeFilterEvent(e,t,r){let a=e.eventFilter;if(a)try{return a.call(t,r)!==!0}catch(o){let s=a.source;return triggerErrorEvent(getDocument().body,"htmx:eventFilter:error",{error:o,source:s}),!0}return!1}function addEventListener(e,t,r,a,o){let s=getInternalData(e),l;a.from?l=querySelectorAllExt(e,a.from):l=[e],a.changed&&("lastValue"in s||(s.lastValue=new WeakMap),l.forEach(function(f){s.lastValue.has(a)||s.lastValue.set(a,new WeakMap),s.lastValue.get(a).set(f,f.value)})),forEach(l,function(f){let n=function(u){if(!bodyContains(e)){f.removeEventListener(a.trigger,n);return}if(ignoreBoostedAnchorCtrlClick(e,u)||((o||shouldCancel(u,f))&&u.preventDefault(),maybeFilterEvent(a,e,u)))return;let c=getInternalData(u);if(c.triggerSpec=a,c.handledFor==null&&(c.handledFor=[]),c.handledFor.indexOf(e)<0){if(c.handledFor.push(e),a.consume&&u.stopPropagation(),a.target&&u.target&&!matches(asElement(u.target),a.target))return;if(a.once){if(s.triggeredOnce)return;s.triggeredOnce=!0}if(a.changed){let i=u.target,d=i.value,S=s.lastValue.get(a);if(S.has(i)&&S.get(i)===d)return;S.set(i,d)}if(s.delayed&&clearTimeout(s.delayed),s.throttle)return;a.throttle>0?s.throttle||(triggerEvent(e,"htmx:trigger"),t(e,u),s.throttle=getWindow().setTimeout(function(){s.throttle=null},a.throttle)):a.delay>0?s.delayed=getWindow().setTimeout(function(){triggerEvent(e,"htmx:trigger"),t(e,u)},a.delay):(triggerEvent(e,"htmx:trigger"),t(e,u))}};r.listenerInfos==null&&(r.listenerInfos=[]),r.listenerInfos.push({trigger:a.trigger,listener:n,on:f}),f.addEventListener(a.trigger,n)})}let windowIsScrolling=!1,scrollHandler=null;function initScrollHandler(){scrollHandler||(scrollHandler=function(){windowIsScrolling=!0},window.addEventListener("scroll",scrollHandler),window.addEventListener("resize",scrollHandler),setInterval(function(){windowIsScrolling&&(windowIsScrolling=!1,forEach(getDocument().querySelectorAll("[hx-trigger*='revealed'],[data-hx-trigger*='revealed']"),function(e){maybeReveal(e)}))},200))}function maybeReveal(e){!hasAttribute(e,"data-hx-revealed")&&isScrolledIntoView(e)&&(e.setAttribute("data-hx-revealed","true"),getInternalData(e).initHash?triggerEvent(e,"revealed"):e.addEventListener("htmx:afterProcessNode",function(){triggerEvent(e,"revealed")},{once:!0}))}function loadImmediately(e,t,r,a){let o=function(){r.loaded||(r.loaded=!0,triggerEvent(e,"htmx:trigger"),t(e))};a>0?getWindow().setTimeout(o,a):o()}function processVerbs(e,t,r){let a=!1;return forEach(VERBS,function(o){if(hasAttribute(e,"hx-"+o)){let s=getAttributeValue(e,"hx-"+o);a=!0,t.path=s,t.verb=o,r.forEach(function(l){addTriggerHandler(e,l,t,function(f,n){let u=asElement(f);if(eltIsDisabled(u)){cleanUpElement(u);return}issueAjaxRequest(o,s,u,n)})})}}),a}function addTriggerHandler(e,t,r,a){if(t.trigger==="revealed")initScrollHandler(),addEventListener(e,a,r,t),maybeReveal(asElement(e));else if(t.trigger==="intersect"){let o={};t.root&&(o.root=querySelectorExt(e,t.root)),t.threshold&&(o.threshold=parseFloat(t.threshold)),new IntersectionObserver(function(l){for(let f=0;f<l.length;f++)if(l[f].isIntersecting){triggerEvent(e,"intersect");break}},o).observe(asElement(e)),addEventListener(asElement(e),a,r,t)}else!r.firstInitCompleted&&t.trigger==="load"?maybeFilterEvent(t,e,makeEvent("load",{elt:e}))||loadImmediately(asElement(e),a,r,t.delay):t.pollInterval>0?(r.polling=!0,processPolling(asElement(e),a,t)):addEventListener(e,a,r,t)}function shouldProcessHxOn(e){let t=asElement(e);if(!t)return!1;let r=t.attributes;for(let a=0;a<r.length;a++){let o=r[a].name;if(startsWith(o,"hx-on:")||startsWith(o,"data-hx-on:")||startsWith(o,"hx-on-")||startsWith(o,"data-hx-on-"))return!0}return!1}let HX_ON_QUERY=new XPathEvaluator().createExpression('.//*[@*[ starts-with(name(), "hx-on:") or starts-with(name(), "data-hx-on:") or starts-with(name(), "hx-on-") or starts-with(name(), "data-hx-on-") ]]');function processHXOnRoot(e,t){shouldProcessHxOn(e)&&t.push(asElement(e));let r=HX_ON_QUERY.evaluate(e),a=null;for(;a=r.iterateNext();)t.push(asElement(a))}function findHxOnWildcardElements(e){let t=[];if(e instanceof DocumentFragment)for(let r of e.childNodes)processHXOnRoot(r,t);else processHXOnRoot(e,t);return t}function findElementsToProcess(e){if(e.querySelectorAll){let r=", [hx-boost] a, [data-hx-boost] a, a[hx-boost], a[data-hx-boost]",a=[];for(let s in extensions){let l=extensions[s];if(l.getSelectors){var t=l.getSelectors();t&&a.push(t)}}return e.querySelectorAll(VERB_SELECTOR+r+", form, [type='submit'], [hx-ext], [data-hx-ext], [hx-trigger], [data-hx-trigger]"+a.flat().map(s=>", "+s).join(""))}else return[]}function maybeSetLastButtonClicked(e){let t=getTargetButton(e.target),r=getRelatedFormData(e);r&&(r.lastButtonClicked=t)}function maybeUnsetLastButtonClicked(e){let t=getRelatedFormData(e);t&&(t.lastButtonClicked=null)}function getTargetButton(e){return closest(asElement(e),"button, input[type='submit']")}function getRelatedForm(e){return e.form||closest(e,"form")}function getRelatedFormData(e){let t=getTargetButton(e.target);if(!t)return;let r=getRelatedForm(t);if(r)return getInternalData(r)}function initButtonTracking(e){e.addEventListener("click",maybeSetLastButtonClicked),e.addEventListener("focusin",maybeSetLastButtonClicked),e.addEventListener("focusout",maybeUnsetLastButtonClicked)}function addHxOnEventHandler(e,t,r){let a=getInternalData(e);Array.isArray(a.onHandlers)||(a.onHandlers=[]);let o,s=function(l){maybeEval(e,function(){eltIsDisabled(e)||(o||(o=new Function("event",r)),o.call(e,l))})};e.addEventListener(t,s),a.onHandlers.push({event:t,listener:s})}function processHxOnWildcard(e){deInitOnHandlers(e);for(let t=0;t<e.attributes.length;t++){let r=e.attributes[t].name,a=e.attributes[t].value;if(startsWith(r,"hx-on")||startsWith(r,"data-hx-on")){let o=r.indexOf("-on")+3,s=r.slice(o,o+1);if(s==="-"||s===":"){let l=r.slice(o+1);startsWith(l,":")?l="htmx"+l:startsWith(l,"-")?l="htmx:"+l.slice(1):startsWith(l,"htmx-")&&(l="htmx:"+l.slice(5)),addHxOnEventHandler(e,l,a)}}}}function initNode(e){triggerEvent(e,"htmx:beforeProcessNode");let t=getInternalData(e),r=getTriggerSpecs(e);processVerbs(e,t,r)||(getClosestAttributeValue(e,"hx-boost")==="true"?boostElement(e,t,r):hasAttribute(e,"hx-trigger")&&r.forEach(function(o){addTriggerHandler(e,o,t,function(){})})),(e.tagName==="FORM"||getRawAttribute(e,"type")==="submit"&&hasAttribute(e,"form"))&&initButtonTracking(e),t.firstInitCompleted=!0,triggerEvent(e,"htmx:afterProcessNode")}function maybeDeInitAndHash(e){if(!(e instanceof Element))return!1;let t=getInternalData(e),r=attributeHash(e);return t.initHash!==r?(deInitNode(e),t.initHash=r,!0):!1}function processNode(e){if(e=resolveTarget(e),eltIsDisabled(e)){cleanUpElement(e);return}let t=[];maybeDeInitAndHash(e)&&t.push(e),forEach(findElementsToProcess(e),function(r){if(eltIsDisabled(r)){cleanUpElement(r);return}maybeDeInitAndHash(r)&&t.push(r)}),forEach(findHxOnWildcardElements(e),processHxOnWildcard),forEach(t,initNode)}function kebabEventName(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function makeEvent(e,t){return new CustomEvent(e,{bubbles:!0,cancelable:!0,composed:!0,detail:t})}function triggerErrorEvent(e,t,r){triggerEvent(e,t,mergeObjects({error:t},r))}function ignoreEventForLogging(e){return e==="htmx:afterProcessNode"}function withExtensions(e,t,r){forEach(getExtensions(e,[],r),function(a){try{t(a)}catch(o){logError(o)}})}function logError(e){console.error(e)}function triggerEvent(e,t,r){e=resolveTarget(e),r==null&&(r={}),r.elt=e;let a=makeEvent(t,r);htmx.logger&&!ignoreEventForLogging(t)&&htmx.logger(e,t,r),r.error&&(logError(r.error),triggerEvent(e,"htmx:error",{errorInfo:r}));let o=e.dispatchEvent(a),s=kebabEventName(t);if(o&&s!==t){let l=makeEvent(s,a.detail);o=o&&e.dispatchEvent(l)}return withExtensions(asElement(e),function(l){o=o&&l.onEvent(t,a)!==!1&&!a.defaultPrevented}),o}let currentPathForHistory;function setCurrentPathForHistory(e){currentPathForHistory=e,canAccessLocalStorage()&&sessionStorage.setItem("htmx-current-path-for-history",e)}setCurrentPathForHistory(location.pathname+location.search);function getHistoryElement(){return getDocument().querySelector("[hx-history-elt],[data-hx-history-elt]")||getDocument().body}function saveToHistoryCache(e,t){if(!canAccessLocalStorage())return;let r=cleanInnerHtmlForHistory(t),a=getDocument().title,o=window.scrollY;if(htmx.config.historyCacheSize<=0){sessionStorage.removeItem("htmx-history-cache");return}e=normalizePath(e);let s=parseJSON(sessionStorage.getItem("htmx-history-cache"))||[];for(let f=0;f<s.length;f++)if(s[f].url===e){s.splice(f,1);break}let l={url:e,content:r,title:a,scroll:o};for(triggerEvent(getDocument().body,"htmx:historyItemCreated",{item:l,cache:s}),s.push(l);s.length>htmx.config.historyCacheSize;)s.shift();for(;s.length>0;)try{sessionStorage.setItem("htmx-history-cache",JSON.stringify(s));break}catch(f){triggerErrorEvent(getDocument().body,"htmx:historyCacheError",{cause:f,cache:s}),s.shift()}}function getCachedHistory(e){if(!canAccessLocalStorage())return null;e=normalizePath(e);let t=parseJSON(sessionStorage.getItem("htmx-history-cache"))||[];for(let r=0;r<t.length;r++)if(t[r].url===e)return t[r];return null}function cleanInnerHtmlForHistory(e){let t=htmx.config.requestClass,r=e.cloneNode(!0);return forEach(findAll(r,"."+t),function(a){removeClassFromElement(a,t)}),forEach(findAll(r,"[data-disabled-by-htmx]"),function(a){a.removeAttribute("disabled")}),r.innerHTML}function saveCurrentPageToHistory(){let e=getHistoryElement(),t=currentPathForHistory;canAccessLocalStorage()&&(t=sessionStorage.getItem("htmx-current-path-for-history")),t=t||location.pathname+location.search,getDocument().querySelector('[hx-history="false" i],[data-hx-history="false" i]')||(triggerEvent(getDocument().body,"htmx:beforeHistorySave",{path:t,historyElt:e}),saveToHistoryCache(t,e)),htmx.config.historyEnabled&&history.replaceState({htmx:!0},getDocument().title,location.href)}function pushUrlIntoHistory(e){htmx.config.getCacheBusterParam&&(e=e.replace(/org\.htmx\.cache-buster=[^&]*&?/,""),(endsWith(e,"&")||endsWith(e,"?"))&&(e=e.slice(0,-1))),htmx.config.historyEnabled&&history.pushState({htmx:!0},"",e),setCurrentPathForHistory(e)}function replaceUrlInHistory(e){htmx.config.historyEnabled&&history.replaceState({htmx:!0},"",e),setCurrentPathForHistory(e)}function settleImmediately(e){forEach(e,function(t){t.call(void 0)})}function loadHistoryFromServer(e){let t=new XMLHttpRequest,r={swapStyle:"innerHTML",swapDelay:0,settleDelay:0},a={path:e,xhr:t,historyElt:getHistoryElement(),swapSpec:r};t.open("GET",e,!0),htmx.config.historyRestoreAsHxRequest&&t.setRequestHeader("HX-Request","true"),t.setRequestHeader("HX-History-Restore-Request","true"),t.setRequestHeader("HX-Current-URL",location.href),t.onload=function(){this.status>=200&&this.status<400?(a.response=this.response,triggerEvent(getDocument().body,"htmx:historyCacheMissLoad",a),swap(a.historyElt,a.response,r,{contextElement:a.historyElt,historyRequest:!0}),setCurrentPathForHistory(a.path),triggerEvent(getDocument().body,"htmx:historyRestore",{path:e,cacheMiss:!0,serverResponse:a.response})):triggerErrorEvent(getDocument().body,"htmx:historyCacheMissLoadError",a)},triggerEvent(getDocument().body,"htmx:historyCacheMiss",a)&&t.send()}function restoreHistory(e){saveCurrentPageToHistory(),e=e||location.pathname+location.search;let t=getCachedHistory(e);if(t){let r={swapStyle:"innerHTML",swapDelay:0,settleDelay:0,scroll:t.scroll},a={path:e,item:t,historyElt:getHistoryElement(),swapSpec:r};triggerEvent(getDocument().body,"htmx:historyCacheHit",a)&&(swap(a.historyElt,t.content,r,{contextElement:a.historyElt,title:t.title}),setCurrentPathForHistory(a.path),triggerEvent(getDocument().body,"htmx:historyRestore",a))}else htmx.config.refreshOnHistoryMiss?htmx.location.reload(!0):loadHistoryFromServer(e)}function addRequestIndicatorClasses(e){let t=findAttributeTargets(e,"hx-indicator");return t==null&&(t=[e]),forEach(t,function(r){let a=getInternalData(r);a.requestCount=(a.requestCount||0)+1,r.classList.add.call(r.classList,htmx.config.requestClass)}),t}function disableElements(e){let t=findAttributeTargets(e,"hx-disabled-elt");return t==null&&(t=[]),forEach(t,function(r){let a=getInternalData(r);a.requestCount=(a.requestCount||0)+1,r.setAttribute("disabled",""),r.setAttribute("data-disabled-by-htmx","")}),t}function removeRequestIndicators(e,t){forEach(e.concat(t),function(r){let a=getInternalData(r);a.requestCount=(a.requestCount||1)-1}),forEach(e,function(r){getInternalData(r).requestCount===0&&r.classList.remove.call(r.classList,htmx.config.requestClass)}),forEach(t,function(r){getInternalData(r).requestCount===0&&(r.removeAttribute("disabled"),r.removeAttribute("data-disabled-by-htmx"))})}function haveSeenNode(e,t){for(let r=0;r<e.length;r++)if(e[r].isSameNode(t))return!0;return!1}function shouldInclude(e){let t=e;return t.name===""||t.name==null||t.disabled||closest(t,"fieldset[disabled]")||t.type==="button"||t.type==="submit"||t.tagName==="image"||t.tagName==="reset"||t.tagName==="file"?!1:t.type==="checkbox"||t.type==="radio"?t.checked:!0}function addValueToFormData(e,t,r){e!=null&&t!=null&&(Array.isArray(t)?t.forEach(function(a){r.append(e,a)}):r.append(e,t))}function removeValueFromFormData(e,t,r){if(e!=null&&t!=null){let a=r.getAll(e);Array.isArray(t)?a=a.filter(o=>t.indexOf(o)<0):a=a.filter(o=>o!==t),r.delete(e),forEach(a,o=>r.append(e,o))}}function getValueFromInput(e){return e instanceof HTMLSelectElement&&e.multiple?toArray(e.querySelectorAll("option:checked")).map(function(t){return t.value}):e instanceof HTMLInputElement&&e.files?toArray(e.files):e.value}function processInputValue(e,t,r,a,o){if(!(a==null||haveSeenNode(e,a))){if(e.push(a),shouldInclude(a)){let s=getRawAttribute(a,"name");addValueToFormData(s,getValueFromInput(a),t),o&&validateElement(a,r)}a instanceof HTMLFormElement&&(forEach(a.elements,function(s){e.indexOf(s)>=0?removeValueFromFormData(s.name,getValueFromInput(s),t):e.push(s),o&&validateElement(s,r)}),new FormData(a).forEach(function(s,l){s instanceof File&&s.name===""||addValueToFormData(l,s,t)}))}}function validateElement(e,t){let r=e;r.willValidate&&(triggerEvent(r,"htmx:validation:validate"),r.checkValidity()||(triggerEvent(r,"htmx:validation:failed",{message:r.validationMessage,validity:r.validity})&&!t.length&&htmx.config.reportValidityOfForms&&r.reportValidity(),t.push({elt:r,message:r.validationMessage,validity:r.validity})))}function overrideFormData(e,t){for(let r of t.keys())e.delete(r);return t.forEach(function(r,a){e.append(a,r)}),e}function getInputValues(e,t){let r=[],a=new FormData,o=new FormData,s=[],l=getInternalData(e);l.lastButtonClicked&&!bodyContains(l.lastButtonClicked)&&(l.lastButtonClicked=null);let f=e instanceof HTMLFormElement&&e.noValidate!==!0||getAttributeValue(e,"hx-validate")==="true";if(l.lastButtonClicked&&(f=f&&l.lastButtonClicked.formNoValidate!==!0),t!=="get"&&processInputValue(r,o,s,getRelatedForm(e),f),processInputValue(r,a,s,e,f),l.lastButtonClicked||e.tagName==="BUTTON"||e.tagName==="INPUT"&&getRawAttribute(e,"type")==="submit"){let u=l.lastButtonClicked||e,c=getRawAttribute(u,"name");addValueToFormData(c,u.value,o)}let n=findAttributeTargets(e,"hx-include");return forEach(n,function(u){processInputValue(r,a,s,asElement(u),f),matches(u,"form")||forEach(asParentNode(u).querySelectorAll(INPUT_SELECTOR),function(c){processInputValue(r,a,s,c,f)})}),overrideFormData(a,o),{errors:s,formData:a,values:formDataProxy(a)}}function appendParam(e,t,r){e!==""&&(e+="&"),String(r)==="[object Object]"&&(r=JSON.stringify(r));let a=encodeURIComponent(r);return e+=encodeURIComponent(t)+"="+a,e}function urlEncode(e){e=formDataFromObject(e);let t="";return e.forEach(function(r,a){t=appendParam(t,a,r)}),t}function getHeaders(e,t,r){let a={"HX-Request":"true","HX-Trigger":getRawAttribute(e,"id"),"HX-Trigger-Name":getRawAttribute(e,"name"),"HX-Target":getAttributeValue(t,"id"),"HX-Current-URL":location.href};return getValuesForElement(e,"hx-headers",!1,a),r!==void 0&&(a["HX-Prompt"]=r),getInternalData(e).boosted&&(a["HX-Boosted"]="true"),a}function filterValues(e,t){let r=getClosestAttributeValue(t,"hx-params");if(r){if(r==="none")return new FormData;if(r==="*")return e;if(r.indexOf("not ")===0)return forEach(r.slice(4).split(","),function(a){a=a.trim(),e.delete(a)}),e;{let a=new FormData;return forEach(r.split(","),function(o){o=o.trim(),e.has(o)&&e.getAll(o).forEach(function(s){a.append(o,s)})}),a}}else return e}function isAnchorLink(e){return!!getRawAttribute(e,"href")&&getRawAttribute(e,"href").indexOf("#")>=0}function getSwapSpecification(e,t){let r=t||getClosestAttributeValue(e,"hx-swap"),a={swapStyle:getInternalData(e).boosted?"innerHTML":htmx.config.defaultSwapStyle,swapDelay:htmx.config.defaultSwapDelay,settleDelay:htmx.config.defaultSettleDelay};if(htmx.config.scrollIntoViewOnBoost&&getInternalData(e).boosted&&!isAnchorLink(e)&&(a.show="top"),r){let l=splitOnWhitespace(r);if(l.length>0)for(let f=0;f<l.length;f++){let n=l[f];if(n.indexOf("swap:")===0)a.swapDelay=parseInterval(n.slice(5));else if(n.indexOf("settle:")===0)a.settleDelay=parseInterval(n.slice(7));else if(n.indexOf("transition:")===0)a.transition=n.slice(11)==="true";else if(n.indexOf("ignoreTitle:")===0)a.ignoreTitle=n.slice(12)==="true";else if(n.indexOf("scroll:")===0){var o=n.slice(7).split(":");let c=o.pop();var s=o.length>0?o.join(":"):null;a.scroll=c,a.scrollTarget=s}else if(n.indexOf("show:")===0){var o=n.slice(5).split(":");let i=o.pop();var s=o.length>0?o.join(":"):null;a.show=i,a.showTarget=s}else if(n.indexOf("focus-scroll:")===0){let u=n.slice(13);a.focusScroll=u=="true"}else f==0?a.swapStyle=n:logError("Unknown modifier in hx-swap: "+n)}}return a}function usesFormData(e){return getClosestAttributeValue(e,"hx-encoding")==="multipart/form-data"||matches(e,"form")&&getRawAttribute(e,"enctype")==="multipart/form-data"}function encodeParamsForBody(e,t,r){let a=null;return withExtensions(t,function(o){a==null&&(a=o.encodeParameters(e,r,t))}),a??(usesFormData(t)?overrideFormData(new FormData,formDataFromObject(r)):urlEncode(r))}function makeSettleInfo(e){return{tasks:[],elts:[e]}}function updateScrollState(e,t){let r=e[0],a=e[e.length-1];if(t.scroll){var o=null;t.scrollTarget&&(o=asElement(querySelectorExt(r,t.scrollTarget))),t.scroll==="top"&&(r||o)&&(o=o||r,o.scrollTop=0),t.scroll==="bottom"&&(a||o)&&(o=o||a,o.scrollTop=o.scrollHeight),typeof t.scroll=="number"&&getWindow().setTimeout(function(){window.scrollTo(0,t.scroll)},0)}if(t.show){var o=null;if(t.showTarget){let l=t.showTarget;t.showTarget==="window"&&(l="body"),o=asElement(querySelectorExt(r,l))}t.show==="top"&&(r||o)&&(o=o||r,o.scrollIntoView({block:"start",behavior:htmx.config.scrollBehavior})),t.show==="bottom"&&(a||o)&&(o=o||a,o.scrollIntoView({block:"end",behavior:htmx.config.scrollBehavior}))}}function getValuesForElement(e,t,r,a,o){if(a==null&&(a={}),e==null)return a;let s=getAttributeValue(e,t);if(s){let l=s.trim(),f=r;if(l==="unset")return null;l.indexOf("javascript:")===0?(l=l.slice(11),f=!0):l.indexOf("js:")===0&&(l=l.slice(3),f=!0),l.indexOf("{")!==0&&(l="{"+l+"}");let n;f?n=maybeEval(e,function(){return o?Function("event","return ("+l+")").call(e,o):Function("return ("+l+")").call(e)},{}):n=parseJSON(l);for(let u in n)n.hasOwnProperty(u)&&a[u]==null&&(a[u]=n[u])}return getValuesForElement(asElement(parentElt(e)),t,r,a,o)}function maybeEval(e,t,r){return htmx.config.allowEval?t():(triggerErrorEvent(e,"htmx:evalDisallowedError"),r)}function getHXVarsForElement(e,t,r){return getValuesForElement(e,"hx-vars",!0,r,t)}function getHXValsForElement(e,t,r){return getValuesForElement(e,"hx-vals",!1,r,t)}function getExpressionVars(e,t){return mergeObjects(getHXVarsForElement(e,t),getHXValsForElement(e,t))}function safelySetHeaderValue(e,t,r){if(r!==null)try{e.setRequestHeader(t,r)}catch{e.setRequestHeader(t,encodeURIComponent(r)),e.setRequestHeader(t+"-URI-AutoEncoded","true")}}function getPathFromResponse(e){if(e.responseURL)try{let t=new URL(e.responseURL);return t.pathname+t.search}catch{triggerErrorEvent(getDocument().body,"htmx:badResponseUrl",{url:e.responseURL})}}function hasHeader(e,t){return t.test(e.getAllResponseHeaders())}function ajaxHelper(e,t,r){if(e=e.toLowerCase(),r){if(r instanceof Element||typeof r=="string")return issueAjaxRequest(e,t,null,null,{targetOverride:resolveTarget(r)||DUMMY_ELT,returnPromise:!0});{let a=resolveTarget(r.target);return(r.target&&!a||r.source&&!a&&!resolveTarget(r.source))&&(a=DUMMY_ELT),issueAjaxRequest(e,t,resolveTarget(r.source),r.event,{handler:r.handler,headers:r.headers,values:r.values,targetOverride:a,swapOverride:r.swap,select:r.select,returnPromise:!0,push:r.push,replace:r.replace,selectOOB:r.selectOOB})}}else return issueAjaxRequest(e,t,null,null,{returnPromise:!0})}function hierarchyForElt(e){let t=[];for(;e;)t.push(e),e=e.parentElement;return t}function verifyPath(e,t,r){let a=new URL(t,location.protocol!=="about:"?location.href:window.origin),s=(location.protocol!=="about:"?location.origin:window.origin)===a.origin;return htmx.config.selfRequestsOnly&&!s?!1:triggerEvent(e,"htmx:validateUrl",mergeObjects({url:a,sameHost:s},r))}function formDataFromObject(e){if(e instanceof FormData)return e;let t=new FormData;for(let r in e)e.hasOwnProperty(r)&&(e[r]&&typeof e[r].forEach=="function"?e[r].forEach(function(a){t.append(r,a)}):typeof e[r]=="object"&&!(e[r]instanceof Blob)?t.append(r,JSON.stringify(e[r])):t.append(r,e[r]));return t}function formDataArrayProxy(e,t,r){return new Proxy(r,{get:function(a,o){return typeof o=="number"?a[o]:o==="length"?a.length:o==="push"?function(s){a.push(s),e.append(t,s)}:typeof a[o]=="function"?function(){a[o].apply(a,arguments),e.delete(t),a.forEach(function(s){e.append(t,s)})}:a[o]&&a[o].length===1?a[o][0]:a[o]},set:function(a,o,s){return a[o]=s,e.delete(t),a.forEach(function(l){e.append(t,l)}),!0}})}function formDataProxy(e){return new Proxy(e,{get:function(t,r){if(typeof r=="symbol"){let o=Reflect.get(t,r);return typeof o=="function"?function(){return o.apply(e,arguments)}:o}if(r==="toJSON")return()=>Object.fromEntries(e);if(r in t&&typeof t[r]=="function")return function(){return e[r].apply(e,arguments)};let a=e.getAll(r);if(a.length!==0)return a.length===1?a[0]:formDataArrayProxy(t,r,a)},set:function(t,r,a){return typeof r!="string"?!1:(t.delete(r),a&&typeof a.forEach=="function"?a.forEach(function(o){t.append(r,o)}):typeof a=="object"&&!(a instanceof Blob)?t.append(r,JSON.stringify(a)):t.append(r,a),!0)},deleteProperty:function(t,r){return typeof r=="string"&&t.delete(r),!0},ownKeys:function(t){return Reflect.ownKeys(Object.fromEntries(t))},getOwnPropertyDescriptor:function(t,r){return Reflect.getOwnPropertyDescriptor(Object.fromEntries(t),r)}})}function issueAjaxRequest(e,t,r,a,o,s){let l=null,f=null;if(o=o??{},o.returnPromise&&typeof Promise<"u")var n=new Promise(function(h,E){l=h,f=E});r==null&&(r=getDocument().body);let u=o.handler||handleAjaxResponse,c=o.select||null;if(!bodyContains(r))return maybeCall(l),n;let i=o.targetOverride||asElement(getTarget(r));if(i==null||i==DUMMY_ELT)return triggerErrorEvent(r,"htmx:targetError",{target:getClosestAttributeValue(r,"hx-target")}),maybeCall(f),n;let d=getInternalData(r),S=d.lastButtonClicked;if(S){let h=getRawAttribute(S,"formaction");h!=null&&(t=h);let E=getRawAttribute(S,"formmethod");if(E!=null)if(VERBS.includes(E.toLowerCase()))e=E;else return maybeCall(l),n}let m=getClosestAttributeValue(r,"hx-confirm");if(s===void 0&&triggerEvent(r,"htmx:confirm",{target:i,elt:r,path:t,verb:e,triggeringEvent:a,etc:o,issueRequest:function(T){return issueAjaxRequest(e,t,r,a,o,!!T)},question:m})===!1)return maybeCall(l),n;let C=r,p=getClosestAttributeValue(r,"hx-sync"),w=null,y=!1;if(p){let h=p.split(":"),E=h[0].trim();if(E==="this"?C=findThisElement(r,"hx-sync"):C=asElement(querySelectorExt(r,E)),p=(h[1]||"drop").trim(),d=getInternalData(C),p==="drop"&&d.xhr&&d.abortable!==!0)return maybeCall(l),n;if(p==="abort"){if(d.xhr)return maybeCall(l),n;y=!0}else p==="replace"?triggerEvent(C,"htmx:abort"):p.indexOf("queue")===0&&(w=(p.split(" ")[1]||"last").trim())}if(d.xhr)if(d.abortable)triggerEvent(C,"htmx:abort");else{if(w==null){if(a){let h=getInternalData(a);h&&h.triggerSpec&&h.triggerSpec.queue&&(w=h.triggerSpec.queue)}w==null&&(w="last")}return d.queuedRequests==null&&(d.queuedRequests=[]),w==="first"&&d.queuedRequests.length===0?d.queuedRequests.push(function(){issueAjaxRequest(e,t,r,a,o)}):w==="all"?d.queuedRequests.push(function(){issueAjaxRequest(e,t,r,a,o)}):w==="last"&&(d.queuedRequests=[],d.queuedRequests.push(function(){issueAjaxRequest(e,t,r,a,o)})),maybeCall(l),n}let g=new XMLHttpRequest;d.xhr=g,d.abortable=y;let x=function(){d.xhr=null,d.abortable=!1,d.queuedRequests!=null&&d.queuedRequests.length>0&&d.queuedRequests.shift()()},Se=getClosestAttributeValue(r,"hx-prompt");if(Se){var U=prompt(Se);if(U===null||!triggerEvent(r,"htmx:prompt",{prompt:U,target:i}))return maybeCall(l),x(),n}if(m&&!s&&!confirm(m))return maybeCall(l),x(),n;let D=getHeaders(r,i,U);e!=="get"&&!usesFormData(r)&&(D["Content-Type"]="application/x-www-form-urlencoded"),o.headers&&(D=mergeObjects(D,o.headers));let ye=getInputValues(r,e),R=ye.errors,we=ye.formData;o.values&&overrideFormData(we,formDataFromObject(o.values));let Be=formDataFromObject(getExpressionVars(r,a)),V=overrideFormData(we,Be),k=filterValues(V,r);htmx.config.getCacheBusterParam&&e==="get"&&k.set("org.htmx.cache-buster",getRawAttribute(i,"id")||"true"),(t==null||t==="")&&(t=location.href);let N=getValuesForElement(r,"hx-request"),Ee=getInternalData(r).boosted,M=htmx.config.methodsThatUseUrlParams.indexOf(e)>=0,b={boosted:Ee,useUrlParams:M,formData:k,parameters:formDataProxy(k),unfilteredFormData:V,unfilteredParameters:formDataProxy(V),headers:D,elt:r,target:i,verb:e,errors:R,withCredentials:o.credentials||N.credentials||htmx.config.withCredentials,timeout:o.timeout||N.timeout||htmx.config.timeout,path:t,triggeringEvent:a};if(!triggerEvent(r,"htmx:configRequest",b))return maybeCall(l),x(),n;if(t=b.path,e=b.verb,D=b.headers,k=formDataFromObject(b.parameters),R=b.errors,M=b.useUrlParams,R&&R.length>0)return triggerEvent(r,"htmx:validation:halted",b),maybeCall(l),x(),n;let ve=t.split("#"),qe=ve[0],W=ve[1],A=t;if(M&&(A=qe,!k.keys().next().done&&(A.indexOf("?")<0?A+="?":A+="&",A+=urlEncode(k),W&&(A+="#"+W))),!verifyPath(r,A,b))return triggerErrorEvent(r,"htmx:invalidPath",b),maybeCall(f),x(),n;if(g.open(e.toUpperCase(),A,!0),g.overrideMimeType("text/html"),g.withCredentials=b.withCredentials,g.timeout=b.timeout,!N.noHeaders){for(let h in D)if(D.hasOwnProperty(h)){let E=D[h];safelySetHeaderValue(g,h,E)}}let v={xhr:g,target:i,requestConfig:b,etc:o,boosted:Ee,select:c,pathInfo:{requestPath:t,finalRequestPath:A,responsePath:null,anchor:W}};if(g.onload=function(){try{let h=hierarchyForElt(r);if(v.pathInfo.responsePath=getPathFromResponse(g),u(r,v),v.keepIndicators!==!0&&removeRequestIndicators(F,H),triggerEvent(r,"htmx:afterRequest",v),triggerEvent(r,"htmx:afterOnLoad",v),!bodyContains(r)){let E=null;for(;h.length>0&&E==null;){let T=h.shift();bodyContains(T)&&(E=T)}E&&(triggerEvent(E,"htmx:afterRequest",v),triggerEvent(E,"htmx:afterOnLoad",v))}maybeCall(l)}catch(h){throw triggerErrorEvent(r,"htmx:onLoadError",mergeObjects({error:h},v)),h}finally{x()}},g.onerror=function(){removeRequestIndicators(F,H),triggerErrorEvent(r,"htmx:afterRequest",v),triggerErrorEvent(r,"htmx:sendError",v),maybeCall(f),x()},g.onabort=function(){removeRequestIndicators(F,H),triggerErrorEvent(r,"htmx:afterRequest",v),triggerErrorEvent(r,"htmx:sendAbort",v),maybeCall(f),x()},g.ontimeout=function(){removeRequestIndicators(F,H),triggerErrorEvent(r,"htmx:afterRequest",v),triggerErrorEvent(r,"htmx:timeout",v),maybeCall(f),x()},!triggerEvent(r,"htmx:beforeRequest",v))return maybeCall(l),x(),n;var F=addRequestIndicatorClasses(r),H=disableElements(r);forEach(["loadstart","loadend","progress","abort"],function(h){forEach([g,g.upload],function(E){E.addEventListener(h,function(T){triggerEvent(r,"htmx:xhr:"+h,{lengthComputable:T.lengthComputable,loaded:T.loaded,total:T.total})})})}),triggerEvent(r,"htmx:beforeSend",v);let Oe=M?null:encodeParamsForBody(g,r,k);return g.send(Oe),n}function determineHistoryUpdates(e,t){let r=t.xhr,a=null,o=null;if(hasHeader(r,/HX-Push:/i)?(a=r.getResponseHeader("HX-Push"),o="push"):hasHeader(r,/HX-Push-Url:/i)?(a=r.getResponseHeader("HX-Push-Url"),o="push"):hasHeader(r,/HX-Replace-Url:/i)&&(a=r.getResponseHeader("HX-Replace-Url"),o="replace"),a)return a==="false"?{}:{type:o,path:a};let s=t.pathInfo.finalRequestPath,l=t.pathInfo.responsePath,f=t.etc.push||getClosestAttributeValue(e,"hx-push-url"),n=t.etc.replace||getClosestAttributeValue(e,"hx-replace-url"),u=getInternalData(e).boosted,c=null,i=null;return f?(c="push",i=f):n?(c="replace",i=n):u&&(c="push",i=l||s),i?i==="false"?{}:(i==="true"&&(i=l||s),t.pathInfo.anchor&&i.indexOf("#")===-1&&(i=i+"#"+t.pathInfo.anchor),{type:c,path:i}):{}}function codeMatches(e,t){var r=new RegExp(e.code);return r.test(t.toString(10))}function resolveResponseHandling(e){for(var t=0;t<htmx.config.responseHandling.length;t++){var r=htmx.config.responseHandling[t];if(codeMatches(r,e.status))return r}return{swap:!1}}function handleTitle(e){if(e){let t=find("title");t?t.textContent=e:window.document.title=e}}function resolveRetarget(e,t){if(t==="this")return e;let r=asElement(querySelectorExt(e,t));if(r==null)throw triggerErrorEvent(e,"htmx:targetError",{target:t}),new Error(`Invalid re-target ${t}`);return r}function handleAjaxResponse(e,t){let r=t.xhr,a=t.target,o=t.etc,s=t.select;if(!triggerEvent(e,"htmx:beforeOnLoad",t))return;if(hasHeader(r,/HX-Trigger:/i)&&handleTriggerHeader(r,"HX-Trigger",e),hasHeader(r,/HX-Location:/i)){let y=r.getResponseHeader("HX-Location");var l={};y.indexOf("{")===0&&(l=parseJSON(y),y=l.path,delete l.path),l.push=l.push||"true",ajaxHelper("get",y,l);return}let f=hasHeader(r,/HX-Refresh:/i)&&r.getResponseHeader("HX-Refresh")==="true";if(hasHeader(r,/HX-Redirect:/i)){t.keepIndicators=!0,htmx.location.href=r.getResponseHeader("HX-Redirect"),f&&htmx.location.reload();return}if(f){t.keepIndicators=!0,htmx.location.reload();return}let n=determineHistoryUpdates(e,t),u=resolveResponseHandling(r),c=u.swap,i=!!u.error,d=htmx.config.ignoreTitle||u.ignoreTitle,S=u.select;u.target&&(t.target=resolveRetarget(e,u.target));var m=o.swapOverride;m==null&&u.swapOverride&&(m=u.swapOverride),hasHeader(r,/HX-Retarget:/i)&&(t.target=resolveRetarget(e,r.getResponseHeader("HX-Retarget"))),hasHeader(r,/HX-Reswap:/i)&&(m=r.getResponseHeader("HX-Reswap"));var C=r.response,p=mergeObjects({shouldSwap:c,serverResponse:C,isError:i,ignoreTitle:d,selectOverride:S,swapOverride:m},t);if(!(u.event&&!triggerEvent(a,u.event,p))&&triggerEvent(a,"htmx:beforeSwap",p)){if(a=p.target,C=p.serverResponse,i=p.isError,d=p.ignoreTitle,S=p.selectOverride,m=p.swapOverride,t.target=a,t.failed=i,t.successful=!i,p.shouldSwap){r.status===286&&cancelPolling(e),withExtensions(e,function(x){C=x.transformResponse(C,r,e)}),n.type&&saveCurrentPageToHistory();var w=getSwapSpecification(e,m);w.hasOwnProperty("ignoreTitle")||(w.ignoreTitle=d),a.classList.add(htmx.config.swappingClass),s&&(S=s),hasHeader(r,/HX-Reselect:/i)&&(S=r.getResponseHeader("HX-Reselect"));let y=o.selectOOB||getClosestAttributeValue(e,"hx-select-oob"),g=getClosestAttributeValue(e,"hx-select");swap(a,C,w,{select:S==="unset"?null:S||g,selectOOB:y,eventInfo:t,anchor:t.pathInfo.anchor,contextElement:e,afterSwapCallback:function(){if(hasHeader(r,/HX-Trigger-After-Swap:/i)){let x=e;bodyContains(e)||(x=getDocument().body),handleTriggerHeader(r,"HX-Trigger-After-Swap",x)}},afterSettleCallback:function(){if(hasHeader(r,/HX-Trigger-After-Settle:/i)){let x=e;bodyContains(e)||(x=getDocument().body),handleTriggerHeader(r,"HX-Trigger-After-Settle",x)}},beforeSwapCallback:function(){n.type&&(triggerEvent(getDocument().body,"htmx:beforeHistoryUpdate",mergeObjects({history:n},t)),n.type==="push"?(pushUrlIntoHistory(n.path),triggerEvent(getDocument().body,"htmx:pushedIntoHistory",{path:n.path})):(replaceUrlInHistory(n.path),triggerEvent(getDocument().body,"htmx:replacedInHistory",{path:n.path})))}})}i&&triggerErrorEvent(e,"htmx:responseError",mergeObjects({error:"Response Status Error Code "+r.status+" from "+t.pathInfo.requestPath},t))}}let extensions={};function extensionBase(){return{init:function(e){return null},getSelectors:function(){return null},onEvent:function(e,t){return!0},transformResponse:function(e,t,r){return e},isInlineSwap:function(e){return!1},handleSwap:function(e,t,r,a){return!1},encodeParameters:function(e,t,r){return null}}}function defineExtension(e,t){t.init&&t.init(internalAPI),extensions[e]=mergeObjects(extensionBase(),t)}function removeExtension(e){delete extensions[e]}function getExtensions(e,t,r){if(t==null&&(t=[]),e==null)return t;r==null&&(r=[]);let a=getAttributeValue(e,"hx-ext");return a&&forEach(a.split(","),function(o){if(o=o.replace(/ /g,""),o.slice(0,7)=="ignore:"){r.push(o.slice(7));return}if(r.indexOf(o)<0){let s=extensions[o];s&&t.indexOf(s)<0&&t.push(s)}}),getExtensions(asElement(parentElt(e)),t,r)}var isReady=!1;getDocument().addEventListener("DOMContentLoaded",function(){isReady=!0});function ready(e){isReady||getDocument().readyState==="complete"?e():getDocument().addEventListener("DOMContentLoaded",e)}function insertIndicatorStyles(){if(htmx.config.includeIndicatorStyles!==!1){let e=htmx.config.inlineStyleNonce?` nonce="${htmx.config.inlineStyleNonce}"`:"",t=htmx.config.indicatorClass,r=htmx.config.requestClass;getDocument().head.insertAdjacentHTML("beforeend",`<style${e}>.${t}{opacity:0;visibility: hidden} .${r} .${t}, .${r}.${t}{opacity:1;visibility: visible;transition: opacity 200ms ease-in}</style>`)}}function getMetaConfig(){let e=getDocument().querySelector('meta[name="htmx-config"]');return e?parseJSON(e.content):null}function mergeMetaConfig(){let e=getMetaConfig();e&&(htmx.config=mergeObjects(htmx.config,e))}return ready(function(){mergeMetaConfig(),insertIndicatorStyles();let e=getDocument().body;processNode(e);let t=getDocument().querySelectorAll("[hx-trigger='restored'],[data-hx-trigger='restored']");e.addEventListener("htmx:abort",function(a){let o=a.detail.elt||a.target,s=getInternalData(o);s&&s.xhr&&s.xhr.abort()});let r=window.onpopstate?window.onpopstate.bind(window):null;window.onpopstate=function(a){a.state&&a.state.htmx?(restoreHistory(),forEach(t,function(o){triggerEvent(o,"htmx:restored",{document:getDocument(),triggerEvent})})):r&&r(a)},getWindow().setTimeout(function(){triggerEvent(e,"htmx:load",{}),e=null},0)}),htmx})(),be=Ie;var Te=document.createElement("template");Te.innerHTML=` 1 + var Ie=(function(){"use strict";let htmx={onLoad:null,process:null,on:null,off:null,trigger:null,ajax:null,find:null,findAll:null,closest:null,values:function(e,t){return getInputValues(e,t||"post").values},remove:null,addClass:null,removeClass:null,toggleClass:null,takeClass:null,swap:null,defineExtension:null,removeExtension:null,logAll:null,logNone:null,logger:null,config:{historyEnabled:!0,historyCacheSize:10,refreshOnHistoryMiss:!1,defaultSwapStyle:"innerHTML",defaultSwapDelay:0,defaultSettleDelay:20,includeIndicatorStyles:!0,indicatorClass:"htmx-indicator",requestClass:"htmx-request",addedClass:"htmx-added",settlingClass:"htmx-settling",swappingClass:"htmx-swapping",allowEval:!0,allowScriptTags:!0,inlineScriptNonce:"",inlineStyleNonce:"",attributesToSettle:["class","style","width","height"],withCredentials:!1,timeout:0,wsReconnectDelay:"full-jitter",wsBinaryType:"blob",disableSelector:"[hx-disable], [data-hx-disable]",scrollBehavior:"instant",defaultFocusScroll:!1,getCacheBusterParam:!1,globalViewTransitions:!1,methodsThatUseUrlParams:["get","delete"],selfRequestsOnly:!0,ignoreTitle:!1,scrollIntoViewOnBoost:!0,triggerSpecsCache:null,disableInheritance:!1,responseHandling:[{code:"204",swap:!1},{code:"[23]..",swap:!0},{code:"[45]..",swap:!1,error:!0}],allowNestedOobSwaps:!0,historyRestoreAsHxRequest:!0,reportValidityOfForms:!1},parseInterval:null,location,_:null,version:"2.0.8"};htmx.onLoad=onLoadHelper,htmx.process=processNode,htmx.on=addEventListenerImpl,htmx.off=removeEventListenerImpl,htmx.trigger=triggerEvent,htmx.ajax=ajaxHelper,htmx.find=find,htmx.findAll=findAll,htmx.closest=closest,htmx.remove=removeElement,htmx.addClass=addClassToElement,htmx.removeClass=removeClassFromElement,htmx.toggleClass=toggleClassOnElement,htmx.takeClass=takeClassForElement,htmx.swap=swap,htmx.defineExtension=defineExtension,htmx.removeExtension=removeExtension,htmx.logAll=logAll,htmx.logNone=logNone,htmx.parseInterval=parseInterval,htmx._=internalEval;let internalAPI={addTriggerHandler,bodyContains,canAccessLocalStorage,findThisElement,filterValues,swap,hasAttribute,getAttributeValue,getClosestAttributeValue,getClosestMatch,getExpressionVars,getHeaders,getInputValues,getInternalData,getSwapSpecification,getTriggerSpecs,getTarget,makeFragment,mergeObjects,makeSettleInfo,oobSwap,querySelectorExt,settleImmediately,shouldCancel,triggerEvent,triggerErrorEvent,withExtensions},VERBS=["get","post","put","delete","patch"],VERB_SELECTOR=VERBS.map(function(e){return"[hx-"+e+"], [data-hx-"+e+"]"}).join(", ");function parseInterval(e){if(e==null)return;let t=NaN;return e.slice(-2)=="ms"?t=parseFloat(e.slice(0,-2)):e.slice(-1)=="s"?t=parseFloat(e.slice(0,-1))*1e3:e.slice(-1)=="m"?t=parseFloat(e.slice(0,-1))*1e3*60:t=parseFloat(e),isNaN(t)?void 0:t}function getRawAttribute(e,t){return e instanceof Element&&e.getAttribute(t)}function hasAttribute(e,t){return!!e.hasAttribute&&(e.hasAttribute(t)||e.hasAttribute("data-"+t))}function getAttributeValue(e,t){return getRawAttribute(e,t)||getRawAttribute(e,"data-"+t)}function parentElt(e){let t=e.parentElement;return!t&&e.parentNode instanceof ShadowRoot?e.parentNode:t}function getDocument(){return document}function getRootNode(e,t){return e.getRootNode?e.getRootNode({composed:t}):getDocument()}function getClosestMatch(e,t){for(;e&&!t(e);)e=parentElt(e);return e||null}function getAttributeValueWithDisinheritance(e,t,r){let a=getAttributeValue(t,r),o=getAttributeValue(t,"hx-disinherit");var s=getAttributeValue(t,"hx-inherit");if(e!==t){if(htmx.config.disableInheritance)return s&&(s==="*"||s.split(" ").indexOf(r)>=0)?a:null;if(o&&(o==="*"||o.split(" ").indexOf(r)>=0))return"unset"}return a}function getClosestAttributeValue(e,t){let r=null;if(getClosestMatch(e,function(a){return!!(r=getAttributeValueWithDisinheritance(e,asElement(a),t))}),r!=="unset")return r}function matches(e,t){return e instanceof Element&&e.matches(t)}function getStartTag(e){let r=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i.exec(e);return r?r[1].toLowerCase():""}function parseHTML(e){return"parseHTMLUnsafe"in Document?Document.parseHTMLUnsafe(e):new DOMParser().parseFromString(e,"text/html")}function takeChildrenFor(e,t){for(;t.childNodes.length>0;)e.append(t.childNodes[0])}function duplicateScript(e){let t=getDocument().createElement("script");return forEach(e.attributes,function(r){t.setAttribute(r.name,r.value)}),t.textContent=e.textContent,t.async=!1,htmx.config.inlineScriptNonce&&(t.nonce=htmx.config.inlineScriptNonce),t}function isJavaScriptScriptNode(e){return e.matches("script")&&(e.type==="text/javascript"||e.type==="module"||e.type==="")}function normalizeScriptTags(e){Array.from(e.querySelectorAll("script")).forEach(t=>{if(isJavaScriptScriptNode(t)){let r=duplicateScript(t),a=t.parentNode;try{a.insertBefore(r,t)}catch(o){logError(o)}finally{t.remove()}}})}function makeFragment(e){let t=e.replace(/<head(\s[^>]*)?>[\s\S]*?<\/head>/i,""),r=getStartTag(t),a;if(r==="html"){a=new DocumentFragment;let s=parseHTML(e);takeChildrenFor(a,s.body),a.title=s.title}else if(r==="body"){a=new DocumentFragment;let s=parseHTML(t);takeChildrenFor(a,s.body),a.title=s.title}else{let s=parseHTML('<body><template class="internal-htmx-wrapper">'+t+"</template></body>");a=s.querySelector("template").content,a.title=s.title;var o=a.querySelector("title");o&&o.parentNode===a&&(o.remove(),a.title=o.innerText)}return a&&(htmx.config.allowScriptTags?normalizeScriptTags(a):a.querySelectorAll("script").forEach(s=>s.remove())),a}function maybeCall(e){e&&e()}function isType(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function isFunction(e){return typeof e=="function"}function isRawObject(e){return isType(e,"Object")}function getInternalData(e){let t="htmx-internal-data",r=e[t];return r||(r=e[t]={}),r}function toArray(e){let t=[];if(e)for(let r=0;r<e.length;r++)t.push(e[r]);return t}function forEach(e,t){if(e)for(let r=0;r<e.length;r++)t(e[r])}function isScrolledIntoView(e){let t=e.getBoundingClientRect(),r=t.top,a=t.bottom;return r<window.innerHeight&&a>=0}function bodyContains(e){return e.getRootNode({composed:!0})===document}function splitOnWhitespace(e){return e.trim().split(/\s+/)}function mergeObjects(e,t){for(let r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}function parseJSON(e){try{return JSON.parse(e)}catch(t){return logError(t),null}}function canAccessLocalStorage(){let e="htmx:sessionStorageTest";try{return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch{return!1}}function normalizePath(e){let t=new URL(e,"http://x");return t&&(e=t.pathname+t.search),e!="/"&&(e=e.replace(/\/+$/,"")),e}function internalEval(str){return maybeEval(getDocument().body,function(){return eval(str)})}function onLoadHelper(e){return htmx.on("htmx:load",function(r){e(r.detail.elt)})}function logAll(){htmx.logger=function(e,t,r){console&&console.log(t,e,r)}}function logNone(){htmx.logger=null}function find(e,t){return typeof e!="string"?e.querySelector(t):find(getDocument(),e)}function findAll(e,t){return typeof e!="string"?e.querySelectorAll(t):findAll(getDocument(),e)}function getWindow(){return window}function removeElement(e,t){e=resolveTarget(e),t?getWindow().setTimeout(function(){removeElement(e),e=null},t):parentElt(e).removeChild(e)}function asElement(e){return e instanceof Element?e:null}function asHtmlElement(e){return e instanceof HTMLElement?e:null}function asString(e){return typeof e=="string"?e:null}function asParentNode(e){return e instanceof Element||e instanceof Document||e instanceof DocumentFragment?e:null}function addClassToElement(e,t,r){e=asElement(resolveTarget(e)),e&&(r?getWindow().setTimeout(function(){addClassToElement(e,t),e=null},r):e.classList&&e.classList.add(t))}function removeClassFromElement(e,t,r){let a=asElement(resolveTarget(e));a&&(r?getWindow().setTimeout(function(){removeClassFromElement(a,t),a=null},r):a.classList&&(a.classList.remove(t),a.classList.length===0&&a.removeAttribute("class")))}function toggleClassOnElement(e,t){e=resolveTarget(e),e.classList.toggle(t)}function takeClassForElement(e,t){e=resolveTarget(e),forEach(e.parentElement.children,function(r){removeClassFromElement(r,t)}),addClassToElement(asElement(e),t)}function closest(e,t){return e=asElement(resolveTarget(e)),e?e.closest(t):null}function startsWith(e,t){return e.substring(0,t.length)===t}function endsWith(e,t){return e.substring(e.length-t.length)===t}function normalizeSelector(e){let t=e.trim();return startsWith(t,"<")&&endsWith(t,"/>")?t.substring(1,t.length-2):t}function querySelectorAllExt(e,t,r){if(t.indexOf("global ")===0)return querySelectorAllExt(e,t.slice(7),!0);e=resolveTarget(e);let a=[];{let l=0,f=0;for(let n=0;n<t.length;n++){let u=t[n];if(u===","&&l===0){a.push(t.substring(f,n)),f=n+1;continue}u==="<"?l++:u==="/"&&n<t.length-1&&t[n+1]===">"&&l--}f<t.length&&a.push(t.substring(f))}let o=[],s=[];for(;a.length>0;){let l=normalizeSelector(a.shift()),f;l.indexOf("closest ")===0?f=closest(asElement(e),normalizeSelector(l.slice(8))):l.indexOf("find ")===0?f=find(asParentNode(e),normalizeSelector(l.slice(5))):l==="next"||l==="nextElementSibling"?f=asElement(e).nextElementSibling:l.indexOf("next ")===0?f=scanForwardQuery(e,normalizeSelector(l.slice(5)),!!r):l==="previous"||l==="previousElementSibling"?f=asElement(e).previousElementSibling:l.indexOf("previous ")===0?f=scanBackwardsQuery(e,normalizeSelector(l.slice(9)),!!r):l==="document"?f=document:l==="window"?f=window:l==="body"?f=document.body:l==="root"?f=getRootNode(e,!!r):l==="host"?f=e.getRootNode().host:s.push(l),f&&o.push(f)}if(s.length>0){let l=s.join(","),f=asParentNode(getRootNode(e,!!r));o.push(...toArray(f.querySelectorAll(l)))}return o}var scanForwardQuery=function(e,t,r){let a=asParentNode(getRootNode(e,r)).querySelectorAll(t);for(let o=0;o<a.length;o++){let s=a[o];if(s.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_PRECEDING)return s}},scanBackwardsQuery=function(e,t,r){let a=asParentNode(getRootNode(e,r)).querySelectorAll(t);for(let o=a.length-1;o>=0;o--){let s=a[o];if(s.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_FOLLOWING)return s}};function querySelectorExt(e,t){return typeof e!="string"?querySelectorAllExt(e,t)[0]:querySelectorAllExt(getDocument().body,e)[0]}function resolveTarget(e,t){return typeof e=="string"?find(asParentNode(t)||document,e):e}function processEventArgs(e,t,r,a){return isFunction(t)?{target:getDocument().body,event:asString(e),listener:t,options:r}:{target:resolveTarget(e),event:asString(t),listener:r,options:a}}function addEventListenerImpl(e,t,r,a){return ready(function(){let s=processEventArgs(e,t,r,a);s.target.addEventListener(s.event,s.listener,s.options)}),isFunction(t)?t:r}function removeEventListenerImpl(e,t,r){return ready(function(){let a=processEventArgs(e,t,r);a.target.removeEventListener(a.event,a.listener)}),isFunction(t)?t:r}let DUMMY_ELT=getDocument().createElement("output");function findAttributeTargets(e,t){let r=getClosestAttributeValue(e,t);if(r){if(r==="this")return[findThisElement(e,t)];{let a=querySelectorAllExt(e,r);if(/(^|,)(\s*)inherit(\s*)($|,)/.test(r)){let s=asElement(getClosestMatch(e,function(l){return l!==e&&hasAttribute(asElement(l),t)}));s&&a.push(...findAttributeTargets(s,t))}return a.length===0?(logError('The selector "'+r+'" on '+t+" returned no matches!"),[DUMMY_ELT]):a}}}function findThisElement(e,t){return asElement(getClosestMatch(e,function(r){return getAttributeValue(asElement(r),t)!=null}))}function getTarget(e){let t=getClosestAttributeValue(e,"hx-target");return t?t==="this"?findThisElement(e,"hx-target"):querySelectorExt(e,t):getInternalData(e).boosted?getDocument().body:e}function shouldSettleAttribute(e){return htmx.config.attributesToSettle.includes(e)}function cloneAttributes(e,t){forEach(Array.from(e.attributes),function(r){!t.hasAttribute(r.name)&&shouldSettleAttribute(r.name)&&e.removeAttribute(r.name)}),forEach(t.attributes,function(r){shouldSettleAttribute(r.name)&&e.setAttribute(r.name,r.value)})}function isInlineSwap(e,t){let r=getExtensions(t);for(let a=0;a<r.length;a++){let o=r[a];try{if(o.isInlineSwap(e))return!0}catch(s){logError(s)}}return e==="outerHTML"}function oobSwap(e,t,r,a){a=a||getDocument();let o="#"+CSS.escape(getRawAttribute(t,"id")),s="outerHTML";e==="true"||(e.indexOf(":")>0?(s=e.substring(0,e.indexOf(":")),o=e.substring(e.indexOf(":")+1)):s=e),t.removeAttribute("hx-swap-oob"),t.removeAttribute("data-hx-swap-oob");let l=querySelectorAllExt(a,o,!1);return l.length?(forEach(l,function(f){let n,u=t.cloneNode(!0);n=getDocument().createDocumentFragment(),n.appendChild(u),isInlineSwap(s,f)||(n=asParentNode(u));let c={shouldSwap:!0,target:f,fragment:n};triggerEvent(f,"htmx:oobBeforeSwap",c)&&(f=c.target,c.shouldSwap&&(handlePreservedElements(n),swapWithStyle(s,f,f,n,r),restorePreservedElements()),forEach(r.elts,function(i){triggerEvent(i,"htmx:oobAfterSwap",c)}))}),t.parentNode.removeChild(t)):(t.parentNode.removeChild(t),triggerErrorEvent(getDocument().body,"htmx:oobErrorNoTarget",{content:t})),e}function restorePreservedElements(){let e=find("#--htmx-preserve-pantry--");if(e){for(let t of[...e.children]){let r=find("#"+t.id);r.parentNode.moveBefore(t,r),r.remove()}e.remove()}}function handlePreservedElements(e){forEach(findAll(e,"[hx-preserve], [data-hx-preserve]"),function(t){let r=getAttributeValue(t,"id"),a=getDocument().getElementById(r);if(a!=null)if(t.moveBefore){let o=find("#--htmx-preserve-pantry--");o==null&&(getDocument().body.insertAdjacentHTML("afterend","<div id='--htmx-preserve-pantry--'></div>"),o=find("#--htmx-preserve-pantry--")),o.moveBefore(a,null)}else t.parentNode.replaceChild(a,t)})}function handleAttributes(e,t,r){forEach(t.querySelectorAll("[id]"),function(a){let o=getRawAttribute(a,"id");if(o&&o.length>0){let s=o.replace("'","\\'"),l=a.tagName.replace(":","\\:"),f=asParentNode(e),n=f&&f.querySelector(l+"[id='"+s+"']");if(n&&n!==f){let u=a.cloneNode();cloneAttributes(a,n),r.tasks.push(function(){cloneAttributes(a,u)})}}})}function makeAjaxLoadTask(e){return function(){removeClassFromElement(e,htmx.config.addedClass),processNode(asElement(e)),processFocus(asParentNode(e)),triggerEvent(e,"htmx:load")}}function processFocus(e){let t="[autofocus]",r=asHtmlElement(matches(e,t)?e:e.querySelector(t));r?.focus()}function insertNodesBefore(e,t,r,a){for(handleAttributes(e,r,a);r.childNodes.length>0;){let o=r.firstChild;addClassToElement(asElement(o),htmx.config.addedClass),e.insertBefore(o,t),o.nodeType!==Node.TEXT_NODE&&o.nodeType!==Node.COMMENT_NODE&&a.tasks.push(makeAjaxLoadTask(o))}}function stringHash(e,t){let r=0;for(;r<e.length;)t=(t<<5)-t+e.charCodeAt(r++)|0;return t}function attributeHash(e){let t=0;for(let r=0;r<e.attributes.length;r++){let a=e.attributes[r];a.value&&(t=stringHash(a.name,t),t=stringHash(a.value,t))}return t}function deInitOnHandlers(e){let t=getInternalData(e);if(t.onHandlers){for(let r=0;r<t.onHandlers.length;r++){let a=t.onHandlers[r];removeEventListenerImpl(e,a.event,a.listener)}delete t.onHandlers}}function deInitNode(e){let t=getInternalData(e);t.timeout&&clearTimeout(t.timeout),t.listenerInfos&&forEach(t.listenerInfos,function(r){r.on&&removeEventListenerImpl(r.on,r.trigger,r.listener)}),deInitOnHandlers(e),forEach(Object.keys(t),function(r){r!=="firstInitCompleted"&&delete t[r]})}function cleanUpElement(e){triggerEvent(e,"htmx:beforeCleanupElement"),deInitNode(e),forEach(e.children,function(t){cleanUpElement(t)})}function swapOuterHTML(e,t,r){if(e.tagName==="BODY")return swapInnerHTML(e,t,r);let a,o=e.previousSibling,s=parentElt(e);if(s){for(insertNodesBefore(s,e,t,r),o==null?a=s.firstChild:a=o.nextSibling,r.elts=r.elts.filter(function(l){return l!==e});a&&a!==e;)a instanceof Element&&r.elts.push(a),a=a.nextSibling;cleanUpElement(e),e.remove()}}function swapAfterBegin(e,t,r){return insertNodesBefore(e,e.firstChild,t,r)}function swapBeforeBegin(e,t,r){return insertNodesBefore(parentElt(e),e,t,r)}function swapBeforeEnd(e,t,r){return insertNodesBefore(e,null,t,r)}function swapAfterEnd(e,t,r){return insertNodesBefore(parentElt(e),e.nextSibling,t,r)}function swapDelete(e){cleanUpElement(e);let t=parentElt(e);if(t)return t.removeChild(e)}function swapInnerHTML(e,t,r){let a=e.firstChild;if(insertNodesBefore(e,a,t,r),a){for(;a.nextSibling;)cleanUpElement(a.nextSibling),e.removeChild(a.nextSibling);cleanUpElement(a),e.removeChild(a)}}function swapWithStyle(e,t,r,a,o){switch(e){case"none":return;case"outerHTML":swapOuterHTML(r,a,o);return;case"afterbegin":swapAfterBegin(r,a,o);return;case"beforebegin":swapBeforeBegin(r,a,o);return;case"beforeend":swapBeforeEnd(r,a,o);return;case"afterend":swapAfterEnd(r,a,o);return;case"delete":swapDelete(r);return;default:var s=getExtensions(t);for(let l=0;l<s.length;l++){let f=s[l];try{let n=f.handleSwap(e,r,a,o);if(n){if(Array.isArray(n))for(let u=0;u<n.length;u++){let c=n[u];c.nodeType!==Node.TEXT_NODE&&c.nodeType!==Node.COMMENT_NODE&&o.tasks.push(makeAjaxLoadTask(c))}return}}catch(n){logError(n)}}e==="innerHTML"?swapInnerHTML(r,a,o):swapWithStyle(htmx.config.defaultSwapStyle,t,r,a,o)}}function findAndSwapOobElements(e,t,r){var a=findAll(e,"[hx-swap-oob], [data-hx-swap-oob]");return forEach(a,function(o){if(htmx.config.allowNestedOobSwaps||o.parentElement===null){let s=getAttributeValue(o,"hx-swap-oob");s!=null&&oobSwap(s,o,t,r)}else o.removeAttribute("hx-swap-oob"),o.removeAttribute("data-hx-swap-oob")}),a.length>0}function swap(e,t,r,a){a||(a={});let o=null,s=null,l=function(){maybeCall(a.beforeSwapCallback),e=resolveTarget(e);let u=a.contextElement?getRootNode(a.contextElement,!1):getDocument(),c=document.activeElement,i={};i={elt:c,start:c?c.selectionStart:null,end:c?c.selectionEnd:null};let d=makeSettleInfo(e);if(r.swapStyle==="textContent")e.textContent=t;else{let m=makeFragment(t);if(d.title=a.title||m.title,a.historyRequest&&(m=m.querySelector("[hx-history-elt],[data-hx-history-elt]")||m),a.selectOOB){let C=a.selectOOB.split(",");for(let p=0;p<C.length;p++){let w=C[p].split(":",2),y=w[0].trim();y.indexOf("#")===0&&(y=y.substring(1));let g=w[1]||"true",x=m.querySelector("#"+y);x&&oobSwap(g,x,d,u)}}if(findAndSwapOobElements(m,d,u),forEach(findAll(m,"template"),function(C){C.content&&findAndSwapOobElements(C.content,d,u)&&C.remove()}),a.select){let C=getDocument().createDocumentFragment();forEach(m.querySelectorAll(a.select),function(p){C.appendChild(p)}),m=C}handlePreservedElements(m),swapWithStyle(r.swapStyle,a.contextElement,e,m,d),restorePreservedElements()}if(i.elt&&!bodyContains(i.elt)&&getRawAttribute(i.elt,"id")){let m=document.getElementById(getRawAttribute(i.elt,"id")),C={preventScroll:r.focusScroll!==void 0?!r.focusScroll:!htmx.config.defaultFocusScroll};if(m){if(i.start&&m.setSelectionRange)try{m.setSelectionRange(i.start,i.end)}catch{}m.focus(C)}}e.classList.remove(htmx.config.swappingClass),forEach(d.elts,function(m){m.classList&&m.classList.add(htmx.config.settlingClass),triggerEvent(m,"htmx:afterSwap",a.eventInfo)}),maybeCall(a.afterSwapCallback),r.ignoreTitle||handleTitle(d.title);let S=function(){if(forEach(d.tasks,function(m){m.call()}),forEach(d.elts,function(m){m.classList&&m.classList.remove(htmx.config.settlingClass),triggerEvent(m,"htmx:afterSettle",a.eventInfo)}),a.anchor){let m=asElement(resolveTarget("#"+a.anchor));m&&m.scrollIntoView({block:"start",behavior:"auto"})}updateScrollState(d.elts,r),maybeCall(a.afterSettleCallback),maybeCall(o)};r.settleDelay>0?getWindow().setTimeout(S,r.settleDelay):S()},f=htmx.config.globalViewTransitions;r.hasOwnProperty("transition")&&(f=r.transition);let n=a.contextElement||getDocument();if(f&&triggerEvent(n,"htmx:beforeTransition",a.eventInfo)&&typeof Promise<"u"&&document.startViewTransition){let u=new Promise(function(i,d){o=i,s=d}),c=l;l=function(){document.startViewTransition(function(){return c(),u})}}try{r?.swapDelay&&r.swapDelay>0?getWindow().setTimeout(l,r.swapDelay):l()}catch(u){throw triggerErrorEvent(n,"htmx:swapError",a.eventInfo),maybeCall(s),u}}function handleTriggerHeader(e,t,r){let a=e.getResponseHeader(t);if(a.indexOf("{")===0){let o=parseJSON(a);for(let s in o)if(o.hasOwnProperty(s)){let l=o[s];isRawObject(l)?r=l.target!==void 0?l.target:r:l={value:l},triggerEvent(r,s,l)}}else{let o=a.split(",");for(let s=0;s<o.length;s++)triggerEvent(r,o[s].trim(),[])}}let WHITESPACE=/\s/,WHITESPACE_OR_COMMA=/[\s,]/,SYMBOL_START=/[_$a-zA-Z]/,SYMBOL_CONT=/[_$a-zA-Z0-9]/,STRINGISH_START=['"',"'","/"],NOT_WHITESPACE=/[^\s]/,COMBINED_SELECTOR_START=/[{(]/,COMBINED_SELECTOR_END=/[})]/;function tokenizeString(e){let t=[],r=0;for(;r<e.length;){if(SYMBOL_START.exec(e.charAt(r))){for(var a=r;SYMBOL_CONT.exec(e.charAt(r+1));)r++;t.push(e.substring(a,r+1))}else if(STRINGISH_START.indexOf(e.charAt(r))!==-1){let o=e.charAt(r);var a=r;for(r++;r<e.length&&e.charAt(r)!==o;)e.charAt(r)==="\\"&&r++,r++;t.push(e.substring(a,r+1))}else{let o=e.charAt(r);t.push(o)}r++}return t}function isPossibleRelativeReference(e,t,r){return SYMBOL_START.exec(e.charAt(0))&&e!=="true"&&e!=="false"&&e!=="this"&&e!==r&&t!=="."}function maybeGenerateConditional(e,t,r){if(t[0]==="["){t.shift();let a=1,o=" return (function("+r+"){ return (",s=null;for(;t.length>0;){let l=t[0];if(l==="]"){if(a--,a===0){s===null&&(o=o+"true"),t.shift(),o+=")})";try{let f=maybeEval(e,function(){return Function(o)()},function(){return!0});return f.source=o,f}catch(f){return triggerErrorEvent(getDocument().body,"htmx:syntax:error",{error:f,source:o}),null}}}else l==="["&&a++;isPossibleRelativeReference(l,s,r)?o+="(("+r+"."+l+") ? ("+r+"."+l+") : (window."+l+"))":o=o+l,s=t.shift()}}}function consumeUntil(e,t){let r="";for(;e.length>0&&!t.test(e[0]);)r+=e.shift();return r}function consumeCSSSelector(e){let t;return e.length>0&&COMBINED_SELECTOR_START.test(e[0])?(e.shift(),t=consumeUntil(e,COMBINED_SELECTOR_END).trim(),e.shift()):t=consumeUntil(e,WHITESPACE_OR_COMMA),t}let INPUT_SELECTOR="input, textarea, select";function parseAndCacheTrigger(e,t,r){let a=[],o=tokenizeString(t);do{consumeUntil(o,NOT_WHITESPACE);let f=o.length,n=consumeUntil(o,/[,\[\s]/);if(n!=="")if(n==="every"){let u={trigger:"every"};consumeUntil(o,NOT_WHITESPACE),u.pollInterval=parseInterval(consumeUntil(o,/[,\[\s]/)),consumeUntil(o,NOT_WHITESPACE);var s=maybeGenerateConditional(e,o,"event");s&&(u.eventFilter=s),a.push(u)}else{let u={trigger:n};var s=maybeGenerateConditional(e,o,"event");for(s&&(u.eventFilter=s),consumeUntil(o,NOT_WHITESPACE);o.length>0&&o[0]!==",";){let i=o.shift();if(i==="changed")u.changed=!0;else if(i==="once")u.once=!0;else if(i==="consume")u.consume=!0;else if(i==="delay"&&o[0]===":")o.shift(),u.delay=parseInterval(consumeUntil(o,WHITESPACE_OR_COMMA));else if(i==="from"&&o[0]===":"){if(o.shift(),COMBINED_SELECTOR_START.test(o[0]))var l=consumeCSSSelector(o);else{var l=consumeUntil(o,WHITESPACE_OR_COMMA);if(l==="closest"||l==="find"||l==="next"||l==="previous"){o.shift();let S=consumeCSSSelector(o);S.length>0&&(l+=" "+S)}}u.from=l}else i==="target"&&o[0]===":"?(o.shift(),u.target=consumeCSSSelector(o)):i==="throttle"&&o[0]===":"?(o.shift(),u.throttle=parseInterval(consumeUntil(o,WHITESPACE_OR_COMMA))):i==="queue"&&o[0]===":"?(o.shift(),u.queue=consumeUntil(o,WHITESPACE_OR_COMMA)):i==="root"&&o[0]===":"?(o.shift(),u[i]=consumeCSSSelector(o)):i==="threshold"&&o[0]===":"?(o.shift(),u[i]=consumeUntil(o,WHITESPACE_OR_COMMA)):triggerErrorEvent(e,"htmx:syntax:error",{token:o.shift()});consumeUntil(o,NOT_WHITESPACE)}a.push(u)}o.length===f&&triggerErrorEvent(e,"htmx:syntax:error",{token:o.shift()}),consumeUntil(o,NOT_WHITESPACE)}while(o[0]===","&&o.shift());return r&&(r[t]=a),a}function getTriggerSpecs(e){let t=getAttributeValue(e,"hx-trigger"),r=[];if(t){let a=htmx.config.triggerSpecsCache;r=a&&a[t]||parseAndCacheTrigger(e,t,a)}return r.length>0?r:matches(e,"form")?[{trigger:"submit"}]:matches(e,'input[type="button"], input[type="submit"]')?[{trigger:"click"}]:matches(e,INPUT_SELECTOR)?[{trigger:"change"}]:[{trigger:"click"}]}function cancelPolling(e){getInternalData(e).cancelled=!0}function processPolling(e,t,r){let a=getInternalData(e);a.timeout=getWindow().setTimeout(function(){bodyContains(e)&&a.cancelled!==!0&&(maybeFilterEvent(r,e,makeEvent("hx:poll:trigger",{triggerSpec:r,target:e}))||t(e),processPolling(e,t,r))},r.pollInterval)}function isLocalLink(e){return location.hostname===e.hostname&&getRawAttribute(e,"href")&&getRawAttribute(e,"href").indexOf("#")!==0}function eltIsDisabled(e){return closest(e,htmx.config.disableSelector)}function boostElement(e,t,r){if(e instanceof HTMLAnchorElement&&isLocalLink(e)&&(e.target===""||e.target==="_self")||e.tagName==="FORM"&&String(getRawAttribute(e,"method")).toLowerCase()!=="dialog"){t.boosted=!0;let a,o;if(e.tagName==="A")a="get",o=getRawAttribute(e,"href");else{let s=getRawAttribute(e,"method");a=s?s.toLowerCase():"get",o=getRawAttribute(e,"action"),(o==null||o==="")&&(o=location.href),a==="get"&&o.includes("?")&&(o=o.replace(/\?[^#]+/,""))}r.forEach(function(s){addEventListener(e,function(l,f){let n=asElement(l);if(eltIsDisabled(n)){cleanUpElement(n);return}issueAjaxRequest(a,o,n,f)},t,s,!0)})}}function shouldCancel(e,t){if(e.type==="submit"&&t.tagName==="FORM")return!0;if(e.type==="click"){let r=t.closest('input[type="submit"], button');if(r&&r.form&&r.type==="submit")return!0;let a=t.closest("a"),o=/^#.+/;if(a&&a.href&&!o.test(a.getAttribute("href")))return!0}return!1}function ignoreBoostedAnchorCtrlClick(e,t){return getInternalData(e).boosted&&e instanceof HTMLAnchorElement&&t.type==="click"&&(t.ctrlKey||t.metaKey)}function maybeFilterEvent(e,t,r){let a=e.eventFilter;if(a)try{return a.call(t,r)!==!0}catch(o){let s=a.source;return triggerErrorEvent(getDocument().body,"htmx:eventFilter:error",{error:o,source:s}),!0}return!1}function addEventListener(e,t,r,a,o){let s=getInternalData(e),l;a.from?l=querySelectorAllExt(e,a.from):l=[e],a.changed&&("lastValue"in s||(s.lastValue=new WeakMap),l.forEach(function(f){s.lastValue.has(a)||s.lastValue.set(a,new WeakMap),s.lastValue.get(a).set(f,f.value)})),forEach(l,function(f){let n=function(u){if(!bodyContains(e)){f.removeEventListener(a.trigger,n);return}if(ignoreBoostedAnchorCtrlClick(e,u)||((o||shouldCancel(u,f))&&u.preventDefault(),maybeFilterEvent(a,e,u)))return;let c=getInternalData(u);if(c.triggerSpec=a,c.handledFor==null&&(c.handledFor=[]),c.handledFor.indexOf(e)<0){if(c.handledFor.push(e),a.consume&&u.stopPropagation(),a.target&&u.target&&!matches(asElement(u.target),a.target))return;if(a.once){if(s.triggeredOnce)return;s.triggeredOnce=!0}if(a.changed){let i=u.target,d=i.value,S=s.lastValue.get(a);if(S.has(i)&&S.get(i)===d)return;S.set(i,d)}if(s.delayed&&clearTimeout(s.delayed),s.throttle)return;a.throttle>0?s.throttle||(triggerEvent(e,"htmx:trigger"),t(e,u),s.throttle=getWindow().setTimeout(function(){s.throttle=null},a.throttle)):a.delay>0?s.delayed=getWindow().setTimeout(function(){triggerEvent(e,"htmx:trigger"),t(e,u)},a.delay):(triggerEvent(e,"htmx:trigger"),t(e,u))}};r.listenerInfos==null&&(r.listenerInfos=[]),r.listenerInfos.push({trigger:a.trigger,listener:n,on:f}),f.addEventListener(a.trigger,n)})}let windowIsScrolling=!1,scrollHandler=null;function initScrollHandler(){scrollHandler||(scrollHandler=function(){windowIsScrolling=!0},window.addEventListener("scroll",scrollHandler),window.addEventListener("resize",scrollHandler),setInterval(function(){windowIsScrolling&&(windowIsScrolling=!1,forEach(getDocument().querySelectorAll("[hx-trigger*='revealed'],[data-hx-trigger*='revealed']"),function(e){maybeReveal(e)}))},200))}function maybeReveal(e){!hasAttribute(e,"data-hx-revealed")&&isScrolledIntoView(e)&&(e.setAttribute("data-hx-revealed","true"),getInternalData(e).initHash?triggerEvent(e,"revealed"):e.addEventListener("htmx:afterProcessNode",function(){triggerEvent(e,"revealed")},{once:!0}))}function loadImmediately(e,t,r,a){let o=function(){r.loaded||(r.loaded=!0,triggerEvent(e,"htmx:trigger"),t(e))};a>0?getWindow().setTimeout(o,a):o()}function processVerbs(e,t,r){let a=!1;return forEach(VERBS,function(o){if(hasAttribute(e,"hx-"+o)){let s=getAttributeValue(e,"hx-"+o);a=!0,t.path=s,t.verb=o,r.forEach(function(l){addTriggerHandler(e,l,t,function(f,n){let u=asElement(f);if(eltIsDisabled(u)){cleanUpElement(u);return}issueAjaxRequest(o,s,u,n)})})}}),a}function addTriggerHandler(e,t,r,a){if(t.trigger==="revealed")initScrollHandler(),addEventListener(e,a,r,t),maybeReveal(asElement(e));else if(t.trigger==="intersect"){let o={};t.root&&(o.root=querySelectorExt(e,t.root)),t.threshold&&(o.threshold=parseFloat(t.threshold)),new IntersectionObserver(function(l){for(let f=0;f<l.length;f++)if(l[f].isIntersecting){triggerEvent(e,"intersect");break}},o).observe(asElement(e)),addEventListener(asElement(e),a,r,t)}else!r.firstInitCompleted&&t.trigger==="load"?maybeFilterEvent(t,e,makeEvent("load",{elt:e}))||loadImmediately(asElement(e),a,r,t.delay):t.pollInterval>0?(r.polling=!0,processPolling(asElement(e),a,t)):addEventListener(e,a,r,t)}function shouldProcessHxOn(e){let t=asElement(e);if(!t)return!1;let r=t.attributes;for(let a=0;a<r.length;a++){let o=r[a].name;if(startsWith(o,"hx-on:")||startsWith(o,"data-hx-on:")||startsWith(o,"hx-on-")||startsWith(o,"data-hx-on-"))return!0}return!1}let HX_ON_QUERY=new XPathEvaluator().createExpression('.//*[@*[ starts-with(name(), "hx-on:") or starts-with(name(), "data-hx-on:") or starts-with(name(), "hx-on-") or starts-with(name(), "data-hx-on-") ]]');function processHXOnRoot(e,t){shouldProcessHxOn(e)&&t.push(asElement(e));let r=HX_ON_QUERY.evaluate(e),a=null;for(;a=r.iterateNext();)t.push(asElement(a))}function findHxOnWildcardElements(e){let t=[];if(e instanceof DocumentFragment)for(let r of e.childNodes)processHXOnRoot(r,t);else processHXOnRoot(e,t);return t}function findElementsToProcess(e){if(e.querySelectorAll){let r=", [hx-boost] a, [data-hx-boost] a, a[hx-boost], a[data-hx-boost]",a=[];for(let s in extensions){let l=extensions[s];if(l.getSelectors){var t=l.getSelectors();t&&a.push(t)}}return e.querySelectorAll(VERB_SELECTOR+r+", form, [type='submit'], [hx-ext], [data-hx-ext], [hx-trigger], [data-hx-trigger]"+a.flat().map(s=>", "+s).join(""))}else return[]}function maybeSetLastButtonClicked(e){let t=getTargetButton(e.target),r=getRelatedFormData(e);r&&(r.lastButtonClicked=t)}function maybeUnsetLastButtonClicked(e){let t=getRelatedFormData(e);t&&(t.lastButtonClicked=null)}function getTargetButton(e){return closest(asElement(e),"button, input[type='submit']")}function getRelatedForm(e){return e.form||closest(e,"form")}function getRelatedFormData(e){let t=getTargetButton(e.target);if(!t)return;let r=getRelatedForm(t);if(r)return getInternalData(r)}function initButtonTracking(e){e.addEventListener("click",maybeSetLastButtonClicked),e.addEventListener("focusin",maybeSetLastButtonClicked),e.addEventListener("focusout",maybeUnsetLastButtonClicked)}function addHxOnEventHandler(e,t,r){let a=getInternalData(e);Array.isArray(a.onHandlers)||(a.onHandlers=[]);let o,s=function(l){maybeEval(e,function(){eltIsDisabled(e)||(o||(o=new Function("event",r)),o.call(e,l))})};e.addEventListener(t,s),a.onHandlers.push({event:t,listener:s})}function processHxOnWildcard(e){deInitOnHandlers(e);for(let t=0;t<e.attributes.length;t++){let r=e.attributes[t].name,a=e.attributes[t].value;if(startsWith(r,"hx-on")||startsWith(r,"data-hx-on")){let o=r.indexOf("-on")+3,s=r.slice(o,o+1);if(s==="-"||s===":"){let l=r.slice(o+1);startsWith(l,":")?l="htmx"+l:startsWith(l,"-")?l="htmx:"+l.slice(1):startsWith(l,"htmx-")&&(l="htmx:"+l.slice(5)),addHxOnEventHandler(e,l,a)}}}}function initNode(e){triggerEvent(e,"htmx:beforeProcessNode");let t=getInternalData(e),r=getTriggerSpecs(e);processVerbs(e,t,r)||(getClosestAttributeValue(e,"hx-boost")==="true"?boostElement(e,t,r):hasAttribute(e,"hx-trigger")&&r.forEach(function(o){addTriggerHandler(e,o,t,function(){})})),(e.tagName==="FORM"||getRawAttribute(e,"type")==="submit"&&hasAttribute(e,"form"))&&initButtonTracking(e),t.firstInitCompleted=!0,triggerEvent(e,"htmx:afterProcessNode")}function maybeDeInitAndHash(e){if(!(e instanceof Element))return!1;let t=getInternalData(e),r=attributeHash(e);return t.initHash!==r?(deInitNode(e),t.initHash=r,!0):!1}function processNode(e){if(e=resolveTarget(e),eltIsDisabled(e)){cleanUpElement(e);return}let t=[];maybeDeInitAndHash(e)&&t.push(e),forEach(findElementsToProcess(e),function(r){if(eltIsDisabled(r)){cleanUpElement(r);return}maybeDeInitAndHash(r)&&t.push(r)}),forEach(findHxOnWildcardElements(e),processHxOnWildcard),forEach(t,initNode)}function kebabEventName(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function makeEvent(e,t){return new CustomEvent(e,{bubbles:!0,cancelable:!0,composed:!0,detail:t})}function triggerErrorEvent(e,t,r){triggerEvent(e,t,mergeObjects({error:t},r))}function ignoreEventForLogging(e){return e==="htmx:afterProcessNode"}function withExtensions(e,t,r){forEach(getExtensions(e,[],r),function(a){try{t(a)}catch(o){logError(o)}})}function logError(e){console.error(e)}function triggerEvent(e,t,r){e=resolveTarget(e),r==null&&(r={}),r.elt=e;let a=makeEvent(t,r);htmx.logger&&!ignoreEventForLogging(t)&&htmx.logger(e,t,r),r.error&&(logError(r.error),triggerEvent(e,"htmx:error",{errorInfo:r}));let o=e.dispatchEvent(a),s=kebabEventName(t);if(o&&s!==t){let l=makeEvent(s,a.detail);o=o&&e.dispatchEvent(l)}return withExtensions(asElement(e),function(l){o=o&&l.onEvent(t,a)!==!1&&!a.defaultPrevented}),o}let currentPathForHistory;function setCurrentPathForHistory(e){currentPathForHistory=e,canAccessLocalStorage()&&sessionStorage.setItem("htmx-current-path-for-history",e)}setCurrentPathForHistory(location.pathname+location.search);function getHistoryElement(){return getDocument().querySelector("[hx-history-elt],[data-hx-history-elt]")||getDocument().body}function saveToHistoryCache(e,t){if(!canAccessLocalStorage())return;let r=cleanInnerHtmlForHistory(t),a=getDocument().title,o=window.scrollY;if(htmx.config.historyCacheSize<=0){sessionStorage.removeItem("htmx-history-cache");return}e=normalizePath(e);let s=parseJSON(sessionStorage.getItem("htmx-history-cache"))||[];for(let f=0;f<s.length;f++)if(s[f].url===e){s.splice(f,1);break}let l={url:e,content:r,title:a,scroll:o};for(triggerEvent(getDocument().body,"htmx:historyItemCreated",{item:l,cache:s}),s.push(l);s.length>htmx.config.historyCacheSize;)s.shift();for(;s.length>0;)try{sessionStorage.setItem("htmx-history-cache",JSON.stringify(s));break}catch(f){triggerErrorEvent(getDocument().body,"htmx:historyCacheError",{cause:f,cache:s}),s.shift()}}function getCachedHistory(e){if(!canAccessLocalStorage())return null;e=normalizePath(e);let t=parseJSON(sessionStorage.getItem("htmx-history-cache"))||[];for(let r=0;r<t.length;r++)if(t[r].url===e)return t[r];return null}function cleanInnerHtmlForHistory(e){let t=htmx.config.requestClass,r=e.cloneNode(!0);return forEach(findAll(r,"."+t),function(a){removeClassFromElement(a,t)}),forEach(findAll(r,"[data-disabled-by-htmx]"),function(a){a.removeAttribute("disabled")}),r.innerHTML}function saveCurrentPageToHistory(){let e=getHistoryElement(),t=currentPathForHistory;canAccessLocalStorage()&&(t=sessionStorage.getItem("htmx-current-path-for-history")),t=t||location.pathname+location.search,getDocument().querySelector('[hx-history="false" i],[data-hx-history="false" i]')||(triggerEvent(getDocument().body,"htmx:beforeHistorySave",{path:t,historyElt:e}),saveToHistoryCache(t,e)),htmx.config.historyEnabled&&history.replaceState({htmx:!0},getDocument().title,location.href)}function pushUrlIntoHistory(e){htmx.config.getCacheBusterParam&&(e=e.replace(/org\.htmx\.cache-buster=[^&]*&?/,""),(endsWith(e,"&")||endsWith(e,"?"))&&(e=e.slice(0,-1))),htmx.config.historyEnabled&&history.pushState({htmx:!0},"",e),setCurrentPathForHistory(e)}function replaceUrlInHistory(e){htmx.config.historyEnabled&&history.replaceState({htmx:!0},"",e),setCurrentPathForHistory(e)}function settleImmediately(e){forEach(e,function(t){t.call(void 0)})}function loadHistoryFromServer(e){let t=new XMLHttpRequest,r={swapStyle:"innerHTML",swapDelay:0,settleDelay:0},a={path:e,xhr:t,historyElt:getHistoryElement(),swapSpec:r};t.open("GET",e,!0),htmx.config.historyRestoreAsHxRequest&&t.setRequestHeader("HX-Request","true"),t.setRequestHeader("HX-History-Restore-Request","true"),t.setRequestHeader("HX-Current-URL",location.href),t.onload=function(){this.status>=200&&this.status<400?(a.response=this.response,triggerEvent(getDocument().body,"htmx:historyCacheMissLoad",a),swap(a.historyElt,a.response,r,{contextElement:a.historyElt,historyRequest:!0}),setCurrentPathForHistory(a.path),triggerEvent(getDocument().body,"htmx:historyRestore",{path:e,cacheMiss:!0,serverResponse:a.response})):triggerErrorEvent(getDocument().body,"htmx:historyCacheMissLoadError",a)},triggerEvent(getDocument().body,"htmx:historyCacheMiss",a)&&t.send()}function restoreHistory(e){saveCurrentPageToHistory(),e=e||location.pathname+location.search;let t=getCachedHistory(e);if(t){let r={swapStyle:"innerHTML",swapDelay:0,settleDelay:0,scroll:t.scroll},a={path:e,item:t,historyElt:getHistoryElement(),swapSpec:r};triggerEvent(getDocument().body,"htmx:historyCacheHit",a)&&(swap(a.historyElt,t.content,r,{contextElement:a.historyElt,title:t.title}),setCurrentPathForHistory(a.path),triggerEvent(getDocument().body,"htmx:historyRestore",a))}else htmx.config.refreshOnHistoryMiss?htmx.location.reload(!0):loadHistoryFromServer(e)}function addRequestIndicatorClasses(e){let t=findAttributeTargets(e,"hx-indicator");return t==null&&(t=[e]),forEach(t,function(r){let a=getInternalData(r);a.requestCount=(a.requestCount||0)+1,r.classList.add.call(r.classList,htmx.config.requestClass)}),t}function disableElements(e){let t=findAttributeTargets(e,"hx-disabled-elt");return t==null&&(t=[]),forEach(t,function(r){let a=getInternalData(r);a.requestCount=(a.requestCount||0)+1,r.setAttribute("disabled",""),r.setAttribute("data-disabled-by-htmx","")}),t}function removeRequestIndicators(e,t){forEach(e.concat(t),function(r){let a=getInternalData(r);a.requestCount=(a.requestCount||1)-1}),forEach(e,function(r){getInternalData(r).requestCount===0&&r.classList.remove.call(r.classList,htmx.config.requestClass)}),forEach(t,function(r){getInternalData(r).requestCount===0&&(r.removeAttribute("disabled"),r.removeAttribute("data-disabled-by-htmx"))})}function haveSeenNode(e,t){for(let r=0;r<e.length;r++)if(e[r].isSameNode(t))return!0;return!1}function shouldInclude(e){let t=e;return t.name===""||t.name==null||t.disabled||closest(t,"fieldset[disabled]")||t.type==="button"||t.type==="submit"||t.tagName==="image"||t.tagName==="reset"||t.tagName==="file"?!1:t.type==="checkbox"||t.type==="radio"?t.checked:!0}function addValueToFormData(e,t,r){e!=null&&t!=null&&(Array.isArray(t)?t.forEach(function(a){r.append(e,a)}):r.append(e,t))}function removeValueFromFormData(e,t,r){if(e!=null&&t!=null){let a=r.getAll(e);Array.isArray(t)?a=a.filter(o=>t.indexOf(o)<0):a=a.filter(o=>o!==t),r.delete(e),forEach(a,o=>r.append(e,o))}}function getValueFromInput(e){return e instanceof HTMLSelectElement&&e.multiple?toArray(e.querySelectorAll("option:checked")).map(function(t){return t.value}):e instanceof HTMLInputElement&&e.files?toArray(e.files):e.value}function processInputValue(e,t,r,a,o){if(!(a==null||haveSeenNode(e,a))){if(e.push(a),shouldInclude(a)){let s=getRawAttribute(a,"name");addValueToFormData(s,getValueFromInput(a),t),o&&validateElement(a,r)}a instanceof HTMLFormElement&&(forEach(a.elements,function(s){e.indexOf(s)>=0?removeValueFromFormData(s.name,getValueFromInput(s),t):e.push(s),o&&validateElement(s,r)}),new FormData(a).forEach(function(s,l){s instanceof File&&s.name===""||addValueToFormData(l,s,t)}))}}function validateElement(e,t){let r=e;r.willValidate&&(triggerEvent(r,"htmx:validation:validate"),r.checkValidity()||(triggerEvent(r,"htmx:validation:failed",{message:r.validationMessage,validity:r.validity})&&!t.length&&htmx.config.reportValidityOfForms&&r.reportValidity(),t.push({elt:r,message:r.validationMessage,validity:r.validity})))}function overrideFormData(e,t){for(let r of t.keys())e.delete(r);return t.forEach(function(r,a){e.append(a,r)}),e}function getInputValues(e,t){let r=[],a=new FormData,o=new FormData,s=[],l=getInternalData(e);l.lastButtonClicked&&!bodyContains(l.lastButtonClicked)&&(l.lastButtonClicked=null);let f=e instanceof HTMLFormElement&&e.noValidate!==!0||getAttributeValue(e,"hx-validate")==="true";if(l.lastButtonClicked&&(f=f&&l.lastButtonClicked.formNoValidate!==!0),t!=="get"&&processInputValue(r,o,s,getRelatedForm(e),f),processInputValue(r,a,s,e,f),l.lastButtonClicked||e.tagName==="BUTTON"||e.tagName==="INPUT"&&getRawAttribute(e,"type")==="submit"){let u=l.lastButtonClicked||e,c=getRawAttribute(u,"name");addValueToFormData(c,u.value,o)}let n=findAttributeTargets(e,"hx-include");return forEach(n,function(u){processInputValue(r,a,s,asElement(u),f),matches(u,"form")||forEach(asParentNode(u).querySelectorAll(INPUT_SELECTOR),function(c){processInputValue(r,a,s,c,f)})}),overrideFormData(a,o),{errors:s,formData:a,values:formDataProxy(a)}}function appendParam(e,t,r){e!==""&&(e+="&"),String(r)==="[object Object]"&&(r=JSON.stringify(r));let a=encodeURIComponent(r);return e+=encodeURIComponent(t)+"="+a,e}function urlEncode(e){e=formDataFromObject(e);let t="";return e.forEach(function(r,a){t=appendParam(t,a,r)}),t}function getHeaders(e,t,r){let a={"HX-Request":"true","HX-Trigger":getRawAttribute(e,"id"),"HX-Trigger-Name":getRawAttribute(e,"name"),"HX-Target":getAttributeValue(t,"id"),"HX-Current-URL":location.href};return getValuesForElement(e,"hx-headers",!1,a),r!==void 0&&(a["HX-Prompt"]=r),getInternalData(e).boosted&&(a["HX-Boosted"]="true"),a}function filterValues(e,t){let r=getClosestAttributeValue(t,"hx-params");if(r){if(r==="none")return new FormData;if(r==="*")return e;if(r.indexOf("not ")===0)return forEach(r.slice(4).split(","),function(a){a=a.trim(),e.delete(a)}),e;{let a=new FormData;return forEach(r.split(","),function(o){o=o.trim(),e.has(o)&&e.getAll(o).forEach(function(s){a.append(o,s)})}),a}}else return e}function isAnchorLink(e){return!!getRawAttribute(e,"href")&&getRawAttribute(e,"href").indexOf("#")>=0}function getSwapSpecification(e,t){let r=t||getClosestAttributeValue(e,"hx-swap"),a={swapStyle:getInternalData(e).boosted?"innerHTML":htmx.config.defaultSwapStyle,swapDelay:htmx.config.defaultSwapDelay,settleDelay:htmx.config.defaultSettleDelay};if(htmx.config.scrollIntoViewOnBoost&&getInternalData(e).boosted&&!isAnchorLink(e)&&(a.show="top"),r){let l=splitOnWhitespace(r);if(l.length>0)for(let f=0;f<l.length;f++){let n=l[f];if(n.indexOf("swap:")===0)a.swapDelay=parseInterval(n.slice(5));else if(n.indexOf("settle:")===0)a.settleDelay=parseInterval(n.slice(7));else if(n.indexOf("transition:")===0)a.transition=n.slice(11)==="true";else if(n.indexOf("ignoreTitle:")===0)a.ignoreTitle=n.slice(12)==="true";else if(n.indexOf("scroll:")===0){var o=n.slice(7).split(":");let c=o.pop();var s=o.length>0?o.join(":"):null;a.scroll=c,a.scrollTarget=s}else if(n.indexOf("show:")===0){var o=n.slice(5).split(":");let i=o.pop();var s=o.length>0?o.join(":"):null;a.show=i,a.showTarget=s}else if(n.indexOf("focus-scroll:")===0){let u=n.slice(13);a.focusScroll=u=="true"}else f==0?a.swapStyle=n:logError("Unknown modifier in hx-swap: "+n)}}return a}function usesFormData(e){return getClosestAttributeValue(e,"hx-encoding")==="multipart/form-data"||matches(e,"form")&&getRawAttribute(e,"enctype")==="multipart/form-data"}function encodeParamsForBody(e,t,r){let a=null;return withExtensions(t,function(o){a==null&&(a=o.encodeParameters(e,r,t))}),a??(usesFormData(t)?overrideFormData(new FormData,formDataFromObject(r)):urlEncode(r))}function makeSettleInfo(e){return{tasks:[],elts:[e]}}function updateScrollState(e,t){let r=e[0],a=e[e.length-1];if(t.scroll){var o=null;t.scrollTarget&&(o=asElement(querySelectorExt(r,t.scrollTarget))),t.scroll==="top"&&(r||o)&&(o=o||r,o.scrollTop=0),t.scroll==="bottom"&&(a||o)&&(o=o||a,o.scrollTop=o.scrollHeight),typeof t.scroll=="number"&&getWindow().setTimeout(function(){window.scrollTo(0,t.scroll)},0)}if(t.show){var o=null;if(t.showTarget){let l=t.showTarget;t.showTarget==="window"&&(l="body"),o=asElement(querySelectorExt(r,l))}t.show==="top"&&(r||o)&&(o=o||r,o.scrollIntoView({block:"start",behavior:htmx.config.scrollBehavior})),t.show==="bottom"&&(a||o)&&(o=o||a,o.scrollIntoView({block:"end",behavior:htmx.config.scrollBehavior}))}}function getValuesForElement(e,t,r,a,o){if(a==null&&(a={}),e==null)return a;let s=getAttributeValue(e,t);if(s){let l=s.trim(),f=r;if(l==="unset")return null;l.indexOf("javascript:")===0?(l=l.slice(11),f=!0):l.indexOf("js:")===0&&(l=l.slice(3),f=!0),l.indexOf("{")!==0&&(l="{"+l+"}");let n;f?n=maybeEval(e,function(){return o?Function("event","return ("+l+")").call(e,o):Function("return ("+l+")").call(e)},{}):n=parseJSON(l);for(let u in n)n.hasOwnProperty(u)&&a[u]==null&&(a[u]=n[u])}return getValuesForElement(asElement(parentElt(e)),t,r,a,o)}function maybeEval(e,t,r){return htmx.config.allowEval?t():(triggerErrorEvent(e,"htmx:evalDisallowedError"),r)}function getHXVarsForElement(e,t,r){return getValuesForElement(e,"hx-vars",!0,r,t)}function getHXValsForElement(e,t,r){return getValuesForElement(e,"hx-vals",!1,r,t)}function getExpressionVars(e,t){return mergeObjects(getHXVarsForElement(e,t),getHXValsForElement(e,t))}function safelySetHeaderValue(e,t,r){if(r!==null)try{e.setRequestHeader(t,r)}catch{e.setRequestHeader(t,encodeURIComponent(r)),e.setRequestHeader(t+"-URI-AutoEncoded","true")}}function getPathFromResponse(e){if(e.responseURL)try{let t=new URL(e.responseURL);return t.pathname+t.search}catch{triggerErrorEvent(getDocument().body,"htmx:badResponseUrl",{url:e.responseURL})}}function hasHeader(e,t){return t.test(e.getAllResponseHeaders())}function ajaxHelper(e,t,r){if(e=e.toLowerCase(),r){if(r instanceof Element||typeof r=="string")return issueAjaxRequest(e,t,null,null,{targetOverride:resolveTarget(r)||DUMMY_ELT,returnPromise:!0});{let a=resolveTarget(r.target);return(r.target&&!a||r.source&&!a&&!resolveTarget(r.source))&&(a=DUMMY_ELT),issueAjaxRequest(e,t,resolveTarget(r.source),r.event,{handler:r.handler,headers:r.headers,values:r.values,targetOverride:a,swapOverride:r.swap,select:r.select,returnPromise:!0,push:r.push,replace:r.replace,selectOOB:r.selectOOB})}}else return issueAjaxRequest(e,t,null,null,{returnPromise:!0})}function hierarchyForElt(e){let t=[];for(;e;)t.push(e),e=e.parentElement;return t}function verifyPath(e,t,r){let a=new URL(t,location.protocol!=="about:"?location.href:window.origin),s=(location.protocol!=="about:"?location.origin:window.origin)===a.origin;return htmx.config.selfRequestsOnly&&!s?!1:triggerEvent(e,"htmx:validateUrl",mergeObjects({url:a,sameHost:s},r))}function formDataFromObject(e){if(e instanceof FormData)return e;let t=new FormData;for(let r in e)e.hasOwnProperty(r)&&(e[r]&&typeof e[r].forEach=="function"?e[r].forEach(function(a){t.append(r,a)}):typeof e[r]=="object"&&!(e[r]instanceof Blob)?t.append(r,JSON.stringify(e[r])):t.append(r,e[r]));return t}function formDataArrayProxy(e,t,r){return new Proxy(r,{get:function(a,o){return typeof o=="number"?a[o]:o==="length"?a.length:o==="push"?function(s){a.push(s),e.append(t,s)}:typeof a[o]=="function"?function(){a[o].apply(a,arguments),e.delete(t),a.forEach(function(s){e.append(t,s)})}:a[o]&&a[o].length===1?a[o][0]:a[o]},set:function(a,o,s){return a[o]=s,e.delete(t),a.forEach(function(l){e.append(t,l)}),!0}})}function formDataProxy(e){return new Proxy(e,{get:function(t,r){if(typeof r=="symbol"){let o=Reflect.get(t,r);return typeof o=="function"?function(){return o.apply(e,arguments)}:o}if(r==="toJSON")return()=>Object.fromEntries(e);if(r in t&&typeof t[r]=="function")return function(){return e[r].apply(e,arguments)};let a=e.getAll(r);if(a.length!==0)return a.length===1?a[0]:formDataArrayProxy(t,r,a)},set:function(t,r,a){return typeof r!="string"?!1:(t.delete(r),a&&typeof a.forEach=="function"?a.forEach(function(o){t.append(r,o)}):typeof a=="object"&&!(a instanceof Blob)?t.append(r,JSON.stringify(a)):t.append(r,a),!0)},deleteProperty:function(t,r){return typeof r=="string"&&t.delete(r),!0},ownKeys:function(t){return Reflect.ownKeys(Object.fromEntries(t))},getOwnPropertyDescriptor:function(t,r){return Reflect.getOwnPropertyDescriptor(Object.fromEntries(t),r)}})}function issueAjaxRequest(e,t,r,a,o,s){let l=null,f=null;if(o=o??{},o.returnPromise&&typeof Promise<"u")var n=new Promise(function(h,E){l=h,f=E});r==null&&(r=getDocument().body);let u=o.handler||handleAjaxResponse,c=o.select||null;if(!bodyContains(r))return maybeCall(l),n;let i=o.targetOverride||asElement(getTarget(r));if(i==null||i==DUMMY_ELT)return triggerErrorEvent(r,"htmx:targetError",{target:getClosestAttributeValue(r,"hx-target")}),maybeCall(f),n;let d=getInternalData(r),S=d.lastButtonClicked;if(S){let h=getRawAttribute(S,"formaction");h!=null&&(t=h);let E=getRawAttribute(S,"formmethod");if(E!=null)if(VERBS.includes(E.toLowerCase()))e=E;else return maybeCall(l),n}let m=getClosestAttributeValue(r,"hx-confirm");if(s===void 0&&triggerEvent(r,"htmx:confirm",{target:i,elt:r,path:t,verb:e,triggeringEvent:a,etc:o,issueRequest:function(T){return issueAjaxRequest(e,t,r,a,o,!!T)},question:m})===!1)return maybeCall(l),n;let C=r,p=getClosestAttributeValue(r,"hx-sync"),w=null,y=!1;if(p){let h=p.split(":"),E=h[0].trim();if(E==="this"?C=findThisElement(r,"hx-sync"):C=asElement(querySelectorExt(r,E)),p=(h[1]||"drop").trim(),d=getInternalData(C),p==="drop"&&d.xhr&&d.abortable!==!0)return maybeCall(l),n;if(p==="abort"){if(d.xhr)return maybeCall(l),n;y=!0}else p==="replace"?triggerEvent(C,"htmx:abort"):p.indexOf("queue")===0&&(w=(p.split(" ")[1]||"last").trim())}if(d.xhr)if(d.abortable)triggerEvent(C,"htmx:abort");else{if(w==null){if(a){let h=getInternalData(a);h&&h.triggerSpec&&h.triggerSpec.queue&&(w=h.triggerSpec.queue)}w==null&&(w="last")}return d.queuedRequests==null&&(d.queuedRequests=[]),w==="first"&&d.queuedRequests.length===0?d.queuedRequests.push(function(){issueAjaxRequest(e,t,r,a,o)}):w==="all"?d.queuedRequests.push(function(){issueAjaxRequest(e,t,r,a,o)}):w==="last"&&(d.queuedRequests=[],d.queuedRequests.push(function(){issueAjaxRequest(e,t,r,a,o)})),maybeCall(l),n}let g=new XMLHttpRequest;d.xhr=g,d.abortable=y;let x=function(){d.xhr=null,d.abortable=!1,d.queuedRequests!=null&&d.queuedRequests.length>0&&d.queuedRequests.shift()()},Se=getClosestAttributeValue(r,"hx-prompt");if(Se){var U=prompt(Se);if(U===null||!triggerEvent(r,"htmx:prompt",{prompt:U,target:i}))return maybeCall(l),x(),n}if(m&&!s&&!confirm(m))return maybeCall(l),x(),n;let D=getHeaders(r,i,U);e!=="get"&&!usesFormData(r)&&(D["Content-Type"]="application/x-www-form-urlencoded"),o.headers&&(D=mergeObjects(D,o.headers));let ye=getInputValues(r,e),R=ye.errors,we=ye.formData;o.values&&overrideFormData(we,formDataFromObject(o.values));let Be=formDataFromObject(getExpressionVars(r,a)),N=overrideFormData(we,Be),k=filterValues(N,r);htmx.config.getCacheBusterParam&&e==="get"&&k.set("org.htmx.cache-buster",getRawAttribute(i,"id")||"true"),(t==null||t==="")&&(t=location.href);let V=getValuesForElement(r,"hx-request"),Ee=getInternalData(r).boosted,M=htmx.config.methodsThatUseUrlParams.indexOf(e)>=0,v={boosted:Ee,useUrlParams:M,formData:k,parameters:formDataProxy(k),unfilteredFormData:N,unfilteredParameters:formDataProxy(N),headers:D,elt:r,target:i,verb:e,errors:R,withCredentials:o.credentials||V.credentials||htmx.config.withCredentials,timeout:o.timeout||V.timeout||htmx.config.timeout,path:t,triggeringEvent:a};if(!triggerEvent(r,"htmx:configRequest",v))return maybeCall(l),x(),n;if(t=v.path,e=v.verb,D=v.headers,k=formDataFromObject(v.parameters),R=v.errors,M=v.useUrlParams,R&&R.length>0)return triggerEvent(r,"htmx:validation:halted",v),maybeCall(l),x(),n;let be=t.split("#"),qe=be[0],W=be[1],A=t;if(M&&(A=qe,!k.keys().next().done&&(A.indexOf("?")<0?A+="?":A+="&",A+=urlEncode(k),W&&(A+="#"+W))),!verifyPath(r,A,v))return triggerErrorEvent(r,"htmx:invalidPath",v),maybeCall(f),x(),n;if(g.open(e.toUpperCase(),A,!0),g.overrideMimeType("text/html"),g.withCredentials=v.withCredentials,g.timeout=v.timeout,!V.noHeaders){for(let h in D)if(D.hasOwnProperty(h)){let E=D[h];safelySetHeaderValue(g,h,E)}}let b={xhr:g,target:i,requestConfig:v,etc:o,boosted:Ee,select:c,pathInfo:{requestPath:t,finalRequestPath:A,responsePath:null,anchor:W}};if(g.onload=function(){try{let h=hierarchyForElt(r);if(b.pathInfo.responsePath=getPathFromResponse(g),u(r,b),b.keepIndicators!==!0&&removeRequestIndicators(F,H),triggerEvent(r,"htmx:afterRequest",b),triggerEvent(r,"htmx:afterOnLoad",b),!bodyContains(r)){let E=null;for(;h.length>0&&E==null;){let T=h.shift();bodyContains(T)&&(E=T)}E&&(triggerEvent(E,"htmx:afterRequest",b),triggerEvent(E,"htmx:afterOnLoad",b))}maybeCall(l)}catch(h){throw triggerErrorEvent(r,"htmx:onLoadError",mergeObjects({error:h},b)),h}finally{x()}},g.onerror=function(){removeRequestIndicators(F,H),triggerErrorEvent(r,"htmx:afterRequest",b),triggerErrorEvent(r,"htmx:sendError",b),maybeCall(f),x()},g.onabort=function(){removeRequestIndicators(F,H),triggerErrorEvent(r,"htmx:afterRequest",b),triggerErrorEvent(r,"htmx:sendAbort",b),maybeCall(f),x()},g.ontimeout=function(){removeRequestIndicators(F,H),triggerErrorEvent(r,"htmx:afterRequest",b),triggerErrorEvent(r,"htmx:timeout",b),maybeCall(f),x()},!triggerEvent(r,"htmx:beforeRequest",b))return maybeCall(l),x(),n;var F=addRequestIndicatorClasses(r),H=disableElements(r);forEach(["loadstart","loadend","progress","abort"],function(h){forEach([g,g.upload],function(E){E.addEventListener(h,function(T){triggerEvent(r,"htmx:xhr:"+h,{lengthComputable:T.lengthComputable,loaded:T.loaded,total:T.total})})})}),triggerEvent(r,"htmx:beforeSend",b);let Oe=M?null:encodeParamsForBody(g,r,k);return g.send(Oe),n}function determineHistoryUpdates(e,t){let r=t.xhr,a=null,o=null;if(hasHeader(r,/HX-Push:/i)?(a=r.getResponseHeader("HX-Push"),o="push"):hasHeader(r,/HX-Push-Url:/i)?(a=r.getResponseHeader("HX-Push-Url"),o="push"):hasHeader(r,/HX-Replace-Url:/i)&&(a=r.getResponseHeader("HX-Replace-Url"),o="replace"),a)return a==="false"?{}:{type:o,path:a};let s=t.pathInfo.finalRequestPath,l=t.pathInfo.responsePath,f=t.etc.push||getClosestAttributeValue(e,"hx-push-url"),n=t.etc.replace||getClosestAttributeValue(e,"hx-replace-url"),u=getInternalData(e).boosted,c=null,i=null;return f?(c="push",i=f):n?(c="replace",i=n):u&&(c="push",i=l||s),i?i==="false"?{}:(i==="true"&&(i=l||s),t.pathInfo.anchor&&i.indexOf("#")===-1&&(i=i+"#"+t.pathInfo.anchor),{type:c,path:i}):{}}function codeMatches(e,t){var r=new RegExp(e.code);return r.test(t.toString(10))}function resolveResponseHandling(e){for(var t=0;t<htmx.config.responseHandling.length;t++){var r=htmx.config.responseHandling[t];if(codeMatches(r,e.status))return r}return{swap:!1}}function handleTitle(e){if(e){let t=find("title");t?t.textContent=e:window.document.title=e}}function resolveRetarget(e,t){if(t==="this")return e;let r=asElement(querySelectorExt(e,t));if(r==null)throw triggerErrorEvent(e,"htmx:targetError",{target:t}),new Error(`Invalid re-target ${t}`);return r}function handleAjaxResponse(e,t){let r=t.xhr,a=t.target,o=t.etc,s=t.select;if(!triggerEvent(e,"htmx:beforeOnLoad",t))return;if(hasHeader(r,/HX-Trigger:/i)&&handleTriggerHeader(r,"HX-Trigger",e),hasHeader(r,/HX-Location:/i)){let y=r.getResponseHeader("HX-Location");var l={};y.indexOf("{")===0&&(l=parseJSON(y),y=l.path,delete l.path),l.push=l.push||"true",ajaxHelper("get",y,l);return}let f=hasHeader(r,/HX-Refresh:/i)&&r.getResponseHeader("HX-Refresh")==="true";if(hasHeader(r,/HX-Redirect:/i)){t.keepIndicators=!0,htmx.location.href=r.getResponseHeader("HX-Redirect"),f&&htmx.location.reload();return}if(f){t.keepIndicators=!0,htmx.location.reload();return}let n=determineHistoryUpdates(e,t),u=resolveResponseHandling(r),c=u.swap,i=!!u.error,d=htmx.config.ignoreTitle||u.ignoreTitle,S=u.select;u.target&&(t.target=resolveRetarget(e,u.target));var m=o.swapOverride;m==null&&u.swapOverride&&(m=u.swapOverride),hasHeader(r,/HX-Retarget:/i)&&(t.target=resolveRetarget(e,r.getResponseHeader("HX-Retarget"))),hasHeader(r,/HX-Reswap:/i)&&(m=r.getResponseHeader("HX-Reswap"));var C=r.response,p=mergeObjects({shouldSwap:c,serverResponse:C,isError:i,ignoreTitle:d,selectOverride:S,swapOverride:m},t);if(!(u.event&&!triggerEvent(a,u.event,p))&&triggerEvent(a,"htmx:beforeSwap",p)){if(a=p.target,C=p.serverResponse,i=p.isError,d=p.ignoreTitle,S=p.selectOverride,m=p.swapOverride,t.target=a,t.failed=i,t.successful=!i,p.shouldSwap){r.status===286&&cancelPolling(e),withExtensions(e,function(x){C=x.transformResponse(C,r,e)}),n.type&&saveCurrentPageToHistory();var w=getSwapSpecification(e,m);w.hasOwnProperty("ignoreTitle")||(w.ignoreTitle=d),a.classList.add(htmx.config.swappingClass),s&&(S=s),hasHeader(r,/HX-Reselect:/i)&&(S=r.getResponseHeader("HX-Reselect"));let y=o.selectOOB||getClosestAttributeValue(e,"hx-select-oob"),g=getClosestAttributeValue(e,"hx-select");swap(a,C,w,{select:S==="unset"?null:S||g,selectOOB:y,eventInfo:t,anchor:t.pathInfo.anchor,contextElement:e,afterSwapCallback:function(){if(hasHeader(r,/HX-Trigger-After-Swap:/i)){let x=e;bodyContains(e)||(x=getDocument().body),handleTriggerHeader(r,"HX-Trigger-After-Swap",x)}},afterSettleCallback:function(){if(hasHeader(r,/HX-Trigger-After-Settle:/i)){let x=e;bodyContains(e)||(x=getDocument().body),handleTriggerHeader(r,"HX-Trigger-After-Settle",x)}},beforeSwapCallback:function(){n.type&&(triggerEvent(getDocument().body,"htmx:beforeHistoryUpdate",mergeObjects({history:n},t)),n.type==="push"?(pushUrlIntoHistory(n.path),triggerEvent(getDocument().body,"htmx:pushedIntoHistory",{path:n.path})):(replaceUrlInHistory(n.path),triggerEvent(getDocument().body,"htmx:replacedInHistory",{path:n.path})))}})}i&&triggerErrorEvent(e,"htmx:responseError",mergeObjects({error:"Response Status Error Code "+r.status+" from "+t.pathInfo.requestPath},t))}}let extensions={};function extensionBase(){return{init:function(e){return null},getSelectors:function(){return null},onEvent:function(e,t){return!0},transformResponse:function(e,t,r){return e},isInlineSwap:function(e){return!1},handleSwap:function(e,t,r,a){return!1},encodeParameters:function(e,t,r){return null}}}function defineExtension(e,t){t.init&&t.init(internalAPI),extensions[e]=mergeObjects(extensionBase(),t)}function removeExtension(e){delete extensions[e]}function getExtensions(e,t,r){if(t==null&&(t=[]),e==null)return t;r==null&&(r=[]);let a=getAttributeValue(e,"hx-ext");return a&&forEach(a.split(","),function(o){if(o=o.replace(/ /g,""),o.slice(0,7)=="ignore:"){r.push(o.slice(7));return}if(r.indexOf(o)<0){let s=extensions[o];s&&t.indexOf(s)<0&&t.push(s)}}),getExtensions(asElement(parentElt(e)),t,r)}var isReady=!1;getDocument().addEventListener("DOMContentLoaded",function(){isReady=!0});function ready(e){isReady||getDocument().readyState==="complete"?e():getDocument().addEventListener("DOMContentLoaded",e)}function insertIndicatorStyles(){if(htmx.config.includeIndicatorStyles!==!1){let e=htmx.config.inlineStyleNonce?` nonce="${htmx.config.inlineStyleNonce}"`:"",t=htmx.config.indicatorClass,r=htmx.config.requestClass;getDocument().head.insertAdjacentHTML("beforeend",`<style${e}>.${t}{opacity:0;visibility: hidden} .${r} .${t}, .${r}.${t}{opacity:1;visibility: visible;transition: opacity 200ms ease-in}</style>`)}}function getMetaConfig(){let e=getDocument().querySelector('meta[name="htmx-config"]');return e?parseJSON(e.content):null}function mergeMetaConfig(){let e=getMetaConfig();e&&(htmx.config=mergeObjects(htmx.config,e))}return ready(function(){mergeMetaConfig(),insertIndicatorStyles();let e=getDocument().body;processNode(e);let t=getDocument().querySelectorAll("[hx-trigger='restored'],[data-hx-trigger='restored']");e.addEventListener("htmx:abort",function(a){let o=a.detail.elt||a.target,s=getInternalData(o);s&&s.xhr&&s.xhr.abort()});let r=window.onpopstate?window.onpopstate.bind(window):null;window.onpopstate=function(a){a.state&&a.state.htmx?(restoreHistory(),forEach(t,function(o){triggerEvent(o,"htmx:restored",{document:getDocument(),triggerEvent})})):r&&r(a)},getWindow().setTimeout(function(){triggerEvent(e,"htmx:load",{}),e=null},0)}),htmx})(),ve=Ie;var Te=document.createElement("template");Te.innerHTML=` 2 2 <slot></slot> 3 3 4 4 <ul class="menu" part="menu"></ul> ··· 92 92 <span class="handle" part="handle"></span> 93 93 </button> 94 94 </li> 95 - `;function Ae(e){return e.cloneNode(!0)}var X=class extends HTMLElement{static tag="actor-typeahead";static define(t=this.tag){this.tag=t;let r=customElements.getName(this);if(r&&r!==t)return console.warn(`${this.name} already defined as <${r}>!`);let a=customElements.get(t);if(a&&a!==this)return console.warn(`<${t}> already defined as ${a.name}!`);customElements.define(t,this)}static{let t=new URL(import.meta.url).searchParams.get("tag")||this.tag;t!=="none"&&this.define(t)}#r=this.attachShadow({mode:"closed"});#a=[];#e=-1;#o=!1;constructor(){super(),this.#r.append(Ae(Te).content),this.#t(),this.addEventListener("input",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.#r.addEventListener("pointerdown",this),this.#r.addEventListener("pointerup",this),this.#r.addEventListener("click",this)}get#s(){let t=Number.parseInt(this.getAttribute("rows")??"");return Number.isNaN(t)?5:t}handleEvent(t){switch(t.type){case"input":this.#f(t);break;case"keydown":this.#l(t);break;case"focusout":this.#n(t);break;case"pointerdown":this.#u(t);break;case"pointerup":this.#i(t);break}}#l(t){switch(t.key){case"ArrowDown":t.preventDefault(),this.#e=Math.min(this.#e+1,this.#s-1),this.#t();break;case"PageDown":t.preventDefault(),this.#e=this.#s-1,this.#t();break;case"ArrowUp":t.preventDefault(),this.#e=Math.max(this.#e-1,0),this.#t();break;case"PageUp":t.preventDefault(),this.#e=0,this.#t();break;case"Escape":t.preventDefault(),this.#a=[],this.#e=-1,this.#t();break;case"Enter":t.preventDefault(),this.#r.querySelectorAll("button")[this.#e]?.dispatchEvent(new PointerEvent("pointerup",{bubbles:!0}));break}}async#f(t){let r=t.target?.value;if(!r){this.#a=[],this.#t();return}let a=this.getAttribute("host")??"https://public.api.bsky.app",o=new URL("xrpc/app.bsky.actor.searchActorsTypeahead",a);o.searchParams.set("q",r),o.searchParams.set("limit",`${this.#s}`);let l=await(await fetch(o)).json();this.#a=l.actors,this.#e=-1,this.#t()}async#n(t){this.#o||(this.#a=[],this.#e=-1,this.#t())}#t(){let t=document.createDocumentFragment(),r=-1;for(let a of this.#a){let o=Ae(De).content,s=o.querySelector("button");s&&(s.dataset.handle=a.handle,++r===this.#e&&(s.dataset.active="true"));let l=o.querySelector("img");l&&a.avatar&&(l.src=a.avatar);let f=o.querySelector(".handle");f&&(f.textContent=a.handle),t.append(o)}this.#r.querySelector(".menu")?.replaceChildren(...t.children)}#u(t){this.#o=!0}#i(t){this.#o=!1,this.querySelector("input")?.focus();let r=t.target?.closest("button"),a=this.querySelector("input");!a||!r||(a.value=r.dataset.handle||"",this.#a=[],this.#t())}};var B={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};var ke=([e,t,r])=>{let a=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.keys(t).forEach(o=>{a.setAttribute(o,String(t[o]))}),r?.length&&r.forEach(o=>{let s=ke(o);a.appendChild(s)}),a},Pe=(e,t={})=>{let a={...B,...t};return ke(["svg",a,e])};var Ue=e=>Array.from(e.attributes).reduce((t,r)=>(t[r.name]=r.value,t),{}),Ve=e=>typeof e=="string"?e:!e||!e.class?"":e.class&&typeof e.class=="string"?e.class.split(" "):e.class&&Array.isArray(e.class)?e.class:"",Ne=e=>e.flatMap(Ve).map(r=>r.trim()).filter(Boolean).filter((r,a,o)=>o.indexOf(r)===a).join(" "),We=e=>e.replace(/(\w)(\w*)(_|-|\s*)/g,(t,r,a)=>r.toUpperCase()+a.toLowerCase()),G=(e,{nameAttr:t,icons:r,attrs:a})=>{let o=e.getAttribute(t);if(o==null)return;let s=We(o),l=r[s];if(!l)return console.warn(`${e.outerHTML} icon name was not found in the provided icons object.`);let f=Ue(e),n={...B,"data-lucide":o,...a,...f},u=Ne(["lucide",`lucide-${o}`,f,a]);u&&Object.assign(n,{class:u});let c=Pe(l,n);return e.parentNode?.replaceChild(c,e)};var z=[["path",{d:"M12 17V3"}],["path",{d:"m6 11 6 6 6-6"}],["path",{d:"M19 21H5"}]];var _=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"}],["path",{d:"m3.3 7 8.7 5 8.7-5"}],["path",{d:"M12 22V12"}]];var j=[["path",{d:"M20 6 9 17l-5-5"}]];var $=[["path",{d:"m6 9 6 6 6-6"}]];var J=[["path",{d:"m15 18-6-6 6-6"}]];var K=[["path",{d:"m9 18 6-6-6-6"}]];var q=[["circle",{cx:"12",cy:"12",r:"10"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16"}]];var O=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335"}],["path",{d:"m9 11 3 3L22 4"}]];var P=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m15 9-6 6"}],["path",{d:"m9 9 6 6"}]];var Q=[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z"}],["circle",{cx:"12",cy:"12",r:"10"}]];var Z=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]];var Y=[["path",{d:"M12 15V3"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["path",{d:"m7 10 5 5 5-5"}]];var ee=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4"}],["path",{d:"M12 8h.01"}]];var I=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56"}]];var te=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"}]];var re=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z"}],["path",{d:"M12 22V12"}],["polyline",{points:"3.29 7 12 12 20.71 7"}],["path",{d:"m7.5 4.27 9 5.15"}]];var ae=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];var oe=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16"}],["path",{d:"M16 16h5v5"}]];var se=[["path",{d:"m21 21-4.34-4.34"}],["circle",{cx:"11",cy:"11",r:"8"}]];var le=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}],["path",{d:"m9 12 2 2 4-4"}]];var fe=[["path",{d:"M12 10.189V14"}],["path",{d:"M12 2v3"}],["path",{d:"M19 13V7a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v6"}],["path",{d:"M19.38 20A11.6 11.6 0 0 0 21 14l-8.188-3.639a2 2 0 0 0-1.624 0L3 14a11.6 11.6 0 0 0 2.81 7.76"}],["path",{d:"M2 21c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1s1.2 1 2.5 1c2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"}]];var ne=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z"}]];var ue=[["path",{d:"M12 2v2"}],["path",{d:"M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715"}],["path",{d:"M16 12a4 4 0 0 0-4-4"}],["path",{d:"m19 5-1.256 1.256"}],["path",{d:"M20 12h2"}]];var ie=[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M12 2v2"}],["path",{d:"M12 20v2"}],["path",{d:"m4.93 4.93 1.41 1.41"}],["path",{d:"m17.66 17.66 1.41 1.41"}],["path",{d:"M2 12h2"}],["path",{d:"M20 12h2"}],["path",{d:"m6.34 17.66-1.41 1.41"}],["path",{d:"m19.07 4.93-1.41 1.41"}]];var de=[["path",{d:"M12 19h8"}],["path",{d:"m4 17 6-6-6-6"}]];var me=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]];var L=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}],["path",{d:"M12 9v4"}],["path",{d:"M12 17h.01"}]];var ce=({icons:e={},nameAttr:t="data-lucide",attrs:r={},root:a=document,inTemplates:o}={})=>{if(!Object.values(e).length)throw new Error(`Please provide an icons object. 95 + `;function Ae(e){return e.cloneNode(!0)}var X=class extends HTMLElement{static tag="actor-typeahead";static define(t=this.tag){this.tag=t;let r=customElements.getName(this);if(r&&r!==t)return console.warn(`${this.name} already defined as <${r}>!`);let a=customElements.get(t);if(a&&a!==this)return console.warn(`<${t}> already defined as ${a.name}!`);customElements.define(t,this)}static{let t=new URL(import.meta.url).searchParams.get("tag")||this.tag;t!=="none"&&this.define(t)}#r=this.attachShadow({mode:"closed"});#a=[];#e=-1;#o=!1;constructor(){super(),this.#r.append(Ae(Te).content),this.#t(),this.addEventListener("input",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.#r.addEventListener("pointerdown",this),this.#r.addEventListener("pointerup",this),this.#r.addEventListener("click",this)}get#s(){let t=Number.parseInt(this.getAttribute("rows")??"");return Number.isNaN(t)?5:t}handleEvent(t){switch(t.type){case"input":this.#f(t);break;case"keydown":this.#l(t);break;case"focusout":this.#n(t);break;case"pointerdown":this.#u(t);break;case"pointerup":this.#i(t);break}}#l(t){switch(t.key){case"ArrowDown":t.preventDefault(),this.#e=Math.min(this.#e+1,this.#s-1),this.#t();break;case"PageDown":t.preventDefault(),this.#e=this.#s-1,this.#t();break;case"ArrowUp":t.preventDefault(),this.#e=Math.max(this.#e-1,0),this.#t();break;case"PageUp":t.preventDefault(),this.#e=0,this.#t();break;case"Escape":t.preventDefault(),this.#a=[],this.#e=-1,this.#t();break;case"Enter":t.preventDefault(),this.#r.querySelectorAll("button")[this.#e]?.dispatchEvent(new PointerEvent("pointerup",{bubbles:!0}));break}}async#f(t){let r=t.target?.value;if(!r){this.#a=[],this.#t();return}let a=this.getAttribute("host")??"https://public.api.bsky.app",o=new URL("xrpc/app.bsky.actor.searchActorsTypeahead",a);o.searchParams.set("q",r),o.searchParams.set("limit",`${this.#s}`);let l=await(await fetch(o)).json();this.#a=l.actors,this.#e=-1,this.#t()}async#n(t){this.#o||(this.#a=[],this.#e=-1,this.#t())}#t(){let t=document.createDocumentFragment(),r=-1;for(let a of this.#a){let o=Ae(De).content,s=o.querySelector("button");s&&(s.dataset.handle=a.handle,++r===this.#e&&(s.dataset.active="true"));let l=o.querySelector("img");l&&a.avatar&&(l.src=a.avatar);let f=o.querySelector(".handle");f&&(f.textContent=a.handle),t.append(o)}this.#r.querySelector(".menu")?.replaceChildren(...t.children)}#u(t){this.#o=!0}#i(t){this.#o=!1,this.querySelector("input")?.focus();let r=t.target?.closest("button"),a=this.querySelector("input");!a||!r||(a.value=r.dataset.handle||"",this.#a=[],this.#t())}};var B={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};var ke=([e,t,r])=>{let a=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.keys(t).forEach(o=>{a.setAttribute(o,String(t[o]))}),r?.length&&r.forEach(o=>{let s=ke(o);a.appendChild(s)}),a},Pe=(e,t={})=>{let a={...B,...t};return ke(["svg",a,e])};var Ue=e=>Array.from(e.attributes).reduce((t,r)=>(t[r.name]=r.value,t),{}),Ne=e=>typeof e=="string"?e:!e||!e.class?"":e.class&&typeof e.class=="string"?e.class.split(" "):e.class&&Array.isArray(e.class)?e.class:"",Ve=e=>e.flatMap(Ne).map(r=>r.trim()).filter(Boolean).filter((r,a,o)=>o.indexOf(r)===a).join(" "),We=e=>e.replace(/(\w)(\w*)(_|-|\s*)/g,(t,r,a)=>r.toUpperCase()+a.toLowerCase()),G=(e,{nameAttr:t,icons:r,attrs:a})=>{let o=e.getAttribute(t);if(o==null)return;let s=We(o),l=r[s];if(!l)return console.warn(`${e.outerHTML} icon name was not found in the provided icons object.`);let f=Ue(e),n={...B,"data-lucide":o,...a,...f},u=Ve(["lucide",`lucide-${o}`,f,a]);u&&Object.assign(n,{class:u});let c=Pe(l,n);return e.parentNode?.replaceChild(c,e)};var z=[["path",{d:"M12 17V3"}],["path",{d:"m6 11 6 6 6-6"}],["path",{d:"M19 21H5"}]];var _=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"}],["path",{d:"m3.3 7 8.7 5 8.7-5"}],["path",{d:"M12 22V12"}]];var j=[["path",{d:"M20 6 9 17l-5-5"}]];var J=[["path",{d:"m6 9 6 6 6-6"}]];var K=[["path",{d:"m15 18-6-6 6-6"}]];var $=[["path",{d:"m9 18 6-6-6-6"}]];var q=[["circle",{cx:"12",cy:"12",r:"10"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16"}]];var O=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335"}],["path",{d:"m9 11 3 3L22 4"}]];var P=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m15 9-6 6"}],["path",{d:"m9 9 6 6"}]];var Q=[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z"}],["circle",{cx:"12",cy:"12",r:"10"}]];var Z=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]];var Y=[["path",{d:"M12 15V3"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["path",{d:"m7 10 5 5 5-5"}]];var ee=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4"}],["path",{d:"M12 8h.01"}]];var I=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56"}]];var te=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"}]];var re=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z"}],["path",{d:"M12 22V12"}],["polyline",{points:"3.29 7 12 12 20.71 7"}],["path",{d:"m7.5 4.27 9 5.15"}]];var ae=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];var oe=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16"}],["path",{d:"M16 16h5v5"}]];var se=[["path",{d:"m21 21-4.34-4.34"}],["circle",{cx:"11",cy:"11",r:"8"}]];var le=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}],["path",{d:"m9 12 2 2 4-4"}]];var fe=[["path",{d:"M12 10.189V14"}],["path",{d:"M12 2v3"}],["path",{d:"M19 13V7a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v6"}],["path",{d:"M19.38 20A11.6 11.6 0 0 0 21 14l-8.188-3.639a2 2 0 0 0-1.624 0L3 14a11.6 11.6 0 0 0 2.81 7.76"}],["path",{d:"M2 21c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1s1.2 1 2.5 1c2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"}]];var ne=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z"}]];var ue=[["path",{d:"M12 2v2"}],["path",{d:"M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715"}],["path",{d:"M16 12a4 4 0 0 0-4-4"}],["path",{d:"m19 5-1.256 1.256"}],["path",{d:"M20 12h2"}]];var ie=[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M12 2v2"}],["path",{d:"M12 20v2"}],["path",{d:"m4.93 4.93 1.41 1.41"}],["path",{d:"m17.66 17.66 1.41 1.41"}],["path",{d:"M2 12h2"}],["path",{d:"M20 12h2"}],["path",{d:"m6.34 17.66-1.41 1.41"}],["path",{d:"m19.07 4.93-1.41 1.41"}]];var de=[["path",{d:"M12 19h8"}],["path",{d:"m4 17 6-6-6-6"}]];var me=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]];var L=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}],["path",{d:"M12 9v4"}],["path",{d:"M12 17h.01"}]];var ce=({icons:e={},nameAttr:t="data-lucide",attrs:r={},root:a=document,inTemplates:o}={})=>{if(!Object.values(e).length)throw new Error(`Please provide an icons object. 96 96 If you want to use all the icons you can import it like: 97 97 \`import { createIcons, icons } from 'lucide'; 98 - lucide.createIcons({icons});\``);if(typeof a>"u")throw new Error("`createIcons()` only works in a browser environment.");if(Array.from(a.querySelectorAll(`[${t}]`)).forEach(l=>G(l,{nameAttr:t,icons:e,attrs:r})),o&&Array.from(a.querySelectorAll("template")).forEach(f=>ce({icons:e,nameAttr:t,attrs:r,root:f.content,inTemplates:o})),t==="data-lucide"){let l=a.querySelectorAll("[icon-name]");l.length>0&&(console.warn("[Lucide] Some icons were found with the now deprecated icon-name attribute. These will still be replaced for backwards compatibility, but will no longer be supported in v1.0 and you should switch to data-lucide"),Array.from(l).forEach(f=>G(f,{nameAttr:"icon-name",icons:e,attrs:r})))}};function Re(){return localStorage.getItem("theme")||"system"}function Xe(e){return e==="dark"?"dark":e==="light"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function he(){let e=Re(),t=Xe(e);document.documentElement.classList.toggle("dark",t==="dark"),document.documentElement.setAttribute("data-theme",t),Ge(e)}function Me(e){localStorage.setItem("theme",e),he(),ze()}function Ge(e){let t={system:"sun-moon",light:"sun",dark:"moon"};document.querySelectorAll("[data-theme-icon]").forEach(r=>{r.setAttribute("data-lucide",t[e]||"sun-moon")}),typeof window.lucide<"u"&&window.lucide.createIcons(),document.querySelectorAll(".theme-option").forEach(r=>{let a=r.dataset.value===e,o=r.querySelector(".theme-check");o&&(o.style.visibility=a?"visible":"hidden")})}function ze(){document.querySelectorAll("[data-theme-toggle]").forEach(e=>{let t=e.closest("details");t&&t.removeAttribute("open")})}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Re()==="system"&&he()});function _e(){let e=document.querySelector(".nav-search-wrapper"),t=document.getElementById("nav-search-input");!e||!t||(e.classList.toggle("expanded"),e.classList.contains("expanded")&&t.focus())}function pe(){let e=document.querySelector(".nav-search-wrapper");e&&e.classList.remove("expanded")}document.addEventListener("DOMContentLoaded",()=>{let e=document.querySelector(".nav-search-wrapper"),t=document.getElementById("nav-search-input");!e||!t||(document.addEventListener("keydown",r=>{r.key==="Escape"&&e.classList.contains("expanded")&&pe()}),document.addEventListener("click",r=>{e.classList.contains("expanded")&&!e.contains(r.target)&&pe()}))});function Fe(e,t){!t&&typeof event<"u"&&(t=event.target.closest("button")),navigator.clipboard.writeText(e).then(()=>{if(!t)return;let r=t.innerHTML;t.innerHTML='<i data-lucide="check"></i> Copied!',typeof window.lucide<"u"&&window.lucide.createIcons(),setTimeout(()=>{t.innerHTML=r,typeof window.lucide<"u"&&window.lucide.createIcons()},2e3)}).catch(r=>{console.error("Failed to copy:",r)})}document.addEventListener("DOMContentLoaded",()=>{document.addEventListener("click",e=>{let t=e.target.closest("button[data-cmd]");if(t){Fe(t.getAttribute("data-cmd"),t);return}if(e.target.closest("a, button, input, .cmd"))return;let r=e.target.closest("[data-href]");r&&(window.location=r.getAttribute("data-href"))})});function je(e){let t=Math.floor((new Date-new Date(e))/1e3),r={year:31536e3,month:2592e3,week:604800,day:86400,hour:3600,minute:60,second:1};for(let[a,o]of Object.entries(r)){let s=Math.floor(t/o);if(s>=1)return s===1?`1 ${a} ago`:`${s} ${a}s ago`}return"just now"}function ge(){document.querySelectorAll("time[datetime]").forEach(e=>{let t=e.getAttribute("datetime");if(t&&!e.dataset.noUpdate){let r=je(t);e.textContent!==r&&(e.textContent=r)}})}document.addEventListener("DOMContentLoaded",()=>{ge(),he(),document.querySelectorAll("[data-theme-menu]").forEach(e=>{e.querySelectorAll(".theme-option").forEach(t=>{t.addEventListener("click",()=>{Me(t.dataset.value)})})})});document.addEventListener("htmx:afterSwap",ge);setInterval(ge,6e4);function $e(){let e=document.getElementById("show-offline-toggle"),t=document.querySelector(".manifests-list");!e||!t||(localStorage.setItem("showOfflineManifests",e.checked),e.checked?t.classList.add("show-offline"):t.classList.remove("show-offline"))}document.addEventListener("DOMContentLoaded",()=>{let e=document.getElementById("show-offline-toggle");if(!e)return;let t=localStorage.getItem("showOfflineManifests")==="true";e.checked=t;let r=document.querySelector(".manifests-list");r&&(t?r.classList.add("show-offline"):r.classList.remove("show-offline"))});async function Je(e,t,r){try{let a=await fetch(`/api/images/${e}/manifests/${t}`,{method:"DELETE",credentials:"include"});if(a.status===409){let o=await a.json();Ke(e,t,r,o.tags)}else if(a.ok)He(r);else{let o=await a.text();alert(`Failed to delete manifest: ${o}`)}}catch(a){console.error("Error deleting manifest:",a),alert(`Error deleting manifest: ${a.message}`)}}function Ke(e,t,r,a){let o=document.getElementById("manifest-delete-modal"),s=document.getElementById("manifest-delete-tags"),l=document.getElementById("confirm-manifest-delete-btn");s.innerHTML="",a.forEach(f=>{let n=document.createElement("li");n.textContent=f,s.appendChild(n)}),l.onclick=()=>Qe(e,t,r),o.style.display="flex"}function Ce(){let e=document.getElementById("manifest-delete-modal");e.style.display="none"}async function Qe(e,t,r){let a=document.getElementById("confirm-manifest-delete-btn"),o=a.textContent;try{a.disabled=!0,a.textContent="Deleting...";let s=await fetch(`/api/images/${e}/manifests/${t}?confirm=true`,{method:"DELETE",credentials:"include"});if(s.ok)Ce(),He(r),location.reload();else{let l=await s.text();alert(`Failed to delete manifest: ${l}`),a.disabled=!1,a.textContent=o}}catch(s){console.error("Error deleting manifest:",s),alert(`Error deleting manifest: ${s.message}`),a.disabled=!1,a.textContent=o}}function He(e){let t=document.getElementById(`manifest-${e}`);t&&t.remove()}document.addEventListener("DOMContentLoaded",()=>{let e=document.getElementById("manifest-delete-modal");e&&e.addEventListener("click",t=>{t.target===e&&Ce()})});var xe=class{constructor(t){this.input=t,this.typeahead=t.closest("actor-typeahead"),this.dropdown=null,this.currentFocus=-1,this.init()}init(){this.createDropdown(),this.input.addEventListener("focus",()=>this.handleFocus()),this.input.addEventListener("input",()=>this.handleInput()),this.input.addEventListener("keydown",t=>this.handleKeydown(t)),document.addEventListener("click",t=>{!this.input.contains(t.target)&&!this.dropdown.contains(t.target)&&this.hideDropdown()})}createDropdown(){this.dropdown=document.createElement("div"),this.dropdown.className="recent-accounts-dropdown",this.dropdown.style.display="none",this.typeahead?this.typeahead.insertAdjacentElement("afterend",this.dropdown):this.input.insertAdjacentElement("afterend",this.dropdown)}handleFocus(){this.input.value.trim().length<1&&this.showRecentAccounts()}handleInput(){this.input.value.trim().length>=1&&this.hideDropdown()}showRecentAccounts(){let t=this.getRecentAccounts();if(t.length===0){this.hideDropdown();return}this.dropdown.innerHTML="",this.currentFocus=-1;let r=document.createElement("div");r.className="recent-accounts-header",r.textContent="Recent accounts",this.dropdown.appendChild(r),t.forEach((a,o)=>{let s=document.createElement("div");s.className="recent-accounts-item",s.dataset.index=o,s.dataset.handle=a,s.textContent=a,s.addEventListener("click",()=>this.selectItem(a)),this.dropdown.appendChild(s)}),this.dropdown.style.display="block"}selectItem(t){this.input.value=t,this.hideDropdown(),this.input.focus()}hideDropdown(){this.dropdown.style.display="none",this.currentFocus=-1}handleKeydown(t){if(this.dropdown.style.display==="none")return;let r=this.dropdown.querySelectorAll(".recent-accounts-item");t.key==="ArrowDown"?(t.preventDefault(),this.currentFocus++,this.currentFocus>=r.length&&(this.currentFocus=0),this.updateFocus(r)):t.key==="ArrowUp"?(t.preventDefault(),this.currentFocus--,this.currentFocus<0&&(this.currentFocus=r.length-1),this.updateFocus(r)):t.key==="Enter"&&this.currentFocus>-1&&r[this.currentFocus]?(t.preventDefault(),this.selectItem(r[this.currentFocus].dataset.handle)):t.key==="Escape"&&this.hideDropdown()}updateFocus(t){t.forEach((r,a)=>{r.classList.toggle("focused",a===this.currentFocus)})}getRecentAccounts(){try{let t=localStorage.getItem("atcr_recent_handles");return t?JSON.parse(t):[]}catch{return[]}}saveRecentAccount(t){if(t)try{let r=this.getRecentAccounts();r=r.filter(a=>a!==t),r.unshift(t),r=r.slice(0,5),localStorage.setItem("atcr_recent_handles",JSON.stringify(r))}catch(r){console.error("Failed to save recent account:",r)}}};document.addEventListener("DOMContentLoaded",()=>{let e=document.getElementById("login-form"),t=document.getElementById("handle");e&&t&&new xe(t)});document.addEventListener("DOMContentLoaded",()=>{let e=document.cookie.split("; ").find(r=>r.startsWith("atcr_login_handle="));if(!e)return;let t=decodeURIComponent(e.split("=")[1]);if(t){try{let r="atcr_recent_handles",a=JSON.parse(localStorage.getItem(r)||"[]");a=a.filter(o=>o!==t),a.unshift(t),a=a.slice(0,5),localStorage.setItem(r,JSON.stringify(a))}catch(r){console.error("Failed to save recent account:",r)}document.cookie="atcr_login_handle=; path=/; max-age=0"}});function Le(){let e=document.getElementById("featured-carousel"),t=document.getElementById("carousel-prev"),r=document.getElementById("carousel-next");if(!e)return;let a=Array.from(e.querySelectorAll(".carousel-item"));if(a.length===0)return;let o=null,s=5e3,l=0,f=0,n=0;function u(){let y=a[0];if(!y)return;let g=getComputedStyle(e),x=parseFloat(g.gap)||24;l=y.offsetWidth+x,f=e.offsetWidth,n=e.scrollWidth}requestAnimationFrame(()=>{requestAnimationFrame(()=>{u(),p()})});let c;window.addEventListener("resize",()=>{clearTimeout(c),c=setTimeout(u,150)});function i(){return l||u(),l}function d(){return(!f||!l)&&u(),Math.round(f/l)||1}function S(){return(!n||!f)&&u(),n-f}function m(){let y=i(),g=S(),x=e.scrollLeft;x>=g-10?e.scrollTo({left:0,behavior:"smooth"}):e.scrollTo({left:x+y,behavior:"smooth"})}function C(){let y=i(),g=S(),x=e.scrollLeft;x<=10?e.scrollTo({left:g,behavior:"smooth"}):e.scrollTo({left:x-y,behavior:"smooth"})}t&&t.addEventListener("click",()=>{w(),C(),p()}),r&&r.addEventListener("click",()=>{w(),m(),p()});function p(){o||a.length<=d()||(o=setInterval(m,s))}function w(){o&&(clearInterval(o),o=null)}e.addEventListener("mouseenter",w),e.addEventListener("mouseleave",p)}document.addEventListener("DOMContentLoaded",()=>{"requestIdleCallback"in window?requestIdleCallback(Le,{timeout:2e3}):setTimeout(Le,100)});window.setTheme=Me;window.toggleSearch=_e;window.closeSearch=pe;window.copyToClipboard=Fe;window.toggleOfflineManifests=$e;window.deleteManifest=Je;window.closeManifestDeleteModal=Ce;window.htmx=be;var Ze=[["path",{d:"M12.337 0c-.475 0-.861 1.016-.861 2.269 0 .527.069 1.011.183 1.396a8.514 8.514 0 0 0-3.961 1.22 5.229 5.229 0 0 0-.595-1.093c-.606-.866-1.34-1.436-1.79-1.43a.381.381 0 0 0-.217.066c-.39.273-.123 1.326.596 2.353.267.381.559.705.84.948a8.683 8.683 0 0 0-1.528 1.716h1.734a7.179 7.179 0 0 1 5.381-2.421 7.18 7.18 0 0 1 5.382 2.42h1.733a8.687 8.687 0 0 0-1.32-1.53c.35-.249.735-.643 1.078-1.133.719-1.027.986-2.08.596-2.353a.382.382 0 0 0-.217-.065c-.45-.007-1.184.563-1.79 1.43a4.897 4.897 0 0 0-.676 1.325 8.52 8.52 0 0 0-3.899-1.42c.12-.39.193-.887.193-1.429 0-1.253-.386-2.269-.862-2.269zM1.624 9.443v5.162h1.358v-1.968h1.64v1.968h1.357V9.443H4.62v1.838H2.98V9.443zm5.912 0v5.162h3.21v-1.108H8.893v-.95h1.64v-1.142h-1.64v-.84h1.853V9.443zm4.698 0v5.162h3.218v-1.362h-1.86v-3.8zm4.706 0v5.162h1.364v-2.643l1.357 1.225 1.35-1.232v2.65h1.365V9.443h-.614l-2.1 1.914-2.109-1.914zm-11.82 7.28a8.688 8.688 0 0 0 1.412 1.548 5.206 5.206 0 0 0-.841.948c-.719 1.027-.985 2.08-.596 2.353.39.273 1.289-.338 2.007-1.364a5.23 5.23 0 0 0 .595-1.092 8.514 8.514 0 0 0 3.961 1.219 5.01 5.01 0 0 0-.183 1.396c0 1.253.386 2.269.861 2.269.476 0 .862-1.016.862-2.269 0-.542-.072-1.04-.193-1.43a8.52 8.52 0 0 0 3.9-1.42c.121.4.352.865.675 1.327.719 1.026 1.617 1.637 2.007 1.364.39-.273.123-1.326-.596-2.353-.343-.49-.727-.885-1.077-1.135a8.69 8.69 0 0 0 1.202-1.36h-1.771a7.174 7.174 0 0 1-5.227 2.252 7.174 7.174 0 0 1-5.226-2.252z",fill:"currentColor",stroke:"none"}]],Ye={Helm:Ze,AlertCircle:q,AlertTriangle:L,ArrowDownToLine:z,Box:_,Check:j,CheckCircle:O,ChevronDown:$,ChevronLeft:J,ChevronRight:K,CircleX:P,Compass:Q,Copy:Z,Download:Y,Info:ee,Loader2:I,Moon:te,Package:re,Plus:ae,RefreshCcw:oe,Search:se,ShieldCheck:le,Ship:fe,Star:ne,Sun:ie,SunMoon:ue,Terminal:de,Trash2:me,TriangleAlert:L,XCircle:P};window.lucide={createIcons:(e={})=>ce({icons:Ye,...e})};document.addEventListener("DOMContentLoaded",()=>{window.lucide.createIcons(),document.body.addEventListener("htmx:afterSwap",()=>{window.lucide.createIcons()})}); 98 + lucide.createIcons({icons});\``);if(typeof a>"u")throw new Error("`createIcons()` only works in a browser environment.");if(Array.from(a.querySelectorAll(`[${t}]`)).forEach(l=>G(l,{nameAttr:t,icons:e,attrs:r})),o&&Array.from(a.querySelectorAll("template")).forEach(f=>ce({icons:e,nameAttr:t,attrs:r,root:f.content,inTemplates:o})),t==="data-lucide"){let l=a.querySelectorAll("[icon-name]");l.length>0&&(console.warn("[Lucide] Some icons were found with the now deprecated icon-name attribute. These will still be replaced for backwards compatibility, but will no longer be supported in v1.0 and you should switch to data-lucide"),Array.from(l).forEach(f=>G(f,{nameAttr:"icon-name",icons:e,attrs:r})))}};function Re(){return localStorage.getItem("theme")||"system"}function Xe(e){return e==="dark"?"dark":e==="light"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function he(){let e=Re(),t=Xe(e);document.documentElement.classList.toggle("dark",t==="dark"),document.documentElement.setAttribute("data-theme",t),Ge(e)}function Me(e){localStorage.setItem("theme",e),he(),ze()}function Ge(e){let t={system:"sun-moon",light:"sun",dark:"moon"};document.querySelectorAll("[data-theme-icon]").forEach(r=>{r.setAttribute("data-lucide",t[e]||"sun-moon")}),typeof window.lucide<"u"&&window.lucide.createIcons(),document.querySelectorAll(".theme-option").forEach(r=>{let a=r.dataset.value===e,o=r.querySelector(".theme-check");o&&(o.style.visibility=a?"visible":"hidden")})}function ze(){document.querySelectorAll("[data-theme-toggle]").forEach(e=>{let t=e.closest("details");t&&t.removeAttribute("open")})}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Re()==="system"&&he()});function _e(){let e=document.querySelector(".nav-search-wrapper"),t=document.getElementById("nav-search-input");!e||!t||(e.classList.toggle("expanded"),e.classList.contains("expanded")&&t.focus())}function pe(){let e=document.querySelector(".nav-search-wrapper");e&&e.classList.remove("expanded")}document.addEventListener("DOMContentLoaded",()=>{let e=document.querySelector(".nav-search-wrapper"),t=document.getElementById("nav-search-input");!e||!t||(document.addEventListener("keydown",r=>{r.key==="Escape"&&e.classList.contains("expanded")&&pe()}),document.addEventListener("click",r=>{e.classList.contains("expanded")&&!e.contains(r.target)&&pe()}))});function Fe(e,t){!t&&typeof event<"u"&&(t=event.target.closest("button")),navigator.clipboard.writeText(e).then(()=>{if(!t)return;let r=t.innerHTML;t.innerHTML='<i data-lucide="check"></i> Copied!',typeof window.lucide<"u"&&window.lucide.createIcons(),setTimeout(()=>{t.innerHTML=r,typeof window.lucide<"u"&&window.lucide.createIcons()},2e3)}).catch(r=>{console.error("Failed to copy:",r)})}document.addEventListener("DOMContentLoaded",()=>{document.addEventListener("click",e=>{let t=e.target.closest("button[data-cmd]");if(t){Fe(t.getAttribute("data-cmd"),t);return}if(e.target.closest("a, button, input, .cmd"))return;let r=e.target.closest("[data-href]");r&&(window.location=r.getAttribute("data-href"))})});function je(e){let t=Math.floor((new Date-new Date(e))/1e3),r={year:31536e3,month:2592e3,week:604800,day:86400,hour:3600,minute:60,second:1};for(let[a,o]of Object.entries(r)){let s=Math.floor(t/o);if(s>=1)return s===1?`1 ${a} ago`:`${s} ${a}s ago`}return"just now"}function ge(){document.querySelectorAll("time[datetime]").forEach(e=>{let t=e.getAttribute("datetime");if(t&&!e.dataset.noUpdate){let r=je(t);e.textContent!==r&&(e.textContent=r)}})}document.addEventListener("DOMContentLoaded",()=>{ge(),he(),document.querySelectorAll("[data-theme-menu]").forEach(e=>{e.querySelectorAll(".theme-option").forEach(t=>{t.addEventListener("click",()=>{Me(t.dataset.value)})})})});document.addEventListener("htmx:afterSwap",ge);setInterval(ge,6e4);function Je(){let e=document.getElementById("show-offline-toggle"),t=document.querySelector(".manifests-list");!e||!t||(localStorage.setItem("showOfflineManifests",e.checked),e.checked?t.classList.add("show-offline"):t.classList.remove("show-offline"))}document.addEventListener("DOMContentLoaded",()=>{let e=document.getElementById("show-offline-toggle");if(!e)return;let t=localStorage.getItem("showOfflineManifests")==="true";e.checked=t;let r=document.querySelector(".manifests-list");r&&(t?r.classList.add("show-offline"):r.classList.remove("show-offline"))});async function Ke(e,t,r){try{let a=await fetch("/api/manifests",{method:"DELETE",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo:e,digest:t,confirm:!1})});if(a.status===409){let o=await a.json();$e(e,t,r,o.tags)}else if(a.ok)He(r);else{let o=await a.text();alert(`Failed to delete manifest: ${o}`)}}catch(a){console.error("Error deleting manifest:",a),alert(`Error deleting manifest: ${a.message}`)}}function $e(e,t,r,a){let o=document.getElementById("manifest-delete-modal"),s=document.getElementById("manifest-delete-tags"),l=document.getElementById("confirm-manifest-delete-btn");s.innerHTML="",a.forEach(f=>{let n=document.createElement("li");n.textContent=f,s.appendChild(n)}),l.onclick=()=>Qe(e,t,r),o.style.display="flex"}function Ce(){let e=document.getElementById("manifest-delete-modal");e.style.display="none"}async function Qe(e,t,r){let a=document.getElementById("confirm-manifest-delete-btn"),o=a.textContent;try{a.disabled=!0,a.textContent="Deleting...";let s=await fetch("/api/manifests",{method:"DELETE",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo:e,digest:t,confirm:!0})});if(s.ok)Ce(),He(r),location.reload();else{let l=await s.text();alert(`Failed to delete manifest: ${l}`),a.disabled=!1,a.textContent=o}}catch(s){console.error("Error deleting manifest:",s),alert(`Error deleting manifest: ${s.message}`),a.disabled=!1,a.textContent=o}}function He(e){let t=document.getElementById(`manifest-${e}`);t&&t.remove()}document.addEventListener("DOMContentLoaded",()=>{let e=document.getElementById("manifest-delete-modal");e&&e.addEventListener("click",t=>{t.target===e&&Ce()})});var xe=class{constructor(t){this.input=t,this.typeahead=t.closest("actor-typeahead"),this.dropdown=null,this.currentFocus=-1,this.init()}init(){this.createDropdown(),this.input.addEventListener("focus",()=>this.handleFocus()),this.input.addEventListener("input",()=>this.handleInput()),this.input.addEventListener("keydown",t=>this.handleKeydown(t)),document.addEventListener("click",t=>{!this.input.contains(t.target)&&!this.dropdown.contains(t.target)&&this.hideDropdown()})}createDropdown(){this.dropdown=document.createElement("div"),this.dropdown.className="recent-accounts-dropdown",this.dropdown.style.display="none",this.typeahead?this.typeahead.insertAdjacentElement("afterend",this.dropdown):this.input.insertAdjacentElement("afterend",this.dropdown)}handleFocus(){this.input.value.trim().length<1&&this.showRecentAccounts()}handleInput(){this.input.value.trim().length>=1&&this.hideDropdown()}showRecentAccounts(){let t=this.getRecentAccounts();if(t.length===0){this.hideDropdown();return}this.dropdown.innerHTML="",this.currentFocus=-1;let r=document.createElement("div");r.className="recent-accounts-header",r.textContent="Recent accounts",this.dropdown.appendChild(r),t.forEach((a,o)=>{let s=document.createElement("div");s.className="recent-accounts-item",s.dataset.index=o,s.dataset.handle=a,s.textContent=a,s.addEventListener("click",()=>this.selectItem(a)),this.dropdown.appendChild(s)}),this.dropdown.style.display="block"}selectItem(t){this.input.value=t,this.hideDropdown(),this.input.focus()}hideDropdown(){this.dropdown.style.display="none",this.currentFocus=-1}handleKeydown(t){if(this.dropdown.style.display==="none")return;let r=this.dropdown.querySelectorAll(".recent-accounts-item");t.key==="ArrowDown"?(t.preventDefault(),this.currentFocus++,this.currentFocus>=r.length&&(this.currentFocus=0),this.updateFocus(r)):t.key==="ArrowUp"?(t.preventDefault(),this.currentFocus--,this.currentFocus<0&&(this.currentFocus=r.length-1),this.updateFocus(r)):t.key==="Enter"&&this.currentFocus>-1&&r[this.currentFocus]?(t.preventDefault(),this.selectItem(r[this.currentFocus].dataset.handle)):t.key==="Escape"&&this.hideDropdown()}updateFocus(t){t.forEach((r,a)=>{r.classList.toggle("focused",a===this.currentFocus)})}getRecentAccounts(){try{let t=localStorage.getItem("atcr_recent_handles");return t?JSON.parse(t):[]}catch{return[]}}saveRecentAccount(t){if(t)try{let r=this.getRecentAccounts();r=r.filter(a=>a!==t),r.unshift(t),r=r.slice(0,5),localStorage.setItem("atcr_recent_handles",JSON.stringify(r))}catch(r){console.error("Failed to save recent account:",r)}}};document.addEventListener("DOMContentLoaded",()=>{let e=document.getElementById("login-form"),t=document.getElementById("handle");e&&t&&new xe(t)});document.addEventListener("DOMContentLoaded",()=>{let e=document.cookie.split("; ").find(r=>r.startsWith("atcr_login_handle="));if(!e)return;let t=decodeURIComponent(e.split("=")[1]);if(t){try{let r="atcr_recent_handles",a=JSON.parse(localStorage.getItem(r)||"[]");a=a.filter(o=>o!==t),a.unshift(t),a=a.slice(0,5),localStorage.setItem(r,JSON.stringify(a))}catch(r){console.error("Failed to save recent account:",r)}document.cookie="atcr_login_handle=; path=/; max-age=0"}});function Le(){let e=document.getElementById("featured-carousel"),t=document.getElementById("carousel-prev"),r=document.getElementById("carousel-next");if(!e)return;let a=Array.from(e.querySelectorAll(".carousel-item"));if(a.length===0)return;let o=null,s=5e3,l=0,f=0,n=0;function u(){let y=a[0];if(!y)return;let g=getComputedStyle(e),x=parseFloat(g.gap)||24;l=y.offsetWidth+x,f=e.offsetWidth,n=e.scrollWidth}requestAnimationFrame(()=>{requestAnimationFrame(()=>{u(),p()})});let c;window.addEventListener("resize",()=>{clearTimeout(c),c=setTimeout(u,150)});function i(){return l||u(),l}function d(){return(!f||!l)&&u(),Math.round(f/l)||1}function S(){return(!n||!f)&&u(),n-f}function m(){let y=i(),g=S(),x=e.scrollLeft;x>=g-10?e.scrollTo({left:0,behavior:"smooth"}):e.scrollTo({left:x+y,behavior:"smooth"})}function C(){let y=i(),g=S(),x=e.scrollLeft;x<=10?e.scrollTo({left:g,behavior:"smooth"}):e.scrollTo({left:x-y,behavior:"smooth"})}t&&t.addEventListener("click",()=>{w(),C(),p()}),r&&r.addEventListener("click",()=>{w(),m(),p()});function p(){o||a.length<=d()||(o=setInterval(m,s))}function w(){o&&(clearInterval(o),o=null)}e.addEventListener("mouseenter",w),e.addEventListener("mouseleave",p)}document.addEventListener("DOMContentLoaded",()=>{"requestIdleCallback"in window?requestIdleCallback(Le,{timeout:2e3}):setTimeout(Le,100)});window.setTheme=Me;window.toggleSearch=_e;window.closeSearch=pe;window.copyToClipboard=Fe;window.toggleOfflineManifests=Je;window.deleteManifest=Ke;window.closeManifestDeleteModal=Ce;window.htmx=ve;var Ze=[["path",{d:"M12.337 0c-.475 0-.861 1.016-.861 2.269 0 .527.069 1.011.183 1.396a8.514 8.514 0 0 0-3.961 1.22 5.229 5.229 0 0 0-.595-1.093c-.606-.866-1.34-1.436-1.79-1.43a.381.381 0 0 0-.217.066c-.39.273-.123 1.326.596 2.353.267.381.559.705.84.948a8.683 8.683 0 0 0-1.528 1.716h1.734a7.179 7.179 0 0 1 5.381-2.421 7.18 7.18 0 0 1 5.382 2.42h1.733a8.687 8.687 0 0 0-1.32-1.53c.35-.249.735-.643 1.078-1.133.719-1.027.986-2.08.596-2.353a.382.382 0 0 0-.217-.065c-.45-.007-1.184.563-1.79 1.43a4.897 4.897 0 0 0-.676 1.325 8.52 8.52 0 0 0-3.899-1.42c.12-.39.193-.887.193-1.429 0-1.253-.386-2.269-.862-2.269zM1.624 9.443v5.162h1.358v-1.968h1.64v1.968h1.357V9.443H4.62v1.838H2.98V9.443zm5.912 0v5.162h3.21v-1.108H8.893v-.95h1.64v-1.142h-1.64v-.84h1.853V9.443zm4.698 0v5.162h3.218v-1.362h-1.86v-3.8zm4.706 0v5.162h1.364v-2.643l1.357 1.225 1.35-1.232v2.65h1.365V9.443h-.614l-2.1 1.914-2.109-1.914zm-11.82 7.28a8.688 8.688 0 0 0 1.412 1.548 5.206 5.206 0 0 0-.841.948c-.719 1.027-.985 2.08-.596 2.353.39.273 1.289-.338 2.007-1.364a5.23 5.23 0 0 0 .595-1.092 8.514 8.514 0 0 0 3.961 1.219 5.01 5.01 0 0 0-.183 1.396c0 1.253.386 2.269.861 2.269.476 0 .862-1.016.862-2.269 0-.542-.072-1.04-.193-1.43a8.52 8.52 0 0 0 3.9-1.42c.121.4.352.865.675 1.327.719 1.026 1.617 1.637 2.007 1.364.39-.273.123-1.326-.596-2.353-.343-.49-.727-.885-1.077-1.135a8.69 8.69 0 0 0 1.202-1.36h-1.771a7.174 7.174 0 0 1-5.227 2.252 7.174 7.174 0 0 1-5.226-2.252z",fill:"currentColor",stroke:"none"}]],Ye={Helm:Ze,AlertCircle:q,AlertTriangle:L,ArrowDownToLine:z,Box:_,Check:j,CheckCircle:O,ChevronDown:J,ChevronLeft:K,ChevronRight:$,CircleX:P,Compass:Q,Copy:Z,Download:Y,Info:ee,Loader2:I,Moon:te,Package:re,Plus:ae,RefreshCcw:oe,Search:se,ShieldCheck:le,Ship:fe,Star:ne,Sun:ie,SunMoon:ue,Terminal:de,Trash2:me,TriangleAlert:L,XCircle:P};window.lucide={createIcons:(e={})=>ce({icons:Ye,...e})};document.addEventListener("DOMContentLoaded",()=>{window.lucide.createIcons(),document.body.addEventListener("htmx:afterSwap",()=>{window.lucide.createIcons()})}); 99 99 /*! Bundled license information: 100 100 101 101 lucide/dist/esm/defaultAttributes.js:
+5 -5
pkg/appview/routes/routes.go
··· 96 96 ).ServeHTTP) 97 97 98 98 // API routes for stars (require authentication) 99 - router.Post("/api/stars/{handle}/{repository}", middleware.RequireAuth(deps.SessionStore, deps.Database)( 99 + router.Post("/api/stars", middleware.RequireAuth(deps.SessionStore, deps.Database)( 100 100 &uihandlers.StarRepositoryHandler{BaseUIHandler: base}, 101 101 ).ServeHTTP) 102 102 103 - router.Delete("/api/stars/{handle}/{repository}", middleware.RequireAuth(deps.SessionStore, deps.Database)( 103 + router.Delete("/api/stars", middleware.RequireAuth(deps.SessionStore, deps.Database)( 104 104 &uihandlers.UnstarRepositoryHandler{BaseUIHandler: base}, 105 105 ).ServeHTTP) 106 106 ··· 128 128 r.Get("/api/storage", (&uihandlers.StorageHandler{BaseUIHandler: base}).ServeHTTP) 129 129 r.Post("/api/profile/default-hold", (&uihandlers.UpdateDefaultHoldHandler{BaseUIHandler: base}).ServeHTTP) 130 130 131 - r.Delete("/api/images/{repository}/tags/{tag}", (&uihandlers.DeleteTagHandler{BaseUIHandler: base}).ServeHTTP) 132 - r.Delete("/api/images/{repository}/manifests/{digest}", (&uihandlers.DeleteManifestHandler{BaseUIHandler: base}).ServeHTTP) 133 - r.Post("/api/images/{repository}/avatar", (&uihandlers.UploadAvatarHandler{BaseUIHandler: base}).ServeHTTP) 131 + r.Delete("/api/tags", (&uihandlers.DeleteTagHandler{BaseUIHandler: base}).ServeHTTP) 132 + r.Delete("/api/manifests", (&uihandlers.DeleteManifestHandler{BaseUIHandler: base}).ServeHTTP) 133 + r.Post("/api/avatar", (&uihandlers.UploadAvatarHandler{BaseUIHandler: base}).ServeHTTP) 134 134 135 135 // Device approval page (authenticated) 136 136 r.Get("/device", (&uihandlers.DeviceApprovalPageHandler{BaseUIHandler: base}).ServeHTTP)
+6 -2
pkg/appview/src/js/app.js
··· 253 253 async function deleteManifest(repository, digest, sanitizedId) { 254 254 try { 255 255 // First, try to delete without confirmation 256 - const response = await fetch(`/api/images/${repository}/manifests/${digest}`, { 256 + const response = await fetch('/api/manifests', { 257 257 method: 'DELETE', 258 258 credentials: 'include', 259 + headers: { 'Content-Type': 'application/json' }, 260 + body: JSON.stringify({ repo: repository, digest: digest, confirm: false }), 259 261 }); 260 262 261 263 if (response.status === 409) { ··· 314 316 confirmBtn.textContent = 'Deleting...'; 315 317 316 318 // Delete with confirmation 317 - const response = await fetch(`/api/images/${repository}/manifests/${digest}?confirm=true`, { 319 + const response = await fetch('/api/manifests', { 318 320 method: 'DELETE', 319 321 credentials: 'include', 322 + headers: { 'Content-Type': 'application/json' }, 323 + body: JSON.stringify({ repo: repository, digest: digest, confirm: true }), 320 324 }); 321 325 322 326 if (response.ok) {
+3 -1
pkg/appview/templates/components/repo-avatar.html
··· 18 18 <label class="absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 hover:opacity-100 transition-opacity cursor-pointer rounded-lg" for="avatar-upload" aria-label="Upload repository icon"> 19 19 <i data-lucide="plus" class="size-8 text-white"></i> 20 20 </label> 21 + <input type="hidden" id="avatar-repo" name="repo" value="{{ .RepositoryName }}"> 21 22 <input type="file" id="avatar-upload" name="avatar" 22 23 accept="image/png,image/jpeg,image/webp" 23 - hx-post="/api/images/{{ .RepositoryName }}/avatar" 24 + hx-post="/api/avatar" 25 + hx-include="#avatar-repo" 24 26 hx-encoding="multipart/form-data" 25 27 hx-swap="outerHTML" 26 28 hx-target="#repo-avatar"
+3 -2
pkg/appview/templates/components/star.html
··· 11 11 <button class="btn btn-sm gap-2 btn-ghost group border border-transparent hover:border-primary{{ if .IsStarred }} border-amber-400!{{ end }}" 12 12 id="star-btn" 13 13 {{ if .IsStarred }} 14 - hx-delete="/api/stars/{{ .Handle }}/{{ .Repository }}" 14 + hx-delete="/api/stars" 15 15 {{ else }} 16 - hx-post="/api/stars/{{ .Handle }}/{{ .Repository }}" 16 + hx-post="/api/stars" 17 17 {{ end }} 18 + hx-vals='{"handle": "{{ .Handle }}", "repo": "{{ .Repository }}"}' 18 19 hx-swap="outerHTML" 19 20 hx-on::before-request="this.disabled=true" 20 21 hx-on::after-request="if(event.detail.xhr.status===401) window.location='/auth/oauth/login'"
+3 -2
pkg/appview/templates/pages/repository.html
··· 170 170 </time> 171 171 {{ if $.IsOwner }} 172 172 <button class="btn btn-ghost btn-sm text-error" 173 - hx-delete="/api/images/{{ $.Repository.Name }}/tags/{{ .Tag.Tag }}" 173 + hx-delete="/api/tags" 174 + hx-vals='{"repo": "{{ $.Repository.Name }}", "tag": "{{ .Tag.Tag }}"}' 174 175 hx-confirm="Delete tag {{ .Tag.Tag }}?" 175 176 hx-target="#tag-{{ sanitizeID .Tag.Tag }}" 176 177 hx-swap="outerHTML" ··· 257 258 {{ if $.IsOwner }} 258 259 <button class="btn btn-ghost btn-sm text-error" 259 260 onclick="deleteManifest('{{ $.Repository.Name }}', '{{ .Manifest.Digest }}', '{{ sanitizeID .Manifest.Digest }}')" 260 - aria-label="Delete manifest {{ .Manifest.Digest | truncateDigest }}"> 261 + aria-label="Delete manifest {{ truncateDigest .Manifest.Digest 16 }}"> 261 262 <i data-lucide="trash-2" class="size-4"></i> 262 263 </button> 263 264 {{ end }}