diff --git a/dist/android-tv-card.min.js b/dist/android-tv-card.min.js index b329e338..2c6627d9 100644 --- a/dist/android-tv-card.min.js +++ b/dist/android-tv-card.min.js @@ -1,5 +1,5 @@ /*! For license information please see android-tv-card.min.js.LICENSE.txt */ -(()=>{var e={9263:(e,t,n)=>{"use strict";n.r(t),n.d(t,{RippleHandlers:()=>i});class i{constructor(e){this.startPress=t=>{e().then((e=>{e&&e.startPress(t)}))},this.endPress=()=>{e().then((e=>{e&&e.endPress()}))},this.startFocus=()=>{e().then((e=>{e&&e.startFocus()}))},this.endFocus=()=>{e().then((e=>{e&&e.endFocus()}))},this.startHover=()=>{e().then((e=>{e&&e.startHover()}))},this.endHover=()=>{e().then((e=>{e&&e.endHover()}))}}}},6197:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DEFAULT_DOMAIN_ICON:()=>X,DEFAULT_PANEL:()=>J,DEFAULT_VIEW_ENTITY_ID:()=>ae,DOMAINS_HIDE_MORE_INFO:()=>te,DOMAINS_MORE_INFO_NO_HISTORY:()=>ne,DOMAINS_TOGGLE:()=>re,DOMAINS_WITH_CARD:()=>Q,DOMAINS_WITH_MORE_INFO:()=>ee,NumberFormat:()=>i,STATES_OFF:()=>ie,TimeFormat:()=>r,UNIT_C:()=>oe,UNIT_F:()=>se,applyThemesOnElement:()=>F,computeCardSize:()=>D,computeDomain:()=>B,computeEntity:()=>K,computeRTL:()=>U,computeRTLDirection:()=>H,computeStateDisplay:()=>G,computeStateDomain:()=>V,createThing:()=>he,debounce:()=>pe,domainIcon:()=>fe,evaluateFilter:()=>me,fireEvent:()=>ce,fixedIcons:()=>de,formatDate:()=>u,formatDateMonth:()=>g,formatDateMonthYear:()=>v,formatDateNumeric:()=>p,formatDateShort:()=>f,formatDateTime:()=>w,formatDateTimeNumeric:()=>E,formatDateTimeWithSeconds:()=>x,formatDateWeekday:()=>c,formatDateYear:()=>b,formatNumber:()=>W,formatTime:()=>T,formatTimeWeekday:()=>I,formatTimeWithSeconds:()=>M,forwardHaptic:()=>ve,getLovelace:()=>Ee,handleAction:()=>Ce,handleActionConfig:()=>be,handleClick:()=>ke,hasAction:()=>we,hasConfigOrEntityChanged:()=>Le,hasDoubleClick:()=>xe,isNumericState:()=>Z,navigate:()=>ye,numberFormatToLocale:()=>z,relativeTime:()=>j,round:()=>Y,stateIcon:()=>Se,timerTimeRemaining:()=>P,toggleEntity:()=>_e,turnOnOffEntities:()=>Ae,turnOnOffEntity:()=>ge});var i,r,o,s=function(){return s=Object.assign||function(e){for(var t,n=1,i=arguments.length;n0)return{value:Math.round(p),unit:"year"};var d=12*p+u.getMonth()-h.getMonth();if(Math.round(Math.abs(d))>0)return{value:Math.round(d),unit:"month"};var f=r/604800;return{value:Math.round(f),unit:"week"}}(e,n);return i?function(e){return new Intl.RelativeTimeFormat(e.language,{numeric:"auto"})}(t).format(r.value,r.unit):Intl.NumberFormat(t.language,{style:"unit",unit:r.unit,unitDisplay:"long"}).format(Math.abs(r.value))};function P(e){var t,n=3600*(t=e.attributes.remaining.split(":").map(Number))[0]+60*t[1]+t[2];if("active"===e.state){var i=(new Date).getTime(),r=new Date(e.last_changed).getTime();n=Math.max(n-(i-r)/1e3,0)}return n}function R(){return(R=Object.assign||function(e){for(var t=1;t-1?e.split(".")[1].length:0;n.minimumFractionDigits=i,n.maximumFractionDigits=i}return n},G=function(e,t,n,i){var r=void 0!==i?i:t.state;if("unknown"===r||"unavailable"===r)return e("state.default."+r);if(Z(t)){if("monetary"===t.attributes.device_class)try{return W(r,n,{style:"currency",currency:t.attributes.unit_of_measurement})}catch(e){}return W(r,n)+(t.attributes.unit_of_measurement?" "+t.attributes.unit_of_measurement:"")}var o=V(t);if("input_datetime"===o){var s;if(void 0===i)return t.attributes.has_date&&t.attributes.has_time?(s=new Date(t.attributes.year,t.attributes.month-1,t.attributes.day,t.attributes.hour,t.attributes.minute),w(s,n)):t.attributes.has_date?(s=new Date(t.attributes.year,t.attributes.month-1,t.attributes.day),u(s,n)):t.attributes.has_time?((s=new Date).setHours(t.attributes.hour,t.attributes.minute),T(s,n)):t.state;try{var a=i.split(" ");if(2===a.length)return w(new Date(a.join("T")),n);if(1===a.length){if(i.includes("-"))return u(new Date(i+"T00:00"),n);if(i.includes(":")){var c=new Date;return T(new Date(c.toISOString().split("T")[0]+"T"+i),n)}}return i}catch(e){return i}}return"humidifier"===o&&"on"===r&&t.attributes.humidity?t.attributes.humidity+" %":"counter"===o||"number"===o||"input_number"===o?W(r,n):t.attributes.device_class&&e("component."+o+".state."+t.attributes.device_class+"."+r)||e("component."+o+".state._."+r)||r},X="mdi:bookmark",J="lovelace",Q=["climate","cover","configurator","input_select","input_number","input_text","lock","media_player","scene","script","timer","vacuum","water_heater","weblink"],ee=["alarm_control_panel","automation","camera","climate","configurator","cover","fan","group","history_graph","input_datetime","light","lock","media_player","script","sun","updater","vacuum","water_heater","weather"],te=["input_number","input_select","input_text","scene","weblink"],ne=["camera","configurator","history_graph","scene"],ie=["closed","locked","off"],re=new Set(["fan","input_boolean","light","switch","group","automation"]),oe="°C",se="°F",ae="group.default_view",ce=function(e,t,n,i){i=i||{},n=null==n?{}:n;var r=new Event(t,{bubbles:void 0===i.bubbles||i.bubbles,cancelable:Boolean(i.cancelable),composed:void 0===i.composed||i.composed});return r.detail=n,e.dispatchEvent(r),r},le=new Set(["call-service","divider","section","weblink","cast","select"]),ue={alert:"toggle",automation:"toggle",climate:"climate",cover:"cover",fan:"toggle",group:"group",input_boolean:"toggle",input_number:"input-number",input_select:"input-select",input_text:"input-text",light:"toggle",lock:"lock",media_player:"media-player",remote:"toggle",scene:"scene",script:"script",sensor:"sensor",timer:"timer",switch:"toggle",vacuum:"toggle",water_heater:"climate",input_datetime:"input-datetime"},he=function(e,t){void 0===t&&(t=!1);var n=function(e,t){return i("hui-error-card",{type:"error",error:e,config:t})},i=function(e,t){var i=window.document.createElement(e);try{if(!i.setConfig)return;i.setConfig(t)}catch(i){return console.error(e,i),n(i.message,t)}return i};if(!e||"object"!=typeof e||!t&&!e.type)return n("No type defined",e);var r=e.type;if(r&&r.startsWith("custom:"))r=r.substr(7);else if(t)if(le.has(r))r="hui-"+r+"-row";else{if(!e.entity)return n("Invalid config given.",e);var o=e.entity.split(".",1)[0];r="hui-"+(ue[o]||"text")+"-entity-row"}else r="hui-"+r+"-card";if(customElements.get(r))return i(r,e);var s=n("Custom element doesn't exist: "+e.type+".",e);s.style.display="None";var a=setTimeout((function(){s.style.display=""}),2e3);return customElements.whenDefined(e.type).then((function(){clearTimeout(a),ce(s,"ll-rebuild",{},s)})),s},pe=function(e,t,n){var i;return void 0===n&&(n=!1),function(){var r=[].slice.call(arguments),o=this,s=n&&!i;clearTimeout(i),i=setTimeout((function(){i=null,n||e.apply(o,r)}),t),s&&e.apply(o,r)}},de={alert:"mdi:alert",automation:"mdi:playlist-play",calendar:"mdi:calendar",camera:"mdi:video",climate:"mdi:thermostat",configurator:"mdi:settings",conversation:"mdi:text-to-speech",device_tracker:"mdi:account",fan:"mdi:fan",group:"mdi:google-circles-communities",history_graph:"mdi:chart-line",homeassistant:"mdi:home-assistant",homekit:"mdi:home-automation",image_processing:"mdi:image-filter-frames",input_boolean:"mdi:drawing",input_datetime:"mdi:calendar-clock",input_number:"mdi:ray-vertex",input_select:"mdi:format-list-bulleted",input_text:"mdi:textbox",light:"mdi:lightbulb",mailbox:"mdi:mailbox",notify:"mdi:comment-alert",person:"mdi:account",plant:"mdi:flower",proximity:"mdi:apple-safari",remote:"mdi:remote",scene:"mdi:google-pages",script:"mdi:file-document",sensor:"mdi:eye",simple_alarm:"mdi:bell",sun:"mdi:white-balance-sunny",switch:"mdi:flash",timer:"mdi:timer",updater:"mdi:cloud-upload",vacuum:"mdi:robot-vacuum",water_heater:"mdi:thermometer",weblink:"mdi:open-in-new"};function fe(e,t){if(e in de)return de[e];switch(e){case"alarm_control_panel":switch(t){case"armed_home":return"mdi:bell-plus";case"armed_night":return"mdi:bell-sleep";case"disarmed":return"mdi:bell-outline";case"triggered":return"mdi:bell-ring";default:return"mdi:bell"}case"binary_sensor":return t&&"off"===t?"mdi:radiobox-blank":"mdi:checkbox-marked-circle";case"cover":return"closed"===t?"mdi:window-closed":"mdi:window-open";case"lock":return t&&"unlocked"===t?"mdi:lock-open":"mdi:lock";case"media_player":return t&&"off"!==t&&"idle"!==t?"mdi:cast-connected":"mdi:cast";case"zwave":switch(t){case"dead":return"mdi:emoticon-dead";case"sleeping":return"mdi:sleep";case"initializing":return"mdi:timer-sand";default:return"mdi:z-wave"}default:return console.warn("Unable to find icon for domain "+e+" ("+t+")"),"mdi:bookmark"}}var me=function(e,t){var n=t.value||t,i=t.attribute?e.attributes[t.attribute]:e.state;switch(t.operator||"=="){case"==":return i===n;case"<=":return i<=n;case"<":return i=":return i>=n;case">":return i>n;case"!=":return i!==n;case"regex":return i.match(n);default:return!1}},ve=function(e){ce(window,"haptic",e)},ye=function(e,t,n){void 0===n&&(n=!1),n?history.replaceState(null,"",t):history.pushState(null,"",t),ce(window,"location-changed",{replace:n})},ge=function(e,t,n){void 0===n&&(n=!0);var i,r=B(t),o="group"===r?"homeassistant":r;switch(r){case"lock":i=n?"unlock":"lock";break;case"cover":i=n?"open_cover":"close_cover";break;default:i=n?"turn_on":"turn_off"}return e.callService(o,i,{entity_id:t})},_e=function(e,t){var n=ie.includes(e.states[t].state);return ge(e,t,n)},be=function(e,t,n,i){if(i||(i={action:"more-info"}),!i.confirmation||i.confirmation.exemptions&&i.confirmation.exemptions.some((function(e){return e.user===t.user.id}))||(ve("warning"),confirm(i.confirmation.text||"Are you sure you want to "+i.action+"?")))switch(i.action){case"more-info":(n.entity||n.camera_image)&&ce(e,"hass-more-info",{entityId:n.entity?n.entity:n.camera_image});break;case"navigate":i.navigation_path&&ye(0,i.navigation_path);break;case"url":i.url_path&&window.open(i.url_path);break;case"toggle":n.entity&&(_e(t,n.entity),ve("success"));break;case"call-service":if(!i.service)return void ve("failure");var r=i.service.split(".",2);t.callService(r[0],r[1],i.service_data,i.target),ve("success");break;case"fire-dom-event":ce(e,"ll-custom",i)}},Ce=function(e,t,n,i){var r;"double_tap"===i&&n.double_tap_action?r=n.double_tap_action:"hold"===i&&n.hold_action?r=n.hold_action:"tap"===i&&n.tap_action&&(r=n.tap_action),be(e,t,n,r)},ke=function(e,t,n,i,r){var o;if(r&&n.double_tap_action?o=n.double_tap_action:i&&n.hold_action?o=n.hold_action:!i&&n.tap_action&&(o=n.tap_action),o||(o={action:"more-info"}),!o.confirmation||o.confirmation.exemptions&&o.confirmation.exemptions.some((function(e){return e.user===t.user.id}))||confirm(o.confirmation.text||"Are you sure you want to "+o.action+"?"))switch(o.action){case"more-info":(o.entity||n.entity||n.camera_image)&&(ce(e,"hass-more-info",{entityId:o.entity?o.entity:n.entity?n.entity:n.camera_image}),o.haptic&&ve(o.haptic));break;case"navigate":o.navigation_path&&(ye(0,o.navigation_path),o.haptic&&ve(o.haptic));break;case"url":o.url_path&&window.open(o.url_path),o.haptic&&ve(o.haptic);break;case"toggle":n.entity&&(_e(t,n.entity),o.haptic&&ve(o.haptic));break;case"call-service":if(!o.service)return;var s=o.service.split(".",2),a=s[0],c=s[1],l=R({},o.service_data);"entity"===l.entity_id&&(l.entity_id=n.entity),t.callService(a,c,l,o.target),o.haptic&&ve(o.haptic);break;case"fire-dom-event":ce(e,"ll-custom",o),o.haptic&&ve(o.haptic)}};function we(e){return void 0!==e&&"none"!==e.action}function Le(e,t,n){if(t.has("config")||n)return!0;if(e.config.entity){var i=t.get("hass");return!i||i.states[e.config.entity]!==e.hass.states[e.config.entity]}return!1}function xe(e){return void 0!==e&&"none"!==e.action}var Ae=function(e,t,n){void 0===n&&(n=!0);var i={};t.forEach((function(t){if(ie.includes(e.states[t].state)===n){var r=B(t),o=["cover","lock"].includes(r)?r:"homeassistant";o in i||(i[o]=[]),i[o].push(t)}})),Object.keys(i).forEach((function(t){var r;switch(t){case"lock":r=n?"unlock":"lock";break;case"cover":r=n?"open_cover":"close_cover";break;default:r=n?"turn_on":"turn_off"}e.callService(t,r,{entity_id:i[t]})}))},Ee=function(){var e=document.querySelector("home-assistant");if(e=(e=(e=(e=(e=(e=(e=(e=e&&e.shadowRoot)&&e.querySelector("home-assistant-main"))&&e.shadowRoot)&&e.querySelector("app-drawer-layout partial-panel-resolver"))&&e.shadowRoot||e)&&e.querySelector("ha-panel-lovelace"))&&e.shadowRoot)&&e.querySelector("hui-root")){var t=e.lovelace;return t.current_view=e.___curView,t}return null},Oe={humidity:"mdi:water-percent",illuminance:"mdi:brightness-5",temperature:"mdi:thermometer",pressure:"mdi:gauge",power:"mdi:flash",signal_strength:"mdi:wifi"},Te={binary_sensor:function(e,t){var n="off"===e;switch(null==t?void 0:t.attributes.device_class){case"battery":return n?"mdi:battery":"mdi:battery-outline";case"battery_charging":return n?"mdi:battery":"mdi:battery-charging";case"cold":return n?"mdi:thermometer":"mdi:snowflake";case"connectivity":return n?"mdi:server-network-off":"mdi:server-network";case"door":return n?"mdi:door-closed":"mdi:door-open";case"garage_door":return n?"mdi:garage":"mdi:garage-open";case"power":case"plug":return n?"mdi:power-plug-off":"mdi:power-plug";case"gas":case"problem":case"safety":case"tamper":return n?"mdi:check-circle":"mdi:alert-circle";case"smoke":return n?"mdi:check-circle":"mdi:smoke";case"heat":return n?"mdi:thermometer":"mdi:fire";case"light":return n?"mdi:brightness-5":"mdi:brightness-7";case"lock":return n?"mdi:lock":"mdi:lock-open";case"moisture":return n?"mdi:water-off":"mdi:water";case"motion":return n?"mdi:walk":"mdi:run";case"occupancy":case"presence":return n?"mdi:home-outline":"mdi:home";case"opening":return n?"mdi:square":"mdi:square-outline";case"running":return n?"mdi:stop":"mdi:play";case"sound":return n?"mdi:music-note-off":"mdi:music-note";case"update":return n?"mdi:package":"mdi:package-up";case"vibration":return n?"mdi:crop-portrait":"mdi:vibrate";case"window":return n?"mdi:window-closed":"mdi:window-open";default:return n?"mdi:radiobox-blank":"mdi:checkbox-marked-circle"}},cover:function(e){var t="closed"!==e.state;switch(e.attributes.device_class){case"garage":return t?"mdi:garage-open":"mdi:garage";case"door":return t?"mdi:door-open":"mdi:door-closed";case"shutter":return t?"mdi:window-shutter-open":"mdi:window-shutter";case"blind":return t?"mdi:blinds-open":"mdi:blinds";case"window":return t?"mdi:window-open":"mdi:window-closed";default:return fe("cover",e.state)}},sensor:function(e){var t=e.attributes.device_class;if(t&&t in Oe)return Oe[t];if("battery"===t){var n=Number(e.state);if(isNaN(n))return"mdi:battery-unknown";var i=10*Math.round(n/10);return i>=100?"mdi:battery":i<=0?"mdi:battery-alert":"hass:battery-"+i}var r=e.attributes.unit_of_measurement;return"°C"===r||"°F"===r?"mdi:thermometer":fe("sensor")},input_datetime:function(e){return e.attributes.has_date?e.attributes.has_time?fe("input_datetime"):"mdi:calendar":"mdi:clock"}},Se=function(e){if(!e)return"mdi:bookmark";if(e.attributes.icon)return e.attributes.icon;var t=B(e.entity_id);return t in Te?Te[t](e):fe(t,e.state)}},6133:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CONTEXT=void 0;const i=n(6710),r=n(1384),o=n(5031);t.CONTEXT=e=>({True:!0,False:!1,None:null,hass:e,states:t=>(0,i.states)(e,t),is_state:(t,n)=>(0,i.is_state)(e,t,n),state_attr:(t,n)=>(0,i.state_attr)(e,t,n),is_state_attr:(t,n,r)=>(0,i.is_state_attr)(e,t,n,r),has_value:t=>(0,i.has_value)(e,t),iif:(t,n,i,o)=>(0,r.iif)(e,t,n,i,o),match_media:e=>(0,o.match_media)(e)})},839:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(8257),t)},8257:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.renderTemplate=void 0;const i=n(2985),r=n(6133);t.renderTemplate=function(e,t,n){if("string"==typeof t&&(t.includes("{{")&&t.includes("}}")||t.includes("{%")&&t.includes("%}"))){if(t=(0,i.renderString)(structuredClone(t),Object.assign(Object.assign({},(0,r.CONTEXT)(e)),n)).trim(),[void 0,null,"undefined","null","None"].includes(t))return"";if(/^-?(\d+|\d+\.\d+)$/.test(t))return Number(t);if("true"==t)return!0;if("false"==t)return!1}return t}},5031:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.match_media=void 0,t.match_media=function(e){return window.matchMedia(e).matches}},1384:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iif=void 0;const i=n(839);t.iif=function(e,t,n,r,o){if(o){const n=(0,i.renderTemplate)(e,t);if([void 0,null,"undefined","null","None"].includes(n))return o}const s=`\n\t\t{% if ${t} %}\n\t\t${null==n||n}\n\t\t{% else %}\n\t\t${null!=r&&r}\n\t\t{% endif %}\n\t`;return(0,i.renderTemplate)(e,s)}},6710:(e,t)=>{"use strict";function n(e,t){try{return e.states[t].state}catch(e){return}}function i(e,t,n){try{return e.states[t].attributes[n]}catch(e){return}}Object.defineProperty(t,"__esModule",{value:!0}),t.has_value=t.is_state_attr=t.state_attr=t.is_state=t.states=void 0,t.states=n,t.is_state=function(e,t,i){try{const r=n(e,t);return Array.isArray(i)?i.includes(r):r==i}catch(e){return!1}},t.state_attr=i,t.is_state_attr=function(e,t,n,r){try{const o=i(e,t,n);return Array.isArray(r)?r.includes(o):o==r}catch(e){return!1}},t.has_value=function(e,t){try{const i=n(e,t);return!![!1,0,-0,""].includes(i)||Boolean(i)}catch(e){return!1}}},3320:(e,t,n)=>{"use strict";var i=n(7990),r=n(3150);function o(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}e.exports.Type=n(1364),e.exports.Schema=n(7657),e.exports.FAILSAFE_SCHEMA=n(4795),e.exports.JSON_SCHEMA=n(5966),e.exports.CORE_SCHEMA=n(9471),e.exports.DEFAULT_SCHEMA=n(6601),e.exports.load=i.load,e.exports.loadAll=i.loadAll,e.exports.dump=r.dump,e.exports.YAMLException=n(8425),e.exports.types={binary:n(3531),float:n(5215),map:n(945),null:n(151),pairs:n(6879),set:n(4982),timestamp:n(2156),bool:n(8771),int:n(1518),merge:n(7452),omap:n(1605),seq:n(6451),str:n(48)},e.exports.safeLoad=o("safeLoad","load"),e.exports.safeLoadAll=o("safeLoadAll","loadAll"),e.exports.safeDump=o("safeDump","dump")},8347:e=>{"use strict";function t(e){return null==e}e.exports.isNothing=t,e.exports.isObject=function(e){return"object"==typeof e&&null!==e},e.exports.toArray=function(e){return Array.isArray(e)?e:t(e)?[]:[e]},e.exports.repeat=function(e,t){var n,i="";for(n=0;n{"use strict";var i=n(8347),r=n(8425),o=n(6601),s=Object.prototype.toString,a=Object.prototype.hasOwnProperty,c=65279,l=9,u=10,h=13,p=32,d=33,f=34,m=35,v=37,y=38,g=39,_=42,b=44,C=45,k=58,w=61,L=62,x=63,A=64,E=91,O=93,T=96,S=123,M=124,N=125,I={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},$=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],j=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function P(e){var t,n,o;if(t=e.toString(16).toUpperCase(),e<=255)n="x",o=2;else if(e<=65535)n="u",o=4;else{if(!(e<=4294967295))throw new r("code point within a string may not be greater than 0xFFFFFFFF");n="U",o=8}return"\\"+n+i.repeat("0",o-t.length)+t}var R=2;function F(e){this.schema=e.schema||o,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=i.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var n,i,r,o,s,c,l;if(null===t)return{};for(n={},r=0,o=(i=Object.keys(t)).length;r=55296&&i<=56319&&t+1=56320&&n<=57343?1024*(i-55296)+n-56320+65536:i}function z(e){return/^\n* /.test(e)}var Y=1,W=2,q=3,G=4,X=5;function J(e,t,n,i,o){e.dump=function(){if(0===t.length)return e.quotingType===R?'""':"''";if(!e.noCompatMode&&(-1!==$.indexOf(t)||j.test(t)))return e.quotingType===R?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,n),a=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),l=i||e.flowLevel>-1&&n>=e.flowLevel;switch(function(e,t,n,i,r,o,s,a){var l,h,p=0,I=null,$=!1,j=!1,P=-1!==i,F=-1,D=U(h=Z(e,0))&&h!==c&&!K(h)&&h!==C&&h!==x&&h!==k&&h!==b&&h!==E&&h!==O&&h!==S&&h!==N&&h!==m&&h!==y&&h!==_&&h!==d&&h!==M&&h!==w&&h!==L&&h!==g&&h!==f&&h!==v&&h!==A&&h!==T&&function(e){return!K(e)&&e!==k}(Z(e,e.length-1));if(t||s)for(l=0;l=65536?l+=2:l++){if(!U(p=Z(e,l)))return X;D=D&&V(p,I,a),I=p}else{for(l=0;l=65536?l+=2:l++){if((p=Z(e,l))===u)$=!0,P&&(j=j||l-F-1>i&&" "!==e[F+1],F=l);else if(!U(p))return X;D=D&&V(p,I,a),I=p}j=j||P&&l-F-1>i&&" "!==e[F+1]}return $||j?n>9&&z(e)?X:s?o===R?X:W:j?G:q:!D||s||r(e)?o===R?X:W:Y}(t,l,e.indent,a,(function(t){return function(e,t){var n,i;for(n=0,i=e.implicitTypes.length;n"+Q(t,e.indent)+ee(D(function(e,t){for(var n,i,r,o=/(\n+)([^\n]*)/g,s=(r=-1!==(r=e.indexOf("\n"))?r:e.length,o.lastIndex=r,te(e.slice(0,r),t)),a="\n"===e[0]||" "===e[0];i=o.exec(e);){var c=i[1],l=i[2];n=" "===l[0],s+=c+(a||n||""===l?"":"\n")+te(l,t),a=n}return s}(t,a),s));case X:return'"'+function(e){for(var t,n="",i=0,r=0;r=65536?r+=2:r++)i=Z(e,r),!(t=I[i])&&U(i)?(n+=e[r],i>=65536&&(n+=e[r+1])):n+=t||P(i);return n}(t)+'"';default:throw new r("impossible error: invalid scalar style")}}()}function Q(e,t){var n=z(e)?String(t):"",i="\n"===e[e.length-1];return n+(!i||"\n"!==e[e.length-2]&&"\n"!==e?i?"":"-":"+")+"\n"}function ee(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function te(e,t){if(""===e||" "===e[0])return e;for(var n,i,r=/ [^ ]/g,o=0,s=0,a=0,c="";n=r.exec(e);)(a=n.index)-o>t&&(i=s>o?s:a,c+="\n"+e.slice(o,i),o=i+1),s=a;return c+="\n",e.length-o>t&&s>o?c+=e.slice(o,s)+"\n"+e.slice(s+1):c+=e.slice(o),c.slice(1)}function ne(e,t,n,i){var r,o,s,a="",c=e.tag;for(r=0,o=n.length;r tag resolver accepts not "'+h+'" style');i=u.represent[h](t,h)}e.dump=i}return!0}return!1}function re(e,t,n,i,o,a,c){e.tag=null,e.dump=n,ie(e,n,!1)||ie(e,n,!0);var l,h=s.call(e.dump),p=i;i&&(i=e.flowLevel<0||e.flowLevel>t);var d,f,m="[object Object]"===h||"[object Array]"===h;if(m&&(f=-1!==(d=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||f||2!==e.indent&&t>0)&&(o=!1),f&&e.usedDuplicates[d])e.dump="*ref_"+d;else{if(m&&f&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),"[object Object]"===h)i&&0!==Object.keys(e.dump).length?(function(e,t,n,i){var o,s,a,c,l,h,p="",d=e.tag,f=Object.keys(n);if(!0===e.sortKeys)f.sort();else if("function"==typeof e.sortKeys)f.sort(e.sortKeys);else if(e.sortKeys)throw new r("sortKeys must be a boolean or a function");for(o=0,s=f.length;o1024)&&(e.dump&&u===e.dump.charCodeAt(0)?h+="?":h+="? "),h+=e.dump,l&&(h+=B(e,t)),re(e,t+1,c,!0,l)&&(e.dump&&u===e.dump.charCodeAt(0)?h+=":":h+=": ",p+=h+=e.dump));e.tag=d,e.dump=p||"{}"}(e,t,e.dump,o),f&&(e.dump="&ref_"+d+e.dump)):(function(e,t,n){var i,r,o,s,a,c="",l=e.tag,u=Object.keys(n);for(i=0,r=u.length;i1024&&(a+="? "),a+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),re(e,t,s,!1,!1)&&(c+=a+=e.dump));e.tag=l,e.dump="{"+c+"}"}(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+e.dump));else if("[object Array]"===h)i&&0!==e.dump.length?(e.noArrayIndent&&!c&&t>0?ne(e,t-1,e.dump,o):ne(e,t,e.dump,o),f&&(e.dump="&ref_"+d+e.dump)):(function(e,t,n){var i,r,o,s="",a=e.tag;for(i=0,r=n.length;i",e.dump=l+" "+e.dump)}return!0}function oe(e,t){var n,i,r=[],o=[];for(se(e,r,o),n=0,i=o.length;n{"use strict";function t(e,t){var n="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+="\n\n"+e.mark.snippet),i+" "+n):i}function n(e,n){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=n,this.message=t(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n.prototype.toString=function(e){return this.name+": "+t(this,e)},e.exports=n},7990:(e,t,n)=>{"use strict";var i=n(8347),r=n(8425),o=n(192),s=n(6601),a=Object.prototype.hasOwnProperty,c=1,l=2,u=3,h=4,p=1,d=2,f=3,m=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,v=/[\x85\u2028\u2029]/,y=/[,\[\]\{\}]/,g=/^(?:!|!!|![a-z\-]+!)$/i,_=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function b(e){return Object.prototype.toString.call(e)}function C(e){return 10===e||13===e}function k(e){return 9===e||32===e}function w(e){return 9===e||32===e||10===e||13===e}function L(e){return 44===e||91===e||93===e||123===e||125===e}function x(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function A(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function E(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var O=new Array(256),T=new Array(256),S=0;S<256;S++)O[S]=A(S)?1:0,T[S]=A(S);function M(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||s,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function N(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=o(n),new r(t,n)}function I(e,t){throw N(e,t)}function $(e,t){e.onWarning&&e.onWarning.call(null,N(e,t))}var j={YAML:function(e,t,n){var i,r,o;null!==e.version&&I(e,"duplication of %YAML directive"),1!==n.length&&I(e,"YAML directive accepts exactly one argument"),null===(i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&I(e,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),o=parseInt(i[2],10),1!==r&&I(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,1!==o&&2!==o&&$(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var i,r;2!==n.length&&I(e,"TAG directive accepts exactly two arguments"),i=n[0],r=n[1],g.test(i)||I(e,"ill-formed tag handle (first argument) of the TAG directive"),a.call(e.tagMap,i)&&I(e,'there is a previously declared suffix for "'+i+'" tag handle'),_.test(r)||I(e,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(t){I(e,"tag prefix is malformed: "+r)}e.tagMap[i]=r}};function P(e,t,n,i){var r,o,s,a;if(t1&&(e.result+=i.repeat("\n",t-1))}function H(e,t){var n,i,r=e.tag,o=e.anchor,s=[],a=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=s),i=e.input.charCodeAt(e.position);0!==i&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,I(e,"tab characters must not be used in indentation")),45===i)&&w(e.input.charCodeAt(e.position+1));)if(a=!0,e.position++,B(e,!0,-1)&&e.lineIndent<=t)s.push(null),i=e.input.charCodeAt(e.position);else if(n=e.line,z(e,t,u,!1,!0),s.push(e.result),B(e,!0,-1),i=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==i)I(e,"bad indentation of a sequence entry");else if(e.lineIndentt?M=1:e.lineIndent===t?M=0:e.lineIndentt?M=1:e.lineIndent===t?M=0:e.lineIndentt)&&(_&&(s=e.line,a=e.lineStart,c=e.position),z(e,t,h,!0,r)&&(_?y=e.result:g=e.result),_||(F(e,f,m,v,y,g,s,a,c),v=y=g=null),B(e,!0,-1),u=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&0!==u)I(e,"bad indentation of a mapping entry");else if(e.lineIndent=0))break;0===o?I(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?I(e,"repeat of an indentation width identifier"):(h=t+o-1,u=!0)}if(k(s)){do{s=e.input.charCodeAt(++e.position)}while(k(s));if(35===s)do{s=e.input.charCodeAt(++e.position)}while(!C(s)&&0!==s)}for(;0!==s;){for(D(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!u||e.lineIndenth&&(h=e.lineIndent),C(s))m++;else{if(e.lineIndent0){for(r=s,o=0;r>0;r--)(s=x(a=e.input.charCodeAt(++e.position)))>=0?o=(o<<4)+s:I(e,"expected hexadecimal character");e.result+=E(o),e.position++}else I(e,"unknown escape sequence");n=i=e.position}else C(a)?(P(e,n,i,!0),U(e,B(e,!1,t)),n=i=e.position):e.position===e.lineStart&&K(e)?I(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}I(e,"unexpected end of the stream within a double quoted scalar")}(e,A)?$=!0:function(e){var t,n,i;if(42!==(i=e.input.charCodeAt(e.position)))return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!w(i)&&!L(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&I(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),a.call(e.anchorMap,n)||I(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],B(e,!0,-1),!0}(e)?($=!0,null===e.tag&&null===e.anchor||I(e,"alias node should not have any properties")):function(e,t,n){var i,r,o,s,a,c,l,u,h=e.kind,p=e.result;if(w(u=e.input.charCodeAt(e.position))||L(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(w(i=e.input.charCodeAt(e.position+1))||n&&L(i)))return!1;for(e.kind="scalar",e.result="",r=o=e.position,s=!1;0!==u;){if(58===u){if(w(i=e.input.charCodeAt(e.position+1))||n&&L(i))break}else if(35===u){if(w(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&K(e)||n&&L(u))break;if(C(u)){if(a=e.line,c=e.lineStart,l=e.lineIndent,B(e,!1,-1),e.lineIndent>=t){s=!0,u=e.input.charCodeAt(e.position);continue}e.position=o,e.line=a,e.lineStart=c,e.lineIndent=l;break}}s&&(P(e,r,o,!1),U(e,e.line-a),r=o=e.position,s=!1),k(u)||(o=e.position+1),u=e.input.charCodeAt(++e.position)}return P(e,r,o,!1),!!e.result||(e.kind=h,e.result=p,!1)}(e,A,c===n)&&($=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===M&&($=v&&H(e,S))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&I(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),y=0,g=e.implicitTypes.length;y"),null!==e.result&&b.kind!==e.kind&&I(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+b.kind+'", not "'+e.kind+'"'),b.resolve(e.result,e.tag)?(e.result=b.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):I(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||$}function Y(e){var t,n,i,r,o=e.position,s=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(r=e.input.charCodeAt(e.position))&&(B(e,!0,-1),r=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==r));){for(s=!0,r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!w(r);)r=e.input.charCodeAt(++e.position);for(i=[],(n=e.input.slice(t,e.position)).length<1&&I(e,"directive name must not be less than one character in length");0!==r;){for(;k(r);)r=e.input.charCodeAt(++e.position);if(35===r){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&!C(r));break}if(C(r))break;for(t=e.position;0!==r&&!w(r);)r=e.input.charCodeAt(++e.position);i.push(e.input.slice(t,e.position))}0!==r&&D(e),a.call(j,n)?j[n](e,n,i):$(e,'unknown document directive "'+n+'"')}B(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,B(e,!0,-1)):s&&I(e,"directives end mark is expected"),z(e,e.lineIndent-1,h,!1,!0),B(e,!0,-1),e.checkLineBreaks&&v.test(e.input.slice(o,e.position))&&$(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&K(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,B(e,!0,-1)):e.position{"use strict";var i=n(8425),r=n(1364);function o(e,t){var n=[];return e[t].forEach((function(e){var t=n.length;n.forEach((function(n,i){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=i)})),n[t]=e})),n}function s(e){return this.extend(e)}s.prototype.extend=function(e){var t=[],n=[];if(e instanceof r)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new i("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof r))throw new i("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new i("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new i("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(e){if(!(e instanceof r))throw new i("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var a=Object.create(s.prototype);return a.implicit=(this.implicit||[]).concat(t),a.explicit=(this.explicit||[]).concat(n),a.compiledImplicit=o(a,"implicit"),a.compiledExplicit=o(a,"explicit"),a.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function i(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e{"use strict";e.exports=n(5966)},6601:(e,t,n)=>{"use strict";e.exports=n(9471).extend({implicit:[n(2156),n(7452)],explicit:[n(3531),n(1605),n(6879),n(4982)]})},4795:(e,t,n)=>{"use strict";var i=n(7657);e.exports=new i({explicit:[n(48),n(6451),n(945)]})},5966:(e,t,n)=>{"use strict";e.exports=n(4795).extend({implicit:[n(151),n(8771),n(1518),n(5215)]})},192:(e,t,n)=>{"use strict";var i=n(8347);function r(e,t,n,i,r){var o="",s="",a=Math.floor(r/2)-1;return i-t>a&&(t=i-a+(o=" ... ").length),n-i>a&&(n=i+a-(s=" ...").length),{str:o+e.slice(t,n).replace(/\t/g,"→")+s,pos:i-t+o.length}}function o(e,t){return i.repeat(" ",t-e.length)+e}e.exports=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,s=/\r?\n|\r|\0/g,a=[0],c=[],l=-1;n=s.exec(e.buffer);)c.push(n.index),a.push(n.index+n[0].length),e.position<=n.index&&l<0&&(l=a.length-2);l<0&&(l=a.length-1);var u,h,p="",d=Math.min(e.line+t.linesAfter,c.length).toString().length,f=t.maxLength-(t.indent+d+3);for(u=1;u<=t.linesBefore&&!(l-u<0);u++)h=r(e.buffer,a[l-u],c[l-u],e.position-(a[l]-a[l-u]),f),p=i.repeat(" ",t.indent)+o((e.line-u+1).toString(),d)+" | "+h.str+"\n"+p;for(h=r(e.buffer,a[l],c[l],e.position,f),p+=i.repeat(" ",t.indent)+o((e.line+1).toString(),d)+" | "+h.str+"\n",p+=i.repeat("-",t.indent+d+3+h.pos)+"^\n",u=1;u<=t.linesAfter&&!(l+u>=c.length);u++)h=r(e.buffer,a[l+u],c[l+u],e.position-(a[l]-a[l+u]),f),p+=i.repeat(" ",t.indent)+o((e.line+u+1).toString(),d)+" | "+h.str+"\n";return p.replace(/\n$/,"")}},1364:(e,t,n)=>{"use strict";var i=n(8425),r=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],o=["scalar","sequence","mapping"];e.exports=function(e,t){var n,s;if(t=t||{},Object.keys(t).forEach((function(t){if(-1===r.indexOf(t))throw new i('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=(n=t.styleAliases||null,s={},null!==n&&Object.keys(n).forEach((function(e){n[e].forEach((function(t){s[String(t)]=e}))})),s),-1===o.indexOf(this.kind))throw new i('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}},3531:(e,t,n)=>{"use strict";var i=n(1364),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";e.exports=new i("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i=0,o=e.length,s=r;for(n=0;n64)){if(t<0)return!1;i+=6}return i%8==0},construct:function(e){var t,n,i=e.replace(/[\r\n=]/g,""),o=i.length,s=r,a=0,c=[];for(t=0;t>16&255),c.push(a>>8&255),c.push(255&a)),a=a<<6|s.indexOf(i.charAt(t));return 0==(n=o%4*6)?(c.push(a>>16&255),c.push(a>>8&255),c.push(255&a)):18===n?(c.push(a>>10&255),c.push(a>>2&255)):12===n&&c.push(a>>4&255),new Uint8Array(c)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,i="",o=0,s=e.length,a=r;for(t=0;t>18&63],i+=a[o>>12&63],i+=a[o>>6&63],i+=a[63&o]),o=(o<<8)+e[t];return 0==(n=s%3)?(i+=a[o>>18&63],i+=a[o>>12&63],i+=a[o>>6&63],i+=a[63&o]):2===n?(i+=a[o>>10&63],i+=a[o>>4&63],i+=a[o<<2&63],i+=a[64]):1===n&&(i+=a[o>>2&63],i+=a[o<<4&63],i+=a[64],i+=a[64]),i}})},8771:(e,t,n)=>{"use strict";var i=n(1364);e.exports=new i("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},5215:(e,t,n)=>{"use strict";var i=n(8347),r=n(1364),o=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),s=/^[-+]?[0-9]+e/;e.exports=new r("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!o.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||i.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(i.isNegativeZero(e))return"-0.0";return n=e.toString(10),s.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},1518:(e,t,n)=>{"use strict";var i=n(8347),r=n(1364);function o(e){return 48<=e&&e<=55}function s(e){return 48<=e&&e<=57}e.exports=new r("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i=e.length,r=0,a=!1;if(!i)return!1;if("-"!==(t=e[r])&&"+"!==t||(t=e[++r]),"0"===t){if(r+1===i)return!0;if("b"===(t=e[++r])){for(r++;r=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},945:(e,t,n)=>{"use strict";var i=n(1364);e.exports=new i("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},7452:(e,t,n)=>{"use strict";var i=n(1364);e.exports=new i("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}})},151:(e,t,n)=>{"use strict";var i=n(1364);e.exports=new i("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})},1605:(e,t,n)=>{"use strict";var i=n(1364),r=Object.prototype.hasOwnProperty,o=Object.prototype.toString;e.exports=new i("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,i,s,a,c=[],l=e;for(t=0,n=l.length;t{"use strict";var i=n(1364),r=Object.prototype.toString;e.exports=new i("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,i,o,s,a=e;for(s=new Array(a.length),t=0,n=a.length;t{"use strict";var i=n(1364);e.exports=new i("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},4982:(e,t,n)=>{"use strict";var i=n(1364),r=Object.prototype.hasOwnProperty;e.exports=new i("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(r.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}})},48:(e,t,n)=>{"use strict";var i=n(1364);e.exports=new i("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},2156:(e,t,n)=>{"use strict";var i=n(1364),r=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),o=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");e.exports=new i("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==r.exec(e)||null!==o.exec(e))},construct:function(e){var t,n,i,s,a,c,l,u,h=0,p=null;if(null===(t=r.exec(e))&&(t=o.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,s=+t[3],!t[4])return new Date(Date.UTC(n,i,s));if(a=+t[4],c=+t[5],l=+t[6],t[7]){for(h=t[7].slice(0,3);h.length<3;)h+="0";h=+h}return t[9]&&(p=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(p=-p)),u=new Date(Date.UTC(n,i,s,a,c,l,h)),p&&u.setTime(u.getTime()-p),u},instanceOf:Date,represent:function(e){return e.toISOString()}})},2985:function(e){var t;"undefined"!=typeof self&&self,t=function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=11)}([function(e,t,n){"use strict";var i=Array.prototype,r=Object.prototype,o={"&":"&",'"':""","'":"'","<":"<",">":">","\\":"\"},s=/[&"'<>\\]/g;function a(e,t){return r.hasOwnProperty.call(e,t)}function c(e){return o[e]}function l(e,t,n){var i,r,o;if(e instanceof Error&&(e=(r=e).name+": "+r.message),Object.setPrototypeOf?(i=new Error(e),Object.setPrototypeOf(i,l.prototype)):(i=this,Object.defineProperty(i,"message",{enumerable:!1,writable:!0,value:e})),Object.defineProperty(i,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(i,this.constructor),r){var s=Object.getOwnPropertyDescriptor(r,"stack");(o=s&&(s.get||function(){return s.value}))||(o=function(){return r.stack})}else{var a=new Error(e).stack;o=function(){return a}}return Object.defineProperty(i,"stack",{get:function(){return o.call(i)}}),Object.defineProperty(i,"cause",{value:r}),i.lineno=t,i.colno=n,i.firstUpdate=!0,i.Update=function(e){var t="("+(e||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?t+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(t+=" [Line "+this.lineno+"]")),t+="\n ",this.firstUpdate&&(t+=" "),this.message=t+(this.message||""),this.firstUpdate=!1,this},i}function u(e){return"[object Function]"===r.toString.call(e)}function h(e){return"[object Array]"===r.toString.call(e)}function p(e){return"[object String]"===r.toString.call(e)}function d(e){return"[object Object]"===r.toString.call(e)}function f(e){var t,n=(t=e)?"string"==typeof t?t.split("."):[t]:[];return function(e){for(var t=e,i=0;ie.length)s=r.slice(0,e.length),r.slice(s.length,l).forEach((function(e,n){n2?r-2:0),s=2;s0||!n)&&process.stdout.write(" ".repeat(t));var o=r===i.length-1?"":"\n";process.stdout.write(""+e+o)}))}e.exports={Node:c,Root:h,NodeList:u,Value:l,Literal:p,Symbol:d,Group:f,Array:m,Pair:v,Dict:y,Output:B,Capture:K,TemplateData:U,If:_,IfAsync:b,InlineIf:C,For:k,AsyncEach:w,AsyncAll:L,Macro:x,Caller:A,Import:E,FromImport:O,FunCall:T,Filter:S,FilterAsync:M,KeywordArgs:N,Block:I,Super:$,Extends:j,Include:P,Set:R,Switch:F,Case:D,LookupVal:g,BinOp:V,In:Z,Is:z,Or:Y,And:W,Not:q,Add:G,Concat:X,Sub:J,Mul:Q,Div:ee,FloorDiv:te,Mod:ne,Pow:ie,Neg:re,Pos:oe,Compare:se,CompareOperand:ae,CallExtension:ce,CallExtensionAsync:le,printNodes:function e(t,n){if(n=n||0,ue(t.typename+": ",n),t instanceof u)ue("\n"),t.children.forEach((function(t){e(t,n+2)}));else if(t instanceof ce)ue(t.extName+"."+t.prop+"\n"),t.args&&e(t.args,n+2),t.contentArgs&&t.contentArgs.forEach((function(t){e(t,n+2)}));else{var i=[],r=null;t.iterFields((function(e,t){e instanceof c?i.push([t,e]):(r=r||{})[t]=e})),r?ue(JSON.stringify(r,null,2)+"\n",null,!0):ue("\n"),i.forEach((function(t){var i=t[0],r=t[1];ue("["+i+"] =>",n+2),e(r,n+4)}))}}}},function(e,t){},function(e,t,n){"use strict";function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}var r=n(8),o=n(17),s=n(3),a=n(0).TemplateError,c=n(2).Frame,l=n(1).Obj,u={"==":"==","===":"===","!=":"!=","!==":"!==","<":"<",">":">","<=":"<=",">=":">="},h=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,i(t,n);var o=r.prototype;return o.init=function(e,t){this.templateName=e,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this._scopeClosers="",this.inBlock=!1,this.throwOnUndefined=t},o.fail=function(e,t,n){throw void 0!==t&&(t+=1),void 0!==n&&(n+=1),new a(e,t,n)},o._pushBuffer=function(){var e=this._tmpid();return this.bufferStack.push(this.buffer),this.buffer=e,this._emit("var "+this.buffer+' = "";'),e},o._popBuffer=function(){this.buffer=this.bufferStack.pop()},o._emit=function(e){this.codebuf.push(e)},o._emitLine=function(e){this._emit(e+"\n")},o._emitLines=function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i0&&r._emit(","),r.compile(e,t)})),i&&this._emit(i)},o._compileExpression=function(e,t){this.assertType(e,s.Literal,s.Symbol,s.Group,s.Array,s.Dict,s.FunCall,s.Caller,s.Filter,s.LookupVal,s.Compare,s.InlineIf,s.In,s.Is,s.And,s.Or,s.Not,s.Add,s.Concat,s.Sub,s.Mul,s.Div,s.FloorDiv,s.Mod,s.Pow,s.Neg,s.Pos,s.Compare,s.NodeList),this.compile(e,t)},o.assertType=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0&&i._emit(","),e){i._emitLine("function(cb) {"),i._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var r=i._pushBuffer();i._withScopedSyntax((function(){i.compile(e,t),i._emitLine("cb(null, "+r+");")})),i._popBuffer(),i._emitLine("return "+r+";"),i._emitLine("}")}else i._emit("null")})),n){var c=this._tmpid();this._emitLine(", "+this._makeCallback(c)),this._emitLine(this.buffer+" += runtime.suppressValue("+c+", "+a+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+a+" && env.opts.autoescape);\n")},o.compileCallExtensionAsync=function(e,t){this.compileCallExtension(e,t,!0)},o.compileNodeList=function(e,t){this._compileChildren(e,t)},o.compileLiteral=function(e){if("string"==typeof e.value){var t=e.value.replace(/\\/g,"\\\\");t=(t=(t=(t=(t=t.replace(/"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t")).replace(/\u2028/g,"\\u2028"),this._emit('"'+t+'"')}else null===e.value?this._emit("null"):this._emit(e.value.toString())},o.compileSymbol=function(e,t){var n=e.value,i=t.lookup(n);i?this._emit(i):this._emit('runtime.contextOrFrameLookup(context, frame, "'+n+'")')},o.compileGroup=function(e,t){this._compileAggregate(e,t,"(",")")},o.compileArray=function(e,t){this._compileAggregate(e,t,"[","]")},o.compileDict=function(e,t){this._compileAggregate(e,t,"{","}")},o.compilePair=function(e,t){var n=e.key,i=e.value;n instanceof s.Symbol?n=new s.Literal(n.lineno,n.colno,n.value):n instanceof s.Literal&&"string"==typeof n.value||this.fail("compilePair: Dict keys must be strings or names",n.lineno,n.colno),this.compile(n,t),this._emit(": "),this._compileExpression(i,t)},o.compileInlineIf=function(e,t){this._emit("("),this.compile(e.cond,t),this._emit("?"),this.compile(e.body,t),this._emit(":"),null!==e.else_?this.compile(e.else_,t):this._emit('""'),this._emit(")")},o.compileIn=function(e,t){this._emit("runtime.inOperator("),this.compile(e.left,t),this._emit(","),this.compile(e.right,t),this._emit(")")},o.compileIs=function(e,t){var n=e.right.name?e.right.name.value:e.right.value;this._emit('env.getTest("'+n+'").call(context, '),this.compile(e.left,t),e.right.args&&(this._emit(","),this.compile(e.right.args,t)),this._emit(") === true")},o._binOpEmitter=function(e,t,n){this.compile(e.left,t),this._emit(n),this.compile(e.right,t)},o.compileOr=function(e,t){return this._binOpEmitter(e,t," || ")},o.compileAnd=function(e,t){return this._binOpEmitter(e,t," && ")},o.compileAdd=function(e,t){return this._binOpEmitter(e,t," + ")},o.compileConcat=function(e,t){return this._binOpEmitter(e,t,' + "" + ')},o.compileSub=function(e,t){return this._binOpEmitter(e,t," - ")},o.compileMul=function(e,t){return this._binOpEmitter(e,t," * ")},o.compileDiv=function(e,t){return this._binOpEmitter(e,t," / ")},o.compileMod=function(e,t){return this._binOpEmitter(e,t," % ")},o.compileNot=function(e,t){this._emit("!"),this.compile(e.target,t)},o.compileFloorDiv=function(e,t){this._emit("Math.floor("),this.compile(e.left,t),this._emit(" / "),this.compile(e.right,t),this._emit(")")},o.compilePow=function(e,t){this._emit("Math.pow("),this.compile(e.left,t),this._emit(", "),this.compile(e.right,t),this._emit(")")},o.compileNeg=function(e,t){this._emit("-"),this.compile(e.target,t)},o.compilePos=function(e,t){this._emit("+"),this.compile(e.target,t)},o.compileCompare=function(e,t){var n=this;this.compile(e.expr,t),e.ops.forEach((function(e){n._emit(" "+u[e.type]+" "),n.compile(e.expr,t)}))},o.compileLookupVal=function(e,t){this._emit("runtime.memberLookup(("),this._compileExpression(e.target,t),this._emit("),"),this._compileExpression(e.val,t),this._emit(")")},o._getNodeName=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--"}},o.compileFunCall=function(e,t){this._emit("(lineno = "+e.lineno+", colno = "+e.colno+", "),this._emit("runtime.callWrap("),this._compileExpression(e.name,t),this._emit(', "'+this._getNodeName(e.name).replace(/"/g,'\\"')+'", context, '),this._compileAggregate(e.args,t,"[","])"),this._emit(")")},o.compileFilter=function(e,t){var n=e.name;this.assertType(n,s.Symbol),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(e.args,t),this._emit(")")},o.compileFilterAsync=function(e,t){var n=e.name,i=e.symbol.value;this.assertType(n,s.Symbol),t.set(i,i),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(e.args,t),this._emitLine(", "+this._makeCallback(i)),this._addScopeLevel()},o.compileKeywordArgs=function(e,t){this._emit("runtime.makeKeywordArgs("),this.compileDict(e,t),this._emit(")")},o.compileSet=function(e,t){var n=this,i=[];e.targets.forEach((function(e){var r=e.value,o=t.lookup(r);null==o&&(o=n._tmpid(),n._emitLine("var "+o+";")),i.push(o)})),e.value?(this._emit(i.join(" = ")+" = "),this._compileExpression(e.value,t),this._emitLine(";")):(this._emit(i.join(" = ")+" = "),this.compile(e.body,t),this._emitLine(";")),e.targets.forEach((function(e,t){var r=i[t],o=e.value;n._emitLine('frame.set("'+o+'", '+r+", true);"),n._emitLine("if(frame.topLevel) {"),n._emitLine('context.setVariable("'+o+'", '+r+");"),n._emitLine("}"),"_"!==o.charAt(0)&&(n._emitLine("if(frame.topLevel) {"),n._emitLine('context.addExport("'+o+'", '+r+");"),n._emitLine("}"))}))},o.compileSwitch=function(e,t){var n=this;this._emit("switch ("),this.compile(e.expr,t),this._emit(") {"),e.cases.forEach((function(e,i){n._emit("case "),n.compile(e.cond,t),n._emit(": "),n.compile(e.body,t),e.body.children.length&&n._emitLine("break;")})),e.default&&(this._emit("default:"),this.compile(e.default,t)),this._emit("}")},o.compileIf=function(e,t,n){var i=this;this._emit("if("),this._compileExpression(e.cond,t),this._emitLine(") {"),this._withScopedSyntax((function(){i.compile(e.body,t),n&&i._emit("cb()")})),e.else_?(this._emitLine("}\nelse {"),this._withScopedSyntax((function(){i.compile(e.else_,t),n&&i._emit("cb()")}))):n&&(this._emitLine("}\nelse {"),this._emit("cb()")),this._emitLine("}")},o.compileIfAsync=function(e,t){this._emit("(function(cb) {"),this.compileIf(e,t,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},o._emitLoopBindings=function(e,t,n,i){var r=this;[{name:"index",val:n+" + 1"},{name:"index0",val:n},{name:"revindex",val:i+" - "+n},{name:"revindex0",val:i+" - "+n+" - 1"},{name:"first",val:n+" === 0"},{name:"last",val:n+" === "+i+" - 1"},{name:"length",val:i}].forEach((function(e){r._emitLine('frame.set("loop.'+e.name+'", '+e.val+");")}))},o.compileFor=function(e,t){var n=this,i=this._tmpid(),r=this._tmpid(),o=this._tmpid();if(t=t.push(),this._emitLine("frame = frame.push();"),this._emit("var "+o+" = "),this._compileExpression(e.arr,t),this._emitLine(";"),this._emit("if("+o+") {"),this._emitLine(o+" = runtime.fromIterator("+o+");"),e.name instanceof s.Array){this._emitLine("var "+i+";"),this._emitLine("if(runtime.isArray("+o+")) {"),this._emitLine("var "+r+" = "+o+".length;"),this._emitLine("for("+i+"=0; "+i+" < "+o+".length; "+i+"++) {"),e.name.children.forEach((function(r,s){var a=n._tmpid();n._emitLine("var "+a+" = "+o+"["+i+"]["+s+"];"),n._emitLine('frame.set("'+r+'", '+o+"["+i+"]["+s+"]);"),t.set(e.name.children[s].value,a)})),this._emitLoopBindings(e,o,i,r),this._withScopedSyntax((function(){n.compile(e.body,t)})),this._emitLine("}"),this._emitLine("} else {");var a=e.name.children,c=a[0],l=a[1],u=this._tmpid(),h=this._tmpid();t.set(c.value,u),t.set(l.value,h),this._emitLine(i+" = -1;"),this._emitLine("var "+r+" = runtime.keys("+o+").length;"),this._emitLine("for(var "+u+" in "+o+") {"),this._emitLine(i+"++;"),this._emitLine("var "+h+" = "+o+"["+u+"];"),this._emitLine('frame.set("'+c.value+'", '+u+");"),this._emitLine('frame.set("'+l.value+'", '+h+");"),this._emitLoopBindings(e,o,i,r),this._withScopedSyntax((function(){n.compile(e.body,t)})),this._emitLine("}"),this._emitLine("}")}else{var p=this._tmpid();t.set(e.name.value,p),this._emitLine("var "+r+" = "+o+".length;"),this._emitLine("for(var "+i+"=0; "+i+" < "+o+".length; "+i+"++) {"),this._emitLine("var "+p+" = "+o+"["+i+"];"),this._emitLine('frame.set("'+e.name.value+'", '+p+");"),this._emitLoopBindings(e,o,i,r),this._withScopedSyntax((function(){n.compile(e.body,t)})),this._emitLine("}")}this._emitLine("}"),e.else_&&(this._emitLine("if (!"+r+") {"),this.compile(e.else_,t),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o._compileAsyncLoop=function(e,t,n){var i=this,r=this._tmpid(),o=this._tmpid(),a=this._tmpid(),c=n?"asyncAll":"asyncEach";if(t=t.push(),this._emitLine("frame = frame.push();"),this._emit("var "+a+" = runtime.fromIterator("),this._compileExpression(e.arr,t),this._emitLine(");"),e.name instanceof s.Array){var l=e.name.children.length;this._emit("runtime."+c+"("+a+", "+l+", function("),e.name.children.forEach((function(e){i._emit(e.value+",")})),this._emit(r+","+o+",next) {"),e.name.children.forEach((function(e){var n=e.value;t.set(n,n),i._emitLine('frame.set("'+n+'", '+n+");")}))}else{var u=e.name.value;this._emitLine("runtime."+c+"("+a+", 1, function("+u+", "+r+", "+o+",next) {"),this._emitLine('frame.set("'+u+'", '+u+");"),t.set(u,u)}this._emitLoopBindings(e,a,r,o),this._withScopedSyntax((function(){var o;n&&(o=i._pushBuffer()),i.compile(e.body,t),i._emitLine("next("+r+(o?","+o:"")+");"),n&&i._popBuffer()}));var h=this._tmpid();this._emitLine("}, "+this._makeCallback(h)),this._addScopeLevel(),n&&this._emitLine(this.buffer+" += "+h+";"),e.else_&&(this._emitLine("if (!"+a+".length) {"),this.compile(e.else_,t),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o.compileAsyncEach=function(e,t){this._compileAsyncLoop(e,t)},o.compileAsyncAll=function(e,t){this._compileAsyncLoop(e,t,!0)},o._compileMacro=function(e,t){var n=this,i=[],r=null,o="macro_"+this._tmpid(),a=void 0!==t;e.args.children.forEach((function(t,o){o===e.args.children.length-1&&t instanceof s.Dict?r=t:(n.assertType(t,s.Symbol),i.push(t))}));var l,u=[].concat(i.map((function(e){return"l_"+e.value})),["kwargs"]),h=i.map((function(e){return'"'+e.value+'"'})),p=(r&&r.children||[]).map((function(e){return'"'+e.key.value+'"'}));l=a?t.push(!0):new c,this._emitLines("var "+o+" = runtime.makeMacro(","["+h.join(", ")+"], ","["+p.join(", ")+"], ","function ("+u.join(", ")+") {","var callerFrame = frame;","frame = "+(a?"frame.push(true);":"new runtime.Frame();"),"kwargs = kwargs || {};",'if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {','frame.set("caller", kwargs.caller); }'),i.forEach((function(e){n._emitLine('frame.set("'+e.value+'", l_'+e.value+");"),l.set(e.value,"l_"+e.value)})),r&&r.children.forEach((function(e){var t=e.key.value;n._emit('frame.set("'+t+'", '),n._emit('Object.prototype.hasOwnProperty.call(kwargs, "'+t+'")'),n._emit(' ? kwargs["'+t+'"] : '),n._compileExpression(e.value,l),n._emit(");")}));var d=this._pushBuffer();return this._withScopedSyntax((function(){n.compile(e.body,l)})),this._emitLine("frame = "+(a?"frame.pop();":"callerFrame;")),this._emitLine("return new runtime.SafeString("+d+");"),this._emitLine("});"),this._popBuffer(),o},o.compileMacro=function(e,t){var n=this._compileMacro(e),i=e.name.value;t.set(i,n),t.parent?this._emitLine('frame.set("'+i+'", '+n+");"):("_"!==e.name.value.charAt(0)&&this._emitLine('context.addExport("'+i+'");'),this._emitLine('context.setVariable("'+i+'", '+n+");"))},o.compileCaller=function(e,t){this._emit("(function (){");var n=this._compileMacro(e,t);this._emit("return "+n+";})()")},o._compileGetTemplate=function(e,t,n,i){var r=this._tmpid(),o=this._templateName(),s=this._makeCallback(r),a=n?"true":"false",c=i?"true":"false";return this._emit("env.getTemplate("),this._compileExpression(e.template,t),this._emitLine(", "+a+", "+o+", "+c+", "+s),r},o.compileImport=function(e,t){var n=e.target.value,i=this._compileGetTemplate(e,t,!1,!1);this._addScopeLevel(),this._emitLine(i+".getExported("+(e.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(i)),this._addScopeLevel(),t.set(n,i),t.parent?this._emitLine('frame.set("'+n+'", '+i+");"):this._emitLine('context.setVariable("'+n+'", '+i+");")},o.compileFromImport=function(e,t){var n=this,i=this._compileGetTemplate(e,t,!1,!1);this._addScopeLevel(),this._emitLine(i+".getExported("+(e.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(i)),this._addScopeLevel(),e.names.children.forEach((function(e){var r,o,a=n._tmpid();e instanceof s.Pair?(r=e.key.value,o=e.value.value):o=r=e.value,n._emitLine("if(Object.prototype.hasOwnProperty.call("+i+', "'+r+'")) {'),n._emitLine("var "+a+" = "+i+"."+r+";"),n._emitLine("} else {"),n._emitLine("cb(new Error(\"cannot import '"+r+"'\")); return;"),n._emitLine("}"),t.set(o,a),t.parent?n._emitLine('frame.set("'+o+'", '+a+");"):n._emitLine('context.setVariable("'+o+'", '+a+");")}))},o.compileBlock=function(e){var t=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(t)),this._emitLine(this.buffer+" += "+t+";"),this._addScopeLevel()},o.compileSuper=function(e,t){var n=e.blockName.value,i=e.symbol.value,r=this._makeCallback(i);this._emitLine('context.getSuper(env, "'+n+'", b_'+n+", frame, runtime, "+r),this._emitLine(i+" = runtime.markSafe("+i+");"),this._addScopeLevel(),t.set(i,i)},o.compileExtends=function(e,t){var n=this._tmpid(),i=this._compileGetTemplate(e,t,!0,!1);this._emitLine("parentTemplate = "+i),this._emitLine("for(var "+n+" in parentTemplate.blocks) {"),this._emitLine("context.addBlock("+n+", parentTemplate.blocks["+n+"]);"),this._emitLine("}"),this._addScopeLevel()},o.compileInclude=function(e,t){this._emitLine("var tasks = [];"),this._emitLine("tasks.push("),this._emitLine("function(callback) {");var n=this._compileGetTemplate(e,t,!1,e.ignoreMissing);this._emitLine("callback(null,"+n+");});"),this._emitLine("});");var i=this._tmpid();this._emitLine("tasks.push("),this._emitLine("function(template, callback){"),this._emitLine("template.render(context.getVariables(), frame, "+this._makeCallback(i)),this._emitLine("callback(null,"+i+");});"),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()},o.compileTemplateData=function(e,t){this.compileLiteral(e,t)},o.compileCapture=function(e,t){var n=this,i=this.buffer;this.buffer="output",this._emitLine("(function() {"),this._emitLine('var output = "";'),this._withScopedSyntax((function(){n.compile(e.body,t)})),this._emitLine("return output;"),this._emitLine("})()"),this.buffer=i},o.compileOutput=function(e,t){var n=this;e.children.forEach((function(i){i instanceof s.TemplateData?i.value&&(n._emit(n.buffer+" += "),n.compileLiteral(i,t),n._emitLine(";")):(n._emit(n.buffer+" += runtime.suppressValue("),n.throwOnUndefined&&n._emit("runtime.ensureDefined("),n.compile(i,t),n.throwOnUndefined&&n._emit(","+e.lineno+","+e.colno+")"),n._emit(", env.opts.autoescape);\n"))}))},o.compileRoot=function(e,t){var n=this;t&&this.fail("compileRoot: root node can't have frame"),t=new c,this._emitFuncBegin(e,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(e,t),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 i=[],r=e.findAll(s.Block);r.forEach((function(e,t){var r=e.name.value;if(-1!==i.indexOf(r))throw new Error('Block "'+r+'" defined more than once.');i.push(r),n._emitFuncBegin(e,"b_"+r);var o=new c;n._emitLine("var frame = frame.push(true);"),n.compile(e.body,o),n._emitFuncEnd()})),this._emitLine("return {"),r.forEach((function(e,t){var i="b_"+e.name.value;n._emitLine(i+": "+i+",")})),this._emitLine("root: root\n};")},o.compile=function(e,t){var n=this["compile"+e.typename];n?n.call(this,e,t):this.fail("compile: Cannot compile node: "+e.typename,e.lineno,e.colno)},o.getCode=function(){return this.codebuf.join("")},r}(l);e.exports={compile:function(e,t,n,i,s){void 0===s&&(s={});var a=new h(i,s.throwOnUndefined),c=(n||[]).map((function(e){return e.preprocess})).filter((function(e){return!!e})).reduce((function(e,t){return t(e)}),e);return a.compile(o.transform(r.parse(c,n,s),t,i)),a.getCode()},Compiler:h}},function(e,t,n){"use strict";function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}var r=n(4),o=n(1).EmitterObj;e.exports=function(e){var t,n;function o(){return e.apply(this,arguments)||this}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,i(t,n);var s=o.prototype;return s.resolve=function(e,t){return r.resolve(r.dirname(e),t)},s.isRelative=function(e){return 0===e.indexOf("./")||0===e.indexOf("../")},o}(o)},function(e,t,n){"use strict";function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}var o=n(12),s=n(15),a=n(0),c=n(5),l=n(18),u=n(10),h=u.FileSystemLoader,p=u.WebLoader,d=u.PrecompiledLoader,f=n(20),m=n(21),v=n(1),y=v.Obj,g=v.EmitterObj,_=n(2),b=_.handleError,C=_.Frame,k=n(22);function w(e,t,n){o((function(){e(t,n)}))}var L={type:"code",obj:{root:function(e,t,n,i,r){try{r(null,"")}catch(e){r(b(e,null,null))}}}},x=function(e){function t(){return e.apply(this,arguments)||this}i(t,e);var n=t.prototype;return n.init=function(e,t){var n=this;t=this.opts=t||{},this.opts.dev=!!t.dev,this.opts.autoescape=null==t.autoescape||t.autoescape,this.opts.throwOnUndefined=!!t.throwOnUndefined,this.opts.trimBlocks=!!t.trimBlocks,this.opts.lstripBlocks=!!t.lstripBlocks,this.loaders=[],e?this.loaders=a.isArray(e)?e:[e]:h?this.loaders=[new h("views")]:p&&(this.loaders=[new p("/views")]),"undefined"!=typeof window&&window.nunjucksPrecompiled&&this.loaders.unshift(new d(window.nunjucksPrecompiled)),this._initLoaders(),this.globals=m(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],a._entries(l).forEach((function(e){var t=e[0],i=e[1];return n.addFilter(t,i)})),a._entries(f).forEach((function(e){var t=e[0],i=e[1];return n.addTest(t,i)}))},n._initLoaders=function(){var e=this;this.loaders.forEach((function(t){t.cache={},"function"==typeof t.on&&(t.on("update",(function(n,i){t.cache[n]=null,e.emit("update",n,i,t)})),t.on("load",(function(n,i){e.emit("load",n,i,t)})))}))},n.invalidateCache=function(){this.loaders.forEach((function(e){e.cache={}}))},n.addExtension=function(e,t){return t.__name=e,this.extensions[e]=t,this.extensionsList.push(t),this},n.removeExtension=function(e){var t=this.getExtension(e);t&&(this.extensionsList=a.without(this.extensionsList,t),delete this.extensions[e])},n.getExtension=function(e){return this.extensions[e]},n.hasExtension=function(e){return!!this.extensions[e]},n.addGlobal=function(e,t){return this.globals[e]=t,this},n.getGlobal=function(e){if(void 0===this.globals[e])throw new Error("global not found: "+e);return this.globals[e]},n.addFilter=function(e,t,n){var i=t;return n&&this.asyncFilters.push(e),this.filters[e]=i,this},n.getFilter=function(e){if(!this.filters[e])throw new Error("filter not found: "+e);return this.filters[e]},n.addTest=function(e,t){return this.tests[e]=t,this},n.getTest=function(e){if(!this.tests[e])throw new Error("test not found: "+e);return this.tests[e]},n.resolveTemplate=function(e,t,n){return e.isRelative&&t&&e.isRelative(n)&&e.resolve?e.resolve(t,n):n},n.getTemplate=function(e,t,n,i,r){var o,s=this,c=this,l=null;if(e&&e.raw&&(e=e.raw),a.isFunction(n)&&(r=n,n=null,t=t||!1),a.isFunction(t)&&(r=t,t=!1),e instanceof E)l=e;else{if("string"!=typeof e)throw new Error("template names must be a string: "+e);for(var u=0;u0&&!this.skip(r.TOKEN_COMMA)&&this.fail("parseFrom: expected comma",e.lineno,e.colno);var a=this.parsePrimary();if("_"===a.value.charAt(0)&&this.fail("parseFrom: names starting with an underscore cannot be imported",a.lineno,a.colno),this.skipSymbol("as")){var c=this.parsePrimary();i.addChild(new o.Pair(a.lineno,a.colno,a,c))}else i.addChild(a);n=this.parseWithContext()}return new o.FromImport(e.lineno,e.colno,t,i,n)},c.parseBlock=function(){var e=this.peekToken();this.skipSymbol("block")||this.fail("parseBlock: expected block",e.lineno,e.colno);var t=new o.Block(e.lineno,e.colno);t.name=this.parsePrimary(),t.name instanceof o.Symbol||this.fail("parseBlock: variable name expected",e.lineno,e.colno),this.advanceAfterBlockEnd(e.value),t.body=this.parseUntilBlocks("endblock"),this.skipSymbol("endblock"),this.skipSymbol(t.name.value);var n=this.peekToken();return n||this.fail("parseBlock: expected endblock, got end of file"),this.advanceAfterBlockEnd(n.value),t},c.parseExtends=function(){var e="extends",t=this.peekToken();this.skipSymbol(e)||this.fail("parseTemplateRef: expected "+e);var n=new o.Extends(t.lineno,t.colno);return n.template=this.parseExpression(),this.advanceAfterBlockEnd(t.value),n},c.parseInclude=function(){var e="include",t=this.peekToken();this.skipSymbol(e)||this.fail("parseInclude: expected "+e);var n=new o.Include(t.lineno,t.colno);return n.template=this.parseExpression(),this.skipSymbol("ignore")&&this.skipSymbol("missing")&&(n.ignoreMissing=!0),this.advanceAfterBlockEnd(t.value),n},c.parseIf=function(){var e,t=this.peekToken();this.skipSymbol("if")||this.skipSymbol("elif")||this.skipSymbol("elseif")?e=new o.If(t.lineno,t.colno):this.skipSymbol("ifAsync")?e=new o.IfAsync(t.lineno,t.colno):this.fail("parseIf: expected if, elif, or elseif",t.lineno,t.colno),e.cond=this.parseExpression(),this.advanceAfterBlockEnd(t.value),e.body=this.parseUntilBlocks("elif","elseif","else","endif");var n=this.peekToken();switch(n&&n.value){case"elseif":case"elif":e.else_=this.parseIf();break;case"else":this.advanceAfterBlockEnd(),e.else_=this.parseUntilBlocks("endif"),this.advanceAfterBlockEnd();break;case"endif":e.else_=null,this.advanceAfterBlockEnd();break;default:this.fail("parseIf: expected elif, else, or endif, got end of file")}return e},c.parseSet=function(){var e=this.peekToken();this.skipSymbol("set")||this.fail("parseSet: expected set",e.lineno,e.colno);for(var t,n=new o.Set(e.lineno,e.colno,[]);(t=this.parsePrimary())&&(n.targets.push(t),this.skip(r.TOKEN_COMMA)););return this.skipValue(r.TOKEN_OPERATOR,"=")?(n.value=this.parseExpression(),this.advanceAfterBlockEnd(e.value)):this.skip(r.TOKEN_BLOCK_END)?(n.body=new o.Capture(e.lineno,e.colno,this.parseUntilBlocks("endset")),n.value=null,this.advanceAfterBlockEnd()):this.fail("parseSet: expected = or block end in set tag",e.lineno,e.colno),n},c.parseSwitch=function(){var e="switch",t="endswitch",n="case",i="default",r=this.peekToken();this.skipSymbol(e)||this.skipSymbol(n)||this.skipSymbol(i)||this.fail('parseSwitch: expected "switch," "case" or "default"',r.lineno,r.colno);var s=this.parseExpression();this.advanceAfterBlockEnd(e),this.parseUntilBlocks(n,i,t);var a,c=this.peekToken(),l=[];do{this.skipSymbol(n);var u=this.parseExpression();this.advanceAfterBlockEnd(e);var h=this.parseUntilBlocks(n,i,t);l.push(new o.Case(c.line,c.col,u,h)),c=this.peekToken()}while(c&&c.value===n);switch(c.value){case i:this.advanceAfterBlockEnd(),a=this.parseUntilBlocks(t),this.advanceAfterBlockEnd();break;case t:this.advanceAfterBlockEnd();break;default:this.fail('parseSwitch: expected "case," "default" or "endswitch," got EOF.')}return new o.Switch(r.lineno,r.colno,s,l,a)},c.parseStatement=function(){var e=this.peekToken();if(e.type!==r.TOKEN_SYMBOL&&this.fail("tag name expected",e.lineno,e.colno),this.breakOnBlocks&&-1!==a.indexOf(this.breakOnBlocks,e.value))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 t=0;t0;){var c=s[0],l=s[1],u=s[2];u===e?i+=1:u===t&&(i-=1),0===i?(r+=l,this.tokens.backN(c.length-l.length)):r+=c}return new o.Output(a.lineno,a.colno,[new o.TemplateData(a.lineno,a.colno,r)])},c.parsePostfix=function(e){for(var t,n=this.peekToken();n;){if(n.type===r.TOKEN_LEFT_PAREN)e=new o.FunCall(n.lineno,n.colno,e,this.parseSignature());else if(n.type===r.TOKEN_LEFT_BRACKET)(t=this.parseAggregate()).children.length>1&&this.fail("invalid index"),e=new o.LookupVal(n.lineno,n.colno,e,t.children[0]);else{if(n.type!==r.TOKEN_OPERATOR||"."!==n.value)break;this.nextToken();var i=this.nextToken();i.type!==r.TOKEN_SYMBOL&&this.fail("expected name as lookup value, got "+i.value,i.lineno,i.colno),t=new o.Literal(i.lineno,i.colno,i.value),e=new o.LookupVal(n.lineno,n.colno,e,t)}n=this.peekToken()}return e},c.parseExpression=function(){return this.parseInlineIf()},c.parseInlineIf=function(){var e=this.parseOr();if(this.skipSymbol("if")){var t=this.parseOr(),n=e;(e=new o.InlineIf(e.lineno,e.colno)).body=n,e.cond=t,this.skipSymbol("else")?e.else_=this.parseOr():e.else_=null}return e},c.parseOr=function(){for(var e=this.parseAnd();this.skipSymbol("or");){var t=this.parseAnd();e=new o.Or(e.lineno,e.colno,e,t)}return e},c.parseAnd=function(){for(var e=this.parseNot();this.skipSymbol("and");){var t=this.parseNot();e=new o.And(e.lineno,e.colno,e,t)}return e},c.parseNot=function(){var e=this.peekToken();return this.skipSymbol("not")?new o.Not(e.lineno,e.colno,this.parseNot()):this.parseIn()},c.parseIn=function(){for(var e=this.parseIs();;){var t=this.nextToken();if(!t)break;var n=t.type===r.TOKEN_SYMBOL&&"not"===t.value;if(n||this.pushToken(t),!this.skipSymbol("in")){n&&this.pushToken(t);break}var i=this.parseIs();e=new o.In(e.lineno,e.colno,e,i),n&&(e=new o.Not(e.lineno,e.colno,e))}return e},c.parseIs=function(){var e=this.parseCompare();if(this.skipSymbol("is")){var t=this.skipSymbol("not"),n=this.parseCompare();e=new o.Is(e.lineno,e.colno,e,n),t&&(e=new o.Not(e.lineno,e.colno,e))}return e},c.parseCompare=function(){for(var e=["==","===","!=","!==","<",">","<=",">="],t=this.parseConcat(),n=[];;){var i=this.nextToken();if(!i)break;if(-1===e.indexOf(i.value)){this.pushToken(i);break}n.push(new o.CompareOperand(i.lineno,i.colno,this.parseConcat(),i.value))}return n.length?new o.Compare(n[0].lineno,n[0].colno,t,n):t},c.parseConcat=function(){for(var e=this.parseAdd();this.skipValue(r.TOKEN_TILDE,"~");){var t=this.parseAdd();e=new o.Concat(e.lineno,e.colno,e,t)}return e},c.parseAdd=function(){for(var e=this.parseSub();this.skipValue(r.TOKEN_OPERATOR,"+");){var t=this.parseSub();e=new o.Add(e.lineno,e.colno,e,t)}return e},c.parseSub=function(){for(var e=this.parseMul();this.skipValue(r.TOKEN_OPERATOR,"-");){var t=this.parseMul();e=new o.Sub(e.lineno,e.colno,e,t)}return e},c.parseMul=function(){for(var e=this.parseDiv();this.skipValue(r.TOKEN_OPERATOR,"*");){var t=this.parseDiv();e=new o.Mul(e.lineno,e.colno,e,t)}return e},c.parseDiv=function(){for(var e=this.parseFloorDiv();this.skipValue(r.TOKEN_OPERATOR,"/");){var t=this.parseFloorDiv();e=new o.Div(e.lineno,e.colno,e,t)}return e},c.parseFloorDiv=function(){for(var e=this.parseMod();this.skipValue(r.TOKEN_OPERATOR,"//");){var t=this.parseMod();e=new o.FloorDiv(e.lineno,e.colno,e,t)}return e},c.parseMod=function(){for(var e=this.parsePow();this.skipValue(r.TOKEN_OPERATOR,"%");){var t=this.parsePow();e=new o.Mod(e.lineno,e.colno,e,t)}return e},c.parsePow=function(){for(var e=this.parseUnary();this.skipValue(r.TOKEN_OPERATOR,"**");){var t=this.parseUnary();e=new o.Pow(e.lineno,e.colno,e,t)}return e},c.parseUnary=function(e){var t,n=this.peekToken();return t=this.skipValue(r.TOKEN_OPERATOR,"-")?new o.Neg(n.lineno,n.colno,this.parseUnary(!0)):this.skipValue(r.TOKEN_OPERATOR,"+")?new o.Pos(n.lineno,n.colno,this.parseUnary(!0)):this.parsePrimary(),e||(t=this.parseFilter(t)),t},c.parsePrimary=function(e){var t,n=this.nextToken(),i=null;if(n?n.type===r.TOKEN_STRING?t=n.value:n.type===r.TOKEN_INT?t=parseInt(n.value,10):n.type===r.TOKEN_FLOAT?t=parseFloat(n.value):n.type===r.TOKEN_BOOLEAN?"true"===n.value?t=!0:"false"===n.value?t=!1:this.fail("invalid boolean: "+n.value,n.lineno,n.colno):n.type===r.TOKEN_NONE?t=null:n.type===r.TOKEN_REGEX&&(t=new RegExp(n.value.body,n.value.flags)):this.fail("expected expression, got end of file"),void 0!==t?i=new o.Literal(n.lineno,n.colno,t):n.type===r.TOKEN_SYMBOL?i=new o.Symbol(n.lineno,n.colno,n.value):(this.pushToken(n),i=this.parseAggregate()),e||(i=this.parsePostfix(i)),i)return i;throw this.error("unexpected token: "+n.value,n.lineno,n.colno)},c.parseFilterName=function(){for(var e=this.expect(r.TOKEN_SYMBOL),t=e.value;this.skipValue(r.TOKEN_OPERATOR,".");)t+="."+this.expect(r.TOKEN_SYMBOL).value;return new o.Symbol(e.lineno,e.colno,t)},c.parseFilterArgs=function(e){return this.peekToken().type===r.TOKEN_LEFT_PAREN?this.parsePostfix(e).args.children:[]},c.parseFilter=function(e){for(;this.skip(r.TOKEN_PIPE);){var t=this.parseFilterName();e=new o.Filter(t.lineno,t.colno,t,new o.NodeList(t.lineno,t.colno,[e].concat(this.parseFilterArgs(e))))}return e},c.parseFilterStatement=function(){var e=this.peekToken();this.skipSymbol("filter")||this.fail("parseFilterStatement: expected filter");var t=this.parseFilterName(),n=this.parseFilterArgs(t);this.advanceAfterBlockEnd(e.value);var i=new o.Capture(t.lineno,t.colno,this.parseUntilBlocks("endfilter"));this.advanceAfterBlockEnd();var r=new o.Filter(t.lineno,t.colno,t,new o.NodeList(t.lineno,t.colno,[i].concat(n)));return new o.Output(t.lineno,t.colno,[r])},c.parseAggregate=function(){var e,t=this.nextToken();switch(t.type){case r.TOKEN_LEFT_PAREN:e=new o.Group(t.lineno,t.colno);break;case r.TOKEN_LEFT_BRACKET:e=new o.Array(t.lineno,t.colno);break;case r.TOKEN_LEFT_CURLY:e=new o.Dict(t.lineno,t.colno);break;default:return null}for(;;){var n=this.peekToken().type;if(n===r.TOKEN_RIGHT_PAREN||n===r.TOKEN_RIGHT_BRACKET||n===r.TOKEN_RIGHT_CURLY){this.nextToken();break}if(e.children.length>0&&(this.skip(r.TOKEN_COMMA)||this.fail("parseAggregate: expected comma after expression",t.lineno,t.colno)),e instanceof o.Dict){var i=this.parsePrimary();this.skip(r.TOKEN_COLON)||this.fail("parseAggregate: expected colon after dict key",t.lineno,t.colno);var s=this.parseExpression();e.addChild(new o.Pair(i.lineno,i.colno,i,s))}else{var a=this.parseExpression();e.addChild(a)}}return e},c.parseSignature=function(e,t){var n=this.peekToken();if(!t&&n.type!==r.TOKEN_LEFT_PAREN){if(e)return null;this.fail("expected arguments",n.lineno,n.colno)}n.type===r.TOKEN_LEFT_PAREN&&(n=this.nextToken());for(var i=new o.NodeList(n.lineno,n.colno),s=new o.KeywordArgs(n.lineno,n.colno),a=!1;;){if(n=this.peekToken(),!t&&n.type===r.TOKEN_RIGHT_PAREN){this.nextToken();break}if(t&&n.type===r.TOKEN_BLOCK_END)break;if(a&&!this.skip(r.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",n.lineno,n.colno);else{var c=this.parseExpression();this.skipValue(r.TOKEN_OPERATOR,"=")?s.addChild(new o.Pair(c.lineno,c.colno,c,this.parseExpression())):i.addChild(c)}a=!0}return s.children.length&&i.addChild(s),i},c.parseUntilBlocks=function(){for(var e=this.breakOnBlocks,t=arguments.length,n=new Array(t),i=0;i=","//","**"],R=M+this.current();switch(-1!==i.indexOf(P,R)&&(this.forward(),M=R,-1!==i.indexOf(P,R+this.current())&&(M=R+this.current(),this.forward())),M){case"(":j=f;break;case")":j=m;break;case"[":j=v;break;case"]":j=y;break;case"{":j=g;break;case"}":j=_;break;case",":j=C;break;case":":j=k;break;case"~":j=w;break;case"|":j=L;break;default:j=b}return S(j,M,t,n)}if((e=this._extractUntil(r+o)).match(/^[-+]?[0-9]+$/)){if("."===this.current()){this.forward();var F=this._extract("0123456789");return S(x,e+"."+F,t,n)}return S("int",e,t,n)}if(e.match(/^(true|false)$/))return S(A,e,t,n);if("none"===e)return S(E,e,t,n);if("null"===e)return S(E,e,t,n);if(e)return S(O,e,t,n);throw new Error("Unexpected value while parsing: "+e)}var D,B=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((e=this._extractString(this.tags.BLOCK_START+"-"))||(e=this._extractString(this.tags.BLOCK_START)))return this.in_code=!0,S(l,e,t,n);if((e=this._extractString(this.tags.VARIABLE_START+"-"))||(e=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,S(h,e,t,n);e="";var K=!1;for(this._matches(this.tags.COMMENT_START)&&(K=!0,e=this._extractString(this.tags.COMMENT_START));null!==(D=this._extractUntil(B));){if(e+=D,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!K){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=e.length){var U=e.slice(-this.colno);if(/^\s+$/.test(U)&&!(e=e.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!K)throw new Error("unexpected end of comment");e+=this._extractString(this.tags.COMMENT_END);break}e+=this.current(),this.forward()}if(null===D&&K)throw new Error("expected end of comment, got end of file");return S(K?d:c,e,t,n)},t._parseString=function(e){this.forward();for(var t="";!this.isFinished()&&this.current()!==e;){var n=this.current();if("\\"===n){switch(this.forward(),this.current()){case"n":t+="\n";break;case"t":t+="\t";break;case"r":t+="\r";break;default:t+=this.current()}this.forward()}else t+=n,this.forward()}return this.forward(),t},t._matches=function(e){return this.index+e.length>this.len?null:this.str.slice(this.index,this.index+e.length)===e},t._extractString=function(e){return this._matches(e)?(this.forwardN(e.length),e):null},t._extractUntil=function(e){return this._extractMatching(!0,e||"")},t._extract=function(e){return this._extractMatching(!1,e)},t._extractMatching=function(e,t){if(this.isFinished())return null;var n=t.indexOf(this.current());if(e&&-1===n||!e&&-1!==n){var i=this.current();this.forward();for(var r=t.indexOf(this.current());(e&&-1===r||!e&&-1!==r)&&!this.isFinished();)i+=this.current(),this.forward(),r=t.indexOf(this.current());return i}return""},t._extractRegex=function(e){var t=this.currentStr().match(e);return t?(this.forwardN(t[0].length),t):null},t.isFinished=function(){return this.index>=this.len},t.forwardN=function(e){for(var t=0;t1024){for(var t=0,n=r.length-o;t0&&s.length>r&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,a=c,console&&console.warn&&console.warn(a)}return e}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=p.bind(i);return r.listener=n,i.wrapFn=r,r}function f(e,t,n){var i=e._events;if(void 0===i)return[];var r=i[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=r[e];if(void 0===c)return!1;if("function"==typeof c)o(c,this,t);else{var l=c.length,u=v(c,l);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,r=o;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1=0;i--)this.removeListener(e,t[i]);return this},a.prototype.listeners=function(e){return f(this,e,!0)},a.prototype.rawListeners=function(e){return f(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},function(e,t,n){"use strict";var i=n(3),r=n(0),o=0;function s(){return"hole_"+o++}function a(e,t){for(var n=null,i=0;i=t)return e;var n=t-e.length,s=i.repeat(" ",n/2-n%2),a=i.repeat(" ",n/2);return r.copySafeness(e,s+e+a)},t.default=function(e,t,n){return n?e||t:void 0!==e?e:t},t.dictsort=function(e,t,n){if(!i.isObject(e))throw new i.TemplateError("dictsort filter: val must be an object");var r,o=[];for(var s in e)o.push([s,e[s]]);if(void 0===n||"key"===n)r=0;else{if("value"!==n)throw new i.TemplateError("dictsort filter: You can only sort by either key or value");r=1}return o.sort((function(e,n){var o=e[r],s=n[r];return t||(i.isString(o)&&(o=o.toUpperCase()),i.isString(s)&&(s=s.toUpperCase())),o>s?1:o===s?0:-1})),o},t.dump=function(e,t){return JSON.stringify(e,null,t)},t.escape=function(e){return e instanceof r.SafeString?e:(e=null==e?"":e,r.markSafe(i.escape(e.toString())))},t.safe=function(e){return e instanceof r.SafeString?e:(e=null==e?"":e,r.markSafe(e.toString()))},t.first=function(e){return e[0]},t.forceescape=function(e){return e=null==e?"":e,r.markSafe(i.escape(e.toString()))},t.groupby=function(e,t){return i.groupBy(e,t,this.env.opts.throwOnUndefined)},t.indent=function(e,t,n){if(""===(e=o(e,"")))return"";t=t||4;var s=e.split("\n"),a=i.repeat(" ",t),c=s.map((function(e,t){return 0!==t||n?""+a+e:e})).join("\n");return r.copySafeness(e,c)},t.join=function(e,t,n){return t=t||"",n&&(e=i.map(e,(function(e){return e[n]}))),e.join(t)},t.last=function(e){return e[e.length-1]},t.length=function(e){var t=o(e,"");return void 0!==t?"function"==typeof Map&&t instanceof Map||"function"==typeof Set&&t instanceof Set?t.size:!i.isObject(t)||t instanceof r.SafeString?t.length:i.keys(t).length:0},t.list=c,t.lower=function(e){return(e=o(e,"")).toLowerCase()},t.nl2br=function(e){return null==e?"":r.copySafeness(e,e.replace(/\r\n|\n/g,"
\n"))},t.random=function(e){return e[Math.floor(Math.random()*e.length)]},t.reject=l(!1),t.rejectattr=function(e,t){return e.filter((function(e){return!e[t]}))},t.select=l(!0),t.selectattr=function(e,t){return e.filter((function(e){return!!e[t]}))},t.replace=function(e,t,n,i){var o=e;if(t instanceof RegExp)return e.replace(t,n);void 0===i&&(i=-1);var s="";if("number"==typeof t)t=""+t;else if("string"!=typeof t)return e;if("number"==typeof e&&(e=""+e),"string"!=typeof e&&!(e instanceof r.SafeString))return e;if(""===t)return s=n+e.split("").join(n)+n,r.copySafeness(e,s);var a=e.indexOf(t);if(0===i||-1===a)return e;for(var c=0,l=0;a>-1&&(-1===i||l=r&&u.push(n),o.push(u)}return o},t.sum=function(e,t,n){return void 0===n&&(n=0),t&&(e=i.map(e,(function(e){return e[t]}))),n+e.reduce((function(e,t){return e+t}),0)},t.sort=r.makeMacro(["value","reverse","case_sensitive","attribute"],[],(function(e,t,n,r){var o=this,s=i.map(e,(function(e){return e})),a=i.getAttrGetter(r);return s.sort((function(e,s){var c=r?a(e):e,l=r?a(s):s;if(o.env.opts.throwOnUndefined&&r&&(void 0===c||void 0===l))throw new TypeError('sort: attribute "'+r+'" resolved to undefined');return!n&&i.isString(c)&&i.isString(l)&&(c=c.toLowerCase(),l=l.toLowerCase()),cl?t?-1:1:0})),s})),t.string=function(e){return r.copySafeness(e,e)},t.striptags=function(e,t){var n,i=u((e=o(e,"")).replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>|/gi,""));return n=t?i.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,"\n").replace(/\n\n\n+/g,"\n\n"):i.replace(/\s+/gi," "),r.copySafeness(e,n)},t.title=function(e){var t=(e=o(e,"")).split(" ").map((function(e){return a(e)}));return r.copySafeness(e,t.join(" "))},t.trim=u,t.truncate=function(e,t,n,i){var s=e;if(t=t||255,(e=o(e,"")).length<=t)return e;if(n)e=e.substring(0,t);else{var a=e.lastIndexOf(" ",t);-1===a&&(a=t),e=e.substring(0,a)}return e+=null!=i?i:"...",r.copySafeness(s,e)},t.upper=function(e){return(e=o(e,"")).toUpperCase()},t.urlencode=function(e){var t=encodeURIComponent;return i.isString(e)?t(e):(i.isArray(e)?e:i._entries(e)).map((function(e){var n=e[0],i=e[1];return t(n)+"="+t(i)})).join("&")};var h=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,p=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,d=/^https?:\/\/.*$/,f=/^www\./,m=/\.(?:org|net|com)(?:\:|\/|$)/;t.urlize=function(e,t,n){s(t)&&(t=1/0);var i=!0===n?' rel="nofollow"':"";return e.split(/(\s+)/).filter((function(e){return e&&e.length})).map((function(e){var n=e.match(h),r=n?n[1]:e,o=r.substr(0,t);return d.test(r)?'"+o+"":f.test(r)?'"+o+"":p.test(r)?''+r+"":m.test(r)?'"+o+"":e})).join("")},t.wordcount=function(e){var t=(e=o(e,""))?e.match(/\w+/g):null;return t?t.length:null},t.float=function(e,t){var n=parseFloat(e);return s(n)?t:n};var v=r.makeMacro(["value","default","base"],[],(function(e,t,n){void 0===n&&(n=10);var i=parseInt(e,n);return s(i)?t:i}));t.int=v,t.d=t.default,t.e=t.escape},function(e,t,n){"use strict";function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}var r=function(e){var t,n;function r(t){var n;return(n=e.call(this)||this).precompiled=t||{},n}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,i(t,n),r.prototype.getSource=function(e){return this.precompiled[e]?{src:{type:"code",obj:this.precompiled[e]},path:e}:null},r}(n(6));e.exports={PrecompiledLoader:r}},function(e,t,n){"use strict";var i=n(2).SafeString;t.callable=function(e){return"function"==typeof e},t.defined=function(e){return void 0!==e},t.divisibleby=function(e,t){return e%t==0},t.escaped=function(e){return e instanceof i},t.equalto=function(e,t){return e===t},t.eq=t.equalto,t.sameas=t.equalto,t.even=function(e){return e%2==0},t.falsy=function(e){return!e},t.ge=function(e,t){return e>=t},t.greaterthan=function(e,t){return e>t},t.gt=t.greaterthan,t.le=function(e,t){return e<=t},t.lessthan=function(e,t){return e0)for(var r=e;rt;o+=n)i.push(o);return i},cycler:function(){return e=Array.prototype.slice.call(arguments),t=-1,{current:null,reset:function(){t=-1,this.current=null},next:function(){return++t>=e.length&&(t=0),this.current=e[t],this.current}};var e,t},joiner:function(e){return function(e){e=e||",";var t=!0;return function(){var n=t?"":e;return t=!1,n}}(e)}}}},function(e,t,n){var i=n(4);e.exports=function(e,t){function n(e,t){if(this.name=e,this.path=e,this.defaultEngine=t.defaultEngine,this.ext=i.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 n.prototype.render=function(t,n){e.render(this.name,t,n)},t.set("view",n),t.set("nunjucksEnv",e),e}},function(e,t,n){"use strict";var i=n(4),r=n(4),o=n(0)._prettifyError,s=n(5),a=n(7).Environment,c=n(24);function l(e,t){return!!Array.isArray(t)&&t.some((function(t){return e.match(t)}))}function u(e,t){(t=t||{}).isString=!0;var n=t.env||new a([]),i=t.wrapper||c;if(!t.name)throw new Error('the "name" option is required when compiling a string');return i([h(e,t.name,n)],t)}function h(e,t,n){var i,r=(n=n||new a([])).asyncFilters,c=n.extensionsList;t=t.replace(/\\/g,"/");try{i=s.compile(e,r,c,t,n.opts)}catch(e){throw o(t,!1,e)}return{name:t,template:i}}e.exports={precompile:function(e,t){var n=(t=t||{}).env||new a([]),o=t.wrapper||c;if(t.isString)return u(e,t);var s=i.existsSync(e)&&i.statSync(e),p=[],d=[];if(s.isFile())p.push(h(i.readFileSync(e,"utf-8"),t.name||e,n));else if(s.isDirectory()){!function n(o){i.readdirSync(o).forEach((function(s){var a=r.join(o,s),c=a.substr(r.join(e,"/").length),u=i.statSync(a);u&&u.isDirectory()?l(c+="/",t.exclude)||n(a):l(c,t.include)&&d.push(a)}))}(e);for(var f=0;fe.length||r>0&&s>=i||r<0&&s<=i);s+=r)o.push(n.memberLookup(e,s));return o}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var f={pop:function(e){if(void 0===e)return this.pop();if(e>=this.length||e<0)throw new Error("KeyError");return this.splice(e,1)},append:function(e){return this.push(e)},remove:function(e){for(var t=0;t=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},r=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const o=n(4147),s=n(1814),a=n(5595),c=n(8921),l=n(6197),u=n(839),h=n(3320),p=n(7554);n(5984),n(5389),n(4448),n(8786),n(3857),n(5116),console.info(`%c ANDROID-TV-CARD v${o.version}`,"color: white; font-weight: bold; background: green");class d extends s.LitElement{constructor(){super(...arguments),this.defaultActions={},this.customActions={},this.icons={}}static get properties(){return{hass:{},config:{}}}static getStubConfig(){return{type:"custom:android-tv-card",rows:[]}}getCardSize(){let e=this.config.rows.length;return"title"in this.config&&(e+=1),e}setConfig(e){return r(this,void 0,void 0,(function*(){if(!e)throw new Error("Invalid configuration");e=structuredClone(e),e=Object.assign({theme:"default"},e),e=this.setToggles(e),e=this.updateDeprecatedKeys(e),this.defaultActions=Object.assign(Object.assign({},p.defaultSources),p.defaultKeys),this.customActions=e.custom_actions||{},this.icons=Object.assign(Object.assign({},p.svg),e.custom_icons),this.config=e}))}updateDeprecatedKeys(e){var t;if("adb_id"in e&&!("keyboard_id"in e)&&(e.keyboard_id=e.adb_id),"media_player_id"in e&&!("slider_id"in e)&&(e.slider_id=e.media_player_id),"touchpad_height"in e&&("touchpad_style"in e||(e.touchpad_style={}),"height"in e.touchpad_style||(e.touchpad_style.height=e.touchpad_height)),!("rows"in e)||!(e.rows||[]).length){const t=[],n=Object.keys(e).filter((e=>e.includes("_row")));for(const i of n){let n=e[i];"string"==typeof n&&(n=[n]),"volume_row"==i?n=["volume_"+n[0]]:"navigation_row"==i&&(n=["navigation_"+n[0]]),t.push(n)}e.rows=t}e.custom_actions=Object.assign(Object.assign(Object.assign({},e.custom_actions),e.custom_keys),e.custom_sources);const n=e.custom_actions;for(const e in n){const i=n[e];"svg_path"in i&&(i.icon=i.svg_path);const r=["key","source","service","service_data","data","target","navigation_path","navigation_replace","url_path","confirmation","pipeline_id","start_listening"],o=null!==(t=i.tap_action)&&void 0!==t?t:{};let s=!1;for(const e of r)e in i&&(s=!0,o[e]=i[e]);s&&(i.tap_action=o);const a=["tap_action","hold_action","double_tap_action"];for(const e of a)if(e in i){const t=i[e];["call-service","more-info"].includes(t.action)&&(t.data=Object.assign(Object.assign(Object.assign({},t.data),t.service_data),t.target)),"action"in t||(t.action="key"in t?"key":"source"in t?"source":"service"in t?"call-service":"navigation_path"in t?"navigate":"url_path"in t?"url":"pipeline_id"in t||"start_listening"in t?"assist":"none")}}return console.log(e),e}setToggles(e){const t={enable_button_feedback:!0,enable_touchpad_feedback:!0,enable_double_click:!1,enable_slider_feedback:!0};let n;for(n in t)n in e||(e[n]=t[n]);return e}getActions(e){var t;const n=this.defaultActions[e]||{},i=this.customActions[e]||n;if(!Object.keys(i).length)return"slider"==e?{tap_action:{action:"call-service",service:"media_player.volume_set",data:{entity_id:this.config.slider_id,volume_level:"VALUE"}}}:{};(null==i?void 0:i.icon)||(i.icon=null!==(t=null==n?void 0:n.icon)&&void 0!==t?t:void 0);const r=["tap_action","hold_action","double_tap_action"];for(const e of r)!(e in i)&&e in n&&(i[e]=n[e]);return i}buildRow(e){return s.html`
${e}
`}buildColumn(e){return s.html`
${e}
`}buildButton(e){const t=this.getActions(e),n=Object.assign(Object.assign({},this.config.button_style),t.style);return Object.keys(t).length?s.html`{var e={9263:(e,t,n)=>{"use strict";n.r(t),n.d(t,{RippleHandlers:()=>i});class i{constructor(e){this.startPress=t=>{e().then((e=>{e&&e.startPress(t)}))},this.endPress=()=>{e().then((e=>{e&&e.endPress()}))},this.startFocus=()=>{e().then((e=>{e&&e.startFocus()}))},this.endFocus=()=>{e().then((e=>{e&&e.endFocus()}))},this.startHover=()=>{e().then((e=>{e&&e.startHover()}))},this.endHover=()=>{e().then((e=>{e&&e.endHover()}))}}}},6197:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DEFAULT_DOMAIN_ICON:()=>X,DEFAULT_PANEL:()=>J,DEFAULT_VIEW_ENTITY_ID:()=>ae,DOMAINS_HIDE_MORE_INFO:()=>te,DOMAINS_MORE_INFO_NO_HISTORY:()=>ne,DOMAINS_TOGGLE:()=>re,DOMAINS_WITH_CARD:()=>Q,DOMAINS_WITH_MORE_INFO:()=>ee,NumberFormat:()=>i,STATES_OFF:()=>ie,TimeFormat:()=>r,UNIT_C:()=>oe,UNIT_F:()=>se,applyThemesOnElement:()=>F,computeCardSize:()=>D,computeDomain:()=>B,computeEntity:()=>K,computeRTL:()=>U,computeRTLDirection:()=>H,computeStateDisplay:()=>G,computeStateDomain:()=>V,createThing:()=>he,debounce:()=>pe,domainIcon:()=>fe,evaluateFilter:()=>me,fireEvent:()=>ce,fixedIcons:()=>de,formatDate:()=>u,formatDateMonth:()=>g,formatDateMonthYear:()=>v,formatDateNumeric:()=>p,formatDateShort:()=>f,formatDateTime:()=>w,formatDateTimeNumeric:()=>E,formatDateTimeWithSeconds:()=>x,formatDateWeekday:()=>c,formatDateYear:()=>b,formatNumber:()=>W,formatTime:()=>T,formatTimeWeekday:()=>I,formatTimeWithSeconds:()=>M,forwardHaptic:()=>ve,getLovelace:()=>Ee,handleAction:()=>Ce,handleActionConfig:()=>be,handleClick:()=>ke,hasAction:()=>we,hasConfigOrEntityChanged:()=>Le,hasDoubleClick:()=>xe,isNumericState:()=>Z,navigate:()=>ye,numberFormatToLocale:()=>z,relativeTime:()=>j,round:()=>Y,stateIcon:()=>Se,timerTimeRemaining:()=>P,toggleEntity:()=>_e,turnOnOffEntities:()=>Ae,turnOnOffEntity:()=>ge});var i,r,o,s=function(){return s=Object.assign||function(e){for(var t,n=1,i=arguments.length;n0)return{value:Math.round(p),unit:"year"};var d=12*p+u.getMonth()-h.getMonth();if(Math.round(Math.abs(d))>0)return{value:Math.round(d),unit:"month"};var f=r/604800;return{value:Math.round(f),unit:"week"}}(e,n);return i?function(e){return new Intl.RelativeTimeFormat(e.language,{numeric:"auto"})}(t).format(r.value,r.unit):Intl.NumberFormat(t.language,{style:"unit",unit:r.unit,unitDisplay:"long"}).format(Math.abs(r.value))};function P(e){var t,n=3600*(t=e.attributes.remaining.split(":").map(Number))[0]+60*t[1]+t[2];if("active"===e.state){var i=(new Date).getTime(),r=new Date(e.last_changed).getTime();n=Math.max(n-(i-r)/1e3,0)}return n}function R(){return(R=Object.assign||function(e){for(var t=1;t-1?e.split(".")[1].length:0;n.minimumFractionDigits=i,n.maximumFractionDigits=i}return n},G=function(e,t,n,i){var r=void 0!==i?i:t.state;if("unknown"===r||"unavailable"===r)return e("state.default."+r);if(Z(t)){if("monetary"===t.attributes.device_class)try{return W(r,n,{style:"currency",currency:t.attributes.unit_of_measurement})}catch(e){}return W(r,n)+(t.attributes.unit_of_measurement?" "+t.attributes.unit_of_measurement:"")}var o=V(t);if("input_datetime"===o){var s;if(void 0===i)return t.attributes.has_date&&t.attributes.has_time?(s=new Date(t.attributes.year,t.attributes.month-1,t.attributes.day,t.attributes.hour,t.attributes.minute),w(s,n)):t.attributes.has_date?(s=new Date(t.attributes.year,t.attributes.month-1,t.attributes.day),u(s,n)):t.attributes.has_time?((s=new Date).setHours(t.attributes.hour,t.attributes.minute),T(s,n)):t.state;try{var a=i.split(" ");if(2===a.length)return w(new Date(a.join("T")),n);if(1===a.length){if(i.includes("-"))return u(new Date(i+"T00:00"),n);if(i.includes(":")){var c=new Date;return T(new Date(c.toISOString().split("T")[0]+"T"+i),n)}}return i}catch(e){return i}}return"humidifier"===o&&"on"===r&&t.attributes.humidity?t.attributes.humidity+" %":"counter"===o||"number"===o||"input_number"===o?W(r,n):t.attributes.device_class&&e("component."+o+".state."+t.attributes.device_class+"."+r)||e("component."+o+".state._."+r)||r},X="mdi:bookmark",J="lovelace",Q=["climate","cover","configurator","input_select","input_number","input_text","lock","media_player","scene","script","timer","vacuum","water_heater","weblink"],ee=["alarm_control_panel","automation","camera","climate","configurator","cover","fan","group","history_graph","input_datetime","light","lock","media_player","script","sun","updater","vacuum","water_heater","weather"],te=["input_number","input_select","input_text","scene","weblink"],ne=["camera","configurator","history_graph","scene"],ie=["closed","locked","off"],re=new Set(["fan","input_boolean","light","switch","group","automation"]),oe="°C",se="°F",ae="group.default_view",ce=function(e,t,n,i){i=i||{},n=null==n?{}:n;var r=new Event(t,{bubbles:void 0===i.bubbles||i.bubbles,cancelable:Boolean(i.cancelable),composed:void 0===i.composed||i.composed});return r.detail=n,e.dispatchEvent(r),r},le=new Set(["call-service","divider","section","weblink","cast","select"]),ue={alert:"toggle",automation:"toggle",climate:"climate",cover:"cover",fan:"toggle",group:"group",input_boolean:"toggle",input_number:"input-number",input_select:"input-select",input_text:"input-text",light:"toggle",lock:"lock",media_player:"media-player",remote:"toggle",scene:"scene",script:"script",sensor:"sensor",timer:"timer",switch:"toggle",vacuum:"toggle",water_heater:"climate",input_datetime:"input-datetime"},he=function(e,t){void 0===t&&(t=!1);var n=function(e,t){return i("hui-error-card",{type:"error",error:e,config:t})},i=function(e,t){var i=window.document.createElement(e);try{if(!i.setConfig)return;i.setConfig(t)}catch(i){return console.error(e,i),n(i.message,t)}return i};if(!e||"object"!=typeof e||!t&&!e.type)return n("No type defined",e);var r=e.type;if(r&&r.startsWith("custom:"))r=r.substr(7);else if(t)if(le.has(r))r="hui-"+r+"-row";else{if(!e.entity)return n("Invalid config given.",e);var o=e.entity.split(".",1)[0];r="hui-"+(ue[o]||"text")+"-entity-row"}else r="hui-"+r+"-card";if(customElements.get(r))return i(r,e);var s=n("Custom element doesn't exist: "+e.type+".",e);s.style.display="None";var a=setTimeout((function(){s.style.display=""}),2e3);return customElements.whenDefined(e.type).then((function(){clearTimeout(a),ce(s,"ll-rebuild",{},s)})),s},pe=function(e,t,n){var i;return void 0===n&&(n=!1),function(){var r=[].slice.call(arguments),o=this,s=n&&!i;clearTimeout(i),i=setTimeout((function(){i=null,n||e.apply(o,r)}),t),s&&e.apply(o,r)}},de={alert:"mdi:alert",automation:"mdi:playlist-play",calendar:"mdi:calendar",camera:"mdi:video",climate:"mdi:thermostat",configurator:"mdi:settings",conversation:"mdi:text-to-speech",device_tracker:"mdi:account",fan:"mdi:fan",group:"mdi:google-circles-communities",history_graph:"mdi:chart-line",homeassistant:"mdi:home-assistant",homekit:"mdi:home-automation",image_processing:"mdi:image-filter-frames",input_boolean:"mdi:drawing",input_datetime:"mdi:calendar-clock",input_number:"mdi:ray-vertex",input_select:"mdi:format-list-bulleted",input_text:"mdi:textbox",light:"mdi:lightbulb",mailbox:"mdi:mailbox",notify:"mdi:comment-alert",person:"mdi:account",plant:"mdi:flower",proximity:"mdi:apple-safari",remote:"mdi:remote",scene:"mdi:google-pages",script:"mdi:file-document",sensor:"mdi:eye",simple_alarm:"mdi:bell",sun:"mdi:white-balance-sunny",switch:"mdi:flash",timer:"mdi:timer",updater:"mdi:cloud-upload",vacuum:"mdi:robot-vacuum",water_heater:"mdi:thermometer",weblink:"mdi:open-in-new"};function fe(e,t){if(e in de)return de[e];switch(e){case"alarm_control_panel":switch(t){case"armed_home":return"mdi:bell-plus";case"armed_night":return"mdi:bell-sleep";case"disarmed":return"mdi:bell-outline";case"triggered":return"mdi:bell-ring";default:return"mdi:bell"}case"binary_sensor":return t&&"off"===t?"mdi:radiobox-blank":"mdi:checkbox-marked-circle";case"cover":return"closed"===t?"mdi:window-closed":"mdi:window-open";case"lock":return t&&"unlocked"===t?"mdi:lock-open":"mdi:lock";case"media_player":return t&&"off"!==t&&"idle"!==t?"mdi:cast-connected":"mdi:cast";case"zwave":switch(t){case"dead":return"mdi:emoticon-dead";case"sleeping":return"mdi:sleep";case"initializing":return"mdi:timer-sand";default:return"mdi:z-wave"}default:return console.warn("Unable to find icon for domain "+e+" ("+t+")"),"mdi:bookmark"}}var me=function(e,t){var n=t.value||t,i=t.attribute?e.attributes[t.attribute]:e.state;switch(t.operator||"=="){case"==":return i===n;case"<=":return i<=n;case"<":return i=":return i>=n;case">":return i>n;case"!=":return i!==n;case"regex":return i.match(n);default:return!1}},ve=function(e){ce(window,"haptic",e)},ye=function(e,t,n){void 0===n&&(n=!1),n?history.replaceState(null,"",t):history.pushState(null,"",t),ce(window,"location-changed",{replace:n})},ge=function(e,t,n){void 0===n&&(n=!0);var i,r=B(t),o="group"===r?"homeassistant":r;switch(r){case"lock":i=n?"unlock":"lock";break;case"cover":i=n?"open_cover":"close_cover";break;default:i=n?"turn_on":"turn_off"}return e.callService(o,i,{entity_id:t})},_e=function(e,t){var n=ie.includes(e.states[t].state);return ge(e,t,n)},be=function(e,t,n,i){if(i||(i={action:"more-info"}),!i.confirmation||i.confirmation.exemptions&&i.confirmation.exemptions.some((function(e){return e.user===t.user.id}))||(ve("warning"),confirm(i.confirmation.text||"Are you sure you want to "+i.action+"?")))switch(i.action){case"more-info":(n.entity||n.camera_image)&&ce(e,"hass-more-info",{entityId:n.entity?n.entity:n.camera_image});break;case"navigate":i.navigation_path&&ye(0,i.navigation_path);break;case"url":i.url_path&&window.open(i.url_path);break;case"toggle":n.entity&&(_e(t,n.entity),ve("success"));break;case"call-service":if(!i.service)return void ve("failure");var r=i.service.split(".",2);t.callService(r[0],r[1],i.service_data,i.target),ve("success");break;case"fire-dom-event":ce(e,"ll-custom",i)}},Ce=function(e,t,n,i){var r;"double_tap"===i&&n.double_tap_action?r=n.double_tap_action:"hold"===i&&n.hold_action?r=n.hold_action:"tap"===i&&n.tap_action&&(r=n.tap_action),be(e,t,n,r)},ke=function(e,t,n,i,r){var o;if(r&&n.double_tap_action?o=n.double_tap_action:i&&n.hold_action?o=n.hold_action:!i&&n.tap_action&&(o=n.tap_action),o||(o={action:"more-info"}),!o.confirmation||o.confirmation.exemptions&&o.confirmation.exemptions.some((function(e){return e.user===t.user.id}))||confirm(o.confirmation.text||"Are you sure you want to "+o.action+"?"))switch(o.action){case"more-info":(o.entity||n.entity||n.camera_image)&&(ce(e,"hass-more-info",{entityId:o.entity?o.entity:n.entity?n.entity:n.camera_image}),o.haptic&&ve(o.haptic));break;case"navigate":o.navigation_path&&(ye(0,o.navigation_path),o.haptic&&ve(o.haptic));break;case"url":o.url_path&&window.open(o.url_path),o.haptic&&ve(o.haptic);break;case"toggle":n.entity&&(_e(t,n.entity),o.haptic&&ve(o.haptic));break;case"call-service":if(!o.service)return;var s=o.service.split(".",2),a=s[0],c=s[1],l=R({},o.service_data);"entity"===l.entity_id&&(l.entity_id=n.entity),t.callService(a,c,l,o.target),o.haptic&&ve(o.haptic);break;case"fire-dom-event":ce(e,"ll-custom",o),o.haptic&&ve(o.haptic)}};function we(e){return void 0!==e&&"none"!==e.action}function Le(e,t,n){if(t.has("config")||n)return!0;if(e.config.entity){var i=t.get("hass");return!i||i.states[e.config.entity]!==e.hass.states[e.config.entity]}return!1}function xe(e){return void 0!==e&&"none"!==e.action}var Ae=function(e,t,n){void 0===n&&(n=!0);var i={};t.forEach((function(t){if(ie.includes(e.states[t].state)===n){var r=B(t),o=["cover","lock"].includes(r)?r:"homeassistant";o in i||(i[o]=[]),i[o].push(t)}})),Object.keys(i).forEach((function(t){var r;switch(t){case"lock":r=n?"unlock":"lock";break;case"cover":r=n?"open_cover":"close_cover";break;default:r=n?"turn_on":"turn_off"}e.callService(t,r,{entity_id:i[t]})}))},Ee=function(){var e=document.querySelector("home-assistant");if(e=(e=(e=(e=(e=(e=(e=(e=e&&e.shadowRoot)&&e.querySelector("home-assistant-main"))&&e.shadowRoot)&&e.querySelector("app-drawer-layout partial-panel-resolver"))&&e.shadowRoot||e)&&e.querySelector("ha-panel-lovelace"))&&e.shadowRoot)&&e.querySelector("hui-root")){var t=e.lovelace;return t.current_view=e.___curView,t}return null},Oe={humidity:"mdi:water-percent",illuminance:"mdi:brightness-5",temperature:"mdi:thermometer",pressure:"mdi:gauge",power:"mdi:flash",signal_strength:"mdi:wifi"},Te={binary_sensor:function(e,t){var n="off"===e;switch(null==t?void 0:t.attributes.device_class){case"battery":return n?"mdi:battery":"mdi:battery-outline";case"battery_charging":return n?"mdi:battery":"mdi:battery-charging";case"cold":return n?"mdi:thermometer":"mdi:snowflake";case"connectivity":return n?"mdi:server-network-off":"mdi:server-network";case"door":return n?"mdi:door-closed":"mdi:door-open";case"garage_door":return n?"mdi:garage":"mdi:garage-open";case"power":case"plug":return n?"mdi:power-plug-off":"mdi:power-plug";case"gas":case"problem":case"safety":case"tamper":return n?"mdi:check-circle":"mdi:alert-circle";case"smoke":return n?"mdi:check-circle":"mdi:smoke";case"heat":return n?"mdi:thermometer":"mdi:fire";case"light":return n?"mdi:brightness-5":"mdi:brightness-7";case"lock":return n?"mdi:lock":"mdi:lock-open";case"moisture":return n?"mdi:water-off":"mdi:water";case"motion":return n?"mdi:walk":"mdi:run";case"occupancy":case"presence":return n?"mdi:home-outline":"mdi:home";case"opening":return n?"mdi:square":"mdi:square-outline";case"running":return n?"mdi:stop":"mdi:play";case"sound":return n?"mdi:music-note-off":"mdi:music-note";case"update":return n?"mdi:package":"mdi:package-up";case"vibration":return n?"mdi:crop-portrait":"mdi:vibrate";case"window":return n?"mdi:window-closed":"mdi:window-open";default:return n?"mdi:radiobox-blank":"mdi:checkbox-marked-circle"}},cover:function(e){var t="closed"!==e.state;switch(e.attributes.device_class){case"garage":return t?"mdi:garage-open":"mdi:garage";case"door":return t?"mdi:door-open":"mdi:door-closed";case"shutter":return t?"mdi:window-shutter-open":"mdi:window-shutter";case"blind":return t?"mdi:blinds-open":"mdi:blinds";case"window":return t?"mdi:window-open":"mdi:window-closed";default:return fe("cover",e.state)}},sensor:function(e){var t=e.attributes.device_class;if(t&&t in Oe)return Oe[t];if("battery"===t){var n=Number(e.state);if(isNaN(n))return"mdi:battery-unknown";var i=10*Math.round(n/10);return i>=100?"mdi:battery":i<=0?"mdi:battery-alert":"hass:battery-"+i}var r=e.attributes.unit_of_measurement;return"°C"===r||"°F"===r?"mdi:thermometer":fe("sensor")},input_datetime:function(e){return e.attributes.has_date?e.attributes.has_time?fe("input_datetime"):"mdi:calendar":"mdi:clock"}},Se=function(e){if(!e)return"mdi:bookmark";if(e.attributes.icon)return e.attributes.icon;var t=B(e.entity_id);return t in Te?Te[t](e):fe(t,e.state)}},6133:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CONTEXT=void 0;const i=n(6710),r=n(1384),o=n(5031);t.CONTEXT=e=>({True:!0,False:!1,None:null,hass:e,states:t=>(0,i.states)(e,t),is_state:(t,n)=>(0,i.is_state)(e,t,n),state_attr:(t,n)=>(0,i.state_attr)(e,t,n),is_state_attr:(t,n,r)=>(0,i.is_state_attr)(e,t,n,r),has_value:t=>(0,i.has_value)(e,t),iif:(t,n,i,o)=>(0,r.iif)(e,t,n,i,o),match_media:e=>(0,o.match_media)(e)})},839:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(8257),t)},8257:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.renderTemplate=void 0;const i=n(2985),r=n(6133);t.renderTemplate=function(e,t,n){if("string"==typeof t&&(t.includes("{{")&&t.includes("}}")||t.includes("{%")&&t.includes("%}"))){if(t=(0,i.renderString)(structuredClone(t),Object.assign(Object.assign({},(0,r.CONTEXT)(e)),n)).trim(),[void 0,null,"undefined","null","None"].includes(t))return"";if(/^-?(\d+|\d+\.\d+)$/.test(t))return Number(t);if("true"==t)return!0;if("false"==t)return!1}return t}},5031:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.match_media=void 0,t.match_media=function(e){return window.matchMedia(e).matches}},1384:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iif=void 0;const i=n(839);t.iif=function(e,t,n,r,o){if(o){const n=(0,i.renderTemplate)(e,t);if([void 0,null,"undefined","null","None"].includes(n))return o}const s=`\n\t\t{% if ${t} %}\n\t\t${null==n||n}\n\t\t{% else %}\n\t\t${null!=r&&r}\n\t\t{% endif %}\n\t`;return(0,i.renderTemplate)(e,s)}},6710:(e,t)=>{"use strict";function n(e,t){try{return e.states[t].state}catch(e){return}}function i(e,t,n){try{return e.states[t].attributes[n]}catch(e){return}}Object.defineProperty(t,"__esModule",{value:!0}),t.has_value=t.is_state_attr=t.state_attr=t.is_state=t.states=void 0,t.states=n,t.is_state=function(e,t,i){try{const r=n(e,t);return Array.isArray(i)?i.includes(r):r==i}catch(e){return!1}},t.state_attr=i,t.is_state_attr=function(e,t,n,r){try{const o=i(e,t,n);return Array.isArray(r)?r.includes(o):o==r}catch(e){return!1}},t.has_value=function(e,t){try{const i=n(e,t);return!![!1,0,-0,""].includes(i)||Boolean(i)}catch(e){return!1}}},3320:(e,t,n)=>{"use strict";var i=n(7990),r=n(3150);function o(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}e.exports.Type=n(1364),e.exports.Schema=n(7657),e.exports.FAILSAFE_SCHEMA=n(4795),e.exports.JSON_SCHEMA=n(5966),e.exports.CORE_SCHEMA=n(9471),e.exports.DEFAULT_SCHEMA=n(6601),e.exports.load=i.load,e.exports.loadAll=i.loadAll,e.exports.dump=r.dump,e.exports.YAMLException=n(8425),e.exports.types={binary:n(3531),float:n(5215),map:n(945),null:n(151),pairs:n(6879),set:n(4982),timestamp:n(2156),bool:n(8771),int:n(1518),merge:n(7452),omap:n(1605),seq:n(6451),str:n(48)},e.exports.safeLoad=o("safeLoad","load"),e.exports.safeLoadAll=o("safeLoadAll","loadAll"),e.exports.safeDump=o("safeDump","dump")},8347:e=>{"use strict";function t(e){return null==e}e.exports.isNothing=t,e.exports.isObject=function(e){return"object"==typeof e&&null!==e},e.exports.toArray=function(e){return Array.isArray(e)?e:t(e)?[]:[e]},e.exports.repeat=function(e,t){var n,i="";for(n=0;n{"use strict";var i=n(8347),r=n(8425),o=n(6601),s=Object.prototype.toString,a=Object.prototype.hasOwnProperty,c=65279,l=9,u=10,h=13,p=32,d=33,f=34,m=35,v=37,y=38,g=39,_=42,b=44,C=45,k=58,w=61,L=62,x=63,A=64,E=91,O=93,T=96,S=123,M=124,N=125,I={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},$=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],j=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function P(e){var t,n,o;if(t=e.toString(16).toUpperCase(),e<=255)n="x",o=2;else if(e<=65535)n="u",o=4;else{if(!(e<=4294967295))throw new r("code point within a string may not be greater than 0xFFFFFFFF");n="U",o=8}return"\\"+n+i.repeat("0",o-t.length)+t}var R=2;function F(e){this.schema=e.schema||o,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=i.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var n,i,r,o,s,c,l;if(null===t)return{};for(n={},r=0,o=(i=Object.keys(t)).length;r=55296&&i<=56319&&t+1=56320&&n<=57343?1024*(i-55296)+n-56320+65536:i}function z(e){return/^\n* /.test(e)}var Y=1,W=2,q=3,G=4,X=5;function J(e,t,n,i,o){e.dump=function(){if(0===t.length)return e.quotingType===R?'""':"''";if(!e.noCompatMode&&(-1!==$.indexOf(t)||j.test(t)))return e.quotingType===R?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,n),a=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),l=i||e.flowLevel>-1&&n>=e.flowLevel;switch(function(e,t,n,i,r,o,s,a){var l,h,p=0,I=null,$=!1,j=!1,P=-1!==i,F=-1,D=U(h=Z(e,0))&&h!==c&&!K(h)&&h!==C&&h!==x&&h!==k&&h!==b&&h!==E&&h!==O&&h!==S&&h!==N&&h!==m&&h!==y&&h!==_&&h!==d&&h!==M&&h!==w&&h!==L&&h!==g&&h!==f&&h!==v&&h!==A&&h!==T&&function(e){return!K(e)&&e!==k}(Z(e,e.length-1));if(t||s)for(l=0;l=65536?l+=2:l++){if(!U(p=Z(e,l)))return X;D=D&&V(p,I,a),I=p}else{for(l=0;l=65536?l+=2:l++){if((p=Z(e,l))===u)$=!0,P&&(j=j||l-F-1>i&&" "!==e[F+1],F=l);else if(!U(p))return X;D=D&&V(p,I,a),I=p}j=j||P&&l-F-1>i&&" "!==e[F+1]}return $||j?n>9&&z(e)?X:s?o===R?X:W:j?G:q:!D||s||r(e)?o===R?X:W:Y}(t,l,e.indent,a,(function(t){return function(e,t){var n,i;for(n=0,i=e.implicitTypes.length;n"+Q(t,e.indent)+ee(D(function(e,t){for(var n,i,r,o=/(\n+)([^\n]*)/g,s=(r=-1!==(r=e.indexOf("\n"))?r:e.length,o.lastIndex=r,te(e.slice(0,r),t)),a="\n"===e[0]||" "===e[0];i=o.exec(e);){var c=i[1],l=i[2];n=" "===l[0],s+=c+(a||n||""===l?"":"\n")+te(l,t),a=n}return s}(t,a),s));case X:return'"'+function(e){for(var t,n="",i=0,r=0;r=65536?r+=2:r++)i=Z(e,r),!(t=I[i])&&U(i)?(n+=e[r],i>=65536&&(n+=e[r+1])):n+=t||P(i);return n}(t)+'"';default:throw new r("impossible error: invalid scalar style")}}()}function Q(e,t){var n=z(e)?String(t):"",i="\n"===e[e.length-1];return n+(!i||"\n"!==e[e.length-2]&&"\n"!==e?i?"":"-":"+")+"\n"}function ee(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function te(e,t){if(""===e||" "===e[0])return e;for(var n,i,r=/ [^ ]/g,o=0,s=0,a=0,c="";n=r.exec(e);)(a=n.index)-o>t&&(i=s>o?s:a,c+="\n"+e.slice(o,i),o=i+1),s=a;return c+="\n",e.length-o>t&&s>o?c+=e.slice(o,s)+"\n"+e.slice(s+1):c+=e.slice(o),c.slice(1)}function ne(e,t,n,i){var r,o,s,a="",c=e.tag;for(r=0,o=n.length;r tag resolver accepts not "'+h+'" style');i=u.represent[h](t,h)}e.dump=i}return!0}return!1}function re(e,t,n,i,o,a,c){e.tag=null,e.dump=n,ie(e,n,!1)||ie(e,n,!0);var l,h=s.call(e.dump),p=i;i&&(i=e.flowLevel<0||e.flowLevel>t);var d,f,m="[object Object]"===h||"[object Array]"===h;if(m&&(f=-1!==(d=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||f||2!==e.indent&&t>0)&&(o=!1),f&&e.usedDuplicates[d])e.dump="*ref_"+d;else{if(m&&f&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),"[object Object]"===h)i&&0!==Object.keys(e.dump).length?(function(e,t,n,i){var o,s,a,c,l,h,p="",d=e.tag,f=Object.keys(n);if(!0===e.sortKeys)f.sort();else if("function"==typeof e.sortKeys)f.sort(e.sortKeys);else if(e.sortKeys)throw new r("sortKeys must be a boolean or a function");for(o=0,s=f.length;o1024)&&(e.dump&&u===e.dump.charCodeAt(0)?h+="?":h+="? "),h+=e.dump,l&&(h+=B(e,t)),re(e,t+1,c,!0,l)&&(e.dump&&u===e.dump.charCodeAt(0)?h+=":":h+=": ",p+=h+=e.dump));e.tag=d,e.dump=p||"{}"}(e,t,e.dump,o),f&&(e.dump="&ref_"+d+e.dump)):(function(e,t,n){var i,r,o,s,a,c="",l=e.tag,u=Object.keys(n);for(i=0,r=u.length;i1024&&(a+="? "),a+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),re(e,t,s,!1,!1)&&(c+=a+=e.dump));e.tag=l,e.dump="{"+c+"}"}(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+e.dump));else if("[object Array]"===h)i&&0!==e.dump.length?(e.noArrayIndent&&!c&&t>0?ne(e,t-1,e.dump,o):ne(e,t,e.dump,o),f&&(e.dump="&ref_"+d+e.dump)):(function(e,t,n){var i,r,o,s="",a=e.tag;for(i=0,r=n.length;i",e.dump=l+" "+e.dump)}return!0}function oe(e,t){var n,i,r=[],o=[];for(se(e,r,o),n=0,i=o.length;n{"use strict";function t(e,t){var n="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+="\n\n"+e.mark.snippet),i+" "+n):i}function n(e,n){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=n,this.message=t(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n.prototype.toString=function(e){return this.name+": "+t(this,e)},e.exports=n},7990:(e,t,n)=>{"use strict";var i=n(8347),r=n(8425),o=n(192),s=n(6601),a=Object.prototype.hasOwnProperty,c=1,l=2,u=3,h=4,p=1,d=2,f=3,m=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,v=/[\x85\u2028\u2029]/,y=/[,\[\]\{\}]/,g=/^(?:!|!!|![a-z\-]+!)$/i,_=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function b(e){return Object.prototype.toString.call(e)}function C(e){return 10===e||13===e}function k(e){return 9===e||32===e}function w(e){return 9===e||32===e||10===e||13===e}function L(e){return 44===e||91===e||93===e||123===e||125===e}function x(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function A(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function E(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var O=new Array(256),T=new Array(256),S=0;S<256;S++)O[S]=A(S)?1:0,T[S]=A(S);function M(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||s,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function N(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=o(n),new r(t,n)}function I(e,t){throw N(e,t)}function $(e,t){e.onWarning&&e.onWarning.call(null,N(e,t))}var j={YAML:function(e,t,n){var i,r,o;null!==e.version&&I(e,"duplication of %YAML directive"),1!==n.length&&I(e,"YAML directive accepts exactly one argument"),null===(i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&I(e,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),o=parseInt(i[2],10),1!==r&&I(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,1!==o&&2!==o&&$(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var i,r;2!==n.length&&I(e,"TAG directive accepts exactly two arguments"),i=n[0],r=n[1],g.test(i)||I(e,"ill-formed tag handle (first argument) of the TAG directive"),a.call(e.tagMap,i)&&I(e,'there is a previously declared suffix for "'+i+'" tag handle'),_.test(r)||I(e,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(t){I(e,"tag prefix is malformed: "+r)}e.tagMap[i]=r}};function P(e,t,n,i){var r,o,s,a;if(t1&&(e.result+=i.repeat("\n",t-1))}function H(e,t){var n,i,r=e.tag,o=e.anchor,s=[],a=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=s),i=e.input.charCodeAt(e.position);0!==i&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,I(e,"tab characters must not be used in indentation")),45===i)&&w(e.input.charCodeAt(e.position+1));)if(a=!0,e.position++,B(e,!0,-1)&&e.lineIndent<=t)s.push(null),i=e.input.charCodeAt(e.position);else if(n=e.line,z(e,t,u,!1,!0),s.push(e.result),B(e,!0,-1),i=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==i)I(e,"bad indentation of a sequence entry");else if(e.lineIndentt?M=1:e.lineIndent===t?M=0:e.lineIndentt?M=1:e.lineIndent===t?M=0:e.lineIndentt)&&(_&&(s=e.line,a=e.lineStart,c=e.position),z(e,t,h,!0,r)&&(_?y=e.result:g=e.result),_||(F(e,f,m,v,y,g,s,a,c),v=y=g=null),B(e,!0,-1),u=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&0!==u)I(e,"bad indentation of a mapping entry");else if(e.lineIndent=0))break;0===o?I(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?I(e,"repeat of an indentation width identifier"):(h=t+o-1,u=!0)}if(k(s)){do{s=e.input.charCodeAt(++e.position)}while(k(s));if(35===s)do{s=e.input.charCodeAt(++e.position)}while(!C(s)&&0!==s)}for(;0!==s;){for(D(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!u||e.lineIndenth&&(h=e.lineIndent),C(s))m++;else{if(e.lineIndent0){for(r=s,o=0;r>0;r--)(s=x(a=e.input.charCodeAt(++e.position)))>=0?o=(o<<4)+s:I(e,"expected hexadecimal character");e.result+=E(o),e.position++}else I(e,"unknown escape sequence");n=i=e.position}else C(a)?(P(e,n,i,!0),U(e,B(e,!1,t)),n=i=e.position):e.position===e.lineStart&&K(e)?I(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}I(e,"unexpected end of the stream within a double quoted scalar")}(e,A)?$=!0:function(e){var t,n,i;if(42!==(i=e.input.charCodeAt(e.position)))return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!w(i)&&!L(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&I(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),a.call(e.anchorMap,n)||I(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],B(e,!0,-1),!0}(e)?($=!0,null===e.tag&&null===e.anchor||I(e,"alias node should not have any properties")):function(e,t,n){var i,r,o,s,a,c,l,u,h=e.kind,p=e.result;if(w(u=e.input.charCodeAt(e.position))||L(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(w(i=e.input.charCodeAt(e.position+1))||n&&L(i)))return!1;for(e.kind="scalar",e.result="",r=o=e.position,s=!1;0!==u;){if(58===u){if(w(i=e.input.charCodeAt(e.position+1))||n&&L(i))break}else if(35===u){if(w(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&K(e)||n&&L(u))break;if(C(u)){if(a=e.line,c=e.lineStart,l=e.lineIndent,B(e,!1,-1),e.lineIndent>=t){s=!0,u=e.input.charCodeAt(e.position);continue}e.position=o,e.line=a,e.lineStart=c,e.lineIndent=l;break}}s&&(P(e,r,o,!1),U(e,e.line-a),r=o=e.position,s=!1),k(u)||(o=e.position+1),u=e.input.charCodeAt(++e.position)}return P(e,r,o,!1),!!e.result||(e.kind=h,e.result=p,!1)}(e,A,c===n)&&($=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===M&&($=v&&H(e,S))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&I(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),y=0,g=e.implicitTypes.length;y"),null!==e.result&&b.kind!==e.kind&&I(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+b.kind+'", not "'+e.kind+'"'),b.resolve(e.result,e.tag)?(e.result=b.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):I(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||$}function Y(e){var t,n,i,r,o=e.position,s=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(r=e.input.charCodeAt(e.position))&&(B(e,!0,-1),r=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==r));){for(s=!0,r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!w(r);)r=e.input.charCodeAt(++e.position);for(i=[],(n=e.input.slice(t,e.position)).length<1&&I(e,"directive name must not be less than one character in length");0!==r;){for(;k(r);)r=e.input.charCodeAt(++e.position);if(35===r){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&!C(r));break}if(C(r))break;for(t=e.position;0!==r&&!w(r);)r=e.input.charCodeAt(++e.position);i.push(e.input.slice(t,e.position))}0!==r&&D(e),a.call(j,n)?j[n](e,n,i):$(e,'unknown document directive "'+n+'"')}B(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,B(e,!0,-1)):s&&I(e,"directives end mark is expected"),z(e,e.lineIndent-1,h,!1,!0),B(e,!0,-1),e.checkLineBreaks&&v.test(e.input.slice(o,e.position))&&$(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&K(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,B(e,!0,-1)):e.position{"use strict";var i=n(8425),r=n(1364);function o(e,t){var n=[];return e[t].forEach((function(e){var t=n.length;n.forEach((function(n,i){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=i)})),n[t]=e})),n}function s(e){return this.extend(e)}s.prototype.extend=function(e){var t=[],n=[];if(e instanceof r)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new i("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof r))throw new i("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new i("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new i("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(e){if(!(e instanceof r))throw new i("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var a=Object.create(s.prototype);return a.implicit=(this.implicit||[]).concat(t),a.explicit=(this.explicit||[]).concat(n),a.compiledImplicit=o(a,"implicit"),a.compiledExplicit=o(a,"explicit"),a.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function i(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e{"use strict";e.exports=n(5966)},6601:(e,t,n)=>{"use strict";e.exports=n(9471).extend({implicit:[n(2156),n(7452)],explicit:[n(3531),n(1605),n(6879),n(4982)]})},4795:(e,t,n)=>{"use strict";var i=n(7657);e.exports=new i({explicit:[n(48),n(6451),n(945)]})},5966:(e,t,n)=>{"use strict";e.exports=n(4795).extend({implicit:[n(151),n(8771),n(1518),n(5215)]})},192:(e,t,n)=>{"use strict";var i=n(8347);function r(e,t,n,i,r){var o="",s="",a=Math.floor(r/2)-1;return i-t>a&&(t=i-a+(o=" ... ").length),n-i>a&&(n=i+a-(s=" ...").length),{str:o+e.slice(t,n).replace(/\t/g,"→")+s,pos:i-t+o.length}}function o(e,t){return i.repeat(" ",t-e.length)+e}e.exports=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,s=/\r?\n|\r|\0/g,a=[0],c=[],l=-1;n=s.exec(e.buffer);)c.push(n.index),a.push(n.index+n[0].length),e.position<=n.index&&l<0&&(l=a.length-2);l<0&&(l=a.length-1);var u,h,p="",d=Math.min(e.line+t.linesAfter,c.length).toString().length,f=t.maxLength-(t.indent+d+3);for(u=1;u<=t.linesBefore&&!(l-u<0);u++)h=r(e.buffer,a[l-u],c[l-u],e.position-(a[l]-a[l-u]),f),p=i.repeat(" ",t.indent)+o((e.line-u+1).toString(),d)+" | "+h.str+"\n"+p;for(h=r(e.buffer,a[l],c[l],e.position,f),p+=i.repeat(" ",t.indent)+o((e.line+1).toString(),d)+" | "+h.str+"\n",p+=i.repeat("-",t.indent+d+3+h.pos)+"^\n",u=1;u<=t.linesAfter&&!(l+u>=c.length);u++)h=r(e.buffer,a[l+u],c[l+u],e.position-(a[l]-a[l+u]),f),p+=i.repeat(" ",t.indent)+o((e.line+u+1).toString(),d)+" | "+h.str+"\n";return p.replace(/\n$/,"")}},1364:(e,t,n)=>{"use strict";var i=n(8425),r=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],o=["scalar","sequence","mapping"];e.exports=function(e,t){var n,s;if(t=t||{},Object.keys(t).forEach((function(t){if(-1===r.indexOf(t))throw new i('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=(n=t.styleAliases||null,s={},null!==n&&Object.keys(n).forEach((function(e){n[e].forEach((function(t){s[String(t)]=e}))})),s),-1===o.indexOf(this.kind))throw new i('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}},3531:(e,t,n)=>{"use strict";var i=n(1364),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";e.exports=new i("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i=0,o=e.length,s=r;for(n=0;n64)){if(t<0)return!1;i+=6}return i%8==0},construct:function(e){var t,n,i=e.replace(/[\r\n=]/g,""),o=i.length,s=r,a=0,c=[];for(t=0;t>16&255),c.push(a>>8&255),c.push(255&a)),a=a<<6|s.indexOf(i.charAt(t));return 0==(n=o%4*6)?(c.push(a>>16&255),c.push(a>>8&255),c.push(255&a)):18===n?(c.push(a>>10&255),c.push(a>>2&255)):12===n&&c.push(a>>4&255),new Uint8Array(c)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,i="",o=0,s=e.length,a=r;for(t=0;t>18&63],i+=a[o>>12&63],i+=a[o>>6&63],i+=a[63&o]),o=(o<<8)+e[t];return 0==(n=s%3)?(i+=a[o>>18&63],i+=a[o>>12&63],i+=a[o>>6&63],i+=a[63&o]):2===n?(i+=a[o>>10&63],i+=a[o>>4&63],i+=a[o<<2&63],i+=a[64]):1===n&&(i+=a[o>>2&63],i+=a[o<<4&63],i+=a[64],i+=a[64]),i}})},8771:(e,t,n)=>{"use strict";var i=n(1364);e.exports=new i("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},5215:(e,t,n)=>{"use strict";var i=n(8347),r=n(1364),o=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),s=/^[-+]?[0-9]+e/;e.exports=new r("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!o.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||i.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(i.isNegativeZero(e))return"-0.0";return n=e.toString(10),s.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},1518:(e,t,n)=>{"use strict";var i=n(8347),r=n(1364);function o(e){return 48<=e&&e<=55}function s(e){return 48<=e&&e<=57}e.exports=new r("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i=e.length,r=0,a=!1;if(!i)return!1;if("-"!==(t=e[r])&&"+"!==t||(t=e[++r]),"0"===t){if(r+1===i)return!0;if("b"===(t=e[++r])){for(r++;r=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},945:(e,t,n)=>{"use strict";var i=n(1364);e.exports=new i("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},7452:(e,t,n)=>{"use strict";var i=n(1364);e.exports=new i("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}})},151:(e,t,n)=>{"use strict";var i=n(1364);e.exports=new i("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})},1605:(e,t,n)=>{"use strict";var i=n(1364),r=Object.prototype.hasOwnProperty,o=Object.prototype.toString;e.exports=new i("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,i,s,a,c=[],l=e;for(t=0,n=l.length;t{"use strict";var i=n(1364),r=Object.prototype.toString;e.exports=new i("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,i,o,s,a=e;for(s=new Array(a.length),t=0,n=a.length;t{"use strict";var i=n(1364);e.exports=new i("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},4982:(e,t,n)=>{"use strict";var i=n(1364),r=Object.prototype.hasOwnProperty;e.exports=new i("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(r.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}})},48:(e,t,n)=>{"use strict";var i=n(1364);e.exports=new i("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},2156:(e,t,n)=>{"use strict";var i=n(1364),r=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),o=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");e.exports=new i("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==r.exec(e)||null!==o.exec(e))},construct:function(e){var t,n,i,s,a,c,l,u,h=0,p=null;if(null===(t=r.exec(e))&&(t=o.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,s=+t[3],!t[4])return new Date(Date.UTC(n,i,s));if(a=+t[4],c=+t[5],l=+t[6],t[7]){for(h=t[7].slice(0,3);h.length<3;)h+="0";h=+h}return t[9]&&(p=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(p=-p)),u=new Date(Date.UTC(n,i,s,a,c,l,h)),p&&u.setTime(u.getTime()-p),u},instanceOf:Date,represent:function(e){return e.toISOString()}})},2985:function(e){var t;"undefined"!=typeof self&&self,t=function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=11)}([function(e,t,n){"use strict";var i=Array.prototype,r=Object.prototype,o={"&":"&",'"':""","'":"'","<":"<",">":">","\\":"\"},s=/[&"'<>\\]/g;function a(e,t){return r.hasOwnProperty.call(e,t)}function c(e){return o[e]}function l(e,t,n){var i,r,o;if(e instanceof Error&&(e=(r=e).name+": "+r.message),Object.setPrototypeOf?(i=new Error(e),Object.setPrototypeOf(i,l.prototype)):(i=this,Object.defineProperty(i,"message",{enumerable:!1,writable:!0,value:e})),Object.defineProperty(i,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(i,this.constructor),r){var s=Object.getOwnPropertyDescriptor(r,"stack");(o=s&&(s.get||function(){return s.value}))||(o=function(){return r.stack})}else{var a=new Error(e).stack;o=function(){return a}}return Object.defineProperty(i,"stack",{get:function(){return o.call(i)}}),Object.defineProperty(i,"cause",{value:r}),i.lineno=t,i.colno=n,i.firstUpdate=!0,i.Update=function(e){var t="("+(e||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?t+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(t+=" [Line "+this.lineno+"]")),t+="\n ",this.firstUpdate&&(t+=" "),this.message=t+(this.message||""),this.firstUpdate=!1,this},i}function u(e){return"[object Function]"===r.toString.call(e)}function h(e){return"[object Array]"===r.toString.call(e)}function p(e){return"[object String]"===r.toString.call(e)}function d(e){return"[object Object]"===r.toString.call(e)}function f(e){var t,n=(t=e)?"string"==typeof t?t.split("."):[t]:[];return function(e){for(var t=e,i=0;ie.length)s=r.slice(0,e.length),r.slice(s.length,l).forEach((function(e,n){n2?r-2:0),s=2;s0||!n)&&process.stdout.write(" ".repeat(t));var o=r===i.length-1?"":"\n";process.stdout.write(""+e+o)}))}e.exports={Node:c,Root:h,NodeList:u,Value:l,Literal:p,Symbol:d,Group:f,Array:m,Pair:v,Dict:y,Output:B,Capture:K,TemplateData:U,If:_,IfAsync:b,InlineIf:C,For:k,AsyncEach:w,AsyncAll:L,Macro:x,Caller:A,Import:E,FromImport:O,FunCall:T,Filter:S,FilterAsync:M,KeywordArgs:N,Block:I,Super:$,Extends:j,Include:P,Set:R,Switch:F,Case:D,LookupVal:g,BinOp:V,In:Z,Is:z,Or:Y,And:W,Not:q,Add:G,Concat:X,Sub:J,Mul:Q,Div:ee,FloorDiv:te,Mod:ne,Pow:ie,Neg:re,Pos:oe,Compare:se,CompareOperand:ae,CallExtension:ce,CallExtensionAsync:le,printNodes:function e(t,n){if(n=n||0,ue(t.typename+": ",n),t instanceof u)ue("\n"),t.children.forEach((function(t){e(t,n+2)}));else if(t instanceof ce)ue(t.extName+"."+t.prop+"\n"),t.args&&e(t.args,n+2),t.contentArgs&&t.contentArgs.forEach((function(t){e(t,n+2)}));else{var i=[],r=null;t.iterFields((function(e,t){e instanceof c?i.push([t,e]):(r=r||{})[t]=e})),r?ue(JSON.stringify(r,null,2)+"\n",null,!0):ue("\n"),i.forEach((function(t){var i=t[0],r=t[1];ue("["+i+"] =>",n+2),e(r,n+4)}))}}}},function(e,t){},function(e,t,n){"use strict";function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}var r=n(8),o=n(17),s=n(3),a=n(0).TemplateError,c=n(2).Frame,l=n(1).Obj,u={"==":"==","===":"===","!=":"!=","!==":"!==","<":"<",">":">","<=":"<=",">=":">="},h=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,i(t,n);var o=r.prototype;return o.init=function(e,t){this.templateName=e,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this._scopeClosers="",this.inBlock=!1,this.throwOnUndefined=t},o.fail=function(e,t,n){throw void 0!==t&&(t+=1),void 0!==n&&(n+=1),new a(e,t,n)},o._pushBuffer=function(){var e=this._tmpid();return this.bufferStack.push(this.buffer),this.buffer=e,this._emit("var "+this.buffer+' = "";'),e},o._popBuffer=function(){this.buffer=this.bufferStack.pop()},o._emit=function(e){this.codebuf.push(e)},o._emitLine=function(e){this._emit(e+"\n")},o._emitLines=function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i0&&r._emit(","),r.compile(e,t)})),i&&this._emit(i)},o._compileExpression=function(e,t){this.assertType(e,s.Literal,s.Symbol,s.Group,s.Array,s.Dict,s.FunCall,s.Caller,s.Filter,s.LookupVal,s.Compare,s.InlineIf,s.In,s.Is,s.And,s.Or,s.Not,s.Add,s.Concat,s.Sub,s.Mul,s.Div,s.FloorDiv,s.Mod,s.Pow,s.Neg,s.Pos,s.Compare,s.NodeList),this.compile(e,t)},o.assertType=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0&&i._emit(","),e){i._emitLine("function(cb) {"),i._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var r=i._pushBuffer();i._withScopedSyntax((function(){i.compile(e,t),i._emitLine("cb(null, "+r+");")})),i._popBuffer(),i._emitLine("return "+r+";"),i._emitLine("}")}else i._emit("null")})),n){var c=this._tmpid();this._emitLine(", "+this._makeCallback(c)),this._emitLine(this.buffer+" += runtime.suppressValue("+c+", "+a+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+a+" && env.opts.autoescape);\n")},o.compileCallExtensionAsync=function(e,t){this.compileCallExtension(e,t,!0)},o.compileNodeList=function(e,t){this._compileChildren(e,t)},o.compileLiteral=function(e){if("string"==typeof e.value){var t=e.value.replace(/\\/g,"\\\\");t=(t=(t=(t=(t=t.replace(/"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t")).replace(/\u2028/g,"\\u2028"),this._emit('"'+t+'"')}else null===e.value?this._emit("null"):this._emit(e.value.toString())},o.compileSymbol=function(e,t){var n=e.value,i=t.lookup(n);i?this._emit(i):this._emit('runtime.contextOrFrameLookup(context, frame, "'+n+'")')},o.compileGroup=function(e,t){this._compileAggregate(e,t,"(",")")},o.compileArray=function(e,t){this._compileAggregate(e,t,"[","]")},o.compileDict=function(e,t){this._compileAggregate(e,t,"{","}")},o.compilePair=function(e,t){var n=e.key,i=e.value;n instanceof s.Symbol?n=new s.Literal(n.lineno,n.colno,n.value):n instanceof s.Literal&&"string"==typeof n.value||this.fail("compilePair: Dict keys must be strings or names",n.lineno,n.colno),this.compile(n,t),this._emit(": "),this._compileExpression(i,t)},o.compileInlineIf=function(e,t){this._emit("("),this.compile(e.cond,t),this._emit("?"),this.compile(e.body,t),this._emit(":"),null!==e.else_?this.compile(e.else_,t):this._emit('""'),this._emit(")")},o.compileIn=function(e,t){this._emit("runtime.inOperator("),this.compile(e.left,t),this._emit(","),this.compile(e.right,t),this._emit(")")},o.compileIs=function(e,t){var n=e.right.name?e.right.name.value:e.right.value;this._emit('env.getTest("'+n+'").call(context, '),this.compile(e.left,t),e.right.args&&(this._emit(","),this.compile(e.right.args,t)),this._emit(") === true")},o._binOpEmitter=function(e,t,n){this.compile(e.left,t),this._emit(n),this.compile(e.right,t)},o.compileOr=function(e,t){return this._binOpEmitter(e,t," || ")},o.compileAnd=function(e,t){return this._binOpEmitter(e,t," && ")},o.compileAdd=function(e,t){return this._binOpEmitter(e,t," + ")},o.compileConcat=function(e,t){return this._binOpEmitter(e,t,' + "" + ')},o.compileSub=function(e,t){return this._binOpEmitter(e,t," - ")},o.compileMul=function(e,t){return this._binOpEmitter(e,t," * ")},o.compileDiv=function(e,t){return this._binOpEmitter(e,t," / ")},o.compileMod=function(e,t){return this._binOpEmitter(e,t," % ")},o.compileNot=function(e,t){this._emit("!"),this.compile(e.target,t)},o.compileFloorDiv=function(e,t){this._emit("Math.floor("),this.compile(e.left,t),this._emit(" / "),this.compile(e.right,t),this._emit(")")},o.compilePow=function(e,t){this._emit("Math.pow("),this.compile(e.left,t),this._emit(", "),this.compile(e.right,t),this._emit(")")},o.compileNeg=function(e,t){this._emit("-"),this.compile(e.target,t)},o.compilePos=function(e,t){this._emit("+"),this.compile(e.target,t)},o.compileCompare=function(e,t){var n=this;this.compile(e.expr,t),e.ops.forEach((function(e){n._emit(" "+u[e.type]+" "),n.compile(e.expr,t)}))},o.compileLookupVal=function(e,t){this._emit("runtime.memberLookup(("),this._compileExpression(e.target,t),this._emit("),"),this._compileExpression(e.val,t),this._emit(")")},o._getNodeName=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--"}},o.compileFunCall=function(e,t){this._emit("(lineno = "+e.lineno+", colno = "+e.colno+", "),this._emit("runtime.callWrap("),this._compileExpression(e.name,t),this._emit(', "'+this._getNodeName(e.name).replace(/"/g,'\\"')+'", context, '),this._compileAggregate(e.args,t,"[","])"),this._emit(")")},o.compileFilter=function(e,t){var n=e.name;this.assertType(n,s.Symbol),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(e.args,t),this._emit(")")},o.compileFilterAsync=function(e,t){var n=e.name,i=e.symbol.value;this.assertType(n,s.Symbol),t.set(i,i),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(e.args,t),this._emitLine(", "+this._makeCallback(i)),this._addScopeLevel()},o.compileKeywordArgs=function(e,t){this._emit("runtime.makeKeywordArgs("),this.compileDict(e,t),this._emit(")")},o.compileSet=function(e,t){var n=this,i=[];e.targets.forEach((function(e){var r=e.value,o=t.lookup(r);null==o&&(o=n._tmpid(),n._emitLine("var "+o+";")),i.push(o)})),e.value?(this._emit(i.join(" = ")+" = "),this._compileExpression(e.value,t),this._emitLine(";")):(this._emit(i.join(" = ")+" = "),this.compile(e.body,t),this._emitLine(";")),e.targets.forEach((function(e,t){var r=i[t],o=e.value;n._emitLine('frame.set("'+o+'", '+r+", true);"),n._emitLine("if(frame.topLevel) {"),n._emitLine('context.setVariable("'+o+'", '+r+");"),n._emitLine("}"),"_"!==o.charAt(0)&&(n._emitLine("if(frame.topLevel) {"),n._emitLine('context.addExport("'+o+'", '+r+");"),n._emitLine("}"))}))},o.compileSwitch=function(e,t){var n=this;this._emit("switch ("),this.compile(e.expr,t),this._emit(") {"),e.cases.forEach((function(e,i){n._emit("case "),n.compile(e.cond,t),n._emit(": "),n.compile(e.body,t),e.body.children.length&&n._emitLine("break;")})),e.default&&(this._emit("default:"),this.compile(e.default,t)),this._emit("}")},o.compileIf=function(e,t,n){var i=this;this._emit("if("),this._compileExpression(e.cond,t),this._emitLine(") {"),this._withScopedSyntax((function(){i.compile(e.body,t),n&&i._emit("cb()")})),e.else_?(this._emitLine("}\nelse {"),this._withScopedSyntax((function(){i.compile(e.else_,t),n&&i._emit("cb()")}))):n&&(this._emitLine("}\nelse {"),this._emit("cb()")),this._emitLine("}")},o.compileIfAsync=function(e,t){this._emit("(function(cb) {"),this.compileIf(e,t,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},o._emitLoopBindings=function(e,t,n,i){var r=this;[{name:"index",val:n+" + 1"},{name:"index0",val:n},{name:"revindex",val:i+" - "+n},{name:"revindex0",val:i+" - "+n+" - 1"},{name:"first",val:n+" === 0"},{name:"last",val:n+" === "+i+" - 1"},{name:"length",val:i}].forEach((function(e){r._emitLine('frame.set("loop.'+e.name+'", '+e.val+");")}))},o.compileFor=function(e,t){var n=this,i=this._tmpid(),r=this._tmpid(),o=this._tmpid();if(t=t.push(),this._emitLine("frame = frame.push();"),this._emit("var "+o+" = "),this._compileExpression(e.arr,t),this._emitLine(";"),this._emit("if("+o+") {"),this._emitLine(o+" = runtime.fromIterator("+o+");"),e.name instanceof s.Array){this._emitLine("var "+i+";"),this._emitLine("if(runtime.isArray("+o+")) {"),this._emitLine("var "+r+" = "+o+".length;"),this._emitLine("for("+i+"=0; "+i+" < "+o+".length; "+i+"++) {"),e.name.children.forEach((function(r,s){var a=n._tmpid();n._emitLine("var "+a+" = "+o+"["+i+"]["+s+"];"),n._emitLine('frame.set("'+r+'", '+o+"["+i+"]["+s+"]);"),t.set(e.name.children[s].value,a)})),this._emitLoopBindings(e,o,i,r),this._withScopedSyntax((function(){n.compile(e.body,t)})),this._emitLine("}"),this._emitLine("} else {");var a=e.name.children,c=a[0],l=a[1],u=this._tmpid(),h=this._tmpid();t.set(c.value,u),t.set(l.value,h),this._emitLine(i+" = -1;"),this._emitLine("var "+r+" = runtime.keys("+o+").length;"),this._emitLine("for(var "+u+" in "+o+") {"),this._emitLine(i+"++;"),this._emitLine("var "+h+" = "+o+"["+u+"];"),this._emitLine('frame.set("'+c.value+'", '+u+");"),this._emitLine('frame.set("'+l.value+'", '+h+");"),this._emitLoopBindings(e,o,i,r),this._withScopedSyntax((function(){n.compile(e.body,t)})),this._emitLine("}"),this._emitLine("}")}else{var p=this._tmpid();t.set(e.name.value,p),this._emitLine("var "+r+" = "+o+".length;"),this._emitLine("for(var "+i+"=0; "+i+" < "+o+".length; "+i+"++) {"),this._emitLine("var "+p+" = "+o+"["+i+"];"),this._emitLine('frame.set("'+e.name.value+'", '+p+");"),this._emitLoopBindings(e,o,i,r),this._withScopedSyntax((function(){n.compile(e.body,t)})),this._emitLine("}")}this._emitLine("}"),e.else_&&(this._emitLine("if (!"+r+") {"),this.compile(e.else_,t),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o._compileAsyncLoop=function(e,t,n){var i=this,r=this._tmpid(),o=this._tmpid(),a=this._tmpid(),c=n?"asyncAll":"asyncEach";if(t=t.push(),this._emitLine("frame = frame.push();"),this._emit("var "+a+" = runtime.fromIterator("),this._compileExpression(e.arr,t),this._emitLine(");"),e.name instanceof s.Array){var l=e.name.children.length;this._emit("runtime."+c+"("+a+", "+l+", function("),e.name.children.forEach((function(e){i._emit(e.value+",")})),this._emit(r+","+o+",next) {"),e.name.children.forEach((function(e){var n=e.value;t.set(n,n),i._emitLine('frame.set("'+n+'", '+n+");")}))}else{var u=e.name.value;this._emitLine("runtime."+c+"("+a+", 1, function("+u+", "+r+", "+o+",next) {"),this._emitLine('frame.set("'+u+'", '+u+");"),t.set(u,u)}this._emitLoopBindings(e,a,r,o),this._withScopedSyntax((function(){var o;n&&(o=i._pushBuffer()),i.compile(e.body,t),i._emitLine("next("+r+(o?","+o:"")+");"),n&&i._popBuffer()}));var h=this._tmpid();this._emitLine("}, "+this._makeCallback(h)),this._addScopeLevel(),n&&this._emitLine(this.buffer+" += "+h+";"),e.else_&&(this._emitLine("if (!"+a+".length) {"),this.compile(e.else_,t),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o.compileAsyncEach=function(e,t){this._compileAsyncLoop(e,t)},o.compileAsyncAll=function(e,t){this._compileAsyncLoop(e,t,!0)},o._compileMacro=function(e,t){var n=this,i=[],r=null,o="macro_"+this._tmpid(),a=void 0!==t;e.args.children.forEach((function(t,o){o===e.args.children.length-1&&t instanceof s.Dict?r=t:(n.assertType(t,s.Symbol),i.push(t))}));var l,u=[].concat(i.map((function(e){return"l_"+e.value})),["kwargs"]),h=i.map((function(e){return'"'+e.value+'"'})),p=(r&&r.children||[]).map((function(e){return'"'+e.key.value+'"'}));l=a?t.push(!0):new c,this._emitLines("var "+o+" = runtime.makeMacro(","["+h.join(", ")+"], ","["+p.join(", ")+"], ","function ("+u.join(", ")+") {","var callerFrame = frame;","frame = "+(a?"frame.push(true);":"new runtime.Frame();"),"kwargs = kwargs || {};",'if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {','frame.set("caller", kwargs.caller); }'),i.forEach((function(e){n._emitLine('frame.set("'+e.value+'", l_'+e.value+");"),l.set(e.value,"l_"+e.value)})),r&&r.children.forEach((function(e){var t=e.key.value;n._emit('frame.set("'+t+'", '),n._emit('Object.prototype.hasOwnProperty.call(kwargs, "'+t+'")'),n._emit(' ? kwargs["'+t+'"] : '),n._compileExpression(e.value,l),n._emit(");")}));var d=this._pushBuffer();return this._withScopedSyntax((function(){n.compile(e.body,l)})),this._emitLine("frame = "+(a?"frame.pop();":"callerFrame;")),this._emitLine("return new runtime.SafeString("+d+");"),this._emitLine("});"),this._popBuffer(),o},o.compileMacro=function(e,t){var n=this._compileMacro(e),i=e.name.value;t.set(i,n),t.parent?this._emitLine('frame.set("'+i+'", '+n+");"):("_"!==e.name.value.charAt(0)&&this._emitLine('context.addExport("'+i+'");'),this._emitLine('context.setVariable("'+i+'", '+n+");"))},o.compileCaller=function(e,t){this._emit("(function (){");var n=this._compileMacro(e,t);this._emit("return "+n+";})()")},o._compileGetTemplate=function(e,t,n,i){var r=this._tmpid(),o=this._templateName(),s=this._makeCallback(r),a=n?"true":"false",c=i?"true":"false";return this._emit("env.getTemplate("),this._compileExpression(e.template,t),this._emitLine(", "+a+", "+o+", "+c+", "+s),r},o.compileImport=function(e,t){var n=e.target.value,i=this._compileGetTemplate(e,t,!1,!1);this._addScopeLevel(),this._emitLine(i+".getExported("+(e.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(i)),this._addScopeLevel(),t.set(n,i),t.parent?this._emitLine('frame.set("'+n+'", '+i+");"):this._emitLine('context.setVariable("'+n+'", '+i+");")},o.compileFromImport=function(e,t){var n=this,i=this._compileGetTemplate(e,t,!1,!1);this._addScopeLevel(),this._emitLine(i+".getExported("+(e.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(i)),this._addScopeLevel(),e.names.children.forEach((function(e){var r,o,a=n._tmpid();e instanceof s.Pair?(r=e.key.value,o=e.value.value):o=r=e.value,n._emitLine("if(Object.prototype.hasOwnProperty.call("+i+', "'+r+'")) {'),n._emitLine("var "+a+" = "+i+"."+r+";"),n._emitLine("} else {"),n._emitLine("cb(new Error(\"cannot import '"+r+"'\")); return;"),n._emitLine("}"),t.set(o,a),t.parent?n._emitLine('frame.set("'+o+'", '+a+");"):n._emitLine('context.setVariable("'+o+'", '+a+");")}))},o.compileBlock=function(e){var t=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(t)),this._emitLine(this.buffer+" += "+t+";"),this._addScopeLevel()},o.compileSuper=function(e,t){var n=e.blockName.value,i=e.symbol.value,r=this._makeCallback(i);this._emitLine('context.getSuper(env, "'+n+'", b_'+n+", frame, runtime, "+r),this._emitLine(i+" = runtime.markSafe("+i+");"),this._addScopeLevel(),t.set(i,i)},o.compileExtends=function(e,t){var n=this._tmpid(),i=this._compileGetTemplate(e,t,!0,!1);this._emitLine("parentTemplate = "+i),this._emitLine("for(var "+n+" in parentTemplate.blocks) {"),this._emitLine("context.addBlock("+n+", parentTemplate.blocks["+n+"]);"),this._emitLine("}"),this._addScopeLevel()},o.compileInclude=function(e,t){this._emitLine("var tasks = [];"),this._emitLine("tasks.push("),this._emitLine("function(callback) {");var n=this._compileGetTemplate(e,t,!1,e.ignoreMissing);this._emitLine("callback(null,"+n+");});"),this._emitLine("});");var i=this._tmpid();this._emitLine("tasks.push("),this._emitLine("function(template, callback){"),this._emitLine("template.render(context.getVariables(), frame, "+this._makeCallback(i)),this._emitLine("callback(null,"+i+");});"),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()},o.compileTemplateData=function(e,t){this.compileLiteral(e,t)},o.compileCapture=function(e,t){var n=this,i=this.buffer;this.buffer="output",this._emitLine("(function() {"),this._emitLine('var output = "";'),this._withScopedSyntax((function(){n.compile(e.body,t)})),this._emitLine("return output;"),this._emitLine("})()"),this.buffer=i},o.compileOutput=function(e,t){var n=this;e.children.forEach((function(i){i instanceof s.TemplateData?i.value&&(n._emit(n.buffer+" += "),n.compileLiteral(i,t),n._emitLine(";")):(n._emit(n.buffer+" += runtime.suppressValue("),n.throwOnUndefined&&n._emit("runtime.ensureDefined("),n.compile(i,t),n.throwOnUndefined&&n._emit(","+e.lineno+","+e.colno+")"),n._emit(", env.opts.autoescape);\n"))}))},o.compileRoot=function(e,t){var n=this;t&&this.fail("compileRoot: root node can't have frame"),t=new c,this._emitFuncBegin(e,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(e,t),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 i=[],r=e.findAll(s.Block);r.forEach((function(e,t){var r=e.name.value;if(-1!==i.indexOf(r))throw new Error('Block "'+r+'" defined more than once.');i.push(r),n._emitFuncBegin(e,"b_"+r);var o=new c;n._emitLine("var frame = frame.push(true);"),n.compile(e.body,o),n._emitFuncEnd()})),this._emitLine("return {"),r.forEach((function(e,t){var i="b_"+e.name.value;n._emitLine(i+": "+i+",")})),this._emitLine("root: root\n};")},o.compile=function(e,t){var n=this["compile"+e.typename];n?n.call(this,e,t):this.fail("compile: Cannot compile node: "+e.typename,e.lineno,e.colno)},o.getCode=function(){return this.codebuf.join("")},r}(l);e.exports={compile:function(e,t,n,i,s){void 0===s&&(s={});var a=new h(i,s.throwOnUndefined),c=(n||[]).map((function(e){return e.preprocess})).filter((function(e){return!!e})).reduce((function(e,t){return t(e)}),e);return a.compile(o.transform(r.parse(c,n,s),t,i)),a.getCode()},Compiler:h}},function(e,t,n){"use strict";function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}var r=n(4),o=n(1).EmitterObj;e.exports=function(e){var t,n;function o(){return e.apply(this,arguments)||this}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,i(t,n);var s=o.prototype;return s.resolve=function(e,t){return r.resolve(r.dirname(e),t)},s.isRelative=function(e){return 0===e.indexOf("./")||0===e.indexOf("../")},o}(o)},function(e,t,n){"use strict";function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}var o=n(12),s=n(15),a=n(0),c=n(5),l=n(18),u=n(10),h=u.FileSystemLoader,p=u.WebLoader,d=u.PrecompiledLoader,f=n(20),m=n(21),v=n(1),y=v.Obj,g=v.EmitterObj,_=n(2),b=_.handleError,C=_.Frame,k=n(22);function w(e,t,n){o((function(){e(t,n)}))}var L={type:"code",obj:{root:function(e,t,n,i,r){try{r(null,"")}catch(e){r(b(e,null,null))}}}},x=function(e){function t(){return e.apply(this,arguments)||this}i(t,e);var n=t.prototype;return n.init=function(e,t){var n=this;t=this.opts=t||{},this.opts.dev=!!t.dev,this.opts.autoescape=null==t.autoescape||t.autoescape,this.opts.throwOnUndefined=!!t.throwOnUndefined,this.opts.trimBlocks=!!t.trimBlocks,this.opts.lstripBlocks=!!t.lstripBlocks,this.loaders=[],e?this.loaders=a.isArray(e)?e:[e]:h?this.loaders=[new h("views")]:p&&(this.loaders=[new p("/views")]),"undefined"!=typeof window&&window.nunjucksPrecompiled&&this.loaders.unshift(new d(window.nunjucksPrecompiled)),this._initLoaders(),this.globals=m(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],a._entries(l).forEach((function(e){var t=e[0],i=e[1];return n.addFilter(t,i)})),a._entries(f).forEach((function(e){var t=e[0],i=e[1];return n.addTest(t,i)}))},n._initLoaders=function(){var e=this;this.loaders.forEach((function(t){t.cache={},"function"==typeof t.on&&(t.on("update",(function(n,i){t.cache[n]=null,e.emit("update",n,i,t)})),t.on("load",(function(n,i){e.emit("load",n,i,t)})))}))},n.invalidateCache=function(){this.loaders.forEach((function(e){e.cache={}}))},n.addExtension=function(e,t){return t.__name=e,this.extensions[e]=t,this.extensionsList.push(t),this},n.removeExtension=function(e){var t=this.getExtension(e);t&&(this.extensionsList=a.without(this.extensionsList,t),delete this.extensions[e])},n.getExtension=function(e){return this.extensions[e]},n.hasExtension=function(e){return!!this.extensions[e]},n.addGlobal=function(e,t){return this.globals[e]=t,this},n.getGlobal=function(e){if(void 0===this.globals[e])throw new Error("global not found: "+e);return this.globals[e]},n.addFilter=function(e,t,n){var i=t;return n&&this.asyncFilters.push(e),this.filters[e]=i,this},n.getFilter=function(e){if(!this.filters[e])throw new Error("filter not found: "+e);return this.filters[e]},n.addTest=function(e,t){return this.tests[e]=t,this},n.getTest=function(e){if(!this.tests[e])throw new Error("test not found: "+e);return this.tests[e]},n.resolveTemplate=function(e,t,n){return e.isRelative&&t&&e.isRelative(n)&&e.resolve?e.resolve(t,n):n},n.getTemplate=function(e,t,n,i,r){var o,s=this,c=this,l=null;if(e&&e.raw&&(e=e.raw),a.isFunction(n)&&(r=n,n=null,t=t||!1),a.isFunction(t)&&(r=t,t=!1),e instanceof E)l=e;else{if("string"!=typeof e)throw new Error("template names must be a string: "+e);for(var u=0;u0&&!this.skip(r.TOKEN_COMMA)&&this.fail("parseFrom: expected comma",e.lineno,e.colno);var a=this.parsePrimary();if("_"===a.value.charAt(0)&&this.fail("parseFrom: names starting with an underscore cannot be imported",a.lineno,a.colno),this.skipSymbol("as")){var c=this.parsePrimary();i.addChild(new o.Pair(a.lineno,a.colno,a,c))}else i.addChild(a);n=this.parseWithContext()}return new o.FromImport(e.lineno,e.colno,t,i,n)},c.parseBlock=function(){var e=this.peekToken();this.skipSymbol("block")||this.fail("parseBlock: expected block",e.lineno,e.colno);var t=new o.Block(e.lineno,e.colno);t.name=this.parsePrimary(),t.name instanceof o.Symbol||this.fail("parseBlock: variable name expected",e.lineno,e.colno),this.advanceAfterBlockEnd(e.value),t.body=this.parseUntilBlocks("endblock"),this.skipSymbol("endblock"),this.skipSymbol(t.name.value);var n=this.peekToken();return n||this.fail("parseBlock: expected endblock, got end of file"),this.advanceAfterBlockEnd(n.value),t},c.parseExtends=function(){var e="extends",t=this.peekToken();this.skipSymbol(e)||this.fail("parseTemplateRef: expected "+e);var n=new o.Extends(t.lineno,t.colno);return n.template=this.parseExpression(),this.advanceAfterBlockEnd(t.value),n},c.parseInclude=function(){var e="include",t=this.peekToken();this.skipSymbol(e)||this.fail("parseInclude: expected "+e);var n=new o.Include(t.lineno,t.colno);return n.template=this.parseExpression(),this.skipSymbol("ignore")&&this.skipSymbol("missing")&&(n.ignoreMissing=!0),this.advanceAfterBlockEnd(t.value),n},c.parseIf=function(){var e,t=this.peekToken();this.skipSymbol("if")||this.skipSymbol("elif")||this.skipSymbol("elseif")?e=new o.If(t.lineno,t.colno):this.skipSymbol("ifAsync")?e=new o.IfAsync(t.lineno,t.colno):this.fail("parseIf: expected if, elif, or elseif",t.lineno,t.colno),e.cond=this.parseExpression(),this.advanceAfterBlockEnd(t.value),e.body=this.parseUntilBlocks("elif","elseif","else","endif");var n=this.peekToken();switch(n&&n.value){case"elseif":case"elif":e.else_=this.parseIf();break;case"else":this.advanceAfterBlockEnd(),e.else_=this.parseUntilBlocks("endif"),this.advanceAfterBlockEnd();break;case"endif":e.else_=null,this.advanceAfterBlockEnd();break;default:this.fail("parseIf: expected elif, else, or endif, got end of file")}return e},c.parseSet=function(){var e=this.peekToken();this.skipSymbol("set")||this.fail("parseSet: expected set",e.lineno,e.colno);for(var t,n=new o.Set(e.lineno,e.colno,[]);(t=this.parsePrimary())&&(n.targets.push(t),this.skip(r.TOKEN_COMMA)););return this.skipValue(r.TOKEN_OPERATOR,"=")?(n.value=this.parseExpression(),this.advanceAfterBlockEnd(e.value)):this.skip(r.TOKEN_BLOCK_END)?(n.body=new o.Capture(e.lineno,e.colno,this.parseUntilBlocks("endset")),n.value=null,this.advanceAfterBlockEnd()):this.fail("parseSet: expected = or block end in set tag",e.lineno,e.colno),n},c.parseSwitch=function(){var e="switch",t="endswitch",n="case",i="default",r=this.peekToken();this.skipSymbol(e)||this.skipSymbol(n)||this.skipSymbol(i)||this.fail('parseSwitch: expected "switch," "case" or "default"',r.lineno,r.colno);var s=this.parseExpression();this.advanceAfterBlockEnd(e),this.parseUntilBlocks(n,i,t);var a,c=this.peekToken(),l=[];do{this.skipSymbol(n);var u=this.parseExpression();this.advanceAfterBlockEnd(e);var h=this.parseUntilBlocks(n,i,t);l.push(new o.Case(c.line,c.col,u,h)),c=this.peekToken()}while(c&&c.value===n);switch(c.value){case i:this.advanceAfterBlockEnd(),a=this.parseUntilBlocks(t),this.advanceAfterBlockEnd();break;case t:this.advanceAfterBlockEnd();break;default:this.fail('parseSwitch: expected "case," "default" or "endswitch," got EOF.')}return new o.Switch(r.lineno,r.colno,s,l,a)},c.parseStatement=function(){var e=this.peekToken();if(e.type!==r.TOKEN_SYMBOL&&this.fail("tag name expected",e.lineno,e.colno),this.breakOnBlocks&&-1!==a.indexOf(this.breakOnBlocks,e.value))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 t=0;t0;){var c=s[0],l=s[1],u=s[2];u===e?i+=1:u===t&&(i-=1),0===i?(r+=l,this.tokens.backN(c.length-l.length)):r+=c}return new o.Output(a.lineno,a.colno,[new o.TemplateData(a.lineno,a.colno,r)])},c.parsePostfix=function(e){for(var t,n=this.peekToken();n;){if(n.type===r.TOKEN_LEFT_PAREN)e=new o.FunCall(n.lineno,n.colno,e,this.parseSignature());else if(n.type===r.TOKEN_LEFT_BRACKET)(t=this.parseAggregate()).children.length>1&&this.fail("invalid index"),e=new o.LookupVal(n.lineno,n.colno,e,t.children[0]);else{if(n.type!==r.TOKEN_OPERATOR||"."!==n.value)break;this.nextToken();var i=this.nextToken();i.type!==r.TOKEN_SYMBOL&&this.fail("expected name as lookup value, got "+i.value,i.lineno,i.colno),t=new o.Literal(i.lineno,i.colno,i.value),e=new o.LookupVal(n.lineno,n.colno,e,t)}n=this.peekToken()}return e},c.parseExpression=function(){return this.parseInlineIf()},c.parseInlineIf=function(){var e=this.parseOr();if(this.skipSymbol("if")){var t=this.parseOr(),n=e;(e=new o.InlineIf(e.lineno,e.colno)).body=n,e.cond=t,this.skipSymbol("else")?e.else_=this.parseOr():e.else_=null}return e},c.parseOr=function(){for(var e=this.parseAnd();this.skipSymbol("or");){var t=this.parseAnd();e=new o.Or(e.lineno,e.colno,e,t)}return e},c.parseAnd=function(){for(var e=this.parseNot();this.skipSymbol("and");){var t=this.parseNot();e=new o.And(e.lineno,e.colno,e,t)}return e},c.parseNot=function(){var e=this.peekToken();return this.skipSymbol("not")?new o.Not(e.lineno,e.colno,this.parseNot()):this.parseIn()},c.parseIn=function(){for(var e=this.parseIs();;){var t=this.nextToken();if(!t)break;var n=t.type===r.TOKEN_SYMBOL&&"not"===t.value;if(n||this.pushToken(t),!this.skipSymbol("in")){n&&this.pushToken(t);break}var i=this.parseIs();e=new o.In(e.lineno,e.colno,e,i),n&&(e=new o.Not(e.lineno,e.colno,e))}return e},c.parseIs=function(){var e=this.parseCompare();if(this.skipSymbol("is")){var t=this.skipSymbol("not"),n=this.parseCompare();e=new o.Is(e.lineno,e.colno,e,n),t&&(e=new o.Not(e.lineno,e.colno,e))}return e},c.parseCompare=function(){for(var e=["==","===","!=","!==","<",">","<=",">="],t=this.parseConcat(),n=[];;){var i=this.nextToken();if(!i)break;if(-1===e.indexOf(i.value)){this.pushToken(i);break}n.push(new o.CompareOperand(i.lineno,i.colno,this.parseConcat(),i.value))}return n.length?new o.Compare(n[0].lineno,n[0].colno,t,n):t},c.parseConcat=function(){for(var e=this.parseAdd();this.skipValue(r.TOKEN_TILDE,"~");){var t=this.parseAdd();e=new o.Concat(e.lineno,e.colno,e,t)}return e},c.parseAdd=function(){for(var e=this.parseSub();this.skipValue(r.TOKEN_OPERATOR,"+");){var t=this.parseSub();e=new o.Add(e.lineno,e.colno,e,t)}return e},c.parseSub=function(){for(var e=this.parseMul();this.skipValue(r.TOKEN_OPERATOR,"-");){var t=this.parseMul();e=new o.Sub(e.lineno,e.colno,e,t)}return e},c.parseMul=function(){for(var e=this.parseDiv();this.skipValue(r.TOKEN_OPERATOR,"*");){var t=this.parseDiv();e=new o.Mul(e.lineno,e.colno,e,t)}return e},c.parseDiv=function(){for(var e=this.parseFloorDiv();this.skipValue(r.TOKEN_OPERATOR,"/");){var t=this.parseFloorDiv();e=new o.Div(e.lineno,e.colno,e,t)}return e},c.parseFloorDiv=function(){for(var e=this.parseMod();this.skipValue(r.TOKEN_OPERATOR,"//");){var t=this.parseMod();e=new o.FloorDiv(e.lineno,e.colno,e,t)}return e},c.parseMod=function(){for(var e=this.parsePow();this.skipValue(r.TOKEN_OPERATOR,"%");){var t=this.parsePow();e=new o.Mod(e.lineno,e.colno,e,t)}return e},c.parsePow=function(){for(var e=this.parseUnary();this.skipValue(r.TOKEN_OPERATOR,"**");){var t=this.parseUnary();e=new o.Pow(e.lineno,e.colno,e,t)}return e},c.parseUnary=function(e){var t,n=this.peekToken();return t=this.skipValue(r.TOKEN_OPERATOR,"-")?new o.Neg(n.lineno,n.colno,this.parseUnary(!0)):this.skipValue(r.TOKEN_OPERATOR,"+")?new o.Pos(n.lineno,n.colno,this.parseUnary(!0)):this.parsePrimary(),e||(t=this.parseFilter(t)),t},c.parsePrimary=function(e){var t,n=this.nextToken(),i=null;if(n?n.type===r.TOKEN_STRING?t=n.value:n.type===r.TOKEN_INT?t=parseInt(n.value,10):n.type===r.TOKEN_FLOAT?t=parseFloat(n.value):n.type===r.TOKEN_BOOLEAN?"true"===n.value?t=!0:"false"===n.value?t=!1:this.fail("invalid boolean: "+n.value,n.lineno,n.colno):n.type===r.TOKEN_NONE?t=null:n.type===r.TOKEN_REGEX&&(t=new RegExp(n.value.body,n.value.flags)):this.fail("expected expression, got end of file"),void 0!==t?i=new o.Literal(n.lineno,n.colno,t):n.type===r.TOKEN_SYMBOL?i=new o.Symbol(n.lineno,n.colno,n.value):(this.pushToken(n),i=this.parseAggregate()),e||(i=this.parsePostfix(i)),i)return i;throw this.error("unexpected token: "+n.value,n.lineno,n.colno)},c.parseFilterName=function(){for(var e=this.expect(r.TOKEN_SYMBOL),t=e.value;this.skipValue(r.TOKEN_OPERATOR,".");)t+="."+this.expect(r.TOKEN_SYMBOL).value;return new o.Symbol(e.lineno,e.colno,t)},c.parseFilterArgs=function(e){return this.peekToken().type===r.TOKEN_LEFT_PAREN?this.parsePostfix(e).args.children:[]},c.parseFilter=function(e){for(;this.skip(r.TOKEN_PIPE);){var t=this.parseFilterName();e=new o.Filter(t.lineno,t.colno,t,new o.NodeList(t.lineno,t.colno,[e].concat(this.parseFilterArgs(e))))}return e},c.parseFilterStatement=function(){var e=this.peekToken();this.skipSymbol("filter")||this.fail("parseFilterStatement: expected filter");var t=this.parseFilterName(),n=this.parseFilterArgs(t);this.advanceAfterBlockEnd(e.value);var i=new o.Capture(t.lineno,t.colno,this.parseUntilBlocks("endfilter"));this.advanceAfterBlockEnd();var r=new o.Filter(t.lineno,t.colno,t,new o.NodeList(t.lineno,t.colno,[i].concat(n)));return new o.Output(t.lineno,t.colno,[r])},c.parseAggregate=function(){var e,t=this.nextToken();switch(t.type){case r.TOKEN_LEFT_PAREN:e=new o.Group(t.lineno,t.colno);break;case r.TOKEN_LEFT_BRACKET:e=new o.Array(t.lineno,t.colno);break;case r.TOKEN_LEFT_CURLY:e=new o.Dict(t.lineno,t.colno);break;default:return null}for(;;){var n=this.peekToken().type;if(n===r.TOKEN_RIGHT_PAREN||n===r.TOKEN_RIGHT_BRACKET||n===r.TOKEN_RIGHT_CURLY){this.nextToken();break}if(e.children.length>0&&(this.skip(r.TOKEN_COMMA)||this.fail("parseAggregate: expected comma after expression",t.lineno,t.colno)),e instanceof o.Dict){var i=this.parsePrimary();this.skip(r.TOKEN_COLON)||this.fail("parseAggregate: expected colon after dict key",t.lineno,t.colno);var s=this.parseExpression();e.addChild(new o.Pair(i.lineno,i.colno,i,s))}else{var a=this.parseExpression();e.addChild(a)}}return e},c.parseSignature=function(e,t){var n=this.peekToken();if(!t&&n.type!==r.TOKEN_LEFT_PAREN){if(e)return null;this.fail("expected arguments",n.lineno,n.colno)}n.type===r.TOKEN_LEFT_PAREN&&(n=this.nextToken());for(var i=new o.NodeList(n.lineno,n.colno),s=new o.KeywordArgs(n.lineno,n.colno),a=!1;;){if(n=this.peekToken(),!t&&n.type===r.TOKEN_RIGHT_PAREN){this.nextToken();break}if(t&&n.type===r.TOKEN_BLOCK_END)break;if(a&&!this.skip(r.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",n.lineno,n.colno);else{var c=this.parseExpression();this.skipValue(r.TOKEN_OPERATOR,"=")?s.addChild(new o.Pair(c.lineno,c.colno,c,this.parseExpression())):i.addChild(c)}a=!0}return s.children.length&&i.addChild(s),i},c.parseUntilBlocks=function(){for(var e=this.breakOnBlocks,t=arguments.length,n=new Array(t),i=0;i=","//","**"],R=M+this.current();switch(-1!==i.indexOf(P,R)&&(this.forward(),M=R,-1!==i.indexOf(P,R+this.current())&&(M=R+this.current(),this.forward())),M){case"(":j=f;break;case")":j=m;break;case"[":j=v;break;case"]":j=y;break;case"{":j=g;break;case"}":j=_;break;case",":j=C;break;case":":j=k;break;case"~":j=w;break;case"|":j=L;break;default:j=b}return S(j,M,t,n)}if((e=this._extractUntil(r+o)).match(/^[-+]?[0-9]+$/)){if("."===this.current()){this.forward();var F=this._extract("0123456789");return S(x,e+"."+F,t,n)}return S("int",e,t,n)}if(e.match(/^(true|false)$/))return S(A,e,t,n);if("none"===e)return S(E,e,t,n);if("null"===e)return S(E,e,t,n);if(e)return S(O,e,t,n);throw new Error("Unexpected value while parsing: "+e)}var D,B=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((e=this._extractString(this.tags.BLOCK_START+"-"))||(e=this._extractString(this.tags.BLOCK_START)))return this.in_code=!0,S(l,e,t,n);if((e=this._extractString(this.tags.VARIABLE_START+"-"))||(e=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,S(h,e,t,n);e="";var K=!1;for(this._matches(this.tags.COMMENT_START)&&(K=!0,e=this._extractString(this.tags.COMMENT_START));null!==(D=this._extractUntil(B));){if(e+=D,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!K){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=e.length){var U=e.slice(-this.colno);if(/^\s+$/.test(U)&&!(e=e.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!K)throw new Error("unexpected end of comment");e+=this._extractString(this.tags.COMMENT_END);break}e+=this.current(),this.forward()}if(null===D&&K)throw new Error("expected end of comment, got end of file");return S(K?d:c,e,t,n)},t._parseString=function(e){this.forward();for(var t="";!this.isFinished()&&this.current()!==e;){var n=this.current();if("\\"===n){switch(this.forward(),this.current()){case"n":t+="\n";break;case"t":t+="\t";break;case"r":t+="\r";break;default:t+=this.current()}this.forward()}else t+=n,this.forward()}return this.forward(),t},t._matches=function(e){return this.index+e.length>this.len?null:this.str.slice(this.index,this.index+e.length)===e},t._extractString=function(e){return this._matches(e)?(this.forwardN(e.length),e):null},t._extractUntil=function(e){return this._extractMatching(!0,e||"")},t._extract=function(e){return this._extractMatching(!1,e)},t._extractMatching=function(e,t){if(this.isFinished())return null;var n=t.indexOf(this.current());if(e&&-1===n||!e&&-1!==n){var i=this.current();this.forward();for(var r=t.indexOf(this.current());(e&&-1===r||!e&&-1!==r)&&!this.isFinished();)i+=this.current(),this.forward(),r=t.indexOf(this.current());return i}return""},t._extractRegex=function(e){var t=this.currentStr().match(e);return t?(this.forwardN(t[0].length),t):null},t.isFinished=function(){return this.index>=this.len},t.forwardN=function(e){for(var t=0;t1024){for(var t=0,n=r.length-o;t0&&s.length>r&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,a=c,console&&console.warn&&console.warn(a)}return e}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=p.bind(i);return r.listener=n,i.wrapFn=r,r}function f(e,t,n){var i=e._events;if(void 0===i)return[];var r=i[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=r[e];if(void 0===c)return!1;if("function"==typeof c)o(c,this,t);else{var l=c.length,u=v(c,l);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,r=o;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1=0;i--)this.removeListener(e,t[i]);return this},a.prototype.listeners=function(e){return f(this,e,!0)},a.prototype.rawListeners=function(e){return f(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},function(e,t,n){"use strict";var i=n(3),r=n(0),o=0;function s(){return"hole_"+o++}function a(e,t){for(var n=null,i=0;i=t)return e;var n=t-e.length,s=i.repeat(" ",n/2-n%2),a=i.repeat(" ",n/2);return r.copySafeness(e,s+e+a)},t.default=function(e,t,n){return n?e||t:void 0!==e?e:t},t.dictsort=function(e,t,n){if(!i.isObject(e))throw new i.TemplateError("dictsort filter: val must be an object");var r,o=[];for(var s in e)o.push([s,e[s]]);if(void 0===n||"key"===n)r=0;else{if("value"!==n)throw new i.TemplateError("dictsort filter: You can only sort by either key or value");r=1}return o.sort((function(e,n){var o=e[r],s=n[r];return t||(i.isString(o)&&(o=o.toUpperCase()),i.isString(s)&&(s=s.toUpperCase())),o>s?1:o===s?0:-1})),o},t.dump=function(e,t){return JSON.stringify(e,null,t)},t.escape=function(e){return e instanceof r.SafeString?e:(e=null==e?"":e,r.markSafe(i.escape(e.toString())))},t.safe=function(e){return e instanceof r.SafeString?e:(e=null==e?"":e,r.markSafe(e.toString()))},t.first=function(e){return e[0]},t.forceescape=function(e){return e=null==e?"":e,r.markSafe(i.escape(e.toString()))},t.groupby=function(e,t){return i.groupBy(e,t,this.env.opts.throwOnUndefined)},t.indent=function(e,t,n){if(""===(e=o(e,"")))return"";t=t||4;var s=e.split("\n"),a=i.repeat(" ",t),c=s.map((function(e,t){return 0!==t||n?""+a+e:e})).join("\n");return r.copySafeness(e,c)},t.join=function(e,t,n){return t=t||"",n&&(e=i.map(e,(function(e){return e[n]}))),e.join(t)},t.last=function(e){return e[e.length-1]},t.length=function(e){var t=o(e,"");return void 0!==t?"function"==typeof Map&&t instanceof Map||"function"==typeof Set&&t instanceof Set?t.size:!i.isObject(t)||t instanceof r.SafeString?t.length:i.keys(t).length:0},t.list=c,t.lower=function(e){return(e=o(e,"")).toLowerCase()},t.nl2br=function(e){return null==e?"":r.copySafeness(e,e.replace(/\r\n|\n/g,"
\n"))},t.random=function(e){return e[Math.floor(Math.random()*e.length)]},t.reject=l(!1),t.rejectattr=function(e,t){return e.filter((function(e){return!e[t]}))},t.select=l(!0),t.selectattr=function(e,t){return e.filter((function(e){return!!e[t]}))},t.replace=function(e,t,n,i){var o=e;if(t instanceof RegExp)return e.replace(t,n);void 0===i&&(i=-1);var s="";if("number"==typeof t)t=""+t;else if("string"!=typeof t)return e;if("number"==typeof e&&(e=""+e),"string"!=typeof e&&!(e instanceof r.SafeString))return e;if(""===t)return s=n+e.split("").join(n)+n,r.copySafeness(e,s);var a=e.indexOf(t);if(0===i||-1===a)return e;for(var c=0,l=0;a>-1&&(-1===i||l=r&&u.push(n),o.push(u)}return o},t.sum=function(e,t,n){return void 0===n&&(n=0),t&&(e=i.map(e,(function(e){return e[t]}))),n+e.reduce((function(e,t){return e+t}),0)},t.sort=r.makeMacro(["value","reverse","case_sensitive","attribute"],[],(function(e,t,n,r){var o=this,s=i.map(e,(function(e){return e})),a=i.getAttrGetter(r);return s.sort((function(e,s){var c=r?a(e):e,l=r?a(s):s;if(o.env.opts.throwOnUndefined&&r&&(void 0===c||void 0===l))throw new TypeError('sort: attribute "'+r+'" resolved to undefined');return!n&&i.isString(c)&&i.isString(l)&&(c=c.toLowerCase(),l=l.toLowerCase()),cl?t?-1:1:0})),s})),t.string=function(e){return r.copySafeness(e,e)},t.striptags=function(e,t){var n,i=u((e=o(e,"")).replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>|/gi,""));return n=t?i.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,"\n").replace(/\n\n\n+/g,"\n\n"):i.replace(/\s+/gi," "),r.copySafeness(e,n)},t.title=function(e){var t=(e=o(e,"")).split(" ").map((function(e){return a(e)}));return r.copySafeness(e,t.join(" "))},t.trim=u,t.truncate=function(e,t,n,i){var s=e;if(t=t||255,(e=o(e,"")).length<=t)return e;if(n)e=e.substring(0,t);else{var a=e.lastIndexOf(" ",t);-1===a&&(a=t),e=e.substring(0,a)}return e+=null!=i?i:"...",r.copySafeness(s,e)},t.upper=function(e){return(e=o(e,"")).toUpperCase()},t.urlencode=function(e){var t=encodeURIComponent;return i.isString(e)?t(e):(i.isArray(e)?e:i._entries(e)).map((function(e){var n=e[0],i=e[1];return t(n)+"="+t(i)})).join("&")};var h=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,p=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,d=/^https?:\/\/.*$/,f=/^www\./,m=/\.(?:org|net|com)(?:\:|\/|$)/;t.urlize=function(e,t,n){s(t)&&(t=1/0);var i=!0===n?' rel="nofollow"':"";return e.split(/(\s+)/).filter((function(e){return e&&e.length})).map((function(e){var n=e.match(h),r=n?n[1]:e,o=r.substr(0,t);return d.test(r)?'"+o+"":f.test(r)?'"+o+"":p.test(r)?''+r+"":m.test(r)?'"+o+"":e})).join("")},t.wordcount=function(e){var t=(e=o(e,""))?e.match(/\w+/g):null;return t?t.length:null},t.float=function(e,t){var n=parseFloat(e);return s(n)?t:n};var v=r.makeMacro(["value","default","base"],[],(function(e,t,n){void 0===n&&(n=10);var i=parseInt(e,n);return s(i)?t:i}));t.int=v,t.d=t.default,t.e=t.escape},function(e,t,n){"use strict";function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}var r=function(e){var t,n;function r(t){var n;return(n=e.call(this)||this).precompiled=t||{},n}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,i(t,n),r.prototype.getSource=function(e){return this.precompiled[e]?{src:{type:"code",obj:this.precompiled[e]},path:e}:null},r}(n(6));e.exports={PrecompiledLoader:r}},function(e,t,n){"use strict";var i=n(2).SafeString;t.callable=function(e){return"function"==typeof e},t.defined=function(e){return void 0!==e},t.divisibleby=function(e,t){return e%t==0},t.escaped=function(e){return e instanceof i},t.equalto=function(e,t){return e===t},t.eq=t.equalto,t.sameas=t.equalto,t.even=function(e){return e%2==0},t.falsy=function(e){return!e},t.ge=function(e,t){return e>=t},t.greaterthan=function(e,t){return e>t},t.gt=t.greaterthan,t.le=function(e,t){return e<=t},t.lessthan=function(e,t){return e0)for(var r=e;rt;o+=n)i.push(o);return i},cycler:function(){return e=Array.prototype.slice.call(arguments),t=-1,{current:null,reset:function(){t=-1,this.current=null},next:function(){return++t>=e.length&&(t=0),this.current=e[t],this.current}};var e,t},joiner:function(e){return function(e){e=e||",";var t=!0;return function(){var n=t?"":e;return t=!1,n}}(e)}}}},function(e,t,n){var i=n(4);e.exports=function(e,t){function n(e,t){if(this.name=e,this.path=e,this.defaultEngine=t.defaultEngine,this.ext=i.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 n.prototype.render=function(t,n){e.render(this.name,t,n)},t.set("view",n),t.set("nunjucksEnv",e),e}},function(e,t,n){"use strict";var i=n(4),r=n(4),o=n(0)._prettifyError,s=n(5),a=n(7).Environment,c=n(24);function l(e,t){return!!Array.isArray(t)&&t.some((function(t){return e.match(t)}))}function u(e,t){(t=t||{}).isString=!0;var n=t.env||new a([]),i=t.wrapper||c;if(!t.name)throw new Error('the "name" option is required when compiling a string');return i([h(e,t.name,n)],t)}function h(e,t,n){var i,r=(n=n||new a([])).asyncFilters,c=n.extensionsList;t=t.replace(/\\/g,"/");try{i=s.compile(e,r,c,t,n.opts)}catch(e){throw o(t,!1,e)}return{name:t,template:i}}e.exports={precompile:function(e,t){var n=(t=t||{}).env||new a([]),o=t.wrapper||c;if(t.isString)return u(e,t);var s=i.existsSync(e)&&i.statSync(e),p=[],d=[];if(s.isFile())p.push(h(i.readFileSync(e,"utf-8"),t.name||e,n));else if(s.isDirectory()){!function n(o){i.readdirSync(o).forEach((function(s){var a=r.join(o,s),c=a.substr(r.join(e,"/").length),u=i.statSync(a);u&&u.isDirectory()?l(c+="/",t.exclude)||n(a):l(c,t.include)&&d.push(a)}))}(e);for(var f=0;fe.length||r>0&&s>=i||r<0&&s<=i);s+=r)o.push(n.memberLookup(e,s));return o}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var f={pop:function(e){if(void 0===e)return this.pop();if(e>=this.length||e<0)throw new Error("KeyError");return this.splice(e,1)},append:function(e){return this.push(e)},remove:function(e){for(var t=0;t=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},r=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const o=n(4147),s=n(1814),a=n(5595),c=n(8921),l=n(6197),u=n(839),h=n(3320),p=n(7554);n(5984),n(5389),n(4448),n(8786),n(3857),n(5116),console.info(`%c ANDROID-TV-CARD v${o.version}`,"color: white; font-weight: bold; background: green");class d extends s.LitElement{constructor(){super(...arguments),this.defaultActions={},this.customActions={},this.icons={}}static get properties(){return{hass:{},config:{}}}static getStubConfig(){return{type:"custom:android-tv-card",rows:[]}}getCardSize(){let e=this.config.rows.length;return"title"in this.config&&(e+=1),e}setConfig(e){return r(this,void 0,void 0,(function*(){if(!e)throw new Error("Invalid configuration");e=structuredClone(e),e=Object.assign({theme:"default"},e),e=this.setToggles(e),e=this.updateDeprecatedKeys(e),this.defaultActions=Object.assign(Object.assign({},p.defaultSources),p.defaultKeys),this.customActions=e.custom_actions||{},this.icons=Object.assign(Object.assign({},p.svg),e.custom_icons),this.config=e}))}updateDeprecatedKeys(e){var t;if("adb_id"in e&&!("keyboard_id"in e)&&(e.keyboard_id=e.adb_id),"media_player_id"in e&&!("slider_id"in e)&&(e.slider_id=e.media_player_id),"touchpad_height"in e&&("touchpad_style"in e||(e.touchpad_style={}),"height"in e.touchpad_style||(e.touchpad_style.height=e.touchpad_height)),!("rows"in e)||!(e.rows||[]).length){const t=[],n=Object.keys(e).filter((e=>e.includes("_row")));for(const i of n){let n=e[i];"string"==typeof n&&(n=[n]),"volume_row"==i?n=["volume_"+n[0]]:"navigation_row"==i&&(n=["navigation_"+n[0]]),t.push(n)}e.rows=t}e.custom_actions=Object.assign(Object.assign(Object.assign({},e.custom_actions),e.custom_keys),e.custom_sources);const n=e.custom_actions;for(const e in n){const i=n[e];"svg_path"in i&&(i.icon=i.svg_path);const r=["key","source","service","service_data","data","target","navigation_path","navigation_replace","url_path","confirmation","pipeline_id","start_listening"],o=null!==(t=i.tap_action)&&void 0!==t?t:{};let s=!1;for(const e of r)e in i&&(s=!0,o[e]=i[e]);s&&(i.tap_action=o);const a=["tap_action","hold_action","double_tap_action"];for(const e of a)if(e in i){const t=i[e];["call-service","more-info"].includes(t.action)&&(t.data=Object.assign(Object.assign(Object.assign({},t.data),t.service_data),t.target)),"action"in t||(t.action="key"in t?"key":"source"in t?"source":"service"in t?"call-service":"navigation_path"in t?"navigate":"url_path"in t?"url":"pipeline_id"in t||"start_listening"in t?"assist":"none")}}return e}setToggles(e){const t={enable_button_feedback:!0,enable_touchpad_feedback:!0,enable_double_click:!1,enable_slider_feedback:!0};let n;for(n in t)n in e||(e[n]=t[n]);return e}getActions(e){var t;const n=this.defaultActions[e]||{},i=this.customActions[e]||n;if(!Object.keys(i).length)return"slider"==e?{tap_action:{action:"call-service",service:"media_player.volume_set",data:{entity_id:this.config.slider_id,volume_level:"VALUE"}}}:{};(null==i?void 0:i.icon)||(i.icon=null!==(t=null==n?void 0:n.icon)&&void 0!==t?t:void 0);const r=["tap_action","hold_action","double_tap_action"];for(const e of r)!(e in i)&&e in n&&(i[e]=n[e]);return i}buildRow(e){return s.html`
${e}
`}buildColumn(e){return s.html`
${e}
`}buildButton(e){const t=this.getActions(e),n=Object.assign(Object.assign({},this.config.button_style),t.style);return Object.keys(t).length?s.html`