werkmeister 0.87.2 → 0.87.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist/budget-BLK2WAB7.js +4 -0
  2. package/dist/cache-HYS5M4AY.js +4 -0
  3. package/dist/chunk-22YIK2BP.js +40 -0
  4. package/dist/chunk-2IE5JCIK.js +4 -0
  5. package/dist/chunk-47HAXWC4.js +4 -0
  6. package/dist/chunk-7D4A3HVZ.js +5 -0
  7. package/dist/chunk-7I5GWJOR.js +45 -0
  8. package/dist/chunk-7YUHPLUW.js +5 -0
  9. package/dist/chunk-A5QL5RDB.js +4 -0
  10. package/dist/chunk-AEDQ3BHS.js +24 -0
  11. package/dist/chunk-ANDUBI2O.js +23 -0
  12. package/dist/chunk-ATYTAZNX.js +4 -0
  13. package/dist/chunk-AXXV337U.js +18 -0
  14. package/dist/chunk-C4J3VWL3.js +26 -0
  15. package/dist/chunk-CBTQBN4M.js +110 -0
  16. package/dist/chunk-CVIURF6M.js +180 -0
  17. package/dist/chunk-CVK35MQA.js +4 -0
  18. package/dist/chunk-CVMWX5W5.js +146 -0
  19. package/dist/chunk-DL73WFKY.js +4 -0
  20. package/dist/chunk-DMZPGI56.js +13 -0
  21. package/dist/chunk-DNDCV7NJ.js +6 -0
  22. package/dist/chunk-EHWLRQV7.js +410 -0
  23. package/dist/chunk-EOBOW6TP.js +48 -0
  24. package/dist/chunk-FUA5NLXY.js +57 -0
  25. package/dist/chunk-GMROWN6L.js +10 -0
  26. package/dist/chunk-GMYAKGU2.js +4 -0
  27. package/dist/chunk-GUFHPPBN.js +4 -0
  28. package/dist/chunk-H3J3PJGY.js +7 -0
  29. package/dist/chunk-HKKHKLTS.js +11 -0
  30. package/dist/chunk-I3QYJM3C.js +4 -0
  31. package/dist/chunk-I7X6WZIM.js +4 -0
  32. package/dist/chunk-IFSWSRJW.js +5 -0
  33. package/dist/chunk-JPAIPFJZ.js +6 -0
  34. package/dist/chunk-JYCKRH6K.js +68 -0
  35. package/dist/chunk-K6GRVJQO.js +4 -0
  36. package/dist/chunk-N72DCINT.js +82 -0
  37. package/dist/chunk-NX6LSFJH.js +4 -0
  38. package/dist/chunk-OC7PYYEG.js +145 -0
  39. package/dist/chunk-OSW5G2B6.js +82 -0
  40. package/dist/chunk-OTPRXRNK.js +23 -0
  41. package/dist/chunk-P3NAQKV7.js +6 -0
  42. package/dist/chunk-PLREOZEU.js +4 -0
  43. package/dist/chunk-Q2CVZANF.js +42 -0
  44. package/dist/chunk-QAQMYRCU.js +4 -0
  45. package/dist/chunk-QEYZ7HOT.js +36 -0
  46. package/dist/chunk-QO5K65QU.js +5 -0
  47. package/dist/chunk-QVMMQ5JU.js +41 -0
  48. package/dist/chunk-RJQTC65O.js +33 -0
  49. package/dist/chunk-RO5NEK3B.js +4 -0
  50. package/dist/chunk-RS7NMSUP.js +4 -0
  51. package/dist/chunk-S62C4SVE.js +4 -0
  52. package/dist/chunk-SNY4QE2J.js +137 -0
  53. package/dist/chunk-SUWACJLK.js +5 -0
  54. package/dist/chunk-TCABDYVJ.js +4 -0
  55. package/dist/chunk-U4733O5I.js +13 -0
  56. package/dist/chunk-U4RIK7SI.js +15 -0
  57. package/dist/chunk-USRMIMWS.js +11 -0
  58. package/dist/chunk-UTVZKLGU.js +89 -0
  59. package/dist/chunk-UU5QPEC3.js +9 -0
  60. package/dist/chunk-VNP6M5VF.js +294 -0
  61. package/dist/chunk-WITTY5DQ.js +4 -0
  62. package/dist/chunk-X7GPCYQ7.js +4 -0
  63. package/dist/chunk-XGIW27EP.js +4 -0
  64. package/dist/chunk-XMARLDYZ.js +11 -0
  65. package/dist/chunk-XS5OH4RT.js +9 -0
  66. package/dist/chunk-YSPELKLM.js +8 -0
  67. package/dist/chunk-ZQOM25KE.js +31 -0
  68. package/dist/chunk-ZUSETSI2.js +4 -0
  69. package/dist/chunk-ZYR6KZ3U.js +4 -0
  70. package/dist/clean-XPY5QAR2.js +8 -0
  71. package/dist/close_out-3G6LG5CE.js +8 -0
  72. package/dist/code-LB6A5M22.js +4 -0
  73. package/dist/config-NTIS2QLB.js +4 -0
  74. package/dist/connect-MNBVLTKZ.js +11 -0
  75. package/dist/daemon-3A47MBS2.js +4 -0
  76. package/dist/dashboard.js +20 -1898
  77. package/dist/detect-QMRHHFXH.js +13 -0
  78. package/dist/down-WKZSBYCI.js +17 -0
  79. package/dist/fixture-OLAE2KUV.js +14 -0
  80. package/dist/form-cli.js +3 -1507
  81. package/dist/hooks-ULLFLRUW.js +4 -0
  82. package/dist/hooks_gen-GKZVUPMO.js +4 -0
  83. package/dist/infra-A3C7FDNR.js +4 -0
  84. package/dist/init_workspace-TU76APJQ.js +4 -0
  85. package/dist/intercept-SOU6VA2K.js +7 -0
  86. package/dist/issue-XC7UEFIP.js +5 -0
  87. package/dist/lib/agent_state.js +1 -6
  88. package/dist/lib/gate.js +1 -2
  89. package/dist/lib/pr_guard.js +1 -1
  90. package/dist/list_workspaces-4FBP4CIS.js +7 -0
  91. package/dist/logs-GFJHTAOE.js +6 -0
  92. package/dist/main.js +42 -1852
  93. package/dist/mcp-proxy.js +12 -229
  94. package/dist/mcp.js +30 -1930
  95. package/dist/migrate-PB3PLOPH.js +8 -0
  96. package/dist/notes-BT4GAPYP.js +4 -0
  97. package/dist/open-ZM2OEFSN.js +6 -0
  98. package/dist/optimize-2IZXOEM6.js +11 -0
  99. package/dist/pause-UPYUR576.js +4 -0
  100. package/dist/pr-UT66UXR7.js +5 -0
  101. package/dist/proxy_reload-PXGCYXTX.js +6 -0
  102. package/dist/registry-BYQSBFX2.js +4 -0
  103. package/dist/remove-E3D5UE6C.js +7 -0
  104. package/dist/remove_workspace-HH5DY2PQ.js +8 -0
  105. package/dist/restart-WACF24Q5.js +8 -0
  106. package/dist/resume-WUHWDN5P.js +8 -0
  107. package/dist/safari-LADKSYXB.js +8 -0
  108. package/dist/sandbox-KCOIOWUC.js +4 -0
  109. package/dist/services-HGBYH2BF.js +6 -0
  110. package/dist/setup-IHMHWCWE.js +5 -0
  111. package/dist/skills-AGQ43EYJ.js +4 -0
  112. package/dist/slots-FUNR4X2E.js +4 -0
  113. package/dist/standards-R42OMGAN.js +4 -0
  114. package/dist/start_args-5VUTUZJK.js +4 -0
  115. package/dist/starting_prompt-VSXMHUES.js +4 -0
  116. package/dist/stats-SBCCNRRR.js +4 -0
  117. package/dist/status-YRBJF4LX.js +13 -0
  118. package/dist/stop-UOWK5NZB.js +9 -0
  119. package/dist/telepresence-KGO67FZ6.js +4 -0
  120. package/dist/test-IGAOSBIZ.js +6 -0
  121. package/dist/tokens-2IJEBSSK.js +6 -0
  122. package/dist/up-LO6N5V5M.js +11 -0
  123. package/dist/v4-IBDIQBRV.js +4 -0
  124. package/dist/wait_load-LVY5WRZP.js +4 -0
  125. package/dist/werkmeister-workspaces.vsix +0 -0
  126. package/dist/workspace-LDQAAZM6.js +4 -0
  127. package/package.json +3 -3
