PageSourceSearch

https://yaak.app/static/build/index.js?c=1790356997852

js yaak.app collected 2026-09-25 19:45:28 UTC 93,217 bytes, 20 lines download raw bytes

1import{i as getThemeCSS,r as completeTheme,t as completeFullColorVariables}from"./assets/window-Dy6YbxTJ.js";var htmx=(function(){const 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},parseInterval:null,_:null,version:`2.0.4`};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;const 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 t=e.slice(-2)==`ms`?parseFloat(e.slice(0,-2)):e.slice(-1)==`s`?parseFloat(e.slice(0,-1))*1e3:e.slice(-1)==`m`?parseFloat(e.slice(0,-1))*1e3*60: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,n){let r=getAttributeValue(t,n),i=getAttributeValue(t,`hx-disinherit`);var a=getAttributeValue(t,`hx-inherit`);if(e!==t){if(htmx.config.disableInheritance)return a&&(a===`*`||a.split(` `).indexOf(n)>=0)?r:null;if(i&&(i===`*`||i.split(` `).indexOf(n)>=0))return`unset`}return r}function getClosestAttributeValue(e,t){let n=null;if(getClosestMatch(e,function(r){return!!(n=getAttributeValueWithDisinheritance(e,asElement(r),t))}),n!==`unset`)return n}function matches(e,t){let n=e instanceof Element&&(e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector);return!!n&&n.call(e,t)}function getStartTag(e){let t=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i.exec(e);return t?t[1].toLowerCase():``}function parseHTML(e){return 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(e){t.setAttribute(e.name,e.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`)).forEac
1h(e=>{if(isJavaScriptScriptNode(e)){let t=duplicateScript(e),n=e.parentNode;try{n.insertBefore(t,e)}catch(e){logError(e)}finally{e.remove()}}})}function makeFragment(e){let t=e.replace(/<head(\s[^>]*)?>[\s\S]*?<\/head>/i,``),n=getStartTag(t),r;if(n===`html`){r=new DocumentFragment;let t=parseHTML(e);takeChildrenFor(r,t.body),r.title=t.title}else if(n===`body`){r=new DocumentFragment;let e=parseHTML(t);takeChildrenFor(r,e.body),r.title=e.title}else{let e=parseHTML(`<body><template class="internal-htmx-wrapper">`+t+`</template></body>`);r=e.querySelector(`template`).content,r.title=e.title;var i=r.querySelector(`title`);i&&i.parentNode===r&&(i.remove(),r.title=i.innerText)}return r&&(htmx.config.allowScriptTags?normalizeScriptTags(r):r.querySelectorAll(`script`).forEach(e=>e.remove())),r}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`,n=e[t];return n||=e[t]={},n}function toArray(e){let t=[];if(e)for(let n=0;n<e.length;n++)t.push(e[n]);return t}function forEach(e,t){if(e)for(let n=0;n<e.length;n++)t(e[n])}function isScrolledIntoView(e){let t=e.getBoundingClientRect(),n=t.top,r=t.bottom;return n<window.innerHeight&&r>=0}function bodyContains(e){return e.getRootNode({composed:!0})===document}function splitOnWhitespace(e){return e.trim().split(/\s+/)}function mergeObjects(e,t){for(let n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function parseJSON(e){try{return JSON.parse(e)}catch(e){return logError(e),null}}function canAccessLocalStorage(){let e=`htmx:localStorageTest`;try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch{return!1}}function normalizePath(e){try{let t=new URL(e);return t&&(e=t.pathname+t.search),/^\/$/.test(e)||(e=e.replace(/\/+$/,``)),e}catch{return e}}function internalEval(str){return maybeEval(getDocument().body,function(){return eval(str)})}function onLoadHelper(e){return htmx.on(`htmx:load`,function(t){e(t.detail.elt)})}function logAll(){htmx.logger=function(e,t,n){console&&console.log(t,e,n)}}function logNone(){htmx.logger=null}function find(e,t){return typeof e==`string`?find(getDocument(),e):e.querySelector(t)}function findAll(e,t){return typeof e==`string`?findAll(getDocument(),e):e.querySelectorAll(t)}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,n){e=asElement(resolveTarget(e)),e&&(n?getWindow().setTimeout(function(){addClassToElement(e,t),e=null},n):e.classList&&e.classList.add(t))}function removeClassFromElement(e,t,n){let r=asElement(resolveTarget(e));r&&(n?getWindow().setTimeout(function(){removeClassFromElement(r,t),r=null},n):r.classList&&(r.classList.remove(t),r.classList.length===0&&r.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(e){removeClassFromElement(e,t)}),addClassToElement(asElement(e),t)}function closest(e,t){if(e=asElement(resolveTarget(e)),e&&e.closest)return e.closest(t);do if(e==null||matches(e,t))return e;while(e&&=asElement(parentElt(e)));return 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,n){if(t.indexOf(`global `)===0)return querySelectorAllExt(e,t.slice(7),!0);e=resolveTarget(e);let r=[];{let e=0,n=0;for(let i=0;i<t.length;i++){let a=t[i];if(a===`,`&&e===0){r.push(t.substring(n,i)),n=i+1;continue}a===`<`?e++:a===`/`&&i<t.length-1&&t[i+1]===`>`&&e--}n<t.length&&r.push(t.substring(n))}let i=[],a=[];for(;r.length>0;){let t=normalizeSelector(r.shift()),o;
1t.indexOf(`closest `)===0?o=closest(asElement(e),normalizeSelector(t.substr(8))):t.indexOf(`find `)===0?o=find(asParentNode(e),normalizeSelector(t.substr(5))):t===`next`||t===`nextElementSibling`?o=asElement(e).nextElementSibling:t.indexOf(`next `)===0?o=scanForwardQuery(e,normalizeSelector(t.substr(5)),!!n):t===`previous`||t===`previousElementSibling`?o=asElement(e).previousElementSibling:t.indexOf(`previous `)===0?o=scanBackwardsQuery(e,normalizeSelector(t.substr(9)),!!n):t===`document`?o=document:t===`window`?o=window:t===`body`?o=document.body:t===`root`?o=getRootNode(e,!!n):t===`host`?o=e.getRootNode().host:a.push(t),o&&i.push(o)}if(a.length>0){let t=a.join(`,`),r=asParentNode(getRootNode(e,!!n));i.push(...toArray(r.querySelectorAll(t)))}return i}var scanForwardQuery=function(e,t,n){let r=asParentNode(getRootNode(e,n)).querySelectorAll(t);for(let t=0;t<r.length;t++){let n=r[t];if(n.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_PRECEDING)return n}},scanBackwardsQuery=function(e,t,n){let r=asParentNode(getRootNode(e,n)).querySelectorAll(t);for(let t=r.length-1;t>=0;t--){let n=r[t];if(n.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_FOLLOWING)return n}};function querySelectorExt(e,t){return typeof e==`string`?querySelectorAllExt(getDocument().body,e)[0]:querySelectorAllExt(e,t)[0]}function resolveTarget(e,t){return typeof e==`string`?find(asParentNode(t)||document,e):e}function processEventArgs(e,t,n,r){return isFunction(t)?{target:getDocument().body,event:asString(e),listener:t,options:n}:{target:resolveTarget(e),event:asString(t),listener:n,options:r}}function addEventListenerImpl(e,t,n,r){return ready(function(){let i=processEventArgs(e,t,n,r);i.target.addEventListener(i.event,i.listener,i.options)}),isFunction(t)?t:n}function removeEventListenerImpl(e,t,n){return ready(function(){let r=processEventArgs(e,t,n);r.target.removeEventListener(r.event,r.listener)}),isFunction(t)?t:n}const DUMMY_ELT=getDocument().createElement(`output`);function findAttributeTargets(e,t){let n=getClosestAttributeValue(e,t);if(n){if(n===`this`)return[findThisElement(e,t)];{let r=querySelectorAllExt(e,n);return r.length===0?(logError(`The selector "`+n+`" on `+t+` returned no matches!`),[DUMMY_ELT]):r}}}function findThisElement(e,t){return asElement(getClosestMatch(e,function(e){return getAttributeValue(asElement(e),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){let t=htmx.config.attributesToSettle;for(let n=0;n<t.length;n++)if(e===t[n])return!0;return!1}function cloneAttributes(e,t){forEach(e.attributes,function(n){!t.hasAttribute(n.name)&&shouldSettleAttribute(n.name)&&e.removeAttribute(n.name)}
1),forEach(t.attributes,function(t){shouldSettleAttribute(t.name)&&e.setAttribute(t.name,t.value)})}function isInlineSwap(e,t){let n=getExtensions(t);for(let t=0;t<n.length;t++){let r=n[t];try{if(r.isInlineSwap(e))return!0}catch(e){logError(e)}}return e===`outerHTML`}function oobSwap(e,t,n,r){r||=getDocument();let i=`#`+getRawAttribute(t,`id`),a=`outerHTML`;e===`true`||(e.indexOf(`:`)>0?(a=e.substring(0,e.indexOf(`:`)),i=e.substring(e.indexOf(`:`)+1)):a=e),t.removeAttribute(`hx-swap-oob`),t.removeAttribute(`data-hx-swap-oob`);let o=querySelectorAllExt(r,i,!1);return o?(forEach(o,function(e){let r,i=t.cloneNode(!0);r=getDocument().createDocumentFragment(),r.appendChild(i),isInlineSwap(a,e)||(r=asParentNode(i));let o={shouldSwap:!0,target:e,fragment:r};triggerEvent(e,`htmx:oobBeforeSwap`,o)&&(e=o.target,o.shouldSwap&&(handlePreservedElements(r),swapWithStyle(a,e,e,r,n),restorePreservedElements()),forEach(n.elts,function(e){triggerEvent(e,`htmx:oobAfterSwap`,o)}))}),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 e=find(`#`+t.id);e.parentNode.moveBefore(t,e),e.remove()}e.remove()}}function handlePreservedElements(e){forEach(findAll(e,`[hx-preserve], [data-hx-preserve]`),function(e){let t=getAttributeValue(e,`id`),n=getDocument().getElementById(t);if(n!=null)if(e.moveBefore){let e=find(`#--htmx-preserve-pantry--`);e??=(getDocument().body.insertAdjacentHTML(`afterend`,`<div id='--htmx-preserve-pantry--'></div>`),find(`#--htmx-preserve-pantry--`)),e.moveBefore(n,null)}else e.parentNode.replaceChild(n,e)})}function handleAttributes(e,t,n){forEach(t.querySelectorAll(`[id]`),function(t){let r=getRawAttribute(t,`id`);if(r&&r.length>0){let i=r.replace(`'`,`\\'`),a=t.tagName.replace(`:`,`\\:`),o=asParentNode(e),s=o&&o.querySelector(a+`[id='`+i+`']`);if(s&&s!==o){let e=t.cloneNode();cloneAttributes(t,s),n.tasks.push(function(){cloneAttributes(t,e)})}}})}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]`;asHtmlElement(matches(e,t)?e:e.querySelector(t))?.focus()}function insertNodesBefore(e,t,n,r){for(handleAttributes(e,n,r);n.childNodes.length>0;){let i=n.firstChild;addClassToElement(asElement(i),htmx.config.addedClass),e.insertBefore(i,t),i.nodeType!==Node.TEXT_NODE&&i.nodeType!==Node.COMMENT_NODE&&r.tasks.push(makeAjaxLoadTask(i))}}function stringHash(e,t){let n=0;for(;n<e.length;)t=(t<<5)-t+e.charCodeAt(n++)|0;return t}function attributeHash(e){let t=0;if(e.attributes)for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];r.value&&(t=stringHash(r.name,t),t=stringHash(r.value,t))}return t}function deInitOnHandlers(e){let t=getInternalData(e);if(t.onHandlers){for(let n=0;n<t.onHandlers.length;n++){let r=t.onHandlers[n];removeEventListenerImpl(e,r.event,r.listener)}delete t.onHandlers}}function deInitNode(e){let t=getInternalData(e);t.timeout&&clearTimeout(t.timeout),t.listenerInfos&&forEach(t.listenerInfos,function(e){e.on&&removeEventListenerImpl(e.on,e.trigger,e.listener)}),deInitOnHandlers(e),forEach(Object.keys(t),function(e){e!==`firstInitCompleted`&&delete t[e]})}function cleanUpElement(e){triggerEvent(e,`htmx:beforeCleanupElement`),deInitNode(e),e.children&&forEach(e.children,function(e){cleanUpElement(e)})}function swapOuterHTML(e,t,n){if(e instanceof Element&&e.tagName===`BODY`)return swapInnerHTML(e,t,n);let r,i=e.previousSibling,a=parentElt(e);if(a){for(insertNodesBefore(a,e,t,n),r=i==null?a.firstChild:i.nextSibling,n.elts=n.elts.filter(function(t){return t!==e});r&&r!==e;)r instanceof Element&&n.elts.push(r),r=r.nextSibling;cleanUpElement(e),e instanceof Element?e.remove():e.parentNode.removeChild(e)}}function swapAfterBegin(e,t,n){return insertNodesBefore(e,e.firstChild,t,n)}function swapBeforeBegin(e,t,n){return insertNodesBefore(parentElt(e),e,t,n)}
1function swapBeforeEnd(e,t,n){return insertNodesBefore(e,null,t,n)}function swapAfterEnd(e,t,n){return insertNodesBefore(parentElt(e),e.nextSibling,t,n)}function swapDelete(e){cleanUpElement(e);let t=parentElt(e);if(t)return t.removeChild(e)}function swapInnerHTML(e,t,n){let r=e.firstChild;if(insertNodesBefore(e,r,t,n),r){for(;r.nextSibling;)cleanUpElement(r.nextSibling),e.removeChild(r.nextSibling);cleanUpElement(r),e.removeChild(r)}}function swapWithStyle(e,t,n,r,i){switch(e){case`none`:return;case`outerHTML`:swapOuterHTML(n,r,i);return;case`afterbegin`:swapAfterBegin(n,r,i);return;case`beforebegin`:swapBeforeBegin(n,r,i);return;case`beforeend`:swapBeforeEnd(n,r,i);return;case`afterend`:swapAfterEnd(n,r,i);return;case`delete`:swapDelete(n);return;default:var a=getExtensions(t);for(let t=0;t<a.length;t++){let o=a[t];try{let t=o.handleSwap(e,n,r,i);if(t){if(Array.isArray(t))for(let e=0;e<t.length;e++){let n=t[e];n.nodeType!==Node.TEXT_NODE&&n.nodeType!==Node.COMMENT_NODE&&i.tasks.push(makeAjaxLoadTask(n))}return}}catch(e){logError(e)}}e===`innerHTML`?swapInnerHTML(n,r,i):swapWithStyle(htmx.config.defaultSwapStyle,t,n,r,i)}}function findAndSwapOobElements(e,t,n){var r=findAll(e,`[hx-swap-oob], [data-hx-swap-oob]`);return forEach(r,function(e){if(htmx.config.allowNestedOobSwaps||e.parentElement===null){let r=getAttributeValue(e,`hx-swap-oob`);r!=null&&oobSwap(r,e,t,n)}else e.removeAttribute(`hx-swap-oob`),e.removeAttribute(`data-hx-swap-oob`)}),r.length>0}function swap(e,t,n,r){r||={},e=resolveTarget(e);let i=r.contextElement?getRootNode(r.contextElement,!1):getDocument(),a=document.activeElement,o={};try{o={elt:a,start:a?a.selectionStart:null,end:a?a.selectionEnd:null}}catch{}let s=makeSettleInfo(e);if(n.swapStyle===`textContent`)e.textContent=t;else{let a=makeFragment(t);if(s.title=a.title,r.selectOOB){let e=r.selectOOB.split(`,`);for(let t=0;t<e.length;t++){let n=e[t].split(`:`,2),r=n[0].trim();r.indexOf(`#`)===0&&(r=r.substring(1));let o=n[1]||`true`,c=a.querySelector(`#`+r);c&&oobSwap(o,c,s,i)}}if(findAndSwapOobElements(a,s,i),forEach(findAll(a,`template`),function(e){e.content&&findAndSwapOobElements(e.content,s,i)&&e.remove()}),r.select){let e=getDocument().createDocumentFragment();forEach(a.querySelectorAll(r.select),function(t){e.appendChild(t)}),a=e}handlePreservedElements(a),swapWithStyle(n.swapStyle,r.contextElement,e,a,s),restorePreservedElements()}if(o.elt&&!bodyContains(o.elt)&&getRawAttribute(o.elt,`id`)){let e=document.getElementById(getRawAttribute(o.elt,`id`)),t={preventScroll:n.focusScroll===void 0?!htmx.config.defaultFocusScroll:!n.focusScroll};if(e){if(o.start&&e.setSelectionRange)try{e.setSelectionRange(o.start,o.end)}catch{}e.focus(t)}}e.classList.remove(htmx.config.swappingClass),forEach(s.elts,function(e){e.classList&&e.classList.add(htmx.config.settlingClass),triggerEvent(e,`htmx:afterSwap`,r.eventInfo)}),r.afterSwapCallback&&r.afterSwapCallback(),n.ignoreTitle||handleTitle(s.title);let c=function(){if(forEach(s.tasks,function(e){e.call()}),forEach(s.elts,function(e){e.classList&&e.classList.remove(htmx.config.settlingClass),triggerEvent(e,`htmx:afterSettle`,r.eventInfo)}),r.anchor){let e=asElement(resolveTarget(`#`+r.anchor));e&&e.scrollIntoView({block:`start`,behavior:`auto`})}updateScrollState(s.elts,n),r.afterSettleCallback&&r.afterSettleCallback()};n.settleDelay>0?getWindow().setTimeout(c,n.settleDelay):c()}function handleTriggerHeader(e,t,n){let r=e.getResponseHeader(t);if(r.indexOf(`{`)===0){let e=parseJSON(r);for(let t in e)if(e.hasOwnProperty(t)){let r=e[t];isRawObject(r)?n=r.target===void 0?n:r.target:r={value:r},triggerEvent(n,t,r)}}else{let e=r.split(`,`);for(let t=0;t<e.length;t++)triggerEvent(n,e[t].trim(),[])}}const 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=[],n=0;for(;n<e.length;){if(SYMBOL_START.exec(e.charAt(n))){for(var r=n;SYMBOL_CONT.exec(e.charAt(n+1));)n++;t.push(e.substring(r,n+1))}else if(STRINGISH_START.indexOf(e.charAt(n))!==-1){let i=e.charAt(n);var r=n;for(n++;n<e.length&&e.charAt(n)!==i;)e.charAt(n)===`\\`&&n++,n++;t.push(e.substring(r,n+1))}else{let r=e.charAt(n);t.push(r)}n++}return t}function isPossibleRelativeReference(e,t,n){return SYMBOL_START.exec(e.charAt(0))&&e!==`true`&&e!==`false`&&e!==`this`&&e!==n&&t!==`.`}function maybeGenerateConditional(e,t,n){if(t[0]===`[`){t.shift();let r=1,i=` return (function(`+n+`){ return (`,a=null;for(;t.length>0;){let o=t[0];if(o===`]`){if(r--,r===0){a===null&&(i+=`true`),t.shift(),i+=`)})`;try{let t=maybeEval(e,function(){return Function(i)()},function(){return!0});return t.source=i,t}catch(e){return triggerErrorEvent(getDocument().body,`htmx:syntax:error`,{error:e,source:i}),null}}}else o===`[`&&r++;isPossibleRelativeReference(o,a,n)?i+=`((`+n+`.`+o+`) ? (`+n+`.`+o+`) : (window.`+o+`))`:i+=o,a=t.shift()}}}function consumeUntil(e,t){let n=``;for(;e.length>0&&!t.test(e[0]);)n+=e.shift();return n}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}const INPUT_SELECTOR=`input, textarea, select`;function parseAndCacheTrigger(e,t,n){let r=[],i=tokenizeString(t);do{consumeUntil(i,NOT_WHITESPACE);let t=i.length,n=consumeUntil(i,/[,\[\s]/);if(n!==``)if(n===`every`){let t={trigger:`every`};consumeUntil(i,NOT_WHITESPACE),t.pollInterval=parseInterval(consumeUntil(i,/[,\[\s]/)),consumeUntil(i,NOT_WHITESPACE);var a=maybeGenerateConditional(e,i,`event`);a&&(t.eventFilter=a),r.push(t)}else{let t={trigger:n};var a=maybeGenerateConditional(e,i,`event`);for(a&&(t.eventFilter=a),consumeUntil(i,NOT_WHITESPACE);i.length>0&&i[0]!==`,`;){let n=i.shift();if(n===`changed`)t.changed=!0;else if(n===`once`)t.once=!0;else if(n===`consume`)t.consume=!0;else if(n===`delay`&&i[0]===`:`)i.shift(),t.delay=parseInterval(consumeUntil(i,WHITESPACE_OR_COMMA));else if(n===`from`&&i[0]===`:`){if(i.shift(),COMBINED_SELECTOR_START.test(i[0]))var o=consumeCSSSelector(i);else{var o=consumeUntil(i,WHITESPACE_OR_COMMA);
1if(o===`closest`||o===`find`||o===`next`||o===`previous`){i.shift();let e=consumeCSSSelector(i);e.length>0&&(o+=` `+e)}}t.from=o}else n===`target`&&i[0]===`:`?(i.shift(),t.target=consumeCSSSelector(i)):n===`throttle`&&i[0]===`:`?(i.shift(),t.throttle=parseInterval(consumeUntil(i,WHITESPACE_OR_COMMA))):n===`queue`&&i[0]===`:`?(i.shift(),t.queue=consumeUntil(i,WHITESPACE_OR_COMMA)):n===`root`&&i[0]===`:`?(i.shift(),t[n]=consumeCSSSelector(i)):n===`threshold`&&i[0]===`:`?(i.shift(),t[n]=consumeUntil(i,WHITESPACE_OR_COMMA)):triggerErrorEvent(e,`htmx:syntax:error`,{token:i.shift()});consumeUntil(i,NOT_WHITESPACE)}r.push(t)}i.length===t&&triggerErrorEvent(e,`htmx:syntax:error`,{token:i.shift()}),consumeUntil(i,NOT_WHITESPACE)}while(i[0]===`,`&&i.shift());return n&&(n[t]=r),r}function getTriggerSpecs(e){let t=getAttributeValue(e,`hx-trigger`),n=[];if(t){let r=htmx.config.triggerSpecsCache;n=r&&r[t]||parseAndCacheTrigger(e,t,r)}return n.length>0?n: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,n){let r=getInternalData(e);r.timeout=getWindow().setTimeout(function(){bodyContains(e)&&r.cancelled!==!0&&(maybeFilterEvent(n,e,makeEvent(`hx:poll:trigger`,{triggerSpec:n,target:e}))||t(e),processPolling(e,t,n))},n.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,n){if(e instanceof HTMLAnchorElement&&isLocalLink(e)&&(e.target===``||e.target===`_self`)||e.tagName===`FORM`&&String(getRawAttribute(e,`method`)).toLowerCase()!==`dialog`){t.boosted=!0;let r,i;if(e.tagName===`A`)r=`get`,i=getRawAttribute(e,`href`);else{let t=getRawAttribute(e,`method`);r=t?t.toLowerCase():`get`,i=getRawAttribute(e,`action`),(i==null||i===``)&&(i=getDocument().location.href),r===`get`&&i.includes(`?`)&&(i=i.replace(/\?[^#]+/,``))}n.forEach(function(n){addEventListener(e,function(e,t){let n=asElement(e);if(eltIsDisabled(n)){cleanUpElement(n);return}issueAjaxRequest(r,i,n,t)},t,n,!0)})}}function shouldCancel(e,t){let n=asElement(t);return n?!!((e.type===`submit`||e.type===`click`)&&(n.tagName===`FORM`||matches(n,`input[type="submit"], button`)&&(matches(n,`[form]`)||closest(n,`form`)!==null)||n instanceof HTMLAnchorElement&&n.href&&(n.getAttribute(`href`)===`#`||n.getAttribute(`href`).indexOf(`#`)!==0))):!1}function ignoreBoostedAnchorCtrlClick(e,t){return getInternalData(e).boosted&&e instanceof HTMLAnchorElement&&t.type===`click`&&(t.ctrlKey||t.metaKey)}function maybeFilterEvent(e,t,n){let r=e.eventFilter;if(r)try{return r.call(t,n)!==!0}catch(e){let t=r.source;return triggerErrorEvent(getDocument().body,`htmx:eventFilter:error`,{error:e,source:t}),!0}return!1}function addEventListener(e,t,n,r,i){let a=getInternalData(e),o;o=r.from?querySelectorAllExt(e,r.from):[e],r.changed&&(`lastValue`in a||(a.lastValue=new WeakMap),o.forEach(function(e){a.lastValue.has(r)||a.lastValue.set(r,new WeakMap),a.lastValue.get(r).set(e,e.value)})),forEach(o,function(o){let s=function(n){if(!bodyContains(e)){o.removeEventListener(r.trigger,s);return}if(ignoreBoostedAnchorCtrlClick(e,n)||((i||shouldCancel(n,e))&&n.preventDefault(),maybeFilterEvent(r,e,n)))return;let c=getInternalData(n);if(c.triggerSpec=r,c.handledFor??=[],c.handledFor.indexOf(e)<0){if(c.handledFor.push(e),r.consume&&n.stopPropagation(),r.target&&n.target&&!matches(asElement(n.target),r.target))return;if(r.once){if(a.triggeredOnce)return;a.triggeredOnce=!0}if(r.changed){let e=event.target,t=e.value,n=a.lastValue.get(r);if(n.has(e)&&n.get(e)===t)return;n.set(e,t)}if(a.delayed&&clearTimeout(a.delayed),a.throttle)return;r.throttle>0?a.throttle||=(triggerEvent(e,`htmx:trigger`),t(e,n),getWindow().setTimeout(function(){a.throttle=null},r.throttle)):r.delay>0?a.delayed=getWindow().setTimeout(function(){triggerEvent(e,`htmx:trigger`),t(e,n)},r.delay):(triggerEvent(e,`htmx:trigger`),t(e,n))}};n.listenerInfos??=[],n.listenerInfos.push({trigger:r.trigger,listener:s,on:o}),o.addEventListener(r.trigger,s)})}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,n,r){let i=function(){n.loaded||(n.loaded=!0,triggerEvent(e,`htmx:trigger`),t(e))};r>0?getWindow().setTimeout(i,r):i()}function processVerbs(e,t,n){let r=!1;return forEach(VERBS,function(i){if(hasAttribute(e,`hx-`+i)){let a=getAttributeValue(e,`hx-`+i);
1r=!0,t.path=a,t.verb=i,n.forEach(function(n){addTriggerHandler(e,n,t,function(e,t){let n=asElement(e);if(closest(n,htmx.config.disableSelector)){cleanUpElement(n);return}issueAjaxRequest(i,a,n,t)})})}}),r}function addTriggerHandler(e,t,n,r){if(t.trigger===`revealed`)initScrollHandler(),addEventListener(e,r,n,t),maybeReveal(asElement(e));else if(t.trigger===`intersect`){let i={};t.root&&(i.root=querySelectorExt(e,t.root)),t.threshold&&(i.threshold=parseFloat(t.threshold)),new IntersectionObserver(function(t){for(let n=0;n<t.length;n++)if(t[n].isIntersecting){triggerEvent(e,`intersect`);break}},i).observe(asElement(e)),addEventListener(asElement(e),r,n,t)}else !n.firstInitCompleted&&t.trigger===`load`?maybeFilterEvent(t,e,makeEvent(`load`,{elt:e}))||loadImmediately(asElement(e),r,n,t.delay):t.pollInterval>0?(n.polling=!0,processPolling(asElement(e),r,t)):addEventListener(e,r,n,t)}function shouldProcessHxOn(e){let t=asElement(e);if(!t)return!1;let n=t.attributes;for(let e=0;e<n.length;e++){let t=n[e].name;if(startsWith(t,`hx-on:`)||startsWith(t,`data-hx-on:`)||startsWith(t,`hx-on-`)||startsWith(t,`data-hx-on-`))return!0}return!1}const 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 n=HX_ON_QUERY.evaluate(e),r=null;for(;r=n.iterateNext();)t.push(asElement(r))}function findHxOnWildcardElements(e){let t=[];if(e instanceof DocumentFragment)for(let n of e.childNodes)processHXOnRoot(n,t);else processHXOnRoot(e,t);return t}function findElementsToProcess(e){if(e.querySelectorAll){let n=`, [hx-boost] a, [data-hx-boost] a, a[hx-boost], a[data-hx-boost]`,r=[];for(let e in extensions){let n=extensions[e];if(n.getSelectors){var t=n.getSelectors();t&&r.push(t)}}return e.querySelectorAll(VERB_SELECTOR+`, [hx-boost] a, [data-hx-boost] a, a[hx-boost], a[data-hx-boost], form, [type='submit'], [hx-ext], [data-hx-ext], [hx-trigger], [data-hx-trigger]`+r.flat().map(e=>`, `+e).join(``))}else return[]}function maybeSetLastButtonClicked(e){let t=closest(asElement(e.target),`button, input[type='submit']`),n=getRelatedFormData(e);n&&(n.lastButtonClicked=t)}function maybeUnsetLastButtonClicked(e){let t=getRelatedFormData(e);t&&(t.lastButtonClicked=null)}function getRelatedFormData(e){let t=closest(asElement(e.target),`button, input[type='submit']`);if(!t)return;let n=resolveTarget(`#`+getRawAttribute(t,`form`),t.getRootNode())||closest(t,`form`);if(n)return getInternalData(n)}function initButtonTracking(e){e.addEventListener(`click`,maybeSetLastButtonClicked),e.addEventListener(`focusin`,maybeSetLastButtonClicked),e.addEventListener(`focusout`,maybeUnsetLastButtonClicked)}function addHxOnEventHandler(e,t,n){let r=getInternalData(e);Array.isArray(r.onHandlers)||(r.onHandlers=[]);let i,a=function(t){maybeEval(e,function(){eltIsDisabled(e)||(i||=Function(`event`,n),i.call(e,t))})};e.addEventListener(t,a),r.onHandlers.push({event:t,listener:a})}function processHxOnWildcard(e){deInitOnHandlers(e);for(let t=0;t<e.attributes.length;t++){let n=e.attributes[t].name,r=e.attributes[t].value;if(startsWith(n,`hx-on`)||startsWith(n,`data-hx-on`)){let t=n.indexOf(`-on`)+3,i=n.slice(t,t+1);if(i===`-`||i===`:`){let i=n.slice(t+1);startsWith(i,`:`)?i=`htmx`+i:startsWith(i,`-`)?i=`htmx:`+i.slice(1):startsWith(i,`htmx-`)&&(i=`htmx:`+i.slice(5)),addHxOnEventHandler(e,i,r)}}}}function initNode(e){if(closest(e,htmx.config.disableSelector)){cleanUpElement(e);return}let t=getInternalData(e),n=attributeHash(e);if(t.initHash!==n){deInitNode(e),t.initHash=n,triggerEvent(e,`htmx:beforeProcessNode`);let r=getTriggerSpecs(e);processVerbs(e,t,r)||(getClosestAttributeValue(e,`hx-boost`)===`true`?boostElement(e,t,r):hasAttribute(e,`hx-trigger`)&&r.forEach(function(n){addTriggerHandler(e,n,t,function(){})})),(e.tagName===`FORM`||getRawAttribute(e,`type`)===`submit`&&hasAttribute(e,`form`))&&initButtonTracking(e),t.firstInitCompleted=!0,triggerEvent(e,`htmx:afterProcessNode`)}}function processNode(e){if(e=resolveTarget(e),closest(e,htmx.config.disableSelector)){cleanUpElement(e);return}initNode(e),forEach(findElementsToProcess(e),function(e){initNode(e)}
1),forEach(findHxOnWildcardElements(e),processHxOnWildcard)}function kebabEventName(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}function makeEvent(e,t){let n;return window.CustomEvent&&typeof window.CustomEvent==`function`?n=new CustomEvent(e,{bubbles:!0,cancelable:!0,composed:!0,detail:t}):(n=getDocument().createEvent(`CustomEvent`),n.initCustomEvent(e,!0,!0,t)),n}function triggerErrorEvent(e,t,n){triggerEvent(e,t,mergeObjects({error:t},n))}function ignoreEventForLogging(e){return e===`htmx:afterProcessNode`}function withExtensions(e,t){forEach(getExtensions(e),function(e){try{t(e)}catch(e){logError(e)}})}function logError(e){console.error?console.error(e):console.log&&console.log(`ERROR: `,e)}function triggerEvent(e,t,n){e=resolveTarget(e),n??={},n.elt=e;let r=makeEvent(t,n);htmx.logger&&!ignoreEventForLogging(t)&&htmx.logger(e,t,n),n.error&&(logError(n.error),triggerEvent(e,`htmx:error`,{errorInfo:n}));let i=e.dispatchEvent(r),a=kebabEventName(t);if(i&&a!==t){let t=makeEvent(a,r.detail);i&&=e.dispatchEvent(t)}return withExtensions(asElement(e),function(e){i=i&&e.onEvent(t,r)!==!1&&!r.defaultPrevented}),i}let currentPathForHistory=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 n=cleanInnerHtmlForHistory(t),r=getDocument().title,i=window.scrollY;if(htmx.config.historyCacheSize<=0){localStorage.removeItem(`htmx-history-cache`);return}e=normalizePath(e);let a=parseJSON(localStorage.getItem(`htmx-history-cache`))||[];for(let t=0;t<a.length;t++)if(a[t].url===e){a.splice(t,1);break}let o={url:e,content:n,title:r,scroll:i};for(triggerEvent(getDocument().body,`htmx:historyItemCreated`,{item:o,cache:a}),a.push(o);a.length>htmx.config.historyCacheSize;)a.shift();for(;a.length>0;)try{localStorage.setItem(`htmx-history-cache`,JSON.stringify(a));break}catch(e){triggerErrorEvent(getDocument().body,`htmx:historyCacheError`,{cause:e,cache:a}),a.shift()}}function getCachedHistory(e){if(!canAccessLocalStorage())return null;e=normalizePath(e);let t=parseJSON(localStorage.getItem(`htmx-history-cache`))||[];for(let n=0;n<t.length;n++)if(t[n].url===e)return t[n];return null}function cleanInnerHtmlForHistory(e){let t=htmx.config.requestClass,n=e.cloneNode(!0);return forEach(findAll(n,`.`+t),function(e){removeClassFromElement(e,t)}),forEach(findAll(n,`[data-disabled-by-htmx]`),function(e){e.removeAttribute(`disabled`)}),n.innerHTML}function saveCurrentPageToHistory(){let e=getHistoryElement(),t=currentPathForHistory||location.pathname+location.search,n;try{n=getDocument().querySelector(`[hx-history="false" i],[data-hx-history="false" i]`)}catch{n=getDocument().querySelector(`[hx-history="false"],[data-hx-history="false"]`)}n||(triggerEvent(getDocument().body,`htmx:beforeHistorySave`,{path:t,historyElt:e}),saveToHistoryCache(t,e)),htmx.config.historyEnabled&&history.replaceState({htmx:!0},getDocument().title,window.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),currentPathForHistory=e}function replaceUrlInHistory(e){htmx.config.historyEnabled&&history.replaceState({htmx:!0},``,e),currentPathForHistory=e}function settleImmediately(e){forEach(e,function(e){e.call(void 0)})}function loadHistoryFromServer(e){let t=new XMLHttpRequest,n={path:e,xhr:t};triggerEvent(getDocument().body,`htmx:historyCacheMiss`,n),t.open(`GET`,e,!0),t.setRequestHeader(`HX-Request`,`true`),t.setRequestHeader(`HX-History-Restore-Request`,`true`),t.setRequestHeader(`HX-Current-URL`,getDocument().location.href),t.onload=function(){if(this.status>=200&&this.status<400){triggerEvent(getDocument().body,`htmx:historyCacheMissLoad`,n);let t=makeFragment(this.response),r=t.querySelector(`[hx-history-elt],[data-hx-history-elt]`)||t,i=getHistoryElement(),a=makeSettleInfo(i);handleTitle(t.title),handlePreservedElements(t),swapInnerHTML(i,r,a),restorePreservedElements(),settleImmediately(a.tasks),currentPathForHistory=e,triggerEvent(getDocument().body,`htmx:historyRestore`,{path:e,cacheMiss:!0,serverResponse:this.response})}else triggerErrorEvent(getDocument().body,`htmx:historyCacheMissLoadError`,n)},t.send()}function restoreHistory(e){saveCurrentPageToHistory(),e||=location.pathname+location.search;
1let t=getCachedHistory(e);if(t){let n=makeFragment(t.content),r=getHistoryElement(),i=makeSettleInfo(r);handleTitle(t.title),handlePreservedElements(n),swapInnerHTML(r,n,i),restorePreservedElements(),settleImmediately(i.tasks),getWindow().setTimeout(function(){window.scrollTo(0,t.scroll)},0),currentPathForHistory=e,triggerEvent(getDocument().body,`htmx:historyRestore`,{path:e,item:t})}else htmx.config.refreshOnHistoryMiss?window.location.reload(!0):loadHistoryFromServer(e)}function addRequestIndicatorClasses(e){let t=findAttributeTargets(e,`hx-indicator`);return t??=[e],forEach(t,function(e){let t=getInternalData(e);t.requestCount=(t.requestCount||0)+1,e.classList.add.call(e.classList,htmx.config.requestClass)}),t}function disableElements(e){let t=findAttributeTargets(e,`hx-disabled-elt`);return t??=[],forEach(t,function(e){let t=getInternalData(e);t.requestCount=(t.requestCount||0)+1,e.setAttribute(`disabled`,``),e.setAttribute(`data-disabled-by-htmx`,``)}),t}function removeRequestIndicators(e,t){forEach(e.concat(t),function(e){let t=getInternalData(e);t.requestCount=(t.requestCount||1)-1}
1),forEach(e,function(e){getInternalData(e).requestCount===0&&e.classList.remove.call(e.classList,htmx.config.requestClass)}),forEach(t,function(e){getInternalData(e).requestCount===0&&(e.removeAttribute(`disabled`),e.removeAttribute(`data-disabled-by-htmx`))})}function haveSeenNode(e,t){for(let n=0;n<e.length;n++)if(e[n].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,n){e!=null&&t!=null&&(Array.isArray(t)?t.forEach(function(t){n.append(e,t)}):n.append(e,t))}function removeValueFromFormData(e,t,n){if(e!=null&&t!=null){let r=n.getAll(e);r=Array.isArray(t)?r.filter(e=>t.indexOf(e)<0):r.filter(e=>e!==t),n.delete(e),forEach(r,t=>n.append(e,t))}}function processInputValue(e,t,n,r,i){if(!(r==null||haveSeenNode(e,r))){if(e.push(r),shouldInclude(r)){let e=getRawAttribute(r,`name`),a=r.value;r instanceof HTMLSelectElement&&r.multiple&&(a=toArray(r.querySelectorAll(`option:checked`)).map(function(e){return e.value})),r instanceof HTMLInputElement&&r.files&&(a=toArray(r.files)),addValueToFormData(e,a,t),i&&validateElement(r,n)}r instanceof HTMLFormElement&&(forEach(r.elements,function(r){e.indexOf(r)>=0?removeValueFromFormData(r.name,r.value,t):e.push(r),i&&validateElement(r,n)}),new FormData(r).forEach(function(e,n){e instanceof File&&e.name===``||addValueToFormData(n,e,t)}))}}function validateElement(e,t){let n=e;n.willValidate&&(triggerEvent(n,`htmx:validation:validate`),n.checkValidity()||(t.push({elt:n,message:n.validationMessage,validity:n.validity}),triggerEvent(n,`htmx:validation:failed`,{message:n.validationMessage,validity:n.validity})))}function overrideFormData(e,t){for(let n of t.keys())e.delete(n);return t.forEach(function(t,n){e.append(n,t)}),e}function getInputValues(e,t){let n=[],r=new FormData,i=new FormData,a=[],o=getInternalData(e);o.lastButtonClicked&&!bodyContains(o.lastButtonClicked)&&(o.lastButtonClicked=null);let s=e instanceof HTMLFormElement&&e.noValidate!==!0||getAttributeValue(e,`hx-validate`)===`true`;if(o.lastButtonClicked&&(s&&=o.lastButtonClicked.formNoValidate!==!0),t!==`get`&&processInputValue(n,i,a,closest(e,`form`),s),processInputValue(n,r,a,e,s),o.lastButtonClicked||e.tagName===`BUTTON`||e.tagName===`INPUT`&&getRawAttribute(e,`type`)===`submit`){let t=o.lastButtonClicked||e;addValueToFormData(getRawAttribute(t,`name`),t.value,i)}return forEach(findAttributeTargets(e,`hx-include`),function(e){processInputValue(n,r,a,asElement(e),s),matches(e,`form`)||forEach(asParentNode(e).querySelectorAll(INPUT_SELECTOR),function(e){processInputValue(n,r,a,e,s)})}),overrideFormData(r,i),{errors:a,formData:r,values:formDataProxy(r)}}function appendParam(e,t,n){e!==``&&(e+=`&`),String(n)===`[object Object]`&&(n=JSON.stringify(n));let r=encodeURIComponent(n);return e+=encodeURIComponent(t)+`=`+r,e}function urlEncode(e){e=formDataFromObject(e);let t=``;return e.forEach(function(e,n){t=appendParam(t,n,e)}),t}function getHeaders(e,t,n){let r={"HX-Request":`true`,"HX-Trigger":getRawAttribute(e,`id`),"HX-Trigger-Name":getRawAttribute(e,`name`),"HX-Target":getAttributeValue(t,`id`),"HX-Current-URL":getDocument().location.href};return getValuesForElement(e,`hx-headers`,!1,r),n!==void 0&&(r[`HX-Prompt`]=n),getInternalData(e).boosted&&(r[`HX-Boosted`]=`true`),r}function filterValues(e,t){let n=getClosestAttributeValue(t,`hx-params`);if(n){if(n===`none`)return new FormData;if(n===`*`)return e;if(n.indexOf(`not `)===0)return forEach(n.slice(4).split(`,`),function(t){t=t.trim(),e.delete(t)}),e;{let t=new FormData;return forEach(n.split(`,`),function(n){n=n.trim(),e.has(n)&&e.getAll(n).forEach(function(e){t.append(n,e)})}),t}}else return e}function isAnchorLink(e){return!!getRawAttribute(e,`href`)&&getRawAttribute(e,`href`).indexOf(`#`)>=0}function getSwapSpecification(e,t){let n=t||getClosestAttributeValue(e,`hx-swap`),r={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)&&(r.show=`top`),n){let e=splitOnWhitespace(n);if(e.length>0)for(let t=0;t<e.length;t++){let n=e[t];if(n.indexOf(`swap:`)===0)r.swapDelay=parseInterval(n.slice(5));else if(n.indexOf(`settle:`)===0)r.settleDelay=parseInterval(n.slice(7));else if(n.indexOf(`transition:`)===0)r.transition=n.slice(11)===`true`;else if(n.indexOf(`ignoreTitle:`)===0)r.ignoreTitle=n.slice(12)===`true`;else if(n.indexOf(`scroll:`)===0){var i=n.slice(7).split(`:`);let e=i.pop();var a=i.length>0?i.join(`:`):null;r.scroll=e,r.scrollTarget=a}else if(n.indexOf(`show:`)===0){var i=n.slice(5).split(`:`);let e=i.pop();var a=i.length>0?i.join(`:`):null;r.show=e,r.showTarget=a}else n.indexOf(`focus-scroll:`)===0?r.focusScroll=n.slice(13)==`true`:t==0?r.swapStyle=n:logError(`Unknown modifier in hx-swap: `+n)}}return r}function usesFormData(e){return getClosestAttributeValue(e,`hx-encoding`)===`multipart/form-data`||matches(e,`form`)&&getRawAttribute(e,`enctype`)===`multipart/form-data`}function encodeParamsForBody(e,t,n){let r=null;return withExtensions(t,function(i){r??=i.encodeParameters(e,n,t)}),r??(usesFormData(t)?overrideFormData(new FormData,formDataFromObject(n)):urlEncode(n))}function makeSettleInfo(e){return{tasks:[],elts:[e]}}function updateScrollState(e,t){let n=e[0],r=e[e.length-1];if(t.scroll){var i=null;t.scrollTarget&&(i=asElement(querySelectorExt(n,t.scrollTarget))),t.scroll===`top`&&(n||i)&&(i||=n,i.scrollTop=0),t.scroll===`bottom`&&(r||i)&&(i||=r,i.scrollTop=i.scrollHeight)}if(t.show){var i=null;if(t.showTarget){let e=t.showTarget;t.showTarget===`window`&&(e=`body`),i=asElement(querySelectorExt(n,e))}t.show===`top`&&(n||i)&&(i||=n,i.scrollIntoView({block:`start`,behavior:htmx.config.scrollBehavior})),t.show===`bottom`&&(r||i)&&(i||=r,i.scrollIntoView({block:`end`,behavior:htmx.config.scrollBehavior}))}}function getValuesForElement(e,t,n,r){if(r??={},e==null)return r;let i=getAttributeValue(e,t);if(i){let t=i.trim(),a=n;if(t===`unset`)return null;t.indexOf(`javascript:`)===0?(t=t.slice(11),a=!0):t.indexOf(`js:`)===0&&(t=t.
1slice(3),a=!0),t.indexOf(`{`)!==0&&(t=`{`+t+`}`);let o;o=a?maybeEval(e,function(){return Function(`return (`+t+`)`)()},{}):parseJSON(t);for(let e in o)o.hasOwnProperty(e)&&(r[e]??(r[e]=o[e]))}return getValuesForElement(asElement(parentElt(e)),t,n,r)}function maybeEval(e,t,n){return htmx.config.allowEval?t():(triggerErrorEvent(e,`htmx:evalDisallowedError`),n)}function getHXVarsForElement(e,t){return getValuesForElement(e,`hx-vars`,!0,t)}function getHXValsForElement(e,t){return getValuesForElement(e,`hx-vals`,!1,t)}function getExpressionVars(e){return mergeObjects(getHXVarsForElement(e),getHXValsForElement(e))}function safelySetHeaderValue(e,t,n){if(n!==null)try{e.setRequestHeader(t,n)}catch{e.setRequestHeader(t,encodeURIComponent(n)),e.setRequestHeader(t+`-URI-AutoEncoded`,`true`)}}function getPathFromResponse(e){if(e.responseURL&&typeof URL<`u`)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,n){if(e=e.toLowerCase(),n){if(n instanceof Element||typeof n==`string`)return issueAjaxRequest(e,t,null,null,{targetOverride:resolveTarget(n)||DUMMY_ELT,returnPromise:!0});{let r=resolveTarget(n.target);return(n.target&&!r||n.source&&!r&&!resolveTarget(n.source))&&(r=DUMMY_ELT),issueAjaxRequest(e,t,resolveTarget(n.source),n.event,{handler:n.handler,headers:n.headers,values:n.values,targetOverride:r,
1swapOverride:n.swap,select:n.select,returnPromise:!0})}}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,n){let r,i;return typeof URL==`function`?(i=new URL(t,document.location.href),r=document.location.origin===i.origin):(i=t,r=startsWith(t,document.location.origin)),htmx.config.selfRequestsOnly&&!r?!1:triggerEvent(e,`htmx:validateUrl`,mergeObjects({url:i,sameHost:r},n))}function formDataFromObject(e){if(e instanceof FormData)return e;let t=new FormData;for(let n in e)e.hasOwnProperty(n)&&(e[n]&&typeof e[n].forEach==`function`?e[n].forEach(function(e){t.append(n,e)}):typeof e[n]==`object`&&!(e[n]instanceof Blob)?t.append(n,JSON.stringify(e[n])):t.append(n,e[n]));return t}function formDataArrayProxy(e,t,n){return new Proxy(n,{get:function(n,r){return typeof r==`number`?n[r]:r===`length`?n.length:r===`push`?function(r){n.push(r),e.append(t,r)}:typeof n[r]==`function`?function(){n[r].apply(n,arguments),e.delete(t),n.forEach(function(n){e.append(t,n)})}:n[r]&&n[r].length===1?n[r][0]:n[r]},set:function(n,r,i){return n[r]=i,e.delete(t),n.forEach(function(n){e.append(t,n)}),!0}})}function formDataProxy(e){return new Proxy(e,{get:function(t,n){if(typeof n==`symbol`){let r=Reflect.get(t,n);return typeof r==`function`?function(){return r.apply(e,arguments)}:r}if(n===`toJSON`)return()=>Object.fromEntries(e);if(n in t)return typeof t[n]==`function`?function(){return e[n].apply(e,arguments)}:t[n];let r=e.getAll(n);if(r.length!==0)return r.length===1?r[0]:formDataArrayProxy(t,n,r)},set:function(e,t,n){return typeof t==`string`?(e.delete(t),n&&typeof n.forEach==`function`?n.forEach(function(n){e.append(t,n)}):typeof n==`object`&&!(n instanceof Blob)?e.append(t,JSON.stringify(n)):e.append(t,n),!0):!1},deleteProperty:function(e,t){return typeof t==`string`&&e.delete(t),!0},ownKeys:function(e){return Reflect.ownKeys(Object.fromEntries(e))},getOwnPropertyDescriptor:function(e,t){return Reflect.getOwnPropertyDescriptor(Object.fromEntries(e),t)}})}function issueAjaxRequest(e,t,n,r,i,a){let o=null,s=null;if(i??={},i.returnPromise&&typeof Promise<`u`)var c=new Promise(function(e,t){o=e,s=t});n??=getDocument().body;let l=i.handler||handleAjaxResponse,u=i.select||null;if(!bodyContains(n))return maybeCall(o),c;let d=i.targetOverride||asElement(getTarget(n));if(d==null||d==DUMMY_ELT)return triggerErrorEvent(n,`htmx:targetError`,{target:getAttributeValue(n,`hx-target`)}),maybeCall(s),c;let f=getInternalData(n),p=f.lastButtonClicked;if(p){let n=getRawAttribute(p,`formaction`);n!=null&&(t=n);let r=getRawAttribute(p,`formmethod`);r!=null&&r.toLowerCase()!==`dialog`&&(e=r)}let m=getClosestAttributeValue(n,`hx-confirm`);if(a===void 0&&triggerEvent(n,`htmx:confirm`,{target:d,elt:n,path:t,verb:e,triggeringEvent:r,etc:i,issueRequest:function(a){return issueAjaxRequest(e,t,n,r,i,!!a)},question:m})===!1)return maybeCall(o),c;let h=n,g=getClosestAttributeValue(n,`hx-sync`),_=null,v=!1;if(g){let e=g.split(`:`),t=e[0].trim();if(h=t===`this`?findThisElement(n,`hx-sync`):asElement(querySelectorExt(n,t)),g=(e[1]||`drop`).trim(),f=getInternalData(h),g===`drop`&&f.xhr&&f.abortable!==!0)return maybeCall(o),c;if(g===`abort`){if(f.xhr)return maybeCall(o),c;v=!0}else g===`replace`?triggerEvent(h,`htmx:abort`):g.indexOf(`queue`)===0&&(_=(g.split(` `)[1]||`last`).trim())}if(f.xhr)if(f.abortable)triggerEvent(h,`htmx:abort`);else{if(_==null){if(r){let e=getInternalData(r);e&&e.triggerSpec&&e.triggerSpec.queue&&(_=e.triggerSpec.queue)}_??=`last`}return f.queuedRequests??=[],_===`first`&&f.queuedRequests.length===0||_===`all`?f.queuedRequests.push(function(){issueAjaxRequest(e,t,n,r,i)}):_===`last`&&(f.queuedRequests=[],f.queuedRequests.push(function(){issueAjaxRequest(e,t,n,r,i)})),maybeCall(o),c}let y=new XMLHttpRequest;f.xhr=y,f.abortable=v;let b=function(){f.xhr=null,f.abortable=!1,f.queuedRequests!=null&&f.queuedRequests.length>0&&f.queuedRequests.shift()()},x=getClosestAttributeValue(n,`hx-prompt`);if(x){var S=prompt(x);if(S===null||!triggerEvent(n,`htmx:prompt`,{prompt:S,target:d}))return maybeCall(o),b(),c}if(m&&!a&&!confirm(m))return maybeCall(o),b(),c;let C=getHeaders(n,d,S);e!==`get`&&!usesFormData(n)&&(C[`Content-Type`]=`application/x-www-form-urlencoded`),i.headers&&(C=mergeObjects(C,i.headers));let w=getInputValues(n,e),T=w.errors,E=w.formData;i.values&&overrideFormData(E,formDataFromObject(i.values));let D=overrideFormData(E,formDataFromObject(getExpressionVars(n))),O=filterValues(D,n);htmx.config.getCacheBusterParam&&e===`get`&&O.set(`org.htmx.cache-buster`,getRawAttribute(d,`id`)||`true`),(t==null||t===``)&&(t=getDocument().location.href);let k=getValuesForElement(n,`hx-request`),A=getInternalData(n).boosted,j=htmx.config.methodsThatUseUrlParams.indexOf(e)>=0,M={boosted:A,useUrlParams:j,formData:O,parameters:formDataProxy(O),unfilteredFormData:D,unfilteredParameters:formDataProxy(D),headers:C,target:d,verb:e,errors:T,withCredentials:i.credentials||k.credentials||htmx.config.withCredentials,timeout:i.timeout||k.timeout||htmx.config.timeout,path:t,triggeringEvent:r};
1if(!triggerEvent(n,`htmx:configRequest`,M))return maybeCall(o),b(),c;if(t=M.path,e=M.verb,C=M.headers,O=formDataFromObject(M.parameters),T=M.errors,j=M.useUrlParams,T&&T.length>0)return triggerEvent(n,`htmx:validation:halted`,M),maybeCall(o),b(),c;let N=t.split(`#`),P=N[0],F=N[1],I=t;if(j&&(I=P,O.keys().next().done||(I.indexOf(`?`)<0?I+=`?`:I+=`&`,I+=urlEncode(O),F&&(I+=`#`+F))),!verifyPath(n,I,M))return triggerErrorEvent(n,`htmx:invalidPath`,M),maybeCall(s),c;if(y.open(e.toUpperCase(),I,!0),y.overrideMimeType(`text/html`),y.withCredentials=M.withCredentials,y.timeout=M.timeout,!k.noHeaders){for(let e in C)if(C.hasOwnProperty(e)){let t=C[e];safelySetHeaderValue(y,e,t)}}let L={xhr:y,target:d,requestConfig:M,etc:i,boosted:A,select:u,pathInfo:{requestPath:t,finalRequestPath:I,responsePath:null,anchor:F}};if(y.onload=function(){try{let e=hierarchyForElt(n);if(L.pathInfo.responsePath=getPathFromResponse(y),l(n,L),L.keepIndicators!==!0&&removeRequestIndicators(R,z),triggerEvent(n,`htmx:afterRequest`,L),triggerEvent(n,`htmx:afterOnLoad`,L),!bodyContains(n)){let t=null;for(;e.length>0&&t==null;){let n=e.shift();bodyContains(n)&&(t=n)}t&&(triggerEvent(t,`htmx:afterRequest`,L),triggerEvent(t,`htmx:afterOnLoad`,L))}maybeCall(o),b()}catch(e){throw triggerErrorEvent(n,`htmx:onLoadError`,mergeObjects({error:e},L)),e}},y.onerror=function(){removeRequestIndicators(R,z),triggerErrorEvent(n,`htmx:afterRequest`,L),triggerErrorEvent(n,`htmx:sendError`,L),maybeCall(s),b()},y.onabort=function(){removeRequestIndicators(R,z),triggerErrorEvent(n,`htmx:afterRequest`,L),triggerErrorEvent(n,`htmx:sendAbort`,L),maybeCall(s),b()},y.ontimeout=function(){removeRequestIndicators(R,z),triggerErrorEvent(n,`htmx:afterRequest`,L),triggerErrorEvent(n,`htmx:timeout`,L),maybeCall(s),b()},!triggerEvent(n,`htmx:beforeRequest`,L))return maybeCall(o),b(),c;var R=addRequestIndicatorClasses(n),z=disableElements(n);forEach([`loadstart`,`loadend`,`progress`,`abort`],function(e){forEach([y,y.upload],function(t){t.addEventListener(e,function(t){triggerEvent(n,`htmx:xhr:`+e,{lengthComputable:t.lengthComputable,loaded:t.loaded,total:t.total})})})}),triggerEvent(n,`htmx:beforeSend`,L);let B=j?null:encodeParamsForBody(y,n,O);return y.send(B),c}function determineHistoryUpdates(e,t){let n=t.xhr,r=null,i=null;if(hasHeader(n,/HX-Push:/i)?(r=n.getResponseHeader(`HX-Push`),i=`push`):hasHeader(n,/HX-Push-Url:/i)?(r=n.getResponseHeader(`HX-Push-Url`),i=`push`):hasHeader(n,/HX-Replace-Url:/i)&&(r=n.getResponseHeader(`HX-Replace-Url`),i=`replace`),r)return r===`false`?{}:{type:i,path:r};let a=t.pathInfo.finalRequestPath,o=t.pathInfo.responsePath,s=getClosestAttributeValue(e,`hx-push-url`),c=getClosestAttributeValue(e,`hx-replace-url`),l=getInternalData(e).boosted,u=null,d=null;return s?(u=`push`,d=s):c?(u=`replace`,d=c):l&&(u=`push`,d=o||a),d?d===`false`?{}:(d===`true`&&(d=o||a),t.pathInfo.anchor&&d.indexOf(`#`)===-1&&(d=d+`#`+t.pathInfo.anchor),{type:u,path:d}):{}}function codeMatches(e,t){return new RegExp(e.code).test(t.toString(10))}function resolveResponseHandling(e){for(var t=0;t<htmx.config.responseHandling.length;t++){var n=htmx.config.responseHandling[t];if(codeMatches(n,e.status))return n}return{swap:!1}}function handleTitle(e){if(e){let t=find(`title`);t?t.innerHTML=e:window.document.title=e}}function handleAjaxResponse(e,t){let n=t.xhr,r=t.target,i=t.etc,a=t.select;if(!triggerEvent(e,`htmx:beforeOnLoad`,t))return;if(hasHeader(n,/HX-Trigger:/i)&&handleTriggerHeader(n,`HX-Trigger`,e),hasHeader(n,/HX-Location:/i)){saveCurrentPageToHistory();let e=n.getResponseHeader(`HX-Location`);var o;e.indexOf(`{`)===0&&(o=parseJSON(e),e=o.path,delete o.path),ajaxHelper(`get`,e,o).then(function(){pushUrlIntoHistory(e)});return}let s=hasHeader(n,/HX-Refresh:/i)&&n.getResponseHeader(`HX-Refresh`)===`true`;if(hasHeader(n,/HX-Redirect:/i)){t.keepIndicators=!0,location.href=n.getResponseHeader(`HX-Redirect`),s&&location.reload();return}if(s){t.keepIndicators=!0,location.reload();return}hasHeader(n,/HX-Retarget:/i)&&(n.getResponseHeader(`HX-Retarget`)===`this`?t.target=e:t.target=asElement(querySelectorExt(e,n.getResponseHeader(`HX-Retarget`))));let c=determineHistoryUpdates(e,t),l=resolveResponseHandling(n),u=l.swap,d=!!l.error,f=htmx.config.ignoreTitle||l.ignoreTitle,p=l.select;l.target&&(t.target=asElement(querySelectorExt(e,l.target)));var m=i.swapOverride;m==null&&l.swapOverride&&(m=l.swapOverride),hasHeader(n,/HX-Retarget:/i)&&(n.getResponseHeader(`HX-Retarget`)===`this`?t.target=e:t.target=asElement(querySelectorExt(e,n.getResponseHeader(`HX-Retarget`)))),hasHeader(n,/HX-Reswap:/i)&&(m=n.getResponseHeader(`HX-Reswap`));var h=n.response,g=mergeObjects({shouldSwap:u,serverResponse:h,isError:d,ignoreTitle:f,selectOverride:p,swapOverride:m},t);if(!(l.event&&!triggerEvent(r,l.event,g))&&triggerEvent(r,`htmx:beforeSwap`,g)){if(r=g.target,h=g.serverResponse,d=g.isError,f=g.ignoreTitle,p=g.selectOverride,m=g.swapOverride,t.target=r,t.failed=d,t.successful=!d,g.shouldSwap){n.status===286&&cancelPolling(e),withExtensions(e,function(t){h=t.transformResponse(h,n,e)}),c.type&&saveCurrentPageToHistory();var _=getSwapSpecification(e,m);_.hasOwnProperty(`ignoreTitle`)||(_.ignoreTitle=f),r.classList.add(htmx.config.swappingClass);let i=null,o=null;a&&(p=a),hasHeader(n,/HX-Reselect:/i)&&(p=n.getResponseHeader(`HX-Reselect`));let s=getClosestAttributeValue(e,`hx-select-oob`),l=getClosestAttributeValue(e,`hx-select`),u=function(){try{c.type&&(triggerEvent(getDocument().body,`htmx:beforeHistoryUpdate`,mergeObjects({history:c},t)),c.type===`push`?(pushUrlIntoHistory(c.path),triggerEvent(getDocument().body,`htmx:pushedIntoHistory`,{path:c.path})):(replaceUrlInHistory(c.path),triggerEvent(getDocument().body,`htmx:replacedInHistory`,{path:c.path}
1))),swap(r,h,_,{select:p||l,selectOOB:s,eventInfo:t,anchor:t.pathInfo.anchor,contextElement:e,afterSwapCallback:function(){if(hasHeader(n,/HX-Trigger-After-Swap:/i)){let t=e;bodyContains(e)||(t=getDocument().body),handleTriggerHeader(n,`HX-Trigger-After-Swap`,t)}},afterSettleCallback:function(){if(hasHeader(n,/HX-Trigger-After-Settle:/i)){let t=e;bodyContains(e)||(t=getDocument().body),handleTriggerHeader(n,`HX-Trigger-After-Settle`,t)}maybeCall(i)}})}catch(n){throw triggerErrorEvent(e,`htmx:swapError`,t),maybeCall(o),n}},d=htmx.config.globalViewTransitions;if(_.hasOwnProperty(`transition`)&&(d=_.transition),d&&triggerEvent(e,`htmx:beforeTransition`,t)&&typeof Promise<`u`&&document.startViewTransition){let e=new Promise(function(e,t){i=e,o=t}),t=u;u=function(){document.startViewTransition(function(){return t(),e})}}_.swapDelay>0?getWindow().setTimeout(u,_.swapDelay):u()}d&&triggerErrorEvent(e,`htmx:responseError`,mergeObjects({error:`Response Status Error Code `+n.status+` from `+t.pathInfo.requestPath},t))}}const extensions={};function extensionBase(){return{init:function(e){return null},getSelectors:function(){return null},onEvent:function(e,t){return!0},transformResponse:function(e,t,n){return e},isInlineSwap:function(e){return!1},handleSwap:function(e,t,n,r){return!1},encodeParameters:function(e,t,n){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,n){if(t??=[],e==null)return t;n??=[];let r=getAttributeValue(e,`hx-ext`);return r&&forEach(r.split(`,`),function(e){if(e=e.replace(/ /g,``),e.slice(0,7)==`ignore:`){n.push(e.slice(7));return}if(n.indexOf(e)<0){let n=extensions[e];n&&t.indexOf(n)<0&&t.push(n)}}),getExtensions(asElement(parentElt(e)),t,n)}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}"`:``;getDocument().head.insertAdjacentHTML(`beforeend`,`<style`+e+`>      .`+htmx.config.indicatorClass+`{opacity:0}      .`+htmx.config.requestClass+` .`+htmx.config.indicatorClass+`{opacity:1; transition: opacity 200ms ease-in;}      .`+htmx.config.requestClass+`.`+htmx.config.indicatorClass+`{opacity:1; 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(e){let t=e.target,n=getInternalData(t);n&&n.xhr&&n.xhr.abort()});let n=window.onpopstate?window.onpopstate.bind(window):null;window.onpopstate=function(e){e.state&&e.state.htmx?(restoreHistory(),forEach(t,function(e){triggerEvent(e,`htmx:restored`,{document:getDocument(),triggerEvent})})):n&&n(e)},getWindow().setTimeout(function(){triggerEvent(e,`htmx:load`,{}),e=null},0)}),htmx})(),DropdownMenu=class e extends HTMLElement{constructor(...e){super(...e),this.panel=null,this.trigger=null,this.panelPlaceholder=null,this.abortController=null,this.menuOffset=4}connectedCallback(){this.abortController?.abort(),this.abortController=new AbortController,this.panel=this.querySelector(`.dropdown-panel`),this.panel&&(this.trigger=this.firstElementChild,this.trigger&&(this.trigger.addEventListener(`click`,e=>{e.stopPropagation(),this.hasAttribute(`data-open`)?this.close():this.open()},{signal:this.abortController.signal}),document.addEventListener(`click`,e=>{let t=e.target;!this.contains(t)&&!this.panel?.contains(t)&&this.close()},{signal:this.abortController.signal}
1),document.addEventListener(`keydown`,e=>{e.key===`Escape`&&this.close()},{signal:this.abortController.signal}),window.addEventListener(`resize`,()=>this.reposition(),{signal:this.abortController.signal}),document.addEventListener(`scroll`,()=>this.reposition(),{capture:!0,signal:this.abortController.signal}),this.panel.addEventListener(`click`,()=>{window.setTimeout(()=>this.close(),0)},{signal:this.abortController.signal})))}disconnectedCallback(){this.close(),this.abortController?.abort(),this.abortController=null}open(){!this.panel||!this.trigger||(this.closeOtherDropdowns(),this.setAttribute(`data-open`,``),this.portalPanel(),this.panel.classList.remove(`hidden`),this.panel.style.position=`fixed`,this.panel.style.left=`0`,this.panel.style.top=`0`,this.panel.style.right=`auto`,this.panel.style.zIndex=`9999`,requestAnimationFrame(()=>this.reposition()))}close(){this.panel&&(this.removeAttribute(`data-open`),this.panel.classList.add(`hidden`),this.panel.style.position=``,this.panel.style.left=``,this.panel.style.top=``,this.panel.style.right=``,this.panel.style.zIndex=``,this.restorePanel())}reposition(){if(!this.hasAttribute(`data-open`)||!this.panel||!this.trigger)return;let e=this.trigger.getBoundingClientRect(),t=this.panel.getBoundingClientRect(),n=8,r=e.left;r+t.width>window.innerWidth-8&&(r=e.right-t.width),r=Math.max(8,r);let i=e.bottom+this.menuOffset;i+t.height>window.innerHeight-8&&(i=e.top-t.height-this.menuOffset),i=Math.max(8,i),this.panel.style.left=`${r}px`,this.panel.style.top=`${i}px`}closeOtherDropdowns(){for(let t of document.querySelectorAll(`dropdown-menu[data-open]`))t!==this&&t instanceof e&&t.close()}portalPanel(){!this.panel||this.panelPlaceholder||(this.panelPlaceholder=document.createComment(`dropdown-panel`),this.panel.parentNode?.insertBefore(this.panelPlaceholder,this.panel),document.body.appendChild(this.panel))}restorePanel(){!this.panel||!this.panelPlaceholder||(this.panelPlaceholder.parentNode?.insertBefore(this.panel,this.panelPlaceholder),this.panelPlaceholder.remove(),this.panelPlaceholder=null)}};customElements.define(`dropdown-menu`,DropdownMenu);var ACCEPTED_IMAGE_TYPES=[`image/png`,`image/jpeg`,`image/gif`,`image/webp`],ACCEPTED_VIDEO_TYPES=[`video/mp4`,`video/webm`],ACCEPTED_TYPES=[...ACCEPTED_IMAGE_TYPES,...ACCEPTED_VIDEO_TYPES],MAX_UPLOAD_BYTES=32*1024*1024,UNSUPPORTED_TYPE_MESSAGE=`Only images (PNG, JPEG, GIF, WebP) and videos (MP4, WebM) can be attached`;function isAcceptedFile(e){return ACCEPTED_TYPES.includes(e.type)}function isVideoFile(e){return ACCEPTED_VIDEO_TYPES.includes(e.type)}var MarkdownEditor=class extends HTMLElement{#e;#t;#n;#r=null;#i=``;#a;#o;constructor(){if(super(),this.#e=this.querySelector(`textarea`),this.#t=this.querySelector(`[data-tab="preview"] .prose`),this.#a=this.#e.offsetHeight,this.#o=this.getAttribute(`data-storage-key`),this.#o){let e=localStorage.getItem(this.#o);e&&!this.#e.value.trim()&&(this.#e.value=e)}this.#e.addEventListener(`paste`,this.#g.bind(this)),this.#e.addEventListener(`dragover`,this.#m.bind(this)),this.#e.addEventListener(`drop`,this.#h.bind(this)),this.#e.addEventListener(`input`,this.#s.bind(this)),this.closest(`form`)?.addEventListener(`submit`,()=>{this.#l()}),this.#n=document.createElement(`input`),this.#n.type=`file`,this.#n.accept=ACCEPTED_TYPES.join(`,`),this.#n.className=`image-paste-file`,this.#n.style.display=`none`,this.#n.addEventListener(`change`,this.#p.bind(this)),this.appendChild(this.#n),this.addEventListener(`click`,e=>{e.target.closest(`[data-image-paste]`)&&this.#n.click()}),this.#u(),this.#e.value.trim()&&this.#d()}#s(){this.#u(),this.#d(),this.#c()}#c(){if(!this.#o)return;let e=this.#e.value;e.trim()?localStorage.setItem(this.#o,e):localStorage.removeItem(this.#o)}#l(){this.#o&&localStorage.removeItem(this.#o)}#u(){this.#e.style.height=`auto`;let e=Math.max(this.#e.scrollHeight,this.#a);this.#e.style.height=`${e}px`}#d(){this.#r&&clearTimeout(this.#r),this.#r=setTimeout(()=>{this.#f()},500)}async#f(){if(!this.#t)return;let e=this.#e.value.trim();if(e!==this.#i){if(!e){this.#i=e,this.#t.innerHTML=`<p class="text-text-subtlest italic">Nothing to preview</p>`;return}try{let t=new FormData;t.append(`content`,this.#e.value);let n=await fetch(`/api/feedback/preview`,{method:`POST`,body:t});if(!n.ok)throw Error(`Preview failed`);this.#i=e,this.#t.innerHTML=await n.text()}catch{this.#t.innerHTML=`<p class="text-danger italic">Failed to load preview</p>`}}}async#p(){let e=this.#n.files?.[0];e&&(isAcceptedFile(e)?await this.#v(e):alert(UNSUPPORTED_TYPE_MESSAGE),this.#n.value=``)}#m(e){e.dataTransfer?.types.includes(`Files`)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`)}async#h(e){let t=e.dataTransfer?.files;if(!(!t||t.length===0)){for(let n of t)if(isAcceptedFile(n)){e.preventDefault(),await this.#v(n);return}e.preventDefault(),alert(UNSUPPORTED_TYPE_MESSAGE)}}async#g(e){let t=e.clipboardData?.items;if(!t)return;let n=e.clipboardData?.getData(`text/plain`);if(n&&this.#_(n)){let t=this.#e.selectionStart,r=this.#e.selectionEnd;if(t!==r){e.preventDefault();let i=`[${this.#e.value.substring(t,r)}](${n})`,a=this.#e.value.substring(0,t),o=this.#e.value.substring(r);this.#e.value=a+i+o,this.#e.selectionStart=this.#e.selectionEnd=t+i.length,this.#e.dispatchEvent(new Event(`input`,{bubbles:!0}));return}}for(let n of t){if(n.kind!==`file`||!ACCEPTED_TYPES.includes(n.t
1ype))continue;let t=n.getAsFile();if(t){e.preventDefault(),await this.#v(t);break}}}#_(e){try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}async#v(e){let t=isVideoFile(e)?`video`:`image`;if(e.size>MAX_UPLOAD_BYTES){alert(`The ${t} must be under 32MB`);return}let n=`![Uploading ${t}...](uploading-${Math.random().toString(36).substring(2,8)})`;this.#y(n);try{let r=new FormData;r.append(`file`,e);let i=await fetch(`/api/feedback/upload`,{method:`POST`,body:r});if(!i.ok){let e=await i.json();throw Error(e.message||`Upload failed`)}let a=await i.json();this.#e.value=this.#e.value.replace(n,`![${t}](${a.url})`)}catch{this.#e.value=this.#e.value.replace(n,``)}this.#e.dispatchEvent(new Event(`input`,{bubbles:!0}))}#y(e){let t=this.#e.selectionStart,n=this.#e.selectionEnd,r=this.#e.value.substring(0,t),i=this.#e.value.substring(n),a=r.length>0&&!r.endsWith(`
2`),o=i.length>0&&!i.startsWith(`
3`),s=(a?`
4`:``)+e+(o?`
5`:``);this.#e.value=r+s+i,this.#e.selectionStart=this.#e.selectionEnd=t+s.length}};customElements.define(`markdown-editor`,MarkdownEditor);var Navbar=class extends HTMLElement{#e;constructor(){super(),this.#e=this.querySelector(`.yaak-navbar-menu`),this.querySelectorAll(`.yaak-navbar-toggle`).forEach(e=>{e.addEventListener(`click`,e=>{e.preventDefault(),this.toggle()})}),document.addEventListener(`click`,e=>{let t=e.target instanceof Element?e.target:null;t!=null&&t.closest(`yaak-navbar`)==null&&this.isOpen()&&this.toggle()})}toggle(){this.#e.classList.toggle(`hidden`)}isOpen(){return!this.#e.classList.contains(`hidden`)}};customElements.define(`yaak-navbar`,Navbar);var relativeFormatter=new Intl.RelativeTimeFormat(void 0,{numeric:`always`}),timestampFormatter=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`long`}),units=[[`year`,365*24*60*60],[`month`,720*60*60],[`week`,10080*60],[`day`,1440*60],[`hour`,3600],[`minute`,60],[`second`,1]],LocalTime=class extends HTMLElement{connectedCallback(){this.update(),this.timer=setInterval(()=>this.update(),6e4)}disconnectedCallback(){clearInterval(this.timer)}update(){let e=this.getAttribute(`datetime`);if(!e)return;let t=new Date(e),n=this.querySelector(`time`);if(!n||Number.isNaN(t.getTime()))return;let r=timestampFormatter.format(t),i=this.querySelector(`[data-local-timestamp]`);i&&(i.textContent=r);let a=(t.getTime()-Date.now())/1e3,[o,s]=units.find(([,e])=>Math.abs(a)>=e)??units[units.length-1];n.textContent=relativeFormatter.format(Math.round(a/s),o),n.setAttribute(`aria-label`,`${n.textContent}, ${r}`)}};customElements.define(`local-time`,LocalTime);var themeComponentNames=[`dialog`,`menu`,`toast`,`sidebar`,`responsePane`,`appHeader`,`button`,`banner`,`templateTag`,`urlBar`,`editor`,`input`],PluginThemePreview=class extends HTMLElement{connectedCallback(){let e=this.readTheme();if(e==null)return;let t=this.getAttribute(`data-preview-id`)||`plugin-theme-preview-${e.id}`,n=completeTheme({...e,id:t,label:``,base:{...e.base},components:sanitizeThemeComponents(e.components)}),r=this.querySelector(`.plugin-theme-preview-theme-root`);r!=null&&(r.setAttribute(`data-theme`,n.id),r.style.colorScheme=n.dark?`dark`:`light`,this.upsertStyle(getPreviewThemeCSS(n)))}readTheme(){let e=this.querySelector(`script[data-plugin-theme-preview-theme]`);if(e==null)return null;try{return JSON.parse(e.textContent||`null`)}catch(e){return console.error(`Failed to parse plugin theme preview`,e),null}}upsertStyle(e){let t=this.querySelector(`style[data-plugin-theme-preview-style]`);t??(t=document.createElement(`style`),t.setAttribute(`data-plugin-theme-preview-style`,``),this.prepend(t)),t.textContent=e}};customElements.define(`plugin-theme-preview`,PluginThemePreview);function getPreviewThemeCSS(e){let t=getThemeCSS(e),n=completeFullColorVariables(e,e.base),r=themeComponentNames.map(e=>[`    .x-theme-${e} {`,...Object.entries(n).filter(([,e])=>e).map(([e,t])=>`        --${e}: ${t};`),`    }`].join(`
6`)).join(`
7
8`);return t.replace(/\{\n/,`{\n${r}\n\n`)}function sanitizeThemeComponents(e){if(e!=null)return Object.fromEntries(Object.entries(e).filter(([e])=>themeComponentNames.includes(e)))}var Tabs=class extends HTMLElement{#e;constructor(){if(super(),this.#e=this.getAttribute(`data-tab-group`),this.addEventListener(`click`,e=>{if(!(e.target instanceof HTMLElement))return;let t=e.target.closest(`.tab-button`);if(!t||!this.#t(t))return;let n=t.getAttribute(`data-tab`);n!=null&&(this.setActiveTab(n),this.#e&&window.op?.(`track`,`tab.click`,{group:this.#e,id:n}))}),this.#e){let e=new URLSearchParams(window.location.search).get(this.#e);e&&this.setActiveTab(e)}}setActiveTab(e){if(this.getAttribute(`data-active-tab`)!=e){if(this.setAttribute(`data-active-tab`,e),this.#e){let t=new URLSearchParams(window.location.search);t.set(this.#e,e),window.history.replaceState(null,``,`?${t.toString()}`)}this.showActiveTab()}}getActiveTab(){return this.getAttribute(`data-active-tab`)??`__UNKNOWN__`}#t(e){return e.closest(`simple-tabs`)===this}showActiveTab(){let e=this.getActiveTab();
8this.querySelectorAll(`.active`).forEach(e=>{e instanceof HTMLElement&&this.#t(e)&&e.classList.remove(`active`)}),this.querySelectorAll(`[data-tab='${e}']`).forEach(e=>{if(e instanceof HTMLElement&&this.#t(e)&&(e.classList.add(`active`),e.classList.contains(`tab-button`)&&e.parentElement)){let t=e.parentElement,n=e.offsetLeft-t.offsetLeft-t.clientWidth/2+e.clientWidth/2;t.scrollTo({left:n,behavior:`smooth`})}})}};customElements.define(`simple-tabs`,Tabs);var images=new Map;function loadImage(e,t=``,n=`100vw`){let r=`${e}|${t}|${n}|${innerWidth}|${devicePixelRatio}`,i=images.get(r);if(i)return i;let a=new Image;a.sizes=n,a.srcset=t,a.src=e;let o=a.decode().catch(e=>{throw images.delete(r),e});return images.set(r,o),o}var ThemePicture=class extends HTMLElement{constructor(...e){super(...e),this.selected=null,this.generation=0,this.followAppearance=()=>{if(this.selected)return;let e=window.yaakTheme?window.yaakTheme.getTheme()===`yaak-dark`:matchMedia(`(prefers-color-scheme: dark)`).matches,t=this.querySelector(`source`);t&&matchMedia(t.media).matches!==e&&(t.media=e?`all`:`not all`);let n=this.querySelector(`[data-screenshot-link]`),r=e?this.dataset.darkSrc:this.dataset.lightSrc;n&&r&&(n.href=r)}}connectedCallback(){window.addEventListener(`yaak-theme-change`,this.followAppearance),this.followAppearance()}disconnectedCallback(){window.removeEventListener(`yaak-theme-change`,this.followAppearance)}async select(e,t=``,n=`100vw`){let r=++this.generation;try{await loadImage(e,t,n)}catch{return!1}if(r!==this.generation||!this.isConnected)return!1;this.selected=e;let i=this.querySelector(`[data-screenshot-link]`);i&&(i.href=e);let a=this.querySelector(`img`);return a&&(a.sizes=n,a.srcset=t,a.src=e),this.querySelector(`source`)?.setAttribute(`media`,`not all`),!0}};customElements.define(`theme-picture`,ThemePicture);var ThemeButtons=class extends HTMLElement{constructor(...e){super(...e),this.previewTheme=null,this.buttons=[],this.appearanceButtons=[],this.initialized=!1,this.refresh=()=>{let e=this.previewTheme??window.yaakTheme?.getTheme(),t=window.yaakTheme?.getAppearance();for(let t of this.buttons){let n=t.dataset.changeTheme===e;t.classList.toggle(`active`,n),t.setAttribute(`aria-pressed`,String(n))}for(let e of this.appearanceButtons){let n=e.dataset.changeAppearance===t;e.classList.toggle(`active`,n),e.setAttribute(`aria-pressed`,String(n))}}}connectedCallback(){this.initialized||(this.initialized=!0,this.buttons=[...this.querySelectorAll(`[data-change-theme]`)],this.appearanceButtons=[...this.querySelectorAll(`[data-change-appearance]`)],this.buttons.forEach(e=>{let t=e.dataset.themeImage;if(!t)return;let n=()=>{loadImage(t,e.dataset.themeSrcset,e.dataset.themeSizes).catch(()=>{})};e.addEventListener(`pointerenter`,n),e.addEventListener(`focus`,n),e.addEventListener(`click`,async()=>{await this.preview?.select(t,e.dataset.themeSrcset,e.dataset.themeSizes)&&(this.previewTheme=e.dataset.changeTheme??null,this.refresh(),window.op?.(`track`,`theme.switch`,{theme:this.previewTheme}))})}),this.appearanceButtons.forEach(e=>e.addEventListener(`click`,()=>{let t=e.dataset.changeAppearance;window.yaakTheme?.setAppearance(t),window.op?.(`track`,`appearance.switch`,{appearance:t})}))),window.addEventListener(`yaak-theme-change`,this.refresh),this.refresh(),this.observer=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&this.warmVisibleChoices()}),this.buttons.forEach(e=>this.observer?.observe(e))}disconnectedCallback(){window.removeEventListener(`yaak-theme-change`,this.refresh),this.observer?.disconnect()}get preview(){return this.closest(`[data-theme-preview]`)?.querySelector(`theme-picture`)}async warmVisibleChoices(){let e=this.preview?.querySelector(`img`);if(e){try{await e.decode()}catch{return}if(this.isConnected)for(let t of this.buttons){let n=t.getBoundingClientRect(),r=n.width>0&&n.height>0&&n.bottom>0&&n.top<innerHeight&&n.right>0&&n.left<innerWidth,i=t.dataset.themeImage;r&&i&&t.getAttribute(`aria-pressed`)!==`true`&&new URL(i,location.href).href!==e.currentSrc&&loadImage(i,t.dataset.themeSrcset,t.dataset.themeSizes).catch(()=>{})}}}};customElements.define(`theme-buttons`,ThemeButtons);var HeroExamples=class extends HTMLElement{constructor(...e){super(...e),this.images={},this.example=`http`,this.theme=null,this.requestedExample=`http`,this.requestedTheme=null,this.generation=0,this.initialized=!1,this.followAppearance=()=>{this.requestedTheme??this.show(this.requestedExample,null)}}connectedCallback(){this.initialized||(this.initialized=!0,this.images=JSON.parse(this.dataset.images??`{}
8`),this.querySelectorAll(`[data-hero-example]`).forEach(e=>{let t=e.dataset.heroExample,n=()=>{let e=this.images[t]?.[this.selectedTheme];e&&loadImage(e.src).catch(()=>{})};e.addEventListener(`pointerenter`,n),e.addEventListener(`focus`,n),e.addEventListener(`click`,()=>{this.show(t,this.requestedTheme)})}),this.themeChoices.forEach(e=>e.addEventListener(`change`,()=>{e.checked&&this.show(this.requestedExample,e.value)}))),window.addEventListener(`yaak-theme-change`,this.followAppearance),this.refresh()}disconnectedCallback(){++this.generation,window.removeEventListener(`yaak-theme-change`,this.followAppearance)}get selectedTheme(){return this.theme??window.yaakTheme?.getTheme()??(matchMedia(`(prefers-color-scheme: dark)`).matches?`yaak-dark`:`yaak-light`)}get themeChoices(){return this.querySelectorAll(`[data-hero-theme]`)}get preview(){return this.closest(`[data-theme-preview]`)?.querySelector(`theme-picture`)}get status(){return this.querySelector(`[data-hero-status]`)}async show(e,t){let n=t??window.yaakTheme?.getTheme()??this.selectedTheme,r=this.images[e]?.[n];if(!r||!this.preview)return;this.requestedExample=e,this.requestedTheme=t;let i=++this.generation;this.setAttribute(`aria-busy`,`true`),this.status&&(this.status.textContent=`Loading screenshot`);let a=await this.preview.select(r.src);if(i!==this.generation||!this.isConnected)return;if(this.removeAttribute(`aria-busy`),!a){this.requestedExample=this.example,this.requestedTheme=this.theme,this.status&&(this.status.textContent=`Could not load screenshot. Please try again.`),this.refresh();return}this.example=e,this.theme=t;let o=this.preview.querySelector(`img`);o&&(o.alt=r.alt),this.refresh(),this.status&&(this.status.textContent=`${r.alt}. ${n===`yaak-dark`?`Yaak Dark`:`Yaak Light`}.`),window.op?.(`track`,`hero.example`,{example:e,theme:n,platform:this.dataset.platform??`macos`})}refresh(){this.querySelectorAll(`[data-hero-example]`).forEach(e=>{let t=e.dataset.heroExample===this.example;e.classList.toggle(`active`,t),e.setAttribute(`aria-pressed`,String(t))}),this.themeChoices.forEach(e=>{e.checked=e.value===this.selectedTheme})}};customElements.define(`hero-examples`,HeroExamples);var Tooltip=class extends HTMLElement{constructor(){super();let e=this.querySelector(`[role=tooltip]`),t=e.parentElement,n=e.parentNode,r=Number(this.dataset.tooltipDelay??500),i=4,a,o=(t=r)=>{clearTimeout(a),a=setTimeout(()=>{if(!this.isConnected)return;let t=getComputedStyle(e);e.style.font=t.font,e.style.color=t.color,e.style.textAlign=t.textAlign,e.style.whiteSpace=t.whiteSpace,document.body.appendChild(e),e.classList.add(`show`),e.inert=!1;let n=this.getBoundingClientRect(),r=e.getBoundingClientRect(),i=n.left+n.width/2-r.width/2,a=window.innerWidth-r.width-4,o=n.top-r.height;if(o<4){let e=n.bottom;o=e+r.height<=window.innerHeight-4?e:4}e.style.left=Math.max(4,Math.min(i,a))+`px`,e.style.top=o+`px`,window.addEventListener(`scroll`,s,!0),window.addEventListener(`resize`,s)},t)},s=()=>{clearTimeout(a),e.classList.remove(`show`),e.inert=!0,e.style.left=``,e.style.top=``,e.style.font=``,e.style.color=``,e.style.textAlign=``,e.style.whiteSpace=``,e.parentNode!==n&&n.appendChild(e),window.removeEventListener(`scroll`,s,!0),window.removeEventListener(`resize`,s)};this.hideTooltip=s;let c=t=>{e.classList.contains(`show`)?s():o(t)};this.addEventListener(`mouseenter`,()=>o()),this.addEventListener(`click`,()=>c(0)),this.addEventListener(`mouseleave`,t=>{(!(t.relatedTarget instanceof Node)||!e.contains(t.relatedTarget))&&s()}),e.addEventListener(`mouseleave`,e=>{(!(e.relatedTarget instanceof Node)||!this.contains(e.relatedTarget))&&s()}),this.addEventListener(`focusin`,()=>o(0));let l=t=>{(!(t.relatedTarget instanceof Node)||!this.contains(t.relatedTarget)&&!e.contains(t.relatedTarget))&&s()};this.addEventListener(`focusout`,l),e.addEventListener(`focusout`,l),this.addEventListener(`keydown`,t=>{if(t.key===`Escape`&&s(),t.key===`Tab`&&!t.shiftKey&&e.classList.contains(`show`)){let n=e.querySelector(`a[href]`);n&&(t.preventDefault(),n.focus())}}),e.addEventListener(`keydown`,n=>{let r=[...e.querySelectorAll(`a[href]`)];n.key===`Escape`?(t.focus(),s()):n.key===`Tab`&&(n.shiftKey&&n.target===r[0]||!n.shiftKey&&n.target===r.at(-1))&&(t.focus(),s(),n.shiftKey&&n.preventDefault())})}disconnectedCallback(){this.hideTooltip?.()}};customElements.define(`simple-tooltip`,Tooltip);var TabbedVideoPlayer=class extends HTMLElement{constructor(...e){super(...e),this.activeTab=``,this.tabs=[],this.isPlaying=!1,this.isSeeking=!1,this.seekTarget=null,this.playProm
8ise=null,this.observer=null}connectedCallback(){if(this.tabs=Array.from(this.querySelectorAll(`.tvp-panel`)).map(e=>e.getAttribute(`data-tab`)),this.tabs.length!==0){this.addEventListener(`mousedown`,e=>{let t=e.target.closest(`.tvp-tab`);if(!t)return;let n=t.getAttribute(`data-tab`);n&&(n===this.activeTab?(e.preventDefault(),this.isSeeking=!0,this.seekTarget=t,this.seekToPosition(t,e.clientX)):this.switchTab(n))}),document.addEventListener(`mousemove`,e=>{!this.isSeeking||!this.seekTarget||this.seekToPosition(this.seekTarget,e.clientX)}),document.addEventListener(`mouseup`,()=>{this.isSeeking&&(this.isSeeking=!1,this.seekTarget=null,this.isPlaying||this.startPlaying())});for(let e of this.tabs){let t=this.getOverlay(e);t&&t.addEventListener(`click`,()=>{if(this.activeTab!==e){this.switchTab(e);return}this.isPlaying?this.stopPlaying():this.startPlaying()})}for(let e of this.tabs){let t=this.getVideo(e);t&&t.addEventListener(`ended`,()=>{this.activeTab===e&&this.advanceTab()})}this.observer=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting?this.isPlaying||this.switchTab(this.activeTab||this.tabs[0]):this.isPlaying&&this.stopPlaying()},{threshold:.5}),this.observer.observe(this),this.showTab(this.tabs[0])}}disconnectedCallback(){this.observer?.disconnect()}getVideo(e){return this.querySelector(`.tvp-panel[data-tab="${e}"] video`)}getTabButton(e){return this.querySelector(`.tvp-tab[data-tab="${e}"]`)}getProgressFills(e){return this.querySelectorAll(`.tvp-tab[data-tab="${e}"] .tvp-progress`)}getOverlay(e){return this.querySelector(`.tvp-panel[data-tab="${e}"] .tvp-overlay`)}seekToPosition(e,t){let n=e.getBoundingClientRect(),r=Math.max(0,Math.min(1,(t-n.left)/n.width)),i=this.getVideo(this.activeTab);i&&isFinite(i.duration)&&(i.currentTime=r*i.duration,this.getProgressFills(this.activeTab).forEach(e=>e.style.width=`${r*100}%`))}advanceTab(){let e=(this.tabs.indexOf(this.activeTab)+1)%this.tabs.length;this.switchTab(this.tabs[e])}switchTab(e){if(this.activeTab&&this.activeTab!==e){this.stopPlaying();let e=this.getVideo(this.activeTab);e&&(e.currentTime=0),this.getProgressFills(this.activeTab).forEach(e=>e.style.width=`0%`)}this.showTab(e),this.startPlaying()}showTab(e){this.activeTab=e,this.querySelectorAll(`.tvp-panel`).forEach(t=>{t.classList.toggle(`active`,t.getAttribute(`data-tab`)===e)}),this.querySelectorAll(`.tvp-tab`).forEach(t=>{t.classList.toggle(`active`,t.getAttribute(`data-tab`)===e)}),this.querySelectorAll(`.tvp-tab[data-tab="${e}"]`).forEach(e=>{if(!e.parentElement)return;let t=e.parentElement,n=e.offsetLeft-t.offsetLeft-t.clientWidth/2+e.clientWidth/2;t.scrollTo({left:n,behavior:`smooth`})})}startPlaying(){if(this.offsetParent===null)return;let e=this.getVideo(this.activeTab);if(!e)return;if(e.readyState<HTMLMediaElement.HAVE_ENOUGH_DATA){e.addEventListener(`canplay`,()=>{this.offsetParent!==null&&this.startPlaying()},{once:!0});return}e.ended&&(e.currentTime=0);let t=parseFloat(e.getAttribute(`data-speed`)??``);t>0&&(e.playbackRate=t),this.isPlaying=!0,this.getOverlay(this.activeTab)?.classList.add(`playing`),this.playPromise=e.play(),this.playPromise.catch(()=>{this.isPlaying=!1,this.getOverlay(this.activeTab)?.classList.remove(`playing`)});let n=()=>{if(!this.isPlaying)return;let e=this.getVideo(this.activeTab);if(!e)return;let t=e.currentTime/e.duration*100;this.getProgressFills(this.activeTab).forEach(e=>e.style.width=`${t}%`),e.ended||requestAnimationFrame(n)};n()}stopPlaying(){this.isPlaying=!1,this.getOverlay(this.activeTab)?.classList.remove(`playing`);let e=this.getVideo(this.activeTab);if(!e)return;let t=this.playPromise;this.playPromise=null,t?t.then(()=>e.pause()).catch(()=>{}):e.pause()}};customElements.define(`tabbed-video-player`,TabbedVideoPlayer);function mapVideoTime(e,t,n){let r=t.marks.flatMap(e=>{let t=n.marks.find(t=>t.label===e.label);return t?[{from:e.seconds,to:t.seconds}]:[]});r.push({from:t.duration,to:n.duration});let i={from:0,to:0};for(let t of r){if(e<=t.from&&t.from>i.from){let n=Math.max(0,(e-i.from)/(t.from-i.from));return i.to+n*(t.to-i.to)}i=t}return n.duration}var VideoPlayer=class extends HTMLElement{constructor(){super(),this.poster=null,this.source=``,this.variants=null,this.currentVariant=null,this.media=matchMedia(`(prefers-color-scheme: dark)`),this.sourceGeneration=0,this.switching=null,this.isPlaying=!1,this.isSeeking=!1,this.hasStarted=!1,this.playProm
8ise=null,this.followAppearance=()=>{let e=this.selectedVariant();if(!e||e.src===this.currentVariant?.src)return;let t=this.currentVariant;if(this.currentVariant=e,this.source=e.src,this.video.width=e.width,this.video.height=e.height,this.poster&&(this.poster.sizes=e.poster.sizes,this.poster.srcset=e.poster.srcset,this.poster.src=e.poster.src),!this.video.hasAttribute(`src`))return;let n=this.switching??{clip:t,seconds:this.video.currentTime,playing:this.isPlaying,rate:this.video.playbackRate};this.switching=n;let r=++this.sourceGeneration;this.stopPlaying(),this.video.src=e.src,this.video.onloadedmetadata=()=>{r===this.sourceGeneration&&(this.video.currentTime=Math.min(mapVideoTime(n.seconds,n.clip,e),Math.max(0,this.video.duration-.05)),this.video.playbackRate=n.rate,this.switching=null,n.playing&&this.startPlaying())},this.video.load()},this.innerHTML=`
9        <video muted playsinline preload="metadata" class="my-0!"></video>
10        <div class="x-overlay group absolute z-50 top-0 left-0 bottom-0 right-0 flex items-center justify-center">
11          <button type="button" class="x-play-control absolute inset-0 flex items-center justify-center cursor-pointer focus-visible:outline-4 focus-visible:outline-offset-[-4px] focus-visible:outline-secondary">
12          <svg aria-hidden="true" viewBox="0 0 640 640" class="fill-secondary h-[26%] opacity-60 group-hover:opacity-90 drop-shadow transition-opacity">
13            <path d="M64 320C64 178.6 178.6 64 320 64C461.4 64 576 178.6 576 320C576 461.4 461.4 576 320 576C178.6 576 64 461.4 64 320zM252.3 211.1C244.7 215.3 240 223.4 240 232L240 408C240 416.7 244.7 424.7 252.3 428.9C259.9 433.1 269.1 433 276.6 428.4L420.6 340.4C427.7 336 432.1 328.3 432.1 319.9C432.1 311.5 427.7 303.8 420.6 299.4L276.6 211.4C269.2 206.9 259.9 206.7 252.3 210.9z"/>
14          </svg>
15          </button>
16          <div role="slider" tabindex="0" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" style="touch-action:none" class="x-progress-bar focus-visible:outline-4 focus-visible:outline-offset-[-4px] focus-visible:outline-secondary absolute bottom-0 left-0 right-0 h-2 group-hover:h-4 focus-visible:h-4 flex items-end motion-reduce:transition-none transition-[height,opacity] duration-150 opacity-60 group-hover:opacity-80">
17            <div class="x-progress-fill h-full w-0 bg-secondary rounded-l-none rounded-r-md transition-opacity duration-150"></div>
18          </div>
19        </div>
20    `,this.className=`block relative w-full rounded-lg shadow overflow-hidden`,this.overlay=this.querySelector(`.x-overlay`),this.video=this.querySelector(`video`),this.variants=JSON.parse(this.getAttribute(`data-variants`)??`null`),this.currentVariant=this.selectedVariant();let e=this.currentVariant,t=e?.src??this.getAttribute(`data-src`)??``;this.source=t;let n=e?.poster.src??this.getAttribute(`data-poster-src`),r=e?.width??Number(this.getAttribute(`data-width`)),i=e?.height??Number(this.getAttribute(`data-height`));if(r>0&&i>0&&(this.video.width=r,this.video.height=i,this.video.style.width=`100%`,this.video.style.height=`auto`),n)this.video.preload=`none`,this.poster=document.createElement(`img`),this.poster.alt=``,this.poster.loading=`lazy`,this.poster.decoding=`async`,this.poster.style.cssText=`position:absolute;inset:0;width:100%;height:100%;object-fit:contain;margin:0;max-height:none`,this.poster.sizes=e?.poster.sizes??this.getAttribute(`data-poster-sizes`)??`100vw`,this.poster.srcset=e?.poster.srcset??this.getAttribute(`data-poster-srcset`)??``,this.poster.src=n,this.video.after(this.poster),this.video.addEventListener(`playing`,()=>{this.poster.hidden=!0});else if(t){let e=parseFloat(this.getAttribute(`data-poster-at`)??``);this.video.setAttribute(`src`,t+`#t=${e>0?e:.1}`)}let a=parseFloat(this.getAttribute(`data-speed`)??``);a>0&&(this.video.playbackRate=a),this.playBtn=this.overlay.querySelector(`svg`),this.progressBar=this.overlay.querySelector(`.x-progress-bar`),this.progressFill=this.overlay.querySelector(`.x-progress-fill`),this.videoName=this.source?.split(`/`).pop()?.replace(/\.mp4#.*/,``)??``;let o=this.getAttribute(`data-label`)||`Video`;
20this.playControl=this.querySelector(`.x-play-control`),this.playControl.setAttribute(`aria-label`,`Play: ${o}`),this.progressBar.setAttribute(`aria-label`,`Seek: ${o}`),this.video.addEventListener(`timeupdate`,()=>this.updateProgress()),this.video.addEventListener(`loadedmetadata`,()=>this.updateProgress()),this.video.addEventListener(`ended`,()=>this.stopPlaying()),this.overlay.addEventListener(`click`,e=>{this.progressBar.contains(e.target)||(this.isPlaying?(this.stopPlaying(),window.op?.(`track`,`video.stop`,{name:this.videoName})):(this.startPlaying(),window.op?.(`track`,`video.play`,{name:this.videoName})))}),this.progressBar.addEventListener(`pointerdown`,e=>{e.preventDefault(),this.progressBar.focus(),this.progressBar.setPointerCapture(e.pointerId),this.isSeeking=!0,this.seekToEvent(e)}),this.progressBar.addEventListener(`pointermove`,e=>{this.isSeeking&&this.seekToEvent(e)}),this.progressBar.addEventListener(`lostpointercapture`,()=>{this.isSeeking=!1}),this.progressBar.addEventListener(`keydown`,e=>{let t=this.video.duration;if(!Number.isFinite(t))return;let n={ArrowLeft:this.video.currentTime-5,ArrowDown:this.video.currentTime-5,ArrowRight:this.video.currentTime+5,ArrowUp:this.video.currentTime+5,Home:0,End:t};e.key in n&&(e.preventDefault(),this.seekTo(n[e.key]))}),this.hasAttribute(`data-autoplay`)&&new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&this.offsetParent!==null&&!matchMedia(`(prefers-reduced-motion: reduce)`).matches?this.isPlaying||this.startPlaying():this.isPlaying&&this.stopPlaying()},{threshold:.5}).observe(this)}connectedCallback(){window.addEventListener(`yaak-theme-change`,this.followAppearance),this.media.addEventListener(`change`,this.followAppearance),this.followAppearance()}disconnectedCallback(){window.removeEventListener(`yaak-theme-change`,this.followAppearance),this.media.removeEventListener(`change`,this.followAppearance),this.stopPlaying()}selectedVariant(){let e=window.yaakTheme?window.yaakTheme.getTheme()===`yaak-dark`:this.media.matches;return this.variants?.[e?`yaak-dark`:`yaak-light`]??null}seekToEvent(e){let t=this.progressBar.getBoundingClientRect(),n=Math.max(0,Math.min(1,(e.clientX-t.left)/t.width));this.seekTo(n*this.video.duration)}seekTo(e){Number.isFinite(this.video.duration)&&(this.hasStarted=!0,this.video.currentTime=Math.max(0,Math.min(this.video.duration,e)),this.poster&&(this.poster.hidden=!0),this.updateProgress())}updateProgress(){let e=this.video.duration,t=e>0?this.video.currentTime/e*100:0;this.progressFill.style.width=`${t}%`,this.progressBar.setAttribute(`aria-valuenow`,String(Math.round(t))),this.progressBar.setAttribute(`aria-valuetext`,`${Math.floor(this.video.currentTime)} of ${Number.isFinite(e)?Math.floor(e):0} seconds`)}updatePlayLabel(){this.playControl.setAttribute(`aria-label`,`${this.isPlaying?`Pause`:`Play`}: ${this.getAttribute(`data-label`)||`Video`}`)}startPlaying(){if(this.offsetParent===null||(this.video.hasAttribute(`src`)||(this.video.preload=`auto`,this.video.src=this.source),this.isPlaying))return;(this.video.ended||!this.hasStarted)&&(this.video.currentTime=0),this.hasStarted=!0,this.isPlaying=!0,this.updatePlayLabel();let e=this.video.play();this.playPromise=e,e.catch(()=>{this.playPromise===e&&(this.isPlaying=!1,this.updatePlayLabel(),this.playBtn.style.opacity=``)}),this.playBtn.style.opacity=`0`;let t=()=>{if(this.playPromise===e){if(!this.isSeeking){let e=this.video.currentTime/this.video.duration*100;this.progressFill.style.width=`${e}%`}this.video.ended?this.stopPlaying():this.isPlaying&&requestAnimationFrame(t)}};t()}stopPlaying(){this.isPlaying=!1,this.updatePlayLabel(),this.playPromise=null,this.video.pause(),this.playBtn.style.opacity=``}};customElements.define(`video-player`,VideoPlayer),document.querySelectorAll(`[data-track]`).forEach(e=>{e.addEventListener(`click`,()=>{let t=e.getAttribute(`data-track`),n=JSON.parse(e.getAttribute(`data-track-attrs`)||`{}`);t!=null&&window.op?.(`track`,t,n)})});try{if(!sessionStorage.getItem(`yaak_first_touch`)){let e=new URLSearchParams(location.search),t=``;try{let e=new URL(document.referrer);e.host!==location.host&&(t=e.href)}catch{}sessionStorage.setItem(`yaak_first_touch`,JSON.stringify({referrer:t,landing:location.pathname,utm_source:e.get(`utm_source`)||e.get(`ref`)||``,utm_medium:e.get(`utm_medium`)||``,utm_campaign:e.get(`utm_campaign`)||e.get(`intent`)||``}))}}catch{}var maxWidths=new WeakMap,ro=new ResizeObserver(e=>{for(let t of e){let e=t.target,n=e.parentElement,r=Math.max(1,Math.round(n?.clientWidth||t.contentBoxSize?.[0]?.inlineSize||t.contentRect.width));r<5&&(r=document.body.clientWidth||window.innerWidth||800);let i=maxWidths.get(e)||0;
20r=Math.max(r,i),maxWidths.set(e,r),e.sizes!==r+`px`&&(e.sizes=r+`px`)}});document.querySelectorAll(`img.ri[srcset]`).forEach(e=>{ro.observe(e)});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.