/*! For license information please see index.js.LICENSE.txt */ (()=>{var e={9078:(e,t,n)=>{"use strict";var r=n(159),a=n(983);function o(e){if(!(this instanceof o))return new o(e);this.headers=e.headers,this.negotiator=new r(e)}function i(e){return-1===e.indexOf("/")?a.lookup(e):e}function s(e){return"string"==typeof e}e.exports=o,o.prototype.type=o.prototype.types=function(e){var t=e;if(t&&!Array.isArray(t)){t=new Array(arguments.length);for(var n=0;n{"use strict";function t(e,n,r){for(var a=0;a0&&Array.isArray(o)?t(o,n,r-1):n.push(o)}return n}function n(e,t){for(var r=0;r{"use strict";n.r(t),n.d(t,{default:()=>Io}),n(5666),n(2222),n(1539),n(8674);var r=n(7846),a=n.n(r),o=n(9268),i=n.n(o),s=n(9383),c=(n(5827),n(9753),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948),n(7042),n(8309),n(1038),n(4916),n(800)),u=n(6363),p=n(4151);function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function d(e,t,n,r,a,o,i){try{var s=e[o](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,a)}function f(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){d(o,r,a,i,s,"next",e)}function s(e){d(o,r,a,i,s,"throw",e)}i(void 0)}))}}const m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.beforeRespond;return function(){var t=f(regeneratorRuntime.mark((function t(r,a){var o,i,s,d;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((0,p.HZ)("Calling CLI script to get data."),o={},t.prev=2,"function"!=typeof e){t.next=9;break}return t.next=6,e(r,o);case 6:t.t0=t.sent,t.next=10;break;case 9:t.t0=e;case 10:return s=t.t0,t.next=13,(0,c.IO)(s);case 13:i=t.sent,t.next=20;break;case 16:return t.prev=16,t.t1=t.catch(2),(0,p.G7)("Failed to execute query; CAUSE: ".concat(t.t1)),t.abrupt("return",a.status(500).send());case 20:(0,p.ry)(i,"Query stdout pre-hooks (type=[".concat(l(i),"]): ")),d=o.afterQueryReturn,i=(0,u.Z)(d,{parameters:[i],notCallableReturn:i}),i=(0,u.Z)(n,{parameters:[i],notCallableReturn:i}),(0,p.ry)(i,"Query stdout post-hooks (type=[".concat(l(i),"]): ")),a.json(i);case 26:case"end":return t.stop()}}),t,null,[[2,16]])})));return function(e,n){return t.apply(this,arguments)}}()};n(6699),n(2479),n(9653);const v=(e,t,n)=>Math.max(t,Math.min(e,n)),h={"b-B":8n,"b-kB":8000n,"b-MB":8000000n,"b-GB":8000000000n,"b-TB":8000000000000n,"b-PB":8000000000000000n,"b-EB":8000000000000000000n,"b-ZB":8000000000000000000000n,"b-YB":8000000000000000000000000n,"b-KiB":8192n,"b-MiB":8388608n,"b-GiB":8589934592n,"b-TiB":8796093022208n,"b-PiB":9007199254740992n,"b-EiB":9223372036854775808n,"b-ZiB":9444732965739290427392n,"b-YiB":9671406556917033397649408n,"b-b":1n,"b-kbit":1000n,"b-Mbit":1000000n,"b-Gbit":1000000000n,"b-Tbit":1000000000000n,"b-Pbit":1000000000000000n,"b-Ebit":1000000000000000000n,"b-Zbit":1000000000000000000000n,"b-Ybit":1000000000000000000000000n,"b-Kibit":1024n,"b-Mibit":1048576n,"b-Gibit":1073741824n,"b-Tibit":1099511627776n,"b-Pibit":1125899906842624n,"b-Eibit":1152921504606846976n,"b-Zibit":1180591620717411303424n,"b-Yibit":1208925819614629174706176n},b=["byte","ibyte","bit","ibit"],g=["B","kB","MB","GB","TB","PB","EB","ZB","YB","B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB","b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit","b","Kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],y=e=>BigInt(10**e),x=({precision:e,value:t},n,{isReverse:r}={})=>{if("b"===n)return{precision:e,value:t};const a=h[`b-${n}`];if(r)return{precision:e,value:t*a};const o=String(a).length;return{precision:e+o,value:t*y(o)/a}},w=(e,{fromUnit:t="B",locale:n,precision:r,toUnit:a}={})=>{let o;try{o=k(e)}catch(e){return}const{max:i,min:s}=E(r),{unit:c}=S(t,"B");o=x(o,c,{isReverse:!0});const u=A(o,c,{toUnit:a});o=x(o,u),o=_(o,{toPrecision:v(o.precision,s,i)}),o=O(o,s);const p=(({precision:e,value:t},{bigintFormatOptions:n,numberFormatOptions:r,locale:a}={})=>{const o=y(e),i=t/o,s=t%o;let[c,u]="0.",p=i.toString(),l=s.toString();if(a){const e="string"==typeof a?a:void 0;[c,u]=.1.toLocaleString(e,r),p=i.toLocaleString(e,n),l=s.toLocaleString(e,{...n,useGrouping:!1})}let d=p;return e>0&&(d+=`${u}${l.padStart(e,c)}`),d})(o,{locale:n});return{value:p,unit:u}},_=({precision:e,value:t},{toPrecision:n=0}={})=>{const r={precision:n,value:t};if(n>e)r.value*=y(n-e);else if(n4&&(r.value+=1n)}return r},S=(e,t,n=g)=>{const r=n.indexOf(e);return r<0?{unit:t,unitIndex:0}:{unit:n[r],unitIndex:r}},k=e=>{var t,n;const r=String(e).split(/\D/,2),a=null!==(t=null===(n=r[1])||void 0===n?void 0:n.length)&&void 0!==t?t:0,o=r.join("");if(0===o.length)throw Error("Value is blank.");return{value:BigInt(o),precision:a}},E=(e={})=>{var t,n;return"number"==typeof e?{max:e,min:e}:{max:null!==(t=e.max)&&void 0!==t?t:2,min:null!==(n=e.min)&&void 0!==n?n:0}},A=({precision:e,value:t},n,{conversionTable:r=h,toUnit:a,units:o=g,unitSections:i=b,unitSectionLength:s=9}={})=>{const c=o.indexOf(a);return c>=0?o[c]:((e,t,n,r,a,o,i)=>{let s=o.indexOf(n),c=t;s<0&&(s=((e,t)=>{const n=`${"i"===e[1]?"i":""}${/B$/.test(e)?"byte":"bit"}`,r=t.findIndex((e=>e===n));return{section:n,index:r}})(t,o).index);let u=s*i;const p=u+i;for(;u=r[`b-${t}`]?c=t:u=p}return c})(t/y(e),n,a,r,o,i,s)},O=({precision:e,value:t},n)=>{const r={precision:e,value:t},a=e-n;let o=!0;for(let e=1;o&&e<=a;e+=1)0n===r.value%10n?(r.value/=10n,r.precision-=1):o=!1;return r};var j=n(2243);const C=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.beforeReturn,r=t.elementWrapper,a=void 0===r?"":r,o=t.onEach,i=t.separator,s=void 0===i?"":i,c="".concat(a).concat(s).concat(a),p=e instanceof Array&&e.length>0?"".concat(a).concat(e.slice(1).reduce((function(e,t){return"".concat(e).concat(c).concat((0,u.Z)(o,{notCallableReturn:t,parameters:[t]}))}),e[0])).concat(a):void 0;return(0,u.Z)(n,{notCallableReturn:p,parameters:[p]})};function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},t=e.isSummary,n=void 0!==t&&t,r="\n host_uuid,\n host_name,\n scan_hardware_cpu_cores,\n scan_hardware_ram_total",a="";return n&&(r="\n MIN(scan_hardware_cpu_cores) AS anvil_total_cpu_cores,\n MIN(scan_hardware_ram_total) AS anvil_total_memory",a="GROUP BY anvil_uuid"),"\n SELECT\n anvil_uuid,\n ".concat(r,"\n FROM anvils AS anv\n JOIN hosts AS hos\n ON host_uuid IN (\n anvil_node1_host_uuid,\n anvil_node2_host_uuid,\n anvil_dr1_host_uuid\n )\n JOIN scan_hardware AS sca_har\n ON host_uuid = scan_hardware_host_uuid\n ").concat(a)},i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.isSummary,n=void 0!==t&&t,r="\n server_uuid,\n server_name,\n server_cpu_cores,\n server_memory_value,\n server_memory_unit",a="";return n&&(r="SUM(server_cpu_cores) AS anvil_total_allocated_cpu_cores",a="GROUP BY server_anvil_uuid"),"\n SELECT\n server_anvil_uuid,\n ".concat(r,"\n FROM servers AS ser\n JOIN (\n SELECT\n server_definition_server_uuid,\n CAST(\n SUBSTRING(\n server_definition_xml, 'cores=''([\\d]*)'''\n ) AS INTEGER\n ) AS server_cpu_cores,\n CAST(\n SUBSTRING(\n server_definition_xml, 'memory.*>([\\d]*)e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:2;return"message_022".concat(e)},Z=function(){var e,t=(e=regeneratorRuntime.mark((function e(t){var n,r,a,o,i,s,u,l,d,f,m,v;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.anvils,r=t.anvilUuid,a=t.hosts,o=n.anvil_uuid[r]){e.next=4;break}throw new Error("Anvil information not found with UUID ".concat(r));case 4:return i=o.anvil_name,s=o.anvil_node1_host_uuid,u=o.anvil_node2_host_uuid,l={anvil_name:i,anvil_state:"optimal",anvil_uuid:r,hosts:[]},e.prev=6,e.next=9,(0,c.IO)("SELECT\n COUNT(a.server_name),\n b.host_uuid\n FROM servers AS a\n JOIN hosts AS b\n ON a.server_host_uuid = b.host_uuid\n JOIN anvils AS c\n ON b.host_uuid IN (\n c.anvil_node1_host_uuid,\n c.anvil_node2_host_uuid\n )\n WHERE c.anvil_uuid = '".concat(r,"'\n AND a.server_state = 'running'\n GROUP BY b.host_uuid, b.host_name\n ORDER BY b.host_name;"));case 9:d=e.sent,e.next=16;break;case 12:throw e.prev=12,e.t0=e.catch(6),(0,p.G7)("Failed to get subnodes' server count; CAUSE: ".concat(e.t0)),e.t0;case 16:f=regeneratorRuntime.mark((function e(){var t,n,r,o,i,s,u,f,h,b,g,y,x,w,_;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=v[m],n=a.host_uuid[t],r=n.host_status,o=n.short_host_name,i=l.hosts,s=d.find((function(e){return 2===e.length&&e[1]===t})),u=s?s[0]:0,f={host_name:o,host_uuid:t,maintenance_mode:!1,server_count:u,state:"offline",state_message:W(),state_percent:0},i.push(f),"online"===r){e.next=9;break}return e.abrupt("return","continue");case 9:return h=void 0,e.prev=10,e.next=13,(0,c.IO)("SELECT\n scan_cluster_node_in_ccm,\n scan_cluster_node_crmd_member,\n scan_cluster_node_cluster_member,\n scan_cluster_node_maintenance_mode\n FROM\n scan_cluster_nodes\n WHERE\n scan_cluster_node_host_uuid = '".concat(t,"';"));case 13:h=e.sent,B().ok(h.length,"No node cluster info"),e.next=21;break;case 17:return e.prev=17,e.t0=e.catch(10),(0,p.G7)("Failed to get node ".concat(t," cluster status; CAUSE: ").concat(e.t0)),e.abrupt("return","continue");case 21:b=z(h,1),g=z(b[0],4),y=g[0],x=g[1],w=g[2],_=g[3],f.maintenance_mode=Boolean(_),w?(f.state="online",f.state_message=W(3),f.state_percent=100):x?(f.state="crmd",f.state_message=W(4),f.state_percent=75):y?(f.state="in_ccm",f.state_message=W(5),f.state_percent=50):(f.state="booted",f.state_message=W(6),f.state_percent=25);case 24:case"end":return e.stop()}}),e,null,[[10,17]])})),m=0,v=[s,u];case 18:if(!(me.length)&&(t=e.length);for(var n=0,r=new Array(t);n([\\d]*)0&&(u=String(s.reduce((function(e,t){var n,r,a=K(t,2),o=a[0],i=a[1],s=null!==(n=null===(r=w(o,{fromUnit:i,toUnit:"B"}))||void 0===r?void 0:r.value)&&void 0!==n?n:"0";return e+BigInt(s)}),BigInt(0)))),e.abrupt("return",n.status(200).send({allocated:u,hosts:i,reserved:String(j.Su),total:o}));case 28:case"end":return e.stop()}}),e,null,[[1,7],[15,21]])})),function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){Y(o,r,a,i,s,"next",e)}function s(e){Y(o,r,a,i,s,"throw",e)}i(void 0)}))});return function(e,n){return t.apply(this,arguments)}}();function ee(e,t,n,r,a,o,i){try{var s=e[o](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,a)}function te(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ne(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nt?1:-1},oe=function(e){var t=Object.entries(e).sort((function(e,t){var n=te(e,2),r=n[0],a=n[1].type,o=te(t,2),i=o[0],s="bond"===a,c="bond"===o[1].type;return s&&c?ae(r,i):s?-1:c?1:ae(r,i)})).reduce((function(e,t){var n=te(t,2),r=n[0],a=n[1],o=a.type;if("bond"===o){var i=a,s=i.active_interface,c=i.uuid;e[c]={active_interface:s,bond_name:r,bond_uuid:c,links:[]}}else if("interface"===o){var u=a,p=u.bond_uuid,l=u.operational,d=u.speed,f=u.uuid;if(!j.Qt.test(p))return e;var m=e[p],v=m.active_interface,h=m.links,b="up"===l?"optimal":"down";h.forEach((function(e){var t=e.link_speed,n=e.link_state;td&&(b=re(b))})),h.push({is_active:r===v,link_name:r,link_speed:d,link_state:b,link_uuid:f})}return e}),{});return Object.values(t)},ie=function(){var e,t=(e=regeneratorRuntime.mark((function e(t,n){var r,a,o,i,s,u,l,d,f,m,v,h,b,g,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.params.anvilUuid,a=(0,T.N)(r,"string",{modifierType:"sql"}),e.prev=2,B()(j.Qt.test(a),"Param UUID must be a valid UUIDv4; got [".concat(a,"]")),e.next=10;break;case 6:return e.prev=6,e.t0=e.catch(2),(0,p.G7)("Failed to assert value during get anvil network; CAUSE: ".concat(e.t0)),e.abrupt("return",n.status(400).send());case 10:return e.prev=10,e.next=13,(0,c.nP)();case 13:return o=e.sent,e.next=16,(0,c.zM)();case 16:i=e.sent,e.next=23;break;case 19:return e.prev=19,e.t1=e.catch(10),(0,p.G7)("Failed to get anvil and host data; CAUSE: ".concat(e.t1)),e.abrupt("return",n.status(500).send());case 23:s=o.anvil_uuid[a],u=s.anvil_node1_host_uuid,l=s.anvil_node2_host_uuid,d={hosts:[]},f=0,m=[u,l];case 26:if(!(fe.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(m.badSSHKeys=v.reduce((function(e,t){var n,r,a=(n=t,r=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw a}}return o}}(n,r)||function(e,t){if(e){if("string"==typeof e)return ge(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ge(e,t):void 0}}(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1];return e[f].push(a),e}),(g=[],(b=f)in(h={})?Object.defineProperty(h,b,{value:g,enumerable:!0,configurable:!0,writable:!0}):h[b]=g,h)));case 32:n.status(200).send(m);case 33:case"end":return e.stop()}var h,b,g}),e,null,[[6,12],[17,23]])})),function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){ye(o,r,a,i,s,"next",e)}function s(e){ye(o,r,a,i,s,"throw",e)}i(void 0)}))});return function(e,n){return t.apply(this,arguments)}}();function we(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _e(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==i[1]?i[1]:{}).isActiveMember){e.next=3;break}return e.abrupt("return",void 0);case 3:return e.next=5,(0,c.IO)("SELECT\n CASE\n WHEN host_status = 'online'\n THEN CAST('1' AS BOOLEAN)\n ELSE CAST('0' AS BOOLEAN)\n END\n FROM hosts WHERE host_uuid = '".concat(t,"';"));case 5:return n=e.sent,B().ok(n.length,"No entry found"),r=ke(n,1),a=ke(r[0],1),o=a[0],e.abrupt("return",o?{job_command:j.us.usr.sbin["anvil-safe-start"].self,job_description:"job_0337",job_host_uuid:t,job_name:"set_membership::join",job_title:"job_0336"}:void 0);case 9:case"end":return e.stop()}}),e)}))),function(e){return Ce.apply(this,arguments)}),leave:(je=Oe(regeneratorRuntime.mark((function e(t){var n,r,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},r=n.isActiveMember,e.abrupt("return",r?{job_command:j.us.usr.sbin["anvil-safe-stop"].self,job_description:"job_0339",job_host_uuid:t,job_name:"set_membership::leave",job_title:"job_0338"}:void 0);case 2:case"end":return e.stop()}}),e)}))),function(e){return je.apply(this,arguments)})},Ie=function(e){return function(){var t=Oe(regeneratorRuntime.mark((function t(n,r){var a,o,i,s,u;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=n.params.uuid,o=(0,T.N)(a,"string",{modifierType:"sql"}),t.prev=2,B()(j.Qt.test(o),"Param UUID must be a valid UUIDv4; got: [".concat(o,"]")),t.next=10;break;case 6:return t.prev=6,t.t0=t.catch(2),(0,p.G7)("Failed to assert value when changing host membership; CAUSE: ".concat(t.t0)),t.abrupt("return",r.status(500).send());case 10:return t.prev=10,t.next=13,(0,c.IO)("SELECT\n scan_cluster_node_in_ccm,\n scan_cluster_node_crmd_member,\n scan_cluster_node_cluster_member\n FROM scan_cluster_nodes\n WHERE scan_cluster_node_host_uuid = '".concat(o,"';"));case 13:i=t.sent,B().ok(i.length,"No entry found"),t.next=21;break;case 17:return t.prev=17,t.t1=t.catch(10),(0,p.G7)("Failed to get cluster status of host ".concat(o,"; CAUSE: ").concat(t.t1)),t.abrupt("return",r.status(500).send());case 21:return s=i[0].every((function(e){return Boolean(e)})),t.prev=22,t.next=25,Re[e](o,{isActiveMember:s});case 25:if(!(u=t.sent)){t.next=29;break}return t.next=29,(0,c.ZP)(_e({file:__filename},u));case 29:t.next=35;break;case 31:return t.prev=31,t.t2=t.catch(22),(0,p.G7)("Failed to initiate ".concat(e," cluster for host ").concat(o,"; CAUSE: ").concat(t.t2)),t.abrupt("return",r.status(500).send());case 35:return t.abrupt("return",r.status(204).send());case 36:case"end":return t.stop()}}),t,null,[[2,6],[10,17],[22,31]])})));return function(e,n){return t.apply(this,arguments)}}()},Te=Ie("join"),Pe=Ie("leave");function Ne(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ue(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function Ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},t=e.uuid;return{job_command:"".concat(j.us.usr.sbin["striker-boot-machine"].self," --host-uuid '").concat(t,"'"),job_description:"job_0335",job_name:"set_power::on",job_title:"job_0334"}},startserver:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.uuid;return{job_command:"".concat(j.us.usr.sbin["anvil-boot-server"].self," --server-uuid '").concat(t,"'"),job_description:"job_0341",job_name:"set_power::server::on",job_title:"job_0340"}},stop:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.isStopServers,n=e.uuid;return{job_command:"".concat(j.us.usr.sbin["anvil-safe-stop"].self," --power-off").concat(t?" --stop-servers":""),job_description:"job_0333",job_host_uuid:n,job_name:"set_power::off",job_title:"job_0332"}},stopserver:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.force,n=e.uuid;return{job_command:"".concat(j.us.usr.sbin["anvil-shutdown-server"].self," --server-uuid '").concat(n,"'").concat(t?" --immediate":""),job_description:"job_0343",job_name:"set_power::server::off",job_title:"job_0342"}}},Be=function(){var e=He(regeneratorRuntime.mark((function e(t,n){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Le({file:__filename},qe[t](n)),e.next=3,(0,c.ZP)(r);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),ze=function(e){return function(){var t=He(regeneratorRuntime.mark((function t(n,r){var a,o,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=n.params.uuid,o=n.query.force,i=(0,T.N)(o,"boolean"),t.prev=2,a&&B()(j.Qt.test(a),"Param UUID must be a valid UUIDv4; got [".concat(a,"]")),t.next=10;break;case 6:return t.prev=6,t.t0=t.catch(2),(0,p.G7)("Failed to ".concat(e,"; CAUSE: ").concat(t.t0)),t.abrupt("return",r.status(400).send());case 10:return t.prev=10,t.next=13,Be(e,{force:i,uuid:a});case 13:t.next=19;break;case 15:return t.prev=15,t.t1=t.catch(10),(0,p.G7)("Failed to ".concat(e," ").concat(null!=a?a:j.Fe,"; CAUSE: ").concat(t.t1)),t.abrupt("return",r.status(500).send());case 19:r.status(204).send();case 20:case"end":return t.stop()}}),t,null,[[2,6],[10,15]])})));return function(e,n){return t.apply(this,arguments)}}()},$e=function(e){return function(){var t=He(regeneratorRuntime.mark((function t(n,r){var a,o,i,s,u,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=n.params.uuid,o=(0,T.N)(a,"string",{modifierType:"sql"}),t.prev=2,B()(j.Qt.test(o),"Param UUID must be a valid UUIDv4; got: [".concat(o,"]")),t.next=10;break;case 6:return t.prev=6,t.t0=t.catch(2),(0,p.G7)("Failed to assert value during power operation on anvil subnode"),t.abrupt("return",r.status(400).send());case 10:return t.prev=10,t.next=13,(0,c.IO)("SELECT anvil_node1_host_uuid, anvil_node2_host_uuid\n FROM anvils WHERE anvil_uuid = '".concat(o,"';"));case 13:i=t.sent,B().ok(i.length,"No entry found"),t.next=21;break;case 17:return t.prev=17,t.t1=t.catch(10),(0,p.G7)("Failed to get anvil subnodes' UUID; CAUSE: ".concat(t.t1)),t.abrupt("return",r.status(500).send());case 21:s=Ne(i[0]),t.prev=22,s.s();case 24:if((u=s.n()).done){t.next=37;break}return l=u.value,t.prev=26,t.next=29,Be(e,{isStopServers:!0,uuid:l});case 29:t.next=35;break;case 31:return t.prev=31,t.t2=t.catch(26),(0,p.G7)("Failed to ".concat(e," host ").concat(l,"; CAUSE: ").concat(t.t2)),t.abrupt("return",r.status(500).send());case 35:t.next=24;break;case 37:t.next=42;break;case 39:t.prev=39,t.t3=t.catch(22),s.e(t.t3);case 42:return t.prev=42,s.f(),t.finish(42);case 45:return t.abrupt("return",r.status(204).send());case 46:case"end":return t.stop()}}),t,null,[[2,6],[10,17],[22,39,42,45],[26,31]])})));return function(e,n){return t.apply(this,arguments)}}()},Ge=ze("poweroff"),We=ze("reboot"),Ze=(n(5212),n(9831)),Ve=n(5230);function Qe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function Zt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,dn);return hn(function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:2;return t.reduce((function(t,r,a){if(r){var o=r.networkInterfaceMACAddress,i=a+1;t[gn(n,"".concat(e,"_link").concat(i,"_mac_to_set"))]={step:n,value:o}}return t}),{})};function xn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return wn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wn(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=t.netconfStep,r=void 0===n?2:n,a=t.netcountStep,o=void 0===a?1:a,i=e.reduce((function(e,t){var n,a=t.createBridge,o=t.interfaces,i=t.ipAddress,s=t.subnetMask,c=t.type,u=e.counters;u[c]=u[c]?u[c]+1:1;var p="".concat(c).concat(u[c]);return e.data=Sn(Sn({},e.data),{},(kn(n={},gn(r,"".concat(p,"_ip")),{step:r,value:i}),kn(n,gn(r,"".concat(p,"_subnet_mask")),{step:r,value:s}),n),yn(p,o)),a&&(e.data[gn(r,"".concat(p,"_create_bridge"))]={step:r,value:a}),e}),{counters:{},data:{}}),s=i.counters,c=i.data;return Object.entries(s).forEach((function(e){var t=xn(e,2),n=t[0],r=t[1];c[gn(o,"".concat(n,"_count"))]={value:r}})),c};function An(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0,"Data host number can only contain digits; got [".concat(_,"]")),B()(j.ah.test(S),"Data network DNS must be a comma separated list of valid IPv4 addresses; got [".concat(S,"]")),B()(j.tf.test(k),"Data network gateway must be a valid IPv4 address; got [".concat(k,"]")),B()(j.OU.test(E),"Data gateway interface must be a peaceful string; got [".concat(E,"]")),B()(A.length>0,"Data organization name cannot be empty; got [".concat(A,"]")),B()(/^[a-z0-9]{1,5}$/.test(O),"Data organization prefix can only contain 1 to 5 lowercase alphanumeric characters; got [".concat(O,"]")),e.next=28;break;case 24:return e.prev=24,e.t0=e.catch(12),(0,p.G7)("Failed to assert value when trying to initialize striker; CAUSE: ".concat(e.t0,".")),e.abrupt("return",n.status(400).send());case 28:C=jn((Cn(r={},gn(1,"domain"),{value:x}),Cn(r,gn(1,"organization"),{value:A}),Cn(r,gn(1,"prefix"),{value:O}),Cn(r,gn(1,"sequence"),{value:_}),Cn(r,gn(2,"dns"),{step:2,value:S}),Cn(r,gn(2,"gateway"),{step:2,value:k}),Cn(r,gn(2,"gateway_interface"),{step:2,value:E}),Cn(r,gn(2,"host_name"),{step:2,value:w}),Cn(r,gn(2,"striker_password"),{step:2,value:y}),Cn(r,gn(2,"striker_user"),{step:2,value:"admin"}),r),En(h)),(0,p.ry)(C,"Config data before initiating striker config: "),R=Object.entries(C),e.prev=31,I=(0,c.gA)(),P=0,N=R;case 34:if(!(Pe.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function Dn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{},r=n.onFallback,a=n.beforeReturn,o=void 0===a?function(e){return e?"".concat(t," IN (").concat(e,")"):(0,u.Z)(r,{notCallableReturn:""})}:a;return C(e,{beforeReturn:o,elementWrapper:"'",separator:", "})},Hn=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.onFallback,a=(0,T.N)(e,"string[]",{modifierType:"sql"}),o=Fn(a,t,{onFallback:r});return{after:o,before:a}},qn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=arguments.length>1?arguments[1]:void 0;return e instanceof Array&&!e.some((function(e){return["all","*"].includes(e)}))?Fn(e,t):""},Bn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.locales;return"".concat(e[0].toLocaleUpperCase(n)).concat(e.slice(1))},zn=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{},a=t[0],o=t.length;if(!a)return n;var i=1,s=r[a];return r[a]=i0&&void 0!==arguments[0]?arguments[0]:{},t=e.keys,n=void 0===t?"*":t,r=qn(n,"WHERE a.host_uuid");(0,p.HZ)("condHostUUIDs=[".concat(r,"]"));var a="\n SELECT\n a.host_name,\n a.host_type,\n a.host_uuid,\n b.variable_name,\n b.variable_value,\n SUBSTRING(\n b.variable_name, '".concat(Xn,"([^:]+)'\n ) as cvar_name,\n SUBSTRING(\n b.variable_name, '").concat(Xn,"([a-z]{2,3})\\d+'\n ) AS network_type,\n SUBSTRING(\n b.variable_name, '").concat(Xn,"[a-z]{2,3}\\d+_(link\\d+)'\n ) AS network_link,\n c.network_interface_uuid\n FROM hosts AS a\n LEFT JOIN variables AS b\n ON b.variable_source_uuid = a.host_uuid\n AND (\n b.variable_name LIKE '").concat(Yn,"%'\n OR b.variable_name = 'install-target::enabled'\n )\n LEFT JOIN network_interfaces AS c\n ON b.variable_name LIKE '%link%_mac%'\n AND b.variable_value = c.network_interface_mac_address\n AND a.host_uuid = c.network_interface_host_uuid\n ").concat(r,"\n ORDER BY a.host_name ASC,\n cvar_name ASC,\n b.variable_name ASC;"),o=Ot((function(e){if(0===e.length)return{};var t=Zn(e[0],3),n=t[0],r=t[1],a=t[2],o=D(n);return e.reduce((function(e,t){var n=Zn(t,9),r=n[3],a=n[4],o=n[6],i=n[7],s=n[8];if(!r)return e;var c=Gn(r.split("::")),u=c[0],p=c.slice(1),l=er[u](p);return tr(l,a,e),i?(l[l.length-1]="".concat(i,"Uuid"),tr(l,s,e)):o&&(l[l.length-1]="type",tr(l,o,e)),e}),{hostName:n,hostType:r,hostUUID:a,shortHostName:o})}));return{query:a,afterQueryReturn:o}};function rr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(s+="WHERE ".concat(i));var u="\n SELECT\n hos.host_name,\n hos.host_type,\n hos.host_uuid\n FROM hosts AS hos\n ".concat(s,"\n ORDER BY hos.host_name ASC;"),p=jt((function(e,t){var n,r,a=(r=3,function(e){if(Array.isArray(e))return e}(n=t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw a}}return o}}(n,r)||function(e,t){if(e){if("string"==typeof e)return rr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rr(e,t):void 0}}(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=a[0],s=a[1],c=a[2];return e[(0,Ye.s)(c,o)]={hostName:i,hostType:s,hostUUID:c,shortHostName:D(i)},e}),{});if(r){var l=nr({keys:(0,T.N)(r,"string[]",{modifierType:"sql"})});u=l.query,p=l.afterQueryReturn}return t&&(t.afterQueryReturn=p),u})),or=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=r.fallbackResult,o=void 0===a?[]:a;return null!==(n=e.match(t))&&void 0!==n?n:o};function ir(e,t,n,r,a,o,i){try{var s=e[o](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,a)}function sr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return cr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cr(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{},r=n.defaultPort,a=void 0===r?5432:r,o=n.defaultUser,i=void 0===o?"admin":o;return Object.entries(t).reduce((function(t,n){var r=sr(n,2),a=r[0],o=r[1],i=o.host,s=o.ping,c=o.port,u=o.user,p=Number(c);return a===e?(t.inbound.port=p,t.inbound.user=u):t.peer[i]={hostUUID:a,ipAddress:i,isPing:"1"===s,port:p,user:u},t}),{inbound:{ipAddress:{},port:a,user:i},peer:{}})},pr=m(function(){var e=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){ir(o,r,a,i,s,"next",e)}function s(e){ir(o,r,a,i,s,"throw",e)}i(void 0)}))}}(regeneratorRuntime.mark((function e(t,n){var r,a,o,i,s,u,l,d,f,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.query.hostUUIDs,o="ip_add.ip_address_host_uuid",i=(0,c.gA)(),s=Hn(r,o,{onFallback:function(){return"".concat(o," = '").concat(i,"'")}}),u=s.after,l=s.before,d=l.length>0?l:[i],f=function(e){return(0,Ye.s)(e,i)},(0,p.HZ)("condHostUUIDs=[".concat(u,"]")),e.prev=7,e.next=10,(0,c.pT)();case 10:a=e.sent,e.next=16;break;case 13:throw e.prev=13,e.t0=e.catch(7),new Error("Failed to get anvil data; CAUSE: ".concat(e.t0));case 16:return m=d.reduce((function(e,t){return e[f(t)]=ur(t,a),e}),{}),(0,p.HZ)("connections=[".concat(JSON.stringify(m,null,2),"]")),n&&(n.afterQueryReturn=function(e){var t=e;return e instanceof Array&&(e.forEach((function(e){var t=sr(e,4),n=t[0],r=t[1],a=t[2],o=t[3],i=sr(or(o,/^([^\s]+)(\d+)_[^\s]+(\d+)$/),4),s=i[1],c=i[2],u=i[3],p=f(r);m[p].inbound.ipAddress[a]={hostUUID:r,ipAddress:a,ipAddressUUID:n,networkLinkNumber:Number(u),networkNumber:Number(c),networkType:s}})),t=m),t}),e.abrupt("return","SELECT\n ip_add.ip_address_uuid,\n ip_add.ip_address_host_uuid,\n ip_add.ip_address_address,\n CASE\n WHEN ip_add.ip_address_on_type = 'interface'\n THEN net_int.network_interface_name\n ELSE bon.bond_active_interface\n END AS network_name\n FROM ip_addresses AS ip_add\n LEFT JOIN network_interfaces AS net_int\n ON ip_add.ip_address_on_uuid = net_int.network_interface_uuid\n LEFT JOIN bridges AS bri\n ON ip_add.ip_address_on_uuid = bri.bridge_uuid\n LEFT JOIN bonds AS bon\n ON bri.bridge_uuid = bon.bond_bridge_uuid\n OR ip_add.ip_address_on_uuid = bon.bond_uuid\n WHERE ".concat(u,"\n AND ip_add.ip_address_note != 'DELETED';"));case 20:case"end":return e.stop()}}),e,null,[[7,13]])})));return function(t,n){return e.apply(this,arguments)}}()),lr=m((function(e,t){var n=e.params.hostUUID,r=(0,Ye.H)(n),a=nr({keys:[(0,nn.f)(r)]}),o=a.afterQueryReturn,i=a.query;return t&&(t.afterQueryReturn=o),i}));function dr(e,t,n,r,a,o,i){try{var s=e[o](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,a)}var fr=function(){var e=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){dr(o,r,a,i,s,"next",e)}function s(e){dr(o,r,a,i,s,"throw",e)}i(void 0)}))}}(regeneratorRuntime.mark((function e(t,n){var r,a,o,i,s,u,l,d,f,m,v,h,b,g,y,x,w,_,S,k,E,A,O,C;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.body,a=(r=void 0===r?{}:r).enterpriseUUID,o=r.hostIPAddress,i=r.hostName,s=r.hostPassword,u=r.hostSSHPort,l=r.hostType,d=r.hostUser,f=r.hostUUID,m=r.redhatPassword,v=r.redhatUser,h=Boolean(a),b=Boolean(f),g=Boolean(m)||Boolean(v),y=(0,T.N)(a,"string"),x=(0,T.N)(o,"string"),w=(0,T.N)(i,"string"),_=(0,T.N)(s,"string"),S=(0,T.N)(u,"number",{fallback:22}),k=(0,T.N)(l,"string"),E=(0,T.N)(d,"string",{fallback:"root"}),A=(0,T.N)(f,"string"),O=(0,T.N)(m,"string"),C=(0,T.N)(v,"string"),e.prev=16,B()(j.tf.test(x),"Data host IP address must be a valid IPv4 address; got [".concat(x,"]")),B()(j.FZ.test(w),"Data host name can only contain alphanumeric, hyphen, and dot characters; got [".concat(w,"]")),B()(j.OU.test(_),"Data host password must be peaceful string; got [".concat(_,"]")),B()(/^node|dr$/.test(k),'Data host type must be one of "node" or "dr"; got ['.concat(k,"]")),B()(j.OU.test(E),"Data host user must be a peaceful string; got [".concat(E,"]")),h&&B()(j.Qt.test(y),"Data enterprise UUID must be a valid UUIDv4; got [".concat(y,"]")),b&&B()(j.Qt.test(A),"Data host UUID must be a valid UUIDv4; got [".concat(A,"]")),g&&(B()(j.OU.test(O),"Data redhat password must be a peaceful string; got [".concat(O,"]")),B()(j.OU.test(C),"Data redhat user must be a peaceful string; got [".concat(C,"]"))),e.next=31;break;case 27:return e.prev=27,e.t0=e.catch(16),(0,p.G7)("Failed to assert value when trying to prepare host; CAUSE: ".concat(e.t0)),e.abrupt("return",n.status(400).send());case 31:if(e.prev=31,!b){e.next=35;break}return e.next=35,(0,c.VD)({file:__filename,update_value_only:1,variable_name:"system::configured",variable_source_table:"hosts",variable_source_uuid:A,variable_value:0});case 35:return e.next=37,(0,c.ZP)({file:__filename,job_command:j.us.usr.sbin["striker-initialize-host"].self,job_data:bn({obj:{enterprise_uuid:y,host_ip_address:x,host_name:w,password:_,rh_password:O,rh_user:C,ssh_port:S,type:k}}),job_description:"job_0022",job_name:"initialize::".concat(k,"::").concat(x),job_title:"job_002".concat("dr"===k?"1":"0")});case 37:e.next=43;break;case 39:return e.prev=39,e.t1=e.catch(31),(0,p.G7)("Failed to init host; CAUSE: ".concat(e.t1)),e.abrupt("return",n.status(500).send());case 43:n.status(200).send();case 44:case"end":return e.stop()}}),e,null,[[16,27],[31,39]])})));return function(t,n){return e.apply(this,arguments)}}();function mr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vr(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n= '".concat(c,"')")}catch(e){throw new Error("Failed to build date condition for job query; CAUSE: ".concat(e))}var u="";return j.OU.test(i)&&(u="AND job.job_command LIKE '%".concat(i,"%'")),(0,p.HZ)("condModifiedDate=[".concat(s,"]")),t&&(t.afterQueryReturn=function(e){var t=e;return e instanceof Array&&(t=e.reduce((function(e,t){var n,r,a=(r=6,function(e){if(Array.isArray(e))return e}(n=t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw a}}return o}}(n,r)||function(e,t){if(e){if("string"==typeof e)return Cr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cr(e,t):void 0}}(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=a[0],i=a[1],s=a[2],c=a[3],u=a[4],p=a[5];return e[o]={jobCommand:u,jobHostName:c,jobHostUUID:s,jobName:i,jobProgress:parseFloat(p),jobUUID:o},e}),{})),t}),"\n SELECT\n job.job_uuid,\n job.job_name,\n job.job_host_uuid,\n hos.host_name,\n job.job_command,\n job.job_progress\n FROM jobs AS job\n JOIN hosts AS hos\n ON job.job_host_uuid = hos.host_uuid\n WHERE (job.job_progress < 100 ".concat(s,")\n ").concat(u,"\n AND job_name NOT LIKE 'get_server_screenshot%';")}));function Ir(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function Zr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nu?p=1:ic?p=1:ol?d=1:cp?d=1:se.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function ka(e,t){if(e){if("string"==typeof e)return Ea(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ea(e,t):void 0}}function Ea(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nt.timestamp?1:-1})),v=m.pop(),(0,p.ry)(v,"Latest server screenshot: "),v&&(h=v.name,b=v.timestamp,g=(0,qt.readFileSync)($t().join(d,h),{encoding:"base64"}),l.screenshot=g,l.timestamp=b),e.abrupt("return",n.send(l));case 30:if(!u){e.next=44;break}return e.prev=31,e.next=34,(0,c.eX)(r);case 34:y=e.sent,e.next=41;break;case 37:return e.prev=37,e.t2=e.catch(31),(0,p.G7)("Failed to get server ".concat(r," VNC info; CAUSE: ").concat(e.t2)),e.abrupt("return",n.status(500).send());case 41:return e.abrupt("return",n.send(y));case 44:n.send();case 45:case"end":return e.stop()}}),e,null,[[4,8],[15,19],[31,37]])})));return function(t,n){return e.apply(this,arguments)}}(),Na=i().Router();Na.delete("/",Oa).delete("/:serverUuid",Oa).get("/",Ca).get("/:serverUUID",Pa).post("/",wa);const Ua=Na;function Da(e,t,n,r,a,o,i){try{var s=e[o](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,a)}var La=function(){var e=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){Da(o,r,a,i,s,"next",e)}function s(e){Da(o,r,a,i,s,"throw",e)}i(void 0)}))}}(regeneratorRuntime.mark((function e(t,n){var r,a,o,i,s,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.body,a=Object.keys(r),o=0,i=a;case 3:if(!(oe.length)&&(t=e.length);for(var n=0,r=new Array(t);n1){var l=i.slice(u.length),d=u.slice(0,-1).replace(/\/+/g,"/"),f="".concat(d).concat(l);return console.log("redirect=".concat(f)),a.redirect(f)}u="/index"}var m=/\.html$/.test(u)?u:"".concat(u,".html"),v="".concat($a).concat(m),h=(0,qt.existsSync)(v);return(0,p.HZ)("static:[".concat(u,"] requested; html=").concat(h)),h?(0,s.assertInit)({fail:function(e,t,n){var r=e.path,a="/init";return t.setHeader("Cache-Control","must-revalidate, no-store"),r.startsWith(a)?n():t.redirect(a)},invert:!0,succeed:(0,s.assertAuthentication)({fail:function(e,t,n,r){var a="/login";return t.path.startsWith(a)?r():n.redirect(e?"".concat(a,"?rt=").concat(e):a)},failReturnTo:!u.startsWith("/login"),succeed:function(e,t,n){var r=e.path,a=e.query,o=a.re,i=a.rt,s=void 0===i?"/":i;return r.startsWith("/login")?t.redirect(String(s)):r.startsWith("/init")&&!o?t.redirect("/"):n()}})}).apply(void 0,t):o()}),i().static($a,{extensions:["html"]}));const Ga=za;function Wa(e,t,n,r,a,o,i){try{var s=e[o](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,a)}var Za=function(){var e=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){Wa(o,r,a,i,s,"next",e)}function s(e){Wa(o,r,a,i,s,"throw",e)}i(void 0)}))}}(regeneratorRuntime.mark((function e(t,n){var r,a,o,i,s,u,l,d,f,m,v,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.body,a=(r=void 0===r?{}:r).agent,o=r.ipAddress,i=r.name,s=t.params.uuid,u=(0,T.N)(a,"string"),l=(0,T.N)(o,"string"),d=(0,T.N)(i,"string"),f=(0,T.N)(s,"string",{fallback:(0,p.Vj)()}),e.prev=7,B()(j.OU.test(u),"Agent must be a peaceful string; got [".concat(u,"]")),B()(j.tf.test(l),"IP address must be a valid IPv4; got [".concat(l,"]")),B()(j.OU.test(d),"Name must be a peaceful string; got [".concat(d,"]")),B()(j.Qt.test(f),"UPS UUID must be a valid UUIDv4; got [".concat(f,"]")),e.next=18;break;case 14:return e.prev=14,e.t0=e.catch(7),(0,p.G7)("Assert value failed when working with UPS; CAUSE: ".concat(e.t0)),e.abrupt("return",n.status(400).send());case 18:return m=(0,c.AB)(),e.prev=19,e.next=22,(0,c.cW)("INSERT INTO\n upses (\n ups_uuid,\n ups_name,\n ups_agent,\n ups_ip_address,\n modified_date\n ) VALUES (\n '".concat(f,"',\n '").concat(d,"',\n '").concat(u,"',\n '").concat(l,"',\n '").concat(m,"'\n ) ON CONFLICT (ups_uuid)\n DO UPDATE SET\n ups_name = '").concat(d,"',\n ups_agent = '").concat(u,"',\n ups_ip_address = '").concat(l,"',\n modified_date = '").concat(m,"';"));case 22:v=e.sent,B()(0===v,"Write exited with code ".concat(v)),e.next=30;break;case 26:return e.prev=26,e.t1=e.catch(19),(0,p.G7)("Failed to write UPS record; CAUSE: ".concat(e.t1)),e.abrupt("return",n.status(500).send());case 30:return h=s?200:201,e.abrupt("return",n.status(h).send());case 32:case"end":return e.stop()}}),e,null,[[7,14],[19,26]])})));return function(t,n){return e.apply(this,arguments)}}();function Va(e,t,n,r,a,o,i){try{var s=e[o](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,a)}var Qa=_t({delete:function(){var e=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){Va(o,r,a,i,s,"next",e)}function s(e){Va(o,r,a,i,s,"throw",e)}i(void 0)}))}}(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,c.cW)("UPDATE upses\n SET ups_ip_address = '".concat(j.oZ,"'\n WHERE ups_uuid IN (").concat(C(t,{elementWrapper:"'",separator:","}),");"));case 2:if(0===(n=e.sent)){e.next=5;break}throw Error("Write exited with code ".concat(n));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()});function Ka(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function ro(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ao(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ao(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ao(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n]+href=[\\"]+([^\s]+)[\\"]+.+[>]([^<]+)[<]/),u=eo(eo({},s),{},{brand:o,description:i,links:{}});if(c){var p=ro(c,4),l=p[1],d=p[2],f=p[3];u.description=l,u.links[0]={linkHref:d,linkLabel:f}}return/apc/i.test(o)&&(e[r]=u),e}),{}),n.status(200).send(a);case 13:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t,n){return e.apply(this,arguments)}}(),so=Za,co=i().Router();co.delete("/:uuid?",Qa).get("/",Ja).get("/template",io).post("/",Za).put("/:uuid",so);const uo=co;function po(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return lo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lo(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?s:[o],(0,p.ry)({ulist:u}),e.prev=10,l=0,B()(u.every((function(e,t){return l=t,j.Qt.test(e)})),"All UUIDs must be valid UUIDv4; failed at ".concat(l,", got [").concat(u[l],"]")),e.next=19;break;case 15:return e.prev=15,e.t0=e.catch(10),(0,p.G7)("Failed to assert value during delete user; CAUSE: ".concat(e.t0)),e.abrupt("return",n.status(400).send());case 19:return e.prev=19,e.next=22,(0,c.cW)("UPDATE users\n SET user_algorithm = '".concat(j.oZ,"'\n WHERE user_uuid IN (").concat(C(u,{elementWrapper:"'",separator:","}),");"));case 22:d=e.sent,B()(0===d,"Write exited with code ".concat(d)),e.next=30;break;case 26:return e.prev=26,e.t1=e.catch(19),(0,p.G7)("Failed to delete user(s); CAUSE: ".concat(e.t1)),e.abrupt("return",n.status(500).send());case 30:n.status(204).send();case 31:case"end":return e.stop()}}),e,null,[[10,15],[19,26]])})));return function(t,n){return e.apply(this,arguments)}}();function bo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{},a=r.assign,o=void 0===a?function(e){return[e]}:a,i=r.key,s=r.route,c=void 0===s?"/":s;if("route"in n){var u=o(n),l=u.length;(0,p.HZ)("Set up route ".concat(c," with ").concat(l," handler(s)")),t.use.apply(t,[c].concat(Ao(u)))}else i?e(t,n[i],{assign:o,route:$t().posix.join(c,String(i))}):Object.entries(n).forEach((function(n){var r=Eo(n,2),a=r[0],i=r[1];e(t,i,{assign:o,route:$t().posix.join(c,a)})}))};function Ro(e,t,n,r,a,o,i){try{var s=e[o](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,a)}const Io=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){Ro(o,r,a,i,s,"next",e)}function s(e){Ro(o,r,a,i,s,"throw",e)}i(void 0)}))}}(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=i()()).use((0,o.json)()),t.use(a()({origin:!0,credentials:!0})),e.t0=t,e.next=6,s.session;case 6:return e.t1=e.sent,e.t0.use.call(e.t0,e.t1),t.use(s.passport.initialize()),t.use(s.passport.authenticate("session")),t.use((function(e,t,n){var r=e.originalUrl,a=e.method;(0,p.HZ)("Received ".concat(a," ").concat(r)),n()})),Co(t,ko.private,{assign:function(e){return[s.guardApi,e]},route:"/api"}),Co(t,ko.public,{route:"/api"}),t.use(ko.static),e.abrupt("return",t);case 15:case"end":return e.stop()}}),e)})))()},800:(e,t,n)=>{"use strict";n.d(t,{Pd:()=>R,pQ:()=>M,HI:()=>H,nP:()=>B,Yu:()=>q,pT:()=>z,M6:()=>$,zM:()=>G,tS:()=>W,gA:()=>Z,R5:()=>V,QY:()=>Q,rV:()=>K,Q7:()=>J,eX:()=>Y,OP:()=>D,ZP:()=>U,IO:()=>P,lu:()=>T,AB:()=>F,VD:()=>L,cW:()=>N}),n(8304),n(489),n(2419),n(8011),n(7941),n(2526),n(7327),n(5003),n(9554),n(4747),n(9337),n(3321),n(9753),n(1817),n(2165),n(6992),n(8783),n(3948),n(1038),n(7042),n(8309),n(5666),n(2222),n(2564),n(4916),n(5306),n(2772),n(9600),n(1539),n(8674),n(1249),n(935),n(3210),n(9653),n(3123),n(9070);var r=n(2081),a=n(2361),o=n.n(a),i=n(7147),s=n(2243),c=function(e){return e.replace(/\s+/g," ")},u=n(4151);function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}var l=["args","gid","restartInterval","stdio","timeout","uid"],d=["job_progress","line"];function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw a}}return o}}(e,t)||v(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||v(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},n=t.eventEmitterOptions,r=void 0===n?{}:n,a=t.spawnOptions,o=void 0===a?{}:a;return _(this,c),j(A(e=i.call(this,r)),"mapToExternalEventHandler",{connected:function(t){var n=t.options,r=t.ps;(0,u.ry)(n,"Successfully started anvil-access-module daemon (pid=".concat(r.pid,"): ")),e.emit("active",r.pid)}}),e.ps=e.start(o),e}return t=c,n=[{key:"start",value:function(){var e,t,n=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=a.args,i=void 0===o?["--emit-events"]:o,c=a.gid,p=void 0===c?s.cI:c,d=a.restartInterval,f=void 0===d?1e4:d,m=a.stdio,v=void 0===m?"pipe":m,h=a.timeout,b=void 0===h?1e4:h,g=a.uid,y=void 0===g?s.NF:g,_=w(a,l),S=x({args:i,gid:p,restartInterval:f,stdio:v,timeout:b,uid:y},_);(0,u.ry)(S,"Starting anvil-access-module daemon with: ");var k=(0,r.spawn)(s.us.usr.sbin["anvil-access-module"].self,i,x({gid:p,stdio:v,timeout:b,uid:y},_));k.once("error",(function(e){(0,u.G7)("anvil-access-module daemon (pid=".concat(k.pid,") error: ").concat(e.message),e)})),k.once("close",(function(e,t){(0,u.ry)({code:e,options:S,signal:t},"anvil-access-module daemon (pid=".concat(k.pid,") closed: ")),n.emit("inactive",k.pid),(0,u.HZ)("Waiting ".concat(f," before restarting.")),setTimeout((function(){n.ps=n.start(S)}),f)})),null===(e=k.stderr)||void 0===e||e.setEncoding("utf-8").on("data",(function(e){(0,u.G7)("anvil-access-module daemon stderr: ".concat(e))}));var E="";return null===(t=k.stdout)||void 0===t||t.setEncoding("utf-8").on("data",(function(e){for(var t=e.replace(/(\n)?event=([^\n]*)\n/g,(function(){for(var e,t=arguments.length,r=new Array(t),a=0;a1?a-1:0),i=1;i1&&void 0!==f[1]?f[1]:{},r=n.params,a=void 0===r?[]:r,o=n.pre,i=void 0===o?["Database"]:o,s=n.root,c=s?I:R,u="".concat(i.join("->"),"->").concat(t),p=a.map((function(e){var t;try{t=JSON.stringify(e)}catch(n){t=String(e)}return'"'.concat(t.replaceAll('"','\\"'),'"')})),e.next=6,c.interact.apply(c,["x",u].concat(m(p)));case 6:return l=e.sent,d=l.sub_results,e.abrupt("return",d);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),P=function(e){return R.interact("r",c(e))},N=function(){var e=g(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,R.interact("w",c(t));case 2:return n=e.sent,r=n.write_code,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),U=function(){var e=g(regeneratorRuntime.mark((function e(t){var n,r,a,o,i,c,u,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.job_progress,r=void 0===n?s.sw:n,a=t.line,o=void 0===a?0:a,i=w(t,d),e.next=3,T("insert_or_update_jobs",{params:[x({job_progress:r,line:o},i)]});case 3:return c=e.sent,u=f(c,1),p=u[0],e.abrupt("return",p);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),D=function(){var e=g(regeneratorRuntime.mark((function e(t){var n,r,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,T("insert_or_update_users",{params:[t]});case 2:return n=e.sent,r=f(n,1),a=r[0],e.abrupt("return",a);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),L=function(){var e=g(regeneratorRuntime.mark((function e(t){var n,r,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,T("insert_or_update_variables",{params:[t]});case 2:return n=e.sent,r=f(n,1),a=r[0],e.abrupt("return",a);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),M=function(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{jobHostUUID:void 0},o=a.jobHostUUID,i={file:__filename,job_command:s.us.usr.sbin["anvil-sync-shared"].self,job_data:t,job_name:"storage::".concat(e),job_title:"job_".concat(n),job_description:"job_".concat(r)};return o&&(i.job_host_uuid=o),U(i)},F=function(){var e;try{e=(0,u.hT)("--rfc-3339","ns").trim()}catch(e){throw new Error("Failed to get timestamp for database use; CAUSE: ".concat(e))}return e},H=function(){var e=g(regeneratorRuntime.mark((function e(t){var n,r,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,T("encrypt_password",{params:[t],pre:["Account"]});case 2:return n=e.sent,r=f(n,1),a=r[0],e.abrupt("return",a);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),q=function(){var e=g(regeneratorRuntime.mark((function e(){var t,n,r,a,o,i,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=c.length,n=new Array(t),r=0;r")),e.next=4,R.interact("x",a);case 4:return o=e.sent,i=f(o.sub_results,1),s=i[0],(0,u.ry)(s,"".concat(a," data: ")),e.abrupt("return",s);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),B=function(){var e=g(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,T("get_anvils");case 2:return e.abrupt("return",q("anvils"));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),z=function(){var e=g(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,T("read_config",{pre:["Storage"]});case 2:if(t=e.sent,n=f(t,1),r=n[0],0===Number(r)){e.next=7;break}throw new Error("Failed to read config");case 7:return e.abrupt("return",q("database"));case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$=function(){var e=g(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,T("get_fence_data",{pre:["Striker"]});case 2:return e.abrupt("return",q("fence_data"));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),G=function(){var e=g(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,T("get_hosts");case 2:return e.abrupt("return",q("hosts"));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),W=function(){var e;try{e=(0,i.readFileSync)(s.us.etc.hostname.self,{encoding:"utf-8"}).trim()}catch(e){throw new Error("Failed to get local host name; CAUSE: ".concat(e))}return(0,u.HZ)("localHostName=".concat(e)),e},Z=function(){var e;try{e=(0,i.readFileSync)(s.us.etc.anvil["host.uuid"].self,{encoding:"utf-8"}).trim()}catch(e){throw new Error("Failed to get local host UUID; CAUSE: ".concat(e))}return(0,u.HZ)("localHostUUID=[".concat(e,"]")),e},V=function(){var e=g(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,T("load_manifest",{params:[{manifest_uuid:t}],pre:["Striker"]});case 2:return e.abrupt("return",q("manifests"));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Q=function(){var e=g(regeneratorRuntime.mark((function e(t,n){var r,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n){e.next=6;break}return e.next=4,G();case 4:a=e.sent,r=a.host_uuid[t].short_host_name;case 6:return e.next=8,T("load_interfces",{params:[{host:r,host_uuid:t}],pre:["Network"]});case 8:return e.abrupt("return",q("network"));case 9:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),K=function(){var e=g(regeneratorRuntime.mark((function e(t){var n,r,a,o,i,s,c,u,p,l,d,m,v=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=v.length>1&&void 0!==v[1]?v[1]:{},r=n.password,a=n.port,e.next=3,T("get_peer_data",{params:[{password:r,port:a,target:t}],pre:["Striker"]});case 3:return o=e.sent,i=f(o,2),s=i[0],c=i[1],u=c.host_name,p=c.host_os,l=c.host_uuid,d=c.internet,m=c.os_registered,e.abrupt("return",{hostName:u,hostOS:p,hostUUID:l,isConnected:"1"===s,isInetConnected:"1"===d,isOSRegistered:"yes"===m});case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),J=function(){var e=g(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,T("get_ups_data",{pre:["Striker"]});case 2:return e.abrupt("return",q("ups_data"));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Y=function(){var e=g(regeneratorRuntime.mark((function e(t){var n,r,a,o,i,s,c,u,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,P("SELECT variable_value FROM variables WHERE variable_name = 'server::".concat(t,"::vncinfo';"));case 2:if((n=e.sent).length){e.next=5;break}throw new Error("No record found");case 5:return r=f(n,1),a=f(r[0],1),o=a[0],i=o.split(":"),s=f(i,2),c=s[0],u=s[1],p=Number(u),e.abrupt("return",{domain:c,port:p,protocol:"ws"});case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},6363:(e,t,n)=>{"use strict";function r(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);no}),n(9753),n(2526),n(1817),n(1539),n(2165),n(6992),n(8783),n(3948),n(1038),n(7042),n(8309),n(4916);const o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.parameters,a=void 0===n?[]:n,o=t.notCallableReturn;return"function"==typeof e?e.apply(void 0,r(a)):o}},3233:(e,t,n)=>{"use strict";n.d(t,{Q:()=>a}),n(2222);var r=n(2243),a=function(e){return"".concat(r.gM,".").concat(e)}},4541:(e,t,n)=>{"use strict";n.d(t,{F:()=>r});var r="local"},4707:(e,t,n)=>{"use strict";n.d(t,{I:()=>i}),n(4916),n(3123),n(3210),n(5827),n(1539),n(5306),n(9753),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948),n(7042),n(8309),n(1038);var r=n(2081),a=n(5230);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n{"use strict";n.d(t,{FZ:()=>u,Ke:()=>c,OU:()=>d,Qt:()=>f,ah:()=>l,tf:()=>p}),n(2222),n(4603),n(4916),n(9714);var r="[a-f0-9]",a="(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9]|)[0-9])",o="[a-z0-9]",i="[a-z0-9-]",s="(?:".concat(a,"[.]){3}").concat(a),c="".concat(r,"{8}-(?:").concat(r,"{4}-){3}").concat(r,"{12}"),u=new RegExp("^(?:".concat(o,"(?:").concat(i,"{0,61}").concat(o,")?[.])+").concat(o).concat(i,"{0,61}").concat(o,"$")),p=new RegExp("^".concat(s,"$")),l=new RegExp("(?:".concat(s,",)*").concat(s)),d=/^[^'"/\\><}{]+$/,f=new RegExp("^".concat(c,"$"))},5230:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o}),n(9554),n(1539),n(4747),n(7941),n(9600);var r=n(1017),a=n.n(r);const o=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a().parse(process.cwd()).root;return Object.keys(t).forEach((function(r){if("self"!==r){var o=a().join(n,r);t[r].self=o,e(t[r],o)}})),t}({etc:{anvil:{"host.uuid":{}},hostname:{}},mnt:{shared:{incoming:{}}},opt:{alteeve:{screenshots:{}}},tmp:{},usr:{bin:{date:{},getent:{},mkfifo:{},openssl:{},psql:{},rm:{},sed:{},uuidgen:{}},sbin:{"anvil-access-module":{},"anvil-boot-server":{},"anvil-configure-host":{},"anvil-delete-server":{},"anvil-get-server-screenshot":{},"anvil-join-anvil":{},"anvil-manage-keys":{},"anvil-manage-power":{},"anvil-provision-server":{},"anvil-safe-start":{},"anvil-safe-stop":{},"anvil-shutdown-server":{},"anvil-sync-shared":{},"anvil-update-system":{},"striker-boot-machine":{},"striker-initialize-host":{},"striker-manage-install-target":{},"striker-manage-peers":{},"striker-parse-os-list":{}}},var:{www:{html:{}}}})},2243:(e,t,n)=>{"use strict";n.d(t,{Vn:()=>l,gM:()=>p,sw:()=>d,oZ:()=>c,bR:()=>h,rj:()=>b,Fe:()=>g.F,Su:()=>y,Im:()=>x.I,cI:()=>v,px:()=>f,NF:()=>m,Ke:()=>w.Ke,FZ:()=>w.FZ,tf:()=>w.tf,ah:()=>w.ah,OU:()=>w.OU,Qt:()=>w.Qt,us:()=>i.Z,C_:()=>s});var r,a,o,i=n(5230),s="striker-ui-api::session::secret",c="DELETED",u=(n(9653),n(4151)),p=null!==(r=process.env.COOKIE_PREFIX)&&void 0!==r?r:"suiapi",l=Number(process.env.COOKIE_ORIGINAL_MAX_AGE)||288e5,d=Number(process.env.DEFAULT_JOB_PROGRESS)||0,f=Number(process.env.PORT)||8080,m=(0,u.Sd)(null!==(a=process.env.PUID)&&void 0!==a?a:"striker-ui-api"),v=(0,u.X2)(null!==(o=process.env.PGID)&&void 0!==o?o:m),h=1,b=2,g=n(4541),y=8589934592,x=n(4707),w=n(9831)},6151:(e,t,n)=>{"use strict";n.d(t,{H:()=>o,s:()=>i});var r=n(4541),a=n(800),o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,a.gA)();return e===r.F?t:e},i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,a.gA)();return e===t?r.F:e}},972:(e,t,n)=>{"use strict";n.d(t,{N:()=>i}),n(4678),n(5827),n(1539),n(4916),n(3123);var r=n(6363),a={none:void 0,sql:n(4633).f},o={boolean:function(e){return Boolean(e)},number:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return parseFloat(String(e))||n},string:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return e?t(e):n},"string[]":function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=n;return e instanceof Array?r=e.reduce((function(e,n){return n&&e.push(t(n)),e}),[]):e&&(r=t(e).split(/[,;]/)),r}},i=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.fallback,s=n.modifierType,c=void 0===s?"none":s,u=n.modifier,p=void 0===u?a[c]:u;return o[t](e,(function(e){var t=String(e);return(0,r.Z)(p,{notCallableReturn:t,parameters:[t]})}),i)}},4633:(e,t,n)=>{"use strict";n.d(t,{f:()=>r}),n(4916),n(5306);var r=function(e){return e.replace(/'/g,"''")}},4151:(e,t,n)=>{"use strict";n.d(t,{G7:()=>h,HZ:()=>b,Sd:()=>v,Tt:()=>u,Vj:()=>y,X2:()=>m,aq:()=>l,hT:()=>p,rm:()=>d,ry:()=>g}),n(2222),n(9653),n(4916),n(3123),n(3210),n(9070),n(7941),n(2526),n(7327),n(1539),n(5003),n(9554),n(4747),n(9337),n(3321);var r=n(2081),a=n(5230);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=t.eol,r=void 0===n?"\n":n,a=t.stream,o=void 0===a?"stdout":a;return process[o].write("".concat(e).concat(r))},u=function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:"Variables: ";return c("".concat(t).concat(JSON.stringify(e,null,2)))},y=function(){return function(){for(var e=arguments.length,t=new Array(e),n=0;n{"use strict";n.r(t),n.d(t,{assertAuthentication:()=>N,assertInit:()=>H,guardApi:()=>U,passport:()=>m,proxyServerVnc:()=>W,proxyServerVncUpgrade:()=>Z,session:()=>P}),n(5666),n(2222),n(8309),n(1539),n(8674),n(9753),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948),n(7042),n(1038),n(4916);var r=n(8212),a=n.n(r),o=n(8462),i=n(2243),s=n(800),c=n(972),u=n(4151);function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0,"No existing session secret found."),o=n[0],c=1,r=function(e){if(Array.isArray(e))return e}(o)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw a}}return o}}(o,c)||function(e,t){if(e){if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(e,t):void 0}}(o,c)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),t=r[0],(0,u.HZ)("Found an existing session secret."),e.abrupt("return",t);case 11:e.prev=11,e.t0=e.catch(0),(0,u.G7)("Failed to get session secret from database; CAUSE: ".concat(e.t0));case 14:try{t=(0,u.aq)("rand","-base64","32").trim(),(0,u.HZ)("Generated a new session secret.")}catch(e){(0,u.G7)("Failed to generate session secret; CAUSE: ".concat(e)),process.exit(i.rj)}return e.prev=15,e.next=18,(0,s.VD)({file:__filename,variable_name:i.C_,variable_value:t});case 18:a=e.sent,(0,u.HZ)("Recorded session secret as variable identified by ".concat(a,".")),e.next=26;break;case 22:e.prev=22,e.t1=e.catch(15),(0,u.G7)("Failed to record session secret; CAUSE: ".concat(e.t1)),process.exit(i.rj);case 26:return e.abrupt("return",t);case 27:case"end":return e.stop()}var o,c}),e,null,[[0,11],[15,22]])})),function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){w(o,r,a,i,s,"next",e)}function s(e){w(o,r,a,i,s,"throw",e)}i(void 0)}))});return function(){return t.apply(this,arguments)}}();function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{};return O(this,m),f.call(this,e)}return t=m,n=[{key:"destroy",value:(p=A(regeneratorRuntime.mark((function e(t,n){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(0,u.HZ)("Destroy session ".concat(t)),e.prev=1,e.next=4,(0,s.cW)("UPDATE sessions\n SET session_salt = '".concat(i.oZ,"', modified_date = '").concat((0,s.AB)(),"'\n WHERE session_uuid = '").concat(t,"';"));case 4:r=e.sent,h()(0===r,"Write exited with code ".concat(r)),e.next=12;break;case 8:return e.prev=8,e.t0=e.catch(1),(0,u.G7)("Failed to complete DB write in destroy session ".concat(t,"; CAUSE: ").concat(e.t0)),e.abrupt("return",null==n?void 0:n.call(null,e.t0));case 12:return e.abrupt("return",null==n?void 0:n.call(null));case 13:case"end":return e.stop()}}),e,null,[[1,8]])}))),function(e,t){return p.apply(this,arguments)})},{key:"get",value:(c=A(regeneratorRuntime.mark((function e(t,n){var r,a,o,c,p,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(0,u.HZ)("Get session ".concat(t)),e.prev=1,e.next=4,(0,s.IO)("SELECT\n s.session_uuid,\n u.user_uuid,\n s.modified_date\n FROM sessions AS s\n JOIN users AS u\n ON s.session_user_uuid = u.user_uuid\n WHERE s.session_salt != '".concat(i.oZ,"'\n AND s.session_uuid = '").concat(t,"';"));case 4:r=e.sent,e.next=10;break;case 7:return e.prev=7,e.t0=e.catch(1),e.abrupt("return",n(e.t0));case 10:if(r.length){e.next=12;break}return e.abrupt("return",n(null));case 12:return d=r[0],f=3,a=function(e){if(Array.isArray(e))return e}(d)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw a}}return o}}(d,f)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(d,f)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=a[1],c=a[2],p=m.calculateCookieMaxAge(c),l={cookie:{maxAge:p,originalMaxAge:i.Vn},passport:{user:o}},e.abrupt("return",n(null,l));case 16:case"end":return e.stop()}var d,f}),e,null,[[1,7]])}))),function(e,t){return c.apply(this,arguments)})},{key:"set",value:(o=A(regeneratorRuntime.mark((function e(t,n,r){var a,o,i,c,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(0,u.ry)({session:n},"Set session ".concat(t,": ")),a=n.passport,o=(a=void 0===a?{}:a).user,e.prev=4,h().ok(o,"Missing user identifier"),i=(0,s.gA)(),c=(0,s.AB)(),e.next=10,(0,s.cW)("INSERT INTO\n sessions (\n session_uuid,\n session_host_uuid,\n session_user_uuid,\n session_salt,\n modified_date\n )\n VALUES\n (\n '".concat(t,"',\n '").concat(i,"',\n '").concat(o,"',\n '',\n '").concat(c,"'\n )\n ON CONFLICT (session_uuid)\n DO UPDATE SET modified_date = '").concat(c,"';"));case 10:p=e.sent,h()(0===p,"Write exited with code ".concat(p)),e.next=18;break;case 14:return e.prev=14,e.t0=e.catch(4),(0,u.G7)("Failed to complete DB write in set session ".concat(t,"; CAUSE: ").concat(e.t0)),e.abrupt("return",null==r?void 0:r.call(null,e.t0));case 18:return e.abrupt("return",null==r?void 0:r.call(null));case 19:case"end":return e.stop()}}),e,null,[[4,14]])}))),function(e,t,n){return o.apply(this,arguments)})},{key:"touch",value:(a=A(regeneratorRuntime.mark((function e(t,n,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(0,u.ry)({session:n},"Touch session ".concat(t,": ")),e.abrupt("return",null==r?void 0:r.call(null));case 2:case"end":return e.stop()}}),e)}))),function(e,t,n){return a.apply(this,arguments)})}],r=[{key:"calculateCookieMaxAge",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.Vn,n=Date.parse(e),r=n+t,a=r-Date.now();return(0,u.ry)({sessionModifiedDate:e,sessionDeadlineEpoch:r,cookieMaxAge:a}),a}}],n&&j(t.prototype,n),r&&j(t,r),Object.defineProperty(t,"prototype",{writable:!1}),m}(b.Store);const P=A(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=g(),e.t1={httpOnly:!0,maxAge:i.Vn,secure:!1},e.t2=function(e){var t=e.originalUrl,n=(0,u.Vj)();return(0,u.HZ)("Generated session identifier ".concat(n,"; access to ").concat(t)),n},e.t3=(0,y.Q)("sid"),e.next=6,_();case 6:return e.t4=e.sent,e.t5=new T,e.t6={cookie:e.t1,genid:e.t2,name:e.t3,resave:!1,saveUninitialized:!1,secret:e.t4,store:e.t5},e.abrupt("return",(0,e.t0)(e.t6));case 10:case"end":return e.stop()}}),e)})))();var N=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.fail,r=void 0===n?function(e,t,n){return n.status(404).send()}:n,a=t.failReturnTo,o=t.succeed,i=void 0===o?function(e,t,n){return n()}:o;!0===a?e=function(e){var t=e.originalUrl,n=e.url;return t||n}:"string"==typeof a&&(e=function(){return a});var s="string"==typeof r?function(e,t,n){return n.redirect(e?"".concat(r,"?rt=").concat(e):r)}:r,c="string"==typeof i?function(e,t){return t.redirect(i)}:i;return function(){for(var t,n=arguments.length,r=new Array(n),a=0;a0&&void 0!==arguments[0]?arguments[0]:{},t=e.fail,n=void 0===t?function(e,t){return t.status(401).send()}:t,r=e.hostUuid,a=void 0===r?i.Fe:r,o=e.invert,c=e.succeed,p=void 0===c?function(e,t,n){return n()}:c;return M(regeneratorRuntime.mark((function e(){var t,r,i,c,l,d,f,m=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=m.length,r=new Array(t),i=0;i{"use strict";var r=n(412)("body-parser"),a=Object.create(null);function o(e){return function(){return function(e){var t=a[e];if(void 0!==t)return t;switch(e){case"json":t=n(6035);break;case"raw":t=n(187);break;case"text":t=n(6560);break;case"urlencoded":t=n(4861)}return a[e]=t}(e)}}t=e.exports=r.function((function(e){var n=Object.create(e||null,{type:{configurable:!0,enumerable:!0,value:void 0,writable:!0}}),r=t.urlencoded(n),a=t.json(n);return function(e,t,n){a(e,t,(function(a){if(a)return n(a);r(e,t,n)}))}}),"bodyParser: use individual json/urlencoded middlewares"),Object.defineProperty(t,"json",{configurable:!0,enumerable:!0,get:o("json")}),Object.defineProperty(t,"raw",{configurable:!0,enumerable:!0,get:o("raw")}),Object.defineProperty(t,"text",{configurable:!0,enumerable:!0,get:o("text")}),Object.defineProperty(t,"urlencoded",{configurable:!0,enumerable:!0,get:o("urlencoded")})},3211:(e,t,n)=>{"use strict";var r=n(9009),a=n(6149),o=n(1045),i=n(4914),s=n(338),c=n(8170),u=n(9796);e.exports=function(e,t,n,p,l,d){var f,m,v=d;e._body=!0;var h=null!==v.encoding?v.encoding:null,b=v.verify;try{m=function(e,t,n){var a,o=(e.headers["content-encoding"]||"identity").toLowerCase(),i=e.headers["content-length"];if(t('content-encoding "%s"',o),!1===n&&"identity"!==o)throw r(415,"content encoding unsupported",{encoding:o,type:"encoding.unsupported"});switch(o){case"deflate":a=u.createInflate(),t("inflate body"),e.pipe(a);break;case"gzip":a=u.createGunzip(),t("gunzip body"),e.pipe(a);break;case"identity":(a=e).length=i;break;default:throw r(415,'unsupported content encoding "'+o+'"',{encoding:o,type:"encoding.unsupported"})}return a}(e,l,v.inflate),f=m.length,m.length=void 0}catch(e){return n(e)}if(v.length=f,v.encoding=b?null:h,null===v.encoding&&null!==h&&!i.encodingExists(h))return n(r(415,'unsupported charset "'+h.toUpperCase()+'"',{charset:h.toLowerCase(),type:"charset.unsupported"}));l("read body"),o(m,v,(function(o,u){var d;if(o)return d="encoding.unsupported"===o.type?r(415,'unsupported charset "'+h.toUpperCase()+'"',{charset:h.toLowerCase(),type:"charset.unsupported"}):r(400,o),m!==e&&(c(e),a(m,!0)),void function(e,t){s.isFinished(e)?t():(s(e,t),e.resume())}(e,(function(){n(r(400,d))}));if(b)try{l("verify body"),b(e,t,u,h)}catch(e){return void n(r(403,e,{body:u,type:e.type||"entity.verify.failed"}))}var f=u;try{l("parse body"),f="string"!=typeof u&&null!==h?i.decode(u,h):u,e.body=p(f)}catch(e){return void n(r(400,e,{body:f,type:e.type||"entity.parse.failed"}))}n()}))}},6035:(e,t,n)=>{"use strict";var r=n(9830),a=n(7811),o=n(9009),i=n(5158)("body-parser:json"),s=n(3211),c=n(273);e.exports=function(e){var t=e||{},n="number"!=typeof t.limit?r.parse(t.limit||"100kb"):t.limit,l=!1!==t.inflate,d=t.reviver,f=!1!==t.strict,m=t.type||"application/json",v=t.verify||!1;if(!1!==v&&"function"!=typeof v)throw new TypeError("option verify must be function");var h="function"!=typeof m?function(e){return function(t){return Boolean(c(t,e))}}(m):m;function b(e){if(0===e.length)return{};if(f){var t=(n=e,(r=u.exec(n))?r[1]:void 0);if("{"!==t&&"["!==t)throw i("strict violation"),function(e,t){var n=e.indexOf(t),r=-1!==n?e.substring(0,n)+"#":"";try{throw JSON.parse(r),new SyntaxError("strict violation")}catch(e){return p(e,{message:e.message.replace("#",t),stack:e.stack})}}(e,t)}var n,r;try{return i("parse json"),JSON.parse(e,d)}catch(e){throw p(e,{message:e.message,stack:e.stack})}}return function(e,t,r){if(e._body)return i("body already parsed"),void r();if(e.body=e.body||{},!c.hasBody(e))return i("skip empty body"),void r();if(i("content-type %j",e.headers["content-type"]),!h(e))return i("skip parsing"),void r();var u=function(e){try{return(a.parse(e).parameters.charset||"").toLowerCase()}catch(e){return}}(e)||"utf-8";if("utf-"!==u.slice(0,4))return i("invalid charset"),void r(o(415,'unsupported charset "'+u.toUpperCase()+'"',{charset:u,type:"charset.unsupported"}));s(e,t,r,b,i,{encoding:u,inflate:l,limit:n,verify:v})}};var u=/^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d])/;function p(e,t){for(var n=Object.getOwnPropertyNames(e),r=0;r{"use strict";var r=n(9830),a=n(5158)("body-parser:raw"),o=n(3211),i=n(273);e.exports=function(e){var t=e||{},n=!1!==t.inflate,s="number"!=typeof t.limit?r.parse(t.limit||"100kb"):t.limit,c=t.type||"application/octet-stream",u=t.verify||!1;if(!1!==u&&"function"!=typeof u)throw new TypeError("option verify must be function");var p="function"!=typeof c?function(e){return function(t){return Boolean(i(t,e))}}(c):c;function l(e){return e}return function(e,t,r){return e._body?(a("body already parsed"),void r()):(e.body=e.body||{},i.hasBody(e)?(a("content-type %j",e.headers["content-type"]),p(e)?void o(e,t,r,l,a,{encoding:null,inflate:n,limit:s,verify:u}):(a("skip parsing"),void r())):(a("skip empty body"),void r()))}}},6560:(e,t,n)=>{"use strict";var r=n(9830),a=n(7811),o=n(5158)("body-parser:text"),i=n(3211),s=n(273);e.exports=function(e){var t=e||{},n=t.defaultCharset||"utf-8",c=!1!==t.inflate,u="number"!=typeof t.limit?r.parse(t.limit||"100kb"):t.limit,p=t.type||"text/plain",l=t.verify||!1;if(!1!==l&&"function"!=typeof l)throw new TypeError("option verify must be function");var d="function"!=typeof p?function(e){return function(t){return Boolean(s(t,e))}}(p):p;function f(e){return e}return function(e,t,r){if(e._body)return o("body already parsed"),void r();if(e.body=e.body||{},!s.hasBody(e))return o("skip empty body"),void r();if(o("content-type %j",e.headers["content-type"]),!d(e))return o("skip parsing"),void r();var p=function(e){try{return(a.parse(e).parameters.charset||"").toLowerCase()}catch(e){return}}(e)||n;i(e,t,r,f,o,{encoding:p,inflate:c,limit:u,verify:l})}}},4861:(e,t,n)=>{"use strict";var r=n(9830),a=n(7811),o=n(9009),i=n(5158)("body-parser:urlencoded"),s=n(412)("body-parser"),c=n(3211),u=n(273);e.exports=function(e){var t=e||{};void 0===t.extended&&s("undefined extended: provide extended option");var n=!1!==t.extended,p=!1!==t.inflate,f="number"!=typeof t.limit?r.parse(t.limit||"100kb"):t.limit,m=t.type||"application/x-www-form-urlencoded",v=t.verify||!1;if(!1!==v&&"function"!=typeof v)throw new TypeError("option verify must be function");var h=n?function(e){var t=void 0!==e.parameterLimit?e.parameterLimit:1e3,n=d("qs");if(isNaN(t)||t<1)throw new TypeError("option parameterLimit must be a positive number");return isFinite(t)&&(t|=0),function(e){var r=l(e,t);if(void 0===r)throw i("too many parameters"),o(413,"too many parameters",{type:"parameters.too.many"});var a=Math.max(100,r);return i("parse extended urlencoding"),n(e,{allowPrototypes:!0,arrayLimit:a,depth:1/0,parameterLimit:t})}}(t):function(e){var t=void 0!==e.parameterLimit?e.parameterLimit:1e3,n=d("querystring");if(isNaN(t)||t<1)throw new TypeError("option parameterLimit must be a positive number");return isFinite(t)&&(t|=0),function(e){if(void 0===l(e,t))throw i("too many parameters"),o(413,"too many parameters",{type:"parameters.too.many"});return i("parse urlencoding"),n(e,void 0,void 0,{maxKeys:t})}}(t),b="function"!=typeof m?function(e){return function(t){return Boolean(u(t,e))}}(m):m;function g(e){return e.length?h(e):{}}return function(e,t,n){if(e._body)return i("body already parsed"),void n();if(e.body=e.body||{},!u.hasBody(e))return i("skip empty body"),void n();if(i("content-type %j",e.headers["content-type"]),!b(e))return i("skip parsing"),void n();var r=function(e){try{return(a.parse(e).parameters.charset||"").toLowerCase()}catch(e){return}}(e)||"utf-8";if("utf-8"!==r)return i("invalid charset"),void n(o(415,'unsupported charset "'+r.toUpperCase()+'"',{charset:r,type:"charset.unsupported"}));c(e,t,n,g,i,{debug:i,encoding:r,inflate:p,limit:f,verify:v})}};var p=Object.create(null);function l(e,t){for(var n=0,r=0;-1!==(r=e.indexOf("&",r));)if(r++,++n===t)return;return n}function d(e){var t=p[e];if(void 0!==t)return t.parse;switch(e){case"qs":t=n(129);break;case"querystring":t=n(3477)}return p[e]=t,t.parse}},6744:(e,t,n)=>{"use strict";const r=n(3349),a=n(7529),o=n(8050),i=n(4339),s=(e,t={})=>{let n=[];if(Array.isArray(e))for(let r of e){let e=s.create(r,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(s.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(n=[...new Set(n)]),n};s.parse=(e,t={})=>i(e,t),s.stringify=(e,t={})=>r("string"==typeof e?s.parse(e,t):e,t),s.compile=(e,t={})=>("string"==typeof e&&(e=s.parse(e,t)),a(e,t)),s.expand=(e,t={})=>{"string"==typeof e&&(e=s.parse(e,t));let n=o(e,t);return!0===t.noempty&&(n=n.filter(Boolean)),!0===t.nodupes&&(n=[...new Set(n)]),n},s.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?s.compile(e,t):s.expand(e,t),e.exports=s},7529:(e,t,n)=>{"use strict";const r=n(2664),a=n(3083);e.exports=(e,t={})=>{let n=(e,o={})=>{let i=a.isInvalidBrace(o),s=!0===e.invalid&&!0===t.escapeInvalid,c=!0===i||!0===s,u=!0===t.escapeInvalid?"\\":"",p="";if(!0===e.isOpen)return u+e.value;if(!0===e.isClose)return u+e.value;if("open"===e.type)return c?u+e.value:"(";if("close"===e.type)return c?u+e.value:")";if("comma"===e.type)return"comma"===e.prev.type?"":c?e.value:"|";if(e.value)return e.value;if(e.nodes&&e.ranges>0){let n=a.reduce(e.nodes),o=r(...n,{...t,wrap:!1,toRegex:!0});if(0!==o.length)return n.length>1&&o.length>1?`(${o})`:o}if(e.nodes)for(let t of e.nodes)p+=n(t,e);return p};return n(e)}},6611:e=>{"use strict";e.exports={MAX_LENGTH:65536,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"}},8050:(e,t,n)=>{"use strict";const r=n(2664),a=n(3349),o=n(3083),i=(e="",t="",n=!1)=>{let r=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return n?o.flatten(t).map((e=>`{${e}}`)):t;for(let a of e)if(Array.isArray(a))for(let e of a)r.push(i(e,t,n));else for(let e of t)!0===n&&"string"==typeof e&&(e=`{${e}}`),r.push(Array.isArray(e)?i(a,e,n):a+e);return o.flatten(r)};e.exports=(e,t={})=>{let n=void 0===t.rangeLimit?1e3:t.rangeLimit,s=(e,c={})=>{e.queue=[];let u=c,p=c.queue;for(;"brace"!==u.type&&"root"!==u.type&&u.parent;)u=u.parent,p=u.queue;if(e.invalid||e.dollar)return void p.push(i(p.pop(),a(e,t)));if("brace"===e.type&&!0!==e.invalid&&2===e.nodes.length)return void p.push(i(p.pop(),["{}"]));if(e.nodes&&e.ranges>0){let s=o.reduce(e.nodes);if(o.exceedsLimit(...s,t.step,n))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let c=r(...s,t);return 0===c.length&&(c=a(e,t)),p.push(i(p.pop(),c)),void(e.nodes=[])}let l=o.encloseBrace(e),d=e.queue,f=e;for(;"brace"!==f.type&&"root"!==f.type&&f.parent;)f=f.parent,d=f.queue;for(let t=0;t{"use strict";const r=n(3349),{MAX_LENGTH:a,CHAR_BACKSLASH:o,CHAR_BACKTICK:i,CHAR_COMMA:s,CHAR_DOT:c,CHAR_LEFT_PARENTHESES:u,CHAR_RIGHT_PARENTHESES:p,CHAR_LEFT_CURLY_BRACE:l,CHAR_RIGHT_CURLY_BRACE:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_RIGHT_SQUARE_BRACKET:m,CHAR_DOUBLE_QUOTE:v,CHAR_SINGLE_QUOTE:h,CHAR_NO_BREAK_SPACE:b,CHAR_ZERO_WIDTH_NOBREAK_SPACE:g}=n(6611);e.exports=(e,t={})=>{if("string"!=typeof e)throw new TypeError("Expected a string");let n=t||{},y="number"==typeof n.maxLength?Math.min(a,n.maxLength):a;if(e.length>y)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${y})`);let x,w={type:"root",input:e,nodes:[]},_=[w],S=w,k=w,E=0,A=e.length,O=0,j=0;const C=()=>e[O++],R=e=>{if("text"===e.type&&"dot"===k.type&&(k.type="text"),!k||"text"!==k.type||"text"!==e.type)return S.nodes.push(e),e.parent=S,e.prev=k,k=e,e;k.value+=e.value};for(R({type:"bos"});O0){if(S.ranges>0){S.ranges=0;let e=S.nodes.shift();S.nodes=[e,{type:"text",value:r(S)}]}R({type:"comma",value:x}),S.commas++}else if(x===c&&j>0&&0===S.commas){let e=S.nodes;if(0===j||0===e.length){R({type:"text",value:x});continue}if("dot"===k.type){if(S.range=[],k.value+=x,k.type="range",3!==S.nodes.length&&5!==S.nodes.length){S.invalid=!0,S.ranges=0,k.type="text";continue}S.ranges++,S.args=[];continue}if("range"===k.type){e.pop();let t=e[e.length-1];t.value+=k.value+x,k=t,S.ranges--;continue}R({type:"dot",value:x})}else R({type:"text",value:x});else{if("brace"!==S.type){R({type:"text",value:x});continue}let e="close";S=_.pop(),S.close=!0,R({type:e,value:x}),j--,S=_[_.length-1]}else{j++;let e=k.value&&"$"===k.value.slice(-1)||!0===S.dollar;S=R({type:"brace",open:!0,close:!1,dollar:e,depth:j,commas:0,ranges:0,nodes:[]}),_.push(S),R({type:"open",value:x})}else{let e,n=x;for(!0!==t.keepQuotes&&(x="");O{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)}));let e=_[_.length-1],t=e.nodes.indexOf(S);e.nodes.splice(t,1,...S.nodes)}}while(_.length>0);return R({type:"eos"}),w}},3349:(e,t,n)=>{"use strict";const r=n(3083);e.exports=(e,t={})=>{let n=(e,a={})=>{let o=t.escapeInvalid&&r.isInvalidBrace(a),i=!0===e.invalid&&!0===t.escapeInvalid,s="";if(e.value)return(o||i)&&r.isOpenOrClose(e)?"\\"+e.value:e.value;if(e.value)return e.value;if(e.nodes)for(let t of e.nodes)s+=n(t);return s};return n(e)}},3083:(e,t)=>{"use strict";t.isInteger=e=>"number"==typeof e?Number.isInteger(e):"string"==typeof e&&""!==e.trim()&&Number.isInteger(Number(e)),t.find=(e,t)=>e.nodes.find((e=>e.type===t)),t.exceedsLimit=(e,n,r=1,a)=>!1!==a&&!(!t.isInteger(e)||!t.isInteger(n))&&(Number(n)-Number(e))/Number(r)>=a,t.escapeNode=(e,t=0,n)=>{let r=e.nodes[t];r&&(n&&r.type===n||"open"===r.type||"close"===r.type)&&!0!==r.escaped&&(r.value="\\"+r.value,r.escaped=!0)},t.encloseBrace=e=>"brace"===e.type&&e.commas>>0+e.ranges>>0==0&&(e.invalid=!0,!0),t.isInvalidBrace=e=>!("brace"!==e.type||!0!==e.invalid&&!e.dollar&&(e.commas>>0+e.ranges>>0!=0&&!0===e.open&&!0===e.close||(e.invalid=!0,0))),t.isOpenOrClose=e=>"open"===e.type||"close"===e.type||!0===e.open||!0===e.close,t.reduce=e=>e.reduce(((e,t)=>("text"===t.type&&e.push(t.value),"range"===t.type&&(t.type="text"),e)),[]),t.flatten=(...e)=>{const t=[],n=e=>{for(let r=0;r{"use strict";const{parseContentType:r}=n(1510),a=[n(7626),n(4403)].filter((function(e){return"function"==typeof e.detect}));e.exports=e=>{if("object"==typeof e&&null!==e||(e={}),"object"!=typeof e.headers||null===e.headers||"string"!=typeof e.headers["content-type"])throw new Error("Missing Content-Type");return function(e){const t=e.headers,n=r(t["content-type"]);if(!n)throw new Error("Malformed content type");for(const r of a){if(!r.detect(n))continue;const a={limits:e.limits,headers:t,conType:n,highWaterMark:void 0,fileHwm:void 0,defCharset:void 0,defParamCharset:void 0,preservePath:!1};return e.highWaterMark&&(a.highWaterMark=e.highWaterMark),e.fileHwm&&(a.fileHwm=e.fileHwm),a.defCharset=e.defCharset,a.defParamCharset=e.defParamCharset,a.preservePath=e.preservePath,new r(a)}throw new Error(`Unsupported content type: ${t["content-type"]}`)}(e)}},7626:(e,t,n)=>{"use strict";const{Readable:r,Writable:a}=n(2781),o=n(1301),{basename:i,convertToUTF8:s,getDecoder:c,parseContentType:u,parseDisposition:p}=n(1510),l=Buffer.from("\r\n"),d=Buffer.from("\r"),f=Buffer.from("-");function m(){}const v=16384;class h{constructor(e){this.header=Object.create(null),this.pairCount=0,this.byteCount=0,this.state=0,this.name="",this.value="",this.crlf=0,this.cb=e}reset(){this.header=Object.create(null),this.pairCount=0,this.byteCount=0,this.state=0,this.name="",this.value="",this.crlf=0}push(e,t,n){let r=t;for(;t{if(this._read(),0==--t._fileEndsLeft&&t._finalcb){const e=t._finalcb;t._finalcb=null,process.nextTick(e)}}))}_read(e){const t=this._readcb;t&&(this._readcb=null,t())}}const g={push:(e,t)=>{},destroy:()=>{}};function y(e,t){return e}function x(e,t,n){if(n)return t(n);t(n=w(e))}function w(e){if(e._hparser)return new Error("Malformed part header");const t=e._fileStream;return t&&(e._fileStream=null,t.destroy(new Error("Unexpected end of file"))),e._complete?void 0:new Error("Unexpected end of form")}const _=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],S=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];e.exports=class extends a{constructor(e){if(super({autoDestroy:!0,emitClose:!0,highWaterMark:"number"==typeof e.highWaterMark?e.highWaterMark:void 0}),!e.conType.params||"string"!=typeof e.conType.params.boundary)throw new Error("Multipart: Boundary not found");const t=e.conType.params.boundary,n="string"==typeof e.defParamCharset&&e.defParamCharset?c(e.defParamCharset):y,r=e.defCharset||"utf8",a=e.preservePath,v={autoDestroy:!0,emitClose:!0,highWaterMark:"number"==typeof e.fileHwm?e.fileHwm:void 0},x=e.limits,w=x&&"number"==typeof x.fieldSize?x.fieldSize:1048576,_=x&&"number"==typeof x.fileSize?x.fileSize:1/0,S=x&&"number"==typeof x.files?x.files:1/0,k=x&&"number"==typeof x.fields?x.fields:1/0,E=x&&"number"==typeof x.parts?x.parts:1/0;let A=-1,O=0,j=0,C=!1;this._fileEndsLeft=0,this._fileStream=void 0,this._complete=!1;let R,I,T,P,N,U=0,D=0,L=!1,M=!1,F=!1;this._hparser=null;const H=new h((e=>{let t;if(this._hparser=null,C=!1,P="text/plain",I=r,T="7bit",N=void 0,L=!1,!e["content-disposition"])return void(C=!0);const o=p(e["content-disposition"][0],n);if(o&&"form-data"===o.type){if(o.params&&(o.params.name&&(N=o.params.name),o.params["filename*"]?t=o.params["filename*"]:o.params.filename&&(t=o.params.filename),void 0===t||a||(t=i(t))),e["content-type"]){const t=u(e["content-type"][0]);t&&(P=`${t.type}/${t.subtype}`,t.params&&"string"==typeof t.params.charset&&(I=t.params.charset.toLowerCase()))}if(e["content-transfer-encoding"]&&(T=e["content-transfer-encoding"][0].toLowerCase()),"application/octet-stream"===P||void 0!==t){if(j===S)return M||(M=!0,this.emit("filesLimit")),void(C=!0);if(++j,0===this.listenerCount("file"))return void(C=!0);U=0,this._fileStream=new b(v,this),++this._fileEndsLeft,this.emit("file",N,this._fileStream,{filename:t,encoding:T,mimeType:P})}else{if(O===k)return F||(F=!0,this.emit("fieldsLimit")),void(C=!0);if(++O,0===this.listenerCount("field"))return void(C=!0);R=[],D=0}}else C=!0}));let q=0;const B=(e,t,n,r,a)=>{e:for(;t;){if(null!==this._hparser){const e=this._hparser.push(t,n,r);if(-1===e){this._hparser=null,H.reset(),this.emit("error",new Error("Malformed part header"));break}n=e}if(n===r)break;if(0!==q){if(1===q){switch(t[n]){case 45:q=2,++n;break;case 13:q=3,++n;break;default:q=0}if(n===r)return}if(2===q){if(q=0,45===t[n])return this._complete=!0,void(this._bparser=g);const e=this._writecb;this._writecb=m,B(!1,f,0,1,!1),this._writecb=e}else if(3===q){if(q=0,10===t[n]){if(++n,A>=E)break;if(this._hparser=H,n===r)break;continue e}{const e=this._writecb;this._writecb=m,B(!1,d,0,1,!1),this._writecb=e}}}if(!C)if(this._fileStream){let e;const o=Math.min(r-n,_-U);a?e=t.slice(n,n+o):(e=Buffer.allocUnsafe(o),t.copy(e,0,n,n+o)),U+=e.length,U===_?(e.length>0&&this._fileStream.push(e),this._fileStream.emit("limit"),this._fileStream.truncated=!0,C=!0):this._fileStream.push(e)||(this._writecb&&(this._fileStream._readcb=this._writecb),this._writecb=null)}else if(void 0!==R){let e;const o=Math.min(r-n,w-D);a?e=t.slice(n,n+o):(e=Buffer.allocUnsafe(o),t.copy(e,0,n,n+o)),D+=o,R.push(e),D===w&&(C=!0,L=!0)}break}if(e){if(q=1,this._fileStream)this._fileStream.push(null),this._fileStream=null;else if(void 0!==R){let e;switch(R.length){case 0:e="";break;case 1:e=s(R[0],I,0);break;default:e=s(Buffer.concat(R,D),I,0)}R=void 0,D=0,this.emit("field",N,e,{nameTruncated:!1,valueTruncated:L,encoding:T,mimeType:P})}++A===E&&this.emit("partsLimit")}};this._bparser=new o(`\r\n--${t}`,B),this._writecb=null,this._finalcb=null,this.write(l)}static detect(e){return"multipart"===e.type&&"form-data"===e.subtype}_write(e,t,n){this._writecb=n,this._bparser.push(e,0),this._writecb&&function(e,t){const n=e._writecb;e._writecb=null,n&&n()}(this)}_destroy(e,t){this._hparser=null,this._bparser=g,e||(e=w(this));const n=this._fileStream;n&&(this._fileStream=null,n.destroy(e)),t(e)}_final(e){if(this._bparser.destroy(),!this._complete)return e(new Error("Unexpected end of form"));this._fileEndsLeft?this._finalcb=x.bind(null,this,e):x(this,e)}}},4403:(e,t,n)=>{"use strict";const{Writable:r}=n(2781),{getDecoder:a}=n(1510);function o(e,t,n,r){if(n>=r)return r;if(-1===e._byte){const a=c[t[n++]];if(-1===a)return-1;if(a>=8&&(e._encode=2),ne.fieldNameSizeLimit){for(e._keyTrunc||e._lastPose.fieldSizeLimit){for(e._valTrunc||e._lastPos=this.fieldsLimit)return n();let r=0;const a=e.length;if(this._lastPos=0,-2!==this._byte){if(r=o(this,e,r,a),-1===r)return n(new Error("Malformed urlencoded form"));if(r>=a)return n();this._inKey?++this._bytesKey:++this._bytesVal}e:for(;r0&&this.emit("field",this._key,"",{nameTruncated:this._keyTrunc,valueTruncated:!1,encoding:this.charset,mimeType:"text/plain"}),this._key="",this._val="",this._keyTrunc=!1,this._valTrunc=!1,this._bytesKey=0,this._bytesVal=0,++this._fields>=this.fieldsLimit)return this.emit("fieldsLimit"),n();continue;case 43:this._lastPos=a)return n();++this._bytesKey,r=i(this,e,r,a);continue}++r,++this._bytesKey,r=i(this,e,r,a)}this._lastPos0||this._bytesVal>0)&&this.emit("field",this._key,this._val,{nameTruncated:this._keyTrunc,valueTruncated:this._valTrunc,encoding:this.charset,mimeType:"text/plain"}),this._key="",this._val="",this._keyTrunc=!1,this._valTrunc=!1,this._bytesKey=0,this._bytesVal=0,++this._fields>=this.fieldsLimit)return this.emit("fieldsLimit"),n();continue e;case 43:this._lastPos=a)return n();++this._bytesVal,r=s(this,e,r,a);continue}++r,++this._bytesVal,r=s(this,e,r,a)}this._lastPos0||this._bytesVal>0)&&(this._inKey?this._key=this._decoder(this._key,this._encode):this._val=this._decoder(this._val,this._encode),this.emit("field",this._key,this._val,{nameTruncated:this._keyTrunc,valueTruncated:this._valTrunc,encoding:this.charset,mimeType:"text/plain"})),e()}}},1510:function(e){"use strict";function t(e,t,n){for(;t=128?r=2:0===r&&(r=1);continue}return}break}}if(m+=e.slice(d,t),m=o(m,f,r),void 0===m)return}else{if(++t===e.length)return;if(34===e.charCodeAt(t)){d=++t;let n=!1;for(;t{if(0===e.length)return"";if("string"==typeof e){if(t<2)return e;e=Buffer.from(e,"latin1")}return e.utf8Slice(0,e.length)},latin1:(e,t)=>0===e.length?"":"string"==typeof e?e:e.latin1Slice(0,e.length),utf16le:(e,t)=>0===e.length?"":("string"==typeof e&&(e=Buffer.from(e,"latin1")),e.ucs2Slice(0,e.length)),base64:(e,t)=>0===e.length?"":("string"==typeof e&&(e=Buffer.from(e,"latin1")),e.base64Slice(0,e.length)),other:(e,t)=>{if(0===e.length)return"";"string"==typeof e&&(e=Buffer.from(e,"latin1"));try{return new TextDecoder(this).decode(e)}catch{}}};function o(e,t,n){const a=r(t);if(a)return a(e,n)}const i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],s=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,0,0,0,0,1,0,1,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],p=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];e.exports={basename:function(e){if("string"!=typeof e)return"";for(let t=e.length-1;t>=0;--t)switch(e.charCodeAt(t)){case 47:case 92:return".."===(e=e.slice(t+1))||"."===e?"":e}return".."===e||"."===e?"":e},convertToUTF8:o,getDecoder:r,parseContentType:function(e){if(0===e.length)return;const n=Object.create(null);let r=0;for(;r{"use strict";e.exports=function(e,t){return"string"==typeof e?i(e):"number"==typeof e?o(e,t):null},e.exports.format=o,e.exports.parse=i;var t=/\B(?=(\d{3})+(?!\d))/g,n=/(?:\.0*|(\.[^0]+)0+)$/,r={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},a=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function o(e,a){if(!Number.isFinite(e))return null;var o=Math.abs(e),i=a&&a.thousandsSeparator||"",s=a&&a.unitSeparator||"",c=a&&void 0!==a.decimalPlaces?a.decimalPlaces:2,u=Boolean(a&&a.fixedDecimals),p=a&&a.unit||"";p&&r[p.toLowerCase()]||(p=o>=r.pb?"PB":o>=r.tb?"TB":o>=r.gb?"GB":o>=r.mb?"MB":o>=r.kb?"KB":"B");var l=(e/r[p.toLowerCase()]).toFixed(c);return u||(l=l.replace(n,"$1")),i&&(l=l.split(".").map((function(e,n){return 0===n?e.replace(t,i):e})).join(".")),l+s+p}function i(e){if("number"==typeof e&&!isNaN(e))return e;if("string"!=typeof e)return null;var t,n=a.exec(e),o="b";return n?(t=parseFloat(n[1]),o=n[4].toLowerCase()):(t=parseInt(e,10),o="b"),isNaN(t)?null:Math.floor(r[o]*t)}},1924:(e,t,n)=>{"use strict";var r=n(210),a=n(5559),o=a(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&o(e,".prototype.")>-1?a(n):n}},5559:(e,t,n)=>{"use strict";var r=n(8612),a=n(210),o=a("%Function.prototype.apply%"),i=a("%Function.prototype.call%"),s=a("%Reflect.apply%",!0)||r.call(i,o),c=a("%Object.getOwnPropertyDescriptor%",!0),u=a("%Object.defineProperty%",!0),p=a("%Math.max%");if(u)try{u({},"a",{value:1})}catch(e){u=null}e.exports=function(e){var t=s(r,i,arguments);if(c&&u){var n=c(t,"length");n.configurable&&u(t,"length",{value:1+p(0,e.length-(arguments.length-1))})}return t};var l=function(){return s(r,o,arguments)};u?u(e.exports,"apply",{value:l}):e.exports.apply=l},7389:(e,t,n)=>{"use strict";e.exports=function(e,t){var n=t||{},a=n.type||"attachment",o=function(e,t){if(void 0!==e){var n={};if("string"!=typeof e)throw new TypeError("filename must be a string");if(void 0===t&&(t=!0),"string"!=typeof t&&"boolean"!=typeof t)throw new TypeError("fallback must be a string or boolean");if("string"==typeof t&&c.test(t))throw new TypeError("fallback must be ISO-8859-1 string");var a=r(e),o=d.test(a),s="string"!=typeof t?t&&b(a):r(t),u="string"==typeof s&&s!==a;return(u||!o||i.test(a))&&(n["filename*"]=a),(o||u)&&(n.filename=u?s:a),n}}(e,n.fallback);return function(e){var t=e.parameters,n=e.type;if(!n||"string"!=typeof n||!f.test(n))throw new TypeError("invalid type");var r=String(n).toLowerCase();if(t&&"object"==typeof t)for(var a,o=Object.keys(t).sort(),i=0;i?@[\\\]{}\x7f]/g,i=/%[0-9A-Fa-f]{2}/,s=/%([0-9A-Fa-f]{2})/g,c=/[^\x20-\x7e\xa0-\xff]/g,u=/\\([\u0000-\u007f])/g,p=/([\\"])/g,l=/;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g,d=/^[\x20-\x7e\x80-\xff]+$/,f=/^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/,m=/^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/,v=/^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/;function h(e){var t=m.exec(e);if(!t)throw new TypeError("invalid extended field value");var n,r=t[1].toLowerCase(),o=t[2].replace(s,g);switch(r){case"iso-8859-1":n=b(o);break;case"utf-8":n=a.from(o,"binary").toString("utf8");break;default:throw new TypeError("unsupported charset in extended field")}return n}function b(e){return String(e).replace(c,"?")}function g(e,t){return String.fromCharCode(parseInt(t,16))}function y(e){return"%"+String(e).charCodeAt(0).toString(16).toUpperCase()}function x(e){return'"'+String(e).replace(p,"\\$1")+'"'}function w(e){var t=String(e);return"UTF-8''"+encodeURIComponent(t).replace(o,y)}function _(e,t){this.type=e,this.parameters=t}},7296:(e,t,n)=>{var r=n(4300),a=r.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function i(e,t,n){return a(e,t,n)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=i),i.prototype=Object.create(a.prototype),o(a,i),i.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return a(e,t,n)},i.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=a(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},7811:(e,t)=>{"use strict";var n=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,r=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,a=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,o=/\\([\u000b\u0020-\u00ff])/g,i=/([\\"])/g,s=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function c(e){var t=String(e);if(a.test(t))return t;if(t.length>0&&!r.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(i,"\\$1")+'"'}function u(e){this.parameters=Object.create(null),this.type=e}t.format=function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var t=e.parameters,n=e.type;if(!n||!s.test(n))throw new TypeError("invalid type");var r=n;if(t&&"object"==typeof t)for(var o,i=Object.keys(t).sort(),u=0;u{var r=n(6113);function a(e){return r.createHash("sha1").update(e).digest("hex")}t.sign=function(e,t){if("string"!=typeof e)throw new TypeError("Cookie value must be provided as a string.");if("string"!=typeof t)throw new TypeError("Secret string must be provided.");return e+"."+r.createHmac("sha256",t).update(e).digest("base64").replace(/\=+$/,"")},t.unsign=function(e,n){if("string"!=typeof e)throw new TypeError("Signed cookie string must be provided.");if("string"!=typeof n)throw new TypeError("Secret string must be provided.");var r=e.slice(0,e.lastIndexOf("."));return a(t.sign(r,n))==a(e)&&r}},6489:(e,t)=>{"use strict";t.parse=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var n={},r=(t||{}).decode||a,o=0;o{var r=n(614),a=n(6330),o=TypeError;e.exports=function(e){if(r(e))return e;throw o(a(e)+" is not a function")}},9483:(e,t,n)=>{var r=n(4411),a=n(6330),o=TypeError;e.exports=function(e){if(r(e))return e;throw o(a(e)+" is not a constructor")}},6077:(e,t,n)=>{var r=n(614),a=String,o=TypeError;e.exports=function(e){if("object"==typeof e||r(e))return e;throw o("Can't set "+a(e)+" as a prototype")}},1223:(e,t,n)=>{var r=n(5112),a=n(30),o=n(3070).f,i=r("unscopables"),s=Array.prototype;null==s[i]&&o(s,i,{configurable:!0,value:a(null)}),e.exports=function(e){s[i][e]=!0}},1530:(e,t,n)=>{"use strict";var r=n(8710).charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},5787:(e,t,n)=>{var r=n(7976),a=TypeError;e.exports=function(e,t){if(r(t,e))return e;throw a("Incorrect invocation")}},9670:(e,t,n)=>{var r=n(111),a=String,o=TypeError;e.exports=function(e){if(r(e))return e;throw o(a(e)+" is not an object")}},8533:(e,t,n)=>{"use strict";var r=n(2092).forEach,a=n(9341)("forEach");e.exports=a?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},8457:(e,t,n)=>{"use strict";var r=n(9974),a=n(6916),o=n(7908),i=n(3411),s=n(7659),c=n(4411),u=n(6244),p=n(6135),l=n(4121),d=n(1246),f=Array;e.exports=function(e){var t=o(e),n=c(this),m=arguments.length,v=m>1?arguments[1]:void 0,h=void 0!==v;h&&(v=r(v,m>2?arguments[2]:void 0));var b,g,y,x,w,_,S=d(t),k=0;if(!S||this===f&&s(S))for(b=u(t),g=n?new this(b):f(b);b>k;k++)_=h?v(t[k],k):t[k],p(g,k,_);else for(w=(x=l(t,S)).next,g=n?new this:[];!(y=a(w,x)).done;k++)_=h?i(x,v,[y.value,k],!0):y.value,p(g,k,_);return g.length=k,g}},1318:(e,t,n)=>{var r=n(5656),a=n(1400),o=n(6244),i=function(e){return function(t,n,i){var s,c=r(t),u=o(c),p=a(i,u);if(e&&n!=n){for(;u>p;)if((s=c[p++])!=s)return!0}else for(;u>p;p++)if((e||p in c)&&c[p]===n)return e||p||0;return!e&&-1}};e.exports={includes:i(!0),indexOf:i(!1)}},2092:(e,t,n)=>{var r=n(9974),a=n(1702),o=n(8361),i=n(7908),s=n(6244),c=n(5417),u=a([].push),p=function(e){var t=1==e,n=2==e,a=3==e,p=4==e,l=6==e,d=7==e,f=5==e||l;return function(m,v,h,b){for(var g,y,x=i(m),w=o(x),_=r(v,h),S=s(w),k=0,E=b||c,A=t?E(m,S):n||d?E(m,0):void 0;S>k;k++)if((f||k in w)&&(y=_(g=w[k],k,x),e))if(t)A[k]=y;else if(y)switch(e){case 3:return!0;case 5:return g;case 6:return k;case 2:u(A,g)}else switch(e){case 4:return!1;case 7:u(A,g)}return l?-1:a||p?p:A}};e.exports={forEach:p(0),map:p(1),filter:p(2),some:p(3),every:p(4),find:p(5),findIndex:p(6),filterReject:p(7)}},1194:(e,t,n)=>{var r=n(7293),a=n(5112),o=n(7392),i=a("species");e.exports=function(e){return o>=51||!r((function(){var t=[];return(t.constructor={})[i]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},9341:(e,t,n)=>{"use strict";var r=n(7293);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){return 1},1)}))}},3671:(e,t,n)=>{var r=n(9662),a=n(7908),o=n(8361),i=n(6244),s=TypeError,c=function(e){return function(t,n,c,u){r(n);var p=a(t),l=o(p),d=i(p),f=e?d-1:0,m=e?-1:1;if(c<2)for(;;){if(f in l){u=l[f],f+=m;break}if(f+=m,e?f<0:d<=f)throw s("Reduce of empty array with no initial value")}for(;e?f>=0:d>f;f+=m)f in l&&(u=n(u,l[f],f,p));return u}};e.exports={left:c(!1),right:c(!0)}},1589:(e,t,n)=>{var r=n(1400),a=n(6244),o=n(6135),i=Array,s=Math.max;e.exports=function(e,t,n){for(var c=a(e),u=r(t,c),p=r(void 0===n?c:n,c),l=i(s(p-u,0)),d=0;u{var r=n(1702);e.exports=r([].slice)},4362:(e,t,n)=>{var r=n(1589),a=Math.floor,o=function(e,t){var n=e.length,c=a(n/2);return n<8?i(e,t):s(e,o(r(e,0,c),t),o(r(e,c),t),t)},i=function(e,t){for(var n,r,a=e.length,o=1;o0;)e[r]=e[--r];r!==o++&&(e[r]=n)}return e},s=function(e,t,n,r){for(var a=t.length,o=n.length,i=0,s=0;i{var r=n(3157),a=n(4411),o=n(111),i=n(5112)("species"),s=Array;e.exports=function(e){var t;return r(e)&&(t=e.constructor,(a(t)&&(t===s||r(t.prototype))||o(t)&&null===(t=t[i]))&&(t=void 0)),void 0===t?s:t}},5417:(e,t,n)=>{var r=n(7475);e.exports=function(e,t){return new(r(e))(0===t?0:t)}},3411:(e,t,n)=>{var r=n(9670),a=n(9212);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){a(e,"throw",t)}}},7072:(e,t,n)=>{var r=n(5112)("iterator"),a=!1;try{var o=0,i={next:function(){return{done:!!o++}},return:function(){a=!0}};i[r]=function(){return this},Array.from(i,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!a)return!1;var n=!1;try{var o={};o[r]=function(){return{next:function(){return{done:n=!0}}}},e(o)}catch(e){}return n}},4326:(e,t,n)=>{var r=n(1702),a=r({}.toString),o=r("".slice);e.exports=function(e){return o(a(e),8,-1)}},648:(e,t,n)=>{var r=n(1694),a=n(614),o=n(4326),i=n(5112)("toStringTag"),s=Object,c="Arguments"==o(function(){return arguments}());e.exports=r?o:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=s(e),i))?n:c?o(t):"Object"==(r=o(t))&&a(t.callee)?"Arguments":r}},9920:(e,t,n)=>{var r=n(2597),a=n(3887),o=n(1236),i=n(3070);e.exports=function(e,t,n){for(var s=a(t),c=i.f,u=o.f,p=0;p{var r=n(5112)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,"/./"[e](t)}catch(e){}}return!1}},8544:(e,t,n)=>{var r=n(7293);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},6178:e=>{e.exports=function(e,t){return{value:e,done:t}}},8880:(e,t,n)=>{var r=n(9781),a=n(3070),o=n(9114);e.exports=r?function(e,t,n){return a.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},9114:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},6135:(e,t,n)=>{"use strict";var r=n(4948),a=n(3070),o=n(9114);e.exports=function(e,t,n){var i=r(t);i in e?a.f(e,i,o(0,n)):e[i]=n}},7045:(e,t,n)=>{var r=n(6339),a=n(3070);e.exports=function(e,t,n){return n.get&&r(n.get,t,{getter:!0}),n.set&&r(n.set,t,{setter:!0}),a.f(e,t,n)}},8052:(e,t,n)=>{var r=n(614),a=n(3070),o=n(6339),i=n(3072);e.exports=function(e,t,n,s){s||(s={});var c=s.enumerable,u=void 0!==s.name?s.name:t;if(r(n)&&o(n,u,s),s.global)c?e[t]=n:i(t,n);else{try{s.unsafe?e[t]&&(c=!0):delete e[t]}catch(e){}c?e[t]=n:a.f(e,t,{value:n,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},3072:(e,t,n)=>{var r=n(7854),a=Object.defineProperty;e.exports=function(e,t){try{a(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},5117:(e,t,n)=>{"use strict";var r=n(6330),a=TypeError;e.exports=function(e,t){if(!delete e[t])throw a("Cannot delete property "+r(t)+" of "+r(e))}},9781:(e,t,n)=>{var r=n(7293);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},4154:e=>{var t="object"==typeof document&&document.all,n=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:n}},317:(e,t,n)=>{var r=n(7854),a=n(111),o=r.document,i=a(o)&&a(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},7207:e=>{var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},8324:e=>{e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8509:(e,t,n)=>{var r=n(317)("span").classList,a=r&&r.constructor&&r.constructor.prototype;e.exports=a===Object.prototype?void 0:a},8886:(e,t,n)=>{var r=n(8113).match(/firefox\/(\d+)/i);e.exports=!!r&&+r[1]},7871:(e,t,n)=>{var r=n(3823),a=n(5268);e.exports=!r&&!a&&"object"==typeof window&&"object"==typeof document},9363:e=>{e.exports="function"==typeof Bun&&Bun&&"string"==typeof Bun.version},3823:e=>{e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},256:(e,t,n)=>{var r=n(8113);e.exports=/MSIE|Trident/.test(r)},1528:(e,t,n)=>{var r=n(8113);e.exports=/ipad|iphone|ipod/i.test(r)&&"undefined"!=typeof Pebble},6833:(e,t,n)=>{var r=n(8113);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},5268:(e,t,n)=>{var r=n(4326);e.exports="undefined"!=typeof process&&"process"==r(process)},1036:(e,t,n)=>{var r=n(8113);e.exports=/web0s(?!.*chrome)/i.test(r)},8113:e=>{e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},7392:(e,t,n)=>{var r,a,o=n(7854),i=n(8113),s=o.process,c=o.Deno,u=s&&s.versions||c&&c.version,p=u&&u.v8;p&&(a=(r=p.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!a&&i&&(!(r=i.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=i.match(/Chrome\/(\d+)/))&&(a=+r[1]),e.exports=a},8008:(e,t,n)=>{var r=n(8113).match(/AppleWebKit\/(\d+)\./);e.exports=!!r&&+r[1]},748:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:(e,t,n)=>{var r=n(7854),a=n(1236).f,o=n(8880),i=n(8052),s=n(3072),c=n(9920),u=n(4705);e.exports=function(e,t){var n,p,l,d,f,m=e.target,v=e.global,h=e.stat;if(n=v?r:h?r[m]||s(m,{}):(r[m]||{}).prototype)for(p in t){if(d=t[p],l=e.dontCallGetSet?(f=a(n,p))&&f.value:n[p],!u(v?p:m+(h?".":"#")+p,e.forced)&&void 0!==l){if(typeof d==typeof l)continue;c(d,l)}(e.sham||l&&l.sham)&&o(d,"sham",!0),i(n,p,d,e)}}},7293:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},7007:(e,t,n)=>{"use strict";n(4916);var r=n(1470),a=n(8052),o=n(2261),i=n(7293),s=n(5112),c=n(8880),u=s("species"),p=RegExp.prototype;e.exports=function(e,t,n,l){var d=s(e),f=!i((function(){var t={};return t[d]=function(){return 7},7!=""[e](t)})),m=f&&!i((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[u]=function(){return n},n.flags="",n[d]=/./[d]),n.exec=function(){return t=!0,null},n[d](""),!t}));if(!f||!m||n){var v=r(/./[d]),h=t(d,""[e],(function(e,t,n,a,i){var s=r(e),c=t.exec;return c===o||c===p.exec?f&&!i?{done:!0,value:v(t,n,a)}:{done:!0,value:s(n,t,a)}:{done:!1}}));a(String.prototype,e,h[0]),a(p,d,h[1])}l&&c(p[d],"sham",!0)}},2104:(e,t,n)=>{var r=n(4374),a=Function.prototype,o=a.apply,i=a.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?i.bind(o):function(){return i.apply(o,arguments)})},9974:(e,t,n)=>{var r=n(1470),a=n(9662),o=n(4374),i=r(r.bind);e.exports=function(e,t){return a(e),void 0===t?e:o?i(e,t):function(){return e.apply(t,arguments)}}},4374:(e,t,n)=>{var r=n(7293);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},7065:(e,t,n)=>{"use strict";var r=n(1702),a=n(9662),o=n(111),i=n(2597),s=n(206),c=n(4374),u=Function,p=r([].concat),l=r([].join),d={},f=function(e,t,n){if(!i(d,t)){for(var r=[],a=0;a{var r=n(4374),a=Function.prototype.call;e.exports=r?a.bind(a):function(){return a.apply(a,arguments)}},6530:(e,t,n)=>{var r=n(9781),a=n(2597),o=Function.prototype,i=r&&Object.getOwnPropertyDescriptor,s=a(o,"name"),c=s&&"something"===function(){}.name,u=s&&(!r||r&&i(o,"name").configurable);e.exports={EXISTS:s,PROPER:c,CONFIGURABLE:u}},5668:(e,t,n)=>{var r=n(1702),a=n(9662);e.exports=function(e,t,n){try{return r(a(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}},1470:(e,t,n)=>{var r=n(4326),a=n(1702);e.exports=function(e){if("Function"===r(e))return a(e)}},1702:(e,t,n)=>{var r=n(4374),a=Function.prototype,o=a.call,i=r&&a.bind.bind(o,o);e.exports=r?i:function(e){return function(){return o.apply(e,arguments)}}},5005:(e,t,n)=>{var r=n(7854),a=n(614),o=function(e){return a(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?o(r[e]):r[e]&&r[e][t]}},1246:(e,t,n)=>{var r=n(648),a=n(8173),o=n(8554),i=n(7497),s=n(5112)("iterator");e.exports=function(e){if(!o(e))return a(e,s)||a(e,"@@iterator")||i[r(e)]}},4121:(e,t,n)=>{var r=n(6916),a=n(9662),o=n(9670),i=n(6330),s=n(1246),c=TypeError;e.exports=function(e,t){var n=arguments.length<2?s(e):t;if(a(n))return o(r(n,e));throw c(i(e)+" is not iterable")}},8044:(e,t,n)=>{var r=n(1702),a=n(3157),o=n(614),i=n(4326),s=n(1340),c=r([].push);e.exports=function(e){if(o(e))return e;if(a(e)){for(var t=e.length,n=[],r=0;r{var r=n(9662),a=n(8554);e.exports=function(e,t){var n=e[t];return a(n)?void 0:r(n)}},647:(e,t,n)=>{var r=n(1702),a=n(7908),o=Math.floor,i=r("".charAt),s=r("".replace),c=r("".slice),u=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,p=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,n,r,l,d){var f=n+e.length,m=r.length,v=p;return void 0!==l&&(l=a(l),v=u),s(d,v,(function(a,s){var u;switch(i(s,0)){case"$":return"$";case"&":return e;case"`":return c(t,0,n);case"'":return c(t,f);case"<":u=l[c(s,1,-1)];break;default:var p=+s;if(0===p)return a;if(p>m){var d=o(p/10);return 0===d?a:d<=m?void 0===r[d-1]?i(s,1):r[d-1]+i(s,1):a}u=r[p-1]}return void 0===u?"":u}))}},7854:e=>{var t=function(e){return e&&e.Math==Math&&e};e.exports=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof global&&global)||function(){return this}()||Function("return this")()},2597:(e,t,n)=>{var r=n(1702),a=n(7908),o=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(a(e),t)}},3501:e=>{e.exports={}},842:e=>{e.exports=function(e,t){try{1==arguments.length?console.error(e):console.error(e,t)}catch(e){}}},490:(e,t,n)=>{var r=n(5005);e.exports=r("document","documentElement")},4664:(e,t,n)=>{var r=n(9781),a=n(7293),o=n(317);e.exports=!r&&!a((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},8361:(e,t,n)=>{var r=n(1702),a=n(7293),o=n(4326),i=Object,s=r("".split);e.exports=a((function(){return!i("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?s(e,""):i(e)}:i},9587:(e,t,n)=>{var r=n(614),a=n(111),o=n(7674);e.exports=function(e,t,n){var i,s;return o&&r(i=t.constructor)&&i!==n&&a(s=i.prototype)&&s!==n.prototype&&o(e,s),e}},2788:(e,t,n)=>{var r=n(1702),a=n(614),o=n(5465),i=r(Function.toString);a(o.inspectSource)||(o.inspectSource=function(e){return i(e)}),e.exports=o.inspectSource},9909:(e,t,n)=>{var r,a,o,i=n(4811),s=n(7854),c=n(111),u=n(8880),p=n(2597),l=n(5465),d=n(6200),f=n(3501),m="Object already initialized",v=s.TypeError,h=s.WeakMap;if(i||l.state){var b=l.state||(l.state=new h);b.get=b.get,b.has=b.has,b.set=b.set,r=function(e,t){if(b.has(e))throw v(m);return t.facade=e,b.set(e,t),t},a=function(e){return b.get(e)||{}},o=function(e){return b.has(e)}}else{var g=d("state");f[g]=!0,r=function(e,t){if(p(e,g))throw v(m);return t.facade=e,u(e,g,t),t},a=function(e){return p(e,g)?e[g]:{}},o=function(e){return p(e,g)}}e.exports={set:r,get:a,has:o,enforce:function(e){return o(e)?a(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!c(t)||(n=a(t)).type!==e)throw v("Incompatible receiver, "+e+" required");return n}}}},7659:(e,t,n)=>{var r=n(5112),a=n(7497),o=r("iterator"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(a.Array===e||i[o]===e)}},3157:(e,t,n)=>{var r=n(4326);e.exports=Array.isArray||function(e){return"Array"==r(e)}},614:(e,t,n)=>{var r=n(4154),a=r.all;e.exports=r.IS_HTMLDDA?function(e){return"function"==typeof e||e===a}:function(e){return"function"==typeof e}},4411:(e,t,n)=>{var r=n(1702),a=n(7293),o=n(614),i=n(648),s=n(5005),c=n(2788),u=function(){},p=[],l=s("Reflect","construct"),d=/^\s*(?:class|function)\b/,f=r(d.exec),m=!d.exec(u),v=function(e){if(!o(e))return!1;try{return l(u,p,e),!0}catch(e){return!1}},h=function(e){if(!o(e))return!1;switch(i(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return m||!!f(d,c(e))}catch(e){return!0}};h.sham=!0,e.exports=!l||a((function(){var e;return v(v.call)||!v(Object)||!v((function(){e=!0}))||e}))?h:v},4705:(e,t,n)=>{var r=n(7293),a=n(614),o=/#|\.prototype\./,i=function(e,t){var n=c[s(e)];return n==p||n!=u&&(a(t)?r(t):!!t)},s=i.normalize=function(e){return String(e).replace(o,".").toLowerCase()},c=i.data={},u=i.NATIVE="N",p=i.POLYFILL="P";e.exports=i},5988:(e,t,n)=>{var r=n(111),a=Math.floor;e.exports=Number.isInteger||function(e){return!r(e)&&isFinite(e)&&a(e)===e}},8554:e=>{e.exports=function(e){return null==e}},111:(e,t,n)=>{var r=n(614),a=n(4154),o=a.all;e.exports=a.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:r(e)||e===o}:function(e){return"object"==typeof e?null!==e:r(e)}},1913:e=>{e.exports=!1},7850:(e,t,n)=>{var r=n(111),a=n(4326),o=n(5112)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==a(e))}},2190:(e,t,n)=>{var r=n(5005),a=n(614),o=n(7976),i=n(3307),s=Object;e.exports=i?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return a(t)&&o(t.prototype,s(e))}},408:(e,t,n)=>{var r=n(9974),a=n(6916),o=n(9670),i=n(6330),s=n(7659),c=n(6244),u=n(7976),p=n(4121),l=n(1246),d=n(9212),f=TypeError,m=function(e,t){this.stopped=e,this.result=t},v=m.prototype;e.exports=function(e,t,n){var h,b,g,y,x,w,_,S=n&&n.that,k=!(!n||!n.AS_ENTRIES),E=!(!n||!n.IS_RECORD),A=!(!n||!n.IS_ITERATOR),O=!(!n||!n.INTERRUPTED),j=r(t,S),C=function(e){return h&&d(h,"normal",e),new m(!0,e)},R=function(e){return k?(o(e),O?j(e[0],e[1],C):j(e[0],e[1])):O?j(e,C):j(e)};if(E)h=e.iterator;else if(A)h=e;else{if(!(b=l(e)))throw f(i(e)+" is not iterable");if(s(b)){for(g=0,y=c(e);y>g;g++)if((x=R(e[g]))&&u(v,x))return x;return new m(!1)}h=p(e,b)}for(w=E?e.next:h.next;!(_=a(w,h)).done;){try{x=R(_.value)}catch(e){d(h,"throw",e)}if("object"==typeof x&&x&&u(v,x))return x}return new m(!1)}},9212:(e,t,n)=>{var r=n(6916),a=n(9670),o=n(8173);e.exports=function(e,t,n){var i,s;a(e);try{if(!(i=o(e,"return"))){if("throw"===t)throw n;return n}i=r(i,e)}catch(e){s=!0,i=e}if("throw"===t)throw n;if(s)throw i;return a(i),n}},3061:(e,t,n)=>{"use strict";var r=n(3383).IteratorPrototype,a=n(30),o=n(9114),i=n(8003),s=n(7497),c=function(){return this};e.exports=function(e,t,n,u){var p=t+" Iterator";return e.prototype=a(r,{next:o(+!u,n)}),i(e,p,!1,!0),s[p]=c,e}},1656:(e,t,n)=>{"use strict";var r=n(2109),a=n(6916),o=n(1913),i=n(6530),s=n(614),c=n(3061),u=n(9518),p=n(7674),l=n(8003),d=n(8880),f=n(8052),m=n(5112),v=n(7497),h=n(3383),b=i.PROPER,g=i.CONFIGURABLE,y=h.IteratorPrototype,x=h.BUGGY_SAFARI_ITERATORS,w=m("iterator"),_="keys",S="values",k="entries",E=function(){return this};e.exports=function(e,t,n,i,m,h,A){c(n,t,i);var O,j,C,R=function(e){if(e===m&&U)return U;if(!x&&e in P)return P[e];switch(e){case _:case S:case k:return function(){return new n(this,e)}}return function(){return new n(this)}},I=t+" Iterator",T=!1,P=e.prototype,N=P[w]||P["@@iterator"]||m&&P[m],U=!x&&N||R(m),D="Array"==t&&P.entries||N;if(D&&(O=u(D.call(new e)))!==Object.prototype&&O.next&&(o||u(O)===y||(p?p(O,y):s(O[w])||f(O,w,E)),l(O,I,!0,!0),o&&(v[I]=E)),b&&m==S&&N&&N.name!==S&&(!o&&g?d(P,"name",S):(T=!0,U=function(){return a(N,this)})),m)if(j={values:R(S),keys:h?U:R(_),entries:R(k)},A)for(C in j)(x||T||!(C in P))&&f(P,C,j[C]);else r({target:t,proto:!0,forced:x||T},j);return o&&!A||P[w]===U||f(P,w,U,{name:m}),v[t]=U,j}},3383:(e,t,n)=>{"use strict";var r,a,o,i=n(7293),s=n(614),c=n(111),u=n(30),p=n(9518),l=n(8052),d=n(5112),f=n(1913),m=d("iterator"),v=!1;[].keys&&("next"in(o=[].keys())?(a=p(p(o)))!==Object.prototype&&(r=a):v=!0),!c(r)||i((function(){var e={};return r[m].call(e)!==e}))?r={}:f&&(r=u(r)),s(r[m])||l(r,m,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:v}},7497:e=>{e.exports={}},6244:(e,t,n)=>{var r=n(7466);e.exports=function(e){return r(e.length)}},6339:(e,t,n)=>{var r=n(1702),a=n(7293),o=n(614),i=n(2597),s=n(9781),c=n(6530).CONFIGURABLE,u=n(2788),p=n(9909),l=p.enforce,d=p.get,f=String,m=Object.defineProperty,v=r("".slice),h=r("".replace),b=r([].join),g=s&&!a((function(){return 8!==m((function(){}),"length",{value:8}).length})),y=String(String).split("String"),x=e.exports=function(e,t,n){"Symbol("===v(f(t),0,7)&&(t="["+h(f(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!i(e,"name")||c&&e.name!==t)&&(s?m(e,"name",{value:t,configurable:!0}):e.name=t),g&&n&&i(n,"arity")&&e.length!==n.arity&&m(e,"length",{value:n.arity});try{n&&i(n,"constructor")&&n.constructor?s&&m(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=l(e);return i(r,"source")||(r.source=b(y,"string"==typeof t?t:"")),e};Function.prototype.toString=x((function(){return o(this)&&d(this).source||u(this)}),"toString")},4758:e=>{var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},5948:(e,t,n)=>{var r,a,o,i,s,c=n(7854),u=n(9974),p=n(1236).f,l=n(261).set,d=n(8572),f=n(6833),m=n(1528),v=n(1036),h=n(5268),b=c.MutationObserver||c.WebKitMutationObserver,g=c.document,y=c.process,x=c.Promise,w=p(c,"queueMicrotask"),_=w&&w.value;if(!_){var S=new d,k=function(){var e,t;for(h&&(e=y.domain)&&e.exit();t=S.get();)try{t()}catch(e){throw S.head&&r(),e}e&&e.enter()};f||h||v||!b||!g?!m&&x&&x.resolve?((i=x.resolve(void 0)).constructor=x,s=u(i.then,i),r=function(){s(k)}):h?r=function(){y.nextTick(k)}:(l=u(l,c),r=function(){l(k)}):(a=!0,o=g.createTextNode(""),new b(k).observe(o,{characterData:!0}),r=function(){o.data=a=!a}),_=function(e){S.head||r(),S.add(e)}}e.exports=_},8523:(e,t,n)=>{"use strict";var r=n(9662),a=TypeError,o=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw a("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new o(e)}},3929:(e,t,n)=>{var r=n(7850),a=TypeError;e.exports=function(e){if(r(e))throw a("The method doesn't accept regular expressions");return e}},2814:(e,t,n)=>{var r=n(7854),a=n(7293),o=n(1702),i=n(1340),s=n(3111).trim,c=n(1361),u=o("".charAt),p=r.parseFloat,l=r.Symbol,d=l&&l.iterator,f=1/p(c+"-0")!=-1/0||d&&!a((function(){p(Object(d))}));e.exports=f?function(e){var t=s(i(e)),n=p(t);return 0===n&&"-"==u(t,0)?-0:n}:p},30:(e,t,n)=>{var r,a=n(9670),o=n(6048),i=n(748),s=n(3501),c=n(490),u=n(317),p=n(6200)("IE_PROTO"),l=function(){},d=function(e){return"