/**! @license FlowPlater v1.1.0 | (c) 2023 FlowPlater | https://flowplater.com Created by J.WSLS | https://jwsls.io Libraries used: - Handlebars.js v4.7.8+ | Copyright (C) 2011-2019 by Yehuda Katz | https://handlebarsjs.com - htmx v1.9.9+ | (c) 2020 by Big Sky Software LLC | https://htmx.org This software and associated documentation (collectively, the "Software") are proprietary to FlowPlater. Use of the Software is governed by the terms of this license agreement ("Agreement"). By installing, copying, or otherwise using the Software, you agree to be bound by the terms of this Agreement. 1. Grant of License: Subject to the terms of this Agreement, FlowPlater grants you a non-exclusive, non-transferable license to use the Software for personal or commercial purposes. You may not redistribute, sublicense, or resell the Software without prior written consent from FlowPlater. 2. Restrictions: You may not modify, reverse engineer, decompile, or disassemble the Software, except to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation. 3. Open Source Libraries: The Software includes open-source libraries Handlebars.js v4.7.8+ (MIT License) and htmx v1.9.9+ (BSD License), which are used under the terms of their respective licenses. These libraries are sublicensed to you under the terms of their original licenses, and not under the terms of this Agreement. 4. No Warranty: The Software is provided "as is" without any warranty of any kind, either expressed or implied, including but not limited to any implied warranties of merchantability, fitness for a particular purpose, or non-infringement. 5. Limitation of Liability: In no event shall FlowPlater or its licensors be liable for any damages (including, without limitation, lost profits, business interruption, or lost information) arising out of the use of or inability to use the Software, even if FlowPlater has been advised of the possibility of such damages. 6. Termination: This Agreement shall terminate automatically if you fail to comply with its terms and conditions. Upon termination, you must destroy all copies of the Software. 7. General: This Agreement constitutes the entire agreement between you and FlowPlater concerning the Software and supersedes any prior or contemporaneous communications. BY USING THE SOFTWARE, YOU ACKNOWLEDGE THAT YOU HAVE READ THIS AGREEMENT, UNDERSTAND IT, AND AGREE TO BE BOUND BY ITS TERMS AND CONDITIONS. // Handlebars and htmx are included below. Flowplater is located at the bottom of the file. */ /**! @license handlebars v4.7.8 Copyright (C) 2011-2019 by Yehuda Katz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ (function e(t,r){if(typeof exports==="object"&&typeof module==="object")module.exports=r();else if(typeof define==="function"&&define.amd)define([],r);else if(typeof exports==="object")exports["Handlebars"]=r();else t["Handlebars"]=r()})(this,function(){return function(r){var n={};function i(e){if(n[e])return n[e].exports;var t=n[e]={exports:{},id:e,loaded:false};r[e].call(t.exports,t,t.exports,i);t.loaded=true;return t.exports}i.m=r;i.c=n;i.p="";return i(0)}([function(e,t,r){"use strict";var n=r(1)["default"];t.__esModule=true;var i=r(2);var a=n(i);var s=r(84);var o=n(s);var l=r(85);var u=r(90);var c=r(91);var f=n(c);var h=r(88);var p=n(h);var d=r(83);var g=n(d);var m=a["default"].create;function v(){var r=m();r.compile=function(e,t){return u.compile(e,t,r)};r.precompile=function(e,t){return u.precompile(e,t,r)};r.AST=o["default"];r.Compiler=u.Compiler;r.JavaScriptCompiler=f["default"];r.Parser=l.parser;r.parse=l.parse;r.parseWithoutProcessing=l.parseWithoutProcessing;return r}var y=v();y.create=v;g["default"](y);y.Visitor=p["default"];y["default"]=y;t["default"]=y;e.exports=t["default"]},function(e,t){"use strict";t["default"]=function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=true},function(e,t,r){"use strict";var n=r(3)["default"];var i=r(1)["default"];t.__esModule=true;var a=r(4);var s=n(a);var o=r(77);var l=i(o);var u=r(6);var c=i(u);var f=r(5);var h=n(f);var p=r(78);var d=n(p);var g=r(83);var m=i(g);function v(){var t=new s.HandlebarsEnvironment;h.extend(t,s);t.SafeString=l["default"];t.Exception=c["default"];t.Utils=h;t.escapeExpression=h.escapeExpression;t.VM=d;t.template=function(e){return d.template(e,t)};return t}var y=v();y.create=v;m["default"](y);y["default"]=y;t["default"]=y;e.exports=t["default"]},function(e,t){"use strict";t["default"]=function(e){if(e&&e.__esModule){return e}else{var t={};if(e!=null){for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]}}t["default"]=e;return t}};t.__esModule=true},function(e,t,r){"use strict";var n=r(1)["default"];t.__esModule=true;t.HandlebarsEnvironment=v;var i=r(5);var a=r(6);var s=n(a);var o=r(10);var l=r(70);var u=r(72);var c=n(u);var f=r(73);var h="4.7.8";t.VERSION=h;var p=8;t.COMPILER_REVISION=p;var d=7;t.LAST_COMPATIBLE_COMPILER_REVISION=d;var g={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};t.REVISION_CHANGES=g;var m="[object Object]";function v(e,t,r){this.helpers=e||{};this.partials=t||{};this.decorators=r||{};o.registerDefaultHelpers(this);l.registerDefaultDecorators(this)}v.prototype={constructor:v,logger:c["default"],log:c["default"].log,registerHelper:function e(t,r){if(i.toString.call(t)===m){if(r){throw new s["default"]("Arg not supported with multiple helpers")}i.extend(this.helpers,t)}else{this.helpers[t]=r}},unregisterHelper:function e(t){delete this.helpers[t]},registerPartial:function e(t,r){if(i.toString.call(t)===m){i.extend(this.partials,t)}else{if(typeof r==="undefined"){throw new s["default"]('Attempting to register a partial called "'+t+'" as undefined')}this.partials[t]=r}},unregisterPartial:function e(t){delete this.partials[t]},registerDecorator:function e(t,r){if(i.toString.call(t)===m){if(r){throw new s["default"]("Arg not supported with multiple decorators")}i.extend(this.decorators,t)}else{this.decorators[t]=r}},unregisterDecorator:function e(t){delete this.decorators[t]},resetLoggedPropertyAccesses:function e(){f.resetLoggedProperties()}};var y=c["default"].log;t.log=y;t.createFrame=i.createFrame;t.logger=c["default"]},function(e,t){"use strict";t.__esModule=true;t.extend=s;t.indexOf=c;t.escapeExpression=f;t.isEmpty=h;t.createFrame=p;t.blockParams=d;t.appendContextPath=g;var r={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="};var n=/[&<>"'`=]/g,i=/[&<>"'`=]/;function a(e){return r[e]}function s(e){for(var t=1;t0){if(t.ids){t.ids=[t.name]}return a.helpers.each(e,t)}else{return r(this)}}else{if(t.data&&t.ids){var i=s.createFrame(t.data);i.contextPath=s.appendContextPath(t.data.contextPath,t.name);t={data:i}}return n(e,t)}})};e.exports=t["default"]},function(e,t,r){"use strict";var p=r(13)["default"];var d=r(43)["default"];var g=r(55)["default"];var m=r(60)["default"];var n=r(1)["default"];t.__esModule=true;var v=r(5);var i=r(6);var y=n(i);t["default"]=function(e){e.registerHelper("each",function(n,e){if(!e){throw new y["default"]("Must pass iterator to #each")}var i=e.fn,t=e.inverse,r=0,a="",s=undefined,o=undefined;if(e.data&&e.ids){o=v.appendContextPath(e.data.contextPath,e.ids[0])+"."}if(v.isFunction(n)){n=n.call(this)}if(e.data){s=v.createFrame(e.data)}function l(e,t,r){if(s){s.key=e;s.index=t;s.first=t===0;s.last=!!r;if(o){s.contextPath=o+e}}a=a+i(n[e],{data:s,blockParams:v.blockParams([n[e],e],[o+e,null])})}if(n&&typeof n==="object"){if(v.isArray(n)){for(var u=n.length;ri)O(t,s=n[i++],r[s]);return t};var H=function e(t,r){return r===undefined?m(t):T(m(t),r)};var L=function e(t){var r=j.call(this,t);return r||!s(this,t)||!s(w,t)||s(this,x)&&this[x][t]?r:true};var R=function e(t,r){var n=d(t=h(t),r);if(n&&s(w,r)&&!(s(t,x)&&t[x][r]))n.enumerable=true;return n};var N=function e(t){var r=v(h(t)),n=[],i=0,a;while(r.length>i)if(!s(w,a=r[i++])&&a!=x)n.push(a);return n};var U=function e(t){var r=v(h(t)),n=[],i=0,a;while(r.length>i)if(s(w,a=r[i++]))n.push(w[a]);return n};var W=function e(t){if(t===undefined||I(t))return;var r=[t],n=1,i=arguments,a,s;while(i.length>n)r.push(i[n++]);a=r[1];if(typeof a=="function")s=a;if(s||!V(a))a=function(e,t){if(s)t=s.call(this,e,t);if(!I(t))return t};r[1]=a;return E.apply(b,r)};var X=o(function(){var e=y();return E([e])!="[null]"||E({a:e})!="{}"||E(Object(e))!="{}"});if(!C){y=function e(){if(I(this))throw TypeError("Symbol is not a constructor");return _(B(arguments.length>0?arguments[0]:undefined))};a(y.prototype,"toString",function e(){return this._k});I=function(e){return e instanceof y};t.create=H;t.isEnum=L;t.getDesc=R;t.setDesc=O;t.setDescs=T;t.getNames=f.get=N;t.getSymbols=U;if(n&&!e(41)){a(A,"propertyIsEnumerable",L,true)}}var z={for:function(e){return s(k,e+="")?k[e]:k[e]=y(e)},keyFor:function e(t){return F(k,t)},useSetter:function(){S=true},useSimple:function(){S=false}};t.each.call(("hasInstance,isConcatSpreadable,iterator,match,replace,search,"+"species,split,toPrimitive,toStringTag,unscopables").split(","),function(e){var t=c(e);z[e]=C?t:_(t)});S=true;i(i.G+i.W,{Symbol:y});i(i.S,"Symbol",z);i(i.S+i.F*!C,"Object",{create:H,defineProperty:O,defineProperties:T,getOwnPropertyDescriptor:R,getOwnPropertyNames:N,getOwnPropertySymbols:U});b&&i(i.S+i.F*(!C||X),"JSON",{stringify:W});u(y,"Symbol");u(Math,"Math",true);u(r.JSON,"JSON",true)},function(e,t){var r=e.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();if(typeof __g=="number")__g=r},function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,r){e.exports=!r(19)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return true}}},function(e,t,r){var d=r(16),g=r(21),m=r(22),v="prototype";var y=function(e,t,r){var n=e&y.F,i=e&y.G,a=e&y.S,s=e&y.P,o=e&y.B,l=e&y.W,u=i?g:g[t]||(g[t]={}),c=i?d:a?d[t]:(d[t]||{})[v],f,h,p;if(i)r=t;for(f in r){h=!n&&c&&f in c;if(h&&f in u)continue;p=h?c[f]:r[f];u[f]=i&&typeof c[f]!="function"?r[f]:o&&h?m(p,d):l&&c[f]==p?function(t){var e=function(e){return this instanceof t?new t(e):t(e)};e[v]=t[v];return e}(p):s&&typeof p=="function"?m(Function.call,p):p;if(s)(u[v]||(u[v]={}))[f]=p}};y.F=1;y.G=2;y.S=4;y.P=8;y.B=16;y.W=32;e.exports=y},function(e,t){var r=e.exports={version:"1.2.6"};if(typeof __e=="number")__e=r},function(e,t,r){var a=r(23);e.exports=function(n,i,e){a(n);if(i===undefined)return n;switch(e){case 1:return function(e){return n.call(i,e)};case 2:return function(e,t){return n.call(i,e,t)};case 3:return function(e,t,r){return n.call(i,e,t,r)}}return function(){return n.apply(i,arguments)}}},function(e,t){e.exports=function(e){if(typeof e!="function")throw TypeError(e+" is not a function!");return e}},function(e,t,r){e.exports=r(25)},function(e,t,r){var n=r(9),i=r(26);e.exports=r(18)?function(e,t,r){return n.setDesc(e,t,i(1,r))}:function(e,t,r){e[t]=r;return e}},function(e,t){e.exports=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}}},function(e,t,r){var n=r(16),i="__core-js_shared__",a=n[i]||(n[i]={});e.exports=function(e){return a[e]||(a[e]={})}},function(e,t,r){var n=r(9).setDesc,i=r(17),a=r(29)("toStringTag");e.exports=function(e,t,r){if(e&&!i(e=r?e:e.prototype,a))n(e,a,{configurable:true,value:t})}},function(e,t,r){var n=r(27)("wks"),i=r(30),a=r(16).Symbol;e.exports=function(e){return n[e]||(n[e]=a&&a[e]||(a||i)("Symbol."+e))}},function(e,t){var r=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(e===undefined?"":e,")_",(++r+n).toString(36))}},function(e,t,r){var o=r(9),l=r(32);e.exports=function(e,t){var r=l(e),n=o.getKeys(r),i=n.length,a=0,s;while(i>a)if(r[s=n[a++]]===t)return s}},function(e,t,r){var n=r(33),i=r(35);e.exports=function(e){return n(i(e))}},function(e,t,r){var n=r(34);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return n(e)=="String"?e.split(""):Object(e)}},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t){e.exports=function(e){if(e==undefined)throw TypeError("Can't call method on "+e);return e}},function(e,t,r){var n=r(32),i=r(9).getNames,a={}.toString;var s=typeof window=="object"&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];var o=function(e){try{return i(e)}catch(e){return s.slice()}};e.exports.get=function e(t){if(s&&a.call(t)=="[object Window]")return o(t);return i(n(t))}},function(e,t,r){var o=r(9);e.exports=function(e){var t=o.getKeys(e),r=o.getSymbols;if(r){var n=r(e),i=o.isEnum,a=0,s;while(n.length>a)if(i.call(e,s=n[a++]))t.push(s)}return t}},function(e,t,r){var n=r(34);e.exports=Array.isArray||function(e){return n(e)=="Array"}},function(e,t,r){var n=r(40);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t){e.exports=function(e){return typeof e==="object"?e!==null:typeof e==="function"}},function(e,t){e.exports=true},function(e,t){},function(e,t,r){e.exports={default:r(44),__esModule:true}},function(e,t,r){r(45);r(51);e.exports=r(29)("iterator")},function(e,t,r){"use strict";var n=r(46)(true);r(48)(String,"String",function(e){this._t=String(e);this._i=0},function(){var e=this._t,t=this._i,r;if(t>=e.length)return{value:undefined,done:true};r=n(e,t);this._i+=r.length;return{value:r,done:false}})},function(e,t,r){var l=r(47),u=r(35);e.exports=function(o){return function(e,t){var r=String(u(e)),n=l(t),i=r.length,a,s;if(n<0||n>=i)return o?"":undefined;a=r.charCodeAt(n);return a<55296||a>56319||n+1===i||(s=r.charCodeAt(n+1))<56320||s>57343?o?r.charAt(n):a:o?r.slice(n,n+2):(a-55296<<10)+(s-56320)+65536}}},function(e,t){var r=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t,r){"use strict";var v=r(41),y=r(20),b=r(24),E=r(25),S=r(17),x=r(49),k=r(50),w=r(28),C=r(9).getProto,A=r(29)("iterator"),P=!([].keys&&"next"in[].keys()),_="@@iterator",I="keys",O="values";var T=function(){return this};e.exports=function(e,t,r,n,i,a,s){k(r,t,n);var o=function(t){if(!P&&t in f)return f[t];switch(t){case I:return function e(){return new r(this,t)};case O:return function e(){return new r(this,t)}}return function e(){return new r(this,t)}};var l=t+" Iterator",u=i==O,c=false,f=e.prototype,h=f[A]||f[_]||i&&f[i],p=h||o(i),d,g;if(h){var m=C(p.call(new e));w(m,l,true);if(!v&&S(f,_))E(m,A,T);if(u&&h.name!==O){c=true;p=function e(){return h.call(this)}}}if((!v||s)&&(P||c||!f[A])){E(f,A,p)}x[t]=p;x[l]=T;if(i){d={values:u?p:o(O),keys:a?p:o(I),entries:!u?p:o("entries")};if(s)for(g in d){if(!(g in f))b(f,g,d[g])}else y(y.P+y.F*(P||c),t,d)}return d}},function(e,t){e.exports={}},function(e,t,r){"use strict";var n=r(9),i=r(26),a=r(28),s={};r(25)(s,r(29)("iterator"),function(){return this});e.exports=function(e,t,r){e.prototype=n.create(s,{next:i(1,r)});a(e,t+" Iterator")}},function(e,t,r){r(52);var n=r(49);n.NodeList=n.HTMLCollection=n.Array},function(e,t,r){"use strict";var n=r(53),i=r(54),a=r(49),s=r(32);e.exports=r(48)(Array,"Array",function(e,t){this._t=s(e);this._i=0;this._k=t},function(){var e=this._t,t=this._k,r=this._i++;if(!e||r>=e.length){this._t=undefined;return i(1)}if(t=="keys")return i(0,r);if(t=="values")return i(0,e[r]);return i(0,[r,e[r]])},"values");a.Arguments=a.Array;n("keys");n("values");n("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,r){e.exports={default:r(56),__esModule:true}},function(e,t,r){r(51);r(45);e.exports=r(57)},function(e,t,r){var n=r(39),i=r(58);e.exports=r(21).getIterator=function(e){var t=i(e);if(typeof t!="function")throw TypeError(e+" is not iterable!");return n(t.call(e))}},function(e,t,r){var n=r(59),i=r(29)("iterator"),a=r(49);e.exports=r(21).getIteratorMethod=function(e){if(e!=undefined)return e[i]||e["@@iterator"]||a[n(e)]}},function(e,t,r){var i=r(34),a=r(29)("toStringTag"),s=i(function(){return arguments}())=="Arguments";e.exports=function(e){var t,r,n;return e===undefined?"Undefined":e===null?"Null":typeof(r=(t=Object(e))[a])=="string"?r:s?i(t):(n=i(t))=="Object"&&typeof t.callee=="function"?"Arguments":n}},function(e,t,r){e.exports={default:r(61),__esModule:true}},function(e,t,r){r(62);e.exports=r(21).Object.keys},function(e,t,r){var n=r(63);r(64)("keys",function(r){return function e(t){return r(n(t))}})},function(e,t,r){var n=r(35);e.exports=function(e){return Object(n(e))}},function(e,t,r){var i=r(20),a=r(21),s=r(19);e.exports=function(e,t){var r=(a.Object||{})[e]||Object[e],n={};n[e]=t(r);i(i.S+i.F*s(function(){r(1)}),"Object",n)}},function(e,t,r){"use strict";var n=r(1)["default"];t.__esModule=true;var i=r(6);var a=n(i);t["default"]=function(e){e.registerHelper("helperMissing",function(){if(arguments.length===1){return undefined}else{throw new a["default"]('Missing helper: "'+arguments[arguments.length-1].name+'"')}})};e.exports=t["default"]},function(e,t,r){"use strict";var n=r(1)["default"];t.__esModule=true;var i=r(5);var a=r(6);var s=n(a);t["default"]=function(r){r.registerHelper("if",function(e,t){if(arguments.length!=2){throw new s["default"]("#if requires exactly one argument")}if(i.isFunction(e)){e=e.call(this)}if(!t.hash.includeZero&&!e||i.isEmpty(e)){return t.inverse(this)}else{return t.fn(this)}});r.registerHelper("unless",function(e,t){if(arguments.length!=2){throw new s["default"]("#unless requires exactly one argument")}return r.helpers["if"].call(this,e,{fn:t.inverse,inverse:t.fn,hash:t.hash})})};e.exports=t["default"]},function(e,t){"use strict";t.__esModule=true;t["default"]=function(i){i.registerHelper("log",function(){var e=[undefined],t=arguments[arguments.length-1];for(var r=0;r=0){t=r}else{t=parseInt(t,10)}}return t},log:function e(t){t=s.lookupLevel(t);if(typeof console!=="undefined"&&s.lookupLevel(s.level)<=t){var r=s.methodMap[t];if(!console[r]){r="log"}for(var n=arguments.length,i=Array(n>1?n-1:0),a=1;a=u.LAST_COMPATIBLE_COMPILER_REVISION&&t<=u.COMPILER_REVISION){return}if(t2){P.push("'"+this.terminals_[w]+"'")}if(this.lexer.showPosition){_="Parse error on line "+(l+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+P.join(", ")+", got '"+(this.terminals_[v]||v)+"'"}else{_="Parse error on line "+(l+1)+": Unexpected "+(v==1?"end of input":"'"+(this.terminals_[v]||v)+"'")}this.parseError(_,{text:this.lexer.match,token:this.terminals_[v]||v,line:this.lexer.yylineno,loc:p,expected:P})}}if(E[0]instanceof Array&&E.length>1){throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+v)}switch(E[0]){case 1:n.push(v);i.push(this.lexer.yytext);a.push(this.lexer.yylloc);n.push(E[1]);v=null;if(!y){u=this.lexer.yyleng;o=this.lexer.yytext;l=this.lexer.yylineno;p=this.lexer.yylloc;if(c>0)c--}else{v=y;y=null}break;case 2:C=this.productions_[E[1]][1];k.$=i[i.length-C];k._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column};if(d){k._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]}x=this.performAction.call(k,o,u,l,this.yy,E[1],i,a);if(typeof x!=="undefined"){return x}if(C){n=n.slice(0,-1*C*2);i=i.slice(0,-1*C);a=a.slice(0,-1*C)}n.push(this.productions_[E[1]][0]);i.push(k.$);a.push(k._$);A=s[n[n.length-2]][n[n.length-1]];n.push(A);break;case 3:return true}}return true}};var t=function(){var e={EOF:1,parseError:function e(t,r){if(this.yy.parser){this.yy.parser.parseError(t,r)}else{throw new Error(t)}},setInput:function e(t){this._input=t;this._more=this._less=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges)this.yylloc.range=[0,0];this.offset=0;return this},input:function e(){var t=this._input[0];this.yytext+=t;this.yyleng++;this.offset++;this.match+=t;this.matched+=t;var r=t.match(/(?:\r\n?|\n).*/g);if(r){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges)this.yylloc.range[1]++;this._input=this._input.slice(1);return t},unput:function e(t){var r=t.length;var n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-r-1);this.offset-=r;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(n.length-1)this.yylineno-=n.length-1;var a=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-r};if(this.options.ranges){this.yylloc.range=[a[0],a[0]+this.yyleng-r]}return this},more:function e(){this._more=true;return this},less:function e(t){this.unput(this.match.slice(t))},pastInput:function e(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function e(){var t=this.match;if(t.length<20){t+=this._input.substr(0,20-t.length)}return(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function e(){var t=this.pastInput();var r=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+r+"^"},next:function e(){if(this.done){return this.EOF}if(!this._input)this.done=true;var t,r,n,i,a,s;if(!this._more){this.yytext="";this.match=""}var o=this._currentRules();for(var l=0;lr[0].length)){r=n;i=l;if(!this.options.flex)break}}if(r){s=r[0].match(/(?:\r\n?|\n).*/g);if(s)this.yylineno+=s.length;this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length};this.yytext+=r[0];this.match+=r[0];this.matches=r;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._input=this._input.slice(r[0].length);this.matched+=r[0];t=this.performAction.call(this,this.yy,this,o[i],this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input)this.done=false;if(t)return t;else return}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},lex:function e(){var t=this.next();if(typeof t!=="undefined"){return t}else{return this.lex()}},begin:function e(t){this.conditionStack.push(t)},popState:function e(){return this.conditionStack.pop()},_currentRules:function e(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function e(){return this.conditionStack[this.conditionStack.length-2]},pushState:function e(t){this.begin(t)}};e.options={};e.performAction=function e(t,r,n,i){function a(e,t){return r.yytext=r.yytext.substring(e,r.yyleng-t+e)}var s=i;switch(n){case 0:if(r.yytext.slice(-2)==="\\\\"){a(0,1);this.begin("mu")}else if(r.yytext.slice(-1)==="\\"){a(0,1);this.begin("emu")}else{this.begin("mu")}if(r.yytext)return 15;break;case 1:return 15;break;case 2:this.popState();return 15;break;case 3:this.begin("raw");return 15;break;case 4:this.popState();if(this.conditionStack[this.conditionStack.length-1]==="raw"){return 15}else{a(5,9);return"END_RAW_BLOCK"}break;case 5:return 15;break;case 6:this.popState();return 14;break;case 7:return 65;break;case 8:return 68;break;case 9:return 19;break;case 10:this.popState();this.begin("raw");return 23;break;case 11:return 55;break;case 12:return 60;break;case 13:return 29;break;case 14:return 47;break;case 15:this.popState();return 44;break;case 16:this.popState();return 44;break;case 17:return 34;break;case 18:return 39;break;case 19:return 51;break;case 20:return 48;break;case 21:this.unput(r.yytext);this.popState();this.begin("com");break;case 22:this.popState();return 14;break;case 23:return 48;break;case 24:return 73;break;case 25:return 72;break;case 26:return 72;break;case 27:return 87;break;case 28:break;case 29:this.popState();return 54;break;case 30:this.popState();return 33;break;case 31:r.yytext=a(1,2).replace(/\\"/g,'"');return 80;break;case 32:r.yytext=a(1,2).replace(/\\'/g,"'");return 80;break;case 33:return 85;break;case 34:return 82;break;case 35:return 82;break;case 36:return 83;break;case 37:return 84;break;case 38:return 81;break;case 39:return 75;break;case 40:return 77;break;case 41:return 72;break;case 42:r.yytext=r.yytext.replace(/\\([\\\]])/g,"$1");return 72;break;case 43:return"INVALID";break;case 44:return 5;break}};e.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/];e.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:false},emu:{rules:[2],inclusive:false},com:{rules:[6],inclusive:false},raw:{rules:[3,4,5],inclusive:false},INITIAL:{rules:[0,1,44],inclusive:true}};return e}();e.lexer=t;function r(){this.yy={}}r.prototype=e;e.Parser=r;return new r}();t["default"]=r;e.exports=t["default"]},function(e,t,r){"use strict";var n=r(1)["default"];t.__esModule=true;var i=r(88);var a=n(i);function s(){var e=arguments.length<=0||arguments[0]===undefined?{}:arguments[0];this.options=e}s.prototype=new a["default"];s.prototype.Program=function(e){var t=!this.options.ignoreStandalone;var r=!this.isRootSeen;this.isRootSeen=true;var n=e.body;for(var i=0,a=n.length;i0){throw new c["default"]("Invalid path: "+n,{loc:r})}else if(l===".."){a++}}else{i.push(l)}}return{type:"PathExpression",data:e,depth:a,parts:i,original:n,loc:r}}function h(e,t,r,n,i,a){var s=n.charAt(3)||n.charAt(2),o=s!=="{"&&s!=="&";var l=/\*/.test(n);return{type:l?"Decorator":"MustacheStatement",path:e,params:t,hash:r,escaped:o,strip:i,loc:this.locInfo(a)}}function p(e,t,r,n){u(e,r);n=this.locInfo(n);var i={type:"Program",body:t,strip:{},loc:n};return{type:"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:i,openStrip:{},inverseStrip:{},closeStrip:{},loc:n}}function d(e,t,r,n,i,a){if(n&&n.path){u(e,n)}var s=/\*/.test(e.open);t.blockParams=e.blockParams;var o=undefined,l=undefined;if(r){if(s){throw new c["default"]("Unexpected inverse block on decorator",r)}if(r.chain){r.program.body[0].closeStrip=n.strip}l=r.strip;o=r.program}if(i){i=o;o=t;t=i}return{type:s?"DecoratorBlock":"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:t,inverse:o,openStrip:e.strip,inverseStrip:l,closeStrip:n&&n.strip,loc:this.locInfo(a)}}function g(e,t){if(!t&&e.length){var r=e[0].loc,n=e[e.length-1].loc;if(r&&n){t={source:r.source,start:{line:r.start.line,column:r.start.column},end:{line:n.end.line,column:n.end.column}}}}return{type:"Program",body:e,strip:{},loc:t}}function m(e,t,r,n){u(e,r);return{type:"PartialBlockStatement",name:e.path,params:e.params,hash:e.hash,program:t,openStrip:e.strip,closeStrip:r&&r.strip,loc:this.locInfo(n)}}},function(e,t,r){"use strict";var n=r(74)["default"];var i=r(1)["default"];t.__esModule=true;t.Compiler=f;t.precompile=h;t.compile=p;var a=r(6);var l=i(a);var u=r(5);var s=r(84);var c=i(s);var o=[].slice;function f(){}f.prototype={compiler:f,equals:function e(t){var r=this.opcodes.length;if(t.opcodes.length!==r){return false}for(var n=0;n1){throw new l["default"]("Unsupported number of partial arguments: "+n.length,t)}else if(!n.length){if(this.options.explicitPartialContext){this.opcode("pushLiteral","undefined")}else{n.push({type:"PathExpression",parts:[],depth:0})}}var i=t.name.original,a=t.name.type==="SubExpression";if(a){this.accept(t.name)}this.setupFullMustacheParams(t,r,undefined,true);var s=t.indent||"";if(this.options.preventIndent&&s){this.opcode("appendContent",s);s=""}this.opcode("invokePartial",a,i,s);this.opcode("append")},PartialBlockStatement:function e(t){this.PartialStatement(t)},MustacheStatement:function e(t){this.SubExpression(t);if(t.escaped&&!this.options.noEscape){this.opcode("appendEscaped")}else{this.opcode("append")}},Decorator:function e(t){this.DecoratorBlock(t)},ContentStatement:function e(t){if(t.value){this.opcode("appendContent",t.value)}},CommentStatement:function e(){},SubExpression:function e(t){g(t);var r=this.classifySexpr(t);if(r==="simple"){this.simpleSexpr(t)}else if(r==="helper"){this.helperSexpr(t)}else{this.ambiguousSexpr(t)}},ambiguousSexpr:function e(t,r,n){var i=t.path,a=i.parts[0],s=r!=null||n!=null;this.opcode("getContext",i.depth);this.opcode("pushProgram",r);this.opcode("pushProgram",n);i.strict=true;this.accept(i);this.opcode("invokeAmbiguous",a,s)},simpleSexpr:function e(t){var r=t.path;r.strict=true;this.accept(r);this.opcode("resolvePossibleLambda")},helperSexpr:function e(t,r,n){var i=this.setupFullMustacheParams(t,r,n),a=t.path,s=a.parts[0];if(this.options.knownHelpers[s]){this.opcode("invokeKnownHelper",i.length,s)}else if(this.options.knownHelpersOnly){throw new l["default"]("You specified knownHelpersOnly, but used the unknown helper "+s,t)}else{a.strict=true;a.falsy=true;this.accept(a);this.opcode("invokeHelper",i.length,a.original,c["default"].helpers.simpleId(a))}},PathExpression:function e(t){this.addDepth(t.depth);this.opcode("getContext",t.depth);var r=t.parts[0],n=c["default"].helpers.scopedId(t),i=!t.depth&&!n&&this.blockParamIndex(r);if(i){this.opcode("lookupBlockParam",i,t.parts)}else if(!r){this.opcode("pushContext")}else if(t.data){this.options.data=true;this.opcode("lookupData",t.depth,t.parts,t.strict)}else{this.opcode("lookupOnContext",t.parts,t.falsy,t.strict,n)}},StringLiteral:function e(t){this.opcode("pushString",t.value)},NumberLiteral:function e(t){this.opcode("pushLiteral",t.value)},BooleanLiteral:function e(t){this.opcode("pushLiteral",t.value)},UndefinedLiteral:function e(){this.opcode("pushLiteral","undefined")},NullLiteral:function e(){this.opcode("pushLiteral","null")},Hash:function e(t){var r=t.pairs,n=0,i=r.length;this.opcode("pushHash");for(;n=0){return[r,a]}}}};function h(e,t,r){if(e==null||typeof e!=="string"&&e.type!=="Program"){throw new l["default"]("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+e)}t=t||{};if(!("data"in t)){t.data=true}if(t.compat){t.useDepths=true}var n=r.parse(e,t),i=(new r.Compiler).compile(n,t);return(new r.JavaScriptCompiler).compile(i,t)}function p(n,i,a){if(i===undefined)i={};if(n==null||typeof n!=="string"&&n.type!=="Program"){throw new l["default"]("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+n)}i=u.extend({},i);if(!("data"in i)){i.data=true}if(i.compat){i.useDepths=true}var s=undefined;function o(){var e=a.parse(n,i),t=(new a.Compiler).compile(e,i),r=(new a.JavaScriptCompiler).compile(t,i,undefined,true);return a.template(r)}function e(e,t){if(!s){s=o()}return s.call(this,e,t)}e._setup=function(e){if(!s){s=o()}return s._setup(e)};e._child=function(e,t,r,n){if(!s){s=o()}return s._child(e,t,r,n)};return e}function d(e,t){if(e===t){return true}if(u.isArray(e)&&u.isArray(t)&&e.length===t.length){for(var r=0;r0){n+=", "+i.join(", ")}var a=0;l(this.aliases).forEach(function(e){var t=r.aliases[e];if(t.children&&t.referenceCount>1){n+=", alias"+ ++a+"="+e;t.children[0]="alias"+a}});if(this.lookupPropertyFunctionIsUsed){n+=", "+this.lookupPropertyFunctionVarDeclaration()}var s=["container","depth0","helpers","partials","data"];if(this.useBlockParams||this.useDepths){s.push("blockParams")}if(this.useDepths){s.push("depths")}var o=this.mergeSource(n);if(t){s.push(o);return Function.apply(this,s)}else{return this.source.wrap(["function(",s.join(","),") {\n ",o,"}"])}},mergeSource:function e(t){var r=this.environment.isSimple,n=!this.forceBuffer,i=undefined,a=undefined,s=undefined,o=undefined;this.source.each(function(e){if(e.appendToBuffer){if(s){e.prepend(" + ")}else{s=e}o=e}else{if(s){if(!a){i=true}else{s.prepend("buffer += ")}o.add(";");s=o=undefined}a=true;if(!r){n=false}}});if(n){if(s){s.prepend("return ");o.add(";")}else if(!a){this.source.push('return "";')}}else{t+=", buffer = "+(i?"":this.initializeBuffer());if(s){s.prepend("return buffer + ");o.add(";")}else{this.source.push("return buffer;")}}if(t){this.source.prepend("var "+t.substring(2)+(i?"":";\n"))}return this.source.merge()},lookupPropertyFunctionVarDeclaration:function e(){return"\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n ".trim()},blockValue:function e(t){var r=this.aliasable("container.hooks.blockHelperMissing"),n=[this.contextName(0)];this.setupHelperArgs(t,0,n);var i=this.popStack();n.splice(1,0,i);this.push(this.source.functionCall(r,"call",n))},ambiguousBlockValue:function e(){var t=this.aliasable("container.hooks.blockHelperMissing"),r=[this.contextName(0)];this.setupHelperArgs("",0,r,true);this.flushInline();var n=this.topStack();r.splice(1,0,n);this.pushSource(["if (!",this.lastHelper,") { ",n," = ",this.source.functionCall(t,"call",r),"}"])},appendContent:function e(t){if(this.pendingContent){t=this.pendingContent+t}else{this.pendingLocation=this.source.currentLocation}this.pendingContent=t},append:function e(){if(this.isInline()){this.replaceStack(function(e){return[" != null ? ",e,' : ""']});this.pushSource(this.appendToBuffer(this.popStack()))}else{var t=this.popStack();this.pushSource(["if (",t," != null) { ",this.appendToBuffer(t,undefined,true)," }"]);if(this.environment.isSimple){this.pushSource(["else { ",this.appendToBuffer("''",undefined,true)," }"])}}},appendEscaped:function e(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function e(t){this.lastContext=t},pushContext:function e(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function e(t,r,n,i){var a=0;if(!i&&this.options.compat&&!this.lastContext){this.push(this.depthedLookup(t[a++]))}else{this.pushContext()}this.resolvePath("context",t,a,r,n)},lookupBlockParam:function e(t,r){this.useBlockParams=true;this.push(["blockParams[",t[0],"][",t[1],"]"]);this.resolvePath("context",r,1)},lookupData:function e(t,r,n){if(!t){this.pushStackLiteral("data")}else{this.pushStackLiteral("container.data(data, "+t+")")}this.resolvePath("data",r,0,true,n)},resolvePath:function e(r,n,i,a,t){var s=this;if(this.options.strict||this.options.assumeObjects){this.push(h(this.options.strict&&t,this,n,i,r));return}var o=n.length;for(;ithis.stackVars.length){this.stackVars.push("stack"+this.stackSlot)}return this.topStackName()},topStackName:function e(){return"stack"+this.stackSlot},flushInline:function e(){var t=this.inlineStack;this.inlineStack=[];for(var r=0,n=t.length;r=0)){return"unset"}else{return n}}function getClosestAttributeValue(t,r){var n=null;getClosestMatch(t,function(e){return n=getAttributeValueWithDisinheritance(t,e,r)});if(n!=="unset"){return n}}function matches(e,t){var r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;return r&&r.call(e,t)}function getStartTag(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 parseHTML(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=getDocument().createDocumentFragment()}return i}function aFullPageResponse(e){return e.match(/",0);return r.querySelector("template").content}else{var n=getStartTag(e);switch(n){case"thead":case"tbody":case"tfoot":case"colgroup":case"caption":return parseHTML(""+e+"
",1);case"col":return parseHTML(""+e+"
",2);case"tr":return parseHTML(""+e+"
",2);case"td":case"th":return parseHTML(""+e+"
",3);case"script":case"style":return parseHTML("
"+e+"
",1);default:return parseHTML(e,0)}}}function maybeCall(e){if(e){e()}}function isType(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function isFunction(e){return isType(e,"Function")}function isRawObject(e){return isType(e,"Object")}function getInternalData(e){var t="htmx-internal-data";var r=e[t];if(!r){r=e[t]={}}return r}function toArray(e){var t=[];if(e){for(var r=0;r=0}function bodyContains(e){if(e.getRootNode&&e.getRootNode()instanceof window.ShadowRoot){return getDocument().body.contains(e.getRootNode().host)}else{return getDocument().body.contains(e)}}function splitOnWhitespace(e){return e.trim().split(/\s+/)}function mergeObjects(e,t){for(var r in t){if(t.hasOwnProperty(r)){e[r]=t[r]}}return e}function parseJSON(e){try{return JSON.parse(e)}catch(e){logError(e);return null}}function canAccessLocalStorage(){var e="htmx:localStorageTest";try{localStorage.setItem(e,e);localStorage.removeItem(e);return true}catch(e){return false}}function normalizePath(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 internalEval(str){return maybeEval(getDocument().body,function(){return eval(str)})}function onLoadHelper(t){var e=htmx.on("htmx:load",function(e){t(e.detail.elt)});return e}function logAll(){htmx.logger=function(e,t,r){if(console){console.log(t,e,r)}}}function logNone(){htmx.logger=null}function find(e,t){if(t){return e.querySelector(t)}else{return find(getDocument(),e)}}function findAll(e,t){if(t){return e.querySelectorAll(t)}else{return findAll(getDocument(),e)}}function removeElement(e,t){e=resolveTarget(e);if(t){setTimeout(function(){removeElement(e);e=null},t)}else{e.parentElement.removeChild(e)}}function addClassToElement(e,t,r){e=resolveTarget(e);if(r){setTimeout(function(){addClassToElement(e,t);e=null},r)}else{e.classList&&e.classList.add(t)}}function removeClassFromElement(e,t,r){e=resolveTarget(e);if(r){setTimeout(function(){removeClassFromElement(e,t);e=null},r)}else{if(e.classList){e.classList.remove(t);if(e.classList.length===0){e.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(e,t)}function closest(e,t){e=resolveTarget(e);if(e.closest){return e.closest(t)}else{do{if(e==null||matches(e,t)){return e}}while(e=e&&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){var t=e.trim();if(startsWith(t,"<")&&endsWith(t,"/>")){return t.substring(1,t.length-2)}else{return t}}function querySelectorAllExt(e,t){if(t.indexOf("closest ")===0){return[closest(e,normalizeSelector(t.substr(8)))]}else if(t.indexOf("find ")===0){return[find(e,normalizeSelector(t.substr(5)))]}else if(t==="next"){return[e.nextElementSibling]}else if(t.indexOf("next ")===0){return[scanForwardQuery(e,normalizeSelector(t.substr(5)))]}else if(t==="previous"){return[e.previousElementSibling]}else if(t.indexOf("previous ")===0){return[scanBackwardsQuery(e,normalizeSelector(t.substr(9)))]}else if(t==="document"){return[document]}else if(t==="window"){return[window]}else if(t==="body"){return[document.body]}else{return getDocument().querySelectorAll(normalizeSelector(t))}}var scanForwardQuery=function(e,t){var r=getDocument().querySelectorAll(t);for(var n=0;n=0;n--){var i=r[n];if(i.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_FOLLOWING){return i}}};function querySelectorExt(e,t){if(t){return querySelectorAllExt(e,t)[0]}else{return querySelectorAllExt(getDocument().body,e)[0]}}function resolveTarget(e){if(isType(e,"String")){return find(e)}else{return e}}function processEventArgs(e,t,r){if(isFunction(t)){return{target:getDocument().body,event:e,listener:t}}else{return{target:resolveTarget(e),event:t,listener:r}}}function addEventListenerImpl(t,r,n){ready(function(){var e=processEventArgs(t,r,n);e.target.addEventListener(e.event,e.listener)});var e=isFunction(r);return e?r:n}function removeEventListenerImpl(t,r,n){ready(function(){var e=processEventArgs(t,r,n);e.target.removeEventListener(e.event,e.listener)});return isFunction(r)?r:n}var DUMMY_ELT=getDocument().createElement("output");function findAttributeTargets(e,t){var r=getClosestAttributeValue(e,t);if(r){if(r==="this"){return[findThisElement(e,t)]}else{var n=querySelectorAllExt(e,r);if(n.length===0){logError('The selector "'+r+'" on '+t+" returned no matches!");return[DUMMY_ELT]}else{return n}}}}function findThisElement(e,t){return getClosestMatch(e,function(e){return getAttributeValue(e,t)!=null})}function getTarget(e){var t=getClosestAttributeValue(e,"hx-target");if(t){if(t==="this"){return findThisElement(e,"hx-target")}else{return querySelectorExt(e,t)}}else{var r=getInternalData(e);if(r.boosted){return getDocument().body}else{return e}}}function shouldSettleAttribute(e){var t=htmx.config.attributesToSettle;for(var r=0;r0){s=e.substr(0,e.indexOf(":"));t=e.substr(e.indexOf(":")+1,e.length)}else{s=e}var r=getDocument().querySelectorAll(t);if(r){forEach(r,function(e){var t;var r=i.cloneNode(true);t=getDocument().createDocumentFragment();t.appendChild(r);if(!isInlineSwap(s,e)){t=r}var n={shouldSwap:true,target:e,fragment:t};if(!triggerEvent(e,"htmx:oobBeforeSwap",n))return;e=n.target;if(n["shouldSwap"]){swap(s,e,e,t,a)}forEach(a.elts,function(e){triggerEvent(e,"htmx:oobAfterSwap",n)})});i.parentNode.removeChild(i)}else{i.parentNode.removeChild(i);triggerErrorEvent(getDocument().body,"htmx:oobErrorNoTarget",{content:i})}return e}function handleOutOfBandSwaps(e,t,r){var n=getClosestAttributeValue(e,"hx-select-oob");if(n){var i=n.split(",");for(let e=0;e0){var r=t.replace("'","\\'");var n=e.tagName.replace(":","\\:");var i=s.querySelector(n+"[id='"+r+"']");if(i&&i!==s){var a=e.cloneNode();cloneAttributes(e,i);o.tasks.push(function(){cloneAttributes(e,a)})}}})}function makeAjaxLoadTask(e){return function(){removeClassFromElement(e,htmx.config.addedClass);processNode(e);processScripts(e);processFocus(e);triggerEvent(e,"htmx:load")}}function processFocus(e){var t="[autofocus]";var r=matches(e,t)?e:e.querySelector(t);if(r!=null){r.focus()}}function insertNodesBefore(e,t,r,n){handleAttributes(e,r,n);while(r.childNodes.length>0){var i=r.firstChild;addClassToElement(i,htmx.config.addedClass);e.insertBefore(i,t);if(i.nodeType!==Node.TEXT_NODE&&i.nodeType!==Node.COMMENT_NODE){n.tasks.push(makeAjaxLoadTask(i))}}}function stringHash(e,t){var r=0;while(r-1){var t=e.replace(/]*>|>)([\s\S]*?)<\/svg>/gim,"");var r=t.match(/]*>|>)([\s\S]*?)<\/title>/im);if(r){return r[2]}}}function selectAndSwap(e,t,r,n,i,a){i.title=findTitle(n);var s=makeFragment(n);if(s){handleOutOfBandSwaps(r,s,i);s=maybeSelectFromResponse(r,s,a);handlePreservedElements(s);return swap(e,r,t,s,i)}}function handleTrigger(e,t,r){var n=e.getResponseHeader(t);if(n.indexOf("{")===0){var i=parseJSON(n);for(var a in i){if(i.hasOwnProperty(a)){var s=i[a];if(!isRawObject(s)){s={value:s}}triggerEvent(r,a,s)}}}else{var o=n.split(",");for(var l=0;l0){var s=t[0];if(s==="]"){n--;if(n===0){if(a===null){i=i+"true"}t.shift();i+=")})";try{var o=maybeEval(e,function(){return Function(i)()},function(){return true});o.source=i;return o}catch(e){triggerErrorEvent(getDocument().body,"htmx:syntax:error",{error:e,source:i});return null}}}else if(s==="["){n++}if(isPossibleRelativeReference(s,a,r)){i+="(("+r+"."+s+") ? ("+r+"."+s+") : (window."+s+"))"}else{i=i+s}a=t.shift()}}}function consumeUntil(e,t){var r="";while(e.length>0&&!e[0].match(t)){r+=e.shift()}return r}function consumeCSSSelector(e){var t;if(e.length>0&&COMBINED_SELECTOR_START.test(e[0])){e.shift();t=consumeUntil(e,COMBINED_SELECTOR_END).trim();e.shift()}else{t=consumeUntil(e,WHITESPACE_OR_COMMA)}return t}var INPUT_SELECTOR="input, textarea, select";function getTriggerSpecs(e){var t=getAttributeValue(e,"hx-trigger");var r=[];if(t){var n=tokenizeString(t);do{consumeUntil(n,NOT_WHITESPACE);var i=n.length;var a=consumeUntil(n,/[,\[\s]/);if(a!==""){if(a==="every"){var s={trigger:"every"};consumeUntil(n,NOT_WHITESPACE);s.pollInterval=parseInterval(consumeUntil(n,/[,\[\s]/));consumeUntil(n,NOT_WHITESPACE);var o=maybeGenerateConditional(e,n,"event");if(o){s.eventFilter=o}r.push(s)}else if(a.indexOf("sse:")===0){r.push({trigger:"sse",sseEvent:a.substr(4)})}else{var l={trigger:a};var o=maybeGenerateConditional(e,n,"event");if(o){l.eventFilter=o}while(n.length>0&&n[0]!==","){consumeUntil(n,NOT_WHITESPACE);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=parseInterval(consumeUntil(n,WHITESPACE_OR_COMMA))}else if(u==="from"&&n[0]===":"){n.shift();if(COMBINED_SELECTOR_START.test(n[0])){var c=consumeCSSSelector(n)}else{var c=consumeUntil(n,WHITESPACE_OR_COMMA);if(c==="closest"||c==="find"||c==="next"||c==="previous"){n.shift();var f=consumeCSSSelector(n);if(f.length>0){c+=" "+f}}}l.from=c}else if(u==="target"&&n[0]===":"){n.shift();l.target=consumeCSSSelector(n)}else if(u==="throttle"&&n[0]===":"){n.shift();l.throttle=parseInterval(consumeUntil(n,WHITESPACE_OR_COMMA))}else if(u==="queue"&&n[0]===":"){n.shift();l.queue=consumeUntil(n,WHITESPACE_OR_COMMA)}else if(u==="root"&&n[0]===":"){n.shift();l[u]=consumeCSSSelector(n)}else if(u==="threshold"&&n[0]===":"){n.shift();l[u]=consumeUntil(n,WHITESPACE_OR_COMMA)}else{triggerErrorEvent(e,"htmx:syntax:error",{token:n.shift()})}}r.push(l)}}if(n.length===i){triggerErrorEvent(e,"htmx:syntax:error",{token:n.shift()})}consumeUntil(n,NOT_WHITESPACE)}while(n[0]===","&&n.shift())}if(r.length>0){return r}else if(matches(e,"form")){return[{trigger:"submit"}]}else if(matches(e,'input[type="button"], input[type="submit"]')){return[{trigger:"click"}]}else if(matches(e,INPUT_SELECTOR)){return[{trigger:"change"}]}else{return[{trigger:"click"}]}}function cancelPolling(e){getInternalData(e).cancelled=true}function processPolling(e,t,r){var n=getInternalData(e);n.timeout=setTimeout(function(){if(bodyContains(e)&&n.cancelled!==true){if(!maybeFilterEvent(r,e,makeEvent("hx:poll:trigger",{triggerSpec:r,target:e}))){t(e)}processPolling(e,t,r)}},r.pollInterval)}function isLocalLink(e){return location.hostname===e.hostname&&getRawAttribute(e,"href")&&getRawAttribute(e,"href").indexOf("#")!==0}function boostElement(t,r,e){if(t.tagName==="A"&&isLocalLink(t)&&(t.target===""||t.target==="_self")||t.tagName==="FORM"){r.boosted=true;var n,i;if(t.tagName==="A"){n="get";i=getRawAttribute(t,"href")}else{var a=getRawAttribute(t,"method");n=a?a.toLowerCase():"get";if(n==="get"){}i=getRawAttribute(t,"action")}e.forEach(function(e){addEventListener(t,function(e,t){if(closest(e,htmx.config.disableSelector)){cleanUpElement(e);return}issueAjaxRequest(n,i,e,t)},r,e,true)})}}function shouldCancel(e,t){if(e.type==="submit"||e.type==="click"){if(t.tagName==="FORM"){return true}if(matches(t,'input[type="submit"], button')&&closest(t,"form")!==null){return true}if(t.tagName==="A"&&t.href&&(t.getAttribute("href")==="#"||t.getAttribute("href").indexOf("#")!==0)){return true}}return false}function ignoreBoostedAnchorCtrlClick(e,t){return getInternalData(e).boosted&&e.tagName==="A"&&t.type==="click"&&(t.ctrlKey||t.metaKey)}function maybeFilterEvent(e,t,r){var n=e.eventFilter;if(n){try{return n.call(t,r)!==true}catch(e){triggerErrorEvent(getDocument().body,"htmx:eventFilter:error",{error:e,source:n.source});return true}}return false}function addEventListener(a,s,e,o,l){var u=getInternalData(a);var t;if(o.from){t=querySelectorAllExt(a,o.from)}else{t=[a]}if(o.changed){t.forEach(function(e){var t=getInternalData(e);t.lastValue=e.value})}forEach(t,function(n){var i=function(e){if(!bodyContains(a)){n.removeEventListener(o.trigger,i);return}if(ignoreBoostedAnchorCtrlClick(a,e)){return}if(l||shouldCancel(e,a)){e.preventDefault()}if(maybeFilterEvent(o,a,e)){return}var t=getInternalData(e);t.triggerSpec=o;if(t.handledFor==null){t.handledFor=[]}if(t.handledFor.indexOf(a)<0){t.handledFor.push(a);if(o.consume){e.stopPropagation()}if(o.target&&e.target){if(!matches(e.target,o.target)){return}}if(o.once){if(u.triggeredOnce){return}else{u.triggeredOnce=true}}if(o.changed){var r=getInternalData(n);if(r.lastValue===n.value){return}r.lastValue=n.value}if(u.delayed){clearTimeout(u.delayed)}if(u.throttle){return}if(o.throttle){if(!u.throttle){s(a,e);u.throttle=setTimeout(function(){u.throttle=null},o.throttle)}}else if(o.delay){u.delayed=setTimeout(function(){s(a,e)},o.delay)}else{triggerEvent(a,"htmx:trigger");s(a,e)}}};if(e.listenerInfos==null){e.listenerInfos=[]}e.listenerInfos.push({trigger:o.trigger,listener:i,on:n});n.addEventListener(o.trigger,i)})}var windowIsScrolling=false;var scrollHandler=null;function initScrollHandler(){if(!scrollHandler){scrollHandler=function(){windowIsScrolling=true};window.addEventListener("scroll",scrollHandler);setInterval(function(){if(windowIsScrolling){windowIsScrolling=false;forEach(getDocument().querySelectorAll("[hx-trigger='revealed'],[data-hx-trigger='revealed']"),function(e){maybeReveal(e)})}},200)}}function maybeReveal(t){if(!hasAttribute(t,"data-hx-revealed")&&isScrolledIntoView(t)){t.setAttribute("data-hx-revealed","true");var e=getInternalData(t);if(e.initHash){triggerEvent(t,"revealed")}else{t.addEventListener("htmx:afterProcessNode",function(e){triggerEvent(t,"revealed")},{once:true})}}}function processWebSocketInfo(e,t,r){var n=splitOnWhitespace(r);for(var i=0;i=0){var t=getWebSocketReconnectDelay(n);setTimeout(function(){ensureWebSocket(o,r,n+1)},t)}};t.onopen=function(e){n=0};getInternalData(o).webSocket=t;t.addEventListener("message",function(e){if(maybeCloseWebSocketSource(o)){return}var t=e.data;withExtensions(o,function(e){t=e.transformResponse(t,null,o)});var r=makeSettleInfo(o);var n=makeFragment(t);var i=toArray(n.children);for(var a=0;a0){triggerEvent(u,"htmx:validation:halted",i);return}t.send(JSON.stringify(l));if(shouldCancel(e,u)){e.preventDefault()}})}else{triggerErrorEvent(u,"htmx:noWebSocketSourceError")}}function getWebSocketReconnectDelay(e){var t=htmx.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()}logError('htmx.config.wsReconnectDelay must either be a function or the string "full-jitter"')}function processSSEInfo(e,t,r){var n=splitOnWhitespace(r);for(var i=0;i0){var s=n.shift();var o=s.match(/^\s*([a-zA-Z:\-\.]+:)(.*)/);if(a===0&&o){s.split(":");i=o[1].slice(0,-1);r[i]=o[2]}else{r[i]+=s}a+=countCurlies(s)}for(var l in r){addHxOnEventHandler(e,l,r[l])}}}function processHxOnWildcard(t){deInitOnHandlers(t);for(var e=0;ehtmx.config.historyCacheSize){i.shift()}while(i.length>0){try{localStorage.setItem("htmx-history-cache",JSON.stringify(i));break}catch(e){triggerErrorEvent(getDocument().body,"htmx:historyCacheError",{cause:e,cache:i});i.shift()}}}function getCachedHistory(e){if(!canAccessLocalStorage()){return null}e=normalizePath(e);var t=parseJSON(localStorage.getItem("htmx-history-cache"))||[];for(var r=0;r=200&&this.status<400){triggerEvent(getDocument().body,"htmx:historyCacheMissLoad",s);var e=makeFragment(this.response);e=e.querySelector("[hx-history-elt],[data-hx-history-elt]")||e;var t=getHistoryElement();var r=makeSettleInfo(t);var n=findTitle(this.response);if(n){var i=find("title");if(i){i.innerHTML=n}else{window.document.title=n}}swapInnerHTML(t,e,r);settleImmediately(r.tasks);currentPathForHistory=a;triggerEvent(getDocument().body,"htmx:historyRestore",{path:a,cacheMiss:true,serverResponse:this.response})}else{triggerErrorEvent(getDocument().body,"htmx:historyCacheMissLoadError",s)}};e.send()}function restoreHistory(e){saveCurrentPageToHistory();e=e||location.pathname+location.search;var t=getCachedHistory(e);if(t){var r=makeFragment(t.content);var n=getHistoryElement();var i=makeSettleInfo(n);swapInnerHTML(n,r,i);settleImmediately(i.tasks);document.title=t.title;setTimeout(function(){window.scrollTo(0,t.scroll)},0);currentPathForHistory=e;triggerEvent(getDocument().body,"htmx:historyRestore",{path:e,item:t})}else{if(htmx.config.refreshOnHistoryMiss){window.location.reload(true)}else{loadHistoryFromServer(e)}}}function addRequestIndicatorClasses(e){var t=findAttributeTargets(e,"hx-indicator");if(t==null){t=[e]}forEach(t,function(e){var t=getInternalData(e);t.requestCount=(t.requestCount||0)+1;e.classList["add"].call(e.classList,htmx.config.requestClass)});return t}function disableElements(e){var t=findAttributeTargets(e,"hx-disabled-elt");if(t==null){t=[]}forEach(t,function(e){var t=getInternalData(e);t.requestCount=(t.requestCount||0)+1;e.setAttribute("disabled","")});return t}function removeRequestIndicators(e,t){forEach(e,function(e){var t=getInternalData(e);t.requestCount=(t.requestCount||0)-1;if(t.requestCount===0){e.classList["remove"].call(e.classList,htmx.config.requestClass)}});forEach(t,function(e){var t=getInternalData(e);t.requestCount=(t.requestCount||0)-1;if(t.requestCount===0){e.removeAttribute("disabled")}})}function haveSeenNode(e,t){for(var r=0;r=0}function getSwapSpecification(e,t){var r=t?t:getClosestAttributeValue(e,"hx-swap");var n={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)){n["show"]="top"}if(r){var i=splitOnWhitespace(r);if(i.length>0){for(var a=0;a0?l.join(":"):null;n["scroll"]=u;n["scrollTarget"]=c}else if(s.indexOf("show:")===0){var f=s.substr(5);var l=f.split(":");var h=l.pop();var c=l.length>0?l.join(":"):null;n["show"]=h;n["showTarget"]=c}else if(s.indexOf("focus-scroll:")===0){var p=s.substr("focus-scroll:".length);n["focusScroll"]=p=="true"}else if(a==0){n["swapStyle"]=s}else{logError("Unknown modifier in hx-swap: "+s)}}}}return n}function usesFormData(e){return getClosestAttributeValue(e,"hx-encoding")==="multipart/form-data"||matches(e,"form")&&getRawAttribute(e,"enctype")==="multipart/form-data"}function encodeParamsForBody(t,r,n){var i=null;withExtensions(r,function(e){if(i==null){i=e.encodeParameters(t,n,r)}});if(i!=null){return i}else{if(usesFormData(r)){return makeFormData(n)}else{return urlEncode(n)}}}function makeSettleInfo(e){return{tasks:[],elts:[e]}}function updateScrollState(e,t){var r=e[0];var n=e[e.length-1];if(t.scroll){var i=null;if(t.scrollTarget){i=querySelectorExt(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=querySelectorExt(r,a)}if(t.show==="top"&&(r||i)){i=i||r;i.scrollIntoView({block:"start",behavior:htmx.config.scrollBehavior})}if(t.show==="bottom"&&(n||i)){i=i||n;i.scrollIntoView({block:"end",behavior:htmx.config.scrollBehavior})}}}function getValuesForElement(e,t,r,n){if(n==null){n={}}if(e==null){return n}var i=getAttributeValue(e,t);if(i){var a=i.trim();var s=r;if(a==="unset"){return null}if(a.indexOf("javascript:")===0){a=a.substr(11);s=true}else if(a.indexOf("js:")===0){a=a.substr(3);s=true}if(a.indexOf("{")!==0){a="{"+a+"}"}var o;if(s){o=maybeEval(e,function(){return Function("return ("+a+")")()},{})}else{o=parseJSON(a)}for(var l in o){if(o.hasOwnProperty(l)){if(n[l]==null){n[l]=o[l]}}}}return getValuesForElement(parentElt(e),t,r,n)}function maybeEval(e,t,r){if(htmx.config.allowEval){return t()}else{triggerErrorEvent(e,"htmx:evalDisallowedError");return r}}function getHXVarsForElement(e,t){return getValuesForElement(e,"hx-vars",true,t)}function getHXValsForElement(e,t){return getValuesForElement(e,"hx-vals",false,t)}function getExpressionVars(e){return mergeObjects(getHXVarsForElement(e),getHXValsForElement(e))}function safelySetHeaderValue(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 getPathFromResponse(t){if(t.responseURL&&typeof URL!=="undefined"){try{var e=new URL(t.responseURL);return e.pathname+e.search}catch(e){triggerErrorEvent(getDocument().body,"htmx:badResponseUrl",{url:t.responseURL})}}}function hasHeader(e,t){return e.getAllResponseHeaders().match(t)}function ajaxHelper(e,t,r){e=e.toLowerCase();if(r){if(r instanceof Element||isType(r,"String")){return issueAjaxRequest(e,t,null,null,{targetOverride:resolveTarget(r),returnPromise:true})}else{return issueAjaxRequest(e,t,resolveTarget(r.source),r.event,{handler:r.handler,headers:r.headers,values:r.values,targetOverride:resolveTarget(r.target),swapOverride:r.swap,select:r.select,returnPromise:true})}}else{return issueAjaxRequest(e,t,null,null,{returnPromise:true})}}function hierarchyForElt(e){var t=[];while(e){t.push(e);e=e.parentElement}return t}function verifyPath(e,t,r){var n;var i;if(typeof URL==="function"){i=new URL(t,document.location.href);var a=document.location.origin;n=a===i.origin}else{i=t;n=startsWith(t,document.location.origin)}if(htmx.config.selfRequestsOnly){if(!n){return false}}return triggerEvent(e,"htmx:validateUrl",mergeObjects({url:i,sameHost:n},r))}function issueAjaxRequest(t,r,n,i,a,e){var s=null;var o=null;a=a!=null?a:{};if(a.returnPromise&&typeof Promise!=="undefined"){var l=new Promise(function(e,t){s=e;o=t})}if(n==null){n=getDocument().body}var D=a.handler||handleAjaxResponse;var M=a.select||null;if(!bodyContains(n)){maybeCall(s);return l}var u=a.targetOverride||getTarget(n);if(u==null||u==DUMMY_ELT){triggerErrorEvent(n,"htmx:targetError",{target:getAttributeValue(n,"hx-target")});maybeCall(o);return l}var c=getInternalData(n);var f=c.lastButtonClicked;if(f){var h=getRawAttribute(f,"formaction");if(h!=null){r=h}var p=getRawAttribute(f,"formmethod");if(p!=null){if(p.toLowerCase()!=="dialog"){t=p}}}var d=getClosestAttributeValue(n,"hx-confirm");if(e===undefined){var B=function(e){return issueAjaxRequest(t,r,n,i,a,!!e)};var F={target:u,elt:n,path:r,verb:t,triggeringEvent:i,etc:a,issueRequest:B,question:d};if(triggerEvent(n,"htmx:confirm",F)===false){maybeCall(s);return l}}var g=n;var m=getClosestAttributeValue(n,"hx-sync");var v=null;var y=false;if(m){var q=m.split(":");var V=q[0].trim();if(V==="this"){g=findThisElement(n,"hx-sync")}else{g=querySelectorExt(n,V)}m=(q[1]||"drop").trim();c=getInternalData(g);if(m==="drop"&&c.xhr&&c.abortable!==true){maybeCall(s);return l}else if(m==="abort"){if(c.xhr){maybeCall(s);return l}else{y=true}}else if(m==="replace"){triggerEvent(g,"htmx:abort")}else if(m.indexOf("queue")===0){var $=m.split(" ");v=($[1]||"last").trim()}}if(c.xhr){if(c.abortable){triggerEvent(g,"htmx:abort")}else{if(v==null){if(i){var b=getInternalData(i);if(b&&b.triggerSpec&&b.triggerSpec.queue){v=b.triggerSpec.queue}}if(v==null){v="last"}}if(c.queuedRequests==null){c.queuedRequests=[]}if(v==="first"&&c.queuedRequests.length===0){c.queuedRequests.push(function(){issueAjaxRequest(t,r,n,i,a)})}else if(v==="all"){c.queuedRequests.push(function(){issueAjaxRequest(t,r,n,i,a)})}else if(v==="last"){c.queuedRequests=[];c.queuedRequests.push(function(){issueAjaxRequest(t,r,n,i,a)})}maybeCall(s);return l}}var E=new XMLHttpRequest;c.xhr=E;c.abortable=y;var S=function(){c.xhr=null;c.abortable=false;if(c.queuedRequests!=null&&c.queuedRequests.length>0){var e=c.queuedRequests.shift();e()}};var j=getClosestAttributeValue(n,"hx-prompt");if(j){var x=prompt(j);if(x===null||!triggerEvent(n,"htmx:prompt",{prompt:x,target:u})){maybeCall(s);S();return l}}if(d&&!e){if(!confirm(d)){maybeCall(s);S();return l}}var k=getHeaders(n,u,x);if(t!=="get"&&!usesFormData(n)){k["Content-Type"]="application/x-www-form-urlencoded"}if(a.headers){k=mergeObjects(k,a.headers)}var U=getInputValues(n,t);var w=U.errors;var C=U.values;if(a.values){C=mergeObjects(C,a.values)}var W=getExpressionVars(n);var X=mergeObjects(C,W);var A=filterValues(X,n);if(htmx.config.getCacheBusterParam&&t==="get"){A["org.htmx.cache-buster"]=getRawAttribute(u,"id")||"true"}if(r==null||r===""){r=getDocument().location.href}var P=getValuesForElement(n,"hx-request");var z=getInternalData(n).boosted;var _=htmx.config.methodsThatUseUrlParams.indexOf(t)>=0;var I={boosted:z,useUrlParams:_,parameters:A,unfilteredParameters:X,headers:k,target:u,verb:t,errors:w,withCredentials:a.credentials||P.credentials||htmx.config.withCredentials,timeout:a.timeout||P.timeout||htmx.config.timeout,path:r,triggeringEvent:i};if(!triggerEvent(n,"htmx:configRequest",I)){maybeCall(s);S();return l}r=I.path;t=I.verb;k=I.headers;A=I.parameters;w=I.errors;_=I.useUrlParams;if(w&&w.length>0){triggerEvent(n,"htmx:validation:halted",I);maybeCall(s);S();return l}var K=r.split("#");var J=K[0];var O=K[1];var T=r;if(_){T=J;var G=Object.keys(A).length!==0;if(G){if(T.indexOf("?")<0){T+="?"}else{T+="&"}T+=urlEncode(A);if(O){T+="#"+O}}}if(!verifyPath(n,T,I)){triggerErrorEvent(n,"htmx:invalidPath",I);maybeCall(o);return l}E.open(t.toUpperCase(),T,true);E.overrideMimeType("text/html");E.withCredentials=I.withCredentials;E.timeout=I.timeout;if(P.noHeaders){}else{for(var H in k){if(k.hasOwnProperty(H)){var Y=k[H];safelySetHeaderValue(E,H,Y)}}}var L={xhr:E,target:u,requestConfig:I,etc:a,boosted:z,select:M,pathInfo:{requestPath:r,finalRequestPath:T,anchor:O}};E.onload=function(){try{var e=hierarchyForElt(n);L.pathInfo.responsePath=getPathFromResponse(E);D(n,L);removeRequestIndicators(R,N);triggerEvent(n,"htmx:afterRequest",L);triggerEvent(n,"htmx:afterOnLoad",L);if(!bodyContains(n)){var t=null;while(e.length>0&&t==null){var r=e.shift();if(bodyContains(r)){t=r}}if(t){triggerEvent(t,"htmx:afterRequest",L);triggerEvent(t,"htmx:afterOnLoad",L)}}maybeCall(s);S()}catch(e){triggerErrorEvent(n,"htmx:onLoadError",mergeObjects({error:e},L));throw e}};E.onerror=function(){removeRequestIndicators(R,N);triggerErrorEvent(n,"htmx:afterRequest",L);triggerErrorEvent(n,"htmx:sendError",L);maybeCall(o);S()};E.onabort=function(){removeRequestIndicators(R,N);triggerErrorEvent(n,"htmx:afterRequest",L);triggerErrorEvent(n,"htmx:sendAbort",L);maybeCall(o);S()};E.ontimeout=function(){removeRequestIndicators(R,N);triggerErrorEvent(n,"htmx:afterRequest",L);triggerErrorEvent(n,"htmx:timeout",L);maybeCall(o);S()};if(!triggerEvent(n,"htmx:beforeRequest",L)){maybeCall(s);S();return l}var R=addRequestIndicatorClasses(n);var N=disableElements(n);forEach(["loadstart","loadend","progress","abort"],function(t){forEach([E,E.upload],function(e){e.addEventListener(t,function(e){triggerEvent(n,"htmx:xhr:"+t,{lengthComputable:e.lengthComputable,loaded:e.loaded,total:e.total})})})});triggerEvent(n,"htmx:beforeSend",L);var Z=_?null:encodeParamsForBody(E,n,A);E.send(Z);return l}function determineHistoryUpdates(e,t){var r=t.xhr;var n=null;var i=null;if(hasHeader(r,/HX-Push:/i)){n=r.getResponseHeader("HX-Push");i="push"}else if(hasHeader(r,/HX-Push-Url:/i)){n=r.getResponseHeader("HX-Push-Url");i="push"}else if(hasHeader(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 s=t.pathInfo.responsePath;var o=getClosestAttributeValue(e,"hx-push-url");var l=getClosestAttributeValue(e,"hx-replace-url");var u=getInternalData(e).boosted;var c=null;var f=null;if(o){c="push";f=o}else if(l){c="replace";f=l}else if(u){c="push";f=s||a}if(f){if(f==="false"){return{}}if(f==="true"){f=s||a}if(t.pathInfo.anchor&&f.indexOf("#")===-1){f=f+"#"+t.pathInfo.anchor}return{type:c,path:f}}else{return{}}}function handleAjaxResponse(l,u){var c=u.xhr;var f=u.target;var e=u.etc;var t=u.requestConfig;var h=u.select;if(!triggerEvent(l,"htmx:beforeOnLoad",u))return;if(hasHeader(c,/HX-Trigger:/i)){handleTrigger(c,"HX-Trigger",l)}if(hasHeader(c,/HX-Location:/i)){saveCurrentPageToHistory();var r=c.getResponseHeader("HX-Location");var p;if(r.indexOf("{")===0){p=parseJSON(r);r=p["path"];delete p["path"]}ajaxHelper("GET",r,p).then(function(){pushUrlIntoHistory(r)});return}var n=hasHeader(c,/HX-Refresh:/i)&&"true"===c.getResponseHeader("HX-Refresh");if(hasHeader(c,/HX-Redirect:/i)){location.href=c.getResponseHeader("HX-Redirect");n&&location.reload();return}if(n){location.reload();return}if(hasHeader(c,/HX-Retarget:/i)){u.target=getDocument().querySelector(c.getResponseHeader("HX-Retarget"))}var d=determineHistoryUpdates(l,u);var i=c.status>=200&&c.status<400&&c.status!==204;var g=c.response;var a=c.status>=400;var m=htmx.config.ignoreTitle;var s=mergeObjects({shouldSwap:i,serverResponse:g,isError:a,ignoreTitle:m},u);if(!triggerEvent(f,"htmx:beforeSwap",s))return;f=s.target;g=s.serverResponse;a=s.isError;m=s.ignoreTitle;u.target=f;u.failed=a;u.successful=!a;if(s.shouldSwap){if(c.status===286){cancelPolling(l)}withExtensions(l,function(e){g=e.transformResponse(g,c,l)});if(d.type){saveCurrentPageToHistory()}var o=e.swapOverride;if(hasHeader(c,/HX-Reswap:/i)){o=c.getResponseHeader("HX-Reswap")}var p=getSwapSpecification(l,o);if(p.hasOwnProperty("ignoreTitle")){m=p.ignoreTitle}f.classList.add(htmx.config.swappingClass);var v=null;var y=null;var b=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 r;if(h){r=h}if(hasHeader(c,/HX-Reselect:/i)){r=c.getResponseHeader("HX-Reselect")}if(d.type){triggerEvent(getDocument().body,"htmx:beforeHistoryUpdate",mergeObjects({history:d},u));if(d.type==="push"){pushUrlIntoHistory(d.path);triggerEvent(getDocument().body,"htmx:pushedIntoHistory",{path:d.path})}else{replaceUrlInHistory(d.path);triggerEvent(getDocument().body,"htmx:replacedInHistory",{path:d.path})}}var n=makeSettleInfo(f);selectAndSwap(p.swapStyle,f,l,g,n,r);if(t.elt&&!bodyContains(t.elt)&&getRawAttribute(t.elt,"id")){var i=document.getElementById(getRawAttribute(t.elt,"id"));var a={preventScroll:p.focusScroll!==undefined?!p.focusScroll:!htmx.config.defaultFocusScroll};if(i){if(t.start&&i.setSelectionRange){try{i.setSelectionRange(t.start,t.end)}catch(e){}}i.focus(a)}}f.classList.remove(htmx.config.swappingClass);forEach(n.elts,function(e){if(e.classList){e.classList.add(htmx.config.settlingClass)}triggerEvent(e,"htmx:afterSwap",u)});if(hasHeader(c,/HX-Trigger-After-Swap:/i)){var s=l;if(!bodyContains(l)){s=getDocument().body}handleTrigger(c,"HX-Trigger-After-Swap",s)}var o=function(){forEach(n.tasks,function(e){e.call()});forEach(n.elts,function(e){if(e.classList){e.classList.remove(htmx.config.settlingClass)}triggerEvent(e,"htmx:afterSettle",u)});if(u.pathInfo.anchor){var e=getDocument().getElementById(u.pathInfo.anchor);if(e){e.scrollIntoView({block:"start",behavior:"auto"})}}if(n.title&&!m){var t=find("title");if(t){t.innerHTML=n.title}else{window.document.title=n.title}}updateScrollState(n.elts,p);if(hasHeader(c,/HX-Trigger-After-Settle:/i)){var r=l;if(!bodyContains(l)){r=getDocument().body}handleTrigger(c,"HX-Trigger-After-Settle",r)}maybeCall(v)};if(p.settleDelay>0){setTimeout(o,p.settleDelay)}else{o()}}catch(e){triggerErrorEvent(l,"htmx:swapError",u);maybeCall(y);throw e}};var E=htmx.config.globalViewTransitions;if(p.hasOwnProperty("transition")){E=p.transition}if(E&&triggerEvent(l,"htmx:beforeTransition",u)&&typeof Promise!=="undefined"&&document.startViewTransition){var S=new Promise(function(e,t){v=e;y=t});var x=b;b=function(){document.startViewTransition(function(){x();return S})}}if(p.swapDelay>0){setTimeout(b,p.swapDelay)}else{b()}}if(a){triggerErrorEvent(l,"htmx:responseError",mergeObjects({error:"Response Status Error Code "+c.status+" from "+u.pathInfo.requestPath},u))}}var extensions={};function extensionBase(){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 defineExtension(e,t){if(t.init){t.init(internalAPI)}extensions[e]=mergeObjects(extensionBase(),t)}function removeExtension(e){delete extensions[e]}function getExtensions(e,r,n){if(e==undefined){return r}if(r==undefined){r=[]}if(n==undefined){n=[]}var t=getAttributeValue(e,"hx-ext");if(t){forEach(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=extensions[e];if(t&&r.indexOf(t)<0){r.push(t)}}})}return getExtensions(parentElt(e),r,n)}function ready(e){var t=function(){if(!e)return;e();e=null};if(getDocument().readyState==="complete"){t()}else{getDocument().addEventListener("DOMContentLoaded",function(){t()});getDocument().addEventListener("readystatechange",function(){if(getDocument().readyState!=="complete")return;t()})}}function insertIndicatorStyles(){if(htmx.config.includeIndicatorStyles!==false){getDocument().head.insertAdjacentHTML("beforeend","")}}function getMetaConfig(){var e=getDocument().querySelector('meta[name="htmx-config"]');if(e){return parseJSON(e.content)}else{return null}}function mergeMetaConfig(){var e=getMetaConfig();if(e){htmx.config=mergeObjects(htmx.config,e)}}ready(function(){mergeMetaConfig();insertIndicatorStyles();var e=getDocument().body;processNode(e);var t=getDocument().querySelectorAll("[hx-trigger='restored'],[data-hx-trigger='restored']");e.addEventListener("htmx:abort",function(e){var t=e.target;var r=getInternalData(t);if(r&&r.xhr){r.xhr.abort()}});var r=window.onpopstate;window.onpopstate=function(e){if(e.state&&e.state.htmx){restoreHistory();forEach(t,function(e){triggerEvent(e,"htmx:restored",{document:getDocument(),triggerEvent:triggerEvent})})}else{if(r){r(e)}}};setTimeout(function(){triggerEvent(e,"htmx:load",{});e=null},0)});return htmx}()}); /**! @preserve FlowPlater starts here */var FlowPlater=function(){;"use strict";if(typeof Handlebars==="undefined"){throw new Error("FlowPlater requires Handlebars. Get it at https://handlebarsjs.com/")}if(typeof htmx==="undefined"){throw new Error("FlowPlater requires htmx. Get it at https://htmx.org/")}document.body.addEventListener("htmx:configRequest",function(e){e.detail.headers="";e.detail.headers["Content-Type"]="application/x-www-form-urlencoded; charset=UTF-8"});var h={};var c={};var f=0;var p={onRender:function(){},onRendered:function(){},onRemove:function(){},onRemoved:function(){},animation:false,debug:true};document.querySelectorAll("[fp-template]").forEach(function(e){var t=e.getAttribute("fp-animation")||p.animation;if(t==="true"){var r=e.getAttribute("hx-swap");if(!r){e.setAttribute("hx-swap","innerHTML transition:true")}else{e.setAttribute("hx-swap",r+" transition:true")}}});document.querySelectorAll("[fp-proxy]").forEach(function(r){if(r.getAttribute("fp-proxy")==="false"){return}if(r.getAttribute("fp-proxy").startsWith("http")){var n=r.getAttribute("fp-proxy")}else{var n="https://corsproxy.io/?"}var e=["get","post","put","patch","delete"];e.forEach(function(e){if(r.hasAttribute("hx-"+e)){var t=r.getAttribute("hx-"+e);r.setAttribute("hx-"+e,n+encodeURIComponent(t))}else if(r.hasAttribute("fp-"+e)){var t=r.getAttribute("fp-"+e);r.setAttribute("hx-"+e,n+encodeURIComponent(t))}})});const t=["boost","get","post","on","push-url","select","select-oob","swap","swap-oob","target","trigger","vals","confirm","delete","disable","disabled-elt","disinherit","encoding","ext","headers","history","history-elt","include","indicator","params","patch","preserve","prompt","put","replace-url","request","sync","validate","vars"];function r(e){const n="fp-";const i="hx-";e.querySelectorAll("*").forEach(r=>{t.forEach(e=>{const t=n+e;if(r.hasAttribute(t)){r.setAttribute(i+e,r.getAttribute(t));r.removeAttribute(t)}})})}const n=t.map(e=>`[fp-${e}]`).join(",");document.querySelectorAll(n).forEach(e=>{r(e);htmx.process(e)});function i(e=document){e.querySelectorAll("[hx-trigger=load]").forEach(e=>{htmx.process(e)})}document.addEventListener("htmx:load",function(e){if(e.detail.elt.querySelector(n)){r(e.detail.elt);i(e.detail.elt)}});function e(e,t){var r=e.getAttribute("fp-animation")||p.animation;if(!r){t();return}else{var n=document.startViewTransition(e);t()}}function d(e,t,r=document){var n;if(document.createEvent){n=document.createEvent("HTMLEvents");n.initEvent("flowplater:"+e,true,true);n.eventName="flowplater:"+e;n.detail=t;r.dispatchEvent(n)}else{n=document.createEventObject();n.eventName="flowplater:"+e;n.eventType="flowplater:"+e;n.detail=t;r.fireEvent("on"+n.eventType,n)}document.dispatchEvent(n)}function g(e){if(p.debug){console.log("Flowplater: "+e)}}function m(e){console.error("%cFlowPlater:%c "+e,"font-weight: bold","font-weight: normal")}document.addEventListener("htmx:beforeRequest",function(e){var t=e.detail.elt;if(t.hasAttribute("fp-instance")){var r=t.getAttribute("fp-instance");d("request-start",{instanceName:r,...e.detail})}});document.addEventListener("htmx:afterRequest",function(e){var t=e.detail.elt;if(t.hasAttribute("fp-instance")){var r=t.getAttribute("fp-instance");d("request-end",{instanceName:r,...e.detail})}});function v(e){var t=document.querySelector(e);if(!t){m("Template not found: "+e);return null}if(!h[e]&&t.hasAttribute("fp-dynamic")&&t.getAttribute("fp-dynamic")!="false"){function u(t){const e=t.tagName.toLowerCase();let r="";for(let e of t.attributes){r+=` ${e.name}="${e.value}"`}return`<${e}${r}>`}function c(e){const t=/(>=|<=|==|!=|&&|\|\||>|<)/g;return e.replace(t,' "$1" ')}function f(e){let l="";e.childNodes.forEach(e=>{if(e.nodeType===Node.TEXT_NODE){l+=e.textContent}else if(e.nodeType===Node.ELEMENT_NODE){if(e.hasAttribute("fp")){const t=e.tagName.toLowerCase();const r=e.getAttribute("fp").split(" ").map(e=>{return e.replace(/"/g,'"')}).join(" ");const n=f(e);if(t==="log"||t==="lookup"||t==="execute"){if(n){console.warn(`FlowPlater: The <${t}> helper does not accept inner content.`)}l+=`{{#${t} ${r}}}`}else if(t==="comment"){l+=`{{!-- ${r} --}}`}else if(t==="if"){const i=c(r);l+=`{{#${t} ${i}}}${n}{{/${t}}}`}else if(t==="else"){l+=`{{#${t} ${r}}}${n}`}else if(t==="math"){if(n){console.warn(`FlowPlater: The <${t}> helper does not accept inner content.`)}l+=`{{#${t} "${r}"}}`}else{l+=`{{#${t} ${r}}}${n}{{/${t}}}`}}else if(e.tagName==="else"){const n=f(e);l+=`{{#${e.tagName.toLowerCase()}}}${n}`}else{const a=f(e);const s=u(e);const o=``;l+=`${s}${a}${o}`}}});return l}const r=f(t);g("Compiling Handlebars template: "+r);try{h[e]=Handlebars.compile(r);return h[e]}catch(e){m("Template not valid: "+r+" | Error: "+e.message);return null}}return h[e]}function u({template:n,data:e,target:t,returnHtml:r,onRender:i=p.onRender,onRendered:a=p.onRendered,instanceName:s}){d("render",{instanceName:s,template:n,data:e,target:t,returnHtml:r});g("Rendering instance: "+s,n,e,t);var o;if(typeof t==="string"){o=document.querySelectorAll(t)}else if(typeof t==="object"&&t.jquery){o=t.toArray()}else if(typeof t==="object"){o=t}else{m("Invalid target type: "+typeof t);return}if(o.length===undefined){o=[o]}if(s){s=s}else if(o[0].hasAttribute("fp-instance")){s=o[0].getAttribute("fp-instance")}else if(o[0].id){s=o[0].id}else{s=f}o.forEach(function(e){i.call(e)});if(!h[n]){v(n);f++}var n=h[n];if(!n){m("Template not found: "+n);return}if(o.length===0){m("Target not found: "+t);return}if(!c[s]||c[s].data!==e){var l=new Proxy(e,{set:function(t,e,r){t[e]=r;o.forEach(function(e){e.innerHTML=n(t)});return true}});c[s]={elements:o,template:n,proxy:l,data:e,...k(s)}}g("Proxy created: ",c[s].proxy);if(r){try{var u=n(c[s].proxy);o.forEach(function(e){a.call(e)});d("rendered",{instance:s,template:n,data:e,target:t,elements:o,returnHtml:r,html:u});g("Rendered HTML: "+u);return u}catch(e){m("Error rendering template: "+e.message)}}else{try{o.forEach(function(e){e.innerHTML=n(c[s].proxy);a.call(e)});d("rendered",{instance:s,template:n,data:e,target:t,elements:o,returnHtml:r});g("Rendered instance: "+s,n,e,t);return c[s]}catch(e){m("Error rendering template: "+e.message)}}}function y(e){function l(e){var t={};if(e.attributes){for(var r=0;rtypeof e==="object"?"":e).join(" ").trim();const r={"||":1,"&&":2,"==":3,"!=":3,"<":4,">":4,"<=":4,">=":4,regex:5};const n=t.match(/(?:[a-zA-Z_][a-zA-Z0-9_\.]*|\(|\)|&&|\|\||==|!=|<=|>=|<|>|regex|\b\S+\b)/g).map(e=>{if(/^[a-zA-Z_][a-zA-Z0-9_\.]*$/.test(e)){return e.split(".").reduce((e,t)=>e[t],this)}else{return e}});const i=[],a=[];n.forEach(e=>{if(r.hasOwnProperty(e)){while(a.length>0&&r[a[a.length-1]]>=r[e]){i.push(a.pop())}a.push(e)}else if(e==="("){a.push(e)}else if(e===")"){while(a.length>0&&a[a.length-1]!=="("){i.push(a.pop())}if(a.length===0||a.pop()!=="("){throw new Error("Mismatched parentheses in helper")}}else{i.push(e)}});while(a.length>0){const o=a.pop();if(o==="("||o===")"){throw new Error("Mismatched parentheses in helper")}i.push(o)}const s=[];i.forEach(e=>{if(r.hasOwnProperty(e)){if(s.length<2){throw new Error("Missing operand in helper")}s.push(compare(s.pop(),e,s.pop()))}else{s.push(e)}});if(s.length!==1){throw new Error("Missing operator in helper")}return s.pop()?e.fn(this):e.inverse(this)},each:function(e,t){var r="";var n=t.hash.limit;var i=t.hash.startAt;var a=t.hash.sortBy;var s=t.hash.descending;var o=t.hash.sortBeforeLimit;var l=t.inverse;var u=t.fn;var c;var f;o=typeof o==="boolean"?o:true;if(t.data&&t.ids){f=Handlebars.Utils.appendContextPath(t.data.contextPath,t.ids[0])+"."}if(Handlebars.Utils.isFunction(e)){e=e.call(this)}if(t.data){c=Handlebars.createFrame(t.data)}if(!Array.isArray(e)&&typeof e!=="object"){return l(this)}var h=Array.isArray(e)?e.slice():Object.entries(e);if(o){h.sort(S(a,s));h=h.slice(i,n)}else{h=h.slice(i,n);h.sort(S(a,s))}for(var p=0;p{if(/^[a-zA-Z_][a-zA-Z0-9_]*(\.[a-zA-Z0-9_]+)+$/.test(e)){return e.split(".").reduce((e,t)=>e[t],t.data.root)}return e});const i=[];const a=[];r.forEach(e=>{if(e in n){while(a.length>0&&n[a[a.length-1]]<=n[e]){i.push(a.pop())}a.push(e)}else if(e==="("){a.push(e)}else if(e===")"){while(a.length>0&&a[a.length-1]!=="("){i.push(a.pop())}if(a.pop()!=="("){throw new Error("Mismatched parentheses")}}else{i.push(e)}});while(a.length>0){if(["(",")"].includes(a[a.length-1])){throw new Error("Mismatched parentheses")}i.push(a.pop())}const s=[];i.forEach(e=>{if(e in n){const t=s.pop();const r=s.pop();if(r===undefined||t===undefined){throw new Error("Missing operand")}s.push(x(r,e,t))}else{s.push(parseFloat(e))}});if(s.length!==1){throw new Error("Invalid expression")}return s.pop()}});function S(i,a){return function(e,t){var r=i&&e[i]?e[i]:e;var n=i&&t[i]?t[i]:t;if(rn){return a?-1:1}return 0}}function x(e,t,r){if(typeof e!=="number"||typeof r!=="number"){throw new Error("Invalid operands")}if(r===0&&t==="/"){throw new Error("Division by zero")}switch(t){case"+":return e+r;case"-":return e-r;case"*":return e*r;case"/":return e/r;case"^":return Math.pow(e,r);case"%":return e%r;default:throw new Error("Invalid operator")}}var k=function(e){return{refresh:function(){s(e)},render:function({template:e=this.template,data:t=this.data,target:r=this.elements,returnHtml:n=false,onRender:i=p.onRender,onRendered:a=p.onRendered,animate:s=p.animate}){s(r,function(){u({template:e,data:t,target:r,returnHtml:n,onRender:i,onRendered:a,animate:s})})}}};return{compileTemplate:v,render:u,refresh:s,getInstance:function(e){return c[e]},getInstances:function(){return c},options:function(e){for(var t in e){p[t]=e[t]}},registerHelper:o,unregisterHelper:l,SafeString:b,escapeExpression:E,init:function(){i()}}}();