htmx-rails 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/assets/javascripts/htmx.js +1 -1
- data/lib/htmx/rails/version.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d98bf865fcc48efc5299c7f5b0c9ec545680b3164388662f995499c04e51adc
|
4
|
+
data.tar.gz: 9a3cb85d8308ce65125d7ba5d7b7833ecb966257d95bf47baf6e86d2bd2a3eb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8f8ec9c0746aabccbcd9bbce7add8e23b46b7cb8d81c09d9ddf01085f24d31571e0ad91451d8f4321d37ad4a83043056fe5b350503647732c0e9b4869070cb0
|
7
|
+
data.tar.gz: f8d62b6e30331b470e78edd456e9ab2ba8f448b29e237fe5042c0be500fcb66ebb4164c63b16e40cdf27fd6c29eb824c58631b61f505007562898a9199aa9064
|
@@ -1 +1 @@
|
|
1
|
-
(function(e,t){if(typeof define==="function"&&define.amd){define([],t)}else{e.htmx=t()}})(typeof self!=="undefined"?self:this,function(){return function(){"use strict";var T={onLoad:x,process:Ze,on:P,off:U,trigger:rt,find:w,findAll:S,closest:I,remove:E,addClass:C,removeClass:A,toggleClass:L,takeClass:O,defineExtension:Vt,removeExtension:_t,logAll:b,logger:null,config:{historyEnabled:true,historyCacheSize:10,defaultSwapStyle:"innerHTML",defaultSwapDelay:0,defaultSettleDelay:100,includeIndicatorStyles:true,indicatorClass:"htmx-indicator",requestClass:"htmx-request",settlingClass:"htmx-settling",swappingClass:"htmx-swapping",attributesToSettle:["class","style","width","height"]},parseInterval:f,_:e,createEventSource:function(e){return new EventSource(e,{withCredentials:true})},createWebSocket:function(e){return new WebSocket(e,[])}};var t=["get","post","put","delete","patch"];var n=t.map(function(e){return"[hx-"+e+"], [data-hx-"+e+"]"}).join(", ");function f(e){if(e==null||e==="null"||e==="false"||e===""){return null}else if(e.lastIndexOf("ms")===e.length-2){return parseFloat(e.substr(0,e.length-2))}else if(e.lastIndexOf("s")===e.length-1){return parseFloat(e.substr(0,e.length-1))*1e3}else{return parseFloat(e)}}function s(e,t){return e.getAttribute&&e.getAttribute(t)}function o(e,t){return e.hasAttribute&&(e.hasAttribute(t)||e.hasAttribute("data-"+t))}function R(e,t){return s(e,t)||s(e,"data-"+t)}function l(e){return e.parentElement}function q(){return document}function c(e,t){if(t(e)){return e}else if(l(e)){return c(l(e),t)}else{return null}}function H(e,t){var r=null;c(e,function(e){return r=R(e,t)});return r}function v(e,t){var r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;return r&&r.call(e,t)}function r(e){var t=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i;var r=t.exec(e);if(r){return r[1].toLowerCase()}else{return""}}function i(e,t){var r=new DOMParser;var n=r.parseFromString(e,"text/html");var i=n.body;while(t>0){t--;i=i.firstChild}if(i==null){i=q().createDocumentFragment()}return i}function h(e){var t=r(e);switch(t){case"thead":case"tbody":case"tfoot":case"colgroup":case"caption":return i("<table>"+e+"</table>",1);case"col":return i("<table><colgroup>"+e+"</colgroup></table>",2);case"tr":return i("<table><tbody>"+e+"</tbody></table>",2);case"td":case"th":return i("<table><tbody><tr>"+e+"</tr></tbody></table>",3);case"script":return i("<div>"+e+"</div>",1);default:return i(e,0)}}function a(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function u(e){return a(e,"Function")}function d(e){return a(e,"Object")}function N(e){var t="htmx-internal-data";var r=e[t];if(!r){r=e[t]={}}return r}function g(e){var t=[];if(e){for(var r=0;r<e.length;r++){t.push(e[r])}}return t}function k(e,t){if(e){for(var r=0;r<e.length;r++){t(e[r])}}}function m(e){var t=e.getBoundingClientRect();var r=t.top;var n=t.bottom;return r<window.innerHeight&&n>=0}function M(e){return q().body.contains(e)}function p(e){return e.trim().split(/\s+/)}function D(e,t){for(var r in t){if(t.hasOwnProperty(r)){e[r]=t[r]}}return e}function y(e){try{return JSON.parse(e)}catch(e){tt(e);return null}}function e(e){return eval(e)}function x(t){var e=T.on("htmx:load",function(e){t(e.detail.elt)});return e}function b(){T.logger=function(e,t,r){if(console){console.log(t,e,r)}}}function w(e,t){if(t){return e.querySelector(t)}else{return w(q(),e)}}function S(e,t){if(t){return e.querySelectorAll(t)}else{return S(q(),e)}}function E(e,t){e=X(e);if(t){setTimeout(function(){E(e)},t)}else{e.parentElement.removeChild(e)}}function C(e,t,r){e=X(e);if(r){setTimeout(function(){C(e,t)},r)}else{e.classList.add(t)}}function A(e,t,r){e=X(e);if(r){setTimeout(function(){A(e,t)},r)}else{e.classList.remove(t)}}function L(e,t){e=X(e);e.classList.toggle(t)}function O(e,t){e=X(e);k(e.parentElement.children,function(e){A(e,t)});C(e,t)}function I(e,t){e=X(e);do{if(e==null||v(e,t))return e}while(e=e&&l(e))}function X(e){if(a(e,"String")){return w(e)}else{return e}}function F(e,t,r){if(u(t)){return{target:q().body,event:e,listener:t}}else{return{target:X(e),event:t,listener:r}}}function P(t,r,n){Wt(function(){var e=F(t,r,n);e.target.addEventListener(e.event,e.listener)});var e=u(r);return e?r:n}function U(t,r,n){Wt(function(){var e=F(t,r,n);e.target.removeEventListener(e.event,e.listener)});return u(r)?r:n}function z(e){var t=c(e,function(e){return R(e,"hx-target")!==null});if(t){var r=R(t,"hx-target");if(r==="this"){return t}else if(r.indexOf("closest ")===0){return I(e,r.substr(8))}else if(r.indexOf("find ")===0){return w(e,r.substr(5))}else{return q().querySelector(r)}}else{var n=N(e);if(n.boosted){return q().body}else{return e}}}function V(e){var t=T.config.attributesToSettle;for(var r=0;r<t.length;r++){if(e===t[r]){return true}}return false}function _(t,r){k(t.attributes,function(e){if(!r.hasAttribute(e.name)&&V(e.name)){t.removeAttribute(e.name)}});k(r.attributes,function(e){if(V(e.name)){t.setAttribute(e.name,e.value)}})}function j(e,t){var r=jt(t);for(var n=0;n<r.length;n++){var i=r[n];try{if(i.isInlineSwap(e)){return true}}catch(e){tt(e)}}return e==="outerHTML"}function W(e,t,r){var n="#"+t.id;var i="outerHTML";if(e==="true"){}else if(e.indexOf(":")>0){i=e.substr(0,e.indexOf(":"));n=e.substr(e.indexOf(":")+1,e.length)}else{i=e}var a=q().querySelector(n);if(a){var o;o=q().createDocumentFragment();o.appendChild(t);if(!j(i,a)){o=t}ae(i,a,a,o,r)}else{t.parentNode.removeChild(t);Ke(q().body,"htmx:oobErrorNoTarget",{content:t})}return e}function B(e,r){k(S(e,"[hx-swap-oob], [data-hx-swap-oob]"),function(e){var t=R(e,"hx-swap-oob");if(t!=null){W(t,e,r)}})}function $(n,e,i){k(e.querySelectorAll("[id]"),function(e){if(e.id&&e.id.length>0){var t=n.querySelector(e.tagName+"[id='"+e.id+"']");if(t&&t!==n){var r=e.cloneNode();_(e,t);i.tasks.push(function(){_(e,r)})}}})}function J(e){return function(){Ze(e);We(e);Z(e);rt(e,"htmx:load")}}function Z(e){var t="[autofocus]";var r=v(e,t)?e:e.querySelector(t);if(r!=null){r.focus()}}function G(e,t,r,n){$(e,r,n);while(r.childNodes.length>0){var i=r.firstChild;e.insertBefore(i,t);if(i.nodeType!==Node.TEXT_NODE&&i.nodeType!==Node.COMMENT_NODE){n.tasks.push(J(i))}}}function Y(e){var t=N(e);if(t.webSocket){t.webSocket.close()}if(t.sseEventSource){t.sseEventSource.close()}if(e.children){k(e.children,function(e){Y(e)})}}function K(e,t,r){if(e.tagName==="BODY"){return ne(e,t)}else{var n=e.previousSibling;G(l(e),e,t,r);if(n==null){var i=l(e).firstChild}else{var i=n.nextSibling}N(e).replacedWith=i;while(i&&i!==e){if(i.nodeType===Node.ELEMENT_NODE){r.elts.push(i)}i=i.nextElementSibling}Y(e);l(e).removeChild(e)}}function Q(e,t,r){return G(e,e.firstChild,t,r)}function ee(e,t,r){return G(l(e),e,t,r)}function te(e,t,r){return G(e,null,t,r)}function re(e,t,r){return G(l(e),e.nextSibling,t,r)}function ne(e,t,r){var n=e.firstChild;G(e,n,t,r);if(n){while(n.nextSibling){Y(n.nextSibling);e.removeChild(n.nextSibling)}Y(n);e.removeChild(n)}}function ie(e,t){var r=H(e,"hx-select");if(r){var n=q().createDocumentFragment();k(t.querySelectorAll(r),function(e){n.appendChild(e)});t=n}return t}function ae(e,t,r,n,i){switch(e){case"none":return;case"outerHTML":K(r,n,i);return;case"afterbegin":Q(r,n,i);return;case"beforebegin":ee(r,n,i);return;case"beforeend":te(r,n,i);return;case"afterend":re(r,n,i);return;default:var a=jt(t);for(var o=0;o<a.length;o++){var u=a[o];try{var s=u.handleSwap(e,r,n,i);if(s){if(typeof s.length!=="undefined"){for(var l=0;l<s.length;l++){var f=s[l];if(f.nodeType!==Node.TEXT_NODE&&f.nodeType!==Node.COMMENT_NODE){i.tasks.push(J(f))}}}return}}catch(e){tt(e)}}ne(r,n,i)}}var oe=/<title>([\s\S]+?)<\/title>/im;function ue(e){var t=oe.exec(e);if(t){return t[1]}}function se(e,t,r,n,i){var a=ue(n);if(a){var o=w("title");if(o){o.innerHTML=a}else{window.document.title=a}}var u=h(n);if(u){B(u,i);u=ie(r,u);return ae(e,r,t,u,i)}}function le(e,t,r){var n=e.getResponseHeader(t);if(n.indexOf("{")===0){var i=y(n);for(var a in i){if(i.hasOwnProperty(a)){var o=i[a];if(!d(o)){o={value:o}}rt(r,a,o)}}}else{rt(r,n,[])}}var fe=/\s/;var ce=/[_$a-zA-Z]/;var ve=/[_$a-zA-Z0-9]/;var he=['"',"'","/"];var de=/[^\s]/;function ge(e){var t=[];var r=0;while(r<e.length){if(ce.exec(e.charAt(r))){var n=r;r++;while(ve.exec(e.charAt(r+1))){r++}t.push(e.substr(n,r-n+1))}else if(he.indexOf(e.charAt(r))!==-1){var i=e.charAt(r);var n=r;r++;while(r<e.length&&e.charAt(r)!==i){if(e.charAt(r)==="\\"){r++}r++}t.push(e.substr(n,r-n+1))}else{var a=e.charAt(r);t.push(a)}r++}return t}function me(e,t,r){return ce.exec(e.charAt(0))&&e!=="true"&&e!=="false"&&e!=="this"&&e!==r&&t!=="."}function pe(e,t){if(e[0]==="["){e.shift();var r=1;var n=" return (function("+t+"){ return (";var i=null;while(e.length>0){var a=e[0];if(a==="]"){r--;if(r===0){if(i===null){n=n+"true"}e.shift();n+=")})";try{var o=Function(n)();o.source=n;return o}catch(e){Ke(q().body,"htmx:syntax:error",{error:e,source:n});return null}}}else if(a==="["){r++}if(me(a,i,t)){n+="(("+t+"."+a+") ? ("+t+"."+a+") : (window."+a+"))"}else{n=n+a}i=e.shift()}}}function ye(e,t){var r="";while(e.length>0&&!e[0].match(t)){r+=e.shift()}return r}function xe(e){var t=R(e,"hx-trigger");var r=[];if(t){var n=ge(t);do{ye(n,de);var i=n.length;var a=ye(n,/[,\[\s]/);if(a!==""){if(a==="every"){var o={trigger:"every"};ye(n,de);o.pollInterval=f(ye(n,fe));r.push(o)}else if(a.indexOf("sse:")===0){r.push({trigger:"sse",sseEvent:a.substr(4)})}else{var u={trigger:a};var s=pe(n,"event");if(s){u.eventFilter=s}while(n.length>0&&n[0]!==","){ye(n,de);var l=n.shift();if(l==="changed"){u.changed=true}else if(l==="once"){u.once=true}else if(l==="delay"&&n[0]===":"){n.shift();u.delay=f(ye(n,fe))}else if(l==="throttle"&&n[0]===":"){n.shift();u.throttle=f(ye(n,fe))}else{Ke(e,"htmx:syntax:error",{token:n.shift()})}}r.push(u)}}if(n.length===i){Ke(e,"htmx:syntax:error",{token:n.shift()})}ye(n,de)}while(n[0]===","&&n.shift())}if(r.length>0){return r}else if(v(e,"form")){return[{trigger:"submit"}]}else if(v(e,"input, textarea, select")){return[{trigger:"change"}]}else{return[{trigger:"click"}]}}function be(e){N(e).cancelled=true}function we(e,t,r,n){var i=N(e);i.timeout=setTimeout(function(){if(M(e)&&i.cancelled!==true){Pt(e,t,r);we(e,t,R(e,"hx-"+t),n)}},n)}function Se(e){return location.hostname===e.hostname&&s(e,"href")&&s(e,"href").indexOf("#")!==0}function Ee(t,r,e){if(t.tagName==="A"&&Se(t)||t.tagName==="FORM"){r.boosted=true;var n,i;if(t.tagName==="A"){n="get";i=s(t,"href")}else{var a=s(t,"method");n=a?a.toLowerCase():"get";i=s(t,"action")}e.forEach(function(e){Oe(t,n,i,r,e,true)})}}function Ce(e){return e.tagName==="FORM"||v(e,'input[type="submit"], button')&&I(e,"form")!==null||e.tagName==="A"&&e.href&&e.href.indexOf("#")!==0}function Ae(e,t){return N(e).boosted&&e.tagName==="A"&&t.type==="click"&&t.ctrlKey}function Le(e,t){var r=e.eventFilter;if(r){try{return r(t)!==true}catch(e){Ke(q().body,"htmx:eventFilter:error",{error:e,source:r.source});return true}}return false}function Oe(n,i,a,e,o,u){var t=function(e){if(Le(o,e)){return}if(Ae(n,e)){return}if(u||Ce(n)){e.preventDefault()}var t=N(e);var r=N(n);if(!t.handled){t.handled=true;if(o.once){if(r.triggeredOnce){return}else{r.triggeredOnce=true}}if(o.changed){if(r.lastValue===n.value){return}else{r.lastValue=n.value}}if(r.delayed){clearTimeout(r.delayed)}if(r.throttle){return}if(o.throttle){r.throttle=setTimeout(function(){Pt(n,i,a,e.target,e);r.throttle=null},o.throttle)}else if(o.delay){r.delayed=setTimeout(function(){Pt(n,i,a,e.target,e)},o.delay)}else{Pt(n,i,a,e.target,e)}}};e.trigger=o.trigger;e.eventListener=t;n.addEventListener(o.trigger,t)}var Te=false;var Re=null;function qe(){if(!Re){Re=function(){Te=true};window.addEventListener("scroll",Re);setInterval(function(){if(Te){Te=false;k(q().querySelectorAll("[hx-trigger='revealed'],[data-hx-trigger='revealed']"),function(e){He(e)})}},200)}}function He(e){var t=N(e);if(!t.revealed&&m(e)){t.revealed=true;Pt(e,t.verb,t.path)}}function Ne(e,t,r){var n=p(r);for(var i=0;i<n.length;i++){var a=n[i].split(/:(.+)/);if(a[0]==="connect"){ke(e,a[1])}if(a[0]==="send"){De(e)}}}function ke(u,e){if(e.indexOf("ws:")!==0&&e.indexOf("wss:")!==0){e="wss:"+e}var t=T.createWebSocket(e);t.onerror=function(e){Ke(u,"htmx:wsError",{error:e,socket:t});Me(u)};N(u).webSocket=t;t.addEventListener("message",function(e){if(Me(u)){return}var t=e.data;et(u,function(e){t=e.transformResponse(t,null,u)});var r=qt(u);var n=h(t);var i=g(n.children);for(var a=0;a<i.length;a++){var o=i[a];W(R(o,"hx-swap-oob")||"true",o,r)}ft(r.tasks)})}function Me(e){if(!M(e)){N(e).webSocket.close();return true}}function De(s){var l=c(s,function(e){return N(e).webSocket!=null});if(l){var f=N(l).webSocket;s.addEventListener(xe(s)[0].trigger,function(e){var t=Lt(s,l,null,s);var r=St(s,"post");var n=r.errors;var i=r.values;var a=Dt(s);var o=D(i,a);var u=Ot(o,s);u["HEADERS"]=t;if(n&&n.length>0){rt(s,"htmx:validation:halted",n);return}f.send(JSON.stringify(u));if(Ce(s)){e.preventDefault()}})}else{Ke(s,"htmx:noWebSocketSourceError")}}function Ie(e,t,r){var n=p(r);for(var i=0;i<n.length;i++){var a=n[i].split(/:(.+)/);if(a[0]==="connect"){Xe(e,a[1])}if(a[0]==="swap"){Fe(e,a[1])}}}function Xe(t,e){var r=T.createEventSource(e);r.onerror=function(e){Ke(t,"htmx:sseError",{error:e,source:r});Ue(t)};N(t).sseEventSource=r}function Fe(a,o){var u=c(a,ze);if(u){var s=N(u).sseEventSource;var l=function(e){if(Ue(u)){s.removeEventListener(o,l);return}var t=e.data;et(a,function(e){t=e.transformResponse(t,null,a)});var r=Tt(a);var n=z(a);var i=qt(a);se(r.swapStyle,a,n,t,i);rt(a,"htmx:sseMessage",e)};N(a).sseListener=l;s.addEventListener(o,l)}else{Ke(a,"htmx:noSSESourceError")}}function Pe(e,t,r,n){var i=c(e,ze);if(i){var a=N(i).sseEventSource;var o=function(){if(!Ue(i)){if(M(e)){Pt(e,t,r)}else{a.removeEventListener(n,o)}}};N(e).sseListener=o;a.addEventListener(n,o)}else{Ke(e,"htmx:noSSESourceError")}}function Ue(e){if(!M(e)){N(e).sseEventSource.close();return true}}function ze(e){return N(e).sseEventSource!=null}function Ve(e,t,r,n,i){var a=function(){if(!n.loaded){n.loaded=true;Pt(e,t,r)}};if(i){setTimeout(a,i)}else{a()}}function _e(n,i,e){var a=false;k(t,function(t){if(o(n,"hx-"+t)){var r=R(n,"hx-"+t);a=true;i.path=r;i.verb=t;e.forEach(function(e){if(e.sseEvent){Pe(n,t,r,e.sseEvent)}else if(e.trigger==="revealed"){qe();He(n)}else if(e.trigger==="load"){Ve(n,t,r,i,e.delay)}else if(e.pollInterval){i.polling=true;we(n,t,r,e.pollInterval)}else{Oe(n,t,r,i,e)}})}});return a}function je(e){if(e.type==="text/javascript"||e.type===""){try{Function(e.innerText)()}catch(e){tt(e)}}}function We(e){if(v(e,"script")){je(e)}k(S(e,"script"),function(e){je(e)})}function Be(){return document.querySelector("[hx-boost], [data-hx-boost]")}function $e(e){if(e.querySelectorAll){var t=Be()?", a, form":"";var r=e.querySelectorAll(n+t+", [hx-sse], [data-hx-sse], [hx-ws],"+" [data-hx-ws]");return r}else{return[]}}function Je(e){var t=N(e);if(!t.initialized){t.initialized=true;if(e.value){t.lastValue=e.value}var r=xe(e);var n=_e(e,t,r);if(!n&&H(e,"hx-boost")==="true"){Ee(e,t,r)}var i=R(e,"hx-sse");if(i){Ie(e,t,i)}var a=R(e,"hx-ws");if(a){Ne(e,t,a)}rt(e,"htmx:processedNode")}}function Ze(e){e=X(e);Je(e);k($e(e),function(e){Je(e)})}function Ge(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Ye(e,t){var r;if(window.CustomEvent&&typeof window.CustomEvent==="function"){r=new CustomEvent(e,{bubbles:true,cancelable:true,detail:t})}else{r=q().createEvent("CustomEvent");r.initCustomEvent(e,true,true,t)}return r}function Ke(e,t,r){rt(e,t,D({error:t},r))}function Qe(e){return e==="htmx:processedNode"}function et(e,t){k(jt(e),function(e){try{t(e)}catch(e){tt(e)}})}function tt(e){if(console.error){console.error(e)}else if(console.log){console.log("ERROR: ",e)}}function rt(e,t,r){e=X(e);if(r==null){r={}}r["elt"]=e;var n=Ye(t,r);if(T.logger&&!Qe(t)){T.logger(e,t,r)}if(r.error){tt(r.error);rt(e,"htmx:error",{errorInfo:r})}var i=e.dispatchEvent(n);var a=Ge(t);if(i&&a!==t){var o=Ye(a,n.detail);i=i&&e.dispatchEvent(o)}et(e,function(e){i=i&&e.onEvent(t,n)!==false});return i}var nt=null;function it(){var e=q().querySelector("[hx-history-elt],[data-hx-history-elt]");return e||q().body}function at(e,t,r,n){var i=y(localStorage.getItem("htmx-history-cache"))||[];for(var a=0;a<i.length;a++){if(i[a].url===e){i=i.slice(a,1);break}}i.push({url:e,content:t,title:r,scroll:n});while(i.length>T.config.historyCacheSize){i.shift()}try{localStorage.setItem("htmx-history-cache",JSON.stringify(i))}catch(e){Ke(q().body,"htmx:historyCacheError",{cause:e})}}function ot(e){var t=y(localStorage.getItem("htmx-history-cache"))||[];for(var r=0;r<t.length;r++){if(t[r].url===e){return t[r]}}return null}function ut(e){var t=T.config.requestClass;var r=e.cloneNode(true);k(S(r,"."+t),function(e){A(e,t)});return r.innerHTML}function st(){var e=it();var t=nt||location.pathname+location.search;rt(q().body,"htmx:beforeHistorySave",{path:t,historyElt:e});if(T.config.historyEnabled)history.replaceState({htmx:true},q().title,window.location.href);at(t,ut(e),q().title,window.scrollY)}function lt(e){if(T.config.historyEnabled)history.pushState({htmx:true},"",e);nt=e}function ft(e){k(e,function(e){e.call()})}function ct(n){var e=new XMLHttpRequest;var i={path:n,xhr:e};rt(q().body,"htmx:historyCacheMiss",i);e.open("GET",n,true);e.onload=function(){if(this.status>=200&&this.status<400){rt(q().body,"htmx:historyCacheMissLoad",i);var e=h(this.response);e=e.querySelector("[hx-history-elt],[data-hx-history-elt]")||e;var t=it();var r=qt(t);ne(t,e,r);ft(r.tasks);nt=n}else{Ke(q().body,"htmx:historyCacheMissLoadError",i)}};e.send()}function vt(e){st(nt);e=e||location.pathname+location.search;rt(q().body,"htmx:historyRestore",{path:e});var t=ot(e);if(t){var r=h(t.content);var n=it();var i=qt(n);ne(n,r,i);ft(i.tasks);document.title=t.title;window.scrollTo(0,t.scroll);nt=e}else{ct(e)}}function ht(e){var t=H(e,"hx-push-url");return t&&t!=="false"||e.tagName==="A"&&N(e).boosted}function dt(e){var t=H(e,"hx-push-url");return t==="true"||t==="false"?null:t}function gt(e){pt(e,"add")}function mt(e){pt(e,"remove")}function pt(e,t){var r=H(e,"hx-indicator");if(r){var n=q().querySelectorAll(r)}else{n=[e]}k(n,function(e){e.classList[t].call(e.classList,T.config.requestClass)})}function yt(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(n.isSameNode(t)){return true}}return false}function xt(e){if(e.name===""||e.name==null||e.disabled){return false}if(e.type==="button"||e.type==="submit"||e.tagName==="image"||e.tagName==="reset"||e.tagName==="file"){return false}if(e.type==="checkbox"||e.type==="radio"){return e.checked}return true}function bt(t,r,n,e){if(e==null||yt(t,e)){return}else{t.push(e)}if(xt(e)){var i=s(e,"name");var a=e.value;if(e.multiple){a=g(e.querySelectorAll("option:checked")).map(function(e){return e.value})}if(e.files){a=g(e.files)}if(i!=null&&a!=null){var o=r[i];if(o){if(Array.isArray(o)){if(Array.isArray(a)){r[i]=o.concat(a)}else{o.push(a)}}else{if(Array.isArray(a)){r[i]=[o].concat(a)}else{r[i]=[o,a]}}}else{r[i]=a}}wt(e,n)}if(v(e,"form")){var u=e.elements;k(u,function(e){bt(t,r,n,e)})}}function wt(e,t){if(e.willValidate){rt(e,"htmx:validation:validate");if(!e.checkValidity()){t.push({elt:e,message:e.validationMessage,validity:e.validity});rt(e,"htmx:validation:failed",{message:e.validationMessage,validity:e.validity})}}}function St(e,t){var r=[];var n={};var i=[];if(t!=="get"){bt(r,n,i,I(e,"form"))}bt(r,n,i,e);var a=H(e,"hx-include");if(a){var o=q().querySelectorAll(a);k(o,function(e){bt(r,n,i,e)})}return{errors:i,values:n}}function Et(e,t,r){if(e!==""){e+="&"}e+=encodeURIComponent(t)+"="+encodeURIComponent(r);return e}function Ct(e){var t="";for(var r in e){if(e.hasOwnProperty(r)){var n=e[r];if(Array.isArray(n)){k(n,function(e){t=Et(t,r,e)})}else{t=Et(t,r,n)}}}return t}function At(e){var t=new FormData;for(var r in e){if(e.hasOwnProperty(r)){var n=e[r];if(Array.isArray(n)){k(n,function(e){t.append(r,e)})}else{t.append(r,n)}}}return t}function Lt(e,t,r,n){var i={"HX-Request":"true","HX-Trigger":s(e,"id"),"HX-Trigger-Name":s(e,"name"),"HX-Target":R(t,"id"),"HX-Current-URL":q().location.href};if(r!==undefined){i["HX-Prompt"]=r}if(n){i["HX-Event-Target"]=s(n,"id")}if(q().activeElement){i["HX-Active-Element"]=s(q().activeElement,"id");i["HX-Active-Element-Name"]=s(q().activeElement,"name");if(q().activeElement.value){i["HX-Active-Element-Value"]=s(q().activeElement,"value")}}return i}function Ot(t,e){var r=H(e,"hx-params");if(r){if(r==="none"){return{}}else if(r==="*"){return t}else if(r.indexOf("not ")===0){k(r.substr(4).split(","),function(e){e=e.trim();delete t[e]});return t}else{var n={};k(r.split(","),function(e){e=e.trim();n[e]=t[e]});return n}}else{return t}}function Tt(e){var t=H(e,"hx-swap");var r={swapStyle:T.config.defaultSwapStyle,swapDelay:T.config.defaultSwapDelay,settleDelay:T.config.defaultSettleDelay};if(t){var n=p(t);if(n.length>0){r["swapStyle"]=n[0];for(var i=1;i<n.length;i++){var a=n[i];if(a.indexOf("swap:")===0){r["swapDelay"]=f(a.substr(5))}if(a.indexOf("settle:")===0){r["settleDelay"]=f(a.substr(7))}if(a.indexOf("scroll:")===0){r["scroll"]=a.substr(7)}if(a.indexOf("show:")===0){r["show"]=a.substr(5)}}}}return r}function Rt(t,r,n){var i=null;et(r,function(e){if(i==null){i=e.encodeParameters(t,n,r)}});if(i!=null){return i}else{if(H(r,"hx-encoding")==="multipart/form-data"){return At(n)}else{return Ct(n)}}}function qt(e){return{tasks:[],elts:[e]}}function Ht(e,t,r){if(r.scroll){if(r.scroll==="top"){e.scrollTop=0}if(r.scroll==="bottom"){e.scrollTop=e.scrollHeight}}if(r.show){if(r.show==="top"){e.scrollIntoView(true)}if(r.show==="bottom"){e.scrollIntoView(false)}}}function Nt(e,t,r,n){if(n==null){n={}}if(e==null){return n}var i=R(e,t);if(i){var a=i.trim();if(a.indexOf("{")!==0){a="{"+a+"}"}var o=r(a);for(var u in o){if(o.hasOwnProperty(u)){if(n[u]==null){n[u]=o[u]}}}}return Nt(l(e),t,r,n)}function kt(e,t){return Nt(e,"hx-vars",function(e){return Function("return ("+e+")")()},t)}function Mt(e,t){return Nt(e,"hx-vals",function(e){return y(e)},t)}function Dt(e){return D(kt(e),Mt(e))}function It(t,r,n){if(n!==null){try{t.setRequestHeader(r,n)}catch(e){t.setRequestHeader(r,encodeURIComponent(n));t.setRequestHeader(r+"-URI-AutoEncoded","true")}}}function Xt(t){if(t.responseURL&&typeof URL!=="undefined"){try{var e=new URL(t.responseURL);return e.pathname+e.search}catch(e){Ke(q().body,"htmx:badResponseUrl",{url:t.responseURL})}}}function Ft(e,t){return e.getAllResponseHeaders().match(t)}function Pt(l,e,f,t,r){if(!M(l)){console.log("Body does not contain",l);return}var c=z(l);if(c==null){Ke(l,"htmx:targetError",{target:R(l,"hx-target")});return}var n=N(l);if(n.requestInFlight){n.queuedRequest=function(){Pt(l,e,f,t,r)};return}else{n.requestInFlight=true}var i=function(){n.requestInFlight=false;var e=n.queuedRequest;n.queuedRequest=null;if(e){e()}};var a=H(l,"hx-prompt");if(a){var o=prompt(a);if(o===null||!rt(l,"htmx:prompt",{prompt:o,target:c}))return i()}var u=H(l,"hx-confirm");if(u){if(!confirm(u))return i()}var v=new XMLHttpRequest;var s=Lt(l,c,o,t);var h=St(l,e);var d=h.errors;var g=h.values;var m=Dt(l);var p=D(g,m);var y=Ot(p,l);if(e!=="get"&&H(l,"hx-encoding")==null){s["Content-Type"]="application/x-www-form-urlencoded; charset=UTF-8"}if(f==null||f===""){f=q().location.href}var x={parameters:y,unfilteredParameters:p,headers:s,target:c,verb:e,errors:d,path:f,triggeringEvent:r};if(!rt(l,"htmx:configRequest",x))return i();f=x.path;e=x.verb;s=x.headers;y=x.parameters;d=x.errors;if(d&&d.length>0){rt(l,"htmx:validation:halted",x);return i()}var b=f.split("#");var w=b[0];var S=b[1];if(e==="get"){var E=w;var C=Object.keys(y).length!==0;if(C){if(E.indexOf("?")<0){E+="?"}else{E+="&"}E+=Ct(y);if(S){E+="#"+S}}v.open("GET",E,true)}else{v.open(e.toUpperCase(),f,true)}v.overrideMimeType("text/html");for(var A in s){if(s.hasOwnProperty(A)){var L=s[A];It(v,A,L)}}var O={xhr:v,target:c,requestConfig:x};v.onload=function(){try{if(!rt(l,"htmx:beforeOnLoad",O))return;if(Ft(v,/HX-Trigger:/i)){le(v,"HX-Trigger",l)}if(Ft(v,/HX-Push:/i)){var a=v.getResponseHeader("HX-Push")}if(Ft(v,/HX-Redirect:/i)){window.location.href=v.getResponseHeader("HX-Redirect");return}if(Ft(v,/HX-Refresh:/i)){if("true"===v.getResponseHeader("HX-Refresh")){location.reload();return}}var o=ht(l)||a;if(this.status>=200&&this.status<400){if(this.status===286){be(l)}if(this.status!==204){if(!rt(c,"htmx:beforeSwap",O))return;var u=this.response;et(l,function(e){u=e.transformResponse(u,v,l)});if(o){st()}var s=Tt(l);c.classList.add(T.config.swappingClass);var e=function(){try{var e=document.activeElement;var t={elt:e,start:e?e.selectionStart:null,end:e?e.selectionEnd:null};var r=qt(c);se(s.swapStyle,c,l,u,r);if(t.elt&&!M(t.elt)&&t.elt.id){var n=document.getElementById(t.elt.id);if(n){if(t.start&&n.setSelectionRange){n.setSelectionRange(t.start,t.end)}n.focus()}}c.classList.remove(T.config.swappingClass);k(r.elts,function(e){if(e.classList){e.classList.add(T.config.settlingClass)}rt(e,"htmx:afterSwap",O)});if(S){location.hash=S}if(Ft(v,/HX-Trigger-After-Swap:/i)){le(v,"HX-Trigger-After-Swap",l)}var i=function(){k(r.tasks,function(e){e.call()});k(r.elts,function(e){if(e.classList){e.classList.remove(T.config.settlingClass)}rt(e,"htmx:afterSettle",O)});if(o){var e=a||dt(l)||Xt(v)||E||f;lt(e);rt(q().body,"htmx:pushedIntoHistory",{path:e})}Ht(c,r.elts,s);if(Ft(v,/HX-Trigger-After-Settle:/i)){le(v,"HX-Trigger-After-Settle",l)}};if(s.settleDelay>0){setTimeout(i,s.settleDelay)}else{i()}}catch(e){Ke(l,"htmx:swapError",O);throw e}};if(s.swapDelay>0){setTimeout(e,s.swapDelay)}else{e()}}}else{Ke(l,"htmx:responseError",D({error:"Response Status Error Code "+this.status+" from "+f},O))}}catch(e){Ke(l,"htmx:onLoadError",D({error:e},O));throw e}finally{mt(l);var t=N(l).replacedWith||l;rt(t,"htmx:afterRequest",O);rt(t,"htmx:afterOnLoad",O);i()}};v.onerror=function(){mt(l);Ke(l,"htmx:afterRequest",O);Ke(l,"htmx:sendError",O);i()};v.onabort=function(){mt(l);i()};if(!rt(l,"htmx:beforeRequest",O))return i();gt(l);k(["loadstart","loadend","progress","abort"],function(t){k([v,v.upload],function(e){e.addEventListener(t,function(e){rt(l,"htmx:xhr:"+t,{lengthComputable:e.lengthComputable,loaded:e.loaded,total:e.total})})})});v.send(e==="get"?null:Rt(v,l,y))}var Ut={};function zt(){return{onEvent:function(e,t){return true},transformResponse:function(e,t,r){return e},isInlineSwap:function(e){return false},handleSwap:function(e,t,r,n){return false},encodeParameters:function(e,t,r){return null}}}function Vt(e,t){Ut[e]=D(zt(),t)}function _t(e){delete Ut[e]}function jt(e,r){if(e==null){return r}if(r==null){r=[]}var t=R(e,"hx-ext");if(t){k(t.split(","),function(e){e=e.replace(/ /g,"");var t=Ut[e];if(t&&r.indexOf(t)<0){r.push(t)}})}return jt(l(e),r)}function Wt(e){if(q().readyState!=="loading"){e()}else{q().addEventListener("DOMContentLoaded",e)}}function Bt(){if(T.config.includeIndicatorStyles!==false){q().head.insertAdjacentHTML("beforeend","<style> ."+T.config.indicatorClass+"{opacity:0;transition: opacity 200ms ease-in;} ."+T.config.requestClass+" ."+T.config.indicatorClass+"{opacity:1} ."+T.config.requestClass+"."+T.config.indicatorClass+"{opacity:1} </style>")}}function $t(){var e=q().querySelector('meta[name="htmx-config"]');if(e){return y(e.content)}else{return null}}function Jt(){var e=$t();if(e){T.config=D(T.config,e)}}Wt(function(){Jt();Bt();var e=q().body;Ze(e);rt(e,"htmx:load",{});window.onpopstate=function(e){if(e.state&&e.state.htmx){vt()}}});return T}()});
|
1
|
+
(function(e,t){if(typeof define==="function"&&define.amd){define([],t)}else if(typeof module==="object"&&module.exports){module.exports=t()}else{e.htmx=e.htmx||t()}})(typeof self!=="undefined"?self:this,function(){return function(){"use strict";var z={onLoad:t,process:Tt,on:le,off:ue,trigger:ie,ajax:dr,find:b,findAll:f,closest:d,values:function(e,t){var r=Jt(e,t||"post");return r.values},remove:B,addClass:j,removeClass:n,toggleClass:U,takeClass:V,defineExtension:yr,removeExtension:br,logAll:F,logger:null,config:{historyEnabled:true,historyCacheSize:10,refreshOnHistoryMiss:false,defaultSwapStyle:"innerHTML",defaultSwapDelay:0,defaultSettleDelay:20,includeIndicatorStyles:true,indicatorClass:"htmx-indicator",requestClass:"htmx-request",addedClass:"htmx-added",settlingClass:"htmx-settling",swappingClass:"htmx-swapping",allowEval:true,inlineScriptNonce:"",attributesToSettle:["class","style","width","height"],withCredentials:false,timeout:0,wsReconnectDelay:"full-jitter",wsBinaryType:"blob",disableSelector:"[hx-disable], [data-hx-disable]",useTemplateFragments:false,scrollBehavior:"smooth",defaultFocusScroll:false,getCacheBusterParam:false,globalViewTransitions:false},parseInterval:v,_:e,createEventSource:function(e){return new EventSource(e,{withCredentials:true})},createWebSocket:function(e){var t=new WebSocket(e,[]);t.binaryType=z.config.wsBinaryType;return t},version:"1.9.2"};var C={addTriggerHandler:xt,bodyContains:ee,canAccessLocalStorage:D,filterValues:er,hasAttribute:q,getAttributeValue:G,getClosestMatch:c,getExpressionVars:fr,getHeaders:Qt,getInputValues:Jt,getInternalData:Y,getSwapSpecification:rr,getTriggerSpecs:ze,getTarget:de,makeFragment:l,mergeObjects:te,makeSettleInfo:S,oobSwap:me,selectAndSwap:Me,settleImmediately:Bt,shouldCancel:Ke,triggerEvent:ie,triggerErrorEvent:ne,withExtensions:w};var R=["get","post","put","delete","patch"];var O=R.map(function(e){return"[hx-"+e+"], [data-hx-"+e+"]"}).join(", ");function v(e){if(e==undefined){return undefined}if(e.slice(-2)=="ms"){return parseFloat(e.slice(0,-2))||undefined}if(e.slice(-1)=="s"){return parseFloat(e.slice(0,-1))*1e3||undefined}if(e.slice(-1)=="m"){return parseFloat(e.slice(0,-1))*1e3*60||undefined}return parseFloat(e)||undefined}function $(e,t){return e.getAttribute&&e.getAttribute(t)}function q(e,t){return e.hasAttribute&&(e.hasAttribute(t)||e.hasAttribute("data-"+t))}function G(e,t){return $(e,t)||$(e,"data-"+t)}function u(e){return e.parentElement}function J(){return document}function c(e,t){while(e&&!t(e)){e=u(e)}return e?e:null}function T(e,t,r){var n=G(t,r);var i=G(t,"hx-disinherit");if(e!==t&&i&&(i==="*"||i.split(" ").indexOf(r)>=0)){return"unset"}else{return n}}function Z(t,r){var n=null;c(t,function(e){return n=T(t,e,r)});if(n!=="unset"){return n}}function h(e,t){var r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;return r&&r.call(e,t)}function H(e){var t=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i;var r=t.exec(e);if(r){return r[1].toLowerCase()}else{return""}}function i(e,t){var r=new DOMParser;var n=r.parseFromString(e,"text/html");var i=n.body;while(t>0){t--;i=i.firstChild}if(i==null){i=J().createDocumentFragment()}return i}function L(e){return e.match(/<body/)}function l(e){var t=!L(e);if(z.config.useTemplateFragments&&t){var r=i("<body><template>"+e+"</template></body>",0);return r.querySelector("template").content}else{var n=H(e);switch(n){case"thead":case"tbody":case"tfoot":case"colgroup":case"caption":return i("<table>"+e+"</table>",1);case"col":return i("<table><colgroup>"+e+"</colgroup></table>",2);case"tr":return i("<table><tbody>"+e+"</tbody></table>",2);case"td":case"th":return i("<table><tbody><tr>"+e+"</tr></tbody></table>",3);case"script":return i("<div>"+e+"</div>",1);default:return i(e,0)}}}function K(e){if(e){e()}}function A(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function N(e){return A(e,"Function")}function I(e){return A(e,"Object")}function Y(e){var t="htmx-internal-data";var r=e[t];if(!r){r=e[t]={}}return r}function k(e){var t=[];if(e){for(var r=0;r<e.length;r++){t.push(e[r])}}return t}function Q(e,t){if(e){for(var r=0;r<e.length;r++){t(e[r])}}}function P(e){var t=e.getBoundingClientRect();var r=t.top;var n=t.bottom;return r<window.innerHeight&&n>=0}function ee(e){if(e.getRootNode&&e.getRootNode()instanceof ShadowRoot){return J().body.contains(e.getRootNode().host)}else{return J().body.contains(e)}}function M(e){return e.trim().split(/\s+/)}function te(e,t){for(var r in t){if(t.hasOwnProperty(r)){e[r]=t[r]}}return e}function y(e){try{return JSON.parse(e)}catch(e){x(e);return null}}function D(){var e="htmx:localStorageTest";try{localStorage.setItem(e,e);localStorage.removeItem(e);return true}catch(e){return false}}function X(t){try{var e=new URL(t);if(e){t=e.pathname+e.search}if(!t.match("^/$")){t=t.replace(/\/+$/,"")}return t}catch(e){return t}}function e(e){return sr(J().body,function(){return eval(e)})}function t(t){var e=z.on("htmx:load",function(e){t(e.detail.elt)});return e}function F(){z.logger=function(e,t,r){if(console){console.log(t,e,r)}}}function b(e,t){if(t){return e.querySelector(t)}else{return b(J(),e)}}function f(e,t){if(t){return e.querySelectorAll(t)}else{return f(J(),e)}}function B(e,t){e=s(e);if(t){setTimeout(function(){B(e);e=null},t)}else{e.parentElement.removeChild(e)}}function j(e,t,r){e=s(e);if(r){setTimeout(function(){j(e,t);e=null},r)}else{e.classList&&e.classList.add(t)}}function n(e,t,r){e=s(e);if(r){setTimeout(function(){n(e,t);e=null},r)}else{if(e.classList){e.classList.remove(t);if(e.classList.length===0){e.removeAttribute("class")}}}}function U(e,t){e=s(e);e.classList.toggle(t)}function V(e,t){e=s(e);Q(e.parentElement.children,function(e){n(e,t)});j(e,t)}function d(e,t){e=s(e);if(e.closest){return e.closest(t)}else{do{if(e==null||h(e,t)){return e}}while(e=e&&u(e));return null}}function r(e){var t=e.trim();if(t.startsWith("<")&&t.endsWith("/>")){return t.substring(1,t.length-2)}else{return t}}function _(e,t){if(t.indexOf("closest ")===0){return[d(e,r(t.substr(8)))]}else if(t.indexOf("find ")===0){return[b(e,r(t.substr(5)))]}else if(t.indexOf("next ")===0){return[W(e,r(t.substr(5)))]}else if(t.indexOf("previous ")===0){return[oe(e,r(t.substr(9)))]}else if(t==="document"){return[document]}else if(t==="window"){return[window]}else{return J().querySelectorAll(r(t))}}var W=function(e,t){var r=J().querySelectorAll(t);for(var n=0;n<r.length;n++){var i=r[n];if(i.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_PRECEDING){return i}}};var oe=function(e,t){var r=J().querySelectorAll(t);for(var n=r.length-1;n>=0;n--){var i=r[n];if(i.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_FOLLOWING){return i}}};function re(e,t){if(t){return _(e,t)[0]}else{return _(J().body,e)[0]}}function s(e){if(A(e,"String")){return b(e)}else{return e}}function se(e,t,r){if(N(t)){return{target:J().body,event:e,listener:t}}else{return{target:s(e),event:t,listener:r}}}function le(t,r,n){Sr(function(){var e=se(t,r,n);e.target.addEventListener(e.event,e.listener)});var e=N(r);return e?r:n}function ue(t,r,n){Sr(function(){var e=se(t,r,n);e.target.removeEventListener(e.event,e.listener)});return N(r)?r:n}var fe=J().createElement("output");function ce(e,t){var r=Z(e,t);if(r){if(r==="this"){return[he(e,t)]}else{var n=_(e,r);if(n.length===0){x('The selector "'+r+'" on '+t+" returned no matches!");return[fe]}else{return n}}}}function he(e,t){return c(e,function(e){return G(e,t)!=null})}function de(e){var t=Z(e,"hx-target");if(t){if(t==="this"){return he(e,"hx-target")}else{return re(e,t)}}else{var r=Y(e);if(r.boosted){return J().body}else{return e}}}function ve(e){var t=z.config.attributesToSettle;for(var r=0;r<t.length;r++){if(e===t[r]){return true}}return false}function ge(t,r){Q(t.attributes,function(e){if(!r.hasAttribute(e.name)&&ve(e.name)){t.removeAttribute(e.name)}});Q(r.attributes,function(e){if(ve(e.name)){t.setAttribute(e.name,e.value)}})}function pe(e,t){var r=wr(t);for(var n=0;n<r.length;n++){var i=r[n];try{if(i.isInlineSwap(e)){return true}}catch(e){x(e)}}return e==="outerHTML"}function me(e,i,a){var t="#"+i.id;var o="outerHTML";if(e==="true"){}else if(e.indexOf(":")>0){o=e.substr(0,e.indexOf(":"));t=e.substr(e.indexOf(":")+1,e.length)}else{o=e}var r=J().querySelectorAll(t);if(r){Q(r,function(e){var t;var r=i.cloneNode(true);t=J().createDocumentFragment();t.appendChild(r);if(!pe(o,e)){t=r}var n={shouldSwap:true,target:e,fragment:t};if(!ie(e,"htmx:oobBeforeSwap",n))return;e=n.target;if(n["shouldSwap"]){ke(o,e,e,t,a)}Q(a.elts,function(e){ie(e,"htmx:oobAfterSwap",n)})});i.parentNode.removeChild(i)}else{i.parentNode.removeChild(i);ne(J().body,"htmx:oobErrorNoTarget",{content:i})}return e}function xe(e,t,r){var n=Z(e,"hx-select-oob");if(n){var i=n.split(",");for(let e=0;e<i.length;e++){var a=i[e].split(":",2);var o=a[0].trim();if(o.indexOf("#")===0){o=o.substring(1)}var s=a[1]||"true";var l=t.querySelector("#"+o);if(l){me(s,l,r)}}}Q(f(t,"[hx-swap-oob], [data-hx-swap-oob]"),function(e){var t=G(e,"hx-swap-oob");if(t!=null){me(t,e,r)}})}function ye(e){Q(f(e,"[hx-preserve], [data-hx-preserve]"),function(e){var t=G(e,"id");var r=J().getElementById(t);if(r!=null){e.parentNode.replaceChild(r,e)}})}function be(a,e,o){Q(e.querySelectorAll("[id]"),function(e){if(e.id&&e.id.length>0){var t=e.id.replace("'","\\'");var r=e.tagName.replace(":","\\:");var n=a.querySelector(r+"[id='"+t+"']");if(n&&n!==a){var i=e.cloneNode();ge(e,n);o.tasks.push(function(){ge(e,i)})}}})}function we(e){return function(){n(e,z.config.addedClass);Tt(e);bt(e);Se(e);ie(e,"htmx:load")}}function Se(e){var t="[autofocus]";var r=h(e,t)?e:e.querySelector(t);if(r!=null){r.focus()}}function a(e,t,r,n){be(e,r,n);while(r.childNodes.length>0){var i=r.firstChild;j(i,z.config.addedClass);e.insertBefore(i,t);if(i.nodeType!==Node.TEXT_NODE&&i.nodeType!==Node.COMMENT_NODE){n.tasks.push(we(i))}}}function Ee(e,t){var r=0;while(r<e.length){t=(t<<5)-t+e.charCodeAt(r++)|0}return t}function Ce(e){var t=0;if(e.attributes){for(var r=0;r<e.attributes.length;r++){var n=e.attributes[r];if(n.value){t=Ee(n.name,t);t=Ee(n.value,t)}}}return t}function Re(t){var r=Y(t);if(r.timeout){clearTimeout(r.timeout)}if(r.webSocket){r.webSocket.close()}if(r.sseEventSource){r.sseEventSource.close()}if(r.listenerInfos){Q(r.listenerInfos,function(e){if(e.on){e.on.removeEventListener(e.trigger,e.listener)}})}if(r.onHandlers){for(let e=0;e<r.onHandlers.length;e++){const n=r.onHandlers[e];t.removeEventListener(n.name,n.handler)}}}function o(e){ie(e,"htmx:beforeCleanupElement");Re(e);if(e.children){Q(e.children,function(e){o(e)})}}function Oe(e,t,r){if(e.tagName==="BODY"){return Ne(e,t,r)}else{var n;var i=e.previousSibling;a(u(e),e,t,r);if(i==null){n=u(e).firstChild}else{n=i.nextSibling}Y(e).replacedWith=n;r.elts=[];while(n&&n!==e){if(n.nodeType===Node.ELEMENT_NODE){r.elts.push(n)}n=n.nextElementSibling}o(e);u(e).removeChild(e)}}function qe(e,t,r){return a(e,e.firstChild,t,r)}function Te(e,t,r){return a(u(e),e,t,r)}function He(e,t,r){return a(e,null,t,r)}function Le(e,t,r){return a(u(e),e.nextSibling,t,r)}function Ae(e,t,r){o(e);return u(e).removeChild(e)}function Ne(e,t,r){var n=e.firstChild;a(e,n,t,r);if(n){while(n.nextSibling){o(n.nextSibling);e.removeChild(n.nextSibling)}o(n);e.removeChild(n)}}function Ie(e,t){var r=Z(e,"hx-select");if(r){var n=J().createDocumentFragment();Q(t.querySelectorAll(r),function(e){n.appendChild(e)});t=n}return t}function ke(e,t,r,n,i){switch(e){case"none":return;case"outerHTML":Oe(r,n,i);return;case"afterbegin":qe(r,n,i);return;case"beforebegin":Te(r,n,i);return;case"beforeend":He(r,n,i);return;case"afterend":Le(r,n,i);return;case"delete":Ae(r,n,i);return;default:var a=wr(t);for(var o=0;o<a.length;o++){var s=a[o];try{var l=s.handleSwap(e,r,n,i);if(l){if(typeof l.length!=="undefined"){for(var u=0;u<l.length;u++){var f=l[u];if(f.nodeType!==Node.TEXT_NODE&&f.nodeType!==Node.COMMENT_NODE){i.tasks.push(we(f))}}}return}}catch(e){x(e)}}if(e==="innerHTML"){Ne(r,n,i)}else{ke(z.config.defaultSwapStyle,t,r,n,i)}}}function Pe(e){if(e.indexOf("<title")>-1){var t=e.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");var r=t.match(/<title(\s[^>]*>|>)([\s\S]*?)<\/title>/im);if(r){return r[2]}}}function Me(e,t,r,n,i){i.title=Pe(n);var a=l(n);if(a){xe(r,a,i);a=Ie(r,a);ye(a);return ke(e,r,t,a,i)}}function De(e,t,r){var n=e.getResponseHeader(t);if(n.indexOf("{")===0){var i=y(n);for(var a in i){if(i.hasOwnProperty(a)){var o=i[a];if(!I(o)){o={value:o}}ie(r,a,o)}}}else{ie(r,n,[])}}var Xe=/\s/;var g=/[\s,]/;var Fe=/[_$a-zA-Z]/;var Be=/[_$a-zA-Z0-9]/;var je=['"',"'","/"];var p=/[^\s]/;function Ue(e){var t=[];var r=0;while(r<e.length){if(Fe.exec(e.charAt(r))){var n=r;while(Be.exec(e.charAt(r+1))){r++}t.push(e.substr(n,r-n+1))}else if(je.indexOf(e.charAt(r))!==-1){var i=e.charAt(r);var n=r;r++;while(r<e.length&&e.charAt(r)!==i){if(e.charAt(r)==="\\"){r++}r++}t.push(e.substr(n,r-n+1))}else{var a=e.charAt(r);t.push(a)}r++}return t}function Ve(e,t,r){return Fe.exec(e.charAt(0))&&e!=="true"&&e!=="false"&&e!=="this"&&e!==r&&t!=="."}function _e(e,t,r){if(t[0]==="["){t.shift();var n=1;var i=" return (function("+r+"){ return (";var a=null;while(t.length>0){var o=t[0];if(o==="]"){n--;if(n===0){if(a===null){i=i+"true"}t.shift();i+=")})";try{var s=sr(e,function(){return Function(i)()},function(){return true});s.source=i;return s}catch(e){ne(J().body,"htmx:syntax:error",{error:e,source:i});return null}}}else if(o==="["){n++}if(Ve(o,a,r)){i+="(("+r+"."+o+") ? ("+r+"."+o+") : (window."+o+"))"}else{i=i+o}a=t.shift()}}}function m(e,t){var r="";while(e.length>0&&!e[0].match(t)){r+=e.shift()}return r}var We="input, textarea, select";function ze(e){var t=G(e,"hx-trigger");var r=[];if(t){var n=Ue(t);do{m(n,p);var i=n.length;var a=m(n,/[,\[\s]/);if(a!==""){if(a==="every"){var o={trigger:"every"};m(n,p);o.pollInterval=v(m(n,/[,\[\s]/));m(n,p);var s=_e(e,n,"event");if(s){o.eventFilter=s}r.push(o)}else if(a.indexOf("sse:")===0){r.push({trigger:"sse",sseEvent:a.substr(4)})}else{var l={trigger:a};var s=_e(e,n,"event");if(s){l.eventFilter=s}while(n.length>0&&n[0]!==","){m(n,p);var u=n.shift();if(u==="changed"){l.changed=true}else if(u==="once"){l.once=true}else if(u==="consume"){l.consume=true}else if(u==="delay"&&n[0]===":"){n.shift();l.delay=v(m(n,g))}else if(u==="from"&&n[0]===":"){n.shift();var f=m(n,g);if(f==="closest"||f==="find"||f==="next"||f==="previous"){n.shift();f+=" "+m(n,g)}l.from=f}else if(u==="target"&&n[0]===":"){n.shift();l.target=m(n,g)}else if(u==="throttle"&&n[0]===":"){n.shift();l.throttle=v(m(n,g))}else if(u==="queue"&&n[0]===":"){n.shift();l.queue=m(n,g)}else if((u==="root"||u==="threshold")&&n[0]===":"){n.shift();l[u]=m(n,g)}else{ne(e,"htmx:syntax:error",{token:n.shift()})}}r.push(l)}}if(n.length===i){ne(e,"htmx:syntax:error",{token:n.shift()})}m(n,p)}while(n[0]===","&&n.shift())}if(r.length>0){return r}else if(h(e,"form")){return[{trigger:"submit"}]}else if(h(e,'input[type="button"]')){return[{trigger:"click"}]}else if(h(e,We)){return[{trigger:"change"}]}else{return[{trigger:"click"}]}}function $e(e){Y(e).cancelled=true}function Ge(e,t,r){var n=Y(e);n.timeout=setTimeout(function(){if(ee(e)&&n.cancelled!==true){if(!Qe(r,Lt("hx:poll:trigger",{triggerSpec:r,target:e}))){t(e)}Ge(e,t,r)}},r.pollInterval)}function Je(e){return location.hostname===e.hostname&&$(e,"href")&&$(e,"href").indexOf("#")!==0}function Ze(t,r,e){if(t.tagName==="A"&&Je(t)&&(t.target===""||t.target==="_self")||t.tagName==="FORM"){r.boosted=true;var n,i;if(t.tagName==="A"){n="get";i=t.href}else{var a=$(t,"method");n=a?a.toLowerCase():"get";if(n==="get"){}i=$(t,"action")}e.forEach(function(e){et(t,function(e,t){ae(n,i,e,t)},r,e,true)})}}function Ke(e,t){if(e.type==="submit"||e.type==="click"){if(t.tagName==="FORM"){return true}if(h(t,'input[type="submit"], button')&&d(t,"form")!==null){return true}if(t.tagName==="A"&&t.href&&(t.getAttribute("href")==="#"||t.getAttribute("href").indexOf("#")!==0)){return true}}return false}function Ye(e,t){return Y(e).boosted&&e.tagName==="A"&&t.type==="click"&&(t.ctrlKey||t.metaKey)}function Qe(e,t){var r=e.eventFilter;if(r){try{return r(t)!==true}catch(e){ne(J().body,"htmx:eventFilter:error",{error:e,source:r.source});return true}}return false}function et(i,a,e,o,s){var l=Y(i);var t;if(o.from){t=_(i,o.from)}else{t=[i]}if(o.changed){l.lastValue=i.value}Q(t,function(r){var n=function(e){if(!ee(i)){r.removeEventListener(o.trigger,n);return}if(Ye(i,e)){return}if(s||Ke(e,i)){e.preventDefault()}if(Qe(o,e)){return}var t=Y(e);t.triggerSpec=o;if(t.handledFor==null){t.handledFor=[]}if(t.handledFor.indexOf(i)<0){t.handledFor.push(i);if(o.consume){e.stopPropagation()}if(o.target&&e.target){if(!h(e.target,o.target)){return}}if(o.once){if(l.triggeredOnce){return}else{l.triggeredOnce=true}}if(o.changed){if(l.lastValue===i.value){return}else{l.lastValue=i.value}}if(l.delayed){clearTimeout(l.delayed)}if(l.throttle){return}if(o.throttle){if(!l.throttle){a(i,e);l.throttle=setTimeout(function(){l.throttle=null},o.throttle)}}else if(o.delay){l.delayed=setTimeout(function(){a(i,e)},o.delay)}else{ie(i,"htmx:trigger");a(i,e)}}};if(e.listenerInfos==null){e.listenerInfos=[]}e.listenerInfos.push({trigger:o.trigger,listener:n,on:r});r.addEventListener(o.trigger,n)})}var tt=false;var rt=null;function nt(){if(!rt){rt=function(){tt=true};window.addEventListener("scroll",rt);setInterval(function(){if(tt){tt=false;Q(J().querySelectorAll("[hx-trigger='revealed'],[data-hx-trigger='revealed']"),function(e){it(e)})}},200)}}function it(t){if(!q(t,"data-hx-revealed")&&P(t)){t.setAttribute("data-hx-revealed","true");var e=Y(t);if(e.initHash){ie(t,"revealed")}else{t.addEventListener("htmx:afterProcessNode",function(e){ie(t,"revealed")},{once:true})}}}function at(e,t,r){var n=M(r);for(var i=0;i<n.length;i++){var a=n[i].split(/:(.+)/);if(a[0]==="connect"){ot(e,a[1],0)}if(a[0]==="send"){lt(e)}}}function ot(s,r,n){if(!ee(s)){return}if(r.indexOf("/")==0){var e=location.hostname+(location.port?":"+location.port:"");if(location.protocol=="https:"){r="wss://"+e+r}else if(location.protocol=="http:"){r="ws://"+e+r}}var t=z.createWebSocket(r);t.onerror=function(e){ne(s,"htmx:wsError",{error:e,socket:t});st(s)};t.onclose=function(e){if([1006,1012,1013].indexOf(e.code)>=0){var t=ut(n);setTimeout(function(){ot(s,r,n+1)},t)}};t.onopen=function(e){n=0};Y(s).webSocket=t;t.addEventListener("message",function(e){if(st(s)){return}var t=e.data;w(s,function(e){t=e.transformResponse(t,null,s)});var r=S(s);var n=l(t);var i=k(n.children);for(var a=0;a<i.length;a++){var o=i[a];me(G(o,"hx-swap-oob")||"true",o,r)}Bt(r.tasks)})}function st(e){if(!ee(e)){Y(e).webSocket.close();return true}}function lt(u){var f=c(u,function(e){return Y(e).webSocket!=null});if(f){u.addEventListener(ze(u)[0].trigger,function(e){var t=Y(f).webSocket;var r=Qt(u,f);var n=Jt(u,"post");var i=n.errors;var a=n.values;var o=fr(u);var s=te(a,o);var l=er(s,u);l["HEADERS"]=r;if(i&&i.length>0){ie(u,"htmx:validation:halted",i);return}t.send(JSON.stringify(l));if(Ke(e,u)){e.preventDefault()}})}else{ne(u,"htmx:noWebSocketSourceError")}}function ut(e){var t=z.config.wsReconnectDelay;if(typeof t==="function"){return t(e)}if(t==="full-jitter"){var r=Math.min(e,6);var n=1e3*Math.pow(2,r);return n*Math.random()}x('htmx.config.wsReconnectDelay must either be a function or the string "full-jitter"')}function ft(e,t,r){var n=M(r);for(var i=0;i<n.length;i++){var a=n[i].split(/:(.+)/);if(a[0]==="connect"){ct(e,a[1])}if(a[0]==="swap"){ht(e,a[1])}}}function ct(t,e){var r=z.createEventSource(e);r.onerror=function(e){ne(t,"htmx:sseError",{error:e,source:r});vt(t)};Y(t).sseEventSource=r}function ht(a,o){var s=c(a,gt);if(s){var l=Y(s).sseEventSource;var u=function(e){if(vt(s)){l.removeEventListener(o,u);return}var t=e.data;w(a,function(e){t=e.transformResponse(t,null,a)});var r=rr(a);var n=de(a);var i=S(a);Me(r.swapStyle,a,n,t,i);Bt(i.tasks);ie(a,"htmx:sseMessage",e)};Y(a).sseListener=u;l.addEventListener(o,u)}else{ne(a,"htmx:noSSESourceError")}}function dt(e,t,r){var n=c(e,gt);if(n){var i=Y(n).sseEventSource;var a=function(){if(!vt(n)){if(ee(e)){t(e)}else{i.removeEventListener(r,a)}}};Y(e).sseListener=a;i.addEventListener(r,a)}else{ne(e,"htmx:noSSESourceError")}}function vt(e){if(!ee(e)){Y(e).sseEventSource.close();return true}}function gt(e){return Y(e).sseEventSource!=null}function pt(e,t,r,n){var i=function(){if(!r.loaded){r.loaded=true;t(e)}};if(n){setTimeout(i,n)}else{i()}}function mt(t,i,e){var a=false;Q(R,function(r){if(q(t,"hx-"+r)){var n=G(t,"hx-"+r);a=true;i.path=n;i.verb=r;e.forEach(function(e){xt(t,e,i,function(e,t){ae(r,n,e,t)})})}});return a}function xt(n,e,t,r){if(e.sseEvent){dt(n,r,e.sseEvent)}else if(e.trigger==="revealed"){nt();et(n,r,t,e);it(n)}else if(e.trigger==="intersect"){var i={};if(e.root){i.root=re(n,e.root)}if(e.threshold){i.threshold=parseFloat(e.threshold)}var a=new IntersectionObserver(function(e){for(var t=0;t<e.length;t++){var r=e[t];if(r.isIntersecting){ie(n,"intersect");break}}},i);a.observe(n);et(n,r,t,e)}else if(e.trigger==="load"){if(!Qe(e,Lt("load",{elt:n}))){pt(n,r,t,e.delay)}}else if(e.pollInterval){t.polling=true;Ge(n,r,e)}else{et(n,r,t,e)}}function yt(e){if(e.type==="text/javascript"||e.type==="module"||e.type===""){var t=J().createElement("script");Q(e.attributes,function(e){t.setAttribute(e.name,e.value)});t.textContent=e.textContent;t.async=false;if(z.config.inlineScriptNonce){t.nonce=z.config.inlineScriptNonce}var r=e.parentElement;try{r.insertBefore(t,e)}catch(e){x(e)}finally{if(e.parentElement){e.parentElement.removeChild(e)}}}}function bt(e){if(h(e,"script")){yt(e)}Q(f(e,"script"),function(e){yt(e)})}function wt(){return document.querySelector("[hx-boost], [data-hx-boost]")}function St(e){if(e.querySelectorAll){var t=wt()?", a, form":"";var r=e.querySelectorAll(O+t+", [hx-sse], [data-hx-sse], [hx-ws],"+" [data-hx-ws], [hx-ext], [data-hx-ext], [hx-trigger], [data-hx-trigger], [hx-on], [data-hx-on]");return r}else{return[]}}function Et(n){var e=function(e){var t=d(e.target,"button, input[type='submit']");if(t!==null){var r=Y(n);r.lastButtonClicked=t}};n.addEventListener("click",e);n.addEventListener("focusin",e);n.addEventListener("focusout",function(e){var t=Y(n);t.lastButtonClicked=null})}function Ct(e){var t=Ue(e);var r=0;for(let e=0;e<t.length;e++){const n=t[e];if(n==="{"){r++}else if(n==="}"){r--}}return r}function Rt(t,e,r){var n=Y(t);n.onHandlers=[];var i=new Function("event",r+"; return;");var a=t.addEventListener(e,function(e){return i.call(t,e)});n.onHandlers.push({event:e,listener:a});return{nodeData:n,code:r,func:i,listener:a}}function Ot(e){var t=G(e,"hx-on");if(t){var r={};var n=t.split("\n");var i=null;var a=0;while(n.length>0){var o=n.shift();var s=o.match(/^\s*([a-zA-Z:\-]+:)(.*)/);if(a===0&&s){o.split(":");i=s[1].slice(0,-1);r[i]=s[2]}else{r[i]+=o}a+=Ct(o)}for(var l in r){Rt(e,l,r[l])}}}function qt(t){if(t.closest&&t.closest(z.config.disableSelector)){return}var r=Y(t);if(r.initHash!==Ce(t)){r.initHash=Ce(t);Re(t);Ot(t);ie(t,"htmx:beforeProcessNode");if(t.value){r.lastValue=t.value}var e=ze(t);var n=mt(t,r,e);if(!n){if(Z(t,"hx-boost")==="true"){Ze(t,r,e)}else if(q(t,"hx-trigger")){e.forEach(function(e){xt(t,e,r,function(){})})}}if(t.tagName==="FORM"){Et(t)}var i=G(t,"hx-sse");if(i){ft(t,r,i)}var a=G(t,"hx-ws");if(a){at(t,r,a)}ie(t,"htmx:afterProcessNode")}}function Tt(e){e=s(e);qt(e);Q(St(e),function(e){qt(e)})}function Ht(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Lt(e,t){var r;if(window.CustomEvent&&typeof window.CustomEvent==="function"){r=new CustomEvent(e,{bubbles:true,cancelable:true,detail:t})}else{r=J().createEvent("CustomEvent");r.initCustomEvent(e,true,true,t)}return r}function ne(e,t,r){ie(e,t,te({error:t},r))}function At(e){return e==="htmx:afterProcessNode"}function w(e,t){Q(wr(e),function(e){try{t(e)}catch(e){x(e)}})}function x(e){if(console.error){console.error(e)}else if(console.log){console.log("ERROR: ",e)}}function ie(e,t,r){e=s(e);if(r==null){r={}}r["elt"]=e;var n=Lt(t,r);if(z.logger&&!At(t)){z.logger(e,t,r)}if(r.error){x(r.error);ie(e,"htmx:error",{errorInfo:r})}var i=e.dispatchEvent(n);var a=Ht(t);if(i&&a!==t){var o=Lt(a,n.detail);i=i&&e.dispatchEvent(o)}w(e,function(e){i=i&&e.onEvent(t,n)!==false});return i}var Nt=location.pathname+location.search;function It(){var e=J().querySelector("[hx-history-elt],[data-hx-history-elt]");return e||J().body}function kt(e,t,r,n){if(!D()){return}e=X(e);var i=y(localStorage.getItem("htmx-history-cache"))||[];for(var a=0;a<i.length;a++){if(i[a].url===e){i.splice(a,1);break}}var o={url:e,content:t,title:r,scroll:n};ie(J().body,"htmx:historyItemCreated",{item:o,cache:i});i.push(o);while(i.length>z.config.historyCacheSize){i.shift()}while(i.length>0){try{localStorage.setItem("htmx-history-cache",JSON.stringify(i));break}catch(e){ne(J().body,"htmx:historyCacheError",{cause:e,cache:i});i.shift()}}}function Pt(e){if(!D()){return null}e=X(e);var t=y(localStorage.getItem("htmx-history-cache"))||[];for(var r=0;r<t.length;r++){if(t[r].url===e){return t[r]}}return null}function Mt(e){var t=z.config.requestClass;var r=e.cloneNode(true);Q(f(r,"."+t),function(e){n(e,t)});return r.innerHTML}function Dt(){var e=It();var t=Nt||location.pathname+location.search;var r=J().querySelector('[hx-history="false" i],[data-hx-history="false" i]');if(!r){ie(J().body,"htmx:beforeHistorySave",{path:t,historyElt:e});kt(t,Mt(e),J().title,window.scrollY)}if(z.config.historyEnabled)history.replaceState({htmx:true},J().title,window.location.href)}function Xt(e){if(z.config.getCacheBusterParam){e=e.replace(/org\.htmx\.cache-buster=[^&]*&?/,"");if(e.endsWith("&")||e.endsWith("?")){e=e.slice(0,-1)}}if(z.config.historyEnabled){history.pushState({htmx:true},"",e)}Nt=e}function Ft(e){if(z.config.historyEnabled)history.replaceState({htmx:true},"",e);Nt=e}function Bt(e){Q(e,function(e){e.call()})}function jt(a){var e=new XMLHttpRequest;var o={path:a,xhr:e};ie(J().body,"htmx:historyCacheMiss",o);e.open("GET",a,true);e.setRequestHeader("HX-History-Restore-Request","true");e.onload=function(){if(this.status>=200&&this.status<400){ie(J().body,"htmx:historyCacheMissLoad",o);var e=l(this.response);e=e.querySelector("[hx-history-elt],[data-hx-history-elt]")||e;var t=It();var r=S(t);var n=Pe(this.response);if(n){var i=b("title");if(i){i.innerHTML=n}else{window.document.title=n}}Ne(t,e,r);Bt(r.tasks);Nt=a;ie(J().body,"htmx:historyRestore",{path:a,cacheMiss:true,serverResponse:this.response})}else{ne(J().body,"htmx:historyCacheMissLoadError",o)}};e.send()}function Ut(e){Dt();e=e||location.pathname+location.search;var t=Pt(e);if(t){var r=l(t.content);var n=It();var i=S(n);Ne(n,r,i);Bt(i.tasks);document.title=t.title;window.scrollTo(0,t.scroll);Nt=e;ie(J().body,"htmx:historyRestore",{path:e,item:t})}else{if(z.config.refreshOnHistoryMiss){window.location.reload(true)}else{jt(e)}}}function Vt(e){var t=ce(e,"hx-indicator");if(t==null){t=[e]}Q(t,function(e){var t=Y(e);t.requestCount=(t.requestCount||0)+1;e.classList["add"].call(e.classList,z.config.requestClass)});return t}function _t(e){Q(e,function(e){var t=Y(e);t.requestCount=(t.requestCount||0)-1;if(t.requestCount===0){e.classList["remove"].call(e.classList,z.config.requestClass)}})}function Wt(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(n.isSameNode(t)){return true}}return false}function zt(e){if(e.name===""||e.name==null||e.disabled){return false}if(e.type==="button"||e.type==="submit"||e.tagName==="image"||e.tagName==="reset"||e.tagName==="file"){return false}if(e.type==="checkbox"||e.type==="radio"){return e.checked}return true}function $t(t,r,n,e,i){if(e==null||Wt(t,e)){return}else{t.push(e)}if(zt(e)){var a=$(e,"name");var o=e.value;if(e.multiple){o=k(e.querySelectorAll("option:checked")).map(function(e){return e.value})}if(e.files){o=k(e.files)}if(a!=null&&o!=null){var s=r[a];if(s!==undefined){if(Array.isArray(s)){if(Array.isArray(o)){r[a]=s.concat(o)}else{s.push(o)}}else{if(Array.isArray(o)){r[a]=[s].concat(o)}else{r[a]=[s,o]}}}else{r[a]=o}}if(i){Gt(e,n)}}if(h(e,"form")){var l=e.elements;Q(l,function(e){$t(t,r,n,e,i)})}}function Gt(e,t){if(e.willValidate){ie(e,"htmx:validation:validate");if(!e.checkValidity()){t.push({elt:e,message:e.validationMessage,validity:e.validity});ie(e,"htmx:validation:failed",{message:e.validationMessage,validity:e.validity})}}}function Jt(e,t){var r=[];var n={};var i={};var a=[];var o=Y(e);var s=h(e,"form")&&e.noValidate!==true||G(e,"hx-validate")==="true";if(o.lastButtonClicked){s=s&&o.lastButtonClicked.formNoValidate!==true}if(t!=="get"){$t(r,i,a,d(e,"form"),s)}$t(r,n,a,e,s);if(o.lastButtonClicked){var l=$(o.lastButtonClicked,"name");if(l){n[l]=o.lastButtonClicked.value}}var u=ce(e,"hx-include");Q(u,function(e){$t(r,n,a,e,s);if(!h(e,"form")){Q(e.querySelectorAll(We),function(e){$t(r,n,a,e,s)})}});n=te(n,i);return{errors:a,values:n}}function Zt(e,t,r){if(e!==""){e+="&"}if(String(r)==="[object Object]"){r=JSON.stringify(r)}var n=encodeURIComponent(r);e+=encodeURIComponent(t)+"="+n;return e}function Kt(e){var t="";for(var r in e){if(e.hasOwnProperty(r)){var n=e[r];if(Array.isArray(n)){Q(n,function(e){t=Zt(t,r,e)})}else{t=Zt(t,r,n)}}}return t}function Yt(e){var t=new FormData;for(var r in e){if(e.hasOwnProperty(r)){var n=e[r];if(Array.isArray(n)){Q(n,function(e){t.append(r,e)})}else{t.append(r,n)}}}return t}function Qt(e,t,r){var n={"HX-Request":"true","HX-Trigger":$(e,"id"),"HX-Trigger-Name":$(e,"name"),"HX-Target":G(t,"id"),"HX-Current-URL":J().location.href};or(e,"hx-headers",false,n);if(r!==undefined){n["HX-Prompt"]=r}if(Y(e).boosted){n["HX-Boosted"]="true"}return n}function er(t,e){var r=Z(e,"hx-params");if(r){if(r==="none"){return{}}else if(r==="*"){return t}else if(r.indexOf("not ")===0){Q(r.substr(4).split(","),function(e){e=e.trim();delete t[e]});return t}else{var n={};Q(r.split(","),function(e){e=e.trim();n[e]=t[e]});return n}}else{return t}}function tr(e){return $(e,"href")&&$(e,"href").indexOf("#")>=0}function rr(e,t){var r=t?t:Z(e,"hx-swap");var n={swapStyle:Y(e).boosted?"innerHTML":z.config.defaultSwapStyle,swapDelay:z.config.defaultSwapDelay,settleDelay:z.config.defaultSettleDelay};if(Y(e).boosted&&!tr(e)){n["show"]="top"}if(r){var i=M(r);if(i.length>0){n["swapStyle"]=i[0];for(var a=1;a<i.length;a++){var o=i[a];if(o.indexOf("swap:")===0){n["swapDelay"]=v(o.substr(5))}if(o.indexOf("settle:")===0){n["settleDelay"]=v(o.substr(7))}if(o.indexOf("transition:")===0){n["transition"]=o.substr(11)==="true"}if(o.indexOf("scroll:")===0){var s=o.substr(7);var l=s.split(":");var u=l.pop();var f=l.length>0?l.join(":"):null;n["scroll"]=u;n["scrollTarget"]=f}if(o.indexOf("show:")===0){var c=o.substr(5);var l=c.split(":");var h=l.pop();var f=l.length>0?l.join(":"):null;n["show"]=h;n["showTarget"]=f}if(o.indexOf("focus-scroll:")===0){var d=o.substr("focus-scroll:".length);n["focusScroll"]=d=="true"}}}}return n}function nr(e){return Z(e,"hx-encoding")==="multipart/form-data"||h(e,"form")&&$(e,"enctype")==="multipart/form-data"}function ir(t,r,n){var i=null;w(r,function(e){if(i==null){i=e.encodeParameters(t,n,r)}});if(i!=null){return i}else{if(nr(r)){return Yt(n)}else{return Kt(n)}}}function S(e){return{tasks:[],elts:[e]}}function ar(e,t){var r=e[0];var n=e[e.length-1];if(t.scroll){var i=null;if(t.scrollTarget){i=re(r,t.scrollTarget)}if(t.scroll==="top"&&(r||i)){i=i||r;i.scrollTop=0}if(t.scroll==="bottom"&&(n||i)){i=i||n;i.scrollTop=i.scrollHeight}}if(t.show){var i=null;if(t.showTarget){var a=t.showTarget;if(t.showTarget==="window"){a="body"}i=re(r,a)}if(t.show==="top"&&(r||i)){i=i||r;i.scrollIntoView({block:"start",behavior:z.config.scrollBehavior})}if(t.show==="bottom"&&(n||i)){i=i||n;i.scrollIntoView({block:"end",behavior:z.config.scrollBehavior})}}}function or(e,t,r,n){if(n==null){n={}}if(e==null){return n}var i=G(e,t);if(i){var a=i.trim();var o=r;if(a==="unset"){return null}if(a.indexOf("javascript:")===0){a=a.substr(11);o=true}else if(a.indexOf("js:")===0){a=a.substr(3);o=true}if(a.indexOf("{")!==0){a="{"+a+"}"}var s;if(o){s=sr(e,function(){return Function("return ("+a+")")()},{})}else{s=y(a)}for(var l in s){if(s.hasOwnProperty(l)){if(n[l]==null){n[l]=s[l]}}}}return or(u(e),t,r,n)}function sr(e,t,r){if(z.config.allowEval){return t()}else{ne(e,"htmx:evalDisallowedError");return r}}function lr(e,t){return or(e,"hx-vars",true,t)}function ur(e,t){return or(e,"hx-vals",false,t)}function fr(e){return te(lr(e),ur(e))}function cr(t,r,n){if(n!==null){try{t.setRequestHeader(r,n)}catch(e){t.setRequestHeader(r,encodeURIComponent(n));t.setRequestHeader(r+"-URI-AutoEncoded","true")}}}function hr(t){if(t.responseURL&&typeof URL!=="undefined"){try{var e=new URL(t.responseURL);return e.pathname+e.search}catch(e){ne(J().body,"htmx:badResponseUrl",{url:t.responseURL})}}}function E(e,t){return e.getAllResponseHeaders().match(t)}function dr(e,t,r){e=e.toLowerCase();if(r){if(r instanceof Element||A(r,"String")){return ae(e,t,null,null,{targetOverride:s(r),returnPromise:true})}else{return ae(e,t,s(r.source),r.event,{handler:r.handler,headers:r.headers,values:r.values,targetOverride:s(r.target),swapOverride:r.swap,returnPromise:true})}}else{return ae(e,t,null,null,{returnPromise:true})}}function vr(e){var t=[];while(e){t.push(e);e=e.parentElement}return t}function ae(e,t,n,r,i,M){var a=null;var o=null;i=i!=null?i:{};if(i.returnPromise&&typeof Promise!=="undefined"){var s=new Promise(function(e,t){a=e;o=t})}if(n==null){n=J().body}var D=i.handler||pr;if(!ee(n)){return}var l=i.targetOverride||de(n);if(l==null||l==fe){ne(n,"htmx:targetError",{target:G(n,"hx-target")});return}if(!M){var X=function(){return ae(e,t,n,r,i,true)};var F={target:l,elt:n,path:t,verb:e,triggeringEvent:r,etc:i,issueRequest:X};if(ie(n,"htmx:confirm",F)===false){return}}var u=n;var f=Y(n);var c=Z(n,"hx-sync");var h=null;var d=false;if(c){var v=c.split(":");var g=v[0].trim();if(g==="this"){u=he(n,"hx-sync")}else{u=re(n,g)}c=(v[1]||"drop").trim();f=Y(u);if(c==="drop"&&f.xhr&&f.abortable!==true){return}else if(c==="abort"){if(f.xhr){return}else{d=true}}else if(c==="replace"){ie(u,"htmx:abort")}else if(c.indexOf("queue")===0){var B=c.split(" ");h=(B[1]||"last").trim()}}if(f.xhr){if(f.abortable){ie(u,"htmx:abort")}else{if(h==null){if(r){var p=Y(r);if(p&&p.triggerSpec&&p.triggerSpec.queue){h=p.triggerSpec.queue}}if(h==null){h="last"}}if(f.queuedRequests==null){f.queuedRequests=[]}if(h==="first"&&f.queuedRequests.length===0){f.queuedRequests.push(function(){ae(e,t,n,r,i)})}else if(h==="all"){f.queuedRequests.push(function(){ae(e,t,n,r,i)})}else if(h==="last"){f.queuedRequests=[];f.queuedRequests.push(function(){ae(e,t,n,r,i)})}return}}var m=new XMLHttpRequest;f.xhr=m;f.abortable=d;var x=function(){f.xhr=null;f.abortable=false;if(f.queuedRequests!=null&&f.queuedRequests.length>0){var e=f.queuedRequests.shift();e()}};var y=Z(n,"hx-prompt");if(y){var b=prompt(y);if(b===null||!ie(n,"htmx:prompt",{prompt:b,target:l})){K(a);x();return s}}var w=Z(n,"hx-confirm");if(w){if(!confirm(w)){K(a);x();return s}}var S=Qt(n,l,b);if(i.headers){S=te(S,i.headers)}var E=Jt(n,e);var C=E.errors;var R=E.values;if(i.values){R=te(R,i.values)}var j=fr(n);var O=te(R,j);var q=er(O,n);if(e!=="get"&&!nr(n)){S["Content-Type"]="application/x-www-form-urlencoded"}if(z.config.getCacheBusterParam&&e==="get"){q["org.htmx.cache-buster"]=$(l,"id")||"true"}if(t==null||t===""){t=J().location.href}var T=or(n,"hx-request");var H=Y(n).boosted;var L={boosted:H,parameters:q,unfilteredParameters:O,headers:S,target:l,verb:e,errors:C,withCredentials:i.credentials||T.credentials||z.config.withCredentials,timeout:i.timeout||T.timeout||z.config.timeout,path:t,triggeringEvent:r};if(!ie(n,"htmx:configRequest",L)){K(a);x();return s}t=L.path;e=L.verb;S=L.headers;q=L.parameters;C=L.errors;if(C&&C.length>0){ie(n,"htmx:validation:halted",L);K(a);x();return s}var U=t.split("#");var V=U[0];var A=U[1];var N=null;if(e==="get"){N=V;var _=Object.keys(q).length!==0;if(_){if(N.indexOf("?")<0){N+="?"}else{N+="&"}N+=Kt(q);if(A){N+="#"+A}}m.open("GET",N,true)}else{m.open(e.toUpperCase(),t,true)}m.overrideMimeType("text/html");m.withCredentials=L.withCredentials;m.timeout=L.timeout;if(T.noHeaders){}else{for(var I in S){if(S.hasOwnProperty(I)){var W=S[I];cr(m,I,W)}}}var k={xhr:m,target:l,requestConfig:L,etc:i,boosted:H,pathInfo:{requestPath:t,finalRequestPath:N||t,anchor:A}};m.onload=function(){try{var e=vr(n);k.pathInfo.responsePath=hr(m);D(n,k);_t(P);ie(n,"htmx:afterRequest",k);ie(n,"htmx:afterOnLoad",k);if(!ee(n)){var t=null;while(e.length>0&&t==null){var r=e.shift();if(ee(r)){t=r}}if(t){ie(t,"htmx:afterRequest",k);ie(t,"htmx:afterOnLoad",k)}}K(a);x()}catch(e){ne(n,"htmx:onLoadError",te({error:e},k));throw e}};m.onerror=function(){_t(P);ne(n,"htmx:afterRequest",k);ne(n,"htmx:sendError",k);K(o);x()};m.onabort=function(){_t(P);ne(n,"htmx:afterRequest",k);ne(n,"htmx:sendAbort",k);K(o);x()};m.ontimeout=function(){_t(P);ne(n,"htmx:afterRequest",k);ne(n,"htmx:timeout",k);K(o);x()};if(!ie(n,"htmx:beforeRequest",k)){K(a);x();return s}var P=Vt(n);Q(["loadstart","loadend","progress","abort"],function(t){Q([m,m.upload],function(e){e.addEventListener(t,function(e){ie(n,"htmx:xhr:"+t,{lengthComputable:e.lengthComputable,loaded:e.loaded,total:e.total})})})});ie(n,"htmx:beforeSend",k);m.send(e==="get"?null:ir(m,n,q));return s}function gr(e,t){var r=t.xhr;var n=null;var i=null;if(E(r,/HX-Push:/i)){n=r.getResponseHeader("HX-Push");i="push"}else if(E(r,/HX-Push-Url:/i)){n=r.getResponseHeader("HX-Push-Url");i="push"}else if(E(r,/HX-Replace-Url:/i)){n=r.getResponseHeader("HX-Replace-Url");i="replace"}if(n){if(n==="false"){return{}}else{return{type:i,path:n}}}var a=t.pathInfo.finalRequestPath;var o=t.pathInfo.responsePath;var s=Z(e,"hx-push-url");var l=Z(e,"hx-replace-url");var u=Y(e).boosted;var f=null;var c=null;if(s){f="push";c=s}else if(l){f="replace";c=l}else if(u){f="push";c=o||a}if(c){if(c==="false"){return{}}if(c==="true"){c=o||a}if(t.pathInfo.anchor&&c.indexOf("#")===-1){c=c+"#"+t.pathInfo.anchor}return{type:f,path:c}}else{return{}}}function pr(s,l){var u=l.xhr;var f=l.target;var e=l.etc;if(!ie(s,"htmx:beforeOnLoad",l))return;if(E(u,/HX-Trigger:/i)){De(u,"HX-Trigger",s)}if(E(u,/HX-Location:/i)){Dt();var t=u.getResponseHeader("HX-Location");var c;if(t.indexOf("{")===0){c=y(t);t=c["path"];delete c["path"]}dr("GET",t,c).then(function(){Xt(t)});return}if(E(u,/HX-Redirect:/i)){location.href=u.getResponseHeader("HX-Redirect");return}if(E(u,/HX-Refresh:/i)){if("true"===u.getResponseHeader("HX-Refresh")){location.reload();return}}if(E(u,/HX-Retarget:/i)){l.target=J().querySelector(u.getResponseHeader("HX-Retarget"))}var h=gr(s,l);var r=u.status>=200&&u.status<400&&u.status!==204;var d=u.response;var n=u.status>=400;var i=te({shouldSwap:r,serverResponse:d,isError:n},l);if(!ie(f,"htmx:beforeSwap",i))return;f=i.target;d=i.serverResponse;n=i.isError;l.target=f;l.failed=n;l.successful=!n;if(i.shouldSwap){if(u.status===286){$e(s)}w(s,function(e){d=e.transformResponse(d,u,s)});if(h.type){Dt()}var a=e.swapOverride;if(E(u,/HX-Reswap:/i)){a=u.getResponseHeader("HX-Reswap")}var c=rr(s,a);f.classList.add(z.config.swappingClass);var v=null;var g=null;var o=function(){try{var e=document.activeElement;var t={};try{t={elt:e,start:e?e.selectionStart:null,end:e?e.selectionEnd:null}}catch(e){}var n=S(f);Me(c.swapStyle,f,s,d,n);if(t.elt&&!ee(t.elt)&&t.elt.id){var r=document.getElementById(t.elt.id);var i={preventScroll:c.focusScroll!==undefined?!c.focusScroll:!z.config.defaultFocusScroll};if(r){if(t.start&&r.setSelectionRange){try{r.setSelectionRange(t.start,t.end)}catch(e){}}r.focus(i)}}f.classList.remove(z.config.swappingClass);Q(n.elts,function(e){if(e.classList){e.classList.add(z.config.settlingClass)}ie(e,"htmx:afterSwap",l)});if(E(u,/HX-Trigger-After-Swap:/i)){var a=s;if(!ee(s)){a=J().body}De(u,"HX-Trigger-After-Swap",a)}var o=function(){Q(n.tasks,function(e){e.call()});Q(n.elts,function(e){if(e.classList){e.classList.remove(z.config.settlingClass)}ie(e,"htmx:afterSettle",l)});if(h.type){if(h.type==="push"){Xt(h.path);ie(J().body,"htmx:pushedIntoHistory",{path:h.path})}else{Ft(h.path);ie(J().body,"htmx:replacedInHistory",{path:h.path})}}if(l.pathInfo.anchor){var e=b("#"+l.pathInfo.anchor);if(e){e.scrollIntoView({block:"start",behavior:"auto"})}}if(n.title){var t=b("title");if(t){t.innerHTML=n.title}else{window.document.title=n.title}}ar(n.elts,c);if(E(u,/HX-Trigger-After-Settle:/i)){var r=s;if(!ee(s)){r=J().body}De(u,"HX-Trigger-After-Settle",r)}K(v)};if(c.settleDelay>0){setTimeout(o,c.settleDelay)}else{o()}}catch(e){ne(s,"htmx:swapError",l);K(g);throw e}};var p=z.config.globalViewTransitions;if(c.hasOwnProperty("transition")){p=c.transition}if(p&&ie(s,"htmx:beforeTransition",l)&&typeof Promise!=="undefined"&&document.startViewTransition){var m=new Promise(function(e,t){v=e;g=t});var x=o;o=function(){document.startViewTransition(function(){x();return m})}}if(c.swapDelay>0){setTimeout(o,c.swapDelay)}else{o()}}if(n){ne(s,"htmx:responseError",te({error:"Response Status Error Code "+u.status+" from "+l.pathInfo.requestPath},l))}}var mr={};function xr(){return{init:function(e){return null},onEvent:function(e,t){return true},transformResponse:function(e,t,r){return e},isInlineSwap:function(e){return false},handleSwap:function(e,t,r,n){return false},encodeParameters:function(e,t,r){return null}}}function yr(e,t){if(t.init){t.init(C)}mr[e]=te(xr(),t)}function br(e){delete mr[e]}function wr(e,r,n){if(e==undefined){return r}if(r==undefined){r=[]}if(n==undefined){n=[]}var t=G(e,"hx-ext");if(t){Q(t.split(","),function(e){e=e.replace(/ /g,"");if(e.slice(0,7)=="ignore:"){n.push(e.slice(7));return}if(n.indexOf(e)<0){var t=mr[e];if(t&&r.indexOf(t)<0){r.push(t)}}})}return wr(u(e),r,n)}function Sr(e){if(J().readyState!=="loading"){e()}else{J().addEventListener("DOMContentLoaded",e)}}function Er(){if(z.config.includeIndicatorStyles!==false){J().head.insertAdjacentHTML("beforeend","<style> ."+z.config.indicatorClass+"{opacity:0;transition: opacity 200ms ease-in;} ."+z.config.requestClass+" ."+z.config.indicatorClass+"{opacity:1} ."+z.config.requestClass+"."+z.config.indicatorClass+"{opacity:1} </style>")}}function Cr(){var e=J().querySelector('meta[name="htmx-config"]');if(e){return y(e.content)}else{return null}}function Rr(){var e=Cr();if(e){z.config=te(z.config,e)}}Sr(function(){Rr();Er();var e=J().body;Tt(e);var t=J().querySelectorAll("[hx-trigger='restored'],[data-hx-trigger='restored']");e.addEventListener("htmx:abort",function(e){var t=e.target;var r=Y(t);if(r&&r.xhr){r.xhr.abort()}});var r=window.onpopstate;window.onpopstate=function(e){if(e.state&&e.state.htmx){Ut();Q(t,function(e){ie(e,"htmx:restored",{document:J(),triggerEvent:ie})})}else{if(r){r(e)}}};setTimeout(function(){ie(e,"htmx:load",{});e=null},0)});return z}()});
|
data/lib/htmx/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: htmx-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julian Pasquale
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: generator_spec
|
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
131
|
requirements: []
|
132
|
-
rubygems_version: 3.
|
132
|
+
rubygems_version: 3.4.10
|
133
133
|
signing_key:
|
134
134
|
specification_version: 4
|
135
135
|
summary: Ruby gem for use HTMX in Rails applications
|