@stonecrop/beam 0.4.29 → 0.4.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/beam.umd.cjs CHANGED
@@ -1,14 +1,14 @@
1
- (function(Te,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],E):(Te=typeof globalThis<"u"?globalThis:Te||self,E(Te["@stonecrop/beam"]={},Te.Vue))})(this,function(Te,E){"use strict";var lc=Object.defineProperty;var Aa=Te=>{throw TypeError(Te)};var uc=(Te,E,ze)=>E in Te?lc(Te,E,{enumerable:!0,configurable:!0,writable:!0,value:ze}):Te[E]=ze;var He=(Te,E,ze)=>uc(Te,typeof E!="symbol"?E+"":E,ze),Mi=(Te,E,ze)=>E.has(Te)||Aa("Cannot "+ze);var B=(Te,E,ze)=>(Mi(Te,E,"read from private field"),ze?ze.call(Te):E.get(Te)),Ue=(Te,E,ze)=>E.has(Te)?Aa("Cannot add the same private member more than once"):E instanceof WeakSet?E.add(Te):E.set(Te,ze),Oe=(Te,E,ze,er)=>(Mi(Te,E,"write to private field"),er?er.call(Te,ze):E.set(Te,ze),ze),ke=(Te,E,ze)=>(Mi(Te,E,"access private method"),ze);var Nr=(Te,E,ze,er)=>({set _(Wr){Oe(Te,E,Wr,ze)},get _(){return B(Te,E,er)}});var ze=document.createElement("style");ze.textContent=`@import"https://fonts.googleapis.com/css2?family=Arimo:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap";.beam_action-footer[data-v-37933bd1]{margin-left:0;background:linear-gradient(180deg,transparent 0%,white 100%);color:var(--sc-primary-text-color);position:fixed;bottom:0;left:0;width:100%;padding:.625rem;text-align:center}.beam_metadata_arrow[data-v-94fbdac5]{align-self:center;flex-grow:1;position:relative;display:flex;align-items:center}.beam_metadata_arrow-body[data-v-94fbdac5]{width:100%;height:10px;background:#c4c4c4}.beam_metadata_arrow-head svg[data-v-94fbdac5]{width:20px;display:block}.beam_btn[data-v-bc768596]{font-size:.875rem;text-align:center;padding:.3125rem .75rem;border:1px solid var(--sc-btn-border);color:var(--sc-btn-label-color);background-color:var(--sc-btn-color);cursor:pointer;font-family:var(--sc-font-family)}.beam_btn[data-v-bc768596]:hover,.beam_btn[data-v-bc768596]:active{background-color:var(--sc-btn-hover)}.beam_btn a:link,.beam_btn a:visited,.beam_btn a:hover,.beam_btn a:active{text-decoration:none;color:var(--sc-btn-label-color)}.beam_day-divider[data-v-160cf6ef]{text-align:left;padding:1rem;background:var(--sc-cell-changed-color);border-bottom:1px solid var(--sc-row-border-color);box-sizing:border-box;margin-bottom:1rem;margin-left:calc(-1 * var(--sc-list-margin));margin-right:calc(-1 * var(--sc-list-margin))}.beam_day-divider h2[data-v-160cf6ef]{text-align:left;font-size:1rem;color:var(--sc-primary-text-color);margin:0;padding:0}.beam_day-divider[data-v-160cf6ef]:first-of-type{margin-top:0}.beam_filters[data-v-63a79e46]{background-color:var(--sc-primary-color);border-bottom:1px solid var(--sc-row-border-color);box-sizing:border-box;min-height:2em;overflow:visible;padding:.625rem;transition:all .2s ease-in-out}.beam_filters-heading[data-v-63a79e46]{align-items:center;background-color:var(--sc-primary-color);box-sizing:border-box;cursor:pointer;display:flex;font-size:1rem}.beam_filters-heading>h1[data-v-63a79e46]{font-size:1rem}.beam_filters-options[data-v-63a79e46]{display:flex;flex-direction:row;justify-content:flex-start;margin:1rem 0;padding:0 1rem;gap:1rem}@media (max-width: 479px){.beam_filters-options[data-v-63a79e46]{flex-direction:column}}.beam_filter-option[data-v-be55508c]{cursor:pointer;position:relative}.beam_filter-option-heading[data-v-be55508c]{font-size:1rem!important;padding-bottom:.25rem}.beam_filter-option-select[data-v-be55508c]{align-items:stretch;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border:1px solid var(--sc-row-border-color);color:var(--sc-primary-text-color);display:flex;font-family:var(--sc-font-family);font-size:.8rem;font-weight:700;position:relative}label[data-v-be55508c]{cursor:pointer;padding:.5rem}.beam_filter-arrow[data-v-be55508c]{background:var(--sc-primary-color);color:var(--sc-primary-text-color);cursor:pointer;display:flex;align-items:center;width:5px;padding:.5rem .7rem}.beam_filter-label[data-v-be55508c]{display:flex;align-items:center}svg[data-v-be55508c]{fill:var(--sc-primary-text-color);width:5px;transform:rotate(90deg)}.beam_filter-select-menu[data-v-be55508c]{background-color:#fff;border-top:none;border:1px solid var(--sc-row-border-color);box-sizing:border-box;left:0;list-style:none;margin:0;max-height:200px;overflow-y:scroll;padding:0rem;position:absolute;width:100%;z-index:100}.beam_filter-select-option[data-v-be55508c]{font-size:.8rem;font-family:var(--sc-font-family);font-weight:700;color:var(--sc-primary-text-color);border-bottom:1px solid var(--sc-row-border-color);padding:.5rem}.beam_filter-select-option[data-v-be55508c]:hover{background:var(--sc-primary-color)}.selected[data-v-be55508c],.selected[data-v-be55508c]:hover{background:var(--sc-row-border-color)}.beam_filter-container[data-v-be55508c]{flex-grow:1;max-width:300px;width:50%}@media (max-width: 479px){.beam_filter-container[data-v-be55508c]{width:100%;max-width:100%}}.beam_header[data-v-5182a4d5]{border:1px solid transparent;text-align:left;font-size:1.125rem;color:var(--sc-primary-text-color);margin:0;padding:0;font-family:var(--sc-font-family)}.beam_metadata[data-v-80484331]{box-sizing:border-box;display:flex;flex-direction:column;max-height:100vh;color:var(--sc-primary-text-color);font-family:var(--sc-font-family)}.beam_metadata_content[data-v-80484331]{padding-top:10px}.beam_metadata_header[data-v-80484331]{display:flex;flex-direction:row;align-items:baseline;padding:0 30px;justify-content:space-between}.beam_metadata_count[data-v-80484331]{font-size:1.5rem}.beam_metadata_count p[data-v-80484331]{margin:0}.beam_metadata_header-order-num[data-v-80484331]{font-weight:700;font-size:1.5rem}.beam_metadata_block[data-v-80484331]{padding:0 30px;margin:10px 0}.beam_metadata_shipping[data-v-80484331]{display:flex;flex-direction:row;align-items:baseline;justify-content:space-between}.beam_metadata_shipping p[data-v-80484331]{line-height:1.5rem}@media screen and (max-width: 600px){.beam_metadata_shipping[data-v-80484331]{flex-direction:column}}.beam_metadata_component_header[data-v-80484331]{display:flex;flex-direction:row;justify-content:space-between;align-items:baseline}.beam_metadata_components[data-v-80484331]{overflow:scroll}hr[data-v-80484331]{display:block;height:1px;border:0;border-top:1px solid var(--sc-row-border-color);margin:1em 0;padding:0}.beam_metadata_heading{font-size:1.125rem;font-weight:700;margin:.625rem 0;color:var(--sc-primary-text-color)}.beam_modal[data-v-4f3f0253]{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#00000080;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);z-index:1000;text-align:center;padding:1.25rem}.beam_modal-confirm[data-v-5b430dca]{background:#fff;padding:1.25rem;width:80%;max-width:400px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.beam_modal-confirm button[data-v-5b430dca]{margin:.625rem}.beam_modal-confirm h2[data-v-5b430dca]{border-bottom:1px solid var(--sc-row-border-color);padding-bottom:.625rem;color:var(--sc-primary-text-color)}.fixed-top[data-v-a38a41d0]{position:sticky;top:0;left:0}.container[data-v-14a5f31b]{display:block;position:relative;padding-left:2.5ch;margin:0;margin-top:.5rem;cursor:pointer;font-size:2rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.container input[data-v-14a5f31b]{position:absolute;opacity:0;cursor:pointer;height:0;width:0}.checkmark[data-v-14a5f31b]{position:absolute;top:0;left:0;height:2rem;width:2rem;background-color:#eee;outline:2px solid transparent;border:1px solid var(--sc-highlight)}.container:hover input~.checkmark[data-v-14a5f31b]{background-color:#fff}.container input:checked~.checkmark[data-v-14a5f31b]{background-color:var(--sc-brand-secondary)}.checkmark[data-v-14a5f31b]:after{content:"";position:absolute;display:none}.container input:checked~.checkmark[data-v-14a5f31b]:after{display:block}.container .checkmark[data-v-14a5f31b]:after{left:25%;top:50%;width:.5rem;height:1rem;border:solid var(--sc-text-color);border-width:0 3px 3px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg) translate(-50%,-50%)}.beam_item-count[data-v-fa0e6dff]{font-size:1.3125rem;color:var(--sc-primary-text-color)}.beam_item-count span[data-v-fa0e6dff]{margin:0;padding:0;outline:none}.beam_list-anchor[data-v-7e3ecf0d]{text-decoration:none;outline:none;color:var(--sc-primary-text-color)}.beam_list-item[data-v-634dd647]{padding:.625rem;border-bottom:1px solid var(--sc-row-border-color);max-width:100%;box-sizing:border-box;display:flex;flex-flow:row nowrap;justify-content:space-between;gap:1.25rem;cursor:pointer;outline:2px solid transparent;outline-offset:-1px}.beam_list-item[data-v-634dd647]:focus{outline:2px solid var(--sc-focus-cell-outline);background-color:var(--sc-focus-cell-background)}.beam_list-text[data-v-634dd647]{width:80%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;flex-grow:1;font-size:.875rem;color:var(--sc-primary-text-color)}.beam_list-text label[data-v-634dd647],.beam_list-text p[data-v-634dd647]{overflow:hidden;text-overflow:ellipsis;width:100%;display:block}.beam_list-item label[data-v-634dd647]{display:block}.beam_list-item p[data-v-634dd647]{margin:0}.beam_list-view[data-v-d536b2a7]{font-family:var(--sc-font-family);list-style-type:none;margin-top:1px;margin-left:var(--sc-list-margin);margin-right:var(--sc-list-margin);padding:0}ul.beam_list-view[data-v-d536b2a7]:last-of-type{padding-bottom:2.5em}.beam_navbar[data-v-cfc4c14e]{padding:.625rem;background-color:var(--sc-primary-color);margin-left:0;min-height:2em;max-height:2em;color:var(--sc-primary-text-color);display:flex;flex-flow:row nowrap;align-content:center;justify-content:space-between;align-items:center;position:sticky;top:0;font-family:var(--sc-font-family);border-bottom:1px solid var(--sc-row-border-color)}.beam_navbar h1[data-v-cfc4c14e]{margin-left:.625rem}.segmented-display[data-v-140e435e]{width:100%;padding:1rem;box-sizing:border-box;display:flex;background:var(--sc-segmented-display-background);align-items:center;justify-content:flex-end}.segmented-display-output[data-v-140e435e]{text-align:right;font-family:Segment7,Arimo,sans-serif;font-weight:400;font-size:var(--sc-segemented-display-font-size);padding:0;margin:0;letter-spacing:.3rem;margin-bottom:-.7rem;color:var(--sc-segmented-display-color)}.two-column[data-v-c65440c0]{display:flex;flex-direction:row;justify-content:space-between;align-items:baseline;gap:1rem}@media screen and (max-width: 400px){.two-column[data-v-c65440c0]{flex-direction:column;gap:0}}.column[data-v-c65440c0]{flex-grow:1;width:50%}@media screen and (max-width: 400px){.column[data-v-c65440c0]{width:100%}}.column-right[data-v-c65440c0]{text-align:right}@media screen and (max-width: 400px){.column-right[data-v-c65440c0]{text-align:left}}svg[data-v-05e7abed]{width:100%;overflow:visible;fill:var(--sc-primary-text-color)}.arrow-icon[data-v-05e7abed]{width:.4rem;transform:rotate(0);transform-origin:center;position:relative;transition:all .1s ease-in-out;margin:.5rem;cursor:pointer;display:flex;align-items:center}.open[data-v-05e7abed]{transform:rotate(90deg)}@font-face{font-family:Segment7;src:url(data:font/otf;base64,T1RUTwAOAIAAAwBgQkFTRQAJAAQAACasAAAADkNGRiC5m9MSAAAH7AAAHbpGRlRNa6XwRAAAJrwAAAAcR0RFRgKxAqIAACWoAAAASkdQT1Ou773UAAAmLAAAAH5HU1VCRNhM5gAAJfQAAAA4T1MvMljUYiwAAAFQAAAAYGNtYXAxVzUsAAAFhAAAAkZoZWFkAmNATwAAAOwAAAA2aGhlYQdTAF8AAAEkAAAAJGhtdHgW0g5oAAAm2AAAAgZtYXhwAQFQAAAAAUgAAAAGbmFtZYoOx10AAAGwAAAD0nBvc3QAAAABAAAHzAAAACAAAQAAAAEAAOVWl1RfDzz1AAsD6AAAAADPuH6JAAAAAM+4fokAAP84A9EDIAACAAgAAgAAAAAAAAABAAADIP84AFoCSQAA/ngD0QBkAAUAAAAAAAAAAAAAAAAAAgAAUAABAQAAAAMCSQJYAAUACAKKArsABwCMAooCu//nAd8AMQECAAACAAUJAAAAAAAAAAAAAwAAAAAAAAAAAAAAAFBmRWQAAQAAAP8DIP84AFoDIADIAAAAAQAAAAABwgHCACAAIAACAAAADgCuAAEAAAAAAAAAsQFkAAEAAAAAAAEACAIoAAEAAAAAAAIACAJDAAEAAAAAAAMAIwKUAAEAAAAAAAQACALKAAEAAAAAAAUACQLnAAEAAAAAAAYAEAMTAAMAAQQJAAABYgAAAAMAAQQJAAEAEAIWAAMAAQQJAAIAEAIxAAMAAQQJAAMARgJMAAMAAQQJAAQAEAK4AAMAAQQJAAUAEgLTAAMAAQQJAAYAIALxAFMAdAByAGkAYwB0AGwAeQAgAHMAZQB2AGUAbgAtAHMAZQBnAG0AZQBuAHQAIAAoAHAAbAB1AHMAIABwAG8AaQBuAHQAKQAgAGMAYQBsAGMAdQBsAGEAdABvAHIAIABkAGkAcwBwAGwAYQB5ACAAZgBhAGMAZQAsACAAZgBpAHgAZQBkAC0AdwBpAGQAdABoACAAYQBuAGQAIABmAHIAZQBlAC4AIAAgACgAYwApACAAQwBlAGQAcgBpAGMAIABLAG4AaQBnAGgAdAAgADIAMAAxADQALgAgACAATABpAGMAZQBuAHMAZQBkACAAdQBuAGQAZQByACAAUwBJAEwAIABPAHAAZQBuACAARgBvAG4AdAAgAEwAaQBjAGUAbgBjAGUAIAB2ADEALgAxAC4AIAAgAFIAZQBzAGUAcgB2AGUAZAAgAG4AYQBtAGUAOgAgAFMAZQBnAG0AZQBuAHQANwAuAABTdHJpY3RseSBzZXZlbi1zZWdtZW50IChwbHVzIHBvaW50KSBjYWxjdWxhdG9yIGRpc3BsYXkgZmFjZSwgZml4ZWQtd2lkdGggYW5kIGZyZWUuICAoYykgQ2VkcmljIEtuaWdodCAyMDE0LiAgTGljZW5zZWQgdW5kZXIgU0lMIE9wZW4gRm9udCBMaWNlbmNlIHYxLjEuICBSZXNlcnZlZCBuYW1lOiBTZWdtZW50Ny4AAFMAZQBnAG0AZQBuAHQANwAAU2VnbWVudDcAAFMAdABhAG4AZABhAHIAZAAAU3RhbmRhcmQAAEYAbwBuAHQARgBvAHIAZwBlACAAMgAuADAAIAA6ACAAUwBlAGcAbQBlAG4AdAA3ACAAOgAgADcALQA2AC0AMgAwADEANAAARm9udEZvcmdlIDIuMCA6IFNlZ21lbnQ3IDogNy02LTIwMTQAAFMAZQBnAG0AZQBuAHQANwAAU2VnbWVudDcAAFYAZQByAHMAaQBvAG4AIAAgAABWZXJzaW9uICAAAFMAZQBnAG0AZQBuAHQANwBTAHQAYQBuAGQAYQByAGQAAFNlZ21lbnQ3U3RhbmRhcmQAAAAAAAADAAAAAwAAABwAAQAAAAAAPAADAAEAAAAcAAQAIAAAAAQABAABAAAA////AAAAAP//AAEAAQAAAAAABgIKAAAAAAEAAAEAAgADAAQABQAGAAcACAAJAAoACwAMAA0ADgAPABAAEQASABMAFAAVABYAFwAYABkAGgAbABwAHQAeAB8AIAAhACIAIwAkACUAJgAnACgAKQAqACsALAAtAC4ALwAwADEAMgAzADQANQA2ADcAOAA5ADoAOwA8AD0APgA/AEAAQQBCAEMARABFAEYARwBIAEkASgBLAEwATQBOAE8AUABRAFIAUwBUAFUAVgBXAFgAWQBaAFsAXABdAF4AXwBgAGEAYgBjAGQAZQBmAGcAaABpAGoAawBsAG0AbgBvAHAAcQByAHMAdAB1AHYAdwB4AHkAegB7AHwAfQB+AH8AgADFAMYAyADKANIA1wDdAOIA4QDjAOUA5ADmAOgA6gDpAOsA7ADuAO0A7wDwAPIA9ADzAPUA9wD2APsA+gD8AP0AAACxAKMApACoAAAAtwDgAK8AqgAAALUAqQAAAMcA2QAAALIAAAAAAKYAtgAAAAAAAAAAAAAAqwC7AAAA5wD5AMAAogCtAAAAAAAAAAAArAC8AAAAoQDBAMQA1gAAAAAAAAAAAAAAAAAAAAAA+AAAAQAAAAAAAAAAAAAAAAAAAAAAALgAAAAAAAAAwwDLAMIAzADJAM4AzwDQAM0A1ADVAAAA0wDbANwA2gAAAAAAAACwAAAAAAAAALkAAAAAAAAAAAADAAD//QAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAQAEBAABAQERU2VnbWVudDdTdGFuZGFyZAABAgABADf4YgD4YwH4ZAL4ZQP4ZgSMDAGIDAKLDAOLDASL+1z6Zfm0BRwDrw8cAAAQHAWwERwAMRwbyBIATAIAAQAIAA8AFgAdACQAKwAyADkAQABHAE4AVQBcAGMAagBxAHgAfwCGAI0AlACbAKIAqQCwALcAvgDFAMwA0wDaAOEA6ADvAPYA/QEEAQsBEgEZASABJwEuATUBPAFDAUoBUQFYAV8BZgFtAXQBewGCAYkBkAGXAZ4BpQGsAbMBugHBAcgBzwHWAd0B5AHrAfIB8gKjAqsCswK7dW5pMDAwMHVuaTAwMDF1bmkwMDAydW5pMDAwM3VuaTAwMDR1bmkwMDA1dW5pMDAwNnVuaTAwMDd1bmkwMDA4dW5pMDAwOXVuaTAwMEF1bmkwMDBCdW5pMDAwQ3VuaTAwMER1bmkwMDBFdW5pMDAwRnVuaTAwMTB1bmkwMDExdW5pMDAxMnVuaTAwMTN1bmkwMDE0dW5pMDAxNXVuaTAwMTZ1bmkwMDE3dW5pMDAxOHVuaTAwMTl1bmkwMDFBdW5pMDAxQnVuaTAwMUN1bmkwMDFEdW5pMDAxRXVuaTAwMUZ1bmkwMDdGdW5pMDA4MHVuaTAwODF1bmkwMDgydW5pMDA4M3VuaTAwODR1bmkwMDg1dW5pMDA4NnVuaTAwODd1bmkwMDg4dW5pMDA4OXVuaTAwOEF1bmkwMDhCdW5pMDA4Q3VuaTAwOER1bmkwMDhFdW5pMDA4RnVuaTAwOTB1bmkwMDkxdW5pMDA5MnVuaTAwOTN1bmkwMDk0dW5pMDA5NXVuaTAwOTZ1bmkwMDk3dW5pMDA5OHVuaTAwOTl1bmkwMDlBdW5pMDA5QnVuaTAwOUN1bmkwMDlEdW5pMDA5RXVuaTAwOUZ1bmkwMEEwdW5pMDBBRHVuaTAwQjJ1bmkwMEIzdW5pMDBCNXVuaTAwQjlTdHJpY3RseSBzZXZlbi1zZWdtZW50IChwbHVzIHBvaW50KSBjYWxjdWxhdG9yIGRpc3BsYXkgZmFjZSwgZml4ZWQtd2lkdGggYW5kIGZyZWUuICAoYykgQ2VkcmljIEtuaWdodCAyMDE0LiAgTGljZW5zZWQgdW5kZXIgU0lMIE9wZW4gRm9udCBMaWNlbmNlIHYxLjEuICBSZXNlcnZlZCBuYW1lOiBTZWdtZW50Ny5TZWdtZW50N1NlZ21lbnQ3U3RhbmRhcmQAAAABhwGIAYkBigGLAYwBjQGOAY8BkAGRAZIBkwGUAZUBlgGXAZgBmQGaAZsBnAGdAZ4BnwGgAaEBogGjAaQBpQGmAAEAAgADAAQABQAGAAcAaAAJAAoACwAMAA0ADgAPABAAEQASABMAFAAVABYAFwAYABkAGgAbABwAHQAeAB8AIAAhACIAIwAkACUAJgAnACgAKQAqACsALAAtAC4ALwAwADEAMgAzADQANQA2ADcAOAA5ADoAOwA8AD0APgA/AEAAfABCAEMARABFAEYARwBIAEkASgBLAEwATQBOAE8AUABRAFIAUwBUAFUAVgBXAFgAWQBaAFsAXABdAF4AXwGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBuAG5AboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBxwHIAGAAYQBiAGcAZACgAGYAgwCqAIsAagCXAckApQCAAKEAnAHKAcsAfQHMAHMAcgCFAc0AjwB4AJ4AmwCjAHsArgCrAKwAsACtAK8AigCxALUAsgCzALQAuQC2ALcAuACaALoAvgC7ALwAvwC9AKgAjQDEAMEAwgDDAMUAnQCVAMsAyADJAM0AygDMAJAAzgDSAM8A0ADRANYA0wDUANUApwDXANsA2ADZANwA2gCfAJMA4QDeAN8A4ADiAKIA4wEBAgABACIANgA3ADgAOQA6ADsAPAA9AD4APwBAAEEAQgBDAEQARQBGAEcASABJAEoASwBMAE0ATgBPAFAAUQBSAFMAVABVAFYAdgCQALYA7QEmAUgBXgGRAcoB8gIWAjQCQAJOAncCxgLnAyQDZwOWA+AEPARhBMEFDgUaBToFTgViBYAFsgX/BkEGhwa6Bv4HOgdrB7AH7QgJCEIIegihCLkI8QlACXwJsgnLCg0KQgqECsYLGAs2C3gLqgvdDAAMNwxcDGgMewzIDQ4NIg1mDa0N3g4pDloOaQ6iDtoPAQ84D1gPjQ/JEAEQGhBeEJMQwREDEVURkhHWEf8SABIcEh0STxJQElESUhJTElQSVRJWElcSWBJZEloSWxJcEl0SXhJfEmASYRJiEmMSZBJlEmYSZxJoEmkSahJrEmwSbRJuEm8ScBJxEnIScxJ0EnUSdhJ3EngSeRJ6EnsSfBJ9En4SfxKAEq8SsBKxErISsxLqEusS7BLtEu4S7xLwEvES8hLzEvQS9RL2EvcS+BL5EvoS+xL8Ev0S/hL/EwATARMCEwMTBBMFEwYTBxMIEwkTChMLEwwTDRMOEw8TEBMRExITExMUE2ETrhOvE7ATsROyE7MTtBO1E/wT/RP+E/8UABQBFAIUAxQEFAUUBhQHFAgUCRQKFAsUDBQNFA4UDxQQFBEUEou9+EW9Ab29+BW9A70W+Hn4qfx5Br38dxX4RfgV/EUHDvtc+nwBi/plA/tcBPpl+nz+ZQYODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg527/floPfFnxL4O/Z66hNw+KH5jhUgChOIsf0/FSEKDvhJdvfBd593zHcSE9Dd+WEVIgr3+fAVIwoOien3m+ppoPfFnxITgPcf5xUkChPA+3j3+hUlChOw9wz3zBUgCg6J6VOg9/ug94zqOJ8SE6D3H+cVE2AmChOgJwoTKPvS+QUVIgoTMH73CxUoCmT8FxUpChNgKgoOielodvgldveh6kx3n3cSE6D3H+cVE2AmChOgJwoTKPvS+QUVIgoTMH73CxUoCmT8FxUpChNgKgoOr6D3vuppoPfFnxITwPdA+FYVJQrRTRUrChOwm/gwFSAKDvhJdvfud593Evg79hPQ+KH5jhUgCg6J6X929+N3ynb3oepMdxITsPcf5xUkCvvX98IVLAoTcC0KEzRG+AsVIgoTOH73CxUoCg6J6Wh2+CV296HqeXefdxIToPcf5xUTYCYKE6AnChMw+4n5RBUoCmT8FxUpChNgKgoTKJv4MBUgCg6J6feb6n529+53n3cSE4D3H+cVJAoTwPt49/oVJQoTsPcM98wVIAoOxHb30+p+dvfud593EhPA90D4VhUlCtFNFSsKE7Cb+DAVIAoOielodhITgPcf5xUTQCYKE4AnCtb3vBUpChNAKgoO9/fqAfdA+FYVJQoOdu8B+JXqA/jH2hUhCg7bdve86lN3ynb37ncSE6jY+B4VLgoTyKD3ABUlCvcM98wVLwoTmDAKDonpaHa3dvfjd8p296HqTHfMdxITmPcf5xUTWCYKE5gnCvvX98IVLAoTOC0KExpG+AsVIgoTHH73CxUoCmT8FxUpChNYKgoTGZv4MBUgCg7Edvgldvfud593Evgq9xATyPhv+BgVKwoT6Jv4MBUgCg6J6X9297zqU3fKdveh6nl3EhOA9x/nFSQKE1D71/fCFS4KEwSP+EoVKAoTIPvq+9kVJQoTCvcM98wVIAoOielodvfT6n5296HqeXefdxITgPcf5xUTQCYKE4AnChMI+4n5RBUoChMg++r72RUlCtFNFSkKE0AqChMUm/gwFSAKDsR299Pqfnb3wXefd8x3EhO03flhFSIKE8SP+2cVJQrRTRUrCpv4MBUvChOkMAoOielodvfU6X5296HmUHefdxITQPhw+BkVUlx++3jNPZylnve1BRMg++XuFTEK+4333RVJYAUTCDIKExT8Q1AVMwoTgG38zhU0Cg6J6Wh2tnb3vulndrd296HmUHcSE4D3HucVNAoTBfvS+QUVMwp+9wkVSWAFEwIyChMQ++r72hUxCtNOFVJcfvt4BRNANQoTKPxEtRWHgYaBh4EIe/vF576X930FDsR2+CV296HqeXefdxIT4Pcv+aAVKApk/BcVKwoT0Jv4MBUgCg6J6Wh2t3b3vOpTd8p296HqTHfMdxITgAD3H+cVE0AAJgoTgAAnChMoAPvX98IVLgoTBQBG+AsVIgoTAgB+9wsVKAoTEAD76vvZFSUK0U0VKQoTQAAqChMEgJv4MBUgCg6J6Wh299Pqfnb3oepMd593zHcSE4D3H+cVE0AmChOAJwoTFPvS+QUVIgoTCH73CxUoChMg++r72RUlCtFNFSkKE0AqChMRm/gwFSAKDvf36gH3QPhWFSUKDnbv9+Wg98WfEvg79nrqE3D4ofmOFSAKE4ix/T8VIQoO9x/nFSQK+9f3whUuCqD3ABUlCg6J6feb6gH3H+cVJAr7ePf6FSUKDonpU6ASE4D3H+cVE0AmChOAJwrW97wVKQoTQCoKDtt297zqU3fKdveh6nl3EhOg2PgeFS4KE4iP+EoVKAoTwPvq+9kVJQoTlPcM98wVIAoOielToI2g96fqP5+hoPeM6mWfEhOA9x/nFRNAJgoTgCcKEyj71/fCFS4KEwKP+EoVKAoTEPvq+9kVJQrRTRUpChNAKgoTBZv4MBUgCg7Edrd297zqU3fKdveh6kx3zHcSE9DY+B4VLgoTykb4CxUiChPEfvcLFSgKE+D76vvZFSUK0U0VKwoTyZv4MBUgCg6J6VOgjaD3p+o/n6Gg95ifEhOC9x/nFRNCJgoTgicKEyr71/fCFS4KRvgLFXv7qQUTBjYKExKP+2cVJQrRTRUpChNCKgoOielqoPe6n6Gg94zqOJ8SE7D3H+cVJAr71/fCFSwKE3AtChM0RvgLFSIKEzh+9wsVKAoOielToI2g96fqP5+hoPfFnxITgvcf5xUTQiYKE4InChMq+9f3whUuChMSoPcAFSUK0U0VKQoTQioKm/gwFS8KEwYwCg6J6X9297zqU3fKdveh6kx3EhOA9x/nFSQKE1D71/fCFS4KEwpG+AsVIgoTBH73CxUoChMg++r72RUlCg7GoPen6j+foaD3jOo4nxIToNj4HhUuChOURvgLFSIKE4h+9wsVKAoTwPvq+9kVJQoOielodrd29+N3ynb3oepMdxITmPcf5xUTWCYKE5gnCvvX98IVLAoTOC0KExpG+AsVIgoTHH73CxUoCmT8FxUpChNYKgoOr6CNoPen6j+foaD3mJ+knxIT1tj4HhUuCkb4CxV7+6kFE842ChPmj/tnFSUK0U0VKwqb+DAVLwoTzjAKDq+g9/ug98WfAfgq9xAD+G/4GBUrCpv4MBUgCg6J6VOgjaD3up+hoPfFnxITnPcf5xUTXCYKE5wnCvvX98IVLAoTPC0K99i5FSkKE1wqCpv4MBUjCg6voI2g96fqP5+hoPeM6jifEhPQ2PgeFS4KE8pG+AsVIgoTxH73CxUoChPg++r72RUlCtFNFSsKDonpaqD3up+hoPeYnxITuPcf5xUkCvvX98IVLAoTeC0KRvgLFSIKDtj4HhUuCqD3ABUlCtFNFSsKm/gwFSMKDsR2t3b343fKdveh6kx3zHcSE/DY+B4VLgoT9Eb4CxUiChP4fvcLFSgKZPwXFSsKE/Kb+DAVIAoOielToI2g97qfoaD3jOo4n6SfEhOY9x/nFRNYJgoTmCcK+9f3whUsChM4LQoTGkb4CxUiChMcfvcLFSgKZPwXFSkKE1gqChMZm/gwFSAKDsag96fqP5+hoPeM6jifpJ8SE6DY+B4VLgoTlEb4CxUiChOIfvcLFSgKE8D76vvZFSUKE5L3DPfMFSAKDq+g977qaaD3jOo4n6SfEhOo3flhFSIKE5B+9wsVKAoTwPvq+9kVJQrRTRUrChOkm/gwFSAKDsag96fqP58SE6DY+B4VLgoTwKD3ABUlCg6J6VOg97/paaD3jOY8nxITgPce5xU0ChMU+9L5BRUzCn73CRVJYAUTCDIKEyD76vvaFTEK004VUlx++3gFE0A1Cg6J6Wqg96fqP5+hoPeYnxIThPcf5xUkChNU+9f3whUuCkb4CxV7+6kFEww2ChMkj/tnFSUKDonpU6CNoPe6n6Gg95ifpJ8SE573H+cVE14mChOeJwr71/fCFSwKEz4tCkb4CxUiCvfH+6UVKQoTXioKm/gwFSMKDonpU6CNoPe6n6Gg95ifpJ8SE573H+cVE14mChOeJwr71/fCFSwKEz4tCkb4CxUiCvfH+6UVKQoTXioKm/gwFSMKDonpU6CNoPen6j+foaD3mJ+knxITg/cf5xUTQyYKE4MnChMr+9f3whUuCkb4CxV7+6kFEwc2ChMTj/tnFSUK0U0VKQoTQyoKm/gwFS8KEwcwCg6J6feb6vd/6gH3H+cVJAr7iflEFSgK++r72RUlCg6J6VOg977qaaD3mJ+knxIThPcf5xUTRCYKE4QnChMc+9L5BRUiChMkj/tnFSUK0U0VKQoTRCoKm/gwFS8KExQwCg7GoPen6j+foaD3jOplnxIToNj4HhUuChOIj/hKFSgKE8D76vvZFSUKE5T3DPfMFSAKDonpaqD3up+hoPeM6jifEhOw9x/nFSQK+9f3whUsChNwLQoTNEb4CxUiChM4fvcLFSgKDsR299Pqfnb3wXefdxITsN35YRUiChPAj/tnFSUK0U0VKwoOielToPf7oPeM6mWfEhOg9x/nFRNgJgoToCcKEzD7iflEFSgKZPwXFSkKE2AqChMom/gwFSAKDvhJdveh6kx3n3fMdxIToN35YRUiChPAfvcLFSgKE4iWfhUgCg739+oB90D4VhUlCg74NKD3xZ8B+Dv2A/ih+Y4VIAoOielodrd297zqU3fKdveh6nl3EhOA9x/nFRNAJgoTgCcKEyj71/fCFS4KEwKP+EoVKAoTEPvq+9kVJQrRTRUpChNAKgoTBZv4MBUgCg6J6Wh2t3b3vOpTd8p298F3EhOC9x/nFRNCJgoTgicKEyr71/fCFS4KRvgLFXv7qQUTBjYKExKP+2cVJQrRTRUpChNCKgoO9x/nFSQK+9f3whUuCqD3ABUlCg6J6Wh2t3b3vOpTd8p29+53EhOC9x/nFRNCJgoTgicKEyr71/fCFS4KExKg9wAVJQrRTRUpChNCKgqb+DAVLwoTBjAKDonpf3b3vOpTd8p296HqTHfMdxITgPcf5xUkChNQ+9f3whUuChMKRvgLFSIKEwR+9wsVKAoTIPvq+9kVJQoTCfcM98wVIAoO23b3vOpTd8p296HqTHcSE6DY+B4VLgoTlEb4CxUiChOIfvcLFSgKE8D76vvZFSUKDonpU6D3vuppoPeM6jifpJ8SE4D3H+cVE0AmChOAJwoTFPvS+QUVIgoTCH73CxUoChMg++r72RUlCtFNFSkKE0AqChMSm/gwFSAKDsR2t3b3vOpTd8p298F3EhPU2PgeFS4KRvgLFXv7qQUTzDYKE+SP+2cVJQrRTRUrCg7EdgH4KvID+G/4GBUrCg6J6Wh2t3b343fKdvfudxITnPcf5xUTXCYKE5wnCvvX98IVLAoTPC0K99i5FSkKE1wqCpv4MBUjCg7Edrd297zqU3fKdveh6kx3EhPQ2PgeFS4KE8pG+AsVIgoTxH73CxUoChPg++r72RUlCtFNFSsKDonpf3b343fKdvfBdxITuPcf5xUkCvvX98IVLAoTeC0KRvgLFSIKDtt297zqU3fKdvfBd8x3EhOs2PgeFS4KRvgLFXv7qQUTnDYKE8yP+2cVJQr3DPfMFS8KE5wwCg7Edrd297zqU3cSE9DY+B4VLgoT4KD3ABUlCtFNFSsKDonpaHa3dve86lN3EhOA9x/nFRNAJgoTgCcKEyj71/fCFS4KExCg9wAVJQrRTRUpChNAKgoO23b3vOpTd8p296HqTHfMdxIToNj4HhUuChOURvgLFSIKE4h+9wsVKAoTwPvq+9kVJQoTkvcM98wVIAoOxHb30+p+dveh6kx3n3fMdxITqN35YRUiChOQfvcLFSgKE8D76vvZFSUK0U0VKwoTopv4MBUgCg7bdve86lN3EhOg2PgeFS4KE8Cg9wAVJQoOielodvfU6X5296HmUHefdxITgPce5xU0ChMU+9L5BRUzCn73CRVJYAUTCDIKEyD76vvaFTEK004VUlx++3gFE0A1Cg6J6X9297zqU3fKdvfBdxIThPcf5xUkChNU+9f3whUuCkb4CxV7+6kFEww2ChMkj/tnFSUKDonpaHa3dvfjdxITkPcf5xUTUCYKE5AnCvvX98IVLAoTMC0K99i5FSkKE1AqCg6J6Wh2t3b343fKdvfBd8x3EhOe9x/nFRNeJgoTnicK+9f3whUsChM+LQpG+AsVIgr3x/ulFSkKE14qCpv4MBUjCg6J6Wh2t3b3vOpTd8p298F3zHcSE4P3H+cVE0MmChODJwoTK/vX98IVLgpG+AsVe/upBRMHNgoTE4/7ZxUlCtFNFSkKE0MqCpv4MBUvChMHMAoOxHa3dve86lN3ynb3wXfMdxIT1tj4HhUuCkb4CxV7+6kFE842ChPmj/tnFSUK0U0VKwqb+DAVLwoTzjAKDonpaHb30+p+dvfBd593zHcSE4L3H+cVE0ImChOCJwoTGvvS+QUVIgoTIo/7ZxUlCtFNFSkKE0IqCpv4MBUvChMSMAoOxqD3p+o/n6Gg98WfEhOo2PgeFS4KE8ig9wAVJQr3DPfMFS8KE5gwCg4Or6D3+6D3xZ8B+Cr3EAP4b/gYFSsKm/gwFSAKDg6J6X929+N3ynb3oep5dxITsPcf5xUkCvvX98IVLAoTcC0KEziP+EoVKAoTNJZ+FSAKDg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg739+ppoPeM6jifpJ8SE4D3QPhWFSUKE1D71/efFSIKE2B+9wsVKAoTSJZ+FSAKDg4ODg7GoPen6j+foaD3mJ+knxITrNj4HhUuCkb4CxV7+6kFE5w2ChPMj/tnFSUK9wz3zBUvChOcMAoODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4OielToI2g96fqP5+hoPeM6mWfEhOA9x/nFRNAJgoTgCcKEyj71/fCFS4KEwKP+EoVKAoTEPvq+9kVJQrRTRUpChNAKgoTBZv4MBUgCg6J6VOgjaD3p+o/n6Gg94zqZZ8SE4D3H+cVE0AmChOAJwoTKPvX98IVLgoTAo/4ShUoChMQ++r72RUlCtFNFSkKE0AqChMFm/gwFSAKDg4ODg4ODg6J6Wqg96fqP5+hoPeM6jifpJ8SE4D3H+cVJAoTUPvX98IVLgoTCkb4CxUiChMEfvcLFSgKEyD76vvZFSUKEwn3DPfMFSAKDg4ODg4ODg4ODg4ODg4ODg4ODg4ODg743RSLFYmx+T24nIwGHgoCLwwJiwwK6gqfjNGOjJD6GAwM+mUL6pOPnPnpDA0cADETABcCAAEAGgAsADgAUAB+AJEAngDBAMwA0wDcAOoA8gD8AQ0BFAEnAToBQwFPAX0BhgGPMTF/+2rDYa6wBZDukeqQ7giLkIiRiZAIC291dm1voHakp6Cgqad3oHIfC3v7qZZz2rqX91oFCzExf/tqw2GusAWQ7pHqkO6LkIiRiZAICy9Ti4oFi4aPiI6IkoKSg5KCCNKL9yKL90CLBZKOjY4fi42JjYiOdqV0qXalCAs7XwWgeqN8oHgI94yLy7dKvgULL1OLigWLho+IjogIC5KCkoOSggjSi/cii/dAiwWSjo2OH4uNiY2IjnaldKl2pQgLSF7bWfeTi+blBQtSXX/7dwULzTydpZ73tAULUl1/+3fNPJ2lnve0BQuIgYOAiIEIC3v7xOe9l/d9BQuIgYOAiIEIe/vE572X930FCzExf/tqBQvDYa6wBZDukeqQ7ouQiJGJkAgLPF8FoXqhfKF5CPeMi8u2Sb4FC9tY95KL5eYFC3z7qJVy27qW91sFCy9Ui4kFi4aQiI6HkoOSgpKDCNOL9yGL90CLBZKPjY4fi42JjYiOdqZzp3amCAvNPZylnve1BQuWc9q6l/daBQsAAAABAAAAAAAAAA4AFgAAAAQAAAACAAAAAgAIADEAOgABAEAAQAACAEIAQgACAEYARgACAE8ATwACAFkAWQACAGIAcwACAHUAegACAAAAAQAAAAoAHAAeAAFERkxUAAgABAAAAAD//wAAAAAAAQAEAAEACAABAAgAAQAGACAAAQACAEcASwABAAAACgAeACwAAURGTFQACAAEAAAAAP//AAEAAAABa2VybgAIAAAAAQABAAIABgAOAAEAAAABABAAAgAAAAEAFgABAAgABP22AAEAAQAvAAEAJAAEAAAACgAeAB4AHgAeAB4AHgAeAB4AHgAeAAEAL/22AAIAAQAxADoAAAAAAAEAAAAIAAAAAAAEAAAAAAAAAAEAAAAAzD2izwAAAADPr89TAAAAAM+4fiECSQAAAkkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABpwBCAC8ALwAvAFwBpwAvAC8ALwBcAC8AXAIBAC8ALwGWAC8ALwBCAC4ALgBYAC8ALwBcAacALwAvAC8ALwAvAC8ALwAvAC8ALwAvAC8ALwGWAC8ALwAvAC8ALwAvAC8AQgAvAC4ALwAvAC8ALwAvAC8ALwAvAEIALwBCAFwBpwAvAC8ALwAvAC8ALwAvAC8BlgAvAC8ALwAvAC8ALwAvAEIALwAuAC8ALwAvAC8ALwAvAC8AAAGWAAAALwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEIAAAAAAAAAAAAvAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC8ALwAAAAAAAAAAAAAAAAAAAC8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA)}:root{--sc-primary-color: #f2f2f2;--sc-primary-text-color: #666666;--sc-alert: #e63c28;--sc-success: #155724;--sc-warning: #f0f34f;--sc-font-family: Arimo, Arial, sans-serif;--sc-row-border-color: #ccc;--sc-btn-color: white;--sc-btn-border: #ccc;--sc-btn-label-color: black;--sc-list-margin: .625rem;--sc-cell-changed-color: #d8edff;--sc-segemented-display-font-size: 4.5rem;--sc-segmented-display-background: #404040;--sc-segmented-display-color: #b0b0b0}.beam_copy{color:var(--sc-primary-text-color);font-size:1rem;line-height:1.5rem;font-family:var(--sc-font-family)}.beam--bold{font-weight:700}.beam--normal{font-weight:400}.beam--alert{color:var(--sc-alert)}.beam--warning{color:var(--sc-warning)}.beam--success{color:var(--sc-success)}.v-toast__item{border-radius:0;color:#fff;font-family:var(--sc-font-family)}.v-toast__item--success{background-color:var(--sc-success)!important;color:#fff}.v-toast__item--info{background-color:var(--sc-primary-text-color)!important}.v-toast__item--warning{background-color:var(--sc-warning)!important;color:#fff}.v-toast__item--error{background-color:var(--sc-alert)!important;color:#fff}.v-toast__item--default{background-color:var(--sc-primary-text-color)!important}
2
- /*$vite$:1*/`,document.head.appendChild(ze);const er={class:"beam_action-footer"},Wr={class:"footer-action-wrapper"},Ta=E.defineComponent({__name:"ActionFooter",emits:["click"],setup(o,{emit:h}){const i=h,a=()=>{i("click")};return(l,r)=>{const e=E.resolveComponent("BeamBtn");return E.openBlock(),E.createElementBlock("footer",er,[E.createElementVNode("span",Wr,[E.createVNode(e,{onClick:a},{default:E.withCtx(()=>[E.renderSlot(l.$slots,"default",{},void 0,!0)]),_:3})])])}}}),Ye=(o,h)=>{const i=o.__vccOpts||o;for(const[a,l]of h)i[a]=l;return i},Wi=Ye(Ta,[["__scopeId","data-v-37933bd1"]]),Ba={class:"beam_metadata_arrow"},Oa={class:"beam_metadata_arrow-head"},Pa={id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 6.74 7.78"},Vi=Ye(E.defineComponent({__name:"BeamArrow",props:{color:{}},setup(o){return(h,i)=>(E.openBlock(),E.createElementBlock("div",Ba,[E.createElementVNode("div",{class:"beam_metadata_arrow-body",style:E.normalizeStyle({background:h.color||"#c4c4c4"})},null,4),E.createElementVNode("div",Oa,[(E.openBlock(),E.createElementBlock("svg",Pa,[E.createElementVNode("polygon",{points:"6.74 3.89 0 0 0 7.78 6.74 3.89",style:E.normalizeStyle([{fill:"#c4c4c4"},{fill:h.color||"#c4c4c4"}])},null,4)]))])]))}}),[["__scopeId","data-v-94fbdac5"]]),xa={},Ra={class:"beam_btn"};function Ma(o,h){return E.openBlock(),E.createElementBlock("button",Ra,[E.renderSlot(o.$slots,"default",{},()=>[h[0]||(h[0]=E.createTextVNode("Action"))],!0)])}const Qi=Ye(xa,[["render",Ma],["__scopeId","data-v-bc768596"]]),Ua={class:"beam_day-divider"},Vr=Ye(E.defineComponent({__name:"BeamDayDivider",props:{item:{}},setup(o){const h=E.computed(()=>{if(!o.item.date||isNaN(Date.parse(o.item.date)))return o.item.date;const i=new Date(o.item.date);if(o.item.dateFormat)switch(o.item.dateFormat.toLowerCase()){case"iso":return i.toISOString()}return i.toDateString()});return(i,a)=>(E.openBlock(),E.createElementBlock(E.Fragment,null,[E.createElementVNode("div",Ua,[E.createElementVNode("h2",null,E.toDisplayString(h.value),1)]),E.renderSlot(i.$slots,"default",{},void 0,!0)],64))}}),[["__scopeId","data-v-160cf6ef"]]),Da={class:"beam_filters"},La={class:"beam_filters-options"},Ki=Ye(E.defineComponent({__name:"BeamFilter",setup(o){const h=E.ref(!1);return(i,a)=>{const l=E.resolveComponent("ToggleArrow"),r=E.resolveComponent("BeamHeading");return E.openBlock(),E.createElementBlock("div",Da,[E.createElementVNode("div",{onClick:a[0]||(a[0]=e=>h.value=!h.value),class:"beam_filters-heading"},[E.createVNode(l,{open:h.value},null,8,["open"]),E.createVNode(r,null,{default:E.withCtx(()=>a[1]||(a[1]=[E.createTextVNode("Filter")])),_:1,__:[1]})]),E.withDirectives(E.createElementVNode("div",La,[E.renderSlot(i.$slots,"default",{},void 0,!0)],512),[[E.vShow,h.value]])])}}}),[["__scopeId","data-v-63a79e46"]]);function Hi(o){return E.getCurrentScope()?(E.onScopeDispose(o),!0):!1}const qi=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Na=Object.prototype.toString,Fa=o=>Na.call(o)==="[object Object]",wt=()=>{},Qr=ja();function ja(){var o,h;return qi&&((o=window==null?void 0:window.navigator)==null?void 0:o.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((h=window==null?void 0:window.navigator)==null?void 0:h.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Wa(...o){if(o.length!==1)return E.toRef(...o);const h=o[0];return typeof h=="function"?E.readonly(E.customRef(()=>({get:h,set:wt}))):E.ref(h)}function Va(o,h){function i(...a){return new Promise((l,r)=>{Promise.resolve(o(()=>h.apply(this,a),{fn:h,thisArg:this,args:a})).then(l).catch(r)})}return i}function Qa(o,h={}){let i,a,l=wt;const r=t=>{clearTimeout(t),l(),l=wt};let e;return t=>{const s=E.toValue(o),u=E.toValue(h.maxWait);return i&&r(i),s<=0||u!==void 0&&u<=0?(a&&(r(a),a=void 0),Promise.resolve(t())):new Promise((d,p)=>{l=h.rejectOnCancel?p:d,e=t,u&&!a&&(a=setTimeout(()=>{i&&r(i),a=void 0,d(e())},u)),i=setTimeout(()=>{a&&r(a),a=void 0,d(t())},s)})}}function Kr(o){return Array.isArray(o)?o:[o]}function Ka(o,h=200,i={}){return Va(Qa(h,i),o)}function Ha(o,h,i){return E.watch(o,h,{...i,immediate:!0})}const $i=qi?window:void 0;function sr(o){var h;const i=E.toValue(o);return(h=i==null?void 0:i.$el)!=null?h:i}function mr(...o){const h=[],i=()=>{h.forEach(n=>n()),h.length=0},a=(n,t,s,u)=>(n.addEventListener(t,s,u),()=>n.removeEventListener(t,s,u)),l=E.computed(()=>{const n=Kr(E.toValue(o[0])).filter(t=>t!=null);return n.every(t=>typeof t!="string")?n:void 0}),r=Ha(()=>{var n,t;return[(t=(n=l.value)==null?void 0:n.map(s=>sr(s)))!=null?t:[$i].filter(s=>s!=null),Kr(E.toValue(l.value?o[1]:o[0])),Kr(E.unref(l.value?o[2]:o[1])),E.toValue(l.value?o[3]:o[2])]},([n,t,s,u])=>{if(i(),!(n!=null&&n.length)||!(t!=null&&t.length)||!(s!=null&&s.length))return;const d=Fa(u)?{...u}:u;h.push(...n.flatMap(p=>t.flatMap(m=>s.map(A=>a(p,m,A,d)))))},{flush:"post"}),e=()=>{r(),i()};return Hi(i),e}let zi=!1;function Gi(o,h,i={}){const{window:a=$i,ignore:l=[],capture:r=!0,detectIframe:e=!1,controls:n=!1}=i;if(!a)return n?{stop:wt,cancel:wt,trigger:wt}:wt;if(Qr&&!zi){zi=!0;const w={passive:!0};Array.from(a.document.body.children).forEach(C=>C.addEventListener("click",wt,w)),a.document.documentElement.addEventListener("click",wt,w)}let t=!0;const s=w=>E.toValue(l).some(C=>{if(typeof C=="string")return Array.from(a.document.querySelectorAll(C)).some(b=>b===w.target||w.composedPath().includes(b));{const b=sr(C);return b&&(w.target===b||w.composedPath().includes(b))}});function u(w){const C=E.toValue(w);return C&&C.$.subTree.shapeFlag===16}function d(w,C){const b=E.toValue(w),_=b.$.subTree&&b.$.subTree.children;return _==null||!Array.isArray(_)?!1:_.some(N=>N.el===C.target||C.composedPath().includes(N.el))}const p=w=>{const C=sr(o);if(w.target!=null&&!(!(C instanceof Element)&&u(o)&&d(o,w))&&!(!C||C===w.target||w.composedPath().includes(C))){if("detail"in w&&w.detail===0&&(t=!s(w)),!t){t=!0;return}h(w)}};let m=!1;const A=[mr(a,"click",w=>{m||(m=!0,setTimeout(()=>{m=!1},0),p(w))},{passive:!0,capture:r}),mr(a,"pointerdown",w=>{const C=sr(o);t=!s(w)&&!!(C&&!w.composedPath().includes(C))},{passive:!0}),e&&mr(a,"blur",w=>{setTimeout(()=>{var C;const b=sr(o);((C=a.document.activeElement)==null?void 0:C.tagName)==="IFRAME"&&!(b!=null&&b.contains(a.document.activeElement))&&h(w)},0)},{passive:!0})].filter(Boolean),y=()=>A.forEach(w=>w());return n?{stop:y,cancel:()=>{t=!1},trigger:w=>{t=!0,p(w),t=!1}}:y}const Hr=new WeakMap,qa={mounted(o,h){const i=!h.modifiers.bubble;let a;if(typeof h.value=="function")a=Gi(o,h.value,{capture:i});else{const[l,r]=h.value;a=Gi(o,l,Object.assign({capture:i},r))}Hr.set(o,a)},unmounted(o){const h=Hr.get(o);h&&typeof h=="function"?h():h==null||h.stop(),Hr.delete(o)}};function qr(o){return typeof Window<"u"&&o instanceof Window?o.document.documentElement:typeof Document<"u"&&o instanceof Document?o.documentElement:o}function Yi(o){const h=window.getComputedStyle(o);if(h.overflowX==="scroll"||h.overflowY==="scroll"||h.overflowX==="auto"&&o.clientWidth<o.scrollWidth||h.overflowY==="auto"&&o.clientHeight<o.scrollHeight)return!0;{const i=o.parentNode;return!i||i.tagName==="BODY"?!1:Yi(i)}}function $a(o){const h=o||window.event,i=h.target;return Yi(i)?!1:h.touches.length>1?!0:(h.preventDefault&&h.preventDefault(),!1)}const $r=new WeakMap;function za(o,h=!1){const i=E.shallowRef(h);let a=null,l="";E.watch(Wa(o),n=>{const t=qr(E.toValue(n));if(t){const s=t;if($r.get(s)||$r.set(s,s.style.overflow),s.style.overflow!=="hidden"&&(l=s.style.overflow),s.style.overflow==="hidden")return i.value=!0;if(i.value)return s.style.overflow="hidden"}},{immediate:!0});const r=()=>{const n=qr(E.toValue(o));!n||i.value||(Qr&&(a=mr(n,"touchmove",t=>{$a(t)},{passive:!1})),n.style.overflow="hidden",i.value=!0)},e=()=>{const n=qr(E.toValue(o));!n||!i.value||(Qr&&(a==null||a()),n.style.overflow=l,$r.delete(n),i.value=!1)};return Hi(e),E.computed({get(){return i.value},set(n){n?r():e()}})}function Ga(){let o=!1;const h=E.shallowRef(!1);return(i,a)=>{if(h.value=a.value,o)return;o=!0;const l=za(i,a.value);E.watch(h,r=>l.value=r)}}Ga();const Ya={class:"beam_filter-container"},Ja={class:"beam_filter-option-select"},Za={class:"beam_filter-label"},Xa={key:0,ref:"menu",class:"beam_filter-select-menu"},el=["data-value","onClick"],Ji=Ye(E.defineComponent({__name:"BeamFilterOption",props:{choices:{default:()=>[]},title:{default:"title"}},emits:["select"],setup(o,{emit:h}){const i=h,a=E.ref(!1),l=E.ref(o.choices[0].label),r=E.ref(o.choices[0].value),e=n=>{l.value=n.label,r.value=n.value,i("select",n)};return(n,t)=>{const s=E.resolveComponent("BeamHeading");return E.withDirectives((E.openBlock(),E.createElementBlock("div",Ya,[E.createVNode(s,{class:"beam_filter-option-heading"},{default:E.withCtx(()=>[E.createTextVNode(E.toDisplayString(n.title),1)]),_:1}),E.createElementVNode("div",{onClick:t[0]||(t[0]=u=>a.value=!a.value),class:"beam_filter-option"},[E.createElementVNode("div",Ja,[t[1]||(t[1]=E.createElementVNode("div",{class:"beam_filter-arrow"},[E.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 35.36 70.71"},[E.createElementVNode("polygon",{points:"0 70.71 0 0 35.36 35.36 0 70.71"})])],-1)),E.createElementVNode("div",Za,[E.createElementVNode("label",null,E.toDisplayString(l.value),1)])]),a.value?(E.openBlock(),E.createElementBlock("ul",Xa,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(n.choices,u=>(E.openBlock(),E.createElementBlock("li",{class:E.normalizeClass([{selected:l.value==u.label},"beam_filter-select-option"]),"data-value":u.value,key:u.value,onClick:d=>e(u)},E.toDisplayString(u.label),11,el))),128))],512)):E.createCommentVNode("",!0)])])),[[E.unref(qa),()=>a.value=!1]])}}}),[["__scopeId","data-v-be55508c"]]),tl={},rl={class:"beam_header"};function nl(o,h){return E.openBlock(),E.createElementBlock("h1",rl,[E.renderSlot(o.$slots,"default",{},void 0,!0)])}const Zi=Ye(tl,[["render",nl],["__scopeId","data-v-5182a4d5"]]),il={class:"beam_metadata"},ol={class:"beam_metadata_content"},sl={class:"beam_metadata_block"},al={class:"beam_metadata_heading"},Xi=Ye(E.defineComponent({__name:"BeamMetadata",props:{order:{}},setup(o){return(h,i)=>(E.openBlock(),E.createElementBlock("div",il,[E.createElementVNode("div",ol,[E.renderSlot(h.$slots,"default",{},()=>[i[1]||(i[1]=E.createElementVNode("div",{class:"beam_metadata_header beam_metadata--two-column"},null,-1)),E.createElementVNode("div",sl,[E.createElementVNode("p",al,[i[0]||(i[0]=E.createTextVNode(" Status: ")),E.createElementVNode("span",{class:E.normalizeClass([{alert:!h.order.complete},"beam_metadata--normal"])},E.toDisplayString(h.order.complete?"Complete":"In Progress"),3)])]),i[2]||(i[2]=E.createStaticVNode('<div class="beam_metadata_shipping beam_metadata_block" data-v-80484331><div class="beam_metadata_source" data-v-80484331><p class="beam_metadata_heading" data-v-80484331>Source</p></div><div class="beam_metadata_source" data-v-80484331><p class="beam_metadata_heading" data-v-80484331>Receiving</p></div></div>',1))],!0)]),i[3]||(i[3]=E.createElementVNode("hr",null,null,-1))]))}}),[["__scopeId","data-v-80484331"]]),ll={class:"beam_modal"},eo=Ye(E.defineComponent({__name:"BeamModal",props:{showModal:{type:Boolean}},setup(o){return(h,i)=>{const a=E.resolveComponent("BeamBtn"),l=E.resolveComponent("portal");return E.openBlock(),E.createBlock(l,{to:"beam_modal_outlet"},{default:E.withCtx(()=>[E.withDirectives(E.createElementVNode("div",ll,[E.createVNode(a,{onClick:i[0]||(i[0]=r=>h.$emit("closemodal"))},{default:E.withCtx(()=>i[3]||(i[3]=[E.createTextVNode("Close Modal")])),_:1,__:[3]}),E.renderSlot(h.$slots,"default",{onClosemodal:i[1]||(i[1]=r=>h.$emit("closemodal")),onConfirmmodal:i[2]||(i[2]=r=>h.$emit("confirmmodal"))},void 0,!0)],512),[[E.vShow,h.showModal]])]),_:3})}}}),[["__scopeId","data-v-4f3f0253"]]),to=E.defineComponent({__name:"BeamModalOutlet",emits:["confirmmodal","closemodal"],setup(o){return(h,i)=>{const a=E.resolveComponent("portal-target");return E.openBlock(),E.createBlock(a,{name:"beam_modal_outlet"})}}}),ul={class:"beam_metadata_heading"},ro=E.defineComponent({__name:"BeamProgress",props:{label:{default:"Status"},progressMessage:{default:"In Progress"},completeMessage:{default:"Complete"},complete:{type:Boolean,default:!1}},setup(o){const h=E.computed(()=>o.complete?o.completeMessage:o.progressMessage);return(i,a)=>(E.openBlock(),E.createElementBlock("p",ul,[E.createTextVNode(E.toDisplayString(i.label)+": ",1),E.createElementVNode("span",{class:E.normalizeClass([{"beam--alert":!i.complete},"beam--normal"])},E.toDisplayString(h.value),3)]))}}),cl={},hl={class:"beam_modal-confirm"};function fl(o,h){const i=E.resolveComponent("BeamBtn");return E.openBlock(),E.createElementBlock("div",hl,[h[4]||(h[4]=E.createElementVNode("h2",null,"Would you like to continue?",-1)),E.createVNode(i,{onClick:h[0]||(h[0]=a=>o.$emit("confirmmodal"))},{default:E.withCtx(()=>h[2]||(h[2]=[E.createTextVNode("Yes")])),_:1,__:[2]}),E.createVNode(i,{onClick:h[1]||(h[1]=a=>o.$emit("confirmmodal"))},{default:E.withCtx(()=>h[3]||(h[3]=[E.createTextVNode("No")])),_:1,__:[3]})])}const no=Ye(cl,[["render",fl],["__scopeId","data-v-5b430dca"]]),dl={},pl={class:"fixed-top"};function gl(o,h){return E.openBlock(),E.createElementBlock("div",pl,[E.renderSlot(o.$slots,"default",{},void 0,!0)])}const io=Ye(dl,[["render",gl],["__scopeId","data-v-a38a41d0"]]),ml={class:"container"},zr=Ye(E.defineComponent({__name:"ItemCheck",props:{modelValue:{type:Boolean,default:!1},modelModifiers:{}},emits:["update:modelValue"],setup(o){const h=E.useModel(o,"modelValue");return(i,a)=>(E.openBlock(),E.createElementBlock("label",ml,[E.withDirectives(E.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":a[0]||(a[0]=l=>h.value=l),tabindex:"-1"},null,512),[[E.vModelCheckbox,h.value]]),a[1]||(a[1]=E.createElementVNode("div",{class:"checkmark",tabindex:"0"},null,-1))]))}}),[["__scopeId","data-v-14a5f31b"]]),Al={class:"beam_item-count"},bl=["contenteditable"],wl={key:0},yl={key:1},Gr=Ye(E.defineComponent({__name:"ItemCount",props:E.mergeModels({denominator:{default:0},debounce:{default:300},editable:{default:!0},uom:{default:""}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const h=E.useModel(o,"modelValue"),i=E.computed(()=>o.denominator!==0&&h.value===o.denominator),a=e=>{const n=Number(e.target.innerHTML)||0;h.value=o.denominator?Math.min(n,o.denominator):n},l=Ka(e=>a(e),o.debounce),r=async e=>await l(e);return(e,n)=>(E.openBlock(),E.createElementBlock("div",Al,[E.createElementVNode("span",{contenteditable:e.editable,class:E.normalizeClass({"beam--alert":!i.value}),onClick:E.withModifiers(a,["stop","prevent"]),onInput:E.withModifiers(r,["stop","prevent"]),onPaste:a},E.toDisplayString(h.value),43,bl),e.denominator?(E.openBlock(),E.createElementBlock("span",wl,"/"+E.toDisplayString(e.denominator),1)):E.createCommentVNode("",!0),e.uom?(E.openBlock(),E.createElementBlock("span",yl,"  "+E.toDisplayString(e.uom),1)):E.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-fa0e6dff"]]),vl=["href"],oo=Ye(E.defineComponent({__name:"ListAnchor",props:{to:{default:""}},setup(o){return(h,i)=>(E.openBlock(),E.createElementBlock("a",{href:h.to,class:"beam_list-anchor"},[E.renderSlot(h.$slots,"default",{},void 0,!0)],8,vl))}}),[["__scopeId","data-v-7e3ecf0d"]]),_l={tabindex:"0",class:"beam_list-item"},El={class:"beam_list-text"},Sl={class:"beam--bold"},Ar=Ye(E.defineComponent({__name:"ListItem",props:{item:{}},emits:["update"],setup(o,{emit:h}){const i=h,a=E.ref(o.item);return E.watch(a,l=>{i("update",l)},{deep:!0}),(l,r)=>(E.openBlock(),E.createElementBlock("li",_l,[E.createElementVNode("div",El,[E.createElementVNode("label",Sl,E.toDisplayString(a.value.label),1),E.createElementVNode("p",null,E.toDisplayString(a.value.description),1)]),a.value.count?(E.openBlock(),E.createBlock(Gr,{key:0,modelValue:a.value.count.count,"onUpdate:modelValue":r[0]||(r[0]=e=>a.value.count.count=e),debounce:a.value.debounce,denominator:a.value.count.of,editable:!0,uom:a.value.count.uom},null,8,["modelValue","debounce","denominator","uom"])):E.createCommentVNode("",!0),a.value.hasOwnProperty("checked")?(E.openBlock(),E.createBlock(zr,{key:1,modelValue:a.value.checked,"onUpdate:modelValue":r[1]||(r[1]=e=>a.value.checked=e)},null,8,["modelValue"])):E.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-634dd647"]]),Cl={class:"beam_list-view"},so=Ye(E.defineComponent({__name:"ListView",props:{items:{}},emits:["update","scrollbottom"],setup(o,{emit:h}){const i=h;E.onMounted(()=>{window.addEventListener("scroll",l)}),E.onUnmounted(()=>{window.removeEventListener("scroll",l)});const a=r=>i("update",r),l=()=>{const r=document.documentElement.scrollHeight-window.innerHeight,e=document.documentElement.scrollTop;r-e<=2&&i("scrollbottom")};return(r,e)=>(E.openBlock(),E.createElementBlock("ul",Cl,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(r.items,n=>(E.openBlock(),E.createElementBlock("li",{key:n.barcode||n.label},[n.linkComponent=="BeamDayDivider"?(E.openBlock(),E.createBlock(Vr,{key:0,item:n},null,8,["item"])):n.linkComponent?(E.openBlock(),E.createBlock(E.resolveDynamicComponent(n.linkComponent),{key:1,to:n.route,tabindex:"-1"},{default:E.withCtx(()=>[E.createVNode(Ar,{item:n,onUpdate:a},null,8,["item"])]),_:2},1032,["to"])):(E.openBlock(),E.createBlock(Ar,{key:2,item:n,onUpdate:a},null,8,["item"]))]))),128))]))}}),[["__scopeId","data-v-d536b2a7"]]),kl={class:"beam_navbar"},ao=Ye(E.defineComponent({__name:"Navbar",emits:["click"],setup(o,{emit:h}){const i=h,a=()=>{i("click")};return(l,r)=>{const e=E.resolveComponent("BeamHeading"),n=E.resolveComponent("BeamBtn");return E.openBlock(),E.createElementBlock("nav",kl,[E.renderSlot(l.$slots,"title",{},()=>[E.createVNode(e,null,{default:E.withCtx(()=>r[0]||(r[0]=[E.createTextVNode("TITLE")])),_:1,__:[0]})],!0),E.createVNode(n,{onClick:a},{default:E.withCtx(()=>[E.renderSlot(l.$slots,"navbaraction",{},()=>[r[1]||(r[1]=E.createTextVNode("Action"))],!0)]),_:3})])}}}),[["__scopeId","data-v-cfc4c14e"]]);function Il(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var br={exports:{}},Tl=br.exports,lo;function Bl(){return lo||(lo=1,function(o,h){(function(i,a){o.exports=a()})(Tl,function(){var i={attachTo:function(a,l){if(a.scannerDetectionData!==void 0)throw new Error("onScan.js is already initialized for DOM element "+a);var r={onScan:function(e,n){},onScanError:function(e){},onKeyProcess:function(e,n){},onKeyDetect:function(e,n){},onPaste:function(e,n){},keyCodeMapper:function(e){return i.decodeKeyEvent(e)},onScanButtonLongPress:function(){},scanButtonKeyCode:!1,scanButtonLongPressTime:500,timeBeforeScanTest:100,avgTimeByChar:30,minLength:6,suffixKeyCodes:[9,13],prefixKeyCodes:[],ignoreIfFocusOn:!1,stopPropagation:!1,preventDefault:!1,captureEvents:!1,reactToKeydown:!0,reactToPaste:!1,singleScanQty:1};return l=this._mergeOptions(r,l),a.scannerDetectionData={options:l,vars:{firstCharTime:0,lastCharTime:0,accumulatedString:"",testTimer:!1,longPressTimeStart:0,longPressed:!1}},l.reactToPaste===!0&&a.addEventListener("paste",this._handlePaste,l.captureEvents),l.scanButtonKeyCode!==!1&&a.addEventListener("keyup",this._handleKeyUp,l.captureEvents),(l.reactToKeydown===!0||l.scanButtonKeyCode!==!1)&&a.addEventListener("keydown",this._handleKeyDown,l.captureEvents),this},detachFrom:function(a){a.scannerDetectionData.options.reactToPaste&&a.removeEventListener("paste",this._handlePaste),a.scannerDetectionData.options.scanButtonKeyCode!==!1&&a.removeEventListener("keyup",this._handleKeyUp),a.removeEventListener("keydown",this._handleKeyDown),a.scannerDetectionData=void 0},getOptions:function(a){return a.scannerDetectionData.options},setOptions:function(a,l){switch(a.scannerDetectionData.options.reactToPaste){case!0:l.reactToPaste===!1&&a.removeEventListener("paste",this._handlePaste);break;case!1:l.reactToPaste===!0&&a.addEventListener("paste",this._handlePaste);break}switch(a.scannerDetectionData.options.scanButtonKeyCode){case!1:l.scanButtonKeyCode!==!1&&a.addEventListener("keyup",this._handleKeyUp);break;default:l.scanButtonKeyCode===!1&&a.removeEventListener("keyup",this._handleKeyUp);break}return a.scannerDetectionData.options=this._mergeOptions(a.scannerDetectionData.options,l),this._reinitialize(a),this},decodeKeyEvent:function(a){var l=this._getNormalizedKeyNum(a);switch(!0){case(l>=48&&l<=90):case(l>=106&&l<=111):if(a.key!==void 0&&a.key!=="")return a.key;var r=String.fromCharCode(l);switch(a.shiftKey){case!1:r=r.toLowerCase();break;case!0:r=r.toUpperCase();break}return r;case(l>=96&&l<=105):return 0+(l-96)}return""},simulate:function(a,l){return this._reinitialize(a),Array.isArray(l)?l.forEach(function(r){var e={};(typeof r=="object"||typeof r=="function")&&r!==null?e=r:e.keyCode=parseInt(r);var n=new KeyboardEvent("keydown",e);document.dispatchEvent(n)}):this._validateScanCode(a,l),this},_reinitialize:function(a){var l=a.scannerDetectionData.vars;l.firstCharTime=0,l.lastCharTime=0,l.accumulatedString=""},_isFocusOnIgnoredElement:function(a){var l=a.scannerDetectionData.options.ignoreIfFocusOn;if(!l)return!1;var r=document.activeElement;if(Array.isArray(l)){for(var e=0;e<l.length;e++)if(r.matches(l[e])===!0)return!0}else if(r.matches(l))return!0;return!1},_validateScanCode:function(a,l){var r=a.scannerDetectionData,e=r.options,n=r.options.singleScanQty,t=r.vars.firstCharTime,s=r.vars.lastCharTime,u={},d;switch(!0){case l.length<e.minLength:u={message:"Receieved code is shorter then minimal length"};break;case s-t>l.length*e.avgTimeByChar:u={message:"Receieved code was not entered in time"};break;default:return e.onScan.call(a,l,n),d=new CustomEvent("scan",{detail:{scanCode:l,qty:n}}),a.dispatchEvent(d),i._reinitialize(a),!0}return u.scanCode=l,u.scanDuration=s-t,u.avgTimeByChar=e.avgTimeByChar,u.minLength=e.minLength,e.onScanError.call(a,u),d=new CustomEvent("scanError",{detail:u}),a.dispatchEvent(d),i._reinitialize(a),!1},_mergeOptions:function(a,l){var r={},e;for(e in a)Object.prototype.hasOwnProperty.call(a,e)&&(r[e]=a[e]);for(e in l)Object.prototype.hasOwnProperty.call(l,e)&&(r[e]=l[e]);return r},_getNormalizedKeyNum:function(a){return a.which||a.keyCode},_handleKeyDown:function(a){var l=i._getNormalizedKeyNum(a),r=this.scannerDetectionData.options,e=this.scannerDetectionData.vars,n=!1;if(r.onKeyDetect.call(this,l,a)!==!1&&!i._isFocusOnIgnoredElement(this)){if(r.scanButtonKeyCode!==!1&&l==r.scanButtonKeyCode){e.longPressed||(e.longPressTimer=setTimeout(r.onScanButtonLongPress,r.scanButtonLongPressTime,this),e.longPressed=!0);return}switch(!0){case(e.firstCharTime&&r.suffixKeyCodes.indexOf(l)!==-1):a.preventDefault(),a.stopImmediatePropagation(),n=!0;break;case(!e.firstCharTime&&r.prefixKeyCodes.indexOf(l)!==-1):a.preventDefault(),a.stopImmediatePropagation(),n=!1;break;default:var t=r.keyCodeMapper.call(this,a);if(t===null)return;e.accumulatedString+=t,r.preventDefault&&a.preventDefault(),r.stopPropagation&&a.stopImmediatePropagation(),n=!1;break}e.firstCharTime||(e.firstCharTime=Date.now()),e.lastCharTime=Date.now(),e.testTimer&&clearTimeout(e.testTimer),n?(i._validateScanCode(this,e.accumulatedString),e.testTimer=!1):e.testTimer=setTimeout(i._validateScanCode,r.timeBeforeScanTest,this,e.accumulatedString),r.onKeyProcess.call(this,t,a)}},_handlePaste:function(a){var l=this.scannerDetectionData.options,r=this.scannerDetectionData.vars,e=(event.clipboardData||window.clipboardData).getData("text");i._isFocusOnIgnoredElement(this)||(a.preventDefault(),l.stopPropagation&&a.stopImmediatePropagation(),l.onPaste.call(this,e,event),r.firstCharTime=0,r.lastCharTime=0,i._validateScanCode(this,e))},_handleKeyUp:function(a){if(!i._isFocusOnIgnoredElement(this)){var l=i._getNormalizedKeyNum(a);l==this.scannerDetectionData.options.scanButtonKeyCode&&(clearTimeout(this.scannerDetectionData.vars.longPressTimer),this.scannerDetectionData.vars.longPressed=!1)}},isScanInProgressFor:function(a){return a.scannerDetectionData.vars.firstCharTime>0},isAttachedTo:function(a){return a.scannerDetectionData!==void 0}};return i})}(br)),br.exports}var Ol=Bl();const uo=Il(Ol),Pl={id:"scan_input"},co=E.defineComponent({__name:"ScanInput",props:{scanHandler:{type:Function}},emits:["scanInstance"],setup(o,{emit:h}){const i=h,a=o;return E.onMounted(()=>{const l=uo.attachTo(window,{onScan:a.scanHandler});i("scanInstance",l)}),E.onUnmounted(()=>{uo.detachFrom(window)}),(l,r)=>(E.openBlock(),E.createElementBlock("div",Pl))}}),ho=Ye(E.defineComponent({__name:"SegmentedDisplay",props:{displayInput:{default:120.2568},decimalPlaces:{default:2},displayColor:{default:"gray"},textColor:{default:"white"}},setup(o){const h=E.computed(()=>o.displayInput===0?0 .toFixed(o.decimalPlaces):o.displayInput.toFixed(o.decimalPlaces)),i=a=>a.substr(0,2)=="--"?`var(${a})`:a;return(a,l)=>(E.openBlock(),E.createElementBlock("div",{class:"segmented-display",style:E.normalizeStyle({background:i(a.displayColor)})},[E.createElementVNode("h1",{class:"segmented-display-output",style:E.normalizeStyle({color:i(a.textColor)})},E.toDisplayString(h.value),5)],4))}}),[["__scopeId","data-v-140e435e"]]),xl={class:"column column-left"},Rl={class:"column column-right"},fo=Ye(E.defineComponent({__name:"SplitColumn",props:{justifyContent:{},alignItems:{}},setup(o){return(h,i)=>(E.openBlock(),E.createElementBlock("div",{class:"two-column",style:E.normalizeStyle({justifyContent:h.justifyContent||"space-between",alignItems:h.alignItems||"flex-start"})},[E.createElementVNode("div",xl,[E.renderSlot(h.$slots,"left",{},void 0,!0)]),E.createElementVNode("div",Rl,[E.renderSlot(h.$slots,"right",{},void 0,!0)])],4))}}),[["__scopeId","data-v-c65440c0"]]),po=Ye(E.defineComponent({__name:"ToggleArrow",props:{open:{type:Boolean}},setup(o){return(h,i)=>(E.openBlock(),E.createElementBlock("div",{class:E.normalizeClass(["arrow-icon",{open:h.open}])},i[0]||(i[0]=[E.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 35.36 70.71"},[E.createElementVNode("polygon",{points:"0 70.71 0 0 35.36 35.36 0 70.71"})],-1)]),2))}}),[["__scopeId","data-v-05e7abed"]]);var Yr=Object.defineProperty,Ml=Object.getOwnPropertyDescriptor,Ul=Object.getOwnPropertyNames,Dl=Object.prototype.hasOwnProperty,it=(o,h)=>()=>(o&&(h=o(o=0)),h),Ae=(o,h)=>()=>(h||o((h={exports:{}}).exports,h),h.exports),tr=(o,h)=>{for(var i in h)Yr(o,i,{get:h[i],enumerable:!0})},Ll=(o,h,i,a)=>{if(h&&typeof h=="object"||typeof h=="function")for(let l of Ul(h))!Dl.call(o,l)&&l!==i&&Yr(o,l,{get:()=>h[l],enumerable:!(a=Ml(h,l))||a.enumerable});return o},Le=o=>Ll(Yr({},"__esModule",{value:!0}),o),ce=it(()=>{}),De={};tr(De,{_debugEnd:()=>Pn,_debugProcess:()=>On,_events:()=>$n,_eventsCount:()=>zn,_exiting:()=>mn,_fatalExceptions:()=>In,_getActiveHandles:()=>vo,_getActiveRequests:()=>yo,_kill:()=>wn,_linkedBinding:()=>bo,_maxListeners:()=>qn,_preload_modules:()=>Qn,_rawDebug:()=>dn,_startProfilerIdleNotifier:()=>xn,_stopProfilerIdleNotifier:()=>Rn,_tickCallback:()=>Bn,abort:()=>Ln,addListener:()=>Gn,allowedNodeEnvironmentFlags:()=>Cn,arch:()=>Xr,argv:()=>rn,argv0:()=>Vn,assert:()=>_o,binding:()=>ln,chdir:()=>hn,config:()=>An,cpuUsage:()=>lr,cwd:()=>cn,debugPort:()=>Wn,default:()=>ni,dlopen:()=>wo,domain:()=>gn,emit:()=>ei,emitWarning:()=>an,env:()=>tn,execArgv:()=>nn,execPath:()=>jn,exit:()=>En,features:()=>kn,hasUncaughtExceptionCaptureCallback:()=>Eo,hrtime:()=>wr,kill:()=>_n,listeners:()=>Co,memoryUsage:()=>vn,moduleLoadList:()=>pn,nextTick:()=>mo,off:()=>Jn,on:()=>yt,once:()=>Yn,openStdin:()=>Sn,pid:()=>Nn,platform:()=>en,ppid:()=>Fn,prependListener:()=>ti,prependOnceListener:()=>ri,reallyExit:()=>bn,release:()=>fn,removeAllListeners:()=>Xn,removeListener:()=>Zn,resourceUsage:()=>yn,setSourceMapsEnabled:()=>Kn,setUncaughtExceptionCaptureCallback:()=>Tn,stderr:()=>Un,stdin:()=>Dn,stdout:()=>Mn,title:()=>Zr,umask:()=>un,uptime:()=>So,version:()=>on,versions:()=>sn});function Jr(o){throw new Error("Node.js process "+o+" is not supported by JSPM core outside of Node.js")}function Nl(){!jt||!Wt||(jt=!1,Wt.length?gt=Wt.concat(gt):ar=-1,gt.length&&go())}function go(){if(!jt){var o=setTimeout(Nl,0);jt=!0;for(var h=gt.length;h;){for(Wt=gt,gt=[];++ar<h;)Wt&&Wt[ar].run();ar=-1,h=gt.length}Wt=null,jt=!1,clearTimeout(o)}}function mo(o){var h=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)h[i-1]=arguments[i];gt.push(new Ao(o,h)),gt.length===1&&!jt&&setTimeout(go,0)}function Ao(o,h){this.fun=o,this.array=h}function tt(){}function bo(o){Jr("_linkedBinding")}function wo(o){Jr("dlopen")}function yo(){return[]}function vo(){return[]}function _o(o,h){if(!o)throw new Error(h||"assertion error")}function Eo(){return!1}function So(){return vt.now()/1e3}function wr(o){var h=Math.floor((Date.now()-vt.now())*.001),i=vt.now()*.001,a=Math.floor(i)+h,l=Math.floor(i%1*1e9);return o&&(a=a-o[0],l=l-o[1],l<0&&(a--,l+=yr)),[a,l]}function yt(){return ni}function Co(o){return[]}var gt,jt,Wt,ar,Zr,Xr,en,tn,rn,nn,on,sn,an,ln,un,cn,hn,fn,dn,pn,gn,mn,An,bn,wn,lr,yn,vn,_n,En,Sn,Cn,kn,In,Tn,Bn,On,Pn,xn,Rn,Mn,Un,Dn,Ln,Nn,Fn,jn,Wn,Vn,Qn,Kn,vt,Hn,yr,qn,$n,zn,Gn,Yn,Jn,Zn,Xn,ei,ti,ri,ni,Fl=it(()=>{ce(),fe(),he(),gt=[],jt=!1,ar=-1,Ao.prototype.run=function(){this.fun.apply(null,this.array)},Zr="browser",Xr="x64",en="browser",tn={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},rn=["/usr/bin/node"],nn=[],on="v16.8.0",sn={},an=function(o,h){console.warn((h?h+": ":"")+o)},ln=function(o){Jr("binding")},un=function(o){return 0},cn=function(){return"/"},hn=function(o){},fn={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},dn=tt,pn=[],gn={},mn=!1,An={},bn=tt,wn=tt,lr=function(){return{}},yn=lr,vn=lr,_n=tt,En=tt,Sn=tt,Cn={},kn={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},In=tt,Tn=tt,Bn=tt,On=tt,Pn=tt,xn=tt,Rn=tt,Mn=void 0,Un=void 0,Dn=void 0,Ln=tt,Nn=2,Fn=1,jn="/bin/usr/node",Wn=9229,Vn="node",Qn=[],Kn=tt,vt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},vt.now===void 0&&(Hn=Date.now(),vt.timing&&vt.timing.navigationStart&&(Hn=vt.timing.navigationStart),vt.now=()=>Date.now()-Hn),yr=1e9,wr.bigint=function(o){var h=wr(o);return typeof BigInt>"u"?h[0]*yr+h[1]:BigInt(h[0]*yr)+BigInt(h[1])},qn=10,$n={},zn=0,Gn=yt,Yn=yt,Jn=yt,Zn=yt,Xn=yt,ei=tt,ti=yt,ri=yt,ni={version:on,versions:sn,arch:Xr,platform:en,release:fn,_rawDebug:dn,moduleLoadList:pn,binding:ln,_linkedBinding:bo,_events:$n,_eventsCount:zn,_maxListeners:qn,on:yt,addListener:Gn,once:Yn,off:Jn,removeListener:Zn,removeAllListeners:Xn,emit:ei,prependListener:ti,prependOnceListener:ri,listeners:Co,domain:gn,_exiting:mn,config:An,dlopen:wo,uptime:So,_getActiveRequests:yo,_getActiveHandles:vo,reallyExit:bn,_kill:wn,cpuUsage:lr,resourceUsage:yn,memoryUsage:vn,kill:_n,exit:En,openStdin:Sn,allowedNodeEnvironmentFlags:Cn,assert:_o,features:kn,_fatalExceptions:In,setUncaughtExceptionCaptureCallback:Tn,hasUncaughtExceptionCaptureCallback:Eo,emitWarning:an,nextTick:mo,_tickCallback:Bn,_debugProcess:On,_debugEnd:Pn,_startProfilerIdleNotifier:xn,_stopProfilerIdleNotifier:Rn,stdout:Mn,stdin:Dn,stderr:Un,abort:Ln,umask:un,chdir:hn,cwd:cn,env:tn,title:Zr,argv:rn,execArgv:nn,pid:Nn,ppid:Fn,execPath:jn,debugPort:Wn,hrtime:wr,argv0:Vn,_preload_modules:Qn,setSourceMapsEnabled:Kn}}),he=it(()=>{Fl()}),Ze={};tr(Ze,{Buffer:()=>vr,INSPECT_MAX_BYTES:()=>ko,default:()=>_t,kMaxLength:()=>Io});function jl(){if(ii)return rr;ii=!0,rr.byteLength=n,rr.toByteArray=s,rr.fromByteArray=p;for(var o=[],h=[],i=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,r=a.length;l<r;++l)o[l]=a[l],h[a.charCodeAt(l)]=l;h[45]=62,h[95]=63;function e(m){var A=m.length;if(A%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var y=m.indexOf("=");y===-1&&(y=A);var w=y===A?0:4-y%4;return[y,w]}function n(m){var A=e(m),y=A[0],w=A[1];return(y+w)*3/4-w}function t(m,A,y){return(A+y)*3/4-y}function s(m){var A,y=e(m),w=y[0],C=y[1],b=new i(t(m,w,C)),_=0,N=C>0?w-4:w,M;for(M=0;M<N;M+=4)A=h[m.charCodeAt(M)]<<18|h[m.charCodeAt(M+1)]<<12|h[m.charCodeAt(M+2)]<<6|h[m.charCodeAt(M+3)],b[_++]=A>>16&255,b[_++]=A>>8&255,b[_++]=A&255;return C===2&&(A=h[m.charCodeAt(M)]<<2|h[m.charCodeAt(M+1)]>>4,b[_++]=A&255),C===1&&(A=h[m.charCodeAt(M)]<<10|h[m.charCodeAt(M+1)]<<4|h[m.charCodeAt(M+2)]>>2,b[_++]=A>>8&255,b[_++]=A&255),b}function u(m){return o[m>>18&63]+o[m>>12&63]+o[m>>6&63]+o[m&63]}function d(m,A,y){for(var w,C=[],b=A;b<y;b+=3)w=(m[b]<<16&16711680)+(m[b+1]<<8&65280)+(m[b+2]&255),C.push(u(w));return C.join("")}function p(m){for(var A,y=m.length,w=y%3,C=[],b=16383,_=0,N=y-w;_<N;_+=b)C.push(d(m,_,_+b>N?N:_+b));return w===1?(A=m[y-1],C.push(o[A>>2]+o[A<<4&63]+"==")):w===2&&(A=(m[y-2]<<8)+m[y-1],C.push(o[A>>10]+o[A>>4&63]+o[A<<2&63]+"=")),C.join("")}return rr}function Wl(){return oi?ur:(oi=!0,ur.read=function(o,h,i,a,l){var r,e,n=l*8-a-1,t=(1<<n)-1,s=t>>1,u=-7,d=i?l-1:0,p=i?-1:1,m=o[h+d];for(d+=p,r=m&(1<<-u)-1,m>>=-u,u+=n;u>0;r=r*256+o[h+d],d+=p,u-=8);for(e=r&(1<<-u)-1,r>>=-u,u+=a;u>0;e=e*256+o[h+d],d+=p,u-=8);if(r===0)r=1-s;else{if(r===t)return e?NaN:(m?-1:1)*(1/0);e=e+Math.pow(2,a),r=r-s}return(m?-1:1)*e*Math.pow(2,r-a)},ur.write=function(o,h,i,a,l,r){var e,n,t,s=r*8-l-1,u=(1<<s)-1,d=u>>1,p=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=a?0:r-1,A=a?1:-1,y=h<0||h===0&&1/h<0?1:0;for(h=Math.abs(h),isNaN(h)||h===1/0?(n=isNaN(h)?1:0,e=u):(e=Math.floor(Math.log(h)/Math.LN2),h*(t=Math.pow(2,-e))<1&&(e--,t*=2),e+d>=1?h+=p/t:h+=p*Math.pow(2,1-d),h*t>=2&&(e++,t/=2),e+d>=u?(n=0,e=u):e+d>=1?(n=(h*t-1)*Math.pow(2,l),e=e+d):(n=h*Math.pow(2,d-1)*Math.pow(2,l),e=0));l>=8;o[i+m]=n&255,m+=A,n/=256,l-=8);for(e=e<<l|n,s+=l;s>0;o[i+m]=e&255,m+=A,e/=256,s-=8);o[i+m-A]|=y*128},ur)}function Vl(){if(si)return xt;si=!0;let o=jl(),h=Wl(),i=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;xt.Buffer=e,xt.SlowBuffer=C,xt.INSPECT_MAX_BYTES=50;let a=2147483647;xt.kMaxLength=a,e.TYPED_ARRAY_SUPPORT=l(),!e.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function l(){try{let c=new Uint8Array(1),f={foo:function(){return 42}};return Object.setPrototypeOf(f,Uint8Array.prototype),Object.setPrototypeOf(c,f),c.foo()===42}catch{return!1}}Object.defineProperty(e.prototype,"parent",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.buffer}}),Object.defineProperty(e.prototype,"offset",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.byteOffset}});function r(c){if(c>a)throw new RangeError('The value "'+c+'" is invalid for option "size"');let f=new Uint8Array(c);return Object.setPrototypeOf(f,e.prototype),f}function e(c,f,g){if(typeof c=="number"){if(typeof f=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return u(c)}return n(c,f,g)}e.poolSize=8192;function n(c,f,g){if(typeof c=="string")return d(c,f);if(ArrayBuffer.isView(c))return m(c);if(c==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof c);if(W(c,ArrayBuffer)||c&&W(c.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(W(c,SharedArrayBuffer)||c&&W(c.buffer,SharedArrayBuffer)))return A(c,f,g);if(typeof c=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let v=c.valueOf&&c.valueOf();if(v!=null&&v!==c)return e.from(v,f,g);let I=y(c);if(I)return I;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof c[Symbol.toPrimitive]=="function")return e.from(c[Symbol.toPrimitive]("string"),f,g);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof c)}e.from=function(c,f,g){return n(c,f,g)},Object.setPrototypeOf(e.prototype,Uint8Array.prototype),Object.setPrototypeOf(e,Uint8Array);function t(c){if(typeof c!="number")throw new TypeError('"size" argument must be of type number');if(c<0)throw new RangeError('The value "'+c+'" is invalid for option "size"')}function s(c,f,g){return t(c),c<=0?r(c):f!==void 0?typeof g=="string"?r(c).fill(f,g):r(c).fill(f):r(c)}e.alloc=function(c,f,g){return s(c,f,g)};function u(c){return t(c),r(c<0?0:w(c)|0)}e.allocUnsafe=function(c){return u(c)},e.allocUnsafeSlow=function(c){return u(c)};function d(c,f){if((typeof f!="string"||f==="")&&(f="utf8"),!e.isEncoding(f))throw new TypeError("Unknown encoding: "+f);let g=b(c,f)|0,v=r(g),I=v.write(c,f);return I!==g&&(v=v.slice(0,I)),v}function p(c){let f=c.length<0?0:w(c.length)|0,g=r(f);for(let v=0;v<f;v+=1)g[v]=c[v]&255;return g}function m(c){if(W(c,Uint8Array)){let f=new Uint8Array(c);return A(f.buffer,f.byteOffset,f.byteLength)}return p(c)}function A(c,f,g){if(f<0||c.byteLength<f)throw new RangeError('"offset" is outside of buffer bounds');if(c.byteLength<f+(g||0))throw new RangeError('"length" is outside of buffer bounds');let v;return f===void 0&&g===void 0?v=new Uint8Array(c):g===void 0?v=new Uint8Array(c,f):v=new Uint8Array(c,f,g),Object.setPrototypeOf(v,e.prototype),v}function y(c){if(e.isBuffer(c)){let f=w(c.length)|0,g=r(f);return g.length===0||c.copy(g,0,0,f),g}if(c.length!==void 0)return typeof c.length!="number"||se(c.length)?r(0):p(c);if(c.type==="Buffer"&&Array.isArray(c.data))return p(c.data)}function w(c){if(c>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return c|0}function C(c){return+c!=c&&(c=0),e.alloc(+c)}e.isBuffer=function(c){return c!=null&&c._isBuffer===!0&&c!==e.prototype},e.compare=function(c,f){if(W(c,Uint8Array)&&(c=e.from(c,c.offset,c.byteLength)),W(f,Uint8Array)&&(f=e.from(f,f.offset,f.byteLength)),!e.isBuffer(c)||!e.isBuffer(f))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(c===f)return 0;let g=c.length,v=f.length;for(let I=0,L=Math.min(g,v);I<L;++I)if(c[I]!==f[I]){g=c[I],v=f[I];break}return g<v?-1:v<g?1:0},e.isEncoding=function(c){switch(String(c).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},e.concat=function(c,f){if(!Array.isArray(c))throw new TypeError('"list" argument must be an Array of Buffers');if(c.length===0)return e.alloc(0);let g;if(f===void 0)for(f=0,g=0;g<c.length;++g)f+=c[g].length;let v=e.allocUnsafe(f),I=0;for(g=0;g<c.length;++g){let L=c[g];if(W(L,Uint8Array))I+L.length>v.length?(e.isBuffer(L)||(L=e.from(L)),L.copy(v,I)):Uint8Array.prototype.set.call(v,L,I);else if(e.isBuffer(L))L.copy(v,I);else throw new TypeError('"list" argument must be an Array of Buffers');I+=L.length}return v};function b(c,f){if(e.isBuffer(c))return c.length;if(ArrayBuffer.isView(c)||W(c,ArrayBuffer))return c.byteLength;if(typeof c!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof c);let g=c.length,v=arguments.length>2&&arguments[2]===!0;if(!v&&g===0)return 0;let I=!1;for(;;)switch(f){case"ascii":case"latin1":case"binary":return g;case"utf8":case"utf-8":return j(c).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g*2;case"hex":return g>>>1;case"base64":return re(c).length;default:if(I)return v?-1:j(c).length;f=(""+f).toLowerCase(),I=!0}}e.byteLength=b;function _(c,f,g){let v=!1;if((f===void 0||f<0)&&(f=0),f>this.length||((g===void 0||g>this.length)&&(g=this.length),g<=0)||(g>>>=0,f>>>=0,g<=f))return"";for(c||(c="utf8");;)switch(c){case"hex":return me(this,f,g);case"utf8":case"utf-8":return G(this,f,g);case"ascii":return be(this,f,g);case"latin1":case"binary":return pe(this,f,g);case"base64":return P(this,f,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ve(this,f,g);default:if(v)throw new TypeError("Unknown encoding: "+c);c=(c+"").toLowerCase(),v=!0}}e.prototype._isBuffer=!0;function N(c,f,g){let v=c[f];c[f]=c[g],c[g]=v}e.prototype.swap16=function(){let c=this.length;if(c%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let f=0;f<c;f+=2)N(this,f,f+1);return this},e.prototype.swap32=function(){let c=this.length;if(c%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let f=0;f<c;f+=4)N(this,f,f+3),N(this,f+1,f+2);return this},e.prototype.swap64=function(){let c=this.length;if(c%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let f=0;f<c;f+=8)N(this,f,f+7),N(this,f+1,f+6),N(this,f+2,f+5),N(this,f+3,f+4);return this},e.prototype.toString=function(){let c=this.length;return c===0?"":arguments.length===0?G(this,0,c):_.apply(this,arguments)},e.prototype.toLocaleString=e.prototype.toString,e.prototype.equals=function(c){if(!e.isBuffer(c))throw new TypeError("Argument must be a Buffer");return this===c?!0:e.compare(this,c)===0},e.prototype.inspect=function(){let c="",f=xt.INSPECT_MAX_BYTES;return c=this.toString("hex",0,f).replace(/(.{2})/g,"$1 ").trim(),this.length>f&&(c+=" ... "),"<Buffer "+c+">"},i&&(e.prototype[i]=e.prototype.inspect),e.prototype.compare=function(c,f,g,v,I){if(W(c,Uint8Array)&&(c=e.from(c,c.offset,c.byteLength)),!e.isBuffer(c))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof c);if(f===void 0&&(f=0),g===void 0&&(g=c?c.length:0),v===void 0&&(v=0),I===void 0&&(I=this.length),f<0||g>c.length||v<0||I>this.length)throw new RangeError("out of range index");if(v>=I&&f>=g)return 0;if(v>=I)return-1;if(f>=g)return 1;if(f>>>=0,g>>>=0,v>>>=0,I>>>=0,this===c)return 0;let L=I-v,$=g-f,_e=Math.min(L,$),Ee=this.slice(v,I),Be=c.slice(f,g);for(let Me=0;Me<_e;++Me)if(Ee[Me]!==Be[Me]){L=Ee[Me],$=Be[Me];break}return L<$?-1:$<L?1:0};function M(c,f,g,v,I){if(c.length===0)return-1;if(typeof g=="string"?(v=g,g=0):g>2147483647?g=2147483647:g<-2147483648&&(g=-2147483648),g=+g,se(g)&&(g=I?0:c.length-1),g<0&&(g=c.length+g),g>=c.length){if(I)return-1;g=c.length-1}else if(g<0)if(I)g=0;else return-1;if(typeof f=="string"&&(f=e.from(f,v)),e.isBuffer(f))return f.length===0?-1:k(c,f,g,v,I);if(typeof f=="number")return f=f&255,typeof Uint8Array.prototype.indexOf=="function"?I?Uint8Array.prototype.indexOf.call(c,f,g):Uint8Array.prototype.lastIndexOf.call(c,f,g):k(c,[f],g,v,I);throw new TypeError("val must be string, number or Buffer")}function k(c,f,g,v,I){let L=1,$=c.length,_e=f.length;if(v!==void 0&&(v=String(v).toLowerCase(),v==="ucs2"||v==="ucs-2"||v==="utf16le"||v==="utf-16le")){if(c.length<2||f.length<2)return-1;L=2,$/=2,_e/=2,g/=2}function Ee(Me,xe){return L===1?Me[xe]:Me.readUInt16BE(xe*L)}let Be;if(I){let Me=-1;for(Be=g;Be<$;Be++)if(Ee(c,Be)===Ee(f,Me===-1?0:Be-Me)){if(Me===-1&&(Me=Be),Be-Me+1===_e)return Me*L}else Me!==-1&&(Be-=Be-Me),Me=-1}else for(g+_e>$&&(g=$-_e),Be=g;Be>=0;Be--){let Me=!0;for(let xe=0;xe<_e;xe++)if(Ee(c,Be+xe)!==Ee(f,xe)){Me=!1;break}if(Me)return Be}return-1}e.prototype.includes=function(c,f,g){return this.indexOf(c,f,g)!==-1},e.prototype.indexOf=function(c,f,g){return M(this,c,f,g,!0)},e.prototype.lastIndexOf=function(c,f,g){return M(this,c,f,g,!1)};function T(c,f,g,v){g=Number(g)||0;let I=c.length-g;v?(v=Number(v),v>I&&(v=I)):v=I;let L=f.length;v>L/2&&(v=L/2);let $;for($=0;$<v;++$){let _e=parseInt(f.substr($*2,2),16);if(se(_e))return $;c[g+$]=_e}return $}function U(c,f,g,v){return ue(j(f,c.length-g),c,g,v)}function J(c,f,g,v){return ue(Y(f),c,g,v)}function X(c,f,g,v){return ue(re(f),c,g,v)}function le(c,f,g,v){return ue(oe(f,c.length-g),c,g,v)}e.prototype.write=function(c,f,g,v){if(f===void 0)v="utf8",g=this.length,f=0;else if(g===void 0&&typeof f=="string")v=f,g=this.length,f=0;else if(isFinite(f))f=f>>>0,isFinite(g)?(g=g>>>0,v===void 0&&(v="utf8")):(v=g,g=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let I=this.length-f;if((g===void 0||g>I)&&(g=I),c.length>0&&(g<0||f<0)||f>this.length)throw new RangeError("Attempt to write outside buffer bounds");v||(v="utf8");let L=!1;for(;;)switch(v){case"hex":return T(this,c,f,g);case"utf8":case"utf-8":return U(this,c,f,g);case"ascii":case"latin1":case"binary":return J(this,c,f,g);case"base64":return X(this,c,f,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return le(this,c,f,g);default:if(L)throw new TypeError("Unknown encoding: "+v);v=(""+v).toLowerCase(),L=!0}},e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function P(c,f,g){return f===0&&g===c.length?o.fromByteArray(c):o.fromByteArray(c.slice(f,g))}function G(c,f,g){g=Math.min(c.length,g);let v=[],I=f;for(;I<g;){let L=c[I],$=null,_e=L>239?4:L>223?3:L>191?2:1;if(I+_e<=g){let Ee,Be,Me,xe;switch(_e){case 1:L<128&&($=L);break;case 2:Ee=c[I+1],(Ee&192)===128&&(xe=(L&31)<<6|Ee&63,xe>127&&($=xe));break;case 3:Ee=c[I+1],Be=c[I+2],(Ee&192)===128&&(Be&192)===128&&(xe=(L&15)<<12|(Ee&63)<<6|Be&63,xe>2047&&(xe<55296||xe>57343)&&($=xe));break;case 4:Ee=c[I+1],Be=c[I+2],Me=c[I+3],(Ee&192)===128&&(Be&192)===128&&(Me&192)===128&&(xe=(L&15)<<18|(Ee&63)<<12|(Be&63)<<6|Me&63,xe>65535&&xe<1114112&&($=xe))}}$===null?($=65533,_e=1):$>65535&&($-=65536,v.push($>>>10&1023|55296),$=56320|$&1023),v.push($),I+=_e}return V(v)}let Z=4096;function V(c){let f=c.length;if(f<=Z)return String.fromCharCode.apply(String,c);let g="",v=0;for(;v<f;)g+=String.fromCharCode.apply(String,c.slice(v,v+=Z));return g}function be(c,f,g){let v="";g=Math.min(c.length,g);for(let I=f;I<g;++I)v+=String.fromCharCode(c[I]&127);return v}function pe(c,f,g){let v="";g=Math.min(c.length,g);for(let I=f;I<g;++I)v+=String.fromCharCode(c[I]);return v}function me(c,f,g){let v=c.length;(!f||f<0)&&(f=0),(!g||g<0||g>v)&&(g=v);let I="";for(let L=f;L<g;++L)I+=we[c[L]];return I}function ve(c,f,g){let v=c.slice(f,g),I="";for(let L=0;L<v.length-1;L+=2)I+=String.fromCharCode(v[L]+v[L+1]*256);return I}e.prototype.slice=function(c,f){let g=this.length;c=~~c,f=f===void 0?g:~~f,c<0?(c+=g,c<0&&(c=0)):c>g&&(c=g),f<0?(f+=g,f<0&&(f=0)):f>g&&(f=g),f<c&&(f=c);let v=this.subarray(c,f);return Object.setPrototypeOf(v,e.prototype),v};function z(c,f,g){if(c%1!==0||c<0)throw new RangeError("offset is not uint");if(c+f>g)throw new RangeError("Trying to access beyond buffer length")}e.prototype.readUintLE=e.prototype.readUIntLE=function(c,f,g){c=c>>>0,f=f>>>0,g||z(c,f,this.length);let v=this[c],I=1,L=0;for(;++L<f&&(I*=256);)v+=this[c+L]*I;return v},e.prototype.readUintBE=e.prototype.readUIntBE=function(c,f,g){c=c>>>0,f=f>>>0,g||z(c,f,this.length);let v=this[c+--f],I=1;for(;f>0&&(I*=256);)v+=this[c+--f]*I;return v},e.prototype.readUint8=e.prototype.readUInt8=function(c,f){return c=c>>>0,f||z(c,1,this.length),this[c]},e.prototype.readUint16LE=e.prototype.readUInt16LE=function(c,f){return c=c>>>0,f||z(c,2,this.length),this[c]|this[c+1]<<8},e.prototype.readUint16BE=e.prototype.readUInt16BE=function(c,f){return c=c>>>0,f||z(c,2,this.length),this[c]<<8|this[c+1]},e.prototype.readUint32LE=e.prototype.readUInt32LE=function(c,f){return c=c>>>0,f||z(c,4,this.length),(this[c]|this[c+1]<<8|this[c+2]<<16)+this[c+3]*16777216},e.prototype.readUint32BE=e.prototype.readUInt32BE=function(c,f){return c=c>>>0,f||z(c,4,this.length),this[c]*16777216+(this[c+1]<<16|this[c+2]<<8|this[c+3])},e.prototype.readBigUInt64LE=te(function(c){c=c>>>0,H(c,"offset");let f=this[c],g=this[c+7];(f===void 0||g===void 0)&&ae(c,this.length-8);let v=f+this[++c]*2**8+this[++c]*2**16+this[++c]*2**24,I=this[++c]+this[++c]*2**8+this[++c]*2**16+g*2**24;return BigInt(v)+(BigInt(I)<<BigInt(32))}),e.prototype.readBigUInt64BE=te(function(c){c=c>>>0,H(c,"offset");let f=this[c],g=this[c+7];(f===void 0||g===void 0)&&ae(c,this.length-8);let v=f*2**24+this[++c]*2**16+this[++c]*2**8+this[++c],I=this[++c]*2**24+this[++c]*2**16+this[++c]*2**8+g;return(BigInt(v)<<BigInt(32))+BigInt(I)}),e.prototype.readIntLE=function(c,f,g){c=c>>>0,f=f>>>0,g||z(c,f,this.length);let v=this[c],I=1,L=0;for(;++L<f&&(I*=256);)v+=this[c+L]*I;return I*=128,v>=I&&(v-=Math.pow(2,8*f)),v},e.prototype.readIntBE=function(c,f,g){c=c>>>0,f=f>>>0,g||z(c,f,this.length);let v=f,I=1,L=this[c+--v];for(;v>0&&(I*=256);)L+=this[c+--v]*I;return I*=128,L>=I&&(L-=Math.pow(2,8*f)),L},e.prototype.readInt8=function(c,f){return c=c>>>0,f||z(c,1,this.length),this[c]&128?(255-this[c]+1)*-1:this[c]},e.prototype.readInt16LE=function(c,f){c=c>>>0,f||z(c,2,this.length);let g=this[c]|this[c+1]<<8;return g&32768?g|4294901760:g},e.prototype.readInt16BE=function(c,f){c=c>>>0,f||z(c,2,this.length);let g=this[c+1]|this[c]<<8;return g&32768?g|4294901760:g},e.prototype.readInt32LE=function(c,f){return c=c>>>0,f||z(c,4,this.length),this[c]|this[c+1]<<8|this[c+2]<<16|this[c+3]<<24},e.prototype.readInt32BE=function(c,f){return c=c>>>0,f||z(c,4,this.length),this[c]<<24|this[c+1]<<16|this[c+2]<<8|this[c+3]},e.prototype.readBigInt64LE=te(function(c){c=c>>>0,H(c,"offset");let f=this[c],g=this[c+7];(f===void 0||g===void 0)&&ae(c,this.length-8);let v=this[c+4]+this[c+5]*2**8+this[c+6]*2**16+(g<<24);return(BigInt(v)<<BigInt(32))+BigInt(f+this[++c]*2**8+this[++c]*2**16+this[++c]*2**24)}),e.prototype.readBigInt64BE=te(function(c){c=c>>>0,H(c,"offset");let f=this[c],g=this[c+7];(f===void 0||g===void 0)&&ae(c,this.length-8);let v=(f<<24)+this[++c]*2**16+this[++c]*2**8+this[++c];return(BigInt(v)<<BigInt(32))+BigInt(this[++c]*2**24+this[++c]*2**16+this[++c]*2**8+g)}),e.prototype.readFloatLE=function(c,f){return c=c>>>0,f||z(c,4,this.length),h.read(this,c,!0,23,4)},e.prototype.readFloatBE=function(c,f){return c=c>>>0,f||z(c,4,this.length),h.read(this,c,!1,23,4)},e.prototype.readDoubleLE=function(c,f){return c=c>>>0,f||z(c,8,this.length),h.read(this,c,!0,52,8)},e.prototype.readDoubleBE=function(c,f){return c=c>>>0,f||z(c,8,this.length),h.read(this,c,!1,52,8)};function de(c,f,g,v,I,L){if(!e.isBuffer(c))throw new TypeError('"buffer" argument must be a Buffer instance');if(f>I||f<L)throw new RangeError('"value" argument is out of bounds');if(g+v>c.length)throw new RangeError("Index out of range")}e.prototype.writeUintLE=e.prototype.writeUIntLE=function(c,f,g,v){if(c=+c,f=f>>>0,g=g>>>0,!v){let $=Math.pow(2,8*g)-1;de(this,c,f,g,$,0)}let I=1,L=0;for(this[f]=c&255;++L<g&&(I*=256);)this[f+L]=c/I&255;return f+g},e.prototype.writeUintBE=e.prototype.writeUIntBE=function(c,f,g,v){if(c=+c,f=f>>>0,g=g>>>0,!v){let $=Math.pow(2,8*g)-1;de(this,c,f,g,$,0)}let I=g-1,L=1;for(this[f+I]=c&255;--I>=0&&(L*=256);)this[f+I]=c/L&255;return f+g},e.prototype.writeUint8=e.prototype.writeUInt8=function(c,f,g){return c=+c,f=f>>>0,g||de(this,c,f,1,255,0),this[f]=c&255,f+1},e.prototype.writeUint16LE=e.prototype.writeUInt16LE=function(c,f,g){return c=+c,f=f>>>0,g||de(this,c,f,2,65535,0),this[f]=c&255,this[f+1]=c>>>8,f+2},e.prototype.writeUint16BE=e.prototype.writeUInt16BE=function(c,f,g){return c=+c,f=f>>>0,g||de(this,c,f,2,65535,0),this[f]=c>>>8,this[f+1]=c&255,f+2},e.prototype.writeUint32LE=e.prototype.writeUInt32LE=function(c,f,g){return c=+c,f=f>>>0,g||de(this,c,f,4,4294967295,0),this[f+3]=c>>>24,this[f+2]=c>>>16,this[f+1]=c>>>8,this[f]=c&255,f+4},e.prototype.writeUint32BE=e.prototype.writeUInt32BE=function(c,f,g){return c=+c,f=f>>>0,g||de(this,c,f,4,4294967295,0),this[f]=c>>>24,this[f+1]=c>>>16,this[f+2]=c>>>8,this[f+3]=c&255,f+4};function x(c,f,g,v,I){K(f,v,I,c,g,7);let L=Number(f&BigInt(4294967295));c[g++]=L,L=L>>8,c[g++]=L,L=L>>8,c[g++]=L,L=L>>8,c[g++]=L;let $=Number(f>>BigInt(32)&BigInt(4294967295));return c[g++]=$,$=$>>8,c[g++]=$,$=$>>8,c[g++]=$,$=$>>8,c[g++]=$,g}function ne(c,f,g,v,I){K(f,v,I,c,g,7);let L=Number(f&BigInt(4294967295));c[g+7]=L,L=L>>8,c[g+6]=L,L=L>>8,c[g+5]=L,L=L>>8,c[g+4]=L;let $=Number(f>>BigInt(32)&BigInt(4294967295));return c[g+3]=$,$=$>>8,c[g+2]=$,$=$>>8,c[g+1]=$,$=$>>8,c[g]=$,g+8}e.prototype.writeBigUInt64LE=te(function(c,f=0){return x(this,c,f,BigInt(0),BigInt("0xffffffffffffffff"))}),e.prototype.writeBigUInt64BE=te(function(c,f=0){return ne(this,c,f,BigInt(0),BigInt("0xffffffffffffffff"))}),e.prototype.writeIntLE=function(c,f,g,v){if(c=+c,f=f>>>0,!v){let _e=Math.pow(2,8*g-1);de(this,c,f,g,_e-1,-_e)}let I=0,L=1,$=0;for(this[f]=c&255;++I<g&&(L*=256);)c<0&&$===0&&this[f+I-1]!==0&&($=1),this[f+I]=(c/L>>0)-$&255;return f+g},e.prototype.writeIntBE=function(c,f,g,v){if(c=+c,f=f>>>0,!v){let _e=Math.pow(2,8*g-1);de(this,c,f,g,_e-1,-_e)}let I=g-1,L=1,$=0;for(this[f+I]=c&255;--I>=0&&(L*=256);)c<0&&$===0&&this[f+I+1]!==0&&($=1),this[f+I]=(c/L>>0)-$&255;return f+g},e.prototype.writeInt8=function(c,f,g){return c=+c,f=f>>>0,g||de(this,c,f,1,127,-128),c<0&&(c=255+c+1),this[f]=c&255,f+1},e.prototype.writeInt16LE=function(c,f,g){return c=+c,f=f>>>0,g||de(this,c,f,2,32767,-32768),this[f]=c&255,this[f+1]=c>>>8,f+2},e.prototype.writeInt16BE=function(c,f,g){return c=+c,f=f>>>0,g||de(this,c,f,2,32767,-32768),this[f]=c>>>8,this[f+1]=c&255,f+2},e.prototype.writeInt32LE=function(c,f,g){return c=+c,f=f>>>0,g||de(this,c,f,4,2147483647,-2147483648),this[f]=c&255,this[f+1]=c>>>8,this[f+2]=c>>>16,this[f+3]=c>>>24,f+4},e.prototype.writeInt32BE=function(c,f,g){return c=+c,f=f>>>0,g||de(this,c,f,4,2147483647,-2147483648),c<0&&(c=4294967295+c+1),this[f]=c>>>24,this[f+1]=c>>>16,this[f+2]=c>>>8,this[f+3]=c&255,f+4},e.prototype.writeBigInt64LE=te(function(c,f=0){return x(this,c,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),e.prototype.writeBigInt64BE=te(function(c,f=0){return ne(this,c,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ge(c,f,g,v,I,L){if(g+v>c.length)throw new RangeError("Index out of range");if(g<0)throw new RangeError("Index out of range")}function F(c,f,g,v,I){return f=+f,g=g>>>0,I||ge(c,f,g,4),h.write(c,f,g,v,23,4),g+4}e.prototype.writeFloatLE=function(c,f,g){return F(this,c,f,!0,g)},e.prototype.writeFloatBE=function(c,f,g){return F(this,c,f,!1,g)};function Ce(c,f,g,v,I){return f=+f,g=g>>>0,I||ge(c,f,g,8),h.write(c,f,g,v,52,8),g+8}e.prototype.writeDoubleLE=function(c,f,g){return Ce(this,c,f,!0,g)},e.prototype.writeDoubleBE=function(c,f,g){return Ce(this,c,f,!1,g)},e.prototype.copy=function(c,f,g,v){if(!e.isBuffer(c))throw new TypeError("argument should be a Buffer");if(g||(g=0),!v&&v!==0&&(v=this.length),f>=c.length&&(f=c.length),f||(f=0),v>0&&v<g&&(v=g),v===g||c.length===0||this.length===0)return 0;if(f<0)throw new RangeError("targetStart out of bounds");if(g<0||g>=this.length)throw new RangeError("Index out of range");if(v<0)throw new RangeError("sourceEnd out of bounds");v>this.length&&(v=this.length),c.length-f<v-g&&(v=c.length-f+g);let I=v-g;return this===c&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(f,g,v):Uint8Array.prototype.set.call(c,this.subarray(g,v),f),I},e.prototype.fill=function(c,f,g,v){if(typeof c=="string"){if(typeof f=="string"?(v=f,f=0,g=this.length):typeof g=="string"&&(v=g,g=this.length),v!==void 0&&typeof v!="string")throw new TypeError("encoding must be a string");if(typeof v=="string"&&!e.isEncoding(v))throw new TypeError("Unknown encoding: "+v);if(c.length===1){let L=c.charCodeAt(0);(v==="utf8"&&L<128||v==="latin1")&&(c=L)}}else typeof c=="number"?c=c&255:typeof c=="boolean"&&(c=Number(c));if(f<0||this.length<f||this.length<g)throw new RangeError("Out of range index");if(g<=f)return this;f=f>>>0,g=g===void 0?this.length:g>>>0,c||(c=0);let I;if(typeof c=="number")for(I=f;I<g;++I)this[I]=c;else{let L=e.isBuffer(c)?c:e.from(c,v),$=L.length;if($===0)throw new TypeError('The value "'+c+'" is invalid for argument "value"');for(I=0;I<g-f;++I)this[I+f]=L[I%$]}return this};let q={};function D(c,f,g){q[c]=class extends g{constructor(){super(),Object.defineProperty(this,"message",{value:f.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${c}]`,this.stack,delete this.name}get code(){return c}set code(v){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:v,writable:!0})}toString(){return`${this.name} [${c}]: ${this.message}`}}}D("ERR_BUFFER_OUT_OF_BOUNDS",function(c){return c?`${c} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),D("ERR_INVALID_ARG_TYPE",function(c,f){return`The "${c}" argument must be of type number. Received type ${typeof f}`},TypeError),D("ERR_OUT_OF_RANGE",function(c,f,g){let v=`The value of "${c}" is out of range.`,I=g;return Number.isInteger(g)&&Math.abs(g)>2**32?I=ee(String(g)):typeof g=="bigint"&&(I=String(g),(g>BigInt(2)**BigInt(32)||g<-(BigInt(2)**BigInt(32)))&&(I=ee(I)),I+="n"),v+=` It must be ${f}. Received ${I}`,v},RangeError);function ee(c){let f="",g=c.length,v=c[0]==="-"?1:0;for(;g>=v+4;g-=3)f=`_${c.slice(g-3,g)}${f}`;return`${c.slice(0,g)}${f}`}function Q(c,f,g){H(f,"offset"),(c[f]===void 0||c[f+g]===void 0)&&ae(f,c.length-(g+1))}function K(c,f,g,v,I,L){if(c>g||c<f){let $=typeof f=="bigint"?"n":"",_e;throw f===0||f===BigInt(0)?_e=`>= 0${$} and < 2${$} ** ${(L+1)*8}${$}`:_e=`>= -(2${$} ** ${(L+1)*8-1}${$}) and < 2 ** ${(L+1)*8-1}${$}`,new q.ERR_OUT_OF_RANGE("value",_e,c)}Q(v,I,L)}function H(c,f){if(typeof c!="number")throw new q.ERR_INVALID_ARG_TYPE(f,"number",c)}function ae(c,f,g){throw Math.floor(c)!==c?(H(c,g),new q.ERR_OUT_OF_RANGE("offset","an integer",c)):f<0?new q.ERR_BUFFER_OUT_OF_BOUNDS:new q.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${f}`,c)}let ie=/[^+/0-9A-Za-z-_]/g;function R(c){if(c=c.split("=")[0],c=c.trim().replace(ie,""),c.length<2)return"";for(;c.length%4!==0;)c=c+"=";return c}function j(c,f){f=f||1/0;let g,v=c.length,I=null,L=[];for(let $=0;$<v;++$){if(g=c.charCodeAt($),g>55295&&g<57344){if(!I){if(g>56319){(f-=3)>-1&&L.push(239,191,189);continue}else if($+1===v){(f-=3)>-1&&L.push(239,191,189);continue}I=g;continue}if(g<56320){(f-=3)>-1&&L.push(239,191,189),I=g;continue}g=(I-55296<<10|g-56320)+65536}else I&&(f-=3)>-1&&L.push(239,191,189);if(I=null,g<128){if((f-=1)<0)break;L.push(g)}else if(g<2048){if((f-=2)<0)break;L.push(g>>6|192,g&63|128)}else if(g<65536){if((f-=3)<0)break;L.push(g>>12|224,g>>6&63|128,g&63|128)}else if(g<1114112){if((f-=4)<0)break;L.push(g>>18|240,g>>12&63|128,g>>6&63|128,g&63|128)}else throw new Error("Invalid code point")}return L}function Y(c){let f=[];for(let g=0;g<c.length;++g)f.push(c.charCodeAt(g)&255);return f}function oe(c,f){let g,v,I,L=[];for(let $=0;$<c.length&&!((f-=2)<0);++$)g=c.charCodeAt($),v=g>>8,I=g%256,L.push(I),L.push(v);return L}function re(c){return o.toByteArray(R(c))}function ue(c,f,g,v){let I;for(I=0;I<v&&!(I+g>=f.length||I>=c.length);++I)f[I+g]=c[I];return I}function W(c,f){return c instanceof f||c!=null&&c.constructor!=null&&c.constructor.name!=null&&c.constructor.name===f.name}function se(c){return c!==c}let we=function(){let c="0123456789abcdef",f=new Array(256);for(let g=0;g<16;++g){let v=g*16;for(let I=0;I<16;++I)f[v+I]=c[g]+c[I]}return f}();function te(c){return typeof BigInt>"u"?Pe:c}function Pe(){throw new Error("BigInt not supported")}return xt}var rr,ii,ur,oi,xt,si,_t,vr,ko,Io,Xe=it(()=>{ce(),fe(),he(),rr={},ii=!1,ur={},oi=!1,xt={},si=!1,_t=Vl(),_t.Buffer,_t.SlowBuffer,_t.INSPECT_MAX_BYTES,_t.kMaxLength,vr=_t.Buffer,ko=_t.INSPECT_MAX_BYTES,Io=_t.kMaxLength}),fe=it(()=>{Xe()}),Ql=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"__esModule",{value:!0});var h=class{constructor(i){this.aliasToTopic={},this.max=i}put(i,a){return a===0||a>this.max?!1:(this.aliasToTopic[a]=i,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(i){return this.aliasToTopic[i]}clear(){this.aliasToTopic={}}};o.default=h}),qe=Ae((o,h)=>{ce(),fe(),he();var i=class extends Error{constructor(a){if(!Array.isArray(a))throw new TypeError(`Expected input to be an Array, got ${typeof a}`);let l="";for(let r=0;r<a.length;r++)l+=` ${a[r].stack}
3
- `;super(l),this.name="AggregateError",this.errors=a}};h.exports={AggregateError:i,ArrayIsArray(a){return Array.isArray(a)},ArrayPrototypeIncludes(a,l){return a.includes(l)},ArrayPrototypeIndexOf(a,l){return a.indexOf(l)},ArrayPrototypeJoin(a,l){return a.join(l)},ArrayPrototypeMap(a,l){return a.map(l)},ArrayPrototypePop(a,l){return a.pop(l)},ArrayPrototypePush(a,l){return a.push(l)},ArrayPrototypeSlice(a,l,r){return a.slice(l,r)},Error,FunctionPrototypeCall(a,l,...r){return a.call(l,...r)},FunctionPrototypeSymbolHasInstance(a,l){return Function.prototype[Symbol.hasInstance].call(a,l)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(a,l){return Object.defineProperties(a,l)},ObjectDefineProperty(a,l,r){return Object.defineProperty(a,l,r)},ObjectGetOwnPropertyDescriptor(a,l){return Object.getOwnPropertyDescriptor(a,l)},ObjectKeys(a){return Object.keys(a)},ObjectSetPrototypeOf(a,l){return Object.setPrototypeOf(a,l)},Promise,PromisePrototypeCatch(a,l){return a.catch(l)},PromisePrototypeThen(a,l,r){return a.then(l,r)},PromiseReject(a){return Promise.reject(a)},PromiseResolve(a){return Promise.resolve(a)},ReflectApply:Reflect.apply,RegExpPrototypeTest(a,l){return a.test(l)},SafeSet:Set,String,StringPrototypeSlice(a,l,r){return a.slice(l,r)},StringPrototypeToLowerCase(a){return a.toLowerCase()},StringPrototypeToUpperCase(a){return a.toUpperCase()},StringPrototypeTrim(a){return a.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(a,l,r){return a.set(l,r)},Boolean,Uint8Array}}),To=Ae((o,h)=>{ce(),fe(),he(),h.exports={format(i,...a){return i.replace(/%([sdifj])/g,function(...[l,r]){let e=a.shift();return r==="f"?e.toFixed(6):r==="j"?JSON.stringify(e):r==="s"&&typeof e=="object"?`${e.constructor!==Object?e.constructor.name:""} {}`.trim():e.toString()})},inspect(i){switch(typeof i){case"string":if(i.includes("'"))if(i.includes('"')){if(!i.includes("`")&&!i.includes("${"))return`\`${i}\``}else return`"${i}"`;return`'${i}'`;case"number":return isNaN(i)?"NaN":Object.is(i,-0)?String(i):i;case"bigint":return`${String(i)}n`;case"boolean":case"undefined":return String(i);case"object":return"{}"}}}}),ot=Ae((o,h)=>{ce(),fe(),he();var{format:i,inspect:a}=To(),{AggregateError:l}=qe(),r=globalThis.AggregateError||l,e=Symbol("kIsNodeError"),n=["string","function","number","object","Function","Object","boolean","bigint","symbol"],t=/^([A-Z][a-z0-9]*)+$/,s="__node_internal_",u={};function d(b,_){if(!b)throw new u.ERR_INTERNAL_ASSERTION(_)}function p(b){let _="",N=b.length,M=b[0]==="-"?1:0;for(;N>=M+4;N-=3)_=`_${b.slice(N-3,N)}${_}`;return`${b.slice(0,N)}${_}`}function m(b,_,N){if(typeof _=="function")return d(_.length<=N.length,`Code: ${b}; The provided arguments length (${N.length}) does not match the required ones (${_.length}).`),_(...N);let M=(_.match(/%[dfijoOs]/g)||[]).length;return d(M===N.length,`Code: ${b}; The provided arguments length (${N.length}) does not match the required ones (${M}).`),N.length===0?_:i(_,...N)}function A(b,_,N){N||(N=Error);class M extends N{constructor(...T){super(m(b,_,T))}toString(){return`${this.name} [${b}]: ${this.message}`}}Object.defineProperties(M.prototype,{name:{value:N.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${b}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),M.prototype.code=b,M.prototype[e]=!0,u[b]=M}function y(b){let _=s+b.name;return Object.defineProperty(b,"name",{value:_}),b}function w(b,_){if(b&&_&&b!==_){if(Array.isArray(_.errors))return _.errors.push(b),_;let N=new r([_,b],_.message);return N.code=_.code,N}return b||_}var C=class extends Error{constructor(b="The operation was aborted",_=void 0){if(_!==void 0&&typeof _!="object")throw new u.ERR_INVALID_ARG_TYPE("options","Object",_);super(b,_),this.code="ABORT_ERR",this.name="AbortError"}};A("ERR_ASSERTION","%s",Error),A("ERR_INVALID_ARG_TYPE",(b,_,N)=>{d(typeof b=="string","'name' must be a string"),Array.isArray(_)||(_=[_]);let M="The ";b.endsWith(" argument")?M+=`${b} `:M+=`"${b}" ${b.includes(".")?"property":"argument"} `,M+="must be ";let k=[],T=[],U=[];for(let X of _)d(typeof X=="string","All expected entries have to be of type string"),n.includes(X)?k.push(X.toLowerCase()):t.test(X)?T.push(X):(d(X!=="object",'The value "object" should be written as "Object"'),U.push(X));if(T.length>0){let X=k.indexOf("object");X!==-1&&(k.splice(k,X,1),T.push("Object"))}if(k.length>0){switch(k.length){case 1:M+=`of type ${k[0]}`;break;case 2:M+=`one of type ${k[0]} or ${k[1]}`;break;default:{let X=k.pop();M+=`one of type ${k.join(", ")}, or ${X}`}}(T.length>0||U.length>0)&&(M+=" or ")}if(T.length>0){switch(T.length){case 1:M+=`an instance of ${T[0]}`;break;case 2:M+=`an instance of ${T[0]} or ${T[1]}`;break;default:{let X=T.pop();M+=`an instance of ${T.join(", ")}, or ${X}`}}U.length>0&&(M+=" or ")}switch(U.length){case 0:break;case 1:U[0].toLowerCase()!==U[0]&&(M+="an "),M+=`${U[0]}`;break;case 2:M+=`one of ${U[0]} or ${U[1]}`;break;default:{let X=U.pop();M+=`one of ${U.join(", ")}, or ${X}`}}if(N==null)M+=`. Received ${N}`;else if(typeof N=="function"&&N.name)M+=`. Received function ${N.name}`;else if(typeof N=="object"){var J;if((J=N.constructor)!==null&&J!==void 0&&J.name)M+=`. Received an instance of ${N.constructor.name}`;else{let X=a(N,{depth:-1});M+=`. Received ${X}`}}else{let X=a(N,{colors:!1});X.length>25&&(X=`${X.slice(0,25)}...`),M+=`. Received type ${typeof N} (${X})`}return M},TypeError),A("ERR_INVALID_ARG_VALUE",(b,_,N="is invalid")=>{let M=a(_);return M.length>128&&(M=M.slice(0,128)+"..."),`The ${b.includes(".")?"property":"argument"} '${b}' ${N}. Received ${M}`},TypeError),A("ERR_INVALID_RETURN_VALUE",(b,_,N)=>{var M;let k=N!=null&&(M=N.constructor)!==null&&M!==void 0&&M.name?`instance of ${N.constructor.name}`:`type ${typeof N}`;return`Expected ${b} to be returned from the "${_}" function but got ${k}.`},TypeError),A("ERR_MISSING_ARGS",(...b)=>{d(b.length>0,"At least one arg needs to be specified");let _,N=b.length;switch(b=(Array.isArray(b)?b:[b]).map(M=>`"${M}"`).join(" or "),N){case 1:_+=`The ${b[0]} argument`;break;case 2:_+=`The ${b[0]} and ${b[1]} arguments`;break;default:{let M=b.pop();_+=`The ${b.join(", ")}, and ${M} arguments`}break}return`${_} must be specified`},TypeError),A("ERR_OUT_OF_RANGE",(b,_,N)=>{d(_,'Missing "range" argument');let M;if(Number.isInteger(N)&&Math.abs(N)>2**32)M=p(String(N));else if(typeof N=="bigint"){M=String(N);let k=BigInt(2)**BigInt(32);(N>k||N<-k)&&(M=p(M)),M+="n"}else M=a(N);return`The value of "${b}" is out of range. It must be ${_}. Received ${M}`},RangeError),A("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),A("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),A("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),A("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),A("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),A("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),A("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),A("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),A("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),A("ERR_STREAM_WRITE_AFTER_END","write after end",Error),A("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),h.exports={AbortError:C,aggregateTwoErrors:y(w),hideStackFrames:y,codes:u}}),cr=Ae((o,h)=>{ce(),fe(),he();var{AbortController:i,AbortSignal:a}=typeof self<"u"?self:typeof window<"u"?window:void 0;h.exports=i,h.exports.AbortSignal=a,h.exports.default=i});function Ne(){Ne.init.call(this)}function _r(o){if(typeof o!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof o)}function Bo(o){return o._maxListeners===void 0?Ne.defaultMaxListeners:o._maxListeners}function Oo(o,h,i,a){var l,r,e,n;if(_r(i),(r=o._events)===void 0?(r=o._events=Object.create(null),o._eventsCount=0):(r.newListener!==void 0&&(o.emit("newListener",h,i.listener?i.listener:i),r=o._events),e=r[h]),e===void 0)e=r[h]=i,++o._eventsCount;else if(typeof e=="function"?e=r[h]=a?[i,e]:[e,i]:a?e.unshift(i):e.push(i),(l=Bo(o))>0&&e.length>l&&!e.warned){e.warned=!0;var t=new Error("Possible EventEmitter memory leak detected. "+e.length+" "+String(h)+" listeners added. Use emitter.setMaxListeners() to increase limit");t.name="MaxListenersExceededWarning",t.emitter=o,t.type=h,t.count=e.length,n=t,console&&console.warn&&console.warn(n)}return o}function Kl(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Po(o,h,i){var a={fired:!1,wrapFn:void 0,target:o,type:h,listener:i},l=Kl.bind(a);return l.listener=i,a.wrapFn=l,l}function xo(o,h,i){var a=o._events;if(a===void 0)return[];var l=a[h];return l===void 0?[]:typeof l=="function"?i?[l.listener||l]:[l]:i?function(r){for(var e=new Array(r.length),n=0;n<e.length;++n)e[n]=r[n].listener||r[n];return e}(l):Mo(l,l.length)}function Ro(o){var h=this._events;if(h!==void 0){var i=h[o];if(typeof i=="function")return 1;if(i!==void 0)return i.length}return 0}function Mo(o,h){for(var i=new Array(h),a=0;a<h;++a)i[a]=o[a];return i}var Uo,Do,Vt,ai,li,ui,ut,Lo=it(()=>{ce(),fe(),he(),Vt=typeof Reflect=="object"?Reflect:null,ai=Vt&&typeof Vt.apply=="function"?Vt.apply:function(o,h,i){return Function.prototype.apply.call(o,h,i)},Do=Vt&&typeof Vt.ownKeys=="function"?Vt.ownKeys:Object.getOwnPropertySymbols?function(o){return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o))}:function(o){return Object.getOwnPropertyNames(o)},li=Number.isNaN||function(o){return o!=o},Uo=Ne,Ne.EventEmitter=Ne,Ne.prototype._events=void 0,Ne.prototype._eventsCount=0,Ne.prototype._maxListeners=void 0,ui=10,Object.defineProperty(Ne,"defaultMaxListeners",{enumerable:!0,get:function(){return ui},set:function(o){if(typeof o!="number"||o<0||li(o))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+o+".");ui=o}}),Ne.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Ne.prototype.setMaxListeners=function(o){if(typeof o!="number"||o<0||li(o))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+o+".");return this._maxListeners=o,this},Ne.prototype.getMaxListeners=function(){return Bo(this)},Ne.prototype.emit=function(o){for(var h=[],i=1;i<arguments.length;i++)h.push(arguments[i]);var a=o==="error",l=this._events;if(l!==void 0)a=a&&l.error===void 0;else if(!a)return!1;if(a){var r;if(h.length>0&&(r=h[0]),r instanceof Error)throw r;var e=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw e.context=r,e}var n=l[o];if(n===void 0)return!1;if(typeof n=="function")ai(n,this,h);else{var t=n.length,s=Mo(n,t);for(i=0;i<t;++i)ai(s[i],this,h)}return!0},Ne.prototype.addListener=function(o,h){return Oo(this,o,h,!1)},Ne.prototype.on=Ne.prototype.addListener,Ne.prototype.prependListener=function(o,h){return Oo(this,o,h,!0)},Ne.prototype.once=function(o,h){return _r(h),this.on(o,Po(this,o,h)),this},Ne.prototype.prependOnceListener=function(o,h){return _r(h),this.prependListener(o,Po(this,o,h)),this},Ne.prototype.removeListener=function(o,h){var i,a,l,r,e;if(_r(h),(a=this._events)===void 0)return this;if((i=a[o])===void 0)return this;if(i===h||i.listener===h)--this._eventsCount==0?this._events=Object.create(null):(delete a[o],a.removeListener&&this.emit("removeListener",o,i.listener||h));else if(typeof i!="function"){for(l=-1,r=i.length-1;r>=0;r--)if(i[r]===h||i[r].listener===h){e=i[r].listener,l=r;break}if(l<0)return this;l===0?i.shift():function(n,t){for(;t+1<n.length;t++)n[t]=n[t+1];n.pop()}(i,l),i.length===1&&(a[o]=i[0]),a.removeListener!==void 0&&this.emit("removeListener",o,e||h)}return this},Ne.prototype.off=Ne.prototype.removeListener,Ne.prototype.removeAllListeners=function(o){var h,i,a;if((i=this._events)===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[o]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete i[o]),this;if(arguments.length===0){var l,r=Object.keys(i);for(a=0;a<r.length;++a)(l=r[a])!=="removeListener"&&this.removeAllListeners(l);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(h=i[o])=="function")this.removeListener(o,h);else if(h!==void 0)for(a=h.length-1;a>=0;a--)this.removeListener(o,h[a]);return this},Ne.prototype.listeners=function(o){return xo(this,o,!0)},Ne.prototype.rawListeners=function(o){return xo(this,o,!1)},Ne.listenerCount=function(o,h){return typeof o.listenerCount=="function"?o.listenerCount(h):Ro.call(o,h)},Ne.prototype.listenerCount=Ro,Ne.prototype.eventNames=function(){return this._eventsCount>0?Do(this._events):[]},ut=Uo,ut.EventEmitter,ut.defaultMaxListeners,ut.init,ut.listenerCount,ut.EventEmitter,ut.defaultMaxListeners,ut.init,ut.listenerCount}),Rt={};tr(Rt,{EventEmitter:()=>No,default:()=>ut,defaultMaxListeners:()=>Fo,init:()=>jo,listenerCount:()=>Wo,on:()=>Vo,once:()=>Qo});var No,Fo,jo,Wo,Vo,Qo,Qt=it(()=>{ce(),fe(),he(),Lo(),Lo(),ut.once=function(o,h){return new Promise((i,a)=>{function l(...e){r!==void 0&&o.removeListener("error",r),i(e)}let r;h!=="error"&&(r=e=>{o.removeListener(name,l),a(e)},o.once("error",r)),o.once(h,l)})},ut.on=function(o,h){let i=[],a=[],l=null,r=!1,e={async next(){let s=i.shift();if(s)return createIterResult(s,!1);if(l){let u=Promise.reject(l);return l=null,u}return r?createIterResult(void 0,!0):new Promise((u,d)=>a.push({resolve:u,reject:d}))},async return(){o.removeListener(h,n),o.removeListener("error",t),r=!0;for(let s of a)s.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(s){l=s,o.removeListener(h,n),o.removeListener("error",t)},[Symbol.asyncIterator](){return this}};return o.on(h,n),o.on("error",t),e;function n(...s){let u=a.shift();u?u.resolve(createIterResult(s,!1)):i.push(s)}function t(s){r=!0;let u=a.shift();u?u.reject(s):l=s,e.return()}},{EventEmitter:No,defaultMaxListeners:Fo,init:jo,listenerCount:Wo,on:Vo,once:Qo}=ut}),at=Ae((o,h)=>{ce(),fe(),he();var i=(Xe(),Le(Ze)),{format:a,inspect:l}=To(),{codes:{ERR_INVALID_ARG_TYPE:r}}=ot(),{kResistStopPropagation:e,AggregateError:n,SymbolDispose:t}=qe(),s=globalThis.AbortSignal||cr().AbortSignal,u=globalThis.AbortController||cr().AbortController,d=Object.getPrototypeOf(async function(){}).constructor,p=globalThis.Blob||i.Blob,m=typeof p<"u"?function(w){return w instanceof p}:function(w){return!1},A=(w,C)=>{if(w!==void 0&&(w===null||typeof w!="object"||!("aborted"in w)))throw new r(C,"AbortSignal",w)},y=(w,C)=>{if(typeof w!="function")throw new r(C,"Function",w)};h.exports={AggregateError:n,kEmptyObject:Object.freeze({}),once(w){let C=!1;return function(...b){C||(C=!0,w.apply(this,b))}},createDeferredPromise:function(){let w,C;return{promise:new Promise((b,_)=>{w=b,C=_}),resolve:w,reject:C}},promisify(w){return new Promise((C,b)=>{w((_,...N)=>_?b(_):C(...N))})},debuglog(){return function(){}},format:a,inspect:l,types:{isAsyncFunction(w){return w instanceof d},isArrayBufferView(w){return ArrayBuffer.isView(w)}},isBlob:m,deprecate(w,C){return w},addAbortListener:(Qt(),Le(Rt)).addAbortListener||function(w,C){if(w===void 0)throw new r("signal","AbortSignal",w);A(w,"signal"),y(C,"listener");let b;return w.aborted?queueMicrotask(()=>C()):(w.addEventListener("abort",C,{__proto__:null,once:!0,[e]:!0}),b=()=>{w.removeEventListener("abort",C)}),{__proto__:null,[t](){var _;(_=b)===null||_===void 0||_()}}},AbortSignalAny:s.any||function(w){if(w.length===1)return w[0];let C=new u,b=()=>C.abort();return w.forEach(_=>{A(_,"signals"),_.addEventListener("abort",b,{once:!0})}),C.signal.addEventListener("abort",()=>{w.forEach(_=>_.removeEventListener("abort",b))},{once:!0}),C.signal}},h.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),hr=Ae((o,h)=>{ce(),fe(),he();var{ArrayIsArray:i,ArrayPrototypeIncludes:a,ArrayPrototypeJoin:l,ArrayPrototypeMap:r,NumberIsInteger:e,NumberIsNaN:n,NumberMAX_SAFE_INTEGER:t,NumberMIN_SAFE_INTEGER:s,NumberParseInt:u,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:p,String:m,StringPrototypeToUpperCase:A,StringPrototypeTrim:y}=qe(),{hideStackFrames:w,codes:{ERR_SOCKET_BAD_PORT:C,ERR_INVALID_ARG_TYPE:b,ERR_INVALID_ARG_VALUE:_,ERR_OUT_OF_RANGE:N,ERR_UNKNOWN_SIGNAL:M}}=ot(),{normalizeEncoding:k}=at(),{isAsyncFunction:T,isArrayBufferView:U}=at().types,J={};function X(W){return W===(W|0)}function le(W){return W===W>>>0}var P=/^[0-7]+$/,G="must be a 32-bit unsigned integer or an octal string";function Z(W,se,we){if(typeof W>"u"&&(W=we),typeof W=="string"){if(p(P,W)===null)throw new _(se,W,G);W=u(W,8)}return pe(W,se),W}var V=w((W,se,we=s,te=t)=>{if(typeof W!="number")throw new b(se,"number",W);if(!e(W))throw new N(se,"an integer",W);if(W<we||W>te)throw new N(se,`>= ${we} && <= ${te}`,W)}),be=w((W,se,we=-2147483648,te=2147483647)=>{if(typeof W!="number")throw new b(se,"number",W);if(!e(W))throw new N(se,"an integer",W);if(W<we||W>te)throw new N(se,`>= ${we} && <= ${te}`,W)}),pe=w((W,se,we=!1)=>{if(typeof W!="number")throw new b(se,"number",W);if(!e(W))throw new N(se,"an integer",W);let te=we?1:0,Pe=4294967295;if(W<te||W>Pe)throw new N(se,`>= ${te} && <= ${Pe}`,W)});function me(W,se){if(typeof W!="string")throw new b(se,"string",W)}function ve(W,se,we=void 0,te){if(typeof W!="number")throw new b(se,"number",W);if(we!=null&&W<we||te!=null&&W>te||(we!=null||te!=null)&&n(W))throw new N(se,`${we!=null?`>= ${we}`:""}${we!=null&&te!=null?" && ":""}${te!=null?`<= ${te}`:""}`,W)}var z=w((W,se,we)=>{if(!a(we,W)){let te="must be one of: "+l(r(we,Pe=>typeof Pe=="string"?`'${Pe}'`:m(Pe)),", ");throw new _(se,W,te)}});function de(W,se){if(typeof W!="boolean")throw new b(se,"boolean",W)}function x(W,se,we){return W==null||!d(W,se)?we:W[se]}var ne=w((W,se,we=null)=>{let te=x(we,"allowArray",!1),Pe=x(we,"allowFunction",!1);if(!x(we,"nullable",!1)&&W===null||!te&&i(W)||typeof W!="object"&&(!Pe||typeof W!="function"))throw new b(se,"Object",W)}),ge=w((W,se)=>{if(W!=null&&typeof W!="object"&&typeof W!="function")throw new b(se,"a dictionary",W)}),F=w((W,se,we=0)=>{if(!i(W))throw new b(se,"Array",W);if(W.length<we){let te=`must be longer than ${we}`;throw new _(se,W,te)}});function Ce(W,se){F(W,se);for(let we=0;we<W.length;we++)me(W[we],`${se}[${we}]`)}function q(W,se){F(W,se);for(let we=0;we<W.length;we++)de(W[we],`${se}[${we}]`)}function D(W,se){F(W,se);for(let we=0;we<W.length;we++){let te=W[we],Pe=`${se}[${we}]`;if(te==null)throw new b(Pe,"AbortSignal",te);ae(te,Pe)}}function ee(W,se="signal"){if(me(W,se),J[W]===void 0)throw J[A(W)]!==void 0?new M(W+" (signals must use all capital letters)"):new M(W)}var Q=w((W,se="buffer")=>{if(!U(W))throw new b(se,["Buffer","TypedArray","DataView"],W)});function K(W,se){let we=k(se),te=W.length;if(we==="hex"&&te%2!==0)throw new _("encoding",se,`is invalid for data of length ${te}`)}function H(W,se="Port",we=!0){if(typeof W!="number"&&typeof W!="string"||typeof W=="string"&&y(W).length===0||+W!==+W>>>0||W>65535||W===0&&!we)throw new C(se,W,we);return W|0}var ae=w((W,se)=>{if(W!==void 0&&(W===null||typeof W!="object"||!("aborted"in W)))throw new b(se,"AbortSignal",W)}),ie=w((W,se)=>{if(typeof W!="function")throw new b(se,"Function",W)}),R=w((W,se)=>{if(typeof W!="function"||T(W))throw new b(se,"Function",W)}),j=w((W,se)=>{if(W!==void 0)throw new b(se,"undefined",W)});function Y(W,se,we){if(!a(we,W))throw new b(se,`('${l(we,"|")}')`,W)}var oe=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function re(W,se){if(typeof W>"u"||!p(oe,W))throw new _(se,W,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function ue(W){if(typeof W=="string")return re(W,"hints"),W;if(i(W)){let se=W.length,we="";if(se===0)return we;for(let te=0;te<se;te++){let Pe=W[te];re(Pe,"hints"),we+=Pe,te!==se-1&&(we+=", ")}return we}throw new _("hints",W,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}h.exports={isInt32:X,isUint32:le,parseFileMode:Z,validateArray:F,validateStringArray:Ce,validateBooleanArray:q,validateAbortSignalArray:D,validateBoolean:de,validateBuffer:Q,validateDictionary:ge,validateEncoding:K,validateFunction:ie,validateInt32:be,validateInteger:V,validateNumber:ve,validateObject:ne,validateOneOf:z,validatePlainFunction:R,validatePort:H,validateSignalName:ee,validateString:me,validateUint32:pe,validateUndefined:j,validateUnion:Y,validateAbortSignal:ae,validateLinkHeaderValue:ue}}),Kt=Ae((o,h)=>{ce(),fe(),he();var i=h.exports={},a,l;function r(){throw new Error("setTimeout has not been defined")}function e(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?a=setTimeout:a=r}catch{a=r}try{typeof clearTimeout=="function"?l=clearTimeout:l=e}catch{l=e}})();function n(C){if(a===setTimeout)return setTimeout(C,0);if((a===r||!a)&&setTimeout)return a=setTimeout,setTimeout(C,0);try{return a(C,0)}catch{try{return a.call(null,C,0)}catch{return a.call(this,C,0)}}}function t(C){if(l===clearTimeout)return clearTimeout(C);if((l===e||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(C);try{return l(C)}catch{try{return l.call(null,C)}catch{return l.call(this,C)}}}var s=[],u=!1,d,p=-1;function m(){!u||!d||(u=!1,d.length?s=d.concat(s):p=-1,s.length&&A())}function A(){if(!u){var C=n(m);u=!0;for(var b=s.length;b;){for(d=s,s=[];++p<b;)d&&d[p].run();p=-1,b=s.length}d=null,u=!1,t(C)}}i.nextTick=function(C){var b=new Array(arguments.length-1);if(arguments.length>1)for(var _=1;_<arguments.length;_++)b[_-1]=arguments[_];s.push(new y(C,b)),s.length===1&&!u&&n(A)};function y(C,b){this.fun=C,this.array=b}y.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={};function w(){}i.on=w,i.addListener=w,i.once=w,i.off=w,i.removeListener=w,i.removeAllListeners=w,i.emit=w,i.prependListener=w,i.prependOnceListener=w,i.listeners=function(C){return[]},i.binding=function(C){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(C){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}}),Et=Ae((o,h)=>{ce(),fe(),he();var{SymbolAsyncIterator:i,SymbolIterator:a,SymbolFor:l}=qe(),r=l("nodejs.stream.destroyed"),e=l("nodejs.stream.errored"),n=l("nodejs.stream.readable"),t=l("nodejs.stream.writable"),s=l("nodejs.stream.disturbed"),u=l("nodejs.webstream.isClosedPromise"),d=l("nodejs.webstream.controllerErrorFunction");function p(x,ne=!1){var ge;return!!(x&&typeof x.pipe=="function"&&typeof x.on=="function"&&(!ne||typeof x.pause=="function"&&typeof x.resume=="function")&&(!x._writableState||((ge=x._readableState)===null||ge===void 0?void 0:ge.readable)!==!1)&&(!x._writableState||x._readableState))}function m(x){var ne;return!!(x&&typeof x.write=="function"&&typeof x.on=="function"&&(!x._readableState||((ne=x._writableState)===null||ne===void 0?void 0:ne.writable)!==!1))}function A(x){return!!(x&&typeof x.pipe=="function"&&x._readableState&&typeof x.on=="function"&&typeof x.write=="function")}function y(x){return x&&(x._readableState||x._writableState||typeof x.write=="function"&&typeof x.on=="function"||typeof x.pipe=="function"&&typeof x.on=="function")}function w(x){return!!(x&&!y(x)&&typeof x.pipeThrough=="function"&&typeof x.getReader=="function"&&typeof x.cancel=="function")}function C(x){return!!(x&&!y(x)&&typeof x.getWriter=="function"&&typeof x.abort=="function")}function b(x){return!!(x&&!y(x)&&typeof x.readable=="object"&&typeof x.writable=="object")}function _(x){return w(x)||C(x)||b(x)}function N(x,ne){return x==null?!1:ne===!0?typeof x[i]=="function":ne===!1?typeof x[a]=="function":typeof x[i]=="function"||typeof x[a]=="function"}function M(x){if(!y(x))return null;let ne=x._writableState,ge=x._readableState,F=ne||ge;return!!(x.destroyed||x[r]||F!=null&&F.destroyed)}function k(x){if(!m(x))return null;if(x.writableEnded===!0)return!0;let ne=x._writableState;return ne!=null&&ne.errored?!1:typeof(ne==null?void 0:ne.ended)!="boolean"?null:ne.ended}function T(x,ne){if(!m(x))return null;if(x.writableFinished===!0)return!0;let ge=x._writableState;return ge!=null&&ge.errored?!1:typeof(ge==null?void 0:ge.finished)!="boolean"?null:!!(ge.finished||ne===!1&&ge.ended===!0&&ge.length===0)}function U(x){if(!p(x))return null;if(x.readableEnded===!0)return!0;let ne=x._readableState;return!ne||ne.errored?!1:typeof(ne==null?void 0:ne.ended)!="boolean"?null:ne.ended}function J(x,ne){if(!p(x))return null;let ge=x._readableState;return ge!=null&&ge.errored?!1:typeof(ge==null?void 0:ge.endEmitted)!="boolean"?null:!!(ge.endEmitted||ne===!1&&ge.ended===!0&&ge.length===0)}function X(x){return x&&x[n]!=null?x[n]:typeof(x==null?void 0:x.readable)!="boolean"?null:M(x)?!1:p(x)&&x.readable&&!J(x)}function le(x){return x&&x[t]!=null?x[t]:typeof(x==null?void 0:x.writable)!="boolean"?null:M(x)?!1:m(x)&&x.writable&&!k(x)}function P(x,ne){return y(x)?M(x)?!0:!((ne==null?void 0:ne.readable)!==!1&&X(x)||(ne==null?void 0:ne.writable)!==!1&&le(x)):null}function G(x){var ne,ge;return y(x)?x.writableErrored?x.writableErrored:(ne=(ge=x._writableState)===null||ge===void 0?void 0:ge.errored)!==null&&ne!==void 0?ne:null:null}function Z(x){var ne,ge;return y(x)?x.readableErrored?x.readableErrored:(ne=(ge=x._readableState)===null||ge===void 0?void 0:ge.errored)!==null&&ne!==void 0?ne:null:null}function V(x){if(!y(x))return null;if(typeof x.closed=="boolean")return x.closed;let ne=x._writableState,ge=x._readableState;return typeof(ne==null?void 0:ne.closed)=="boolean"||typeof(ge==null?void 0:ge.closed)=="boolean"?(ne==null?void 0:ne.closed)||(ge==null?void 0:ge.closed):typeof x._closed=="boolean"&&be(x)?x._closed:null}function be(x){return typeof x._closed=="boolean"&&typeof x._defaultKeepAlive=="boolean"&&typeof x._removedConnection=="boolean"&&typeof x._removedContLen=="boolean"}function pe(x){return typeof x._sent100=="boolean"&&be(x)}function me(x){var ne;return typeof x._consuming=="boolean"&&typeof x._dumped=="boolean"&&((ne=x.req)===null||ne===void 0?void 0:ne.upgradeOrConnect)===void 0}function ve(x){if(!y(x))return null;let ne=x._writableState,ge=x._readableState,F=ne||ge;return!F&&pe(x)||!!(F&&F.autoDestroy&&F.emitClose&&F.closed===!1)}function z(x){var ne;return!!(x&&((ne=x[s])!==null&&ne!==void 0?ne:x.readableDidRead||x.readableAborted))}function de(x){var ne,ge,F,Ce,q,D,ee,Q,K,H;return!!(x&&((ne=(ge=(F=(Ce=(q=(D=x[e])!==null&&D!==void 0?D:x.readableErrored)!==null&&q!==void 0?q:x.writableErrored)!==null&&Ce!==void 0?Ce:(ee=x._readableState)===null||ee===void 0?void 0:ee.errorEmitted)!==null&&F!==void 0?F:(Q=x._writableState)===null||Q===void 0?void 0:Q.errorEmitted)!==null&&ge!==void 0?ge:(K=x._readableState)===null||K===void 0?void 0:K.errored)!==null&&ne!==void 0?ne:!((H=x._writableState)===null||H===void 0)&&H.errored))}h.exports={isDestroyed:M,kIsDestroyed:r,isDisturbed:z,kIsDisturbed:s,isErrored:de,kIsErrored:e,isReadable:X,kIsReadable:n,kIsClosedPromise:u,kControllerErrorFunction:d,kIsWritable:t,isClosed:V,isDuplexNodeStream:A,isFinished:P,isIterable:N,isReadableNodeStream:p,isReadableStream:w,isReadableEnded:U,isReadableFinished:J,isReadableErrored:Z,isNodeStream:y,isWebStream:_,isWritable:le,isWritableNodeStream:m,isWritableStream:C,isWritableEnded:k,isWritableFinished:T,isWritableErrored:G,isServerRequest:me,isServerResponse:pe,willEmitClose:ve,isTransformStream:b}}),Mt=Ae((o,h)=>{ce(),fe(),he();var i=Kt(),{AbortError:a,codes:l}=ot(),{ERR_INVALID_ARG_TYPE:r,ERR_STREAM_PREMATURE_CLOSE:e}=l,{kEmptyObject:n,once:t}=at(),{validateAbortSignal:s,validateFunction:u,validateObject:d,validateBoolean:p}=hr(),{Promise:m,PromisePrototypeThen:A,SymbolDispose:y}=qe(),{isClosed:w,isReadable:C,isReadableNodeStream:b,isReadableStream:_,isReadableFinished:N,isReadableErrored:M,isWritable:k,isWritableNodeStream:T,isWritableStream:U,isWritableFinished:J,isWritableErrored:X,isNodeStream:le,willEmitClose:P,kIsClosedPromise:G}=Et(),Z;function V(z){return z.setHeader&&typeof z.abort=="function"}var be=()=>{};function pe(z,de,x){var ne,ge;if(arguments.length===2?(x=de,de=n):de==null?de=n:d(de,"options"),u(x,"callback"),s(de.signal,"options.signal"),x=t(x),_(z)||U(z))return me(z,de,x);if(!le(z))throw new r("stream",["ReadableStream","WritableStream","Stream"],z);let F=(ne=de.readable)!==null&&ne!==void 0?ne:b(z),Ce=(ge=de.writable)!==null&&ge!==void 0?ge:T(z),q=z._writableState,D=z._readableState,ee=()=>{z.writable||H()},Q=P(z)&&b(z)===F&&T(z)===Ce,K=J(z,!1),H=()=>{K=!0,z.destroyed&&(Q=!1),!(Q&&(!z.readable||F))&&(!F||ae)&&x.call(z)},ae=N(z,!1),ie=()=>{ae=!0,z.destroyed&&(Q=!1),!(Q&&(!z.writable||Ce))&&(!Ce||K)&&x.call(z)},R=W=>{x.call(z,W)},j=w(z),Y=()=>{j=!0;let W=X(z)||M(z);if(W&&typeof W!="boolean")return x.call(z,W);if(F&&!ae&&b(z,!0)&&!N(z,!1))return x.call(z,new e);if(Ce&&!K&&!J(z,!1))return x.call(z,new e);x.call(z)},oe=()=>{j=!0;let W=X(z)||M(z);if(W&&typeof W!="boolean")return x.call(z,W);x.call(z)},re=()=>{z.req.on("finish",H)};V(z)?(z.on("complete",H),Q||z.on("abort",Y),z.req?re():z.on("request",re)):Ce&&!q&&(z.on("end",ee),z.on("close",ee)),!Q&&typeof z.aborted=="boolean"&&z.on("aborted",Y),z.on("end",ie),z.on("finish",H),de.error!==!1&&z.on("error",R),z.on("close",Y),j?i.nextTick(Y):q!=null&&q.errorEmitted||D!=null&&D.errorEmitted?Q||i.nextTick(oe):(!F&&(!Q||C(z))&&(K||k(z)===!1)||!Ce&&(!Q||k(z))&&(ae||C(z)===!1)||D&&z.req&&z.aborted)&&i.nextTick(oe);let ue=()=>{x=be,z.removeListener("aborted",Y),z.removeListener("complete",H),z.removeListener("abort",Y),z.removeListener("request",re),z.req&&z.req.removeListener("finish",H),z.removeListener("end",ee),z.removeListener("close",ee),z.removeListener("finish",H),z.removeListener("end",ie),z.removeListener("error",R),z.removeListener("close",Y)};if(de.signal&&!j){let W=()=>{let se=x;ue(),se.call(z,new a(void 0,{cause:de.signal.reason}))};if(de.signal.aborted)i.nextTick(W);else{Z=Z||at().addAbortListener;let se=Z(de.signal,W),we=x;x=t((...te)=>{se[y](),we.apply(z,te)})}}return ue}function me(z,de,x){let ne=!1,ge=be;if(de.signal)if(ge=()=>{ne=!0,x.call(z,new a(void 0,{cause:de.signal.reason}))},de.signal.aborted)i.nextTick(ge);else{Z=Z||at().addAbortListener;let Ce=Z(de.signal,ge),q=x;x=t((...D)=>{Ce[y](),q.apply(z,D)})}let F=(...Ce)=>{ne||i.nextTick(()=>x.apply(z,Ce))};return A(z[G].promise,F,F),be}function ve(z,de){var x;let ne=!1;return de===null&&(de=n),(x=de)!==null&&x!==void 0&&x.cleanup&&(p(de.cleanup,"cleanup"),ne=de.cleanup),new m((ge,F)=>{let Ce=pe(z,de,q=>{ne&&Ce(),q?F(q):ge()})})}h.exports=pe,h.exports.finished=ve}),nr=Ae((o,h)=>{ce(),fe(),he();var i=Kt(),{aggregateTwoErrors:a,codes:{ERR_MULTIPLE_CALLBACK:l},AbortError:r}=ot(),{Symbol:e}=qe(),{kIsDestroyed:n,isDestroyed:t,isFinished:s,isServerRequest:u}=Et(),d=e("kDestroy"),p=e("kConstruct");function m(P,G,Z){P&&(P.stack,G&&!G.errored&&(G.errored=P),Z&&!Z.errored&&(Z.errored=P))}function A(P,G){let Z=this._readableState,V=this._writableState,be=V||Z;return V!=null&&V.destroyed||Z!=null&&Z.destroyed?(typeof G=="function"&&G(),this):(m(P,V,Z),V&&(V.destroyed=!0),Z&&(Z.destroyed=!0),be.constructed?y(this,P,G):this.once(d,function(pe){y(this,a(pe,P),G)}),this)}function y(P,G,Z){let V=!1;function be(pe){if(V)return;V=!0;let me=P._readableState,ve=P._writableState;m(pe,ve,me),ve&&(ve.closed=!0),me&&(me.closed=!0),typeof Z=="function"&&Z(pe),pe?i.nextTick(w,P,pe):i.nextTick(C,P)}try{P._destroy(G||null,be)}catch(pe){be(pe)}}function w(P,G){b(P,G),C(P)}function C(P){let G=P._readableState,Z=P._writableState;Z&&(Z.closeEmitted=!0),G&&(G.closeEmitted=!0),(Z!=null&&Z.emitClose||G!=null&&G.emitClose)&&P.emit("close")}function b(P,G){let Z=P._readableState,V=P._writableState;V!=null&&V.errorEmitted||Z!=null&&Z.errorEmitted||(V&&(V.errorEmitted=!0),Z&&(Z.errorEmitted=!0),P.emit("error",G))}function _(){let P=this._readableState,G=this._writableState;P&&(P.constructed=!0,P.closed=!1,P.closeEmitted=!1,P.destroyed=!1,P.errored=null,P.errorEmitted=!1,P.reading=!1,P.ended=P.readable===!1,P.endEmitted=P.readable===!1),G&&(G.constructed=!0,G.destroyed=!1,G.closed=!1,G.closeEmitted=!1,G.errored=null,G.errorEmitted=!1,G.finalCalled=!1,G.prefinished=!1,G.ended=G.writable===!1,G.ending=G.writable===!1,G.finished=G.writable===!1)}function N(P,G,Z){let V=P._readableState,be=P._writableState;if(be!=null&&be.destroyed||V!=null&&V.destroyed)return this;V!=null&&V.autoDestroy||be!=null&&be.autoDestroy?P.destroy(G):G&&(G.stack,be&&!be.errored&&(be.errored=G),V&&!V.errored&&(V.errored=G),Z?i.nextTick(b,P,G):b(P,G))}function M(P,G){if(typeof P._construct!="function")return;let Z=P._readableState,V=P._writableState;Z&&(Z.constructed=!1),V&&(V.constructed=!1),P.once(p,G),!(P.listenerCount(p)>1)&&i.nextTick(k,P)}function k(P){let G=!1;function Z(V){if(G){N(P,V??new l);return}G=!0;let be=P._readableState,pe=P._writableState,me=pe||be;be&&(be.constructed=!0),pe&&(pe.constructed=!0),me.destroyed?P.emit(d,V):V?N(P,V,!0):i.nextTick(T,P)}try{P._construct(V=>{i.nextTick(Z,V)})}catch(V){i.nextTick(Z,V)}}function T(P){P.emit(p)}function U(P){return(P==null?void 0:P.setHeader)&&typeof P.abort=="function"}function J(P){P.emit("close")}function X(P,G){P.emit("error",G),i.nextTick(J,P)}function le(P,G){!P||t(P)||(!G&&!s(P)&&(G=new r),u(P)?(P.socket=null,P.destroy(G)):U(P)?P.abort():U(P.req)?P.req.abort():typeof P.destroy=="function"?P.destroy(G):typeof P.close=="function"?P.close():G?i.nextTick(X,P,G):i.nextTick(J,P),P.destroyed||(P[n]=!0))}h.exports={construct:M,destroyer:le,destroy:A,undestroy:_,errorOrDestroy:N}}),ci=Ae((o,h)=>{ce(),fe(),he();var{ArrayIsArray:i,ObjectSetPrototypeOf:a}=qe(),{EventEmitter:l}=(Qt(),Le(Rt));function r(n){l.call(this,n)}a(r.prototype,l.prototype),a(r,l),r.prototype.pipe=function(n,t){let s=this;function u(C){n.writable&&n.write(C)===!1&&s.pause&&s.pause()}s.on("data",u);function d(){s.readable&&s.resume&&s.resume()}n.on("drain",d),!n._isStdio&&(!t||t.end!==!1)&&(s.on("end",m),s.on("close",A));let p=!1;function m(){p||(p=!0,n.end())}function A(){p||(p=!0,typeof n.destroy=="function"&&n.destroy())}function y(C){w(),l.listenerCount(this,"error")===0&&this.emit("error",C)}e(s,"error",y),e(n,"error",y);function w(){s.removeListener("data",u),n.removeListener("drain",d),s.removeListener("end",m),s.removeListener("close",A),s.removeListener("error",y),n.removeListener("error",y),s.removeListener("end",w),s.removeListener("close",w),n.removeListener("close",w)}return s.on("end",w),s.on("close",w),n.on("close",w),n.emit("pipe",s),n};function e(n,t,s){if(typeof n.prependListener=="function")return n.prependListener(t,s);!n._events||!n._events[t]?n.on(t,s):i(n._events[t])?n._events[t].unshift(s):n._events[t]=[s,n._events[t]]}h.exports={Stream:r,prependListener:e}}),Er=Ae((o,h)=>{ce(),fe(),he();var{SymbolDispose:i}=qe(),{AbortError:a,codes:l}=ot(),{isNodeStream:r,isWebStream:e,kControllerErrorFunction:n}=Et(),t=Mt(),{ERR_INVALID_ARG_TYPE:s}=l,u,d=(p,m)=>{if(typeof p!="object"||!("aborted"in p))throw new s(m,"AbortSignal",p)};h.exports.addAbortSignal=function(p,m){if(d(p,"signal"),!r(m)&&!e(m))throw new s("stream",["ReadableStream","WritableStream","Stream"],m);return h.exports.addAbortSignalNoValidate(p,m)},h.exports.addAbortSignalNoValidate=function(p,m){if(typeof p!="object"||!("aborted"in p))return m;let A=r(m)?()=>{m.destroy(new a(void 0,{cause:p.reason}))}:()=>{m[n](new a(void 0,{cause:p.reason}))};if(p.aborted)A();else{u=u||at().addAbortListener;let y=u(p,A);t(m,y[i])}return m}}),Hl=Ae((o,h)=>{ce(),fe(),he();var{StringPrototypeSlice:i,SymbolIterator:a,TypedArrayPrototypeSet:l,Uint8Array:r}=qe(),{Buffer:e}=(Xe(),Le(Ze)),{inspect:n}=at();h.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){let s={data:t,next:null};this.length>0?this.tail.next=s:this.head=s,this.tail=s,++this.length}unshift(t){let s={data:t,next:this.head};this.length===0&&(this.tail=s),this.head=s,++this.length}shift(){if(this.length===0)return;let t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let s=this.head,u=""+s.data;for(;(s=s.next)!==null;)u+=t+s.data;return u}concat(t){if(this.length===0)return e.alloc(0);let s=e.allocUnsafe(t>>>0),u=this.head,d=0;for(;u;)l(s,u.data,d),d+=u.data.length,u=u.next;return s}consume(t,s){let u=this.head.data;if(t<u.length){let d=u.slice(0,t);return this.head.data=u.slice(t),d}return t===u.length?this.shift():s?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[a](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let s="",u=this.head,d=0;do{let p=u.data;if(t>p.length)s+=p,t-=p.length;else{t===p.length?(s+=p,++d,u.next?this.head=u.next:this.head=this.tail=null):(s+=i(p,0,t),this.head=u,u.data=i(p,t));break}++d}while((u=u.next)!==null);return this.length-=d,s}_getBuffer(t){let s=e.allocUnsafe(t),u=t,d=this.head,p=0;do{let m=d.data;if(t>m.length)l(s,m,u-t),t-=m.length;else{t===m.length?(l(s,m,u-t),++p,d.next?this.head=d.next:this.head=this.tail=null):(l(s,new r(m.buffer,m.byteOffset,t),u-t),this.head=d,d.data=m.slice(t));break}++p}while((d=d.next)!==null);return this.length-=p,s}[Symbol.for("nodejs.util.inspect.custom")](t,s){return n(this,{...s,depth:0,customInspect:!1})}}}),Sr=Ae((o,h)=>{ce(),fe(),he();var{MathFloor:i,NumberIsInteger:a}=qe(),{validateInteger:l}=hr(),{ERR_INVALID_ARG_VALUE:r}=ot().codes,e=16*1024,n=16;function t(p,m,A){return p.highWaterMark!=null?p.highWaterMark:m?p[A]:null}function s(p){return p?n:e}function u(p,m){l(m,"value",0),p?n=m:e=m}function d(p,m,A,y){let w=t(m,y,A);if(w!=null){if(!a(w)||w<0){let C=y?`options.${A}`:"options.highWaterMark";throw new r(C,w)}return i(w)}return s(p.objectMode)}h.exports={getHighWaterMark:d,getDefaultHighWaterMark:s,setDefaultHighWaterMark:u}}),ql=Ae((o,h)=>{ce(),fe(),he();var i=(Xe(),Le(Ze)),a=i.Buffer;function l(e,n){for(var t in e)n[t]=e[t]}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?h.exports=i:(l(i,o),o.Buffer=r);function r(e,n,t){return a(e,n,t)}r.prototype=Object.create(a.prototype),l(a,r),r.from=function(e,n,t){if(typeof e=="number")throw new TypeError("Argument must not be a number");return a(e,n,t)},r.alloc=function(e,n,t){if(typeof e!="number")throw new TypeError("Argument must be a number");var s=a(e);return n!==void 0?typeof t=="string"?s.fill(n,t):s.fill(n):s.fill(0),s},r.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return a(e)},r.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}}),$l=Ae(o=>{ce(),fe(),he();var h=ql().Buffer,i=h.isEncoding||function(b){switch(b=""+b,b&&b.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(b){if(!b)return"utf8";for(var _;;)switch(b){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return b;default:if(_)return;b=(""+b).toLowerCase(),_=!0}}function l(b){var _=a(b);if(typeof _!="string"&&(h.isEncoding===i||!i(b)))throw new Error("Unknown encoding: "+b);return _||b}o.StringDecoder=r;function r(b){this.encoding=l(b);var _;switch(this.encoding){case"utf16le":this.text=p,this.end=m,_=4;break;case"utf8":this.fillLast=s,_=4;break;case"base64":this.text=A,this.end=y,_=3;break;default:this.write=w,this.end=C;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=h.allocUnsafe(_)}r.prototype.write=function(b){if(b.length===0)return"";var _,N;if(this.lastNeed){if(_=this.fillLast(b),_===void 0)return"";N=this.lastNeed,this.lastNeed=0}else N=0;return N<b.length?_?_+this.text(b,N):this.text(b,N):_||""},r.prototype.end=d,r.prototype.text=u,r.prototype.fillLast=function(b){if(this.lastNeed<=b.length)return b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,b.length),this.lastNeed-=b.length};function e(b){return b<=127?0:b>>5===6?2:b>>4===14?3:b>>3===30?4:b>>6===2?-1:-2}function n(b,_,N){var M=_.length-1;if(M<N)return 0;var k=e(_[M]);return k>=0?(k>0&&(b.lastNeed=k-1),k):--M<N||k===-2?0:(k=e(_[M]),k>=0?(k>0&&(b.lastNeed=k-2),k):--M<N||k===-2?0:(k=e(_[M]),k>=0?(k>0&&(k===2?k=0:b.lastNeed=k-3),k):0))}function t(b,_,N){if((_[0]&192)!==128)return b.lastNeed=0,"�";if(b.lastNeed>1&&_.length>1){if((_[1]&192)!==128)return b.lastNeed=1,"�";if(b.lastNeed>2&&_.length>2&&(_[2]&192)!==128)return b.lastNeed=2,"�"}}function s(b){var _=this.lastTotal-this.lastNeed,N=t(this,b);if(N!==void 0)return N;if(this.lastNeed<=b.length)return b.copy(this.lastChar,_,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,_,0,b.length),this.lastNeed-=b.length}function u(b,_){var N=n(this,b,_);if(!this.lastNeed)return b.toString("utf8",_);this.lastTotal=N;var M=b.length-(N-this.lastNeed);return b.copy(this.lastChar,0,M),b.toString("utf8",_,M)}function d(b){var _=b&&b.length?this.write(b):"";return this.lastNeed?_+"�":_}function p(b,_){if((b.length-_)%2===0){var N=b.toString("utf16le",_);if(N){var M=N.charCodeAt(N.length-1);if(M>=55296&&M<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1],N.slice(0,-1)}return N}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=b[b.length-1],b.toString("utf16le",_,b.length-1)}function m(b){var _=b&&b.length?this.write(b):"";if(this.lastNeed){var N=this.lastTotal-this.lastNeed;return _+this.lastChar.toString("utf16le",0,N)}return _}function A(b,_){var N=(b.length-_)%3;return N===0?b.toString("base64",_):(this.lastNeed=3-N,this.lastTotal=3,N===1?this.lastChar[0]=b[b.length-1]:(this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1]),b.toString("base64",_,b.length-N))}function y(b){var _=b&&b.length?this.write(b):"";return this.lastNeed?_+this.lastChar.toString("base64",0,3-this.lastNeed):_}function w(b){return b.toString(this.encoding)}function C(b){return b&&b.length?this.write(b):""}}),Ko=Ae((o,h)=>{ce(),fe(),he();var i=Kt(),{PromisePrototypeThen:a,SymbolAsyncIterator:l,SymbolIterator:r}=qe(),{Buffer:e}=(Xe(),Le(Ze)),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_NULL_VALUES:t}=ot().codes;function s(u,d,p){let m;if(typeof d=="string"||d instanceof e)return new u({objectMode:!0,...p,read(){this.push(d),this.push(null)}});let A;if(d&&d[l])A=!0,m=d[l]();else if(d&&d[r])A=!1,m=d[r]();else throw new n("iterable",["Iterable"],d);let y=new u({objectMode:!0,highWaterMark:1,...p}),w=!1;y._read=function(){w||(w=!0,b())},y._destroy=function(_,N){a(C(_),()=>i.nextTick(N,_),M=>i.nextTick(N,M||_))};async function C(_){let N=_!=null,M=typeof m.throw=="function";if(N&&M){let{value:k,done:T}=await m.throw(_);if(await k,T)return}if(typeof m.return=="function"){let{value:k}=await m.return();await k}}async function b(){for(;;){try{let{value:_,done:N}=A?await m.next():m.next();if(N)y.push(null);else{let M=_&&typeof _.then=="function"?await _:_;if(M===null)throw w=!1,new t;if(y.push(M))continue;w=!1}}catch(_){y.destroy(_)}break}}return y}h.exports=s}),Cr=Ae((o,h)=>{ce(),fe(),he();var i=Kt(),{ArrayPrototypeIndexOf:a,NumberIsInteger:l,NumberIsNaN:r,NumberParseInt:e,ObjectDefineProperties:n,ObjectKeys:t,ObjectSetPrototypeOf:s,Promise:u,SafeSet:d,SymbolAsyncDispose:p,SymbolAsyncIterator:m,Symbol:A}=qe();h.exports=te,te.ReadableState=we;var{EventEmitter:y}=(Qt(),Le(Rt)),{Stream:w,prependListener:C}=ci(),{Buffer:b}=(Xe(),Le(Ze)),{addAbortSignal:_}=Er(),N=Mt(),M=at().debuglog("stream",S=>{M=S}),k=Hl(),T=nr(),{getHighWaterMark:U,getDefaultHighWaterMark:J}=Sr(),{aggregateTwoErrors:X,codes:{ERR_INVALID_ARG_TYPE:le,ERR_METHOD_NOT_IMPLEMENTED:P,ERR_OUT_OF_RANGE:G,ERR_STREAM_PUSH_AFTER_EOF:Z,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:V},AbortError:be}=ot(),{validateObject:pe}=hr(),me=A("kPaused"),{StringDecoder:ve}=$l(),z=Ko();s(te.prototype,w.prototype),s(te,w);var de=()=>{},{errorOrDestroy:x}=T,ne=1,ge=2,F=4,Ce=8,q=16,D=32,ee=64,Q=128,K=256,H=512,ae=1024,ie=2048,R=4096,j=8192,Y=16384,oe=32768,re=65536,ue=1<<17,W=1<<18;function se(S){return{enumerable:!1,get(){return(this.state&S)!==0},set(O){O?this.state|=S:this.state&=~S}}}n(we.prototype,{objectMode:se(ne),ended:se(ge),endEmitted:se(F),reading:se(Ce),constructed:se(q),sync:se(D),needReadable:se(ee),emittedReadable:se(Q),readableListening:se(K),resumeScheduled:se(H),errorEmitted:se(ae),emitClose:se(ie),autoDestroy:se(R),destroyed:se(j),closed:se(Y),closeEmitted:se(oe),multiAwaitDrain:se(re),readingMore:se(ue),dataEmitted:se(W)});function we(S,O,ye){typeof ye!="boolean"&&(ye=O instanceof St()),this.state=ie|R|q|D,S&&S.objectMode&&(this.state|=ne),ye&&S&&S.readableObjectMode&&(this.state|=ne),this.highWaterMark=S?U(this,S,"readableHighWaterMark",ye):J(!1),this.buffer=new k,this.length=0,this.pipes=[],this.flowing=null,this[me]=null,S&&S.emitClose===!1&&(this.state&=~ie),S&&S.autoDestroy===!1&&(this.state&=~R),this.errored=null,this.defaultEncoding=S&&S.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,S&&S.encoding&&(this.decoder=new ve(S.encoding),this.encoding=S.encoding)}function te(S){if(!(this instanceof te))return new te(S);let O=this instanceof St();this._readableState=new we(S,this,O),S&&(typeof S.read=="function"&&(this._read=S.read),typeof S.destroy=="function"&&(this._destroy=S.destroy),typeof S.construct=="function"&&(this._construct=S.construct),S.signal&&!O&&_(S.signal,this)),w.call(this,S),T.construct(this,()=>{this._readableState.needReadable&&_e(this,this._readableState)})}te.prototype.destroy=T.destroy,te.prototype._undestroy=T.undestroy,te.prototype._destroy=function(S,O){O(S)},te.prototype[y.captureRejectionSymbol]=function(S){this.destroy(S)},te.prototype[p]=function(){let S;return this.destroyed||(S=this.readableEnded?null:new be,this.destroy(S)),new u((O,ye)=>N(this,Se=>Se&&Se!==S?ye(Se):O(null)))},te.prototype.push=function(S,O){return Pe(this,S,O,!1)},te.prototype.unshift=function(S,O){return Pe(this,S,O,!0)};function Pe(S,O,ye,Se){M("readableAddChunk",O);let Ie=S._readableState,nt;if((Ie.state&ne)===0&&(typeof O=="string"?(ye=ye||Ie.defaultEncoding,Ie.encoding!==ye&&(Se&&Ie.encoding?O=b.from(O,ye).toString(Ie.encoding):(O=b.from(O,ye),ye=""))):O instanceof b?ye="":w._isUint8Array(O)?(O=w._uint8ArrayToBuffer(O),ye=""):O!=null&&(nt=new le("chunk",["string","Buffer","Uint8Array"],O))),nt)x(S,nt);else if(O===null)Ie.state&=~Ce,I(S,Ie);else if((Ie.state&ne)!==0||O&&O.length>0)if(Se)if((Ie.state&F)!==0)x(S,new V);else{if(Ie.destroyed||Ie.errored)return!1;c(S,Ie,O,!0)}else if(Ie.ended)x(S,new Z);else{if(Ie.destroyed||Ie.errored)return!1;Ie.state&=~Ce,Ie.decoder&&!ye?(O=Ie.decoder.write(O),Ie.objectMode||O.length!==0?c(S,Ie,O,!1):_e(S,Ie)):c(S,Ie,O,!1)}else Se||(Ie.state&=~Ce,_e(S,Ie));return!Ie.ended&&(Ie.length<Ie.highWaterMark||Ie.length===0)}function c(S,O,ye,Se){O.flowing&&O.length===0&&!O.sync&&S.listenerCount("data")>0?((O.state&re)!==0?O.awaitDrainWriters.clear():O.awaitDrainWriters=null,O.dataEmitted=!0,S.emit("data",ye)):(O.length+=O.objectMode?1:ye.length,Se?O.buffer.unshift(ye):O.buffer.push(ye),(O.state&ee)!==0&&L(S)),_e(S,O)}te.prototype.isPaused=function(){let S=this._readableState;return S[me]===!0||S.flowing===!1},te.prototype.setEncoding=function(S){let O=new ve(S);this._readableState.decoder=O,this._readableState.encoding=this._readableState.decoder.encoding;let ye=this._readableState.buffer,Se="";for(let Ie of ye)Se+=O.write(Ie);return ye.clear(),Se!==""&&ye.push(Se),this._readableState.length=Se.length,this};var f=1073741824;function g(S){if(S>f)throw new G("size","<= 1GiB",S);return S--,S|=S>>>1,S|=S>>>2,S|=S>>>4,S|=S>>>8,S|=S>>>16,S++,S}function v(S,O){return S<=0||O.length===0&&O.ended?0:(O.state&ne)!==0?1:r(S)?O.flowing&&O.length?O.buffer.first().length:O.length:S<=O.length?S:O.ended?O.length:0}te.prototype.read=function(S){M("read",S),S===void 0?S=NaN:l(S)||(S=e(S,10));let O=this._readableState,ye=S;if(S>O.highWaterMark&&(O.highWaterMark=g(S)),S!==0&&(O.state&=~Q),S===0&&O.needReadable&&((O.highWaterMark!==0?O.length>=O.highWaterMark:O.length>0)||O.ended))return M("read: emitReadable",O.length,O.ended),O.length===0&&O.ended?je(this):L(this),null;if(S=v(S,O),S===0&&O.ended)return O.length===0&&je(this),null;let Se=(O.state&ee)!==0;if(M("need readable",Se),(O.length===0||O.length-S<O.highWaterMark)&&(Se=!0,M("length less than watermark",Se)),O.ended||O.reading||O.destroyed||O.errored||!O.constructed)Se=!1,M("reading, ended or constructing",Se);else if(Se){M("do read"),O.state|=Ce|D,O.length===0&&(O.state|=ee);try{this._read(O.highWaterMark)}catch(nt){x(this,nt)}O.state&=~D,O.reading||(S=v(ye,O))}let Ie;return S>0?Ie=Re(S,O):Ie=null,Ie===null?(O.needReadable=O.length<=O.highWaterMark,S=0):(O.length-=S,O.multiAwaitDrain?O.awaitDrainWriters.clear():O.awaitDrainWriters=null),O.length===0&&(O.ended||(O.needReadable=!0),ye!==S&&O.ended&&je(this)),Ie!==null&&!O.errorEmitted&&!O.closeEmitted&&(O.dataEmitted=!0,this.emit("data",Ie)),Ie};function I(S,O){if(M("onEofChunk"),!O.ended){if(O.decoder){let ye=O.decoder.end();ye&&ye.length&&(O.buffer.push(ye),O.length+=O.objectMode?1:ye.length)}O.ended=!0,O.sync?L(S):(O.needReadable=!1,O.emittedReadable=!0,$(S))}}function L(S){let O=S._readableState;M("emitReadable",O.needReadable,O.emittedReadable),O.needReadable=!1,O.emittedReadable||(M("emitReadable",O.flowing),O.emittedReadable=!0,i.nextTick($,S))}function $(S){let O=S._readableState;M("emitReadable_",O.destroyed,O.length,O.ended),!O.destroyed&&!O.errored&&(O.length||O.ended)&&(S.emit("readable"),O.emittedReadable=!1),O.needReadable=!O.flowing&&!O.ended&&O.length<=O.highWaterMark,ct(S)}function _e(S,O){!O.readingMore&&O.constructed&&(O.readingMore=!0,i.nextTick(Ee,S,O))}function Ee(S,O){for(;!O.reading&&!O.ended&&(O.length<O.highWaterMark||O.flowing&&O.length===0);){let ye=O.length;if(M("maybeReadMore read 0"),S.read(0),ye===O.length)break}O.readingMore=!1}te.prototype._read=function(S){throw new P("_read()")},te.prototype.pipe=function(S,O){let ye=this,Se=this._readableState;Se.pipes.length===1&&(Se.multiAwaitDrain||(Se.multiAwaitDrain=!0,Se.awaitDrainWriters=new d(Se.awaitDrainWriters?[Se.awaitDrainWriters]:[]))),Se.pipes.push(S),M("pipe count=%d opts=%j",Se.pipes.length,O);let Ie=(!O||O.end!==!1)&&S!==i.stdout&&S!==i.stderr?ft:pr;Se.endEmitted?i.nextTick(Ie):ye.once("end",Ie),S.on("unpipe",nt);function nt(Xt,Pt){M("onunpipe"),Xt===ye&&Pt&&Pt.hasUnpiped===!1&&(Pt.hasUnpiped=!0,ac())}function ft(){M("onend"),S.end()}let Zt,pa=!1;function ac(){M("cleanup"),S.removeListener("close",xi),S.removeListener("finish",Ri),Zt&&S.removeListener("drain",Zt),S.removeListener("error",Pi),S.removeListener("unpipe",nt),ye.removeListener("end",ft),ye.removeListener("end",pr),ye.removeListener("data",ma),pa=!0,Zt&&Se.awaitDrainWriters&&(!S._writableState||S._writableState.needDrain)&&Zt()}function ga(){pa||(Se.pipes.length===1&&Se.pipes[0]===S?(M("false write response, pause",0),Se.awaitDrainWriters=S,Se.multiAwaitDrain=!1):Se.pipes.length>1&&Se.pipes.includes(S)&&(M("false write response, pause",Se.awaitDrainWriters.size),Se.awaitDrainWriters.add(S)),ye.pause()),Zt||(Zt=Be(ye,S),S.on("drain",Zt))}ye.on("data",ma);function ma(Xt){M("ondata");let Pt=S.write(Xt);M("dest.write",Pt),Pt===!1&&ga()}function Pi(Xt){if(M("onerror",Xt),pr(),S.removeListener("error",Pi),S.listenerCount("error")===0){let Pt=S._writableState||S._readableState;Pt&&!Pt.errorEmitted?x(S,Xt):S.emit("error",Xt)}}C(S,"error",Pi);function xi(){S.removeListener("finish",Ri),pr()}S.once("close",xi);function Ri(){M("onfinish"),S.removeListener("close",xi),pr()}S.once("finish",Ri);function pr(){M("unpipe"),ye.unpipe(S)}return S.emit("pipe",ye),S.writableNeedDrain===!0?ga():Se.flowing||(M("pipe resume"),ye.resume()),S};function Be(S,O){return function(){let ye=S._readableState;ye.awaitDrainWriters===O?(M("pipeOnDrain",1),ye.awaitDrainWriters=null):ye.multiAwaitDrain&&(M("pipeOnDrain",ye.awaitDrainWriters.size),ye.awaitDrainWriters.delete(O)),(!ye.awaitDrainWriters||ye.awaitDrainWriters.size===0)&&S.listenerCount("data")&&S.resume()}}te.prototype.unpipe=function(S){let O=this._readableState,ye={hasUnpiped:!1};if(O.pipes.length===0)return this;if(!S){let Ie=O.pipes;O.pipes=[],this.pause();for(let nt=0;nt<Ie.length;nt++)Ie[nt].emit("unpipe",this,{hasUnpiped:!1});return this}let Se=a(O.pipes,S);return Se===-1?this:(O.pipes.splice(Se,1),O.pipes.length===0&&this.pause(),S.emit("unpipe",this,ye),this)},te.prototype.on=function(S,O){let ye=w.prototype.on.call(this,S,O),Se=this._readableState;return S==="data"?(Se.readableListening=this.listenerCount("readable")>0,Se.flowing!==!1&&this.resume()):S==="readable"&&!Se.endEmitted&&!Se.readableListening&&(Se.readableListening=Se.needReadable=!0,Se.flowing=!1,Se.emittedReadable=!1,M("on readable",Se.length,Se.reading),Se.length?L(this):Se.reading||i.nextTick(xe,this)),ye},te.prototype.addListener=te.prototype.on,te.prototype.removeListener=function(S,O){let ye=w.prototype.removeListener.call(this,S,O);return S==="readable"&&i.nextTick(Me,this),ye},te.prototype.off=te.prototype.removeListener,te.prototype.removeAllListeners=function(S){let O=w.prototype.removeAllListeners.apply(this,arguments);return(S==="readable"||S===void 0)&&i.nextTick(Me,this),O};function Me(S){let O=S._readableState;O.readableListening=S.listenerCount("readable")>0,O.resumeScheduled&&O[me]===!1?O.flowing=!0:S.listenerCount("data")>0?S.resume():O.readableListening||(O.flowing=null)}function xe(S){M("readable nexttick read 0"),S.read(0)}te.prototype.resume=function(){let S=this._readableState;return S.flowing||(M("resume"),S.flowing=!S.readableListening,bt(this,S)),S[me]=!1,this};function bt(S,O){O.resumeScheduled||(O.resumeScheduled=!0,i.nextTick(lt,S,O))}function lt(S,O){M("resume",O.reading),O.reading||S.read(0),O.resumeScheduled=!1,S.emit("resume"),ct(S),O.flowing&&!O.reading&&S.read(0)}te.prototype.pause=function(){return M("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(M("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[me]=!0,this};function ct(S){let O=S._readableState;for(M("flow",O.flowing);O.flowing&&S.read()!==null;);}te.prototype.wrap=function(S){let O=!1;S.on("data",Se=>{!this.push(Se)&&S.pause&&(O=!0,S.pause())}),S.on("end",()=>{this.push(null)}),S.on("error",Se=>{x(this,Se)}),S.on("close",()=>{this.destroy()}),S.on("destroy",()=>{this.destroy()}),this._read=()=>{O&&S.resume&&(O=!1,S.resume())};let ye=t(S);for(let Se=1;Se<ye.length;Se++){let Ie=ye[Se];this[Ie]===void 0&&typeof S[Ie]=="function"&&(this[Ie]=S[Ie].bind(S))}return this},te.prototype[m]=function(){return Ke(this)},te.prototype.iterator=function(S){return S!==void 0&&pe(S,"options"),Ke(this,S)};function Ke(S,O){typeof S.read!="function"&&(S=te.wrap(S,{objectMode:!0}));let ye=et(S,O);return ye.stream=S,ye}async function*et(S,O){let ye=de;function Se(ft){this===S?(ye(),ye=de):ye=ft}S.on("readable",Se);let Ie,nt=N(S,{writable:!1},ft=>{Ie=ft?X(Ie,ft):null,ye(),ye=de});try{for(;;){let ft=S.destroyed?null:S.read();if(ft!==null)yield ft;else{if(Ie)throw Ie;if(Ie===null)return;await new u(Se)}}}catch(ft){throw Ie=X(Ie,ft),Ie}finally{(Ie||(O==null?void 0:O.destroyOnReturn)!==!1)&&(Ie===void 0||S._readableState.autoDestroy)?T.destroyer(S,null):(S.off("readable",Se),nt())}}n(te.prototype,{readable:{__proto__:null,get(){let S=this._readableState;return!!S&&S.readable!==!1&&!S.destroyed&&!S.errorEmitted&&!S.endEmitted},set(S){this._readableState&&(this._readableState.readable=!!S)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(S){this._readableState&&(this._readableState.flowing=S)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(S){this._readableState&&(this._readableState.destroyed=S)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),n(we.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[me]!==!1},set(S){this[me]=!!S}}}),te._fromList=Re;function Re(S,O){if(O.length===0)return null;let ye;return O.objectMode?ye=O.buffer.shift():!S||S>=O.length?(O.decoder?ye=O.buffer.join(""):O.buffer.length===1?ye=O.buffer.first():ye=O.buffer.concat(O.length),O.buffer.clear()):ye=O.buffer.consume(S,O.decoder),ye}function je(S){let O=S._readableState;M("endReadable",O.endEmitted),O.endEmitted||(O.ended=!0,i.nextTick(rt,O,S))}function rt(S,O){if(M("endReadableNT",S.endEmitted,S.length),!S.errored&&!S.closeEmitted&&!S.endEmitted&&S.length===0){if(S.endEmitted=!0,O.emit("end"),O.writable&&O.allowHalfOpen===!1)i.nextTick(Je,O);else if(S.autoDestroy){let ye=O._writableState;(!ye||ye.autoDestroy&&(ye.finished||ye.writable===!1))&&O.destroy()}}}function Je(S){S.writable&&!S.writableEnded&&!S.destroyed&&S.end()}te.from=function(S,O){return z(te,S,O)};var st;function Dt(){return st===void 0&&(st={}),st}te.fromWeb=function(S,O){return Dt().newStreamReadableFromReadableStream(S,O)},te.toWeb=function(S,O){return Dt().newReadableStreamFromStreamReadable(S,O)},te.wrap=function(S,O){var ye,Se;return new te({objectMode:(ye=(Se=S.readableObjectMode)!==null&&Se!==void 0?Se:S.objectMode)!==null&&ye!==void 0?ye:!0,...O,destroy(Ie,nt){T.destroyer(S,Ie),nt(Ie)}}).wrap(S)}}),hi=Ae((o,h)=>{ce(),fe(),he();var i=Kt(),{ArrayPrototypeSlice:a,Error:l,FunctionPrototypeSymbolHasInstance:r,ObjectDefineProperty:e,ObjectDefineProperties:n,ObjectSetPrototypeOf:t,StringPrototypeToLowerCase:s,Symbol:u,SymbolHasInstance:d}=qe();h.exports=pe,pe.WritableState=V;var{EventEmitter:p}=(Qt(),Le(Rt)),m=ci().Stream,{Buffer:A}=(Xe(),Le(Ze)),y=nr(),{addAbortSignal:w}=Er(),{getHighWaterMark:C,getDefaultHighWaterMark:b}=Sr(),{ERR_INVALID_ARG_TYPE:_,ERR_METHOD_NOT_IMPLEMENTED:N,ERR_MULTIPLE_CALLBACK:M,ERR_STREAM_CANNOT_PIPE:k,ERR_STREAM_DESTROYED:T,ERR_STREAM_ALREADY_FINISHED:U,ERR_STREAM_NULL_VALUES:J,ERR_STREAM_WRITE_AFTER_END:X,ERR_UNKNOWN_ENCODING:le}=ot().codes,{errorOrDestroy:P}=y;t(pe.prototype,m.prototype),t(pe,m);function G(){}var Z=u("kOnFinished");function V(R,j,Y){typeof Y!="boolean"&&(Y=j instanceof St()),this.objectMode=!!(R&&R.objectMode),Y&&(this.objectMode=this.objectMode||!!(R&&R.writableObjectMode)),this.highWaterMark=R?C(this,R,"writableHighWaterMark",Y):b(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let oe=!!(R&&R.decodeStrings===!1);this.decodeStrings=!oe,this.defaultEncoding=R&&R.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=x.bind(void 0,j),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,be(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!R||R.emitClose!==!1,this.autoDestroy=!R||R.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[Z]=[]}function be(R){R.buffered=[],R.bufferedIndex=0,R.allBuffers=!0,R.allNoop=!0}V.prototype.getBuffer=function(){return a(this.buffered,this.bufferedIndex)},e(V.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function pe(R){let j=this instanceof St();if(!j&&!r(pe,this))return new pe(R);this._writableState=new V(R,this,j),R&&(typeof R.write=="function"&&(this._write=R.write),typeof R.writev=="function"&&(this._writev=R.writev),typeof R.destroy=="function"&&(this._destroy=R.destroy),typeof R.final=="function"&&(this._final=R.final),typeof R.construct=="function"&&(this._construct=R.construct),R.signal&&w(R.signal,this)),m.call(this,R),y.construct(this,()=>{let Y=this._writableState;Y.writing||Ce(this,Y),Q(this,Y)})}e(pe,d,{__proto__:null,value:function(R){return r(this,R)?!0:this!==pe?!1:R&&R._writableState instanceof V}}),pe.prototype.pipe=function(){P(this,new k)};function me(R,j,Y,oe){let re=R._writableState;if(typeof Y=="function")oe=Y,Y=re.defaultEncoding;else{if(!Y)Y=re.defaultEncoding;else if(Y!=="buffer"&&!A.isEncoding(Y))throw new le(Y);typeof oe!="function"&&(oe=G)}if(j===null)throw new J;if(!re.objectMode)if(typeof j=="string")re.decodeStrings!==!1&&(j=A.from(j,Y),Y="buffer");else if(j instanceof A)Y="buffer";else if(m._isUint8Array(j))j=m._uint8ArrayToBuffer(j),Y="buffer";else throw new _("chunk",["string","Buffer","Uint8Array"],j);let ue;return re.ending?ue=new X:re.destroyed&&(ue=new T("write")),ue?(i.nextTick(oe,ue),P(R,ue,!0),ue):(re.pendingcb++,ve(R,re,j,Y,oe))}pe.prototype.write=function(R,j,Y){return me(this,R,j,Y)===!0},pe.prototype.cork=function(){this._writableState.corked++},pe.prototype.uncork=function(){let R=this._writableState;R.corked&&(R.corked--,R.writing||Ce(this,R))},pe.prototype.setDefaultEncoding=function(R){if(typeof R=="string"&&(R=s(R)),!A.isEncoding(R))throw new le(R);return this._writableState.defaultEncoding=R,this};function ve(R,j,Y,oe,re){let ue=j.objectMode?1:Y.length;j.length+=ue;let W=j.length<j.highWaterMark;return W||(j.needDrain=!0),j.writing||j.corked||j.errored||!j.constructed?(j.buffered.push({chunk:Y,encoding:oe,callback:re}),j.allBuffers&&oe!=="buffer"&&(j.allBuffers=!1),j.allNoop&&re!==G&&(j.allNoop=!1)):(j.writelen=ue,j.writecb=re,j.writing=!0,j.sync=!0,R._write(Y,oe,j.onwrite),j.sync=!1),W&&!j.errored&&!j.destroyed}function z(R,j,Y,oe,re,ue,W){j.writelen=oe,j.writecb=W,j.writing=!0,j.sync=!0,j.destroyed?j.onwrite(new T("write")):Y?R._writev(re,j.onwrite):R._write(re,ue,j.onwrite),j.sync=!1}function de(R,j,Y,oe){--j.pendingcb,oe(Y),F(j),P(R,Y)}function x(R,j){let Y=R._writableState,oe=Y.sync,re=Y.writecb;if(typeof re!="function"){P(R,new M);return}Y.writing=!1,Y.writecb=null,Y.length-=Y.writelen,Y.writelen=0,j?(j.stack,Y.errored||(Y.errored=j),R._readableState&&!R._readableState.errored&&(R._readableState.errored=j),oe?i.nextTick(de,R,Y,j,re):de(R,Y,j,re)):(Y.buffered.length>Y.bufferedIndex&&Ce(R,Y),oe?Y.afterWriteTickInfo!==null&&Y.afterWriteTickInfo.cb===re?Y.afterWriteTickInfo.count++:(Y.afterWriteTickInfo={count:1,cb:re,stream:R,state:Y},i.nextTick(ne,Y.afterWriteTickInfo)):ge(R,Y,1,re))}function ne({stream:R,state:j,count:Y,cb:oe}){return j.afterWriteTickInfo=null,ge(R,j,Y,oe)}function ge(R,j,Y,oe){for(!j.ending&&!R.destroyed&&j.length===0&&j.needDrain&&(j.needDrain=!1,R.emit("drain"));Y-- >0;)j.pendingcb--,oe();j.destroyed&&F(j),Q(R,j)}function F(R){if(R.writing)return;for(let re=R.bufferedIndex;re<R.buffered.length;++re){var j;let{chunk:ue,callback:W}=R.buffered[re],se=R.objectMode?1:ue.length;R.length-=se,W((j=R.errored)!==null&&j!==void 0?j:new T("write"))}let Y=R[Z].splice(0);for(let re=0;re<Y.length;re++){var oe;Y[re]((oe=R.errored)!==null&&oe!==void 0?oe:new T("end"))}be(R)}function Ce(R,j){if(j.corked||j.bufferProcessing||j.destroyed||!j.constructed)return;let{buffered:Y,bufferedIndex:oe,objectMode:re}=j,ue=Y.length-oe;if(!ue)return;let W=oe;if(j.bufferProcessing=!0,ue>1&&R._writev){j.pendingcb-=ue-1;let se=j.allNoop?G:te=>{for(let Pe=W;Pe<Y.length;++Pe)Y[Pe].callback(te)},we=j.allNoop&&W===0?Y:a(Y,W);we.allBuffers=j.allBuffers,z(R,j,!0,j.length,we,"",se),be(j)}else{do{let{chunk:se,encoding:we,callback:te}=Y[W];Y[W++]=null;let Pe=re?1:se.length;z(R,j,!1,Pe,se,we,te)}while(W<Y.length&&!j.writing);W===Y.length?be(j):W>256?(Y.splice(0,W),j.bufferedIndex=0):j.bufferedIndex=W}j.bufferProcessing=!1}pe.prototype._write=function(R,j,Y){if(this._writev)this._writev([{chunk:R,encoding:j}],Y);else throw new N("_write()")},pe.prototype._writev=null,pe.prototype.end=function(R,j,Y){let oe=this._writableState;typeof R=="function"?(Y=R,R=null,j=null):typeof j=="function"&&(Y=j,j=null);let re;if(R!=null){let ue=me(this,R,j);ue instanceof l&&(re=ue)}return oe.corked&&(oe.corked=1,this.uncork()),re||(!oe.errored&&!oe.ending?(oe.ending=!0,Q(this,oe,!0),oe.ended=!0):oe.finished?re=new U("end"):oe.destroyed&&(re=new T("end"))),typeof Y=="function"&&(re||oe.finished?i.nextTick(Y,re):oe[Z].push(Y)),this};function q(R){return R.ending&&!R.destroyed&&R.constructed&&R.length===0&&!R.errored&&R.buffered.length===0&&!R.finished&&!R.writing&&!R.errorEmitted&&!R.closeEmitted}function D(R,j){let Y=!1;function oe(re){if(Y){P(R,re??M());return}if(Y=!0,j.pendingcb--,re){let ue=j[Z].splice(0);for(let W=0;W<ue.length;W++)ue[W](re);P(R,re,j.sync)}else q(j)&&(j.prefinished=!0,R.emit("prefinish"),j.pendingcb++,i.nextTick(K,R,j))}j.sync=!0,j.pendingcb++;try{R._final(oe)}catch(re){oe(re)}j.sync=!1}function ee(R,j){!j.prefinished&&!j.finalCalled&&(typeof R._final=="function"&&!j.destroyed?(j.finalCalled=!0,D(R,j)):(j.prefinished=!0,R.emit("prefinish")))}function Q(R,j,Y){q(j)&&(ee(R,j),j.pendingcb===0&&(Y?(j.pendingcb++,i.nextTick((oe,re)=>{q(re)?K(oe,re):re.pendingcb--},R,j)):q(j)&&(j.pendingcb++,K(R,j))))}function K(R,j){j.pendingcb--,j.finished=!0;let Y=j[Z].splice(0);for(let oe=0;oe<Y.length;oe++)Y[oe]();if(R.emit("finish"),j.autoDestroy){let oe=R._readableState;(!oe||oe.autoDestroy&&(oe.endEmitted||oe.readable===!1))&&R.destroy()}}n(pe.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(R){this._writableState&&(this._writableState.destroyed=R)}},writable:{__proto__:null,get(){let R=this._writableState;return!!R&&R.writable!==!1&&!R.destroyed&&!R.errored&&!R.ending&&!R.ended},set(R){this._writableState&&(this._writableState.writable=!!R)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let R=this._writableState;return R?!R.destroyed&&!R.ending&&R.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var H=y.destroy;pe.prototype.destroy=function(R,j){let Y=this._writableState;return!Y.destroyed&&(Y.bufferedIndex<Y.buffered.length||Y[Z].length)&&i.nextTick(F,Y),H.call(this,R,j),this},pe.prototype._undestroy=y.undestroy,pe.prototype._destroy=function(R,j){j(R)},pe.prototype[p.captureRejectionSymbol]=function(R){this.destroy(R)};var ae;function ie(){return ae===void 0&&(ae={}),ae}pe.fromWeb=function(R,j){return ie().newStreamWritableFromWritableStream(R,j)},pe.toWeb=function(R){return ie().newWritableStreamFromStreamWritable(R)}}),zl=Ae((o,h)=>{ce(),fe(),he();var i=Kt(),a=(Xe(),Le(Ze)),{isReadable:l,isWritable:r,isIterable:e,isNodeStream:n,isReadableNodeStream:t,isWritableNodeStream:s,isDuplexNodeStream:u,isReadableStream:d,isWritableStream:p}=Et(),m=Mt(),{AbortError:A,codes:{ERR_INVALID_ARG_TYPE:y,ERR_INVALID_RETURN_VALUE:w}}=ot(),{destroyer:C}=nr(),b=St(),_=Cr(),N=hi(),{createDeferredPromise:M}=at(),k=Ko(),T=globalThis.Blob||a.Blob,U=typeof T<"u"?function(Z){return Z instanceof T}:function(Z){return!1},J=globalThis.AbortController||cr().AbortController,{FunctionPrototypeCall:X}=qe(),le=class extends b{constructor(Z){super(Z),(Z==null?void 0:Z.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(Z==null?void 0:Z.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};h.exports=function Z(V,be){if(u(V))return V;if(t(V))return G({readable:V});if(s(V))return G({writable:V});if(n(V))return G({writable:!1,readable:!1});if(d(V))return G({readable:_.fromWeb(V)});if(p(V))return G({writable:N.fromWeb(V)});if(typeof V=="function"){let{value:me,write:ve,final:z,destroy:de}=P(V);if(e(me))return k(le,me,{objectMode:!0,write:ve,final:z,destroy:de});let x=me==null?void 0:me.then;if(typeof x=="function"){let ne,ge=X(x,me,F=>{if(F!=null)throw new w("nully","body",F)},F=>{C(ne,F)});return ne=new le({objectMode:!0,readable:!1,write:ve,final(F){z(async()=>{try{await ge,i.nextTick(F,null)}catch(Ce){i.nextTick(F,Ce)}})},destroy:de})}throw new w("Iterable, AsyncIterable or AsyncFunction",be,me)}if(U(V))return Z(V.arrayBuffer());if(e(V))return k(le,V,{objectMode:!0,writable:!1});if(d(V==null?void 0:V.readable)&&p(V==null?void 0:V.writable))return le.fromWeb(V);if(typeof(V==null?void 0:V.writable)=="object"||typeof(V==null?void 0:V.readable)=="object"){let me=V!=null&&V.readable?t(V==null?void 0:V.readable)?V==null?void 0:V.readable:Z(V.readable):void 0,ve=V!=null&&V.writable?s(V==null?void 0:V.writable)?V==null?void 0:V.writable:Z(V.writable):void 0;return G({readable:me,writable:ve})}let pe=V==null?void 0:V.then;if(typeof pe=="function"){let me;return X(pe,V,ve=>{ve!=null&&me.push(ve),me.push(null)},ve=>{C(me,ve)}),me=new le({objectMode:!0,writable:!1,read(){}})}throw new y(be,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],V)};function P(Z){let{promise:V,resolve:be}=M(),pe=new J,me=pe.signal;return{value:Z(async function*(){for(;;){let ve=V;V=null;let{chunk:z,done:de,cb:x}=await ve;if(i.nextTick(x),de)return;if(me.aborted)throw new A(void 0,{cause:me.reason});({promise:V,resolve:be}=M()),yield z}}(),{signal:me}),write(ve,z,de){let x=be;be=null,x({chunk:ve,done:!1,cb:de})},final(ve){let z=be;be=null,z({done:!0,cb:ve})},destroy(ve,z){pe.abort(),z(ve)}}}function G(Z){let V=Z.readable&&typeof Z.readable.read!="function"?_.wrap(Z.readable):Z.readable,be=Z.writable,pe=!!l(V),me=!!r(be),ve,z,de,x,ne;function ge(F){let Ce=x;x=null,Ce?Ce(F):F&&ne.destroy(F)}return ne=new le({readableObjectMode:!!(V!=null&&V.readableObjectMode),writableObjectMode:!!(be!=null&&be.writableObjectMode),readable:pe,writable:me}),me&&(m(be,F=>{me=!1,F&&C(V,F),ge(F)}),ne._write=function(F,Ce,q){be.write(F,Ce)?q():ve=q},ne._final=function(F){be.end(),z=F},be.on("drain",function(){if(ve){let F=ve;ve=null,F()}}),be.on("finish",function(){if(z){let F=z;z=null,F()}})),pe&&(m(V,F=>{pe=!1,F&&C(V,F),ge(F)}),V.on("readable",function(){if(de){let F=de;de=null,F()}}),V.on("end",function(){ne.push(null)}),ne._read=function(){for(;;){let F=V.read();if(F===null){de=ne._read;return}if(!ne.push(F))return}}),ne._destroy=function(F,Ce){!F&&x!==null&&(F=new A),de=null,ve=null,z=null,x===null?Ce(F):(x=Ce,C(be,F),C(V,F))},ne}}),St=Ae((o,h)=>{ce(),fe(),he();var{ObjectDefineProperties:i,ObjectGetOwnPropertyDescriptor:a,ObjectKeys:l,ObjectSetPrototypeOf:r}=qe();h.exports=t;var e=Cr(),n=hi();r(t.prototype,e.prototype),r(t,e);{let p=l(n.prototype);for(let m=0;m<p.length;m++){let A=p[m];t.prototype[A]||(t.prototype[A]=n.prototype[A])}}function t(p){if(!(this instanceof t))return new t(p);e.call(this,p),n.call(this,p),p?(this.allowHalfOpen=p.allowHalfOpen!==!1,p.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),p.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}i(t.prototype,{writable:{__proto__:null,...a(n.prototype,"writable")},writableHighWaterMark:{__proto__:null,...a(n.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...a(n.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...a(n.prototype,"writableBuffer")},writableLength:{__proto__:null,...a(n.prototype,"writableLength")},writableFinished:{__proto__:null,...a(n.prototype,"writableFinished")},writableCorked:{__proto__:null,...a(n.prototype,"writableCorked")},writableEnded:{__proto__:null,...a(n.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...a(n.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(p){this._readableState&&this._writableState&&(this._readableState.destroyed=p,this._writableState.destroyed=p)}}});var s;function u(){return s===void 0&&(s={}),s}t.fromWeb=function(p,m){return u().newStreamDuplexFromReadableWritablePair(p,m)},t.toWeb=function(p){return u().newReadableWritablePairFromDuplex(p)};var d;t.from=function(p){return d||(d=zl()),d(p,"body")}}),Ho=Ae((o,h)=>{ce(),fe(),he();var{ObjectSetPrototypeOf:i,Symbol:a}=qe();h.exports=t;var{ERR_METHOD_NOT_IMPLEMENTED:l}=ot().codes,r=St(),{getHighWaterMark:e}=Sr();i(t.prototype,r.prototype),i(t,r);var n=a("kCallback");function t(d){if(!(this instanceof t))return new t(d);let p=d?e(this,d,"readableHighWaterMark",!0):null;p===0&&(d={...d,highWaterMark:null,readableHighWaterMark:p,writableHighWaterMark:d.writableHighWaterMark||0}),r.call(this,d),this._readableState.sync=!1,this[n]=null,d&&(typeof d.transform=="function"&&(this._transform=d.transform),typeof d.flush=="function"&&(this._flush=d.flush)),this.on("prefinish",u)}function s(d){typeof this._flush=="function"&&!this.destroyed?this._flush((p,m)=>{if(p){d?d(p):this.destroy(p);return}m!=null&&this.push(m),this.push(null),d&&d()}):(this.push(null),d&&d())}function u(){this._final!==s&&s.call(this)}t.prototype._final=s,t.prototype._transform=function(d,p,m){throw new l("_transform()")},t.prototype._write=function(d,p,m){let A=this._readableState,y=this._writableState,w=A.length;this._transform(d,p,(C,b)=>{if(C){m(C);return}b!=null&&this.push(b),y.ended||w===A.length||A.length<A.highWaterMark?m():this[n]=m})},t.prototype._read=function(){if(this[n]){let d=this[n];this[n]=null,d()}}}),qo=Ae((o,h)=>{ce(),fe(),he();var{ObjectSetPrototypeOf:i}=qe();h.exports=l;var a=Ho();i(l.prototype,a.prototype),i(l,a);function l(r){if(!(this instanceof l))return new l(r);a.call(this,r)}l.prototype._transform=function(r,e,n){n(null,r)}}),fi=Ae((o,h)=>{ce(),fe(),he();var i=Kt(),{ArrayIsArray:a,Promise:l,SymbolAsyncIterator:r,SymbolDispose:e}=qe(),n=Mt(),{once:t}=at(),s=nr(),u=St(),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:p,ERR_INVALID_RETURN_VALUE:m,ERR_MISSING_ARGS:A,ERR_STREAM_DESTROYED:y,ERR_STREAM_PREMATURE_CLOSE:w},AbortError:C}=ot(),{validateFunction:b,validateAbortSignal:_}=hr(),{isIterable:N,isReadable:M,isReadableNodeStream:k,isNodeStream:T,isTransformStream:U,isWebStream:J,isReadableStream:X,isReadableFinished:le}=Et(),P=globalThis.AbortController||cr().AbortController,G,Z,V;function be(F,Ce,q){let D=!1;F.on("close",()=>{D=!0});let ee=n(F,{readable:Ce,writable:q},Q=>{D=!Q});return{destroy:Q=>{D||(D=!0,s.destroyer(F,Q||new y("pipe")))},cleanup:ee}}function pe(F){return b(F[F.length-1],"streams[stream.length - 1]"),F.pop()}function me(F){if(N(F))return F;if(k(F))return ve(F);throw new p("val",["Readable","Iterable","AsyncIterable"],F)}async function*ve(F){Z||(Z=Cr()),yield*Z.prototype[r].call(F)}async function z(F,Ce,q,{end:D}){let ee,Q=null,K=ie=>{if(ie&&(ee=ie),Q){let R=Q;Q=null,R()}},H=()=>new l((ie,R)=>{ee?R(ee):Q=()=>{ee?R(ee):ie()}});Ce.on("drain",K);let ae=n(Ce,{readable:!1},K);try{Ce.writableNeedDrain&&await H();for await(let ie of F)Ce.write(ie)||await H();D&&(Ce.end(),await H()),q()}catch(ie){q(ee!==ie?d(ee,ie):ie)}finally{ae(),Ce.off("drain",K)}}async function de(F,Ce,q,{end:D}){U(Ce)&&(Ce=Ce.writable);let ee=Ce.getWriter();try{for await(let Q of F)await ee.ready,ee.write(Q).catch(()=>{});await ee.ready,D&&await ee.close(),q()}catch(Q){try{await ee.abort(Q),q(Q)}catch(K){q(K)}}}function x(...F){return ne(F,t(pe(F)))}function ne(F,Ce,q){if(F.length===1&&a(F[0])&&(F=F[0]),F.length<2)throw new A("streams");let D=new P,ee=D.signal,Q=q==null?void 0:q.signal,K=[];_(Q,"options.signal");function H(){re(new C)}V=V||at().addAbortListener;let ae;Q&&(ae=V(Q,H));let ie,R,j=[],Y=0;function oe(we){re(we,--Y===0)}function re(we,te){var Pe;if(we&&(!ie||ie.code==="ERR_STREAM_PREMATURE_CLOSE")&&(ie=we),!(!ie&&!te)){for(;j.length;)j.shift()(ie);(Pe=ae)===null||Pe===void 0||Pe[e](),D.abort(),te&&(ie||K.forEach(c=>c()),i.nextTick(Ce,ie,R))}}let ue;for(let we=0;we<F.length;we++){let te=F[we],Pe=we<F.length-1,c=we>0,f=Pe||(q==null?void 0:q.end)!==!1,g=we===F.length-1;if(T(te)){let v=function(I){I&&I.name!=="AbortError"&&I.code!=="ERR_STREAM_PREMATURE_CLOSE"&&oe(I)};if(f){let{destroy:I,cleanup:L}=be(te,Pe,c);j.push(I),M(te)&&g&&K.push(L)}te.on("error",v),M(te)&&g&&K.push(()=>{te.removeListener("error",v)})}if(we===0)if(typeof te=="function"){if(ue=te({signal:ee}),!N(ue))throw new m("Iterable, AsyncIterable or Stream","source",ue)}else N(te)||k(te)||U(te)?ue=te:ue=u.from(te);else if(typeof te=="function"){if(U(ue)){var W;ue=me((W=ue)===null||W===void 0?void 0:W.readable)}else ue=me(ue);if(ue=te(ue,{signal:ee}),Pe){if(!N(ue,!0))throw new m("AsyncIterable",`transform[${we-1}]`,ue)}else{var se;G||(G=qo());let v=new G({objectMode:!0}),I=(se=ue)===null||se===void 0?void 0:se.then;if(typeof I=="function")Y++,I.call(ue,_e=>{R=_e,_e!=null&&v.write(_e),f&&v.end(),i.nextTick(oe)},_e=>{v.destroy(_e),i.nextTick(oe,_e)});else if(N(ue,!0))Y++,z(ue,v,oe,{end:f});else if(X(ue)||U(ue)){let _e=ue.readable||ue;Y++,z(_e,v,oe,{end:f})}else throw new m("AsyncIterable or Promise","destination",ue);ue=v;let{destroy:L,cleanup:$}=be(ue,!1,!0);j.push(L),g&&K.push($)}}else if(T(te)){if(k(ue)){Y+=2;let v=ge(ue,te,oe,{end:f});M(te)&&g&&K.push(v)}else if(U(ue)||X(ue)){let v=ue.readable||ue;Y++,z(v,te,oe,{end:f})}else if(N(ue))Y++,z(ue,te,oe,{end:f});else throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],ue);ue=te}else if(J(te)){if(k(ue))Y++,de(me(ue),te,oe,{end:f});else if(X(ue)||N(ue))Y++,de(ue,te,oe,{end:f});else if(U(ue))Y++,de(ue.readable,te,oe,{end:f});else throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],ue);ue=te}else ue=u.from(te)}return(ee!=null&&ee.aborted||Q!=null&&Q.aborted)&&i.nextTick(H),ue}function ge(F,Ce,q,{end:D}){let ee=!1;if(Ce.on("close",()=>{ee||q(new w)}),F.pipe(Ce,{end:!1}),D){let Q=function(){ee=!0,Ce.end()};le(F)?i.nextTick(Q):F.once("end",Q)}else q();return n(F,{readable:!0,writable:!1},Q=>{let K=F._readableState;Q&&Q.code==="ERR_STREAM_PREMATURE_CLOSE"&&K&&K.ended&&!K.errored&&!K.errorEmitted?F.once("end",q).once("error",q):q(Q)}),n(Ce,{readable:!1,writable:!0},q)}h.exports={pipelineImpl:ne,pipeline:x}}),$o=Ae((o,h)=>{ce(),fe(),he();var{pipeline:i}=fi(),a=St(),{destroyer:l}=nr(),{isNodeStream:r,isReadable:e,isWritable:n,isWebStream:t,isTransformStream:s,isWritableStream:u,isReadableStream:d}=Et(),{AbortError:p,codes:{ERR_INVALID_ARG_VALUE:m,ERR_MISSING_ARGS:A}}=ot(),y=Mt();h.exports=function(...w){if(w.length===0)throw new A("streams");if(w.length===1)return a.from(w[0]);let C=[...w];if(typeof w[0]=="function"&&(w[0]=a.from(w[0])),typeof w[w.length-1]=="function"){let P=w.length-1;w[P]=a.from(w[P])}for(let P=0;P<w.length;++P)if(!(!r(w[P])&&!t(w[P]))){if(P<w.length-1&&!(e(w[P])||d(w[P])||s(w[P])))throw new m(`streams[${P}]`,C[P],"must be readable");if(P>0&&!(n(w[P])||u(w[P])||s(w[P])))throw new m(`streams[${P}]`,C[P],"must be writable")}let b,_,N,M,k;function T(P){let G=M;M=null,G?G(P):P?k.destroy(P):!le&&!X&&k.destroy()}let U=w[0],J=i(w,T),X=!!(n(U)||u(U)||s(U)),le=!!(e(J)||d(J)||s(J));if(k=new a({writableObjectMode:!!(U!=null&&U.writableObjectMode),readableObjectMode:!!(J!=null&&J.readableObjectMode),writable:X,readable:le}),X){if(r(U))k._write=function(G,Z,V){U.write(G,Z)?V():b=V},k._final=function(G){U.end(),_=G},U.on("drain",function(){if(b){let G=b;b=null,G()}});else if(t(U)){let G=(s(U)?U.writable:U).getWriter();k._write=async function(Z,V,be){try{await G.ready,G.write(Z).catch(()=>{}),be()}catch(pe){be(pe)}},k._final=async function(Z){try{await G.ready,G.close().catch(()=>{}),_=Z}catch(V){Z(V)}}}let P=s(J)?J.readable:J;y(P,()=>{if(_){let G=_;_=null,G()}})}if(le){if(r(J))J.on("readable",function(){if(N){let P=N;N=null,P()}}),J.on("end",function(){k.push(null)}),k._read=function(){for(;;){let P=J.read();if(P===null){N=k._read;return}if(!k.push(P))return}};else if(t(J)){let P=(s(J)?J.readable:J).getReader();k._read=async function(){for(;;)try{let{value:G,done:Z}=await P.read();if(!k.push(G))return;if(Z){k.push(null);return}}catch{return}}}}return k._destroy=function(P,G){!P&&M!==null&&(P=new p),N=null,b=null,_=null,M===null?G(P):(M=G,r(J)&&l(J,P))},k}}),Gl=Ae((o,h)=>{ce(),fe(),he();var i=globalThis.AbortController||cr().AbortController,{codes:{ERR_INVALID_ARG_VALUE:a,ERR_INVALID_ARG_TYPE:l,ERR_MISSING_ARGS:r,ERR_OUT_OF_RANGE:e},AbortError:n}=ot(),{validateAbortSignal:t,validateInteger:s,validateObject:u}=hr(),d=qe().Symbol("kWeak"),p=qe().Symbol("kResistStopPropagation"),{finished:m}=Mt(),A=$o(),{addAbortSignalNoValidate:y}=Er(),{isWritable:w,isNodeStream:C}=Et(),{deprecate:b}=at(),{ArrayPrototypePush:_,Boolean:N,MathFloor:M,Number:k,NumberIsNaN:T,Promise:U,PromiseReject:J,PromiseResolve:X,PromisePrototypeThen:le,Symbol:P}=qe(),G=P("kEmpty"),Z=P("kEof");function V(Q,K){if(K!=null&&u(K,"options"),(K==null?void 0:K.signal)!=null&&t(K.signal,"options.signal"),C(Q)&&!w(Q))throw new a("stream",Q,"must be writable");let H=A(this,Q);return K!=null&&K.signal&&y(K.signal,H),H}function be(Q,K){if(typeof Q!="function")throw new l("fn",["Function","AsyncFunction"],Q);K!=null&&u(K,"options"),(K==null?void 0:K.signal)!=null&&t(K.signal,"options.signal");let H=1;(K==null?void 0:K.concurrency)!=null&&(H=M(K.concurrency));let ae=H-1;return(K==null?void 0:K.highWaterMark)!=null&&(ae=M(K.highWaterMark)),s(H,"options.concurrency",1),s(ae,"options.highWaterMark",0),ae+=H,(async function*(){let ie=at().AbortSignalAny([K==null?void 0:K.signal].filter(N)),R=this,j=[],Y={signal:ie},oe,re,ue=!1,W=0;function se(){ue=!0,we()}function we(){W-=1,te()}function te(){re&&!ue&&W<H&&j.length<ae&&(re(),re=null)}async function Pe(){try{for await(let c of R){if(ue)return;if(ie.aborted)throw new n;try{if(c=Q(c,Y),c===G)continue;c=X(c)}catch(f){c=J(f)}W+=1,le(c,we,se),j.push(c),oe&&(oe(),oe=null),!ue&&(j.length>=ae||W>=H)&&await new U(f=>{re=f})}j.push(Z)}catch(c){let f=J(c);le(f,we,se),j.push(f)}finally{ue=!0,oe&&(oe(),oe=null)}}Pe();try{for(;;){for(;j.length>0;){let c=await j[0];if(c===Z)return;if(ie.aborted)throw new n;c!==G&&(yield c),j.shift(),te()}await new U(c=>{oe=c})}}finally{ue=!0,re&&(re(),re=null)}}).call(this)}function pe(Q=void 0){return Q!=null&&u(Q,"options"),(Q==null?void 0:Q.signal)!=null&&t(Q.signal,"options.signal"),(async function*(){let K=0;for await(let ae of this){var H;if(Q!=null&&(H=Q.signal)!==null&&H!==void 0&&H.aborted)throw new n({cause:Q.signal.reason});yield[K++,ae]}}).call(this)}async function me(Q,K=void 0){for await(let H of x.call(this,Q,K))return!0;return!1}async function ve(Q,K=void 0){if(typeof Q!="function")throw new l("fn",["Function","AsyncFunction"],Q);return!await me.call(this,async(...H)=>!await Q(...H),K)}async function z(Q,K){for await(let H of x.call(this,Q,K))return H}async function de(Q,K){if(typeof Q!="function")throw new l("fn",["Function","AsyncFunction"],Q);async function H(ae,ie){return await Q(ae,ie),G}for await(let ae of be.call(this,H,K));}function x(Q,K){if(typeof Q!="function")throw new l("fn",["Function","AsyncFunction"],Q);async function H(ae,ie){return await Q(ae,ie)?ae:G}return be.call(this,H,K)}var ne=class extends r{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function ge(Q,K,H){var ae;if(typeof Q!="function")throw new l("reducer",["Function","AsyncFunction"],Q);H!=null&&u(H,"options"),(H==null?void 0:H.signal)!=null&&t(H.signal,"options.signal");let ie=arguments.length>1;if(H!=null&&(ae=H.signal)!==null&&ae!==void 0&&ae.aborted){let re=new n(void 0,{cause:H.signal.reason});throw this.once("error",()=>{}),await m(this.destroy(re)),re}let R=new i,j=R.signal;if(H!=null&&H.signal){let re={once:!0,[d]:this,[p]:!0};H.signal.addEventListener("abort",()=>R.abort(),re)}let Y=!1;try{for await(let re of this){var oe;if(Y=!0,H!=null&&(oe=H.signal)!==null&&oe!==void 0&&oe.aborted)throw new n;ie?K=await Q(K,re,{signal:j}):(K=re,ie=!0)}if(!Y&&!ie)throw new ne}finally{R.abort()}return K}async function F(Q){Q!=null&&u(Q,"options"),(Q==null?void 0:Q.signal)!=null&&t(Q.signal,"options.signal");let K=[];for await(let ae of this){var H;if(Q!=null&&(H=Q.signal)!==null&&H!==void 0&&H.aborted)throw new n(void 0,{cause:Q.signal.reason});_(K,ae)}return K}function Ce(Q,K){let H=be.call(this,Q,K);return(async function*(){for await(let ae of H)yield*ae}).call(this)}function q(Q){if(Q=k(Q),T(Q))return 0;if(Q<0)throw new e("number",">= 0",Q);return Q}function D(Q,K=void 0){return K!=null&&u(K,"options"),(K==null?void 0:K.signal)!=null&&t(K.signal,"options.signal"),Q=q(Q),(async function*(){var H;if(K!=null&&(H=K.signal)!==null&&H!==void 0&&H.aborted)throw new n;for await(let ie of this){var ae;if(K!=null&&(ae=K.signal)!==null&&ae!==void 0&&ae.aborted)throw new n;Q--<=0&&(yield ie)}}).call(this)}function ee(Q,K=void 0){return K!=null&&u(K,"options"),(K==null?void 0:K.signal)!=null&&t(K.signal,"options.signal"),Q=q(Q),(async function*(){var H;if(K!=null&&(H=K.signal)!==null&&H!==void 0&&H.aborted)throw new n;for await(let ie of this){var ae;if(K!=null&&(ae=K.signal)!==null&&ae!==void 0&&ae.aborted)throw new n;if(Q-- >0&&(yield ie),Q<=0)return}}).call(this)}h.exports.streamReturningOperators={asIndexedPairs:b(pe,"readable.asIndexedPairs will be removed in a future version."),drop:D,filter:x,flatMap:Ce,map:be,take:ee,compose:V},h.exports.promiseReturningOperators={every:ve,forEach:de,reduce:ge,toArray:F,some:me,find:z}}),zo=Ae((o,h)=>{ce(),fe(),he();var{ArrayPrototypePop:i,Promise:a}=qe(),{isIterable:l,isNodeStream:r,isWebStream:e}=Et(),{pipelineImpl:n}=fi(),{finished:t}=Mt();Go();function s(...u){return new a((d,p)=>{let m,A,y=u[u.length-1];if(y&&typeof y=="object"&&!r(y)&&!l(y)&&!e(y)){let w=i(u);m=w.signal,A=w.end}n(u,(w,C)=>{w?p(w):d(C)},{signal:m,end:A})})}h.exports={finished:t,pipeline:s}}),Go=Ae((o,h)=>{ce(),fe(),he();var{Buffer:i}=(Xe(),Le(Ze)),{ObjectDefineProperty:a,ObjectKeys:l,ReflectApply:r}=qe(),{promisify:{custom:e}}=at(),{streamReturningOperators:n,promiseReturningOperators:t}=Gl(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:s}}=ot(),u=$o(),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:p}=Sr(),{pipeline:m}=fi(),{destroyer:A}=nr(),y=Mt(),w=zo(),C=Et(),b=h.exports=ci().Stream;b.isDestroyed=C.isDestroyed,b.isDisturbed=C.isDisturbed,b.isErrored=C.isErrored,b.isReadable=C.isReadable,b.isWritable=C.isWritable,b.Readable=Cr();for(let N of l(n)){let M=function(...T){if(new.target)throw s();return b.Readable.from(r(k,this,T))},k=n[N];a(M,"name",{__proto__:null,value:k.name}),a(M,"length",{__proto__:null,value:k.length}),a(b.Readable.prototype,N,{__proto__:null,value:M,enumerable:!1,configurable:!0,writable:!0})}for(let N of l(t)){let M=function(...T){if(new.target)throw s();return r(k,this,T)},k=t[N];a(M,"name",{__proto__:null,value:k.name}),a(M,"length",{__proto__:null,value:k.length}),a(b.Readable.prototype,N,{__proto__:null,value:M,enumerable:!1,configurable:!0,writable:!0})}b.Writable=hi(),b.Duplex=St(),b.Transform=Ho(),b.PassThrough=qo(),b.pipeline=m;var{addAbortSignal:_}=Er();b.addAbortSignal=_,b.finished=y,b.destroy=A,b.compose=u,b.setDefaultHighWaterMark=d,b.getDefaultHighWaterMark=p,a(b,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return w}}),a(m,e,{__proto__:null,enumerable:!0,get(){return w.pipeline}}),a(y,e,{__proto__:null,enumerable:!0,get(){return w.finished}}),b.Stream=b,b._isUint8Array=function(N){return N instanceof Uint8Array},b._uint8ArrayToBuffer=function(N){return i.from(N.buffer,N.byteOffset,N.byteLength)}}),Ht=Ae((o,h)=>{ce(),fe(),he();var i=Go(),a=zo(),l=i.Readable.destroy;h.exports=i.Readable,h.exports._uint8ArrayToBuffer=i._uint8ArrayToBuffer,h.exports._isUint8Array=i._isUint8Array,h.exports.isDisturbed=i.isDisturbed,h.exports.isErrored=i.isErrored,h.exports.isReadable=i.isReadable,h.exports.Readable=i.Readable,h.exports.Writable=i.Writable,h.exports.Duplex=i.Duplex,h.exports.Transform=i.Transform,h.exports.PassThrough=i.PassThrough,h.exports.addAbortSignal=i.addAbortSignal,h.exports.finished=i.finished,h.exports.destroy=i.destroy,h.exports.destroy=l,h.exports.pipeline=i.pipeline,h.exports.compose=i.compose,Object.defineProperty(i,"promises",{configurable:!0,enumerable:!0,get(){return a}}),h.exports.Stream=i.Stream,h.exports.default=h.exports}),Yl=Ae((o,h)=>{ce(),fe(),he(),typeof Object.create=="function"?h.exports=function(i,a){a&&(i.super_=a,i.prototype=Object.create(a.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}))}:h.exports=function(i,a){if(a){i.super_=a;var l=function(){};l.prototype=a.prototype,i.prototype=new l,i.prototype.constructor=i}}}),Jl=Ae((o,h)=>{ce(),fe(),he();var{Buffer:i}=(Xe(),Le(Ze)),a=Symbol.for("BufferList");function l(r){if(!(this instanceof l))return new l(r);l._init.call(this,r)}l._init=function(r){Object.defineProperty(this,a,{value:!0}),this._bufs=[],this.length=0,r&&this.append(r)},l.prototype._new=function(r){return new l(r)},l.prototype._offset=function(r){if(r===0)return[0,0];let e=0;for(let n=0;n<this._bufs.length;n++){let t=e+this._bufs[n].length;if(r<t||n===this._bufs.length-1)return[n,r-e];e=t}},l.prototype._reverseOffset=function(r){let e=r[0],n=r[1];for(let t=0;t<e;t++)n+=this._bufs[t].length;return n},l.prototype.get=function(r){if(r>this.length||r<0)return;let e=this._offset(r);return this._bufs[e[0]][e[1]]},l.prototype.slice=function(r,e){return typeof r=="number"&&r<0&&(r+=this.length),typeof e=="number"&&e<0&&(e+=this.length),this.copy(null,0,r,e)},l.prototype.copy=function(r,e,n,t){if((typeof n!="number"||n<0)&&(n=0),(typeof t!="number"||t>this.length)&&(t=this.length),n>=this.length||t<=0)return r||i.alloc(0);let s=!!r,u=this._offset(n),d=t-n,p=d,m=s&&e||0,A=u[1];if(n===0&&t===this.length){if(!s)return this._bufs.length===1?this._bufs[0]:i.concat(this._bufs,this.length);for(let y=0;y<this._bufs.length;y++)this._bufs[y].copy(r,m),m+=this._bufs[y].length;return r}if(p<=this._bufs[u[0]].length-A)return s?this._bufs[u[0]].copy(r,e,A,A+p):this._bufs[u[0]].slice(A,A+p);s||(r=i.allocUnsafe(d));for(let y=u[0];y<this._bufs.length;y++){let w=this._bufs[y].length-A;if(p>w)this._bufs[y].copy(r,m,A),m+=w;else{this._bufs[y].copy(r,m,A,A+p),m+=w;break}p-=w,A&&(A=0)}return r.length>m?r.slice(0,m):r},l.prototype.shallowSlice=function(r,e){if(r=r||0,e=typeof e!="number"?this.length:e,r<0&&(r+=this.length),e<0&&(e+=this.length),r===e)return this._new();let n=this._offset(r),t=this._offset(e),s=this._bufs.slice(n[0],t[0]+1);return t[1]===0?s.pop():s[s.length-1]=s[s.length-1].slice(0,t[1]),n[1]!==0&&(s[0]=s[0].slice(n[1])),this._new(s)},l.prototype.toString=function(r,e,n){return this.slice(e,n).toString(r)},l.prototype.consume=function(r){if(r=Math.trunc(r),Number.isNaN(r)||r<=0)return this;for(;this._bufs.length;)if(r>=this._bufs[0].length)r-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(r),this.length-=r;break}return this},l.prototype.duplicate=function(){let r=this._new();for(let e=0;e<this._bufs.length;e++)r.append(this._bufs[e]);return r},l.prototype.append=function(r){if(r==null)return this;if(r.buffer)this._appendBuffer(i.from(r.buffer,r.byteOffset,r.byteLength));else if(Array.isArray(r))for(let e=0;e<r.length;e++)this.append(r[e]);else if(this._isBufferList(r))for(let e=0;e<r._bufs.length;e++)this.append(r._bufs[e]);else typeof r=="number"&&(r=r.toString()),this._appendBuffer(i.from(r));return this},l.prototype._appendBuffer=function(r){this._bufs.push(r),this.length+=r.length},l.prototype.indexOf=function(r,e,n){if(n===void 0&&typeof e=="string"&&(n=e,e=void 0),typeof r=="function"||Array.isArray(r))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof r=="number"?r=i.from([r]):typeof r=="string"?r=i.from(r,n):this._isBufferList(r)?r=r.slice():Array.isArray(r.buffer)?r=i.from(r.buffer,r.byteOffset,r.byteLength):i.isBuffer(r)||(r=i.from(r)),e=Number(e||0),isNaN(e)&&(e=0),e<0&&(e=this.length+e),e<0&&(e=0),r.length===0)return e>this.length?this.length:e;let t=this._offset(e),s=t[0],u=t[1];for(;s<this._bufs.length;s++){let d=this._bufs[s];for(;u<d.length;)if(d.length-u>=r.length){let p=d.indexOf(r,u);if(p!==-1)return this._reverseOffset([s,p]);u=d.length-r.length+1}else{let p=this._reverseOffset([s,u]);if(this._match(p,r))return p;u++}u=0}return-1},l.prototype._match=function(r,e){if(this.length-r<e.length)return!1;for(let n=0;n<e.length;n++)if(this.get(r+n)!==e[n])return!1;return!0},function(){let r={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readBigInt64BE:8,readBigInt64LE:8,readBigUInt64BE:8,readBigUInt64LE:8,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let e in r)(function(n){r[n]===null?l.prototype[n]=function(t,s){return this.slice(t,t+s)[n](0,s)}:l.prototype[n]=function(t=0){return this.slice(t,t+r[n])[n](0)}})(e)}(),l.prototype._isBufferList=function(r){return r instanceof l||l.isBufferList(r)},l.isBufferList=function(r){return r!=null&&r[a]},h.exports=l}),Zl=Ae((o,h)=>{ce(),fe(),he();var i=Ht().Duplex,a=Yl(),l=Jl();function r(e){if(!(this instanceof r))return new r(e);if(typeof e=="function"){this._callback=e;let n=(function(t){this._callback&&(this._callback(t),this._callback=null)}).bind(this);this.on("pipe",function(t){t.on("error",n)}),this.on("unpipe",function(t){t.removeListener("error",n)}),e=null}l._init.call(this,e),i.call(this)}a(r,i),Object.assign(r.prototype,l.prototype),r.prototype._new=function(e){return new r(e)},r.prototype._write=function(e,n,t){this._appendBuffer(e),typeof t=="function"&&t()},r.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e)},r.prototype.end=function(e){i.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)},r.prototype._destroy=function(e,n){this._bufs.length=0,this.length=0,n(e)},r.prototype._isBufferList=function(e){return e instanceof r||e instanceof l||r.isBufferList(e)},r.isBufferList=l.isBufferList,h.exports=r,h.exports.BufferListStream=r,h.exports.BufferList=l}),Xl=Ae((o,h)=>{ce(),fe(),he();var i=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}};h.exports=i}),Yo=Ae((o,h)=>{ce(),fe(),he();var i=h.exports,{Buffer:a}=(Xe(),Le(Ze));i.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},i.requiredHeaderFlags={1:0,2:0,4:0,5:0,6:2,7:0,8:2,9:0,10:2,11:0,12:0,13:0,14:0,15:0},i.requiredHeaderFlagsErrors={};for(let r in i.requiredHeaderFlags){let e=i.requiredHeaderFlags[r];i.requiredHeaderFlagsErrors[r]="Invalid header flag bits, must be 0x"+e.toString(16)+" for "+i.types[r]+" packet"}i.codes={};for(let r in i.types){let e=i.types[r];i.codes[e]=r}i.CMD_SHIFT=4,i.CMD_MASK=240,i.DUP_MASK=8,i.QOS_MASK=3,i.QOS_SHIFT=1,i.RETAIN_MASK=1,i.VARBYTEINT_MASK=127,i.VARBYTEINT_FIN_MASK=128,i.VARBYTEINT_MAX=268435455,i.SESSIONPRESENT_MASK=1,i.SESSIONPRESENT_HEADER=a.from([i.SESSIONPRESENT_MASK]),i.CONNACK_HEADER=a.from([i.codes.connack<<i.CMD_SHIFT]),i.USERNAME_MASK=128,i.PASSWORD_MASK=64,i.WILL_RETAIN_MASK=32,i.WILL_QOS_MASK=24,i.WILL_QOS_SHIFT=3,i.WILL_FLAG_MASK=4,i.CLEAN_SESSION_MASK=2,i.CONNECT_HEADER=a.from([i.codes.connect<<i.CMD_SHIFT]),i.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},i.propertiesCodes={};for(let r in i.properties){let e=i.properties[r];i.propertiesCodes[e]=r}i.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"};function l(r){return[0,1,2].map(e=>[0,1].map(n=>[0,1].map(t=>{let s=a.alloc(1);return s.writeUInt8(i.codes[r]<<i.CMD_SHIFT|(n?i.DUP_MASK:0)|e<<i.QOS_SHIFT|t,0,!0),s})))}i.PUBLISH_HEADER=l("publish"),i.SUBSCRIBE_HEADER=l("subscribe"),i.SUBSCRIBE_OPTIONS_QOS_MASK=3,i.SUBSCRIBE_OPTIONS_NL_MASK=1,i.SUBSCRIBE_OPTIONS_NL_SHIFT=2,i.SUBSCRIBE_OPTIONS_RAP_MASK=1,i.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,i.SUBSCRIBE_OPTIONS_RH_MASK=3,i.SUBSCRIBE_OPTIONS_RH_SHIFT=4,i.SUBSCRIBE_OPTIONS_RH=[0,16,32],i.SUBSCRIBE_OPTIONS_NL=4,i.SUBSCRIBE_OPTIONS_RAP=8,i.SUBSCRIBE_OPTIONS_QOS=[0,1,2],i.UNSUBSCRIBE_HEADER=l("unsubscribe"),i.ACKS={unsuback:l("unsuback"),puback:l("puback"),pubcomp:l("pubcomp"),pubrel:l("pubrel"),pubrec:l("pubrec")},i.SUBACK_HEADER=a.from([i.codes.suback<<i.CMD_SHIFT]),i.VERSION3=a.from([3]),i.VERSION4=a.from([4]),i.VERSION5=a.from([5]),i.VERSION131=a.from([131]),i.VERSION132=a.from([132]),i.QOS=[0,1,2].map(r=>a.from([r])),i.EMPTY={pingreq:a.from([i.codes.pingreq<<4,0]),pingresp:a.from([i.codes.pingresp<<4,0]),disconnect:a.from([i.codes.disconnect<<4,0])},i.MQTT5_PUBACK_PUBREC_CODES={0:"Success",16:"No matching subscribers",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",144:"Topic Name invalid",145:"Packet identifier in use",151:"Quota exceeded",153:"Payload format invalid"},i.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},i.MQTT5_SUBACK_CODES={0:"Granted QoS 0",1:"Granted QoS 1",2:"Granted QoS 2",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use",151:"Quota exceeded",158:"Shared Subscriptions not supported",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},i.MQTT5_UNSUBACK_CODES={0:"Success",17:"No subscription existed",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use"},i.MQTT5_DISCONNECT_CODES={0:"Normal disconnection",4:"Disconnect with Will Message",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",135:"Not authorized",137:"Server busy",139:"Server shutting down",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},i.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}}),eu=Ae((o,h)=>{ce(),fe(),he();var i=1e3,a=i*60,l=a*60,r=l*24,e=r*7,n=r*365.25;h.exports=function(p,m){m=m||{};var A=typeof p;if(A==="string"&&p.length>0)return t(p);if(A==="number"&&isFinite(p))return m.long?u(p):s(p);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))};function t(p){if(p=String(p),!(p.length>100)){var m=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(p);if(m){var A=parseFloat(m[1]),y=(m[2]||"ms").toLowerCase();switch(y){case"years":case"year":case"yrs":case"yr":case"y":return A*n;case"weeks":case"week":case"w":return A*e;case"days":case"day":case"d":return A*r;case"hours":case"hour":case"hrs":case"hr":case"h":return A*l;case"minutes":case"minute":case"mins":case"min":case"m":return A*a;case"seconds":case"second":case"secs":case"sec":case"s":return A*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return A;default:return}}}}function s(p){var m=Math.abs(p);return m>=r?Math.round(p/r)+"d":m>=l?Math.round(p/l)+"h":m>=a?Math.round(p/a)+"m":m>=i?Math.round(p/i)+"s":p+"ms"}function u(p){var m=Math.abs(p);return m>=r?d(p,m,r,"day"):m>=l?d(p,m,l,"hour"):m>=a?d(p,m,a,"minute"):m>=i?d(p,m,i,"second"):p+" ms"}function d(p,m,A,y){var w=m>=A*1.5;return Math.round(p/A)+" "+y+(w?"s":"")}}),tu=Ae((o,h)=>{ce(),fe(),he();function i(a){r.debug=r,r.default=r,r.coerce=d,r.disable=s,r.enable=n,r.enabled=u,r.humanize=eu(),r.destroy=p,Object.keys(a).forEach(m=>{r[m]=a[m]}),r.names=[],r.skips=[],r.formatters={};function l(m){let A=0;for(let y=0;y<m.length;y++)A=(A<<5)-A+m.charCodeAt(y),A|=0;return r.colors[Math.abs(A)%r.colors.length]}r.selectColor=l;function r(m){let A,y=null,w,C;function b(..._){if(!b.enabled)return;let N=b,M=Number(new Date),k=M-(A||M);N.diff=k,N.prev=A,N.curr=M,A=M,_[0]=r.coerce(_[0]),typeof _[0]!="string"&&_.unshift("%O");let T=0;_[0]=_[0].replace(/%([a-zA-Z%])/g,(U,J)=>{if(U==="%%")return"%";T++;let X=r.formatters[J];if(typeof X=="function"){let le=_[T];U=X.call(N,le),_.splice(T,1),T--}return U}),r.formatArgs.call(N,_),(N.log||r.log).apply(N,_)}return b.namespace=m,b.useColors=r.useColors(),b.color=r.selectColor(m),b.extend=e,b.destroy=r.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>y!==null?y:(w!==r.namespaces&&(w=r.namespaces,C=r.enabled(m)),C),set:_=>{y=_}}),typeof r.init=="function"&&r.init(b),b}function e(m,A){let y=r(this.namespace+(typeof A>"u"?":":A)+m);return y.log=this.log,y}function n(m){r.save(m),r.namespaces=m,r.names=[],r.skips=[];let A=(typeof m=="string"?m:"").trim().replace(" ",",").split(",").filter(Boolean);for(let y of A)y[0]==="-"?r.skips.push(y.slice(1)):r.names.push(y)}function t(m,A){let y=0,w=0,C=-1,b=0;for(;y<m.length;)if(w<A.length&&(A[w]===m[y]||A[w]==="*"))A[w]==="*"?(C=w,b=y,w++):(y++,w++);else if(C!==-1)w=C+1,b++,y=b;else return!1;for(;w<A.length&&A[w]==="*";)w++;return w===A.length}function s(){let m=[...r.names,...r.skips.map(A=>"-"+A)].join(",");return r.enable(""),m}function u(m){for(let A of r.skips)if(t(m,A))return!1;for(let A of r.names)if(t(m,A))return!0;return!1}function d(m){return m instanceof Error?m.stack||m.message:m}function p(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}h.exports=i}),Ct=Ae((o,h)=>{ce(),fe(),he(),o.formatArgs=a,o.save=l,o.load=r,o.useColors=i,o.storage=e(),o.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),o.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function i(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+h.exports.humanize(this.diff),!this.useColors)return;let s="color: "+this.color;t.splice(1,0,s,"color: inherit");let u=0,d=0;t[0].replace(/%[a-zA-Z%]/g,p=>{p!=="%%"&&(u++,p==="%c"&&(d=u))}),t.splice(d,0,s)}o.log=console.debug||console.log||(()=>{});function l(t){try{t?o.storage.setItem("debug",t):o.storage.removeItem("debug")}catch{}}function r(){let t;try{t=o.storage.getItem("debug")}catch{}return!t&&typeof De<"u"&&"env"in De&&(t=De.env.DEBUG),t}function e(){try{return localStorage}catch{}}h.exports=tu()(o);var{formatters:n}=h.exports;n.j=function(t){try{return JSON.stringify(t)}catch(s){return"[UnexpectedJSONParseError]: "+s.message}}}),ru=Ae((o,h)=>{ce(),fe(),he();var i=Zl(),{EventEmitter:a}=(Qt(),Le(Rt)),l=Xl(),r=Yo(),e=Ct()("mqtt-packet:parser"),n=class Ui extends a{constructor(){super(),this.parser=this.constructor.parser}static parser(s){return this instanceof Ui?(this.settings=s||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new Ui().parser(s)}_resetState(){e("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new l,this.error=null,this._list=i(),this._stateCounter=0}parse(s){for(this.error&&this._resetState(),this._list.append(s),e("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,e("parse: state complete. _stateCounter is now: %d",this._stateCounter),e("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return e("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let s=this._list.readUInt8(0),u=s>>r.CMD_SHIFT;this.packet.cmd=r.types[u];let d=s&15,p=r.requiredHeaderFlags[u];return p!=null&&d!==p?this._emitError(new Error(r.requiredHeaderFlagsErrors[u])):(this.packet.retain=(s&r.RETAIN_MASK)!==0,this.packet.qos=s>>r.QOS_SHIFT&r.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(s&r.DUP_MASK)!==0,e("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){let s=this._parseVarByteNum(!0);return s&&(this.packet.length=s.value,this._list.consume(s.bytes)),e("_parseLength %d",s.value),!!s}_parsePayload(){e("_parsePayload: payload %O",this._list);let s=!1;if(this.packet.length===0||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}s=!0}return e("_parsePayload complete result: %s",s),s}_parseConnect(){e("_parseConnect");let s,u,d,p,m={},A=this.packet,y=this._parseString();if(y===null)return this._emitError(new Error("Cannot parse protocolId"));if(y!=="MQTT"&&y!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(A.protocolId=y,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(A.protocolVersion=this._list.readUInt8(this._pos),A.protocolVersion>=128&&(A.bridgeMode=!0,A.protocolVersion=A.protocolVersion-128),A.protocolVersion!==3&&A.protocolVersion!==4&&A.protocolVersion!==5)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(this._list.readUInt8(this._pos)&1)return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));m.username=this._list.readUInt8(this._pos)&r.USERNAME_MASK,m.password=this._list.readUInt8(this._pos)&r.PASSWORD_MASK,m.will=this._list.readUInt8(this._pos)&r.WILL_FLAG_MASK;let w=!!(this._list.readUInt8(this._pos)&r.WILL_RETAIN_MASK),C=(this._list.readUInt8(this._pos)&r.WILL_QOS_MASK)>>r.WILL_QOS_SHIFT;if(m.will)A.will={},A.will.retain=w,A.will.qos=C;else{if(w)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(C)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(A.clean=(this._list.readUInt8(this._pos)&r.CLEAN_SESSION_MASK)!==0,this._pos++,A.keepalive=this._parseNum(),A.keepalive===-1)return this._emitError(new Error("Packet too short"));if(A.protocolVersion===5){let _=this._parseProperties();Object.getOwnPropertyNames(_).length&&(A.properties=_)}let b=this._parseString();if(b===null)return this._emitError(new Error("Packet too short"));if(A.clientId=b,e("_parseConnect: packet.clientId: %s",A.clientId),m.will){if(A.protocolVersion===5){let _=this._parseProperties();Object.getOwnPropertyNames(_).length&&(A.will.properties=_)}if(s=this._parseString(),s===null)return this._emitError(new Error("Cannot parse will topic"));if(A.will.topic=s,e("_parseConnect: packet.will.topic: %s",A.will.topic),u=this._parseBuffer(),u===null)return this._emitError(new Error("Cannot parse will payload"));A.will.payload=u,e("_parseConnect: packet.will.paylaod: %s",A.will.payload)}if(m.username){if(p=this._parseString(),p===null)return this._emitError(new Error("Cannot parse username"));A.username=p,e("_parseConnect: packet.username: %s",A.username)}if(m.password){if(d=this._parseBuffer(),d===null)return this._emitError(new Error("Cannot parse password"));A.password=d}return this.settings=A,e("_parseConnect: complete"),A}_parseConnack(){e("_parseConnack");let s=this.packet;if(this._list.length<1)return null;let u=this._list.readUInt8(this._pos++);if(u>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(s.sessionPresent=!!(u&r.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?s.reasonCode=this._list.readUInt8(this._pos++):s.reasonCode=0;else{if(this._list.length<2)return null;s.returnCode=this._list.readUInt8(this._pos++)}if(s.returnCode===-1||s.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){let d=this._parseProperties();Object.getOwnPropertyNames(d).length&&(s.properties=d)}e("_parseConnack: complete")}_parsePublish(){e("_parsePublish");let s=this.packet;if(s.topic=this._parseString(),s.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(s.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(s.properties=u)}s.payload=this._list.slice(this._pos,s.length),e("_parsePublish: payload from buffer list: %o",s.payload)}}_parseSubscribe(){e("_parseSubscribe");let s=this.packet,u,d,p,m,A,y,w;if(s.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let C=this._parseProperties();Object.getOwnPropertyNames(C).length&&(s.properties=C)}if(s.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<s.length;){if(u=this._parseString(),u===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=s.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(d=this._parseByte(),this.settings.protocolVersion===5){if(d&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(d&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(p=d&r.SUBSCRIBE_OPTIONS_QOS_MASK,p>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(y=(d>>r.SUBSCRIBE_OPTIONS_NL_SHIFT&r.SUBSCRIBE_OPTIONS_NL_MASK)!==0,A=(d>>r.SUBSCRIBE_OPTIONS_RAP_SHIFT&r.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,m=d>>r.SUBSCRIBE_OPTIONS_RH_SHIFT&r.SUBSCRIBE_OPTIONS_RH_MASK,m>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));w={topic:u,qos:p},this.settings.protocolVersion===5?(w.nl=y,w.rap=A,w.rh=m):this.settings.bridgeMode&&(w.rh=0,w.rap=!0,w.nl=!0),e("_parseSubscribe: push subscription `%s` to subscription",w),s.subscriptions.push(w)}}}_parseSuback(){e("_parseSuback");let s=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(s.properties=u)}if(s.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let u=this._list.readUInt8(this._pos++);if(this.settings.protocolVersion===5){if(!r.MQTT5_SUBACK_CODES[u])return this._emitError(new Error("Invalid suback code"))}else if(u>2&&u!==128)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(u)}}}_parseUnsubscribe(){e("_parseUnsubscribe");let s=this.packet;if(s.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(s.properties=u)}if(s.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<s.length;){let u=this._parseString();if(u===null)return this._emitError(new Error("Cannot parse topic"));e("_parseUnsubscribe: push topic `%s` to unsubscriptions",u),s.unsubscriptions.push(u)}}}_parseUnsuback(){e("_parseUnsuback");let s=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((this.settings.protocolVersion===3||this.settings.protocolVersion===4)&&s.length!==2)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(s.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(this.settings.protocolVersion===5){let u=this._parseProperties();for(Object.getOwnPropertyNames(u).length&&(s.properties=u),s.granted=[];this._pos<this.packet.length;){let d=this._list.readUInt8(this._pos++);if(!r.MQTT5_UNSUBACK_CODES[d])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(d)}}}_parseConfirmation(){e("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let s=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5){if(s.length>2){switch(s.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!r.MQTT5_PUBACK_PUBREC_CODES[s.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!r.MQTT5_PUBREL_PUBCOMP_CODES[s.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}e("_parseConfirmation: packet.reasonCode `%d`",s.reasonCode)}else s.reasonCode=0;if(s.length>3){let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(s.properties=u)}}return!0}_parseDisconnect(){let s=this.packet;if(e("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(s.reasonCode=this._parseByte(),r.MQTT5_DISCONNECT_CODES[s.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):s.reasonCode=0;let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(s.properties=u)}return e("_parseDisconnect result: true"),!0}_parseAuth(){e("_parseAuth");let s=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(s.reasonCode=this._parseByte(),!r.MQTT5_AUTH_CODES[s.reasonCode])return this._emitError(new Error("Invalid auth reason code"));let u=this._parseProperties();return Object.getOwnPropertyNames(u).length&&(s.properties=u),e("_parseAuth: result: true"),!0}_parseMessageId(){let s=this.packet;return s.messageId=this._parseNum(),s.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(e("_parseMessageId: packet.messageId %d",s.messageId),!0)}_parseString(s){let u=this._parseNum(),d=u+this._pos;if(u===-1||d>this._list.length||d>this.packet.length)return null;let p=this._list.toString("utf8",this._pos,d);return this._pos+=u,e("_parseString: result: %s",p),p}_parseStringPair(){return e("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let s=this._parseNum(),u=s+this._pos;if(s===-1||u>this._list.length||u>this.packet.length)return null;let d=this._list.slice(this._pos,u);return this._pos+=s,e("_parseBuffer: result: %o",d),d}_parseNum(){if(this._list.length-this._pos<2)return-1;let s=this._list.readUInt16BE(this._pos);return this._pos+=2,e("_parseNum: result: %s",s),s}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;let s=this._list.readUInt32BE(this._pos);return this._pos+=4,e("_parse4ByteNum: result: %s",s),s}_parseVarByteNum(s){e("_parseVarByteNum");let u=4,d=0,p=1,m=0,A=!1,y,w=this._pos?this._pos:0;for(;d<u&&w+d<this._list.length;){if(y=this._list.readUInt8(w+d++),m+=p*(y&r.VARBYTEINT_MASK),p*=128,(y&r.VARBYTEINT_FIN_MASK)===0){A=!0;break}if(this._list.length<=d)break}return!A&&d===u&&this._list.length>=d&&this._emitError(new Error("Invalid variable byte integer")),w&&(this._pos+=d),A?s?A={bytes:d,value:m}:A=m:A=!1,e("_parseVarByteNum: result: %o",A),A}_parseByte(){let s;return this._pos<this._list.length&&(s=this._list.readUInt8(this._pos),this._pos++),e("_parseByte: result: %o",s),s}_parseByType(s){switch(e("_parseByType: type: %s",s),s){case"byte":return this._parseByte()!==0;case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){e("_parseProperties");let s=this._parseVarByteNum(),u=this._pos+s,d={};for(;this._pos<u;){let p=this._parseByte();if(!p)return this._emitError(new Error("Cannot parse property code type")),!1;let m=r.propertiesCodes[p];if(!m)return this._emitError(new Error("Unknown property")),!1;if(m==="userProperties"){d[m]||(d[m]=Object.create(null));let A=this._parseByType(r.propertiesTypes[m]);if(d[m][A.name])if(Array.isArray(d[m][A.name]))d[m][A.name].push(A.value);else{let y=d[m][A.name];d[m][A.name]=[y],d[m][A.name].push(A.value)}else d[m][A.name]=A.value;continue}d[m]?Array.isArray(d[m])?d[m].push(this._parseByType(r.propertiesTypes[m])):(d[m]=[d[m]],d[m].push(this._parseByType(r.propertiesTypes[m]))):d[m]=this._parseByType(r.propertiesTypes[m])}return d}_newPacket(){return e("_newPacket"),this.packet&&(this._list.consume(this.packet.length),e("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),e("_newPacket: new packet"),this.packet=new l,this._pos=0,!0}_emitError(s){e("_emitError",s),this.error=s,this.emit("error",s)}};h.exports=n}),nu=Ae((o,h)=>{ce(),fe(),he();var{Buffer:i}=(Xe(),Le(Ze)),a=65536,l={},r=i.isBuffer(i.from([1,2]).subarray(0,1));function e(u){let d=i.allocUnsafe(2);return d.writeUInt8(u>>8,0),d.writeUInt8(u&255,1),d}function n(){for(let u=0;u<a;u++)l[u]=e(u)}function t(u){let d=0,p=0,m=i.allocUnsafe(4);do d=u%128|0,u=u/128|0,u>0&&(d=d|128),m.writeUInt8(d,p++);while(u>0&&p<4);return u>0&&(p=0),r?m.subarray(0,p):m.slice(0,p)}function s(u){let d=i.allocUnsafe(4);return d.writeUInt32BE(u,0),d}h.exports={cache:l,generateCache:n,generateNumber:e,genBufVariableByteInt:t,generate4ByteBuffer:s}}),iu=Ae((o,h)=>{ce(),fe(),he(),typeof De>"u"||!De.version||De.version.indexOf("v0.")===0||De.version.indexOf("v1.")===0&&De.version.indexOf("v1.8.")!==0?h.exports={nextTick:i}:h.exports=De;function i(a,l,r,e){if(typeof a!="function")throw new TypeError('"callback" argument must be a function');var n=arguments.length,t,s;switch(n){case 0:case 1:return De.nextTick(a);case 2:return De.nextTick(function(){a.call(null,l)});case 3:return De.nextTick(function(){a.call(null,l,r)});case 4:return De.nextTick(function(){a.call(null,l,r,e)});default:for(t=new Array(n-1),s=0;s<t.length;)t[s++]=arguments[s];return De.nextTick(function(){a.apply(null,t)})}}}),Jo=Ae((o,h)=>{ce(),fe(),he();var i=Yo(),{Buffer:a}=(Xe(),Le(Ze)),l=a.allocUnsafe(0),r=a.from([0]),e=nu(),n=iu().nextTick,t=Ct()("mqtt-packet:writeToStream"),s=e.cache,u=e.generateNumber,d=e.generateCache,p=e.genBufVariableByteInt,m=e.generate4ByteBuffer,A=pe,y=!0;function w(q,D,ee){switch(t("generate called"),D.cork&&(D.cork(),n(C,D)),y&&(y=!1,d()),t("generate: packet.cmd: %s",q.cmd),q.cmd){case"connect":return b(q,D);case"connack":return _(q,D,ee);case"publish":return N(q,D,ee);case"puback":case"pubrec":case"pubrel":case"pubcomp":return M(q,D,ee);case"subscribe":return k(q,D,ee);case"suback":return T(q,D,ee);case"unsubscribe":return U(q,D,ee);case"unsuback":return J(q,D,ee);case"pingreq":case"pingresp":return X(q,D);case"disconnect":return le(q,D,ee);case"auth":return P(q,D,ee);default:return D.destroy(new Error("Unknown command")),!1}}Object.defineProperty(w,"cacheNumbers",{get(){return A===pe},set(q){q?((!s||Object.keys(s).length===0)&&(y=!0),A=pe):(y=!1,A=me)}});function C(q){q.uncork()}function b(q,D,ee){let Q=q||{},K=Q.protocolId||"MQTT",H=Q.protocolVersion||4,ae=Q.will,ie=Q.clean,R=Q.keepalive||0,j=Q.clientId||"",Y=Q.username,oe=Q.password,re=Q.properties;ie===void 0&&(ie=!0);let ue=0;if(typeof K!="string"&&!a.isBuffer(K))return D.destroy(new Error("Invalid protocolId")),!1;if(ue+=K.length+2,H!==3&&H!==4&&H!==5)return D.destroy(new Error("Invalid protocol version")),!1;if(ue+=1,(typeof j=="string"||a.isBuffer(j))&&(j||H>=4)&&(j||ie))ue+=a.byteLength(j)+2;else{if(H<4)return D.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(ie*1===0)return D.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof R!="number"||R<0||R>65535||R%1!==0)return D.destroy(new Error("Invalid keepalive")),!1;ue+=2,ue+=1;let W,se;if(H===5){if(W=de(D,re),!W)return!1;ue+=W.length}if(ae){if(typeof ae!="object")return D.destroy(new Error("Invalid will")),!1;if(!ae.topic||typeof ae.topic!="string")return D.destroy(new Error("Invalid will topic")),!1;if(ue+=a.byteLength(ae.topic)+2,ue+=2,ae.payload)if(ae.payload.length>=0)typeof ae.payload=="string"?ue+=a.byteLength(ae.payload):ue+=ae.payload.length;else return D.destroy(new Error("Invalid will payload")),!1;if(se={},H===5){if(se=de(D,ae.properties),!se)return!1;ue+=se.length}}let we=!1;if(Y!=null)if(Ce(Y))we=!0,ue+=a.byteLength(Y)+2;else return D.destroy(new Error("Invalid username")),!1;if(oe!=null){if(!we)return D.destroy(new Error("Username is required to use password")),!1;if(Ce(oe))ue+=F(oe)+2;else return D.destroy(new Error("Invalid password")),!1}D.write(i.CONNECT_HEADER),Z(D,ue),z(D,K),Q.bridgeMode&&(H+=128),D.write(H===131?i.VERSION131:H===132?i.VERSION132:H===4?i.VERSION4:H===5?i.VERSION5:i.VERSION3);let te=0;return te|=Y!=null?i.USERNAME_MASK:0,te|=oe!=null?i.PASSWORD_MASK:0,te|=ae&&ae.retain?i.WILL_RETAIN_MASK:0,te|=ae&&ae.qos?ae.qos<<i.WILL_QOS_SHIFT:0,te|=ae?i.WILL_FLAG_MASK:0,te|=ie?i.CLEAN_SESSION_MASK:0,D.write(a.from([te])),A(D,R),H===5&&W.write(),z(D,j),ae&&(H===5&&se.write(),V(D,ae.topic),z(D,ae.payload)),Y!=null&&z(D,Y),oe!=null&&z(D,oe),!0}function _(q,D,ee){let Q=ee?ee.protocolVersion:4,K=q||{},H=Q===5?K.reasonCode:K.returnCode,ae=K.properties,ie=2;if(typeof H!="number")return D.destroy(new Error("Invalid return code")),!1;let R=null;if(Q===5){if(R=de(D,ae),!R)return!1;ie+=R.length}return D.write(i.CONNACK_HEADER),Z(D,ie),D.write(K.sessionPresent?i.SESSIONPRESENT_HEADER:r),D.write(a.from([H])),R==null||R.write(),!0}function N(q,D,ee){t("publish: packet: %o",q);let Q=ee?ee.protocolVersion:4,K=q||{},H=K.qos||0,ae=K.retain?i.RETAIN_MASK:0,ie=K.topic,R=K.payload||l,j=K.messageId,Y=K.properties,oe=0;if(typeof ie=="string")oe+=a.byteLength(ie)+2;else if(a.isBuffer(ie))oe+=ie.length+2;else return D.destroy(new Error("Invalid topic")),!1;if(a.isBuffer(R)?oe+=R.length:oe+=a.byteLength(R),H&&typeof j!="number")return D.destroy(new Error("Invalid messageId")),!1;H&&(oe+=2);let re=null;if(Q===5){if(re=de(D,Y),!re)return!1;oe+=re.length}return D.write(i.PUBLISH_HEADER[H][K.dup?1:0][ae?1:0]),Z(D,oe),A(D,F(ie)),D.write(ie),H>0&&A(D,j),re==null||re.write(),t("publish: payload: %o",R),D.write(R)}function M(q,D,ee){let Q=ee?ee.protocolVersion:4,K=q||{},H=K.cmd||"puback",ae=K.messageId,ie=K.dup&&H==="pubrel"?i.DUP_MASK:0,R=0,j=K.reasonCode,Y=K.properties,oe=Q===5?3:2;if(H==="pubrel"&&(R=1),typeof ae!="number")return D.destroy(new Error("Invalid messageId")),!1;let re=null;if(Q===5&&typeof Y=="object"){if(re=x(D,Y,ee,oe),!re)return!1;oe+=re.length}return D.write(i.ACKS[H][R][ie][0]),oe===3&&(oe+=j!==0?1:-1),Z(D,oe),A(D,ae),Q===5&&oe!==2&&D.write(a.from([j])),re!==null?re.write():oe===4&&D.write(a.from([0])),!0}function k(q,D,ee){t("subscribe: packet: ");let Q=ee?ee.protocolVersion:4,K=q||{},H=K.dup?i.DUP_MASK:0,ae=K.messageId,ie=K.subscriptions,R=K.properties,j=0;if(typeof ae!="number")return D.destroy(new Error("Invalid messageId")),!1;j+=2;let Y=null;if(Q===5){if(Y=de(D,R),!Y)return!1;j+=Y.length}if(typeof ie=="object"&&ie.length)for(let re=0;re<ie.length;re+=1){let ue=ie[re].topic,W=ie[re].qos;if(typeof ue!="string")return D.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof W!="number")return D.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(Q===5){if(typeof(ie[re].nl||!1)!="boolean")return D.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(ie[re].rap||!1)!="boolean")return D.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let se=ie[re].rh||0;if(typeof se!="number"||se>2)return D.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}j+=a.byteLength(ue)+2+1}else return D.destroy(new Error("Invalid subscriptions")),!1;t("subscribe: writing to stream: %o",i.SUBSCRIBE_HEADER),D.write(i.SUBSCRIBE_HEADER[1][H?1:0][0]),Z(D,j),A(D,ae),Y!==null&&Y.write();let oe=!0;for(let re of ie){let ue=re.topic,W=re.qos,se=+re.nl,we=+re.rap,te=re.rh,Pe;V(D,ue),Pe=i.SUBSCRIBE_OPTIONS_QOS[W],Q===5&&(Pe|=se?i.SUBSCRIBE_OPTIONS_NL:0,Pe|=we?i.SUBSCRIBE_OPTIONS_RAP:0,Pe|=te?i.SUBSCRIBE_OPTIONS_RH[te]:0),oe=D.write(a.from([Pe]))}return oe}function T(q,D,ee){let Q=ee?ee.protocolVersion:4,K=q||{},H=K.messageId,ae=K.granted,ie=K.properties,R=0;if(typeof H!="number")return D.destroy(new Error("Invalid messageId")),!1;if(R+=2,typeof ae=="object"&&ae.length)for(let Y=0;Y<ae.length;Y+=1){if(typeof ae[Y]!="number")return D.destroy(new Error("Invalid qos vector")),!1;R+=1}else return D.destroy(new Error("Invalid qos vector")),!1;let j=null;if(Q===5){if(j=x(D,ie,ee,R),!j)return!1;R+=j.length}return D.write(i.SUBACK_HEADER),Z(D,R),A(D,H),j!==null&&j.write(),D.write(a.from(ae))}function U(q,D,ee){let Q=ee?ee.protocolVersion:4,K=q||{},H=K.messageId,ae=K.dup?i.DUP_MASK:0,ie=K.unsubscriptions,R=K.properties,j=0;if(typeof H!="number")return D.destroy(new Error("Invalid messageId")),!1;if(j+=2,typeof ie=="object"&&ie.length)for(let re=0;re<ie.length;re+=1){if(typeof ie[re]!="string")return D.destroy(new Error("Invalid unsubscriptions")),!1;j+=a.byteLength(ie[re])+2}else return D.destroy(new Error("Invalid unsubscriptions")),!1;let Y=null;if(Q===5){if(Y=de(D,R),!Y)return!1;j+=Y.length}D.write(i.UNSUBSCRIBE_HEADER[1][ae?1:0][0]),Z(D,j),A(D,H),Y!==null&&Y.write();let oe=!0;for(let re=0;re<ie.length;re++)oe=V(D,ie[re]);return oe}function J(q,D,ee){let Q=ee?ee.protocolVersion:4,K=q||{},H=K.messageId,ae=K.dup?i.DUP_MASK:0,ie=K.granted,R=K.properties,j=K.cmd,Y=0,oe=2;if(typeof H!="number")return D.destroy(new Error("Invalid messageId")),!1;if(Q===5)if(typeof ie=="object"&&ie.length)for(let ue=0;ue<ie.length;ue+=1){if(typeof ie[ue]!="number")return D.destroy(new Error("Invalid qos vector")),!1;oe+=1}else return D.destroy(new Error("Invalid qos vector")),!1;let re=null;if(Q===5){if(re=x(D,R,ee,oe),!re)return!1;oe+=re.length}return D.write(i.ACKS[j][Y][ae][0]),Z(D,oe),A(D,H),re!==null&&re.write(),Q===5&&D.write(a.from(ie)),!0}function X(q,D,ee){return D.write(i.EMPTY[q.cmd])}function le(q,D,ee){let Q=ee?ee.protocolVersion:4,K=q||{},H=K.reasonCode,ae=K.properties,ie=Q===5?1:0,R=null;if(Q===5){if(R=x(D,ae,ee,ie),!R)return!1;ie+=R.length}return D.write(a.from([i.codes.disconnect<<4])),Z(D,ie),Q===5&&D.write(a.from([H])),R!==null&&R.write(),!0}function P(q,D,ee){let Q=ee?ee.protocolVersion:4,K=q||{},H=K.reasonCode,ae=K.properties,ie=Q===5?1:0;Q!==5&&D.destroy(new Error("Invalid mqtt version for auth packet"));let R=x(D,ae,ee,ie);return R?(ie+=R.length,D.write(a.from([i.codes.auth<<4])),Z(D,ie),D.write(a.from([H])),R!==null&&R.write(),!0):!1}var G={};function Z(q,D){if(D>i.VARBYTEINT_MAX)return q.destroy(new Error(`Invalid variable byte integer: ${D}`)),!1;let ee=G[D];return ee||(ee=p(D),D<16384&&(G[D]=ee)),t("writeVarByteInt: writing to stream: %o",ee),q.write(ee)}function V(q,D){let ee=a.byteLength(D);return A(q,ee),t("writeString: %s",D),q.write(D,"utf8")}function be(q,D,ee){V(q,D),V(q,ee)}function pe(q,D){return t("writeNumberCached: number: %d",D),t("writeNumberCached: %o",s[D]),q.write(s[D])}function me(q,D){let ee=u(D);return t("writeNumberGenerated: %o",ee),q.write(ee)}function ve(q,D){let ee=m(D);return t("write4ByteNumber: %o",ee),q.write(ee)}function z(q,D){typeof D=="string"?V(q,D):D?(A(q,D.length),q.write(D)):A(q,0)}function de(q,D){if(typeof D!="object"||D.length!=null)return{length:1,write(){ge(q,{},0)}};let ee=0;function Q(K,H){let ae=i.propertiesTypes[K],ie=0;switch(ae){case"byte":{if(typeof H!="boolean")return q.destroy(new Error(`Invalid ${K}: ${H}`)),!1;ie+=2;break}case"int8":{if(typeof H!="number"||H<0||H>255)return q.destroy(new Error(`Invalid ${K}: ${H}`)),!1;ie+=2;break}case"binary":{if(H&&H===null)return q.destroy(new Error(`Invalid ${K}: ${H}`)),!1;ie+=1+a.byteLength(H)+2;break}case"int16":{if(typeof H!="number"||H<0||H>65535)return q.destroy(new Error(`Invalid ${K}: ${H}`)),!1;ie+=3;break}case"int32":{if(typeof H!="number"||H<0||H>4294967295)return q.destroy(new Error(`Invalid ${K}: ${H}`)),!1;ie+=5;break}case"var":{if(typeof H!="number"||H<0||H>268435455)return q.destroy(new Error(`Invalid ${K}: ${H}`)),!1;ie+=1+a.byteLength(p(H));break}case"string":{if(typeof H!="string")return q.destroy(new Error(`Invalid ${K}: ${H}`)),!1;ie+=3+a.byteLength(H.toString());break}case"pair":{if(typeof H!="object")return q.destroy(new Error(`Invalid ${K}: ${H}`)),!1;ie+=Object.getOwnPropertyNames(H).reduce((R,j)=>{let Y=H[j];return Array.isArray(Y)?R+=Y.reduce((oe,re)=>(oe+=3+a.byteLength(j.toString())+2+a.byteLength(re.toString()),oe),0):R+=3+a.byteLength(j.toString())+2+a.byteLength(H[j].toString()),R},0);break}default:return q.destroy(new Error(`Invalid property ${K}: ${H}`)),!1}return ie}if(D)for(let K in D){let H=0,ae=0,ie=D[K];if(ie!==void 0){if(Array.isArray(ie))for(let R=0;R<ie.length;R++){if(ae=Q(K,ie[R]),!ae)return!1;H+=ae}else{if(ae=Q(K,ie),!ae)return!1;H=ae}if(!H)return!1;ee+=H}}return{length:a.byteLength(p(ee))+ee,write(){ge(q,D,ee)}}}function x(q,D,ee,Q){let K=["reasonString","userProperties"],H=ee&&ee.properties&&ee.properties.maximumPacketSize?ee.properties.maximumPacketSize:0,ae=de(q,D);if(H)for(;Q+ae.length>H;){let ie=K.shift();if(ie&&D[ie])delete D[ie],ae=de(q,D);else return!1}return ae}function ne(q,D,ee){switch(i.propertiesTypes[D]){case"byte":{q.write(a.from([i.properties[D]])),q.write(a.from([+ee]));break}case"int8":{q.write(a.from([i.properties[D]])),q.write(a.from([ee]));break}case"binary":{q.write(a.from([i.properties[D]])),z(q,ee);break}case"int16":{q.write(a.from([i.properties[D]])),A(q,ee);break}case"int32":{q.write(a.from([i.properties[D]])),ve(q,ee);break}case"var":{q.write(a.from([i.properties[D]])),Z(q,ee);break}case"string":{q.write(a.from([i.properties[D]])),V(q,ee);break}case"pair":{Object.getOwnPropertyNames(ee).forEach(Q=>{let K=ee[Q];Array.isArray(K)?K.forEach(H=>{q.write(a.from([i.properties[D]])),be(q,Q.toString(),H.toString())}):(q.write(a.from([i.properties[D]])),be(q,Q.toString(),K.toString()))});break}default:return q.destroy(new Error(`Invalid property ${D} value: ${ee}`)),!1}}function ge(q,D,ee){Z(q,ee);for(let Q in D)if(Object.prototype.hasOwnProperty.call(D,Q)&&D[Q]!=null){let K=D[Q];if(Array.isArray(K))for(let H=0;H<K.length;H++)ne(q,Q,K[H]);else ne(q,Q,K)}}function F(q){return q?q instanceof a?q.length:a.byteLength(q):0}function Ce(q){return typeof q=="string"||q instanceof a}h.exports=w}),ou=Ae((o,h)=>{ce(),fe(),he();var i=Jo(),{EventEmitter:a}=(Qt(),Le(Rt)),{Buffer:l}=(Xe(),Le(Ze));function r(n,t){let s=new e;return i(n,s,t),s.concat()}var e=class extends a{constructor(){super(),this._array=new Array(20),this._i=0}write(n){return this._array[this._i++]=n,!0}concat(){let n=0,t=new Array(this._array.length),s=this._array,u=0,d;for(d=0;d<s.length&&s[d]!==void 0;d++)typeof s[d]!="string"?t[d]=s[d].length:t[d]=l.byteLength(s[d]),n+=t[d];let p=l.allocUnsafe(n);for(d=0;d<s.length&&s[d]!==void 0;d++)typeof s[d]!="string"?(s[d].copy(p,u),u+=t[d]):(p.write(s[d],u),u+=t[d]);return p}destroy(n){n&&this.emit("error",n)}};h.exports=r}),su=Ae(o=>{ce(),fe(),he(),o.parser=ru().parser,o.generate=ou(),o.writeToStream=Jo()}),Zo=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"__esModule",{value:!0});var h=class{constructor(){this.nextId=Math.max(1,Math.floor(Math.random()*65535))}allocate(){let i=this.nextId++;return this.nextId===65536&&(this.nextId=1),i}getLastAllocated(){return this.nextId===1?65535:this.nextId-1}register(i){return!0}deallocate(i){}clear(){}};o.default=h}),au=Ae((o,h)=>{ce(),fe(),he(),h.exports=a;function i(r){return r instanceof vr?vr.from(r):new r.constructor(r.buffer.slice(),r.byteOffset,r.length)}function a(r){if(r=r||{},r.circles)return l(r);let e=new Map;if(e.set(Date,d=>new Date(d)),e.set(Map,(d,p)=>new Map(t(Array.from(d),p))),e.set(Set,(d,p)=>new Set(t(Array.from(d),p))),r.constructorHandlers)for(let d of r.constructorHandlers)e.set(d[0],d[1]);let n=null;return r.proto?u:s;function t(d,p){let m=Object.keys(d),A=new Array(m.length);for(let y=0;y<m.length;y++){let w=m[y],C=d[w];typeof C!="object"||C===null?A[w]=C:C.constructor!==Object&&(n=e.get(C.constructor))?A[w]=n(C,p):ArrayBuffer.isView(C)?A[w]=i(C):A[w]=p(C)}return A}function s(d){if(typeof d!="object"||d===null)return d;if(Array.isArray(d))return t(d,s);if(d.constructor!==Object&&(n=e.get(d.constructor)))return n(d,s);let p={};for(let m in d){if(Object.hasOwnProperty.call(d,m)===!1)continue;let A=d[m];typeof A!="object"||A===null?p[m]=A:A.constructor!==Object&&(n=e.get(A.constructor))?p[m]=n(A,s):ArrayBuffer.isView(A)?p[m]=i(A):p[m]=s(A)}return p}function u(d){if(typeof d!="object"||d===null)return d;if(Array.isArray(d))return t(d,u);if(d.constructor!==Object&&(n=e.get(d.constructor)))return n(d,u);let p={};for(let m in d){let A=d[m];typeof A!="object"||A===null?p[m]=A:A.constructor!==Object&&(n=e.get(A.constructor))?p[m]=n(A,u):ArrayBuffer.isView(A)?p[m]=i(A):p[m]=u(A)}return p}}function l(r){let e=[],n=[],t=new Map;if(t.set(Date,m=>new Date(m)),t.set(Map,(m,A)=>new Map(u(Array.from(m),A))),t.set(Set,(m,A)=>new Set(u(Array.from(m),A))),r.constructorHandlers)for(let m of r.constructorHandlers)t.set(m[0],m[1]);let s=null;return r.proto?p:d;function u(m,A){let y=Object.keys(m),w=new Array(y.length);for(let C=0;C<y.length;C++){let b=y[C],_=m[b];if(typeof _!="object"||_===null)w[b]=_;else if(_.constructor!==Object&&(s=t.get(_.constructor)))w[b]=s(_,A);else if(ArrayBuffer.isView(_))w[b]=i(_);else{let N=e.indexOf(_);N!==-1?w[b]=n[N]:w[b]=A(_)}}return w}function d(m){if(typeof m!="object"||m===null)return m;if(Array.isArray(m))return u(m,d);if(m.constructor!==Object&&(s=t.get(m.constructor)))return s(m,d);let A={};e.push(m),n.push(A);for(let y in m){if(Object.hasOwnProperty.call(m,y)===!1)continue;let w=m[y];if(typeof w!="object"||w===null)A[y]=w;else if(w.constructor!==Object&&(s=t.get(w.constructor)))A[y]=s(w,d);else if(ArrayBuffer.isView(w))A[y]=i(w);else{let C=e.indexOf(w);C!==-1?A[y]=n[C]:A[y]=d(w)}}return e.pop(),n.pop(),A}function p(m){if(typeof m!="object"||m===null)return m;if(Array.isArray(m))return u(m,p);if(m.constructor!==Object&&(s=t.get(m.constructor)))return s(m,p);let A={};e.push(m),n.push(A);for(let y in m){let w=m[y];if(typeof w!="object"||w===null)A[y]=w;else if(w.constructor!==Object&&(s=t.get(w.constructor)))A[y]=s(w,p);else if(ArrayBuffer.isView(w))A[y]=i(w);else{let C=e.indexOf(w);C!==-1?A[y]=n[C]:A[y]=p(w)}}return e.pop(),n.pop(),A}}}),lu=Ae((o,h)=>{ce(),fe(),he(),h.exports=au()()}),uu=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"__esModule",{value:!0}),o.validateTopic=h,o.validateTopics=i;function h(a){let l=a.split("/");for(let r=0;r<l.length;r++)if(l[r]!=="+"){if(l[r]==="#")return r===l.length-1;if(l[r].indexOf("+")!==-1||l[r].indexOf("#")!==-1)return!1}return!0}function i(a){if(a.length===0)return"empty_topic_list";for(let l=0;l<a.length;l++)if(!h(a[l]))return a[l];return null}}),Xo=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"__esModule",{value:!0});var h=Ht(),i={objectMode:!0},a={clean:!0},l=class{constructor(r){this.options=r||{},this.options=Object.assign(Object.assign({},a),r),this._inflights=new Map}put(r,e){return this._inflights.set(r.messageId,r),e&&e(),this}createStream(){let r=new h.Readable(i),e=[],n=!1,t=0;return this._inflights.forEach((s,u)=>{e.push(s)}),r._read=()=>{!n&&t<e.length?r.push(e[t++]):r.push(null)},r.destroy=s=>{if(!n)return n=!0,setTimeout(()=>{r.emit("close")},0),r},r}del(r,e){let n=this._inflights.get(r.messageId);return n?(this._inflights.delete(r.messageId),e(null,n)):e&&e(new Error("missing packet")),this}get(r,e){let n=this._inflights.get(r.messageId);return n?e(null,n):e&&e(new Error("missing packet")),this}close(r){this.options.clean&&(this._inflights=null),r&&r()}};o.default=l}),cu=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"__esModule",{value:!0});var h=[0,16,128,131,135,144,145,151,153],i=(a,l,r)=>{a.log("handlePublish: packet %o",l),r=typeof r<"u"?r:a.noop;let e=l.topic.toString(),n=l.payload,{qos:t}=l,{messageId:s}=l,{options:u}=a;if(a.options.protocolVersion===5){let d;if(l.properties&&(d=l.properties.topicAlias),typeof d<"u")if(e.length===0)if(d>0&&d<=65535){let p=a.topicAliasRecv.getTopicByAlias(d);if(p)e=p,a.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",e,d);else{a.log("handlePublish :: unregistered topic alias. alias: %d",d),a.emit("error",new Error("Received unregistered Topic Alias"));return}}else{a.log("handlePublish :: topic alias out of range. alias: %d",d),a.emit("error",new Error("Received Topic Alias is out of range"));return}else if(a.topicAliasRecv.put(e,d))a.log("handlePublish :: registered topic: %s - alias: %d",e,d);else{a.log("handlePublish :: topic alias out of range. alias: %d",d),a.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(a.log("handlePublish: qos %d",t),t){case 2:{u.customHandleAcks(e,n,l,(d,p)=>{if(typeof d=="number"&&(p=d,d=null),d)return a.emit("error",d);if(h.indexOf(p)===-1)return a.emit("error",new Error("Wrong reason code for pubrec"));p?a._sendPacket({cmd:"pubrec",messageId:s,reasonCode:p},r):a.incomingStore.put(l,()=>{a._sendPacket({cmd:"pubrec",messageId:s},r)})});break}case 1:{u.customHandleAcks(e,n,l,(d,p)=>{if(typeof d=="number"&&(p=d,d=null),d)return a.emit("error",d);if(h.indexOf(p)===-1)return a.emit("error",new Error("Wrong reason code for puback"));p||a.emit("message",e,n,l),a.handleMessage(l,m=>{if(m)return r&&r(m);a._sendPacket({cmd:"puback",messageId:s,reasonCode:p},r)})});break}case 0:a.emit("message",e,n,l),a.handleMessage(l,r);break;default:a.log("handlePublish: unknown QoS. Doing nothing.");break}};o.default=i}),hu=Ae((o,h)=>{h.exports={version:"5.13.1"}}),ir=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"__esModule",{value:!0}),o.MQTTJS_VERSION=o.nextTick=o.ErrorWithSubackPacket=o.ErrorWithReasonCode=void 0,o.applyMixin=a;var h=class ba extends Error{constructor(r,e){super(r),this.code=e,Object.setPrototypeOf(this,ba.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};o.ErrorWithReasonCode=h;var i=class wa extends Error{constructor(r,e){super(r),this.packet=e,Object.setPrototypeOf(this,wa.prototype),Object.getPrototypeOf(this).name="ErrorWithSubackPacket"}};o.ErrorWithSubackPacket=i;function a(l,r,e=!1){var n;let t=[r];for(;;){let s=t[0],u=Object.getPrototypeOf(s);if(u!=null&&u.prototype)t.unshift(u);else break}for(let s of t)for(let u of Object.getOwnPropertyNames(s.prototype))(e||u!=="constructor")&&Object.defineProperty(l.prototype,u,(n=Object.getOwnPropertyDescriptor(s.prototype,u))!==null&&n!==void 0?n:Object.create(null))}o.nextTick=typeof(De==null?void 0:De.nextTick)=="function"?De.nextTick:l=>{setTimeout(l,0)},o.MQTTJS_VERSION=hu().version}),kr=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"__esModule",{value:!0}),o.ReasonCodes=void 0;var h=ir();o.ReasonCodes={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};var i=(a,l)=>{let{messageId:r}=l,e=l.cmd,n=null,t=a.outgoing[r]?a.outgoing[r].cb:null,s=null;if(!t){a.log("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(a.log("_handleAck :: packet type",e),e){case"pubcomp":case"puback":{let u=l.reasonCode;u&&u>0&&u!==16?(s=new h.ErrorWithReasonCode(`Publish error: ${o.ReasonCodes[u]}`,u),a._removeOutgoingAndStoreMessage(r,()=>{t(s,l)})):a._removeOutgoingAndStoreMessage(r,t);break}case"pubrec":{n={cmd:"pubrel",qos:2,messageId:r};let u=l.reasonCode;u&&u>0&&u!==16?(s=new h.ErrorWithReasonCode(`Publish error: ${o.ReasonCodes[u]}`,u),a._removeOutgoingAndStoreMessage(r,()=>{t(s,l)})):a._sendPacket(n);break}case"suback":{delete a.outgoing[r],a.messageIdProvider.deallocate(r);let u=l.granted;for(let d=0;d<u.length;d++){let p=u[d];if((p&128)!==0){s=new Error(`Subscribe error: ${o.ReasonCodes[p]}`),s.code=p;let m=a.messageIdToTopic[r];m&&m.forEach(A=>{delete a._resubscribeTopics[A]})}}delete a.messageIdToTopic[r],a._invokeStoreProcessingQueue(),t(s,l);break}case"unsuback":{delete a.outgoing[r],a.messageIdProvider.deallocate(r),a._invokeStoreProcessingQueue(),t(null,l);break}default:a.emit("error",new Error("unrecognized packet type"))}a.disconnecting&&Object.keys(a.outgoing).length===0&&a.emit("outgoingEmpty")};o.default=i}),fu=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"__esModule",{value:!0});var h=ir(),i=kr(),a=(l,r)=>{let{options:e}=l,n=e.protocolVersion,t=n===5?r.reasonCode:r.returnCode;if(n!==5){let s=new h.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${n}`,t);l.emit("error",s);return}l.handleAuth(r,(s,u)=>{if(s){l.emit("error",s);return}if(t===24)l.reconnecting=!1,l._sendPacket(u);else{let d=new h.ErrorWithReasonCode(`Connection refused: ${i.ReasonCodes[t]}`,t);l.emit("error",d)}})};o.default=a}),du=Ae(o=>{var m,A,y,w,C,b,_,N,M,k,T,U,J,X,le,P,G,Z,V,be,pe,me,ve,z,de,x,ne,ge,F,Di,q,D,ee,Q,ya,H,ae,ie,Lt,Nt,Li,Fr,jr,We,Ni,gr,Ft,Fi,Pe;ce(),fe(),he(),Object.defineProperty(o,"__esModule",{value:!0}),o.LRUCache=void 0;var h=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,i=new Set,a=typeof De=="object"&&De?De:{},l=(c,f,g,v)=>{typeof a.emitWarning=="function"?a.emitWarning(c,f,g,v):console.error(`[${g}] ${f}: ${c}`)},r=globalThis.AbortController,e=globalThis.AbortSignal;if(typeof r>"u"){e=class{constructor(){He(this,"onabort");He(this,"_onabort",[]);He(this,"reason");He(this,"aborted",!1)}addEventListener(g,v){this._onabort.push(v)}},r=class{constructor(){He(this,"signal",new e);f()}abort(g){var v,I;if(!this.signal.aborted){this.signal.reason=g,this.signal.aborted=!0;for(let L of this.signal._onabort)L(g);(I=(v=this.signal).onabort)==null||I.call(v,g)}}};let c=((m=a.env)==null?void 0:m.LRU_CACHE_IGNORE_AC_WARNING)!=="1",f=()=>{c&&(c=!1,l("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",f))}}var n=c=>!i.has(c),t=c=>c&&c===Math.floor(c)&&c>0&&isFinite(c),s=c=>t(c)?c<=Math.pow(2,8)?Uint8Array:c<=Math.pow(2,16)?Uint16Array:c<=Math.pow(2,32)?Uint32Array:c<=Number.MAX_SAFE_INTEGER?u:null:null,u=class extends Array{constructor(c){super(c),this.fill(0)}},d=(A=class{constructor(f,g){He(this,"heap");He(this,"length");if(!B(A,y))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new g(f),this.length=0}static create(f){let g=s(f);if(!g)return[];Oe(A,y,!0);let v=new A(f,g);return Oe(A,y,!1),v}push(f){this.heap[this.length++]=f}pop(){return this.heap[--this.length]}},y=new WeakMap,Ue(A,y,!1),A),p=(Pe=class{constructor(f){Ue(this,F);Ue(this,b);Ue(this,_);Ue(this,N);Ue(this,M);Ue(this,k);Ue(this,T);He(this,"ttl");He(this,"ttlResolution");He(this,"ttlAutopurge");He(this,"updateAgeOnGet");He(this,"updateAgeOnHas");He(this,"allowStale");He(this,"noDisposeOnSet");He(this,"noUpdateTTL");He(this,"maxEntrySize");He(this,"sizeCalculation");He(this,"noDeleteOnFetchRejection");He(this,"noDeleteOnStaleGet");He(this,"allowStaleOnFetchAbort");He(this,"allowStaleOnFetchRejection");He(this,"ignoreFetchAbort");Ue(this,U);Ue(this,J);Ue(this,X);Ue(this,le);Ue(this,P);Ue(this,G);Ue(this,Z);Ue(this,V);Ue(this,be);Ue(this,pe);Ue(this,me);Ue(this,ve);Ue(this,z);Ue(this,de);Ue(this,x);Ue(this,ne);Ue(this,ge);Ue(this,q,()=>{});Ue(this,D,()=>{});Ue(this,ee,()=>{});Ue(this,Q,()=>!1);Ue(this,H,f=>{});Ue(this,ae,(f,g,v)=>{});Ue(this,ie,(f,g,v,I)=>{if(v||I)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});He(this,w,"LRUCache");let{max:g=0,ttl:v,ttlResolution:I=1,ttlAutopurge:L,updateAgeOnGet:$,updateAgeOnHas:_e,allowStale:Ee,dispose:Be,disposeAfter:Me,noDisposeOnSet:xe,noUpdateTTL:bt,maxSize:lt=0,maxEntrySize:ct=0,sizeCalculation:Ke,fetchMethod:et,memoMethod:Re,noDeleteOnFetchRejection:je,noDeleteOnStaleGet:rt,allowStaleOnFetchRejection:Je,allowStaleOnFetchAbort:st,ignoreFetchAbort:Dt}=f;if(g!==0&&!t(g))throw new TypeError("max option must be a nonnegative integer");let S=g?s(g):Array;if(!S)throw new Error("invalid max value: "+g);if(Oe(this,b,g),Oe(this,_,lt),this.maxEntrySize=ct||B(this,_),this.sizeCalculation=Ke,this.sizeCalculation){if(!B(this,_)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(Re!==void 0&&typeof Re!="function")throw new TypeError("memoMethod must be a function if defined");if(Oe(this,T,Re),et!==void 0&&typeof et!="function")throw new TypeError("fetchMethod must be a function if specified");if(Oe(this,k,et),Oe(this,ne,!!et),Oe(this,X,new Map),Oe(this,le,new Array(g).fill(void 0)),Oe(this,P,new Array(g).fill(void 0)),Oe(this,G,new S(g)),Oe(this,Z,new S(g)),Oe(this,V,0),Oe(this,be,0),Oe(this,pe,d.create(g)),Oe(this,U,0),Oe(this,J,0),typeof Be=="function"&&Oe(this,N,Be),typeof Me=="function"?(Oe(this,M,Me),Oe(this,me,[])):(Oe(this,M,void 0),Oe(this,me,void 0)),Oe(this,x,!!B(this,N)),Oe(this,ge,!!B(this,M)),this.noDisposeOnSet=!!xe,this.noUpdateTTL=!!bt,this.noDeleteOnFetchRejection=!!je,this.allowStaleOnFetchRejection=!!Je,this.allowStaleOnFetchAbort=!!st,this.ignoreFetchAbort=!!Dt,this.maxEntrySize!==0){if(B(this,_)!==0&&!t(B(this,_)))throw new TypeError("maxSize must be a positive integer if specified");if(!t(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");ke(this,F,ya).call(this)}if(this.allowStale=!!Ee,this.noDeleteOnStaleGet=!!rt,this.updateAgeOnGet=!!$,this.updateAgeOnHas=!!_e,this.ttlResolution=t(I)||I===0?I:1,this.ttlAutopurge=!!L,this.ttl=v||0,this.ttl){if(!t(this.ttl))throw new TypeError("ttl must be a positive integer if specified");ke(this,F,Di).call(this)}if(B(this,b)===0&&this.ttl===0&&B(this,_)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!B(this,b)&&!B(this,_)){let O="LRU_CACHE_UNBOUNDED";n(O)&&(i.add(O),l("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",O,Pe))}}static unsafeExposeInternals(f){return{starts:B(f,z),ttls:B(f,de),sizes:B(f,ve),keyMap:B(f,X),keyList:B(f,le),valList:B(f,P),next:B(f,G),prev:B(f,Z),get head(){return B(f,V)},get tail(){return B(f,be)},free:B(f,pe),isBackgroundFetch:g=>{var v;return ke(v=f,F,We).call(v,g)},backgroundFetch:(g,v,I,L)=>{var $;return ke($=f,F,jr).call($,g,v,I,L)},moveToTail:g=>{var v;return ke(v=f,F,gr).call(v,g)},indexes:g=>{var v;return ke(v=f,F,Lt).call(v,g)},rindexes:g=>{var v;return ke(v=f,F,Nt).call(v,g)},isStale:g=>{var v;return B(v=f,Q).call(v,g)}}}get max(){return B(this,b)}get maxSize(){return B(this,_)}get calculatedSize(){return B(this,J)}get size(){return B(this,U)}get fetchMethod(){return B(this,k)}get memoMethod(){return B(this,T)}get dispose(){return B(this,N)}get disposeAfter(){return B(this,M)}getRemainingTTL(f){return B(this,X).has(f)?1/0:0}*entries(){for(let f of ke(this,F,Lt).call(this))B(this,P)[f]!==void 0&&B(this,le)[f]!==void 0&&!ke(this,F,We).call(this,B(this,P)[f])&&(yield[B(this,le)[f],B(this,P)[f]])}*rentries(){for(let f of ke(this,F,Nt).call(this))B(this,P)[f]!==void 0&&B(this,le)[f]!==void 0&&!ke(this,F,We).call(this,B(this,P)[f])&&(yield[B(this,le)[f],B(this,P)[f]])}*keys(){for(let f of ke(this,F,Lt).call(this)){let g=B(this,le)[f];g!==void 0&&!ke(this,F,We).call(this,B(this,P)[f])&&(yield g)}}*rkeys(){for(let f of ke(this,F,Nt).call(this)){let g=B(this,le)[f];g!==void 0&&!ke(this,F,We).call(this,B(this,P)[f])&&(yield g)}}*values(){for(let f of ke(this,F,Lt).call(this))B(this,P)[f]!==void 0&&!ke(this,F,We).call(this,B(this,P)[f])&&(yield B(this,P)[f])}*rvalues(){for(let f of ke(this,F,Nt).call(this))B(this,P)[f]!==void 0&&!ke(this,F,We).call(this,B(this,P)[f])&&(yield B(this,P)[f])}[(C=Symbol.iterator,w=Symbol.toStringTag,C)](){return this.entries()}find(f,g={}){for(let v of ke(this,F,Lt).call(this)){let I=B(this,P)[v],L=ke(this,F,We).call(this,I)?I.__staleWhileFetching:I;if(L!==void 0&&f(L,B(this,le)[v],this))return this.get(B(this,le)[v],g)}}forEach(f,g=this){for(let v of ke(this,F,Lt).call(this)){let I=B(this,P)[v],L=ke(this,F,We).call(this,I)?I.__staleWhileFetching:I;L!==void 0&&f.call(g,L,B(this,le)[v],this)}}rforEach(f,g=this){for(let v of ke(this,F,Nt).call(this)){let I=B(this,P)[v],L=ke(this,F,We).call(this,I)?I.__staleWhileFetching:I;L!==void 0&&f.call(g,L,B(this,le)[v],this)}}purgeStale(){let f=!1;for(let g of ke(this,F,Nt).call(this,{allowStale:!0}))B(this,Q).call(this,g)&&(ke(this,F,Ft).call(this,B(this,le)[g],"expire"),f=!0);return f}info(f){let g=B(this,X).get(f);if(g===void 0)return;let v=B(this,P)[g],I=ke(this,F,We).call(this,v)?v.__staleWhileFetching:v;if(I===void 0)return;let L={value:I};if(B(this,de)&&B(this,z)){let $=B(this,de)[g],_e=B(this,z)[g];if($&&_e){let Ee=$-(h.now()-_e);L.ttl=Ee,L.start=Date.now()}}return B(this,ve)&&(L.size=B(this,ve)[g]),L}dump(){let f=[];for(let g of ke(this,F,Lt).call(this,{allowStale:!0})){let v=B(this,le)[g],I=B(this,P)[g],L=ke(this,F,We).call(this,I)?I.__staleWhileFetching:I;if(L===void 0||v===void 0)continue;let $={value:L};if(B(this,de)&&B(this,z)){$.ttl=B(this,de)[g];let _e=h.now()-B(this,z)[g];$.start=Math.floor(Date.now()-_e)}B(this,ve)&&($.size=B(this,ve)[g]),f.unshift([v,$])}return f}load(f){this.clear();for(let[g,v]of f){if(v.start){let I=Date.now()-v.start;v.start=h.now()-I}this.set(g,v.value,v)}}set(f,g,v={}){var bt,lt,ct,Ke,et;if(g===void 0)return this.delete(f),this;let{ttl:I=this.ttl,start:L,noDisposeOnSet:$=this.noDisposeOnSet,sizeCalculation:_e=this.sizeCalculation,status:Ee}=v,{noUpdateTTL:Be=this.noUpdateTTL}=v,Me=B(this,ie).call(this,f,g,v.size||0,_e);if(this.maxEntrySize&&Me>this.maxEntrySize)return Ee&&(Ee.set="miss",Ee.maxEntrySizeExceeded=!0),ke(this,F,Ft).call(this,f,"set"),this;let xe=B(this,U)===0?void 0:B(this,X).get(f);if(xe===void 0)xe=B(this,U)===0?B(this,be):B(this,pe).length!==0?B(this,pe).pop():B(this,U)===B(this,b)?ke(this,F,Fr).call(this,!1):B(this,U),B(this,le)[xe]=f,B(this,P)[xe]=g,B(this,X).set(f,xe),B(this,G)[B(this,be)]=xe,B(this,Z)[xe]=B(this,be),Oe(this,be,xe),Nr(this,U)._++,B(this,ae).call(this,xe,Me,Ee),Ee&&(Ee.set="add"),Be=!1;else{ke(this,F,gr).call(this,xe);let Re=B(this,P)[xe];if(g!==Re){if(B(this,ne)&&ke(this,F,We).call(this,Re)){Re.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:je}=Re;je!==void 0&&!$&&(B(this,x)&&((bt=B(this,N))==null||bt.call(this,je,f,"set")),B(this,ge)&&((lt=B(this,me))==null||lt.push([je,f,"set"])))}else $||(B(this,x)&&((ct=B(this,N))==null||ct.call(this,Re,f,"set")),B(this,ge)&&((Ke=B(this,me))==null||Ke.push([Re,f,"set"])));if(B(this,H).call(this,xe),B(this,ae).call(this,xe,Me,Ee),B(this,P)[xe]=g,Ee){Ee.set="replace";let je=Re&&ke(this,F,We).call(this,Re)?Re.__staleWhileFetching:Re;je!==void 0&&(Ee.oldValue=je)}}else Ee&&(Ee.set="update")}if(I!==0&&!B(this,de)&&ke(this,F,Di).call(this),B(this,de)&&(Be||B(this,ee).call(this,xe,I,L),Ee&&B(this,D).call(this,Ee,xe)),!$&&B(this,ge)&&B(this,me)){let Re=B(this,me),je;for(;je=Re==null?void 0:Re.shift();)(et=B(this,M))==null||et.call(this,...je)}return this}pop(){var f;try{for(;B(this,U);){let g=B(this,P)[B(this,V)];if(ke(this,F,Fr).call(this,!0),ke(this,F,We).call(this,g)){if(g.__staleWhileFetching)return g.__staleWhileFetching}else if(g!==void 0)return g}}finally{if(B(this,ge)&&B(this,me)){let g=B(this,me),v;for(;v=g==null?void 0:g.shift();)(f=B(this,M))==null||f.call(this,...v)}}}has(f,g={}){let{updateAgeOnHas:v=this.updateAgeOnHas,status:I}=g,L=B(this,X).get(f);if(L!==void 0){let $=B(this,P)[L];if(ke(this,F,We).call(this,$)&&$.__staleWhileFetching===void 0)return!1;if(B(this,Q).call(this,L))I&&(I.has="stale",B(this,D).call(this,I,L));else return v&&B(this,q).call(this,L),I&&(I.has="hit",B(this,D).call(this,I,L)),!0}else I&&(I.has="miss");return!1}peek(f,g={}){let{allowStale:v=this.allowStale}=g,I=B(this,X).get(f);if(I===void 0||!v&&B(this,Q).call(this,I))return;let L=B(this,P)[I];return ke(this,F,We).call(this,L)?L.__staleWhileFetching:L}async fetch(f,g={}){let{allowStale:v=this.allowStale,updateAgeOnGet:I=this.updateAgeOnGet,noDeleteOnStaleGet:L=this.noDeleteOnStaleGet,ttl:$=this.ttl,noDisposeOnSet:_e=this.noDisposeOnSet,size:Ee=0,sizeCalculation:Be=this.sizeCalculation,noUpdateTTL:Me=this.noUpdateTTL,noDeleteOnFetchRejection:xe=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:bt=this.allowStaleOnFetchRejection,ignoreFetchAbort:lt=this.ignoreFetchAbort,allowStaleOnFetchAbort:ct=this.allowStaleOnFetchAbort,context:Ke,forceRefresh:et=!1,status:Re,signal:je}=g;if(!B(this,ne))return Re&&(Re.fetch="get"),this.get(f,{allowStale:v,updateAgeOnGet:I,noDeleteOnStaleGet:L,status:Re});let rt={allowStale:v,updateAgeOnGet:I,noDeleteOnStaleGet:L,ttl:$,noDisposeOnSet:_e,size:Ee,sizeCalculation:Be,noUpdateTTL:Me,noDeleteOnFetchRejection:xe,allowStaleOnFetchRejection:bt,allowStaleOnFetchAbort:ct,ignoreFetchAbort:lt,status:Re,signal:je},Je=B(this,X).get(f);if(Je===void 0){Re&&(Re.fetch="miss");let st=ke(this,F,jr).call(this,f,Je,rt,Ke);return st.__returned=st}else{let st=B(this,P)[Je];if(ke(this,F,We).call(this,st)){let ye=v&&st.__staleWhileFetching!==void 0;return Re&&(Re.fetch="inflight",ye&&(Re.returnedStale=!0)),ye?st.__staleWhileFetching:st.__returned=st}let Dt=B(this,Q).call(this,Je);if(!et&&!Dt)return Re&&(Re.fetch="hit"),ke(this,F,gr).call(this,Je),I&&B(this,q).call(this,Je),Re&&B(this,D).call(this,Re,Je),st;let S=ke(this,F,jr).call(this,f,Je,rt,Ke),O=S.__staleWhileFetching!==void 0&&v;return Re&&(Re.fetch=Dt?"stale":"refresh",O&&Dt&&(Re.returnedStale=!0)),O?S.__staleWhileFetching:S.__returned=S}}async forceFetch(f,g={}){let v=await this.fetch(f,g);if(v===void 0)throw new Error("fetch() returned undefined");return v}memo(f,g={}){let v=B(this,T);if(!v)throw new Error("no memoMethod provided to constructor");let{context:I,forceRefresh:L,...$}=g,_e=this.get(f,$);if(!L&&_e!==void 0)return _e;let Ee=v(f,_e,{options:$,context:I});return this.set(f,Ee,$),Ee}get(f,g={}){let{allowStale:v=this.allowStale,updateAgeOnGet:I=this.updateAgeOnGet,noDeleteOnStaleGet:L=this.noDeleteOnStaleGet,status:$}=g,_e=B(this,X).get(f);if(_e!==void 0){let Ee=B(this,P)[_e],Be=ke(this,F,We).call(this,Ee);return $&&B(this,D).call(this,$,_e),B(this,Q).call(this,_e)?($&&($.get="stale"),Be?($&&v&&Ee.__staleWhileFetching!==void 0&&($.returnedStale=!0),v?Ee.__staleWhileFetching:void 0):(L||ke(this,F,Ft).call(this,f,"expire"),$&&v&&($.returnedStale=!0),v?Ee:void 0)):($&&($.get="hit"),Be?Ee.__staleWhileFetching:(ke(this,F,gr).call(this,_e),I&&B(this,q).call(this,_e),Ee))}else $&&($.get="miss")}delete(f){return ke(this,F,Ft).call(this,f,"delete")}clear(){return ke(this,F,Fi).call(this,"delete")}},b=new WeakMap,_=new WeakMap,N=new WeakMap,M=new WeakMap,k=new WeakMap,T=new WeakMap,U=new WeakMap,J=new WeakMap,X=new WeakMap,le=new WeakMap,P=new WeakMap,G=new WeakMap,Z=new WeakMap,V=new WeakMap,be=new WeakMap,pe=new WeakMap,me=new WeakMap,ve=new WeakMap,z=new WeakMap,de=new WeakMap,x=new WeakMap,ne=new WeakMap,ge=new WeakMap,F=new WeakSet,Di=function(){let f=new u(B(this,b)),g=new u(B(this,b));Oe(this,de,f),Oe(this,z,g),Oe(this,ee,(L,$,_e=h.now())=>{if(g[L]=$!==0?_e:0,f[L]=$,$!==0&&this.ttlAutopurge){let Ee=setTimeout(()=>{B(this,Q).call(this,L)&&ke(this,F,Ft).call(this,B(this,le)[L],"expire")},$+1);Ee.unref&&Ee.unref()}}),Oe(this,q,L=>{g[L]=f[L]!==0?h.now():0}),Oe(this,D,(L,$)=>{if(f[$]){let _e=f[$],Ee=g[$];if(!_e||!Ee)return;L.ttl=_e,L.start=Ee,L.now=v||I();let Be=L.now-Ee;L.remainingTTL=_e-Be}});let v=0,I=()=>{let L=h.now();if(this.ttlResolution>0){v=L;let $=setTimeout(()=>v=0,this.ttlResolution);$.unref&&$.unref()}return L};this.getRemainingTTL=L=>{let $=B(this,X).get(L);if($===void 0)return 0;let _e=f[$],Ee=g[$];if(!_e||!Ee)return 1/0;let Be=(v||I())-Ee;return _e-Be},Oe(this,Q,L=>{let $=g[L],_e=f[L];return!!_e&&!!$&&(v||I())-$>_e})},q=new WeakMap,D=new WeakMap,ee=new WeakMap,Q=new WeakMap,ya=function(){let f=new u(B(this,b));Oe(this,J,0),Oe(this,ve,f),Oe(this,H,g=>{Oe(this,J,B(this,J)-f[g]),f[g]=0}),Oe(this,ie,(g,v,I,L)=>{if(ke(this,F,We).call(this,v))return 0;if(!t(I))if(L){if(typeof L!="function")throw new TypeError("sizeCalculation must be a function");if(I=L(v,g),!t(I))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return I}),Oe(this,ae,(g,v,I)=>{if(f[g]=v,B(this,_)){let L=B(this,_)-f[g];for(;B(this,J)>L;)ke(this,F,Fr).call(this,!0)}Oe(this,J,B(this,J)+f[g]),I&&(I.entrySize=v,I.totalCalculatedSize=B(this,J))})},H=new WeakMap,ae=new WeakMap,ie=new WeakMap,Lt=function*({allowStale:f=this.allowStale}={}){if(B(this,U))for(let g=B(this,be);!(!ke(this,F,Li).call(this,g)||((f||!B(this,Q).call(this,g))&&(yield g),g===B(this,V)));)g=B(this,Z)[g]},Nt=function*({allowStale:f=this.allowStale}={}){if(B(this,U))for(let g=B(this,V);!(!ke(this,F,Li).call(this,g)||((f||!B(this,Q).call(this,g))&&(yield g),g===B(this,be)));)g=B(this,G)[g]},Li=function(f){return f!==void 0&&B(this,X).get(B(this,le)[f])===f},Fr=function(f){var L,$;let g=B(this,V),v=B(this,le)[g],I=B(this,P)[g];return B(this,ne)&&ke(this,F,We).call(this,I)?I.__abortController.abort(new Error("evicted")):(B(this,x)||B(this,ge))&&(B(this,x)&&((L=B(this,N))==null||L.call(this,I,v,"evict")),B(this,ge)&&(($=B(this,me))==null||$.push([I,v,"evict"]))),B(this,H).call(this,g),f&&(B(this,le)[g]=void 0,B(this,P)[g]=void 0,B(this,pe).push(g)),B(this,U)===1?(Oe(this,V,Oe(this,be,0)),B(this,pe).length=0):Oe(this,V,B(this,G)[g]),B(this,X).delete(v),Nr(this,U)._--,g},jr=function(f,g,v,I){let L=g===void 0?void 0:B(this,P)[g];if(ke(this,F,We).call(this,L))return L;let $=new r,{signal:_e}=v;_e==null||_e.addEventListener("abort",()=>$.abort(_e.reason),{signal:$.signal});let Ee={signal:$.signal,options:v,context:I},Be=(Ke,et=!1)=>{let{aborted:Re}=$.signal,je=v.ignoreFetchAbort&&Ke!==void 0;if(v.status&&(Re&&!et?(v.status.fetchAborted=!0,v.status.fetchError=$.signal.reason,je&&(v.status.fetchAbortIgnored=!0)):v.status.fetchResolved=!0),Re&&!je&&!et)return xe($.signal.reason);let rt=lt;return B(this,P)[g]===lt&&(Ke===void 0?rt.__staleWhileFetching?B(this,P)[g]=rt.__staleWhileFetching:ke(this,F,Ft).call(this,f,"fetch"):(v.status&&(v.status.fetchUpdated=!0),this.set(f,Ke,Ee.options))),Ke},Me=Ke=>(v.status&&(v.status.fetchRejected=!0,v.status.fetchError=Ke),xe(Ke)),xe=Ke=>{let{aborted:et}=$.signal,Re=et&&v.allowStaleOnFetchAbort,je=Re||v.allowStaleOnFetchRejection,rt=je||v.noDeleteOnFetchRejection,Je=lt;if(B(this,P)[g]===lt&&(!rt||Je.__staleWhileFetching===void 0?ke(this,F,Ft).call(this,f,"fetch"):Re||(B(this,P)[g]=Je.__staleWhileFetching)),je)return v.status&&Je.__staleWhileFetching!==void 0&&(v.status.returnedStale=!0),Je.__staleWhileFetching;if(Je.__returned===Je)throw Ke},bt=(Ke,et)=>{var je;let Re=(je=B(this,k))==null?void 0:je.call(this,f,L,Ee);Re&&Re instanceof Promise&&Re.then(rt=>Ke(rt===void 0?void 0:rt),et),$.signal.addEventListener("abort",()=>{(!v.ignoreFetchAbort||v.allowStaleOnFetchAbort)&&(Ke(void 0),v.allowStaleOnFetchAbort&&(Ke=rt=>Be(rt,!0)))})};v.status&&(v.status.fetchDispatched=!0);let lt=new Promise(bt).then(Be,Me),ct=Object.assign(lt,{__abortController:$,__staleWhileFetching:L,__returned:void 0});return g===void 0?(this.set(f,ct,{...Ee.options,status:void 0}),g=B(this,X).get(f)):B(this,P)[g]=ct,ct},We=function(f){if(!B(this,ne))return!1;let g=f;return!!g&&g instanceof Promise&&g.hasOwnProperty("__staleWhileFetching")&&g.__abortController instanceof r},Ni=function(f,g){B(this,Z)[g]=f,B(this,G)[f]=g},gr=function(f){f!==B(this,be)&&(f===B(this,V)?Oe(this,V,B(this,G)[f]):ke(this,F,Ni).call(this,B(this,Z)[f],B(this,G)[f]),ke(this,F,Ni).call(this,B(this,be),f),Oe(this,be,f))},Ft=function(f,g){var I,L,$,_e;let v=!1;if(B(this,U)!==0){let Ee=B(this,X).get(f);if(Ee!==void 0)if(v=!0,B(this,U)===1)ke(this,F,Fi).call(this,g);else{B(this,H).call(this,Ee);let Be=B(this,P)[Ee];if(ke(this,F,We).call(this,Be)?Be.__abortController.abort(new Error("deleted")):(B(this,x)||B(this,ge))&&(B(this,x)&&((I=B(this,N))==null||I.call(this,Be,f,g)),B(this,ge)&&((L=B(this,me))==null||L.push([Be,f,g]))),B(this,X).delete(f),B(this,le)[Ee]=void 0,B(this,P)[Ee]=void 0,Ee===B(this,be))Oe(this,be,B(this,Z)[Ee]);else if(Ee===B(this,V))Oe(this,V,B(this,G)[Ee]);else{let Me=B(this,Z)[Ee];B(this,G)[Me]=B(this,G)[Ee];let xe=B(this,G)[Ee];B(this,Z)[xe]=B(this,Z)[Ee]}Nr(this,U)._--,B(this,pe).push(Ee)}}if(B(this,ge)&&(($=B(this,me))!=null&&$.length)){let Ee=B(this,me),Be;for(;Be=Ee==null?void 0:Ee.shift();)(_e=B(this,M))==null||_e.call(this,...Be)}return v},Fi=function(f){var g,v,I;for(let L of ke(this,F,Nt).call(this,{allowStale:!0})){let $=B(this,P)[L];if(ke(this,F,We).call(this,$))$.__abortController.abort(new Error("deleted"));else{let _e=B(this,le)[L];B(this,x)&&((g=B(this,N))==null||g.call(this,$,_e,f)),B(this,ge)&&((v=B(this,me))==null||v.push([$,_e,f]))}}if(B(this,X).clear(),B(this,P).fill(void 0),B(this,le).fill(void 0),B(this,de)&&B(this,z)&&(B(this,de).fill(0),B(this,z).fill(0)),B(this,ve)&&B(this,ve).fill(0),Oe(this,V,0),Oe(this,be,0),B(this,pe).length=0,Oe(this,J,0),Oe(this,U,0),B(this,ge)&&B(this,me)){let L=B(this,me),$;for(;$=L==null?void 0:L.shift();)(I=B(this,M))==null||I.call(this,...$)}},Pe);o.LRUCache=p}),kt=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"t",{value:!0}),o.ContainerIterator=o.Container=o.Base=void 0;var h=class{constructor(l=0){this.iteratorType=l}equals(l){return this.o===l.o}};o.ContainerIterator=h;var i=class{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return this.i===0}};o.Base=i;var a=class extends i{};o.Container=a}),pu=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var h=kt(),i=class extends h.Base{constructor(l=[]){super(),this.S=[];let r=this;l.forEach(function(e){r.push(e)})}clear(){this.i=0,this.S=[]}push(l){return this.S.push(l),this.i+=1,this.i}pop(){if(this.i!==0)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}},a=i;o.default=a}),gu=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var h=kt(),i=class extends h.Base{constructor(l=[]){super(),this.j=0,this.q=[];let r=this;l.forEach(function(e){r.push(e)})}clear(){this.q=[],this.i=this.j=0}push(l){let r=this.q.length;if(this.j/r>.5&&this.j+this.i>=r&&r>4096){let e=this.i;for(let n=0;n<e;++n)this.q[n]=this.q[this.j+n];this.j=0,this.q[this.i]=l}else this.q[this.j+this.i]=l;return++this.i}pop(){if(this.i===0)return;let l=this.q[this.j++];return this.i-=1,l}front(){if(this.i!==0)return this.q[this.j]}},a=i;o.default=a}),mu=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var h=kt(),i=class extends h.Base{constructor(l=[],r=function(n,t){return n>t?-1:n<t?1:0},e=!0){if(super(),this.v=r,Array.isArray(l))this.C=e?[...l]:l;else{this.C=[];let t=this;l.forEach(function(s){t.C.push(s)})}this.i=this.C.length;let n=this.i>>1;for(let t=this.i-1>>1;t>=0;--t)this.k(t,n)}m(l){let r=this.C[l];for(;l>0;){let e=l-1>>1,n=this.C[e];if(this.v(n,r)<=0)break;this.C[l]=n,l=e}this.C[l]=r}k(l,r){let e=this.C[l];for(;l<r;){let n=l<<1|1,t=n+1,s=this.C[n];if(t<this.i&&this.v(s,this.C[t])>0&&(n=t,s=this.C[t]),this.v(s,e)>=0)break;this.C[l]=s,l=n}this.C[l]=e}clear(){this.i=0,this.C.length=0}push(l){this.C.push(l),this.m(this.i),this.i+=1}pop(){if(this.i===0)return;let l=this.C[0],r=this.C.pop();return this.i-=1,this.i&&(this.C[0]=r,this.k(0,this.i>>1)),l}top(){return this.C[0]}find(l){return this.C.indexOf(l)>=0}remove(l){let r=this.C.indexOf(l);return r<0?!1:(r===0?this.pop():r===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(r,1,this.C.pop()),this.i-=1,this.m(r),this.k(r,this.i>>1)),!0)}updateItem(l){let r=this.C.indexOf(l);return r<0?!1:(this.m(r),this.k(r,this.i>>1),!0)}toArray(){return[...this.C]}},a=i;o.default=a}),di=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var h=kt(),i=class extends h.Container{},a=i;o.default=a}),It=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"t",{value:!0}),o.throwIteratorAccessError=h;function h(){throw new RangeError("Iterator access denied!")}}),es=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"t",{value:!0}),o.RandomIterator=void 0;var h=kt(),i=It(),a=class extends h.ContainerIterator{constructor(l,r){super(r),this.o=l,this.iteratorType===0?(this.pre=function(){return this.o===0&&(0,i.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,i.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,i.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return this.o===-1&&(0,i.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(l){this.container.setElementByPos(this.o,l)}};o.RandomIterator=a}),Au=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var h=a(di()),i=es();function a(n){return n&&n.t?n:{default:n}}var l=class va extends i.RandomIterator{constructor(t,s,u){super(t,u),this.container=s}copy(){return new va(this.o,this.container,this.iteratorType)}},r=class extends h.default{constructor(n=[],t=!0){if(super(),Array.isArray(n))this.J=t?[...n]:n,this.i=n.length;else{this.J=[];let s=this;n.forEach(function(u){s.pushBack(u)})}}clear(){this.i=0,this.J.length=0}begin(){return new l(0,this)}end(){return new l(this.i,this)}rBegin(){return new l(this.i-1,this,1)}rEnd(){return new l(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;return this.J[n]}eraseElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;return this.J.splice(n,1),this.i-=1,this.i}eraseElementByValue(n){let t=0;for(let s=0;s<this.i;++s)this.J[s]!==n&&(this.J[t++]=this.J[s]);return this.i=this.J.length=t,this.i}eraseElementByIterator(n){let t=n.o;return n=n.next(),this.eraseElementByPos(t),n}pushBack(n){return this.J.push(n),this.i+=1,this.i}popBack(){if(this.i!==0)return this.i-=1,this.J.pop()}setElementByPos(n,t){if(n<0||n>this.i-1)throw new RangeError;this.J[n]=t}insert(n,t,s=1){if(n<0||n>this.i)throw new RangeError;return this.J.splice(n,0,...new Array(s).fill(t)),this.i+=s,this.i}find(n){for(let t=0;t<this.i;++t)if(this.J[t]===n)return new l(t,this);return this.end()}reverse(){this.J.reverse()}unique(){let n=1;for(let t=1;t<this.i;++t)this.J[t]!==this.J[t-1]&&(this.J[n++]=this.J[t]);return this.i=this.J.length=n,this.i}sort(n){this.J.sort(n)}forEach(n){for(let t=0;t<this.i;++t)n(this.J[t],t,this)}[Symbol.iterator](){return(function*(){yield*this.J}).bind(this)()}},e=r;o.default=e}),bu=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var h=l(di()),i=kt(),a=It();function l(t){return t&&t.t?t:{default:t}}var r=class _a extends i.ContainerIterator{constructor(s,u,d,p){super(p),this.o=s,this.h=u,this.container=d,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o.l}set pointer(s){this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o.l=s}copy(){return new _a(this.o,this.h,this.container,this.iteratorType)}},e=class extends h.default{constructor(t=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;let s=this;t.forEach(function(u){s.pushBack(u)})}V(t){let{L:s,B:u}=t;s.B=u,u.L=s,t===this.p&&(this.p=u),t===this._&&(this._=s),this.i-=1}G(t,s){let u=s.B,d={l:t,L:s,B:u};s.B=d,u.L=d,s===this.h&&(this.p=d),u===this.h&&(this._=d),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}begin(){return new r(this.p,this.h,this)}end(){return new r(this.h,this.h,this)}rBegin(){return new r(this._,this.h,this,1)}rEnd(){return new r(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(t){if(t<0||t>this.i-1)throw new RangeError;let s=this.p;for(;t--;)s=s.B;return s.l}eraseElementByPos(t){if(t<0||t>this.i-1)throw new RangeError;let s=this.p;for(;t--;)s=s.B;return this.V(s),this.i}eraseElementByValue(t){let s=this.p;for(;s!==this.h;)s.l===t&&this.V(s),s=s.B;return this.i}eraseElementByIterator(t){let s=t.o;return s===this.h&&(0,a.throwIteratorAccessError)(),t=t.next(),this.V(s),t}pushBack(t){return this.G(t,this._),this.i}popBack(){if(this.i===0)return;let t=this._.l;return this.V(this._),t}pushFront(t){return this.G(t,this.h),this.i}popFront(){if(this.i===0)return;let t=this.p.l;return this.V(this.p),t}setElementByPos(t,s){if(t<0||t>this.i-1)throw new RangeError;let u=this.p;for(;t--;)u=u.B;u.l=s}insert(t,s,u=1){if(t<0||t>this.i)throw new RangeError;if(u<=0)return this.i;if(t===0)for(;u--;)this.pushFront(s);else if(t===this.i)for(;u--;)this.pushBack(s);else{let d=this.p;for(let m=1;m<t;++m)d=d.B;let p=d.B;for(this.i+=u;u--;)d.B={l:s,L:d},d.B.L=d,d=d.B;d.B=p,p.L=d}return this.i}find(t){let s=this.p;for(;s!==this.h;){if(s.l===t)return new r(s,this.h,this);s=s.B}return this.end()}reverse(){if(this.i<=1)return;let t=this.p,s=this._,u=0;for(;u<<1<this.i;){let d=t.l;t.l=s.l,s.l=d,t=t.B,s=s.L,u+=1}}unique(){if(this.i<=1)return this.i;let t=this.p;for(;t!==this.h;){let s=t;for(;s.B!==this.h&&s.l===s.B.l;)s=s.B,this.i-=1;t.B=s.B,t.B.L=t,t=t.B}return this.i}sort(t){if(this.i<=1)return;let s=[];this.forEach(function(d){s.push(d)}),s.sort(t);let u=this.p;s.forEach(function(d){u.l=d,u=u.B})}merge(t){let s=this;if(this.i===0)t.forEach(function(u){s.pushBack(u)});else{let u=this.p;t.forEach(function(d){for(;u!==s.h&&u.l<=d;)u=u.B;s.G(d,u.L)})}return this.i}forEach(t){let s=this.p,u=0;for(;s!==this.h;)t(s.l,u++,this),s=s.B}[Symbol.iterator](){return(function*(){if(this.i===0)return;let t=this.p;for(;t!==this.h;)yield t.l,t=t.B}).bind(this)()}},n=e;o.default=n}),wu=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var h=a(di()),i=es();function a(n){return n&&n.t?n:{default:n}}var l=class Ea extends i.RandomIterator{constructor(t,s,u){super(t,u),this.container=s}copy(){return new Ea(this.o,this.container,this.iteratorType)}},r=class extends h.default{constructor(n=[],t=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];let s=(()=>{if(typeof n.length=="number")return n.length;if(typeof n.size=="number")return n.size;if(typeof n.size=="function")return n.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=t,this.P=Math.max(Math.ceil(s/this.F),1);for(let p=0;p<this.P;++p)this.A.push(new Array(this.F));let u=Math.ceil(s/this.F);this.j=this.R=(this.P>>1)-(u>>1),this.D=this.N=this.F-s%this.F>>1;let d=this;n.forEach(function(p){d.pushBack(p)})}T(){let n=[],t=Math.max(this.P>>1,1);for(let s=0;s<t;++s)n[s]=new Array(this.F);for(let s=this.j;s<this.P;++s)n[n.length]=this.A[s];for(let s=0;s<this.R;++s)n[n.length]=this.A[s];n[n.length]=[...this.A[this.R]],this.j=t,this.R=n.length-1;for(let s=0;s<t;++s)n[n.length]=new Array(this.F);this.A=n,this.P=n.length}O(n){let t=this.D+n+1,s=t%this.F,u=s-1,d=this.j+(t-s)/this.F;return s===0&&(d-=1),d%=this.P,u<0&&(u+=this.F),{curNodeBucketIndex:d,curNodePointerIndex:u}}clear(){this.A=[new Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1}begin(){return new l(0,this)}end(){return new l(this.i,this)}rBegin(){return new l(this.i-1,this,1)}rEnd(){return new l(-1,this,1)}front(){if(this.i!==0)return this.A[this.j][this.D]}back(){if(this.i!==0)return this.A[this.R][this.N]}pushBack(n){return this.i&&(this.N<this.F-1?this.N+=1:this.R<this.P-1?(this.R+=1,this.N=0):(this.R=0,this.N=0),this.R===this.j&&this.N===this.D&&this.T()),this.i+=1,this.A[this.R][this.N]=n,this.i}popBack(){if(this.i===0)return;let n=this.A[this.R][this.N];return this.i!==1&&(this.N>0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,n}pushFront(n){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=n,this.i}popFront(){if(this.i===0)return;let n=this.A[this.j][this.D];return this.i!==1&&(this.D<this.F-1?this.D+=1:this.j<this.P-1?(this.j+=1,this.D=0):(this.j=0,this.D=0)),this.i-=1,n}getElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;let{curNodeBucketIndex:t,curNodePointerIndex:s}=this.O(n);return this.A[t][s]}setElementByPos(n,t){if(n<0||n>this.i-1)throw new RangeError;let{curNodeBucketIndex:s,curNodePointerIndex:u}=this.O(n);this.A[s][u]=t}insert(n,t,s=1){if(n<0||n>this.i)throw new RangeError;if(n===0)for(;s--;)this.pushFront(t);else if(n===this.i)for(;s--;)this.pushBack(t);else{let u=[];for(let d=n;d<this.i;++d)u.push(this.getElementByPos(d));this.cut(n-1);for(let d=0;d<s;++d)this.pushBack(t);for(let d=0;d<u.length;++d)this.pushBack(u[d])}return this.i}cut(n){if(n<0)return this.clear(),0;let{curNodeBucketIndex:t,curNodePointerIndex:s}=this.O(n);return this.R=t,this.N=s,this.i=n+1,this.i}eraseElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;if(n===0)this.popFront();else if(n===this.i-1)this.popBack();else{let t=[];for(let u=n+1;u<this.i;++u)t.push(this.getElementByPos(u));this.cut(n),this.popBack();let s=this;t.forEach(function(u){s.pushBack(u)})}return this.i}eraseElementByValue(n){if(this.i===0)return 0;let t=[];for(let u=0;u<this.i;++u){let d=this.getElementByPos(u);d!==n&&t.push(d)}let s=t.length;for(let u=0;u<s;++u)this.setElementByPos(u,t[u]);return this.cut(s-1)}eraseElementByIterator(n){let t=n.o;return this.eraseElementByPos(t),n=n.next(),n}find(n){for(let t=0;t<this.i;++t)if(this.getElementByPos(t)===n)return new l(t,this);return this.end()}reverse(){let n=0,t=this.i-1;for(;n<t;){let s=this.getElementByPos(n);this.setElementByPos(n,this.getElementByPos(t)),this.setElementByPos(t,s),n+=1,t-=1}}unique(){if(this.i<=1)return this.i;let n=1,t=this.getElementByPos(0);for(let s=1;s<this.i;++s){let u=this.getElementByPos(s);u!==t&&(t=u,this.setElementByPos(n++,u))}for(;this.i>n;)this.popBack();return this.i}sort(n){let t=[];for(let s=0;s<this.i;++s)t.push(this.getElementByPos(s));t.sort(n);for(let s=0;s<this.i;++s)this.setElementByPos(s,t[s])}shrinkToFit(){if(this.i===0)return;let n=[];this.forEach(function(t){n.push(t)}),this.P=Math.max(Math.ceil(this.i/this.F),1),this.i=this.j=this.R=this.D=this.N=0,this.A=[];for(let t=0;t<this.P;++t)this.A.push(new Array(this.F));for(let t=0;t<n.length;++t)this.pushBack(n[t])}forEach(n){for(let t=0;t<this.i;++t)n(this.getElementByPos(t),t,this)}[Symbol.iterator](){return(function*(){for(let n=0;n<this.i;++n)yield this.getElementByPos(n)}).bind(this)()}},e=r;o.default=e}),yu=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"t",{value:!0}),o.TreeNodeEnableIndex=o.TreeNode=void 0;var h=class{constructor(a,l){this.ee=1,this.u=void 0,this.l=void 0,this.U=void 0,this.W=void 0,this.tt=void 0,this.u=a,this.l=l}L(){let a=this;if(a.ee===1&&a.tt.tt===a)a=a.W;else if(a.U)for(a=a.U;a.W;)a=a.W;else{let l=a.tt;for(;l.U===a;)a=l,l=a.tt;a=l}return a}B(){let a=this;if(a.W){for(a=a.W;a.U;)a=a.U;return a}else{let l=a.tt;for(;l.W===a;)a=l,l=a.tt;return a.W!==l?l:a}}te(){let a=this.tt,l=this.W,r=l.U;return a.tt===this?a.tt=l:a.U===this?a.U=l:a.W=l,l.tt=a,l.U=this,this.tt=l,this.W=r,r&&(r.tt=this),l}se(){let a=this.tt,l=this.U,r=l.W;return a.tt===this?a.tt=l:a.U===this?a.U=l:a.W=l,l.tt=a,l.W=this,this.tt=l,this.U=r,r&&(r.tt=this),l}};o.TreeNode=h;var i=class extends h{constructor(){super(...arguments),this.rt=1}te(){let a=super.te();return this.ie(),a.ie(),a}se(){let a=super.se();return this.ie(),a.ie(),a}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}};o.TreeNodeEnableIndex=i}),ts=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var h=yu(),i=kt(),a=It(),l=class extends i.Container{constructor(e=function(t,s){return t<s?-1:t>s?1:0},n=!1){super(),this.Y=void 0,this.v=e,n?(this.re=h.TreeNodeEnableIndex,this.M=function(t,s,u){let d=this.ne(t,s,u);if(d){let p=d.tt;for(;p!==this.h;)p.rt+=1,p=p.tt;let m=this.he(d);if(m){let{parentNode:A,grandParent:y,curNode:w}=m;A.ie(),y.ie(),w.ie()}}return this.i},this.V=function(t){let s=this.fe(t);for(;s!==this.h;)s.rt-=1,s=s.tt}):(this.re=h.TreeNode,this.M=function(t,s,u){let d=this.ne(t,s,u);return d&&this.he(d),this.i},this.V=this.fe),this.h=new this.re}X(e,n){let t=this.h;for(;e;){let s=this.v(e.u,n);if(s<0)e=e.W;else if(s>0)t=e,e=e.U;else return e}return t}Z(e,n){let t=this.h;for(;e;)this.v(e.u,n)<=0?e=e.W:(t=e,e=e.U);return t}$(e,n){let t=this.h;for(;e;){let s=this.v(e.u,n);if(s<0)t=e,e=e.W;else if(s>0)e=e.U;else return e}return t}rr(e,n){let t=this.h;for(;e;)this.v(e.u,n)<0?(t=e,e=e.W):e=e.U;return t}ue(e){for(;;){let n=e.tt;if(n===this.h)return;if(e.ee===1){e.ee=0;return}if(e===n.U){let t=n.W;if(t.ee===1)t.ee=0,n.ee=1,n===this.Y?this.Y=n.te():n.te();else if(t.W&&t.W.ee===1){t.ee=n.ee,n.ee=0,t.W.ee=0,n===this.Y?this.Y=n.te():n.te();return}else t.U&&t.U.ee===1?(t.ee=1,t.U.ee=0,t.se()):(t.ee=1,e=n)}else{let t=n.U;if(t.ee===1)t.ee=0,n.ee=1,n===this.Y?this.Y=n.se():n.se();else if(t.U&&t.U.ee===1){t.ee=n.ee,n.ee=0,t.U.ee=0,n===this.Y?this.Y=n.se():n.se();return}else t.W&&t.W.ee===1?(t.ee=1,t.W.ee=0,t.te()):(t.ee=1,e=n)}}}fe(e){if(this.i===1)return this.clear(),this.h;let n=e;for(;n.U||n.W;){if(n.W)for(n=n.W;n.U;)n=n.U;else n=n.U;[e.u,n.u]=[n.u,e.u],[e.l,n.l]=[n.l,e.l],e=n}this.h.U===n?this.h.U=n.tt:this.h.W===n&&(this.h.W=n.tt),this.ue(n);let t=n.tt;return n===t.U?t.U=void 0:t.W=void 0,this.i-=1,this.Y.ee=0,t}oe(e,n){return e===void 0?!1:this.oe(e.U,n)||n(e)?!0:this.oe(e.W,n)}he(e){for(;;){let n=e.tt;if(n.ee===0)return;let t=n.tt;if(n===t.U){let s=t.W;if(s&&s.ee===1){if(s.ee=n.ee=0,t===this.Y)return;t.ee=1,e=t;continue}else if(e===n.W){if(e.ee=0,e.U&&(e.U.tt=n),e.W&&(e.W.tt=t),n.W=e.U,t.U=e.W,e.U=n,e.W=t,t===this.Y)this.Y=e,this.h.tt=e;else{let u=t.tt;u.U===t?u.U=e:u.W=e}return e.tt=t.tt,n.tt=e,t.tt=e,t.ee=1,{parentNode:n,grandParent:t,curNode:e}}else n.ee=0,t===this.Y?this.Y=t.se():t.se(),t.ee=1}else{let s=t.U;if(s&&s.ee===1){if(s.ee=n.ee=0,t===this.Y)return;t.ee=1,e=t;continue}else if(e===n.U){if(e.ee=0,e.U&&(e.U.tt=t),e.W&&(e.W.tt=n),t.W=e.U,n.U=e.W,e.U=t,e.W=n,t===this.Y)this.Y=e,this.h.tt=e;else{let u=t.tt;u.U===t?u.U=e:u.W=e}return e.tt=t.tt,n.tt=e,t.tt=e,t.ee=1,{parentNode:n,grandParent:t,curNode:e}}else n.ee=0,t===this.Y?this.Y=t.te():t.te(),t.ee=1}return}}ne(e,n,t){if(this.Y===void 0){this.i+=1,this.Y=new this.re(e,n),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,this.h.W=this.Y;return}let s,u=this.h.U,d=this.v(u.u,e);if(d===0){u.l=n;return}else if(d>0)u.U=new this.re(e,n),u.U.tt=u,s=u.U,this.h.U=s;else{let p=this.h.W,m=this.v(p.u,e);if(m===0){p.l=n;return}else if(m<0)p.W=new this.re(e,n),p.W.tt=p,s=p.W,this.h.W=s;else{if(t!==void 0){let A=t.o;if(A!==this.h){let y=this.v(A.u,e);if(y===0){A.l=n;return}else if(y>0){let w=A.L(),C=this.v(w.u,e);if(C===0){w.l=n;return}else C<0&&(s=new this.re(e,n),w.W===void 0?(w.W=s,s.tt=w):(A.U=s,s.tt=A))}}}if(s===void 0)for(s=this.Y;;){let A=this.v(s.u,e);if(A>0){if(s.U===void 0){s.U=new this.re(e,n),s.U.tt=s,s=s.U;break}s=s.U}else if(A<0){if(s.W===void 0){s.W=new this.re(e,n),s.W.tt=s,s=s.W;break}s=s.W}else{s.l=n;return}}}}return this.i+=1,s}I(e,n){for(;e;){let t=this.v(e.u,n);if(t<0)e=e.W;else if(t>0)e=e.U;else return e}return e||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(e,n){let t=e.o;if(t===this.h&&(0,a.throwIteratorAccessError)(),this.i===1)return t.u=n,!0;if(t===this.h.U)return this.v(t.B().u,n)>0?(t.u=n,!0):!1;if(t===this.h.W)return this.v(t.L().u,n)<0?(t.u=n,!0):!1;let s=t.L().u;if(this.v(s,n)>=0)return!1;let u=t.B().u;return this.v(u,n)<=0?!1:(t.u=n,!0)}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let n=0,t=this;return this.oe(this.Y,function(s){return e===n?(t.V(s),!0):(n+=1,!1)}),this.i}eraseElementByKey(e){if(this.i===0)return!1;let n=this.I(this.Y,e);return n===this.h?!1:(this.V(n),!0)}eraseElementByIterator(e){let n=e.o;n===this.h&&(0,a.throwIteratorAccessError)();let t=n.W===void 0;return e.iteratorType===0?t&&e.next():(!t||n.U===void 0)&&e.next(),this.V(n),e}forEach(e){let n=0;for(let t of this)e(t,n++,this)}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let n,t=0;for(let s of this){if(t===e){n=s;break}t+=1}return n}getHeight(){if(this.i===0)return 0;let e=function(n){return n?Math.max(e(n.U),e(n.W))+1:0};return e(this.Y)}},r=l;o.default=r}),rs=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var h=kt(),i=It(),a=class extends h.ContainerIterator{constructor(r,e,n){super(n),this.o=r,this.h=e,this.iteratorType===0?(this.pre=function(){return this.o===this.h.U&&(0,i.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,i.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let r=this.o,e=this.h.tt;if(r===this.h)return e?e.rt-1:0;let n=0;for(r.U&&(n+=r.U.rt);r!==e;){let t=r.tt;r===t.W&&(n+=1,t.U&&(n+=t.U.rt)),r=t}return n}},l=a;o.default=l}),vu=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var h=l(ts()),i=l(rs()),a=It();function l(t){return t&&t.t?t:{default:t}}var r=class Sa extends i.default{constructor(s,u,d,p){super(s,u,p),this.container=d}get pointer(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o.u}copy(){return new Sa(this.o,this.h,this.container,this.iteratorType)}},e=class extends h.default{constructor(t=[],s,u){super(s,u);let d=this;t.forEach(function(p){d.insert(p)})}*K(t){t!==void 0&&(yield*this.K(t.U),yield t.u,yield*this.K(t.W))}begin(){return new r(this.h.U||this.h,this.h,this)}end(){return new r(this.h,this.h,this)}rBegin(){return new r(this.h.W||this.h,this.h,this,1)}rEnd(){return new r(this.h,this.h,this,1)}front(){return this.h.U?this.h.U.u:void 0}back(){return this.h.W?this.h.W.u:void 0}insert(t,s){return this.M(t,void 0,s)}find(t){let s=this.I(this.Y,t);return new r(s,this.h,this)}lowerBound(t){let s=this.X(this.Y,t);return new r(s,this.h,this)}upperBound(t){let s=this.Z(this.Y,t);return new r(s,this.h,this)}reverseLowerBound(t){let s=this.$(this.Y,t);return new r(s,this.h,this)}reverseUpperBound(t){let s=this.rr(this.Y,t);return new r(s,this.h,this)}union(t){let s=this;return t.forEach(function(u){s.insert(u)}),this.i}[Symbol.iterator](){return this.K(this.Y)}},n=e;o.default=n}),_u=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var h=l(ts()),i=l(rs()),a=It();function l(t){return t&&t.t?t:{default:t}}var r=class Ca extends i.default{constructor(s,u,d,p){super(s,u,p),this.container=d}get pointer(){this.o===this.h&&(0,a.throwIteratorAccessError)();let s=this;return new Proxy([],{get(u,d){if(d==="0")return s.o.u;if(d==="1")return s.o.l},set(u,d,p){if(d!=="1")throw new TypeError("props must be 1");return s.o.l=p,!0}})}copy(){return new Ca(this.o,this.h,this.container,this.iteratorType)}},e=class extends h.default{constructor(t=[],s,u){super(s,u);let d=this;t.forEach(function(p){d.setElement(p[0],p[1])})}*K(t){t!==void 0&&(yield*this.K(t.U),yield[t.u,t.l],yield*this.K(t.W))}begin(){return new r(this.h.U||this.h,this.h,this)}end(){return new r(this.h,this.h,this)}rBegin(){return new r(this.h.W||this.h,this.h,this,1)}rEnd(){return new r(this.h,this.h,this,1)}front(){if(this.i===0)return;let t=this.h.U;return[t.u,t.l]}back(){if(this.i===0)return;let t=this.h.W;return[t.u,t.l]}lowerBound(t){let s=this.X(this.Y,t);return new r(s,this.h,this)}upperBound(t){let s=this.Z(this.Y,t);return new r(s,this.h,this)}reverseLowerBound(t){let s=this.$(this.Y,t);return new r(s,this.h,this)}reverseUpperBound(t){let s=this.rr(this.Y,t);return new r(s,this.h,this)}setElement(t,s,u){return this.M(t,s,u)}find(t){let s=this.I(this.Y,t);return new r(s,this.h,this)}getElementByKey(t){return this.I(this.Y,t).l}union(t){let s=this;return t.forEach(function(u){s.setElement(u[0],u[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}},n=e;o.default=n}),ns=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"t",{value:!0}),o.default=h;function h(i){let a=typeof i;return a==="object"&&i!==null||a==="function"}}),is=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"t",{value:!0}),o.HashContainerIterator=o.HashContainer=void 0;var h=kt(),i=l(ns()),a=It();function l(n){return n&&n.t?n:{default:n}}var r=class extends h.ContainerIterator{constructor(n,t,s){super(s),this.o=n,this.h=t,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this})}};o.HashContainerIterator=r;var e=class extends h.Container{constructor(){super(),this.H=[],this.g={},this.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(this.g,null),this.h={},this.h.L=this.h.B=this.p=this._=this.h}V(n){let{L:t,B:s}=n;t.B=s,s.L=t,n===this.p&&(this.p=s),n===this._&&(this._=t),this.i-=1}M(n,t,s){s===void 0&&(s=(0,i.default)(n));let u;if(s){let d=n[this.HASH_TAG];if(d!==void 0)return this.H[d].l=t,this.i;Object.defineProperty(n,this.HASH_TAG,{value:this.H.length,configurable:!0}),u={u:n,l:t,L:this._,B:this.h},this.H.push(u)}else{let d=this.g[n];if(d)return d.l=t,this.i;u={u:n,l:t,L:this._,B:this.h},this.g[n]=u}return this.i===0?(this.p=u,this.h.B=u):this._.B=u,this._=u,this.h.L=u,++this.i}I(n,t){if(t===void 0&&(t=(0,i.default)(n)),t){let s=n[this.HASH_TAG];return s===void 0?this.h:this.H[s]}else return this.g[n]||this.h}clear(){let n=this.HASH_TAG;this.H.forEach(function(t){delete t.u[n]}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(n,t){let s;if(t===void 0&&(t=(0,i.default)(n)),t){let u=n[this.HASH_TAG];if(u===void 0)return!1;delete n[this.HASH_TAG],s=this.H[u],delete this.H[u]}else{if(s=this.g[n],s===void 0)return!1;delete this.g[n]}return this.V(s),!0}eraseElementByIterator(n){let t=n.o;return t===this.h&&(0,a.throwIteratorAccessError)(),this.V(t),n.next()}eraseElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;let t=this.p;for(;n--;)t=t.B;return this.V(t),this.i}};o.HashContainer=e}),Eu=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var h=is(),i=It(),a=class ka extends h.HashContainerIterator{constructor(n,t,s,u){super(n,t,u),this.container=s}get pointer(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o.u}copy(){return new ka(this.o,this.h,this.container,this.iteratorType)}},l=class extends h.HashContainer{constructor(e=[]){super();let n=this;e.forEach(function(t){n.insert(t)})}begin(){return new a(this.p,this.h,this)}end(){return new a(this.h,this.h,this)}rBegin(){return new a(this._,this.h,this,1)}rEnd(){return new a(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(e,n){return this.M(e,void 0,n)}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let n=this.p;for(;e--;)n=n.B;return n.u}find(e,n){let t=this.I(e,n);return new a(t,this.h,this)}forEach(e){let n=0,t=this.p;for(;t!==this.h;)e(t.u,n++,this),t=t.B}[Symbol.iterator](){return(function*(){let e=this.p;for(;e!==this.h;)yield e.u,e=e.B}).bind(this)()}},r=l;o.default=r}),Su=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var h=is(),i=l(ns()),a=It();function l(t){return t&&t.t?t:{default:t}}var r=class Ia extends h.HashContainerIterator{constructor(s,u,d,p){super(s,u,p),this.container=d}get pointer(){this.o===this.h&&(0,a.throwIteratorAccessError)();let s=this;return new Proxy([],{get(u,d){if(d==="0")return s.o.u;if(d==="1")return s.o.l},set(u,d,p){if(d!=="1")throw new TypeError("props must be 1");return s.o.l=p,!0}})}copy(){return new Ia(this.o,this.h,this.container,this.iteratorType)}},e=class extends h.HashContainer{constructor(t=[]){super();let s=this;t.forEach(function(u){s.setElement(u[0],u[1])})}begin(){return new r(this.p,this.h,this)}end(){return new r(this.h,this.h,this)}rBegin(){return new r(this._,this.h,this,1)}rEnd(){return new r(this.h,this.h,this,1)}front(){if(this.i!==0)return[this.p.u,this.p.l]}back(){if(this.i!==0)return[this._.u,this._.l]}setElement(t,s,u){return this.M(t,s,u)}getElementByKey(t,s){if(s===void 0&&(s=(0,i.default)(t)),s){let d=t[this.HASH_TAG];return d!==void 0?this.H[d].l:void 0}let u=this.g[t];return u?u.l:void 0}getElementByPos(t){if(t<0||t>this.i-1)throw new RangeError;let s=this.p;for(;t--;)s=s.B;return[s.u,s.l]}find(t,s){let u=this.I(t,s);return new r(u,this.h,this)}forEach(t){let s=0,u=this.p;for(;u!==this.h;)t([u.u,u.l],s++,this),u=u.B}[Symbol.iterator](){return(function*(){let t=this.p;for(;t!==this.h;)yield[t.u,t.l],t=t.B}).bind(this)()}},n=e;o.default=n}),Cu=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"t",{value:!0}),Object.defineProperty(o,"Deque",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(o,"HashMap",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(o,"HashSet",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(o,"LinkList",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(o,"OrderedMap",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(o,"OrderedSet",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(o,"PriorityQueue",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(o,"Queue",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(o,"Stack",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(o,"Vector",{enumerable:!0,get:function(){return l.default}});var h=d(pu()),i=d(gu()),a=d(mu()),l=d(Au()),r=d(bu()),e=d(wu()),n=d(vu()),t=d(_u()),s=d(Eu()),u=d(Su());function d(p){return p&&p.t?p:{default:p}}}),ku=Ae((o,h)=>{ce(),fe(),he();var i=Cu().OrderedSet,a=Ct()("number-allocator:trace"),l=Ct()("number-allocator:error");function r(n,t){this.low=n,this.high=t}r.prototype.equals=function(n){return this.low===n.low&&this.high===n.high},r.prototype.compare=function(n){return this.low<n.low&&this.high<n.low?-1:n.low<this.low&&n.high<this.low?1:0};function e(n,t){if(!(this instanceof e))return new e(n,t);this.min=n,this.max=t,this.ss=new i([],(s,u)=>s.compare(u)),a("Create"),this.clear()}e.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},e.prototype.alloc=function(){if(this.ss.size()===0)return a("alloc():empty"),null;let n=this.ss.begin(),t=n.pointer.low,s=n.pointer.high,u=t;return u+1<=s?this.ss.updateKeyByIterator(n,new r(t+1,s)):this.ss.eraseElementByPos(0),a("alloc():"+u),u},e.prototype.use=function(n){let t=new r(n,n),s=this.ss.lowerBound(t);if(!s.equals(this.ss.end())){let u=s.pointer.low,d=s.pointer.high;return s.pointer.equals(t)?(this.ss.eraseElementByIterator(s),a("use():"+n),!0):u>n?!1:u===n?(this.ss.updateKeyByIterator(s,new r(u+1,d)),a("use():"+n),!0):d===n?(this.ss.updateKeyByIterator(s,new r(u,d-1)),a("use():"+n),!0):(this.ss.updateKeyByIterator(s,new r(n+1,d)),this.ss.insert(new r(u,n-1)),a("use():"+n),!0)}return a("use():failed"),!1},e.prototype.free=function(n){if(n<this.min||n>this.max){l("free():"+n+" is out of range");return}let t=new r(n,n),s=this.ss.upperBound(t);if(s.equals(this.ss.end())){if(s.equals(this.ss.begin())){this.ss.insert(t);return}s.pre();let u=s.pointer.high;s.pointer.high+1===n?this.ss.updateKeyByIterator(s,new r(u,n)):this.ss.insert(t)}else if(s.equals(this.ss.begin()))if(n+1===s.pointer.low){let u=s.pointer.high;this.ss.updateKeyByIterator(s,new r(n,u))}else this.ss.insert(t);else{let u=s.pointer.low,d=s.pointer.high;s.pre();let p=s.pointer.low;s.pointer.high+1===n?n+1===u?(this.ss.eraseElementByIterator(s),this.ss.updateKeyByIterator(s,new r(p,d))):this.ss.updateKeyByIterator(s,new r(p,n)):n+1===u?(this.ss.eraseElementByIterator(s.next()),this.ss.insert(new r(n,d))):this.ss.insert(t)}a("free():"+n)},e.prototype.clear=function(){a("clear()"),this.ss.clear(),this.ss.insert(new r(this.min,this.max))},e.prototype.intervalCount=function(){return this.ss.size()},e.prototype.dump=function(){console.log("length:"+this.ss.size());for(let n of this.ss)console.log(n)},h.exports=e}),os=Ae((o,h)=>{ce(),fe(),he();var i=ku();h.exports.NumberAllocator=i}),Iu=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"__esModule",{value:!0});var h=du(),i=os(),a=class{constructor(l){l>0&&(this.aliasToTopic=new h.LRUCache({max:l}),this.topicToAlias={},this.numberAllocator=new i.NumberAllocator(1,l),this.max=l,this.length=0)}put(l,r){if(r===0||r>this.max)return!1;let e=this.aliasToTopic.get(r);return e&&delete this.topicToAlias[e],this.aliasToTopic.set(r,l),this.topicToAlias[l]=r,this.numberAllocator.use(r),this.length=this.aliasToTopic.size,!0}getTopicByAlias(l){return this.aliasToTopic.get(l)}getAliasByTopic(l){let r=this.topicToAlias[l];return typeof r<"u"&&this.aliasToTopic.get(r),r}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){return this.numberAllocator.firstVacant()||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}};o.default=a}),Tu=Ae(o=>{ce(),fe(),he();var h=o&&o.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o,"__esModule",{value:!0});var i=kr(),a=h(Iu()),l=ir(),r=(e,n)=>{e.log("_handleConnack");let{options:t}=e,s=t.protocolVersion===5?n.reasonCode:n.returnCode;if(clearTimeout(e.connackTimer),delete e.topicAliasSend,n.properties){if(n.properties.topicAliasMaximum){if(n.properties.topicAliasMaximum>65535){e.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}n.properties.topicAliasMaximum>0&&(e.topicAliasSend=new a.default(n.properties.topicAliasMaximum))}n.properties.serverKeepAlive&&t.keepalive&&(t.keepalive=n.properties.serverKeepAlive),n.properties.maximumPacketSize&&(t.properties||(t.properties={}),t.properties.maximumPacketSize=n.properties.maximumPacketSize)}if(s===0)e.reconnecting=!1,e._onConnect(n);else if(s>0){let u=new l.ErrorWithReasonCode(`Connection refused: ${i.ReasonCodes[s]}`,s);e.emit("error",u),e.options.reconnectOnConnackError&&e._cleanUp(!0)}};o.default=r}),Bu=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"__esModule",{value:!0});var h=(i,a,l)=>{i.log("handling pubrel packet");let r=typeof l<"u"?l:i.noop,{messageId:e}=a,n={cmd:"pubcomp",messageId:e};i.incomingStore.get(a,(t,s)=>{t?i._sendPacket(n,r):(i.emit("message",s.topic,s.payload,s),i.handleMessage(s,u=>{if(u)return r(u);i.incomingStore.del(s,i.noop),i._sendPacket(n,r)}))})};o.default=h}),Ou=Ae(o=>{ce(),fe(),he();var h=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(o,"__esModule",{value:!0});var i=h(cu()),a=h(fu()),l=h(Tu()),r=h(kr()),e=h(Bu()),n=(t,s,u)=>{let{options:d}=t;if(d.protocolVersion===5&&d.properties&&d.properties.maximumPacketSize&&d.properties.maximumPacketSize<s.length)return t.emit("error",new Error(`exceeding packets size ${s.cmd}`)),t.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),t;switch(t.log("_handlePacket :: emitting packetreceive"),t.emit("packetreceive",s),s.cmd){case"publish":(0,i.default)(t,s,u);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":t.reschedulePing(),(0,r.default)(t,s),u();break;case"pubrel":t.reschedulePing(),(0,e.default)(t,s,u);break;case"connack":(0,l.default)(t,s),u();break;case"auth":t.reschedulePing(),(0,a.default)(t,s),u();break;case"pingresp":t.log("_handlePacket :: received pingresp"),t.reschedulePing(!0),u();break;case"disconnect":t.emit("disconnect",s),u();break;default:t.log("_handlePacket :: unknown command"),u();break}};o.default=n}),Pu=Ae(o=>{ce(),fe(),he();var h=o&&o.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(o,"__esModule",{value:!0}),o.TypedEventEmitter=void 0;var i=h((Qt(),Le(Rt))),a=ir(),l=class{};o.TypedEventEmitter=l,(0,a.applyMixin)(l,i.default)}),Ir=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"__esModule",{value:!0}),o.isReactNativeBrowser=o.isWebWorker=void 0;var h=()=>{var r;return typeof window<"u"?typeof navigator<"u"&&((r=navigator.userAgent)===null||r===void 0?void 0:r.toLowerCase().indexOf(" electron/"))>-1&&De!=null&&De.versions?!Object.prototype.hasOwnProperty.call(De.versions,"electron"):typeof window.document<"u":!1},i=()=>{var r,e;return!!(typeof self=="object"&&!((e=(r=self==null?void 0:self.constructor)===null||r===void 0?void 0:r.name)===null||e===void 0)&&e.includes("WorkerGlobalScope"))},a=()=>typeof navigator<"u"&&navigator.product==="ReactNative",l=h()||i()||a();o.isWebWorker=i(),o.isReactNativeBrowser=a(),o.default=l}),xu=Ae((o,h)=>{ce(),fe(),he(),function(i,a){typeof o=="object"&&typeof h<"u"?a(o):typeof define=="function"&&define.amd?define(["exports"],a):(i=typeof globalThis<"u"?globalThis:i||self,a(i.fastUniqueNumbers={}))}(o,function(i){var a=function(m){return function(A){var y=m(A);return A.add(y),y}},l=function(m){return function(A,y){return m.set(A,y),y}},r=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,e=536870912,n=e*2,t=function(m,A){return function(y){var w=A.get(y),C=w===void 0?y.size:w<n?w+1:0;if(!y.has(C))return m(y,C);if(y.size<e){for(;y.has(C);)C=Math.floor(Math.random()*n);return m(y,C)}if(y.size>r)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;y.has(C);)C=Math.floor(Math.random()*r);return m(y,C)}},s=new WeakMap,u=l(s),d=t(u,s),p=a(d);i.addUniqueNumber=p,i.generateUniqueNumber=d})}),Ru=Ae((o,h)=>{ce(),fe(),he(),function(i,a){typeof o=="object"&&typeof h<"u"?a(o,xu()):typeof define=="function"&&define.amd?define(["exports","fast-unique-numbers"],a):(i=typeof globalThis<"u"?globalThis:i||self,a(i.workerTimersBroker={},i.fastUniqueNumbers))}(o,function(i,a){var l=function(n){return n.method!==void 0&&n.method==="call"},r=function(n){return n.error===null&&typeof n.id=="number"},e=function(n){var t=new Map([[0,function(){}]]),s=new Map([[0,function(){}]]),u=new Map,d=new Worker(n);d.addEventListener("message",function(w){var C=w.data;if(l(C)){var b=C.params,_=b.timerId,N=b.timerType;if(N==="interval"){var M=t.get(_);if(typeof M=="number"){var k=u.get(M);if(k===void 0||k.timerId!==_||k.timerType!==N)throw new Error("The timer is in an undefined state.")}else if(typeof M<"u")M();else throw new Error("The timer is in an undefined state.")}else if(N==="timeout"){var T=s.get(_);if(typeof T=="number"){var U=u.get(T);if(U===void 0||U.timerId!==_||U.timerType!==N)throw new Error("The timer is in an undefined state.")}else if(typeof T<"u")T(),s.delete(_);else throw new Error("The timer is in an undefined state.")}}else if(r(C)){var J=C.id,X=u.get(J);if(X===void 0)throw new Error("The timer is in an undefined state.");var le=X.timerId,P=X.timerType;u.delete(J),P==="interval"?t.delete(le):s.delete(le)}else{var G=C.error.message;throw new Error(G)}});var p=function(w){var C=a.generateUniqueNumber(u);u.set(C,{timerId:w,timerType:"interval"}),t.set(w,C),d.postMessage({id:C,method:"clear",params:{timerId:w,timerType:"interval"}})},m=function(w){var C=a.generateUniqueNumber(u);u.set(C,{timerId:w,timerType:"timeout"}),s.set(w,C),d.postMessage({id:C,method:"clear",params:{timerId:w,timerType:"timeout"}})},A=function(w){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,b=a.generateUniqueNumber(t);return t.set(b,function(){w(),typeof t.get(b)=="function"&&d.postMessage({id:null,method:"set",params:{delay:C,now:performance.now(),timerId:b,timerType:"interval"}})}),d.postMessage({id:null,method:"set",params:{delay:C,now:performance.now(),timerId:b,timerType:"interval"}}),b},y=function(w){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,b=a.generateUniqueNumber(s);return s.set(b,w),d.postMessage({id:null,method:"set",params:{delay:C,now:performance.now(),timerId:b,timerType:"timeout"}}),b};return{clearInterval:p,clearTimeout:m,setInterval:A,setTimeout:y}};i.load=e})}),Mu=Ae((o,h)=>{ce(),fe(),he(),function(i,a){typeof o=="object"&&typeof h<"u"?a(o,Ru()):typeof define=="function"&&define.amd?define(["exports","worker-timers-broker"],a):(i=typeof globalThis<"u"?globalThis:i||self,a(i.workerTimers={},i.workerTimersBroker))}(o,function(i,a){var l=function(d,p){var m=null;return function(){if(m!==null)return m;var A=new Blob([p],{type:"application/javascript; charset=utf-8"}),y=URL.createObjectURL(A);return m=d(y),setTimeout(function(){return URL.revokeObjectURL(y)}),m}},r=`(()=>{var e={472:(e,t,r)=>{var o,i;void 0===(i="function"==typeof(o=function(){"use strict";var e=new Map,t=new Map,r=function(t){var r=e.get(t);if(void 0===r)throw new Error('There is no interval scheduled with the given id "'.concat(t,'".'));clearTimeout(r),e.delete(t)},o=function(e){var r=t.get(e);if(void 0===r)throw new Error('There is no timeout scheduled with the given id "'.concat(e,'".'));clearTimeout(r),t.delete(e)},i=function(e,t){var r,o=performance.now();return{expected:o+(r=e-Math.max(0,o-t)),remainingDelay:r}},n=function e(t,r,o,i){var n=performance.now();n>o?postMessage({id:null,method:"call",params:{timerId:r,timerType:i}}):t.set(r,setTimeout(e,o-n,t,r,o,i))},a=function(t,r,o){var a=i(t,o),s=a.expected,d=a.remainingDelay;e.set(r,setTimeout(n,d,e,r,s,"interval"))},s=function(e,r,o){var a=i(e,o),s=a.expected,d=a.remainingDelay;t.set(r,setTimeout(n,d,t,r,s,"timeout"))};addEventListener("message",(function(e){var t=e.data;try{if("clear"===t.method){var i=t.id,n=t.params,d=n.timerId,c=n.timerType;if("interval"===c)r(d),postMessage({error:null,id:i});else{if("timeout"!==c)throw new Error('The given type "'.concat(c,'" is not supported'));o(d),postMessage({error:null,id:i})}}else{if("set"!==t.method)throw new Error('The given method "'.concat(t.method,'" is not supported'));var u=t.params,l=u.delay,p=u.now,m=u.timerId,v=u.timerType;if("interval"===v)a(l,m,p);else{if("timeout"!==v)throw new Error('The given type "'.concat(v,'" is not supported'));s(l,m,p)}}}catch(e){postMessage({error:{message:e.message},id:t.id,result:null})}}))})?o.call(t,r,t,e):o)||(e.exports=i)}},t={};function r(o){var i=t[o];if(void 0!==i)return i.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";r(472)})()})();`,e=l(a.load,r),n=function(d){return e().clearInterval(d)},t=function(d){return e().clearTimeout(d)},s=function(){var d;return(d=e()).setInterval.apply(d,arguments)},u=function(){var d;return(d=e()).setTimeout.apply(d,arguments)};i.clearInterval=n,i.clearTimeout=t,i.setInterval=s,i.setTimeout=u})}),Uu=Ae(o=>{ce(),fe(),he();var h=o&&o.__createBinding||(Object.create?function(s,u,d,p){p===void 0&&(p=d);var m=Object.getOwnPropertyDescriptor(u,d);(!m||("get"in m?!u.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return u[d]}}),Object.defineProperty(s,p,m)}:function(s,u,d,p){p===void 0&&(p=d),s[p]=u[d]}),i=o&&o.__setModuleDefault||(Object.create?function(s,u){Object.defineProperty(s,"default",{enumerable:!0,value:u})}:function(s,u){s.default=u}),a=o&&o.__importStar||function(){var s=function(u){return s=Object.getOwnPropertyNames||function(d){var p=[];for(var m in d)Object.prototype.hasOwnProperty.call(d,m)&&(p[p.length]=m);return p},s(u)};return function(u){if(u&&u.__esModule)return u;var d={};if(u!=null)for(var p=s(u),m=0;m<p.length;m++)p[m]!=="default"&&h(d,u,p[m]);return i(d,u),d}}();Object.defineProperty(o,"__esModule",{value:!0});var l=a(Ir()),r=Mu(),e={set:r.setInterval,clear:r.clearInterval},n={set:(s,u)=>setInterval(s,u),clear:s=>clearInterval(s)},t=s=>{switch(s){case"native":return n;case"worker":return e;case"auto":default:return l.default&&!l.isWebWorker&&!l.isReactNativeBrowser?e:n}};o.default=t}),ss=Ae(o=>{ce(),fe(),he();var h=o&&o.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(o,"__esModule",{value:!0});var i=h(Uu()),a=class{get keepaliveTimeoutTimestamp(){return this._keepaliveTimeoutTimestamp}get intervalEvery(){return this._intervalEvery}get keepalive(){return this._keepalive}constructor(l,r){this.destroyed=!1,this.client=l,this.timer=typeof r=="object"&&"set"in r&&"clear"in r?r:(0,i.default)(r),this.setKeepalive(l.options.keepalive)}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}setKeepalive(l){if(l*=1e3,isNaN(l)||l<=0||l>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${l}`);this._keepalive=l,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${l}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;let l=Math.ceil(this._keepalive*1.5);this._keepaliveTimeoutTimestamp=Date.now()+l,this._intervalEvery=Math.ceil(this._keepalive/2),this.timerId=this.timer.set(()=>{this.destroyed||(this.counter+=1,this.counter===2?this.client.sendPing():this.counter>2&&this.client.onKeepaliveTimeout())},this._intervalEvery)}};o.default=a}),pi=Ae(o=>{ce(),fe(),he();var h=o&&o.__createBinding||(Object.create?function(M,k,T,U){U===void 0&&(U=T);var J=Object.getOwnPropertyDescriptor(k,T);(!J||("get"in J?!k.__esModule:J.writable||J.configurable))&&(J={enumerable:!0,get:function(){return k[T]}}),Object.defineProperty(M,U,J)}:function(M,k,T,U){U===void 0&&(U=T),M[U]=k[T]}),i=o&&o.__setModuleDefault||(Object.create?function(M,k){Object.defineProperty(M,"default",{enumerable:!0,value:k})}:function(M,k){M.default=k}),a=o&&o.__importStar||function(){var M=function(k){return M=Object.getOwnPropertyNames||function(T){var U=[];for(var J in T)Object.prototype.hasOwnProperty.call(T,J)&&(U[U.length]=J);return U},M(k)};return function(k){if(k&&k.__esModule)return k;var T={};if(k!=null)for(var U=M(k),J=0;J<U.length;J++)U[J]!=="default"&&h(T,k,U[J]);return i(T,k),T}}(),l=o&&o.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(o,"__esModule",{value:!0});var r=l(Ql()),e=l(su()),n=l(Zo()),t=Ht(),s=l(lu()),u=a(uu()),d=l(Ct()),p=l(Xo()),m=l(Ou()),A=ir(),y=Pu(),w=l(ss()),C=a(Ir()),b=globalThis.setImmediate||((...M)=>{let k=M.shift();(0,A.nextTick)(()=>{k(...M)})}),_={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,subscribeBatchSize:null,writeCache:!0,timerVariant:"auto"},N=class ji extends y.TypedEventEmitter{static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(k,T){super(),this.options=T||{};for(let U in _)typeof this.options[U]>"u"?this.options[U]=_[U]:this.options[U]=T[U];this.log=this.options.log||(0,d.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",ji.VERSION),C.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",C.default?"browser":"node"),this.log("MqttClient :: options.protocol",T.protocol),this.log("MqttClient :: options.protocolVersion",T.protocolVersion),this.log("MqttClient :: options.username",T.username),this.log("MqttClient :: options.keepalive",T.keepalive),this.log("MqttClient :: options.reconnectPeriod",T.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",T.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",T.properties?T.properties.topicAliasMaximum:void 0),this.options.clientId=typeof T.clientId=="string"?T.clientId:ji.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=T.protocolVersion===5&&T.customHandleAcks?T.customHandleAcks:(...U)=>{U[3](null,0)},this.options.writeCache||(e.default.writeToStream.cacheNumbers=!1),this.streamBuilder=k,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new n.default:this.options.messageIdProvider,this.outgoingStore=T.outgoingStore||new p.default,this.incomingStore=T.incomingStore||new p.default,this.queueQoSZero=T.queueQoSZero===void 0?!0:T.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.keepaliveManager=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,T.properties&&T.properties.topicAliasMaximum>0&&(T.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new r.default(T.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:U}=this,J=()=>{let X=U.shift();this.log("deliver :: entry %o",X);let le=null;if(!X){this._resubscribe();return}le=X.packet,this.log("deliver :: call _sendPacket for %o",le);let P=!0;le.messageId&&le.messageId!==0&&(this.messageIdProvider.register(le.messageId)||(P=!1)),P?this._sendPacket(le,G=>{X.cb&&X.cb(G),J()}):(this.log("messageId: %d has already used. The message is skipped and removed.",le.messageId),J())};this.log("connect :: sending queued packets"),J()}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this._destroyKeepaliveManager(),this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()}),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}handleAuth(k,T){T()}handleMessage(k,T){T()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var k;let T=new t.Writable,U=e.default.parser(this.options),J=null,X=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new p.default,this.outgoingStore=this.options.outgoingStore||new p.default,this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),U.on("packet",V=>{this.log("parser :: on packet push to packets array."),X.push(V)});let le=()=>{this.log("work :: getting next packet in queue");let V=X.shift();if(V)this.log("work :: packet pulled from queue"),(0,m.default)(this,V,P);else{this.log("work :: no packets in queue");let be=J;J=null,this.log("work :: done flag is %s",!!be),be&&be()}},P=()=>{if(X.length)(0,A.nextTick)(le);else{let V=J;J=null,V()}};T._write=(V,be,pe)=>{J=pe,this.log("writable stream :: parsing buffer"),U.parse(V),le()};let G=V=>{this.log("streamErrorHandler :: error",V.message),V.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",V)):this.noop(V)};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(T),this.stream.on("error",G),this.stream.on("close",()=>{this.log("(%s)stream :: on close",this.options.clientId),this._flushVolatile(),this.log("stream: emit close to MqttClient"),this.emit("close")}),this.log("connect: sending packet `connect`");let Z={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties};if(this.options.will&&(Z.will=Object.assign(Object.assign({},this.options.will),{payload:(k=this.options.will)===null||k===void 0?void 0:k.payload})),this.topicAliasRecv&&(Z.properties||(Z.properties={}),this.topicAliasRecv&&(Z.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(Z),U.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&typeof this.options.authPacket=="object"){let V=Object.assign({cmd:"auth",reasonCode:0},this.options.authPacket);this._writePacket(V)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this.emit("error",new Error("connack timeout")),this._cleanUp(!0)},this.options.connectTimeout),this}publish(k,T,U,J){this.log("publish :: message `%s` to topic `%s`",T,k);let{options:X}=this;typeof U=="function"&&(J=U,U=null),U=U||{},U=Object.assign(Object.assign({},{qos:0,retain:!1,dup:!1}),U);let{qos:le,retain:P,dup:G,properties:Z,cbStorePut:V}=U;if(this._checkDisconnecting(J))return this;let be=()=>{let pe=0;if((le===1||le===2)&&(pe=this._nextId(),pe===null))return this.log("No messageId left"),!1;let me={cmd:"publish",topic:k,payload:T,qos:le,retain:P,messageId:pe,dup:G};switch(X.protocolVersion===5&&(me.properties=Z),this.log("publish :: qos",le),le){case 1:case 2:this.outgoing[me.messageId]={volatile:!1,cb:J||this.noop},this.log("MqttClient:publish: packet cmd: %s",me.cmd),this._sendPacket(me,void 0,V);break;default:this.log("MqttClient:publish: packet cmd: %s",me.cmd),this._sendPacket(me,J,V);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!be())&&this._storeProcessingQueue.push({invoke:be,cbStorePut:U.cbStorePut,callback:J}),this}publishAsync(k,T,U){return new Promise((J,X)=>{this.publish(k,T,U,(le,P)=>{le?X(le):J(P)})})}subscribe(k,T,U){let J=this.options.protocolVersion;typeof T=="function"&&(U=T),U=U||this.noop;let X=!1,le=[];typeof k=="string"?(k=[k],le=k):Array.isArray(k)?le=k:typeof k=="object"&&(X=k.resubscribe,delete k.resubscribe,le=Object.keys(k));let P=u.validateTopics(le);if(P!==null)return b(U,new Error(`Invalid topic ${P}`)),this;if(this._checkDisconnecting(U))return this.log("subscribe: discconecting true"),this;let G={qos:0};J===5&&(G.nl=!1,G.rap=!1,G.rh=0),T=Object.assign(Object.assign({},G),T);let Z=T.properties,V=[],be=(ve,z)=>{if(z=z||T,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,ve)||this._resubscribeTopics[ve].qos<z.qos||X){let de={topic:ve,qos:z.qos};J===5&&(de.nl=z.nl,de.rap=z.rap,de.rh=z.rh,de.properties=Z),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",de.topic,de.qos),V.push(de)}};if(Array.isArray(k)?k.forEach(ve=>{this.log("subscribe: array topic %s",ve),be(ve)}):Object.keys(k).forEach(ve=>{this.log("subscribe: object topic %s, %o",ve,k[ve]),be(ve,k[ve])}),!V.length)return U(null,[]),this;let pe=(ve,z)=>{let de={cmd:"subscribe",subscriptions:ve,messageId:z};if(Z&&(de.properties=Z),this.options.resubscribe){this.log("subscribe :: resubscribe true");let ne=[];ve.forEach(ge=>{if(this.options.reconnectPeriod>0){let F={qos:ge.qos};J===5&&(F.nl=ge.nl||!1,F.rap=ge.rap||!1,F.rh=ge.rh||0,F.properties=ge.properties),this._resubscribeTopics[ge.topic]=F,ne.push(ge.topic)}}),this.messageIdToTopic[de.messageId]=ne}let x=new Promise((ne,ge)=>{this.outgoing[de.messageId]={volatile:!0,cb(F,Ce){if(!F){let{granted:q}=Ce;for(let D=0;D<q.length;D+=1)ve[D].qos=q[D]}F?ge(new A.ErrorWithSubackPacket(F.message,Ce)):ne(Ce)}}});return this.log("subscribe :: call _sendPacket"),this._sendPacket(de),x},me=()=>{var ve;let z=(ve=this.options.subscribeBatchSize)!==null&&ve!==void 0?ve:V.length,de=[];for(let x=0;x<V.length;x+=z){let ne=V.slice(x,x+z),ge=this._nextId();if(ge===null)return this.log("No messageId left"),!1;de.push(pe(ne,ge))}return Promise.all(de).then(x=>{U(null,V,x.at(-1))}).catch(x=>{U(x,V,x.packet)}),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!me())&&this._storeProcessingQueue.push({invoke:me,callback:U}),this}subscribeAsync(k,T){return new Promise((U,J)=>{this.subscribe(k,T,(X,le)=>{X?J(X):U(le)})})}unsubscribe(k,T,U){typeof k=="string"&&(k=[k]),typeof T=="function"&&(U=T),U=U||this.noop;let J=u.validateTopics(k);if(J!==null)return b(U,new Error(`Invalid topic ${J}`)),this;if(this._checkDisconnecting(U))return this;let X=()=>{let le=this._nextId();if(le===null)return this.log("No messageId left"),!1;let P={cmd:"unsubscribe",messageId:le,unsubscriptions:[]};return typeof k=="string"?P.unsubscriptions=[k]:Array.isArray(k)&&(P.unsubscriptions=k),this.options.resubscribe&&P.unsubscriptions.forEach(G=>{delete this._resubscribeTopics[G]}),typeof T=="object"&&T.properties&&(P.properties=T.properties),this.outgoing[P.messageId]={volatile:!0,cb:U},this.log("unsubscribe: call _sendPacket"),this._sendPacket(P),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!X())&&this._storeProcessingQueue.push({invoke:X,callback:U}),this}unsubscribeAsync(k,T){return new Promise((U,J)=>{this.unsubscribe(k,T,(X,le)=>{X?J(X):U(le)})})}end(k,T,U){this.log("end :: (%s)",this.options.clientId),(k==null||typeof k!="boolean")&&(U=U||T,T=k,k=!1),typeof T!="object"&&(U=U||T,T=null),this.log("end :: cb? %s",!!U),(!U||typeof U!="function")&&(U=this.noop);let J=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close(le=>{this.outgoingStore.close(P=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),U){let G=le||P;this.log("end :: closeStores: invoking callback with args"),U(G)}})}),this._deferredReconnect?this._deferredReconnect():(this.options.reconnectPeriod===0||this.options.manualConnect)&&(this.disconnecting=!1)},X=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,k),this._cleanUp(k,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,A.nextTick)(J)},T)};return this.disconnecting?(U(),this):(this._clearReconnect(),this.disconnecting=!0,!k&&Object.keys(this.outgoing).length>0?(this.log("end :: (%s) :: calling finish in 10ms once outgoing is empty",this.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,X,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),X()),this)}endAsync(k,T){return new Promise((U,J)=>{this.end(k,T,X=>{X?J(X):U()})})}removeOutgoingMessage(k){if(this.outgoing[k]){let{cb:T}=this.outgoing[k];this._removeOutgoingAndStoreMessage(k,()=>{T(new Error("Message removed"))})}return this}reconnect(k){this.log("client reconnect");let T=()=>{k?(this.options.incomingStore=k.incomingStore,this.options.outgoingStore=k.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new p.default,this.outgoingStore=this.options.outgoingStore||new p.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=T:T(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach(k=>{this.outgoing[k].volatile&&typeof this.outgoing[k].cb=="function"&&(this.outgoing[k].cb(new Error("Connection closed")),delete this.outgoing[k])}))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(k=>{typeof this.outgoing[k].cb=="function"&&(this.outgoing[k].cb(new Error("Connection closed")),delete this.outgoing[k])}))}_removeTopicAliasAndRecoverTopicName(k){let T;k.properties&&(T=k.properties.topicAlias);let U=k.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",T,U),U.length===0){if(typeof T>"u")return new Error("Unregistered Topic Alias");if(U=this.topicAliasSend.getTopicByAlias(T),typeof U>"u")return new Error("Unregistered Topic Alias");k.topic=U}T&&delete k.properties.topicAlias}_checkDisconnecting(k){return this.disconnecting&&(k&&k!==this.noop?k(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this.connect()}),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()},this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(k,T,U={}){if(T&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",T)),this.log("_cleanUp :: forced? %s",k),k)this.options.reconnectPeriod===0&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let J=Object.assign({cmd:"disconnect"},U);this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(J,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),b(()=>{this.stream.end(()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)})})})}!this.disconnecting&&!this.reconnecting&&(this.log("_cleanUp :: client not disconnecting/reconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this._destroyKeepaliveManager(),T&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",T),T())}_storeAndSend(k,T,U){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",k.cmd);let J=k,X;if(J.cmd==="publish"&&(J=(0,s.default)(k),X=this._removeTopicAliasAndRecoverTopicName(J),X))return T&&T(X);this.outgoingStore.put(J,le=>{if(le)return T&&T(le);U(),this._writePacket(k,T)})}_applyTopicAlias(k){if(this.options.protocolVersion===5&&k.cmd==="publish"){let T;k.properties&&(T=k.properties.topicAlias);let U=k.topic.toString();if(this.topicAliasSend)if(T){if(U.length!==0&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",U,T),!this.topicAliasSend.put(U,T)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",U,T),new Error("Sending Topic Alias out of range")}else U.length!==0&&(this.options.autoAssignTopicAlias?(T=this.topicAliasSend.getAliasByTopic(U),T?(k.topic="",k.properties=Object.assign(Object.assign({},k.properties),{topicAlias:T}),this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",U,T)):(T=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(U,T),k.properties=Object.assign(Object.assign({},k.properties),{topicAlias:T}),this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",U,T))):this.options.autoUseTopicAlias&&(T=this.topicAliasSend.getAliasByTopic(U),T&&(k.topic="",k.properties=Object.assign(Object.assign({},k.properties),{topicAlias:T}),this.log("applyTopicAlias :: auto use topic: %s - alias: %d",U,T))));else if(T)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",U,T),new Error("Sending Topic Alias out of range")}}_noop(k){this.log("noop ::",k)}_writePacket(k,T){this.log("_writePacket :: packet: %O",k),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",k),this.log("_writePacket :: writing to stream");let U=e.default.writeToStream(k,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",U),!U&&T&&T!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",T)):T&&(this.log("_writePacket :: invoking cb"),T())}_sendPacket(k,T,U,J){this.log("_sendPacket :: (%s) :: start",this.options.clientId),U=U||this.noop,T=T||this.noop;let X=this._applyTopicAlias(k);if(X){T(X);return}if(!this.connected){if(k.cmd==="auth"){this._writePacket(k,T);return}this.log("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(k,T,U);return}if(J){this._writePacket(k,T);return}switch(k.cmd){case"publish":break;case"pubrel":this._storeAndSend(k,T,U);return;default:this._writePacket(k,T);return}switch(k.qos){case 2:case 1:this._storeAndSend(k,T,U);break;case 0:default:this._writePacket(k,T);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}_storePacket(k,T,U){this.log("_storePacket :: packet: %o",k),this.log("_storePacket :: cb? %s",!!T),U=U||this.noop;let J=k;if(J.cmd==="publish"){J=(0,s.default)(k);let le=this._removeTopicAliasAndRecoverTopicName(J);if(le)return T&&T(le)}let X=J.qos||0;X===0&&this.queueQoSZero||J.cmd!=="publish"?this.queue.push({packet:J,cb:T}):X>0?(T=this.outgoing[J.messageId]?this.outgoing[J.messageId].cb:null,this.outgoingStore.put(J,le=>{if(le)return T&&T(le);U()})):T&&T(new Error("No connection to broker"))}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.options.keepalive),!this.keepaliveManager&&this.options.keepalive&&(this.keepaliveManager=new w.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(k=!1){this.keepaliveManager&&this.options.keepalive&&(k||this.options.reschedulePings)&&this._reschedulePing()}_reschedulePing(){this.log("_reschedulePing :: rescheduling ping"),this.keepaliveManager.reschedule()}sendPing(){this.log("_sendPing :: sending pingreq"),this._sendPacket({cmd:"pingreq"})}onKeepaliveTimeout(){this.emit("error",new Error("Keepalive timeout")),this.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0)}_resubscribe(){this.log("_resubscribe");let k=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&k.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){this.log("_resubscribe: protocolVersion 5");for(let T=0;T<k.length;T++){let U={};U[k[T]]=this._resubscribeTopics[k[T]],U.resubscribe=!0,this.subscribe(U,{properties:U[k[T]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(k){if(this.disconnected){this.emit("connect",k);return}this.connackPacket=k,this.messageIdProvider.clear(),this._setupKeepaliveManager(),this.connected=!0;let T=()=>{let U=this.outgoingStore.createStream(),J=()=>{U.destroy(),U=null,this._flushStoreProcessingQueue(),X()},X=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",J),U.on("error",P=>{X(),this._flushStoreProcessingQueue(),this.removeListener("close",J),this.emit("error",P)});let le=()=>{if(!U)return;let P=U.read(1),G;if(!P){U.once("readable",le);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[P.messageId]){le();return}!this.disconnecting&&!this.reconnectTimer?(G=this.outgoing[P.messageId]?this.outgoing[P.messageId].cb:null,this.outgoing[P.messageId]={volatile:!1,cb(Z,V){G&&G(Z,V),le()}},this._packetIdsDuringStoreProcessing[P.messageId]=!0,this.messageIdProvider.register(P.messageId)?this._sendPacket(P,void 0,void 0,!0):this.log("messageId: %d has already used.",P.messageId)):U.destroy&&U.destroy()};U.on("end",()=>{let P=!0;for(let G in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[G]){P=!1;break}this.removeListener("close",J),P?(X(),this._invokeAllStoreProcessingQueue(),this.emit("connect",k)):T()}),le()};T()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){let k=this._storeProcessingQueue[0];if(k&&k.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(let k of this._storeProcessingQueue)k.cbStorePut&&k.cbStorePut(new Error("Connection closed")),k.callback&&k.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(k,T){delete this.outgoing[k],this.outgoingStore.del({messageId:k},(U,J)=>{T(U,J),this.messageIdProvider.deallocate(k),this._invokeStoreProcessingQueue()})}};N.VERSION=A.MQTTJS_VERSION,o.default=N}),Du=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"__esModule",{value:!0});var h=os(),i=class{constructor(){this.numberAllocator=new h.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(a){return this.numberAllocator.use(a)}deallocate(a){this.numberAllocator.free(a)}clear(){this.numberAllocator.clear()}};o.default=i});function qt(o){throw new RangeError(fs[o])}function as(o,h){let i=o.split("@"),a="";i.length>1&&(a=i[0]+"@",o=i[1]);let l=function(r,e){let n=[],t=r.length;for(;t--;)n[t]=e(r[t]);return n}((o=o.replace(hs,".")).split("."),h).join(".");return a+l}function ls(o){let h=[],i=0,a=o.length;for(;i<a;){let l=o.charCodeAt(i++);if(l>=55296&&l<=56319&&i<a){let r=o.charCodeAt(i++);(64512&r)==56320?h.push(((1023&l)<<10)+(1023&r)+65536):(h.push(l),i--)}else h.push(l)}return h}var us,cs,hs,fs,dt,Tr,gi,mi,Ai,bi,Ut,Lu=it(()=>{ce(),fe(),he(),us=/^xn--/,cs=/[^\0-\x7E]/,hs=/[\x2E\u3002\uFF0E\uFF61]/g,fs={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},dt=Math.floor,Tr=String.fromCharCode,gi=function(o,h){return o+22+75*(o<26)-((h!=0)<<5)},mi=function(o,h,i){let a=0;for(o=i?dt(o/700):o>>1,o+=dt(o/h);o>455;a+=36)o=dt(o/35);return dt(a+36*o/(o+38))},Ai=function(o){let h=[],i=o.length,a=0,l=128,r=72,e=o.lastIndexOf("-");e<0&&(e=0);for(let t=0;t<e;++t)o.charCodeAt(t)>=128&&qt("not-basic"),h.push(o.charCodeAt(t));for(let t=e>0?e+1:0;t<i;){let s=a;for(let d=1,p=36;;p+=36){t>=i&&qt("invalid-input");let m=(n=o.charCodeAt(t++))-48<10?n-22:n-65<26?n-65:n-97<26?n-97:36;(m>=36||m>dt((2147483647-a)/d))&&qt("overflow"),a+=m*d;let A=p<=r?1:p>=r+26?26:p-r;if(m<A)break;let y=36-A;d>dt(2147483647/y)&&qt("overflow"),d*=y}let u=h.length+1;r=mi(a-s,u,s==0),dt(a/u)>2147483647-l&&qt("overflow"),l+=dt(a/u),a%=u,h.splice(a++,0,l)}var n;return String.fromCodePoint(...h)},bi=function(o){let h=[],i=(o=ls(o)).length,a=128,l=0,r=72;for(let t of o)t<128&&h.push(Tr(t));let e=h.length,n=e;for(e&&h.push("-");n<i;){let t=2147483647;for(let u of o)u>=a&&u<t&&(t=u);let s=n+1;t-a>dt((2147483647-l)/s)&&qt("overflow"),l+=(t-a)*s,a=t;for(let u of o)if(u<a&&++l>2147483647&&qt("overflow"),u==a){let d=l;for(let p=36;;p+=36){let m=p<=r?1:p>=r+26?26:p-r;if(d<m)break;let A=d-m,y=36-m;h.push(Tr(gi(m+A%y,0))),d=dt(A/y)}h.push(Tr(gi(d,0))),r=mi(l,s,n==e),l=0,++n}++l,++a}return h.join("")},Ut={version:"2.1.0",ucs2:{decode:ls,encode:o=>String.fromCodePoint(...o)},decode:Ai,encode:bi,toASCII:function(o){return as(o,function(h){return cs.test(h)?"xn--"+bi(h):h})},toUnicode:function(o){return as(o,function(h){return us.test(h)?Ai(h.slice(4).toLowerCase()):h})}},Ut.decode,Ut.encode,Ut.toASCII,Ut.toUnicode,Ut.ucs2,Ut.version});function Nu(o,h){return Object.prototype.hasOwnProperty.call(o,h)}var ds,or,ps,mt,Fu=it(()=>{ce(),fe(),he(),ds=function(o,h,i,a){h=h||"&",i=i||"=";var l={};if(typeof o!="string"||o.length===0)return l;var r=/\+/g;o=o.split(h);var e=1e3;a&&typeof a.maxKeys=="number"&&(e=a.maxKeys);var n=o.length;e>0&&n>e&&(n=e);for(var t=0;t<n;++t){var s,u,d,p,m=o[t].replace(r,"%20"),A=m.indexOf(i);A>=0?(s=m.substr(0,A),u=m.substr(A+1)):(s=m,u=""),d=decodeURIComponent(s),p=decodeURIComponent(u),Nu(l,d)?Array.isArray(l[d])?l[d].push(p):l[d]=[l[d],p]:l[d]=p}return l},or=function(o){switch(typeof o){case"string":return o;case"boolean":return o?"true":"false";case"number":return isFinite(o)?o:"";default:return""}},ps=function(o,h,i,a){return h=h||"&",i=i||"=",o===null&&(o=void 0),typeof o=="object"?Object.keys(o).map(function(l){var r=encodeURIComponent(or(l))+i;return Array.isArray(o[l])?o[l].map(function(e){return r+encodeURIComponent(or(e))}).join(h):r+encodeURIComponent(or(o[l]))}).join(h):a?encodeURIComponent(or(a))+i+encodeURIComponent(or(o)):""},mt={},mt.decode=mt.parse=ds,mt.encode=mt.stringify=ps,mt.decode,mt.encode,mt.parse,mt.stringify});function wi(){throw new Error("setTimeout has not been defined")}function yi(){throw new Error("clearTimeout has not been defined")}function gs(o){if(Bt===setTimeout)return setTimeout(o,0);if((Bt===wi||!Bt)&&setTimeout)return Bt=setTimeout,setTimeout(o,0);try{return Bt(o,0)}catch{try{return Bt.call(null,o,0)}catch{return Bt.call(this||$t,o,0)}}}function ju(){Gt&&zt&&(Gt=!1,zt.length?At=zt.concat(At):fr=-1,At.length&&ms())}function ms(){if(!Gt){var o=gs(ju);Gt=!0;for(var h=At.length;h;){for(zt=At,At=[];++fr<h;)zt&&zt[fr].run();fr=-1,h=At.length}zt=null,Gt=!1,function(i){if(Ot===clearTimeout)return clearTimeout(i);if((Ot===yi||!Ot)&&clearTimeout)return Ot=clearTimeout,clearTimeout(i);try{Ot(i)}catch{try{return Ot.call(null,i)}catch{return Ot.call(this||$t,i)}}}(o)}}function As(o,h){(this||$t).fun=o,(this||$t).array=h}function Tt(){}var bs,Bt,Ot,$t,Ge,zt,At,Gt,fr,$e,Wu=it(()=>{ce(),fe(),he(),$t=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Ge=bs={},function(){try{Bt=typeof setTimeout=="function"?setTimeout:wi}catch{Bt=wi}try{Ot=typeof clearTimeout=="function"?clearTimeout:yi}catch{Ot=yi}}(),At=[],Gt=!1,fr=-1,Ge.nextTick=function(o){var h=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)h[i-1]=arguments[i];At.push(new As(o,h)),At.length!==1||Gt||gs(ms)},As.prototype.run=function(){(this||$t).fun.apply(null,(this||$t).array)},Ge.title="browser",Ge.browser=!0,Ge.env={},Ge.argv=[],Ge.version="",Ge.versions={},Ge.on=Tt,Ge.addListener=Tt,Ge.once=Tt,Ge.off=Tt,Ge.removeListener=Tt,Ge.removeAllListeners=Tt,Ge.emit=Tt,Ge.prependListener=Tt,Ge.prependOnceListener=Tt,Ge.listeners=function(o){return[]},Ge.binding=function(o){throw new Error("process.binding is not supported")},Ge.cwd=function(){return"/"},Ge.chdir=function(o){throw new Error("process.chdir is not supported")},Ge.umask=function(){return 0},$e=bs,$e.addListener,$e.argv,$e.binding,$e.browser,$e.chdir,$e.cwd,$e.emit,$e.env,$e.listeners,$e.nextTick,$e.off,$e.on,$e.once,$e.prependListener,$e.prependOnceListener,$e.removeAllListeners,$e.removeListener,$e.title,$e.umask,$e.version,$e.versions});function Vu(){if(vi)return Br;vi=!0;var o=Br={},h,i;function a(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?h=setTimeout:h=a}catch{h=a}try{typeof clearTimeout=="function"?i=clearTimeout:i=l}catch{i=l}})();function r(y){if(h===setTimeout)return setTimeout(y,0);if((h===a||!h)&&setTimeout)return h=setTimeout,setTimeout(y,0);try{return h(y,0)}catch{try{return h.call(null,y,0)}catch{return h.call(this||Yt,y,0)}}}function e(y){if(i===clearTimeout)return clearTimeout(y);if((i===l||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(y);try{return i(y)}catch{try{return i.call(null,y)}catch{return i.call(this||Yt,y)}}}var n=[],t=!1,s,u=-1;function d(){!t||!s||(t=!1,s.length?n=s.concat(n):u=-1,n.length&&p())}function p(){if(!t){var y=r(d);t=!0;for(var w=n.length;w;){for(s=n,n=[];++u<w;)s&&s[u].run();u=-1,w=n.length}s=null,t=!1,e(y)}}o.nextTick=function(y){var w=new Array(arguments.length-1);if(arguments.length>1)for(var C=1;C<arguments.length;C++)w[C-1]=arguments[C];n.push(new m(y,w)),n.length===1&&!t&&r(p)};function m(y,w){(this||Yt).fun=y,(this||Yt).array=w}m.prototype.run=function(){(this||Yt).fun.apply(null,(this||Yt).array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={};function A(){}return o.on=A,o.addListener=A,o.once=A,o.off=A,o.removeListener=A,o.removeAllListeners=A,o.emit=A,o.prependListener=A,o.prependOnceListener=A,o.listeners=function(y){return[]},o.binding=function(y){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(y){throw new Error("process.chdir is not supported")},o.umask=function(){return 0},Br}var Br,vi,Yt,Ve,ws=it(()=>{ce(),fe(),he(),Br={},vi=!1,Yt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Ve=Vu(),Ve.platform="browser",Ve.addListener,Ve.argv,Ve.binding,Ve.browser,Ve.chdir,Ve.cwd,Ve.emit,Ve.env,Ve.listeners,Ve.nextTick,Ve.off,Ve.on,Ve.once,Ve.prependListener,Ve.prependOnceListener,Ve.removeAllListeners,Ve.removeListener,Ve.title,Ve.umask,Ve.version,Ve.versions});function Qu(){if(_i)return Or;_i=!0;var o=Ve;function h(r){if(typeof r!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(r))}function i(r,e){for(var n="",t=0,s=-1,u=0,d,p=0;p<=r.length;++p){if(p<r.length)d=r.charCodeAt(p);else{if(d===47)break;d=47}if(d===47){if(!(s===p-1||u===1))if(s!==p-1&&u===2){if(n.length<2||t!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){var m=n.lastIndexOf("/");if(m!==n.length-1){m===-1?(n="",t=0):(n=n.slice(0,m),t=n.length-1-n.lastIndexOf("/")),s=p,u=0;continue}}else if(n.length===2||n.length===1){n="",t=0,s=p,u=0;continue}}e&&(n.length>0?n+="/..":n="..",t=2)}else n.length>0?n+="/"+r.slice(s+1,p):n=r.slice(s+1,p),t=p-s-1;s=p,u=0}else d===46&&u!==-1?++u:u=-1}return n}function a(r,e){var n=e.dir||e.root,t=e.base||(e.name||"")+(e.ext||"");return n?n===e.root?n+t:n+r+t:t}var l={resolve:function(){for(var r="",e=!1,n,t=arguments.length-1;t>=-1&&!e;t--){var s;t>=0?s=arguments[t]:(n===void 0&&(n=o.cwd()),s=n),h(s),s.length!==0&&(r=s+"/"+r,e=s.charCodeAt(0)===47)}return r=i(r,!e),e?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(r){if(h(r),r.length===0)return".";var e=r.charCodeAt(0)===47,n=r.charCodeAt(r.length-1)===47;return r=i(r,!e),r.length===0&&!e&&(r="."),r.length>0&&n&&(r+="/"),e?"/"+r:r},isAbsolute:function(r){return h(r),r.length>0&&r.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var r,e=0;e<arguments.length;++e){var n=arguments[e];h(n),n.length>0&&(r===void 0?r=n:r+="/"+n)}return r===void 0?".":l.normalize(r)},relative:function(r,e){if(h(r),h(e),r===e||(r=l.resolve(r),e=l.resolve(e),r===e))return"";for(var n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var t=r.length,s=t-n,u=1;u<e.length&&e.charCodeAt(u)===47;++u);for(var d=e.length,p=d-u,m=s<p?s:p,A=-1,y=0;y<=m;++y){if(y===m){if(p>m){if(e.charCodeAt(u+y)===47)return e.slice(u+y+1);if(y===0)return e.slice(u+y)}else s>m&&(r.charCodeAt(n+y)===47?A=y:y===0&&(A=0));break}var w=r.charCodeAt(n+y),C=e.charCodeAt(u+y);if(w!==C)break;w===47&&(A=y)}var b="";for(y=n+A+1;y<=t;++y)(y===t||r.charCodeAt(y)===47)&&(b.length===0?b+="..":b+="/..");return b.length>0?b+e.slice(u+A):(u+=A,e.charCodeAt(u)===47&&++u,e.slice(u))},_makeLong:function(r){return r},dirname:function(r){if(h(r),r.length===0)return".";for(var e=r.charCodeAt(0),n=e===47,t=-1,s=!0,u=r.length-1;u>=1;--u)if(e=r.charCodeAt(u),e===47){if(!s){t=u;break}}else s=!1;return t===-1?n?"/":".":n&&t===1?"//":r.slice(0,t)},basename:function(r,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');h(r);var n=0,t=-1,s=!0,u;if(e!==void 0&&e.length>0&&e.length<=r.length){if(e.length===r.length&&e===r)return"";var d=e.length-1,p=-1;for(u=r.length-1;u>=0;--u){var m=r.charCodeAt(u);if(m===47){if(!s){n=u+1;break}}else p===-1&&(s=!1,p=u+1),d>=0&&(m===e.charCodeAt(d)?--d===-1&&(t=u):(d=-1,t=p))}return n===t?t=p:t===-1&&(t=r.length),r.slice(n,t)}else{for(u=r.length-1;u>=0;--u)if(r.charCodeAt(u)===47){if(!s){n=u+1;break}}else t===-1&&(s=!1,t=u+1);return t===-1?"":r.slice(n,t)}},extname:function(r){h(r);for(var e=-1,n=0,t=-1,s=!0,u=0,d=r.length-1;d>=0;--d){var p=r.charCodeAt(d);if(p===47){if(!s){n=d+1;break}continue}t===-1&&(s=!1,t=d+1),p===46?e===-1?e=d:u!==1&&(u=1):e!==-1&&(u=-1)}return e===-1||t===-1||u===0||u===1&&e===t-1&&e===n+1?"":r.slice(e,t)},format:function(r){if(r===null||typeof r!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof r);return a("/",r)},parse:function(r){h(r);var e={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return e;var n=r.charCodeAt(0),t=n===47,s;t?(e.root="/",s=1):s=0;for(var u=-1,d=0,p=-1,m=!0,A=r.length-1,y=0;A>=s;--A){if(n=r.charCodeAt(A),n===47){if(!m){d=A+1;break}continue}p===-1&&(m=!1,p=A+1),n===46?u===-1?u=A:y!==1&&(y=1):u!==-1&&(y=-1)}return u===-1||p===-1||y===0||y===1&&u===p-1&&u===d+1?p!==-1&&(d===0&&t?e.base=e.name=r.slice(1,p):e.base=e.name=r.slice(d,p)):(d===0&&t?(e.name=r.slice(1,u),e.base=r.slice(1,p)):(e.name=r.slice(d,u),e.base=r.slice(d,p)),e.ext=r.slice(u,p)),d>0?e.dir=r.slice(0,d-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};return l.posix=l,Or=l,Or}var Or,_i,Ei,Ku=it(()=>{ce(),fe(),he(),ws(),Or={},_i=!1,Ei=Qu()}),ys={};tr(ys,{URL:()=>$s,Url:()=>Vs,default:()=>Fe,fileURLToPath:()=>vs,format:()=>Qs,parse:()=>qs,pathToFileURL:()=>_s,resolve:()=>Ks,resolveObject:()=>Hs});function ht(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function dr(o,h,i){if(o&&pt.isObject(o)&&o instanceof ht)return o;var a=new ht;return a.parse(o,h,i),a}function Hu(){if(Ii)return Mr;Ii=!0;var o=$e;function h(r){if(typeof r!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(r))}function i(r,e){for(var n="",t=0,s=-1,u=0,d,p=0;p<=r.length;++p){if(p<r.length)d=r.charCodeAt(p);else{if(d===47)break;d=47}if(d===47){if(!(s===p-1||u===1))if(s!==p-1&&u===2){if(n.length<2||t!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){var m=n.lastIndexOf("/");if(m!==n.length-1){m===-1?(n="",t=0):(n=n.slice(0,m),t=n.length-1-n.lastIndexOf("/")),s=p,u=0;continue}}else if(n.length===2||n.length===1){n="",t=0,s=p,u=0;continue}}e&&(n.length>0?n+="/..":n="..",t=2)}else n.length>0?n+="/"+r.slice(s+1,p):n=r.slice(s+1,p),t=p-s-1;s=p,u=0}else d===46&&u!==-1?++u:u=-1}return n}function a(r,e){var n=e.dir||e.root,t=e.base||(e.name||"")+(e.ext||"");return n?n===e.root?n+t:n+r+t:t}var l={resolve:function(){for(var r="",e=!1,n,t=arguments.length-1;t>=-1&&!e;t--){var s;t>=0?s=arguments[t]:(n===void 0&&(n=o.cwd()),s=n),h(s),s.length!==0&&(r=s+"/"+r,e=s.charCodeAt(0)===47)}return r=i(r,!e),e?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(r){if(h(r),r.length===0)return".";var e=r.charCodeAt(0)===47,n=r.charCodeAt(r.length-1)===47;return r=i(r,!e),r.length===0&&!e&&(r="."),r.length>0&&n&&(r+="/"),e?"/"+r:r},isAbsolute:function(r){return h(r),r.length>0&&r.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var r,e=0;e<arguments.length;++e){var n=arguments[e];h(n),n.length>0&&(r===void 0?r=n:r+="/"+n)}return r===void 0?".":l.normalize(r)},relative:function(r,e){if(h(r),h(e),r===e||(r=l.resolve(r),e=l.resolve(e),r===e))return"";for(var n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var t=r.length,s=t-n,u=1;u<e.length&&e.charCodeAt(u)===47;++u);for(var d=e.length,p=d-u,m=s<p?s:p,A=-1,y=0;y<=m;++y){if(y===m){if(p>m){if(e.charCodeAt(u+y)===47)return e.slice(u+y+1);if(y===0)return e.slice(u+y)}else s>m&&(r.charCodeAt(n+y)===47?A=y:y===0&&(A=0));break}var w=r.charCodeAt(n+y),C=e.charCodeAt(u+y);if(w!==C)break;w===47&&(A=y)}var b="";for(y=n+A+1;y<=t;++y)(y===t||r.charCodeAt(y)===47)&&(b.length===0?b+="..":b+="/..");return b.length>0?b+e.slice(u+A):(u+=A,e.charCodeAt(u)===47&&++u,e.slice(u))},_makeLong:function(r){return r},dirname:function(r){if(h(r),r.length===0)return".";for(var e=r.charCodeAt(0),n=e===47,t=-1,s=!0,u=r.length-1;u>=1;--u)if(e=r.charCodeAt(u),e===47){if(!s){t=u;break}}else s=!1;return t===-1?n?"/":".":n&&t===1?"//":r.slice(0,t)},basename:function(r,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');h(r);var n=0,t=-1,s=!0,u;if(e!==void 0&&e.length>0&&e.length<=r.length){if(e.length===r.length&&e===r)return"";var d=e.length-1,p=-1;for(u=r.length-1;u>=0;--u){var m=r.charCodeAt(u);if(m===47){if(!s){n=u+1;break}}else p===-1&&(s=!1,p=u+1),d>=0&&(m===e.charCodeAt(d)?--d===-1&&(t=u):(d=-1,t=p))}return n===t?t=p:t===-1&&(t=r.length),r.slice(n,t)}else{for(u=r.length-1;u>=0;--u)if(r.charCodeAt(u)===47){if(!s){n=u+1;break}}else t===-1&&(s=!1,t=u+1);return t===-1?"":r.slice(n,t)}},extname:function(r){h(r);for(var e=-1,n=0,t=-1,s=!0,u=0,d=r.length-1;d>=0;--d){var p=r.charCodeAt(d);if(p===47){if(!s){n=d+1;break}continue}t===-1&&(s=!1,t=d+1),p===46?e===-1?e=d:u!==1&&(u=1):e!==-1&&(u=-1)}return e===-1||t===-1||u===0||u===1&&e===t-1&&e===n+1?"":r.slice(e,t)},format:function(r){if(r===null||typeof r!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof r);return a("/",r)},parse:function(r){h(r);var e={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return e;var n=r.charCodeAt(0),t=n===47,s;t?(e.root="/",s=1):s=0;for(var u=-1,d=0,p=-1,m=!0,A=r.length-1,y=0;A>=s;--A){if(n=r.charCodeAt(A),n===47){if(!m){d=A+1;break}continue}p===-1&&(m=!1,p=A+1),n===46?u===-1?u=A:y!==1&&(y=1):u!==-1&&(y=-1)}return u===-1||p===-1||y===0||y===1&&u===p-1&&u===d+1?p!==-1&&(d===0&&t?e.base=e.name=r.slice(1,p):e.base=e.name=r.slice(d,p)):(d===0&&t?(e.name=r.slice(1,u),e.base=r.slice(1,p)):(e.name=r.slice(d,u),e.base=r.slice(d,p)),e.ext=r.slice(u,p)),d>0?e.dir=r.slice(0,d-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};return l.posix=l,Mr=l,Mr}function qu(o){if(typeof o=="string")o=new URL(o);else if(!(o instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(o.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return Ur?$u(o):zu(o)}function $u(o){let h=o.hostname,i=o.pathname;for(let a=0;a<i.length;a++)if(i[a]==="%"){let l=i.codePointAt(a+2)||32;if(i[a+1]==="2"&&l===102||i[a+1]==="5"&&l===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(i=i.replace(Us,"\\"),i=decodeURIComponent(i),h!=="")return`\\\\${h}${i}`;{let a=i.codePointAt(1)|32,l=i[2];if(a<Rs||a>Ms||l!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return i.slice(1)}}function zu(o){if(o.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let h=o.pathname;for(let i=0;i<h.length;i++)if(h[i]==="%"){let a=h.codePointAt(i+2)||32;if(h[i+1]==="2"&&a===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(h)}function Gu(o){let h=Ti.resolve(o),i=o.charCodeAt(o.length-1);(i===xs||Ur&&i===Ps)&&h[h.length-1]!==Ti.sep&&(h+="/");let a=new URL("file://");return h.includes("%")&&(h=h.replace(Ds,"%25")),!Ur&&h.includes("\\")&&(h=h.replace(Ls,"%5C")),h.includes(`
4
- `)&&(h=h.replace(Ns,"%0A")),h.includes("\r")&&(h=h.replace(Fs,"%0D")),h.includes(" ")&&(h=h.replace(js,"%09")),a.pathname=h,a}function vs(o){if(typeof o=="string")o=new URL(o);else if(!(o instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(o.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return Dr?Yu(o):Ju(o)}function Yu(o){let h=o.hostname,i=o.pathname;for(let a=0;a<i.length;a++)if(i[a]==="%"){let l=i.codePointAt(a+2)||32;if(i[a+1]==="2"&&l===102||i[a+1]==="5"&&l===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(i=i.replace(Zs,"\\"),i=decodeURIComponent(i),h!=="")return`\\\\${h}${i}`;{let a=i.codePointAt(1)|32,l=i[2];if(a<Ys||a>Js||l!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return i.slice(1)}}function Ju(o){if(o.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let h=o.pathname;for(let i=0;i<h.length;i++)if(h[i]==="%"){let a=h.codePointAt(i+2)||32;if(h[i+1]==="2"&&a===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(h)}function _s(o){let h=Ei.resolve(o),i=o.charCodeAt(o.length-1);(i===Gs||Dr&&i===zs)&&h[h.length-1]!==Ei.sep&&(h+="/");let a=new URL("file://");return h.includes("%")&&(h=h.replace(Xs,"%25")),!Dr&&h.includes("\\")&&(h=h.replace(ea,"%5C")),h.includes(`
5
- `)&&(h=h.replace(ta,"%0A")),h.includes("\r")&&(h=h.replace(ra,"%0D")),h.includes(" ")&&(h=h.replace(na,"%09")),a.pathname=h,a}var Fe,Es,pt,Ss,Cs,ks,Is,Pr,Si,Ci,ki,Ts,Bs,xr,Jt,Rr,Mr,Ii,Ti,Os,Ps,xs,Rs,Ms,Ur,Us,Ds,Ls,Ns,Fs,js,Ws,Vs,Qs,Ks,Hs,qs,$s,zs,Gs,Ys,Js,Dr,Zs,Xs,ea,ta,ra,na,Zu=it(()=>{ce(),fe(),he(),Lu(),Fu(),Wu(),Ku(),ws(),Fe={},Es=Ut,pt={isString:function(o){return typeof o=="string"},isObject:function(o){return typeof o=="object"&&o!==null},isNull:function(o){return o===null},isNullOrUndefined:function(o){return o==null}},Fe.parse=dr,Fe.resolve=function(o,h){return dr(o,!1,!0).resolve(h)},Fe.resolveObject=function(o,h){return o?dr(o,!1,!0).resolveObject(h):h},Fe.format=function(o){return pt.isString(o)&&(o=dr(o)),o instanceof ht?o.format():ht.prototype.format.call(o)},Fe.Url=ht,Ss=/^([a-z0-9.+-]+:)/i,Cs=/:[0-9]*$/,ks=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Is=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
6
- `," "]),Pr=["'"].concat(Is),Si=["%","/","?",";","#"].concat(Pr),Ci=["/","?","#"],ki=/^[+a-z0-9A-Z_-]{0,63}$/,Ts=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Bs={javascript:!0,"javascript:":!0},xr={javascript:!0,"javascript:":!0},Jt={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Rr=mt,ht.prototype.parse=function(o,h,i){if(!pt.isString(o))throw new TypeError("Parameter 'url' must be a string, not "+typeof o);var a=o.indexOf("?"),l=a!==-1&&a<o.indexOf("#")?"?":"#",r=o.split(l);r[0]=r[0].replace(/\\/g,"/");var e=o=r.join(l);if(e=e.trim(),!i&&o.split("#").length===1){var n=ks.exec(e);if(n)return this.path=e,this.href=e,this.pathname=n[1],n[2]?(this.search=n[2],this.query=h?Rr.parse(this.search.substr(1)):this.search.substr(1)):h&&(this.search="",this.query={}),this}var t=Ss.exec(e);if(t){var s=(t=t[0]).toLowerCase();this.protocol=s,e=e.substr(t.length)}if(i||t||e.match(/^\/\/[^@\/]+@[^@\/]+/)){var u=e.substr(0,2)==="//";!u||t&&xr[t]||(e=e.substr(2),this.slashes=!0)}if(!xr[t]&&(u||t&&!Jt[t])){for(var d,p,m=-1,A=0;A<Ci.length;A++)(y=e.indexOf(Ci[A]))!==-1&&(m===-1||y<m)&&(m=y);for((p=m===-1?e.lastIndexOf("@"):e.lastIndexOf("@",m))!==-1&&(d=e.slice(0,p),e=e.slice(p+1),this.auth=decodeURIComponent(d)),m=-1,A=0;A<Si.length;A++){var y;(y=e.indexOf(Si[A]))!==-1&&(m===-1||y<m)&&(m=y)}m===-1&&(m=e.length),this.host=e.slice(0,m),e=e.slice(m),this.parseHost(),this.hostname=this.hostname||"";var w=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!w)for(var C=this.hostname.split(/\./),b=(A=0,C.length);A<b;A++){var _=C[A];if(_&&!_.match(ki)){for(var N="",M=0,k=_.length;M<k;M++)_.charCodeAt(M)>127?N+="x":N+=_[M];if(!N.match(ki)){var T=C.slice(0,A),U=C.slice(A+1),J=_.match(Ts);J&&(T.push(J[1]),U.unshift(J[2])),U.length&&(e="/"+U.join(".")+e),this.hostname=T.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),w||(this.hostname=Es.toASCII(this.hostname));var X=this.port?":"+this.port:"",le=this.hostname||"";this.host=le+X,this.href+=this.host,w&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),e[0]!=="/"&&(e="/"+e))}if(!Bs[s])for(A=0,b=Pr.length;A<b;A++){var P=Pr[A];if(e.indexOf(P)!==-1){var G=encodeURIComponent(P);G===P&&(G=escape(P)),e=e.split(P).join(G)}}var Z=e.indexOf("#");Z!==-1&&(this.hash=e.substr(Z),e=e.slice(0,Z));var V=e.indexOf("?");if(V!==-1?(this.search=e.substr(V),this.query=e.substr(V+1),h&&(this.query=Rr.parse(this.query)),e=e.slice(0,V)):h&&(this.search="",this.query={}),e&&(this.pathname=e),Jt[s]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){X=this.pathname||"";var be=this.search||"";this.path=X+be}return this.href=this.format(),this},ht.prototype.format=function(){var o=this.auth||"";o&&(o=(o=encodeURIComponent(o)).replace(/%3A/i,":"),o+="@");var h=this.protocol||"",i=this.pathname||"",a=this.hash||"",l=!1,r="";this.host?l=o+this.host:this.hostname&&(l=o+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(l+=":"+this.port)),this.query&&pt.isObject(this.query)&&Object.keys(this.query).length&&(r=Rr.stringify(this.query));var e=this.search||r&&"?"+r||"";return h&&h.substr(-1)!==":"&&(h+=":"),this.slashes||(!h||Jt[h])&&l!==!1?(l="//"+(l||""),i&&i.charAt(0)!=="/"&&(i="/"+i)):l||(l=""),a&&a.charAt(0)!=="#"&&(a="#"+a),e&&e.charAt(0)!=="?"&&(e="?"+e),h+l+(i=i.replace(/[?#]/g,function(n){return encodeURIComponent(n)}))+(e=e.replace("#","%23"))+a},ht.prototype.resolve=function(o){return this.resolveObject(dr(o,!1,!0)).format()},ht.prototype.resolveObject=function(o){if(pt.isString(o)){var h=new ht;h.parse(o,!1,!0),o=h}for(var i=new ht,a=Object.keys(this),l=0;l<a.length;l++){var r=a[l];i[r]=this[r]}if(i.hash=o.hash,o.href==="")return i.href=i.format(),i;if(o.slashes&&!o.protocol){for(var e=Object.keys(o),n=0;n<e.length;n++){var t=e[n];t!=="protocol"&&(i[t]=o[t])}return Jt[i.protocol]&&i.hostname&&!i.pathname&&(i.path=i.pathname="/"),i.href=i.format(),i}if(o.protocol&&o.protocol!==i.protocol){if(!Jt[o.protocol]){for(var s=Object.keys(o),u=0;u<s.length;u++){var d=s[u];i[d]=o[d]}return i.href=i.format(),i}if(i.protocol=o.protocol,o.host||xr[o.protocol])i.pathname=o.pathname;else{for(var p=(o.pathname||"").split("/");p.length&&!(o.host=p.shift()););o.host||(o.host=""),o.hostname||(o.hostname=""),p[0]!==""&&p.unshift(""),p.length<2&&p.unshift(""),i.pathname=p.join("/")}if(i.search=o.search,i.query=o.query,i.host=o.host||"",i.auth=o.auth,i.hostname=o.hostname||o.host,i.port=o.port,i.pathname||i.search){var m=i.pathname||"",A=i.search||"";i.path=m+A}return i.slashes=i.slashes||o.slashes,i.href=i.format(),i}var y=i.pathname&&i.pathname.charAt(0)==="/",w=o.host||o.pathname&&o.pathname.charAt(0)==="/",C=w||y||i.host&&o.pathname,b=C,_=i.pathname&&i.pathname.split("/")||[],N=(p=o.pathname&&o.pathname.split("/")||[],i.protocol&&!Jt[i.protocol]);if(N&&(i.hostname="",i.port=null,i.host&&(_[0]===""?_[0]=i.host:_.unshift(i.host)),i.host="",o.protocol&&(o.hostname=null,o.port=null,o.host&&(p[0]===""?p[0]=o.host:p.unshift(o.host)),o.host=null),C=C&&(p[0]===""||_[0]==="")),w)i.host=o.host||o.host===""?o.host:i.host,i.hostname=o.hostname||o.hostname===""?o.hostname:i.hostname,i.search=o.search,i.query=o.query,_=p;else if(p.length)_||(_=[]),_.pop(),_=_.concat(p),i.search=o.search,i.query=o.query;else if(!pt.isNullOrUndefined(o.search))return N&&(i.hostname=i.host=_.shift(),(J=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=J.shift(),i.host=i.hostname=J.shift())),i.search=o.search,i.query=o.query,pt.isNull(i.pathname)&&pt.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i;if(!_.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var M=_.slice(-1)[0],k=(i.host||o.host||_.length>1)&&(M==="."||M==="..")||M==="",T=0,U=_.length;U>=0;U--)(M=_[U])==="."?_.splice(U,1):M===".."?(_.splice(U,1),T++):T&&(_.splice(U,1),T--);if(!C&&!b)for(;T--;T)_.unshift("..");!C||_[0]===""||_[0]&&_[0].charAt(0)==="/"||_.unshift(""),k&&_.join("/").substr(-1)!=="/"&&_.push("");var J,X=_[0]===""||_[0]&&_[0].charAt(0)==="/";return N&&(i.hostname=i.host=X?"":_.length?_.shift():"",(J=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=J.shift(),i.host=i.hostname=J.shift())),(C=C||i.host&&_.length)&&!X&&_.unshift(""),_.length?i.pathname=_.join("/"):(i.pathname=null,i.path=null),pt.isNull(i.pathname)&&pt.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=o.auth||i.auth,i.slashes=i.slashes||o.slashes,i.href=i.format(),i},ht.prototype.parseHost=function(){var o=this.host,h=Cs.exec(o);h&&((h=h[0])!==":"&&(this.port=h.substr(1)),o=o.substr(0,o.length-h.length)),o&&(this.hostname=o)},Fe.Url,Fe.format,Fe.resolve,Fe.resolveObject,Mr={},Ii=!1,Ti=Hu(),Os=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0,Fe.URL=typeof URL<"u"?URL:null,Fe.pathToFileURL=Gu,Fe.fileURLToPath=qu,Fe.Url,Fe.format,Fe.resolve,Fe.resolveObject,Fe.URL,Ps=92,xs=47,Rs=97,Ms=122,Ur=Os==="win32",Us=/\//g,Ds=/%/g,Ls=/\\/g,Ns=/\n/g,Fs=/\r/g,js=/\t/g,Ws=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0,Fe.URL=typeof URL<"u"?URL:null,Fe.pathToFileURL=_s,Fe.fileURLToPath=vs,Vs=Fe.Url,Qs=Fe.format,Ks=Fe.resolve,Hs=Fe.resolveObject,qs=Fe.parse,$s=Fe.URL,zs=92,Gs=47,Ys=97,Js=122,Dr=Ws==="win32",Zs=/\//g,Xs=/%/g,ea=/\\/g,ta=/\n/g,ra=/\r/g,na=/\t/g}),Xu=Ae((o,h)=>{ce(),fe(),he(),h.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}),Bi=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"__esModule",{value:!0}),o.BufferedDuplex=void 0,o.writev=a;var h=Ht(),i=(Xe(),Le(Ze));function a(r,e){let n=new Array(r.length);for(let t=0;t<r.length;t++)typeof r[t].chunk=="string"?n[t]=i.Buffer.from(r[t].chunk,"utf8"):n[t]=r[t].chunk;this._write(i.Buffer.concat(n),"binary",e)}var l=class extends h.Duplex{constructor(r,e,n){super({objectMode:!0}),this.proxy=e,this.socket=n,this.writeQueue=[],r.objectMode||(this._writev=a.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",t=>{!this.destroyed&&this.readable&&this.push(t)})}_read(r){this.proxy.read(r)}_write(r,e,n){this.isSocketOpen?this.writeToProxy(r,e,n):this.writeQueue.push({chunk:r,encoding:e,cb:n})}_final(r){this.writeQueue=[],this.proxy.end(r)}_destroy(r,e){this.writeQueue=[],this.proxy.destroy(),e(r)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(r,e,n){this.proxy.write(r,e)===!1?this.proxy.once("drain",n):n()}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:r,encoding:e,cb:n}=this.writeQueue.shift();this.writeToProxy(r,e,n)}}};o.BufferedDuplex=l}),Lr=Ae(o=>{ce(),fe(),he();var h=o&&o.__importDefault||function(C){return C&&C.__esModule?C:{default:C}};Object.defineProperty(o,"__esModule",{value:!0}),o.streamBuilder=o.browserStreamBuilder=void 0;var i=(Xe(),Le(Ze)),a=h(Xu()),l=h(Ct()),r=Ht(),e=h(Ir()),n=Bi(),t=(0,l.default)("mqttjs:ws"),s=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function u(C,b){let _=`${C.protocol}://${C.hostname}:${C.port}${C.path}`;return typeof C.transformWsUrl=="function"&&(_=C.transformWsUrl(_,C,b)),_}function d(C){let b=C;return C.port||(C.protocol==="wss"?b.port=443:b.port=80),C.path||(b.path="/"),C.wsOptions||(b.wsOptions={}),!e.default&&!C.forceNativeWebSocket&&C.protocol==="wss"&&s.forEach(_=>{Object.prototype.hasOwnProperty.call(C,_)&&!Object.prototype.hasOwnProperty.call(C.wsOptions,_)&&(b.wsOptions[_]=C[_])}),b}function p(C){let b=d(C);if(b.hostname||(b.hostname=b.host),!b.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let _=new URL(document.URL);b.hostname=_.hostname,b.port||(b.port=Number(_.port))}return b.objectMode===void 0&&(b.objectMode=!(b.binary===!0||b.binary===void 0)),b}function m(C,b,_){t("createWebSocket"),t(`protocol: ${_.protocolId} ${_.protocolVersion}`);let N=_.protocolId==="MQIsdp"&&_.protocolVersion===3?"mqttv3.1":"mqtt";t(`creating new Websocket for url: ${b} and protocol: ${N}`);let M;return _.createWebsocket?M=_.createWebsocket(b,[N],_):M=new a.default(b,[N],_.wsOptions),M}function A(C,b){let _=b.protocolId==="MQIsdp"&&b.protocolVersion===3?"mqttv3.1":"mqtt",N=u(b,C),M;return b.createWebsocket?M=b.createWebsocket(N,[_],b):M=new WebSocket(N,[_]),M.binaryType="arraybuffer",M}var y=(C,b)=>{t("streamBuilder");let _=d(b);_.hostname=_.hostname||_.host||"localhost";let N=u(_,C),M=m(C,N,_),k=a.default.createWebSocketStream(M,_.wsOptions);return k.url=N,M.on("close",()=>{k.destroy()}),k};o.streamBuilder=y;var w=(C,b)=>{t("browserStreamBuilder");let _,N=p(b).browserBufferSize||1024*512,M=b.browserBufferTimeout||1e3,k=!b.objectMode,T=A(C,b),U=X(b,V,be);b.objectMode||(U._writev=n.writev.bind(U)),U.on("close",()=>{T.close()});let J=typeof T.addEventListener<"u";T.readyState===T.OPEN?(_=U,_.socket=T):(_=new n.BufferedDuplex(b,U,T),J?T.addEventListener("open",le):T.onopen=le),J?(T.addEventListener("close",P),T.addEventListener("error",G),T.addEventListener("message",Z)):(T.onclose=P,T.onerror=G,T.onmessage=Z);function X(pe,me,ve){let z=new r.Transform({objectMode:pe.objectMode});return z._write=me,z._flush=ve,z}function le(){t("WebSocket onOpen"),_ instanceof n.BufferedDuplex&&_.socketReady()}function P(pe){t("WebSocket onClose",pe),_.end(),_.destroy()}function G(pe){t("WebSocket onError",pe);let me=new Error("WebSocket error");me.event=pe,_.destroy(me)}async function Z(pe){if(!U||U.destroyed||!U.readable)return;let{data:me}=pe;me instanceof ArrayBuffer?me=i.Buffer.from(me):me instanceof Blob?me=i.Buffer.from(await new Response(me).arrayBuffer()):me=i.Buffer.from(me,"utf8"),U.push(me)}function V(pe,me,ve){if(T.bufferedAmount>N){setTimeout(V,M,pe,me,ve);return}k&&typeof pe=="string"&&(pe=i.Buffer.from(pe,"utf8"));try{T.send(pe)}catch(z){return ve(z)}ve()}function be(pe){T.close(),pe()}return _};o.browserStreamBuilder=w}),Oi={};tr(Oi,{Server:()=>Qe,Socket:()=>Qe,Stream:()=>Qe,_createServerHandle:()=>Qe,_normalizeArgs:()=>Qe,_setSimultaneousAccepts:()=>Qe,connect:()=>Qe,createConnection:()=>Qe,createServer:()=>Qe,default:()=>ia,isIP:()=>Qe,isIPv4:()=>Qe,isIPv6:()=>Qe});function Qe(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}var ia,oa=it(()=>{ce(),fe(),he(),ia={_createServerHandle:Qe,_normalizeArgs:Qe,_setSimultaneousAccepts:Qe,connect:Qe,createConnection:Qe,createServer:Qe,isIP:Qe,isIPv4:Qe,isIPv6:Qe,Server:Qe,Socket:Qe,Stream:Qe}}),sa=Ae((o,h)=>{ce(),fe(),he(),h.exports={}}),aa=Ae(o=>{ce(),fe(),he();var h=o&&o.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(o,"__esModule",{value:!0});var i=h((oa(),Le(Oi))),a=h(Ct()),l=h(sa()),r=(0,a.default)("mqttjs:tcp"),e=(n,t)=>{if(t.port=t.port||1883,t.hostname=t.hostname||t.host||"localhost",t.socksProxy)return(0,l.default)(t.hostname,t.port,t.socksProxy,{timeout:t.socksTimeout});let{port:s,path:u}=t,d=t.hostname;return r("port %d and host %s",s,d),i.default.createConnection({port:s,host:d,path:u})};o.default=e}),la={};tr(la,{default:()=>ua});var ua,ec=it(()=>{ce(),fe(),he(),ua={}}),ca=Ae(o=>{ce(),fe(),he();var h=o&&o.__rest||function(u,d){var p={};for(var m in u)Object.prototype.hasOwnProperty.call(u,m)&&d.indexOf(m)<0&&(p[m]=u[m]);if(u!=null&&typeof Object.getOwnPropertySymbols=="function")for(var A=0,m=Object.getOwnPropertySymbols(u);A<m.length;A++)d.indexOf(m[A])<0&&Object.prototype.propertyIsEnumerable.call(u,m[A])&&(p[m[A]]=u[m[A]]);return p},i=o&&o.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(o,"__esModule",{value:!0});var a=i((ec(),Le(la))),l=i((oa(),Le(Oi))),r=i(Ct()),e=i(sa()),n=(0,r.default)("mqttjs:tls");function t(u){let{host:d,port:p,socksProxy:m}=u,A=h(u,["host","port","socksProxy"]);return a.default.connect(m?Object.assign(Object.assign({},A),{socket:(0,e.default)(d,p,m,{timeout:u.socksTimeout})}):u)}var s=(u,d)=>{d.port=d.port||8883,d.host=d.hostname||d.host||"localhost",l.default.isIP(d.host)===0&&(d.servername=d.host),d.rejectUnauthorized=d.rejectUnauthorized!==!1,delete d.path,n("port %d host %s rejectUnauthorized %b",d.port,d.host,d.rejectUnauthorized);let p=t(d);p.on("secureConnect",()=>{d.rejectUnauthorized&&!p.authorized?p.emit("error",new Error("TLS not authorized")):p.removeListener("error",m)});function m(A){d.rejectUnauthorized&&u.emit("error",A),p.end()}return p.on("error",m),p};o.default=s}),ha=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"__esModule",{value:!0});var h=(Xe(),Le(Ze)),i=Ht(),a=Bi(),l,r,e;function n(){let p=new i.Transform;return p._write=(m,A,y)=>{l.send({data:m.buffer,success(){y()},fail(w){y(new Error(w))}})},p._flush=m=>{l.close({success(){m()}})},p}function t(p){p.hostname||(p.hostname="localhost"),p.path||(p.path="/"),p.wsOptions||(p.wsOptions={})}function s(p,m){let A=p.protocol==="wxs"?"wss":"ws",y=`${A}://${p.hostname}${p.path}`;return p.port&&p.port!==80&&p.port!==443&&(y=`${A}://${p.hostname}:${p.port}${p.path}`),typeof p.transformWsUrl=="function"&&(y=p.transformWsUrl(y,p,m)),y}function u(){l.onOpen(()=>{e.socketReady()}),l.onMessage(p=>{let{data:m}=p;m instanceof ArrayBuffer?m=h.Buffer.from(m):m=h.Buffer.from(m,"utf8"),r.push(m)}),l.onClose(()=>{e.emit("close"),e.end(),e.destroy()}),l.onError(p=>{let m=new Error(p.errMsg);e.destroy(m)})}var d=(p,m)=>{if(m.hostname=m.hostname||m.host,!m.hostname)throw new Error("Could not determine host. Specify host manually.");let A=m.protocolId==="MQIsdp"&&m.protocolVersion===3?"mqttv3.1":"mqtt";t(m);let y=s(m,p);l=wx.connectSocket({url:y,protocols:[A]}),r=n(),e=new a.BufferedDuplex(m,r,l),e._destroy=(C,b)=>{l.close({success(){b&&b(C)}})};let w=e.destroy;return e.destroy=(C,b)=>(e.destroy=w,setTimeout(()=>{l.close({fail(){e._destroy(C,b)}})},0),e),u(),e};o.default=d}),fa=Ae(o=>{ce(),fe(),he(),Object.defineProperty(o,"__esModule",{value:!0});var h=(Xe(),Le(Ze)),i=Ht(),a=Bi(),l,r,e,n=!1;function t(){let m=new i.Transform;return m._write=(A,y,w)=>{l.sendSocketMessage({data:A.buffer,success(){w()},fail(){w(new Error)}})},m._flush=A=>{l.closeSocket({success(){A()}})},m}function s(m){m.hostname||(m.hostname="localhost"),m.path||(m.path="/"),m.wsOptions||(m.wsOptions={})}function u(m,A){let y=m.protocol==="alis"?"wss":"ws",w=`${y}://${m.hostname}${m.path}`;return m.port&&m.port!==80&&m.port!==443&&(w=`${y}://${m.hostname}:${m.port}${m.path}`),typeof m.transformWsUrl=="function"&&(w=m.transformWsUrl(w,m,A)),w}function d(){n||(n=!0,l.onSocketOpen(()=>{e.socketReady()}),l.onSocketMessage(m=>{if(typeof m.data=="string"){let A=h.Buffer.from(m.data,"base64");r.push(A)}else{let A=new FileReader;A.addEventListener("load",()=>{let y=A.result;y instanceof ArrayBuffer?y=h.Buffer.from(y):y=h.Buffer.from(y,"utf8"),r.push(y)}),A.readAsArrayBuffer(m.data)}}),l.onSocketClose(()=>{e.end(),e.destroy()}),l.onSocketError(m=>{e.destroy(m)}))}var p=(m,A)=>{if(A.hostname=A.hostname||A.host,!A.hostname)throw new Error("Could not determine host. Specify host manually.");let y=A.protocolId==="MQIsdp"&&A.protocolVersion===3?"mqttv3.1":"mqtt";s(A);let w=u(A,m);return l=A.my,l.connectSocket({url:w,protocols:y}),r=t(),e=new a.BufferedDuplex(A,r,l),d(),e};o.default=p}),tc=Ae(o=>{ce(),fe(),he();var h=o&&o.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(o,"__esModule",{value:!0}),o.connectAsync=u;var i=h(Ct()),a=h((Zu(),Le(ys))),l=h(pi()),r=h(Ir());typeof(De==null?void 0:De.nextTick)!="function"&&(De.nextTick=setImmediate);var e=(0,i.default)("mqttjs"),n=null;function t(d){let p;d.auth&&(p=d.auth.match(/^(.+):(.+)$/),p?(d.username=p[1],d.password=p[2]):d.username=d.auth)}function s(d,p){var m,A,y;if(e("connecting to an MQTT broker..."),typeof d=="object"&&!p&&(p=d,d=""),p=p||{},d&&typeof d=="string"){let b=a.default.parse(d,!0),_={};if(b.port!=null&&(_.port=Number(b.port)),_.host=b.hostname,_.query=b.query,_.auth=b.auth,_.protocol=b.protocol,_.path=b.path,p=Object.assign(Object.assign({},_),p),!p.protocol)throw new Error("Missing protocol");p.protocol=p.protocol.replace(/:$/,"")}if(p.unixSocket=p.unixSocket||((m=p.protocol)===null||m===void 0?void 0:m.includes("+unix")),p.unixSocket?p.protocol=p.protocol.replace("+unix",""):!(!((A=p.protocol)===null||A===void 0)&&A.startsWith("ws"))&&!(!((y=p.protocol)===null||y===void 0)&&y.startsWith("wx"))&&delete p.path,t(p),p.query&&typeof p.query.clientId=="string"&&(p.clientId=p.query.clientId),r.default||p.unixSocket?p.socksProxy=void 0:p.socksProxy===void 0&&typeof De<"u"&&(p.socksProxy=De.env.MQTTJS_SOCKS_PROXY),p.cert&&p.key)if(p.protocol){if(["mqtts","wss","wxs","alis"].indexOf(p.protocol)===-1)switch(p.protocol){case"mqtt":p.protocol="mqtts";break;case"ws":p.protocol="wss";break;case"wx":p.protocol="wxs";break;case"ali":p.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${p.protocol}"!`)}}else throw new Error("Missing secure protocol key");if(n||(n={},!r.default&&!p.forceNativeWebSocket?(n.ws=Lr().streamBuilder,n.wss=Lr().streamBuilder,n.mqtt=aa().default,n.tcp=aa().default,n.ssl=ca().default,n.tls=n.ssl,n.mqtts=ca().default):(n.ws=Lr().browserStreamBuilder,n.wss=Lr().browserStreamBuilder,n.wx=ha().default,n.wxs=ha().default,n.ali=fa().default,n.alis=fa().default)),!n[p.protocol]){let b=["mqtts","wss"].indexOf(p.protocol)!==-1;p.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((_,N)=>b&&N%2===0?!1:typeof n[_]=="function")[0]}if(p.clean===!1&&!p.clientId)throw new Error("Missing clientId for unclean clients");p.protocol&&(p.defaultProtocol=p.protocol);function w(b){return p.servers&&((!b._reconnectCount||b._reconnectCount===p.servers.length)&&(b._reconnectCount=0),p.host=p.servers[b._reconnectCount].host,p.port=p.servers[b._reconnectCount].port,p.protocol=p.servers[b._reconnectCount].protocol?p.servers[b._reconnectCount].protocol:p.defaultProtocol,p.hostname=p.host,b._reconnectCount++),e("calling streambuilder for",p.protocol),n[p.protocol](b,p)}let C=new l.default(w,p);return C.on("error",()=>{}),C}function u(d,p,m=!0){return new Promise((A,y)=>{let w=s(d,p),C={connect:_=>{b(),A(w)},end:()=>{b(),A(w)},error:_=>{b(),w.end(),y(_)}};m===!1&&(C.close=()=>{C.error(new Error("Couldn't connect to server"))});function b(){Object.keys(C).forEach(_=>{w.off(_,C[_])})}Object.keys(C).forEach(_=>{w.on(_,C[_])})})}o.default=s}),da=Ae(o=>{ce(),fe(),he();var h=o&&o.__createBinding||(Object.create?function(m,A,y,w){w===void 0&&(w=y);var C=Object.getOwnPropertyDescriptor(A,y);(!C||("get"in C?!A.__esModule:C.writable||C.configurable))&&(C={enumerable:!0,get:function(){return A[y]}}),Object.defineProperty(m,w,C)}:function(m,A,y,w){w===void 0&&(w=y),m[w]=A[y]}),i=o&&o.__setModuleDefault||(Object.create?function(m,A){Object.defineProperty(m,"default",{enumerable:!0,value:A})}:function(m,A){m.default=A}),a=o&&o.__importStar||function(){var m=function(A){return m=Object.getOwnPropertyNames||function(y){var w=[];for(var C in y)Object.prototype.hasOwnProperty.call(y,C)&&(w[w.length]=C);return w},m(A)};return function(A){if(A&&A.__esModule)return A;var y={};if(A!=null)for(var w=m(A),C=0;C<w.length;C++)w[C]!=="default"&&h(y,A,w[C]);return i(y,A),y}}(),l=o&&o.__exportStar||function(m,A){for(var y in m)y!=="default"&&!Object.prototype.hasOwnProperty.call(A,y)&&h(A,m,y)},r=o&&o.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(o,"__esModule",{value:!0}),o.ReasonCodes=o.KeepaliveManager=o.UniqueMessageIdProvider=o.DefaultMessageIdProvider=o.Store=o.MqttClient=o.connectAsync=o.connect=o.Client=void 0;var e=r(pi());o.MqttClient=e.default;var n=r(Zo());o.DefaultMessageIdProvider=n.default;var t=r(Du());o.UniqueMessageIdProvider=t.default;var s=r(Xo());o.Store=s.default;var u=a(tc());o.connect=u.default,Object.defineProperty(o,"connectAsync",{enumerable:!0,get:function(){return u.connectAsync}});var d=r(ss());o.KeepaliveManager=d.default,o.Client=e.default,l(pi(),o),l(ir(),o);var p=kr();Object.defineProperty(o,"ReasonCodes",{enumerable:!0,get:function(){return p.ReasonCodes}})}),rc=Ae(o=>{ce(),fe(),he();var h=o&&o.__createBinding||(Object.create?function(e,n,t,s){s===void 0&&(s=t);var u=Object.getOwnPropertyDescriptor(n,t);(!u||("get"in u?!n.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,s,u)}:function(e,n,t,s){s===void 0&&(s=t),e[s]=n[t]}),i=o&&o.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),a=o&&o.__importStar||function(){var e=function(n){return e=Object.getOwnPropertyNames||function(t){var s=[];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(s[s.length]=u);return s},e(n)};return function(n){if(n&&n.__esModule)return n;var t={};if(n!=null)for(var s=e(n),u=0;u<s.length;u++)s[u]!=="default"&&h(t,n,s[u]);return i(t,n),t}}(),l=o&&o.__exportStar||function(e,n){for(var t in e)t!=="default"&&!Object.prototype.hasOwnProperty.call(n,t)&&h(n,e,t)};Object.defineProperty(o,"__esModule",{value:!0});var r=a(da());o.default=r,l(da(),o)});const nc=rc();/*! Bundled license information:
1
+ (function(Ie,C){typeof exports=="object"&&typeof module<"u"?C(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],C):(Ie=typeof globalThis<"u"?globalThis:Ie||self,C(Ie["@stonecrop/beam"]={},Ie.Vue))})(this,function(Ie,C){"use strict";var fi=document.createElement("style");fi.textContent=`@import"https://fonts.googleapis.com/css2?family=Arimo:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap";.beam_action-footer[data-v-37933bd1]{margin-left:0;background:linear-gradient(180deg,transparent 0%,white 100%);color:var(--sc-primary-text-color);position:fixed;bottom:0;left:0;width:100%;padding:.625rem;text-align:center}.beam_metadata_arrow[data-v-94fbdac5]{align-self:center;flex-grow:1;position:relative;display:flex;align-items:center}.beam_metadata_arrow-body[data-v-94fbdac5]{width:100%;height:10px;background:#c4c4c4}.beam_metadata_arrow-head svg[data-v-94fbdac5]{width:20px;display:block}.beam_btn[data-v-bc768596]{font-size:.875rem;text-align:center;padding:.3125rem .75rem;border:1px solid var(--sc-btn-border);color:var(--sc-btn-label-color);background-color:var(--sc-btn-color);cursor:pointer;font-family:var(--sc-font-family)}.beam_btn[data-v-bc768596]:hover,.beam_btn[data-v-bc768596]:active{background-color:var(--sc-btn-hover)}.beam_btn a:link,.beam_btn a:visited,.beam_btn a:hover,.beam_btn a:active{text-decoration:none;color:var(--sc-btn-label-color)}.beam_day-divider[data-v-160cf6ef]{text-align:left;padding:1rem;background:var(--sc-cell-changed-color);border-bottom:1px solid var(--sc-row-border-color);box-sizing:border-box;margin-bottom:1rem;margin-left:calc(-1 * var(--sc-list-margin));margin-right:calc(-1 * var(--sc-list-margin))}.beam_day-divider h2[data-v-160cf6ef]{text-align:left;font-size:1rem;color:var(--sc-primary-text-color);margin:0;padding:0}.beam_day-divider[data-v-160cf6ef]:first-of-type{margin-top:0}.beam_filters[data-v-63a79e46]{background-color:var(--sc-primary-color);border-bottom:1px solid var(--sc-row-border-color);box-sizing:border-box;min-height:2em;overflow:visible;padding:.625rem;transition:all .2s ease-in-out}.beam_filters-heading[data-v-63a79e46]{align-items:center;background-color:var(--sc-primary-color);box-sizing:border-box;cursor:pointer;display:flex;font-size:1rem}.beam_filters-heading>h1[data-v-63a79e46]{font-size:1rem}.beam_filters-options[data-v-63a79e46]{display:flex;flex-direction:row;justify-content:flex-start;margin:1rem 0;padding:0 1rem;gap:1rem}@media (max-width: 479px){.beam_filters-options[data-v-63a79e46]{flex-direction:column}}.beam_filter-option[data-v-be55508c]{cursor:pointer;position:relative}.beam_filter-option-heading[data-v-be55508c]{font-size:1rem!important;padding-bottom:.25rem}.beam_filter-option-select[data-v-be55508c]{align-items:stretch;appearance:none;background-color:#fff;border:1px solid var(--sc-row-border-color);color:var(--sc-primary-text-color);display:flex;font-family:var(--sc-font-family);font-size:.8rem;font-weight:700;position:relative}label[data-v-be55508c]{cursor:pointer;padding:.5rem}.beam_filter-arrow[data-v-be55508c]{background:var(--sc-primary-color);color:var(--sc-primary-text-color);cursor:pointer;display:flex;align-items:center;width:5px;padding:.5rem .7rem}.beam_filter-label[data-v-be55508c]{display:flex;align-items:center}svg[data-v-be55508c]{fill:var(--sc-primary-text-color);width:5px;transform:rotate(90deg)}.beam_filter-select-menu[data-v-be55508c]{background-color:#fff;border-top:none;border:1px solid var(--sc-row-border-color);box-sizing:border-box;left:0;list-style:none;margin:0;max-height:200px;overflow-y:scroll;padding:0rem;position:absolute;width:100%;z-index:100}.beam_filter-select-option[data-v-be55508c]{font-size:.8rem;font-family:var(--sc-font-family);font-weight:700;color:var(--sc-primary-text-color);border-bottom:1px solid var(--sc-row-border-color);padding:.5rem}.beam_filter-select-option[data-v-be55508c]:hover{background:var(--sc-primary-color)}.selected[data-v-be55508c],.selected[data-v-be55508c]:hover{background:var(--sc-row-border-color)}.beam_filter-container[data-v-be55508c]{flex-grow:1;max-width:300px;width:50%}@media (max-width: 479px){.beam_filter-container[data-v-be55508c]{width:100%;max-width:100%}}.beam_header[data-v-5182a4d5]{border:1px solid transparent;text-align:left;font-size:1.125rem;color:var(--sc-primary-text-color);margin:0;padding:0;font-family:var(--sc-font-family)}.beam_metadata[data-v-80484331]{box-sizing:border-box;display:flex;flex-direction:column;max-height:100vh;color:var(--sc-primary-text-color);font-family:var(--sc-font-family)}.beam_metadata_content[data-v-80484331]{padding-top:10px}.beam_metadata_header[data-v-80484331]{display:flex;flex-direction:row;align-items:baseline;padding:0 30px;justify-content:space-between}.beam_metadata_count[data-v-80484331]{font-size:1.5rem}.beam_metadata_count p[data-v-80484331]{margin:0}.beam_metadata_header-order-num[data-v-80484331]{font-weight:700;font-size:1.5rem}.beam_metadata_block[data-v-80484331]{padding:0 30px;margin:10px 0}.beam_metadata_shipping[data-v-80484331]{display:flex;flex-direction:row;align-items:baseline;justify-content:space-between}.beam_metadata_shipping p[data-v-80484331]{line-height:1.5rem}@media screen and (max-width: 600px){.beam_metadata_shipping[data-v-80484331]{flex-direction:column}}.beam_metadata_component_header[data-v-80484331]{display:flex;flex-direction:row;justify-content:space-between;align-items:baseline}.beam_metadata_components[data-v-80484331]{overflow:scroll}hr[data-v-80484331]{display:block;height:1px;border:0;border-top:1px solid var(--sc-row-border-color);margin:1em 0;padding:0}.beam_metadata_heading{font-size:1.125rem;font-weight:700;margin:.625rem 0;color:var(--sc-primary-text-color)}.beam_modal[data-v-4f3f0253]{position:fixed;inset:0;background-color:#00000080;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);z-index:1000;text-align:center;padding:1.25rem}.beam_modal-confirm[data-v-5b430dca]{background:#fff;padding:1.25rem;width:80%;max-width:400px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.beam_modal-confirm button[data-v-5b430dca]{margin:.625rem}.beam_modal-confirm h2[data-v-5b430dca]{border-bottom:1px solid var(--sc-row-border-color);padding-bottom:.625rem;color:var(--sc-primary-text-color)}.fixed-top[data-v-a38a41d0]{position:sticky;top:0;left:0}.container[data-v-14a5f31b]{display:block;position:relative;padding-left:2.5ch;margin:0;margin-top:.5rem;cursor:pointer;font-size:2rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.container input[data-v-14a5f31b]{position:absolute;opacity:0;cursor:pointer;height:0;width:0}.checkmark[data-v-14a5f31b]{position:absolute;top:0;left:0;height:2rem;width:2rem;background-color:#eee;outline:2px solid transparent;border:1px solid var(--sc-highlight)}.container:hover input~.checkmark[data-v-14a5f31b]{background-color:#fff}.container input:checked~.checkmark[data-v-14a5f31b]{background-color:var(--sc-brand-secondary)}.checkmark[data-v-14a5f31b]:after{content:"";position:absolute;display:none}.container input:checked~.checkmark[data-v-14a5f31b]:after{display:block}.container .checkmark[data-v-14a5f31b]:after{left:25%;top:50%;width:.5rem;height:1rem;border:solid var(--sc-text-color);border-width:0 3px 3px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg) translate(-50%,-50%)}.beam_item-count[data-v-fa0e6dff]{font-size:1.3125rem;color:var(--sc-primary-text-color)}.beam_item-count span[data-v-fa0e6dff]{margin:0;padding:0;outline:none}.beam_list-anchor[data-v-7e3ecf0d]{text-decoration:none;outline:none;color:var(--sc-primary-text-color)}.beam_list-item[data-v-634dd647]{padding:.625rem;border-bottom:1px solid var(--sc-row-border-color);max-width:100%;box-sizing:border-box;display:flex;flex-flow:row nowrap;justify-content:space-between;gap:1.25rem;cursor:pointer;outline:2px solid transparent;outline-offset:-1px}.beam_list-item[data-v-634dd647]:focus{outline:2px solid var(--sc-focus-cell-outline);background-color:var(--sc-focus-cell-background)}.beam_list-text[data-v-634dd647]{width:80%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;flex-grow:1;font-size:.875rem;color:var(--sc-primary-text-color)}.beam_list-text label[data-v-634dd647],.beam_list-text p[data-v-634dd647]{overflow:hidden;text-overflow:ellipsis;width:100%;display:block}.beam_list-item label[data-v-634dd647]{display:block}.beam_list-item p[data-v-634dd647]{margin:0}.beam_list-view[data-v-d536b2a7]{font-family:var(--sc-font-family);list-style-type:none;margin-top:1px;margin-left:var(--sc-list-margin);margin-right:var(--sc-list-margin);padding:0}ul.beam_list-view[data-v-d536b2a7]:last-of-type{padding-bottom:2.5em}.beam_navbar[data-v-cfc4c14e]{padding:.625rem;background-color:var(--sc-primary-color);margin-left:0;min-height:2em;max-height:2em;color:var(--sc-primary-text-color);display:flex;flex-flow:row nowrap;align-content:center;justify-content:space-between;align-items:center;position:sticky;top:0;font-family:var(--sc-font-family);border-bottom:1px solid var(--sc-row-border-color)}.beam_navbar h1[data-v-cfc4c14e]{margin-left:.625rem}.segmented-display[data-v-140e435e]{width:100%;padding:1rem;box-sizing:border-box;display:flex;background:var(--sc-segmented-display-background);align-items:center;justify-content:flex-end}.segmented-display-output[data-v-140e435e]{text-align:right;font-family:Segment7,Arimo,sans-serif;font-weight:400;font-size:var(--sc-segemented-display-font-size);padding:0;margin:0;letter-spacing:.3rem;margin-bottom:-.7rem;color:var(--sc-segmented-display-color)}.two-column[data-v-c65440c0]{display:flex;flex-direction:row;justify-content:space-between;align-items:baseline;gap:1rem}@media screen and (max-width: 400px){.two-column[data-v-c65440c0]{flex-direction:column;gap:0}}.column[data-v-c65440c0]{flex-grow:1;width:50%}@media screen and (max-width: 400px){.column[data-v-c65440c0]{width:100%}}.column-right[data-v-c65440c0]{text-align:right}@media screen and (max-width: 400px){.column-right[data-v-c65440c0]{text-align:left}}svg[data-v-05e7abed]{width:100%;overflow:visible;fill:var(--sc-primary-text-color)}.arrow-icon[data-v-05e7abed]{width:.4rem;transform:rotate(0);transform-origin:center;position:relative;transition:all .1s ease-in-out;margin:.5rem;cursor:pointer;display:flex;align-items:center}.open[data-v-05e7abed]{transform:rotate(90deg)}@font-face{font-family:Segment7;src:url(data:font/otf;base64,T1RUTwAOAIAAAwBgQkFTRQAJAAQAACasAAAADkNGRiC5m9MSAAAH7AAAHbpGRlRNa6XwRAAAJrwAAAAcR0RFRgKxAqIAACWoAAAASkdQT1Ou773UAAAmLAAAAH5HU1VCRNhM5gAAJfQAAAA4T1MvMljUYiwAAAFQAAAAYGNtYXAxVzUsAAAFhAAAAkZoZWFkAmNATwAAAOwAAAA2aGhlYQdTAF8AAAEkAAAAJGhtdHgW0g5oAAAm2AAAAgZtYXhwAQFQAAAAAUgAAAAGbmFtZYoOx10AAAGwAAAD0nBvc3QAAAABAAAHzAAAACAAAQAAAAEAAOVWl1RfDzz1AAsD6AAAAADPuH6JAAAAAM+4fokAAP84A9EDIAACAAgAAgAAAAAAAAABAAADIP84AFoCSQAA/ngD0QBkAAUAAAAAAAAAAAAAAAAAAgAAUAABAQAAAAMCSQJYAAUACAKKArsABwCMAooCu//nAd8AMQECAAACAAUJAAAAAAAAAAAAAwAAAAAAAAAAAAAAAFBmRWQAAQAAAP8DIP84AFoDIADIAAAAAQAAAAABwgHCACAAIAACAAAADgCuAAEAAAAAAAAAsQFkAAEAAAAAAAEACAIoAAEAAAAAAAIACAJDAAEAAAAAAAMAIwKUAAEAAAAAAAQACALKAAEAAAAAAAUACQLnAAEAAAAAAAYAEAMTAAMAAQQJAAABYgAAAAMAAQQJAAEAEAIWAAMAAQQJAAIAEAIxAAMAAQQJAAMARgJMAAMAAQQJAAQAEAK4AAMAAQQJAAUAEgLTAAMAAQQJAAYAIALxAFMAdAByAGkAYwB0AGwAeQAgAHMAZQB2AGUAbgAtAHMAZQBnAG0AZQBuAHQAIAAoAHAAbAB1AHMAIABwAG8AaQBuAHQAKQAgAGMAYQBsAGMAdQBsAGEAdABvAHIAIABkAGkAcwBwAGwAYQB5ACAAZgBhAGMAZQAsACAAZgBpAHgAZQBkAC0AdwBpAGQAdABoACAAYQBuAGQAIABmAHIAZQBlAC4AIAAgACgAYwApACAAQwBlAGQAcgBpAGMAIABLAG4AaQBnAGgAdAAgADIAMAAxADQALgAgACAATABpAGMAZQBuAHMAZQBkACAAdQBuAGQAZQByACAAUwBJAEwAIABPAHAAZQBuACAARgBvAG4AdAAgAEwAaQBjAGUAbgBjAGUAIAB2ADEALgAxAC4AIAAgAFIAZQBzAGUAcgB2AGUAZAAgAG4AYQBtAGUAOgAgAFMAZQBnAG0AZQBuAHQANwAuAABTdHJpY3RseSBzZXZlbi1zZWdtZW50IChwbHVzIHBvaW50KSBjYWxjdWxhdG9yIGRpc3BsYXkgZmFjZSwgZml4ZWQtd2lkdGggYW5kIGZyZWUuICAoYykgQ2VkcmljIEtuaWdodCAyMDE0LiAgTGljZW5zZWQgdW5kZXIgU0lMIE9wZW4gRm9udCBMaWNlbmNlIHYxLjEuICBSZXNlcnZlZCBuYW1lOiBTZWdtZW50Ny4AAFMAZQBnAG0AZQBuAHQANwAAU2VnbWVudDcAAFMAdABhAG4AZABhAHIAZAAAU3RhbmRhcmQAAEYAbwBuAHQARgBvAHIAZwBlACAAMgAuADAAIAA6ACAAUwBlAGcAbQBlAG4AdAA3ACAAOgAgADcALQA2AC0AMgAwADEANAAARm9udEZvcmdlIDIuMCA6IFNlZ21lbnQ3IDogNy02LTIwMTQAAFMAZQBnAG0AZQBuAHQANwAAU2VnbWVudDcAAFYAZQByAHMAaQBvAG4AIAAgAABWZXJzaW9uICAAAFMAZQBnAG0AZQBuAHQANwBTAHQAYQBuAGQAYQByAGQAAFNlZ21lbnQ3U3RhbmRhcmQAAAAAAAADAAAAAwAAABwAAQAAAAAAPAADAAEAAAAcAAQAIAAAAAQABAABAAAA////AAAAAP//AAEAAQAAAAAABgIKAAAAAAEAAAEAAgADAAQABQAGAAcACAAJAAoACwAMAA0ADgAPABAAEQASABMAFAAVABYAFwAYABkAGgAbABwAHQAeAB8AIAAhACIAIwAkACUAJgAnACgAKQAqACsALAAtAC4ALwAwADEAMgAzADQANQA2ADcAOAA5ADoAOwA8AD0APgA/AEAAQQBCAEMARABFAEYARwBIAEkASgBLAEwATQBOAE8AUABRAFIAUwBUAFUAVgBXAFgAWQBaAFsAXABdAF4AXwBgAGEAYgBjAGQAZQBmAGcAaABpAGoAawBsAG0AbgBvAHAAcQByAHMAdAB1AHYAdwB4AHkAegB7AHwAfQB+AH8AgADFAMYAyADKANIA1wDdAOIA4QDjAOUA5ADmAOgA6gDpAOsA7ADuAO0A7wDwAPIA9ADzAPUA9wD2APsA+gD8AP0AAACxAKMApACoAAAAtwDgAK8AqgAAALUAqQAAAMcA2QAAALIAAAAAAKYAtgAAAAAAAAAAAAAAqwC7AAAA5wD5AMAAogCtAAAAAAAAAAAArAC8AAAAoQDBAMQA1gAAAAAAAAAAAAAAAAAAAAAA+AAAAQAAAAAAAAAAAAAAAAAAAAAAALgAAAAAAAAAwwDLAMIAzADJAM4AzwDQAM0A1ADVAAAA0wDbANwA2gAAAAAAAACwAAAAAAAAALkAAAAAAAAAAAADAAD//QAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAQAEBAABAQERU2VnbWVudDdTdGFuZGFyZAABAgABADf4YgD4YwH4ZAL4ZQP4ZgSMDAGIDAKLDAOLDASL+1z6Zfm0BRwDrw8cAAAQHAWwERwAMRwbyBIATAIAAQAIAA8AFgAdACQAKwAyADkAQABHAE4AVQBcAGMAagBxAHgAfwCGAI0AlACbAKIAqQCwALcAvgDFAMwA0wDaAOEA6ADvAPYA/QEEAQsBEgEZASABJwEuATUBPAFDAUoBUQFYAV8BZgFtAXQBewGCAYkBkAGXAZ4BpQGsAbMBugHBAcgBzwHWAd0B5AHrAfIB8gKjAqsCswK7dW5pMDAwMHVuaTAwMDF1bmkwMDAydW5pMDAwM3VuaTAwMDR1bmkwMDA1dW5pMDAwNnVuaTAwMDd1bmkwMDA4dW5pMDAwOXVuaTAwMEF1bmkwMDBCdW5pMDAwQ3VuaTAwMER1bmkwMDBFdW5pMDAwRnVuaTAwMTB1bmkwMDExdW5pMDAxMnVuaTAwMTN1bmkwMDE0dW5pMDAxNXVuaTAwMTZ1bmkwMDE3dW5pMDAxOHVuaTAwMTl1bmkwMDFBdW5pMDAxQnVuaTAwMUN1bmkwMDFEdW5pMDAxRXVuaTAwMUZ1bmkwMDdGdW5pMDA4MHVuaTAwODF1bmkwMDgydW5pMDA4M3VuaTAwODR1bmkwMDg1dW5pMDA4NnVuaTAwODd1bmkwMDg4dW5pMDA4OXVuaTAwOEF1bmkwMDhCdW5pMDA4Q3VuaTAwOER1bmkwMDhFdW5pMDA4RnVuaTAwOTB1bmkwMDkxdW5pMDA5MnVuaTAwOTN1bmkwMDk0dW5pMDA5NXVuaTAwOTZ1bmkwMDk3dW5pMDA5OHVuaTAwOTl1bmkwMDlBdW5pMDA5QnVuaTAwOUN1bmkwMDlEdW5pMDA5RXVuaTAwOUZ1bmkwMEEwdW5pMDBBRHVuaTAwQjJ1bmkwMEIzdW5pMDBCNXVuaTAwQjlTdHJpY3RseSBzZXZlbi1zZWdtZW50IChwbHVzIHBvaW50KSBjYWxjdWxhdG9yIGRpc3BsYXkgZmFjZSwgZml4ZWQtd2lkdGggYW5kIGZyZWUuICAoYykgQ2VkcmljIEtuaWdodCAyMDE0LiAgTGljZW5zZWQgdW5kZXIgU0lMIE9wZW4gRm9udCBMaWNlbmNlIHYxLjEuICBSZXNlcnZlZCBuYW1lOiBTZWdtZW50Ny5TZWdtZW50N1NlZ21lbnQ3U3RhbmRhcmQAAAABhwGIAYkBigGLAYwBjQGOAY8BkAGRAZIBkwGUAZUBlgGXAZgBmQGaAZsBnAGdAZ4BnwGgAaEBogGjAaQBpQGmAAEAAgADAAQABQAGAAcAaAAJAAoACwAMAA0ADgAPABAAEQASABMAFAAVABYAFwAYABkAGgAbABwAHQAeAB8AIAAhACIAIwAkACUAJgAnACgAKQAqACsALAAtAC4ALwAwADEAMgAzADQANQA2ADcAOAA5ADoAOwA8AD0APgA/AEAAfABCAEMARABFAEYARwBIAEkASgBLAEwATQBOAE8AUABRAFIAUwBUAFUAVgBXAFgAWQBaAFsAXABdAF4AXwGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBuAG5AboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBxwHIAGAAYQBiAGcAZACgAGYAgwCqAIsAagCXAckApQCAAKEAnAHKAcsAfQHMAHMAcgCFAc0AjwB4AJ4AmwCjAHsArgCrAKwAsACtAK8AigCxALUAsgCzALQAuQC2ALcAuACaALoAvgC7ALwAvwC9AKgAjQDEAMEAwgDDAMUAnQCVAMsAyADJAM0AygDMAJAAzgDSAM8A0ADRANYA0wDUANUApwDXANsA2ADZANwA2gCfAJMA4QDeAN8A4ADiAKIA4wEBAgABACIANgA3ADgAOQA6ADsAPAA9AD4APwBAAEEAQgBDAEQARQBGAEcASABJAEoASwBMAE0ATgBPAFAAUQBSAFMAVABVAFYAdgCQALYA7QEmAUgBXgGRAcoB8gIWAjQCQAJOAncCxgLnAyQDZwOWA+AEPARhBMEFDgUaBToFTgViBYAFsgX/BkEGhwa6Bv4HOgdrB7AH7QgJCEIIegihCLkI8QlACXwJsgnLCg0KQgqECsYLGAs2C3gLqgvdDAAMNwxcDGgMewzIDQ4NIg1mDa0N3g4pDloOaQ6iDtoPAQ84D1gPjQ/JEAEQGhBeEJMQwREDEVURkhHWEf8SABIcEh0STxJQElESUhJTElQSVRJWElcSWBJZEloSWxJcEl0SXhJfEmASYRJiEmMSZBJlEmYSZxJoEmkSahJrEmwSbRJuEm8ScBJxEnIScxJ0EnUSdhJ3EngSeRJ6EnsSfBJ9En4SfxKAEq8SsBKxErISsxLqEusS7BLtEu4S7xLwEvES8hLzEvQS9RL2EvcS+BL5EvoS+xL8Ev0S/hL/EwATARMCEwMTBBMFEwYTBxMIEwkTChMLEwwTDRMOEw8TEBMRExITExMUE2ETrhOvE7ATsROyE7MTtBO1E/wT/RP+E/8UABQBFAIUAxQEFAUUBhQHFAgUCRQKFAsUDBQNFA4UDxQQFBEUEou9+EW9Ab29+BW9A70W+Hn4qfx5Br38dxX4RfgV/EUHDvtc+nwBi/plA/tcBPpl+nz+ZQYODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg527/floPfFnxL4O/Z66hNw+KH5jhUgChOIsf0/FSEKDvhJdvfBd593zHcSE9Dd+WEVIgr3+fAVIwoOien3m+ppoPfFnxITgPcf5xUkChPA+3j3+hUlChOw9wz3zBUgCg6J6VOg9/ug94zqOJ8SE6D3H+cVE2AmChOgJwoTKPvS+QUVIgoTMH73CxUoCmT8FxUpChNgKgoOielodvgldveh6kx3n3cSE6D3H+cVE2AmChOgJwoTKPvS+QUVIgoTMH73CxUoCmT8FxUpChNgKgoOr6D3vuppoPfFnxITwPdA+FYVJQrRTRUrChOwm/gwFSAKDvhJdvfud593Evg79hPQ+KH5jhUgCg6J6X929+N3ynb3oepMdxITsPcf5xUkCvvX98IVLAoTcC0KEzRG+AsVIgoTOH73CxUoCg6J6Wh2+CV296HqeXefdxIToPcf5xUTYCYKE6AnChMw+4n5RBUoCmT8FxUpChNgKgoTKJv4MBUgCg6J6feb6n529+53n3cSE4D3H+cVJAoTwPt49/oVJQoTsPcM98wVIAoOxHb30+p+dvfud593EhPA90D4VhUlCtFNFSsKE7Cb+DAVIAoOielodhITgPcf5xUTQCYKE4AnCtb3vBUpChNAKgoO9/fqAfdA+FYVJQoOdu8B+JXqA/jH2hUhCg7bdve86lN3ynb37ncSE6jY+B4VLgoTyKD3ABUlCvcM98wVLwoTmDAKDonpaHa3dvfjd8p296HqTHfMdxITmPcf5xUTWCYKE5gnCvvX98IVLAoTOC0KExpG+AsVIgoTHH73CxUoCmT8FxUpChNYKgoTGZv4MBUgCg7Edvgldvfud593Evgq9xATyPhv+BgVKwoT6Jv4MBUgCg6J6X9297zqU3fKdveh6nl3EhOA9x/nFSQKE1D71/fCFS4KEwSP+EoVKAoTIPvq+9kVJQoTCvcM98wVIAoOielodvfT6n5296HqeXefdxITgPcf5xUTQCYKE4AnChMI+4n5RBUoChMg++r72RUlCtFNFSkKE0AqChMUm/gwFSAKDsR299Pqfnb3wXefd8x3EhO03flhFSIKE8SP+2cVJQrRTRUrCpv4MBUvChOkMAoOielodvfU6X5296HmUHefdxITQPhw+BkVUlx++3jNPZylnve1BRMg++XuFTEK+4333RVJYAUTCDIKExT8Q1AVMwoTgG38zhU0Cg6J6Wh2tnb3vulndrd296HmUHcSE4D3HucVNAoTBfvS+QUVMwp+9wkVSWAFEwIyChMQ++r72hUxCtNOFVJcfvt4BRNANQoTKPxEtRWHgYaBh4EIe/vF576X930FDsR2+CV296HqeXefdxIT4Pcv+aAVKApk/BcVKwoT0Jv4MBUgCg6J6Wh2t3b3vOpTd8p296HqTHfMdxITgAD3H+cVE0AAJgoTgAAnChMoAPvX98IVLgoTBQBG+AsVIgoTAgB+9wsVKAoTEAD76vvZFSUK0U0VKQoTQAAqChMEgJv4MBUgCg6J6Wh299Pqfnb3oepMd593zHcSE4D3H+cVE0AmChOAJwoTFPvS+QUVIgoTCH73CxUoChMg++r72RUlCtFNFSkKE0AqChMRm/gwFSAKDvf36gH3QPhWFSUKDnbv9+Wg98WfEvg79nrqE3D4ofmOFSAKE4ix/T8VIQoO9x/nFSQK+9f3whUuCqD3ABUlCg6J6feb6gH3H+cVJAr7ePf6FSUKDonpU6ASE4D3H+cVE0AmChOAJwrW97wVKQoTQCoKDtt297zqU3fKdveh6nl3EhOg2PgeFS4KE4iP+EoVKAoTwPvq+9kVJQoTlPcM98wVIAoOielToI2g96fqP5+hoPeM6mWfEhOA9x/nFRNAJgoTgCcKEyj71/fCFS4KEwKP+EoVKAoTEPvq+9kVJQrRTRUpChNAKgoTBZv4MBUgCg7Edrd297zqU3fKdveh6kx3zHcSE9DY+B4VLgoTykb4CxUiChPEfvcLFSgKE+D76vvZFSUK0U0VKwoTyZv4MBUgCg6J6VOgjaD3p+o/n6Gg95ifEhOC9x/nFRNCJgoTgicKEyr71/fCFS4KRvgLFXv7qQUTBjYKExKP+2cVJQrRTRUpChNCKgoOielqoPe6n6Gg94zqOJ8SE7D3H+cVJAr71/fCFSwKE3AtChM0RvgLFSIKEzh+9wsVKAoOielToI2g96fqP5+hoPfFnxITgvcf5xUTQiYKE4InChMq+9f3whUuChMSoPcAFSUK0U0VKQoTQioKm/gwFS8KEwYwCg6J6X9297zqU3fKdveh6kx3EhOA9x/nFSQKE1D71/fCFS4KEwpG+AsVIgoTBH73CxUoChMg++r72RUlCg7GoPen6j+foaD3jOo4nxIToNj4HhUuChOURvgLFSIKE4h+9wsVKAoTwPvq+9kVJQoOielodrd29+N3ynb3oepMdxITmPcf5xUTWCYKE5gnCvvX98IVLAoTOC0KExpG+AsVIgoTHH73CxUoCmT8FxUpChNYKgoOr6CNoPen6j+foaD3mJ+knxIT1tj4HhUuCkb4CxV7+6kFE842ChPmj/tnFSUK0U0VKwqb+DAVLwoTzjAKDq+g9/ug98WfAfgq9xAD+G/4GBUrCpv4MBUgCg6J6VOgjaD3up+hoPfFnxITnPcf5xUTXCYKE5wnCvvX98IVLAoTPC0K99i5FSkKE1wqCpv4MBUjCg6voI2g96fqP5+hoPeM6jifEhPQ2PgeFS4KE8pG+AsVIgoTxH73CxUoChPg++r72RUlCtFNFSsKDonpaqD3up+hoPeYnxITuPcf5xUkCvvX98IVLAoTeC0KRvgLFSIKDtj4HhUuCqD3ABUlCtFNFSsKm/gwFSMKDsR2t3b343fKdveh6kx3zHcSE/DY+B4VLgoT9Eb4CxUiChP4fvcLFSgKZPwXFSsKE/Kb+DAVIAoOielToI2g97qfoaD3jOo4n6SfEhOY9x/nFRNYJgoTmCcK+9f3whUsChM4LQoTGkb4CxUiChMcfvcLFSgKZPwXFSkKE1gqChMZm/gwFSAKDsag96fqP5+hoPeM6jifpJ8SE6DY+B4VLgoTlEb4CxUiChOIfvcLFSgKE8D76vvZFSUKE5L3DPfMFSAKDq+g977qaaD3jOo4n6SfEhOo3flhFSIKE5B+9wsVKAoTwPvq+9kVJQrRTRUrChOkm/gwFSAKDsag96fqP58SE6DY+B4VLgoTwKD3ABUlCg6J6VOg97/paaD3jOY8nxITgPce5xU0ChMU+9L5BRUzCn73CRVJYAUTCDIKEyD76vvaFTEK004VUlx++3gFE0A1Cg6J6Wqg96fqP5+hoPeYnxIThPcf5xUkChNU+9f3whUuCkb4CxV7+6kFEww2ChMkj/tnFSUKDonpU6CNoPe6n6Gg95ifpJ8SE573H+cVE14mChOeJwr71/fCFSwKEz4tCkb4CxUiCvfH+6UVKQoTXioKm/gwFSMKDonpU6CNoPe6n6Gg95ifpJ8SE573H+cVE14mChOeJwr71/fCFSwKEz4tCkb4CxUiCvfH+6UVKQoTXioKm/gwFSMKDonpU6CNoPen6j+foaD3mJ+knxITg/cf5xUTQyYKE4MnChMr+9f3whUuCkb4CxV7+6kFEwc2ChMTj/tnFSUK0U0VKQoTQyoKm/gwFS8KEwcwCg6J6feb6vd/6gH3H+cVJAr7iflEFSgK++r72RUlCg6J6VOg977qaaD3mJ+knxIThPcf5xUTRCYKE4QnChMc+9L5BRUiChMkj/tnFSUK0U0VKQoTRCoKm/gwFS8KExQwCg7GoPen6j+foaD3jOplnxIToNj4HhUuChOIj/hKFSgKE8D76vvZFSUKE5T3DPfMFSAKDonpaqD3up+hoPeM6jifEhOw9x/nFSQK+9f3whUsChNwLQoTNEb4CxUiChM4fvcLFSgKDsR299Pqfnb3wXefdxITsN35YRUiChPAj/tnFSUK0U0VKwoOielToPf7oPeM6mWfEhOg9x/nFRNgJgoToCcKEzD7iflEFSgKZPwXFSkKE2AqChMom/gwFSAKDvhJdveh6kx3n3fMdxIToN35YRUiChPAfvcLFSgKE4iWfhUgCg739+oB90D4VhUlCg74NKD3xZ8B+Dv2A/ih+Y4VIAoOielodrd297zqU3fKdveh6nl3EhOA9x/nFRNAJgoTgCcKEyj71/fCFS4KEwKP+EoVKAoTEPvq+9kVJQrRTRUpChNAKgoTBZv4MBUgCg6J6Wh2t3b3vOpTd8p298F3EhOC9x/nFRNCJgoTgicKEyr71/fCFS4KRvgLFXv7qQUTBjYKExKP+2cVJQrRTRUpChNCKgoO9x/nFSQK+9f3whUuCqD3ABUlCg6J6Wh2t3b3vOpTd8p29+53EhOC9x/nFRNCJgoTgicKEyr71/fCFS4KExKg9wAVJQrRTRUpChNCKgqb+DAVLwoTBjAKDonpf3b3vOpTd8p296HqTHfMdxITgPcf5xUkChNQ+9f3whUuChMKRvgLFSIKEwR+9wsVKAoTIPvq+9kVJQoTCfcM98wVIAoO23b3vOpTd8p296HqTHcSE6DY+B4VLgoTlEb4CxUiChOIfvcLFSgKE8D76vvZFSUKDonpU6D3vuppoPeM6jifpJ8SE4D3H+cVE0AmChOAJwoTFPvS+QUVIgoTCH73CxUoChMg++r72RUlCtFNFSkKE0AqChMSm/gwFSAKDsR2t3b3vOpTd8p298F3EhPU2PgeFS4KRvgLFXv7qQUTzDYKE+SP+2cVJQrRTRUrCg7EdgH4KvID+G/4GBUrCg6J6Wh2t3b343fKdvfudxITnPcf5xUTXCYKE5wnCvvX98IVLAoTPC0K99i5FSkKE1wqCpv4MBUjCg7Edrd297zqU3fKdveh6kx3EhPQ2PgeFS4KE8pG+AsVIgoTxH73CxUoChPg++r72RUlCtFNFSsKDonpf3b343fKdvfBdxITuPcf5xUkCvvX98IVLAoTeC0KRvgLFSIKDtt297zqU3fKdvfBd8x3EhOs2PgeFS4KRvgLFXv7qQUTnDYKE8yP+2cVJQr3DPfMFS8KE5wwCg7Edrd297zqU3cSE9DY+B4VLgoT4KD3ABUlCtFNFSsKDonpaHa3dve86lN3EhOA9x/nFRNAJgoTgCcKEyj71/fCFS4KExCg9wAVJQrRTRUpChNAKgoO23b3vOpTd8p296HqTHfMdxIToNj4HhUuChOURvgLFSIKE4h+9wsVKAoTwPvq+9kVJQoTkvcM98wVIAoOxHb30+p+dveh6kx3n3fMdxITqN35YRUiChOQfvcLFSgKE8D76vvZFSUK0U0VKwoTopv4MBUgCg7bdve86lN3EhOg2PgeFS4KE8Cg9wAVJQoOielodvfU6X5296HmUHefdxITgPce5xU0ChMU+9L5BRUzCn73CRVJYAUTCDIKEyD76vvaFTEK004VUlx++3gFE0A1Cg6J6X9297zqU3fKdvfBdxIThPcf5xUkChNU+9f3whUuCkb4CxV7+6kFEww2ChMkj/tnFSUKDonpaHa3dvfjdxITkPcf5xUTUCYKE5AnCvvX98IVLAoTMC0K99i5FSkKE1AqCg6J6Wh2t3b343fKdvfBd8x3EhOe9x/nFRNeJgoTnicK+9f3whUsChM+LQpG+AsVIgr3x/ulFSkKE14qCpv4MBUjCg6J6Wh2t3b3vOpTd8p298F3zHcSE4P3H+cVE0MmChODJwoTK/vX98IVLgpG+AsVe/upBRMHNgoTE4/7ZxUlCtFNFSkKE0MqCpv4MBUvChMHMAoOxHa3dve86lN3ynb3wXfMdxIT1tj4HhUuCkb4CxV7+6kFE842ChPmj/tnFSUK0U0VKwqb+DAVLwoTzjAKDonpaHb30+p+dvfBd593zHcSE4L3H+cVE0ImChOCJwoTGvvS+QUVIgoTIo/7ZxUlCtFNFSkKE0IqCpv4MBUvChMSMAoOxqD3p+o/n6Gg98WfEhOo2PgeFS4KE8ig9wAVJQr3DPfMFS8KE5gwCg4Or6D3+6D3xZ8B+Cr3EAP4b/gYFSsKm/gwFSAKDg6J6X929+N3ynb3oep5dxITsPcf5xUkCvvX98IVLAoTcC0KEziP+EoVKAoTNJZ+FSAKDg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg739+ppoPeM6jifpJ8SE4D3QPhWFSUKE1D71/efFSIKE2B+9wsVKAoTSJZ+FSAKDg4ODg7GoPen6j+foaD3mJ+knxITrNj4HhUuCkb4CxV7+6kFE5w2ChPMj/tnFSUK9wz3zBUvChOcMAoODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4OielToI2g96fqP5+hoPeM6mWfEhOA9x/nFRNAJgoTgCcKEyj71/fCFS4KEwKP+EoVKAoTEPvq+9kVJQrRTRUpChNAKgoTBZv4MBUgCg6J6VOgjaD3p+o/n6Gg94zqZZ8SE4D3H+cVE0AmChOAJwoTKPvX98IVLgoTAo/4ShUoChMQ++r72RUlCtFNFSkKE0AqChMFm/gwFSAKDg4ODg4ODg6J6Wqg96fqP5+hoPeM6jifpJ8SE4D3H+cVJAoTUPvX98IVLgoTCkb4CxUiChMEfvcLFSgKEyD76vvZFSUKEwn3DPfMFSAKDg4ODg4ODg4ODg4ODg4ODg4ODg4ODg743RSLFYmx+T24nIwGHgoCLwwJiwwK6gqfjNGOjJD6GAwM+mUL6pOPnPnpDA0cADETABcCAAEAGgAsADgAUAB+AJEAngDBAMwA0wDcAOoA8gD8AQ0BFAEnAToBQwFPAX0BhgGPMTF/+2rDYa6wBZDukeqQ7giLkIiRiZAIC291dm1voHakp6Cgqad3oHIfC3v7qZZz2rqX91oFCzExf/tqw2GusAWQ7pHqkO6LkIiRiZAICy9Ti4oFi4aPiI6IkoKSg5KCCNKL9yKL90CLBZKOjY4fi42JjYiOdqV0qXalCAs7XwWgeqN8oHgI94yLy7dKvgULL1OLigWLho+IjogIC5KCkoOSggjSi/cii/dAiwWSjo2OH4uNiY2IjnaldKl2pQgLSF7bWfeTi+blBQtSXX/7dwULzTydpZ73tAULUl1/+3fNPJ2lnve0BQuIgYOAiIEIC3v7xOe9l/d9BQuIgYOAiIEIe/vE572X930FCzExf/tqBQvDYa6wBZDukeqQ7ouQiJGJkAgLPF8FoXqhfKF5CPeMi8u2Sb4FC9tY95KL5eYFC3z7qJVy27qW91sFCy9Ui4kFi4aQiI6HkoOSgpKDCNOL9yGL90CLBZKPjY4fi42JjYiOdqZzp3amCAvNPZylnve1BQuWc9q6l/daBQsAAAABAAAAAAAAAA4AFgAAAAQAAAACAAAAAgAIADEAOgABAEAAQAACAEIAQgACAEYARgACAE8ATwACAFkAWQACAGIAcwACAHUAegACAAAAAQAAAAoAHAAeAAFERkxUAAgABAAAAAD//wAAAAAAAQAEAAEACAABAAgAAQAGACAAAQACAEcASwABAAAACgAeACwAAURGTFQACAAEAAAAAP//AAEAAAABa2VybgAIAAAAAQABAAIABgAOAAEAAAABABAAAgAAAAEAFgABAAgABP22AAEAAQAvAAEAJAAEAAAACgAeAB4AHgAeAB4AHgAeAB4AHgAeAAEAL/22AAIAAQAxADoAAAAAAAEAAAAIAAAAAAAEAAAAAAAAAAEAAAAAzD2izwAAAADPr89TAAAAAM+4fiECSQAAAkkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABpwBCAC8ALwAvAFwBpwAvAC8ALwBcAC8AXAIBAC8ALwGWAC8ALwBCAC4ALgBYAC8ALwBcAacALwAvAC8ALwAvAC8ALwAvAC8ALwAvAC8ALwGWAC8ALwAvAC8ALwAvAC8AQgAvAC4ALwAvAC8ALwAvAC8ALwAvAEIALwBCAFwBpwAvAC8ALwAvAC8ALwAvAC8BlgAvAC8ALwAvAC8ALwAvAEIALwAuAC8ALwAvAC8ALwAvAC8AAAGWAAAALwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEIAAAAAAAAAAAAvAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC8ALwAAAAAAAAAAAAAAAAAAAC8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA)}:root{--sc-primary-color: #f2f2f2;--sc-primary-text-color: #666666;--sc-alert: #e63c28;--sc-success: #155724;--sc-warning: #f0f34f;--sc-font-family: Arimo, Arial, sans-serif;--sc-row-border-color: #ccc;--sc-btn-color: white;--sc-btn-border: #ccc;--sc-btn-label-color: black;--sc-list-margin: .625rem;--sc-cell-changed-color: #d8edff;--sc-segemented-display-font-size: 4.5rem;--sc-segmented-display-background: #404040;--sc-segmented-display-color: #b0b0b0}.beam_copy{color:var(--sc-primary-text-color);font-size:1rem;line-height:1.5rem;font-family:var(--sc-font-family)}.beam--bold{font-weight:700}.beam--normal{font-weight:400}.beam--alert{color:var(--sc-alert)}.beam--warning{color:var(--sc-warning)}.beam--success{color:var(--sc-success)}.v-toast__item{border-radius:0;color:#fff;font-family:var(--sc-font-family)}.v-toast__item--success{background-color:var(--sc-success)!important;color:#fff}.v-toast__item--info{background-color:var(--sc-primary-text-color)!important}.v-toast__item--warning{background-color:var(--sc-warning)!important;color:#fff}.v-toast__item--error{background-color:var(--sc-alert)!important;color:#fff}.v-toast__item--default{background-color:var(--sc-primary-text-color)!important}
2
+ /*$vite$:1*/`,document.head.appendChild(fi);const na={class:"beam_action-footer"},ia={class:"footer-action-wrapper"},oa=C.defineComponent({__name:"ActionFooter",emits:["click"],setup(o,{emit:c}){const i=c,a=()=>{i("click")};return(l,r)=>{const e=C.resolveComponent("BeamBtn");return C.openBlock(),C.createElementBlock("footer",na,[C.createElementVNode("span",ia,[C.createVNode(e,{onClick:a},{default:C.withCtx(()=>[C.renderSlot(l.$slots,"default",{},void 0,!0)]),_:3})])])}}}),Fe=(o,c)=>{const i=o.__vccOpts||o;for(const[a,l]of c)i[a]=l;return i},di=Fe(oa,[["__scopeId","data-v-37933bd1"]]),sa={class:"beam_metadata_arrow"},aa={class:"beam_metadata_arrow-head"},la={id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 6.74 7.78"},pi=Fe(C.defineComponent({__name:"BeamArrow",props:{color:{}},setup(o){return(c,i)=>(C.openBlock(),C.createElementBlock("div",sa,[C.createElementVNode("div",{class:"beam_metadata_arrow-body",style:C.normalizeStyle({background:c.color||"#c4c4c4"})},null,4),C.createElementVNode("div",aa,[(C.openBlock(),C.createElementBlock("svg",la,[C.createElementVNode("polygon",{points:"6.74 3.89 0 0 0 7.78 6.74 3.89",style:C.normalizeStyle([{fill:"#c4c4c4"},{fill:c.color||"#c4c4c4"}])},null,4)]))])]))}}),[["__scopeId","data-v-94fbdac5"]]),ua={},ca={class:"beam_btn"};function ha(o,c){return C.openBlock(),C.createElementBlock("button",ca,[C.renderSlot(o.$slots,"default",{},()=>[c[0]||(c[0]=C.createTextVNode("Action",-1))],!0)])}const gi=Fe(ua,[["render",ha],["__scopeId","data-v-bc768596"]]),fa={class:"beam_day-divider"},mr=Fe(C.defineComponent({__name:"BeamDayDivider",props:{item:{}},setup(o){const c=C.computed(()=>{if(!o.item.date||isNaN(Date.parse(o.item.date)))return o.item.date;const i=new Date(o.item.date);if(o.item.dateFormat)switch(o.item.dateFormat.toLowerCase()){case"iso":return i.toISOString()}return i.toDateString()});return(i,a)=>(C.openBlock(),C.createElementBlock(C.Fragment,null,[C.createElementVNode("div",fa,[C.createElementVNode("h2",null,C.toDisplayString(c.value),1)]),C.renderSlot(i.$slots,"default",{},void 0,!0)],64))}}),[["__scopeId","data-v-160cf6ef"]]),da={class:"beam_filters"},pa={class:"beam_filters-options"},mi=Fe(C.defineComponent({__name:"BeamFilter",setup(o){const c=C.ref(!1);return(i,a)=>{const l=C.resolveComponent("ToggleArrow"),r=C.resolveComponent("BeamHeading");return C.openBlock(),C.createElementBlock("div",da,[C.createElementVNode("div",{onClick:a[0]||(a[0]=e=>c.value=!c.value),class:"beam_filters-heading"},[C.createVNode(l,{open:c.value},null,8,["open"]),C.createVNode(r,null,{default:C.withCtx(()=>a[1]||(a[1]=[C.createTextVNode("Filter",-1)])),_:1,__:[1]})]),C.withDirectives(C.createElementVNode("div",pa,[C.renderSlot(i.$slots,"default",{},void 0,!0)],512),[[C.vShow,c.value]])])}}}),[["__scopeId","data-v-63a79e46"]]);function Ai(o){return C.getCurrentScope()?(C.onScopeDispose(o),!0):!1}const bi=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const ga=Object.prototype.toString,ma=o=>ga.call(o)==="[object Object]",rt=()=>{},Ar=Aa();function Aa(){var o,c;return bi&&((o=window?.navigator)==null?void 0:o.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((c=window?.navigator)==null?void 0:c.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function ba(...o){if(o.length!==1)return C.toRef(...o);const c=o[0];return typeof c=="function"?C.readonly(C.customRef(()=>({get:c,set:rt}))):C.ref(c)}function ya(o,c){function i(...a){return new Promise((l,r)=>{Promise.resolve(o(()=>c.apply(this,a),{fn:c,thisArg:this,args:a})).then(l).catch(r)})}return i}function wa(o,c={}){let i,a,l=rt;const r=t=>{clearTimeout(t),l(),l=rt};let e;return t=>{const s=C.toValue(o),u=C.toValue(c.maxWait);return i&&r(i),s<=0||u!==void 0&&u<=0?(a&&(r(a),a=void 0),Promise.resolve(t())):new Promise((d,p)=>{l=c.rejectOnCancel?p:d,e=t,u&&!a&&(a=setTimeout(()=>{i&&r(i),a=void 0,d(e())},u)),i=setTimeout(()=>{a&&r(a),a=void 0,d(t())},s)})}}function br(o){return Array.isArray(o)?o:[o]}function va(o,c=200,i={}){return ya(wa(c,i),o)}function _a(o,c,i){return C.watch(o,c,{...i,immediate:!0})}const yi=bi?window:void 0;function Nt(o){var c;const i=C.toValue(o);return(c=i?.$el)!=null?c:i}function zt(...o){const c=[],i=()=>{c.forEach(n=>n()),c.length=0},a=(n,t,s,u)=>(n.addEventListener(t,s,u),()=>n.removeEventListener(t,s,u)),l=C.computed(()=>{const n=br(C.toValue(o[0])).filter(t=>t!=null);return n.every(t=>typeof t!="string")?n:void 0}),r=_a(()=>{var n,t;return[(t=(n=l.value)==null?void 0:n.map(s=>Nt(s)))!=null?t:[yi].filter(s=>s!=null),br(C.toValue(l.value?o[1]:o[0])),br(C.unref(l.value?o[2]:o[1])),C.toValue(l.value?o[3]:o[2])]},([n,t,s,u])=>{if(i(),!n?.length||!t?.length||!s?.length)return;const d=ma(u)?{...u}:u;c.push(...n.flatMap(p=>t.flatMap(g=>s.map(f=>a(p,g,f,d)))))},{flush:"post"}),e=()=>{r(),i()};return Ai(i),e}let wi=!1;function vi(o,c,i={}){const{window:a=yi,ignore:l=[],capture:r=!0,detectIframe:e=!1,controls:n=!1}=i;if(!a)return n?{stop:rt,cancel:rt,trigger:rt}:rt;if(Ar&&!wi){wi=!0;const y={passive:!0};Array.from(a.document.body.children).forEach(_=>_.addEventListener("click",rt,y)),a.document.documentElement.addEventListener("click",rt,y)}let t=!0;const s=y=>C.toValue(l).some(_=>{if(typeof _=="string")return Array.from(a.document.querySelectorAll(_)).some(A=>A===y.target||y.composedPath().includes(A));{const A=Nt(_);return A&&(y.target===A||y.composedPath().includes(A))}});function u(y){const _=C.toValue(y);return _&&_.$.subTree.shapeFlag===16}function d(y,_){const A=C.toValue(y),w=A.$.subTree&&A.$.subTree.children;return w==null||!Array.isArray(w)?!1:w.some(T=>T.el===_.target||_.composedPath().includes(T.el))}const p=y=>{const _=Nt(o);if(y.target!=null&&!(!(_ instanceof Element)&&u(o)&&d(o,y))&&!(!_||_===y.target||y.composedPath().includes(_))){if("detail"in y&&y.detail===0&&(t=!s(y)),!t){t=!0;return}c(y)}};let g=!1;const f=[zt(a,"click",y=>{g||(g=!0,setTimeout(()=>{g=!1},0),p(y))},{passive:!0,capture:r}),zt(a,"pointerdown",y=>{const _=Nt(o);t=!s(y)&&!!(_&&!y.composedPath().includes(_))},{passive:!0}),e&&zt(a,"blur",y=>{setTimeout(()=>{var _;const A=Nt(o);((_=a.document.activeElement)==null?void 0:_.tagName)==="IFRAME"&&!A?.contains(a.document.activeElement)&&c(y)},0)},{passive:!0})].filter(Boolean),b=()=>f.forEach(y=>y());return n?{stop:b,cancel:()=>{t=!1},trigger:y=>{t=!0,p(y),t=!1}}:b}const yr=new WeakMap,Ea={mounted(o,c){const i=!c.modifiers.bubble;let a;if(typeof c.value=="function")a=vi(o,c.value,{capture:i});else{const[l,r]=c.value;a=vi(o,l,Object.assign({capture:i},r))}yr.set(o,a)},unmounted(o){const c=yr.get(o);c&&typeof c=="function"?c():c?.stop(),yr.delete(o)}};function wr(o){return typeof Window<"u"&&o instanceof Window?o.document.documentElement:typeof Document<"u"&&o instanceof Document?o.documentElement:o}function _i(o){const c=window.getComputedStyle(o);if(c.overflowX==="scroll"||c.overflowY==="scroll"||c.overflowX==="auto"&&o.clientWidth<o.scrollWidth||c.overflowY==="auto"&&o.clientHeight<o.scrollHeight)return!0;{const i=o.parentNode;return!i||i.tagName==="BODY"?!1:_i(i)}}function Sa(o){const c=o||window.event,i=c.target;return _i(i)?!1:c.touches.length>1?!0:(c.preventDefault&&c.preventDefault(),!1)}const vr=new WeakMap;function Ca(o,c=!1){const i=C.shallowRef(c);let a=null,l="";C.watch(ba(o),n=>{const t=wr(C.toValue(n));if(t){const s=t;if(vr.get(s)||vr.set(s,s.style.overflow),s.style.overflow!=="hidden"&&(l=s.style.overflow),s.style.overflow==="hidden")return i.value=!0;if(i.value)return s.style.overflow="hidden"}},{immediate:!0});const r=()=>{const n=wr(C.toValue(o));!n||i.value||(Ar&&(a=zt(n,"touchmove",t=>{Sa(t)},{passive:!1})),n.style.overflow="hidden",i.value=!0)},e=()=>{const n=wr(C.toValue(o));!n||!i.value||(Ar&&a?.(),n.style.overflow=l,vr.delete(n),i.value=!1)};return Ai(e),C.computed({get(){return i.value},set(n){n?r():e()}})}function ka(){let o=!1;const c=C.shallowRef(!1);return(i,a)=>{if(c.value=a.value,o)return;o=!0;const l=Ca(i,a.value);C.watch(c,r=>l.value=r)}}ka();const Ia={class:"beam_filter-container"},Ta={class:"beam_filter-option-select"},Ba={class:"beam_filter-label"},Oa={key:0,ref:"menu",class:"beam_filter-select-menu"},Pa=["data-value","onClick"],Ei=Fe(C.defineComponent({__name:"BeamFilterOption",props:{choices:{default:()=>[]},title:{default:"title"}},emits:["select"],setup(o,{emit:c}){const i=c,a=C.ref(!1),l=C.ref(o.choices[0].label),r=C.ref(o.choices[0].value),e=n=>{l.value=n.label,r.value=n.value,i("select",n)};return(n,t)=>{const s=C.resolveComponent("BeamHeading");return C.withDirectives((C.openBlock(),C.createElementBlock("div",Ia,[C.createVNode(s,{class:"beam_filter-option-heading"},{default:C.withCtx(()=>[C.createTextVNode(C.toDisplayString(n.title),1)]),_:1}),C.createElementVNode("div",{onClick:t[0]||(t[0]=u=>a.value=!a.value),class:"beam_filter-option"},[C.createElementVNode("div",Ta,[t[1]||(t[1]=C.createElementVNode("div",{class:"beam_filter-arrow"},[C.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 35.36 70.71"},[C.createElementVNode("polygon",{points:"0 70.71 0 0 35.36 35.36 0 70.71"})])],-1)),C.createElementVNode("div",Ba,[C.createElementVNode("label",null,C.toDisplayString(l.value),1)])]),a.value?(C.openBlock(),C.createElementBlock("ul",Oa,[(C.openBlock(!0),C.createElementBlock(C.Fragment,null,C.renderList(n.choices,u=>(C.openBlock(),C.createElementBlock("li",{class:C.normalizeClass([{selected:l.value==u.label},"beam_filter-select-option"]),"data-value":u.value,key:u.value,onClick:d=>e(u)},C.toDisplayString(u.label),11,Pa))),128))],512)):C.createCommentVNode("",!0)])])),[[C.unref(Ea),()=>a.value=!1]])}}}),[["__scopeId","data-v-be55508c"]]),xa={},Ra={class:"beam_header"};function Ma(o,c){return C.openBlock(),C.createElementBlock("h1",Ra,[C.renderSlot(o.$slots,"default",{},void 0,!0)])}const Si=Fe(xa,[["render",Ma],["__scopeId","data-v-5182a4d5"]]),Ua={class:"beam_metadata"},Da={class:"beam_metadata_content"},La={class:"beam_metadata_block"},Na={class:"beam_metadata_heading"},Ci=Fe(C.defineComponent({__name:"BeamMetadata",props:{order:{}},setup(o){return(c,i)=>(C.openBlock(),C.createElementBlock("div",Ua,[C.createElementVNode("div",Da,[C.renderSlot(c.$slots,"default",{},()=>[i[1]||(i[1]=C.createElementVNode("div",{class:"beam_metadata_header beam_metadata--two-column"},null,-1)),C.createElementVNode("div",La,[C.createElementVNode("p",Na,[i[0]||(i[0]=C.createTextVNode(" Status: ",-1)),C.createElementVNode("span",{class:C.normalizeClass([{alert:!c.order.complete},"beam_metadata--normal"])},C.toDisplayString(c.order.complete?"Complete":"In Progress"),3)])]),i[2]||(i[2]=C.createStaticVNode('<div class="beam_metadata_shipping beam_metadata_block" data-v-80484331><div class="beam_metadata_source" data-v-80484331><p class="beam_metadata_heading" data-v-80484331>Source</p></div><div class="beam_metadata_source" data-v-80484331><p class="beam_metadata_heading" data-v-80484331>Receiving</p></div></div>',1))],!0)]),i[3]||(i[3]=C.createElementVNode("hr",null,null,-1))]))}}),[["__scopeId","data-v-80484331"]]),Fa={class:"beam_modal"},ki=Fe(C.defineComponent({__name:"BeamModal",props:{showModal:{type:Boolean}},setup(o){return(c,i)=>{const a=C.resolveComponent("BeamBtn"),l=C.resolveComponent("portal");return C.openBlock(),C.createBlock(l,{to:"beam_modal_outlet"},{default:C.withCtx(()=>[C.withDirectives(C.createElementVNode("div",Fa,[C.createVNode(a,{onClick:i[0]||(i[0]=r=>c.$emit("closemodal"))},{default:C.withCtx(()=>i[3]||(i[3]=[C.createTextVNode("Close Modal",-1)])),_:1,__:[3]}),C.renderSlot(c.$slots,"default",{onClosemodal:i[1]||(i[1]=r=>c.$emit("closemodal")),onConfirmmodal:i[2]||(i[2]=r=>c.$emit("confirmmodal"))},void 0,!0)],512),[[C.vShow,c.showModal]])]),_:3})}}}),[["__scopeId","data-v-4f3f0253"]]),Ii=C.defineComponent({__name:"BeamModalOutlet",emits:["confirmmodal","closemodal"],setup(o){return(c,i)=>{const a=C.resolveComponent("portal-target");return C.openBlock(),C.createBlock(a,{name:"beam_modal_outlet"})}}}),ja={class:"beam_metadata_heading"},Ti=C.defineComponent({__name:"BeamProgress",props:{label:{default:"Status"},progressMessage:{default:"In Progress"},completeMessage:{default:"Complete"},complete:{type:Boolean,default:!1}},setup(o){const c=C.computed(()=>o.complete?o.completeMessage:o.progressMessage);return(i,a)=>(C.openBlock(),C.createElementBlock("p",ja,[C.createTextVNode(C.toDisplayString(i.label)+": ",1),C.createElementVNode("span",{class:C.normalizeClass([{"beam--alert":!i.complete},"beam--normal"])},C.toDisplayString(c.value),3)]))}}),Wa={},Va={class:"beam_modal-confirm"};function Qa(o,c){const i=C.resolveComponent("BeamBtn");return C.openBlock(),C.createElementBlock("div",Va,[c[4]||(c[4]=C.createElementVNode("h2",null,"Would you like to continue?",-1)),C.createVNode(i,{onClick:c[0]||(c[0]=a=>o.$emit("confirmmodal"))},{default:C.withCtx(()=>c[2]||(c[2]=[C.createTextVNode("Yes",-1)])),_:1,__:[2]}),C.createVNode(i,{onClick:c[1]||(c[1]=a=>o.$emit("confirmmodal"))},{default:C.withCtx(()=>c[3]||(c[3]=[C.createTextVNode("No",-1)])),_:1,__:[3]})])}const Bi=Fe(Wa,[["render",Qa],["__scopeId","data-v-5b430dca"]]),Ka={},Ha={class:"fixed-top"};function qa(o,c){return C.openBlock(),C.createElementBlock("div",Ha,[C.renderSlot(o.$slots,"default",{},void 0,!0)])}const Oi=Fe(Ka,[["render",qa],["__scopeId","data-v-a38a41d0"]]),$a={class:"container"},_r=Fe(C.defineComponent({__name:"ItemCheck",props:{modelValue:{type:Boolean,default:!1},modelModifiers:{}},emits:["update:modelValue"],setup(o){const c=C.useModel(o,"modelValue");return(i,a)=>(C.openBlock(),C.createElementBlock("label",$a,[C.withDirectives(C.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":a[0]||(a[0]=l=>c.value=l),tabindex:"-1"},null,512),[[C.vModelCheckbox,c.value]]),a[1]||(a[1]=C.createElementVNode("div",{class:"checkmark",tabindex:"0"},null,-1))]))}}),[["__scopeId","data-v-14a5f31b"]]),za={class:"beam_item-count"},Ga=["contenteditable"],Ya={key:0},Ja={key:1},Er=Fe(C.defineComponent({__name:"ItemCount",props:C.mergeModels({denominator:{default:0},debounce:{default:300},editable:{default:!0},uom:{default:""}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const c=C.useModel(o,"modelValue"),i=C.computed(()=>o.denominator!==0&&c.value===o.denominator),a=e=>{const n=Number(e.target.innerHTML)||0;c.value=o.denominator?Math.min(n,o.denominator):n},l=va(e=>a(e),o.debounce),r=async e=>await l(e);return(e,n)=>(C.openBlock(),C.createElementBlock("div",za,[C.createElementVNode("span",{contenteditable:e.editable,class:C.normalizeClass({"beam--alert":!i.value}),onClick:C.withModifiers(a,["stop","prevent"]),onInput:C.withModifiers(r,["stop","prevent"]),onPaste:a},C.toDisplayString(c.value),43,Ga),e.denominator?(C.openBlock(),C.createElementBlock("span",Ya,"/"+C.toDisplayString(e.denominator),1)):C.createCommentVNode("",!0),e.uom?(C.openBlock(),C.createElementBlock("span",Ja,"  "+C.toDisplayString(e.uom),1)):C.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-fa0e6dff"]]),Za=["href"],Pi=Fe(C.defineComponent({__name:"ListAnchor",props:{to:{default:""}},setup(o){return(c,i)=>(C.openBlock(),C.createElementBlock("a",{href:c.to,class:"beam_list-anchor"},[C.renderSlot(c.$slots,"default",{},void 0,!0)],8,Za))}}),[["__scopeId","data-v-7e3ecf0d"]]),Xa={tabindex:"0",class:"beam_list-item"},el={class:"beam_list-text"},tl={class:"beam--bold"},Gt=Fe(C.defineComponent({__name:"ListItem",props:{item:{}},emits:["update"],setup(o,{emit:c}){const i=c,a=C.ref(o.item);return C.watch(a,l=>{i("update",l)},{deep:!0}),(l,r)=>(C.openBlock(),C.createElementBlock("li",Xa,[C.createElementVNode("div",el,[C.createElementVNode("label",tl,C.toDisplayString(a.value.label),1),C.createElementVNode("p",null,C.toDisplayString(a.value.description),1)]),a.value.count?(C.openBlock(),C.createBlock(Er,{key:0,modelValue:a.value.count.count,"onUpdate:modelValue":r[0]||(r[0]=e=>a.value.count.count=e),debounce:a.value.debounce,denominator:a.value.count.of,editable:!0,uom:a.value.count.uom},null,8,["modelValue","debounce","denominator","uom"])):C.createCommentVNode("",!0),a.value.hasOwnProperty("checked")?(C.openBlock(),C.createBlock(_r,{key:1,modelValue:a.value.checked,"onUpdate:modelValue":r[1]||(r[1]=e=>a.value.checked=e)},null,8,["modelValue"])):C.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-634dd647"]]),rl={class:"beam_list-view"},xi=Fe(C.defineComponent({__name:"ListView",props:{items:{}},emits:["update","scrollbottom"],setup(o,{emit:c}){const i=c;C.onMounted(()=>{window.addEventListener("scroll",l)}),C.onUnmounted(()=>{window.removeEventListener("scroll",l)});const a=r=>i("update",r),l=()=>{const r=document.documentElement.scrollHeight-window.innerHeight,e=document.documentElement.scrollTop;r-e<=2&&i("scrollbottom")};return(r,e)=>(C.openBlock(),C.createElementBlock("ul",rl,[(C.openBlock(!0),C.createElementBlock(C.Fragment,null,C.renderList(r.items,n=>(C.openBlock(),C.createElementBlock("li",{key:n.barcode||n.label},[n.linkComponent=="BeamDayDivider"?(C.openBlock(),C.createBlock(mr,{key:0,item:n},null,8,["item"])):n.linkComponent?(C.openBlock(),C.createBlock(C.resolveDynamicComponent(n.linkComponent),{key:1,to:n.route,tabindex:"-1"},{default:C.withCtx(()=>[C.createVNode(Gt,{item:n,onUpdate:a},null,8,["item"])]),_:2},1032,["to"])):(C.openBlock(),C.createBlock(Gt,{key:2,item:n,onUpdate:a},null,8,["item"]))]))),128))]))}}),[["__scopeId","data-v-d536b2a7"]]),nl={class:"beam_navbar"},Ri=Fe(C.defineComponent({__name:"Navbar",emits:["click"],setup(o,{emit:c}){const i=c,a=()=>{i("click")};return(l,r)=>{const e=C.resolveComponent("BeamHeading"),n=C.resolveComponent("BeamBtn");return C.openBlock(),C.createElementBlock("nav",nl,[C.renderSlot(l.$slots,"title",{},()=>[C.createVNode(e,null,{default:C.withCtx(()=>r[0]||(r[0]=[C.createTextVNode("TITLE",-1)])),_:1,__:[0]})],!0),C.createVNode(n,{onClick:a},{default:C.withCtx(()=>[C.renderSlot(l.$slots,"navbaraction",{},()=>[r[1]||(r[1]=C.createTextVNode("Action",-1))],!0)]),_:3})])}}}),[["__scopeId","data-v-cfc4c14e"]]);function il(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Yt={exports:{}},ol=Yt.exports,Mi;function sl(){return Mi||(Mi=1,function(o,c){(function(i,a){o.exports=a()})(ol,function(){var i={attachTo:function(a,l){if(a.scannerDetectionData!==void 0)throw new Error("onScan.js is already initialized for DOM element "+a);var r={onScan:function(e,n){},onScanError:function(e){},onKeyProcess:function(e,n){},onKeyDetect:function(e,n){},onPaste:function(e,n){},keyCodeMapper:function(e){return i.decodeKeyEvent(e)},onScanButtonLongPress:function(){},scanButtonKeyCode:!1,scanButtonLongPressTime:500,timeBeforeScanTest:100,avgTimeByChar:30,minLength:6,suffixKeyCodes:[9,13],prefixKeyCodes:[],ignoreIfFocusOn:!1,stopPropagation:!1,preventDefault:!1,captureEvents:!1,reactToKeydown:!0,reactToPaste:!1,singleScanQty:1};return l=this._mergeOptions(r,l),a.scannerDetectionData={options:l,vars:{firstCharTime:0,lastCharTime:0,accumulatedString:"",testTimer:!1,longPressTimeStart:0,longPressed:!1}},l.reactToPaste===!0&&a.addEventListener("paste",this._handlePaste,l.captureEvents),l.scanButtonKeyCode!==!1&&a.addEventListener("keyup",this._handleKeyUp,l.captureEvents),(l.reactToKeydown===!0||l.scanButtonKeyCode!==!1)&&a.addEventListener("keydown",this._handleKeyDown,l.captureEvents),this},detachFrom:function(a){a.scannerDetectionData.options.reactToPaste&&a.removeEventListener("paste",this._handlePaste),a.scannerDetectionData.options.scanButtonKeyCode!==!1&&a.removeEventListener("keyup",this._handleKeyUp),a.removeEventListener("keydown",this._handleKeyDown),a.scannerDetectionData=void 0},getOptions:function(a){return a.scannerDetectionData.options},setOptions:function(a,l){switch(a.scannerDetectionData.options.reactToPaste){case!0:l.reactToPaste===!1&&a.removeEventListener("paste",this._handlePaste);break;case!1:l.reactToPaste===!0&&a.addEventListener("paste",this._handlePaste);break}switch(a.scannerDetectionData.options.scanButtonKeyCode){case!1:l.scanButtonKeyCode!==!1&&a.addEventListener("keyup",this._handleKeyUp);break;default:l.scanButtonKeyCode===!1&&a.removeEventListener("keyup",this._handleKeyUp);break}return a.scannerDetectionData.options=this._mergeOptions(a.scannerDetectionData.options,l),this._reinitialize(a),this},decodeKeyEvent:function(a){var l=this._getNormalizedKeyNum(a);switch(!0){case(l>=48&&l<=90):case(l>=106&&l<=111):if(a.key!==void 0&&a.key!=="")return a.key;var r=String.fromCharCode(l);switch(a.shiftKey){case!1:r=r.toLowerCase();break;case!0:r=r.toUpperCase();break}return r;case(l>=96&&l<=105):return 0+(l-96)}return""},simulate:function(a,l){return this._reinitialize(a),Array.isArray(l)?l.forEach(function(r){var e={};(typeof r=="object"||typeof r=="function")&&r!==null?e=r:e.keyCode=parseInt(r);var n=new KeyboardEvent("keydown",e);document.dispatchEvent(n)}):this._validateScanCode(a,l),this},_reinitialize:function(a){var l=a.scannerDetectionData.vars;l.firstCharTime=0,l.lastCharTime=0,l.accumulatedString=""},_isFocusOnIgnoredElement:function(a){var l=a.scannerDetectionData.options.ignoreIfFocusOn;if(!l)return!1;var r=document.activeElement;if(Array.isArray(l)){for(var e=0;e<l.length;e++)if(r.matches(l[e])===!0)return!0}else if(r.matches(l))return!0;return!1},_validateScanCode:function(a,l){var r=a.scannerDetectionData,e=r.options,n=r.options.singleScanQty,t=r.vars.firstCharTime,s=r.vars.lastCharTime,u={},d;switch(!0){case l.length<e.minLength:u={message:"Receieved code is shorter then minimal length"};break;case s-t>l.length*e.avgTimeByChar:u={message:"Receieved code was not entered in time"};break;default:return e.onScan.call(a,l,n),d=new CustomEvent("scan",{detail:{scanCode:l,qty:n}}),a.dispatchEvent(d),i._reinitialize(a),!0}return u.scanCode=l,u.scanDuration=s-t,u.avgTimeByChar=e.avgTimeByChar,u.minLength=e.minLength,e.onScanError.call(a,u),d=new CustomEvent("scanError",{detail:u}),a.dispatchEvent(d),i._reinitialize(a),!1},_mergeOptions:function(a,l){var r={},e;for(e in a)Object.prototype.hasOwnProperty.call(a,e)&&(r[e]=a[e]);for(e in l)Object.prototype.hasOwnProperty.call(l,e)&&(r[e]=l[e]);return r},_getNormalizedKeyNum:function(a){return a.which||a.keyCode},_handleKeyDown:function(a){var l=i._getNormalizedKeyNum(a),r=this.scannerDetectionData.options,e=this.scannerDetectionData.vars,n=!1;if(r.onKeyDetect.call(this,l,a)!==!1&&!i._isFocusOnIgnoredElement(this)){if(r.scanButtonKeyCode!==!1&&l==r.scanButtonKeyCode){e.longPressed||(e.longPressTimer=setTimeout(r.onScanButtonLongPress,r.scanButtonLongPressTime,this),e.longPressed=!0);return}switch(!0){case(e.firstCharTime&&r.suffixKeyCodes.indexOf(l)!==-1):a.preventDefault(),a.stopImmediatePropagation(),n=!0;break;case(!e.firstCharTime&&r.prefixKeyCodes.indexOf(l)!==-1):a.preventDefault(),a.stopImmediatePropagation(),n=!1;break;default:var t=r.keyCodeMapper.call(this,a);if(t===null)return;e.accumulatedString+=t,r.preventDefault&&a.preventDefault(),r.stopPropagation&&a.stopImmediatePropagation(),n=!1;break}e.firstCharTime||(e.firstCharTime=Date.now()),e.lastCharTime=Date.now(),e.testTimer&&clearTimeout(e.testTimer),n?(i._validateScanCode(this,e.accumulatedString),e.testTimer=!1):e.testTimer=setTimeout(i._validateScanCode,r.timeBeforeScanTest,this,e.accumulatedString),r.onKeyProcess.call(this,t,a)}},_handlePaste:function(a){var l=this.scannerDetectionData.options,r=this.scannerDetectionData.vars,e=(event.clipboardData||window.clipboardData).getData("text");i._isFocusOnIgnoredElement(this)||(a.preventDefault(),l.stopPropagation&&a.stopImmediatePropagation(),l.onPaste.call(this,e,event),r.firstCharTime=0,r.lastCharTime=0,i._validateScanCode(this,e))},_handleKeyUp:function(a){if(!i._isFocusOnIgnoredElement(this)){var l=i._getNormalizedKeyNum(a);l==this.scannerDetectionData.options.scanButtonKeyCode&&(clearTimeout(this.scannerDetectionData.vars.longPressTimer),this.scannerDetectionData.vars.longPressed=!1)}},isScanInProgressFor:function(a){return a.scannerDetectionData.vars.firstCharTime>0},isAttachedTo:function(a){return a.scannerDetectionData!==void 0}};return i})}(Yt)),Yt.exports}var al=sl();const Ui=il(al),ll={id:"scan_input"},Di=C.defineComponent({__name:"ScanInput",props:{scanHandler:{type:Function}},emits:["scanInstance"],setup(o,{emit:c}){const i=c,a=o;return C.onMounted(()=>{const l=Ui.attachTo(window,{onScan:a.scanHandler});i("scanInstance",l)}),C.onUnmounted(()=>{Ui.detachFrom(window)}),(l,r)=>(C.openBlock(),C.createElementBlock("div",ll))}}),Li=Fe(C.defineComponent({__name:"SegmentedDisplay",props:{displayInput:{default:120.2568},decimalPlaces:{default:2},displayColor:{default:"gray"},textColor:{default:"white"}},setup(o){const c=C.computed(()=>o.displayInput===0?0 .toFixed(o.decimalPlaces):o.displayInput.toFixed(o.decimalPlaces)),i=a=>a.substr(0,2)=="--"?`var(${a})`:a;return(a,l)=>(C.openBlock(),C.createElementBlock("div",{class:"segmented-display",style:C.normalizeStyle({background:i(a.displayColor)})},[C.createElementVNode("h1",{class:"segmented-display-output",style:C.normalizeStyle({color:i(a.textColor)})},C.toDisplayString(c.value),5)],4))}}),[["__scopeId","data-v-140e435e"]]),ul={class:"column column-left"},cl={class:"column column-right"},Ni=Fe(C.defineComponent({__name:"SplitColumn",props:{justifyContent:{},alignItems:{}},setup(o){return(c,i)=>(C.openBlock(),C.createElementBlock("div",{class:"two-column",style:C.normalizeStyle({justifyContent:c.justifyContent||"space-between",alignItems:c.alignItems||"flex-start"})},[C.createElementVNode("div",ul,[C.renderSlot(c.$slots,"left",{},void 0,!0)]),C.createElementVNode("div",cl,[C.renderSlot(c.$slots,"right",{},void 0,!0)])],4))}}),[["__scopeId","data-v-c65440c0"]]),Fi=Fe(C.defineComponent({__name:"ToggleArrow",props:{open:{type:Boolean}},setup(o){return(c,i)=>(C.openBlock(),C.createElementBlock("div",{class:C.normalizeClass(["arrow-icon",{open:c.open}])},i[0]||(i[0]=[C.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 35.36 70.71"},[C.createElementVNode("polygon",{points:"0 70.71 0 0 35.36 35.36 0 70.71"})],-1)]),2))}}),[["__scopeId","data-v-05e7abed"]]);var Sr=Object.defineProperty,hl=Object.getOwnPropertyDescriptor,fl=Object.getOwnPropertyNames,dl=Object.prototype.hasOwnProperty,He=(o,c)=>()=>(o&&(c=o(o=0)),c),fe=(o,c)=>()=>(c||o((c={exports:{}}).exports,c),c.exports),Rt=(o,c)=>{for(var i in c)Sr(o,i,{get:c[i],enumerable:!0})},pl=(o,c,i,a)=>{if(c&&typeof c=="object"||typeof c=="function")for(let l of fl(c))!dl.call(o,l)&&l!==i&&Sr(o,l,{get:()=>c[l],enumerable:!(a=hl(c,l))||a.enumerable});return o},Be=o=>pl(Sr({},"__esModule",{value:!0}),o),oe=He(()=>{}),ke={};Rt(ke,{_debugEnd:()=>on,_debugProcess:()=>nn,_events:()=>vn,_eventsCount:()=>_n,_exiting:()=>Qr,_fatalExceptions:()=>en,_getActiveHandles:()=>qi,_getActiveRequests:()=>Hi,_kill:()=>qr,_linkedBinding:()=>Qi,_maxListeners:()=>wn,_preload_modules:()=>An,_rawDebug:()=>jr,_startProfilerIdleNotifier:()=>sn,_stopProfilerIdleNotifier:()=>an,_tickCallback:()=>rn,abort:()=>hn,addListener:()=>En,allowedNodeEnvironmentFlags:()=>Zr,arch:()=>Ir,argv:()=>Or,argv0:()=>mn,assert:()=>$i,binding:()=>Ur,chdir:()=>Nr,config:()=>Kr,cpuUsage:()=>jt,cwd:()=>Lr,debugPort:()=>gn,default:()=>Pn,dlopen:()=>Ki,domain:()=>Vr,emit:()=>Tn,emitWarning:()=>Mr,env:()=>Br,execArgv:()=>Pr,execPath:()=>pn,exit:()=>Yr,features:()=>Xr,hasUncaughtExceptionCaptureCallback:()=>zi,hrtime:()=>Jt,kill:()=>Gr,listeners:()=>Yi,memoryUsage:()=>zr,moduleLoadList:()=>Wr,nextTick:()=>Wi,off:()=>Cn,on:()=>nt,once:()=>Sn,openStdin:()=>Jr,pid:()=>fn,platform:()=>Tr,ppid:()=>dn,prependListener:()=>Bn,prependOnceListener:()=>On,reallyExit:()=>Hr,release:()=>Fr,removeAllListeners:()=>In,removeListener:()=>kn,resourceUsage:()=>$r,setSourceMapsEnabled:()=>bn,setUncaughtExceptionCaptureCallback:()=>tn,stderr:()=>un,stdin:()=>cn,stdout:()=>ln,title:()=>kr,umask:()=>Dr,uptime:()=>Gi,version:()=>xr,versions:()=>Rr});function Cr(o){throw new Error("Node.js process "+o+" is not supported by JSPM core outside of Node.js")}function gl(){!yt||!wt||(yt=!1,wt.length?Xe=wt.concat(Xe):Ft=-1,Xe.length&&ji())}function ji(){if(!yt){var o=setTimeout(gl,0);yt=!0;for(var c=Xe.length;c;){for(wt=Xe,Xe=[];++Ft<c;)wt&&wt[Ft].run();Ft=-1,c=Xe.length}wt=null,yt=!1,clearTimeout(o)}}function Wi(o){var c=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)c[i-1]=arguments[i];Xe.push(new Vi(o,c)),Xe.length===1&&!yt&&setTimeout(ji,0)}function Vi(o,c){this.fun=o,this.array=c}function Qe(){}function Qi(o){Cr("_linkedBinding")}function Ki(o){Cr("dlopen")}function Hi(){return[]}function qi(){return[]}function $i(o,c){if(!o)throw new Error(c||"assertion error")}function zi(){return!1}function Gi(){return it.now()/1e3}function Jt(o){var c=Math.floor((Date.now()-it.now())*.001),i=it.now()*.001,a=Math.floor(i)+c,l=Math.floor(i%1*1e9);return o&&(a=a-o[0],l=l-o[1],l<0&&(a--,l+=Zt)),[a,l]}function nt(){return Pn}function Yi(o){return[]}var Xe,yt,wt,Ft,kr,Ir,Tr,Br,Or,Pr,xr,Rr,Mr,Ur,Dr,Lr,Nr,Fr,jr,Wr,Vr,Qr,Kr,Hr,qr,jt,$r,zr,Gr,Yr,Jr,Zr,Xr,en,tn,rn,nn,on,sn,an,ln,un,cn,hn,fn,dn,pn,gn,mn,An,bn,it,yn,Zt,wn,vn,_n,En,Sn,Cn,kn,In,Tn,Bn,On,Pn,ml=He(()=>{oe(),ae(),se(),Xe=[],yt=!1,Ft=-1,Vi.prototype.run=function(){this.fun.apply(null,this.array)},kr="browser",Ir="x64",Tr="browser",Br={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},Or=["/usr/bin/node"],Pr=[],xr="v16.8.0",Rr={},Mr=function(o,c){console.warn((c?c+": ":"")+o)},Ur=function(o){Cr("binding")},Dr=function(o){return 0},Lr=function(){return"/"},Nr=function(o){},Fr={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},jr=Qe,Wr=[],Vr={},Qr=!1,Kr={},Hr=Qe,qr=Qe,jt=function(){return{}},$r=jt,zr=jt,Gr=Qe,Yr=Qe,Jr=Qe,Zr={},Xr={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},en=Qe,tn=Qe,rn=Qe,nn=Qe,on=Qe,sn=Qe,an=Qe,ln=void 0,un=void 0,cn=void 0,hn=Qe,fn=2,dn=1,pn="/bin/usr/node",gn=9229,mn="node",An=[],bn=Qe,it={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},it.now===void 0&&(yn=Date.now(),it.timing&&it.timing.navigationStart&&(yn=it.timing.navigationStart),it.now=()=>Date.now()-yn),Zt=1e9,Jt.bigint=function(o){var c=Jt(o);return typeof BigInt>"u"?c[0]*Zt+c[1]:BigInt(c[0]*Zt)+BigInt(c[1])},wn=10,vn={},_n=0,En=nt,Sn=nt,Cn=nt,kn=nt,In=nt,Tn=Qe,Bn=nt,On=nt,Pn={version:xr,versions:Rr,arch:Ir,platform:Tr,release:Fr,_rawDebug:jr,moduleLoadList:Wr,binding:Ur,_linkedBinding:Qi,_events:vn,_eventsCount:_n,_maxListeners:wn,on:nt,addListener:En,once:Sn,off:Cn,removeListener:kn,removeAllListeners:In,emit:Tn,prependListener:Bn,prependOnceListener:On,listeners:Yi,domain:Vr,_exiting:Qr,config:Kr,dlopen:Ki,uptime:Gi,_getActiveRequests:Hi,_getActiveHandles:qi,reallyExit:Hr,_kill:qr,cpuUsage:jt,resourceUsage:$r,memoryUsage:zr,kill:Gr,exit:Yr,openStdin:Jr,allowedNodeEnvironmentFlags:Zr,assert:$i,features:Xr,_fatalExceptions:en,setUncaughtExceptionCaptureCallback:tn,hasUncaughtExceptionCaptureCallback:zi,emitWarning:Mr,nextTick:Wi,_tickCallback:rn,_debugProcess:nn,_debugEnd:on,_startProfilerIdleNotifier:sn,_stopProfilerIdleNotifier:an,stdout:ln,stdin:cn,stderr:un,abort:hn,umask:Dr,chdir:Nr,cwd:Lr,env:Br,title:kr,argv:Or,execArgv:Pr,pid:fn,ppid:dn,execPath:pn,debugPort:gn,hrtime:Jt,argv0:mn,_preload_modules:An,setSourceMapsEnabled:bn}}),se=He(()=>{ml()}),We={};Rt(We,{Buffer:()=>Xt,INSPECT_MAX_BYTES:()=>Ji,default:()=>ot,kMaxLength:()=>Zi});function Al(){if(xn)return Mt;xn=!0,Mt.byteLength=n,Mt.toByteArray=s,Mt.fromByteArray=p;for(var o=[],c=[],i=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,r=a.length;l<r;++l)o[l]=a[l],c[a.charCodeAt(l)]=l;c[45]=62,c[95]=63;function e(g){var f=g.length;if(f%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var b=g.indexOf("=");b===-1&&(b=f);var y=b===f?0:4-b%4;return[b,y]}function n(g){var f=e(g),b=f[0],y=f[1];return(b+y)*3/4-y}function t(g,f,b){return(f+b)*3/4-b}function s(g){var f,b=e(g),y=b[0],_=b[1],A=new i(t(g,y,_)),w=0,T=_>0?y-4:y,k;for(k=0;k<T;k+=4)f=c[g.charCodeAt(k)]<<18|c[g.charCodeAt(k+1)]<<12|c[g.charCodeAt(k+2)]<<6|c[g.charCodeAt(k+3)],A[w++]=f>>16&255,A[w++]=f>>8&255,A[w++]=f&255;return _===2&&(f=c[g.charCodeAt(k)]<<2|c[g.charCodeAt(k+1)]>>4,A[w++]=f&255),_===1&&(f=c[g.charCodeAt(k)]<<10|c[g.charCodeAt(k+1)]<<4|c[g.charCodeAt(k+2)]>>2,A[w++]=f>>8&255,A[w++]=f&255),A}function u(g){return o[g>>18&63]+o[g>>12&63]+o[g>>6&63]+o[g&63]}function d(g,f,b){for(var y,_=[],A=f;A<b;A+=3)y=(g[A]<<16&16711680)+(g[A+1]<<8&65280)+(g[A+2]&255),_.push(u(y));return _.join("")}function p(g){for(var f,b=g.length,y=b%3,_=[],A=16383,w=0,T=b-y;w<T;w+=A)_.push(d(g,w,w+A>T?T:w+A));return y===1?(f=g[b-1],_.push(o[f>>2]+o[f<<4&63]+"==")):y===2&&(f=(g[b-2]<<8)+g[b-1],_.push(o[f>>10]+o[f>>4&63]+o[f<<2&63]+"=")),_.join("")}return Mt}function bl(){return Rn?Wt:(Rn=!0,Wt.read=function(o,c,i,a,l){var r,e,n=l*8-a-1,t=(1<<n)-1,s=t>>1,u=-7,d=i?l-1:0,p=i?-1:1,g=o[c+d];for(d+=p,r=g&(1<<-u)-1,g>>=-u,u+=n;u>0;r=r*256+o[c+d],d+=p,u-=8);for(e=r&(1<<-u)-1,r>>=-u,u+=a;u>0;e=e*256+o[c+d],d+=p,u-=8);if(r===0)r=1-s;else{if(r===t)return e?NaN:(g?-1:1)*(1/0);e=e+Math.pow(2,a),r=r-s}return(g?-1:1)*e*Math.pow(2,r-a)},Wt.write=function(o,c,i,a,l,r){var e,n,t,s=r*8-l-1,u=(1<<s)-1,d=u>>1,p=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=a?0:r-1,f=a?1:-1,b=c<0||c===0&&1/c<0?1:0;for(c=Math.abs(c),isNaN(c)||c===1/0?(n=isNaN(c)?1:0,e=u):(e=Math.floor(Math.log(c)/Math.LN2),c*(t=Math.pow(2,-e))<1&&(e--,t*=2),e+d>=1?c+=p/t:c+=p*Math.pow(2,1-d),c*t>=2&&(e++,t/=2),e+d>=u?(n=0,e=u):e+d>=1?(n=(c*t-1)*Math.pow(2,l),e=e+d):(n=c*Math.pow(2,d-1)*Math.pow(2,l),e=0));l>=8;o[i+g]=n&255,g+=f,n/=256,l-=8);for(e=e<<l|n,s+=l;s>0;o[i+g]=e&255,g+=f,e/=256,s-=8);o[i+g-f]|=b*128},Wt)}function yl(){if(Mn)return gt;Mn=!0;let o=Al(),c=bl(),i=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;gt.Buffer=e,gt.SlowBuffer=_,gt.INSPECT_MAX_BYTES=50;let a=2147483647;gt.kMaxLength=a,e.TYPED_ARRAY_SUPPORT=l(),!e.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function l(){try{let h=new Uint8Array(1),m={foo:function(){return 42}};return Object.setPrototypeOf(m,Uint8Array.prototype),Object.setPrototypeOf(h,m),h.foo()===42}catch{return!1}}Object.defineProperty(e.prototype,"parent",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.buffer}}),Object.defineProperty(e.prototype,"offset",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.byteOffset}});function r(h){if(h>a)throw new RangeError('The value "'+h+'" is invalid for option "size"');let m=new Uint8Array(h);return Object.setPrototypeOf(m,e.prototype),m}function e(h,m,v){if(typeof h=="number"){if(typeof m=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return u(h)}return n(h,m,v)}e.poolSize=8192;function n(h,m,v){if(typeof h=="string")return d(h,m);if(ArrayBuffer.isView(h))return g(h);if(h==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof h);if(L(h,ArrayBuffer)||h&&L(h.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(L(h,SharedArrayBuffer)||h&&L(h.buffer,SharedArrayBuffer)))return f(h,m,v);if(typeof h=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let R=h.valueOf&&h.valueOf();if(R!=null&&R!==h)return e.from(R,m,v);let N=b(h);if(N)return N;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof h[Symbol.toPrimitive]=="function")return e.from(h[Symbol.toPrimitive]("string"),m,v);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof h)}e.from=function(h,m,v){return n(h,m,v)},Object.setPrototypeOf(e.prototype,Uint8Array.prototype),Object.setPrototypeOf(e,Uint8Array);function t(h){if(typeof h!="number")throw new TypeError('"size" argument must be of type number');if(h<0)throw new RangeError('The value "'+h+'" is invalid for option "size"')}function s(h,m,v){return t(h),h<=0?r(h):m!==void 0?typeof v=="string"?r(h).fill(m,v):r(h).fill(m):r(h)}e.alloc=function(h,m,v){return s(h,m,v)};function u(h){return t(h),r(h<0?0:y(h)|0)}e.allocUnsafe=function(h){return u(h)},e.allocUnsafeSlow=function(h){return u(h)};function d(h,m){if((typeof m!="string"||m==="")&&(m="utf8"),!e.isEncoding(m))throw new TypeError("Unknown encoding: "+m);let v=A(h,m)|0,R=r(v),N=R.write(h,m);return N!==v&&(R=R.slice(0,N)),R}function p(h){let m=h.length<0?0:y(h.length)|0,v=r(m);for(let R=0;R<m;R+=1)v[R]=h[R]&255;return v}function g(h){if(L(h,Uint8Array)){let m=new Uint8Array(h);return f(m.buffer,m.byteOffset,m.byteLength)}return p(h)}function f(h,m,v){if(m<0||h.byteLength<m)throw new RangeError('"offset" is outside of buffer bounds');if(h.byteLength<m+(v||0))throw new RangeError('"length" is outside of buffer bounds');let R;return m===void 0&&v===void 0?R=new Uint8Array(h):v===void 0?R=new Uint8Array(h,m):R=new Uint8Array(h,m,v),Object.setPrototypeOf(R,e.prototype),R}function b(h){if(e.isBuffer(h)){let m=y(h.length)|0,v=r(m);return v.length===0||h.copy(v,0,0,m),v}if(h.length!==void 0)return typeof h.length!="number"||ne(h.length)?r(0):p(h);if(h.type==="Buffer"&&Array.isArray(h.data))return p(h.data)}function y(h){if(h>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return h|0}function _(h){return+h!=h&&(h=0),e.alloc(+h)}e.isBuffer=function(h){return h!=null&&h._isBuffer===!0&&h!==e.prototype},e.compare=function(h,m){if(L(h,Uint8Array)&&(h=e.from(h,h.offset,h.byteLength)),L(m,Uint8Array)&&(m=e.from(m,m.offset,m.byteLength)),!e.isBuffer(h)||!e.isBuffer(m))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(h===m)return 0;let v=h.length,R=m.length;for(let N=0,X=Math.min(v,R);N<X;++N)if(h[N]!==m[N]){v=h[N],R=m[N];break}return v<R?-1:R<v?1:0},e.isEncoding=function(h){switch(String(h).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},e.concat=function(h,m){if(!Array.isArray(h))throw new TypeError('"list" argument must be an Array of Buffers');if(h.length===0)return e.alloc(0);let v;if(m===void 0)for(m=0,v=0;v<h.length;++v)m+=h[v].length;let R=e.allocUnsafe(m),N=0;for(v=0;v<h.length;++v){let X=h[v];if(L(X,Uint8Array))N+X.length>R.length?(e.isBuffer(X)||(X=e.from(X)),X.copy(R,N)):Uint8Array.prototype.set.call(R,X,N);else if(e.isBuffer(X))X.copy(R,N);else throw new TypeError('"list" argument must be an Array of Buffers');N+=X.length}return R};function A(h,m){if(e.isBuffer(h))return h.length;if(ArrayBuffer.isView(h)||L(h,ArrayBuffer))return h.byteLength;if(typeof h!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof h);let v=h.length,R=arguments.length>2&&arguments[2]===!0;if(!R&&v===0)return 0;let N=!1;for(;;)switch(m){case"ascii":case"latin1":case"binary":return v;case"utf8":case"utf-8":return D(h).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v*2;case"hex":return v>>>1;case"base64":return ee(h).length;default:if(N)return R?-1:D(h).length;m=(""+m).toLowerCase(),N=!0}}e.byteLength=A;function w(h,m,v){let R=!1;if((m===void 0||m<0)&&(m=0),m>this.length||((v===void 0||v>this.length)&&(v=this.length),v<=0)||(v>>>=0,m>>>=0,v<=m))return"";for(h||(h="utf8");;)switch(h){case"hex":return pe(this,m,v);case"utf8":case"utf-8":return $(this,m,v);case"ascii":return me(this,m,v);case"latin1":case"binary":return le(this,m,v);case"base64":return U(this,m,v);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return we(this,m,v);default:if(R)throw new TypeError("Unknown encoding: "+h);h=(h+"").toLowerCase(),R=!0}}e.prototype._isBuffer=!0;function T(h,m,v){let R=h[m];h[m]=h[v],h[v]=R}e.prototype.swap16=function(){let h=this.length;if(h%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let m=0;m<h;m+=2)T(this,m,m+1);return this},e.prototype.swap32=function(){let h=this.length;if(h%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let m=0;m<h;m+=4)T(this,m,m+3),T(this,m+1,m+2);return this},e.prototype.swap64=function(){let h=this.length;if(h%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let m=0;m<h;m+=8)T(this,m,m+7),T(this,m+1,m+6),T(this,m+2,m+5),T(this,m+3,m+4);return this},e.prototype.toString=function(){let h=this.length;return h===0?"":arguments.length===0?$(this,0,h):w.apply(this,arguments)},e.prototype.toLocaleString=e.prototype.toString,e.prototype.equals=function(h){if(!e.isBuffer(h))throw new TypeError("Argument must be a Buffer");return this===h?!0:e.compare(this,h)===0},e.prototype.inspect=function(){let h="",m=gt.INSPECT_MAX_BYTES;return h=this.toString("hex",0,m).replace(/(.{2})/g,"$1 ").trim(),this.length>m&&(h+=" ... "),"<Buffer "+h+">"},i&&(e.prototype[i]=e.prototype.inspect),e.prototype.compare=function(h,m,v,R,N){if(L(h,Uint8Array)&&(h=e.from(h,h.offset,h.byteLength)),!e.isBuffer(h))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof h);if(m===void 0&&(m=0),v===void 0&&(v=h?h.length:0),R===void 0&&(R=0),N===void 0&&(N=this.length),m<0||v>h.length||R<0||N>this.length)throw new RangeError("out of range index");if(R>=N&&m>=v)return 0;if(R>=N)return-1;if(m>=v)return 1;if(m>>>=0,v>>>=0,R>>>=0,N>>>=0,this===h)return 0;let X=N-R,be=v-m,Ce=Math.min(X,be),je=this.slice(R,N),xe=h.slice(m,v);for(let Te=0;Te<Ce;++Te)if(je[Te]!==xe[Te]){X=je[Te],be=xe[Te];break}return X<be?-1:be<X?1:0};function k(h,m,v,R,N){if(h.length===0)return-1;if(typeof v=="string"?(R=v,v=0):v>2147483647?v=2147483647:v<-2147483648&&(v=-2147483648),v=+v,ne(v)&&(v=N?0:h.length-1),v<0&&(v=h.length+v),v>=h.length){if(N)return-1;v=h.length-1}else if(v<0)if(N)v=0;else return-1;if(typeof m=="string"&&(m=e.from(m,R)),e.isBuffer(m))return m.length===0?-1:E(h,m,v,R,N);if(typeof m=="number")return m=m&255,typeof Uint8Array.prototype.indexOf=="function"?N?Uint8Array.prototype.indexOf.call(h,m,v):Uint8Array.prototype.lastIndexOf.call(h,m,v):E(h,[m],v,R,N);throw new TypeError("val must be string, number or Buffer")}function E(h,m,v,R,N){let X=1,be=h.length,Ce=m.length;if(R!==void 0&&(R=String(R).toLowerCase(),R==="ucs2"||R==="ucs-2"||R==="utf16le"||R==="utf-16le")){if(h.length<2||m.length<2)return-1;X=2,be/=2,Ce/=2,v/=2}function je(Te,Ne){return X===1?Te[Ne]:Te.readUInt16BE(Ne*X)}let xe;if(N){let Te=-1;for(xe=v;xe<be;xe++)if(je(h,xe)===je(m,Te===-1?0:xe-Te)){if(Te===-1&&(Te=xe),xe-Te+1===Ce)return Te*X}else Te!==-1&&(xe-=xe-Te),Te=-1}else for(v+Ce>be&&(v=be-Ce),xe=v;xe>=0;xe--){let Te=!0;for(let Ne=0;Ne<Ce;Ne++)if(je(h,xe+Ne)!==je(m,Ne)){Te=!1;break}if(Te)return xe}return-1}e.prototype.includes=function(h,m,v){return this.indexOf(h,m,v)!==-1},e.prototype.indexOf=function(h,m,v){return k(this,h,m,v,!0)},e.prototype.lastIndexOf=function(h,m,v){return k(this,h,m,v,!1)};function I(h,m,v,R){v=Number(v)||0;let N=h.length-v;R?(R=Number(R),R>N&&(R=N)):R=N;let X=m.length;R>X/2&&(R=X/2);let be;for(be=0;be<R;++be){let Ce=parseInt(m.substr(be*2,2),16);if(ne(Ce))return be;h[v+be]=Ce}return be}function O(h,m,v,R){return ie(D(m,h.length-v),h,v,R)}function H(h,m,v,R){return ie(q(m),h,v,R)}function G(h,m,v,R){return ie(ee(m),h,v,R)}function de(h,m,v,R){return ie(te(m,h.length-v),h,v,R)}e.prototype.write=function(h,m,v,R){if(m===void 0)R="utf8",v=this.length,m=0;else if(v===void 0&&typeof m=="string")R=m,v=this.length,m=0;else if(isFinite(m))m=m>>>0,isFinite(v)?(v=v>>>0,R===void 0&&(R="utf8")):(R=v,v=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let N=this.length-m;if((v===void 0||v>N)&&(v=N),h.length>0&&(v<0||m<0)||m>this.length)throw new RangeError("Attempt to write outside buffer bounds");R||(R="utf8");let X=!1;for(;;)switch(R){case"hex":return I(this,h,m,v);case"utf8":case"utf-8":return O(this,h,m,v);case"ascii":case"latin1":case"binary":return H(this,h,m,v);case"base64":return G(this,h,m,v);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return de(this,h,m,v);default:if(X)throw new TypeError("Unknown encoding: "+R);R=(""+R).toLowerCase(),X=!0}},e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function U(h,m,v){return m===0&&v===h.length?o.fromByteArray(h):o.fromByteArray(h.slice(m,v))}function $(h,m,v){v=Math.min(h.length,v);let R=[],N=m;for(;N<v;){let X=h[N],be=null,Ce=X>239?4:X>223?3:X>191?2:1;if(N+Ce<=v){let je,xe,Te,Ne;switch(Ce){case 1:X<128&&(be=X);break;case 2:je=h[N+1],(je&192)===128&&(Ne=(X&31)<<6|je&63,Ne>127&&(be=Ne));break;case 3:je=h[N+1],xe=h[N+2],(je&192)===128&&(xe&192)===128&&(Ne=(X&15)<<12|(je&63)<<6|xe&63,Ne>2047&&(Ne<55296||Ne>57343)&&(be=Ne));break;case 4:je=h[N+1],xe=h[N+2],Te=h[N+3],(je&192)===128&&(xe&192)===128&&(Te&192)===128&&(Ne=(X&15)<<18|(je&63)<<12|(xe&63)<<6|Te&63,Ne>65535&&Ne<1114112&&(be=Ne))}}be===null?(be=65533,Ce=1):be>65535&&(be-=65536,R.push(be>>>10&1023|55296),be=56320|be&1023),R.push(be),N+=Ce}return F(R)}let z=4096;function F(h){let m=h.length;if(m<=z)return String.fromCharCode.apply(String,h);let v="",R=0;for(;R<m;)v+=String.fromCharCode.apply(String,h.slice(R,R+=z));return v}function me(h,m,v){let R="";v=Math.min(h.length,v);for(let N=m;N<v;++N)R+=String.fromCharCode(h[N]&127);return R}function le(h,m,v){let R="";v=Math.min(h.length,v);for(let N=m;N<v;++N)R+=String.fromCharCode(h[N]);return R}function pe(h,m,v){let R=h.length;(!m||m<0)&&(m=0),(!v||v<0||v>R)&&(v=R);let N="";for(let X=m;X<v;++X)N+=ge[h[X]];return N}function we(h,m,v){let R=h.slice(m,v),N="";for(let X=0;X<R.length-1;X+=2)N+=String.fromCharCode(R[X]+R[X+1]*256);return N}e.prototype.slice=function(h,m){let v=this.length;h=~~h,m=m===void 0?v:~~m,h<0?(h+=v,h<0&&(h=0)):h>v&&(h=v),m<0?(m+=v,m<0&&(m=0)):m>v&&(m=v),m<h&&(m=h);let R=this.subarray(h,m);return Object.setPrototypeOf(R,e.prototype),R};function Q(h,m,v){if(h%1!==0||h<0)throw new RangeError("offset is not uint");if(h+m>v)throw new RangeError("Trying to access beyond buffer length")}e.prototype.readUintLE=e.prototype.readUIntLE=function(h,m,v){h=h>>>0,m=m>>>0,v||Q(h,m,this.length);let R=this[h],N=1,X=0;for(;++X<m&&(N*=256);)R+=this[h+X]*N;return R},e.prototype.readUintBE=e.prototype.readUIntBE=function(h,m,v){h=h>>>0,m=m>>>0,v||Q(h,m,this.length);let R=this[h+--m],N=1;for(;m>0&&(N*=256);)R+=this[h+--m]*N;return R},e.prototype.readUint8=e.prototype.readUInt8=function(h,m){return h=h>>>0,m||Q(h,1,this.length),this[h]},e.prototype.readUint16LE=e.prototype.readUInt16LE=function(h,m){return h=h>>>0,m||Q(h,2,this.length),this[h]|this[h+1]<<8},e.prototype.readUint16BE=e.prototype.readUInt16BE=function(h,m){return h=h>>>0,m||Q(h,2,this.length),this[h]<<8|this[h+1]},e.prototype.readUint32LE=e.prototype.readUInt32LE=function(h,m){return h=h>>>0,m||Q(h,4,this.length),(this[h]|this[h+1]<<8|this[h+2]<<16)+this[h+3]*16777216},e.prototype.readUint32BE=e.prototype.readUInt32BE=function(h,m){return h=h>>>0,m||Q(h,4,this.length),this[h]*16777216+(this[h+1]<<16|this[h+2]<<8|this[h+3])},e.prototype.readBigUInt64LE=Y(function(h){h=h>>>0,W(h,"offset");let m=this[h],v=this[h+7];(m===void 0||v===void 0)&&ue(h,this.length-8);let R=m+this[++h]*2**8+this[++h]*2**16+this[++h]*2**24,N=this[++h]+this[++h]*2**8+this[++h]*2**16+v*2**24;return BigInt(R)+(BigInt(N)<<BigInt(32))}),e.prototype.readBigUInt64BE=Y(function(h){h=h>>>0,W(h,"offset");let m=this[h],v=this[h+7];(m===void 0||v===void 0)&&ue(h,this.length-8);let R=m*2**24+this[++h]*2**16+this[++h]*2**8+this[++h],N=this[++h]*2**24+this[++h]*2**16+this[++h]*2**8+v;return(BigInt(R)<<BigInt(32))+BigInt(N)}),e.prototype.readIntLE=function(h,m,v){h=h>>>0,m=m>>>0,v||Q(h,m,this.length);let R=this[h],N=1,X=0;for(;++X<m&&(N*=256);)R+=this[h+X]*N;return N*=128,R>=N&&(R-=Math.pow(2,8*m)),R},e.prototype.readIntBE=function(h,m,v){h=h>>>0,m=m>>>0,v||Q(h,m,this.length);let R=m,N=1,X=this[h+--R];for(;R>0&&(N*=256);)X+=this[h+--R]*N;return N*=128,X>=N&&(X-=Math.pow(2,8*m)),X},e.prototype.readInt8=function(h,m){return h=h>>>0,m||Q(h,1,this.length),this[h]&128?(255-this[h]+1)*-1:this[h]},e.prototype.readInt16LE=function(h,m){h=h>>>0,m||Q(h,2,this.length);let v=this[h]|this[h+1]<<8;return v&32768?v|4294901760:v},e.prototype.readInt16BE=function(h,m){h=h>>>0,m||Q(h,2,this.length);let v=this[h+1]|this[h]<<8;return v&32768?v|4294901760:v},e.prototype.readInt32LE=function(h,m){return h=h>>>0,m||Q(h,4,this.length),this[h]|this[h+1]<<8|this[h+2]<<16|this[h+3]<<24},e.prototype.readInt32BE=function(h,m){return h=h>>>0,m||Q(h,4,this.length),this[h]<<24|this[h+1]<<16|this[h+2]<<8|this[h+3]},e.prototype.readBigInt64LE=Y(function(h){h=h>>>0,W(h,"offset");let m=this[h],v=this[h+7];(m===void 0||v===void 0)&&ue(h,this.length-8);let R=this[h+4]+this[h+5]*2**8+this[h+6]*2**16+(v<<24);return(BigInt(R)<<BigInt(32))+BigInt(m+this[++h]*2**8+this[++h]*2**16+this[++h]*2**24)}),e.prototype.readBigInt64BE=Y(function(h){h=h>>>0,W(h,"offset");let m=this[h],v=this[h+7];(m===void 0||v===void 0)&&ue(h,this.length-8);let R=(m<<24)+this[++h]*2**16+this[++h]*2**8+this[++h];return(BigInt(R)<<BigInt(32))+BigInt(this[++h]*2**24+this[++h]*2**16+this[++h]*2**8+v)}),e.prototype.readFloatLE=function(h,m){return h=h>>>0,m||Q(h,4,this.length),c.read(this,h,!0,23,4)},e.prototype.readFloatBE=function(h,m){return h=h>>>0,m||Q(h,4,this.length),c.read(this,h,!1,23,4)},e.prototype.readDoubleLE=function(h,m){return h=h>>>0,m||Q(h,8,this.length),c.read(this,h,!0,52,8)},e.prototype.readDoubleBE=function(h,m){return h=h>>>0,m||Q(h,8,this.length),c.read(this,h,!1,52,8)};function he(h,m,v,R,N,X){if(!e.isBuffer(h))throw new TypeError('"buffer" argument must be a Buffer instance');if(m>N||m<X)throw new RangeError('"value" argument is out of bounds');if(v+R>h.length)throw new RangeError("Index out of range")}e.prototype.writeUintLE=e.prototype.writeUIntLE=function(h,m,v,R){if(h=+h,m=m>>>0,v=v>>>0,!R){let be=Math.pow(2,8*v)-1;he(this,h,m,v,be,0)}let N=1,X=0;for(this[m]=h&255;++X<v&&(N*=256);)this[m+X]=h/N&255;return m+v},e.prototype.writeUintBE=e.prototype.writeUIntBE=function(h,m,v,R){if(h=+h,m=m>>>0,v=v>>>0,!R){let be=Math.pow(2,8*v)-1;he(this,h,m,v,be,0)}let N=v-1,X=1;for(this[m+N]=h&255;--N>=0&&(X*=256);)this[m+N]=h/X&255;return m+v},e.prototype.writeUint8=e.prototype.writeUInt8=function(h,m,v){return h=+h,m=m>>>0,v||he(this,h,m,1,255,0),this[m]=h&255,m+1},e.prototype.writeUint16LE=e.prototype.writeUInt16LE=function(h,m,v){return h=+h,m=m>>>0,v||he(this,h,m,2,65535,0),this[m]=h&255,this[m+1]=h>>>8,m+2},e.prototype.writeUint16BE=e.prototype.writeUInt16BE=function(h,m,v){return h=+h,m=m>>>0,v||he(this,h,m,2,65535,0),this[m]=h>>>8,this[m+1]=h&255,m+2},e.prototype.writeUint32LE=e.prototype.writeUInt32LE=function(h,m,v){return h=+h,m=m>>>0,v||he(this,h,m,4,4294967295,0),this[m+3]=h>>>24,this[m+2]=h>>>16,this[m+1]=h>>>8,this[m]=h&255,m+4},e.prototype.writeUint32BE=e.prototype.writeUInt32BE=function(h,m,v){return h=+h,m=m>>>0,v||he(this,h,m,4,4294967295,0),this[m]=h>>>24,this[m+1]=h>>>16,this[m+2]=h>>>8,this[m+3]=h&255,m+4};function x(h,m,v,R,N){j(m,R,N,h,v,7);let X=Number(m&BigInt(4294967295));h[v++]=X,X=X>>8,h[v++]=X,X=X>>8,h[v++]=X,X=X>>8,h[v++]=X;let be=Number(m>>BigInt(32)&BigInt(4294967295));return h[v++]=be,be=be>>8,h[v++]=be,be=be>>8,h[v++]=be,be=be>>8,h[v++]=be,v}function ce(h,m,v,R,N){j(m,R,N,h,v,7);let X=Number(m&BigInt(4294967295));h[v+7]=X,X=X>>8,h[v+6]=X,X=X>>8,h[v+5]=X,X=X>>8,h[v+4]=X;let be=Number(m>>BigInt(32)&BigInt(4294967295));return h[v+3]=be,be=be>>8,h[v+2]=be,be=be>>8,h[v+1]=be,be=be>>8,h[v]=be,v+8}e.prototype.writeBigUInt64LE=Y(function(h,m=0){return x(this,h,m,BigInt(0),BigInt("0xffffffffffffffff"))}),e.prototype.writeBigUInt64BE=Y(function(h,m=0){return ce(this,h,m,BigInt(0),BigInt("0xffffffffffffffff"))}),e.prototype.writeIntLE=function(h,m,v,R){if(h=+h,m=m>>>0,!R){let Ce=Math.pow(2,8*v-1);he(this,h,m,v,Ce-1,-Ce)}let N=0,X=1,be=0;for(this[m]=h&255;++N<v&&(X*=256);)h<0&&be===0&&this[m+N-1]!==0&&(be=1),this[m+N]=(h/X>>0)-be&255;return m+v},e.prototype.writeIntBE=function(h,m,v,R){if(h=+h,m=m>>>0,!R){let Ce=Math.pow(2,8*v-1);he(this,h,m,v,Ce-1,-Ce)}let N=v-1,X=1,be=0;for(this[m+N]=h&255;--N>=0&&(X*=256);)h<0&&be===0&&this[m+N+1]!==0&&(be=1),this[m+N]=(h/X>>0)-be&255;return m+v},e.prototype.writeInt8=function(h,m,v){return h=+h,m=m>>>0,v||he(this,h,m,1,127,-128),h<0&&(h=255+h+1),this[m]=h&255,m+1},e.prototype.writeInt16LE=function(h,m,v){return h=+h,m=m>>>0,v||he(this,h,m,2,32767,-32768),this[m]=h&255,this[m+1]=h>>>8,m+2},e.prototype.writeInt16BE=function(h,m,v){return h=+h,m=m>>>0,v||he(this,h,m,2,32767,-32768),this[m]=h>>>8,this[m+1]=h&255,m+2},e.prototype.writeInt32LE=function(h,m,v){return h=+h,m=m>>>0,v||he(this,h,m,4,2147483647,-2147483648),this[m]=h&255,this[m+1]=h>>>8,this[m+2]=h>>>16,this[m+3]=h>>>24,m+4},e.prototype.writeInt32BE=function(h,m,v){return h=+h,m=m>>>0,v||he(this,h,m,4,2147483647,-2147483648),h<0&&(h=4294967295+h+1),this[m]=h>>>24,this[m+1]=h>>>16,this[m+2]=h>>>8,this[m+3]=h&255,m+4},e.prototype.writeBigInt64LE=Y(function(h,m=0){return x(this,h,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),e.prototype.writeBigInt64BE=Y(function(h,m=0){return ce(this,h,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ye(h,m,v,R,N,X){if(v+R>h.length)throw new RangeError("Index out of range");if(v<0)throw new RangeError("Index out of range")}function J(h,m,v,R,N){return m=+m,v=v>>>0,N||ye(h,m,v,4),c.write(h,m,v,R,23,4),v+4}e.prototype.writeFloatLE=function(h,m,v){return J(this,h,m,!0,v)},e.prototype.writeFloatBE=function(h,m,v){return J(this,h,m,!1,v)};function _e(h,m,v,R,N){return m=+m,v=v>>>0,N||ye(h,m,v,8),c.write(h,m,v,R,52,8),v+8}e.prototype.writeDoubleLE=function(h,m,v){return _e(this,h,m,!0,v)},e.prototype.writeDoubleBE=function(h,m,v){return _e(this,h,m,!1,v)},e.prototype.copy=function(h,m,v,R){if(!e.isBuffer(h))throw new TypeError("argument should be a Buffer");if(v||(v=0),!R&&R!==0&&(R=this.length),m>=h.length&&(m=h.length),m||(m=0),R>0&&R<v&&(R=v),R===v||h.length===0||this.length===0)return 0;if(m<0)throw new RangeError("targetStart out of bounds");if(v<0||v>=this.length)throw new RangeError("Index out of range");if(R<0)throw new RangeError("sourceEnd out of bounds");R>this.length&&(R=this.length),h.length-m<R-v&&(R=h.length-m+v);let N=R-v;return this===h&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(m,v,R):Uint8Array.prototype.set.call(h,this.subarray(v,R),m),N},e.prototype.fill=function(h,m,v,R){if(typeof h=="string"){if(typeof m=="string"?(R=m,m=0,v=this.length):typeof v=="string"&&(R=v,v=this.length),R!==void 0&&typeof R!="string")throw new TypeError("encoding must be a string");if(typeof R=="string"&&!e.isEncoding(R))throw new TypeError("Unknown encoding: "+R);if(h.length===1){let X=h.charCodeAt(0);(R==="utf8"&&X<128||R==="latin1")&&(h=X)}}else typeof h=="number"?h=h&255:typeof h=="boolean"&&(h=Number(h));if(m<0||this.length<m||this.length<v)throw new RangeError("Out of range index");if(v<=m)return this;m=m>>>0,v=v===void 0?this.length:v>>>0,h||(h=0);let N;if(typeof h=="number")for(N=m;N<v;++N)this[N]=h;else{let X=e.isBuffer(h)?h:e.from(h,R),be=X.length;if(be===0)throw new TypeError('The value "'+h+'" is invalid for argument "value"');for(N=0;N<v-m;++N)this[N+m]=X[N%be]}return this};let K={};function M(h,m,v){K[h]=class extends v{constructor(){super(),Object.defineProperty(this,"message",{value:m.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${h}]`,this.stack,delete this.name}get code(){return h}set code(R){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:R,writable:!0})}toString(){return`${this.name} [${h}]: ${this.message}`}}}M("ERR_BUFFER_OUT_OF_BOUNDS",function(h){return h?`${h} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),M("ERR_INVALID_ARG_TYPE",function(h,m){return`The "${h}" argument must be of type number. Received type ${typeof m}`},TypeError),M("ERR_OUT_OF_RANGE",function(h,m,v){let R=`The value of "${h}" is out of range.`,N=v;return Number.isInteger(v)&&Math.abs(v)>2**32?N=Z(String(v)):typeof v=="bigint"&&(N=String(v),(v>BigInt(2)**BigInt(32)||v<-(BigInt(2)**BigInt(32)))&&(N=Z(N)),N+="n"),R+=` It must be ${m}. Received ${N}`,R},RangeError);function Z(h){let m="",v=h.length,R=h[0]==="-"?1:0;for(;v>=R+4;v-=3)m=`_${h.slice(v-3,v)}${m}`;return`${h.slice(0,v)}${m}`}function V(h,m,v){W(m,"offset"),(h[m]===void 0||h[m+v]===void 0)&&ue(m,h.length-(v+1))}function j(h,m,v,R,N,X){if(h>v||h<m){let be=typeof m=="bigint"?"n":"",Ce;throw m===0||m===BigInt(0)?Ce=`>= 0${be} and < 2${be} ** ${(X+1)*8}${be}`:Ce=`>= -(2${be} ** ${(X+1)*8-1}${be}) and < 2 ** ${(X+1)*8-1}${be}`,new K.ERR_OUT_OF_RANGE("value",Ce,h)}V(R,N,X)}function W(h,m){if(typeof h!="number")throw new K.ERR_INVALID_ARG_TYPE(m,"number",h)}function ue(h,m,v){throw Math.floor(h)!==h?(W(h,v),new K.ERR_OUT_OF_RANGE("offset","an integer",h)):m<0?new K.ERR_BUFFER_OUT_OF_BOUNDS:new K.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${m}`,h)}let re=/[^+/0-9A-Za-z-_]/g;function P(h){if(h=h.split("=")[0],h=h.trim().replace(re,""),h.length<2)return"";for(;h.length%4!==0;)h=h+"=";return h}function D(h,m){m=m||1/0;let v,R=h.length,N=null,X=[];for(let be=0;be<R;++be){if(v=h.charCodeAt(be),v>55295&&v<57344){if(!N){if(v>56319){(m-=3)>-1&&X.push(239,191,189);continue}else if(be+1===R){(m-=3)>-1&&X.push(239,191,189);continue}N=v;continue}if(v<56320){(m-=3)>-1&&X.push(239,191,189),N=v;continue}v=(N-55296<<10|v-56320)+65536}else N&&(m-=3)>-1&&X.push(239,191,189);if(N=null,v<128){if((m-=1)<0)break;X.push(v)}else if(v<2048){if((m-=2)<0)break;X.push(v>>6|192,v&63|128)}else if(v<65536){if((m-=3)<0)break;X.push(v>>12|224,v>>6&63|128,v&63|128)}else if(v<1114112){if((m-=4)<0)break;X.push(v>>18|240,v>>12&63|128,v>>6&63|128,v&63|128)}else throw new Error("Invalid code point")}return X}function q(h){let m=[];for(let v=0;v<h.length;++v)m.push(h.charCodeAt(v)&255);return m}function te(h,m){let v,R,N,X=[];for(let be=0;be<h.length&&!((m-=2)<0);++be)v=h.charCodeAt(be),R=v>>8,N=v%256,X.push(N),X.push(R);return X}function ee(h){return o.toByteArray(P(h))}function ie(h,m,v,R){let N;for(N=0;N<R&&!(N+v>=m.length||N>=h.length);++N)m[N+v]=h[N];return N}function L(h,m){return h instanceof m||h!=null&&h.constructor!=null&&h.constructor.name!=null&&h.constructor.name===m.name}function ne(h){return h!==h}let ge=function(){let h="0123456789abcdef",m=new Array(256);for(let v=0;v<16;++v){let R=v*16;for(let N=0;N<16;++N)m[R+N]=h[v]+h[N]}return m}();function Y(h){return typeof BigInt>"u"?Se:h}function Se(){throw new Error("BigInt not supported")}return gt}var Mt,xn,Wt,Rn,gt,Mn,ot,Xt,Ji,Zi,Ve=He(()=>{oe(),ae(),se(),Mt={},xn=!1,Wt={},Rn=!1,gt={},Mn=!1,ot=yl(),ot.Buffer,ot.SlowBuffer,ot.INSPECT_MAX_BYTES,ot.kMaxLength,Xt=ot.Buffer,Ji=ot.INSPECT_MAX_BYTES,Zi=ot.kMaxLength}),ae=He(()=>{Ve()}),wl=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"__esModule",{value:!0});var c=class{constructor(i){this.aliasToTopic={},this.max=i}put(i,a){return a===0||a>this.max?!1:(this.aliasToTopic[a]=i,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(i){return this.aliasToTopic[i]}clear(){this.aliasToTopic={}}};o.default=c}),Ue=fe((o,c)=>{oe(),ae(),se();var i=class extends Error{constructor(a){if(!Array.isArray(a))throw new TypeError(`Expected input to be an Array, got ${typeof a}`);let l="";for(let r=0;r<a.length;r++)l+=` ${a[r].stack}
3
+ `;super(l),this.name="AggregateError",this.errors=a}};c.exports={AggregateError:i,ArrayIsArray(a){return Array.isArray(a)},ArrayPrototypeIncludes(a,l){return a.includes(l)},ArrayPrototypeIndexOf(a,l){return a.indexOf(l)},ArrayPrototypeJoin(a,l){return a.join(l)},ArrayPrototypeMap(a,l){return a.map(l)},ArrayPrototypePop(a,l){return a.pop(l)},ArrayPrototypePush(a,l){return a.push(l)},ArrayPrototypeSlice(a,l,r){return a.slice(l,r)},Error,FunctionPrototypeCall(a,l,...r){return a.call(l,...r)},FunctionPrototypeSymbolHasInstance(a,l){return Function.prototype[Symbol.hasInstance].call(a,l)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(a,l){return Object.defineProperties(a,l)},ObjectDefineProperty(a,l,r){return Object.defineProperty(a,l,r)},ObjectGetOwnPropertyDescriptor(a,l){return Object.getOwnPropertyDescriptor(a,l)},ObjectKeys(a){return Object.keys(a)},ObjectSetPrototypeOf(a,l){return Object.setPrototypeOf(a,l)},Promise,PromisePrototypeCatch(a,l){return a.catch(l)},PromisePrototypeThen(a,l,r){return a.then(l,r)},PromiseReject(a){return Promise.reject(a)},PromiseResolve(a){return Promise.resolve(a)},ReflectApply:Reflect.apply,RegExpPrototypeTest(a,l){return a.test(l)},SafeSet:Set,String,StringPrototypeSlice(a,l,r){return a.slice(l,r)},StringPrototypeToLowerCase(a){return a.toLowerCase()},StringPrototypeToUpperCase(a){return a.toUpperCase()},StringPrototypeTrim(a){return a.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(a,l,r){return a.set(l,r)},Boolean,Uint8Array}}),Xi=fe((o,c)=>{oe(),ae(),se(),c.exports={format(i,...a){return i.replace(/%([sdifj])/g,function(...[l,r]){let e=a.shift();return r==="f"?e.toFixed(6):r==="j"?JSON.stringify(e):r==="s"&&typeof e=="object"?`${e.constructor!==Object?e.constructor.name:""} {}`.trim():e.toString()})},inspect(i){switch(typeof i){case"string":if(i.includes("'"))if(i.includes('"')){if(!i.includes("`")&&!i.includes("${"))return`\`${i}\``}else return`"${i}"`;return`'${i}'`;case"number":return isNaN(i)?"NaN":Object.is(i,-0)?String(i):i;case"bigint":return`${String(i)}n`;case"boolean":case"undefined":return String(i);case"object":return"{}"}}}}),qe=fe((o,c)=>{oe(),ae(),se();var{format:i,inspect:a}=Xi(),{AggregateError:l}=Ue(),r=globalThis.AggregateError||l,e=Symbol("kIsNodeError"),n=["string","function","number","object","Function","Object","boolean","bigint","symbol"],t=/^([A-Z][a-z0-9]*)+$/,s="__node_internal_",u={};function d(A,w){if(!A)throw new u.ERR_INTERNAL_ASSERTION(w)}function p(A){let w="",T=A.length,k=A[0]==="-"?1:0;for(;T>=k+4;T-=3)w=`_${A.slice(T-3,T)}${w}`;return`${A.slice(0,T)}${w}`}function g(A,w,T){if(typeof w=="function")return d(w.length<=T.length,`Code: ${A}; The provided arguments length (${T.length}) does not match the required ones (${w.length}).`),w(...T);let k=(w.match(/%[dfijoOs]/g)||[]).length;return d(k===T.length,`Code: ${A}; The provided arguments length (${T.length}) does not match the required ones (${k}).`),T.length===0?w:i(w,...T)}function f(A,w,T){T||(T=Error);class k extends T{constructor(...I){super(g(A,w,I))}toString(){return`${this.name} [${A}]: ${this.message}`}}Object.defineProperties(k.prototype,{name:{value:T.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${A}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),k.prototype.code=A,k.prototype[e]=!0,u[A]=k}function b(A){let w=s+A.name;return Object.defineProperty(A,"name",{value:w}),A}function y(A,w){if(A&&w&&A!==w){if(Array.isArray(w.errors))return w.errors.push(A),w;let T=new r([w,A],w.message);return T.code=w.code,T}return A||w}var _=class extends Error{constructor(A="The operation was aborted",w=void 0){if(w!==void 0&&typeof w!="object")throw new u.ERR_INVALID_ARG_TYPE("options","Object",w);super(A,w),this.code="ABORT_ERR",this.name="AbortError"}};f("ERR_ASSERTION","%s",Error),f("ERR_INVALID_ARG_TYPE",(A,w,T)=>{d(typeof A=="string","'name' must be a string"),Array.isArray(w)||(w=[w]);let k="The ";A.endsWith(" argument")?k+=`${A} `:k+=`"${A}" ${A.includes(".")?"property":"argument"} `,k+="must be ";let E=[],I=[],O=[];for(let G of w)d(typeof G=="string","All expected entries have to be of type string"),n.includes(G)?E.push(G.toLowerCase()):t.test(G)?I.push(G):(d(G!=="object",'The value "object" should be written as "Object"'),O.push(G));if(I.length>0){let G=E.indexOf("object");G!==-1&&(E.splice(E,G,1),I.push("Object"))}if(E.length>0){switch(E.length){case 1:k+=`of type ${E[0]}`;break;case 2:k+=`one of type ${E[0]} or ${E[1]}`;break;default:{let G=E.pop();k+=`one of type ${E.join(", ")}, or ${G}`}}(I.length>0||O.length>0)&&(k+=" or ")}if(I.length>0){switch(I.length){case 1:k+=`an instance of ${I[0]}`;break;case 2:k+=`an instance of ${I[0]} or ${I[1]}`;break;default:{let G=I.pop();k+=`an instance of ${I.join(", ")}, or ${G}`}}O.length>0&&(k+=" or ")}switch(O.length){case 0:break;case 1:O[0].toLowerCase()!==O[0]&&(k+="an "),k+=`${O[0]}`;break;case 2:k+=`one of ${O[0]} or ${O[1]}`;break;default:{let G=O.pop();k+=`one of ${O.join(", ")}, or ${G}`}}if(T==null)k+=`. Received ${T}`;else if(typeof T=="function"&&T.name)k+=`. Received function ${T.name}`;else if(typeof T=="object"){var H;if((H=T.constructor)!==null&&H!==void 0&&H.name)k+=`. Received an instance of ${T.constructor.name}`;else{let G=a(T,{depth:-1});k+=`. Received ${G}`}}else{let G=a(T,{colors:!1});G.length>25&&(G=`${G.slice(0,25)}...`),k+=`. Received type ${typeof T} (${G})`}return k},TypeError),f("ERR_INVALID_ARG_VALUE",(A,w,T="is invalid")=>{let k=a(w);return k.length>128&&(k=k.slice(0,128)+"..."),`The ${A.includes(".")?"property":"argument"} '${A}' ${T}. Received ${k}`},TypeError),f("ERR_INVALID_RETURN_VALUE",(A,w,T)=>{var k;let E=T!=null&&(k=T.constructor)!==null&&k!==void 0&&k.name?`instance of ${T.constructor.name}`:`type ${typeof T}`;return`Expected ${A} to be returned from the "${w}" function but got ${E}.`},TypeError),f("ERR_MISSING_ARGS",(...A)=>{d(A.length>0,"At least one arg needs to be specified");let w,T=A.length;switch(A=(Array.isArray(A)?A:[A]).map(k=>`"${k}"`).join(" or "),T){case 1:w+=`The ${A[0]} argument`;break;case 2:w+=`The ${A[0]} and ${A[1]} arguments`;break;default:{let k=A.pop();w+=`The ${A.join(", ")}, and ${k} arguments`}break}return`${w} must be specified`},TypeError),f("ERR_OUT_OF_RANGE",(A,w,T)=>{d(w,'Missing "range" argument');let k;if(Number.isInteger(T)&&Math.abs(T)>2**32)k=p(String(T));else if(typeof T=="bigint"){k=String(T);let E=BigInt(2)**BigInt(32);(T>E||T<-E)&&(k=p(k)),k+="n"}else k=a(T);return`The value of "${A}" is out of range. It must be ${w}. Received ${k}`},RangeError),f("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),f("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),f("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),f("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),f("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),f("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),f("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),f("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),f("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),f("ERR_STREAM_WRITE_AFTER_END","write after end",Error),f("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),c.exports={AbortError:_,aggregateTwoErrors:b(y),hideStackFrames:b,codes:u}}),Vt=fe((o,c)=>{oe(),ae(),se();var{AbortController:i,AbortSignal:a}=typeof self<"u"?self:typeof window<"u"?window:void 0;c.exports=i,c.exports.AbortSignal=a,c.exports.default=i});function Oe(){Oe.init.call(this)}function er(o){if(typeof o!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof o)}function eo(o){return o._maxListeners===void 0?Oe.defaultMaxListeners:o._maxListeners}function to(o,c,i,a){var l,r,e,n;if(er(i),(r=o._events)===void 0?(r=o._events=Object.create(null),o._eventsCount=0):(r.newListener!==void 0&&(o.emit("newListener",c,i.listener?i.listener:i),r=o._events),e=r[c]),e===void 0)e=r[c]=i,++o._eventsCount;else if(typeof e=="function"?e=r[c]=a?[i,e]:[e,i]:a?e.unshift(i):e.push(i),(l=eo(o))>0&&e.length>l&&!e.warned){e.warned=!0;var t=new Error("Possible EventEmitter memory leak detected. "+e.length+" "+String(c)+" listeners added. Use emitter.setMaxListeners() to increase limit");t.name="MaxListenersExceededWarning",t.emitter=o,t.type=c,t.count=e.length,n=t,console&&console.warn&&console.warn(n)}return o}function vl(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function ro(o,c,i){var a={fired:!1,wrapFn:void 0,target:o,type:c,listener:i},l=vl.bind(a);return l.listener=i,a.wrapFn=l,l}function no(o,c,i){var a=o._events;if(a===void 0)return[];var l=a[c];return l===void 0?[]:typeof l=="function"?i?[l.listener||l]:[l]:i?function(r){for(var e=new Array(r.length),n=0;n<e.length;++n)e[n]=r[n].listener||r[n];return e}(l):oo(l,l.length)}function io(o){var c=this._events;if(c!==void 0){var i=c[o];if(typeof i=="function")return 1;if(i!==void 0)return i.length}return 0}function oo(o,c){for(var i=new Array(c),a=0;a<c;++a)i[a]=o[a];return i}var so,ao,vt,Un,Dn,Ln,ze,lo=He(()=>{oe(),ae(),se(),vt=typeof Reflect=="object"?Reflect:null,Un=vt&&typeof vt.apply=="function"?vt.apply:function(o,c,i){return Function.prototype.apply.call(o,c,i)},ao=vt&&typeof vt.ownKeys=="function"?vt.ownKeys:Object.getOwnPropertySymbols?function(o){return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o))}:function(o){return Object.getOwnPropertyNames(o)},Dn=Number.isNaN||function(o){return o!=o},so=Oe,Oe.EventEmitter=Oe,Oe.prototype._events=void 0,Oe.prototype._eventsCount=0,Oe.prototype._maxListeners=void 0,Ln=10,Object.defineProperty(Oe,"defaultMaxListeners",{enumerable:!0,get:function(){return Ln},set:function(o){if(typeof o!="number"||o<0||Dn(o))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+o+".");Ln=o}}),Oe.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Oe.prototype.setMaxListeners=function(o){if(typeof o!="number"||o<0||Dn(o))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+o+".");return this._maxListeners=o,this},Oe.prototype.getMaxListeners=function(){return eo(this)},Oe.prototype.emit=function(o){for(var c=[],i=1;i<arguments.length;i++)c.push(arguments[i]);var a=o==="error",l=this._events;if(l!==void 0)a=a&&l.error===void 0;else if(!a)return!1;if(a){var r;if(c.length>0&&(r=c[0]),r instanceof Error)throw r;var e=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw e.context=r,e}var n=l[o];if(n===void 0)return!1;if(typeof n=="function")Un(n,this,c);else{var t=n.length,s=oo(n,t);for(i=0;i<t;++i)Un(s[i],this,c)}return!0},Oe.prototype.addListener=function(o,c){return to(this,o,c,!1)},Oe.prototype.on=Oe.prototype.addListener,Oe.prototype.prependListener=function(o,c){return to(this,o,c,!0)},Oe.prototype.once=function(o,c){return er(c),this.on(o,ro(this,o,c)),this},Oe.prototype.prependOnceListener=function(o,c){return er(c),this.prependListener(o,ro(this,o,c)),this},Oe.prototype.removeListener=function(o,c){var i,a,l,r,e;if(er(c),(a=this._events)===void 0)return this;if((i=a[o])===void 0)return this;if(i===c||i.listener===c)--this._eventsCount==0?this._events=Object.create(null):(delete a[o],a.removeListener&&this.emit("removeListener",o,i.listener||c));else if(typeof i!="function"){for(l=-1,r=i.length-1;r>=0;r--)if(i[r]===c||i[r].listener===c){e=i[r].listener,l=r;break}if(l<0)return this;l===0?i.shift():function(n,t){for(;t+1<n.length;t++)n[t]=n[t+1];n.pop()}(i,l),i.length===1&&(a[o]=i[0]),a.removeListener!==void 0&&this.emit("removeListener",o,e||c)}return this},Oe.prototype.off=Oe.prototype.removeListener,Oe.prototype.removeAllListeners=function(o){var c,i,a;if((i=this._events)===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[o]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete i[o]),this;if(arguments.length===0){var l,r=Object.keys(i);for(a=0;a<r.length;++a)(l=r[a])!=="removeListener"&&this.removeAllListeners(l);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(c=i[o])=="function")this.removeListener(o,c);else if(c!==void 0)for(a=c.length-1;a>=0;a--)this.removeListener(o,c[a]);return this},Oe.prototype.listeners=function(o){return no(this,o,!0)},Oe.prototype.rawListeners=function(o){return no(this,o,!1)},Oe.listenerCount=function(o,c){return typeof o.listenerCount=="function"?o.listenerCount(c):io.call(o,c)},Oe.prototype.listenerCount=io,Oe.prototype.eventNames=function(){return this._eventsCount>0?ao(this._events):[]},ze=so,ze.EventEmitter,ze.defaultMaxListeners,ze.init,ze.listenerCount,ze.EventEmitter,ze.defaultMaxListeners,ze.init,ze.listenerCount}),mt={};Rt(mt,{EventEmitter:()=>uo,default:()=>ze,defaultMaxListeners:()=>co,init:()=>ho,listenerCount:()=>fo,on:()=>po,once:()=>go});var uo,co,ho,fo,po,go,_t=He(()=>{oe(),ae(),se(),lo(),lo(),ze.once=function(o,c){return new Promise((i,a)=>{function l(...e){r!==void 0&&o.removeListener("error",r),i(e)}let r;c!=="error"&&(r=e=>{o.removeListener(name,l),a(e)},o.once("error",r)),o.once(c,l)})},ze.on=function(o,c){let i=[],a=[],l=null,r=!1,e={async next(){let s=i.shift();if(s)return createIterResult(s,!1);if(l){let u=Promise.reject(l);return l=null,u}return r?createIterResult(void 0,!0):new Promise((u,d)=>a.push({resolve:u,reject:d}))},async return(){o.removeListener(c,n),o.removeListener("error",t),r=!0;for(let s of a)s.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(s){l=s,o.removeListener(c,n),o.removeListener("error",t)},[Symbol.asyncIterator](){return this}};return o.on(c,n),o.on("error",t),e;function n(...s){let u=a.shift();u?u.resolve(createIterResult(s,!1)):i.push(s)}function t(s){r=!0;let u=a.shift();u?u.reject(s):l=s,e.return()}},{EventEmitter:uo,defaultMaxListeners:co,init:ho,listenerCount:fo,on:po,once:go}=ze}),$e=fe((o,c)=>{oe(),ae(),se();var i=(Ve(),Be(We)),{format:a,inspect:l}=Xi(),{codes:{ERR_INVALID_ARG_TYPE:r}}=qe(),{kResistStopPropagation:e,AggregateError:n,SymbolDispose:t}=Ue(),s=globalThis.AbortSignal||Vt().AbortSignal,u=globalThis.AbortController||Vt().AbortController,d=Object.getPrototypeOf(async function(){}).constructor,p=globalThis.Blob||i.Blob,g=typeof p<"u"?function(y){return y instanceof p}:function(y){return!1},f=(y,_)=>{if(y!==void 0&&(y===null||typeof y!="object"||!("aborted"in y)))throw new r(_,"AbortSignal",y)},b=(y,_)=>{if(typeof y!="function")throw new r(_,"Function",y)};c.exports={AggregateError:n,kEmptyObject:Object.freeze({}),once(y){let _=!1;return function(...A){_||(_=!0,y.apply(this,A))}},createDeferredPromise:function(){let y,_;return{promise:new Promise((A,w)=>{y=A,_=w}),resolve:y,reject:_}},promisify(y){return new Promise((_,A)=>{y((w,...T)=>w?A(w):_(...T))})},debuglog(){return function(){}},format:a,inspect:l,types:{isAsyncFunction(y){return y instanceof d},isArrayBufferView(y){return ArrayBuffer.isView(y)}},isBlob:g,deprecate(y,_){return y},addAbortListener:(_t(),Be(mt)).addAbortListener||function(y,_){if(y===void 0)throw new r("signal","AbortSignal",y);f(y,"signal"),b(_,"listener");let A;return y.aborted?queueMicrotask(()=>_()):(y.addEventListener("abort",_,{__proto__:null,once:!0,[e]:!0}),A=()=>{y.removeEventListener("abort",_)}),{__proto__:null,[t](){var w;(w=A)===null||w===void 0||w()}}},AbortSignalAny:s.any||function(y){if(y.length===1)return y[0];let _=new u,A=()=>_.abort();return y.forEach(w=>{f(w,"signals"),w.addEventListener("abort",A,{once:!0})}),_.signal.addEventListener("abort",()=>{y.forEach(w=>w.removeEventListener("abort",A))},{once:!0}),_.signal}},c.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),Qt=fe((o,c)=>{oe(),ae(),se();var{ArrayIsArray:i,ArrayPrototypeIncludes:a,ArrayPrototypeJoin:l,ArrayPrototypeMap:r,NumberIsInteger:e,NumberIsNaN:n,NumberMAX_SAFE_INTEGER:t,NumberMIN_SAFE_INTEGER:s,NumberParseInt:u,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:p,String:g,StringPrototypeToUpperCase:f,StringPrototypeTrim:b}=Ue(),{hideStackFrames:y,codes:{ERR_SOCKET_BAD_PORT:_,ERR_INVALID_ARG_TYPE:A,ERR_INVALID_ARG_VALUE:w,ERR_OUT_OF_RANGE:T,ERR_UNKNOWN_SIGNAL:k}}=qe(),{normalizeEncoding:E}=$e(),{isAsyncFunction:I,isArrayBufferView:O}=$e().types,H={};function G(L){return L===(L|0)}function de(L){return L===L>>>0}var U=/^[0-7]+$/,$="must be a 32-bit unsigned integer or an octal string";function z(L,ne,ge){if(typeof L>"u"&&(L=ge),typeof L=="string"){if(p(U,L)===null)throw new w(ne,L,$);L=u(L,8)}return le(L,ne),L}var F=y((L,ne,ge=s,Y=t)=>{if(typeof L!="number")throw new A(ne,"number",L);if(!e(L))throw new T(ne,"an integer",L);if(L<ge||L>Y)throw new T(ne,`>= ${ge} && <= ${Y}`,L)}),me=y((L,ne,ge=-2147483648,Y=2147483647)=>{if(typeof L!="number")throw new A(ne,"number",L);if(!e(L))throw new T(ne,"an integer",L);if(L<ge||L>Y)throw new T(ne,`>= ${ge} && <= ${Y}`,L)}),le=y((L,ne,ge=!1)=>{if(typeof L!="number")throw new A(ne,"number",L);if(!e(L))throw new T(ne,"an integer",L);let Y=ge?1:0,Se=4294967295;if(L<Y||L>Se)throw new T(ne,`>= ${Y} && <= ${Se}`,L)});function pe(L,ne){if(typeof L!="string")throw new A(ne,"string",L)}function we(L,ne,ge=void 0,Y){if(typeof L!="number")throw new A(ne,"number",L);if(ge!=null&&L<ge||Y!=null&&L>Y||(ge!=null||Y!=null)&&n(L))throw new T(ne,`${ge!=null?`>= ${ge}`:""}${ge!=null&&Y!=null?" && ":""}${Y!=null?`<= ${Y}`:""}`,L)}var Q=y((L,ne,ge)=>{if(!a(ge,L)){let Y="must be one of: "+l(r(ge,Se=>typeof Se=="string"?`'${Se}'`:g(Se)),", ");throw new w(ne,L,Y)}});function he(L,ne){if(typeof L!="boolean")throw new A(ne,"boolean",L)}function x(L,ne,ge){return L==null||!d(L,ne)?ge:L[ne]}var ce=y((L,ne,ge=null)=>{let Y=x(ge,"allowArray",!1),Se=x(ge,"allowFunction",!1);if(!x(ge,"nullable",!1)&&L===null||!Y&&i(L)||typeof L!="object"&&(!Se||typeof L!="function"))throw new A(ne,"Object",L)}),ye=y((L,ne)=>{if(L!=null&&typeof L!="object"&&typeof L!="function")throw new A(ne,"a dictionary",L)}),J=y((L,ne,ge=0)=>{if(!i(L))throw new A(ne,"Array",L);if(L.length<ge){let Y=`must be longer than ${ge}`;throw new w(ne,L,Y)}});function _e(L,ne){J(L,ne);for(let ge=0;ge<L.length;ge++)pe(L[ge],`${ne}[${ge}]`)}function K(L,ne){J(L,ne);for(let ge=0;ge<L.length;ge++)he(L[ge],`${ne}[${ge}]`)}function M(L,ne){J(L,ne);for(let ge=0;ge<L.length;ge++){let Y=L[ge],Se=`${ne}[${ge}]`;if(Y==null)throw new A(Se,"AbortSignal",Y);ue(Y,Se)}}function Z(L,ne="signal"){if(pe(L,ne),H[L]===void 0)throw H[f(L)]!==void 0?new k(L+" (signals must use all capital letters)"):new k(L)}var V=y((L,ne="buffer")=>{if(!O(L))throw new A(ne,["Buffer","TypedArray","DataView"],L)});function j(L,ne){let ge=E(ne),Y=L.length;if(ge==="hex"&&Y%2!==0)throw new w("encoding",ne,`is invalid for data of length ${Y}`)}function W(L,ne="Port",ge=!0){if(typeof L!="number"&&typeof L!="string"||typeof L=="string"&&b(L).length===0||+L!==+L>>>0||L>65535||L===0&&!ge)throw new _(ne,L,ge);return L|0}var ue=y((L,ne)=>{if(L!==void 0&&(L===null||typeof L!="object"||!("aborted"in L)))throw new A(ne,"AbortSignal",L)}),re=y((L,ne)=>{if(typeof L!="function")throw new A(ne,"Function",L)}),P=y((L,ne)=>{if(typeof L!="function"||I(L))throw new A(ne,"Function",L)}),D=y((L,ne)=>{if(L!==void 0)throw new A(ne,"undefined",L)});function q(L,ne,ge){if(!a(ge,L))throw new A(ne,`('${l(ge,"|")}')`,L)}var te=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function ee(L,ne){if(typeof L>"u"||!p(te,L))throw new w(ne,L,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function ie(L){if(typeof L=="string")return ee(L,"hints"),L;if(i(L)){let ne=L.length,ge="";if(ne===0)return ge;for(let Y=0;Y<ne;Y++){let Se=L[Y];ee(Se,"hints"),ge+=Se,Y!==ne-1&&(ge+=", ")}return ge}throw new w("hints",L,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}c.exports={isInt32:G,isUint32:de,parseFileMode:z,validateArray:J,validateStringArray:_e,validateBooleanArray:K,validateAbortSignalArray:M,validateBoolean:he,validateBuffer:V,validateDictionary:ye,validateEncoding:j,validateFunction:re,validateInt32:me,validateInteger:F,validateNumber:we,validateObject:ce,validateOneOf:Q,validatePlainFunction:P,validatePort:W,validateSignalName:Z,validateString:pe,validateUint32:le,validateUndefined:D,validateUnion:q,validateAbortSignal:ue,validateLinkHeaderValue:ie}}),Et=fe((o,c)=>{oe(),ae(),se();var i=c.exports={},a,l;function r(){throw new Error("setTimeout has not been defined")}function e(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?a=setTimeout:a=r}catch{a=r}try{typeof clearTimeout=="function"?l=clearTimeout:l=e}catch{l=e}})();function n(_){if(a===setTimeout)return setTimeout(_,0);if((a===r||!a)&&setTimeout)return a=setTimeout,setTimeout(_,0);try{return a(_,0)}catch{try{return a.call(null,_,0)}catch{return a.call(this,_,0)}}}function t(_){if(l===clearTimeout)return clearTimeout(_);if((l===e||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(_);try{return l(_)}catch{try{return l.call(null,_)}catch{return l.call(this,_)}}}var s=[],u=!1,d,p=-1;function g(){!u||!d||(u=!1,d.length?s=d.concat(s):p=-1,s.length&&f())}function f(){if(!u){var _=n(g);u=!0;for(var A=s.length;A;){for(d=s,s=[];++p<A;)d&&d[p].run();p=-1,A=s.length}d=null,u=!1,t(_)}}i.nextTick=function(_){var A=new Array(arguments.length-1);if(arguments.length>1)for(var w=1;w<arguments.length;w++)A[w-1]=arguments[w];s.push(new b(_,A)),s.length===1&&!u&&n(f)};function b(_,A){this.fun=_,this.array=A}b.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={};function y(){}i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(_){return[]},i.binding=function(_){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(_){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}}),st=fe((o,c)=>{oe(),ae(),se();var{SymbolAsyncIterator:i,SymbolIterator:a,SymbolFor:l}=Ue(),r=l("nodejs.stream.destroyed"),e=l("nodejs.stream.errored"),n=l("nodejs.stream.readable"),t=l("nodejs.stream.writable"),s=l("nodejs.stream.disturbed"),u=l("nodejs.webstream.isClosedPromise"),d=l("nodejs.webstream.controllerErrorFunction");function p(x,ce=!1){var ye;return!!(x&&typeof x.pipe=="function"&&typeof x.on=="function"&&(!ce||typeof x.pause=="function"&&typeof x.resume=="function")&&(!x._writableState||((ye=x._readableState)===null||ye===void 0?void 0:ye.readable)!==!1)&&(!x._writableState||x._readableState))}function g(x){var ce;return!!(x&&typeof x.write=="function"&&typeof x.on=="function"&&(!x._readableState||((ce=x._writableState)===null||ce===void 0?void 0:ce.writable)!==!1))}function f(x){return!!(x&&typeof x.pipe=="function"&&x._readableState&&typeof x.on=="function"&&typeof x.write=="function")}function b(x){return x&&(x._readableState||x._writableState||typeof x.write=="function"&&typeof x.on=="function"||typeof x.pipe=="function"&&typeof x.on=="function")}function y(x){return!!(x&&!b(x)&&typeof x.pipeThrough=="function"&&typeof x.getReader=="function"&&typeof x.cancel=="function")}function _(x){return!!(x&&!b(x)&&typeof x.getWriter=="function"&&typeof x.abort=="function")}function A(x){return!!(x&&!b(x)&&typeof x.readable=="object"&&typeof x.writable=="object")}function w(x){return y(x)||_(x)||A(x)}function T(x,ce){return x==null?!1:ce===!0?typeof x[i]=="function":ce===!1?typeof x[a]=="function":typeof x[i]=="function"||typeof x[a]=="function"}function k(x){if(!b(x))return null;let ce=x._writableState,ye=x._readableState,J=ce||ye;return!!(x.destroyed||x[r]||J!=null&&J.destroyed)}function E(x){if(!g(x))return null;if(x.writableEnded===!0)return!0;let ce=x._writableState;return ce!=null&&ce.errored?!1:typeof ce?.ended!="boolean"?null:ce.ended}function I(x,ce){if(!g(x))return null;if(x.writableFinished===!0)return!0;let ye=x._writableState;return ye!=null&&ye.errored?!1:typeof ye?.finished!="boolean"?null:!!(ye.finished||ce===!1&&ye.ended===!0&&ye.length===0)}function O(x){if(!p(x))return null;if(x.readableEnded===!0)return!0;let ce=x._readableState;return!ce||ce.errored?!1:typeof ce?.ended!="boolean"?null:ce.ended}function H(x,ce){if(!p(x))return null;let ye=x._readableState;return ye!=null&&ye.errored?!1:typeof ye?.endEmitted!="boolean"?null:!!(ye.endEmitted||ce===!1&&ye.ended===!0&&ye.length===0)}function G(x){return x&&x[n]!=null?x[n]:typeof x?.readable!="boolean"?null:k(x)?!1:p(x)&&x.readable&&!H(x)}function de(x){return x&&x[t]!=null?x[t]:typeof x?.writable!="boolean"?null:k(x)?!1:g(x)&&x.writable&&!E(x)}function U(x,ce){return b(x)?k(x)?!0:!(ce?.readable!==!1&&G(x)||ce?.writable!==!1&&de(x)):null}function $(x){var ce,ye;return b(x)?x.writableErrored?x.writableErrored:(ce=(ye=x._writableState)===null||ye===void 0?void 0:ye.errored)!==null&&ce!==void 0?ce:null:null}function z(x){var ce,ye;return b(x)?x.readableErrored?x.readableErrored:(ce=(ye=x._readableState)===null||ye===void 0?void 0:ye.errored)!==null&&ce!==void 0?ce:null:null}function F(x){if(!b(x))return null;if(typeof x.closed=="boolean")return x.closed;let ce=x._writableState,ye=x._readableState;return typeof ce?.closed=="boolean"||typeof ye?.closed=="boolean"?ce?.closed||ye?.closed:typeof x._closed=="boolean"&&me(x)?x._closed:null}function me(x){return typeof x._closed=="boolean"&&typeof x._defaultKeepAlive=="boolean"&&typeof x._removedConnection=="boolean"&&typeof x._removedContLen=="boolean"}function le(x){return typeof x._sent100=="boolean"&&me(x)}function pe(x){var ce;return typeof x._consuming=="boolean"&&typeof x._dumped=="boolean"&&((ce=x.req)===null||ce===void 0?void 0:ce.upgradeOrConnect)===void 0}function we(x){if(!b(x))return null;let ce=x._writableState,ye=x._readableState,J=ce||ye;return!J&&le(x)||!!(J&&J.autoDestroy&&J.emitClose&&J.closed===!1)}function Q(x){var ce;return!!(x&&((ce=x[s])!==null&&ce!==void 0?ce:x.readableDidRead||x.readableAborted))}function he(x){var ce,ye,J,_e,K,M,Z,V,j,W;return!!(x&&((ce=(ye=(J=(_e=(K=(M=x[e])!==null&&M!==void 0?M:x.readableErrored)!==null&&K!==void 0?K:x.writableErrored)!==null&&_e!==void 0?_e:(Z=x._readableState)===null||Z===void 0?void 0:Z.errorEmitted)!==null&&J!==void 0?J:(V=x._writableState)===null||V===void 0?void 0:V.errorEmitted)!==null&&ye!==void 0?ye:(j=x._readableState)===null||j===void 0?void 0:j.errored)!==null&&ce!==void 0?ce:!((W=x._writableState)===null||W===void 0)&&W.errored))}c.exports={isDestroyed:k,kIsDestroyed:r,isDisturbed:Q,kIsDisturbed:s,isErrored:he,kIsErrored:e,isReadable:G,kIsReadable:n,kIsClosedPromise:u,kControllerErrorFunction:d,kIsWritable:t,isClosed:F,isDuplexNodeStream:f,isFinished:U,isIterable:T,isReadableNodeStream:p,isReadableStream:y,isReadableEnded:O,isReadableFinished:H,isReadableErrored:z,isNodeStream:b,isWebStream:w,isWritable:de,isWritableNodeStream:g,isWritableStream:_,isWritableEnded:E,isWritableFinished:I,isWritableErrored:$,isServerRequest:pe,isServerResponse:le,willEmitClose:we,isTransformStream:A}}),At=fe((o,c)=>{oe(),ae(),se();var i=Et(),{AbortError:a,codes:l}=qe(),{ERR_INVALID_ARG_TYPE:r,ERR_STREAM_PREMATURE_CLOSE:e}=l,{kEmptyObject:n,once:t}=$e(),{validateAbortSignal:s,validateFunction:u,validateObject:d,validateBoolean:p}=Qt(),{Promise:g,PromisePrototypeThen:f,SymbolDispose:b}=Ue(),{isClosed:y,isReadable:_,isReadableNodeStream:A,isReadableStream:w,isReadableFinished:T,isReadableErrored:k,isWritable:E,isWritableNodeStream:I,isWritableStream:O,isWritableFinished:H,isWritableErrored:G,isNodeStream:de,willEmitClose:U,kIsClosedPromise:$}=st(),z;function F(Q){return Q.setHeader&&typeof Q.abort=="function"}var me=()=>{};function le(Q,he,x){var ce,ye;if(arguments.length===2?(x=he,he=n):he==null?he=n:d(he,"options"),u(x,"callback"),s(he.signal,"options.signal"),x=t(x),w(Q)||O(Q))return pe(Q,he,x);if(!de(Q))throw new r("stream",["ReadableStream","WritableStream","Stream"],Q);let J=(ce=he.readable)!==null&&ce!==void 0?ce:A(Q),_e=(ye=he.writable)!==null&&ye!==void 0?ye:I(Q),K=Q._writableState,M=Q._readableState,Z=()=>{Q.writable||W()},V=U(Q)&&A(Q)===J&&I(Q)===_e,j=H(Q,!1),W=()=>{j=!0,Q.destroyed&&(V=!1),!(V&&(!Q.readable||J))&&(!J||ue)&&x.call(Q)},ue=T(Q,!1),re=()=>{ue=!0,Q.destroyed&&(V=!1),!(V&&(!Q.writable||_e))&&(!_e||j)&&x.call(Q)},P=L=>{x.call(Q,L)},D=y(Q),q=()=>{D=!0;let L=G(Q)||k(Q);if(L&&typeof L!="boolean")return x.call(Q,L);if(J&&!ue&&A(Q,!0)&&!T(Q,!1))return x.call(Q,new e);if(_e&&!j&&!H(Q,!1))return x.call(Q,new e);x.call(Q)},te=()=>{D=!0;let L=G(Q)||k(Q);if(L&&typeof L!="boolean")return x.call(Q,L);x.call(Q)},ee=()=>{Q.req.on("finish",W)};F(Q)?(Q.on("complete",W),V||Q.on("abort",q),Q.req?ee():Q.on("request",ee)):_e&&!K&&(Q.on("end",Z),Q.on("close",Z)),!V&&typeof Q.aborted=="boolean"&&Q.on("aborted",q),Q.on("end",re),Q.on("finish",W),he.error!==!1&&Q.on("error",P),Q.on("close",q),D?i.nextTick(q):K!=null&&K.errorEmitted||M!=null&&M.errorEmitted?V||i.nextTick(te):(!J&&(!V||_(Q))&&(j||E(Q)===!1)||!_e&&(!V||E(Q))&&(ue||_(Q)===!1)||M&&Q.req&&Q.aborted)&&i.nextTick(te);let ie=()=>{x=me,Q.removeListener("aborted",q),Q.removeListener("complete",W),Q.removeListener("abort",q),Q.removeListener("request",ee),Q.req&&Q.req.removeListener("finish",W),Q.removeListener("end",Z),Q.removeListener("close",Z),Q.removeListener("finish",W),Q.removeListener("end",re),Q.removeListener("error",P),Q.removeListener("close",q)};if(he.signal&&!D){let L=()=>{let ne=x;ie(),ne.call(Q,new a(void 0,{cause:he.signal.reason}))};if(he.signal.aborted)i.nextTick(L);else{z=z||$e().addAbortListener;let ne=z(he.signal,L),ge=x;x=t((...Y)=>{ne[b](),ge.apply(Q,Y)})}}return ie}function pe(Q,he,x){let ce=!1,ye=me;if(he.signal)if(ye=()=>{ce=!0,x.call(Q,new a(void 0,{cause:he.signal.reason}))},he.signal.aborted)i.nextTick(ye);else{z=z||$e().addAbortListener;let _e=z(he.signal,ye),K=x;x=t((...M)=>{_e[b](),K.apply(Q,M)})}let J=(..._e)=>{ce||i.nextTick(()=>x.apply(Q,_e))};return f(Q[$].promise,J,J),me}function we(Q,he){var x;let ce=!1;return he===null&&(he=n),(x=he)!==null&&x!==void 0&&x.cleanup&&(p(he.cleanup,"cleanup"),ce=he.cleanup),new g((ye,J)=>{let _e=le(Q,he,K=>{ce&&_e(),K?J(K):ye()})})}c.exports=le,c.exports.finished=we}),Ut=fe((o,c)=>{oe(),ae(),se();var i=Et(),{aggregateTwoErrors:a,codes:{ERR_MULTIPLE_CALLBACK:l},AbortError:r}=qe(),{Symbol:e}=Ue(),{kIsDestroyed:n,isDestroyed:t,isFinished:s,isServerRequest:u}=st(),d=e("kDestroy"),p=e("kConstruct");function g(U,$,z){U&&(U.stack,$&&!$.errored&&($.errored=U),z&&!z.errored&&(z.errored=U))}function f(U,$){let z=this._readableState,F=this._writableState,me=F||z;return F!=null&&F.destroyed||z!=null&&z.destroyed?(typeof $=="function"&&$(),this):(g(U,F,z),F&&(F.destroyed=!0),z&&(z.destroyed=!0),me.constructed?b(this,U,$):this.once(d,function(le){b(this,a(le,U),$)}),this)}function b(U,$,z){let F=!1;function me(le){if(F)return;F=!0;let pe=U._readableState,we=U._writableState;g(le,we,pe),we&&(we.closed=!0),pe&&(pe.closed=!0),typeof z=="function"&&z(le),le?i.nextTick(y,U,le):i.nextTick(_,U)}try{U._destroy($||null,me)}catch(le){me(le)}}function y(U,$){A(U,$),_(U)}function _(U){let $=U._readableState,z=U._writableState;z&&(z.closeEmitted=!0),$&&($.closeEmitted=!0),(z!=null&&z.emitClose||$!=null&&$.emitClose)&&U.emit("close")}function A(U,$){let z=U._readableState,F=U._writableState;F!=null&&F.errorEmitted||z!=null&&z.errorEmitted||(F&&(F.errorEmitted=!0),z&&(z.errorEmitted=!0),U.emit("error",$))}function w(){let U=this._readableState,$=this._writableState;U&&(U.constructed=!0,U.closed=!1,U.closeEmitted=!1,U.destroyed=!1,U.errored=null,U.errorEmitted=!1,U.reading=!1,U.ended=U.readable===!1,U.endEmitted=U.readable===!1),$&&($.constructed=!0,$.destroyed=!1,$.closed=!1,$.closeEmitted=!1,$.errored=null,$.errorEmitted=!1,$.finalCalled=!1,$.prefinished=!1,$.ended=$.writable===!1,$.ending=$.writable===!1,$.finished=$.writable===!1)}function T(U,$,z){let F=U._readableState,me=U._writableState;if(me!=null&&me.destroyed||F!=null&&F.destroyed)return this;F!=null&&F.autoDestroy||me!=null&&me.autoDestroy?U.destroy($):$&&($.stack,me&&!me.errored&&(me.errored=$),F&&!F.errored&&(F.errored=$),z?i.nextTick(A,U,$):A(U,$))}function k(U,$){if(typeof U._construct!="function")return;let z=U._readableState,F=U._writableState;z&&(z.constructed=!1),F&&(F.constructed=!1),U.once(p,$),!(U.listenerCount(p)>1)&&i.nextTick(E,U)}function E(U){let $=!1;function z(F){if($){T(U,F??new l);return}$=!0;let me=U._readableState,le=U._writableState,pe=le||me;me&&(me.constructed=!0),le&&(le.constructed=!0),pe.destroyed?U.emit(d,F):F?T(U,F,!0):i.nextTick(I,U)}try{U._construct(F=>{i.nextTick(z,F)})}catch(F){i.nextTick(z,F)}}function I(U){U.emit(p)}function O(U){return U?.setHeader&&typeof U.abort=="function"}function H(U){U.emit("close")}function G(U,$){U.emit("error",$),i.nextTick(H,U)}function de(U,$){!U||t(U)||(!$&&!s(U)&&($=new r),u(U)?(U.socket=null,U.destroy($)):O(U)?U.abort():O(U.req)?U.req.abort():typeof U.destroy=="function"?U.destroy($):typeof U.close=="function"?U.close():$?i.nextTick(G,U,$):i.nextTick(H,U),U.destroyed||(U[n]=!0))}c.exports={construct:k,destroyer:de,destroy:f,undestroy:w,errorOrDestroy:T}}),Nn=fe((o,c)=>{oe(),ae(),se();var{ArrayIsArray:i,ObjectSetPrototypeOf:a}=Ue(),{EventEmitter:l}=(_t(),Be(mt));function r(n){l.call(this,n)}a(r.prototype,l.prototype),a(r,l),r.prototype.pipe=function(n,t){let s=this;function u(_){n.writable&&n.write(_)===!1&&s.pause&&s.pause()}s.on("data",u);function d(){s.readable&&s.resume&&s.resume()}n.on("drain",d),!n._isStdio&&(!t||t.end!==!1)&&(s.on("end",g),s.on("close",f));let p=!1;function g(){p||(p=!0,n.end())}function f(){p||(p=!0,typeof n.destroy=="function"&&n.destroy())}function b(_){y(),l.listenerCount(this,"error")===0&&this.emit("error",_)}e(s,"error",b),e(n,"error",b);function y(){s.removeListener("data",u),n.removeListener("drain",d),s.removeListener("end",g),s.removeListener("close",f),s.removeListener("error",b),n.removeListener("error",b),s.removeListener("end",y),s.removeListener("close",y),n.removeListener("close",y)}return s.on("end",y),s.on("close",y),n.on("close",y),n.emit("pipe",s),n};function e(n,t,s){if(typeof n.prependListener=="function")return n.prependListener(t,s);!n._events||!n._events[t]?n.on(t,s):i(n._events[t])?n._events[t].unshift(s):n._events[t]=[s,n._events[t]]}c.exports={Stream:r,prependListener:e}}),tr=fe((o,c)=>{oe(),ae(),se();var{SymbolDispose:i}=Ue(),{AbortError:a,codes:l}=qe(),{isNodeStream:r,isWebStream:e,kControllerErrorFunction:n}=st(),t=At(),{ERR_INVALID_ARG_TYPE:s}=l,u,d=(p,g)=>{if(typeof p!="object"||!("aborted"in p))throw new s(g,"AbortSignal",p)};c.exports.addAbortSignal=function(p,g){if(d(p,"signal"),!r(g)&&!e(g))throw new s("stream",["ReadableStream","WritableStream","Stream"],g);return c.exports.addAbortSignalNoValidate(p,g)},c.exports.addAbortSignalNoValidate=function(p,g){if(typeof p!="object"||!("aborted"in p))return g;let f=r(g)?()=>{g.destroy(new a(void 0,{cause:p.reason}))}:()=>{g[n](new a(void 0,{cause:p.reason}))};if(p.aborted)f();else{u=u||$e().addAbortListener;let b=u(p,f);t(g,b[i])}return g}}),_l=fe((o,c)=>{oe(),ae(),se();var{StringPrototypeSlice:i,SymbolIterator:a,TypedArrayPrototypeSet:l,Uint8Array:r}=Ue(),{Buffer:e}=(Ve(),Be(We)),{inspect:n}=$e();c.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){let s={data:t,next:null};this.length>0?this.tail.next=s:this.head=s,this.tail=s,++this.length}unshift(t){let s={data:t,next:this.head};this.length===0&&(this.tail=s),this.head=s,++this.length}shift(){if(this.length===0)return;let t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let s=this.head,u=""+s.data;for(;(s=s.next)!==null;)u+=t+s.data;return u}concat(t){if(this.length===0)return e.alloc(0);let s=e.allocUnsafe(t>>>0),u=this.head,d=0;for(;u;)l(s,u.data,d),d+=u.data.length,u=u.next;return s}consume(t,s){let u=this.head.data;if(t<u.length){let d=u.slice(0,t);return this.head.data=u.slice(t),d}return t===u.length?this.shift():s?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[a](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let s="",u=this.head,d=0;do{let p=u.data;if(t>p.length)s+=p,t-=p.length;else{t===p.length?(s+=p,++d,u.next?this.head=u.next:this.head=this.tail=null):(s+=i(p,0,t),this.head=u,u.data=i(p,t));break}++d}while((u=u.next)!==null);return this.length-=d,s}_getBuffer(t){let s=e.allocUnsafe(t),u=t,d=this.head,p=0;do{let g=d.data;if(t>g.length)l(s,g,u-t),t-=g.length;else{t===g.length?(l(s,g,u-t),++p,d.next?this.head=d.next:this.head=this.tail=null):(l(s,new r(g.buffer,g.byteOffset,t),u-t),this.head=d,d.data=g.slice(t));break}++p}while((d=d.next)!==null);return this.length-=p,s}[Symbol.for("nodejs.util.inspect.custom")](t,s){return n(this,{...s,depth:0,customInspect:!1})}}}),rr=fe((o,c)=>{oe(),ae(),se();var{MathFloor:i,NumberIsInteger:a}=Ue(),{validateInteger:l}=Qt(),{ERR_INVALID_ARG_VALUE:r}=qe().codes,e=16*1024,n=16;function t(p,g,f){return p.highWaterMark!=null?p.highWaterMark:g?p[f]:null}function s(p){return p?n:e}function u(p,g){l(g,"value",0),p?n=g:e=g}function d(p,g,f,b){let y=t(g,b,f);if(y!=null){if(!a(y)||y<0){let _=b?`options.${f}`:"options.highWaterMark";throw new r(_,y)}return i(y)}return s(p.objectMode)}c.exports={getHighWaterMark:d,getDefaultHighWaterMark:s,setDefaultHighWaterMark:u}}),El=fe((o,c)=>{oe(),ae(),se();var i=(Ve(),Be(We)),a=i.Buffer;function l(e,n){for(var t in e)n[t]=e[t]}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?c.exports=i:(l(i,o),o.Buffer=r);function r(e,n,t){return a(e,n,t)}r.prototype=Object.create(a.prototype),l(a,r),r.from=function(e,n,t){if(typeof e=="number")throw new TypeError("Argument must not be a number");return a(e,n,t)},r.alloc=function(e,n,t){if(typeof e!="number")throw new TypeError("Argument must be a number");var s=a(e);return n!==void 0?typeof t=="string"?s.fill(n,t):s.fill(n):s.fill(0),s},r.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return a(e)},r.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}}),Sl=fe(o=>{oe(),ae(),se();var c=El().Buffer,i=c.isEncoding||function(A){switch(A=""+A,A&&A.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(A){if(!A)return"utf8";for(var w;;)switch(A){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return A;default:if(w)return;A=(""+A).toLowerCase(),w=!0}}function l(A){var w=a(A);if(typeof w!="string"&&(c.isEncoding===i||!i(A)))throw new Error("Unknown encoding: "+A);return w||A}o.StringDecoder=r;function r(A){this.encoding=l(A);var w;switch(this.encoding){case"utf16le":this.text=p,this.end=g,w=4;break;case"utf8":this.fillLast=s,w=4;break;case"base64":this.text=f,this.end=b,w=3;break;default:this.write=y,this.end=_;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=c.allocUnsafe(w)}r.prototype.write=function(A){if(A.length===0)return"";var w,T;if(this.lastNeed){if(w=this.fillLast(A),w===void 0)return"";T=this.lastNeed,this.lastNeed=0}else T=0;return T<A.length?w?w+this.text(A,T):this.text(A,T):w||""},r.prototype.end=d,r.prototype.text=u,r.prototype.fillLast=function(A){if(this.lastNeed<=A.length)return A.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);A.copy(this.lastChar,this.lastTotal-this.lastNeed,0,A.length),this.lastNeed-=A.length};function e(A){return A<=127?0:A>>5===6?2:A>>4===14?3:A>>3===30?4:A>>6===2?-1:-2}function n(A,w,T){var k=w.length-1;if(k<T)return 0;var E=e(w[k]);return E>=0?(E>0&&(A.lastNeed=E-1),E):--k<T||E===-2?0:(E=e(w[k]),E>=0?(E>0&&(A.lastNeed=E-2),E):--k<T||E===-2?0:(E=e(w[k]),E>=0?(E>0&&(E===2?E=0:A.lastNeed=E-3),E):0))}function t(A,w,T){if((w[0]&192)!==128)return A.lastNeed=0,"�";if(A.lastNeed>1&&w.length>1){if((w[1]&192)!==128)return A.lastNeed=1,"�";if(A.lastNeed>2&&w.length>2&&(w[2]&192)!==128)return A.lastNeed=2,"�"}}function s(A){var w=this.lastTotal-this.lastNeed,T=t(this,A);if(T!==void 0)return T;if(this.lastNeed<=A.length)return A.copy(this.lastChar,w,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);A.copy(this.lastChar,w,0,A.length),this.lastNeed-=A.length}function u(A,w){var T=n(this,A,w);if(!this.lastNeed)return A.toString("utf8",w);this.lastTotal=T;var k=A.length-(T-this.lastNeed);return A.copy(this.lastChar,0,k),A.toString("utf8",w,k)}function d(A){var w=A&&A.length?this.write(A):"";return this.lastNeed?w+"�":w}function p(A,w){if((A.length-w)%2===0){var T=A.toString("utf16le",w);if(T){var k=T.charCodeAt(T.length-1);if(k>=55296&&k<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=A[A.length-2],this.lastChar[1]=A[A.length-1],T.slice(0,-1)}return T}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=A[A.length-1],A.toString("utf16le",w,A.length-1)}function g(A){var w=A&&A.length?this.write(A):"";if(this.lastNeed){var T=this.lastTotal-this.lastNeed;return w+this.lastChar.toString("utf16le",0,T)}return w}function f(A,w){var T=(A.length-w)%3;return T===0?A.toString("base64",w):(this.lastNeed=3-T,this.lastTotal=3,T===1?this.lastChar[0]=A[A.length-1]:(this.lastChar[0]=A[A.length-2],this.lastChar[1]=A[A.length-1]),A.toString("base64",w,A.length-T))}function b(A){var w=A&&A.length?this.write(A):"";return this.lastNeed?w+this.lastChar.toString("base64",0,3-this.lastNeed):w}function y(A){return A.toString(this.encoding)}function _(A){return A&&A.length?this.write(A):""}}),mo=fe((o,c)=>{oe(),ae(),se();var i=Et(),{PromisePrototypeThen:a,SymbolAsyncIterator:l,SymbolIterator:r}=Ue(),{Buffer:e}=(Ve(),Be(We)),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_NULL_VALUES:t}=qe().codes;function s(u,d,p){let g;if(typeof d=="string"||d instanceof e)return new u({objectMode:!0,...p,read(){this.push(d),this.push(null)}});let f;if(d&&d[l])f=!0,g=d[l]();else if(d&&d[r])f=!1,g=d[r]();else throw new n("iterable",["Iterable"],d);let b=new u({objectMode:!0,highWaterMark:1,...p}),y=!1;b._read=function(){y||(y=!0,A())},b._destroy=function(w,T){a(_(w),()=>i.nextTick(T,w),k=>i.nextTick(T,k||w))};async function _(w){let T=w!=null,k=typeof g.throw=="function";if(T&&k){let{value:E,done:I}=await g.throw(w);if(await E,I)return}if(typeof g.return=="function"){let{value:E}=await g.return();await E}}async function A(){for(;;){try{let{value:w,done:T}=f?await g.next():g.next();if(T)b.push(null);else{let k=w&&typeof w.then=="function"?await w:w;if(k===null)throw y=!1,new t;if(b.push(k))continue;y=!1}}catch(w){b.destroy(w)}break}}return b}c.exports=s}),nr=fe((o,c)=>{oe(),ae(),se();var i=Et(),{ArrayPrototypeIndexOf:a,NumberIsInteger:l,NumberIsNaN:r,NumberParseInt:e,ObjectDefineProperties:n,ObjectKeys:t,ObjectSetPrototypeOf:s,Promise:u,SafeSet:d,SymbolAsyncDispose:p,SymbolAsyncIterator:g,Symbol:f}=Ue();c.exports=Y,Y.ReadableState=ge;var{EventEmitter:b}=(_t(),Be(mt)),{Stream:y,prependListener:_}=Nn(),{Buffer:A}=(Ve(),Be(We)),{addAbortSignal:w}=tr(),T=At(),k=$e().debuglog("stream",S=>{k=S}),E=_l(),I=Ut(),{getHighWaterMark:O,getDefaultHighWaterMark:H}=rr(),{aggregateTwoErrors:G,codes:{ERR_INVALID_ARG_TYPE:de,ERR_METHOD_NOT_IMPLEMENTED:U,ERR_OUT_OF_RANGE:$,ERR_STREAM_PUSH_AFTER_EOF:z,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:F},AbortError:me}=qe(),{validateObject:le}=Qt(),pe=f("kPaused"),{StringDecoder:we}=Sl(),Q=mo();s(Y.prototype,y.prototype),s(Y,y);var he=()=>{},{errorOrDestroy:x}=I,ce=1,ye=2,J=4,_e=8,K=16,M=32,Z=64,V=128,j=256,W=512,ue=1024,re=2048,P=4096,D=8192,q=16384,te=32768,ee=65536,ie=1<<17,L=1<<18;function ne(S){return{enumerable:!1,get(){return(this.state&S)!==0},set(B){B?this.state|=S:this.state&=~S}}}n(ge.prototype,{objectMode:ne(ce),ended:ne(ye),endEmitted:ne(J),reading:ne(_e),constructed:ne(K),sync:ne(M),needReadable:ne(Z),emittedReadable:ne(V),readableListening:ne(j),resumeScheduled:ne(W),errorEmitted:ne(ue),emitClose:ne(re),autoDestroy:ne(P),destroyed:ne(D),closed:ne(q),closeEmitted:ne(te),multiAwaitDrain:ne(ee),readingMore:ne(ie),dataEmitted:ne(L)});function ge(S,B,Ae){typeof Ae!="boolean"&&(Ae=B instanceof at()),this.state=re|P|K|M,S&&S.objectMode&&(this.state|=ce),Ae&&S&&S.readableObjectMode&&(this.state|=ce),this.highWaterMark=S?O(this,S,"readableHighWaterMark",Ae):H(!1),this.buffer=new E,this.length=0,this.pipes=[],this.flowing=null,this[pe]=null,S&&S.emitClose===!1&&(this.state&=~re),S&&S.autoDestroy===!1&&(this.state&=~P),this.errored=null,this.defaultEncoding=S&&S.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,S&&S.encoding&&(this.decoder=new we(S.encoding),this.encoding=S.encoding)}function Y(S){if(!(this instanceof Y))return new Y(S);let B=this instanceof at();this._readableState=new ge(S,this,B),S&&(typeof S.read=="function"&&(this._read=S.read),typeof S.destroy=="function"&&(this._destroy=S.destroy),typeof S.construct=="function"&&(this._construct=S.construct),S.signal&&!B&&w(S.signal,this)),y.call(this,S),I.construct(this,()=>{this._readableState.needReadable&&Ce(this,this._readableState)})}Y.prototype.destroy=I.destroy,Y.prototype._undestroy=I.undestroy,Y.prototype._destroy=function(S,B){B(S)},Y.prototype[b.captureRejectionSymbol]=function(S){this.destroy(S)},Y.prototype[p]=function(){let S;return this.destroyed||(S=this.readableEnded?null:new me,this.destroy(S)),new u((B,Ae)=>T(this,ve=>ve&&ve!==S?Ae(ve):B(null)))},Y.prototype.push=function(S,B){return Se(this,S,B,!1)},Y.prototype.unshift=function(S,B){return Se(this,S,B,!0)};function Se(S,B,Ae,ve){k("readableAddChunk",B);let Ee=S._readableState,Ke;if((Ee.state&ce)===0&&(typeof B=="string"?(Ae=Ae||Ee.defaultEncoding,Ee.encoding!==Ae&&(ve&&Ee.encoding?B=A.from(B,Ae).toString(Ee.encoding):(B=A.from(B,Ae),Ae=""))):B instanceof A?Ae="":y._isUint8Array(B)?(B=y._uint8ArrayToBuffer(B),Ae=""):B!=null&&(Ke=new de("chunk",["string","Buffer","Uint8Array"],B))),Ke)x(S,Ke);else if(B===null)Ee.state&=~_e,N(S,Ee);else if((Ee.state&ce)!==0||B&&B.length>0)if(ve)if((Ee.state&J)!==0)x(S,new F);else{if(Ee.destroyed||Ee.errored)return!1;h(S,Ee,B,!0)}else if(Ee.ended)x(S,new z);else{if(Ee.destroyed||Ee.errored)return!1;Ee.state&=~_e,Ee.decoder&&!Ae?(B=Ee.decoder.write(B),Ee.objectMode||B.length!==0?h(S,Ee,B,!1):Ce(S,Ee)):h(S,Ee,B,!1)}else ve||(Ee.state&=~_e,Ce(S,Ee));return!Ee.ended&&(Ee.length<Ee.highWaterMark||Ee.length===0)}function h(S,B,Ae,ve){B.flowing&&B.length===0&&!B.sync&&S.listenerCount("data")>0?((B.state&ee)!==0?B.awaitDrainWriters.clear():B.awaitDrainWriters=null,B.dataEmitted=!0,S.emit("data",Ae)):(B.length+=B.objectMode?1:Ae.length,ve?B.buffer.unshift(Ae):B.buffer.push(Ae),(B.state&Z)!==0&&X(S)),Ce(S,B)}Y.prototype.isPaused=function(){let S=this._readableState;return S[pe]===!0||S.flowing===!1},Y.prototype.setEncoding=function(S){let B=new we(S);this._readableState.decoder=B,this._readableState.encoding=this._readableState.decoder.encoding;let Ae=this._readableState.buffer,ve="";for(let Ee of Ae)ve+=B.write(Ee);return Ae.clear(),ve!==""&&Ae.push(ve),this._readableState.length=ve.length,this};var m=1073741824;function v(S){if(S>m)throw new $("size","<= 1GiB",S);return S--,S|=S>>>1,S|=S>>>2,S|=S>>>4,S|=S>>>8,S|=S>>>16,S++,S}function R(S,B){return S<=0||B.length===0&&B.ended?0:(B.state&ce)!==0?1:r(S)?B.flowing&&B.length?B.buffer.first().length:B.length:S<=B.length?S:B.ended?B.length:0}Y.prototype.read=function(S){k("read",S),S===void 0?S=NaN:l(S)||(S=e(S,10));let B=this._readableState,Ae=S;if(S>B.highWaterMark&&(B.highWaterMark=v(S)),S!==0&&(B.state&=~V),S===0&&B.needReadable&&((B.highWaterMark!==0?B.length>=B.highWaterMark:B.length>0)||B.ended))return k("read: emitReadable",B.length,B.ended),B.length===0&&B.ended?oi(this):X(this),null;if(S=R(S,B),S===0&&B.ended)return B.length===0&&oi(this),null;let ve=(B.state&Z)!==0;if(k("need readable",ve),(B.length===0||B.length-S<B.highWaterMark)&&(ve=!0,k("length less than watermark",ve)),B.ended||B.reading||B.destroyed||B.errored||!B.constructed)ve=!1,k("reading, ended or constructing",ve);else if(ve){k("do read"),B.state|=_e|M,B.length===0&&(B.state|=Z);try{this._read(B.highWaterMark)}catch(Ke){x(this,Ke)}B.state&=~M,B.reading||(S=R(Ae,B))}let Ee;return S>0?Ee=Vs(S,B):Ee=null,Ee===null?(B.needReadable=B.length<=B.highWaterMark,S=0):(B.length-=S,B.multiAwaitDrain?B.awaitDrainWriters.clear():B.awaitDrainWriters=null),B.length===0&&(B.ended||(B.needReadable=!0),Ae!==S&&B.ended&&oi(this)),Ee!==null&&!B.errorEmitted&&!B.closeEmitted&&(B.dataEmitted=!0,this.emit("data",Ee)),Ee};function N(S,B){if(k("onEofChunk"),!B.ended){if(B.decoder){let Ae=B.decoder.end();Ae&&Ae.length&&(B.buffer.push(Ae),B.length+=B.objectMode?1:Ae.length)}B.ended=!0,B.sync?X(S):(B.needReadable=!1,B.emittedReadable=!0,be(S))}}function X(S){let B=S._readableState;k("emitReadable",B.needReadable,B.emittedReadable),B.needReadable=!1,B.emittedReadable||(k("emitReadable",B.flowing),B.emittedReadable=!0,i.nextTick(be,S))}function be(S){let B=S._readableState;k("emitReadable_",B.destroyed,B.length,B.ended),!B.destroyed&&!B.errored&&(B.length||B.ended)&&(S.emit("readable"),B.emittedReadable=!1),B.needReadable=!B.flowing&&!B.ended&&B.length<=B.highWaterMark,js(S)}function Ce(S,B){!B.readingMore&&B.constructed&&(B.readingMore=!0,i.nextTick(je,S,B))}function je(S,B){for(;!B.reading&&!B.ended&&(B.length<B.highWaterMark||B.flowing&&B.length===0);){let Ae=B.length;if(k("maybeReadMore read 0"),S.read(0),Ae===B.length)break}B.readingMore=!1}Y.prototype._read=function(S){throw new U("_read()")},Y.prototype.pipe=function(S,B){let Ae=this,ve=this._readableState;ve.pipes.length===1&&(ve.multiAwaitDrain||(ve.multiAwaitDrain=!0,ve.awaitDrainWriters=new d(ve.awaitDrainWriters?[ve.awaitDrainWriters]:[]))),ve.pipes.push(S),k("pipe count=%d opts=%j",ve.pipes.length,B);let Ee=(!B||B.end!==!1)&&S!==i.stdout&&S!==i.stderr?Ye:qt;ve.endEmitted?i.nextTick(Ee):Ae.once("end",Ee),S.on("unpipe",Ke);function Ke(xt,pt){k("onunpipe"),xt===Ae&&pt&&pt.hasUnpiped===!1&&(pt.hasUnpiped=!0,Qu())}function Ye(){k("onend"),S.end()}let Pt,Ks=!1;function Qu(){k("cleanup"),S.removeListener("close",li),S.removeListener("finish",ui),Pt&&S.removeListener("drain",Pt),S.removeListener("error",ai),S.removeListener("unpipe",Ke),Ae.removeListener("end",Ye),Ae.removeListener("end",qt),Ae.removeListener("data",qs),Ks=!0,Pt&&ve.awaitDrainWriters&&(!S._writableState||S._writableState.needDrain)&&Pt()}function Hs(){Ks||(ve.pipes.length===1&&ve.pipes[0]===S?(k("false write response, pause",0),ve.awaitDrainWriters=S,ve.multiAwaitDrain=!1):ve.pipes.length>1&&ve.pipes.includes(S)&&(k("false write response, pause",ve.awaitDrainWriters.size),ve.awaitDrainWriters.add(S)),Ae.pause()),Pt||(Pt=xe(Ae,S),S.on("drain",Pt))}Ae.on("data",qs);function qs(xt){k("ondata");let pt=S.write(xt);k("dest.write",pt),pt===!1&&Hs()}function ai(xt){if(k("onerror",xt),qt(),S.removeListener("error",ai),S.listenerCount("error")===0){let pt=S._writableState||S._readableState;pt&&!pt.errorEmitted?x(S,xt):S.emit("error",xt)}}_(S,"error",ai);function li(){S.removeListener("finish",ui),qt()}S.once("close",li);function ui(){k("onfinish"),S.removeListener("close",li),qt()}S.once("finish",ui);function qt(){k("unpipe"),Ae.unpipe(S)}return S.emit("pipe",Ae),S.writableNeedDrain===!0?Hs():ve.flowing||(k("pipe resume"),Ae.resume()),S};function xe(S,B){return function(){let Ae=S._readableState;Ae.awaitDrainWriters===B?(k("pipeOnDrain",1),Ae.awaitDrainWriters=null):Ae.multiAwaitDrain&&(k("pipeOnDrain",Ae.awaitDrainWriters.size),Ae.awaitDrainWriters.delete(B)),(!Ae.awaitDrainWriters||Ae.awaitDrainWriters.size===0)&&S.listenerCount("data")&&S.resume()}}Y.prototype.unpipe=function(S){let B=this._readableState,Ae={hasUnpiped:!1};if(B.pipes.length===0)return this;if(!S){let Ee=B.pipes;B.pipes=[],this.pause();for(let Ke=0;Ke<Ee.length;Ke++)Ee[Ke].emit("unpipe",this,{hasUnpiped:!1});return this}let ve=a(B.pipes,S);return ve===-1?this:(B.pipes.splice(ve,1),B.pipes.length===0&&this.pause(),S.emit("unpipe",this,Ae),this)},Y.prototype.on=function(S,B){let Ae=y.prototype.on.call(this,S,B),ve=this._readableState;return S==="data"?(ve.readableListening=this.listenerCount("readable")>0,ve.flowing!==!1&&this.resume()):S==="readable"&&!ve.endEmitted&&!ve.readableListening&&(ve.readableListening=ve.needReadable=!0,ve.flowing=!1,ve.emittedReadable=!1,k("on readable",ve.length,ve.reading),ve.length?X(this):ve.reading||i.nextTick(Ne,this)),Ae},Y.prototype.addListener=Y.prototype.on,Y.prototype.removeListener=function(S,B){let Ae=y.prototype.removeListener.call(this,S,B);return S==="readable"&&i.nextTick(Te,this),Ae},Y.prototype.off=Y.prototype.removeListener,Y.prototype.removeAllListeners=function(S){let B=y.prototype.removeAllListeners.apply(this,arguments);return(S==="readable"||S===void 0)&&i.nextTick(Te,this),B};function Te(S){let B=S._readableState;B.readableListening=S.listenerCount("readable")>0,B.resumeScheduled&&B[pe]===!1?B.flowing=!0:S.listenerCount("data")>0?S.resume():B.readableListening||(B.flowing=null)}function Ne(S){k("readable nexttick read 0"),S.read(0)}Y.prototype.resume=function(){let S=this._readableState;return S.flowing||(k("resume"),S.flowing=!S.readableListening,Nu(this,S)),S[pe]=!1,this};function Nu(S,B){B.resumeScheduled||(B.resumeScheduled=!0,i.nextTick(Fu,S,B))}function Fu(S,B){k("resume",B.reading),B.reading||S.read(0),B.resumeScheduled=!1,S.emit("resume"),js(S),B.flowing&&!B.reading&&S.read(0)}Y.prototype.pause=function(){return k("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(k("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[pe]=!0,this};function js(S){let B=S._readableState;for(k("flow",B.flowing);B.flowing&&S.read()!==null;);}Y.prototype.wrap=function(S){let B=!1;S.on("data",ve=>{!this.push(ve)&&S.pause&&(B=!0,S.pause())}),S.on("end",()=>{this.push(null)}),S.on("error",ve=>{x(this,ve)}),S.on("close",()=>{this.destroy()}),S.on("destroy",()=>{this.destroy()}),this._read=()=>{B&&S.resume&&(B=!1,S.resume())};let Ae=t(S);for(let ve=1;ve<Ae.length;ve++){let Ee=Ae[ve];this[Ee]===void 0&&typeof S[Ee]=="function"&&(this[Ee]=S[Ee].bind(S))}return this},Y.prototype[g]=function(){return Ws(this)},Y.prototype.iterator=function(S){return S!==void 0&&le(S,"options"),Ws(this,S)};function Ws(S,B){typeof S.read!="function"&&(S=Y.wrap(S,{objectMode:!0}));let Ae=ju(S,B);return Ae.stream=S,Ae}async function*ju(S,B){let Ae=he;function ve(Ye){this===S?(Ae(),Ae=he):Ae=Ye}S.on("readable",ve);let Ee,Ke=T(S,{writable:!1},Ye=>{Ee=Ye?G(Ee,Ye):null,Ae(),Ae=he});try{for(;;){let Ye=S.destroyed?null:S.read();if(Ye!==null)yield Ye;else{if(Ee)throw Ee;if(Ee===null)return;await new u(ve)}}}catch(Ye){throw Ee=G(Ee,Ye),Ee}finally{(Ee||B?.destroyOnReturn!==!1)&&(Ee===void 0||S._readableState.autoDestroy)?I.destroyer(S,null):(S.off("readable",ve),Ke())}}n(Y.prototype,{readable:{__proto__:null,get(){let S=this._readableState;return!!S&&S.readable!==!1&&!S.destroyed&&!S.errorEmitted&&!S.endEmitted},set(S){this._readableState&&(this._readableState.readable=!!S)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(S){this._readableState&&(this._readableState.flowing=S)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(S){this._readableState&&(this._readableState.destroyed=S)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),n(ge.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[pe]!==!1},set(S){this[pe]=!!S}}}),Y._fromList=Vs;function Vs(S,B){if(B.length===0)return null;let Ae;return B.objectMode?Ae=B.buffer.shift():!S||S>=B.length?(B.decoder?Ae=B.buffer.join(""):B.buffer.length===1?Ae=B.buffer.first():Ae=B.buffer.concat(B.length),B.buffer.clear()):Ae=B.buffer.consume(S,B.decoder),Ae}function oi(S){let B=S._readableState;k("endReadable",B.endEmitted),B.endEmitted||(B.ended=!0,i.nextTick(Wu,B,S))}function Wu(S,B){if(k("endReadableNT",S.endEmitted,S.length),!S.errored&&!S.closeEmitted&&!S.endEmitted&&S.length===0){if(S.endEmitted=!0,B.emit("end"),B.writable&&B.allowHalfOpen===!1)i.nextTick(Vu,B);else if(S.autoDestroy){let Ae=B._writableState;(!Ae||Ae.autoDestroy&&(Ae.finished||Ae.writable===!1))&&B.destroy()}}}function Vu(S){S.writable&&!S.writableEnded&&!S.destroyed&&S.end()}Y.from=function(S,B){return Q(Y,S,B)};var si;function Qs(){return si===void 0&&(si={}),si}Y.fromWeb=function(S,B){return Qs().newStreamReadableFromReadableStream(S,B)},Y.toWeb=function(S,B){return Qs().newReadableStreamFromStreamReadable(S,B)},Y.wrap=function(S,B){var Ae,ve;return new Y({objectMode:(Ae=(ve=S.readableObjectMode)!==null&&ve!==void 0?ve:S.objectMode)!==null&&Ae!==void 0?Ae:!0,...B,destroy(Ee,Ke){I.destroyer(S,Ee),Ke(Ee)}}).wrap(S)}}),Fn=fe((o,c)=>{oe(),ae(),se();var i=Et(),{ArrayPrototypeSlice:a,Error:l,FunctionPrototypeSymbolHasInstance:r,ObjectDefineProperty:e,ObjectDefineProperties:n,ObjectSetPrototypeOf:t,StringPrototypeToLowerCase:s,Symbol:u,SymbolHasInstance:d}=Ue();c.exports=le,le.WritableState=F;var{EventEmitter:p}=(_t(),Be(mt)),g=Nn().Stream,{Buffer:f}=(Ve(),Be(We)),b=Ut(),{addAbortSignal:y}=tr(),{getHighWaterMark:_,getDefaultHighWaterMark:A}=rr(),{ERR_INVALID_ARG_TYPE:w,ERR_METHOD_NOT_IMPLEMENTED:T,ERR_MULTIPLE_CALLBACK:k,ERR_STREAM_CANNOT_PIPE:E,ERR_STREAM_DESTROYED:I,ERR_STREAM_ALREADY_FINISHED:O,ERR_STREAM_NULL_VALUES:H,ERR_STREAM_WRITE_AFTER_END:G,ERR_UNKNOWN_ENCODING:de}=qe().codes,{errorOrDestroy:U}=b;t(le.prototype,g.prototype),t(le,g);function $(){}var z=u("kOnFinished");function F(P,D,q){typeof q!="boolean"&&(q=D instanceof at()),this.objectMode=!!(P&&P.objectMode),q&&(this.objectMode=this.objectMode||!!(P&&P.writableObjectMode)),this.highWaterMark=P?_(this,P,"writableHighWaterMark",q):A(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let te=!!(P&&P.decodeStrings===!1);this.decodeStrings=!te,this.defaultEncoding=P&&P.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=x.bind(void 0,D),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,me(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!P||P.emitClose!==!1,this.autoDestroy=!P||P.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[z]=[]}function me(P){P.buffered=[],P.bufferedIndex=0,P.allBuffers=!0,P.allNoop=!0}F.prototype.getBuffer=function(){return a(this.buffered,this.bufferedIndex)},e(F.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function le(P){let D=this instanceof at();if(!D&&!r(le,this))return new le(P);this._writableState=new F(P,this,D),P&&(typeof P.write=="function"&&(this._write=P.write),typeof P.writev=="function"&&(this._writev=P.writev),typeof P.destroy=="function"&&(this._destroy=P.destroy),typeof P.final=="function"&&(this._final=P.final),typeof P.construct=="function"&&(this._construct=P.construct),P.signal&&y(P.signal,this)),g.call(this,P),b.construct(this,()=>{let q=this._writableState;q.writing||_e(this,q),V(this,q)})}e(le,d,{__proto__:null,value:function(P){return r(this,P)?!0:this!==le?!1:P&&P._writableState instanceof F}}),le.prototype.pipe=function(){U(this,new E)};function pe(P,D,q,te){let ee=P._writableState;if(typeof q=="function")te=q,q=ee.defaultEncoding;else{if(!q)q=ee.defaultEncoding;else if(q!=="buffer"&&!f.isEncoding(q))throw new de(q);typeof te!="function"&&(te=$)}if(D===null)throw new H;if(!ee.objectMode)if(typeof D=="string")ee.decodeStrings!==!1&&(D=f.from(D,q),q="buffer");else if(D instanceof f)q="buffer";else if(g._isUint8Array(D))D=g._uint8ArrayToBuffer(D),q="buffer";else throw new w("chunk",["string","Buffer","Uint8Array"],D);let ie;return ee.ending?ie=new G:ee.destroyed&&(ie=new I("write")),ie?(i.nextTick(te,ie),U(P,ie,!0),ie):(ee.pendingcb++,we(P,ee,D,q,te))}le.prototype.write=function(P,D,q){return pe(this,P,D,q)===!0},le.prototype.cork=function(){this._writableState.corked++},le.prototype.uncork=function(){let P=this._writableState;P.corked&&(P.corked--,P.writing||_e(this,P))},le.prototype.setDefaultEncoding=function(P){if(typeof P=="string"&&(P=s(P)),!f.isEncoding(P))throw new de(P);return this._writableState.defaultEncoding=P,this};function we(P,D,q,te,ee){let ie=D.objectMode?1:q.length;D.length+=ie;let L=D.length<D.highWaterMark;return L||(D.needDrain=!0),D.writing||D.corked||D.errored||!D.constructed?(D.buffered.push({chunk:q,encoding:te,callback:ee}),D.allBuffers&&te!=="buffer"&&(D.allBuffers=!1),D.allNoop&&ee!==$&&(D.allNoop=!1)):(D.writelen=ie,D.writecb=ee,D.writing=!0,D.sync=!0,P._write(q,te,D.onwrite),D.sync=!1),L&&!D.errored&&!D.destroyed}function Q(P,D,q,te,ee,ie,L){D.writelen=te,D.writecb=L,D.writing=!0,D.sync=!0,D.destroyed?D.onwrite(new I("write")):q?P._writev(ee,D.onwrite):P._write(ee,ie,D.onwrite),D.sync=!1}function he(P,D,q,te){--D.pendingcb,te(q),J(D),U(P,q)}function x(P,D){let q=P._writableState,te=q.sync,ee=q.writecb;if(typeof ee!="function"){U(P,new k);return}q.writing=!1,q.writecb=null,q.length-=q.writelen,q.writelen=0,D?(D.stack,q.errored||(q.errored=D),P._readableState&&!P._readableState.errored&&(P._readableState.errored=D),te?i.nextTick(he,P,q,D,ee):he(P,q,D,ee)):(q.buffered.length>q.bufferedIndex&&_e(P,q),te?q.afterWriteTickInfo!==null&&q.afterWriteTickInfo.cb===ee?q.afterWriteTickInfo.count++:(q.afterWriteTickInfo={count:1,cb:ee,stream:P,state:q},i.nextTick(ce,q.afterWriteTickInfo)):ye(P,q,1,ee))}function ce({stream:P,state:D,count:q,cb:te}){return D.afterWriteTickInfo=null,ye(P,D,q,te)}function ye(P,D,q,te){for(!D.ending&&!P.destroyed&&D.length===0&&D.needDrain&&(D.needDrain=!1,P.emit("drain"));q-- >0;)D.pendingcb--,te();D.destroyed&&J(D),V(P,D)}function J(P){if(P.writing)return;for(let ee=P.bufferedIndex;ee<P.buffered.length;++ee){var D;let{chunk:ie,callback:L}=P.buffered[ee],ne=P.objectMode?1:ie.length;P.length-=ne,L((D=P.errored)!==null&&D!==void 0?D:new I("write"))}let q=P[z].splice(0);for(let ee=0;ee<q.length;ee++){var te;q[ee]((te=P.errored)!==null&&te!==void 0?te:new I("end"))}me(P)}function _e(P,D){if(D.corked||D.bufferProcessing||D.destroyed||!D.constructed)return;let{buffered:q,bufferedIndex:te,objectMode:ee}=D,ie=q.length-te;if(!ie)return;let L=te;if(D.bufferProcessing=!0,ie>1&&P._writev){D.pendingcb-=ie-1;let ne=D.allNoop?$:Y=>{for(let Se=L;Se<q.length;++Se)q[Se].callback(Y)},ge=D.allNoop&&L===0?q:a(q,L);ge.allBuffers=D.allBuffers,Q(P,D,!0,D.length,ge,"",ne),me(D)}else{do{let{chunk:ne,encoding:ge,callback:Y}=q[L];q[L++]=null;let Se=ee?1:ne.length;Q(P,D,!1,Se,ne,ge,Y)}while(L<q.length&&!D.writing);L===q.length?me(D):L>256?(q.splice(0,L),D.bufferedIndex=0):D.bufferedIndex=L}D.bufferProcessing=!1}le.prototype._write=function(P,D,q){if(this._writev)this._writev([{chunk:P,encoding:D}],q);else throw new T("_write()")},le.prototype._writev=null,le.prototype.end=function(P,D,q){let te=this._writableState;typeof P=="function"?(q=P,P=null,D=null):typeof D=="function"&&(q=D,D=null);let ee;if(P!=null){let ie=pe(this,P,D);ie instanceof l&&(ee=ie)}return te.corked&&(te.corked=1,this.uncork()),ee||(!te.errored&&!te.ending?(te.ending=!0,V(this,te,!0),te.ended=!0):te.finished?ee=new O("end"):te.destroyed&&(ee=new I("end"))),typeof q=="function"&&(ee||te.finished?i.nextTick(q,ee):te[z].push(q)),this};function K(P){return P.ending&&!P.destroyed&&P.constructed&&P.length===0&&!P.errored&&P.buffered.length===0&&!P.finished&&!P.writing&&!P.errorEmitted&&!P.closeEmitted}function M(P,D){let q=!1;function te(ee){if(q){U(P,ee??k());return}if(q=!0,D.pendingcb--,ee){let ie=D[z].splice(0);for(let L=0;L<ie.length;L++)ie[L](ee);U(P,ee,D.sync)}else K(D)&&(D.prefinished=!0,P.emit("prefinish"),D.pendingcb++,i.nextTick(j,P,D))}D.sync=!0,D.pendingcb++;try{P._final(te)}catch(ee){te(ee)}D.sync=!1}function Z(P,D){!D.prefinished&&!D.finalCalled&&(typeof P._final=="function"&&!D.destroyed?(D.finalCalled=!0,M(P,D)):(D.prefinished=!0,P.emit("prefinish")))}function V(P,D,q){K(D)&&(Z(P,D),D.pendingcb===0&&(q?(D.pendingcb++,i.nextTick((te,ee)=>{K(ee)?j(te,ee):ee.pendingcb--},P,D)):K(D)&&(D.pendingcb++,j(P,D))))}function j(P,D){D.pendingcb--,D.finished=!0;let q=D[z].splice(0);for(let te=0;te<q.length;te++)q[te]();if(P.emit("finish"),D.autoDestroy){let te=P._readableState;(!te||te.autoDestroy&&(te.endEmitted||te.readable===!1))&&P.destroy()}}n(le.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(P){this._writableState&&(this._writableState.destroyed=P)}},writable:{__proto__:null,get(){let P=this._writableState;return!!P&&P.writable!==!1&&!P.destroyed&&!P.errored&&!P.ending&&!P.ended},set(P){this._writableState&&(this._writableState.writable=!!P)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let P=this._writableState;return P?!P.destroyed&&!P.ending&&P.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var W=b.destroy;le.prototype.destroy=function(P,D){let q=this._writableState;return!q.destroyed&&(q.bufferedIndex<q.buffered.length||q[z].length)&&i.nextTick(J,q),W.call(this,P,D),this},le.prototype._undestroy=b.undestroy,le.prototype._destroy=function(P,D){D(P)},le.prototype[p.captureRejectionSymbol]=function(P){this.destroy(P)};var ue;function re(){return ue===void 0&&(ue={}),ue}le.fromWeb=function(P,D){return re().newStreamWritableFromWritableStream(P,D)},le.toWeb=function(P){return re().newWritableStreamFromStreamWritable(P)}}),Cl=fe((o,c)=>{oe(),ae(),se();var i=Et(),a=(Ve(),Be(We)),{isReadable:l,isWritable:r,isIterable:e,isNodeStream:n,isReadableNodeStream:t,isWritableNodeStream:s,isDuplexNodeStream:u,isReadableStream:d,isWritableStream:p}=st(),g=At(),{AbortError:f,codes:{ERR_INVALID_ARG_TYPE:b,ERR_INVALID_RETURN_VALUE:y}}=qe(),{destroyer:_}=Ut(),A=at(),w=nr(),T=Fn(),{createDeferredPromise:k}=$e(),E=mo(),I=globalThis.Blob||a.Blob,O=typeof I<"u"?function(z){return z instanceof I}:function(z){return!1},H=globalThis.AbortController||Vt().AbortController,{FunctionPrototypeCall:G}=Ue(),de=class extends A{constructor(z){super(z),z?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),z?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};c.exports=function z(F,me){if(u(F))return F;if(t(F))return $({readable:F});if(s(F))return $({writable:F});if(n(F))return $({writable:!1,readable:!1});if(d(F))return $({readable:w.fromWeb(F)});if(p(F))return $({writable:T.fromWeb(F)});if(typeof F=="function"){let{value:pe,write:we,final:Q,destroy:he}=U(F);if(e(pe))return E(de,pe,{objectMode:!0,write:we,final:Q,destroy:he});let x=pe?.then;if(typeof x=="function"){let ce,ye=G(x,pe,J=>{if(J!=null)throw new y("nully","body",J)},J=>{_(ce,J)});return ce=new de({objectMode:!0,readable:!1,write:we,final(J){Q(async()=>{try{await ye,i.nextTick(J,null)}catch(_e){i.nextTick(J,_e)}})},destroy:he})}throw new y("Iterable, AsyncIterable or AsyncFunction",me,pe)}if(O(F))return z(F.arrayBuffer());if(e(F))return E(de,F,{objectMode:!0,writable:!1});if(d(F?.readable)&&p(F?.writable))return de.fromWeb(F);if(typeof F?.writable=="object"||typeof F?.readable=="object"){let pe=F!=null&&F.readable?t(F?.readable)?F?.readable:z(F.readable):void 0,we=F!=null&&F.writable?s(F?.writable)?F?.writable:z(F.writable):void 0;return $({readable:pe,writable:we})}let le=F?.then;if(typeof le=="function"){let pe;return G(le,F,we=>{we!=null&&pe.push(we),pe.push(null)},we=>{_(pe,we)}),pe=new de({objectMode:!0,writable:!1,read(){}})}throw new b(me,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],F)};function U(z){let{promise:F,resolve:me}=k(),le=new H,pe=le.signal;return{value:z(async function*(){for(;;){let we=F;F=null;let{chunk:Q,done:he,cb:x}=await we;if(i.nextTick(x),he)return;if(pe.aborted)throw new f(void 0,{cause:pe.reason});({promise:F,resolve:me}=k()),yield Q}}(),{signal:pe}),write(we,Q,he){let x=me;me=null,x({chunk:we,done:!1,cb:he})},final(we){let Q=me;me=null,Q({done:!0,cb:we})},destroy(we,Q){le.abort(),Q(we)}}}function $(z){let F=z.readable&&typeof z.readable.read!="function"?w.wrap(z.readable):z.readable,me=z.writable,le=!!l(F),pe=!!r(me),we,Q,he,x,ce;function ye(J){let _e=x;x=null,_e?_e(J):J&&ce.destroy(J)}return ce=new de({readableObjectMode:!!(F!=null&&F.readableObjectMode),writableObjectMode:!!(me!=null&&me.writableObjectMode),readable:le,writable:pe}),pe&&(g(me,J=>{pe=!1,J&&_(F,J),ye(J)}),ce._write=function(J,_e,K){me.write(J,_e)?K():we=K},ce._final=function(J){me.end(),Q=J},me.on("drain",function(){if(we){let J=we;we=null,J()}}),me.on("finish",function(){if(Q){let J=Q;Q=null,J()}})),le&&(g(F,J=>{le=!1,J&&_(F,J),ye(J)}),F.on("readable",function(){if(he){let J=he;he=null,J()}}),F.on("end",function(){ce.push(null)}),ce._read=function(){for(;;){let J=F.read();if(J===null){he=ce._read;return}if(!ce.push(J))return}}),ce._destroy=function(J,_e){!J&&x!==null&&(J=new f),he=null,we=null,Q=null,x===null?_e(J):(x=_e,_(me,J),_(F,J))},ce}}),at=fe((o,c)=>{oe(),ae(),se();var{ObjectDefineProperties:i,ObjectGetOwnPropertyDescriptor:a,ObjectKeys:l,ObjectSetPrototypeOf:r}=Ue();c.exports=t;var e=nr(),n=Fn();r(t.prototype,e.prototype),r(t,e);{let p=l(n.prototype);for(let g=0;g<p.length;g++){let f=p[g];t.prototype[f]||(t.prototype[f]=n.prototype[f])}}function t(p){if(!(this instanceof t))return new t(p);e.call(this,p),n.call(this,p),p?(this.allowHalfOpen=p.allowHalfOpen!==!1,p.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),p.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}i(t.prototype,{writable:{__proto__:null,...a(n.prototype,"writable")},writableHighWaterMark:{__proto__:null,...a(n.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...a(n.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...a(n.prototype,"writableBuffer")},writableLength:{__proto__:null,...a(n.prototype,"writableLength")},writableFinished:{__proto__:null,...a(n.prototype,"writableFinished")},writableCorked:{__proto__:null,...a(n.prototype,"writableCorked")},writableEnded:{__proto__:null,...a(n.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...a(n.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(p){this._readableState&&this._writableState&&(this._readableState.destroyed=p,this._writableState.destroyed=p)}}});var s;function u(){return s===void 0&&(s={}),s}t.fromWeb=function(p,g){return u().newStreamDuplexFromReadableWritablePair(p,g)},t.toWeb=function(p){return u().newReadableWritablePairFromDuplex(p)};var d;t.from=function(p){return d||(d=Cl()),d(p,"body")}}),Ao=fe((o,c)=>{oe(),ae(),se();var{ObjectSetPrototypeOf:i,Symbol:a}=Ue();c.exports=t;var{ERR_METHOD_NOT_IMPLEMENTED:l}=qe().codes,r=at(),{getHighWaterMark:e}=rr();i(t.prototype,r.prototype),i(t,r);var n=a("kCallback");function t(d){if(!(this instanceof t))return new t(d);let p=d?e(this,d,"readableHighWaterMark",!0):null;p===0&&(d={...d,highWaterMark:null,readableHighWaterMark:p,writableHighWaterMark:d.writableHighWaterMark||0}),r.call(this,d),this._readableState.sync=!1,this[n]=null,d&&(typeof d.transform=="function"&&(this._transform=d.transform),typeof d.flush=="function"&&(this._flush=d.flush)),this.on("prefinish",u)}function s(d){typeof this._flush=="function"&&!this.destroyed?this._flush((p,g)=>{if(p){d?d(p):this.destroy(p);return}g!=null&&this.push(g),this.push(null),d&&d()}):(this.push(null),d&&d())}function u(){this._final!==s&&s.call(this)}t.prototype._final=s,t.prototype._transform=function(d,p,g){throw new l("_transform()")},t.prototype._write=function(d,p,g){let f=this._readableState,b=this._writableState,y=f.length;this._transform(d,p,(_,A)=>{if(_){g(_);return}A!=null&&this.push(A),b.ended||y===f.length||f.length<f.highWaterMark?g():this[n]=g})},t.prototype._read=function(){if(this[n]){let d=this[n];this[n]=null,d()}}}),bo=fe((o,c)=>{oe(),ae(),se();var{ObjectSetPrototypeOf:i}=Ue();c.exports=l;var a=Ao();i(l.prototype,a.prototype),i(l,a);function l(r){if(!(this instanceof l))return new l(r);a.call(this,r)}l.prototype._transform=function(r,e,n){n(null,r)}}),jn=fe((o,c)=>{oe(),ae(),se();var i=Et(),{ArrayIsArray:a,Promise:l,SymbolAsyncIterator:r,SymbolDispose:e}=Ue(),n=At(),{once:t}=$e(),s=Ut(),u=at(),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:p,ERR_INVALID_RETURN_VALUE:g,ERR_MISSING_ARGS:f,ERR_STREAM_DESTROYED:b,ERR_STREAM_PREMATURE_CLOSE:y},AbortError:_}=qe(),{validateFunction:A,validateAbortSignal:w}=Qt(),{isIterable:T,isReadable:k,isReadableNodeStream:E,isNodeStream:I,isTransformStream:O,isWebStream:H,isReadableStream:G,isReadableFinished:de}=st(),U=globalThis.AbortController||Vt().AbortController,$,z,F;function me(J,_e,K){let M=!1;J.on("close",()=>{M=!0});let Z=n(J,{readable:_e,writable:K},V=>{M=!V});return{destroy:V=>{M||(M=!0,s.destroyer(J,V||new b("pipe")))},cleanup:Z}}function le(J){return A(J[J.length-1],"streams[stream.length - 1]"),J.pop()}function pe(J){if(T(J))return J;if(E(J))return we(J);throw new p("val",["Readable","Iterable","AsyncIterable"],J)}async function*we(J){z||(z=nr()),yield*z.prototype[r].call(J)}async function Q(J,_e,K,{end:M}){let Z,V=null,j=re=>{if(re&&(Z=re),V){let P=V;V=null,P()}},W=()=>new l((re,P)=>{Z?P(Z):V=()=>{Z?P(Z):re()}});_e.on("drain",j);let ue=n(_e,{readable:!1},j);try{_e.writableNeedDrain&&await W();for await(let re of J)_e.write(re)||await W();M&&(_e.end(),await W()),K()}catch(re){K(Z!==re?d(Z,re):re)}finally{ue(),_e.off("drain",j)}}async function he(J,_e,K,{end:M}){O(_e)&&(_e=_e.writable);let Z=_e.getWriter();try{for await(let V of J)await Z.ready,Z.write(V).catch(()=>{});await Z.ready,M&&await Z.close(),K()}catch(V){try{await Z.abort(V),K(V)}catch(j){K(j)}}}function x(...J){return ce(J,t(le(J)))}function ce(J,_e,K){if(J.length===1&&a(J[0])&&(J=J[0]),J.length<2)throw new f("streams");let M=new U,Z=M.signal,V=K?.signal,j=[];w(V,"options.signal");function W(){ee(new _)}F=F||$e().addAbortListener;let ue;V&&(ue=F(V,W));let re,P,D=[],q=0;function te(ge){ee(ge,--q===0)}function ee(ge,Y){var Se;if(ge&&(!re||re.code==="ERR_STREAM_PREMATURE_CLOSE")&&(re=ge),!(!re&&!Y)){for(;D.length;)D.shift()(re);(Se=ue)===null||Se===void 0||Se[e](),M.abort(),Y&&(re||j.forEach(h=>h()),i.nextTick(_e,re,P))}}let ie;for(let ge=0;ge<J.length;ge++){let Y=J[ge],Se=ge<J.length-1,h=ge>0,m=Se||K?.end!==!1,v=ge===J.length-1;if(I(Y)){let R=function(N){N&&N.name!=="AbortError"&&N.code!=="ERR_STREAM_PREMATURE_CLOSE"&&te(N)};if(m){let{destroy:N,cleanup:X}=me(Y,Se,h);D.push(N),k(Y)&&v&&j.push(X)}Y.on("error",R),k(Y)&&v&&j.push(()=>{Y.removeListener("error",R)})}if(ge===0)if(typeof Y=="function"){if(ie=Y({signal:Z}),!T(ie))throw new g("Iterable, AsyncIterable or Stream","source",ie)}else T(Y)||E(Y)||O(Y)?ie=Y:ie=u.from(Y);else if(typeof Y=="function"){if(O(ie)){var L;ie=pe((L=ie)===null||L===void 0?void 0:L.readable)}else ie=pe(ie);if(ie=Y(ie,{signal:Z}),Se){if(!T(ie,!0))throw new g("AsyncIterable",`transform[${ge-1}]`,ie)}else{var ne;$||($=bo());let R=new $({objectMode:!0}),N=(ne=ie)===null||ne===void 0?void 0:ne.then;if(typeof N=="function")q++,N.call(ie,Ce=>{P=Ce,Ce!=null&&R.write(Ce),m&&R.end(),i.nextTick(te)},Ce=>{R.destroy(Ce),i.nextTick(te,Ce)});else if(T(ie,!0))q++,Q(ie,R,te,{end:m});else if(G(ie)||O(ie)){let Ce=ie.readable||ie;q++,Q(Ce,R,te,{end:m})}else throw new g("AsyncIterable or Promise","destination",ie);ie=R;let{destroy:X,cleanup:be}=me(ie,!1,!0);D.push(X),v&&j.push(be)}}else if(I(Y)){if(E(ie)){q+=2;let R=ye(ie,Y,te,{end:m});k(Y)&&v&&j.push(R)}else if(O(ie)||G(ie)){let R=ie.readable||ie;q++,Q(R,Y,te,{end:m})}else if(T(ie))q++,Q(ie,Y,te,{end:m});else throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],ie);ie=Y}else if(H(Y)){if(E(ie))q++,he(pe(ie),Y,te,{end:m});else if(G(ie)||T(ie))q++,he(ie,Y,te,{end:m});else if(O(ie))q++,he(ie.readable,Y,te,{end:m});else throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],ie);ie=Y}else ie=u.from(Y)}return(Z!=null&&Z.aborted||V!=null&&V.aborted)&&i.nextTick(W),ie}function ye(J,_e,K,{end:M}){let Z=!1;if(_e.on("close",()=>{Z||K(new y)}),J.pipe(_e,{end:!1}),M){let V=function(){Z=!0,_e.end()};de(J)?i.nextTick(V):J.once("end",V)}else K();return n(J,{readable:!0,writable:!1},V=>{let j=J._readableState;V&&V.code==="ERR_STREAM_PREMATURE_CLOSE"&&j&&j.ended&&!j.errored&&!j.errorEmitted?J.once("end",K).once("error",K):K(V)}),n(_e,{readable:!1,writable:!0},K)}c.exports={pipelineImpl:ce,pipeline:x}}),yo=fe((o,c)=>{oe(),ae(),se();var{pipeline:i}=jn(),a=at(),{destroyer:l}=Ut(),{isNodeStream:r,isReadable:e,isWritable:n,isWebStream:t,isTransformStream:s,isWritableStream:u,isReadableStream:d}=st(),{AbortError:p,codes:{ERR_INVALID_ARG_VALUE:g,ERR_MISSING_ARGS:f}}=qe(),b=At();c.exports=function(...y){if(y.length===0)throw new f("streams");if(y.length===1)return a.from(y[0]);let _=[...y];if(typeof y[0]=="function"&&(y[0]=a.from(y[0])),typeof y[y.length-1]=="function"){let U=y.length-1;y[U]=a.from(y[U])}for(let U=0;U<y.length;++U)if(!(!r(y[U])&&!t(y[U]))){if(U<y.length-1&&!(e(y[U])||d(y[U])||s(y[U])))throw new g(`streams[${U}]`,_[U],"must be readable");if(U>0&&!(n(y[U])||u(y[U])||s(y[U])))throw new g(`streams[${U}]`,_[U],"must be writable")}let A,w,T,k,E;function I(U){let $=k;k=null,$?$(U):U?E.destroy(U):!de&&!G&&E.destroy()}let O=y[0],H=i(y,I),G=!!(n(O)||u(O)||s(O)),de=!!(e(H)||d(H)||s(H));if(E=new a({writableObjectMode:!!(O!=null&&O.writableObjectMode),readableObjectMode:!!(H!=null&&H.readableObjectMode),writable:G,readable:de}),G){if(r(O))E._write=function($,z,F){O.write($,z)?F():A=F},E._final=function($){O.end(),w=$},O.on("drain",function(){if(A){let $=A;A=null,$()}});else if(t(O)){let $=(s(O)?O.writable:O).getWriter();E._write=async function(z,F,me){try{await $.ready,$.write(z).catch(()=>{}),me()}catch(le){me(le)}},E._final=async function(z){try{await $.ready,$.close().catch(()=>{}),w=z}catch(F){z(F)}}}let U=s(H)?H.readable:H;b(U,()=>{if(w){let $=w;w=null,$()}})}if(de){if(r(H))H.on("readable",function(){if(T){let U=T;T=null,U()}}),H.on("end",function(){E.push(null)}),E._read=function(){for(;;){let U=H.read();if(U===null){T=E._read;return}if(!E.push(U))return}};else if(t(H)){let U=(s(H)?H.readable:H).getReader();E._read=async function(){for(;;)try{let{value:$,done:z}=await U.read();if(!E.push($))return;if(z){E.push(null);return}}catch{return}}}}return E._destroy=function(U,$){!U&&k!==null&&(U=new p),T=null,A=null,w=null,k===null?$(U):(k=$,r(H)&&l(H,U))},E}}),kl=fe((o,c)=>{oe(),ae(),se();var i=globalThis.AbortController||Vt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:a,ERR_INVALID_ARG_TYPE:l,ERR_MISSING_ARGS:r,ERR_OUT_OF_RANGE:e},AbortError:n}=qe(),{validateAbortSignal:t,validateInteger:s,validateObject:u}=Qt(),d=Ue().Symbol("kWeak"),p=Ue().Symbol("kResistStopPropagation"),{finished:g}=At(),f=yo(),{addAbortSignalNoValidate:b}=tr(),{isWritable:y,isNodeStream:_}=st(),{deprecate:A}=$e(),{ArrayPrototypePush:w,Boolean:T,MathFloor:k,Number:E,NumberIsNaN:I,Promise:O,PromiseReject:H,PromiseResolve:G,PromisePrototypeThen:de,Symbol:U}=Ue(),$=U("kEmpty"),z=U("kEof");function F(V,j){if(j!=null&&u(j,"options"),j?.signal!=null&&t(j.signal,"options.signal"),_(V)&&!y(V))throw new a("stream",V,"must be writable");let W=f(this,V);return j!=null&&j.signal&&b(j.signal,W),W}function me(V,j){if(typeof V!="function")throw new l("fn",["Function","AsyncFunction"],V);j!=null&&u(j,"options"),j?.signal!=null&&t(j.signal,"options.signal");let W=1;j?.concurrency!=null&&(W=k(j.concurrency));let ue=W-1;return j?.highWaterMark!=null&&(ue=k(j.highWaterMark)),s(W,"options.concurrency",1),s(ue,"options.highWaterMark",0),ue+=W,(async function*(){let re=$e().AbortSignalAny([j?.signal].filter(T)),P=this,D=[],q={signal:re},te,ee,ie=!1,L=0;function ne(){ie=!0,ge()}function ge(){L-=1,Y()}function Y(){ee&&!ie&&L<W&&D.length<ue&&(ee(),ee=null)}async function Se(){try{for await(let h of P){if(ie)return;if(re.aborted)throw new n;try{if(h=V(h,q),h===$)continue;h=G(h)}catch(m){h=H(m)}L+=1,de(h,ge,ne),D.push(h),te&&(te(),te=null),!ie&&(D.length>=ue||L>=W)&&await new O(m=>{ee=m})}D.push(z)}catch(h){let m=H(h);de(m,ge,ne),D.push(m)}finally{ie=!0,te&&(te(),te=null)}}Se();try{for(;;){for(;D.length>0;){let h=await D[0];if(h===z)return;if(re.aborted)throw new n;h!==$&&(yield h),D.shift(),Y()}await new O(h=>{te=h})}}finally{ie=!0,ee&&(ee(),ee=null)}}).call(this)}function le(V=void 0){return V!=null&&u(V,"options"),V?.signal!=null&&t(V.signal,"options.signal"),(async function*(){let j=0;for await(let ue of this){var W;if(V!=null&&(W=V.signal)!==null&&W!==void 0&&W.aborted)throw new n({cause:V.signal.reason});yield[j++,ue]}}).call(this)}async function pe(V,j=void 0){for await(let W of x.call(this,V,j))return!0;return!1}async function we(V,j=void 0){if(typeof V!="function")throw new l("fn",["Function","AsyncFunction"],V);return!await pe.call(this,async(...W)=>!await V(...W),j)}async function Q(V,j){for await(let W of x.call(this,V,j))return W}async function he(V,j){if(typeof V!="function")throw new l("fn",["Function","AsyncFunction"],V);async function W(ue,re){return await V(ue,re),$}for await(let ue of me.call(this,W,j));}function x(V,j){if(typeof V!="function")throw new l("fn",["Function","AsyncFunction"],V);async function W(ue,re){return await V(ue,re)?ue:$}return me.call(this,W,j)}var ce=class extends r{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function ye(V,j,W){var ue;if(typeof V!="function")throw new l("reducer",["Function","AsyncFunction"],V);W!=null&&u(W,"options"),W?.signal!=null&&t(W.signal,"options.signal");let re=arguments.length>1;if(W!=null&&(ue=W.signal)!==null&&ue!==void 0&&ue.aborted){let ee=new n(void 0,{cause:W.signal.reason});throw this.once("error",()=>{}),await g(this.destroy(ee)),ee}let P=new i,D=P.signal;if(W!=null&&W.signal){let ee={once:!0,[d]:this,[p]:!0};W.signal.addEventListener("abort",()=>P.abort(),ee)}let q=!1;try{for await(let ee of this){var te;if(q=!0,W!=null&&(te=W.signal)!==null&&te!==void 0&&te.aborted)throw new n;re?j=await V(j,ee,{signal:D}):(j=ee,re=!0)}if(!q&&!re)throw new ce}finally{P.abort()}return j}async function J(V){V!=null&&u(V,"options"),V?.signal!=null&&t(V.signal,"options.signal");let j=[];for await(let ue of this){var W;if(V!=null&&(W=V.signal)!==null&&W!==void 0&&W.aborted)throw new n(void 0,{cause:V.signal.reason});w(j,ue)}return j}function _e(V,j){let W=me.call(this,V,j);return(async function*(){for await(let ue of W)yield*ue}).call(this)}function K(V){if(V=E(V),I(V))return 0;if(V<0)throw new e("number",">= 0",V);return V}function M(V,j=void 0){return j!=null&&u(j,"options"),j?.signal!=null&&t(j.signal,"options.signal"),V=K(V),(async function*(){var W;if(j!=null&&(W=j.signal)!==null&&W!==void 0&&W.aborted)throw new n;for await(let re of this){var ue;if(j!=null&&(ue=j.signal)!==null&&ue!==void 0&&ue.aborted)throw new n;V--<=0&&(yield re)}}).call(this)}function Z(V,j=void 0){return j!=null&&u(j,"options"),j?.signal!=null&&t(j.signal,"options.signal"),V=K(V),(async function*(){var W;if(j!=null&&(W=j.signal)!==null&&W!==void 0&&W.aborted)throw new n;for await(let re of this){var ue;if(j!=null&&(ue=j.signal)!==null&&ue!==void 0&&ue.aborted)throw new n;if(V-- >0&&(yield re),V<=0)return}}).call(this)}c.exports.streamReturningOperators={asIndexedPairs:A(le,"readable.asIndexedPairs will be removed in a future version."),drop:M,filter:x,flatMap:_e,map:me,take:Z,compose:F},c.exports.promiseReturningOperators={every:we,forEach:he,reduce:ye,toArray:J,some:pe,find:Q}}),wo=fe((o,c)=>{oe(),ae(),se();var{ArrayPrototypePop:i,Promise:a}=Ue(),{isIterable:l,isNodeStream:r,isWebStream:e}=st(),{pipelineImpl:n}=jn(),{finished:t}=At();vo();function s(...u){return new a((d,p)=>{let g,f,b=u[u.length-1];if(b&&typeof b=="object"&&!r(b)&&!l(b)&&!e(b)){let y=i(u);g=y.signal,f=y.end}n(u,(y,_)=>{y?p(y):d(_)},{signal:g,end:f})})}c.exports={finished:t,pipeline:s}}),vo=fe((o,c)=>{oe(),ae(),se();var{Buffer:i}=(Ve(),Be(We)),{ObjectDefineProperty:a,ObjectKeys:l,ReflectApply:r}=Ue(),{promisify:{custom:e}}=$e(),{streamReturningOperators:n,promiseReturningOperators:t}=kl(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:s}}=qe(),u=yo(),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:p}=rr(),{pipeline:g}=jn(),{destroyer:f}=Ut(),b=At(),y=wo(),_=st(),A=c.exports=Nn().Stream;A.isDestroyed=_.isDestroyed,A.isDisturbed=_.isDisturbed,A.isErrored=_.isErrored,A.isReadable=_.isReadable,A.isWritable=_.isWritable,A.Readable=nr();for(let T of l(n)){let k=function(...I){if(new.target)throw s();return A.Readable.from(r(E,this,I))},E=n[T];a(k,"name",{__proto__:null,value:E.name}),a(k,"length",{__proto__:null,value:E.length}),a(A.Readable.prototype,T,{__proto__:null,value:k,enumerable:!1,configurable:!0,writable:!0})}for(let T of l(t)){let k=function(...I){if(new.target)throw s();return r(E,this,I)},E=t[T];a(k,"name",{__proto__:null,value:E.name}),a(k,"length",{__proto__:null,value:E.length}),a(A.Readable.prototype,T,{__proto__:null,value:k,enumerable:!1,configurable:!0,writable:!0})}A.Writable=Fn(),A.Duplex=at(),A.Transform=Ao(),A.PassThrough=bo(),A.pipeline=g;var{addAbortSignal:w}=tr();A.addAbortSignal=w,A.finished=b,A.destroy=f,A.compose=u,A.setDefaultHighWaterMark=d,A.getDefaultHighWaterMark=p,a(A,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return y}}),a(g,e,{__proto__:null,enumerable:!0,get(){return y.pipeline}}),a(b,e,{__proto__:null,enumerable:!0,get(){return y.finished}}),A.Stream=A,A._isUint8Array=function(T){return T instanceof Uint8Array},A._uint8ArrayToBuffer=function(T){return i.from(T.buffer,T.byteOffset,T.byteLength)}}),St=fe((o,c)=>{oe(),ae(),se();var i=vo(),a=wo(),l=i.Readable.destroy;c.exports=i.Readable,c.exports._uint8ArrayToBuffer=i._uint8ArrayToBuffer,c.exports._isUint8Array=i._isUint8Array,c.exports.isDisturbed=i.isDisturbed,c.exports.isErrored=i.isErrored,c.exports.isReadable=i.isReadable,c.exports.Readable=i.Readable,c.exports.Writable=i.Writable,c.exports.Duplex=i.Duplex,c.exports.Transform=i.Transform,c.exports.PassThrough=i.PassThrough,c.exports.addAbortSignal=i.addAbortSignal,c.exports.finished=i.finished,c.exports.destroy=i.destroy,c.exports.destroy=l,c.exports.pipeline=i.pipeline,c.exports.compose=i.compose,Object.defineProperty(i,"promises",{configurable:!0,enumerable:!0,get(){return a}}),c.exports.Stream=i.Stream,c.exports.default=c.exports}),Il=fe((o,c)=>{oe(),ae(),se(),typeof Object.create=="function"?c.exports=function(i,a){a&&(i.super_=a,i.prototype=Object.create(a.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}))}:c.exports=function(i,a){if(a){i.super_=a;var l=function(){};l.prototype=a.prototype,i.prototype=new l,i.prototype.constructor=i}}}),Tl=fe((o,c)=>{oe(),ae(),se();var{Buffer:i}=(Ve(),Be(We)),a=Symbol.for("BufferList");function l(r){if(!(this instanceof l))return new l(r);l._init.call(this,r)}l._init=function(r){Object.defineProperty(this,a,{value:!0}),this._bufs=[],this.length=0,r&&this.append(r)},l.prototype._new=function(r){return new l(r)},l.prototype._offset=function(r){if(r===0)return[0,0];let e=0;for(let n=0;n<this._bufs.length;n++){let t=e+this._bufs[n].length;if(r<t||n===this._bufs.length-1)return[n,r-e];e=t}},l.prototype._reverseOffset=function(r){let e=r[0],n=r[1];for(let t=0;t<e;t++)n+=this._bufs[t].length;return n},l.prototype.get=function(r){if(r>this.length||r<0)return;let e=this._offset(r);return this._bufs[e[0]][e[1]]},l.prototype.slice=function(r,e){return typeof r=="number"&&r<0&&(r+=this.length),typeof e=="number"&&e<0&&(e+=this.length),this.copy(null,0,r,e)},l.prototype.copy=function(r,e,n,t){if((typeof n!="number"||n<0)&&(n=0),(typeof t!="number"||t>this.length)&&(t=this.length),n>=this.length||t<=0)return r||i.alloc(0);let s=!!r,u=this._offset(n),d=t-n,p=d,g=s&&e||0,f=u[1];if(n===0&&t===this.length){if(!s)return this._bufs.length===1?this._bufs[0]:i.concat(this._bufs,this.length);for(let b=0;b<this._bufs.length;b++)this._bufs[b].copy(r,g),g+=this._bufs[b].length;return r}if(p<=this._bufs[u[0]].length-f)return s?this._bufs[u[0]].copy(r,e,f,f+p):this._bufs[u[0]].slice(f,f+p);s||(r=i.allocUnsafe(d));for(let b=u[0];b<this._bufs.length;b++){let y=this._bufs[b].length-f;if(p>y)this._bufs[b].copy(r,g,f),g+=y;else{this._bufs[b].copy(r,g,f,f+p),g+=y;break}p-=y,f&&(f=0)}return r.length>g?r.slice(0,g):r},l.prototype.shallowSlice=function(r,e){if(r=r||0,e=typeof e!="number"?this.length:e,r<0&&(r+=this.length),e<0&&(e+=this.length),r===e)return this._new();let n=this._offset(r),t=this._offset(e),s=this._bufs.slice(n[0],t[0]+1);return t[1]===0?s.pop():s[s.length-1]=s[s.length-1].slice(0,t[1]),n[1]!==0&&(s[0]=s[0].slice(n[1])),this._new(s)},l.prototype.toString=function(r,e,n){return this.slice(e,n).toString(r)},l.prototype.consume=function(r){if(r=Math.trunc(r),Number.isNaN(r)||r<=0)return this;for(;this._bufs.length;)if(r>=this._bufs[0].length)r-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(r),this.length-=r;break}return this},l.prototype.duplicate=function(){let r=this._new();for(let e=0;e<this._bufs.length;e++)r.append(this._bufs[e]);return r},l.prototype.append=function(r){if(r==null)return this;if(r.buffer)this._appendBuffer(i.from(r.buffer,r.byteOffset,r.byteLength));else if(Array.isArray(r))for(let e=0;e<r.length;e++)this.append(r[e]);else if(this._isBufferList(r))for(let e=0;e<r._bufs.length;e++)this.append(r._bufs[e]);else typeof r=="number"&&(r=r.toString()),this._appendBuffer(i.from(r));return this},l.prototype._appendBuffer=function(r){this._bufs.push(r),this.length+=r.length},l.prototype.indexOf=function(r,e,n){if(n===void 0&&typeof e=="string"&&(n=e,e=void 0),typeof r=="function"||Array.isArray(r))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof r=="number"?r=i.from([r]):typeof r=="string"?r=i.from(r,n):this._isBufferList(r)?r=r.slice():Array.isArray(r.buffer)?r=i.from(r.buffer,r.byteOffset,r.byteLength):i.isBuffer(r)||(r=i.from(r)),e=Number(e||0),isNaN(e)&&(e=0),e<0&&(e=this.length+e),e<0&&(e=0),r.length===0)return e>this.length?this.length:e;let t=this._offset(e),s=t[0],u=t[1];for(;s<this._bufs.length;s++){let d=this._bufs[s];for(;u<d.length;)if(d.length-u>=r.length){let p=d.indexOf(r,u);if(p!==-1)return this._reverseOffset([s,p]);u=d.length-r.length+1}else{let p=this._reverseOffset([s,u]);if(this._match(p,r))return p;u++}u=0}return-1},l.prototype._match=function(r,e){if(this.length-r<e.length)return!1;for(let n=0;n<e.length;n++)if(this.get(r+n)!==e[n])return!1;return!0},function(){let r={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readBigInt64BE:8,readBigInt64LE:8,readBigUInt64BE:8,readBigUInt64LE:8,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let e in r)(function(n){r[n]===null?l.prototype[n]=function(t,s){return this.slice(t,t+s)[n](0,s)}:l.prototype[n]=function(t=0){return this.slice(t,t+r[n])[n](0)}})(e)}(),l.prototype._isBufferList=function(r){return r instanceof l||l.isBufferList(r)},l.isBufferList=function(r){return r!=null&&r[a]},c.exports=l}),Bl=fe((o,c)=>{oe(),ae(),se();var i=St().Duplex,a=Il(),l=Tl();function r(e){if(!(this instanceof r))return new r(e);if(typeof e=="function"){this._callback=e;let n=(function(t){this._callback&&(this._callback(t),this._callback=null)}).bind(this);this.on("pipe",function(t){t.on("error",n)}),this.on("unpipe",function(t){t.removeListener("error",n)}),e=null}l._init.call(this,e),i.call(this)}a(r,i),Object.assign(r.prototype,l.prototype),r.prototype._new=function(e){return new r(e)},r.prototype._write=function(e,n,t){this._appendBuffer(e),typeof t=="function"&&t()},r.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e)},r.prototype.end=function(e){i.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)},r.prototype._destroy=function(e,n){this._bufs.length=0,this.length=0,n(e)},r.prototype._isBufferList=function(e){return e instanceof r||e instanceof l||r.isBufferList(e)},r.isBufferList=l.isBufferList,c.exports=r,c.exports.BufferListStream=r,c.exports.BufferList=l}),Ol=fe((o,c)=>{oe(),ae(),se();var i=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}};c.exports=i}),_o=fe((o,c)=>{oe(),ae(),se();var i=c.exports,{Buffer:a}=(Ve(),Be(We));i.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},i.requiredHeaderFlags={1:0,2:0,4:0,5:0,6:2,7:0,8:2,9:0,10:2,11:0,12:0,13:0,14:0,15:0},i.requiredHeaderFlagsErrors={};for(let r in i.requiredHeaderFlags){let e=i.requiredHeaderFlags[r];i.requiredHeaderFlagsErrors[r]="Invalid header flag bits, must be 0x"+e.toString(16)+" for "+i.types[r]+" packet"}i.codes={};for(let r in i.types){let e=i.types[r];i.codes[e]=r}i.CMD_SHIFT=4,i.CMD_MASK=240,i.DUP_MASK=8,i.QOS_MASK=3,i.QOS_SHIFT=1,i.RETAIN_MASK=1,i.VARBYTEINT_MASK=127,i.VARBYTEINT_FIN_MASK=128,i.VARBYTEINT_MAX=268435455,i.SESSIONPRESENT_MASK=1,i.SESSIONPRESENT_HEADER=a.from([i.SESSIONPRESENT_MASK]),i.CONNACK_HEADER=a.from([i.codes.connack<<i.CMD_SHIFT]),i.USERNAME_MASK=128,i.PASSWORD_MASK=64,i.WILL_RETAIN_MASK=32,i.WILL_QOS_MASK=24,i.WILL_QOS_SHIFT=3,i.WILL_FLAG_MASK=4,i.CLEAN_SESSION_MASK=2,i.CONNECT_HEADER=a.from([i.codes.connect<<i.CMD_SHIFT]),i.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},i.propertiesCodes={};for(let r in i.properties){let e=i.properties[r];i.propertiesCodes[e]=r}i.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"};function l(r){return[0,1,2].map(e=>[0,1].map(n=>[0,1].map(t=>{let s=a.alloc(1);return s.writeUInt8(i.codes[r]<<i.CMD_SHIFT|(n?i.DUP_MASK:0)|e<<i.QOS_SHIFT|t,0,!0),s})))}i.PUBLISH_HEADER=l("publish"),i.SUBSCRIBE_HEADER=l("subscribe"),i.SUBSCRIBE_OPTIONS_QOS_MASK=3,i.SUBSCRIBE_OPTIONS_NL_MASK=1,i.SUBSCRIBE_OPTIONS_NL_SHIFT=2,i.SUBSCRIBE_OPTIONS_RAP_MASK=1,i.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,i.SUBSCRIBE_OPTIONS_RH_MASK=3,i.SUBSCRIBE_OPTIONS_RH_SHIFT=4,i.SUBSCRIBE_OPTIONS_RH=[0,16,32],i.SUBSCRIBE_OPTIONS_NL=4,i.SUBSCRIBE_OPTIONS_RAP=8,i.SUBSCRIBE_OPTIONS_QOS=[0,1,2],i.UNSUBSCRIBE_HEADER=l("unsubscribe"),i.ACKS={unsuback:l("unsuback"),puback:l("puback"),pubcomp:l("pubcomp"),pubrel:l("pubrel"),pubrec:l("pubrec")},i.SUBACK_HEADER=a.from([i.codes.suback<<i.CMD_SHIFT]),i.VERSION3=a.from([3]),i.VERSION4=a.from([4]),i.VERSION5=a.from([5]),i.VERSION131=a.from([131]),i.VERSION132=a.from([132]),i.QOS=[0,1,2].map(r=>a.from([r])),i.EMPTY={pingreq:a.from([i.codes.pingreq<<4,0]),pingresp:a.from([i.codes.pingresp<<4,0]),disconnect:a.from([i.codes.disconnect<<4,0])},i.MQTT5_PUBACK_PUBREC_CODES={0:"Success",16:"No matching subscribers",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",144:"Topic Name invalid",145:"Packet identifier in use",151:"Quota exceeded",153:"Payload format invalid"},i.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},i.MQTT5_SUBACK_CODES={0:"Granted QoS 0",1:"Granted QoS 1",2:"Granted QoS 2",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use",151:"Quota exceeded",158:"Shared Subscriptions not supported",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},i.MQTT5_UNSUBACK_CODES={0:"Success",17:"No subscription existed",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use"},i.MQTT5_DISCONNECT_CODES={0:"Normal disconnection",4:"Disconnect with Will Message",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",135:"Not authorized",137:"Server busy",139:"Server shutting down",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},i.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}}),Pl=fe((o,c)=>{oe(),ae(),se();var i=1e3,a=i*60,l=a*60,r=l*24,e=r*7,n=r*365.25;c.exports=function(p,g){g=g||{};var f=typeof p;if(f==="string"&&p.length>0)return t(p);if(f==="number"&&isFinite(p))return g.long?u(p):s(p);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))};function t(p){if(p=String(p),!(p.length>100)){var g=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(p);if(g){var f=parseFloat(g[1]),b=(g[2]||"ms").toLowerCase();switch(b){case"years":case"year":case"yrs":case"yr":case"y":return f*n;case"weeks":case"week":case"w":return f*e;case"days":case"day":case"d":return f*r;case"hours":case"hour":case"hrs":case"hr":case"h":return f*l;case"minutes":case"minute":case"mins":case"min":case"m":return f*a;case"seconds":case"second":case"secs":case"sec":case"s":return f*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function s(p){var g=Math.abs(p);return g>=r?Math.round(p/r)+"d":g>=l?Math.round(p/l)+"h":g>=a?Math.round(p/a)+"m":g>=i?Math.round(p/i)+"s":p+"ms"}function u(p){var g=Math.abs(p);return g>=r?d(p,g,r,"day"):g>=l?d(p,g,l,"hour"):g>=a?d(p,g,a,"minute"):g>=i?d(p,g,i,"second"):p+" ms"}function d(p,g,f,b){var y=g>=f*1.5;return Math.round(p/f)+" "+b+(y?"s":"")}}),xl=fe((o,c)=>{oe(),ae(),se();function i(a){r.debug=r,r.default=r,r.coerce=d,r.disable=s,r.enable=n,r.enabled=u,r.humanize=Pl(),r.destroy=p,Object.keys(a).forEach(g=>{r[g]=a[g]}),r.names=[],r.skips=[],r.formatters={};function l(g){let f=0;for(let b=0;b<g.length;b++)f=(f<<5)-f+g.charCodeAt(b),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=l;function r(g){let f,b=null,y,_;function A(...w){if(!A.enabled)return;let T=A,k=Number(new Date),E=k-(f||k);T.diff=E,T.prev=f,T.curr=k,f=k,w[0]=r.coerce(w[0]),typeof w[0]!="string"&&w.unshift("%O");let I=0;w[0]=w[0].replace(/%([a-zA-Z%])/g,(O,H)=>{if(O==="%%")return"%";I++;let G=r.formatters[H];if(typeof G=="function"){let de=w[I];O=G.call(T,de),w.splice(I,1),I--}return O}),r.formatArgs.call(T,w),(T.log||r.log).apply(T,w)}return A.namespace=g,A.useColors=r.useColors(),A.color=r.selectColor(g),A.extend=e,A.destroy=r.destroy,Object.defineProperty(A,"enabled",{enumerable:!0,configurable:!1,get:()=>b!==null?b:(y!==r.namespaces&&(y=r.namespaces,_=r.enabled(g)),_),set:w=>{b=w}}),typeof r.init=="function"&&r.init(A),A}function e(g,f){let b=r(this.namespace+(typeof f>"u"?":":f)+g);return b.log=this.log,b}function n(g){r.save(g),r.namespaces=g,r.names=[],r.skips=[];let f=(typeof g=="string"?g:"").trim().replace(" ",",").split(",").filter(Boolean);for(let b of f)b[0]==="-"?r.skips.push(b.slice(1)):r.names.push(b)}function t(g,f){let b=0,y=0,_=-1,A=0;for(;b<g.length;)if(y<f.length&&(f[y]===g[b]||f[y]==="*"))f[y]==="*"?(_=y,A=b,y++):(b++,y++);else if(_!==-1)y=_+1,A++,b=A;else return!1;for(;y<f.length&&f[y]==="*";)y++;return y===f.length}function s(){let g=[...r.names,...r.skips.map(f=>"-"+f)].join(",");return r.enable(""),g}function u(g){for(let f of r.skips)if(t(g,f))return!1;for(let f of r.names)if(t(g,f))return!0;return!1}function d(g){return g instanceof Error?g.stack||g.message:g}function p(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}c.exports=i}),lt=fe((o,c)=>{oe(),ae(),se(),o.formatArgs=a,o.save=l,o.load=r,o.useColors=i,o.storage=e(),o.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),o.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function i(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+c.exports.humanize(this.diff),!this.useColors)return;let s="color: "+this.color;t.splice(1,0,s,"color: inherit");let u=0,d=0;t[0].replace(/%[a-zA-Z%]/g,p=>{p!=="%%"&&(u++,p==="%c"&&(d=u))}),t.splice(d,0,s)}o.log=console.debug||console.log||(()=>{});function l(t){try{t?o.storage.setItem("debug",t):o.storage.removeItem("debug")}catch{}}function r(){let t;try{t=o.storage.getItem("debug")}catch{}return!t&&typeof ke<"u"&&"env"in ke&&(t=ke.env.DEBUG),t}function e(){try{return localStorage}catch{}}c.exports=xl()(o);var{formatters:n}=c.exports;n.j=function(t){try{return JSON.stringify(t)}catch(s){return"[UnexpectedJSONParseError]: "+s.message}}}),Rl=fe((o,c)=>{oe(),ae(),se();var i=Bl(),{EventEmitter:a}=(_t(),Be(mt)),l=Ol(),r=_o(),e=lt()("mqtt-packet:parser"),n=class ci extends a{constructor(){super(),this.parser=this.constructor.parser}static parser(s){return this instanceof ci?(this.settings=s||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new ci().parser(s)}_resetState(){e("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new l,this.error=null,this._list=i(),this._stateCounter=0}parse(s){for(this.error&&this._resetState(),this._list.append(s),e("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,e("parse: state complete. _stateCounter is now: %d",this._stateCounter),e("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return e("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let s=this._list.readUInt8(0),u=s>>r.CMD_SHIFT;this.packet.cmd=r.types[u];let d=s&15,p=r.requiredHeaderFlags[u];return p!=null&&d!==p?this._emitError(new Error(r.requiredHeaderFlagsErrors[u])):(this.packet.retain=(s&r.RETAIN_MASK)!==0,this.packet.qos=s>>r.QOS_SHIFT&r.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(s&r.DUP_MASK)!==0,e("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){let s=this._parseVarByteNum(!0);return s&&(this.packet.length=s.value,this._list.consume(s.bytes)),e("_parseLength %d",s.value),!!s}_parsePayload(){e("_parsePayload: payload %O",this._list);let s=!1;if(this.packet.length===0||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}s=!0}return e("_parsePayload complete result: %s",s),s}_parseConnect(){e("_parseConnect");let s,u,d,p,g={},f=this.packet,b=this._parseString();if(b===null)return this._emitError(new Error("Cannot parse protocolId"));if(b!=="MQTT"&&b!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(f.protocolId=b,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(f.protocolVersion=this._list.readUInt8(this._pos),f.protocolVersion>=128&&(f.bridgeMode=!0,f.protocolVersion=f.protocolVersion-128),f.protocolVersion!==3&&f.protocolVersion!==4&&f.protocolVersion!==5)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(this._list.readUInt8(this._pos)&1)return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));g.username=this._list.readUInt8(this._pos)&r.USERNAME_MASK,g.password=this._list.readUInt8(this._pos)&r.PASSWORD_MASK,g.will=this._list.readUInt8(this._pos)&r.WILL_FLAG_MASK;let y=!!(this._list.readUInt8(this._pos)&r.WILL_RETAIN_MASK),_=(this._list.readUInt8(this._pos)&r.WILL_QOS_MASK)>>r.WILL_QOS_SHIFT;if(g.will)f.will={},f.will.retain=y,f.will.qos=_;else{if(y)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(_)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(f.clean=(this._list.readUInt8(this._pos)&r.CLEAN_SESSION_MASK)!==0,this._pos++,f.keepalive=this._parseNum(),f.keepalive===-1)return this._emitError(new Error("Packet too short"));if(f.protocolVersion===5){let w=this._parseProperties();Object.getOwnPropertyNames(w).length&&(f.properties=w)}let A=this._parseString();if(A===null)return this._emitError(new Error("Packet too short"));if(f.clientId=A,e("_parseConnect: packet.clientId: %s",f.clientId),g.will){if(f.protocolVersion===5){let w=this._parseProperties();Object.getOwnPropertyNames(w).length&&(f.will.properties=w)}if(s=this._parseString(),s===null)return this._emitError(new Error("Cannot parse will topic"));if(f.will.topic=s,e("_parseConnect: packet.will.topic: %s",f.will.topic),u=this._parseBuffer(),u===null)return this._emitError(new Error("Cannot parse will payload"));f.will.payload=u,e("_parseConnect: packet.will.paylaod: %s",f.will.payload)}if(g.username){if(p=this._parseString(),p===null)return this._emitError(new Error("Cannot parse username"));f.username=p,e("_parseConnect: packet.username: %s",f.username)}if(g.password){if(d=this._parseBuffer(),d===null)return this._emitError(new Error("Cannot parse password"));f.password=d}return this.settings=f,e("_parseConnect: complete"),f}_parseConnack(){e("_parseConnack");let s=this.packet;if(this._list.length<1)return null;let u=this._list.readUInt8(this._pos++);if(u>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(s.sessionPresent=!!(u&r.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?s.reasonCode=this._list.readUInt8(this._pos++):s.reasonCode=0;else{if(this._list.length<2)return null;s.returnCode=this._list.readUInt8(this._pos++)}if(s.returnCode===-1||s.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){let d=this._parseProperties();Object.getOwnPropertyNames(d).length&&(s.properties=d)}e("_parseConnack: complete")}_parsePublish(){e("_parsePublish");let s=this.packet;if(s.topic=this._parseString(),s.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(s.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(s.properties=u)}s.payload=this._list.slice(this._pos,s.length),e("_parsePublish: payload from buffer list: %o",s.payload)}}_parseSubscribe(){e("_parseSubscribe");let s=this.packet,u,d,p,g,f,b,y;if(s.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let _=this._parseProperties();Object.getOwnPropertyNames(_).length&&(s.properties=_)}if(s.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<s.length;){if(u=this._parseString(),u===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=s.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(d=this._parseByte(),this.settings.protocolVersion===5){if(d&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(d&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(p=d&r.SUBSCRIBE_OPTIONS_QOS_MASK,p>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(b=(d>>r.SUBSCRIBE_OPTIONS_NL_SHIFT&r.SUBSCRIBE_OPTIONS_NL_MASK)!==0,f=(d>>r.SUBSCRIBE_OPTIONS_RAP_SHIFT&r.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,g=d>>r.SUBSCRIBE_OPTIONS_RH_SHIFT&r.SUBSCRIBE_OPTIONS_RH_MASK,g>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));y={topic:u,qos:p},this.settings.protocolVersion===5?(y.nl=b,y.rap=f,y.rh=g):this.settings.bridgeMode&&(y.rh=0,y.rap=!0,y.nl=!0),e("_parseSubscribe: push subscription `%s` to subscription",y),s.subscriptions.push(y)}}}_parseSuback(){e("_parseSuback");let s=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(s.properties=u)}if(s.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let u=this._list.readUInt8(this._pos++);if(this.settings.protocolVersion===5){if(!r.MQTT5_SUBACK_CODES[u])return this._emitError(new Error("Invalid suback code"))}else if(u>2&&u!==128)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(u)}}}_parseUnsubscribe(){e("_parseUnsubscribe");let s=this.packet;if(s.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(s.properties=u)}if(s.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<s.length;){let u=this._parseString();if(u===null)return this._emitError(new Error("Cannot parse topic"));e("_parseUnsubscribe: push topic `%s` to unsubscriptions",u),s.unsubscriptions.push(u)}}}_parseUnsuback(){e("_parseUnsuback");let s=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((this.settings.protocolVersion===3||this.settings.protocolVersion===4)&&s.length!==2)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(s.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(this.settings.protocolVersion===5){let u=this._parseProperties();for(Object.getOwnPropertyNames(u).length&&(s.properties=u),s.granted=[];this._pos<this.packet.length;){let d=this._list.readUInt8(this._pos++);if(!r.MQTT5_UNSUBACK_CODES[d])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(d)}}}_parseConfirmation(){e("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let s=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5){if(s.length>2){switch(s.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!r.MQTT5_PUBACK_PUBREC_CODES[s.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!r.MQTT5_PUBREL_PUBCOMP_CODES[s.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}e("_parseConfirmation: packet.reasonCode `%d`",s.reasonCode)}else s.reasonCode=0;if(s.length>3){let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(s.properties=u)}}return!0}_parseDisconnect(){let s=this.packet;if(e("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(s.reasonCode=this._parseByte(),r.MQTT5_DISCONNECT_CODES[s.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):s.reasonCode=0;let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(s.properties=u)}return e("_parseDisconnect result: true"),!0}_parseAuth(){e("_parseAuth");let s=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(s.reasonCode=this._parseByte(),!r.MQTT5_AUTH_CODES[s.reasonCode])return this._emitError(new Error("Invalid auth reason code"));let u=this._parseProperties();return Object.getOwnPropertyNames(u).length&&(s.properties=u),e("_parseAuth: result: true"),!0}_parseMessageId(){let s=this.packet;return s.messageId=this._parseNum(),s.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(e("_parseMessageId: packet.messageId %d",s.messageId),!0)}_parseString(s){let u=this._parseNum(),d=u+this._pos;if(u===-1||d>this._list.length||d>this.packet.length)return null;let p=this._list.toString("utf8",this._pos,d);return this._pos+=u,e("_parseString: result: %s",p),p}_parseStringPair(){return e("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let s=this._parseNum(),u=s+this._pos;if(s===-1||u>this._list.length||u>this.packet.length)return null;let d=this._list.slice(this._pos,u);return this._pos+=s,e("_parseBuffer: result: %o",d),d}_parseNum(){if(this._list.length-this._pos<2)return-1;let s=this._list.readUInt16BE(this._pos);return this._pos+=2,e("_parseNum: result: %s",s),s}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;let s=this._list.readUInt32BE(this._pos);return this._pos+=4,e("_parse4ByteNum: result: %s",s),s}_parseVarByteNum(s){e("_parseVarByteNum");let u=4,d=0,p=1,g=0,f=!1,b,y=this._pos?this._pos:0;for(;d<u&&y+d<this._list.length;){if(b=this._list.readUInt8(y+d++),g+=p*(b&r.VARBYTEINT_MASK),p*=128,(b&r.VARBYTEINT_FIN_MASK)===0){f=!0;break}if(this._list.length<=d)break}return!f&&d===u&&this._list.length>=d&&this._emitError(new Error("Invalid variable byte integer")),y&&(this._pos+=d),f?s?f={bytes:d,value:g}:f=g:f=!1,e("_parseVarByteNum: result: %o",f),f}_parseByte(){let s;return this._pos<this._list.length&&(s=this._list.readUInt8(this._pos),this._pos++),e("_parseByte: result: %o",s),s}_parseByType(s){switch(e("_parseByType: type: %s",s),s){case"byte":return this._parseByte()!==0;case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){e("_parseProperties");let s=this._parseVarByteNum(),u=this._pos+s,d={};for(;this._pos<u;){let p=this._parseByte();if(!p)return this._emitError(new Error("Cannot parse property code type")),!1;let g=r.propertiesCodes[p];if(!g)return this._emitError(new Error("Unknown property")),!1;if(g==="userProperties"){d[g]||(d[g]=Object.create(null));let f=this._parseByType(r.propertiesTypes[g]);if(d[g][f.name])if(Array.isArray(d[g][f.name]))d[g][f.name].push(f.value);else{let b=d[g][f.name];d[g][f.name]=[b],d[g][f.name].push(f.value)}else d[g][f.name]=f.value;continue}d[g]?Array.isArray(d[g])?d[g].push(this._parseByType(r.propertiesTypes[g])):(d[g]=[d[g]],d[g].push(this._parseByType(r.propertiesTypes[g]))):d[g]=this._parseByType(r.propertiesTypes[g])}return d}_newPacket(){return e("_newPacket"),this.packet&&(this._list.consume(this.packet.length),e("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),e("_newPacket: new packet"),this.packet=new l,this._pos=0,!0}_emitError(s){e("_emitError",s),this.error=s,this.emit("error",s)}};c.exports=n}),Ml=fe((o,c)=>{oe(),ae(),se();var{Buffer:i}=(Ve(),Be(We)),a=65536,l={},r=i.isBuffer(i.from([1,2]).subarray(0,1));function e(u){let d=i.allocUnsafe(2);return d.writeUInt8(u>>8,0),d.writeUInt8(u&255,1),d}function n(){for(let u=0;u<a;u++)l[u]=e(u)}function t(u){let d=0,p=0,g=i.allocUnsafe(4);do d=u%128|0,u=u/128|0,u>0&&(d=d|128),g.writeUInt8(d,p++);while(u>0&&p<4);return u>0&&(p=0),r?g.subarray(0,p):g.slice(0,p)}function s(u){let d=i.allocUnsafe(4);return d.writeUInt32BE(u,0),d}c.exports={cache:l,generateCache:n,generateNumber:e,genBufVariableByteInt:t,generate4ByteBuffer:s}}),Ul=fe((o,c)=>{oe(),ae(),se(),typeof ke>"u"||!ke.version||ke.version.indexOf("v0.")===0||ke.version.indexOf("v1.")===0&&ke.version.indexOf("v1.8.")!==0?c.exports={nextTick:i}:c.exports=ke;function i(a,l,r,e){if(typeof a!="function")throw new TypeError('"callback" argument must be a function');var n=arguments.length,t,s;switch(n){case 0:case 1:return ke.nextTick(a);case 2:return ke.nextTick(function(){a.call(null,l)});case 3:return ke.nextTick(function(){a.call(null,l,r)});case 4:return ke.nextTick(function(){a.call(null,l,r,e)});default:for(t=new Array(n-1),s=0;s<t.length;)t[s++]=arguments[s];return ke.nextTick(function(){a.apply(null,t)})}}}),Eo=fe((o,c)=>{oe(),ae(),se();var i=_o(),{Buffer:a}=(Ve(),Be(We)),l=a.allocUnsafe(0),r=a.from([0]),e=Ml(),n=Ul().nextTick,t=lt()("mqtt-packet:writeToStream"),s=e.cache,u=e.generateNumber,d=e.generateCache,p=e.genBufVariableByteInt,g=e.generate4ByteBuffer,f=le,b=!0;function y(K,M,Z){switch(t("generate called"),M.cork&&(M.cork(),n(_,M)),b&&(b=!1,d()),t("generate: packet.cmd: %s",K.cmd),K.cmd){case"connect":return A(K,M);case"connack":return w(K,M,Z);case"publish":return T(K,M,Z);case"puback":case"pubrec":case"pubrel":case"pubcomp":return k(K,M,Z);case"subscribe":return E(K,M,Z);case"suback":return I(K,M,Z);case"unsubscribe":return O(K,M,Z);case"unsuback":return H(K,M,Z);case"pingreq":case"pingresp":return G(K,M);case"disconnect":return de(K,M,Z);case"auth":return U(K,M,Z);default:return M.destroy(new Error("Unknown command")),!1}}Object.defineProperty(y,"cacheNumbers",{get(){return f===le},set(K){K?((!s||Object.keys(s).length===0)&&(b=!0),f=le):(b=!1,f=pe)}});function _(K){K.uncork()}function A(K,M,Z){let V=K||{},j=V.protocolId||"MQTT",W=V.protocolVersion||4,ue=V.will,re=V.clean,P=V.keepalive||0,D=V.clientId||"",q=V.username,te=V.password,ee=V.properties;re===void 0&&(re=!0);let ie=0;if(typeof j!="string"&&!a.isBuffer(j))return M.destroy(new Error("Invalid protocolId")),!1;if(ie+=j.length+2,W!==3&&W!==4&&W!==5)return M.destroy(new Error("Invalid protocol version")),!1;if(ie+=1,(typeof D=="string"||a.isBuffer(D))&&(D||W>=4)&&(D||re))ie+=a.byteLength(D)+2;else{if(W<4)return M.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(re*1===0)return M.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof P!="number"||P<0||P>65535||P%1!==0)return M.destroy(new Error("Invalid keepalive")),!1;ie+=2,ie+=1;let L,ne;if(W===5){if(L=he(M,ee),!L)return!1;ie+=L.length}if(ue){if(typeof ue!="object")return M.destroy(new Error("Invalid will")),!1;if(!ue.topic||typeof ue.topic!="string")return M.destroy(new Error("Invalid will topic")),!1;if(ie+=a.byteLength(ue.topic)+2,ie+=2,ue.payload)if(ue.payload.length>=0)typeof ue.payload=="string"?ie+=a.byteLength(ue.payload):ie+=ue.payload.length;else return M.destroy(new Error("Invalid will payload")),!1;if(ne={},W===5){if(ne=he(M,ue.properties),!ne)return!1;ie+=ne.length}}let ge=!1;if(q!=null)if(_e(q))ge=!0,ie+=a.byteLength(q)+2;else return M.destroy(new Error("Invalid username")),!1;if(te!=null){if(!ge)return M.destroy(new Error("Username is required to use password")),!1;if(_e(te))ie+=J(te)+2;else return M.destroy(new Error("Invalid password")),!1}M.write(i.CONNECT_HEADER),z(M,ie),Q(M,j),V.bridgeMode&&(W+=128),M.write(W===131?i.VERSION131:W===132?i.VERSION132:W===4?i.VERSION4:W===5?i.VERSION5:i.VERSION3);let Y=0;return Y|=q!=null?i.USERNAME_MASK:0,Y|=te!=null?i.PASSWORD_MASK:0,Y|=ue&&ue.retain?i.WILL_RETAIN_MASK:0,Y|=ue&&ue.qos?ue.qos<<i.WILL_QOS_SHIFT:0,Y|=ue?i.WILL_FLAG_MASK:0,Y|=re?i.CLEAN_SESSION_MASK:0,M.write(a.from([Y])),f(M,P),W===5&&L.write(),Q(M,D),ue&&(W===5&&ne.write(),F(M,ue.topic),Q(M,ue.payload)),q!=null&&Q(M,q),te!=null&&Q(M,te),!0}function w(K,M,Z){let V=Z?Z.protocolVersion:4,j=K||{},W=V===5?j.reasonCode:j.returnCode,ue=j.properties,re=2;if(typeof W!="number")return M.destroy(new Error("Invalid return code")),!1;let P=null;if(V===5){if(P=he(M,ue),!P)return!1;re+=P.length}return M.write(i.CONNACK_HEADER),z(M,re),M.write(j.sessionPresent?i.SESSIONPRESENT_HEADER:r),M.write(a.from([W])),P?.write(),!0}function T(K,M,Z){t("publish: packet: %o",K);let V=Z?Z.protocolVersion:4,j=K||{},W=j.qos||0,ue=j.retain?i.RETAIN_MASK:0,re=j.topic,P=j.payload||l,D=j.messageId,q=j.properties,te=0;if(typeof re=="string")te+=a.byteLength(re)+2;else if(a.isBuffer(re))te+=re.length+2;else return M.destroy(new Error("Invalid topic")),!1;if(a.isBuffer(P)?te+=P.length:te+=a.byteLength(P),W&&typeof D!="number")return M.destroy(new Error("Invalid messageId")),!1;W&&(te+=2);let ee=null;if(V===5){if(ee=he(M,q),!ee)return!1;te+=ee.length}return M.write(i.PUBLISH_HEADER[W][j.dup?1:0][ue?1:0]),z(M,te),f(M,J(re)),M.write(re),W>0&&f(M,D),ee?.write(),t("publish: payload: %o",P),M.write(P)}function k(K,M,Z){let V=Z?Z.protocolVersion:4,j=K||{},W=j.cmd||"puback",ue=j.messageId,re=j.dup&&W==="pubrel"?i.DUP_MASK:0,P=0,D=j.reasonCode,q=j.properties,te=V===5?3:2;if(W==="pubrel"&&(P=1),typeof ue!="number")return M.destroy(new Error("Invalid messageId")),!1;let ee=null;if(V===5&&typeof q=="object"){if(ee=x(M,q,Z,te),!ee)return!1;te+=ee.length}return M.write(i.ACKS[W][P][re][0]),te===3&&(te+=D!==0?1:-1),z(M,te),f(M,ue),V===5&&te!==2&&M.write(a.from([D])),ee!==null?ee.write():te===4&&M.write(a.from([0])),!0}function E(K,M,Z){t("subscribe: packet: ");let V=Z?Z.protocolVersion:4,j=K||{},W=j.dup?i.DUP_MASK:0,ue=j.messageId,re=j.subscriptions,P=j.properties,D=0;if(typeof ue!="number")return M.destroy(new Error("Invalid messageId")),!1;D+=2;let q=null;if(V===5){if(q=he(M,P),!q)return!1;D+=q.length}if(typeof re=="object"&&re.length)for(let ee=0;ee<re.length;ee+=1){let ie=re[ee].topic,L=re[ee].qos;if(typeof ie!="string")return M.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof L!="number")return M.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(V===5){if(typeof(re[ee].nl||!1)!="boolean")return M.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(re[ee].rap||!1)!="boolean")return M.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let ne=re[ee].rh||0;if(typeof ne!="number"||ne>2)return M.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}D+=a.byteLength(ie)+2+1}else return M.destroy(new Error("Invalid subscriptions")),!1;t("subscribe: writing to stream: %o",i.SUBSCRIBE_HEADER),M.write(i.SUBSCRIBE_HEADER[1][W?1:0][0]),z(M,D),f(M,ue),q!==null&&q.write();let te=!0;for(let ee of re){let ie=ee.topic,L=ee.qos,ne=+ee.nl,ge=+ee.rap,Y=ee.rh,Se;F(M,ie),Se=i.SUBSCRIBE_OPTIONS_QOS[L],V===5&&(Se|=ne?i.SUBSCRIBE_OPTIONS_NL:0,Se|=ge?i.SUBSCRIBE_OPTIONS_RAP:0,Se|=Y?i.SUBSCRIBE_OPTIONS_RH[Y]:0),te=M.write(a.from([Se]))}return te}function I(K,M,Z){let V=Z?Z.protocolVersion:4,j=K||{},W=j.messageId,ue=j.granted,re=j.properties,P=0;if(typeof W!="number")return M.destroy(new Error("Invalid messageId")),!1;if(P+=2,typeof ue=="object"&&ue.length)for(let q=0;q<ue.length;q+=1){if(typeof ue[q]!="number")return M.destroy(new Error("Invalid qos vector")),!1;P+=1}else return M.destroy(new Error("Invalid qos vector")),!1;let D=null;if(V===5){if(D=x(M,re,Z,P),!D)return!1;P+=D.length}return M.write(i.SUBACK_HEADER),z(M,P),f(M,W),D!==null&&D.write(),M.write(a.from(ue))}function O(K,M,Z){let V=Z?Z.protocolVersion:4,j=K||{},W=j.messageId,ue=j.dup?i.DUP_MASK:0,re=j.unsubscriptions,P=j.properties,D=0;if(typeof W!="number")return M.destroy(new Error("Invalid messageId")),!1;if(D+=2,typeof re=="object"&&re.length)for(let ee=0;ee<re.length;ee+=1){if(typeof re[ee]!="string")return M.destroy(new Error("Invalid unsubscriptions")),!1;D+=a.byteLength(re[ee])+2}else return M.destroy(new Error("Invalid unsubscriptions")),!1;let q=null;if(V===5){if(q=he(M,P),!q)return!1;D+=q.length}M.write(i.UNSUBSCRIBE_HEADER[1][ue?1:0][0]),z(M,D),f(M,W),q!==null&&q.write();let te=!0;for(let ee=0;ee<re.length;ee++)te=F(M,re[ee]);return te}function H(K,M,Z){let V=Z?Z.protocolVersion:4,j=K||{},W=j.messageId,ue=j.dup?i.DUP_MASK:0,re=j.granted,P=j.properties,D=j.cmd,q=0,te=2;if(typeof W!="number")return M.destroy(new Error("Invalid messageId")),!1;if(V===5)if(typeof re=="object"&&re.length)for(let ie=0;ie<re.length;ie+=1){if(typeof re[ie]!="number")return M.destroy(new Error("Invalid qos vector")),!1;te+=1}else return M.destroy(new Error("Invalid qos vector")),!1;let ee=null;if(V===5){if(ee=x(M,P,Z,te),!ee)return!1;te+=ee.length}return M.write(i.ACKS[D][q][ue][0]),z(M,te),f(M,W),ee!==null&&ee.write(),V===5&&M.write(a.from(re)),!0}function G(K,M,Z){return M.write(i.EMPTY[K.cmd])}function de(K,M,Z){let V=Z?Z.protocolVersion:4,j=K||{},W=j.reasonCode,ue=j.properties,re=V===5?1:0,P=null;if(V===5){if(P=x(M,ue,Z,re),!P)return!1;re+=P.length}return M.write(a.from([i.codes.disconnect<<4])),z(M,re),V===5&&M.write(a.from([W])),P!==null&&P.write(),!0}function U(K,M,Z){let V=Z?Z.protocolVersion:4,j=K||{},W=j.reasonCode,ue=j.properties,re=V===5?1:0;V!==5&&M.destroy(new Error("Invalid mqtt version for auth packet"));let P=x(M,ue,Z,re);return P?(re+=P.length,M.write(a.from([i.codes.auth<<4])),z(M,re),M.write(a.from([W])),P!==null&&P.write(),!0):!1}var $={};function z(K,M){if(M>i.VARBYTEINT_MAX)return K.destroy(new Error(`Invalid variable byte integer: ${M}`)),!1;let Z=$[M];return Z||(Z=p(M),M<16384&&($[M]=Z)),t("writeVarByteInt: writing to stream: %o",Z),K.write(Z)}function F(K,M){let Z=a.byteLength(M);return f(K,Z),t("writeString: %s",M),K.write(M,"utf8")}function me(K,M,Z){F(K,M),F(K,Z)}function le(K,M){return t("writeNumberCached: number: %d",M),t("writeNumberCached: %o",s[M]),K.write(s[M])}function pe(K,M){let Z=u(M);return t("writeNumberGenerated: %o",Z),K.write(Z)}function we(K,M){let Z=g(M);return t("write4ByteNumber: %o",Z),K.write(Z)}function Q(K,M){typeof M=="string"?F(K,M):M?(f(K,M.length),K.write(M)):f(K,0)}function he(K,M){if(typeof M!="object"||M.length!=null)return{length:1,write(){ye(K,{},0)}};let Z=0;function V(j,W){let ue=i.propertiesTypes[j],re=0;switch(ue){case"byte":{if(typeof W!="boolean")return K.destroy(new Error(`Invalid ${j}: ${W}`)),!1;re+=2;break}case"int8":{if(typeof W!="number"||W<0||W>255)return K.destroy(new Error(`Invalid ${j}: ${W}`)),!1;re+=2;break}case"binary":{if(W&&W===null)return K.destroy(new Error(`Invalid ${j}: ${W}`)),!1;re+=1+a.byteLength(W)+2;break}case"int16":{if(typeof W!="number"||W<0||W>65535)return K.destroy(new Error(`Invalid ${j}: ${W}`)),!1;re+=3;break}case"int32":{if(typeof W!="number"||W<0||W>4294967295)return K.destroy(new Error(`Invalid ${j}: ${W}`)),!1;re+=5;break}case"var":{if(typeof W!="number"||W<0||W>268435455)return K.destroy(new Error(`Invalid ${j}: ${W}`)),!1;re+=1+a.byteLength(p(W));break}case"string":{if(typeof W!="string")return K.destroy(new Error(`Invalid ${j}: ${W}`)),!1;re+=3+a.byteLength(W.toString());break}case"pair":{if(typeof W!="object")return K.destroy(new Error(`Invalid ${j}: ${W}`)),!1;re+=Object.getOwnPropertyNames(W).reduce((P,D)=>{let q=W[D];return Array.isArray(q)?P+=q.reduce((te,ee)=>(te+=3+a.byteLength(D.toString())+2+a.byteLength(ee.toString()),te),0):P+=3+a.byteLength(D.toString())+2+a.byteLength(W[D].toString()),P},0);break}default:return K.destroy(new Error(`Invalid property ${j}: ${W}`)),!1}return re}if(M)for(let j in M){let W=0,ue=0,re=M[j];if(re!==void 0){if(Array.isArray(re))for(let P=0;P<re.length;P++){if(ue=V(j,re[P]),!ue)return!1;W+=ue}else{if(ue=V(j,re),!ue)return!1;W=ue}if(!W)return!1;Z+=W}}return{length:a.byteLength(p(Z))+Z,write(){ye(K,M,Z)}}}function x(K,M,Z,V){let j=["reasonString","userProperties"],W=Z&&Z.properties&&Z.properties.maximumPacketSize?Z.properties.maximumPacketSize:0,ue=he(K,M);if(W)for(;V+ue.length>W;){let re=j.shift();if(re&&M[re])delete M[re],ue=he(K,M);else return!1}return ue}function ce(K,M,Z){switch(i.propertiesTypes[M]){case"byte":{K.write(a.from([i.properties[M]])),K.write(a.from([+Z]));break}case"int8":{K.write(a.from([i.properties[M]])),K.write(a.from([Z]));break}case"binary":{K.write(a.from([i.properties[M]])),Q(K,Z);break}case"int16":{K.write(a.from([i.properties[M]])),f(K,Z);break}case"int32":{K.write(a.from([i.properties[M]])),we(K,Z);break}case"var":{K.write(a.from([i.properties[M]])),z(K,Z);break}case"string":{K.write(a.from([i.properties[M]])),F(K,Z);break}case"pair":{Object.getOwnPropertyNames(Z).forEach(V=>{let j=Z[V];Array.isArray(j)?j.forEach(W=>{K.write(a.from([i.properties[M]])),me(K,V.toString(),W.toString())}):(K.write(a.from([i.properties[M]])),me(K,V.toString(),j.toString()))});break}default:return K.destroy(new Error(`Invalid property ${M} value: ${Z}`)),!1}}function ye(K,M,Z){z(K,Z);for(let V in M)if(Object.prototype.hasOwnProperty.call(M,V)&&M[V]!=null){let j=M[V];if(Array.isArray(j))for(let W=0;W<j.length;W++)ce(K,V,j[W]);else ce(K,V,j)}}function J(K){return K?K instanceof a?K.length:a.byteLength(K):0}function _e(K){return typeof K=="string"||K instanceof a}c.exports=y}),Dl=fe((o,c)=>{oe(),ae(),se();var i=Eo(),{EventEmitter:a}=(_t(),Be(mt)),{Buffer:l}=(Ve(),Be(We));function r(n,t){let s=new e;return i(n,s,t),s.concat()}var e=class extends a{constructor(){super(),this._array=new Array(20),this._i=0}write(n){return this._array[this._i++]=n,!0}concat(){let n=0,t=new Array(this._array.length),s=this._array,u=0,d;for(d=0;d<s.length&&s[d]!==void 0;d++)typeof s[d]!="string"?t[d]=s[d].length:t[d]=l.byteLength(s[d]),n+=t[d];let p=l.allocUnsafe(n);for(d=0;d<s.length&&s[d]!==void 0;d++)typeof s[d]!="string"?(s[d].copy(p,u),u+=t[d]):(p.write(s[d],u),u+=t[d]);return p}destroy(n){n&&this.emit("error",n)}};c.exports=r}),Ll=fe(o=>{oe(),ae(),se(),o.parser=Rl().parser,o.generate=Dl(),o.writeToStream=Eo()}),So=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"__esModule",{value:!0});var c=class{constructor(){this.nextId=Math.max(1,Math.floor(Math.random()*65535))}allocate(){let i=this.nextId++;return this.nextId===65536&&(this.nextId=1),i}getLastAllocated(){return this.nextId===1?65535:this.nextId-1}register(i){return!0}deallocate(i){}clear(){}};o.default=c}),Nl=fe((o,c)=>{oe(),ae(),se(),c.exports=a;function i(r){return r instanceof Xt?Xt.from(r):new r.constructor(r.buffer.slice(),r.byteOffset,r.length)}function a(r){if(r=r||{},r.circles)return l(r);let e=new Map;if(e.set(Date,d=>new Date(d)),e.set(Map,(d,p)=>new Map(t(Array.from(d),p))),e.set(Set,(d,p)=>new Set(t(Array.from(d),p))),r.constructorHandlers)for(let d of r.constructorHandlers)e.set(d[0],d[1]);let n=null;return r.proto?u:s;function t(d,p){let g=Object.keys(d),f=new Array(g.length);for(let b=0;b<g.length;b++){let y=g[b],_=d[y];typeof _!="object"||_===null?f[y]=_:_.constructor!==Object&&(n=e.get(_.constructor))?f[y]=n(_,p):ArrayBuffer.isView(_)?f[y]=i(_):f[y]=p(_)}return f}function s(d){if(typeof d!="object"||d===null)return d;if(Array.isArray(d))return t(d,s);if(d.constructor!==Object&&(n=e.get(d.constructor)))return n(d,s);let p={};for(let g in d){if(Object.hasOwnProperty.call(d,g)===!1)continue;let f=d[g];typeof f!="object"||f===null?p[g]=f:f.constructor!==Object&&(n=e.get(f.constructor))?p[g]=n(f,s):ArrayBuffer.isView(f)?p[g]=i(f):p[g]=s(f)}return p}function u(d){if(typeof d!="object"||d===null)return d;if(Array.isArray(d))return t(d,u);if(d.constructor!==Object&&(n=e.get(d.constructor)))return n(d,u);let p={};for(let g in d){let f=d[g];typeof f!="object"||f===null?p[g]=f:f.constructor!==Object&&(n=e.get(f.constructor))?p[g]=n(f,u):ArrayBuffer.isView(f)?p[g]=i(f):p[g]=u(f)}return p}}function l(r){let e=[],n=[],t=new Map;if(t.set(Date,g=>new Date(g)),t.set(Map,(g,f)=>new Map(u(Array.from(g),f))),t.set(Set,(g,f)=>new Set(u(Array.from(g),f))),r.constructorHandlers)for(let g of r.constructorHandlers)t.set(g[0],g[1]);let s=null;return r.proto?p:d;function u(g,f){let b=Object.keys(g),y=new Array(b.length);for(let _=0;_<b.length;_++){let A=b[_],w=g[A];if(typeof w!="object"||w===null)y[A]=w;else if(w.constructor!==Object&&(s=t.get(w.constructor)))y[A]=s(w,f);else if(ArrayBuffer.isView(w))y[A]=i(w);else{let T=e.indexOf(w);T!==-1?y[A]=n[T]:y[A]=f(w)}}return y}function d(g){if(typeof g!="object"||g===null)return g;if(Array.isArray(g))return u(g,d);if(g.constructor!==Object&&(s=t.get(g.constructor)))return s(g,d);let f={};e.push(g),n.push(f);for(let b in g){if(Object.hasOwnProperty.call(g,b)===!1)continue;let y=g[b];if(typeof y!="object"||y===null)f[b]=y;else if(y.constructor!==Object&&(s=t.get(y.constructor)))f[b]=s(y,d);else if(ArrayBuffer.isView(y))f[b]=i(y);else{let _=e.indexOf(y);_!==-1?f[b]=n[_]:f[b]=d(y)}}return e.pop(),n.pop(),f}function p(g){if(typeof g!="object"||g===null)return g;if(Array.isArray(g))return u(g,p);if(g.constructor!==Object&&(s=t.get(g.constructor)))return s(g,p);let f={};e.push(g),n.push(f);for(let b in g){let y=g[b];if(typeof y!="object"||y===null)f[b]=y;else if(y.constructor!==Object&&(s=t.get(y.constructor)))f[b]=s(y,p);else if(ArrayBuffer.isView(y))f[b]=i(y);else{let _=e.indexOf(y);_!==-1?f[b]=n[_]:f[b]=p(y)}}return e.pop(),n.pop(),f}}}),Fl=fe((o,c)=>{oe(),ae(),se(),c.exports=Nl()()}),jl=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"__esModule",{value:!0}),o.validateTopic=c,o.validateTopics=i;function c(a){let l=a.split("/");for(let r=0;r<l.length;r++)if(l[r]!=="+"){if(l[r]==="#")return r===l.length-1;if(l[r].indexOf("+")!==-1||l[r].indexOf("#")!==-1)return!1}return!0}function i(a){if(a.length===0)return"empty_topic_list";for(let l=0;l<a.length;l++)if(!c(a[l]))return a[l];return null}}),Co=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"__esModule",{value:!0});var c=St(),i={objectMode:!0},a={clean:!0},l=class{constructor(r){this.options=r||{},this.options=Object.assign(Object.assign({},a),r),this._inflights=new Map}put(r,e){return this._inflights.set(r.messageId,r),e&&e(),this}createStream(){let r=new c.Readable(i),e=[],n=!1,t=0;return this._inflights.forEach((s,u)=>{e.push(s)}),r._read=()=>{!n&&t<e.length?r.push(e[t++]):r.push(null)},r.destroy=s=>{if(!n)return n=!0,setTimeout(()=>{r.emit("close")},0),r},r}del(r,e){let n=this._inflights.get(r.messageId);return n?(this._inflights.delete(r.messageId),e(null,n)):e&&e(new Error("missing packet")),this}get(r,e){let n=this._inflights.get(r.messageId);return n?e(null,n):e&&e(new Error("missing packet")),this}close(r){this.options.clean&&(this._inflights=null),r&&r()}};o.default=l}),Wl=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"__esModule",{value:!0});var c=[0,16,128,131,135,144,145,151,153],i=(a,l,r)=>{a.log("handlePublish: packet %o",l),r=typeof r<"u"?r:a.noop;let e=l.topic.toString(),n=l.payload,{qos:t}=l,{messageId:s}=l,{options:u}=a;if(a.options.protocolVersion===5){let d;if(l.properties&&(d=l.properties.topicAlias),typeof d<"u")if(e.length===0)if(d>0&&d<=65535){let p=a.topicAliasRecv.getTopicByAlias(d);if(p)e=p,a.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",e,d);else{a.log("handlePublish :: unregistered topic alias. alias: %d",d),a.emit("error",new Error("Received unregistered Topic Alias"));return}}else{a.log("handlePublish :: topic alias out of range. alias: %d",d),a.emit("error",new Error("Received Topic Alias is out of range"));return}else if(a.topicAliasRecv.put(e,d))a.log("handlePublish :: registered topic: %s - alias: %d",e,d);else{a.log("handlePublish :: topic alias out of range. alias: %d",d),a.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(a.log("handlePublish: qos %d",t),t){case 2:{u.customHandleAcks(e,n,l,(d,p)=>{if(typeof d=="number"&&(p=d,d=null),d)return a.emit("error",d);if(c.indexOf(p)===-1)return a.emit("error",new Error("Wrong reason code for pubrec"));p?a._sendPacket({cmd:"pubrec",messageId:s,reasonCode:p},r):a.incomingStore.put(l,()=>{a._sendPacket({cmd:"pubrec",messageId:s},r)})});break}case 1:{u.customHandleAcks(e,n,l,(d,p)=>{if(typeof d=="number"&&(p=d,d=null),d)return a.emit("error",d);if(c.indexOf(p)===-1)return a.emit("error",new Error("Wrong reason code for puback"));p||a.emit("message",e,n,l),a.handleMessage(l,g=>{if(g)return r&&r(g);a._sendPacket({cmd:"puback",messageId:s,reasonCode:p},r)})});break}case 0:a.emit("message",e,n,l),a.handleMessage(l,r);break;default:a.log("handlePublish: unknown QoS. Doing nothing.");break}};o.default=i}),Vl=fe((o,c)=>{c.exports={version:"5.13.1"}}),Dt=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"__esModule",{value:!0}),o.MQTTJS_VERSION=o.nextTick=o.ErrorWithSubackPacket=o.ErrorWithReasonCode=void 0,o.applyMixin=a;var c=class $s extends Error{constructor(r,e){super(r),this.code=e,Object.setPrototypeOf(this,$s.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};o.ErrorWithReasonCode=c;var i=class zs extends Error{constructor(r,e){super(r),this.packet=e,Object.setPrototypeOf(this,zs.prototype),Object.getPrototypeOf(this).name="ErrorWithSubackPacket"}};o.ErrorWithSubackPacket=i;function a(l,r,e=!1){var n;let t=[r];for(;;){let s=t[0],u=Object.getPrototypeOf(s);if(u?.prototype)t.unshift(u);else break}for(let s of t)for(let u of Object.getOwnPropertyNames(s.prototype))(e||u!=="constructor")&&Object.defineProperty(l.prototype,u,(n=Object.getOwnPropertyDescriptor(s.prototype,u))!==null&&n!==void 0?n:Object.create(null))}o.nextTick=typeof ke?.nextTick=="function"?ke.nextTick:l=>{setTimeout(l,0)},o.MQTTJS_VERSION=Vl().version}),ir=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"__esModule",{value:!0}),o.ReasonCodes=void 0;var c=Dt();o.ReasonCodes={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};var i=(a,l)=>{let{messageId:r}=l,e=l.cmd,n=null,t=a.outgoing[r]?a.outgoing[r].cb:null,s=null;if(!t){a.log("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(a.log("_handleAck :: packet type",e),e){case"pubcomp":case"puback":{let u=l.reasonCode;u&&u>0&&u!==16?(s=new c.ErrorWithReasonCode(`Publish error: ${o.ReasonCodes[u]}`,u),a._removeOutgoingAndStoreMessage(r,()=>{t(s,l)})):a._removeOutgoingAndStoreMessage(r,t);break}case"pubrec":{n={cmd:"pubrel",qos:2,messageId:r};let u=l.reasonCode;u&&u>0&&u!==16?(s=new c.ErrorWithReasonCode(`Publish error: ${o.ReasonCodes[u]}`,u),a._removeOutgoingAndStoreMessage(r,()=>{t(s,l)})):a._sendPacket(n);break}case"suback":{delete a.outgoing[r],a.messageIdProvider.deallocate(r);let u=l.granted;for(let d=0;d<u.length;d++){let p=u[d];if((p&128)!==0){s=new Error(`Subscribe error: ${o.ReasonCodes[p]}`),s.code=p;let g=a.messageIdToTopic[r];g&&g.forEach(f=>{delete a._resubscribeTopics[f]})}}delete a.messageIdToTopic[r],a._invokeStoreProcessingQueue(),t(s,l);break}case"unsuback":{delete a.outgoing[r],a.messageIdProvider.deallocate(r),a._invokeStoreProcessingQueue(),t(null,l);break}default:a.emit("error",new Error("unrecognized packet type"))}a.disconnecting&&Object.keys(a.outgoing).length===0&&a.emit("outgoingEmpty")};o.default=i}),Ql=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"__esModule",{value:!0});var c=Dt(),i=ir(),a=(l,r)=>{let{options:e}=l,n=e.protocolVersion,t=n===5?r.reasonCode:r.returnCode;if(n!==5){let s=new c.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${n}`,t);l.emit("error",s);return}l.handleAuth(r,(s,u)=>{if(s){l.emit("error",s);return}if(t===24)l.reconnecting=!1,l._sendPacket(u);else{let d=new c.ErrorWithReasonCode(`Connection refused: ${i.ReasonCodes[t]}`,t);l.emit("error",d)}})};o.default=a}),Kl=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"__esModule",{value:!0}),o.LRUCache=void 0;var c=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,i=new Set,a=typeof ke=="object"&&ke?ke:{},l=(g,f,b,y)=>{typeof a.emitWarning=="function"?a.emitWarning(g,f,b,y):console.error(`[${b}] ${f}: ${g}`)},r=globalThis.AbortController,e=globalThis.AbortSignal;if(typeof r>"u"){e=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(b,y){this._onabort.push(y)}},r=class{constructor(){f()}signal=new e;abort(b){if(!this.signal.aborted){this.signal.reason=b,this.signal.aborted=!0;for(let y of this.signal._onabort)y(b);this.signal.onabort?.(b)}}};let g=a.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",f=()=>{g&&(g=!1,l("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",f))}}var n=g=>!i.has(g),t=g=>g&&g===Math.floor(g)&&g>0&&isFinite(g),s=g=>t(g)?g<=Math.pow(2,8)?Uint8Array:g<=Math.pow(2,16)?Uint16Array:g<=Math.pow(2,32)?Uint32Array:g<=Number.MAX_SAFE_INTEGER?u:null:null,u=class extends Array{constructor(g){super(g),this.fill(0)}},d=class $t{heap;length;static#l=!1;static create(f){let b=s(f);if(!b)return[];$t.#l=!0;let y=new $t(f,b);return $t.#l=!1,y}constructor(f,b){if(!$t.#l)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new b(f),this.length=0}push(f){this.heap[this.length++]=f}pop(){return this.heap[--this.length]}},p=class Gs{#l;#h;#g;#m;#O;#P;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#A;#n;#r;#e;#u;#f;#a;#o;#b;#s;#y;#w;#d;#v;#k;#c;static unsafeExposeInternals(f){return{starts:f.#w,ttls:f.#d,sizes:f.#y,keyMap:f.#n,keyList:f.#r,valList:f.#e,next:f.#u,prev:f.#f,get head(){return f.#a},get tail(){return f.#o},free:f.#b,isBackgroundFetch:b=>f.#t(b),backgroundFetch:(b,y,_,A)=>f.#M(b,y,_,A),moveToTail:b=>f.#B(b),indexes:b=>f.#_(b),rindexes:b=>f.#E(b),isStale:b=>f.#p(b)}}get max(){return this.#l}get maxSize(){return this.#h}get calculatedSize(){return this.#A}get size(){return this.#i}get fetchMethod(){return this.#O}get memoMethod(){return this.#P}get dispose(){return this.#g}get disposeAfter(){return this.#m}constructor(f){let{max:b=0,ttl:y,ttlResolution:_=1,ttlAutopurge:A,updateAgeOnGet:w,updateAgeOnHas:T,allowStale:k,dispose:E,disposeAfter:I,noDisposeOnSet:O,noUpdateTTL:H,maxSize:G=0,maxEntrySize:de=0,sizeCalculation:U,fetchMethod:$,memoMethod:z,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:me,allowStaleOnFetchRejection:le,allowStaleOnFetchAbort:pe,ignoreFetchAbort:we}=f;if(b!==0&&!t(b))throw new TypeError("max option must be a nonnegative integer");let Q=b?s(b):Array;if(!Q)throw new Error("invalid max value: "+b);if(this.#l=b,this.#h=G,this.maxEntrySize=de||this.#h,this.sizeCalculation=U,this.sizeCalculation){if(!this.#h&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(z!==void 0&&typeof z!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#P=z,$!==void 0&&typeof $!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#O=$,this.#k=!!$,this.#n=new Map,this.#r=new Array(b).fill(void 0),this.#e=new Array(b).fill(void 0),this.#u=new Q(b),this.#f=new Q(b),this.#a=0,this.#o=0,this.#b=d.create(b),this.#i=0,this.#A=0,typeof E=="function"&&(this.#g=E),typeof I=="function"?(this.#m=I,this.#s=[]):(this.#m=void 0,this.#s=void 0),this.#v=!!this.#g,this.#c=!!this.#m,this.noDisposeOnSet=!!O,this.noUpdateTTL=!!H,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!le,this.allowStaleOnFetchAbort=!!pe,this.ignoreFetchAbort=!!we,this.maxEntrySize!==0){if(this.#h!==0&&!t(this.#h))throw new TypeError("maxSize must be a positive integer if specified");if(!t(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#W()}if(this.allowStale=!!k,this.noDeleteOnStaleGet=!!me,this.updateAgeOnGet=!!w,this.updateAgeOnHas=!!T,this.ttlResolution=t(_)||_===0?_:1,this.ttlAutopurge=!!A,this.ttl=y||0,this.ttl){if(!t(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#U()}if(this.#l===0&&this.ttl===0&&this.#h===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#l&&!this.#h){let he="LRU_CACHE_UNBOUNDED";n(he)&&(i.add(he),l("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",he,Gs))}}getRemainingTTL(f){return this.#n.has(f)?1/0:0}#U(){let f=new u(this.#l),b=new u(this.#l);this.#d=f,this.#w=b,this.#D=(A,w,T=c.now())=>{if(b[A]=w!==0?T:0,f[A]=w,w!==0&&this.ttlAutopurge){let k=setTimeout(()=>{this.#p(A)&&this.#S(this.#r[A],"expire")},w+1);k.unref&&k.unref()}},this.#I=A=>{b[A]=f[A]!==0?c.now():0},this.#C=(A,w)=>{if(f[w]){let T=f[w],k=b[w];if(!T||!k)return;A.ttl=T,A.start=k,A.now=y||_();let E=A.now-k;A.remainingTTL=T-E}};let y=0,_=()=>{let A=c.now();if(this.ttlResolution>0){y=A;let w=setTimeout(()=>y=0,this.ttlResolution);w.unref&&w.unref()}return A};this.getRemainingTTL=A=>{let w=this.#n.get(A);if(w===void 0)return 0;let T=f[w],k=b[w];if(!T||!k)return 1/0;let E=(y||_())-k;return T-E},this.#p=A=>{let w=b[A],T=f[A];return!!T&&!!w&&(y||_())-w>T}}#I=()=>{};#C=()=>{};#D=()=>{};#p=()=>!1;#W(){let f=new u(this.#l);this.#A=0,this.#y=f,this.#T=b=>{this.#A-=f[b],f[b]=0},this.#L=(b,y,_,A)=>{if(this.#t(y))return 0;if(!t(_))if(A){if(typeof A!="function")throw new TypeError("sizeCalculation must be a function");if(_=A(y,b),!t(_))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return _},this.#x=(b,y,_)=>{if(f[b]=y,this.#h){let A=this.#h-f[b];for(;this.#A>A;)this.#R(!0)}this.#A+=f[b],_&&(_.entrySize=y,_.totalCalculatedSize=this.#A)}}#T=f=>{};#x=(f,b,y)=>{};#L=(f,b,y,_)=>{if(y||_)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#_({allowStale:f=this.allowStale}={}){if(this.#i)for(let b=this.#o;!(!this.#N(b)||((f||!this.#p(b))&&(yield b),b===this.#a));)b=this.#f[b]}*#E({allowStale:f=this.allowStale}={}){if(this.#i)for(let b=this.#a;!(!this.#N(b)||((f||!this.#p(b))&&(yield b),b===this.#o));)b=this.#u[b]}#N(f){return f!==void 0&&this.#n.get(this.#r[f])===f}*entries(){for(let f of this.#_())this.#e[f]!==void 0&&this.#r[f]!==void 0&&!this.#t(this.#e[f])&&(yield[this.#r[f],this.#e[f]])}*rentries(){for(let f of this.#E())this.#e[f]!==void 0&&this.#r[f]!==void 0&&!this.#t(this.#e[f])&&(yield[this.#r[f],this.#e[f]])}*keys(){for(let f of this.#_()){let b=this.#r[f];b!==void 0&&!this.#t(this.#e[f])&&(yield b)}}*rkeys(){for(let f of this.#E()){let b=this.#r[f];b!==void 0&&!this.#t(this.#e[f])&&(yield b)}}*values(){for(let f of this.#_())this.#e[f]!==void 0&&!this.#t(this.#e[f])&&(yield this.#e[f])}*rvalues(){for(let f of this.#E())this.#e[f]!==void 0&&!this.#t(this.#e[f])&&(yield this.#e[f])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(f,b={}){for(let y of this.#_()){let _=this.#e[y],A=this.#t(_)?_.__staleWhileFetching:_;if(A!==void 0&&f(A,this.#r[y],this))return this.get(this.#r[y],b)}}forEach(f,b=this){for(let y of this.#_()){let _=this.#e[y],A=this.#t(_)?_.__staleWhileFetching:_;A!==void 0&&f.call(b,A,this.#r[y],this)}}rforEach(f,b=this){for(let y of this.#E()){let _=this.#e[y],A=this.#t(_)?_.__staleWhileFetching:_;A!==void 0&&f.call(b,A,this.#r[y],this)}}purgeStale(){let f=!1;for(let b of this.#E({allowStale:!0}))this.#p(b)&&(this.#S(this.#r[b],"expire"),f=!0);return f}info(f){let b=this.#n.get(f);if(b===void 0)return;let y=this.#e[b],_=this.#t(y)?y.__staleWhileFetching:y;if(_===void 0)return;let A={value:_};if(this.#d&&this.#w){let w=this.#d[b],T=this.#w[b];if(w&&T){let k=w-(c.now()-T);A.ttl=k,A.start=Date.now()}}return this.#y&&(A.size=this.#y[b]),A}dump(){let f=[];for(let b of this.#_({allowStale:!0})){let y=this.#r[b],_=this.#e[b],A=this.#t(_)?_.__staleWhileFetching:_;if(A===void 0||y===void 0)continue;let w={value:A};if(this.#d&&this.#w){w.ttl=this.#d[b];let T=c.now()-this.#w[b];w.start=Math.floor(Date.now()-T)}this.#y&&(w.size=this.#y[b]),f.unshift([y,w])}return f}load(f){this.clear();for(let[b,y]of f){if(y.start){let _=Date.now()-y.start;y.start=c.now()-_}this.set(b,y.value,y)}}set(f,b,y={}){if(b===void 0)return this.delete(f),this;let{ttl:_=this.ttl,start:A,noDisposeOnSet:w=this.noDisposeOnSet,sizeCalculation:T=this.sizeCalculation,status:k}=y,{noUpdateTTL:E=this.noUpdateTTL}=y,I=this.#L(f,b,y.size||0,T);if(this.maxEntrySize&&I>this.maxEntrySize)return k&&(k.set="miss",k.maxEntrySizeExceeded=!0),this.#S(f,"set"),this;let O=this.#i===0?void 0:this.#n.get(f);if(O===void 0)O=this.#i===0?this.#o:this.#b.length!==0?this.#b.pop():this.#i===this.#l?this.#R(!1):this.#i,this.#r[O]=f,this.#e[O]=b,this.#n.set(f,O),this.#u[this.#o]=O,this.#f[O]=this.#o,this.#o=O,this.#i++,this.#x(O,I,k),k&&(k.set="add"),E=!1;else{this.#B(O);let H=this.#e[O];if(b!==H){if(this.#k&&this.#t(H)){H.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:G}=H;G!==void 0&&!w&&(this.#v&&this.#g?.(G,f,"set"),this.#c&&this.#s?.push([G,f,"set"]))}else w||(this.#v&&this.#g?.(H,f,"set"),this.#c&&this.#s?.push([H,f,"set"]));if(this.#T(O),this.#x(O,I,k),this.#e[O]=b,k){k.set="replace";let G=H&&this.#t(H)?H.__staleWhileFetching:H;G!==void 0&&(k.oldValue=G)}}else k&&(k.set="update")}if(_!==0&&!this.#d&&this.#U(),this.#d&&(E||this.#D(O,_,A),k&&this.#C(k,O)),!w&&this.#c&&this.#s){let H=this.#s,G;for(;G=H?.shift();)this.#m?.(...G)}return this}pop(){try{for(;this.#i;){let f=this.#e[this.#a];if(this.#R(!0),this.#t(f)){if(f.__staleWhileFetching)return f.__staleWhileFetching}else if(f!==void 0)return f}}finally{if(this.#c&&this.#s){let f=this.#s,b;for(;b=f?.shift();)this.#m?.(...b)}}}#R(f){let b=this.#a,y=this.#r[b],_=this.#e[b];return this.#k&&this.#t(_)?_.__abortController.abort(new Error("evicted")):(this.#v||this.#c)&&(this.#v&&this.#g?.(_,y,"evict"),this.#c&&this.#s?.push([_,y,"evict"])),this.#T(b),f&&(this.#r[b]=void 0,this.#e[b]=void 0,this.#b.push(b)),this.#i===1?(this.#a=this.#o=0,this.#b.length=0):this.#a=this.#u[b],this.#n.delete(y),this.#i--,b}has(f,b={}){let{updateAgeOnHas:y=this.updateAgeOnHas,status:_}=b,A=this.#n.get(f);if(A!==void 0){let w=this.#e[A];if(this.#t(w)&&w.__staleWhileFetching===void 0)return!1;if(this.#p(A))_&&(_.has="stale",this.#C(_,A));else return y&&this.#I(A),_&&(_.has="hit",this.#C(_,A)),!0}else _&&(_.has="miss");return!1}peek(f,b={}){let{allowStale:y=this.allowStale}=b,_=this.#n.get(f);if(_===void 0||!y&&this.#p(_))return;let A=this.#e[_];return this.#t(A)?A.__staleWhileFetching:A}#M(f,b,y,_){let A=b===void 0?void 0:this.#e[b];if(this.#t(A))return A;let w=new r,{signal:T}=y;T?.addEventListener("abort",()=>w.abort(T.reason),{signal:w.signal});let k={signal:w.signal,options:y,context:_},E=(U,$=!1)=>{let{aborted:z}=w.signal,F=y.ignoreFetchAbort&&U!==void 0;if(y.status&&(z&&!$?(y.status.fetchAborted=!0,y.status.fetchError=w.signal.reason,F&&(y.status.fetchAbortIgnored=!0)):y.status.fetchResolved=!0),z&&!F&&!$)return O(w.signal.reason);let me=G;return this.#e[b]===G&&(U===void 0?me.__staleWhileFetching?this.#e[b]=me.__staleWhileFetching:this.#S(f,"fetch"):(y.status&&(y.status.fetchUpdated=!0),this.set(f,U,k.options))),U},I=U=>(y.status&&(y.status.fetchRejected=!0,y.status.fetchError=U),O(U)),O=U=>{let{aborted:$}=w.signal,z=$&&y.allowStaleOnFetchAbort,F=z||y.allowStaleOnFetchRejection,me=F||y.noDeleteOnFetchRejection,le=G;if(this.#e[b]===G&&(!me||le.__staleWhileFetching===void 0?this.#S(f,"fetch"):z||(this.#e[b]=le.__staleWhileFetching)),F)return y.status&&le.__staleWhileFetching!==void 0&&(y.status.returnedStale=!0),le.__staleWhileFetching;if(le.__returned===le)throw U},H=(U,$)=>{let z=this.#O?.(f,A,k);z&&z instanceof Promise&&z.then(F=>U(F===void 0?void 0:F),$),w.signal.addEventListener("abort",()=>{(!y.ignoreFetchAbort||y.allowStaleOnFetchAbort)&&(U(void 0),y.allowStaleOnFetchAbort&&(U=F=>E(F,!0)))})};y.status&&(y.status.fetchDispatched=!0);let G=new Promise(H).then(E,I),de=Object.assign(G,{__abortController:w,__staleWhileFetching:A,__returned:void 0});return b===void 0?(this.set(f,de,{...k.options,status:void 0}),b=this.#n.get(f)):this.#e[b]=de,de}#t(f){if(!this.#k)return!1;let b=f;return!!b&&b instanceof Promise&&b.hasOwnProperty("__staleWhileFetching")&&b.__abortController instanceof r}async fetch(f,b={}){let{allowStale:y=this.allowStale,updateAgeOnGet:_=this.updateAgeOnGet,noDeleteOnStaleGet:A=this.noDeleteOnStaleGet,ttl:w=this.ttl,noDisposeOnSet:T=this.noDisposeOnSet,size:k=0,sizeCalculation:E=this.sizeCalculation,noUpdateTTL:I=this.noUpdateTTL,noDeleteOnFetchRejection:O=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:H=this.allowStaleOnFetchRejection,ignoreFetchAbort:G=this.ignoreFetchAbort,allowStaleOnFetchAbort:de=this.allowStaleOnFetchAbort,context:U,forceRefresh:$=!1,status:z,signal:F}=b;if(!this.#k)return z&&(z.fetch="get"),this.get(f,{allowStale:y,updateAgeOnGet:_,noDeleteOnStaleGet:A,status:z});let me={allowStale:y,updateAgeOnGet:_,noDeleteOnStaleGet:A,ttl:w,noDisposeOnSet:T,size:k,sizeCalculation:E,noUpdateTTL:I,noDeleteOnFetchRejection:O,allowStaleOnFetchRejection:H,allowStaleOnFetchAbort:de,ignoreFetchAbort:G,status:z,signal:F},le=this.#n.get(f);if(le===void 0){z&&(z.fetch="miss");let pe=this.#M(f,le,me,U);return pe.__returned=pe}else{let pe=this.#e[le];if(this.#t(pe)){let x=y&&pe.__staleWhileFetching!==void 0;return z&&(z.fetch="inflight",x&&(z.returnedStale=!0)),x?pe.__staleWhileFetching:pe.__returned=pe}let we=this.#p(le);if(!$&&!we)return z&&(z.fetch="hit"),this.#B(le),_&&this.#I(le),z&&this.#C(z,le),pe;let Q=this.#M(f,le,me,U),he=Q.__staleWhileFetching!==void 0&&y;return z&&(z.fetch=we?"stale":"refresh",he&&we&&(z.returnedStale=!0)),he?Q.__staleWhileFetching:Q.__returned=Q}}async forceFetch(f,b={}){let y=await this.fetch(f,b);if(y===void 0)throw new Error("fetch() returned undefined");return y}memo(f,b={}){let y=this.#P;if(!y)throw new Error("no memoMethod provided to constructor");let{context:_,forceRefresh:A,...w}=b,T=this.get(f,w);if(!A&&T!==void 0)return T;let k=y(f,T,{options:w,context:_});return this.set(f,k,w),k}get(f,b={}){let{allowStale:y=this.allowStale,updateAgeOnGet:_=this.updateAgeOnGet,noDeleteOnStaleGet:A=this.noDeleteOnStaleGet,status:w}=b,T=this.#n.get(f);if(T!==void 0){let k=this.#e[T],E=this.#t(k);return w&&this.#C(w,T),this.#p(T)?(w&&(w.get="stale"),E?(w&&y&&k.__staleWhileFetching!==void 0&&(w.returnedStale=!0),y?k.__staleWhileFetching:void 0):(A||this.#S(f,"expire"),w&&y&&(w.returnedStale=!0),y?k:void 0)):(w&&(w.get="hit"),E?k.__staleWhileFetching:(this.#B(T),_&&this.#I(T),k))}else w&&(w.get="miss")}#F(f,b){this.#f[b]=f,this.#u[f]=b}#B(f){f!==this.#o&&(f===this.#a?this.#a=this.#u[f]:this.#F(this.#f[f],this.#u[f]),this.#F(this.#o,f),this.#o=f)}delete(f){return this.#S(f,"delete")}#S(f,b){let y=!1;if(this.#i!==0){let _=this.#n.get(f);if(_!==void 0)if(y=!0,this.#i===1)this.#j(b);else{this.#T(_);let A=this.#e[_];if(this.#t(A)?A.__abortController.abort(new Error("deleted")):(this.#v||this.#c)&&(this.#v&&this.#g?.(A,f,b),this.#c&&this.#s?.push([A,f,b])),this.#n.delete(f),this.#r[_]=void 0,this.#e[_]=void 0,_===this.#o)this.#o=this.#f[_];else if(_===this.#a)this.#a=this.#u[_];else{let w=this.#f[_];this.#u[w]=this.#u[_];let T=this.#u[_];this.#f[T]=this.#f[_]}this.#i--,this.#b.push(_)}}if(this.#c&&this.#s?.length){let _=this.#s,A;for(;A=_?.shift();)this.#m?.(...A)}return y}clear(){return this.#j("delete")}#j(f){for(let b of this.#E({allowStale:!0})){let y=this.#e[b];if(this.#t(y))y.__abortController.abort(new Error("deleted"));else{let _=this.#r[b];this.#v&&this.#g?.(y,_,f),this.#c&&this.#s?.push([y,_,f])}}if(this.#n.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#d&&this.#w&&(this.#d.fill(0),this.#w.fill(0)),this.#y&&this.#y.fill(0),this.#a=0,this.#o=0,this.#b.length=0,this.#A=0,this.#i=0,this.#c&&this.#s){let b=this.#s,y;for(;y=b?.shift();)this.#m?.(...y)}}};o.LRUCache=p}),ut=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"t",{value:!0}),o.ContainerIterator=o.Container=o.Base=void 0;var c=class{constructor(l=0){this.iteratorType=l}equals(l){return this.o===l.o}};o.ContainerIterator=c;var i=class{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return this.i===0}};o.Base=i;var a=class extends i{};o.Container=a}),Hl=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var c=ut(),i=class extends c.Base{constructor(l=[]){super(),this.S=[];let r=this;l.forEach(function(e){r.push(e)})}clear(){this.i=0,this.S=[]}push(l){return this.S.push(l),this.i+=1,this.i}pop(){if(this.i!==0)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}},a=i;o.default=a}),ql=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var c=ut(),i=class extends c.Base{constructor(l=[]){super(),this.j=0,this.q=[];let r=this;l.forEach(function(e){r.push(e)})}clear(){this.q=[],this.i=this.j=0}push(l){let r=this.q.length;if(this.j/r>.5&&this.j+this.i>=r&&r>4096){let e=this.i;for(let n=0;n<e;++n)this.q[n]=this.q[this.j+n];this.j=0,this.q[this.i]=l}else this.q[this.j+this.i]=l;return++this.i}pop(){if(this.i===0)return;let l=this.q[this.j++];return this.i-=1,l}front(){if(this.i!==0)return this.q[this.j]}},a=i;o.default=a}),$l=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var c=ut(),i=class extends c.Base{constructor(l=[],r=function(n,t){return n>t?-1:n<t?1:0},e=!0){if(super(),this.v=r,Array.isArray(l))this.C=e?[...l]:l;else{this.C=[];let t=this;l.forEach(function(s){t.C.push(s)})}this.i=this.C.length;let n=this.i>>1;for(let t=this.i-1>>1;t>=0;--t)this.k(t,n)}m(l){let r=this.C[l];for(;l>0;){let e=l-1>>1,n=this.C[e];if(this.v(n,r)<=0)break;this.C[l]=n,l=e}this.C[l]=r}k(l,r){let e=this.C[l];for(;l<r;){let n=l<<1|1,t=n+1,s=this.C[n];if(t<this.i&&this.v(s,this.C[t])>0&&(n=t,s=this.C[t]),this.v(s,e)>=0)break;this.C[l]=s,l=n}this.C[l]=e}clear(){this.i=0,this.C.length=0}push(l){this.C.push(l),this.m(this.i),this.i+=1}pop(){if(this.i===0)return;let l=this.C[0],r=this.C.pop();return this.i-=1,this.i&&(this.C[0]=r,this.k(0,this.i>>1)),l}top(){return this.C[0]}find(l){return this.C.indexOf(l)>=0}remove(l){let r=this.C.indexOf(l);return r<0?!1:(r===0?this.pop():r===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(r,1,this.C.pop()),this.i-=1,this.m(r),this.k(r,this.i>>1)),!0)}updateItem(l){let r=this.C.indexOf(l);return r<0?!1:(this.m(r),this.k(r,this.i>>1),!0)}toArray(){return[...this.C]}},a=i;o.default=a}),Wn=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var c=ut(),i=class extends c.Container{},a=i;o.default=a}),ct=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"t",{value:!0}),o.throwIteratorAccessError=c;function c(){throw new RangeError("Iterator access denied!")}}),ko=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"t",{value:!0}),o.RandomIterator=void 0;var c=ut(),i=ct(),a=class extends c.ContainerIterator{constructor(l,r){super(r),this.o=l,this.iteratorType===0?(this.pre=function(){return this.o===0&&(0,i.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,i.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,i.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return this.o===-1&&(0,i.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(l){this.container.setElementByPos(this.o,l)}};o.RandomIterator=a}),zl=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var c=a(Wn()),i=ko();function a(n){return n&&n.t?n:{default:n}}var l=class Ys extends i.RandomIterator{constructor(t,s,u){super(t,u),this.container=s}copy(){return new Ys(this.o,this.container,this.iteratorType)}},r=class extends c.default{constructor(n=[],t=!0){if(super(),Array.isArray(n))this.J=t?[...n]:n,this.i=n.length;else{this.J=[];let s=this;n.forEach(function(u){s.pushBack(u)})}}clear(){this.i=0,this.J.length=0}begin(){return new l(0,this)}end(){return new l(this.i,this)}rBegin(){return new l(this.i-1,this,1)}rEnd(){return new l(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;return this.J[n]}eraseElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;return this.J.splice(n,1),this.i-=1,this.i}eraseElementByValue(n){let t=0;for(let s=0;s<this.i;++s)this.J[s]!==n&&(this.J[t++]=this.J[s]);return this.i=this.J.length=t,this.i}eraseElementByIterator(n){let t=n.o;return n=n.next(),this.eraseElementByPos(t),n}pushBack(n){return this.J.push(n),this.i+=1,this.i}popBack(){if(this.i!==0)return this.i-=1,this.J.pop()}setElementByPos(n,t){if(n<0||n>this.i-1)throw new RangeError;this.J[n]=t}insert(n,t,s=1){if(n<0||n>this.i)throw new RangeError;return this.J.splice(n,0,...new Array(s).fill(t)),this.i+=s,this.i}find(n){for(let t=0;t<this.i;++t)if(this.J[t]===n)return new l(t,this);return this.end()}reverse(){this.J.reverse()}unique(){let n=1;for(let t=1;t<this.i;++t)this.J[t]!==this.J[t-1]&&(this.J[n++]=this.J[t]);return this.i=this.J.length=n,this.i}sort(n){this.J.sort(n)}forEach(n){for(let t=0;t<this.i;++t)n(this.J[t],t,this)}[Symbol.iterator](){return(function*(){yield*this.J}).bind(this)()}},e=r;o.default=e}),Gl=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var c=l(Wn()),i=ut(),a=ct();function l(t){return t&&t.t?t:{default:t}}var r=class Js extends i.ContainerIterator{constructor(s,u,d,p){super(p),this.o=s,this.h=u,this.container=d,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o.l}set pointer(s){this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o.l=s}copy(){return new Js(this.o,this.h,this.container,this.iteratorType)}},e=class extends c.default{constructor(t=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;let s=this;t.forEach(function(u){s.pushBack(u)})}V(t){let{L:s,B:u}=t;s.B=u,u.L=s,t===this.p&&(this.p=u),t===this._&&(this._=s),this.i-=1}G(t,s){let u=s.B,d={l:t,L:s,B:u};s.B=d,u.L=d,s===this.h&&(this.p=d),u===this.h&&(this._=d),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}begin(){return new r(this.p,this.h,this)}end(){return new r(this.h,this.h,this)}rBegin(){return new r(this._,this.h,this,1)}rEnd(){return new r(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(t){if(t<0||t>this.i-1)throw new RangeError;let s=this.p;for(;t--;)s=s.B;return s.l}eraseElementByPos(t){if(t<0||t>this.i-1)throw new RangeError;let s=this.p;for(;t--;)s=s.B;return this.V(s),this.i}eraseElementByValue(t){let s=this.p;for(;s!==this.h;)s.l===t&&this.V(s),s=s.B;return this.i}eraseElementByIterator(t){let s=t.o;return s===this.h&&(0,a.throwIteratorAccessError)(),t=t.next(),this.V(s),t}pushBack(t){return this.G(t,this._),this.i}popBack(){if(this.i===0)return;let t=this._.l;return this.V(this._),t}pushFront(t){return this.G(t,this.h),this.i}popFront(){if(this.i===0)return;let t=this.p.l;return this.V(this.p),t}setElementByPos(t,s){if(t<0||t>this.i-1)throw new RangeError;let u=this.p;for(;t--;)u=u.B;u.l=s}insert(t,s,u=1){if(t<0||t>this.i)throw new RangeError;if(u<=0)return this.i;if(t===0)for(;u--;)this.pushFront(s);else if(t===this.i)for(;u--;)this.pushBack(s);else{let d=this.p;for(let g=1;g<t;++g)d=d.B;let p=d.B;for(this.i+=u;u--;)d.B={l:s,L:d},d.B.L=d,d=d.B;d.B=p,p.L=d}return this.i}find(t){let s=this.p;for(;s!==this.h;){if(s.l===t)return new r(s,this.h,this);s=s.B}return this.end()}reverse(){if(this.i<=1)return;let t=this.p,s=this._,u=0;for(;u<<1<this.i;){let d=t.l;t.l=s.l,s.l=d,t=t.B,s=s.L,u+=1}}unique(){if(this.i<=1)return this.i;let t=this.p;for(;t!==this.h;){let s=t;for(;s.B!==this.h&&s.l===s.B.l;)s=s.B,this.i-=1;t.B=s.B,t.B.L=t,t=t.B}return this.i}sort(t){if(this.i<=1)return;let s=[];this.forEach(function(d){s.push(d)}),s.sort(t);let u=this.p;s.forEach(function(d){u.l=d,u=u.B})}merge(t){let s=this;if(this.i===0)t.forEach(function(u){s.pushBack(u)});else{let u=this.p;t.forEach(function(d){for(;u!==s.h&&u.l<=d;)u=u.B;s.G(d,u.L)})}return this.i}forEach(t){let s=this.p,u=0;for(;s!==this.h;)t(s.l,u++,this),s=s.B}[Symbol.iterator](){return(function*(){if(this.i===0)return;let t=this.p;for(;t!==this.h;)yield t.l,t=t.B}).bind(this)()}},n=e;o.default=n}),Yl=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var c=a(Wn()),i=ko();function a(n){return n&&n.t?n:{default:n}}var l=class Zs extends i.RandomIterator{constructor(t,s,u){super(t,u),this.container=s}copy(){return new Zs(this.o,this.container,this.iteratorType)}},r=class extends c.default{constructor(n=[],t=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];let s=(()=>{if(typeof n.length=="number")return n.length;if(typeof n.size=="number")return n.size;if(typeof n.size=="function")return n.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=t,this.P=Math.max(Math.ceil(s/this.F),1);for(let p=0;p<this.P;++p)this.A.push(new Array(this.F));let u=Math.ceil(s/this.F);this.j=this.R=(this.P>>1)-(u>>1),this.D=this.N=this.F-s%this.F>>1;let d=this;n.forEach(function(p){d.pushBack(p)})}T(){let n=[],t=Math.max(this.P>>1,1);for(let s=0;s<t;++s)n[s]=new Array(this.F);for(let s=this.j;s<this.P;++s)n[n.length]=this.A[s];for(let s=0;s<this.R;++s)n[n.length]=this.A[s];n[n.length]=[...this.A[this.R]],this.j=t,this.R=n.length-1;for(let s=0;s<t;++s)n[n.length]=new Array(this.F);this.A=n,this.P=n.length}O(n){let t=this.D+n+1,s=t%this.F,u=s-1,d=this.j+(t-s)/this.F;return s===0&&(d-=1),d%=this.P,u<0&&(u+=this.F),{curNodeBucketIndex:d,curNodePointerIndex:u}}clear(){this.A=[new Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1}begin(){return new l(0,this)}end(){return new l(this.i,this)}rBegin(){return new l(this.i-1,this,1)}rEnd(){return new l(-1,this,1)}front(){if(this.i!==0)return this.A[this.j][this.D]}back(){if(this.i!==0)return this.A[this.R][this.N]}pushBack(n){return this.i&&(this.N<this.F-1?this.N+=1:this.R<this.P-1?(this.R+=1,this.N=0):(this.R=0,this.N=0),this.R===this.j&&this.N===this.D&&this.T()),this.i+=1,this.A[this.R][this.N]=n,this.i}popBack(){if(this.i===0)return;let n=this.A[this.R][this.N];return this.i!==1&&(this.N>0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,n}pushFront(n){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=n,this.i}popFront(){if(this.i===0)return;let n=this.A[this.j][this.D];return this.i!==1&&(this.D<this.F-1?this.D+=1:this.j<this.P-1?(this.j+=1,this.D=0):(this.j=0,this.D=0)),this.i-=1,n}getElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;let{curNodeBucketIndex:t,curNodePointerIndex:s}=this.O(n);return this.A[t][s]}setElementByPos(n,t){if(n<0||n>this.i-1)throw new RangeError;let{curNodeBucketIndex:s,curNodePointerIndex:u}=this.O(n);this.A[s][u]=t}insert(n,t,s=1){if(n<0||n>this.i)throw new RangeError;if(n===0)for(;s--;)this.pushFront(t);else if(n===this.i)for(;s--;)this.pushBack(t);else{let u=[];for(let d=n;d<this.i;++d)u.push(this.getElementByPos(d));this.cut(n-1);for(let d=0;d<s;++d)this.pushBack(t);for(let d=0;d<u.length;++d)this.pushBack(u[d])}return this.i}cut(n){if(n<0)return this.clear(),0;let{curNodeBucketIndex:t,curNodePointerIndex:s}=this.O(n);return this.R=t,this.N=s,this.i=n+1,this.i}eraseElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;if(n===0)this.popFront();else if(n===this.i-1)this.popBack();else{let t=[];for(let u=n+1;u<this.i;++u)t.push(this.getElementByPos(u));this.cut(n),this.popBack();let s=this;t.forEach(function(u){s.pushBack(u)})}return this.i}eraseElementByValue(n){if(this.i===0)return 0;let t=[];for(let u=0;u<this.i;++u){let d=this.getElementByPos(u);d!==n&&t.push(d)}let s=t.length;for(let u=0;u<s;++u)this.setElementByPos(u,t[u]);return this.cut(s-1)}eraseElementByIterator(n){let t=n.o;return this.eraseElementByPos(t),n=n.next(),n}find(n){for(let t=0;t<this.i;++t)if(this.getElementByPos(t)===n)return new l(t,this);return this.end()}reverse(){let n=0,t=this.i-1;for(;n<t;){let s=this.getElementByPos(n);this.setElementByPos(n,this.getElementByPos(t)),this.setElementByPos(t,s),n+=1,t-=1}}unique(){if(this.i<=1)return this.i;let n=1,t=this.getElementByPos(0);for(let s=1;s<this.i;++s){let u=this.getElementByPos(s);u!==t&&(t=u,this.setElementByPos(n++,u))}for(;this.i>n;)this.popBack();return this.i}sort(n){let t=[];for(let s=0;s<this.i;++s)t.push(this.getElementByPos(s));t.sort(n);for(let s=0;s<this.i;++s)this.setElementByPos(s,t[s])}shrinkToFit(){if(this.i===0)return;let n=[];this.forEach(function(t){n.push(t)}),this.P=Math.max(Math.ceil(this.i/this.F),1),this.i=this.j=this.R=this.D=this.N=0,this.A=[];for(let t=0;t<this.P;++t)this.A.push(new Array(this.F));for(let t=0;t<n.length;++t)this.pushBack(n[t])}forEach(n){for(let t=0;t<this.i;++t)n(this.getElementByPos(t),t,this)}[Symbol.iterator](){return(function*(){for(let n=0;n<this.i;++n)yield this.getElementByPos(n)}).bind(this)()}},e=r;o.default=e}),Jl=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"t",{value:!0}),o.TreeNodeEnableIndex=o.TreeNode=void 0;var c=class{constructor(a,l){this.ee=1,this.u=void 0,this.l=void 0,this.U=void 0,this.W=void 0,this.tt=void 0,this.u=a,this.l=l}L(){let a=this;if(a.ee===1&&a.tt.tt===a)a=a.W;else if(a.U)for(a=a.U;a.W;)a=a.W;else{let l=a.tt;for(;l.U===a;)a=l,l=a.tt;a=l}return a}B(){let a=this;if(a.W){for(a=a.W;a.U;)a=a.U;return a}else{let l=a.tt;for(;l.W===a;)a=l,l=a.tt;return a.W!==l?l:a}}te(){let a=this.tt,l=this.W,r=l.U;return a.tt===this?a.tt=l:a.U===this?a.U=l:a.W=l,l.tt=a,l.U=this,this.tt=l,this.W=r,r&&(r.tt=this),l}se(){let a=this.tt,l=this.U,r=l.W;return a.tt===this?a.tt=l:a.U===this?a.U=l:a.W=l,l.tt=a,l.W=this,this.tt=l,this.U=r,r&&(r.tt=this),l}};o.TreeNode=c;var i=class extends c{constructor(){super(...arguments),this.rt=1}te(){let a=super.te();return this.ie(),a.ie(),a}se(){let a=super.se();return this.ie(),a.ie(),a}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}};o.TreeNodeEnableIndex=i}),Io=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var c=Jl(),i=ut(),a=ct(),l=class extends i.Container{constructor(e=function(t,s){return t<s?-1:t>s?1:0},n=!1){super(),this.Y=void 0,this.v=e,n?(this.re=c.TreeNodeEnableIndex,this.M=function(t,s,u){let d=this.ne(t,s,u);if(d){let p=d.tt;for(;p!==this.h;)p.rt+=1,p=p.tt;let g=this.he(d);if(g){let{parentNode:f,grandParent:b,curNode:y}=g;f.ie(),b.ie(),y.ie()}}return this.i},this.V=function(t){let s=this.fe(t);for(;s!==this.h;)s.rt-=1,s=s.tt}):(this.re=c.TreeNode,this.M=function(t,s,u){let d=this.ne(t,s,u);return d&&this.he(d),this.i},this.V=this.fe),this.h=new this.re}X(e,n){let t=this.h;for(;e;){let s=this.v(e.u,n);if(s<0)e=e.W;else if(s>0)t=e,e=e.U;else return e}return t}Z(e,n){let t=this.h;for(;e;)this.v(e.u,n)<=0?e=e.W:(t=e,e=e.U);return t}$(e,n){let t=this.h;for(;e;){let s=this.v(e.u,n);if(s<0)t=e,e=e.W;else if(s>0)e=e.U;else return e}return t}rr(e,n){let t=this.h;for(;e;)this.v(e.u,n)<0?(t=e,e=e.W):e=e.U;return t}ue(e){for(;;){let n=e.tt;if(n===this.h)return;if(e.ee===1){e.ee=0;return}if(e===n.U){let t=n.W;if(t.ee===1)t.ee=0,n.ee=1,n===this.Y?this.Y=n.te():n.te();else if(t.W&&t.W.ee===1){t.ee=n.ee,n.ee=0,t.W.ee=0,n===this.Y?this.Y=n.te():n.te();return}else t.U&&t.U.ee===1?(t.ee=1,t.U.ee=0,t.se()):(t.ee=1,e=n)}else{let t=n.U;if(t.ee===1)t.ee=0,n.ee=1,n===this.Y?this.Y=n.se():n.se();else if(t.U&&t.U.ee===1){t.ee=n.ee,n.ee=0,t.U.ee=0,n===this.Y?this.Y=n.se():n.se();return}else t.W&&t.W.ee===1?(t.ee=1,t.W.ee=0,t.te()):(t.ee=1,e=n)}}}fe(e){if(this.i===1)return this.clear(),this.h;let n=e;for(;n.U||n.W;){if(n.W)for(n=n.W;n.U;)n=n.U;else n=n.U;[e.u,n.u]=[n.u,e.u],[e.l,n.l]=[n.l,e.l],e=n}this.h.U===n?this.h.U=n.tt:this.h.W===n&&(this.h.W=n.tt),this.ue(n);let t=n.tt;return n===t.U?t.U=void 0:t.W=void 0,this.i-=1,this.Y.ee=0,t}oe(e,n){return e===void 0?!1:this.oe(e.U,n)||n(e)?!0:this.oe(e.W,n)}he(e){for(;;){let n=e.tt;if(n.ee===0)return;let t=n.tt;if(n===t.U){let s=t.W;if(s&&s.ee===1){if(s.ee=n.ee=0,t===this.Y)return;t.ee=1,e=t;continue}else if(e===n.W){if(e.ee=0,e.U&&(e.U.tt=n),e.W&&(e.W.tt=t),n.W=e.U,t.U=e.W,e.U=n,e.W=t,t===this.Y)this.Y=e,this.h.tt=e;else{let u=t.tt;u.U===t?u.U=e:u.W=e}return e.tt=t.tt,n.tt=e,t.tt=e,t.ee=1,{parentNode:n,grandParent:t,curNode:e}}else n.ee=0,t===this.Y?this.Y=t.se():t.se(),t.ee=1}else{let s=t.U;if(s&&s.ee===1){if(s.ee=n.ee=0,t===this.Y)return;t.ee=1,e=t;continue}else if(e===n.U){if(e.ee=0,e.U&&(e.U.tt=t),e.W&&(e.W.tt=n),t.W=e.U,n.U=e.W,e.U=t,e.W=n,t===this.Y)this.Y=e,this.h.tt=e;else{let u=t.tt;u.U===t?u.U=e:u.W=e}return e.tt=t.tt,n.tt=e,t.tt=e,t.ee=1,{parentNode:n,grandParent:t,curNode:e}}else n.ee=0,t===this.Y?this.Y=t.te():t.te(),t.ee=1}return}}ne(e,n,t){if(this.Y===void 0){this.i+=1,this.Y=new this.re(e,n),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,this.h.W=this.Y;return}let s,u=this.h.U,d=this.v(u.u,e);if(d===0){u.l=n;return}else if(d>0)u.U=new this.re(e,n),u.U.tt=u,s=u.U,this.h.U=s;else{let p=this.h.W,g=this.v(p.u,e);if(g===0){p.l=n;return}else if(g<0)p.W=new this.re(e,n),p.W.tt=p,s=p.W,this.h.W=s;else{if(t!==void 0){let f=t.o;if(f!==this.h){let b=this.v(f.u,e);if(b===0){f.l=n;return}else if(b>0){let y=f.L(),_=this.v(y.u,e);if(_===0){y.l=n;return}else _<0&&(s=new this.re(e,n),y.W===void 0?(y.W=s,s.tt=y):(f.U=s,s.tt=f))}}}if(s===void 0)for(s=this.Y;;){let f=this.v(s.u,e);if(f>0){if(s.U===void 0){s.U=new this.re(e,n),s.U.tt=s,s=s.U;break}s=s.U}else if(f<0){if(s.W===void 0){s.W=new this.re(e,n),s.W.tt=s,s=s.W;break}s=s.W}else{s.l=n;return}}}}return this.i+=1,s}I(e,n){for(;e;){let t=this.v(e.u,n);if(t<0)e=e.W;else if(t>0)e=e.U;else return e}return e||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(e,n){let t=e.o;if(t===this.h&&(0,a.throwIteratorAccessError)(),this.i===1)return t.u=n,!0;if(t===this.h.U)return this.v(t.B().u,n)>0?(t.u=n,!0):!1;if(t===this.h.W)return this.v(t.L().u,n)<0?(t.u=n,!0):!1;let s=t.L().u;if(this.v(s,n)>=0)return!1;let u=t.B().u;return this.v(u,n)<=0?!1:(t.u=n,!0)}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let n=0,t=this;return this.oe(this.Y,function(s){return e===n?(t.V(s),!0):(n+=1,!1)}),this.i}eraseElementByKey(e){if(this.i===0)return!1;let n=this.I(this.Y,e);return n===this.h?!1:(this.V(n),!0)}eraseElementByIterator(e){let n=e.o;n===this.h&&(0,a.throwIteratorAccessError)();let t=n.W===void 0;return e.iteratorType===0?t&&e.next():(!t||n.U===void 0)&&e.next(),this.V(n),e}forEach(e){let n=0;for(let t of this)e(t,n++,this)}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let n,t=0;for(let s of this){if(t===e){n=s;break}t+=1}return n}getHeight(){if(this.i===0)return 0;let e=function(n){return n?Math.max(e(n.U),e(n.W))+1:0};return e(this.Y)}},r=l;o.default=r}),To=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var c=ut(),i=ct(),a=class extends c.ContainerIterator{constructor(r,e,n){super(n),this.o=r,this.h=e,this.iteratorType===0?(this.pre=function(){return this.o===this.h.U&&(0,i.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,i.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let r=this.o,e=this.h.tt;if(r===this.h)return e?e.rt-1:0;let n=0;for(r.U&&(n+=r.U.rt);r!==e;){let t=r.tt;r===t.W&&(n+=1,t.U&&(n+=t.U.rt)),r=t}return n}},l=a;o.default=l}),Zl=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var c=l(Io()),i=l(To()),a=ct();function l(t){return t&&t.t?t:{default:t}}var r=class Xs extends i.default{constructor(s,u,d,p){super(s,u,p),this.container=d}get pointer(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o.u}copy(){return new Xs(this.o,this.h,this.container,this.iteratorType)}},e=class extends c.default{constructor(t=[],s,u){super(s,u);let d=this;t.forEach(function(p){d.insert(p)})}*K(t){t!==void 0&&(yield*this.K(t.U),yield t.u,yield*this.K(t.W))}begin(){return new r(this.h.U||this.h,this.h,this)}end(){return new r(this.h,this.h,this)}rBegin(){return new r(this.h.W||this.h,this.h,this,1)}rEnd(){return new r(this.h,this.h,this,1)}front(){return this.h.U?this.h.U.u:void 0}back(){return this.h.W?this.h.W.u:void 0}insert(t,s){return this.M(t,void 0,s)}find(t){let s=this.I(this.Y,t);return new r(s,this.h,this)}lowerBound(t){let s=this.X(this.Y,t);return new r(s,this.h,this)}upperBound(t){let s=this.Z(this.Y,t);return new r(s,this.h,this)}reverseLowerBound(t){let s=this.$(this.Y,t);return new r(s,this.h,this)}reverseUpperBound(t){let s=this.rr(this.Y,t);return new r(s,this.h,this)}union(t){let s=this;return t.forEach(function(u){s.insert(u)}),this.i}[Symbol.iterator](){return this.K(this.Y)}},n=e;o.default=n}),Xl=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var c=l(Io()),i=l(To()),a=ct();function l(t){return t&&t.t?t:{default:t}}var r=class ea extends i.default{constructor(s,u,d,p){super(s,u,p),this.container=d}get pointer(){this.o===this.h&&(0,a.throwIteratorAccessError)();let s=this;return new Proxy([],{get(u,d){if(d==="0")return s.o.u;if(d==="1")return s.o.l},set(u,d,p){if(d!=="1")throw new TypeError("props must be 1");return s.o.l=p,!0}})}copy(){return new ea(this.o,this.h,this.container,this.iteratorType)}},e=class extends c.default{constructor(t=[],s,u){super(s,u);let d=this;t.forEach(function(p){d.setElement(p[0],p[1])})}*K(t){t!==void 0&&(yield*this.K(t.U),yield[t.u,t.l],yield*this.K(t.W))}begin(){return new r(this.h.U||this.h,this.h,this)}end(){return new r(this.h,this.h,this)}rBegin(){return new r(this.h.W||this.h,this.h,this,1)}rEnd(){return new r(this.h,this.h,this,1)}front(){if(this.i===0)return;let t=this.h.U;return[t.u,t.l]}back(){if(this.i===0)return;let t=this.h.W;return[t.u,t.l]}lowerBound(t){let s=this.X(this.Y,t);return new r(s,this.h,this)}upperBound(t){let s=this.Z(this.Y,t);return new r(s,this.h,this)}reverseLowerBound(t){let s=this.$(this.Y,t);return new r(s,this.h,this)}reverseUpperBound(t){let s=this.rr(this.Y,t);return new r(s,this.h,this)}setElement(t,s,u){return this.M(t,s,u)}find(t){let s=this.I(this.Y,t);return new r(s,this.h,this)}getElementByKey(t){return this.I(this.Y,t).l}union(t){let s=this;return t.forEach(function(u){s.setElement(u[0],u[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}},n=e;o.default=n}),Bo=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"t",{value:!0}),o.default=c;function c(i){let a=typeof i;return a==="object"&&i!==null||a==="function"}}),Oo=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"t",{value:!0}),o.HashContainerIterator=o.HashContainer=void 0;var c=ut(),i=l(Bo()),a=ct();function l(n){return n&&n.t?n:{default:n}}var r=class extends c.ContainerIterator{constructor(n,t,s){super(s),this.o=n,this.h=t,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this})}};o.HashContainerIterator=r;var e=class extends c.Container{constructor(){super(),this.H=[],this.g={},this.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(this.g,null),this.h={},this.h.L=this.h.B=this.p=this._=this.h}V(n){let{L:t,B:s}=n;t.B=s,s.L=t,n===this.p&&(this.p=s),n===this._&&(this._=t),this.i-=1}M(n,t,s){s===void 0&&(s=(0,i.default)(n));let u;if(s){let d=n[this.HASH_TAG];if(d!==void 0)return this.H[d].l=t,this.i;Object.defineProperty(n,this.HASH_TAG,{value:this.H.length,configurable:!0}),u={u:n,l:t,L:this._,B:this.h},this.H.push(u)}else{let d=this.g[n];if(d)return d.l=t,this.i;u={u:n,l:t,L:this._,B:this.h},this.g[n]=u}return this.i===0?(this.p=u,this.h.B=u):this._.B=u,this._=u,this.h.L=u,++this.i}I(n,t){if(t===void 0&&(t=(0,i.default)(n)),t){let s=n[this.HASH_TAG];return s===void 0?this.h:this.H[s]}else return this.g[n]||this.h}clear(){let n=this.HASH_TAG;this.H.forEach(function(t){delete t.u[n]}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(n,t){let s;if(t===void 0&&(t=(0,i.default)(n)),t){let u=n[this.HASH_TAG];if(u===void 0)return!1;delete n[this.HASH_TAG],s=this.H[u],delete this.H[u]}else{if(s=this.g[n],s===void 0)return!1;delete this.g[n]}return this.V(s),!0}eraseElementByIterator(n){let t=n.o;return t===this.h&&(0,a.throwIteratorAccessError)(),this.V(t),n.next()}eraseElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;let t=this.p;for(;n--;)t=t.B;return this.V(t),this.i}};o.HashContainer=e}),eu=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var c=Oo(),i=ct(),a=class ta extends c.HashContainerIterator{constructor(n,t,s,u){super(n,t,u),this.container=s}get pointer(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o.u}copy(){return new ta(this.o,this.h,this.container,this.iteratorType)}},l=class extends c.HashContainer{constructor(e=[]){super();let n=this;e.forEach(function(t){n.insert(t)})}begin(){return new a(this.p,this.h,this)}end(){return new a(this.h,this.h,this)}rBegin(){return new a(this._,this.h,this,1)}rEnd(){return new a(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(e,n){return this.M(e,void 0,n)}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let n=this.p;for(;e--;)n=n.B;return n.u}find(e,n){let t=this.I(e,n);return new a(t,this.h,this)}forEach(e){let n=0,t=this.p;for(;t!==this.h;)e(t.u,n++,this),t=t.B}[Symbol.iterator](){return(function*(){let e=this.p;for(;e!==this.h;)yield e.u,e=e.B}).bind(this)()}},r=l;o.default=r}),tu=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var c=Oo(),i=l(Bo()),a=ct();function l(t){return t&&t.t?t:{default:t}}var r=class ra extends c.HashContainerIterator{constructor(s,u,d,p){super(s,u,p),this.container=d}get pointer(){this.o===this.h&&(0,a.throwIteratorAccessError)();let s=this;return new Proxy([],{get(u,d){if(d==="0")return s.o.u;if(d==="1")return s.o.l},set(u,d,p){if(d!=="1")throw new TypeError("props must be 1");return s.o.l=p,!0}})}copy(){return new ra(this.o,this.h,this.container,this.iteratorType)}},e=class extends c.HashContainer{constructor(t=[]){super();let s=this;t.forEach(function(u){s.setElement(u[0],u[1])})}begin(){return new r(this.p,this.h,this)}end(){return new r(this.h,this.h,this)}rBegin(){return new r(this._,this.h,this,1)}rEnd(){return new r(this.h,this.h,this,1)}front(){if(this.i!==0)return[this.p.u,this.p.l]}back(){if(this.i!==0)return[this._.u,this._.l]}setElement(t,s,u){return this.M(t,s,u)}getElementByKey(t,s){if(s===void 0&&(s=(0,i.default)(t)),s){let d=t[this.HASH_TAG];return d!==void 0?this.H[d].l:void 0}let u=this.g[t];return u?u.l:void 0}getElementByPos(t){if(t<0||t>this.i-1)throw new RangeError;let s=this.p;for(;t--;)s=s.B;return[s.u,s.l]}find(t,s){let u=this.I(t,s);return new r(u,this.h,this)}forEach(t){let s=0,u=this.p;for(;u!==this.h;)t([u.u,u.l],s++,this),u=u.B}[Symbol.iterator](){return(function*(){let t=this.p;for(;t!==this.h;)yield[t.u,t.l],t=t.B}).bind(this)()}},n=e;o.default=n}),ru=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"t",{value:!0}),Object.defineProperty(o,"Deque",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(o,"HashMap",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(o,"HashSet",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(o,"LinkList",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(o,"OrderedMap",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(o,"OrderedSet",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(o,"PriorityQueue",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(o,"Queue",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(o,"Stack",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(o,"Vector",{enumerable:!0,get:function(){return l.default}});var c=d(Hl()),i=d(ql()),a=d($l()),l=d(zl()),r=d(Gl()),e=d(Yl()),n=d(Zl()),t=d(Xl()),s=d(eu()),u=d(tu());function d(p){return p&&p.t?p:{default:p}}}),nu=fe((o,c)=>{oe(),ae(),se();var i=ru().OrderedSet,a=lt()("number-allocator:trace"),l=lt()("number-allocator:error");function r(n,t){this.low=n,this.high=t}r.prototype.equals=function(n){return this.low===n.low&&this.high===n.high},r.prototype.compare=function(n){return this.low<n.low&&this.high<n.low?-1:n.low<this.low&&n.high<this.low?1:0};function e(n,t){if(!(this instanceof e))return new e(n,t);this.min=n,this.max=t,this.ss=new i([],(s,u)=>s.compare(u)),a("Create"),this.clear()}e.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},e.prototype.alloc=function(){if(this.ss.size()===0)return a("alloc():empty"),null;let n=this.ss.begin(),t=n.pointer.low,s=n.pointer.high,u=t;return u+1<=s?this.ss.updateKeyByIterator(n,new r(t+1,s)):this.ss.eraseElementByPos(0),a("alloc():"+u),u},e.prototype.use=function(n){let t=new r(n,n),s=this.ss.lowerBound(t);if(!s.equals(this.ss.end())){let u=s.pointer.low,d=s.pointer.high;return s.pointer.equals(t)?(this.ss.eraseElementByIterator(s),a("use():"+n),!0):u>n?!1:u===n?(this.ss.updateKeyByIterator(s,new r(u+1,d)),a("use():"+n),!0):d===n?(this.ss.updateKeyByIterator(s,new r(u,d-1)),a("use():"+n),!0):(this.ss.updateKeyByIterator(s,new r(n+1,d)),this.ss.insert(new r(u,n-1)),a("use():"+n),!0)}return a("use():failed"),!1},e.prototype.free=function(n){if(n<this.min||n>this.max){l("free():"+n+" is out of range");return}let t=new r(n,n),s=this.ss.upperBound(t);if(s.equals(this.ss.end())){if(s.equals(this.ss.begin())){this.ss.insert(t);return}s.pre();let u=s.pointer.high;s.pointer.high+1===n?this.ss.updateKeyByIterator(s,new r(u,n)):this.ss.insert(t)}else if(s.equals(this.ss.begin()))if(n+1===s.pointer.low){let u=s.pointer.high;this.ss.updateKeyByIterator(s,new r(n,u))}else this.ss.insert(t);else{let u=s.pointer.low,d=s.pointer.high;s.pre();let p=s.pointer.low;s.pointer.high+1===n?n+1===u?(this.ss.eraseElementByIterator(s),this.ss.updateKeyByIterator(s,new r(p,d))):this.ss.updateKeyByIterator(s,new r(p,n)):n+1===u?(this.ss.eraseElementByIterator(s.next()),this.ss.insert(new r(n,d))):this.ss.insert(t)}a("free():"+n)},e.prototype.clear=function(){a("clear()"),this.ss.clear(),this.ss.insert(new r(this.min,this.max))},e.prototype.intervalCount=function(){return this.ss.size()},e.prototype.dump=function(){console.log("length:"+this.ss.size());for(let n of this.ss)console.log(n)},c.exports=e}),Po=fe((o,c)=>{oe(),ae(),se();var i=nu();c.exports.NumberAllocator=i}),iu=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"__esModule",{value:!0});var c=Kl(),i=Po(),a=class{constructor(l){l>0&&(this.aliasToTopic=new c.LRUCache({max:l}),this.topicToAlias={},this.numberAllocator=new i.NumberAllocator(1,l),this.max=l,this.length=0)}put(l,r){if(r===0||r>this.max)return!1;let e=this.aliasToTopic.get(r);return e&&delete this.topicToAlias[e],this.aliasToTopic.set(r,l),this.topicToAlias[l]=r,this.numberAllocator.use(r),this.length=this.aliasToTopic.size,!0}getTopicByAlias(l){return this.aliasToTopic.get(l)}getAliasByTopic(l){let r=this.topicToAlias[l];return typeof r<"u"&&this.aliasToTopic.get(r),r}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){return this.numberAllocator.firstVacant()||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}};o.default=a}),ou=fe(o=>{oe(),ae(),se();var c=o&&o.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o,"__esModule",{value:!0});var i=ir(),a=c(iu()),l=Dt(),r=(e,n)=>{e.log("_handleConnack");let{options:t}=e,s=t.protocolVersion===5?n.reasonCode:n.returnCode;if(clearTimeout(e.connackTimer),delete e.topicAliasSend,n.properties){if(n.properties.topicAliasMaximum){if(n.properties.topicAliasMaximum>65535){e.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}n.properties.topicAliasMaximum>0&&(e.topicAliasSend=new a.default(n.properties.topicAliasMaximum))}n.properties.serverKeepAlive&&t.keepalive&&(t.keepalive=n.properties.serverKeepAlive),n.properties.maximumPacketSize&&(t.properties||(t.properties={}),t.properties.maximumPacketSize=n.properties.maximumPacketSize)}if(s===0)e.reconnecting=!1,e._onConnect(n);else if(s>0){let u=new l.ErrorWithReasonCode(`Connection refused: ${i.ReasonCodes[s]}`,s);e.emit("error",u),e.options.reconnectOnConnackError&&e._cleanUp(!0)}};o.default=r}),su=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"__esModule",{value:!0});var c=(i,a,l)=>{i.log("handling pubrel packet");let r=typeof l<"u"?l:i.noop,{messageId:e}=a,n={cmd:"pubcomp",messageId:e};i.incomingStore.get(a,(t,s)=>{t?i._sendPacket(n,r):(i.emit("message",s.topic,s.payload,s),i.handleMessage(s,u=>{if(u)return r(u);i.incomingStore.del(s,i.noop),i._sendPacket(n,r)}))})};o.default=c}),au=fe(o=>{oe(),ae(),se();var c=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(o,"__esModule",{value:!0});var i=c(Wl()),a=c(Ql()),l=c(ou()),r=c(ir()),e=c(su()),n=(t,s,u)=>{let{options:d}=t;if(d.protocolVersion===5&&d.properties&&d.properties.maximumPacketSize&&d.properties.maximumPacketSize<s.length)return t.emit("error",new Error(`exceeding packets size ${s.cmd}`)),t.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),t;switch(t.log("_handlePacket :: emitting packetreceive"),t.emit("packetreceive",s),s.cmd){case"publish":(0,i.default)(t,s,u);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":t.reschedulePing(),(0,r.default)(t,s),u();break;case"pubrel":t.reschedulePing(),(0,e.default)(t,s,u);break;case"connack":(0,l.default)(t,s),u();break;case"auth":t.reschedulePing(),(0,a.default)(t,s),u();break;case"pingresp":t.log("_handlePacket :: received pingresp"),t.reschedulePing(!0),u();break;case"disconnect":t.emit("disconnect",s),u();break;default:t.log("_handlePacket :: unknown command"),u();break}};o.default=n}),lu=fe(o=>{oe(),ae(),se();var c=o&&o.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(o,"__esModule",{value:!0}),o.TypedEventEmitter=void 0;var i=c((_t(),Be(mt))),a=Dt(),l=class{};o.TypedEventEmitter=l,(0,a.applyMixin)(l,i.default)}),or=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"__esModule",{value:!0}),o.isReactNativeBrowser=o.isWebWorker=void 0;var c=()=>{var r;return typeof window<"u"?typeof navigator<"u"&&((r=navigator.userAgent)===null||r===void 0?void 0:r.toLowerCase().indexOf(" electron/"))>-1&&ke!=null&&ke.versions?!Object.prototype.hasOwnProperty.call(ke.versions,"electron"):typeof window.document<"u":!1},i=()=>{var r,e;return!!(typeof self=="object"&&!((e=(r=self?.constructor)===null||r===void 0?void 0:r.name)===null||e===void 0)&&e.includes("WorkerGlobalScope"))},a=()=>typeof navigator<"u"&&navigator.product==="ReactNative",l=c()||i()||a();o.isWebWorker=i(),o.isReactNativeBrowser=a(),o.default=l}),uu=fe((o,c)=>{oe(),ae(),se(),function(i,a){typeof o=="object"&&typeof c<"u"?a(o):typeof define=="function"&&define.amd?define(["exports"],a):(i=typeof globalThis<"u"?globalThis:i||self,a(i.fastUniqueNumbers={}))}(o,function(i){var a=function(g){return function(f){var b=g(f);return f.add(b),b}},l=function(g){return function(f,b){return g.set(f,b),b}},r=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,e=536870912,n=e*2,t=function(g,f){return function(b){var y=f.get(b),_=y===void 0?b.size:y<n?y+1:0;if(!b.has(_))return g(b,_);if(b.size<e){for(;b.has(_);)_=Math.floor(Math.random()*n);return g(b,_)}if(b.size>r)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;b.has(_);)_=Math.floor(Math.random()*r);return g(b,_)}},s=new WeakMap,u=l(s),d=t(u,s),p=a(d);i.addUniqueNumber=p,i.generateUniqueNumber=d})}),cu=fe((o,c)=>{oe(),ae(),se(),function(i,a){typeof o=="object"&&typeof c<"u"?a(o,uu()):typeof define=="function"&&define.amd?define(["exports","fast-unique-numbers"],a):(i=typeof globalThis<"u"?globalThis:i||self,a(i.workerTimersBroker={},i.fastUniqueNumbers))}(o,function(i,a){var l=function(n){return n.method!==void 0&&n.method==="call"},r=function(n){return n.error===null&&typeof n.id=="number"},e=function(n){var t=new Map([[0,function(){}]]),s=new Map([[0,function(){}]]),u=new Map,d=new Worker(n);d.addEventListener("message",function(y){var _=y.data;if(l(_)){var A=_.params,w=A.timerId,T=A.timerType;if(T==="interval"){var k=t.get(w);if(typeof k=="number"){var E=u.get(k);if(E===void 0||E.timerId!==w||E.timerType!==T)throw new Error("The timer is in an undefined state.")}else if(typeof k<"u")k();else throw new Error("The timer is in an undefined state.")}else if(T==="timeout"){var I=s.get(w);if(typeof I=="number"){var O=u.get(I);if(O===void 0||O.timerId!==w||O.timerType!==T)throw new Error("The timer is in an undefined state.")}else if(typeof I<"u")I(),s.delete(w);else throw new Error("The timer is in an undefined state.")}}else if(r(_)){var H=_.id,G=u.get(H);if(G===void 0)throw new Error("The timer is in an undefined state.");var de=G.timerId,U=G.timerType;u.delete(H),U==="interval"?t.delete(de):s.delete(de)}else{var $=_.error.message;throw new Error($)}});var p=function(y){var _=a.generateUniqueNumber(u);u.set(_,{timerId:y,timerType:"interval"}),t.set(y,_),d.postMessage({id:_,method:"clear",params:{timerId:y,timerType:"interval"}})},g=function(y){var _=a.generateUniqueNumber(u);u.set(_,{timerId:y,timerType:"timeout"}),s.set(y,_),d.postMessage({id:_,method:"clear",params:{timerId:y,timerType:"timeout"}})},f=function(y){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,A=a.generateUniqueNumber(t);return t.set(A,function(){y(),typeof t.get(A)=="function"&&d.postMessage({id:null,method:"set",params:{delay:_,now:performance.now(),timerId:A,timerType:"interval"}})}),d.postMessage({id:null,method:"set",params:{delay:_,now:performance.now(),timerId:A,timerType:"interval"}}),A},b=function(y){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,A=a.generateUniqueNumber(s);return s.set(A,y),d.postMessage({id:null,method:"set",params:{delay:_,now:performance.now(),timerId:A,timerType:"timeout"}}),A};return{clearInterval:p,clearTimeout:g,setInterval:f,setTimeout:b}};i.load=e})}),hu=fe((o,c)=>{oe(),ae(),se(),function(i,a){typeof o=="object"&&typeof c<"u"?a(o,cu()):typeof define=="function"&&define.amd?define(["exports","worker-timers-broker"],a):(i=typeof globalThis<"u"?globalThis:i||self,a(i.workerTimers={},i.workerTimersBroker))}(o,function(i,a){var l=function(d,p){var g=null;return function(){if(g!==null)return g;var f=new Blob([p],{type:"application/javascript; charset=utf-8"}),b=URL.createObjectURL(f);return g=d(b),setTimeout(function(){return URL.revokeObjectURL(b)}),g}},r=`(()=>{var e={472:(e,t,r)=>{var o,i;void 0===(i="function"==typeof(o=function(){"use strict";var e=new Map,t=new Map,r=function(t){var r=e.get(t);if(void 0===r)throw new Error('There is no interval scheduled with the given id "'.concat(t,'".'));clearTimeout(r),e.delete(t)},o=function(e){var r=t.get(e);if(void 0===r)throw new Error('There is no timeout scheduled with the given id "'.concat(e,'".'));clearTimeout(r),t.delete(e)},i=function(e,t){var r,o=performance.now();return{expected:o+(r=e-Math.max(0,o-t)),remainingDelay:r}},n=function e(t,r,o,i){var n=performance.now();n>o?postMessage({id:null,method:"call",params:{timerId:r,timerType:i}}):t.set(r,setTimeout(e,o-n,t,r,o,i))},a=function(t,r,o){var a=i(t,o),s=a.expected,d=a.remainingDelay;e.set(r,setTimeout(n,d,e,r,s,"interval"))},s=function(e,r,o){var a=i(e,o),s=a.expected,d=a.remainingDelay;t.set(r,setTimeout(n,d,t,r,s,"timeout"))};addEventListener("message",(function(e){var t=e.data;try{if("clear"===t.method){var i=t.id,n=t.params,d=n.timerId,c=n.timerType;if("interval"===c)r(d),postMessage({error:null,id:i});else{if("timeout"!==c)throw new Error('The given type "'.concat(c,'" is not supported'));o(d),postMessage({error:null,id:i})}}else{if("set"!==t.method)throw new Error('The given method "'.concat(t.method,'" is not supported'));var u=t.params,l=u.delay,p=u.now,m=u.timerId,v=u.timerType;if("interval"===v)a(l,m,p);else{if("timeout"!==v)throw new Error('The given type "'.concat(v,'" is not supported'));s(l,m,p)}}}catch(e){postMessage({error:{message:e.message},id:t.id,result:null})}}))})?o.call(t,r,t,e):o)||(e.exports=i)}},t={};function r(o){var i=t[o];if(void 0!==i)return i.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";r(472)})()})();`,e=l(a.load,r),n=function(d){return e().clearInterval(d)},t=function(d){return e().clearTimeout(d)},s=function(){var d;return(d=e()).setInterval.apply(d,arguments)},u=function(){var d;return(d=e()).setTimeout.apply(d,arguments)};i.clearInterval=n,i.clearTimeout=t,i.setInterval=s,i.setTimeout=u})}),fu=fe(o=>{oe(),ae(),se();var c=o&&o.__createBinding||(Object.create?function(s,u,d,p){p===void 0&&(p=d);var g=Object.getOwnPropertyDescriptor(u,d);(!g||("get"in g?!u.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return u[d]}}),Object.defineProperty(s,p,g)}:function(s,u,d,p){p===void 0&&(p=d),s[p]=u[d]}),i=o&&o.__setModuleDefault||(Object.create?function(s,u){Object.defineProperty(s,"default",{enumerable:!0,value:u})}:function(s,u){s.default=u}),a=o&&o.__importStar||function(){var s=function(u){return s=Object.getOwnPropertyNames||function(d){var p=[];for(var g in d)Object.prototype.hasOwnProperty.call(d,g)&&(p[p.length]=g);return p},s(u)};return function(u){if(u&&u.__esModule)return u;var d={};if(u!=null)for(var p=s(u),g=0;g<p.length;g++)p[g]!=="default"&&c(d,u,p[g]);return i(d,u),d}}();Object.defineProperty(o,"__esModule",{value:!0});var l=a(or()),r=hu(),e={set:r.setInterval,clear:r.clearInterval},n={set:(s,u)=>setInterval(s,u),clear:s=>clearInterval(s)},t=s=>{switch(s){case"native":return n;case"worker":return e;case"auto":default:return l.default&&!l.isWebWorker&&!l.isReactNativeBrowser?e:n}};o.default=t}),xo=fe(o=>{oe(),ae(),se();var c=o&&o.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(o,"__esModule",{value:!0});var i=c(fu()),a=class{get keepaliveTimeoutTimestamp(){return this._keepaliveTimeoutTimestamp}get intervalEvery(){return this._intervalEvery}get keepalive(){return this._keepalive}constructor(l,r){this.destroyed=!1,this.client=l,this.timer=typeof r=="object"&&"set"in r&&"clear"in r?r:(0,i.default)(r),this.setKeepalive(l.options.keepalive)}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}setKeepalive(l){if(l*=1e3,isNaN(l)||l<=0||l>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${l}`);this._keepalive=l,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${l}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;let l=Math.ceil(this._keepalive*1.5);this._keepaliveTimeoutTimestamp=Date.now()+l,this._intervalEvery=Math.ceil(this._keepalive/2),this.timerId=this.timer.set(()=>{this.destroyed||(this.counter+=1,this.counter===2?this.client.sendPing():this.counter>2&&this.client.onKeepaliveTimeout())},this._intervalEvery)}};o.default=a}),Vn=fe(o=>{oe(),ae(),se();var c=o&&o.__createBinding||(Object.create?function(k,E,I,O){O===void 0&&(O=I);var H=Object.getOwnPropertyDescriptor(E,I);(!H||("get"in H?!E.__esModule:H.writable||H.configurable))&&(H={enumerable:!0,get:function(){return E[I]}}),Object.defineProperty(k,O,H)}:function(k,E,I,O){O===void 0&&(O=I),k[O]=E[I]}),i=o&&o.__setModuleDefault||(Object.create?function(k,E){Object.defineProperty(k,"default",{enumerable:!0,value:E})}:function(k,E){k.default=E}),a=o&&o.__importStar||function(){var k=function(E){return k=Object.getOwnPropertyNames||function(I){var O=[];for(var H in I)Object.prototype.hasOwnProperty.call(I,H)&&(O[O.length]=H);return O},k(E)};return function(E){if(E&&E.__esModule)return E;var I={};if(E!=null)for(var O=k(E),H=0;H<O.length;H++)O[H]!=="default"&&c(I,E,O[H]);return i(I,E),I}}(),l=o&&o.__importDefault||function(k){return k&&k.__esModule?k:{default:k}};Object.defineProperty(o,"__esModule",{value:!0});var r=l(wl()),e=l(Ll()),n=l(So()),t=St(),s=l(Fl()),u=a(jl()),d=l(lt()),p=l(Co()),g=l(au()),f=Dt(),b=lu(),y=l(xo()),_=a(or()),A=globalThis.setImmediate||((...k)=>{let E=k.shift();(0,f.nextTick)(()=>{E(...k)})}),w={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,subscribeBatchSize:null,writeCache:!0,timerVariant:"auto"},T=class hi extends b.TypedEventEmitter{static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(E,I){super(),this.options=I||{};for(let O in w)typeof this.options[O]>"u"?this.options[O]=w[O]:this.options[O]=I[O];this.log=this.options.log||(0,d.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",hi.VERSION),_.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",_.default?"browser":"node"),this.log("MqttClient :: options.protocol",I.protocol),this.log("MqttClient :: options.protocolVersion",I.protocolVersion),this.log("MqttClient :: options.username",I.username),this.log("MqttClient :: options.keepalive",I.keepalive),this.log("MqttClient :: options.reconnectPeriod",I.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",I.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",I.properties?I.properties.topicAliasMaximum:void 0),this.options.clientId=typeof I.clientId=="string"?I.clientId:hi.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=I.protocolVersion===5&&I.customHandleAcks?I.customHandleAcks:(...O)=>{O[3](null,0)},this.options.writeCache||(e.default.writeToStream.cacheNumbers=!1),this.streamBuilder=E,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new n.default:this.options.messageIdProvider,this.outgoingStore=I.outgoingStore||new p.default,this.incomingStore=I.incomingStore||new p.default,this.queueQoSZero=I.queueQoSZero===void 0?!0:I.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.keepaliveManager=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,I.properties&&I.properties.topicAliasMaximum>0&&(I.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new r.default(I.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:O}=this,H=()=>{let G=O.shift();this.log("deliver :: entry %o",G);let de=null;if(!G){this._resubscribe();return}de=G.packet,this.log("deliver :: call _sendPacket for %o",de);let U=!0;de.messageId&&de.messageId!==0&&(this.messageIdProvider.register(de.messageId)||(U=!1)),U?this._sendPacket(de,$=>{G.cb&&G.cb($),H()}):(this.log("messageId: %d has already used. The message is skipped and removed.",de.messageId),H())};this.log("connect :: sending queued packets"),H()}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this._destroyKeepaliveManager(),this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()}),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}handleAuth(E,I){I()}handleMessage(E,I){I()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var E;let I=new t.Writable,O=e.default.parser(this.options),H=null,G=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new p.default,this.outgoingStore=this.options.outgoingStore||new p.default,this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),O.on("packet",F=>{this.log("parser :: on packet push to packets array."),G.push(F)});let de=()=>{this.log("work :: getting next packet in queue");let F=G.shift();if(F)this.log("work :: packet pulled from queue"),(0,g.default)(this,F,U);else{this.log("work :: no packets in queue");let me=H;H=null,this.log("work :: done flag is %s",!!me),me&&me()}},U=()=>{if(G.length)(0,f.nextTick)(de);else{let F=H;H=null,F()}};I._write=(F,me,le)=>{H=le,this.log("writable stream :: parsing buffer"),O.parse(F),de()};let $=F=>{this.log("streamErrorHandler :: error",F.message),F.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",F)):this.noop(F)};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(I),this.stream.on("error",$),this.stream.on("close",()=>{this.log("(%s)stream :: on close",this.options.clientId),this._flushVolatile(),this.log("stream: emit close to MqttClient"),this.emit("close")}),this.log("connect: sending packet `connect`");let z={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties};if(this.options.will&&(z.will=Object.assign(Object.assign({},this.options.will),{payload:(E=this.options.will)===null||E===void 0?void 0:E.payload})),this.topicAliasRecv&&(z.properties||(z.properties={}),this.topicAliasRecv&&(z.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(z),O.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&typeof this.options.authPacket=="object"){let F=Object.assign({cmd:"auth",reasonCode:0},this.options.authPacket);this._writePacket(F)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this.emit("error",new Error("connack timeout")),this._cleanUp(!0)},this.options.connectTimeout),this}publish(E,I,O,H){this.log("publish :: message `%s` to topic `%s`",I,E);let{options:G}=this;typeof O=="function"&&(H=O,O=null),O=O||{},O=Object.assign(Object.assign({},{qos:0,retain:!1,dup:!1}),O);let{qos:de,retain:U,dup:$,properties:z,cbStorePut:F}=O;if(this._checkDisconnecting(H))return this;let me=()=>{let le=0;if((de===1||de===2)&&(le=this._nextId(),le===null))return this.log("No messageId left"),!1;let pe={cmd:"publish",topic:E,payload:I,qos:de,retain:U,messageId:le,dup:$};switch(G.protocolVersion===5&&(pe.properties=z),this.log("publish :: qos",de),de){case 1:case 2:this.outgoing[pe.messageId]={volatile:!1,cb:H||this.noop},this.log("MqttClient:publish: packet cmd: %s",pe.cmd),this._sendPacket(pe,void 0,F);break;default:this.log("MqttClient:publish: packet cmd: %s",pe.cmd),this._sendPacket(pe,H,F);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!me())&&this._storeProcessingQueue.push({invoke:me,cbStorePut:O.cbStorePut,callback:H}),this}publishAsync(E,I,O){return new Promise((H,G)=>{this.publish(E,I,O,(de,U)=>{de?G(de):H(U)})})}subscribe(E,I,O){let H=this.options.protocolVersion;typeof I=="function"&&(O=I),O=O||this.noop;let G=!1,de=[];typeof E=="string"?(E=[E],de=E):Array.isArray(E)?de=E:typeof E=="object"&&(G=E.resubscribe,delete E.resubscribe,de=Object.keys(E));let U=u.validateTopics(de);if(U!==null)return A(O,new Error(`Invalid topic ${U}`)),this;if(this._checkDisconnecting(O))return this.log("subscribe: discconecting true"),this;let $={qos:0};H===5&&($.nl=!1,$.rap=!1,$.rh=0),I=Object.assign(Object.assign({},$),I);let z=I.properties,F=[],me=(we,Q)=>{if(Q=Q||I,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,we)||this._resubscribeTopics[we].qos<Q.qos||G){let he={topic:we,qos:Q.qos};H===5&&(he.nl=Q.nl,he.rap=Q.rap,he.rh=Q.rh,he.properties=z),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",he.topic,he.qos),F.push(he)}};if(Array.isArray(E)?E.forEach(we=>{this.log("subscribe: array topic %s",we),me(we)}):Object.keys(E).forEach(we=>{this.log("subscribe: object topic %s, %o",we,E[we]),me(we,E[we])}),!F.length)return O(null,[]),this;let le=(we,Q)=>{let he={cmd:"subscribe",subscriptions:we,messageId:Q};if(z&&(he.properties=z),this.options.resubscribe){this.log("subscribe :: resubscribe true");let ce=[];we.forEach(ye=>{if(this.options.reconnectPeriod>0){let J={qos:ye.qos};H===5&&(J.nl=ye.nl||!1,J.rap=ye.rap||!1,J.rh=ye.rh||0,J.properties=ye.properties),this._resubscribeTopics[ye.topic]=J,ce.push(ye.topic)}}),this.messageIdToTopic[he.messageId]=ce}let x=new Promise((ce,ye)=>{this.outgoing[he.messageId]={volatile:!0,cb(J,_e){if(!J){let{granted:K}=_e;for(let M=0;M<K.length;M+=1)we[M].qos=K[M]}J?ye(new f.ErrorWithSubackPacket(J.message,_e)):ce(_e)}}});return this.log("subscribe :: call _sendPacket"),this._sendPacket(he),x},pe=()=>{var we;let Q=(we=this.options.subscribeBatchSize)!==null&&we!==void 0?we:F.length,he=[];for(let x=0;x<F.length;x+=Q){let ce=F.slice(x,x+Q),ye=this._nextId();if(ye===null)return this.log("No messageId left"),!1;he.push(le(ce,ye))}return Promise.all(he).then(x=>{O(null,F,x.at(-1))}).catch(x=>{O(x,F,x.packet)}),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!pe())&&this._storeProcessingQueue.push({invoke:pe,callback:O}),this}subscribeAsync(E,I){return new Promise((O,H)=>{this.subscribe(E,I,(G,de)=>{G?H(G):O(de)})})}unsubscribe(E,I,O){typeof E=="string"&&(E=[E]),typeof I=="function"&&(O=I),O=O||this.noop;let H=u.validateTopics(E);if(H!==null)return A(O,new Error(`Invalid topic ${H}`)),this;if(this._checkDisconnecting(O))return this;let G=()=>{let de=this._nextId();if(de===null)return this.log("No messageId left"),!1;let U={cmd:"unsubscribe",messageId:de,unsubscriptions:[]};return typeof E=="string"?U.unsubscriptions=[E]:Array.isArray(E)&&(U.unsubscriptions=E),this.options.resubscribe&&U.unsubscriptions.forEach($=>{delete this._resubscribeTopics[$]}),typeof I=="object"&&I.properties&&(U.properties=I.properties),this.outgoing[U.messageId]={volatile:!0,cb:O},this.log("unsubscribe: call _sendPacket"),this._sendPacket(U),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!G())&&this._storeProcessingQueue.push({invoke:G,callback:O}),this}unsubscribeAsync(E,I){return new Promise((O,H)=>{this.unsubscribe(E,I,(G,de)=>{G?H(G):O(de)})})}end(E,I,O){this.log("end :: (%s)",this.options.clientId),(E==null||typeof E!="boolean")&&(O=O||I,I=E,E=!1),typeof I!="object"&&(O=O||I,I=null),this.log("end :: cb? %s",!!O),(!O||typeof O!="function")&&(O=this.noop);let H=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close(de=>{this.outgoingStore.close(U=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),O){let $=de||U;this.log("end :: closeStores: invoking callback with args"),O($)}})}),this._deferredReconnect?this._deferredReconnect():(this.options.reconnectPeriod===0||this.options.manualConnect)&&(this.disconnecting=!1)},G=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,E),this._cleanUp(E,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,f.nextTick)(H)},I)};return this.disconnecting?(O(),this):(this._clearReconnect(),this.disconnecting=!0,!E&&Object.keys(this.outgoing).length>0?(this.log("end :: (%s) :: calling finish in 10ms once outgoing is empty",this.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,G,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),G()),this)}endAsync(E,I){return new Promise((O,H)=>{this.end(E,I,G=>{G?H(G):O()})})}removeOutgoingMessage(E){if(this.outgoing[E]){let{cb:I}=this.outgoing[E];this._removeOutgoingAndStoreMessage(E,()=>{I(new Error("Message removed"))})}return this}reconnect(E){this.log("client reconnect");let I=()=>{E?(this.options.incomingStore=E.incomingStore,this.options.outgoingStore=E.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new p.default,this.outgoingStore=this.options.outgoingStore||new p.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=I:I(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach(E=>{this.outgoing[E].volatile&&typeof this.outgoing[E].cb=="function"&&(this.outgoing[E].cb(new Error("Connection closed")),delete this.outgoing[E])}))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(E=>{typeof this.outgoing[E].cb=="function"&&(this.outgoing[E].cb(new Error("Connection closed")),delete this.outgoing[E])}))}_removeTopicAliasAndRecoverTopicName(E){let I;E.properties&&(I=E.properties.topicAlias);let O=E.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",I,O),O.length===0){if(typeof I>"u")return new Error("Unregistered Topic Alias");if(O=this.topicAliasSend.getTopicByAlias(I),typeof O>"u")return new Error("Unregistered Topic Alias");E.topic=O}I&&delete E.properties.topicAlias}_checkDisconnecting(E){return this.disconnecting&&(E&&E!==this.noop?E(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this.connect()}),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()},this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(E,I,O={}){if(I&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",I)),this.log("_cleanUp :: forced? %s",E),E)this.options.reconnectPeriod===0&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let H=Object.assign({cmd:"disconnect"},O);this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(H,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),A(()=>{this.stream.end(()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)})})})}!this.disconnecting&&!this.reconnecting&&(this.log("_cleanUp :: client not disconnecting/reconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this._destroyKeepaliveManager(),I&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",I),I())}_storeAndSend(E,I,O){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",E.cmd);let H=E,G;if(H.cmd==="publish"&&(H=(0,s.default)(E),G=this._removeTopicAliasAndRecoverTopicName(H),G))return I&&I(G);this.outgoingStore.put(H,de=>{if(de)return I&&I(de);O(),this._writePacket(E,I)})}_applyTopicAlias(E){if(this.options.protocolVersion===5&&E.cmd==="publish"){let I;E.properties&&(I=E.properties.topicAlias);let O=E.topic.toString();if(this.topicAliasSend)if(I){if(O.length!==0&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",O,I),!this.topicAliasSend.put(O,I)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",O,I),new Error("Sending Topic Alias out of range")}else O.length!==0&&(this.options.autoAssignTopicAlias?(I=this.topicAliasSend.getAliasByTopic(O),I?(E.topic="",E.properties=Object.assign(Object.assign({},E.properties),{topicAlias:I}),this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",O,I)):(I=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(O,I),E.properties=Object.assign(Object.assign({},E.properties),{topicAlias:I}),this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",O,I))):this.options.autoUseTopicAlias&&(I=this.topicAliasSend.getAliasByTopic(O),I&&(E.topic="",E.properties=Object.assign(Object.assign({},E.properties),{topicAlias:I}),this.log("applyTopicAlias :: auto use topic: %s - alias: %d",O,I))));else if(I)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",O,I),new Error("Sending Topic Alias out of range")}}_noop(E){this.log("noop ::",E)}_writePacket(E,I){this.log("_writePacket :: packet: %O",E),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",E),this.log("_writePacket :: writing to stream");let O=e.default.writeToStream(E,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",O),!O&&I&&I!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",I)):I&&(this.log("_writePacket :: invoking cb"),I())}_sendPacket(E,I,O,H){this.log("_sendPacket :: (%s) :: start",this.options.clientId),O=O||this.noop,I=I||this.noop;let G=this._applyTopicAlias(E);if(G){I(G);return}if(!this.connected){if(E.cmd==="auth"){this._writePacket(E,I);return}this.log("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(E,I,O);return}if(H){this._writePacket(E,I);return}switch(E.cmd){case"publish":break;case"pubrel":this._storeAndSend(E,I,O);return;default:this._writePacket(E,I);return}switch(E.qos){case 2:case 1:this._storeAndSend(E,I,O);break;case 0:default:this._writePacket(E,I);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}_storePacket(E,I,O){this.log("_storePacket :: packet: %o",E),this.log("_storePacket :: cb? %s",!!I),O=O||this.noop;let H=E;if(H.cmd==="publish"){H=(0,s.default)(E);let de=this._removeTopicAliasAndRecoverTopicName(H);if(de)return I&&I(de)}let G=H.qos||0;G===0&&this.queueQoSZero||H.cmd!=="publish"?this.queue.push({packet:H,cb:I}):G>0?(I=this.outgoing[H.messageId]?this.outgoing[H.messageId].cb:null,this.outgoingStore.put(H,de=>{if(de)return I&&I(de);O()})):I&&I(new Error("No connection to broker"))}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.options.keepalive),!this.keepaliveManager&&this.options.keepalive&&(this.keepaliveManager=new y.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(E=!1){this.keepaliveManager&&this.options.keepalive&&(E||this.options.reschedulePings)&&this._reschedulePing()}_reschedulePing(){this.log("_reschedulePing :: rescheduling ping"),this.keepaliveManager.reschedule()}sendPing(){this.log("_sendPing :: sending pingreq"),this._sendPacket({cmd:"pingreq"})}onKeepaliveTimeout(){this.emit("error",new Error("Keepalive timeout")),this.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0)}_resubscribe(){this.log("_resubscribe");let E=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&E.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){this.log("_resubscribe: protocolVersion 5");for(let I=0;I<E.length;I++){let O={};O[E[I]]=this._resubscribeTopics[E[I]],O.resubscribe=!0,this.subscribe(O,{properties:O[E[I]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(E){if(this.disconnected){this.emit("connect",E);return}this.connackPacket=E,this.messageIdProvider.clear(),this._setupKeepaliveManager(),this.connected=!0;let I=()=>{let O=this.outgoingStore.createStream(),H=()=>{O.destroy(),O=null,this._flushStoreProcessingQueue(),G()},G=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",H),O.on("error",U=>{G(),this._flushStoreProcessingQueue(),this.removeListener("close",H),this.emit("error",U)});let de=()=>{if(!O)return;let U=O.read(1),$;if(!U){O.once("readable",de);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[U.messageId]){de();return}!this.disconnecting&&!this.reconnectTimer?($=this.outgoing[U.messageId]?this.outgoing[U.messageId].cb:null,this.outgoing[U.messageId]={volatile:!1,cb(z,F){$&&$(z,F),de()}},this._packetIdsDuringStoreProcessing[U.messageId]=!0,this.messageIdProvider.register(U.messageId)?this._sendPacket(U,void 0,void 0,!0):this.log("messageId: %d has already used.",U.messageId)):O.destroy&&O.destroy()};O.on("end",()=>{let U=!0;for(let $ in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[$]){U=!1;break}this.removeListener("close",H),U?(G(),this._invokeAllStoreProcessingQueue(),this.emit("connect",E)):I()}),de()};I()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){let E=this._storeProcessingQueue[0];if(E&&E.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(let E of this._storeProcessingQueue)E.cbStorePut&&E.cbStorePut(new Error("Connection closed")),E.callback&&E.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(E,I){delete this.outgoing[E],this.outgoingStore.del({messageId:E},(O,H)=>{I(O,H),this.messageIdProvider.deallocate(E),this._invokeStoreProcessingQueue()})}};T.VERSION=f.MQTTJS_VERSION,o.default=T}),du=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"__esModule",{value:!0});var c=Po(),i=class{constructor(){this.numberAllocator=new c.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(a){return this.numberAllocator.use(a)}deallocate(a){this.numberAllocator.free(a)}clear(){this.numberAllocator.clear()}};o.default=i});function Ct(o){throw new RangeError(No[o])}function Ro(o,c){let i=o.split("@"),a="";i.length>1&&(a=i[0]+"@",o=i[1]);let l=function(r,e){let n=[],t=r.length;for(;t--;)n[t]=e(r[t]);return n}((o=o.replace(Lo,".")).split("."),c).join(".");return a+l}function Mo(o){let c=[],i=0,a=o.length;for(;i<a;){let l=o.charCodeAt(i++);if(l>=55296&&l<=56319&&i<a){let r=o.charCodeAt(i++);(64512&r)==56320?c.push(((1023&l)<<10)+(1023&r)+65536):(c.push(l),i--)}else c.push(l)}return c}var Uo,Do,Lo,No,Je,sr,Qn,Kn,Hn,qn,bt,pu=He(()=>{oe(),ae(),se(),Uo=/^xn--/,Do=/[^\0-\x7E]/,Lo=/[\x2E\u3002\uFF0E\uFF61]/g,No={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Je=Math.floor,sr=String.fromCharCode,Qn=function(o,c){return o+22+75*(o<26)-((c!=0)<<5)},Kn=function(o,c,i){let a=0;for(o=i?Je(o/700):o>>1,o+=Je(o/c);o>455;a+=36)o=Je(o/35);return Je(a+36*o/(o+38))},Hn=function(o){let c=[],i=o.length,a=0,l=128,r=72,e=o.lastIndexOf("-");e<0&&(e=0);for(let t=0;t<e;++t)o.charCodeAt(t)>=128&&Ct("not-basic"),c.push(o.charCodeAt(t));for(let t=e>0?e+1:0;t<i;){let s=a;for(let d=1,p=36;;p+=36){t>=i&&Ct("invalid-input");let g=(n=o.charCodeAt(t++))-48<10?n-22:n-65<26?n-65:n-97<26?n-97:36;(g>=36||g>Je((2147483647-a)/d))&&Ct("overflow"),a+=g*d;let f=p<=r?1:p>=r+26?26:p-r;if(g<f)break;let b=36-f;d>Je(2147483647/b)&&Ct("overflow"),d*=b}let u=c.length+1;r=Kn(a-s,u,s==0),Je(a/u)>2147483647-l&&Ct("overflow"),l+=Je(a/u),a%=u,c.splice(a++,0,l)}var n;return String.fromCodePoint(...c)},qn=function(o){let c=[],i=(o=Mo(o)).length,a=128,l=0,r=72;for(let t of o)t<128&&c.push(sr(t));let e=c.length,n=e;for(e&&c.push("-");n<i;){let t=2147483647;for(let u of o)u>=a&&u<t&&(t=u);let s=n+1;t-a>Je((2147483647-l)/s)&&Ct("overflow"),l+=(t-a)*s,a=t;for(let u of o)if(u<a&&++l>2147483647&&Ct("overflow"),u==a){let d=l;for(let p=36;;p+=36){let g=p<=r?1:p>=r+26?26:p-r;if(d<g)break;let f=d-g,b=36-g;c.push(sr(Qn(g+f%b,0))),d=Je(f/b)}c.push(sr(Qn(d,0))),r=Kn(l,s,n==e),l=0,++n}++l,++a}return c.join("")},bt={version:"2.1.0",ucs2:{decode:Mo,encode:o=>String.fromCodePoint(...o)},decode:Hn,encode:qn,toASCII:function(o){return Ro(o,function(c){return Do.test(c)?"xn--"+qn(c):c})},toUnicode:function(o){return Ro(o,function(c){return Uo.test(c)?Hn(c.slice(4).toLowerCase()):c})}},bt.decode,bt.encode,bt.toASCII,bt.toUnicode,bt.ucs2,bt.version});function gu(o,c){return Object.prototype.hasOwnProperty.call(o,c)}var Fo,Lt,jo,et,mu=He(()=>{oe(),ae(),se(),Fo=function(o,c,i,a){c=c||"&",i=i||"=";var l={};if(typeof o!="string"||o.length===0)return l;var r=/\+/g;o=o.split(c);var e=1e3;a&&typeof a.maxKeys=="number"&&(e=a.maxKeys);var n=o.length;e>0&&n>e&&(n=e);for(var t=0;t<n;++t){var s,u,d,p,g=o[t].replace(r,"%20"),f=g.indexOf(i);f>=0?(s=g.substr(0,f),u=g.substr(f+1)):(s=g,u=""),d=decodeURIComponent(s),p=decodeURIComponent(u),gu(l,d)?Array.isArray(l[d])?l[d].push(p):l[d]=[l[d],p]:l[d]=p}return l},Lt=function(o){switch(typeof o){case"string":return o;case"boolean":return o?"true":"false";case"number":return isFinite(o)?o:"";default:return""}},jo=function(o,c,i,a){return c=c||"&",i=i||"=",o===null&&(o=void 0),typeof o=="object"?Object.keys(o).map(function(l){var r=encodeURIComponent(Lt(l))+i;return Array.isArray(o[l])?o[l].map(function(e){return r+encodeURIComponent(Lt(e))}).join(c):r+encodeURIComponent(Lt(o[l]))}).join(c):a?encodeURIComponent(Lt(a))+i+encodeURIComponent(Lt(o)):""},et={},et.decode=et.parse=Fo,et.encode=et.stringify=jo,et.decode,et.encode,et.parse,et.stringify});function $n(){throw new Error("setTimeout has not been defined")}function zn(){throw new Error("clearTimeout has not been defined")}function Wo(o){if(ft===setTimeout)return setTimeout(o,0);if((ft===$n||!ft)&&setTimeout)return ft=setTimeout,setTimeout(o,0);try{return ft(o,0)}catch{try{return ft.call(null,o,0)}catch{return ft.call(this||kt,o,0)}}}function Au(){Tt&&It&&(Tt=!1,It.length?tt=It.concat(tt):Kt=-1,tt.length&&Vo())}function Vo(){if(!Tt){var o=Wo(Au);Tt=!0;for(var c=tt.length;c;){for(It=tt,tt=[];++Kt<c;)It&&It[Kt].run();Kt=-1,c=tt.length}It=null,Tt=!1,function(i){if(dt===clearTimeout)return clearTimeout(i);if((dt===zn||!dt)&&clearTimeout)return dt=clearTimeout,clearTimeout(i);try{dt(i)}catch{try{return dt.call(null,i)}catch{return dt.call(this||kt,i)}}}(o)}}function Qo(o,c){(this||kt).fun=o,(this||kt).array=c}function ht(){}var Ko,ft,dt,kt,Le,It,tt,Tt,Kt,De,bu=He(()=>{oe(),ae(),se(),kt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Le=Ko={},function(){try{ft=typeof setTimeout=="function"?setTimeout:$n}catch{ft=$n}try{dt=typeof clearTimeout=="function"?clearTimeout:zn}catch{dt=zn}}(),tt=[],Tt=!1,Kt=-1,Le.nextTick=function(o){var c=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)c[i-1]=arguments[i];tt.push(new Qo(o,c)),tt.length!==1||Tt||Wo(Vo)},Qo.prototype.run=function(){(this||kt).fun.apply(null,(this||kt).array)},Le.title="browser",Le.browser=!0,Le.env={},Le.argv=[],Le.version="",Le.versions={},Le.on=ht,Le.addListener=ht,Le.once=ht,Le.off=ht,Le.removeListener=ht,Le.removeAllListeners=ht,Le.emit=ht,Le.prependListener=ht,Le.prependOnceListener=ht,Le.listeners=function(o){return[]},Le.binding=function(o){throw new Error("process.binding is not supported")},Le.cwd=function(){return"/"},Le.chdir=function(o){throw new Error("process.chdir is not supported")},Le.umask=function(){return 0},De=Ko,De.addListener,De.argv,De.binding,De.browser,De.chdir,De.cwd,De.emit,De.env,De.listeners,De.nextTick,De.off,De.on,De.once,De.prependListener,De.prependOnceListener,De.removeAllListeners,De.removeListener,De.title,De.umask,De.version,De.versions});function yu(){if(Gn)return ar;Gn=!0;var o=ar={},c,i;function a(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?c=setTimeout:c=a}catch{c=a}try{typeof clearTimeout=="function"?i=clearTimeout:i=l}catch{i=l}})();function r(b){if(c===setTimeout)return setTimeout(b,0);if((c===a||!c)&&setTimeout)return c=setTimeout,setTimeout(b,0);try{return c(b,0)}catch{try{return c.call(null,b,0)}catch{return c.call(this||Bt,b,0)}}}function e(b){if(i===clearTimeout)return clearTimeout(b);if((i===l||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(b);try{return i(b)}catch{try{return i.call(null,b)}catch{return i.call(this||Bt,b)}}}var n=[],t=!1,s,u=-1;function d(){!t||!s||(t=!1,s.length?n=s.concat(n):u=-1,n.length&&p())}function p(){if(!t){var b=r(d);t=!0;for(var y=n.length;y;){for(s=n,n=[];++u<y;)s&&s[u].run();u=-1,y=n.length}s=null,t=!1,e(b)}}o.nextTick=function(b){var y=new Array(arguments.length-1);if(arguments.length>1)for(var _=1;_<arguments.length;_++)y[_-1]=arguments[_];n.push(new g(b,y)),n.length===1&&!t&&r(p)};function g(b,y){(this||Bt).fun=b,(this||Bt).array=y}g.prototype.run=function(){(this||Bt).fun.apply(null,(this||Bt).array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={};function f(){}return o.on=f,o.addListener=f,o.once=f,o.off=f,o.removeListener=f,o.removeAllListeners=f,o.emit=f,o.prependListener=f,o.prependOnceListener=f,o.listeners=function(b){return[]},o.binding=function(b){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(b){throw new Error("process.chdir is not supported")},o.umask=function(){return 0},ar}var ar,Gn,Bt,Re,Ho=He(()=>{oe(),ae(),se(),ar={},Gn=!1,Bt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Re=yu(),Re.platform="browser",Re.addListener,Re.argv,Re.binding,Re.browser,Re.chdir,Re.cwd,Re.emit,Re.env,Re.listeners,Re.nextTick,Re.off,Re.on,Re.once,Re.prependListener,Re.prependOnceListener,Re.removeAllListeners,Re.removeListener,Re.title,Re.umask,Re.version,Re.versions});function wu(){if(Yn)return lr;Yn=!0;var o=Re;function c(r){if(typeof r!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(r))}function i(r,e){for(var n="",t=0,s=-1,u=0,d,p=0;p<=r.length;++p){if(p<r.length)d=r.charCodeAt(p);else{if(d===47)break;d=47}if(d===47){if(!(s===p-1||u===1))if(s!==p-1&&u===2){if(n.length<2||t!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){var g=n.lastIndexOf("/");if(g!==n.length-1){g===-1?(n="",t=0):(n=n.slice(0,g),t=n.length-1-n.lastIndexOf("/")),s=p,u=0;continue}}else if(n.length===2||n.length===1){n="",t=0,s=p,u=0;continue}}e&&(n.length>0?n+="/..":n="..",t=2)}else n.length>0?n+="/"+r.slice(s+1,p):n=r.slice(s+1,p),t=p-s-1;s=p,u=0}else d===46&&u!==-1?++u:u=-1}return n}function a(r,e){var n=e.dir||e.root,t=e.base||(e.name||"")+(e.ext||"");return n?n===e.root?n+t:n+r+t:t}var l={resolve:function(){for(var r="",e=!1,n,t=arguments.length-1;t>=-1&&!e;t--){var s;t>=0?s=arguments[t]:(n===void 0&&(n=o.cwd()),s=n),c(s),s.length!==0&&(r=s+"/"+r,e=s.charCodeAt(0)===47)}return r=i(r,!e),e?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(r){if(c(r),r.length===0)return".";var e=r.charCodeAt(0)===47,n=r.charCodeAt(r.length-1)===47;return r=i(r,!e),r.length===0&&!e&&(r="."),r.length>0&&n&&(r+="/"),e?"/"+r:r},isAbsolute:function(r){return c(r),r.length>0&&r.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var r,e=0;e<arguments.length;++e){var n=arguments[e];c(n),n.length>0&&(r===void 0?r=n:r+="/"+n)}return r===void 0?".":l.normalize(r)},relative:function(r,e){if(c(r),c(e),r===e||(r=l.resolve(r),e=l.resolve(e),r===e))return"";for(var n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var t=r.length,s=t-n,u=1;u<e.length&&e.charCodeAt(u)===47;++u);for(var d=e.length,p=d-u,g=s<p?s:p,f=-1,b=0;b<=g;++b){if(b===g){if(p>g){if(e.charCodeAt(u+b)===47)return e.slice(u+b+1);if(b===0)return e.slice(u+b)}else s>g&&(r.charCodeAt(n+b)===47?f=b:b===0&&(f=0));break}var y=r.charCodeAt(n+b),_=e.charCodeAt(u+b);if(y!==_)break;y===47&&(f=b)}var A="";for(b=n+f+1;b<=t;++b)(b===t||r.charCodeAt(b)===47)&&(A.length===0?A+="..":A+="/..");return A.length>0?A+e.slice(u+f):(u+=f,e.charCodeAt(u)===47&&++u,e.slice(u))},_makeLong:function(r){return r},dirname:function(r){if(c(r),r.length===0)return".";for(var e=r.charCodeAt(0),n=e===47,t=-1,s=!0,u=r.length-1;u>=1;--u)if(e=r.charCodeAt(u),e===47){if(!s){t=u;break}}else s=!1;return t===-1?n?"/":".":n&&t===1?"//":r.slice(0,t)},basename:function(r,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');c(r);var n=0,t=-1,s=!0,u;if(e!==void 0&&e.length>0&&e.length<=r.length){if(e.length===r.length&&e===r)return"";var d=e.length-1,p=-1;for(u=r.length-1;u>=0;--u){var g=r.charCodeAt(u);if(g===47){if(!s){n=u+1;break}}else p===-1&&(s=!1,p=u+1),d>=0&&(g===e.charCodeAt(d)?--d===-1&&(t=u):(d=-1,t=p))}return n===t?t=p:t===-1&&(t=r.length),r.slice(n,t)}else{for(u=r.length-1;u>=0;--u)if(r.charCodeAt(u)===47){if(!s){n=u+1;break}}else t===-1&&(s=!1,t=u+1);return t===-1?"":r.slice(n,t)}},extname:function(r){c(r);for(var e=-1,n=0,t=-1,s=!0,u=0,d=r.length-1;d>=0;--d){var p=r.charCodeAt(d);if(p===47){if(!s){n=d+1;break}continue}t===-1&&(s=!1,t=d+1),p===46?e===-1?e=d:u!==1&&(u=1):e!==-1&&(u=-1)}return e===-1||t===-1||u===0||u===1&&e===t-1&&e===n+1?"":r.slice(e,t)},format:function(r){if(r===null||typeof r!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof r);return a("/",r)},parse:function(r){c(r);var e={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return e;var n=r.charCodeAt(0),t=n===47,s;t?(e.root="/",s=1):s=0;for(var u=-1,d=0,p=-1,g=!0,f=r.length-1,b=0;f>=s;--f){if(n=r.charCodeAt(f),n===47){if(!g){d=f+1;break}continue}p===-1&&(g=!1,p=f+1),n===46?u===-1?u=f:b!==1&&(b=1):u!==-1&&(b=-1)}return u===-1||p===-1||b===0||b===1&&u===p-1&&u===d+1?p!==-1&&(d===0&&t?e.base=e.name=r.slice(1,p):e.base=e.name=r.slice(d,p)):(d===0&&t?(e.name=r.slice(1,u),e.base=r.slice(1,p)):(e.name=r.slice(d,u),e.base=r.slice(d,p)),e.ext=r.slice(u,p)),d>0?e.dir=r.slice(0,d-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};return l.posix=l,lr=l,lr}var lr,Yn,Jn,vu=He(()=>{oe(),ae(),se(),Ho(),lr={},Yn=!1,Jn=wu()}),qo={};Rt(qo,{URL:()=>ys,Url:()=>ps,default:()=>Pe,fileURLToPath:()=>$o,format:()=>gs,parse:()=>bs,pathToFileURL:()=>zo,resolve:()=>ms,resolveObject:()=>As});function Ge(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function Ht(o,c,i){if(o&&Ze.isObject(o)&&o instanceof Ge)return o;var a=new Ge;return a.parse(o,c,i),a}function _u(){if(ti)return fr;ti=!0;var o=De;function c(r){if(typeof r!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(r))}function i(r,e){for(var n="",t=0,s=-1,u=0,d,p=0;p<=r.length;++p){if(p<r.length)d=r.charCodeAt(p);else{if(d===47)break;d=47}if(d===47){if(!(s===p-1||u===1))if(s!==p-1&&u===2){if(n.length<2||t!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){var g=n.lastIndexOf("/");if(g!==n.length-1){g===-1?(n="",t=0):(n=n.slice(0,g),t=n.length-1-n.lastIndexOf("/")),s=p,u=0;continue}}else if(n.length===2||n.length===1){n="",t=0,s=p,u=0;continue}}e&&(n.length>0?n+="/..":n="..",t=2)}else n.length>0?n+="/"+r.slice(s+1,p):n=r.slice(s+1,p),t=p-s-1;s=p,u=0}else d===46&&u!==-1?++u:u=-1}return n}function a(r,e){var n=e.dir||e.root,t=e.base||(e.name||"")+(e.ext||"");return n?n===e.root?n+t:n+r+t:t}var l={resolve:function(){for(var r="",e=!1,n,t=arguments.length-1;t>=-1&&!e;t--){var s;t>=0?s=arguments[t]:(n===void 0&&(n=o.cwd()),s=n),c(s),s.length!==0&&(r=s+"/"+r,e=s.charCodeAt(0)===47)}return r=i(r,!e),e?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(r){if(c(r),r.length===0)return".";var e=r.charCodeAt(0)===47,n=r.charCodeAt(r.length-1)===47;return r=i(r,!e),r.length===0&&!e&&(r="."),r.length>0&&n&&(r+="/"),e?"/"+r:r},isAbsolute:function(r){return c(r),r.length>0&&r.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var r,e=0;e<arguments.length;++e){var n=arguments[e];c(n),n.length>0&&(r===void 0?r=n:r+="/"+n)}return r===void 0?".":l.normalize(r)},relative:function(r,e){if(c(r),c(e),r===e||(r=l.resolve(r),e=l.resolve(e),r===e))return"";for(var n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var t=r.length,s=t-n,u=1;u<e.length&&e.charCodeAt(u)===47;++u);for(var d=e.length,p=d-u,g=s<p?s:p,f=-1,b=0;b<=g;++b){if(b===g){if(p>g){if(e.charCodeAt(u+b)===47)return e.slice(u+b+1);if(b===0)return e.slice(u+b)}else s>g&&(r.charCodeAt(n+b)===47?f=b:b===0&&(f=0));break}var y=r.charCodeAt(n+b),_=e.charCodeAt(u+b);if(y!==_)break;y===47&&(f=b)}var A="";for(b=n+f+1;b<=t;++b)(b===t||r.charCodeAt(b)===47)&&(A.length===0?A+="..":A+="/..");return A.length>0?A+e.slice(u+f):(u+=f,e.charCodeAt(u)===47&&++u,e.slice(u))},_makeLong:function(r){return r},dirname:function(r){if(c(r),r.length===0)return".";for(var e=r.charCodeAt(0),n=e===47,t=-1,s=!0,u=r.length-1;u>=1;--u)if(e=r.charCodeAt(u),e===47){if(!s){t=u;break}}else s=!1;return t===-1?n?"/":".":n&&t===1?"//":r.slice(0,t)},basename:function(r,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');c(r);var n=0,t=-1,s=!0,u;if(e!==void 0&&e.length>0&&e.length<=r.length){if(e.length===r.length&&e===r)return"";var d=e.length-1,p=-1;for(u=r.length-1;u>=0;--u){var g=r.charCodeAt(u);if(g===47){if(!s){n=u+1;break}}else p===-1&&(s=!1,p=u+1),d>=0&&(g===e.charCodeAt(d)?--d===-1&&(t=u):(d=-1,t=p))}return n===t?t=p:t===-1&&(t=r.length),r.slice(n,t)}else{for(u=r.length-1;u>=0;--u)if(r.charCodeAt(u)===47){if(!s){n=u+1;break}}else t===-1&&(s=!1,t=u+1);return t===-1?"":r.slice(n,t)}},extname:function(r){c(r);for(var e=-1,n=0,t=-1,s=!0,u=0,d=r.length-1;d>=0;--d){var p=r.charCodeAt(d);if(p===47){if(!s){n=d+1;break}continue}t===-1&&(s=!1,t=d+1),p===46?e===-1?e=d:u!==1&&(u=1):e!==-1&&(u=-1)}return e===-1||t===-1||u===0||u===1&&e===t-1&&e===n+1?"":r.slice(e,t)},format:function(r){if(r===null||typeof r!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof r);return a("/",r)},parse:function(r){c(r);var e={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return e;var n=r.charCodeAt(0),t=n===47,s;t?(e.root="/",s=1):s=0;for(var u=-1,d=0,p=-1,g=!0,f=r.length-1,b=0;f>=s;--f){if(n=r.charCodeAt(f),n===47){if(!g){d=f+1;break}continue}p===-1&&(g=!1,p=f+1),n===46?u===-1?u=f:b!==1&&(b=1):u!==-1&&(b=-1)}return u===-1||p===-1||b===0||b===1&&u===p-1&&u===d+1?p!==-1&&(d===0&&t?e.base=e.name=r.slice(1,p):e.base=e.name=r.slice(d,p)):(d===0&&t?(e.name=r.slice(1,u),e.base=r.slice(1,p)):(e.name=r.slice(d,u),e.base=r.slice(d,p)),e.ext=r.slice(u,p)),d>0?e.dir=r.slice(0,d-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};return l.posix=l,fr=l,fr}function Eu(o){if(typeof o=="string")o=new URL(o);else if(!(o instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(o.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return dr?Su(o):Cu(o)}function Su(o){let c=o.hostname,i=o.pathname;for(let a=0;a<i.length;a++)if(i[a]==="%"){let l=i.codePointAt(a+2)||32;if(i[a+1]==="2"&&l===102||i[a+1]==="5"&&l===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(i=i.replace(as,"\\"),i=decodeURIComponent(i),c!=="")return`\\\\${c}${i}`;{let a=i.codePointAt(1)|32,l=i[2];if(a<os||a>ss||l!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return i.slice(1)}}function Cu(o){if(o.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let c=o.pathname;for(let i=0;i<c.length;i++)if(c[i]==="%"){let a=c.codePointAt(i+2)||32;if(c[i+1]==="2"&&a===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(c)}function ku(o){let c=ri.resolve(o),i=o.charCodeAt(o.length-1);(i===is||dr&&i===ns)&&c[c.length-1]!==ri.sep&&(c+="/");let a=new URL("file://");return c.includes("%")&&(c=c.replace(ls,"%25")),!dr&&c.includes("\\")&&(c=c.replace(us,"%5C")),c.includes(`
4
+ `)&&(c=c.replace(cs,"%0A")),c.includes("\r")&&(c=c.replace(hs,"%0D")),c.includes(" ")&&(c=c.replace(fs,"%09")),a.pathname=c,a}function $o(o){if(typeof o=="string")o=new URL(o);else if(!(o instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(o.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return pr?Iu(o):Tu(o)}function Iu(o){let c=o.hostname,i=o.pathname;for(let a=0;a<i.length;a++)if(i[a]==="%"){let l=i.codePointAt(a+2)||32;if(i[a+1]==="2"&&l===102||i[a+1]==="5"&&l===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(i=i.replace(Ss,"\\"),i=decodeURIComponent(i),c!=="")return`\\\\${c}${i}`;{let a=i.codePointAt(1)|32,l=i[2];if(a<_s||a>Es||l!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return i.slice(1)}}function Tu(o){if(o.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let c=o.pathname;for(let i=0;i<c.length;i++)if(c[i]==="%"){let a=c.codePointAt(i+2)||32;if(c[i+1]==="2"&&a===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(c)}function zo(o){let c=Jn.resolve(o),i=o.charCodeAt(o.length-1);(i===vs||pr&&i===ws)&&c[c.length-1]!==Jn.sep&&(c+="/");let a=new URL("file://");return c.includes("%")&&(c=c.replace(Cs,"%25")),!pr&&c.includes("\\")&&(c=c.replace(ks,"%5C")),c.includes(`
5
+ `)&&(c=c.replace(Is,"%0A")),c.includes("\r")&&(c=c.replace(Ts,"%0D")),c.includes(" ")&&(c=c.replace(Bs,"%09")),a.pathname=c,a}var Pe,Go,Ze,Yo,Jo,Zo,Xo,ur,Zn,Xn,ei,es,ts,cr,Ot,hr,fr,ti,ri,rs,ns,is,os,ss,dr,as,ls,us,cs,hs,fs,ds,ps,gs,ms,As,bs,ys,ws,vs,_s,Es,pr,Ss,Cs,ks,Is,Ts,Bs,Bu=He(()=>{oe(),ae(),se(),pu(),mu(),bu(),vu(),Ho(),Pe={},Go=bt,Ze={isString:function(o){return typeof o=="string"},isObject:function(o){return typeof o=="object"&&o!==null},isNull:function(o){return o===null},isNullOrUndefined:function(o){return o==null}},Pe.parse=Ht,Pe.resolve=function(o,c){return Ht(o,!1,!0).resolve(c)},Pe.resolveObject=function(o,c){return o?Ht(o,!1,!0).resolveObject(c):c},Pe.format=function(o){return Ze.isString(o)&&(o=Ht(o)),o instanceof Ge?o.format():Ge.prototype.format.call(o)},Pe.Url=Ge,Yo=/^([a-z0-9.+-]+:)/i,Jo=/:[0-9]*$/,Zo=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Xo=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
6
+ `," "]),ur=["'"].concat(Xo),Zn=["%","/","?",";","#"].concat(ur),Xn=["/","?","#"],ei=/^[+a-z0-9A-Z_-]{0,63}$/,es=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ts={javascript:!0,"javascript:":!0},cr={javascript:!0,"javascript:":!0},Ot={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},hr=et,Ge.prototype.parse=function(o,c,i){if(!Ze.isString(o))throw new TypeError("Parameter 'url' must be a string, not "+typeof o);var a=o.indexOf("?"),l=a!==-1&&a<o.indexOf("#")?"?":"#",r=o.split(l);r[0]=r[0].replace(/\\/g,"/");var e=o=r.join(l);if(e=e.trim(),!i&&o.split("#").length===1){var n=Zo.exec(e);if(n)return this.path=e,this.href=e,this.pathname=n[1],n[2]?(this.search=n[2],this.query=c?hr.parse(this.search.substr(1)):this.search.substr(1)):c&&(this.search="",this.query={}),this}var t=Yo.exec(e);if(t){var s=(t=t[0]).toLowerCase();this.protocol=s,e=e.substr(t.length)}if(i||t||e.match(/^\/\/[^@\/]+@[^@\/]+/)){var u=e.substr(0,2)==="//";!u||t&&cr[t]||(e=e.substr(2),this.slashes=!0)}if(!cr[t]&&(u||t&&!Ot[t])){for(var d,p,g=-1,f=0;f<Xn.length;f++)(b=e.indexOf(Xn[f]))!==-1&&(g===-1||b<g)&&(g=b);for((p=g===-1?e.lastIndexOf("@"):e.lastIndexOf("@",g))!==-1&&(d=e.slice(0,p),e=e.slice(p+1),this.auth=decodeURIComponent(d)),g=-1,f=0;f<Zn.length;f++){var b;(b=e.indexOf(Zn[f]))!==-1&&(g===-1||b<g)&&(g=b)}g===-1&&(g=e.length),this.host=e.slice(0,g),e=e.slice(g),this.parseHost(),this.hostname=this.hostname||"";var y=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!y)for(var _=this.hostname.split(/\./),A=(f=0,_.length);f<A;f++){var w=_[f];if(w&&!w.match(ei)){for(var T="",k=0,E=w.length;k<E;k++)w.charCodeAt(k)>127?T+="x":T+=w[k];if(!T.match(ei)){var I=_.slice(0,f),O=_.slice(f+1),H=w.match(es);H&&(I.push(H[1]),O.unshift(H[2])),O.length&&(e="/"+O.join(".")+e),this.hostname=I.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),y||(this.hostname=Go.toASCII(this.hostname));var G=this.port?":"+this.port:"",de=this.hostname||"";this.host=de+G,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),e[0]!=="/"&&(e="/"+e))}if(!ts[s])for(f=0,A=ur.length;f<A;f++){var U=ur[f];if(e.indexOf(U)!==-1){var $=encodeURIComponent(U);$===U&&($=escape(U)),e=e.split(U).join($)}}var z=e.indexOf("#");z!==-1&&(this.hash=e.substr(z),e=e.slice(0,z));var F=e.indexOf("?");if(F!==-1?(this.search=e.substr(F),this.query=e.substr(F+1),c&&(this.query=hr.parse(this.query)),e=e.slice(0,F)):c&&(this.search="",this.query={}),e&&(this.pathname=e),Ot[s]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){G=this.pathname||"";var me=this.search||"";this.path=G+me}return this.href=this.format(),this},Ge.prototype.format=function(){var o=this.auth||"";o&&(o=(o=encodeURIComponent(o)).replace(/%3A/i,":"),o+="@");var c=this.protocol||"",i=this.pathname||"",a=this.hash||"",l=!1,r="";this.host?l=o+this.host:this.hostname&&(l=o+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(l+=":"+this.port)),this.query&&Ze.isObject(this.query)&&Object.keys(this.query).length&&(r=hr.stringify(this.query));var e=this.search||r&&"?"+r||"";return c&&c.substr(-1)!==":"&&(c+=":"),this.slashes||(!c||Ot[c])&&l!==!1?(l="//"+(l||""),i&&i.charAt(0)!=="/"&&(i="/"+i)):l||(l=""),a&&a.charAt(0)!=="#"&&(a="#"+a),e&&e.charAt(0)!=="?"&&(e="?"+e),c+l+(i=i.replace(/[?#]/g,function(n){return encodeURIComponent(n)}))+(e=e.replace("#","%23"))+a},Ge.prototype.resolve=function(o){return this.resolveObject(Ht(o,!1,!0)).format()},Ge.prototype.resolveObject=function(o){if(Ze.isString(o)){var c=new Ge;c.parse(o,!1,!0),o=c}for(var i=new Ge,a=Object.keys(this),l=0;l<a.length;l++){var r=a[l];i[r]=this[r]}if(i.hash=o.hash,o.href==="")return i.href=i.format(),i;if(o.slashes&&!o.protocol){for(var e=Object.keys(o),n=0;n<e.length;n++){var t=e[n];t!=="protocol"&&(i[t]=o[t])}return Ot[i.protocol]&&i.hostname&&!i.pathname&&(i.path=i.pathname="/"),i.href=i.format(),i}if(o.protocol&&o.protocol!==i.protocol){if(!Ot[o.protocol]){for(var s=Object.keys(o),u=0;u<s.length;u++){var d=s[u];i[d]=o[d]}return i.href=i.format(),i}if(i.protocol=o.protocol,o.host||cr[o.protocol])i.pathname=o.pathname;else{for(var p=(o.pathname||"").split("/");p.length&&!(o.host=p.shift()););o.host||(o.host=""),o.hostname||(o.hostname=""),p[0]!==""&&p.unshift(""),p.length<2&&p.unshift(""),i.pathname=p.join("/")}if(i.search=o.search,i.query=o.query,i.host=o.host||"",i.auth=o.auth,i.hostname=o.hostname||o.host,i.port=o.port,i.pathname||i.search){var g=i.pathname||"",f=i.search||"";i.path=g+f}return i.slashes=i.slashes||o.slashes,i.href=i.format(),i}var b=i.pathname&&i.pathname.charAt(0)==="/",y=o.host||o.pathname&&o.pathname.charAt(0)==="/",_=y||b||i.host&&o.pathname,A=_,w=i.pathname&&i.pathname.split("/")||[],T=(p=o.pathname&&o.pathname.split("/")||[],i.protocol&&!Ot[i.protocol]);if(T&&(i.hostname="",i.port=null,i.host&&(w[0]===""?w[0]=i.host:w.unshift(i.host)),i.host="",o.protocol&&(o.hostname=null,o.port=null,o.host&&(p[0]===""?p[0]=o.host:p.unshift(o.host)),o.host=null),_=_&&(p[0]===""||w[0]==="")),y)i.host=o.host||o.host===""?o.host:i.host,i.hostname=o.hostname||o.hostname===""?o.hostname:i.hostname,i.search=o.search,i.query=o.query,w=p;else if(p.length)w||(w=[]),w.pop(),w=w.concat(p),i.search=o.search,i.query=o.query;else if(!Ze.isNullOrUndefined(o.search))return T&&(i.hostname=i.host=w.shift(),(H=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=H.shift(),i.host=i.hostname=H.shift())),i.search=o.search,i.query=o.query,Ze.isNull(i.pathname)&&Ze.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i;if(!w.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var k=w.slice(-1)[0],E=(i.host||o.host||w.length>1)&&(k==="."||k==="..")||k==="",I=0,O=w.length;O>=0;O--)(k=w[O])==="."?w.splice(O,1):k===".."?(w.splice(O,1),I++):I&&(w.splice(O,1),I--);if(!_&&!A)for(;I--;I)w.unshift("..");!_||w[0]===""||w[0]&&w[0].charAt(0)==="/"||w.unshift(""),E&&w.join("/").substr(-1)!=="/"&&w.push("");var H,G=w[0]===""||w[0]&&w[0].charAt(0)==="/";return T&&(i.hostname=i.host=G?"":w.length?w.shift():"",(H=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=H.shift(),i.host=i.hostname=H.shift())),(_=_||i.host&&w.length)&&!G&&w.unshift(""),w.length?i.pathname=w.join("/"):(i.pathname=null,i.path=null),Ze.isNull(i.pathname)&&Ze.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=o.auth||i.auth,i.slashes=i.slashes||o.slashes,i.href=i.format(),i},Ge.prototype.parseHost=function(){var o=this.host,c=Jo.exec(o);c&&((c=c[0])!==":"&&(this.port=c.substr(1)),o=o.substr(0,o.length-c.length)),o&&(this.hostname=o)},Pe.Url,Pe.format,Pe.resolve,Pe.resolveObject,fr={},ti=!1,ri=_u(),rs=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0,Pe.URL=typeof URL<"u"?URL:null,Pe.pathToFileURL=ku,Pe.fileURLToPath=Eu,Pe.Url,Pe.format,Pe.resolve,Pe.resolveObject,Pe.URL,ns=92,is=47,os=97,ss=122,dr=rs==="win32",as=/\//g,ls=/%/g,us=/\\/g,cs=/\n/g,hs=/\r/g,fs=/\t/g,ds=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0,Pe.URL=typeof URL<"u"?URL:null,Pe.pathToFileURL=zo,Pe.fileURLToPath=$o,ps=Pe.Url,gs=Pe.format,ms=Pe.resolve,As=Pe.resolveObject,bs=Pe.parse,ys=Pe.URL,ws=92,vs=47,_s=97,Es=122,pr=ds==="win32",Ss=/\//g,Cs=/%/g,ks=/\\/g,Is=/\n/g,Ts=/\r/g,Bs=/\t/g}),Ou=fe((o,c)=>{oe(),ae(),se(),c.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}),ni=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"__esModule",{value:!0}),o.BufferedDuplex=void 0,o.writev=a;var c=St(),i=(Ve(),Be(We));function a(r,e){let n=new Array(r.length);for(let t=0;t<r.length;t++)typeof r[t].chunk=="string"?n[t]=i.Buffer.from(r[t].chunk,"utf8"):n[t]=r[t].chunk;this._write(i.Buffer.concat(n),"binary",e)}var l=class extends c.Duplex{constructor(r,e,n){super({objectMode:!0}),this.proxy=e,this.socket=n,this.writeQueue=[],r.objectMode||(this._writev=a.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",t=>{!this.destroyed&&this.readable&&this.push(t)})}_read(r){this.proxy.read(r)}_write(r,e,n){this.isSocketOpen?this.writeToProxy(r,e,n):this.writeQueue.push({chunk:r,encoding:e,cb:n})}_final(r){this.writeQueue=[],this.proxy.end(r)}_destroy(r,e){this.writeQueue=[],this.proxy.destroy(),e(r)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(r,e,n){this.proxy.write(r,e)===!1?this.proxy.once("drain",n):n()}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:r,encoding:e,cb:n}=this.writeQueue.shift();this.writeToProxy(r,e,n)}}};o.BufferedDuplex=l}),gr=fe(o=>{oe(),ae(),se();var c=o&&o.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(o,"__esModule",{value:!0}),o.streamBuilder=o.browserStreamBuilder=void 0;var i=(Ve(),Be(We)),a=c(Ou()),l=c(lt()),r=St(),e=c(or()),n=ni(),t=(0,l.default)("mqttjs:ws"),s=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function u(_,A){let w=`${_.protocol}://${_.hostname}:${_.port}${_.path}`;return typeof _.transformWsUrl=="function"&&(w=_.transformWsUrl(w,_,A)),w}function d(_){let A=_;return _.port||(_.protocol==="wss"?A.port=443:A.port=80),_.path||(A.path="/"),_.wsOptions||(A.wsOptions={}),!e.default&&!_.forceNativeWebSocket&&_.protocol==="wss"&&s.forEach(w=>{Object.prototype.hasOwnProperty.call(_,w)&&!Object.prototype.hasOwnProperty.call(_.wsOptions,w)&&(A.wsOptions[w]=_[w])}),A}function p(_){let A=d(_);if(A.hostname||(A.hostname=A.host),!A.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let w=new URL(document.URL);A.hostname=w.hostname,A.port||(A.port=Number(w.port))}return A.objectMode===void 0&&(A.objectMode=!(A.binary===!0||A.binary===void 0)),A}function g(_,A,w){t("createWebSocket"),t(`protocol: ${w.protocolId} ${w.protocolVersion}`);let T=w.protocolId==="MQIsdp"&&w.protocolVersion===3?"mqttv3.1":"mqtt";t(`creating new Websocket for url: ${A} and protocol: ${T}`);let k;return w.createWebsocket?k=w.createWebsocket(A,[T],w):k=new a.default(A,[T],w.wsOptions),k}function f(_,A){let w=A.protocolId==="MQIsdp"&&A.protocolVersion===3?"mqttv3.1":"mqtt",T=u(A,_),k;return A.createWebsocket?k=A.createWebsocket(T,[w],A):k=new WebSocket(T,[w]),k.binaryType="arraybuffer",k}var b=(_,A)=>{t("streamBuilder");let w=d(A);w.hostname=w.hostname||w.host||"localhost";let T=u(w,_),k=g(_,T,w),E=a.default.createWebSocketStream(k,w.wsOptions);return E.url=T,k.on("close",()=>{E.destroy()}),E};o.streamBuilder=b;var y=(_,A)=>{t("browserStreamBuilder");let w,T=p(A).browserBufferSize||1024*512,k=A.browserBufferTimeout||1e3,E=!A.objectMode,I=f(_,A),O=G(A,F,me);A.objectMode||(O._writev=n.writev.bind(O)),O.on("close",()=>{I.close()});let H=typeof I.addEventListener<"u";I.readyState===I.OPEN?(w=O,w.socket=I):(w=new n.BufferedDuplex(A,O,I),H?I.addEventListener("open",de):I.onopen=de),H?(I.addEventListener("close",U),I.addEventListener("error",$),I.addEventListener("message",z)):(I.onclose=U,I.onerror=$,I.onmessage=z);function G(le,pe,we){let Q=new r.Transform({objectMode:le.objectMode});return Q._write=pe,Q._flush=we,Q}function de(){t("WebSocket onOpen"),w instanceof n.BufferedDuplex&&w.socketReady()}function U(le){t("WebSocket onClose",le),w.end(),w.destroy()}function $(le){t("WebSocket onError",le);let pe=new Error("WebSocket error");pe.event=le,w.destroy(pe)}async function z(le){if(!O||O.destroyed||!O.readable)return;let{data:pe}=le;pe instanceof ArrayBuffer?pe=i.Buffer.from(pe):pe instanceof Blob?pe=i.Buffer.from(await new Response(pe).arrayBuffer()):pe=i.Buffer.from(pe,"utf8"),O.push(pe)}function F(le,pe,we){if(I.bufferedAmount>T){setTimeout(F,k,le,pe,we);return}E&&typeof le=="string"&&(le=i.Buffer.from(le,"utf8"));try{I.send(le)}catch(Q){return we(Q)}we()}function me(le){I.close(),le()}return w};o.browserStreamBuilder=y}),ii={};Rt(ii,{Server:()=>Me,Socket:()=>Me,Stream:()=>Me,_createServerHandle:()=>Me,_normalizeArgs:()=>Me,_setSimultaneousAccepts:()=>Me,connect:()=>Me,createConnection:()=>Me,createServer:()=>Me,default:()=>Os,isIP:()=>Me,isIPv4:()=>Me,isIPv6:()=>Me});function Me(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}var Os,Ps=He(()=>{oe(),ae(),se(),Os={_createServerHandle:Me,_normalizeArgs:Me,_setSimultaneousAccepts:Me,connect:Me,createConnection:Me,createServer:Me,isIP:Me,isIPv4:Me,isIPv6:Me,Server:Me,Socket:Me,Stream:Me}}),xs=fe((o,c)=>{oe(),ae(),se(),c.exports={}}),Rs=fe(o=>{oe(),ae(),se();var c=o&&o.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(o,"__esModule",{value:!0});var i=c((Ps(),Be(ii))),a=c(lt()),l=c(xs()),r=(0,a.default)("mqttjs:tcp"),e=(n,t)=>{if(t.port=t.port||1883,t.hostname=t.hostname||t.host||"localhost",t.socksProxy)return(0,l.default)(t.hostname,t.port,t.socksProxy,{timeout:t.socksTimeout});let{port:s,path:u}=t,d=t.hostname;return r("port %d and host %s",s,d),i.default.createConnection({port:s,host:d,path:u})};o.default=e}),Ms={};Rt(Ms,{default:()=>Us});var Us,Pu=He(()=>{oe(),ae(),se(),Us={}}),Ds=fe(o=>{oe(),ae(),se();var c=o&&o.__rest||function(u,d){var p={};for(var g in u)Object.prototype.hasOwnProperty.call(u,g)&&d.indexOf(g)<0&&(p[g]=u[g]);if(u!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,g=Object.getOwnPropertySymbols(u);f<g.length;f++)d.indexOf(g[f])<0&&Object.prototype.propertyIsEnumerable.call(u,g[f])&&(p[g[f]]=u[g[f]]);return p},i=o&&o.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(o,"__esModule",{value:!0});var a=i((Pu(),Be(Ms))),l=i((Ps(),Be(ii))),r=i(lt()),e=i(xs()),n=(0,r.default)("mqttjs:tls");function t(u){let{host:d,port:p,socksProxy:g}=u,f=c(u,["host","port","socksProxy"]);return a.default.connect(g?Object.assign(Object.assign({},f),{socket:(0,e.default)(d,p,g,{timeout:u.socksTimeout})}):u)}var s=(u,d)=>{d.port=d.port||8883,d.host=d.hostname||d.host||"localhost",l.default.isIP(d.host)===0&&(d.servername=d.host),d.rejectUnauthorized=d.rejectUnauthorized!==!1,delete d.path,n("port %d host %s rejectUnauthorized %b",d.port,d.host,d.rejectUnauthorized);let p=t(d);p.on("secureConnect",()=>{d.rejectUnauthorized&&!p.authorized?p.emit("error",new Error("TLS not authorized")):p.removeListener("error",g)});function g(f){d.rejectUnauthorized&&u.emit("error",f),p.end()}return p.on("error",g),p};o.default=s}),Ls=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"__esModule",{value:!0});var c=(Ve(),Be(We)),i=St(),a=ni(),l,r,e;function n(){let p=new i.Transform;return p._write=(g,f,b)=>{l.send({data:g.buffer,success(){b()},fail(y){b(new Error(y))}})},p._flush=g=>{l.close({success(){g()}})},p}function t(p){p.hostname||(p.hostname="localhost"),p.path||(p.path="/"),p.wsOptions||(p.wsOptions={})}function s(p,g){let f=p.protocol==="wxs"?"wss":"ws",b=`${f}://${p.hostname}${p.path}`;return p.port&&p.port!==80&&p.port!==443&&(b=`${f}://${p.hostname}:${p.port}${p.path}`),typeof p.transformWsUrl=="function"&&(b=p.transformWsUrl(b,p,g)),b}function u(){l.onOpen(()=>{e.socketReady()}),l.onMessage(p=>{let{data:g}=p;g instanceof ArrayBuffer?g=c.Buffer.from(g):g=c.Buffer.from(g,"utf8"),r.push(g)}),l.onClose(()=>{e.emit("close"),e.end(),e.destroy()}),l.onError(p=>{let g=new Error(p.errMsg);e.destroy(g)})}var d=(p,g)=>{if(g.hostname=g.hostname||g.host,!g.hostname)throw new Error("Could not determine host. Specify host manually.");let f=g.protocolId==="MQIsdp"&&g.protocolVersion===3?"mqttv3.1":"mqtt";t(g);let b=s(g,p);l=wx.connectSocket({url:b,protocols:[f]}),r=n(),e=new a.BufferedDuplex(g,r,l),e._destroy=(_,A)=>{l.close({success(){A&&A(_)}})};let y=e.destroy;return e.destroy=(_,A)=>(e.destroy=y,setTimeout(()=>{l.close({fail(){e._destroy(_,A)}})},0),e),u(),e};o.default=d}),Ns=fe(o=>{oe(),ae(),se(),Object.defineProperty(o,"__esModule",{value:!0});var c=(Ve(),Be(We)),i=St(),a=ni(),l,r,e,n=!1;function t(){let g=new i.Transform;return g._write=(f,b,y)=>{l.sendSocketMessage({data:f.buffer,success(){y()},fail(){y(new Error)}})},g._flush=f=>{l.closeSocket({success(){f()}})},g}function s(g){g.hostname||(g.hostname="localhost"),g.path||(g.path="/"),g.wsOptions||(g.wsOptions={})}function u(g,f){let b=g.protocol==="alis"?"wss":"ws",y=`${b}://${g.hostname}${g.path}`;return g.port&&g.port!==80&&g.port!==443&&(y=`${b}://${g.hostname}:${g.port}${g.path}`),typeof g.transformWsUrl=="function"&&(y=g.transformWsUrl(y,g,f)),y}function d(){n||(n=!0,l.onSocketOpen(()=>{e.socketReady()}),l.onSocketMessage(g=>{if(typeof g.data=="string"){let f=c.Buffer.from(g.data,"base64");r.push(f)}else{let f=new FileReader;f.addEventListener("load",()=>{let b=f.result;b instanceof ArrayBuffer?b=c.Buffer.from(b):b=c.Buffer.from(b,"utf8"),r.push(b)}),f.readAsArrayBuffer(g.data)}}),l.onSocketClose(()=>{e.end(),e.destroy()}),l.onSocketError(g=>{e.destroy(g)}))}var p=(g,f)=>{if(f.hostname=f.hostname||f.host,!f.hostname)throw new Error("Could not determine host. Specify host manually.");let b=f.protocolId==="MQIsdp"&&f.protocolVersion===3?"mqttv3.1":"mqtt";s(f);let y=u(f,g);return l=f.my,l.connectSocket({url:y,protocols:b}),r=t(),e=new a.BufferedDuplex(f,r,l),d(),e};o.default=p}),xu=fe(o=>{oe(),ae(),se();var c=o&&o.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(o,"__esModule",{value:!0}),o.connectAsync=u;var i=c(lt()),a=c((Bu(),Be(qo))),l=c(Vn()),r=c(or());typeof ke?.nextTick!="function"&&(ke.nextTick=setImmediate);var e=(0,i.default)("mqttjs"),n=null;function t(d){let p;d.auth&&(p=d.auth.match(/^(.+):(.+)$/),p?(d.username=p[1],d.password=p[2]):d.username=d.auth)}function s(d,p){var g,f,b;if(e("connecting to an MQTT broker..."),typeof d=="object"&&!p&&(p=d,d=""),p=p||{},d&&typeof d=="string"){let A=a.default.parse(d,!0),w={};if(A.port!=null&&(w.port=Number(A.port)),w.host=A.hostname,w.query=A.query,w.auth=A.auth,w.protocol=A.protocol,w.path=A.path,p=Object.assign(Object.assign({},w),p),!p.protocol)throw new Error("Missing protocol");p.protocol=p.protocol.replace(/:$/,"")}if(p.unixSocket=p.unixSocket||((g=p.protocol)===null||g===void 0?void 0:g.includes("+unix")),p.unixSocket?p.protocol=p.protocol.replace("+unix",""):!(!((f=p.protocol)===null||f===void 0)&&f.startsWith("ws"))&&!(!((b=p.protocol)===null||b===void 0)&&b.startsWith("wx"))&&delete p.path,t(p),p.query&&typeof p.query.clientId=="string"&&(p.clientId=p.query.clientId),r.default||p.unixSocket?p.socksProxy=void 0:p.socksProxy===void 0&&typeof ke<"u"&&(p.socksProxy=ke.env.MQTTJS_SOCKS_PROXY),p.cert&&p.key)if(p.protocol){if(["mqtts","wss","wxs","alis"].indexOf(p.protocol)===-1)switch(p.protocol){case"mqtt":p.protocol="mqtts";break;case"ws":p.protocol="wss";break;case"wx":p.protocol="wxs";break;case"ali":p.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${p.protocol}"!`)}}else throw new Error("Missing secure protocol key");if(n||(n={},!r.default&&!p.forceNativeWebSocket?(n.ws=gr().streamBuilder,n.wss=gr().streamBuilder,n.mqtt=Rs().default,n.tcp=Rs().default,n.ssl=Ds().default,n.tls=n.ssl,n.mqtts=Ds().default):(n.ws=gr().browserStreamBuilder,n.wss=gr().browserStreamBuilder,n.wx=Ls().default,n.wxs=Ls().default,n.ali=Ns().default,n.alis=Ns().default)),!n[p.protocol]){let A=["mqtts","wss"].indexOf(p.protocol)!==-1;p.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((w,T)=>A&&T%2===0?!1:typeof n[w]=="function")[0]}if(p.clean===!1&&!p.clientId)throw new Error("Missing clientId for unclean clients");p.protocol&&(p.defaultProtocol=p.protocol);function y(A){return p.servers&&((!A._reconnectCount||A._reconnectCount===p.servers.length)&&(A._reconnectCount=0),p.host=p.servers[A._reconnectCount].host,p.port=p.servers[A._reconnectCount].port,p.protocol=p.servers[A._reconnectCount].protocol?p.servers[A._reconnectCount].protocol:p.defaultProtocol,p.hostname=p.host,A._reconnectCount++),e("calling streambuilder for",p.protocol),n[p.protocol](A,p)}let _=new l.default(y,p);return _.on("error",()=>{}),_}function u(d,p,g=!0){return new Promise((f,b)=>{let y=s(d,p),_={connect:w=>{A(),f(y)},end:()=>{A(),f(y)},error:w=>{A(),y.end(),b(w)}};g===!1&&(_.close=()=>{_.error(new Error("Couldn't connect to server"))});function A(){Object.keys(_).forEach(w=>{y.off(w,_[w])})}Object.keys(_).forEach(w=>{y.on(w,_[w])})})}o.default=s}),Fs=fe(o=>{oe(),ae(),se();var c=o&&o.__createBinding||(Object.create?function(g,f,b,y){y===void 0&&(y=b);var _=Object.getOwnPropertyDescriptor(f,b);(!_||("get"in _?!f.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return f[b]}}),Object.defineProperty(g,y,_)}:function(g,f,b,y){y===void 0&&(y=b),g[y]=f[b]}),i=o&&o.__setModuleDefault||(Object.create?function(g,f){Object.defineProperty(g,"default",{enumerable:!0,value:f})}:function(g,f){g.default=f}),a=o&&o.__importStar||function(){var g=function(f){return g=Object.getOwnPropertyNames||function(b){var y=[];for(var _ in b)Object.prototype.hasOwnProperty.call(b,_)&&(y[y.length]=_);return y},g(f)};return function(f){if(f&&f.__esModule)return f;var b={};if(f!=null)for(var y=g(f),_=0;_<y.length;_++)y[_]!=="default"&&c(b,f,y[_]);return i(b,f),b}}(),l=o&&o.__exportStar||function(g,f){for(var b in g)b!=="default"&&!Object.prototype.hasOwnProperty.call(f,b)&&c(f,g,b)},r=o&&o.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(o,"__esModule",{value:!0}),o.ReasonCodes=o.KeepaliveManager=o.UniqueMessageIdProvider=o.DefaultMessageIdProvider=o.Store=o.MqttClient=o.connectAsync=o.connect=o.Client=void 0;var e=r(Vn());o.MqttClient=e.default;var n=r(So());o.DefaultMessageIdProvider=n.default;var t=r(du());o.UniqueMessageIdProvider=t.default;var s=r(Co());o.Store=s.default;var u=a(xu());o.connect=u.default,Object.defineProperty(o,"connectAsync",{enumerable:!0,get:function(){return u.connectAsync}});var d=r(xo());o.KeepaliveManager=d.default,o.Client=e.default,l(Vn(),o),l(Dt(),o);var p=ir();Object.defineProperty(o,"ReasonCodes",{enumerable:!0,get:function(){return p.ReasonCodes}})}),Ru=fe(o=>{oe(),ae(),se();var c=o&&o.__createBinding||(Object.create?function(e,n,t,s){s===void 0&&(s=t);var u=Object.getOwnPropertyDescriptor(n,t);(!u||("get"in u?!n.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,s,u)}:function(e,n,t,s){s===void 0&&(s=t),e[s]=n[t]}),i=o&&o.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),a=o&&o.__importStar||function(){var e=function(n){return e=Object.getOwnPropertyNames||function(t){var s=[];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(s[s.length]=u);return s},e(n)};return function(n){if(n&&n.__esModule)return n;var t={};if(n!=null)for(var s=e(n),u=0;u<s.length;u++)s[u]!=="default"&&c(t,n,s[u]);return i(t,n),t}}(),l=o&&o.__exportStar||function(e,n){for(var t in e)t!=="default"&&!Object.prototype.hasOwnProperty.call(n,t)&&c(n,e,t)};Object.defineProperty(o,"__esModule",{value:!0});var r=a(Fs());o.default=r,l(Fs(),o)});const Mu=Ru();/*! Bundled license information:
7
7
 
8
8
  @jspm/core/nodelibs/browser/buffer.js:
9
9
  (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
10
10
 
11
11
  safe-buffer/index.js:
12
12
  (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
13
- */const ic=async o=>{if(o.host&&o.port&&!await oc(o.host,o.port))return;const h=E.ref(),i=E.ref({});return E.onMounted(()=>{h.value=nc.connect(o),o.topics||(o.topics=["#"]);for(const a of o.topics)h.value.subscribe(a,l=>{if(l)throw l});h.value.on("message",(a,l)=>{i.value[a]||(i.value[a]=[]),i.value[a].push(l.toString())})}),E.onUnmounted(()=>{var a;(a=h.value)==null||a.end()}),{messages:i}},oc=async(o,h)=>{try{const i=new AbortController,a=setTimeout(()=>i.abort(),2e3);try{return await fetch(`${o}:${h}`,{mode:"no-cors",signal:i.signal}),clearTimeout(a),!0}catch(l){if(clearTimeout(a),l instanceof DOMException&&l.name==="AbortError")return!1;const r=String(l);return!(r.includes("NetworkError")||r.includes("Failed to fetch")||r.includes("net::ERR_CONNECTION_REFUSED"))}}catch{return!1}};function sc(o){o.component("ActionFooter",Wi),o.component("BeamArrow",Vi),o.component("BeamBtn",Qi),o.component("BeamDayDivider",Vr),o.component("BeamFilter",Ki),o.component("BeamFilterOption",Ji),o.component("BeamHeading",Zi),o.component("BeamMetadata",Xi),o.component("BeamModal",eo),o.component("BeamModalOutlet",to),o.component("BeamProgress",ro),o.component("Confirm",no),o.component("FixedTop",io),o.component("ItemCheck",zr),o.component("ItemCount",Gr),o.component("ListAnchor",oo),o.component("ListItem",Ar),o.component("ListView",so),o.component("Navbar",ao),o.component("ScanInput",co),o.component("SegmentedDisplay",ho),o.component("SplitColumn",fo),o.component("ToggleArrow",po)}Te.ActionFooter=Wi,Te.BeamArrow=Vi,Te.BeamBtn=Qi,Te.BeamDayDivider=Vr,Te.BeamFilter=Ki,Te.BeamFilterOption=Ji,Te.BeamHeading=Zi,Te.BeamMetadata=Xi,Te.BeamModal=eo,Te.BeamModalOutlet=to,Te.BeamProgress=ro,Te.Confirm=no,Te.FixedTop=io,Te.ItemCheck=zr,Te.ItemCount=Gr,Te.ListAnchor=oo,Te.ListItem=Ar,Te.ListView=so,Te.Navbar=ao,Te.ScanInput=co,Te.SegmentedDisplay=ho,Te.SplitColumn=fo,Te.ToggleArrow=po,Te.install=sc,Te.useMqttStream=ic,Object.defineProperty(Te,Symbol.toStringTag,{value:"Module"})});
13
+ */const Uu=async o=>{if(o.host&&o.port&&!await Du(o.host,o.port))return;const c=C.ref(),i=C.ref({});return C.onMounted(()=>{c.value=Mu.connect(o),o.topics||(o.topics=["#"]);for(const a of o.topics)c.value.subscribe(a,l=>{if(l)throw l});c.value.on("message",(a,l)=>{i.value[a]||(i.value[a]=[]),i.value[a].push(l.toString())})}),C.onUnmounted(()=>{c.value?.end()}),{messages:i}},Du=async(o,c)=>{try{const i=new AbortController,a=setTimeout(()=>i.abort(),2e3);try{return await fetch(`${o}:${c}`,{mode:"no-cors",signal:i.signal}),clearTimeout(a),!0}catch(l){if(clearTimeout(a),l instanceof DOMException&&l.name==="AbortError")return!1;const r=String(l);return!(r.includes("NetworkError")||r.includes("Failed to fetch")||r.includes("net::ERR_CONNECTION_REFUSED"))}}catch{return!1}};function Lu(o){o.component("ActionFooter",di),o.component("BeamArrow",pi),o.component("BeamBtn",gi),o.component("BeamDayDivider",mr),o.component("BeamFilter",mi),o.component("BeamFilterOption",Ei),o.component("BeamHeading",Si),o.component("BeamMetadata",Ci),o.component("BeamModal",ki),o.component("BeamModalOutlet",Ii),o.component("BeamProgress",Ti),o.component("Confirm",Bi),o.component("FixedTop",Oi),o.component("ItemCheck",_r),o.component("ItemCount",Er),o.component("ListAnchor",Pi),o.component("ListItem",Gt),o.component("ListView",xi),o.component("Navbar",Ri),o.component("ScanInput",Di),o.component("SegmentedDisplay",Li),o.component("SplitColumn",Ni),o.component("ToggleArrow",Fi)}Ie.ActionFooter=di,Ie.BeamArrow=pi,Ie.BeamBtn=gi,Ie.BeamDayDivider=mr,Ie.BeamFilter=mi,Ie.BeamFilterOption=Ei,Ie.BeamHeading=Si,Ie.BeamMetadata=Ci,Ie.BeamModal=ki,Ie.BeamModalOutlet=Ii,Ie.BeamProgress=Ti,Ie.Confirm=Bi,Ie.FixedTop=Oi,Ie.ItemCheck=_r,Ie.ItemCount=Er,Ie.ListAnchor=Pi,Ie.ListItem=Gt,Ie.ListView=xi,Ie.Navbar=Ri,Ie.ScanInput=Di,Ie.SegmentedDisplay=Li,Ie.SplitColumn=Ni,Ie.ToggleArrow=Fi,Ie.install=Lu,Ie.useMqttStream=Uu,Object.defineProperty(Ie,Symbol.toStringTag,{value:"Module"})});
14
14
  //# sourceMappingURL=beam.umd.cjs.map