@@ -0,0 +1,4 @@
1
+ import { createRequire as __sandboxCreateRequire } from "node:module";
2
+ const require = __sandboxCreateRequire(import.meta.url);
3
+ var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var p=(a,b)=>e(a,"name",{value:b,configurable:!0}),q=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var l=(a,b)=>()=>(a&&(b=a(a=0)),b);var r=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),s=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},m=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=h(b,d))||f.enumerable});return a};var t=(a,b,c)=>(c=a!=null?g(j(a)):{},m(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a));var w,o=l(()=>{w={sha:"024490d8d6cc785d6736261351529fbbd0a2500c",dirty:!1}});export{p as a,q as b,r as c,s as d,t as e,o as f,w as g};
4
+ //# sourceMappingURL=chunk-K6GRVJQO.js.map
@@ -0,0 +1,82 @@
1
+ import { createRequire as __sandboxCreateRequire } from "node:module";
2
+ const require = __sandboxCreateRequire(import.meta.url);
3
+ import{a as Er}from"./chunk-OTPRXRNK.js";import{a as yr}from"./chunk-ZUSETSI2.js";import{m as kr}from"./chunk-EOBOW6TP.js";import{d as gr}from"./chunk-CVIURF6M.js";import{b as fr}from"./chunk-22YIK2BP.js";import{i as ur}from"./chunk-S62C4SVE.js";import{D as pr,K as hr}from"./chunk-RJQTC65O.js";import{a as mr}from"./chunk-ATYTAZNX.js";import{B as vr,G as _r,H as ge,I as ct,c as $e}from"./chunk-XMARLDYZ.js";import{a as dr}from"./chunk-DNDCV7NJ.js";import{a as Te,d as Qt}from"./chunk-GUFHPPBN.js";import{f as cr}from"./chunk-C4J3VWL3.js";import{b as lr}from"./chunk-WITTY5DQ.js";import{D as it,H as Ke,I as er,K as Me,L as tr,M as st,O as rr,Q as ot,R as nr,S as ir,U as sr,V as at,X as _e,Y as or,Z as ar,_ as lt,a as $i,j as je,k as te,l as fe,s as Zt}from"./chunk-OC7PYYEG.js";import{b as Ae}from"./chunk-RO5NEK3B.js";import{a,b as Q,c as M,e as Jt,f as b}from"./chunk-K6GRVJQO.js";var ee=M((pc,Lr)=>{"use strict";b();var De=Array.prototype,Ne=Object.prototype,Di={"&":"&amp;",'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","\\":"&#92;"},qi=/[&"'<>\\]/g,j=Lr.exports={};function ut(t,n){return Ne.hasOwnProperty.call(t,n)}a(ut,"hasOwnProp");j.hasOwnProp=ut;function Ui(t){return Di[t]}a(Ui,"lookupEscape");function Vi(t,n,s){if(s.Update||(s=new j.TemplateError(s)),s.Update(t),!n){var i=s;s=new Error(i.message),s.name=i.name}return s}a(Vi,"_prettifyError");j._prettifyError=Vi;function Le(t,n,s){var i,e;t instanceof Error&&(e=t,t=e.name+": "+e.message),Object.setPrototypeOf?(i=new Error(t),Object.setPrototypeOf(i,Le.prototype)):(i=this,Object.defineProperty(i,"message",{enumerable:!1,writable:!0,value:t})),Object.defineProperty(i,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(i,this.constructor);var r;if(e){var o=Object.getOwnPropertyDescriptor(e,"stack");r=o&&(o.get||function(){return o.value}),r||(r=a(function(){return e.stack},"getStack"))}else{var l=new Error(t).stack;r=a(function(){return l},"getStack")}return Object.defineProperty(i,"stack",{get:a(function(){return r.call(i)},"get")}),Object.defineProperty(i,"cause",{value:e}),i.lineno=n,i.colno=s,i.firstUpdate=!0,i.Update=a(function(u){var f="("+(u||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?f+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(f+=" [Line "+this.lineno+"]")),f+=`
4
+ `,this.firstUpdate&&(f+=" "),this.message=f+(this.message||""),this.firstUpdate=!1,this},"Update"),i}a(Le,"TemplateError");Object.setPrototypeOf?Object.setPrototypeOf(Le.prototype,Error.prototype):Le.prototype=Object.create(Error.prototype,{constructor:{value:Le}});j.TemplateError=Le;function Gi(t){return t.replace(qi,Ui)}a(Gi,"escape");j.escape=Gi;function wr(t){return Ne.toString.call(t)==="[object Function]"}a(wr,"isFunction");j.isFunction=wr;function br(t){return Ne.toString.call(t)==="[object Array]"}a(br,"isArray");j.isArray=br;function Or(t){return Ne.toString.call(t)==="[object String]"}a(Or,"isString");j.isString=Or;function xr(t){return Ne.toString.call(t)==="[object Object]"}a(xr,"isObject");j.isObject=xr;function Wi(t){return t?typeof t=="string"?t.split("."):[t]:[]}a(Wi,"_prepareAttributeParts");function Sr(t){var n=Wi(t);return a(function(i){for(var e=i,r=0;r<n.length;r++){var o=n[r];if(ut(e,o))e=e[o];else return}return e},"attrGetter")}a(Sr,"getAttrGetter");j.getAttrGetter=Sr;function Hi(t,n,s){for(var i={},e=wr(n)?n:Sr(n),r=0;r<t.length;r++){var o=t[r],l=e(o,r);if(l===void 0&&s===!0)throw new TypeError('groupby: attribute "'+n+'" resolved to undefined');(i[l]||(i[l]=[])).push(o)}return i}a(Hi,"groupBy");j.groupBy=Hi;function Tr(t){return Array.prototype.slice.call(t)}a(Tr,"toArray");j.toArray=Tr;function Yi(t){var n=[];if(!t)return n;for(var s=t.length,i=Tr(arguments).slice(1),e=-1;++e<s;)Ar(i,t[e])===-1&&n.push(t[e]);return n}a(Yi,"without");j.without=Yi;function zi(t,n){for(var s="",i=0;i<n;i++)s+=t;return s}a(zi,"repeat");j.repeat=zi;function Xi(t,n,s){if(t!=null){if(De.forEach&&t.forEach===De.forEach)t.forEach(n,s);else if(t.length===+t.length)for(var i=0,e=t.length;i<e;i++)n.call(s,t[i],i,t)}}a(Xi,"each");j.each=Xi;function Ji(t,n){var s=[];if(t==null)return s;if(De.map&&t.map===De.map)return t.map(n);for(var i=0;i<t.length;i++)s[s.length]=n(t[i],i);return t.length===+t.length&&(s.length=t.length),s}a(Ji,"map");j.map=Ji;function Qi(t,n,s){var i=-1;function e(){i++,i<t.length?n(t[i],i,e,s):s()}a(e,"next"),e()}a(Qi,"asyncIter");j.asyncIter=Qi;function Zi(t,n,s){var i=Ce(t||{}),e=i.length,r=-1;function o(){r++;var l=i[r];r<e?n(l,t[l],r,e,o):s()}a(o,"next"),o()}a(Zi,"asyncFor");j.asyncFor=Zi;function Ar(t,n,s){return Array.prototype.indexOf.call(t||[],n,s)}a(Ar,"indexOf");j.indexOf=Ar;function Ce(t){var n=[];for(var s in t)ut(t,s)&&n.push(s);return n}a(Ce,"keys_");j.keys=Ce;function es(t){return Ce(t).map(function(n){return[n,t[n]]})}a(es,"_entries");j._entries=es;function ts(t){return Ce(t).map(function(n){return t[n]})}a(ts,"_values");j._values=ts;function rs(t,n){return t=t||{},Ce(n).forEach(function(s){t[s]=n[s]}),t}a(rs,"extend");j._assign=j.extend=rs;function ns(t,n){if(br(n)||Or(n))return n.indexOf(t)!==-1;if(xr(n))return t in n;throw new Error('Cannot use "in" operator to search for "'+t+'" in unexpected types.')}a(ns,"inOperator");j.inOperator=ns});var Pr=M((dc,Rr)=>{"use strict";b();var qe,is=typeof setImmediate=="function";Rr.exports=Cr;function Cr(t){ne.length||(Fr(),ft=!0),ne[ne.length]=t}a(Cr,"rawAsap");var ne=[],ft=!1,re=0,ss=1024;function Nr(){for(;re<ne.length;){var t=re;if(re=re+1,ne[t].call(),re>ss){for(var n=0,s=ne.length-re;n<s;n++)ne[n]=ne[n+re];ne.length-=re,re=0}}ne.length=0,re=0,ft=!1}a(Nr,"flush");Cr.requestFlush=Fr;function Fr(){var t=process.domain;t&&(qe||(qe=Q("domain")),qe.active=process.domain=null),ft&&is?setImmediate(Nr):process.nextTick(Nr),t&&(qe.active=process.domain=t)}a(Fr,"requestFlush")});var Kr=M((gc,jr)=>{"use strict";b();var Ir=Pr(),pt=[];jr.exports=os;function os(t){var n;pt.length?n=pt.pop():n=new Br,n.task=t,n.domain=process.domain,Ir(n)}a(os,"asap");function Br(){this.task=null,this.domain=null}a(Br,"RawTask");Br.prototype.call=function(){this.domain&&this.domain.enter();var t=!0;try{this.task.call(),t=!1,this.domain&&this.domain.exit()}finally{t&&Ir.requestFlush(),this.task=null,this.domain=null,pt.push(this)}}});var $r=M((Mr,Ue)=>{b();(function(t){"use strict";var n=a(function(){var o=Array.prototype.slice.call(arguments);typeof o[0]=="function"&&o[0].apply(null,o.splice(1))},"executeSync"),s=a(function(o){typeof setImmediate=="function"?setImmediate(o):typeof process<"u"&&process.nextTick?process.nextTick(o):setTimeout(o,0)},"executeAsync"),i=a(function(o){var l=a(function(c){var u=a(function(){return o.length&&o[c].apply(null,arguments),u.next()},"fn");return u.next=function(){return c<o.length-1?l(c+1):null},u},"makeCallback");return l(0)},"makeIterator"),e=Array.isArray||function(o){return Object.prototype.toString.call(o)==="[object Array]"},r=a(function(o,l,c){var u=c?s:n;if(l=l||function(){},!e(o)){var f=new Error("First argument to waterfall must be an array of functions");return l(f)}if(!o.length)return l();var p=a(function(_){return function(g){if(g)l.apply(null,arguments),l=a(function(){},"callback");else{var w=Array.prototype.slice.call(arguments,1),x=_.next();x?w.push(p(x)):w.push(l),u(function(){_.apply(null,w)})}}},"wrapIterator");p(i(o))()},"waterfall");typeof define<"u"&&define.amd?define([],function(){return r}):typeof Ue<"u"&&Ue.exports?Ue.exports=r:t.waterfall=r})(Mr)});var mt=M((bc,dn)=>{"use strict";b();var Dr=ee(),qr=`
5
+ \r\xA0`,Ur="()[]{}%*-+~/#,:|.<>=!",as="0123456789",ls="{%",cs="%}",us="{{",fs="}}",ps="{#",hs="#}",Vr="string",Gr="whitespace",Wr="data",Hr="block-start",Yr="block-end",zr="variable-start",Xr="variable-end",Jr="comment",Qr="left-paren",Zr="right-paren",en="left-bracket",tn="right-bracket",rn="left-curly",nn="right-curly",sn="operator",on="comma",an="colon",ln="tilde",cn="pipe",un="int",fn="float",pn="boolean",ht="none",hn="symbol",ms="special",mn="regex";function Y(t,n,s,i){return{type:t,value:n,lineno:s,colno:i}}a(Y,"token");var ds=function(){function t(s,i){this.str=s,this.index=0,this.len=s.length,this.lineno=0,this.colno=0,this.in_code=!1,i=i||{};var e=i.tags||{};this.tags={BLOCK_START:e.blockStart||ls,BLOCK_END:e.blockEnd||cs,VARIABLE_START:e.variableStart||us,VARIABLE_END:e.variableEnd||fs,COMMENT_START:e.commentStart||ps,COMMENT_END:e.commentEnd||hs},this.trimBlocks=!!i.trimBlocks,this.lstripBlocks=!!i.lstripBlocks}a(t,"Tokenizer");var n=t.prototype;return n.nextToken=a(function(){var i=this.lineno,e=this.colno,r;if(this.in_code){var o=this.current();if(this.isFinished())return null;if(o==='"'||o==="'")return Y(Vr,this._parseString(o),i,e);if(r=this._extract(qr))return Y(Gr,r,i,e);if((r=this._extractString(this.tags.BLOCK_END))||(r=this._extractString("-"+this.tags.BLOCK_END)))return this.in_code=!1,this.trimBlocks&&(o=this.current(),o===`
6
+ `?this.forward():o==="\r"&&(this.forward(),o=this.current(),o===`
7
+ `?this.forward():this.back())),Y(Yr,r,i,e);if((r=this._extractString(this.tags.VARIABLE_END))||(r=this._extractString("-"+this.tags.VARIABLE_END)))return this.in_code=!1,Y(Xr,r,i,e);if(o==="r"&&this.str.charAt(this.index+1)==="/"){this.forwardN(2);for(var l="";!this.isFinished();)if(this.current()==="/"&&this.previous()!=="\\"){this.forward();break}else l+=this.current(),this.forward();for(var c=["g","i","m","y"],u="";!this.isFinished();){var f=c.indexOf(this.current())!==-1;if(f)u+=this.current(),this.forward();else break}return Y(mn,{body:l,flags:u},i,e)}else if(Ur.indexOf(o)!==-1){this.forward();var p=["==","===","!=","!==","<=",">=","//","**"],_=o+this.current(),g;switch(Dr.indexOf(p,_)!==-1&&(this.forward(),o=_,Dr.indexOf(p,_+this.current())!==-1&&(o=_+this.current(),this.forward())),o){case"(":g=Qr;break;case")":g=Zr;break;case"[":g=en;break;case"]":g=tn;break;case"{":g=rn;break;case"}":g=nn;break;case",":g=on;break;case":":g=an;break;case"~":g=ln;break;case"|":g=cn;break;default:g=sn}return Y(g,o,i,e)}else if(r=this._extractUntil(qr+Ur),r.match(/^[-+]?[0-9]+$/))if(this.current()==="."){this.forward();var w=this._extract(as);return Y(fn,r+"."+w,i,e)}else return Y(un,r,i,e);else{if(r.match(/^(true|false)$/))return Y(pn,r,i,e);if(r==="none")return Y(ht,r,i,e);if(r==="null")return Y(ht,r,i,e);if(r)return Y(hn,r,i,e);throw new Error("Unexpected value while parsing: "+r)}}else{var x=this.tags.BLOCK_START.charAt(0)+this.tags.VARIABLE_START.charAt(0)+this.tags.COMMENT_START.charAt(0)+this.tags.COMMENT_END.charAt(0);if(this.isFinished())return null;if((r=this._extractString(this.tags.BLOCK_START+"-"))||(r=this._extractString(this.tags.BLOCK_START)))return this.in_code=!0,Y(Hr,r,i,e);if((r=this._extractString(this.tags.VARIABLE_START+"-"))||(r=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,Y(zr,r,i,e);r="";var k,v=!1;for(this._matches(this.tags.COMMENT_START)&&(v=!0,r=this._extractString(this.tags.COMMENT_START));(k=this._extractUntil(x))!==null;)if(r+=k,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!v){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=r.length){var h=r.slice(-this.colno);if(/^\s+$/.test(h)&&(r=r.slice(0,-this.colno),!r.length))return this.nextToken()}break}else if(this._matches(this.tags.COMMENT_END)){if(!v)throw new Error("unexpected end of comment");r+=this._extractString(this.tags.COMMENT_END);break}else r+=this.current(),this.forward();if(k===null&&v)throw new Error("expected end of comment, got end of file");return Y(v?Jr:Wr,r,i,e)}},"nextToken"),n._parseString=a(function(i){this.forward();for(var e="";!this.isFinished()&&this.current()!==i;){var r=this.current();if(r==="\\"){switch(this.forward(),this.current()){case"n":e+=`
8
+ `;break;case"t":e+=" ";break;case"r":e+="\r";break;default:e+=this.current()}this.forward()}else e+=r,this.forward()}return this.forward(),e},"_parseString"),n._matches=a(function(i){if(this.index+i.length>this.len)return null;var e=this.str.slice(this.index,this.index+i.length);return e===i},"_matches"),n._extractString=a(function(i){return this._matches(i)?(this.forwardN(i.length),i):null},"_extractString"),n._extractUntil=a(function(i){return this._extractMatching(!0,i||"")},"_extractUntil"),n._extract=a(function(i){return this._extractMatching(!1,i)},"_extract"),n._extractMatching=a(function(i,e){if(this.isFinished())return null;var r=e.indexOf(this.current());if(i&&r===-1||!i&&r!==-1){var o=this.current();this.forward();for(var l=e.indexOf(this.current());(i&&l===-1||!i&&l!==-1)&&!this.isFinished();)o+=this.current(),this.forward(),l=e.indexOf(this.current());return o}return""},"_extractMatching"),n._extractRegex=a(function(i){var e=this.currentStr().match(i);return e?(this.forwardN(e[0].length),e):null},"_extractRegex"),n.isFinished=a(function(){return this.index>=this.len},"isFinished"),n.forwardN=a(function(i){for(var e=0;e<i;e++)this.forward()},"forwardN"),n.forward=a(function(){this.index++,this.previous()===`
9
+ `?(this.lineno++,this.colno=0):this.colno++},"forward"),n.backN=a(function(i){for(var e=0;e<i;e++)this.back()},"backN"),n.back=a(function(){if(this.index--,this.current()===`
10
+ `){this.lineno--;var i=this.src.lastIndexOf(`
11
+ `,this.index-1);i===-1?this.colno=this.index:this.colno=this.index-i}else this.colno--},"back"),n.current=a(function(){return this.isFinished()?"":this.str.charAt(this.index)},"current"),n.currentStr=a(function(){return this.isFinished()?"":this.str.substr(this.index)},"currentStr"),n.previous=a(function(){return this.str.charAt(this.index-1)},"previous"),t}();dn.exports={lex:a(function(n,s){return new ds(n,s)},"lex"),TOKEN_STRING:Vr,TOKEN_WHITESPACE:Gr,TOKEN_DATA:Wr,TOKEN_BLOCK_START:Hr,TOKEN_BLOCK_END:Yr,TOKEN_VARIABLE_START:zr,TOKEN_VARIABLE_END:Xr,TOKEN_COMMENT:Jr,TOKEN_LEFT_PAREN:Qr,TOKEN_RIGHT_PAREN:Zr,TOKEN_LEFT_BRACKET:en,TOKEN_RIGHT_BRACKET:tn,TOKEN_LEFT_CURLY:rn,TOKEN_RIGHT_CURLY:nn,TOKEN_OPERATOR:sn,TOKEN_COMMA:on,TOKEN_COLON:an,TOKEN_TILDE:ln,TOKEN_PIPE:cn,TOKEN_INT:un,TOKEN_FLOAT:fn,TOKEN_BOOLEAN:pn,TOKEN_NONE:ht,TOKEN_SYMBOL:hn,TOKEN_SPECIAL:ms,TOKEN_REGEX:mn}});var ye=M((Sc,kn)=>{"use strict";b();function vn(t,n){for(var s=0;s<n.length;s++){var i=n[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,vs(i.key),i)}}a(vn,"_defineProperties");function vt(t,n,s){return n&&vn(t.prototype,n),s&&vn(t,s),Object.defineProperty(t,"prototype",{writable:!1}),t}a(vt,"_createClass");function vs(t){var n=_s(t,"string");return typeof n=="symbol"?n:String(n)}a(vs,"_toPropertyKey");function _s(t,n){if(typeof t!="object"||t===null)return t;var s=t[Symbol.toPrimitive];if(s!==void 0){var i=s.call(t,n||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(t)}a(_s,"_toPrimitive");function gn(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,dt(t,n)}a(gn,"_inheritsLoose");function dt(t,n){return dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():a(function(i,e){return i.__proto__=e,i},"_setPrototypeOf"),dt(t,n)}a(dt,"_setPrototypeOf");var gs=Q("events"),_n=ee();function ys(t,n){return typeof t!="function"||typeof n!="function"?n:a(function(){var i=this.parent;this.parent=t;var e=n.apply(this,arguments);return this.parent=i,e},"wrap")}a(ys,"parentWrap");function yn(t,n,s){s=s||{},_n.keys(s).forEach(function(e){s[e]=ys(t.prototype[e],s[e])});var i=function(e){gn(r,e);function r(){return e.apply(this,arguments)||this}return a(r,"subclass"),vt(r,[{key:"typename",get:a(function(){return n},"get")}]),r}(t);return _n._assign(i.prototype,s),i}a(yn,"extendClass");var ks=function(){function t(){this.init.apply(this,arguments)}a(t,"Obj");var n=t.prototype;return n.init=a(function(){},"init"),t.extend=a(function(i,e){return typeof i=="object"&&(e=i,i="anonymous"),yn(this,i,e)},"extend"),vt(t,[{key:"typename",get:a(function(){return this.constructor.name},"get")}]),t}(),Es=function(t){gn(n,t);function n(){var i,e;return e=t.call(this)||this,(i=e).init.apply(i,arguments),e}a(n,"EmitterObj");var s=n.prototype;return s.init=a(function(){},"init"),n.extend=a(function(e,r){return typeof e=="object"&&(r=e,e="anonymous"),yn(this,e,r)},"extend"),vt(n,[{key:"typename",get:a(function(){return this.constructor.name},"get")}]),n}(gs);kn.exports={Obj:ks,EmitterObj:Es}});var Re=M((Lc,Ln)=>{"use strict";b();function En(t,n){for(var s=0;s<n.length;s++){var i=n[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,ws(i.key),i)}}a(En,"_defineProperties");function gt(t,n,s){return n&&En(t.prototype,n),s&&En(t,s),Object.defineProperty(t,"prototype",{writable:!1}),t}a(gt,"_createClass");function ws(t){var n=bs(t,"string");return typeof n=="symbol"?n:String(n)}a(ws,"_toPropertyKey");function bs(t,n){if(typeof t!="object"||t===null)return t;var s=t[Symbol.toPrimitive];if(s!==void 0){var i=s.call(t,n||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(t)}a(bs,"_toPrimitive");function Ve(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,_t(t,n)}a(Ve,"_inheritsLoose");function _t(t,n){return _t=Object.setPrototypeOf?Object.setPrototypeOf.bind():a(function(i,e){return i.__proto__=e,i},"_setPrototypeOf"),_t(t,n)}a(_t,"_setPrototypeOf");var Os=ye(),xs=Os.Obj;function wn(t,n,s){t instanceof n&&s.push(t),t instanceof B&&t.findAll(n,s)}a(wn,"traverseAndCheck");var B=function(t){Ve(n,t);function n(){return t.apply(this,arguments)||this}a(n,"Node");var s=n.prototype;return s.init=a(function(e,r){for(var o=arguments,l=this,c=arguments.length,u=new Array(c>2?c-2:0),f=2;f<c;f++)u[f-2]=arguments[f];this.lineno=e,this.colno=r,this.fields.forEach(function(p,_){var g=o[_+2];g===void 0&&(g=null),l[p]=g})},"init"),s.findAll=a(function(e,r){var o=this;return r=r||[],this instanceof ie?this.children.forEach(function(l){return wn(l,e,r)}):this.fields.forEach(function(l){return wn(o[l],e,r)}),r},"findAll"),s.iterFields=a(function(e){var r=this;this.fields.forEach(function(o){e(r[o],o)})},"iterFields"),n}(xs),yt=function(t){Ve(n,t);function n(){return t.apply(this,arguments)||this}return a(n,"Value"),gt(n,[{key:"typename",get:a(function(){return"Value"},"get")},{key:"fields",get:a(function(){return["value"]},"get")}]),n}(B),ie=function(t){Ve(n,t);function n(){return t.apply(this,arguments)||this}a(n,"NodeList");var s=n.prototype;return s.init=a(function(e,r,o){t.prototype.init.call(this,e,r,o||[])},"init"),s.addChild=a(function(e){this.children.push(e)},"addChild"),gt(n,[{key:"typename",get:a(function(){return"NodeList"},"get")},{key:"fields",get:a(function(){return["children"]},"get")}]),n}(B),Ss=ie.extend("Root"),bn=yt.extend("Literal"),Ts=yt.extend("Symbol"),As=ie.extend("Group"),Ls=ie.extend("Array"),Ns=B.extend("Pair",{fields:["key","value"]}),On=ie.extend("Dict"),Cs=B.extend("LookupVal",{fields:["target","val"]}),xn=B.extend("If",{fields:["cond","body","else_"]}),Fs=xn.extend("IfAsync"),Rs=B.extend("InlineIf",{fields:["cond","body","else_"]}),kt=B.extend("For",{fields:["arr","name","body","else_"]}),Ps=kt.extend("AsyncEach"),Is=kt.extend("AsyncAll"),Sn=B.extend("Macro",{fields:["name","args","body"]}),Bs=Sn.extend("Caller"),js=B.extend("Import",{fields:["template","target","withContext"]}),Ks=function(t){Ve(n,t);function n(){return t.apply(this,arguments)||this}a(n,"FromImport");var s=n.prototype;return s.init=a(function(e,r,o,l,c){t.prototype.init.call(this,e,r,o,l||new ie,c)},"init"),gt(n,[{key:"typename",get:a(function(){return"FromImport"},"get")},{key:"fields",get:a(function(){return["template","names","withContext"]},"get")}]),n}(B),Tn=B.extend("FunCall",{fields:["name","args"]}),An=Tn.extend("Filter"),Ms=An.extend("FilterAsync",{fields:["name","args","symbol"]}),$s=On.extend("KeywordArgs"),Ds=B.extend("Block",{fields:["name","body"]}),qs=B.extend("Super",{fields:["blockName","symbol"]}),Us=B.extend("TemplateRef",{fields:["template"]}),Vs=Us.extend("Extends"),Gs=B.extend("Include",{fields:["template","ignoreMissing"]}),Ws=B.extend("Set",{fields:["targets","value"]}),Hs=B.extend("Switch",{fields:["expr","cases","default"]}),Ys=B.extend("Case",{fields:["cond","body"]}),zs=ie.extend("Output"),Xs=B.extend("Capture",{fields:["body"]}),Js=bn.extend("TemplateData"),Et=B.extend("UnaryOp",{fields:["target"]}),z=B.extend("BinOp",{fields:["left","right"]}),Qs=z.extend("In"),Zs=z.extend("Is"),eo=z.extend("Or"),to=z.extend("And"),ro=Et.extend("Not"),no=z.extend("Add"),io=z.extend("Concat"),so=z.extend("Sub"),oo=z.extend("Mul"),ao=z.extend("Div"),lo=z.extend("FloorDiv"),co=z.extend("Mod"),uo=z.extend("Pow"),fo=Et.extend("Neg"),po=Et.extend("Pos"),ho=B.extend("Compare",{fields:["expr","ops"]}),mo=B.extend("CompareOperand",{fields:["expr","type"]}),wt=B.extend("CallExtension",{init:a(function(n,s,i,e){this.parent(),this.extName=n.__name||n,this.prop=s,this.args=i||new ie,this.contentArgs=e||[],this.autoescape=n.autoescape},"init"),fields:["extName","prop","args","contentArgs"]}),vo=wt.extend("CallExtensionAsync");function ke(t,n,s){var i=t.split(`
12
+ `);i.forEach(function(e,r){e&&(s&&r>0||!s)&&process.stdout.write(" ".repeat(n));var o=r===i.length-1?"":`
13
+ `;process.stdout.write(""+e+o)})}a(ke,"print");function Fe(t,n){if(n=n||0,ke(t.typename+": ",n),t instanceof ie)ke(`
14
+ `),t.children.forEach(function(e){Fe(e,n+2)});else if(t instanceof wt)ke(t.extName+"."+t.prop+`
15
+ `),t.args&&Fe(t.args,n+2),t.contentArgs&&t.contentArgs.forEach(function(e){Fe(e,n+2)});else{var s=[],i=null;t.iterFields(function(e,r){e instanceof B?s.push([r,e]):(i=i||{},i[r]=e)}),i?ke(JSON.stringify(i,null,2)+`
16
+ `,null,!0):ke(`
17
+ `),s.forEach(function(e){var r=e[0],o=e[1];ke("["+r+"] =>",n+2),Fe(o,n+4)})}}a(Fe,"printNodes");Ln.exports={Node:B,Root:Ss,NodeList:ie,Value:yt,Literal:bn,Symbol:Ts,Group:As,Array:Ls,Pair:Ns,Dict:On,Output:zs,Capture:Xs,TemplateData:Js,If:xn,IfAsync:Fs,InlineIf:Rs,For:kt,AsyncEach:Ps,AsyncAll:Is,Macro:Sn,Caller:Bs,Import:js,FromImport:Ks,FunCall:Tn,Filter:An,FilterAsync:Ms,KeywordArgs:$s,Block:Ds,Super:qs,Extends:Vs,Include:Gs,Set:Ws,Switch:Hs,Case:Ys,LookupVal:Cs,BinOp:z,In:Qs,Is:Zs,Or:eo,And:to,Not:ro,Add:no,Concat:io,Sub:so,Mul:oo,Div:ao,FloorDiv:lo,Mod:co,Pow:uo,Neg:fo,Pos:po,Compare:ho,CompareOperand:mo,CallExtension:wt,CallExtensionAsync:vo,printNodes:Fe}});var xt=M((Fc,Cn)=>{"use strict";b();function _o(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,Ot(t,n)}a(_o,"_inheritsLoose");function Ot(t,n){return Ot=Object.setPrototypeOf?Object.setPrototypeOf.bind():a(function(i,e){return i.__proto__=e,i},"_setPrototypeOf"),Ot(t,n)}a(Ot,"_setPrototypeOf");var E=mt(),d=Re(),go=ye().Obj,bt=ee(),Nn=function(t){_o(n,t);function n(){return t.apply(this,arguments)||this}a(n,"Parser");var s=n.prototype;return s.init=a(function(e){this.tokens=e,this.peeked=null,this.breakOnBlocks=null,this.dropLeadingWhitespace=!1,this.extensions=[]},"init"),s.nextToken=a(function(e){var r;if(this.peeked)if(!e&&this.peeked.type===E.TOKEN_WHITESPACE)this.peeked=null;else return r=this.peeked,this.peeked=null,r;if(r=this.tokens.nextToken(),!e)for(;r&&r.type===E.TOKEN_WHITESPACE;)r=this.tokens.nextToken();return r},"nextToken"),s.peekToken=a(function(){return this.peeked=this.peeked||this.nextToken(),this.peeked},"peekToken"),s.pushToken=a(function(e){if(this.peeked)throw new Error("pushToken: can only push one token on between reads");this.peeked=e},"pushToken"),s.error=a(function(e,r,o){if(r===void 0||o===void 0){var l=this.peekToken()||{};r=l.lineno,o=l.colno}return r!==void 0&&(r+=1),o!==void 0&&(o+=1),new bt.TemplateError(e,r,o)},"error"),s.fail=a(function(e,r,o){throw this.error(e,r,o)},"fail"),s.skip=a(function(e){var r=this.nextToken();return!r||r.type!==e?(this.pushToken(r),!1):!0},"skip"),s.expect=a(function(e){var r=this.nextToken();return r.type!==e&&this.fail("expected "+e+", got "+r.type,r.lineno,r.colno),r},"expect"),s.skipValue=a(function(e,r){var o=this.nextToken();return!o||o.type!==e||o.value!==r?(this.pushToken(o),!1):!0},"skipValue"),s.skipSymbol=a(function(e){return this.skipValue(E.TOKEN_SYMBOL,e)},"skipSymbol"),s.advanceAfterBlockEnd=a(function(e){var r;return e||(r=this.peekToken(),r||this.fail("unexpected end of file"),r.type!==E.TOKEN_SYMBOL&&this.fail("advanceAfterBlockEnd: expected symbol token or explicit name to be passed"),e=this.nextToken().value),r=this.nextToken(),r&&r.type===E.TOKEN_BLOCK_END?r.value.charAt(0)==="-"&&(this.dropLeadingWhitespace=!0):this.fail("expected block end in "+e+" statement"),r},"advanceAfterBlockEnd"),s.advanceAfterVariableEnd=a(function(){var e=this.nextToken();e&&e.type===E.TOKEN_VARIABLE_END?this.dropLeadingWhitespace=e.value.charAt(e.value.length-this.tokens.tags.VARIABLE_END.length-1)==="-":(this.pushToken(e),this.fail("expected variable end"))},"advanceAfterVariableEnd"),s.parseFor=a(function(){var e=this.peekToken(),r,o;this.skipSymbol("for")?(r=new d.For(e.lineno,e.colno),o="endfor"):this.skipSymbol("asyncEach")?(r=new d.AsyncEach(e.lineno,e.colno),o="endeach"):this.skipSymbol("asyncAll")?(r=new d.AsyncAll(e.lineno,e.colno),o="endall"):this.fail("parseFor: expected for{Async}",e.lineno,e.colno),r.name=this.parsePrimary(),r.name instanceof d.Symbol||this.fail("parseFor: variable name expected for loop");var l=this.peekToken().type;if(l===E.TOKEN_COMMA){var c=r.name;for(r.name=new d.Array(c.lineno,c.colno),r.name.addChild(c);this.skip(E.TOKEN_COMMA);){var u=this.parsePrimary();r.name.addChild(u)}}return this.skipSymbol("in")||this.fail('parseFor: expected "in" keyword for loop',e.lineno,e.colno),r.arr=this.parseExpression(),this.advanceAfterBlockEnd(e.value),r.body=this.parseUntilBlocks(o,"else"),this.skipSymbol("else")&&(this.advanceAfterBlockEnd("else"),r.else_=this.parseUntilBlocks(o)),this.advanceAfterBlockEnd(),r},"parseFor"),s.parseMacro=a(function(){var e=this.peekToken();this.skipSymbol("macro")||this.fail("expected macro");var r=this.parsePrimary(!0),o=this.parseSignature(),l=new d.Macro(e.lineno,e.colno,r,o);return this.advanceAfterBlockEnd(e.value),l.body=this.parseUntilBlocks("endmacro"),this.advanceAfterBlockEnd(),l},"parseMacro"),s.parseCall=a(function(){var e=this.peekToken();this.skipSymbol("call")||this.fail("expected call");var r=this.parseSignature(!0)||new d.NodeList,o=this.parsePrimary();this.advanceAfterBlockEnd(e.value);var l=this.parseUntilBlocks("endcall");this.advanceAfterBlockEnd();var c=new d.Symbol(e.lineno,e.colno,"caller"),u=new d.Caller(e.lineno,e.colno,c,r,l),f=o.args.children;f[f.length-1]instanceof d.KeywordArgs||f.push(new d.KeywordArgs);var p=f[f.length-1];return p.addChild(new d.Pair(e.lineno,e.colno,c,u)),new d.Output(e.lineno,e.colno,[o])},"parseCall"),s.parseWithContext=a(function(){var e=this.peekToken(),r=null;return this.skipSymbol("with")?r=!0:this.skipSymbol("without")&&(r=!1),r!==null&&(this.skipSymbol("context")||this.fail("parseFrom: expected context after with/without",e.lineno,e.colno)),r},"parseWithContext"),s.parseImport=a(function(){var e=this.peekToken();this.skipSymbol("import")||this.fail("parseImport: expected import",e.lineno,e.colno);var r=this.parseExpression();this.skipSymbol("as")||this.fail('parseImport: expected "as" keyword',e.lineno,e.colno);var o=this.parseExpression(),l=this.parseWithContext(),c=new d.Import(e.lineno,e.colno,r,o,l);return this.advanceAfterBlockEnd(e.value),c},"parseImport"),s.parseFrom=a(function(){var e=this.peekToken();this.skipSymbol("from")||this.fail("parseFrom: expected from");var r=this.parseExpression();this.skipSymbol("import")||this.fail("parseFrom: expected import",e.lineno,e.colno);for(var o=new d.NodeList,l;;){var c=this.peekToken();if(c.type===E.TOKEN_BLOCK_END){o.children.length||this.fail("parseFrom: Expected at least one import name",e.lineno,e.colno),c.value.charAt(0)==="-"&&(this.dropLeadingWhitespace=!0),this.nextToken();break}o.children.length>0&&!this.skip(E.TOKEN_COMMA)&&this.fail("parseFrom: expected comma",e.lineno,e.colno);var u=this.parsePrimary();if(u.value.charAt(0)==="_"&&this.fail("parseFrom: names starting with an underscore cannot be imported",u.lineno,u.colno),this.skipSymbol("as")){var f=this.parsePrimary();o.addChild(new d.Pair(u.lineno,u.colno,u,f))}else o.addChild(u);l=this.parseWithContext()}return new d.FromImport(e.lineno,e.colno,r,o,l)},"parseFrom"),s.parseBlock=a(function(){var e=this.peekToken();this.skipSymbol("block")||this.fail("parseBlock: expected block",e.lineno,e.colno);var r=new d.Block(e.lineno,e.colno);r.name=this.parsePrimary(),r.name instanceof d.Symbol||this.fail("parseBlock: variable name expected",e.lineno,e.colno),this.advanceAfterBlockEnd(e.value),r.body=this.parseUntilBlocks("endblock"),this.skipSymbol("endblock"),this.skipSymbol(r.name.value);var o=this.peekToken();return o||this.fail("parseBlock: expected endblock, got end of file"),this.advanceAfterBlockEnd(o.value),r},"parseBlock"),s.parseExtends=a(function(){var e="extends",r=this.peekToken();this.skipSymbol(e)||this.fail("parseTemplateRef: expected "+e);var o=new d.Extends(r.lineno,r.colno);return o.template=this.parseExpression(),this.advanceAfterBlockEnd(r.value),o},"parseExtends"),s.parseInclude=a(function(){var e="include",r=this.peekToken();this.skipSymbol(e)||this.fail("parseInclude: expected "+e);var o=new d.Include(r.lineno,r.colno);return o.template=this.parseExpression(),this.skipSymbol("ignore")&&this.skipSymbol("missing")&&(o.ignoreMissing=!0),this.advanceAfterBlockEnd(r.value),o},"parseInclude"),s.parseIf=a(function(){var e=this.peekToken(),r;this.skipSymbol("if")||this.skipSymbol("elif")||this.skipSymbol("elseif")?r=new d.If(e.lineno,e.colno):this.skipSymbol("ifAsync")?r=new d.IfAsync(e.lineno,e.colno):this.fail("parseIf: expected if, elif, or elseif",e.lineno,e.colno),r.cond=this.parseExpression(),this.advanceAfterBlockEnd(e.value),r.body=this.parseUntilBlocks("elif","elseif","else","endif");var o=this.peekToken();switch(o&&o.value){case"elseif":case"elif":r.else_=this.parseIf();break;case"else":this.advanceAfterBlockEnd(),r.else_=this.parseUntilBlocks("endif"),this.advanceAfterBlockEnd();break;case"endif":r.else_=null,this.advanceAfterBlockEnd();break;default:this.fail("parseIf: expected elif, else, or endif, got end of file")}return r},"parseIf"),s.parseSet=a(function(){var e=this.peekToken();this.skipSymbol("set")||this.fail("parseSet: expected set",e.lineno,e.colno);for(var r=new d.Set(e.lineno,e.colno,[]),o;(o=this.parsePrimary())&&(r.targets.push(o),!!this.skip(E.TOKEN_COMMA)););return this.skipValue(E.TOKEN_OPERATOR,"=")?(r.value=this.parseExpression(),this.advanceAfterBlockEnd(e.value)):this.skip(E.TOKEN_BLOCK_END)?(r.body=new d.Capture(e.lineno,e.colno,this.parseUntilBlocks("endset")),r.value=null,this.advanceAfterBlockEnd()):this.fail("parseSet: expected = or block end in set tag",e.lineno,e.colno),r},"parseSet"),s.parseSwitch=a(function(){var e="switch",r="endswitch",o="case",l="default",c=this.peekToken();!this.skipSymbol(e)&&!this.skipSymbol(o)&&!this.skipSymbol(l)&&this.fail('parseSwitch: expected "switch," "case" or "default"',c.lineno,c.colno);var u=this.parseExpression();this.advanceAfterBlockEnd(e),this.parseUntilBlocks(o,l,r);var f=this.peekToken(),p=[],_;do{this.skipSymbol(o);var g=this.parseExpression();this.advanceAfterBlockEnd(e);var w=this.parseUntilBlocks(o,l,r);p.push(new d.Case(f.line,f.col,g,w)),f=this.peekToken()}while(f&&f.value===o);switch(f.value){case l:this.advanceAfterBlockEnd(),_=this.parseUntilBlocks(r),this.advanceAfterBlockEnd();break;case r:this.advanceAfterBlockEnd();break;default:this.fail('parseSwitch: expected "case," "default" or "endswitch," got EOF.')}return new d.Switch(c.lineno,c.colno,u,p,_)},"parseSwitch"),s.parseStatement=a(function(){var e=this.peekToken(),r;if(e.type!==E.TOKEN_SYMBOL&&this.fail("tag name expected",e.lineno,e.colno),this.breakOnBlocks&&bt.indexOf(this.breakOnBlocks,e.value)!==-1)return null;switch(e.value){case"raw":return this.parseRaw();case"verbatim":return this.parseRaw("verbatim");case"if":case"ifAsync":return this.parseIf();case"for":case"asyncEach":case"asyncAll":return this.parseFor();case"block":return this.parseBlock();case"extends":return this.parseExtends();case"include":return this.parseInclude();case"set":return this.parseSet();case"macro":return this.parseMacro();case"call":return this.parseCall();case"import":return this.parseImport();case"from":return this.parseFrom();case"filter":return this.parseFilterStatement();case"switch":return this.parseSwitch();default:if(this.extensions.length)for(var o=0;o<this.extensions.length;o++){var l=this.extensions[o];if(bt.indexOf(l.tags||[],e.value)!==-1)return l.parse(this,d,E)}this.fail("unknown block tag: "+e.value,e.lineno,e.colno)}return r},"parseStatement"),s.parseRaw=a(function(e){e=e||"raw";for(var r="end"+e,o=new RegExp("([\\s\\S]*?){%\\s*("+e+"|"+r+")\\s*(?=%})%}"),l=1,c="",u=null,f=this.advanceAfterBlockEnd();(u=this.tokens._extractRegex(o))&&l>0;){var p=u[0],_=u[1],g=u[2];g===e?l+=1:g===r&&(l-=1),l===0?(c+=_,this.tokens.backN(p.length-_.length)):c+=p}return new d.Output(f.lineno,f.colno,[new d.TemplateData(f.lineno,f.colno,c)])},"parseRaw"),s.parsePostfix=a(function(e){for(var r,o=this.peekToken();o;){if(o.type===E.TOKEN_LEFT_PAREN)e=new d.FunCall(o.lineno,o.colno,e,this.parseSignature());else if(o.type===E.TOKEN_LEFT_BRACKET)r=this.parseAggregate(),r.children.length>1&&this.fail("invalid index"),e=new d.LookupVal(o.lineno,o.colno,e,r.children[0]);else if(o.type===E.TOKEN_OPERATOR&&o.value==="."){this.nextToken();var l=this.nextToken();l.type!==E.TOKEN_SYMBOL&&this.fail("expected name as lookup value, got "+l.value,l.lineno,l.colno),r=new d.Literal(l.lineno,l.colno,l.value),e=new d.LookupVal(o.lineno,o.colno,e,r)}else break;o=this.peekToken()}return e},"parsePostfix"),s.parseExpression=a(function(){var e=this.parseInlineIf();return e},"parseExpression"),s.parseInlineIf=a(function(){var e=this.parseOr();if(this.skipSymbol("if")){var r=this.parseOr(),o=e;e=new d.InlineIf(e.lineno,e.colno),e.body=o,e.cond=r,this.skipSymbol("else")?e.else_=this.parseOr():e.else_=null}return e},"parseInlineIf"),s.parseOr=a(function(){for(var e=this.parseAnd();this.skipSymbol("or");){var r=this.parseAnd();e=new d.Or(e.lineno,e.colno,e,r)}return e},"parseOr"),s.parseAnd=a(function(){for(var e=this.parseNot();this.skipSymbol("and");){var r=this.parseNot();e=new d.And(e.lineno,e.colno,e,r)}return e},"parseAnd"),s.parseNot=a(function(){var e=this.peekToken();return this.skipSymbol("not")?new d.Not(e.lineno,e.colno,this.parseNot()):this.parseIn()},"parseNot"),s.parseIn=a(function(){for(var e=this.parseIs();;){var r=this.nextToken();if(!r)break;var o=r.type===E.TOKEN_SYMBOL&&r.value==="not";if(o||this.pushToken(r),this.skipSymbol("in")){var l=this.parseIs();e=new d.In(e.lineno,e.colno,e,l),o&&(e=new d.Not(e.lineno,e.colno,e))}else{o&&this.pushToken(r);break}}return e},"parseIn"),s.parseIs=a(function(){var e=this.parseCompare();if(this.skipSymbol("is")){var r=this.skipSymbol("not"),o=this.parseCompare();e=new d.Is(e.lineno,e.colno,e,o),r&&(e=new d.Not(e.lineno,e.colno,e))}return e},"parseIs"),s.parseCompare=a(function(){for(var e=["==","===","!=","!==","<",">","<=",">="],r=this.parseConcat(),o=[];;){var l=this.nextToken();if(l)if(e.indexOf(l.value)!==-1)o.push(new d.CompareOperand(l.lineno,l.colno,this.parseConcat(),l.value));else{this.pushToken(l);break}else break}return o.length?new d.Compare(o[0].lineno,o[0].colno,r,o):r},"parseCompare"),s.parseConcat=a(function(){for(var e=this.parseAdd();this.skipValue(E.TOKEN_TILDE,"~");){var r=this.parseAdd();e=new d.Concat(e.lineno,e.colno,e,r)}return e},"parseConcat"),s.parseAdd=a(function(){for(var e=this.parseSub();this.skipValue(E.TOKEN_OPERATOR,"+");){var r=this.parseSub();e=new d.Add(e.lineno,e.colno,e,r)}return e},"parseAdd"),s.parseSub=a(function(){for(var e=this.parseMul();this.skipValue(E.TOKEN_OPERATOR,"-");){var r=this.parseMul();e=new d.Sub(e.lineno,e.colno,e,r)}return e},"parseSub"),s.parseMul=a(function(){for(var e=this.parseDiv();this.skipValue(E.TOKEN_OPERATOR,"*");){var r=this.parseDiv();e=new d.Mul(e.lineno,e.colno,e,r)}return e},"parseMul"),s.parseDiv=a(function(){for(var e=this.parseFloorDiv();this.skipValue(E.TOKEN_OPERATOR,"/");){var r=this.parseFloorDiv();e=new d.Div(e.lineno,e.colno,e,r)}return e},"parseDiv"),s.parseFloorDiv=a(function(){for(var e=this.parseMod();this.skipValue(E.TOKEN_OPERATOR,"//");){var r=this.parseMod();e=new d.FloorDiv(e.lineno,e.colno,e,r)}return e},"parseFloorDiv"),s.parseMod=a(function(){for(var e=this.parsePow();this.skipValue(E.TOKEN_OPERATOR,"%");){var r=this.parsePow();e=new d.Mod(e.lineno,e.colno,e,r)}return e},"parseMod"),s.parsePow=a(function(){for(var e=this.parseUnary();this.skipValue(E.TOKEN_OPERATOR,"**");){var r=this.parseUnary();e=new d.Pow(e.lineno,e.colno,e,r)}return e},"parsePow"),s.parseUnary=a(function(e){var r=this.peekToken(),o;return this.skipValue(E.TOKEN_OPERATOR,"-")?o=new d.Neg(r.lineno,r.colno,this.parseUnary(!0)):this.skipValue(E.TOKEN_OPERATOR,"+")?o=new d.Pos(r.lineno,r.colno,this.parseUnary(!0)):o=this.parsePrimary(),e||(o=this.parseFilter(o)),o},"parseUnary"),s.parsePrimary=a(function(e){var r=this.nextToken(),o,l=null;if(r?r.type===E.TOKEN_STRING?o=r.value:r.type===E.TOKEN_INT?o=parseInt(r.value,10):r.type===E.TOKEN_FLOAT?o=parseFloat(r.value):r.type===E.TOKEN_BOOLEAN?r.value==="true"?o=!0:r.value==="false"?o=!1:this.fail("invalid boolean: "+r.value,r.lineno,r.colno):r.type===E.TOKEN_NONE?o=null:r.type===E.TOKEN_REGEX&&(o=new RegExp(r.value.body,r.value.flags)):this.fail("expected expression, got end of file"),o!==void 0?l=new d.Literal(r.lineno,r.colno,o):r.type===E.TOKEN_SYMBOL?l=new d.Symbol(r.lineno,r.colno,r.value):(this.pushToken(r),l=this.parseAggregate()),e||(l=this.parsePostfix(l)),l)return l;throw this.error("unexpected token: "+r.value,r.lineno,r.colno)},"parsePrimary"),s.parseFilterName=a(function(){for(var e=this.expect(E.TOKEN_SYMBOL),r=e.value;this.skipValue(E.TOKEN_OPERATOR,".");)r+="."+this.expect(E.TOKEN_SYMBOL).value;return new d.Symbol(e.lineno,e.colno,r)},"parseFilterName"),s.parseFilterArgs=a(function(e){if(this.peekToken().type===E.TOKEN_LEFT_PAREN){var r=this.parsePostfix(e);return r.args.children}return[]},"parseFilterArgs"),s.parseFilter=a(function(e){for(;this.skip(E.TOKEN_PIPE);){var r=this.parseFilterName();e=new d.Filter(r.lineno,r.colno,r,new d.NodeList(r.lineno,r.colno,[e].concat(this.parseFilterArgs(e))))}return e},"parseFilter"),s.parseFilterStatement=a(function(){var e=this.peekToken();this.skipSymbol("filter")||this.fail("parseFilterStatement: expected filter");var r=this.parseFilterName(),o=this.parseFilterArgs(r);this.advanceAfterBlockEnd(e.value);var l=new d.Capture(r.lineno,r.colno,this.parseUntilBlocks("endfilter"));this.advanceAfterBlockEnd();var c=new d.Filter(r.lineno,r.colno,r,new d.NodeList(r.lineno,r.colno,[l].concat(o)));return new d.Output(r.lineno,r.colno,[c])},"parseFilterStatement"),s.parseAggregate=a(function(){var e=this.nextToken(),r;switch(e.type){case E.TOKEN_LEFT_PAREN:r=new d.Group(e.lineno,e.colno);break;case E.TOKEN_LEFT_BRACKET:r=new d.Array(e.lineno,e.colno);break;case E.TOKEN_LEFT_CURLY:r=new d.Dict(e.lineno,e.colno);break;default:return null}for(;;){var o=this.peekToken().type;if(o===E.TOKEN_RIGHT_PAREN||o===E.TOKEN_RIGHT_BRACKET||o===E.TOKEN_RIGHT_CURLY){this.nextToken();break}if(r.children.length>0&&(this.skip(E.TOKEN_COMMA)||this.fail("parseAggregate: expected comma after expression",e.lineno,e.colno)),r instanceof d.Dict){var l=this.parsePrimary();this.skip(E.TOKEN_COLON)||this.fail("parseAggregate: expected colon after dict key",e.lineno,e.colno);var c=this.parseExpression();r.addChild(new d.Pair(l.lineno,l.colno,l,c))}else{var u=this.parseExpression();r.addChild(u)}}return r},"parseAggregate"),s.parseSignature=a(function(e,r){var o=this.peekToken();if(!r&&o.type!==E.TOKEN_LEFT_PAREN){if(e)return null;this.fail("expected arguments",o.lineno,o.colno)}o.type===E.TOKEN_LEFT_PAREN&&(o=this.nextToken());for(var l=new d.NodeList(o.lineno,o.colno),c=new d.KeywordArgs(o.lineno,o.colno),u=!1;;){if(o=this.peekToken(),!r&&o.type===E.TOKEN_RIGHT_PAREN){this.nextToken();break}else if(r&&o.type===E.TOKEN_BLOCK_END)break;if(u&&!this.skip(E.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",o.lineno,o.colno);else{var f=this.parseExpression();this.skipValue(E.TOKEN_OPERATOR,"=")?c.addChild(new d.Pair(f.lineno,f.colno,f,this.parseExpression())):l.addChild(f)}u=!0}return c.children.length&&l.addChild(c),l},"parseSignature"),s.parseUntilBlocks=a(function(){for(var e=this.breakOnBlocks,r=arguments.length,o=new Array(r),l=0;l<r;l++)o[l]=arguments[l];this.breakOnBlocks=o;var c=this.parse();return this.breakOnBlocks=e,c},"parseUntilBlocks"),s.parseNodes=a(function(){for(var e,r=[];e=this.nextToken();)if(e.type===E.TOKEN_DATA){var o=e.value,l=this.peekToken(),c=l&&l.value;this.dropLeadingWhitespace&&(o=o.replace(/^\s*/,""),this.dropLeadingWhitespace=!1),l&&(l.type===E.TOKEN_BLOCK_START&&c.charAt(c.length-1)==="-"||l.type===E.TOKEN_VARIABLE_START&&c.charAt(this.tokens.tags.VARIABLE_START.length)==="-"||l.type===E.TOKEN_COMMENT&&c.charAt(this.tokens.tags.COMMENT_START.length)==="-")&&(o=o.replace(/\s*$/,"")),r.push(new d.Output(e.lineno,e.colno,[new d.TemplateData(e.lineno,e.colno,o)]))}else if(e.type===E.TOKEN_BLOCK_START){this.dropLeadingWhitespace=!1;var u=this.parseStatement();if(!u)break;r.push(u)}else if(e.type===E.TOKEN_VARIABLE_START){var f=this.parseExpression();this.dropLeadingWhitespace=!1,this.advanceAfterVariableEnd(),r.push(new d.Output(e.lineno,e.colno,[f]))}else e.type===E.TOKEN_COMMENT?this.dropLeadingWhitespace=e.value.charAt(e.value.length-this.tokens.tags.COMMENT_END.length-1)==="-":this.fail("Unexpected token at top-level: "+e.type,e.lineno,e.colno);return r},"parseNodes"),s.parse=a(function(){return new d.NodeList(0,0,this.parseNodes())},"parse"),s.parseAsRoot=a(function(){return new d.Root(0,0,this.parseNodes())},"parseAsRoot"),n}(go);Cn.exports={parse:a(function(n,s,i){var e=new Nn(E.lex(n,i));return s!==void 0&&(e.extensions=s),e.parseAsRoot()},"parse"),Parser:Nn}});var Pn=M((Ic,Rn)=>{"use strict";b();var N=Re(),yo=ee(),ko=0;function Fn(){return"hole_"+ko++}a(Fn,"gensym");function St(t,n){for(var s=null,i=0;i<t.length;i++){var e=n(t[i]);e!==t[i]&&(s||(s=t.slice()),s[i]=e)}return s||t}a(St,"mapCOW");function pe(t,n,s){if(!(t instanceof N.Node))return t;if(!s){var i=n(t);if(i&&i!==t)return i}if(t instanceof N.NodeList){var e=St(t.children,function(u){return pe(u,n,s)});e!==t.children&&(t=new N[t.typename](t.lineno,t.colno,e))}else if(t instanceof N.CallExtension){var r=pe(t.args,n,s),o=St(t.contentArgs,function(u){return pe(u,n,s)});(r!==t.args||o!==t.contentArgs)&&(t=new N[t.typename](t.extName,t.prop,r,o))}else{var l=t.fields.map(function(u){return t[u]}),c=St(l,function(u){return pe(u,n,s)});c!==l&&(t=new N[t.typename](t.lineno,t.colno),c.forEach(function(u,f){t[t.fields[f]]=u}))}return s&&n(t)||t}a(pe,"walk");function Tt(t,n){return pe(t,n,!0)}a(Tt,"depthWalk");function Pe(t,n,s){var i=[],e=Tt(s?t[s]:t,function(r){var o;return r instanceof N.Block?r:((r instanceof N.Filter&&yo.indexOf(n,r.name.value)!==-1||r instanceof N.CallExtensionAsync)&&(o=new N.Symbol(r.lineno,r.colno,Fn()),i.push(new N.FilterAsync(r.lineno,r.colno,r.name,r.args,o))),o)});return s?t[s]=e:t=e,i.length?(i.push(t),new N.NodeList(t.lineno,t.colno,i)):t}a(Pe,"_liftFilters");function Eo(t,n){return Tt(t,function(s){return s instanceof N.Output?Pe(s,n):s instanceof N.Set?Pe(s,n,"value"):s instanceof N.For?Pe(s,n,"arr"):s instanceof N.If?Pe(s,n,"cond"):s instanceof N.CallExtension?Pe(s,n,"args"):void 0})}a(Eo,"liftFilters");function wo(t){return pe(t,function(n){if(n instanceof N.Block){var s=!1,i=Fn();n.body=pe(n.body,function(e){if(e instanceof N.FunCall&&e.name.value==="super")return s=!0,new N.Symbol(e.lineno,e.colno,i)}),s&&n.body.children.unshift(new N.Super(0,0,n.name,new N.Symbol(0,0,i)))}})}a(wo,"liftSuper");function bo(t){return Tt(t,function(n){if(!(!(n instanceof N.If)&&!(n instanceof N.For))){var s=!1;if(pe(n,function(i){if(i instanceof N.FilterAsync||i instanceof N.IfAsync||i instanceof N.AsyncEach||i instanceof N.AsyncAll||i instanceof N.CallExtensionAsync)return s=!0,i}),s){if(n instanceof N.If)return new N.IfAsync(n.lineno,n.colno,n.cond,n.body,n.else_);if(n instanceof N.For&&!(n instanceof N.AsyncAll))return new N.AsyncEach(n.lineno,n.colno,n.arr,n.name,n.body,n.else_)}}})}a(bo,"convertStatements");function Oo(t,n){return bo(wo(Eo(t,n)))}a(Oo,"cps");function xo(t,n){return Oo(t,n||[])}a(xo,"transform");Rn.exports={transform:xo}});var Ee=M((Kc,Kn)=>{"use strict";b();var Z=ee(),In=Array.from,So=typeof Symbol=="function"&&Symbol.iterator&&typeof In=="function",To=function(){function t(s,i){this.variables=Object.create(null),this.parent=s,this.topLevel=!1,this.isolateWrites=i}a(t,"Frame");var n=t.prototype;return n.set=a(function(i,e,r){var o=i.split("."),l=this.variables,c=this;if(r&&(c=this.resolve(o[0],!0))){c.set(i,e);return}for(var u=0;u<o.length-1;u++){var f=o[u];l[f]||(l[f]={}),l=l[f]}l[o[o.length-1]]=e},"set"),n.get=a(function(i){var e=this.variables[i];return e!==void 0?e:null},"get"),n.lookup=a(function(i){var e=this.parent,r=this.variables[i];return r!==void 0?r:e&&e.lookup(i)},"lookup"),n.resolve=a(function(i,e){var r=e&&this.isolateWrites?void 0:this.parent,o=this.variables[i];return o!==void 0?this:r&&r.resolve(i)},"resolve"),n.push=a(function(i){return new t(this,i)},"push"),n.pop=a(function(){return this.parent},"pop"),t}();function Ao(t,n,s){return a(function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];var l=jn(r),c,u=No(r);if(l>t.length)c=r.slice(0,t.length),r.slice(c.length,l).forEach(function(_,g){g<n.length&&(u[n[g]]=_)}),c.push(u);else if(l<t.length){c=r.slice(0,l);for(var f=l;f<t.length;f++){var p=t[f];c.push(u[p]),delete u[p]}c.push(u)}else c=r;return s.apply(this,c)},"macro")}a(Ao,"makeMacro");function Lo(t){return t.__keywords=!0,t}a(Lo,"makeKeywordArgs");function Bn(t){return t&&Object.prototype.hasOwnProperty.call(t,"__keywords")}a(Bn,"isKeywordArgs");function No(t){var n=t.length;if(n){var s=t[n-1];if(Bn(s))return s}return{}}a(No,"getKeywordArgs");function jn(t){var n=t.length;if(n===0)return 0;var s=t[n-1];return Bn(s)?n-1:n}a(jn,"numArgs");function ce(t){if(typeof t!="string")return t;this.val=t,this.length=t.length}a(ce,"SafeString");ce.prototype=Object.create(String.prototype,{length:{writable:!0,configurable:!0,value:0}});ce.prototype.valueOf=a(function(){return this.val},"valueOf");ce.prototype.toString=a(function(){return this.val},"toString");function Co(t,n){return t instanceof ce?new ce(n):n.toString()}a(Co,"copySafeness");function Fo(t){var n=typeof t;return n==="string"?new ce(t):n!=="function"?t:a(function(i){var e=t.apply(this,arguments);return typeof e=="string"?new ce(e):e},"wrapSafe")}a(Fo,"markSafe");function Ro(t,n){return t=t??"",n&&!(t instanceof ce)&&(t=Z.escape(t.toString())),t}a(Ro,"suppressValue");function Po(t,n,s){if(t==null)throw new Z.TemplateError("attempted to output null or undefined value",n+1,s+1);return t}a(Po,"ensureDefined");function Io(t,n){if(t!=null)return typeof t[n]=="function"?function(){for(var s=arguments.length,i=new Array(s),e=0;e<s;e++)i[e]=arguments[e];return t[n].apply(t,i)}:t[n]}a(Io,"memberLookup");function Bo(t,n,s,i){if(t){if(typeof t!="function")throw new Error("Unable to call `"+n+"`, which is not a function")}else throw new Error("Unable to call `"+n+"`, which is undefined or falsey");return t.apply(s,i)}a(Bo,"callWrap");function jo(t,n,s){var i=n.lookup(s);return i!==void 0?i:t.lookup(s)}a(jo,"contextOrFrameLookup");function Ko(t,n,s){return t.lineno?t:new Z.TemplateError(t,n,s)}a(Ko,"handleError");function Mo(t,n,s,i){if(Z.isArray(t)){var e=t.length;Z.asyncIter(t,a(function(o,l,c){switch(n){case 1:s(o,l,e,c);break;case 2:s(o[0],o[1],l,e,c);break;case 3:s(o[0],o[1],o[2],l,e,c);break;default:o.push(l,e,c),s.apply(this,o)}},"iterCallback"),i)}else Z.asyncFor(t,a(function(o,l,c,u,f){s(o,l,c,u,f)},"iterCallback"),i)}a(Mo,"asyncEach");function $o(t,n,s,i){var e=0,r,o;function l(g,w){e++,o[g]=w,e===r&&i(null,o.join(""))}if(a(l,"done"),Z.isArray(t))if(r=t.length,o=new Array(r),r===0)i(null,"");else for(var c=0;c<t.length;c++){var u=t[c];switch(n){case 1:s(u,c,r,l);break;case 2:s(u[0],u[1],c,r,l);break;case 3:s(u[0],u[1],u[2],c,r,l);break;default:u.push(c,r,l),s.apply(this,u)}}else{var f=Z.keys(t||{});if(r=f.length,o=new Array(r),r===0)i(null,"");else for(var p=0;p<f.length;p++){var _=f[p];s(_,t[_],p,r,l)}}}a($o,"asyncAll");function Do(t){return typeof t!="object"||t===null||Z.isArray(t)?t:So&&Symbol.iterator in t?In(t):t}a(Do,"fromIterator");Kn.exports={Frame:To,makeMacro:Ao,makeKeywordArgs:Lo,numArgs:jn,suppressValue:Ro,ensureDefined:Po,memberLookup:Io,contextOrFrameLookup:jo,callWrap:Bo,handleError:Ko,isArray:Z.isArray,keys:Z.keys,SafeString:ce,copySafeness:Co,markSafe:Fo,asyncEach:Mo,asyncAll:$o,inOperator:Z.inOperator,fromIterator:Do}});var Ge=M((Dc,$n)=>{"use strict";b();function qo(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,Lt(t,n)}a(qo,"_inheritsLoose");function Lt(t,n){return Lt=Object.setPrototypeOf?Object.setPrototypeOf.bind():a(function(i,e){return i.__proto__=e,i},"_setPrototypeOf"),Lt(t,n)}a(Lt,"_setPrototypeOf");var Uo=xt(),Vo=Pn(),A=Re(),Go=ee(),Wo=Go.TemplateError,Ho=Ee(),At=Ho.Frame,Yo=ye(),zo=Yo.Obj,Xo={"==":"==","===":"===","!=":"!=","!==":"!==","<":"<",">":">","<=":"<=",">=":">="},Mn=function(t){qo(n,t);function n(){return t.apply(this,arguments)||this}a(n,"Compiler");var s=n.prototype;return s.init=a(function(e,r){this.templateName=e,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this._scopeClosers="",this.inBlock=!1,this.throwOnUndefined=r},"init"),s.fail=a(function(e,r,o){throw r!==void 0&&(r+=1),o!==void 0&&(o+=1),new Wo(e,r,o)},"fail"),s._pushBuffer=a(function(){var e=this._tmpid();return this.bufferStack.push(this.buffer),this.buffer=e,this._emit("var "+this.buffer+' = "";'),e},"_pushBuffer"),s._popBuffer=a(function(){this.buffer=this.bufferStack.pop()},"_popBuffer"),s._emit=a(function(e){this.codebuf.push(e)},"_emit"),s._emitLine=a(function(e){this._emit(e+`
18
+ `)},"_emitLine"),s._emitLines=a(function(){for(var e=this,r=arguments.length,o=new Array(r),l=0;l<r;l++)o[l]=arguments[l];o.forEach(function(c){return e._emitLine(c)})},"_emitLines"),s._emitFuncBegin=a(function(e,r){this.buffer="output",this._scopeClosers="",this._emitLine("function "+r+"(env, context, frame, runtime, cb) {"),this._emitLine("var lineno = "+e.lineno+";"),this._emitLine("var colno = "+e.colno+";"),this._emitLine("var "+this.buffer+' = "";'),this._emitLine("try {")},"_emitFuncBegin"),s._emitFuncEnd=a(function(e){e||this._emitLine("cb(null, "+this.buffer+");"),this._closeScopeLevels(),this._emitLine("} catch (e) {"),this._emitLine(" cb(runtime.handleError(e, lineno, colno));"),this._emitLine("}"),this._emitLine("}"),this.buffer=null},"_emitFuncEnd"),s._addScopeLevel=a(function(){this._scopeClosers+="})"},"_addScopeLevel"),s._closeScopeLevels=a(function(){this._emitLine(this._scopeClosers+";"),this._scopeClosers=""},"_closeScopeLevels"),s._withScopedSyntax=a(function(e){var r=this._scopeClosers;this._scopeClosers="",e.call(this),this._closeScopeLevels(),this._scopeClosers=r},"_withScopedSyntax"),s._makeCallback=a(function(e){var r=this._tmpid();return"function("+r+(e?","+e:"")+`) {
19
+ if(`+r+") { cb("+r+"); return; }"},"_makeCallback"),s._tmpid=a(function(){return this.lastId++,"t_"+this.lastId},"_tmpid"),s._templateName=a(function(){return this.templateName==null?"undefined":JSON.stringify(this.templateName)},"_templateName"),s._compileChildren=a(function(e,r){var o=this;e.children.forEach(function(l){o.compile(l,r)})},"_compileChildren"),s._compileAggregate=a(function(e,r,o,l){var c=this;o&&this._emit(o),e.children.forEach(function(u,f){f>0&&c._emit(","),c.compile(u,r)}),l&&this._emit(l)},"_compileAggregate"),s._compileExpression=a(function(e,r){this.assertType(e,A.Literal,A.Symbol,A.Group,A.Array,A.Dict,A.FunCall,A.Caller,A.Filter,A.LookupVal,A.Compare,A.InlineIf,A.In,A.Is,A.And,A.Or,A.Not,A.Add,A.Concat,A.Sub,A.Mul,A.Div,A.FloorDiv,A.Mod,A.Pow,A.Neg,A.Pos,A.Compare,A.NodeList),this.compile(e,r)},"_compileExpression"),s.assertType=a(function(e){for(var r=arguments.length,o=new Array(r>1?r-1:0),l=1;l<r;l++)o[l-1]=arguments[l];o.some(function(c){return e instanceof c})||this.fail("assertType: invalid type: "+e.typename,e.lineno,e.colno)},"assertType"),s.compileCallExtension=a(function(e,r,o){var l=this,c=e.args,u=e.contentArgs,f=typeof e.autoescape=="boolean"?e.autoescape:!0;if(o||this._emit(this.buffer+" += runtime.suppressValue("),this._emit('env.getExtension("'+e.extName+'")["'+e.prop+'"]('),this._emit("context"),(c||u)&&this._emit(","),c&&(c instanceof A.NodeList||this.fail("compileCallExtension: arguments must be a NodeList, use `parser.parseSignature`"),c.children.forEach(function(_,g){l._compileExpression(_,r),(g!==c.children.length-1||u.length)&&l._emit(",")})),u.length&&u.forEach(function(_,g){if(g>0&&l._emit(","),_){l._emitLine("function(cb) {"),l._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var w=l._pushBuffer();l._withScopedSyntax(function(){l.compile(_,r),l._emitLine("cb(null, "+w+");")}),l._popBuffer(),l._emitLine("return "+w+";"),l._emitLine("}")}else l._emit("null")}),o){var p=this._tmpid();this._emitLine(", "+this._makeCallback(p)),this._emitLine(this.buffer+" += runtime.suppressValue("+p+", "+f+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+f+` && env.opts.autoescape);
20
+ `)},"compileCallExtension"),s.compileCallExtensionAsync=a(function(e,r){this.compileCallExtension(e,r,!0)},"compileCallExtensionAsync"),s.compileNodeList=a(function(e,r){this._compileChildren(e,r)},"compileNodeList"),s.compileLiteral=a(function(e){if(typeof e.value=="string"){var r=e.value.replace(/\\/g,"\\\\");r=r.replace(/"/g,'\\"'),r=r.replace(/\n/g,"\\n"),r=r.replace(/\r/g,"\\r"),r=r.replace(/\t/g,"\\t"),r=r.replace(/\u2028/g,"\\u2028"),this._emit('"'+r+'"')}else e.value===null?this._emit("null"):this._emit(e.value.toString())},"compileLiteral"),s.compileSymbol=a(function(e,r){var o=e.value,l=r.lookup(o);l?this._emit(l):this._emit('runtime.contextOrFrameLookup(context, frame, "'+o+'")')},"compileSymbol"),s.compileGroup=a(function(e,r){this._compileAggregate(e,r,"(",")")},"compileGroup"),s.compileArray=a(function(e,r){this._compileAggregate(e,r,"[","]")},"compileArray"),s.compileDict=a(function(e,r){this._compileAggregate(e,r,"{","}")},"compileDict"),s.compilePair=a(function(e,r){var o=e.key,l=e.value;o instanceof A.Symbol?o=new A.Literal(o.lineno,o.colno,o.value):o instanceof A.Literal&&typeof o.value=="string"||this.fail("compilePair: Dict keys must be strings or names",o.lineno,o.colno),this.compile(o,r),this._emit(": "),this._compileExpression(l,r)},"compilePair"),s.compileInlineIf=a(function(e,r){this._emit("("),this.compile(e.cond,r),this._emit("?"),this.compile(e.body,r),this._emit(":"),e.else_!==null?this.compile(e.else_,r):this._emit('""'),this._emit(")")},"compileInlineIf"),s.compileIn=a(function(e,r){this._emit("runtime.inOperator("),this.compile(e.left,r),this._emit(","),this.compile(e.right,r),this._emit(")")},"compileIn"),s.compileIs=a(function(e,r){var o=e.right.name?e.right.name.value:e.right.value;this._emit('env.getTest("'+o+'").call(context, '),this.compile(e.left,r),e.right.args&&(this._emit(","),this.compile(e.right.args,r)),this._emit(") === true")},"compileIs"),s._binOpEmitter=a(function(e,r,o){this.compile(e.left,r),this._emit(o),this.compile(e.right,r)},"_binOpEmitter"),s.compileOr=a(function(e,r){return this._binOpEmitter(e,r," || ")},"compileOr"),s.compileAnd=a(function(e,r){return this._binOpEmitter(e,r," && ")},"compileAnd"),s.compileAdd=a(function(e,r){return this._binOpEmitter(e,r," + ")},"compileAdd"),s.compileConcat=a(function(e,r){return this._binOpEmitter(e,r,' + "" + ')},"compileConcat"),s.compileSub=a(function(e,r){return this._binOpEmitter(e,r," - ")},"compileSub"),s.compileMul=a(function(e,r){return this._binOpEmitter(e,r," * ")},"compileMul"),s.compileDiv=a(function(e,r){return this._binOpEmitter(e,r," / ")},"compileDiv"),s.compileMod=a(function(e,r){return this._binOpEmitter(e,r," % ")},"compileMod"),s.compileNot=a(function(e,r){this._emit("!"),this.compile(e.target,r)},"compileNot"),s.compileFloorDiv=a(function(e,r){this._emit("Math.floor("),this.compile(e.left,r),this._emit(" / "),this.compile(e.right,r),this._emit(")")},"compileFloorDiv"),s.compilePow=a(function(e,r){this._emit("Math.pow("),this.compile(e.left,r),this._emit(", "),this.compile(e.right,r),this._emit(")")},"compilePow"),s.compileNeg=a(function(e,r){this._emit("-"),this.compile(e.target,r)},"compileNeg"),s.compilePos=a(function(e,r){this._emit("+"),this.compile(e.target,r)},"compilePos"),s.compileCompare=a(function(e,r){var o=this;this.compile(e.expr,r),e.ops.forEach(function(l){o._emit(" "+Xo[l.type]+" "),o.compile(l.expr,r)})},"compileCompare"),s.compileLookupVal=a(function(e,r){this._emit("runtime.memberLookup(("),this._compileExpression(e.target,r),this._emit("),"),this._compileExpression(e.val,r),this._emit(")")},"compileLookupVal"),s._getNodeName=a(function(e){switch(e.typename){case"Symbol":return e.value;case"FunCall":return"the return value of ("+this._getNodeName(e.name)+")";case"LookupVal":return this._getNodeName(e.target)+'["'+this._getNodeName(e.val)+'"]';case"Literal":return e.value.toString();default:return"--expression--"}},"_getNodeName"),s.compileFunCall=a(function(e,r){this._emit("(lineno = "+e.lineno+", colno = "+e.colno+", "),this._emit("runtime.callWrap("),this._compileExpression(e.name,r),this._emit(', "'+this._getNodeName(e.name).replace(/"/g,'\\"')+'", context, '),this._compileAggregate(e.args,r,"[","])"),this._emit(")")},"compileFunCall"),s.compileFilter=a(function(e,r){var o=e.name;this.assertType(o,A.Symbol),this._emit('env.getFilter("'+o.value+'").call(context, '),this._compileAggregate(e.args,r),this._emit(")")},"compileFilter"),s.compileFilterAsync=a(function(e,r){var o=e.name,l=e.symbol.value;this.assertType(o,A.Symbol),r.set(l,l),this._emit('env.getFilter("'+o.value+'").call(context, '),this._compileAggregate(e.args,r),this._emitLine(", "+this._makeCallback(l)),this._addScopeLevel()},"compileFilterAsync"),s.compileKeywordArgs=a(function(e,r){this._emit("runtime.makeKeywordArgs("),this.compileDict(e,r),this._emit(")")},"compileKeywordArgs"),s.compileSet=a(function(e,r){var o=this,l=[];e.targets.forEach(function(c){var u=c.value,f=r.lookup(u);f==null&&(f=o._tmpid(),o._emitLine("var "+f+";")),l.push(f)}),e.value?(this._emit(l.join(" = ")+" = "),this._compileExpression(e.value,r),this._emitLine(";")):(this._emit(l.join(" = ")+" = "),this.compile(e.body,r),this._emitLine(";")),e.targets.forEach(function(c,u){var f=l[u],p=c.value;o._emitLine('frame.set("'+p+'", '+f+", true);"),o._emitLine("if(frame.topLevel) {"),o._emitLine('context.setVariable("'+p+'", '+f+");"),o._emitLine("}"),p.charAt(0)!=="_"&&(o._emitLine("if(frame.topLevel) {"),o._emitLine('context.addExport("'+p+'", '+f+");"),o._emitLine("}"))})},"compileSet"),s.compileSwitch=a(function(e,r){var o=this;this._emit("switch ("),this.compile(e.expr,r),this._emit(") {"),e.cases.forEach(function(l,c){o._emit("case "),o.compile(l.cond,r),o._emit(": "),o.compile(l.body,r),l.body.children.length&&o._emitLine("break;")}),e.default&&(this._emit("default:"),this.compile(e.default,r)),this._emit("}")},"compileSwitch"),s.compileIf=a(function(e,r,o){var l=this;this._emit("if("),this._compileExpression(e.cond,r),this._emitLine(") {"),this._withScopedSyntax(function(){l.compile(e.body,r),o&&l._emit("cb()")}),e.else_?(this._emitLine(`}
21
+ else {`),this._withScopedSyntax(function(){l.compile(e.else_,r),o&&l._emit("cb()")})):o&&(this._emitLine(`}
22
+ else {`),this._emit("cb()")),this._emitLine("}")},"compileIf"),s.compileIfAsync=a(function(e,r){this._emit("(function(cb) {"),this.compileIf(e,r,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},"compileIfAsync"),s._emitLoopBindings=a(function(e,r,o,l){var c=this,u=[{name:"index",val:o+" + 1"},{name:"index0",val:o},{name:"revindex",val:l+" - "+o},{name:"revindex0",val:l+" - "+o+" - 1"},{name:"first",val:o+" === 0"},{name:"last",val:o+" === "+l+" - 1"},{name:"length",val:l}];u.forEach(function(f){c._emitLine('frame.set("loop.'+f.name+'", '+f.val+");")})},"_emitLoopBindings"),s.compileFor=a(function(e,r){var o=this,l=this._tmpid(),c=this._tmpid(),u=this._tmpid();if(r=r.push(),this._emitLine("frame = frame.push();"),this._emit("var "+u+" = "),this._compileExpression(e.arr,r),this._emitLine(";"),this._emit("if("+u+") {"),this._emitLine(u+" = runtime.fromIterator("+u+");"),e.name instanceof A.Array){this._emitLine("var "+l+";"),this._emitLine("if(runtime.isArray("+u+")) {"),this._emitLine("var "+c+" = "+u+".length;"),this._emitLine("for("+l+"=0; "+l+" < "+u+".length; "+l+"++) {"),e.name.children.forEach(function(k,v){var h=o._tmpid();o._emitLine("var "+h+" = "+u+"["+l+"]["+v+"];"),o._emitLine('frame.set("'+k+'", '+u+"["+l+"]["+v+"]);"),r.set(e.name.children[v].value,h)}),this._emitLoopBindings(e,u,l,c),this._withScopedSyntax(function(){o.compile(e.body,r)}),this._emitLine("}"),this._emitLine("} else {");var f=e.name.children,p=f[0],_=f[1],g=this._tmpid(),w=this._tmpid();r.set(p.value,g),r.set(_.value,w),this._emitLine(l+" = -1;"),this._emitLine("var "+c+" = runtime.keys("+u+").length;"),this._emitLine("for(var "+g+" in "+u+") {"),this._emitLine(l+"++;"),this._emitLine("var "+w+" = "+u+"["+g+"];"),this._emitLine('frame.set("'+p.value+'", '+g+");"),this._emitLine('frame.set("'+_.value+'", '+w+");"),this._emitLoopBindings(e,u,l,c),this._withScopedSyntax(function(){o.compile(e.body,r)}),this._emitLine("}"),this._emitLine("}")}else{var x=this._tmpid();r.set(e.name.value,x),this._emitLine("var "+c+" = "+u+".length;"),this._emitLine("for(var "+l+"=0; "+l+" < "+u+".length; "+l+"++) {"),this._emitLine("var "+x+" = "+u+"["+l+"];"),this._emitLine('frame.set("'+e.name.value+'", '+x+");"),this._emitLoopBindings(e,u,l,c),this._withScopedSyntax(function(){o.compile(e.body,r)}),this._emitLine("}")}this._emitLine("}"),e.else_&&(this._emitLine("if (!"+c+") {"),this.compile(e.else_,r),this._emitLine("}")),this._emitLine("frame = frame.pop();")},"compileFor"),s._compileAsyncLoop=a(function(e,r,o){var l=this,c=this._tmpid(),u=this._tmpid(),f=this._tmpid(),p=o?"asyncAll":"asyncEach";if(r=r.push(),this._emitLine("frame = frame.push();"),this._emit("var "+f+" = runtime.fromIterator("),this._compileExpression(e.arr,r),this._emitLine(");"),e.name instanceof A.Array){var _=e.name.children.length;this._emit("runtime."+p+"("+f+", "+_+", function("),e.name.children.forEach(function(x){l._emit(x.value+",")}),this._emit(c+","+u+",next) {"),e.name.children.forEach(function(x){var k=x.value;r.set(k,k),l._emitLine('frame.set("'+k+'", '+k+");")})}else{var g=e.name.value;this._emitLine("runtime."+p+"("+f+", 1, function("+g+", "+c+", "+u+",next) {"),this._emitLine('frame.set("'+g+'", '+g+");"),r.set(g,g)}this._emitLoopBindings(e,f,c,u),this._withScopedSyntax(function(){var x;o&&(x=l._pushBuffer()),l.compile(e.body,r),l._emitLine("next("+c+(x?","+x:"")+");"),o&&l._popBuffer()});var w=this._tmpid();this._emitLine("}, "+this._makeCallback(w)),this._addScopeLevel(),o&&this._emitLine(this.buffer+" += "+w+";"),e.else_&&(this._emitLine("if (!"+f+".length) {"),this.compile(e.else_,r),this._emitLine("}")),this._emitLine("frame = frame.pop();")},"_compileAsyncLoop"),s.compileAsyncEach=a(function(e,r){this._compileAsyncLoop(e,r)},"compileAsyncEach"),s.compileAsyncAll=a(function(e,r){this._compileAsyncLoop(e,r,!0)},"compileAsyncAll"),s._compileMacro=a(function(e,r){var o=this,l=[],c=null,u="macro_"+this._tmpid(),f=r!==void 0;e.args.children.forEach(function(k,v){v===e.args.children.length-1&&k instanceof A.Dict?c=k:(o.assertType(k,A.Symbol),l.push(k))});var p=[].concat(l.map(function(k){return"l_"+k.value}),["kwargs"]),_=l.map(function(k){return'"'+k.value+'"'}),g=(c&&c.children||[]).map(function(k){return'"'+k.key.value+'"'}),w;f?w=r.push(!0):w=new At,this._emitLines("var "+u+" = runtime.makeMacro(","["+_.join(", ")+"], ","["+g.join(", ")+"], ","function ("+p.join(", ")+") {","var callerFrame = frame;","frame = "+(f?"frame.push(true);":"new runtime.Frame();"),"kwargs = kwargs || {};",'if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {','frame.set("caller", kwargs.caller); }'),l.forEach(function(k){o._emitLine('frame.set("'+k.value+'", l_'+k.value+");"),w.set(k.value,"l_"+k.value)}),c&&c.children.forEach(function(k){var v=k.key.value;o._emit('frame.set("'+v+'", '),o._emit('Object.prototype.hasOwnProperty.call(kwargs, "'+v+'")'),o._emit(' ? kwargs["'+v+'"] : '),o._compileExpression(k.value,w),o._emit(");")});var x=this._pushBuffer();return this._withScopedSyntax(function(){o.compile(e.body,w)}),this._emitLine("frame = "+(f?"frame.pop();":"callerFrame;")),this._emitLine("return new runtime.SafeString("+x+");"),this._emitLine("});"),this._popBuffer(),u},"_compileMacro"),s.compileMacro=a(function(e,r){var o=this._compileMacro(e),l=e.name.value;r.set(l,o),r.parent?this._emitLine('frame.set("'+l+'", '+o+");"):(e.name.value.charAt(0)!=="_"&&this._emitLine('context.addExport("'+l+'");'),this._emitLine('context.setVariable("'+l+'", '+o+");"))},"compileMacro"),s.compileCaller=a(function(e,r){this._emit("(function (){");var o=this._compileMacro(e,r);this._emit("return "+o+";})()")},"compileCaller"),s._compileGetTemplate=a(function(e,r,o,l){var c=this._tmpid(),u=this._templateName(),f=this._makeCallback(c),p=o?"true":"false",_=l?"true":"false";return this._emit("env.getTemplate("),this._compileExpression(e.template,r),this._emitLine(", "+p+", "+u+", "+_+", "+f),c},"_compileGetTemplate"),s.compileImport=a(function(e,r){var o=e.target.value,l=this._compileGetTemplate(e,r,!1,!1);this._addScopeLevel(),this._emitLine(l+".getExported("+(e.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(l)),this._addScopeLevel(),r.set(o,l),r.parent?this._emitLine('frame.set("'+o+'", '+l+");"):this._emitLine('context.setVariable("'+o+'", '+l+");")},"compileImport"),s.compileFromImport=a(function(e,r){var o=this,l=this._compileGetTemplate(e,r,!1,!1);this._addScopeLevel(),this._emitLine(l+".getExported("+(e.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(l)),this._addScopeLevel(),e.names.children.forEach(function(c){var u,f,p=o._tmpid();c instanceof A.Pair?(u=c.key.value,f=c.value.value):(u=c.value,f=u),o._emitLine("if(Object.prototype.hasOwnProperty.call("+l+', "'+u+'")) {'),o._emitLine("var "+p+" = "+l+"."+u+";"),o._emitLine("} else {"),o._emitLine(`cb(new Error("cannot import '`+u+`'")); return;`),o._emitLine("}"),r.set(f,p),r.parent?o._emitLine('frame.set("'+f+'", '+p+");"):o._emitLine('context.setVariable("'+f+'", '+p+");")})},"compileFromImport"),s.compileBlock=a(function(e){var r=this._tmpid();this.inBlock||this._emit('(parentTemplate ? function(e, c, f, r, cb) { cb(""); } : '),this._emit('context.getBlock("'+e.name.value+'")'),this.inBlock||this._emit(")"),this._emitLine("(env, context, frame, runtime, "+this._makeCallback(r)),this._emitLine(this.buffer+" += "+r+";"),this._addScopeLevel()},"compileBlock"),s.compileSuper=a(function(e,r){var o=e.blockName.value,l=e.symbol.value,c=this._makeCallback(l);this._emitLine('context.getSuper(env, "'+o+'", b_'+o+", frame, runtime, "+c),this._emitLine(l+" = runtime.markSafe("+l+");"),this._addScopeLevel(),r.set(l,l)},"compileSuper"),s.compileExtends=a(function(e,r){var o=this._tmpid(),l=this._compileGetTemplate(e,r,!0,!1);this._emitLine("parentTemplate = "+l),this._emitLine("for(var "+o+" in parentTemplate.blocks) {"),this._emitLine("context.addBlock("+o+", parentTemplate.blocks["+o+"]);"),this._emitLine("}"),this._addScopeLevel()},"compileExtends"),s.compileInclude=a(function(e,r){this._emitLine("var tasks = [];"),this._emitLine("tasks.push("),this._emitLine("function(callback) {");var o=this._compileGetTemplate(e,r,!1,e.ignoreMissing);this._emitLine("callback(null,"+o+");});"),this._emitLine("});");var l=this._tmpid();this._emitLine("tasks.push("),this._emitLine("function(template, callback){"),this._emitLine("template.render(context.getVariables(), frame, "+this._makeCallback(l)),this._emitLine("callback(null,"+l+");});"),this._emitLine("});"),this._emitLine("tasks.push("),this._emitLine("function(result, callback){"),this._emitLine(this.buffer+" += result;"),this._emitLine("callback(null);"),this._emitLine("});"),this._emitLine("env.waterfall(tasks, function(){"),this._addScopeLevel()},"compileInclude"),s.compileTemplateData=a(function(e,r){this.compileLiteral(e,r)},"compileTemplateData"),s.compileCapture=a(function(e,r){var o=this,l=this.buffer;this.buffer="output",this._emitLine("(function() {"),this._emitLine('var output = "";'),this._withScopedSyntax(function(){o.compile(e.body,r)}),this._emitLine("return output;"),this._emitLine("})()"),this.buffer=l},"compileCapture"),s.compileOutput=a(function(e,r){var o=this,l=e.children;l.forEach(function(c){c instanceof A.TemplateData?c.value&&(o._emit(o.buffer+" += "),o.compileLiteral(c,r),o._emitLine(";")):(o._emit(o.buffer+" += runtime.suppressValue("),o.throwOnUndefined&&o._emit("runtime.ensureDefined("),o.compile(c,r),o.throwOnUndefined&&o._emit(","+e.lineno+","+e.colno+")"),o._emit(`, env.opts.autoescape);
23
+ `))})},"compileOutput"),s.compileRoot=a(function(e,r){var o=this;r&&this.fail("compileRoot: root node can't have frame"),r=new At,this._emitFuncBegin(e,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(e,r),this._emitLine("if(parentTemplate) {"),this._emitLine("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this._emitLine("} else {"),this._emitLine("cb(null, "+this.buffer+");"),this._emitLine("}"),this._emitFuncEnd(!0),this.inBlock=!0;var l=[],c=e.findAll(A.Block);c.forEach(function(u,f){var p=u.name.value;if(l.indexOf(p)!==-1)throw new Error('Block "'+p+'" defined more than once.');l.push(p),o._emitFuncBegin(u,"b_"+p);var _=new At;o._emitLine("var frame = frame.push(true);"),o.compile(u.body,_),o._emitFuncEnd()}),this._emitLine("return {"),c.forEach(function(u,f){var p="b_"+u.name.value;o._emitLine(p+": "+p+",")}),this._emitLine(`root: root
24
+ };`)},"compileRoot"),s.compile=a(function(e,r){var o=this["compile"+e.typename];o?o.call(this,e,r):this.fail("compile: Cannot compile node: "+e.typename,e.lineno,e.colno)},"compile"),s.getCode=a(function(){return this.codebuf.join("")},"getCode"),n}(zo);$n.exports={compile:a(function(n,s,i,e,r){r===void 0&&(r={});var o=new Mn(e,r.throwOnUndefined),l=(i||[]).map(function(u){return u.preprocess}).filter(function(u){return!!u}),c=l.reduce(function(u,f){return f(u)},n);return o.compile(Vo.transform(Uo.parse(c,i,r),s,e)),o.getCode()},"compile"),Compiler:Mn}});var Wn=M((Vc,Gn)=>{"use strict";b();var F=ee(),q=Ee(),S=Gn.exports={};function se(t,n){return t==null||t===!1?n:t}a(se,"normalize");S.abs=Math.abs;function Nt(t){return t!==t}a(Nt,"isNaN");function Jo(t,n,s){var i,e=[],r=[];for(i=0;i<t.length;i++)i%n===0&&r.length&&(e.push(r),r=[]),r.push(t[i]);if(r.length){if(s)for(i=r.length;i<n;i++)r.push(s);e.push(r)}return e}a(Jo,"batch");S.batch=Jo;function Dn(t){t=se(t,"");var n=t.toLowerCase();return q.copySafeness(t,n.charAt(0).toUpperCase()+n.slice(1))}a(Dn,"capitalize");S.capitalize=Dn;function Qo(t,n){if(t=se(t,""),n=n||80,t.length>=n)return t;var s=n-t.length,i=F.repeat(" ",s/2-s%2),e=F.repeat(" ",s/2);return q.copySafeness(t,i+t+e)}a(Qo,"center");S.center=Qo;function Zo(t,n,s){return s?t||n:t!==void 0?t:n}a(Zo,"default_");S.default=Zo;function ea(t,n,s){if(!F.isObject(t))throw new F.TemplateError("dictsort filter: val must be an object");var i=[];for(var e in t)i.push([e,t[e]]);var r;if(s===void 0||s==="key")r=0;else if(s==="value")r=1;else throw new F.TemplateError("dictsort filter: You can only sort by either key or value");return i.sort(function(o,l){var c=o[r],u=l[r];return n||(F.isString(c)&&(c=c.toUpperCase()),F.isString(u)&&(u=u.toUpperCase())),c>u?1:c===u?0:-1}),i}a(ea,"dictsort");S.dictsort=ea;function ta(t,n){return JSON.stringify(t,null,n)}a(ta,"dump");S.dump=ta;function ra(t){return t instanceof q.SafeString?t:(t=t??"",q.markSafe(F.escape(t.toString())))}a(ra,"escape");S.escape=ra;function na(t){return t instanceof q.SafeString?t:(t=t??"",q.markSafe(t.toString()))}a(na,"safe");S.safe=na;function ia(t){return t[0]}a(ia,"first");S.first=ia;function sa(t){return t=t??"",q.markSafe(F.escape(t.toString()))}a(sa,"forceescape");S.forceescape=sa;function oa(t,n){return F.groupBy(t,n,this.env.opts.throwOnUndefined)}a(oa,"groupby");S.groupby=oa;function aa(t,n,s){if(t=se(t,""),t==="")return"";n=n||4;var i=t.split(`
25
+ `),e=F.repeat(" ",n),r=i.map(function(o,l){return l===0&&!s?o:""+e+o}).join(`
26
+ `);return q.copySafeness(t,r)}a(aa,"indent");S.indent=aa;function la(t,n,s){return n=n||"",s&&(t=F.map(t,function(i){return i[s]})),t.join(n)}a(la,"join");S.join=la;function ca(t){return t[t.length-1]}a(ca,"last");S.last=ca;function ua(t){var n=se(t,"");return n!==void 0?typeof Map=="function"&&n instanceof Map||typeof Set=="function"&&n instanceof Set?n.size:F.isObject(n)&&!(n instanceof q.SafeString)?F.keys(n).length:n.length:0}a(ua,"lengthFilter");S.length=ua;function qn(t){if(F.isString(t))return t.split("");if(F.isObject(t))return F._entries(t||{}).map(function(n){var s=n[0],i=n[1];return{key:s,value:i}});if(F.isArray(t))return t;throw new F.TemplateError("list filter: type not iterable")}a(qn,"list");S.list=qn;function fa(t){return t=se(t,""),t.toLowerCase()}a(fa,"lower");S.lower=fa;function pa(t){return t==null?"":q.copySafeness(t,t.replace(/\r\n|\n/g,`<br />
27
+ `))}a(pa,"nl2br");S.nl2br=pa;function ha(t){return t[Math.floor(Math.random()*t.length)]}a(ha,"random");S.random=ha;function Un(t){function n(s,i,e){i===void 0&&(i="truthy");var r=this,o=r.env.getTest(i);return F.toArray(s).filter(a(function(c){return o.call(r,c,e)===t},"examineTestResult"))}return a(n,"filter"),n}a(Un,"getSelectOrReject");S.reject=Un(!1);function ma(t,n){return t.filter(function(s){return!s[n]})}a(ma,"rejectattr");S.rejectattr=ma;S.select=Un(!0);function da(t,n){return t.filter(function(s){return!!s[n]})}a(da,"selectattr");S.selectattr=da;function va(t,n,s,i){var e=t;if(n instanceof RegExp)return t.replace(n,s);typeof i>"u"&&(i=-1);var r="";if(typeof n=="number")n=""+n;else if(typeof n!="string")return t;if(typeof t=="number"&&(t=""+t),typeof t!="string"&&!(t instanceof q.SafeString))return t;if(n==="")return r=s+t.split("").join(s)+s,q.copySafeness(t,r);var o=t.indexOf(n);if(i===0||o===-1)return t;for(var l=0,c=0;o>-1&&(i===-1||c<i);)r+=t.substring(l,o)+s,l=o+n.length,c++,o=t.indexOf(n,l);return l<t.length&&(r+=t.substring(l)),q.copySafeness(e,r)}a(va,"replace");S.replace=va;function _a(t){var n;return F.isString(t)?n=qn(t):n=F.map(t,function(s){return s}),n.reverse(),F.isString(t)?q.copySafeness(t,n.join("")):n}a(_a,"reverse");S.reverse=_a;function ga(t,n,s){n=n||0;var i=Math.pow(10,n),e;return s==="ceil"?e=Math.ceil:s==="floor"?e=Math.floor:e=Math.round,e(t*i)/i}a(ga,"round");S.round=ga;function ya(t,n,s){for(var i=Math.floor(t.length/n),e=t.length%n,r=[],o=0,l=0;l<n;l++){var c=o+l*i;l<e&&o++;var u=o+(l+1)*i,f=t.slice(c,u);s&&l>=e&&f.push(s),r.push(f)}return r}a(ya,"slice");S.slice=ya;function ka(t,n,s){return s===void 0&&(s=0),n&&(t=F.map(t,function(i){return i[n]})),s+t.reduce(function(i,e){return i+e},0)}a(ka,"sum");S.sum=ka;S.sort=q.makeMacro(["value","reverse","case_sensitive","attribute"],[],a(function(n,s,i,e){var r=this,o=F.map(n,function(c){return c}),l=F.getAttrGetter(e);return o.sort(function(c,u){var f=e?l(c):c,p=e?l(u):u;if(r.env.opts.throwOnUndefined&&e&&(f===void 0||p===void 0))throw new TypeError('sort: attribute "'+e+'" resolved to undefined');return!i&&F.isString(f)&&F.isString(p)&&(f=f.toLowerCase(),p=p.toLowerCase()),f<p?s?1:-1:f>p?s?-1:1:0}),o},"sortFilter"));function Ea(t){return q.copySafeness(t,t)}a(Ea,"string");S.string=Ea;function wa(t,n){t=se(t,"");var s=/<\/?([a-z][a-z0-9]*)\b[^>]*>|<!--[\s\S]*?-->/gi,i=Vn(t.replace(s,"")),e="";return n?e=i.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,`
28
+ `).replace(/\n\n\n+/g,`
29
+
30
+ `):e=i.replace(/\s+/gi," "),q.copySafeness(t,e)}a(wa,"striptags");S.striptags=wa;function ba(t){t=se(t,"");var n=t.split(" ").map(function(s){return Dn(s)});return q.copySafeness(t,n.join(" "))}a(ba,"title");S.title=ba;function Vn(t){return q.copySafeness(t,t.replace(/^\s*|\s*$/g,""))}a(Vn,"trim");S.trim=Vn;function Oa(t,n,s,i){var e=t;if(t=se(t,""),n=n||255,t.length<=n)return t;if(s)t=t.substring(0,n);else{var r=t.lastIndexOf(" ",n);r===-1&&(r=n),t=t.substring(0,r)}return t+=i??"...",q.copySafeness(e,t)}a(Oa,"truncate");S.truncate=Oa;function xa(t){return t=se(t,""),t.toUpperCase()}a(xa,"upper");S.upper=xa;function Sa(t){var n=encodeURIComponent;if(F.isString(t))return n(t);var s=F.isArray(t)?t:F._entries(t);return s.map(function(i){var e=i[0],r=i[1];return n(e)+"="+n(r)}).join("&")}a(Sa,"urlencode");S.urlencode=Sa;var Ta=/^(?:\(|<|&lt;)?(.*?)(?:\.|,|\)|\n|&gt;)?$/,Aa=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,La=/^https?:\/\/.*$/,Na=/^www\./,Ca=/\.(?:org|net|com)(?:\:|\/|$)/;function Fa(t,n,s){Nt(n)&&(n=1/0);var i=s===!0?' rel="nofollow"':"",e=t.split(/(\s+)/).filter(function(r){return r&&r.length}).map(function(r){var o=r.match(Ta),l=o?o[1]:r,c=l.substr(0,n);return La.test(l)?'<a href="'+l+'"'+i+">"+c+"</a>":Na.test(l)?'<a href="http://'+l+'"'+i+">"+c+"</a>":Aa.test(l)?'<a href="mailto:'+l+'">'+l+"</a>":Ca.test(l)?'<a href="http://'+l+'"'+i+">"+c+"</a>":r});return e.join("")}a(Fa,"urlize");S.urlize=Fa;function Ra(t){t=se(t,"");var n=t?t.match(/\w+/g):null;return n?n.length:null}a(Ra,"wordcount");S.wordcount=Ra;function Pa(t,n){var s=parseFloat(t);return Nt(s)?n:s}a(Pa,"float");S.float=Pa;var Ia=q.makeMacro(["value","default","base"],[],a(function(n,s,i){i===void 0&&(i=10);var e=parseInt(n,i);return Nt(e)?s:e},"doInt"));S.int=Ia;S.d=S.default;S.e=S.escape});var We=M((Hc,Yn)=>{"use strict";b();function Ba(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,Ct(t,n)}a(Ba,"_inheritsLoose");function Ct(t,n){return Ct=Object.setPrototypeOf?Object.setPrototypeOf.bind():a(function(i,e){return i.__proto__=e,i},"_setPrototypeOf"),Ct(t,n)}a(Ct,"_setPrototypeOf");var Hn=Q("path"),ja=ye(),Ka=ja.EmitterObj;Yn.exports=function(t){Ba(n,t);function n(){return t.apply(this,arguments)||this}a(n,"Loader");var s=n.prototype;return s.resolve=a(function(e,r){return Hn.resolve(Hn.dirname(e),r)},"resolve"),s.isRelative=a(function(e){return e.indexOf("./")===0||e.indexOf("../")===0},"isRelative"),n}(Ka)});var Xn=M((Xc,zn)=>{"use strict";b();function Ma(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,Ft(t,n)}a(Ma,"_inheritsLoose");function Ft(t,n){return Ft=Object.setPrototypeOf?Object.setPrototypeOf.bind():a(function(i,e){return i.__proto__=e,i},"_setPrototypeOf"),Ft(t,n)}a(Ft,"_setPrototypeOf");var $a=We(),Da=function(t){Ma(n,t);function n(i){var e;return e=t.call(this)||this,e.precompiled=i||{},e}a(n,"PrecompiledLoader");var s=n.prototype;return s.getSource=a(function(e){return this.precompiled[e]?{src:{type:"code",obj:this.precompiled[e]},path:e}:null},"getSource"),n}($a);zn.exports={PrecompiledLoader:Da}});var ei=M((Zc,Zn)=>{"use strict";b();function Jn(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,Rt(t,n)}a(Jn,"_inheritsLoose");function Rt(t,n){return Rt=Object.setPrototypeOf?Object.setPrototypeOf.bind():a(function(i,e){return i.__proto__=e,i},"_setPrototypeOf"),Rt(t,n)}a(Rt,"_setPrototypeOf");var Ye=Q("fs"),He=Q("path"),Qn=We(),qa=Xn(),Ua=qa.PrecompiledLoader,ze,Va=function(t){Jn(n,t);function n(i,e){var r;if(r=t.call(this)||this,typeof e=="boolean"&&console.log("[nunjucks] Warning: you passed a boolean as the second argument to FileSystemLoader, but it now takes an options object. See http://mozilla.github.io/nunjucks/api.html#filesystemloader"),e=e||{},r.pathsToNames={},r.noCache=!!e.noCache,i?(i=Array.isArray(i)?i:[i],r.searchPaths=i.map(He.normalize)):r.searchPaths=["."],e.watch){try{ze=Q("chokidar")}catch{throw new Error("watch requires chokidar to be installed")}var o=r.searchPaths.filter(Ye.existsSync),l=ze.watch(o);l.on("all",function(c,u){u=He.resolve(u),c==="change"&&u in r.pathsToNames&&r.emit("update",r.pathsToNames[u],u)}),l.on("error",function(c){console.log("Watcher error: "+c)})}return r}a(n,"FileSystemLoader");var s=n.prototype;return s.getSource=a(function(e){for(var r=null,o=this.searchPaths,l=0;l<o.length;l++){var c=He.resolve(o[l]),u=He.resolve(o[l],e);if(u.indexOf(c)===0&&Ye.existsSync(u)){r=u;break}}if(!r)return null;this.pathsToNames[r]=e;var f={src:Ye.readFileSync(r,"utf-8"),path:r,noCache:this.noCache};return this.emit("load",e,f),f},"getSource"),n}(Qn),Ga=function(t){Jn(n,t);function n(i){var e;if(e=t.call(this)||this,i=i||{},e.pathsToNames={},e.noCache=!!i.noCache,i.watch){try{ze=Q("chokidar")}catch{throw new Error("watch requires chokidar to be installed")}e.watcher=ze.watch(),e.watcher.on("change",function(r){e.emit("update",e.pathsToNames[r],r)}),e.watcher.on("error",function(r){console.log("Watcher error: "+r)}),e.on("load",function(r,o){e.watcher.add(o.path)})}return e}a(n,"NodeResolveLoader");var s=n.prototype;return s.getSource=a(function(e){if(/^\.?\.?(\/|\\)/.test(e)||/^[A-Z]:/.test(e))return null;var r;try{r=Q.resolve(e)}catch{return null}this.pathsToNames[r]=e;var o={src:Ye.readFileSync(r,"utf-8"),path:r,noCache:this.noCache};return this.emit("load",e,o),o},"getSource"),n}(Qn);Zn.exports={FileSystemLoader:Va,PrecompiledLoader:Ua,NodeResolveLoader:Ga}});var Pt=M((ru,ti)=>{"use strict";b();ti.exports=ei()});var ri=M(R=>{"use strict";b();var Wa=Ee().SafeString;function Ha(t){return typeof t=="function"}a(Ha,"callable");R.callable=Ha;function Ya(t){return t!==void 0}a(Ya,"defined");R.defined=Ya;function za(t,n){return t%n===0}a(za,"divisibleby");R.divisibleby=za;function Xa(t){return t instanceof Wa}a(Xa,"escaped");R.escaped=Xa;function Ja(t,n){return t===n}a(Ja,"equalto");R.equalto=Ja;R.eq=R.equalto;R.sameas=R.equalto;function Qa(t){return t%2===0}a(Qa,"even");R.even=Qa;function Za(t){return!t}a(Za,"falsy");R.falsy=Za;function el(t,n){return t>=n}a(el,"ge");R.ge=el;function tl(t,n){return t>n}a(tl,"greaterthan");R.greaterthan=tl;R.gt=R.greaterthan;function rl(t,n){return t<=n}a(rl,"le");R.le=rl;function nl(t,n){return t<n}a(nl,"lessthan");R.lessthan=nl;R.lt=R.lessthan;function il(t){return t.toLowerCase()===t}a(il,"lower");R.lower=il;function sl(t,n){return t!==n}a(sl,"ne");R.ne=sl;function ol(t){return t===null}a(ol,"nullTest");R.null=ol;function al(t){return typeof t=="number"}a(al,"number");R.number=al;function ll(t){return t%2===1}a(ll,"odd");R.odd=ll;function cl(t){return typeof t=="string"}a(cl,"string");R.string=cl;function ul(t){return!!t}a(ul,"truthy");R.truthy=ul;function fl(t){return t===void 0}a(fl,"undefinedTest");R.undefined=fl;function pl(t){return t.toUpperCase()===t}a(pl,"upper");R.upper=pl;function hl(t){return typeof Symbol<"u"?!!t[Symbol.iterator]:Array.isArray(t)||typeof t=="string"}a(hl,"iterable");R.iterable=hl;function ml(t){var n=t!=null&&typeof t=="object"&&!Array.isArray(t);return Set?n&&!(t instanceof Set):n}a(ml,"mapping");R.mapping=ml});var ii=M((au,ni)=>{"use strict";b();function dl(t){var n=-1;return{current:null,reset:a(function(){n=-1,this.current=null},"reset"),next:a(function(){return n++,n>=t.length&&(n=0),this.current=t[n],this.current},"next")}}a(dl,"_cycler");function vl(t){t=t||",";var n=!0;return function(){var s=n?"":t;return n=!1,s}}a(vl,"_joiner");function _l(){return{range:a(function(n,s,i){typeof s>"u"?(s=n,n=0,i=1):i||(i=1);var e=[];if(i>0)for(var r=n;r<s;r+=i)e.push(r);else for(var o=n;o>s;o+=i)e.push(o);return e},"range"),cycler:a(function(){return dl(Array.prototype.slice.call(arguments))},"cycler"),joiner:a(function(n){return vl(n)},"joiner")}}a(_l,"globals");ni.exports=_l});var oi=M((uu,si)=>{"use strict";b();var gl=Q("path");si.exports=a(function(n,s){function i(e,r){if(this.name=e,this.path=e,this.defaultEngine=r.defaultEngine,this.ext=gl.extname(e),!this.ext&&!this.defaultEngine)throw new Error("No default engine was specified and no extension was provided.");this.ext||(this.name+=this.ext=(this.defaultEngine[0]!=="."?".":"")+this.defaultEngine)}return a(i,"NunjucksView"),i.prototype.render=a(function(r,o){n.render(this.name,r,o)},"render"),s.set("view",i),s.set("nunjucksEnv",n),n},"express")});var $t=M((hu,hi)=>{"use strict";b();function jt(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,It(t,n)}a(jt,"_inheritsLoose");function It(t,n){return It=Object.setPrototypeOf?Object.setPrototypeOf.bind():a(function(i,e){return i.__proto__=e,i},"_setPrototypeOf"),It(t,n)}a(It,"_setPrototypeOf");var yl=Kr(),kl=$r(),V=ee(),El=Ge(),wl=Wn(),Kt=Pt(),ai=Kt.FileSystemLoader,li=Kt.WebLoader,bl=Kt.PrecompiledLoader,Ol=ri(),xl=ii(),fi=ye(),pi=fi.Obj,Sl=fi.EmitterObj,Xe=Ee(),Tl=Xe.handleError,ci=Xe.Frame,Al=oi();function Bt(t,n,s){yl(function(){t(n,s)})}a(Bt,"callbackAsap");var Ll={type:"code",obj:{root:a(function(n,s,i,e,r){try{r(null,"")}catch(o){r(Tl(o,null,null))}},"root")}},Mt=function(t){jt(n,t);function n(){return t.apply(this,arguments)||this}a(n,"Environment");var s=n.prototype;return s.init=a(function(e,r){var o=this;r=this.opts=r||{},this.opts.dev=!!r.dev,this.opts.autoescape=r.autoescape!=null?r.autoescape:!0,this.opts.throwOnUndefined=!!r.throwOnUndefined,this.opts.trimBlocks=!!r.trimBlocks,this.opts.lstripBlocks=!!r.lstripBlocks,this.loaders=[],e?this.loaders=V.isArray(e)?e:[e]:ai?this.loaders=[new ai("views")]:li&&(this.loaders=[new li("/views")]),typeof window<"u"&&window.nunjucksPrecompiled&&this.loaders.unshift(new bl(window.nunjucksPrecompiled)),this._initLoaders(),this.globals=xl(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],V._entries(wl).forEach(function(l){var c=l[0],u=l[1];return o.addFilter(c,u)}),V._entries(Ol).forEach(function(l){var c=l[0],u=l[1];return o.addTest(c,u)})},"init"),s._initLoaders=a(function(){var e=this;this.loaders.forEach(function(r){r.cache={},typeof r.on=="function"&&(r.on("update",function(o,l){r.cache[o]=null,e.emit("update",o,l,r)}),r.on("load",function(o,l){e.emit("load",o,l,r)}))})},"_initLoaders"),s.invalidateCache=a(function(){this.loaders.forEach(function(e){e.cache={}})},"invalidateCache"),s.addExtension=a(function(e,r){return r.__name=e,this.extensions[e]=r,this.extensionsList.push(r),this},"addExtension"),s.removeExtension=a(function(e){var r=this.getExtension(e);r&&(this.extensionsList=V.without(this.extensionsList,r),delete this.extensions[e])},"removeExtension"),s.getExtension=a(function(e){return this.extensions[e]},"getExtension"),s.hasExtension=a(function(e){return!!this.extensions[e]},"hasExtension"),s.addGlobal=a(function(e,r){return this.globals[e]=r,this},"addGlobal"),s.getGlobal=a(function(e){if(typeof this.globals[e]>"u")throw new Error("global not found: "+e);return this.globals[e]},"getGlobal"),s.addFilter=a(function(e,r,o){var l=r;return o&&this.asyncFilters.push(e),this.filters[e]=l,this},"addFilter"),s.getFilter=a(function(e){if(!this.filters[e])throw new Error("filter not found: "+e);return this.filters[e]},"getFilter"),s.addTest=a(function(e,r){return this.tests[e]=r,this},"addTest"),s.getTest=a(function(e){if(!this.tests[e])throw new Error("test not found: "+e);return this.tests[e]},"getTest"),s.resolveTemplate=a(function(e,r,o){var l=e.isRelative&&r?e.isRelative(o):!1;return l&&e.resolve?e.resolve(r,o):o},"resolveTemplate"),s.getTemplate=a(function(e,r,o,l,c){var u=this,f=this,p=null;if(e&&e.raw&&(e=e.raw),V.isFunction(o)&&(c=o,o=null,r=r||!1),V.isFunction(r)&&(c=r,r=!1),e instanceof Ie)p=e;else{if(typeof e!="string")throw new Error("template names must be a string: "+e);for(var _=0;_<this.loaders.length;_++){var g=this.loaders[_];if(p=g.cache[this.resolveTemplate(g,o,e)],p)break}}if(p)if(r&&p.compile(),c){c(null,p);return}else return p;var w,x=a(function(v,h){if(!h&&!v&&!l&&(v=new Error("template not found: "+e)),v)if(c){c(v);return}else throw v;var m;h?(m=new Ie(h.src,u,h.path,r),h.noCache||(h.loader.cache[e]=m)):m=new Ie(Ll,u,"",r),c?c(null,m):w=m},"createTemplate");return V.asyncIter(this.loaders,function(k,v,h,m){function y(L,O){L?m(L):O?(O.loader=k,m(null,O)):h()}a(y,"handle"),e=f.resolveTemplate(k,o,e),k.async?k.getSource(e,y):y(null,k.getSource(e))},x),w},"getTemplate"),s.express=a(function(e){return Al(this,e)},"express"),s.render=a(function(e,r,o){V.isFunction(r)&&(o=r,r=null);var l=null;return this.getTemplate(e,function(c,u){if(c&&o)Bt(o,c);else{if(c)throw c;l=u.render(r,o)}}),l},"render"),s.renderString=a(function(e,r,o,l){V.isFunction(o)&&(l=o,o={}),o=o||{};var c=new Ie(e,this,o.path);return c.render(r,l)},"renderString"),s.waterfall=a(function(e,r,o){return kl(e,r,o)},"waterfall"),n}(Sl),ui=function(t){jt(n,t);function n(){return t.apply(this,arguments)||this}a(n,"Context");var s=n.prototype;return s.init=a(function(e,r,o){var l=this;this.env=o||new Mt,this.ctx=V.extend({},e),this.blocks={},this.exported=[],V.keys(r).forEach(function(c){l.addBlock(c,r[c])})},"init"),s.lookup=a(function(e){return e in this.env.globals&&!(e in this.ctx)?this.env.globals[e]:this.ctx[e]},"lookup"),s.setVariable=a(function(e,r){this.ctx[e]=r},"setVariable"),s.getVariables=a(function(){return this.ctx},"getVariables"),s.addBlock=a(function(e,r){return this.blocks[e]=this.blocks[e]||[],this.blocks[e].push(r),this},"addBlock"),s.getBlock=a(function(e){if(!this.blocks[e])throw new Error('unknown block "'+e+'"');return this.blocks[e][0]},"getBlock"),s.getSuper=a(function(e,r,o,l,c,u){var f=V.indexOf(this.blocks[r]||[],o),p=this.blocks[r][f+1],_=this;if(f===-1||!p)throw new Error('no super block available for "'+r+'"');p(e,_,l,c,u)},"getSuper"),s.addExport=a(function(e){this.exported.push(e)},"addExport"),s.getExported=a(function(){var e=this,r={};return this.exported.forEach(function(o){r[o]=e.ctx[o]}),r},"getExported"),n}(pi),Ie=function(t){jt(n,t);function n(){return t.apply(this,arguments)||this}a(n,"Template");var s=n.prototype;return s.init=a(function(e,r,o,l){if(this.env=r||new Mt,V.isObject(e))switch(e.type){case"code":this.tmplProps=e.obj;break;case"string":this.tmplStr=e.obj;break;default:throw new Error("Unexpected template object type "+e.type+"; expected 'code', or 'string'")}else if(V.isString(e))this.tmplStr=e;else throw new Error("src must be a string or an object describing the source");if(this.path=o,l)try{this._compile()}catch(c){throw V._prettifyError(this.path,this.env.opts.dev,c)}else this.compiled=!1},"init"),s.render=a(function(e,r,o){var l=this;typeof e=="function"?(o=e,e={}):typeof r=="function"&&(o=r,r=null);var c=!r;try{this.compile()}catch(w){var u=V._prettifyError(this.path,this.env.opts.dev,w);if(o)return Bt(o,u);throw u}var f=new ui(e||{},this.blocks,this.env),p=r?r.push(!0):new ci;p.topLevel=!0;var _=null,g=!1;return this.rootRenderFunc(this.env,f,p,Xe,function(w,x){if(!(g&&o&&typeof x<"u"))if(w&&(w=V._prettifyError(l.path,l.env.opts.dev,w),g=!0),o)c?Bt(o,w,x):o(w,x);else{if(w)throw w;_=x}}),_},"render"),s.getExported=a(function(e,r,o){typeof e=="function"&&(o=e,e={}),typeof r=="function"&&(o=r,r=null);try{this.compile()}catch(u){if(o)return o(u);throw u}var l=r?r.push():new ci;l.topLevel=!0;var c=new ui(e||{},this.blocks,this.env);this.rootRenderFunc(this.env,c,l,Xe,function(u){u?o(u,null):o(null,c.getExported())})},"getExported"),s.compile=a(function(){this.compiled||this._compile()},"compile"),s._compile=a(function(){var e;if(this.tmplProps)e=this.tmplProps;else{var r=El.compile(this.tmplStr,this.env.asyncFilters,this.env.extensionsList,this.path,this.env.opts),o=new Function(r);e=o()}this.blocks=this._getBlocks(e),this.rootRenderFunc=e.root,this.compiled=!0},"_compile"),s._getBlocks=a(function(e){var r={};return V.keys(e).forEach(function(o){o.slice(0,2)==="b_"&&(r[o.slice(2)]=e[o])}),r},"_getBlocks"),n}(pi);hi.exports={Environment:Mt,Template:Ie}});var di=M((vu,mi)=>{"use strict";b();function Nl(t,n){var s="";n=n||{};for(var i=0;i<t.length;i++){var e=JSON.stringify(t[i].name),r=t[i].template;s+="(function() {(window.nunjucksPrecompiled = window.nunjucksPrecompiled || {})["+e+`] = (function() {
31
+ `+r+`
32
+ })();
33
+ `,n.asFunction&&(s+="return function(ctx, cb) { return nunjucks.render("+e+`, ctx, cb); }
34
+ `),s+=`})();
35
+ `}return s}a(Nl,"precompileGlobal");mi.exports=Nl});var ki=M((yu,yi)=>{"use strict";b();var we=Q("fs"),Dt=Q("path"),Cl=ee(),Fl=Cl._prettifyError,Rl=Ge(),Pl=$t(),Ut=Pl.Environment,_i=di();function vi(t,n){return Array.isArray(n)?n.some(function(s){return t.match(s)}):!1}a(vi,"match");function gi(t,n){n=n||{},n.isString=!0;var s=n.env||new Ut([]),i=n.wrapper||_i;if(!n.name)throw new Error('the "name" option is required when compiling a string');return i([qt(t,n.name,s)],n)}a(gi,"precompileString");function Il(t,n){n=n||{};var s=n.env||new Ut([]),i=n.wrapper||_i;if(n.isString)return gi(t,n);var e=we.existsSync(t)&&we.statSync(t),r=[],o=[];function l(f){we.readdirSync(f).forEach(function(p){var _=Dt.join(f,p),g=_.substr(Dt.join(t,"/").length),w=we.statSync(_);w&&w.isDirectory()?(g+="/",vi(g,n.exclude)||l(_)):vi(g,n.include)&&o.push(_)})}if(a(l,"addTemplates"),e.isFile())r.push(qt(we.readFileSync(t,"utf-8"),n.name||t,s));else if(e.isDirectory()){l(t);for(var c=0;c<o.length;c++){var u=o[c].replace(Dt.join(t,"/"),"");try{r.push(qt(we.readFileSync(o[c],"utf-8"),u,s))}catch(f){if(n.force)console.error(f);else throw f}}}return i(r,n)}a(Il,"precompile");function qt(t,n,s){s=s||new Ut([]);var i=s.asyncFilters,e=s.extensionsList,r;n=n.replace(/\\/g,"/");try{r=Rl.compile(t,i,e,n,s.opts)}catch(o){throw Fl(n,!1,o)}return{name:n,template:r}}a(qt,"_precompile");yi.exports={precompile:Il,precompileString:gi}});var wi=M((wu,Ei)=>{"use strict";b();function Bl(){"use strict";var t=this.runtime,n=this.lib,s=this.compiler.Compiler,i=this.parser.Parser,e=this.nodes,r=this.lexer,o=t.contextOrFrameLookup,l=t.memberLookup,c,u;s&&(c=s.prototype.assertType),i&&(u=i.prototype.parseAggregate);function f(){t.contextOrFrameLookup=o,t.memberLookup=l,s&&(s.prototype.assertType=c),i&&(i.prototype.parseAggregate=u)}a(f,"uninstall"),t.contextOrFrameLookup=a(function(h,m,y){var L=o.apply(this,arguments);if(L!==void 0)return L;switch(y){case"True":return!0;case"False":return!1;case"None":return null;default:return}},"contextOrFrameLookup");function p(v){return{index:v.index,lineno:v.lineno,colno:v.colno}}if(a(p,"getTokensState"),process.env.BUILD_TYPE!=="SLIM"&&e&&s&&i){var _=e.Node.extend("Slice",{fields:["start","stop","step"],init:a(function(h,m,y,L,O){y=y||new e.Literal(h,m,null),L=L||new e.Literal(h,m,null),O=O||new e.Literal(h,m,1),this.parent(h,m,y,L,O)},"init")});s.prototype.assertType=a(function(h){h instanceof _||c.apply(this,arguments)},"assertType"),s.prototype.compileSlice=a(function(h,m){this._emit("("),this._compileExpression(h.start,m),this._emit("),("),this._compileExpression(h.stop,m),this._emit("),("),this._compileExpression(h.step,m),this._emit(")")},"compileSlice"),i.prototype.parseAggregate=a(function(){var h=this,m=p(this.tokens);m.colno--,m.index--;try{return u.apply(this)}catch(oe){var y=p(this.tokens),L=a(function(){return n._assign(h.tokens,y),oe},"rethrow");n._assign(this.tokens,m),this.peeked=!1;var O=this.peekToken();if(O.type!==r.TOKEN_LEFT_BRACKET)throw L();this.nextToken();for(var P=new _(O.lineno,O.colno),G=!1,W=0;W<=P.fields.length&&!this.skip(r.TOKEN_RIGHT_BRACKET);W++){if(W===P.fields.length)if(G)this.fail("parseSlice: too many slice components",O.lineno,O.colno);else break;if(this.skip(r.TOKEN_COLON))G=!0;else{var J=P.fields[W];P[J]=this.parseExpression(),G=this.skip(r.TOKEN_COLON)||G}}if(!G)throw L();return new e.Array(O.lineno,O.colno,[P])}},"parseAggregate")}function g(v,h,m,y){v=v||[],h===null&&(h=y<0?v.length-1:0),m===null?m=y<0?-1:v.length:m<0&&(m+=v.length),h<0&&(h+=v.length);for(var L=[],O=h;!(O<0||O>v.length||y>0&&O>=m||y<0&&O<=m);O+=y)L.push(t.memberLookup(v,O));return L}a(g,"sliceLookup");function w(v,h){return Object.prototype.hasOwnProperty.call(v,h)}a(w,"hasOwnProp");var x={pop:a(function(h){if(h===void 0)return this.pop();if(h>=this.length||h<0)throw new Error("KeyError");return this.splice(h,1)},"pop"),append:a(function(h){return this.push(h)},"append"),remove:a(function(h){for(var m=0;m<this.length;m++)if(this[m]===h)return this.splice(m,1);throw new Error("ValueError")},"remove"),count:a(function(h){for(var m=0,y=0;y<this.length;y++)this[y]===h&&m++;return m},"count"),index:a(function(h){var m;if((m=this.indexOf(h))===-1)throw new Error("ValueError");return m},"index"),find:a(function(h){return this.indexOf(h)},"find"),insert:a(function(h,m){return this.splice(h,0,m)},"insert")},k={items:a(function(){return n._entries(this)},"items"),values:a(function(){return n._values(this)},"values"),keys:a(function(){return n.keys(this)},"keys"),get:a(function(h,m){var y=this[h];return y===void 0&&(y=m),y},"get"),has_key:a(function(h){return w(this,h)},"has_key"),pop:a(function(h,m){var y=this[h];if(y===void 0&&m!==void 0)y=m;else{if(y===void 0)throw new Error("KeyError");delete this[h]}return y},"pop"),popitem:a(function(){var h=n.keys(this);if(!h.length)throw new Error("KeyError");var m=h[0],y=this[m];return delete this[m],[m,y]},"popitem"),setdefault:a(function(h,m){return m===void 0&&(m=null),h in this||(this[h]=m),this[h]},"setdefault"),update:a(function(h){return n._assign(this,h),null},"update")};return k.iteritems=k.items,k.itervalues=k.values,k.iterkeys=k.keys,t.memberLookup=a(function(h,m,y){return arguments.length===4?g.apply(this,arguments):(h=h||{},n.isArray(h)&&w(x,m)?x[m].bind(h):n.isObject(h)&&w(k,m)?k[m].bind(h):l.apply(this,arguments))},"memberLookup"),f}a(Bl,"installCompat");Ei.exports=Bl});var Ai=M((xu,Ti)=>{"use strict";b();var Oi=ee(),xi=$t(),Si=xi.Environment,bi=xi.Template,jl=We(),he=Pt(),Je=ki(),Kl=Ge(),Ml=xt(),$l=mt(),Dl=Ee(),ql=Re(),Ul=wi(),ue;function Qe(t,n){n=n||{},Oi.isObject(t)&&(n=t,t=null);var s;return he.FileSystemLoader?s=new he.FileSystemLoader(t,{watch:n.watch,noCache:n.noCache}):he.WebLoader&&(s=new he.WebLoader(t,{useCache:n.web&&n.web.useCache,async:n.web&&n.web.async})),ue=new Si(s,n),n&&n.express&&ue.express(n.express),ue}a(Qe,"configure");Ti.exports={Environment:Si,Template:bi,Loader:jl,FileSystemLoader:he.FileSystemLoader,NodeResolveLoader:he.NodeResolveLoader,PrecompiledLoader:he.PrecompiledLoader,WebLoader:he.WebLoader,compiler:Kl,parser:Ml,lexer:$l,runtime:Dl,lib:Oi,nodes:ql,installJinjaCompat:Ul,configure:Qe,reset:a(function(){ue=void 0},"reset"),compile:a(function(n,s,i,e){return ue||Qe(),new bi(n,s,i,e)},"compile"),render:a(function(n,s,i){return ue||Qe(),ue.render(n,s,i)},"render"),renderString:a(function(n,s,i){return ue||Qe(),ue.renderString(n,s,i)},"renderString"),precompile:Je?Je.precompile:void 0,precompileString:Je?Je.precompileString:void 0}});b();var Yt=Jt(Ai(),1),ve=Jt($i(),1);import*as T from"node:fs";import*as C from"node:path";import{isDeepStrictEqual as Gl}from"node:util";b();import*as be from"node:fs";function Vl(t){return t.toUpperCase().replace(/-/g,"_")}a(Vl,"secretPrefix");function Li(t,n,s,i={}){let e={},r=new Set;for(let o of s){let l={},c=n[o],u=c&&typeof c=="object"?c.secrets:null;if(Array.isArray(u)){let f=Vl(o);for(let p of u){let _=String(p),g=`${f}__${_}`,w=[i[_],t[g],t[_]].find(x=>(x??"").trim());w===void 0?r.add(`${g} / ${_}`):l[_]=w}}e[o]=l}return{byService:e,missing:[...r].sort()}}a(Li,"resolveSecrets");function Ni(){return cr()}a(Ni,"getSecretsPath");function Ci(t){if(!(be.existsSync(t)&&be.statSync(t).isFile()))return{};let n={};for(let s of be.readFileSync(t,"utf8").split(`
36
+ `)){let i=s.trim();if(!i||i.startsWith("#")||!i.includes("="))continue;let e=i.indexOf("="),r=i.slice(0,e),o=i.slice(e+1);n[r.trim()]=o.trim()}return n}a(Ci,"loadSecrets");function U(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(U,"isDict");function Gt(t){return Array.isArray(t)?t.length>0:t!==null&&typeof t=="object"?Object.keys(t).length>0:!!t}a(Gt,"jinjaTruthy");function X(t,n,s){n in t||(t[n]=s)}a(X,"setdefault");function Fi(t){let n=C.join(t,".git"),s;try{s=T.statSync(n)}catch{return null}if(!s.isFile())return null;for(let i of T.readFileSync(n,"utf8").split(`
37
+ `))if(i.startsWith("gitdir:")){let e=i.slice(i.indexOf(":")+1).trim(),r=C.relative(t,e);if(r.startsWith("..")||C.isAbsolute(r))return e}return null}a(Fi,"resolveWorktreeGitdir");function et(t){let n=t?t.services:null,s=t?t.ports:null,i=Gt(n)?n:st(),e=Gt(s)?s:ot();return[i,e]}a(et,"resolveServicesAndPorts");var Wt=class{static{a(this,"DoExtension")}tags=["do"];parse(n,s){let i=n.nextToken(),e=n.parseSignature(null,!0);return n.advanceAfterBlockEnd(i.value),new s.CallExtension(this,"run",e)}run(...n){return""}},Wl=/(\{%-?\s*(?:el)?if\s+)([\s\S]+?)(\s*-?%\})/g,Ht=class extends Yt.default.FileSystemLoader{static{a(this,"JinjaCompatLoader")}getSource(n){let s=super.getSource(n);return s&&typeof s.src=="string"&&(s.src=s.src.replace(Wl,(i,e,r,o)=>`${e}__truthy(${r})${o}`)),s}},Hl=a(function(t,n){return t in this?this[t]:n},"_DICT_GET"),Yl=a(function(){return Object.entries(this)},"_DICT_ITEMS");function Oe(t,n=new WeakSet){if(t===null||typeof t!="object")return t;let s=t;if(n.has(s))return t;if(n.add(s),Array.isArray(t)){for(let e of t)Oe(e,n);return t}let i=Object.getPrototypeOf(s);if(i===Object.prototype||i===null){let e=t;Object.hasOwn(e,"get")||Object.defineProperty(e,"get",{value:Hl,enumerable:!1}),Object.hasOwn(e,"items")||Object.defineProperty(e,"items",{value:Yl,enumerable:!1});for(let r of Object.values(e))Oe(r,n)}return t}a(Oe,"jinjaContext");function zl(){Object.hasOwn(Array.prototype,"append")||Object.defineProperty(Array.prototype,"append",{value:a(function(n){this.push(n)},"append"),enumerable:!1,writable:!0,configurable:!0})}a(zl,"installArrayAppend");function tt(){zl();let t=C.join(or(),"templates");(!T.existsSync(t)||!T.statSync(t).isDirectory())&&T.mkdirSync(t,{recursive:!0});let n=new Yt.default.Environment(new Ht(t),{autoescape:!1});return n.addExtension("do",new Wt),n.addGlobal("__truthy",Gt),n.addGlobal("container_of",lt),n.addFilter("map",(s,i)=>{let e=U(i)?i.attribute:void 0;return(s??[]).map(r=>e===void 0?r:r[String(e)])}),n}a(tt,"getNunjucksEnv");function rt(t,n){try{return t.getTemplate(n)}catch(s){if(s instanceof Error&&/template not found/i.test(s.message))return null;throw s}}a(rt,"getTemplateOrNull");function Xl(t,n){return`# Werkmeister docker-compose for feature: ${t}
38
+ # Generated by: ${n}
39
+ # Regenerated by \`werkmeister feature up\` whenever stale; do not hand-edit.
40
+ #
41
+ # Run from workspace root:
42
+ # docker compose up -d --build (start)
43
+ # docker compose down (stop)
44
+ # docker compose logs -f (tail logs)
45
+ # docker compose ps (status)
46
+ #
47
+ `}a(Xl,"composeHeader");function Jl(t,n){let s=Ke(t,n);return T.mkdirSync(s,{recursive:!0}),[s,C.join(s,Te)]}a(Jl,"resolveComposeOutPath");function zu(t,n){let s=Object.entries(n).map(([i,e])=>`${i}=${hr(String(e).replace(/\s*\n\s*/g," ").trim())}
48
+ `).join("");T.writeFileSync(t,Ii(t,new Set(Object.keys(n)))+s)}a(zu,"seedWorkspaceMetadataEnv");function Ii(t,n){let s;try{if(!T.statSync(t).isFile())return"";s=T.readFileSync(t,"utf8")}catch{return""}let i=[];for(let e of s.split(`
49
+ `)){let r=e.trim();if(!r||r.startsWith("#")||!r.includes("="))continue;let o=r.slice(0,r.indexOf("=")).trim();n.has(o)||i.push(e)}return i.length===0?"":`# Workspace metadata (preserved across regeneration)
50
+ `+i.join(`
51
+ `)+`
52
+
53
+ `}a(Ii,"preservedEnvMetadata");function xe(t,n,s){let i=n[t]??{};return U(i)&&i.k8s_forward_port!==null&&i.k8s_forward_port!==void 0?Number(i.k8s_forward_port):null}a(xe,"k8sPortForService");function Ze(t){return`'${t}'`}a(Ze,"quoted");function Ri(t,n,s){let i={};for(let e of Object.keys(n).sort()){let r=n[e]??{};if(!U(r))continue;let o=e.toUpperCase().replace(/-/g,"_");if(t.includes(e)){let u=r.internal_port??3e3;i[`${o}_URL`]=`http://${e}:${u}`,i[`${o}_HOST`]=e,i[`${o}_PORT`]=String(u);continue}let l=it(e,r);if(l){i[`${o}_URL`]=`http://${l.host}:${l.port}`,i[`${o}_HOST`]=l.host,i[`${o}_PORT`]=String(l.port);continue}let c=xe(e,n,s);c&&(i[`${o}_URL`]=`http://k8s-forwards:${c}`,i[`${o}_HOST`]="k8s-forwards",i[`${o}_PORT`]=String(c))}return ic(i,t,n)}a(Ri,"serviceUrlVars");function Ql(t,n,s,i){return t.replace(/(?<!\$)\{([a-zA-Z0-9_-]+)\}/g,(e,r)=>{let o=s[r]??{};if(!U(o))throw new Error(`Cannot resolve {${r}} in ${Ze(t)}: ${Ze(r)} is not a known service in services.yaml`);if(n.includes(r)){let u=o.internal_port??3e3;return`${r}:${u}`}let l=it(r,o);if(l)return`${l.host}:${l.port}`;let c=xe(r,s,i);if(c)return`k8s-forwards:${c}`;throw new Error(`Cannot resolve {${r}} in ${Ze(t)}: ${Ze(r)} is not local and has neither baseline_upstream nor k8s_forward_port in services.yaml`)})}a(Ql,"resolveServiceRefs");function Bi(t,n){let s=C.join(Ae(t),"workspace.yml"),i;try{if(!T.statSync(s).isFile())return{};i=T.readFileSync(s,"utf8")}catch{return{}}let e;try{e=ve.parse(i)}catch{return{}}let r=U(e)&&n in e?e[n]:{};return U(r)?r:{}}a(Bi,"loadWorkspaceDict");function Zl(t){return Bi(t,"dev_links")}a(Zl,"loadDevLinks");function ji(t){let n={};for(let[s,i]of Object.entries(Bi(t,"env_vars")))i!=null&&(n[s]=String(i));return n}a(ji,"loadWorkspaceEnvVars");function ec(t,n,s){return Object.entries(t).filter(([i,e])=>!n.includes(i)&&U(e)&&!!e.repo&&T.existsSync(C.join(s,String(e.repo)))).map(([i])=>i).sort()}a(ec,"onDemandServices");function zt(t,n,s,i,e,r){let[o,l]=et(i),[c,u]=Jl(t,e),[f,p]=yr(o,i&&"setup_services"in i?i.setup_services??{}:rr(),i&&"archetypes"in i?i.archetypes??{}:ir(),i&&"caches"in i?i.caches??{}:sr(),c),_=Zl(c),g=Xl(t,r),w=tt(),x=rt(w,"docker-compose.feature.yml.njk");if(x){let[L]=ge(n),O=ec(f,s,c),P=[];for(let J of[...[...s].sort(),...O]){let oe=f[J]??{};if(!U(oe))continue;let I={...oe};I.name=J,I.on_demand=O.includes(J),X(I,"port_offset",0),X(I,"internal_port",3e3),X(I,"setup_service",null),X(I,"node_modules_volume",null),X(I,"extra_volumes",[]),I.dev_links=_[J]??[],X(I,"environment",{});let Be={};for(let[me,de]of Object.entries(I.environment))Be[me]=Ql(de,s,f,l);I.environment=Be,X(I,"command",null),X(I,"memory_limit","2G"),X(I,"memory_reservation","512M"),X(I,"cpus",Me),I.extra_services&&(I.extra_services=Object.fromEntries(Object.entries(I.extra_services).map(([me,de])=>[me,{cpus:Me,...de}]))),X(I,"health_endpoint","/health"),X(I,"extra_services",null),X(I,"depends_on",[]),I.worktree_gitdir=Fi(C.join(c,I.repo??"")),P.push(I)}let G=p;G=Object.fromEntries(Object.entries(G).map(([J,oe])=>[J,{memory_limit:"2G",memory_reservation:"512M",cpus:tr,extra_volumes:[],healthcheck:"true",...oe,worktree_gitdir:Fi(C.join(c,oe.repo??""))}]));let W=x.render(Oe({feature_name:t,slot:n,base_port:L,local_services:P,services_config:f,idle_types:er,setup_configs:G,ports_config:l,workspace_path:c,werkmeister_root:_e(),get_service_port:ct,k8s_port_for_service:a(J=>xe(J,f,l),"k8s_port_for_service")}));return W=W.replace(/\n{3,}/g,`
54
+
55
+ `),[u,g+W,"template"]}fe("Template 'docker-compose.feature.yml.njk' not found -- falling back to built-in compose generation"),ge(n);let k=$e(t),v={name:$e(t),networks:{[`feature-${t}`]:{name:k,driver:"bridge"},"shared-network":{external:!0,name:"werkmeister-shared"}},services:{}},h={},m=[...s].sort();for(let L=0;L<m.length;L++){let O=m[L],P=f[O]??{};if(!U(P))continue;let G=P.repo??"",W=P.path??".",J=P.port_offset??L,oe=P.internal_port??3e3,I=ct(n,J),Be=G?C.join(c,G):c,me=P.dockerfile??"Dockerfile";W&&W!=="."&&W!=="/"&&(me=`${W}/${me}`);let de={NODE_ENV:"development",WERKMEISTER_FEATURE:t,SANDBOX_FEATURE:t,WERKMEISTER_SLOT:String(n)};for(let[$,H]of Object.entries(f)){if(!U(H))continue;let le=$.toUpperCase().replace(/-/g,"_");if(s.includes($)){let D=H.internal_port??3e3;de[`${le}_URL`]=`http://${$}:${D}`}else{let D=xe($,f,l);D&&(de[`${le}_URL`]=`http://k8s-forwards:${D}`)}}let nt={build:{context:Be,dockerfile:me,target:"development"},container_name:lt(t,O),labels:{"com.werkmeister.feature":t,"com.werkmeister.slot":String(n),"com.werkmeister.service":O,"com.werkmeister.role":"app"},ports:[`${I}:${oe}`],environment:de,networks:{[`feature-${t}`]:{aliases:[O]},"shared-network":{aliases:[`${t}-${O}`]}},restart:"unless-stopped",deploy:{resources:{limits:{cpus:String(P.cpus??Me)}}}},ae=[],Xt=P.node_modules_volume;if(Xt){let $=`${t}-${Xt}`;ae.push(`${$}:/app/node_modules`),h[$]={name:$}}for(let $ of P.extra_volumes??[]){let H=$.split(":"),le=H[0];if(le.includes("/")){let D=$.split("${WORKSPACE}").join(c);D=D.split("${REPO}").join(C.join(c,G)),D=D.split("${WERKMEISTER_ROOT}").join(_e()),ae.push(D)}else if(le.startsWith(at)){let D=le.slice(at.length);ae.push(`${D}:${H.slice(1).join(":")}`),h[D]={name:D,external:!0}}else{let D=`${t}-${le}`,Mi=H.slice(1).join(":");ae.push(`${D}:${Mi}`),h[D]={name:D}}}for(let $ of _[O]??[]){let H=$.split("${WORKSPACE}").join(c);H=H.split("${REPO}").join(C.join(c,G)),H=H.split("${WERKMEISTER_ROOT}").join(_e()),ae.push(H)}if(W&&W!=="."&&W!=="/"){let $=C.join(c,G,W,"src");ae.push(`${$}:/app/src`)}else if(G){let $=C.join(c,G,"src");ae.push(`${$}:/app/src`)}ae.length>0&&(nt.volumes=ae);let Se={};P.setup_service&&(Se[P.setup_service]={condition:"service_completed_successfully"});for(let $ of P.depends_on??[]){let H=!1;if(s.includes($))H=!0;else for(let le of s){let D=f[le]??{};if(U(D)&&D.extra_services?.[$]){H=!0;break}}H&&!($ in Se)&&(Se[$]={condition:"service_healthy"})}Object.keys(Se).length>0&&(nt.depends_on=Se),v.services[O]=nt}Object.keys(h).length>0&&(v.volumes=h);let y=ve.stringify(v,{indentSeq:!1,singleQuote:!0});return[u,g+y,"built-in"]}a(zt,"renderFeatureCompose");function Ki(t="/.dockerenv"){if(T.existsSync(t)&&!Zt("CONFIG_FILE"))throw new lr(`Refusing to write ${Te} from inside a container: the host's Docker reads it, and the werkmeister root here is the container's (${_e()}).
56
+ Run it from the host, or set WERKMEISTER_CONFIG_FILE to a scratch file.`,"INSIDE_CONTAINER")}a(Ki,"refuseComposeInsideContainer");function tc(t,n,s,i=null,e=null,r="werkmeister CLI"){Ki();let[o,l,c]=zt(t,n,s,i,e,r);return T.writeFileSync(o,l),te(`Generated compose (${c}): ${o}`),o}a(tc,"generateFeatureCompose");function Xu(t,n,s,i,e){let[r,o]=zt(t,n,s,i,e,"werkmeister CLI"),l=a(c=>c.replace(/^# Generated by: .*$/m,""),"maskSource");try{return l(T.readFileSync(r,"utf8"))!==l(o)}catch{return!1}}a(Xu,"isFeatureComposeStale");var rc="compose.gate.yml";function Ju(t,n,s,i,e){Ki();let[r,o]=zt(t,n,s,{services:i},e,"werkmeister pr gate"),l=ve.parse(o)?.services??{},c=ve.parse(T.readFileSync(r,"utf8"))?.services??{};return T.writeFileSync(C.join(C.dirname(r),rc),o),Object.keys(l).filter(u=>!Gl(l[u],c[u]))}a(Ju,"renderGateCompose");var nc={_URL:"_BASE_URL",_HOST:"_BASE_HOST",_PORT:"_BASE_PORT"};function ic(t,n,s){let i=new Set;for(let r of n){let o=s[r]??{};if(U(o))for(let l of Object.keys(o.environment??{}))i.add(l)}let e={};for(let[r,o]of Object.entries(t))if(i.has(r)){let l=!1;for(let[c,u]of Object.entries(nc))if(r.endsWith(c)){e[r.slice(0,-c.length)+u]=o,l=!0;break}l||(e[r]=o)}else e[r]=o;return e}a(ic,"avoidComposeEnvShadowing");function sc(t,n,s,i=null,e=null){let[r,o]=et(i),l=Ke(t,e);T.mkdirSync(l,{recursive:!0});let c=C.join(l,".env"),u=C.join(l,"docker-compose.env");oc(l,s,r);let f=Object.values(r).flatMap(x=>U(x)&&Array.isArray(x.secrets)?x.secrets.map(String):[]),p=tt(),_=rt(p,"env.njk");if(_){let[x]=ge(n),k=ji(l),v=Ri(s,r,o),h=_.render(Oe({feature_name:t,slot:n,base_port:x,service_urls:v,env_vars:k}));return Pi(c,h,u,f),te(`Generated .env (template): ${c}`),c}fe("Template 'env.njk' not found -- falling back to built-in .env generation");let g=[`# Auto-generated .env for feature: ${t}`,`# Slot: ${n}`,"",`WERKMEISTER_FEATURE=${t}`,`SANDBOX_FEATURE=${t}`,`WERKMEISTER_SLOT=${n}`,`COMPOSE_PROJECT_NAME=${$e(t)}`,"","# Service URLs"],w=Ri(s,r,o);for(let[x,k]of Object.entries(w))g.push(`${x}=${k}`);return g.push(""),Pi(c,g.join(`
57
+ `)+`
58
+ `,u,f),te(`Generated .env (built-in): ${c}`),c}a(sc,"generateFeatureEnv");function oc(t,n,s){Er(t);let{byService:i}=Li(Ci(Ni()),s,n,ji(t));for(let[e,r]of Object.entries(i)){let o=Object.keys(r).sort().map(l=>`${l}=${r[l]}
59
+ `).join("");T.writeFileSync(C.join(t,`.env.${e}`),o,{mode:384})}}a(oc,"writeServiceSecretEnvs");function Pi(t,n,s,i){let e=new Set(i);for(let l of n.split(`
60
+ `))l.includes("=")&&!l.trimStart().startsWith("#")&&e.add(l.slice(0,l.indexOf("=")).trim());let r=Ii(t,e);T.writeFileSync(t,r+n);let o=!1;try{o=T.statSync(s).isFile()}catch{}o&&(T.unlinkSync(s),je(`Removed legacy ${C.basename(s)}`))}a(Pi,"writeWorkspaceEnv");var Vt=new Set(["graphql-subgraph","graphql","subgraph","federation"]);function ac(t,n,s,i=null,e=null){let[r,o]=et(i),l=Ke(t,e),c=Ae(l),u=C.join(c,"supergraph-config.yml");if(!Object.values(r).some(k=>U(k)&&Vt.has(k.type??"")))return T.rmSync(u,{force:!0}),null;T.mkdirSync(c,{recursive:!0});let p=tt(),_=rt(p,"supergraph-config.yml.njk");if(_){let k=[];for(let[h,m]of Object.entries(r)){if(!U(m)||!Vt.has(m.type??""))continue;let y=m.graphql_path??"/graphql",L;if(s.includes(h)){let O=m.internal_port??3e3;L=`http://${h}:${O}${y}`}else{let O=xe(h,r,o);if(!O)continue;L=`http://k8s-forwards:${O}${y}`}k.push({name:h.replace(/-/g,"_"),url:L})}let v=_.render(Oe({feature_name:t,subgraphs:k}));return T.writeFileSync(u,v),te(`Generated supergraph config (template): ${u}`),u}fe("Template 'supergraph-config.yml.njk' not found -- falling back to built-in supergraph config generation");let g={};for(let[k,v]of Object.entries(r)){if(!U(v))continue;let h=v.type??"";if(!Vt.has(h))continue;let m=v.graphql_path??"/graphql",y;if(s.includes(k)){let O=v.internal_port??3e3;y=`http://${k}:${O}${m}`}else{let O=xe(k,r,o);if(O)y=`http://k8s-forwards:${O}${m}`;else continue}let L=k.replace(/-/g,"_");g[L]={routing_url:y,schema:{subgraph_url:y}}}let w={subgraphs:g},x=`# AUTO-GENERATED FILE \u2014 DO NOT EDIT BY HAND.
61
+ # Source: ~/.werkmeister/services.yaml (type: graphql-subgraph,
62
+ # k8s_forward_port)
63
+ # + .werkmeister/workspace.yml (feature local_services)
64
+ # Generator: packages/werkmeister-core/src/generate.ts :: generateSupergraphConfig
65
+ # Regen: werkmeister feature up (or \`werkmeister workspace init\`)
66
+ # To add a subgraph: set its \`type: graphql-subgraph\` in services.yaml and rerun.
67
+ # To change endpoint path, set \`graphql_path: /<path>\` on the service (default /graphql).
68
+ #
69
+ # Feature: ${t}
70
+ # Local subgraphs use the per-feature container network; remote
71
+ # subgraphs fall through to the shared k8s-forwards container.
72
+ `;return T.writeFileSync(u,x+ve.stringify(w,{indentSeq:!1,singleQuote:!0})),te(`Generated supergraph config (built-in): ${u}`),u}a(ac,"generateSupergraphConfig");async function Qu(t=null,n=null){let[s,i]=et(n),e=C.join(ar(),"proxy");T.mkdirSync(e,{recursive:!0});let r=C.join(e,"Caddyfile");return T.existsSync(r)&&T.statSync(r).isDirectory()&&T.rmSync(r,{recursive:!0,force:!0}),dr("caddyfile",async()=>{t==null&&(t=await _r());let o=Object.entries(t).sort(([l],[c])=>l<c?-1:l>c?1:0).filter(([,l])=>U(l)).map(([l,c])=>({name:l,slot:c.slot??null,services:c.services??[]}));return T.writeFileSync(C.join(e,"features.json"),JSON.stringify(o,null,2)+`
73
+ `),fc(t,s,i,_e(),r)})}a(Qu,"generateCaddyfile");function lc(t){return`(?:^|;\\s*)X-Feature=${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?:\\s*;|\\s*$)`}a(lc,"featureCookieRegexp");function cc(t,n){let s=[];for(let[i,e]of Object.entries(mr(n))){if(e.remoteHostname&&e.remoteUpstream&&s.push({hostname:e.remoteHostname,service:i,upstream:e.remoteUpstream}),!e.hostname)continue;let r=n[i]??{},o=U(r)?r.port_offset??0:0,l=Object.entries(t).filter(([,u])=>U(u)&&u.slot!==null&&u.slot!==void 0&&(u.services??[]).includes(i)).sort(([u],[f])=>u<f?-1:u>f?1:0).map(([u,f],p)=>({name:u,upstream:`host.docker.internal:${ge(f.slot)[0]+o}`,matcher:`feat${p}_${u.replace(/[^A-Za-z0-9_]/g,"_")}`,cookie_regexp:lc(u)})),c=e.remoteUpstream??l[0]?.upstream;c&&s.push({hostname:e.hostname,service:i,upstream:c,...l.length?{features:l}:{}})}return s}a(cc,"buildHostRouters");function uc(t){let n=[];for(let s of t){n.push(`# ${s.service} \u2014 Caddy terminates ${s.hostname} directly`),n.push(`${s.hostname} {`),n.push(" tls internal"),n.push(""),n.push(" # Feature selector UI (sets/clears the X-Feature cookie)."),n.push(" @selector_features path /__werkmeister/features.json"),n.push(" handle @selector_features {"),n.push(" root * /srv"),n.push(" rewrite * /features.json"),n.push(" file_server"),n.push(" }"),n.push(" @selector path /__werkmeister*"),n.push(" handle @selector {"),n.push(" root * /werkmeister/proxy/ui"),n.push(" rewrite * /index.html"),n.push(" file_server"),n.push(" }"),n.push("");let i=s.features??[];if(i.length){for(let e of i)n.push(` # X-Feature=${e.name} -> that workspace's containers.`),n.push(` @${e.matcher} header_regexp Cookie ${e.cookie_regexp}`),n.push(` handle @${e.matcher} {`),n.push(` reverse_proxy ${e.upstream} {`),n.push(` header_up X-Feature ${e.name}`),n.push(" }"),n.push(" }");n.push(" # No cookie, or one naming a feature not serving this service.")}else n.push(" # X-Feature cookie -> X-Feature header (when present), then proxy."),n.push(" @xf header_regexp xf Cookie X-Feature=([^;]+)"),n.push(" handle @xf {"),n.push(` reverse_proxy ${s.upstream} {`),n.push(" header_up X-Feature {re.xf.1}"),n.push(" }"),n.push(" }");n.push(" handle /* {"),n.push(` reverse_proxy ${s.upstream}`),n.push(" }"),n.push("}"),n.push("")}return n}a(uc,"hostRouterLines");function fc(t,n,s,i,e){let r=cc(t,n),o=tt(),l=rt(o,"Caddyfile.njk");if(l){let u=l.render(Oe({host_routers:r}));return T.writeFileSync(e,u),te(`Generated Caddyfile (template): ${e}`),e}fe("Template 'Caddyfile.njk' not found -- falling back to built-in Caddyfile generation");let c=["# Auto-generated Caddyfile -- do not edit manually","# Regenerate with: werkmeister infra proxy-reload","","{"," admin localhost:2019","}","",...uc(r)];return T.writeFileSync(e,c.join(`
74
+ `)),te(`Generated Caddyfile (built-in): ${e}`),e}a(fc,"generateCaddyfileLocked");async function Zu(t,n,s,i="",e=[]){Qt(s),je(`Generating ${Te}...`);let r=kr(st(),s),o=ot(),l={services:r,ports:o},c={};for(let[y,L]of Object.entries(r)){if(!U(L))continue;let O=(L.path??"").replace(/\/+$/,""),P=O.includes("/")?O.slice(O.lastIndexOf("/")+1):O;P!==y&&(c[P]=y)}let u=a(y=>{if(y in r)return y;let L=c[y];return L?(je(` Resolved service alias: ${y} \u2192 ${L}`),L):L??null},"resolve"),f=n.split(",").map(y=>y.trim()).filter(y=>y),p=new Map;for(let y of f)p.set(y,u(y));let _=[...p.values()].filter(y=>y!==null),g=[...p.entries()].filter(([,y])=>y===null).map(([y])=>y);g.length>0&&fe(`Unknown services (skipped): ${g.join(", ")}`);let w;try{w=await vr(t,null,s)}catch(y){let L=y instanceof Error?y.message:String(y);fe(`Could not allocate slot: ${L}`);let O=L.startsWith("Timed out")?"Retry `werkmeister workspace init`, or remove the stale lock file if no werkmeister process is running.":"Run `werkmeister feature down <feature>` on another feature to free a slot, then rerun `werkmeister workspace init` here.";fe(O);let P=Ae(s);return T.mkdirSync(P,{recursive:!0}),T.writeFileSync(C.join(P,"werkmeister-context.md"),`# Werkmeister Context: ${t}
75
+
76
+ The container step did not run: no slot, so ${Te} and ports were not (re)generated.
77
+
78
+ Why: ${L}
79
+
80
+ Next: ${O} That rewrites this file with the container recipe.
81
+ `),null}tc(t,w,_,l,s,"werkmeister workspace init"),sc(t,w,_,l,s),ac(t,w,_,l,s);let[x,k]=ge(w);te(`Compose ready (slot ${w}, ports ${x}-${k})`);let v=nr(),h=gr(t,w,x,k,_,r,i,null,ur(e,v,_),pr(s),fr(s),v),m=Ae(s);return T.mkdirSync(m,{recursive:!0}),T.writeFileSync(C.join(m,"werkmeister-context.md"),h),T.rmSync(C.join(m,"sandbox-context.md"),{force:!0}),te(`Wrote ${C.basename(m)}/werkmeister-context.md`),w}a(Zu,"generateWorkspaceCompose");export{Li as a,Ni as b,Ci as c,zu as d,ji as e,ec as f,tc as g,Xu as h,rc as i,Ju as j,sc as k,oc as l,ac as m,Qu as n,Zu as o};
82
+ //# sourceMappingURL=chunk-N72DCINT.js.map
@@ -0,0 +1,4 @@
1
+ import { createRequire as __sandboxCreateRequire } from "node:module";
2
+ const require = __sandboxCreateRequire(import.meta.url);
3
+ import{a as R}from"./chunk-EHWLRQV7.js";import{o as x,s as j}from"./chunk-CBTQBN4M.js";import{c as y}from"./chunk-WITTY5DQ.js";import{a as i,e as F,f as b}from"./chunk-K6GRVJQO.js";b();var g=F(R(),1);import{spawn as D}from"node:child_process";import L from"node:fs/promises";import l from"node:path";var S=import.meta.filename.endsWith(".ts")?l.join(import.meta.dirname,"..","..","dist"):l.basename(import.meta.dirname)==="lib"?l.join(import.meta.dirname,".."):import.meta.dirname;function C(o){let e=process.platform==="darwin"?"open":process.platform==="win32"?"cmd":"xdg-open",c=process.platform==="win32"?["/c","start","",o]:[o];try{D(e,c,{detached:!0,stdio:"ignore"}).unref()}catch{}}i(C,"openBrowser");function k(o){if(!o)return!1;let e=o.replace(/:\d+$/,"").replace(/^\[|\]$/g,"");return e==="localhost"||e==="127.0.0.1"||e==="::1"}i(k,"isLocalHost");function I(o,e,c){let m=o.headers.origin;if(m){let s=null;try{s=new URL(m).hostname}catch{}if(!k(s??void 0)){e.status(403).json({error:"cross-origin request refused"});return}}if(!k(o.headers.host)){e.status(403).json({error:"non-local host refused"});return}c()}i(I,"localOnly");function P(o,e={}){let c=e.timeoutMs??6e5;return new Promise(m=>{let s=(0,g.default)();s.use(g.default.json({limit:"1mb"}));let w=!1,d,u=i(n=>{w||(w=!0,d&&clearTimeout(d),setTimeout(()=>f.close(()=>m(n)),50))},"settle");s.get("/",async(n,t)=>{try{let p=await L.readFile(l.join(S,"form.html"),"utf-8");t.type("html").send(p)}catch{t.status(500).type("text").send("Form UI bundle missing \u2014 run `pnpm run build` in apps/werkmeister-dashboard.")}}),s.post("/api/tool",I,async(n,t)=>{let{name:p,arguments:a}=n.body??{};try{switch(p){case"workspace-form-schema":t.json({structuredContent:o});return;case"refine-prompt":{let r=a??{},h=await x(r.text??"",r.instruction??"",r.formData);t.json({structuredContent:{refined:h}});return}case"issue-form-data":{let r=typeof a?.ref=="string"?a.ref:"";t.json({structuredContent:{formData:await j(r)}});return}case"create-workspace":t.json({structuredContent:{output:"Submitted \u2014 return to Claude; the workspace is being created there."}}),u({status:"submitted",formData:a?.formData??{},open:typeof a?.open=="boolean"?a.open:void 0});return;case"cancel-form":t.json({structuredContent:null}),u({status:"cancelled"});return;default:t.status(400).json({error:`unknown tool ${String(p)}`})}}catch(r){let h=(r instanceof y,r.message);t.status(500).json({error:h})}});let f=s.listen(0,"127.0.0.1",()=>{let{port:n}=f.address(),t=`http://127.0.0.1:${n}/`;console.error(`[workspaces] workspace form: ${t}`),e.open!==!1&&C(t)});f.on("error",()=>u({status:"cancelled"})),d=setTimeout(()=>u({status:"timeout"}),c)})}i(P,"promptViaLocalhostForm");export{I as a,P as b};
4
+ //# sourceMappingURL=chunk-NX6LSFJH.js.map