@stonecrop/beam 0.4.17 → 0.4.18
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.js +7188 -7599
- package/dist/beam.js.map +1 -1
- package/dist/beam.tsbuildinfo +1 -1
- package/dist/beam.umd.cjs +10 -7
- package/dist/beam.umd.cjs.map +1 -1
- package/dist/src/composables/mqtt.d.ts.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/package.json +22 -22
package/dist/beam.umd.cjs
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
(function(_e,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],v):(_e=typeof globalThis<"u"?globalThis:_e||self,v(_e["@stonecrop/beam"]={},_e.Vue))})(this,function(_e,v){"use strict";var Xc=Object.defineProperty;var Ha=_e=>{throw TypeError(_e)};var eh=(_e,v,Ke)=>v in _e?Xc(_e,v,{enumerable:!0,configurable:!0,writable:!0,value:Ke}):_e[v]=Ke;var Ve=(_e,v,Ke)=>eh(_e,typeof v!="symbol"?v+"":v,Ke),Ki=(_e,v,Ke)=>v.has(_e)||Ha("Cannot "+Ke);var R=(_e,v,Ke)=>(Ki(_e,v,"read from private field"),Ke?Ke.call(_e):v.get(_e)),Pe=(_e,v,Ke)=>v.has(_e)?Ha("Cannot add the same private member more than once"):v instanceof WeakSet?v.add(_e):v.set(_e,Ke),Ce=(_e,v,Ke,Zt)=>(Ki(_e,v,"write to private field"),Zt?Zt.call(_e,Ke):v.set(_e,Ke),Ke),Ee=(_e,v,Ke)=>(Ki(_e,v,"access private method"),Ke);var Vr=(_e,v,Ke,Zt)=>({set _(Qr){Ce(_e,v,Qr,Ke)},get _(){return R(_e,v,Zt)}});var Ke=document.createElement("style");Ke.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-ec1a0218]{font-size:1.3125rem;color:var(--sc-primary-text-color)}.beam_item-count span[data-v-ec1a0218]{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(Ke);const Zt={class:"beam_action-footer"},Qr={class:"footer-action-wrapper"},tl=v.defineComponent({__name:"ActionFooter",emits:["click"],setup(e,{emit:n}){const t=n,a=()=>{t("click")};return(u,i)=>{const r=v.resolveComponent("BeamBtn");return v.openBlock(),v.createElementBlock("footer",Zt,[v.createElementVNode("span",Qr,[v.createVNode(r,{onClick:a},{default:v.withCtx(()=>[v.renderSlot(u.$slots,"default",{},void 0,!0)]),_:3})])])}}}),He=(e,n)=>{const t=e.__vccOpts||e;for(const[a,u]of n)t[a]=u;return t},zi=He(tl,[["__scopeId","data-v-37933bd1"]]),rl={class:"beam_metadata_arrow"},nl={class:"beam_metadata_arrow-head"},il={id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 6.74 7.78"},Yi=He(v.defineComponent({__name:"BeamArrow",props:{color:{}},setup(e){return(n,t)=>(v.openBlock(),v.createElementBlock("div",rl,[v.createElementVNode("div",{class:"beam_metadata_arrow-body",style:v.normalizeStyle({background:n.color||"#c4c4c4"})},null,4),v.createElementVNode("div",nl,[(v.openBlock(),v.createElementBlock("svg",il,[v.createElementVNode("polygon",{points:"6.74 3.89 0 0 0 7.78 6.74 3.89",style:v.normalizeStyle([{fill:"#c4c4c4"},{fill:n.color||"#c4c4c4"}])},null,4)]))])]))}}),[["__scopeId","data-v-94fbdac5"]]),ol={},sl={class:"beam_btn"};function al(e,n){return v.openBlock(),v.createElementBlock("button",sl,[v.renderSlot(e.$slots,"default",{},()=>[n[0]||(n[0]=v.createTextVNode("Action"))],!0)])}const Gi=He(ol,[["render",al],["__scopeId","data-v-bc768596"]]),ll={class:"beam_day-divider"},Hr=He(v.defineComponent({__name:"BeamDayDivider",props:{item:{}},setup(e){const n=v.computed(()=>{if(!e.item.date||isNaN(Date.parse(e.item.date)))return e.item.date;const t=new Date(e.item.date);if(e.item.dateFormat)switch(e.item.dateFormat.toLowerCase()){case"iso":return t.toISOString()}return t.toDateString()});return(t,a)=>(v.openBlock(),v.createElementBlock(v.Fragment,null,[v.createElementVNode("div",ll,[v.createElementVNode("h2",null,v.toDisplayString(n.value),1)]),v.renderSlot(t.$slots,"default",{},void 0,!0)],64))}}),[["__scopeId","data-v-160cf6ef"]]),ul={class:"beam_filters"},cl={class:"beam_filters-options"},Ji=He(v.defineComponent({__name:"BeamFilter",setup(e){const n=v.ref(!1);return(t,a)=>{const u=v.resolveComponent("ToggleArrow"),i=v.resolveComponent("BeamHeading");return v.openBlock(),v.createElementBlock("div",ul,[v.createElementVNode("div",{onClick:a[0]||(a[0]=r=>n.value=!n.value),class:"beam_filters-heading"},[v.createVNode(u,{open:n.value},null,8,["open"]),v.createVNode(i,null,{default:v.withCtx(()=>a[1]||(a[1]=[v.createTextVNode("Filter")])),_:1})]),v.withDirectives(v.createElementVNode("div",cl,[v.renderSlot(t.$slots,"default",{},void 0,!0)],512),[[v.vShow,n.value]])])}}}),[["__scopeId","data-v-63a79e46"]]);function Zi(e){return v.getCurrentScope()?(v.onScopeDispose(e),!0):!1}const Xi=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const hl=Object.prototype.toString,fl=e=>hl.call(e)==="[object Object]",gt=()=>{},qr=dl();function dl(){var e,n;return Xi&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((n=window==null?void 0:window.navigator)==null?void 0:n.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function pl(e,n){function t(...a){return new Promise((u,i)=>{Promise.resolve(e(()=>n.apply(this,a),{fn:n,thisArg:this,args:a})).then(u).catch(i)})}return t}function gl(e,n={}){let t,a,u=gt;const i=o=>{clearTimeout(o),u(),u=gt};let r;return o=>{const l=v.toValue(e),f=v.toValue(n.maxWait);return t&&i(t),l<=0||f!==void 0&&f<=0?(a&&(i(a),a=null),Promise.resolve(o())):new Promise((p,g)=>{u=n.rejectOnCancel?g:p,r=o,f&&!a&&(a=setTimeout(()=>{t&&i(t),a=null,p(r())},f)),t=setTimeout(()=>{a&&i(a),a=null,p(o())},l)})}}function $r(e){return Array.isArray(e)?e:[e]}function ml(...e){if(e.length!==1)return v.toRef(...e);const n=e[0];return typeof n=="function"?v.readonly(v.customRef(()=>({get:n,set:gt}))):v.ref(n)}function Al(e,n=200,t={}){return pl(gl(n,t),e)}function bl(e,n,t){return v.watch(e,n,{...t,immediate:!0})}const eo=Xi?window:void 0;function sr(e){var n;const t=v.toValue(e);return(n=t==null?void 0:t.$el)!=null?n:t}function Xt(...e){const n=[],t=()=>{n.forEach(s=>s()),n.length=0},a=(s,o,l,f)=>(s.addEventListener(o,l,f),()=>s.removeEventListener(o,l,f)),u=v.computed(()=>{const s=$r(v.toValue(e[0])).filter(o=>o!=null);return s.every(o=>typeof o!="string")?s:void 0}),i=bl(()=>{var s,o;return[(o=(s=u.value)==null?void 0:s.map(l=>sr(l)))!=null?o:[eo].filter(l=>l!=null),$r(v.toValue(u.value?e[1]:e[0])),$r(v.unref(u.value?e[2]:e[1])),v.toValue(u.value?e[3]:e[2])]},([s,o,l,f])=>{if(t(),!(s!=null&&s.length)||!(o!=null&&o.length)||!(l!=null&&l.length))return;const p=fl(f)?{...f}:f;n.push(...s.flatMap(g=>o.flatMap(m=>l.map(A=>a(g,m,A,p)))))},{flush:"post"}),r=()=>{i(),t()};return Zi(t),r}let to=!1;function ro(e,n,t={}){const{window:a=eo,ignore:u=[],capture:i=!0,detectIframe:r=!1,controls:s=!1}=t;if(!a)return s?{stop:gt,cancel:gt,trigger:gt}:gt;if(qr&&!to){to=!0;const _={passive:!0};Array.from(a.document.body.children).forEach(x=>Xt(x,"click",gt,_)),Xt(a.document.documentElement,"click",gt,_)}let o=!0;const l=_=>v.toValue(u).some(x=>{if(typeof x=="string")return Array.from(a.document.querySelectorAll(x)).some(I=>I===_.target||_.composedPath().includes(I));{const I=sr(x);return I&&(_.target===I||_.composedPath().includes(I))}});function f(_){const x=v.toValue(_);return x&&x.$.subTree.shapeFlag===16}function p(_,x){const I=v.toValue(_),E=I.$.subTree&&I.$.subTree.children;return E==null||!Array.isArray(E)?!1:E.some(L=>L.el===x.target||x.composedPath().includes(L.el))}const g=_=>{const x=sr(e);if(_.target!=null&&!(!(x instanceof Element)&&f(e)&&p(e,_))&&!(!x||x===_.target||_.composedPath().includes(x))){if("detail"in _&&_.detail===0&&(o=!l(_)),!o){o=!0;return}n(_)}};let m=!1;const A=[Xt(a,"click",_=>{m||(m=!0,setTimeout(()=>{m=!1},0),g(_))},{passive:!0,capture:i}),Xt(a,"pointerdown",_=>{const x=sr(e);o=!l(_)&&!!(x&&!_.composedPath().includes(x))},{passive:!0}),r&&Xt(a,"blur",_=>{setTimeout(()=>{var x;const I=sr(e);((x=a.document.activeElement)==null?void 0:x.tagName)==="IFRAME"&&!(I!=null&&I.contains(a.document.activeElement))&&n(_)},0)},{passive:!0})].filter(Boolean),b=()=>A.forEach(_=>_());return s?{stop:b,cancel:()=>{o=!1},trigger:_=>{o=!0,g(_),o=!1}}:b}const yl={mounted(e,n){const t=!n.modifiers.bubble;if(typeof n.value=="function")e.__onClickOutside_stop=ro(e,n.value,{capture:t});else{const[a,u]=n.value;e.__onClickOutside_stop=ro(e,a,Object.assign({capture:t},u))}},unmounted(e){e.__onClickOutside_stop()}};function zr(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}function no(e){const n=window.getComputedStyle(e);if(n.overflowX==="scroll"||n.overflowY==="scroll"||n.overflowX==="auto"&&e.clientWidth<e.scrollWidth||n.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const t=e.parentNode;return!t||t.tagName==="BODY"?!1:no(t)}}function wl(e){const n=e||window.event,t=n.target;return no(t)?!1:n.touches.length>1?!0:(n.preventDefault&&n.preventDefault(),!1)}const Yr=new WeakMap;function vl(e,n=!1){const t=v.ref(n);let a=null,u="";v.watch(ml(e),s=>{const o=zr(v.toValue(s));if(o){const l=o;if(Yr.get(l)||Yr.set(l,l.style.overflow),l.style.overflow!=="hidden"&&(u=l.style.overflow),l.style.overflow==="hidden")return t.value=!0;if(t.value)return l.style.overflow="hidden"}},{immediate:!0});const i=()=>{const s=zr(v.toValue(e));!s||t.value||(qr&&(a=Xt(s,"touchmove",o=>{wl(o)},{passive:!1})),s.style.overflow="hidden",t.value=!0)},r=()=>{const s=zr(v.toValue(e));!s||!t.value||(qr&&(a==null||a()),s.style.overflow=u,Yr.delete(s),t.value=!1)};return Zi(r),v.computed({get(){return t.value},set(s){s?i():r()}})}function _l(){let e=!1;const n=v.shallowRef(!1);return(t,a)=>{if(n.value=a.value,e)return;e=!0;const u=vl(t,a.value);v.watch(n,i=>u.value=i)}}_l();const El={class:"beam_filter-container"},Sl={class:"beam_filter-option-select"},Cl={class:"beam_filter-label"},Il={key:0,ref:"menu",class:"beam_filter-select-menu"},kl=["data-value","onClick"],io=He(v.defineComponent({__name:"BeamFilterOption",props:{choices:{default:()=>[]},title:{default:"title"}},emits:["select"],setup(e,{emit:n}){const t=n,a=v.ref(!1),u=v.ref(e.choices[0].label),i=v.ref(e.choices[0].value),r=s=>{u.value=s.label,i.value=s.value,t("select",s)};return(s,o)=>{const l=v.resolveComponent("BeamHeading");return v.withDirectives((v.openBlock(),v.createElementBlock("div",El,[v.createVNode(l,{class:"beam_filter-option-heading"},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(s.title),1)]),_:1}),v.createElementVNode("div",{onClick:o[0]||(o[0]=f=>a.value=!a.value),class:"beam_filter-option"},[v.createElementVNode("div",Sl,[o[1]||(o[1]=v.createElementVNode("div",{class:"beam_filter-arrow"},[v.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 35.36 70.71"},[v.createElementVNode("polygon",{points:"0 70.71 0 0 35.36 35.36 0 70.71"})])],-1)),v.createElementVNode("div",Cl,[v.createElementVNode("label",null,v.toDisplayString(u.value),1)])]),a.value?(v.openBlock(),v.createElementBlock("ul",Il,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(s.choices,f=>(v.openBlock(),v.createElementBlock("li",{class:v.normalizeClass([{selected:u.value==f.label},"beam_filter-select-option"]),"data-value":f.value,key:f.value,onClick:p=>r(f)},v.toDisplayString(f.label),11,kl))),128))],512)):v.createCommentVNode("",!0)])])),[[v.unref(yl),()=>a.value=!1]])}}}),[["__scopeId","data-v-be55508c"]]),Tl={},Bl={class:"beam_header"};function Ol(e,n){return v.openBlock(),v.createElementBlock("h1",Bl,[v.renderSlot(e.$slots,"default",{},void 0,!0)])}const oo=He(Tl,[["render",Ol],["__scopeId","data-v-5182a4d5"]]),Pl={class:"beam_metadata"},xl={class:"beam_metadata_content"},Rl={class:"beam_metadata_block"},Ml={class:"beam_metadata_heading"},so=He(v.defineComponent({__name:"BeamMetadata",props:{order:{}},setup(e){return(n,t)=>(v.openBlock(),v.createElementBlock("div",Pl,[v.createElementVNode("div",xl,[v.renderSlot(n.$slots,"default",{},()=>[t[1]||(t[1]=v.createElementVNode("div",{class:"beam_metadata_header beam_metadata--two-column"},null,-1)),v.createElementVNode("div",Rl,[v.createElementVNode("p",Ml,[t[0]||(t[0]=v.createTextVNode(" Status: ")),v.createElementVNode("span",{class:v.normalizeClass([{alert:!n.order.complete},"beam_metadata--normal"])},v.toDisplayString(n.order.complete?"Complete":"In Progress"),3)])]),t[2]||(t[2]=v.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)]),t[3]||(t[3]=v.createElementVNode("hr",null,null,-1))]))}}),[["__scopeId","data-v-80484331"]]),Ul={class:"beam_modal"},ao=He(v.defineComponent({__name:"BeamModal",props:{showModal:{type:Boolean}},setup(e){return(n,t)=>{const a=v.resolveComponent("BeamBtn"),u=v.resolveComponent("portal");return v.openBlock(),v.createBlock(u,{to:"beam_modal_outlet"},{default:v.withCtx(()=>[v.withDirectives(v.createElementVNode("div",Ul,[v.createVNode(a,{onClick:t[0]||(t[0]=i=>n.$emit("closemodal"))},{default:v.withCtx(()=>t[3]||(t[3]=[v.createTextVNode("Close Modal")])),_:1}),v.renderSlot(n.$slots,"default",{onClosemodal:t[1]||(t[1]=i=>n.$emit("closemodal")),onConfirmmodal:t[2]||(t[2]=i=>n.$emit("confirmmodal"))},void 0,!0)],512),[[v.vShow,n.showModal]])]),_:3})}}}),[["__scopeId","data-v-4f3f0253"]]),lo=v.defineComponent({__name:"BeamModalOutlet",emits:["confirmmodal","closemodal"],setup(e){return(n,t)=>{const a=v.resolveComponent("portal-target");return v.openBlock(),v.createBlock(a,{name:"beam_modal_outlet"})}}}),Dl={class:"beam_metadata_heading"},uo=v.defineComponent({__name:"BeamProgress",props:{label:{default:"Status"},progressMessage:{default:"In Progress"},completeMessage:{default:"Complete"},complete:{type:Boolean,default:!1}},setup(e){const n=v.computed(()=>e.complete?e.completeMessage:e.progressMessage);return(t,a)=>(v.openBlock(),v.createElementBlock("p",Dl,[v.createTextVNode(v.toDisplayString(t.label)+": ",1),v.createElementVNode("span",{class:v.normalizeClass([{"beam--alert":!t.complete},"beam--normal"])},v.toDisplayString(n.value),3)]))}}),Ll={},Nl={class:"beam_modal-confirm"};function Fl(e,n){const t=v.resolveComponent("BeamBtn");return v.openBlock(),v.createElementBlock("div",Nl,[n[4]||(n[4]=v.createElementVNode("h2",null,"Would you like to continue?",-1)),v.createVNode(t,{onClick:n[0]||(n[0]=a=>e.$emit("confirmmodal"))},{default:v.withCtx(()=>n[2]||(n[2]=[v.createTextVNode("Yes")])),_:1}),v.createVNode(t,{onClick:n[1]||(n[1]=a=>e.$emit("confirmmodal"))},{default:v.withCtx(()=>n[3]||(n[3]=[v.createTextVNode("No")])),_:1})])}const co=He(Ll,[["render",Fl],["__scopeId","data-v-5b430dca"]]),jl={},Vl={class:"fixed-top"};function Kl(e,n){return v.openBlock(),v.createElementBlock("div",Vl,[v.renderSlot(e.$slots,"default",{},void 0,!0)])}const ho=He(jl,[["render",Kl],["__scopeId","data-v-a38a41d0"]]),Wl={class:"container"},Gr=He(v.defineComponent({__name:"ItemCheck",props:{modelValue:{type:Boolean,default:!1},modelModifiers:{}},emits:["update:modelValue"],setup(e){const n=v.useModel(e,"modelValue");return(t,a)=>(v.openBlock(),v.createElementBlock("label",Wl,[v.withDirectives(v.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":a[0]||(a[0]=u=>n.value=u),tabindex:"-1"},null,512),[[v.vModelCheckbox,n.value]]),a[1]||(a[1]=v.createElementVNode("div",{class:"checkmark",tabindex:"0"},null,-1))]))}}),[["__scopeId","data-v-14a5f31b"]]),Ql={class:"beam_item-count"},Hl=["contenteditable"],ql={key:0},$l={key:1},Jr=He(v.defineComponent({__name:"ItemCount",props:v.mergeModels({denominator:{},debounce:{default:300},editable:{default:!0},uom:{default:""}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const n=v.useModel(e,"modelValue"),t=v.computed(()=>n.value===e.denominator),a=r=>{const s=Number(r.target.innerHTML)||0;n.value=Math.min(s,e.denominator)},u=Al(r=>a(r),e.debounce),i=async r=>await u(r);return(r,s)=>(v.openBlock(),v.createElementBlock("div",Ql,[v.createElementVNode("span",{contenteditable:r.editable,class:v.normalizeClass({"beam--alert":!t.value}),onClick:v.withModifiers(a,["stop","prevent"]),onInput:v.withModifiers(i,["stop","prevent"]),onPaste:a},v.toDisplayString(n.value),43,Hl),r.denominator?(v.openBlock(),v.createElementBlock("span",ql,"/"+v.toDisplayString(r.denominator),1)):v.createCommentVNode("",!0),r.uom?(v.openBlock(),v.createElementBlock("span",$l," "+v.toDisplayString(r.uom),1)):v.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ec1a0218"]]),zl=["href"],fo=He(v.defineComponent({__name:"ListAnchor",props:{to:{default:""}},setup(e){return(n,t)=>(v.openBlock(),v.createElementBlock("a",{href:n.to,class:"beam_list-anchor"},[v.renderSlot(n.$slots,"default",{},void 0,!0)],8,zl))}}),[["__scopeId","data-v-7e3ecf0d"]]),Yl={tabindex:"0",class:"beam_list-item"},Gl={class:"beam_list-text"},Jl={class:"beam--bold"},mr=He(v.defineComponent({__name:"ListItem",props:{item:{}},emits:["update"],setup(e,{emit:n}){const t=n,a=v.ref(e.item);return v.watch(a,u=>{t("update",u)},{deep:!0}),(u,i)=>(v.openBlock(),v.createElementBlock("li",Yl,[v.createElementVNode("div",Gl,[v.createElementVNode("label",Jl,v.toDisplayString(a.value.label),1),v.createElementVNode("p",null,v.toDisplayString(a.value.description),1)]),a.value.count?(v.openBlock(),v.createBlock(Jr,{key:0,modelValue:a.value.count.count,"onUpdate:modelValue":i[0]||(i[0]=r=>a.value.count.count=r),debounce:a.value.debounce,denominator:a.value.count.of,editable:!0,uom:a.value.count.uom},null,8,["modelValue","debounce","denominator","uom"])):v.createCommentVNode("",!0),a.value.hasOwnProperty("checked")?(v.openBlock(),v.createBlock(Gr,{key:1,modelValue:a.value.checked,"onUpdate:modelValue":i[1]||(i[1]=r=>a.value.checked=r)},null,8,["modelValue"])):v.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-634dd647"]]),Zl={class:"beam_list-view"},po=He(v.defineComponent({__name:"ListView",props:{items:{}},emits:["update","scrollbottom"],setup(e,{emit:n}){const t=n;v.onMounted(()=>{window.addEventListener("scroll",u)}),v.onUnmounted(()=>{window.removeEventListener("scroll",u)});const a=i=>t("update",i),u=()=>{const i=document.documentElement.scrollHeight-window.innerHeight,r=document.documentElement.scrollTop;i-r<=2&&t("scrollbottom")};return(i,r)=>(v.openBlock(),v.createElementBlock("ul",Zl,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.items,s=>(v.openBlock(),v.createElementBlock("li",{key:s.barcode||s.label},[s.linkComponent=="BeamDayDivider"?(v.openBlock(),v.createBlock(Hr,{key:0,item:s},null,8,["item"])):s.linkComponent?(v.openBlock(),v.createBlock(v.resolveDynamicComponent(s.linkComponent),{key:1,to:s.route,tabindex:"-1"},{default:v.withCtx(()=>[v.createVNode(mr,{item:s,onUpdate:a},null,8,["item"])]),_:2},1032,["to"])):(v.openBlock(),v.createBlock(mr,{key:2,item:s,onUpdate:a},null,8,["item"]))]))),128))]))}}),[["__scopeId","data-v-d536b2a7"]]),Xl={class:"beam_navbar"},go=He(v.defineComponent({__name:"Navbar",emits:["click"],setup(e,{emit:n}){const t=n,a=()=>{t("click")};return(u,i)=>{const r=v.resolveComponent("BeamHeading"),s=v.resolveComponent("BeamBtn");return v.openBlock(),v.createElementBlock("nav",Xl,[v.renderSlot(u.$slots,"title",{},()=>[v.createVNode(r,null,{default:v.withCtx(()=>i[0]||(i[0]=[v.createTextVNode("TITLE")])),_:1})],!0),v.createVNode(s,{onClick:a},{default:v.withCtx(()=>[v.renderSlot(u.$slots,"navbaraction",{},()=>[i[1]||(i[1]=v.createTextVNode("Action"))],!0)]),_:3})])}}}),[["__scopeId","data-v-cfc4c14e"]]);function eu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ar={exports:{}},tu=Ar.exports,mo;function ru(){return mo||(mo=1,function(e,n){(function(t,a){e.exports=a()})(tu,function(){var t={attachTo:function(a,u){if(a.scannerDetectionData!==void 0)throw new Error("onScan.js is already initialized for DOM element "+a);var i={onScan:function(r,s){},onScanError:function(r){},onKeyProcess:function(r,s){},onKeyDetect:function(r,s){},onPaste:function(r,s){},keyCodeMapper:function(r){return t.decodeKeyEvent(r)},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 u=this._mergeOptions(i,u),a.scannerDetectionData={options:u,vars:{firstCharTime:0,lastCharTime:0,accumulatedString:"",testTimer:!1,longPressTimeStart:0,longPressed:!1}},u.reactToPaste===!0&&a.addEventListener("paste",this._handlePaste,u.captureEvents),u.scanButtonKeyCode!==!1&&a.addEventListener("keyup",this._handleKeyUp,u.captureEvents),(u.reactToKeydown===!0||u.scanButtonKeyCode!==!1)&&a.addEventListener("keydown",this._handleKeyDown,u.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,u){switch(a.scannerDetectionData.options.reactToPaste){case!0:u.reactToPaste===!1&&a.removeEventListener("paste",this._handlePaste);break;case!1:u.reactToPaste===!0&&a.addEventListener("paste",this._handlePaste);break}switch(a.scannerDetectionData.options.scanButtonKeyCode){case!1:u.scanButtonKeyCode!==!1&&a.addEventListener("keyup",this._handleKeyUp);break;default:u.scanButtonKeyCode===!1&&a.removeEventListener("keyup",this._handleKeyUp);break}return a.scannerDetectionData.options=this._mergeOptions(a.scannerDetectionData.options,u),this._reinitialize(a),this},decodeKeyEvent:function(a){var u=this._getNormalizedKeyNum(a);switch(!0){case(u>=48&&u<=90):case(u>=106&&u<=111):if(a.key!==void 0&&a.key!=="")return a.key;var i=String.fromCharCode(u);switch(a.shiftKey){case!1:i=i.toLowerCase();break;case!0:i=i.toUpperCase();break}return i;case(u>=96&&u<=105):return 0+(u-96)}return""},simulate:function(a,u){return this._reinitialize(a),Array.isArray(u)?u.forEach(function(i){var r={};(typeof i=="object"||typeof i=="function")&&i!==null?r=i:r.keyCode=parseInt(i);var s=new KeyboardEvent("keydown",r);document.dispatchEvent(s)}):this._validateScanCode(a,u),this},_reinitialize:function(a){var u=a.scannerDetectionData.vars;u.firstCharTime=0,u.lastCharTime=0,u.accumulatedString=""},_isFocusOnIgnoredElement:function(a){var u=a.scannerDetectionData.options.ignoreIfFocusOn;if(!u)return!1;var i=document.activeElement;if(Array.isArray(u)){for(var r=0;r<u.length;r++)if(i.matches(u[r])===!0)return!0}else if(i.matches(u))return!0;return!1},_validateScanCode:function(a,u){var i=a.scannerDetectionData,r=i.options,s=i.options.singleScanQty,o=i.vars.firstCharTime,l=i.vars.lastCharTime,f={},p;switch(!0){case u.length<r.minLength:f={message:"Receieved code is shorter then minimal length"};break;case l-o>u.length*r.avgTimeByChar:f={message:"Receieved code was not entered in time"};break;default:return r.onScan.call(a,u,s),p=new CustomEvent("scan",{detail:{scanCode:u,qty:s}}),a.dispatchEvent(p),t._reinitialize(a),!0}return f.scanCode=u,f.scanDuration=l-o,f.avgTimeByChar=r.avgTimeByChar,f.minLength=r.minLength,r.onScanError.call(a,f),p=new CustomEvent("scanError",{detail:f}),a.dispatchEvent(p),t._reinitialize(a),!1},_mergeOptions:function(a,u){var i={},r;for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(i[r]=a[r]);for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(i[r]=u[r]);return i},_getNormalizedKeyNum:function(a){return a.which||a.keyCode},_handleKeyDown:function(a){var u=t._getNormalizedKeyNum(a),i=this.scannerDetectionData.options,r=this.scannerDetectionData.vars,s=!1;if(i.onKeyDetect.call(this,u,a)!==!1&&!t._isFocusOnIgnoredElement(this)){if(i.scanButtonKeyCode!==!1&&u==i.scanButtonKeyCode){r.longPressed||(r.longPressTimer=setTimeout(i.onScanButtonLongPress,i.scanButtonLongPressTime,this),r.longPressed=!0);return}switch(!0){case(r.firstCharTime&&i.suffixKeyCodes.indexOf(u)!==-1):a.preventDefault(),a.stopImmediatePropagation(),s=!0;break;case(!r.firstCharTime&&i.prefixKeyCodes.indexOf(u)!==-1):a.preventDefault(),a.stopImmediatePropagation(),s=!1;break;default:var o=i.keyCodeMapper.call(this,a);if(o===null)return;r.accumulatedString+=o,i.preventDefault&&a.preventDefault(),i.stopPropagation&&a.stopImmediatePropagation(),s=!1;break}r.firstCharTime||(r.firstCharTime=Date.now()),r.lastCharTime=Date.now(),r.testTimer&&clearTimeout(r.testTimer),s?(t._validateScanCode(this,r.accumulatedString),r.testTimer=!1):r.testTimer=setTimeout(t._validateScanCode,i.timeBeforeScanTest,this,r.accumulatedString),i.onKeyProcess.call(this,o,a)}},_handlePaste:function(a){var u=this.scannerDetectionData.options,i=this.scannerDetectionData.vars,r=(event.clipboardData||window.clipboardData).getData("text");t._isFocusOnIgnoredElement(this)||(a.preventDefault(),u.stopPropagation&&a.stopImmediatePropagation(),u.onPaste.call(this,r,event),i.firstCharTime=0,i.lastCharTime=0,t._validateScanCode(this,r))},_handleKeyUp:function(a){if(!t._isFocusOnIgnoredElement(this)){var u=t._getNormalizedKeyNum(a);u==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 t})}(Ar)),Ar.exports}var nu=ru();const Ao=eu(nu),iu={id:"scan_input"},bo=v.defineComponent({__name:"ScanInput",props:{scanHandler:{type:Function}},emits:["scanInstance"],setup(e,{emit:n}){const t=n,a=e;return v.onMounted(()=>{const u=Ao.attachTo(window,{onScan:a.scanHandler});t("scanInstance",u)}),v.onUnmounted(()=>{Ao.detachFrom(window)}),(u,i)=>(v.openBlock(),v.createElementBlock("div",iu))}}),yo=He(v.defineComponent({__name:"SegmentedDisplay",props:{displayInput:{default:120.2568},decimalPlaces:{default:2},displayColor:{default:"gray"},textColor:{default:"white"}},setup(e){const n=v.computed(()=>e.displayInput===0?0 .toFixed(e.decimalPlaces):e.displayInput.toFixed(e.decimalPlaces)),t=a=>a.substr(0,2)=="--"?`var(${a})`:a;return(a,u)=>(v.openBlock(),v.createElementBlock("div",{class:"segmented-display",style:v.normalizeStyle({background:t(a.displayColor)})},[v.createElementVNode("h1",{class:"segmented-display-output",style:v.normalizeStyle({color:t(a.textColor)})},v.toDisplayString(n.value),5)],4))}}),[["__scopeId","data-v-140e435e"]]),ou={class:"column column-left"},su={class:"column column-right"},wo=He(v.defineComponent({__name:"SplitColumn",props:{justifyContent:{},alignItems:{}},setup(e){return(n,t)=>(v.openBlock(),v.createElementBlock("div",{class:"two-column",style:v.normalizeStyle({justifyContent:n.justifyContent||"space-between",alignItems:n.alignItems||"flex-start"})},[v.createElementVNode("div",ou,[v.renderSlot(n.$slots,"left",{},void 0,!0)]),v.createElementVNode("div",su,[v.renderSlot(n.$slots,"right",{},void 0,!0)])],4))}}),[["__scopeId","data-v-c65440c0"]]),vo=He(v.defineComponent({__name:"ToggleArrow",props:{open:{type:Boolean}},setup(e){return(n,t)=>(v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["arrow-icon",{open:n.open}])},t[0]||(t[0]=[v.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 35.36 70.71"},[v.createElementVNode("polygon",{points:"0 70.71 0 0 35.36 35.36 0 70.71"})],-1)]),2))}}),[["__scopeId","data-v-05e7abed"]]);var Zr=Object.defineProperty,au=Object.getOwnPropertyDescriptor,lu=Object.getOwnPropertyNames,uu=Object.prototype.hasOwnProperty,Ge=(e,n)=>()=>(e&&(n=e(e=0)),n),Ae=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),Ut=(e,n)=>{for(var t in n)Zr(e,t,{get:n[t],enumerable:!0})},cu=(e,n,t,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let u of lu(n))!uu.call(e,u)&&u!==t&&Zr(e,u,{get:()=>n[u],enumerable:!(a=au(n,u))||a.enumerable});return e},Ue=e=>cu(Zr({},"__esModule",{value:!0}),e),ae=Ge(()=>{}),xe={};Ut(xe,{_debugEnd:()=>Rn,_debugProcess:()=>xn,_events:()=>Yn,_eventsCount:()=>Gn,_exiting:()=>bn,_fatalExceptions:()=>Bn,_getActiveHandles:()=>To,_getActiveRequests:()=>ko,_kill:()=>vn,_linkedBinding:()=>Co,_maxListeners:()=>zn,_preload_modules:()=>Hn,_rawDebug:()=>gn,_startProfilerIdleNotifier:()=>Mn,_stopProfilerIdleNotifier:()=>Un,_tickCallback:()=>Pn,abort:()=>Fn,addListener:()=>Jn,allowedNodeEnvironmentFlags:()=>kn,arch:()=>tn,argv:()=>on,argv0:()=>Qn,assert:()=>Bo,binding:()=>cn,chdir:()=>dn,config:()=>yn,cpuUsage:()=>lr,cwd:()=>fn,debugPort:()=>Wn,default:()=>oi,dlopen:()=>Io,domain:()=>An,emit:()=>ri,emitWarning:()=>un,env:()=>nn,execArgv:()=>sn,execPath:()=>Kn,exit:()=>Cn,features:()=>Tn,hasUncaughtExceptionCaptureCallback:()=>Oo,hrtime:()=>br,kill:()=>Sn,listeners:()=>xo,memoryUsage:()=>En,moduleLoadList:()=>mn,nextTick:()=>Eo,off:()=>Xn,on:()=>mt,once:()=>Zn,openStdin:()=>In,pid:()=>jn,platform:()=>rn,ppid:()=>Vn,prependListener:()=>ni,prependOnceListener:()=>ii,reallyExit:()=>wn,release:()=>pn,removeAllListeners:()=>ti,removeListener:()=>ei,resourceUsage:()=>_n,setSourceMapsEnabled:()=>qn,setUncaughtExceptionCaptureCallback:()=>On,stderr:()=>Ln,stdin:()=>Nn,stdout:()=>Dn,title:()=>en,umask:()=>hn,uptime:()=>Po,version:()=>an,versions:()=>ln});function Xr(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function hu(){!Dt||!Lt||(Dt=!1,Lt.length?ht=Lt.concat(ht):ar=-1,ht.length&&_o())}function _o(){if(!Dt){var e=setTimeout(hu,0);Dt=!0;for(var n=ht.length;n;){for(Lt=ht,ht=[];++ar<n;)Lt&&Lt[ar].run();ar=-1,n=ht.length}Lt=null,Dt=!1,clearTimeout(e)}}function Eo(e){var n=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)n[t-1]=arguments[t];ht.push(new So(e,n)),ht.length===1&&!Dt&&setTimeout(_o,0)}function So(e,n){this.fun=e,this.array=n}function et(){}function Co(e){Xr("_linkedBinding")}function Io(e){Xr("dlopen")}function ko(){return[]}function To(){return[]}function Bo(e,n){if(!e)throw new Error(n||"assertion error")}function Oo(){return!1}function Po(){return At.now()/1e3}function br(e){var n=Math.floor((Date.now()-At.now())*.001),t=At.now()*.001,a=Math.floor(t)+n,u=Math.floor(t%1*1e9);return e&&(a=a-e[0],u=u-e[1],u<0&&(a--,u+=yr)),[a,u]}function mt(){return oi}function xo(e){return[]}var ht,Dt,Lt,ar,en,tn,rn,nn,on,sn,an,ln,un,cn,hn,fn,dn,pn,gn,mn,An,bn,yn,wn,vn,lr,_n,En,Sn,Cn,In,kn,Tn,Bn,On,Pn,xn,Rn,Mn,Un,Dn,Ln,Nn,Fn,jn,Vn,Kn,Wn,Qn,Hn,qn,At,$n,yr,zn,Yn,Gn,Jn,Zn,Xn,ei,ti,ri,ni,ii,oi,fu=Ge(()=>{ae(),ue(),le(),ht=[],Dt=!1,ar=-1,So.prototype.run=function(){this.fun.apply(null,this.array)},en="browser",tn="x64",rn="browser",nn={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},on=["/usr/bin/node"],sn=[],an="v16.8.0",ln={},un=function(e,n){console.warn((n?n+": ":"")+e)},cn=function(e){Xr("binding")},hn=function(e){return 0},fn=function(){return"/"},dn=function(e){},pn={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},gn=et,mn=[],An={},bn=!1,yn={},wn=et,vn=et,lr=function(){return{}},_n=lr,En=lr,Sn=et,Cn=et,In=et,kn={},Tn={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Bn=et,On=et,Pn=et,xn=et,Rn=et,Mn=et,Un=et,Dn=void 0,Ln=void 0,Nn=void 0,Fn=et,jn=2,Vn=1,Kn="/bin/usr/node",Wn=9229,Qn="node",Hn=[],qn=et,At={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},At.now===void 0&&($n=Date.now(),At.timing&&At.timing.navigationStart&&($n=At.timing.navigationStart),At.now=()=>Date.now()-$n),yr=1e9,br.bigint=function(e){var n=br(e);return typeof BigInt>"u"?n[0]*yr+n[1]:BigInt(n[0]*yr)+BigInt(n[1])},zn=10,Yn={},Gn=0,Jn=mt,Zn=mt,Xn=mt,ei=mt,ti=mt,ri=et,ni=mt,ii=mt,oi={version:an,versions:ln,arch:tn,platform:rn,release:pn,_rawDebug:gn,moduleLoadList:mn,binding:cn,_linkedBinding:Co,_events:Yn,_eventsCount:Gn,_maxListeners:zn,on:mt,addListener:Jn,once:Zn,off:Xn,removeListener:ei,removeAllListeners:ti,emit:ri,prependListener:ni,prependOnceListener:ii,listeners:xo,domain:An,_exiting:bn,config:yn,dlopen:Io,uptime:Po,_getActiveRequests:ko,_getActiveHandles:To,reallyExit:wn,_kill:vn,cpuUsage:lr,resourceUsage:_n,memoryUsage:En,kill:Sn,exit:Cn,openStdin:In,allowedNodeEnvironmentFlags:kn,assert:Bo,features:Tn,_fatalExceptions:Bn,setUncaughtExceptionCaptureCallback:On,hasUncaughtExceptionCaptureCallback:Oo,emitWarning:un,nextTick:Eo,_tickCallback:Pn,_debugProcess:xn,_debugEnd:Rn,_startProfilerIdleNotifier:Mn,_stopProfilerIdleNotifier:Un,stdout:Dn,stdin:Nn,stderr:Ln,abort:Fn,umask:hn,chdir:dn,cwd:fn,env:nn,title:en,argv:on,execArgv:sn,pid:jn,ppid:Vn,execPath:Kn,debugPort:Wn,hrtime:br,argv0:Qn,_preload_modules:Hn,setSourceMapsEnabled:qn}}),le=Ge(()=>{fu()}),Je={};Ut(Je,{Buffer:()=>wr,INSPECT_MAX_BYTES:()=>Ro,default:()=>bt,kMaxLength:()=>Mo});function du(){if(si)return er;si=!0,er.byteLength=s,er.toByteArray=l,er.fromByteArray=g;for(var e=[],n=[],t=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,i=a.length;u<i;++u)e[u]=a[u],n[a.charCodeAt(u)]=u;n[45]=62,n[95]=63;function r(m){var A=m.length;if(A%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var b=m.indexOf("=");b===-1&&(b=A);var _=b===A?0:4-b%4;return[b,_]}function s(m){var A=r(m),b=A[0],_=A[1];return(b+_)*3/4-_}function o(m,A,b){return(A+b)*3/4-b}function l(m){var A,b=r(m),_=b[0],x=b[1],I=new t(o(m,_,x)),E=0,L=x>0?_-4:_,F;for(F=0;F<L;F+=4)A=n[m.charCodeAt(F)]<<18|n[m.charCodeAt(F+1)]<<12|n[m.charCodeAt(F+2)]<<6|n[m.charCodeAt(F+3)],I[E++]=A>>16&255,I[E++]=A>>8&255,I[E++]=A&255;return x===2&&(A=n[m.charCodeAt(F)]<<2|n[m.charCodeAt(F+1)]>>4,I[E++]=A&255),x===1&&(A=n[m.charCodeAt(F)]<<10|n[m.charCodeAt(F+1)]<<4|n[m.charCodeAt(F+2)]>>2,I[E++]=A>>8&255,I[E++]=A&255),I}function f(m){return e[m>>18&63]+e[m>>12&63]+e[m>>6&63]+e[m&63]}function p(m,A,b){for(var _,x=[],I=A;I<b;I+=3)_=(m[I]<<16&16711680)+(m[I+1]<<8&65280)+(m[I+2]&255),x.push(f(_));return x.join("")}function g(m){for(var A,b=m.length,_=b%3,x=[],I=16383,E=0,L=b-_;E<L;E+=I)x.push(p(m,E,E+I>L?L:E+I));return _===1?(A=m[b-1],x.push(e[A>>2]+e[A<<4&63]+"==")):_===2&&(A=(m[b-2]<<8)+m[b-1],x.push(e[A>>10]+e[A>>4&63]+e[A<<2&63]+"=")),x.join("")}return er}function pu(){return ai?ur:(ai=!0,ur.read=function(e,n,t,a,u){var i,r,s=u*8-a-1,o=(1<<s)-1,l=o>>1,f=-7,p=t?u-1:0,g=t?-1:1,m=e[n+p];for(p+=g,i=m&(1<<-f)-1,m>>=-f,f+=s;f>0;i=i*256+e[n+p],p+=g,f-=8);for(r=i&(1<<-f)-1,i>>=-f,f+=a;f>0;r=r*256+e[n+p],p+=g,f-=8);if(i===0)i=1-l;else{if(i===o)return r?NaN:(m?-1:1)*(1/0);r=r+Math.pow(2,a),i=i-l}return(m?-1:1)*r*Math.pow(2,i-a)},ur.write=function(e,n,t,a,u,i){var r,s,o,l=i*8-u-1,f=(1<<l)-1,p=f>>1,g=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=a?0:i-1,A=a?1:-1,b=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(s=isNaN(n)?1:0,r=f):(r=Math.floor(Math.log(n)/Math.LN2),n*(o=Math.pow(2,-r))<1&&(r--,o*=2),r+p>=1?n+=g/o:n+=g*Math.pow(2,1-p),n*o>=2&&(r++,o/=2),r+p>=f?(s=0,r=f):r+p>=1?(s=(n*o-1)*Math.pow(2,u),r=r+p):(s=n*Math.pow(2,p-1)*Math.pow(2,u),r=0));u>=8;e[t+m]=s&255,m+=A,s/=256,u-=8);for(r=r<<u|s,l+=u;l>0;e[t+m]=r&255,m+=A,r/=256,l-=8);e[t+m-A]|=b*128},ur)}function gu(){if(li)return Ot;li=!0;let e=du(),n=pu(),t=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ot.Buffer=r,Ot.SlowBuffer=x,Ot.INSPECT_MAX_BYTES=50;let a=2147483647;Ot.kMaxLength=a,r.TYPED_ARRAY_SUPPORT=u(),!r.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 u(){try{let h=new Uint8Array(1),c={foo:function(){return 42}};return Object.setPrototypeOf(c,Uint8Array.prototype),Object.setPrototypeOf(h,c),h.foo()===42}catch{return!1}}Object.defineProperty(r.prototype,"parent",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.buffer}}),Object.defineProperty(r.prototype,"offset",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.byteOffset}});function i(h){if(h>a)throw new RangeError('The value "'+h+'" is invalid for option "size"');let c=new Uint8Array(h);return Object.setPrototypeOf(c,r.prototype),c}function r(h,c,d){if(typeof h=="number"){if(typeof c=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(h)}return s(h,c,d)}r.poolSize=8192;function s(h,c,d){if(typeof h=="string")return p(h,c);if(ArrayBuffer.isView(h))return m(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($(h,ArrayBuffer)||h&&$(h.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&($(h,SharedArrayBuffer)||h&&$(h.buffer,SharedArrayBuffer)))return A(h,c,d);if(typeof h=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let y=h.valueOf&&h.valueOf();if(y!=null&&y!==h)return r.from(y,c,d);let k=b(h);if(k)return k;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof h[Symbol.toPrimitive]=="function")return r.from(h[Symbol.toPrimitive]("string"),c,d);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof h)}r.from=function(h,c,d){return s(h,c,d)},Object.setPrototypeOf(r.prototype,Uint8Array.prototype),Object.setPrototypeOf(r,Uint8Array);function o(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 l(h,c,d){return o(h),h<=0?i(h):c!==void 0?typeof d=="string"?i(h).fill(c,d):i(h).fill(c):i(h)}r.alloc=function(h,c,d){return l(h,c,d)};function f(h){return o(h),i(h<0?0:_(h)|0)}r.allocUnsafe=function(h){return f(h)},r.allocUnsafeSlow=function(h){return f(h)};function p(h,c){if((typeof c!="string"||c==="")&&(c="utf8"),!r.isEncoding(c))throw new TypeError("Unknown encoding: "+c);let d=I(h,c)|0,y=i(d),k=y.write(h,c);return k!==d&&(y=y.slice(0,k)),y}function g(h){let c=h.length<0?0:_(h.length)|0,d=i(c);for(let y=0;y<c;y+=1)d[y]=h[y]&255;return d}function m(h){if($(h,Uint8Array)){let c=new Uint8Array(h);return A(c.buffer,c.byteOffset,c.byteLength)}return g(h)}function A(h,c,d){if(c<0||h.byteLength<c)throw new RangeError('"offset" is outside of buffer bounds');if(h.byteLength<c+(d||0))throw new RangeError('"length" is outside of buffer bounds');let y;return c===void 0&&d===void 0?y=new Uint8Array(h):d===void 0?y=new Uint8Array(h,c):y=new Uint8Array(h,c,d),Object.setPrototypeOf(y,r.prototype),y}function b(h){if(r.isBuffer(h)){let c=_(h.length)|0,d=i(c);return d.length===0||h.copy(d,0,0,c),d}if(h.length!==void 0)return typeof h.length!="number"||O(h.length)?i(0):g(h);if(h.type==="Buffer"&&Array.isArray(h.data))return g(h.data)}function _(h){if(h>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return h|0}function x(h){return+h!=h&&(h=0),r.alloc(+h)}r.isBuffer=function(h){return h!=null&&h._isBuffer===!0&&h!==r.prototype},r.compare=function(h,c){if($(h,Uint8Array)&&(h=r.from(h,h.offset,h.byteLength)),$(c,Uint8Array)&&(c=r.from(c,c.offset,c.byteLength)),!r.isBuffer(h)||!r.isBuffer(c))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(h===c)return 0;let d=h.length,y=c.length;for(let k=0,K=Math.min(d,y);k<K;++k)if(h[k]!==c[k]){d=h[k],y=c[k];break}return d<y?-1:y<d?1:0},r.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}},r.concat=function(h,c){if(!Array.isArray(h))throw new TypeError('"list" argument must be an Array of Buffers');if(h.length===0)return r.alloc(0);let d;if(c===void 0)for(c=0,d=0;d<h.length;++d)c+=h[d].length;let y=r.allocUnsafe(c),k=0;for(d=0;d<h.length;++d){let K=h[d];if($(K,Uint8Array))k+K.length>y.length?(r.isBuffer(K)||(K=r.from(K)),K.copy(y,k)):Uint8Array.prototype.set.call(y,K,k);else if(r.isBuffer(K))K.copy(y,k);else throw new TypeError('"list" argument must be an Array of Buffers');k+=K.length}return y};function I(h,c){if(r.isBuffer(h))return h.length;if(ArrayBuffer.isView(h)||$(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 d=h.length,y=arguments.length>2&&arguments[2]===!0;if(!y&&d===0)return 0;let k=!1;for(;;)switch(c){case"ascii":case"latin1":case"binary":return d;case"utf8":case"utf-8":return j(h).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return d*2;case"hex":return d>>>1;case"base64":return Z(h).length;default:if(k)return y?-1:j(h).length;c=(""+c).toLowerCase(),k=!0}}r.byteLength=I;function E(h,c,d){let y=!1;if((c===void 0||c<0)&&(c=0),c>this.length||((d===void 0||d>this.length)&&(d=this.length),d<=0)||(d>>>=0,c>>>=0,d<=c))return"";for(h||(h="utf8");;)switch(h){case"hex":return H(this,c,d);case"utf8":case"utf-8":return q(this,c,d);case"ascii":return me(this,c,d);case"latin1":case"binary":return se(this,c,d);case"base64":return C(this,c,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return be(this,c,d);default:if(y)throw new TypeError("Unknown encoding: "+h);h=(h+"").toLowerCase(),y=!0}}r.prototype._isBuffer=!0;function L(h,c,d){let y=h[c];h[c]=h[d],h[d]=y}r.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 c=0;c<h;c+=2)L(this,c,c+1);return this},r.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 c=0;c<h;c+=4)L(this,c,c+3),L(this,c+1,c+2);return this},r.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 c=0;c<h;c+=8)L(this,c,c+7),L(this,c+1,c+6),L(this,c+2,c+5),L(this,c+3,c+4);return this},r.prototype.toString=function(){let h=this.length;return h===0?"":arguments.length===0?q(this,0,h):E.apply(this,arguments)},r.prototype.toLocaleString=r.prototype.toString,r.prototype.equals=function(h){if(!r.isBuffer(h))throw new TypeError("Argument must be a Buffer");return this===h?!0:r.compare(this,h)===0},r.prototype.inspect=function(){let h="",c=Ot.INSPECT_MAX_BYTES;return h=this.toString("hex",0,c).replace(/(.{2})/g,"$1 ").trim(),this.length>c&&(h+=" ... "),"<Buffer "+h+">"},t&&(r.prototype[t]=r.prototype.inspect),r.prototype.compare=function(h,c,d,y,k){if($(h,Uint8Array)&&(h=r.from(h,h.offset,h.byteLength)),!r.isBuffer(h))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof h);if(c===void 0&&(c=0),d===void 0&&(d=h?h.length:0),y===void 0&&(y=0),k===void 0&&(k=this.length),c<0||d>h.length||y<0||k>this.length)throw new RangeError("out of range index");if(y>=k&&c>=d)return 0;if(y>=k)return-1;if(c>=d)return 1;if(c>>>=0,d>>>=0,y>>>=0,k>>>=0,this===h)return 0;let K=k-y,ee=d-c,Ie=Math.min(K,ee),Be=this.slice(y,k),Oe=h.slice(c,d);for(let Se=0;Se<Ie;++Se)if(Be[Se]!==Oe[Se]){K=Be[Se],ee=Oe[Se];break}return K<ee?-1:ee<K?1:0};function F(h,c,d,y,k){if(h.length===0)return-1;if(typeof d=="string"?(y=d,d=0):d>2147483647?d=2147483647:d<-2147483648&&(d=-2147483648),d=+d,O(d)&&(d=k?0:h.length-1),d<0&&(d=h.length+d),d>=h.length){if(k)return-1;d=h.length-1}else if(d<0)if(k)d=0;else return-1;if(typeof c=="string"&&(c=r.from(c,y)),r.isBuffer(c))return c.length===0?-1:B(h,c,d,y,k);if(typeof c=="number")return c=c&255,typeof Uint8Array.prototype.indexOf=="function"?k?Uint8Array.prototype.indexOf.call(h,c,d):Uint8Array.prototype.lastIndexOf.call(h,c,d):B(h,[c],d,y,k);throw new TypeError("val must be string, number or Buffer")}function B(h,c,d,y,k){let K=1,ee=h.length,Ie=c.length;if(y!==void 0&&(y=String(y).toLowerCase(),y==="ucs2"||y==="ucs-2"||y==="utf16le"||y==="utf-16le")){if(h.length<2||c.length<2)return-1;K=2,ee/=2,Ie/=2,d/=2}function Be(Se,Te){return K===1?Se[Te]:Se.readUInt16BE(Te*K)}let Oe;if(k){let Se=-1;for(Oe=d;Oe<ee;Oe++)if(Be(h,Oe)===Be(c,Se===-1?0:Oe-Se)){if(Se===-1&&(Se=Oe),Oe-Se+1===Ie)return Se*K}else Se!==-1&&(Oe-=Oe-Se),Se=-1}else for(d+Ie>ee&&(d=ee-Ie),Oe=d;Oe>=0;Oe--){let Se=!0;for(let Te=0;Te<Ie;Te++)if(Be(h,Oe+Te)!==Be(c,Te)){Se=!1;break}if(Se)return Oe}return-1}r.prototype.includes=function(h,c,d){return this.indexOf(h,c,d)!==-1},r.prototype.indexOf=function(h,c,d){return F(this,h,c,d,!0)},r.prototype.lastIndexOf=function(h,c,d){return F(this,h,c,d,!1)};function T(h,c,d,y){d=Number(d)||0;let k=h.length-d;y?(y=Number(y),y>k&&(y=k)):y=k;let K=c.length;y>K/2&&(y=K/2);let ee;for(ee=0;ee<y;++ee){let Ie=parseInt(c.substr(ee*2,2),16);if(O(Ie))return ee;h[d+ee]=Ie}return ee}function U(h,c,d,y){return D(j(c,h.length-d),h,d,y)}function W(h,c,d,y){return D(V(c),h,d,y)}function J(h,c,d,y){return D(Z(c),h,d,y)}function ne(h,c,d,y){return D(ie(c,h.length-d),h,d,y)}r.prototype.write=function(h,c,d,y){if(c===void 0)y="utf8",d=this.length,c=0;else if(d===void 0&&typeof c=="string")y=c,d=this.length,c=0;else if(isFinite(c))c=c>>>0,isFinite(d)?(d=d>>>0,y===void 0&&(y="utf8")):(y=d,d=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let k=this.length-c;if((d===void 0||d>k)&&(d=k),h.length>0&&(d<0||c<0)||c>this.length)throw new RangeError("Attempt to write outside buffer bounds");y||(y="utf8");let K=!1;for(;;)switch(y){case"hex":return T(this,h,c,d);case"utf8":case"utf-8":return U(this,h,c,d);case"ascii":case"latin1":case"binary":return W(this,h,c,d);case"base64":return J(this,h,c,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,h,c,d);default:if(K)throw new TypeError("Unknown encoding: "+y);y=(""+y).toLowerCase(),K=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function C(h,c,d){return c===0&&d===h.length?e.fromByteArray(h):e.fromByteArray(h.slice(c,d))}function q(h,c,d){d=Math.min(h.length,d);let y=[],k=c;for(;k<d;){let K=h[k],ee=null,Ie=K>239?4:K>223?3:K>191?2:1;if(k+Ie<=d){let Be,Oe,Se,Te;switch(Ie){case 1:K<128&&(ee=K);break;case 2:Be=h[k+1],(Be&192)===128&&(Te=(K&31)<<6|Be&63,Te>127&&(ee=Te));break;case 3:Be=h[k+1],Oe=h[k+2],(Be&192)===128&&(Oe&192)===128&&(Te=(K&15)<<12|(Be&63)<<6|Oe&63,Te>2047&&(Te<55296||Te>57343)&&(ee=Te));break;case 4:Be=h[k+1],Oe=h[k+2],Se=h[k+3],(Be&192)===128&&(Oe&192)===128&&(Se&192)===128&&(Te=(K&15)<<18|(Be&63)<<12|(Oe&63)<<6|Se&63,Te>65535&&Te<1114112&&(ee=Te))}}ee===null?(ee=65533,Ie=1):ee>65535&&(ee-=65536,y.push(ee>>>10&1023|55296),ee=56320|ee&1023),y.push(ee),k+=Ie}return Y(y)}let te=4096;function Y(h){let c=h.length;if(c<=te)return String.fromCharCode.apply(String,h);let d="",y=0;for(;y<c;)d+=String.fromCharCode.apply(String,h.slice(y,y+=te));return d}function me(h,c,d){let y="";d=Math.min(h.length,d);for(let k=c;k<d;++k)y+=String.fromCharCode(h[k]&127);return y}function se(h,c,d){let y="";d=Math.min(h.length,d);for(let k=c;k<d;++k)y+=String.fromCharCode(h[k]);return y}function H(h,c,d){let y=h.length;(!c||c<0)&&(c=0),(!d||d<0||d>y)&&(d=y);let k="";for(let K=c;K<d;++K)k+=N[h[K]];return k}function be(h,c,d){let y=h.slice(c,d),k="";for(let K=0;K<y.length-1;K+=2)k+=String.fromCharCode(y[K]+y[K+1]*256);return k}r.prototype.slice=function(h,c){let d=this.length;h=~~h,c=c===void 0?d:~~c,h<0?(h+=d,h<0&&(h=0)):h>d&&(h=d),c<0?(c+=d,c<0&&(c=0)):c>d&&(c=d),c<h&&(c=h);let y=this.subarray(h,c);return Object.setPrototypeOf(y,r.prototype),y};function oe(h,c,d){if(h%1!==0||h<0)throw new RangeError("offset is not uint");if(h+c>d)throw new RangeError("Trying to access beyond buffer length")}r.prototype.readUintLE=r.prototype.readUIntLE=function(h,c,d){h=h>>>0,c=c>>>0,d||oe(h,c,this.length);let y=this[h],k=1,K=0;for(;++K<c&&(k*=256);)y+=this[h+K]*k;return y},r.prototype.readUintBE=r.prototype.readUIntBE=function(h,c,d){h=h>>>0,c=c>>>0,d||oe(h,c,this.length);let y=this[h+--c],k=1;for(;c>0&&(k*=256);)y+=this[h+--c]*k;return y},r.prototype.readUint8=r.prototype.readUInt8=function(h,c){return h=h>>>0,c||oe(h,1,this.length),this[h]},r.prototype.readUint16LE=r.prototype.readUInt16LE=function(h,c){return h=h>>>0,c||oe(h,2,this.length),this[h]|this[h+1]<<8},r.prototype.readUint16BE=r.prototype.readUInt16BE=function(h,c){return h=h>>>0,c||oe(h,2,this.length),this[h]<<8|this[h+1]},r.prototype.readUint32LE=r.prototype.readUInt32LE=function(h,c){return h=h>>>0,c||oe(h,4,this.length),(this[h]|this[h+1]<<8|this[h+2]<<16)+this[h+3]*16777216},r.prototype.readUint32BE=r.prototype.readUInt32BE=function(h,c){return h=h>>>0,c||oe(h,4,this.length),this[h]*16777216+(this[h+1]<<16|this[h+2]<<8|this[h+3])},r.prototype.readBigUInt64LE=Q(function(h){h=h>>>0,X(h,"offset");let c=this[h],d=this[h+7];(c===void 0||d===void 0)&&ye(h,this.length-8);let y=c+this[++h]*2**8+this[++h]*2**16+this[++h]*2**24,k=this[++h]+this[++h]*2**8+this[++h]*2**16+d*2**24;return BigInt(y)+(BigInt(k)<<BigInt(32))}),r.prototype.readBigUInt64BE=Q(function(h){h=h>>>0,X(h,"offset");let c=this[h],d=this[h+7];(c===void 0||d===void 0)&&ye(h,this.length-8);let y=c*2**24+this[++h]*2**16+this[++h]*2**8+this[++h],k=this[++h]*2**24+this[++h]*2**16+this[++h]*2**8+d;return(BigInt(y)<<BigInt(32))+BigInt(k)}),r.prototype.readIntLE=function(h,c,d){h=h>>>0,c=c>>>0,d||oe(h,c,this.length);let y=this[h],k=1,K=0;for(;++K<c&&(k*=256);)y+=this[h+K]*k;return k*=128,y>=k&&(y-=Math.pow(2,8*c)),y},r.prototype.readIntBE=function(h,c,d){h=h>>>0,c=c>>>0,d||oe(h,c,this.length);let y=c,k=1,K=this[h+--y];for(;y>0&&(k*=256);)K+=this[h+--y]*k;return k*=128,K>=k&&(K-=Math.pow(2,8*c)),K},r.prototype.readInt8=function(h,c){return h=h>>>0,c||oe(h,1,this.length),this[h]&128?(255-this[h]+1)*-1:this[h]},r.prototype.readInt16LE=function(h,c){h=h>>>0,c||oe(h,2,this.length);let d=this[h]|this[h+1]<<8;return d&32768?d|4294901760:d},r.prototype.readInt16BE=function(h,c){h=h>>>0,c||oe(h,2,this.length);let d=this[h+1]|this[h]<<8;return d&32768?d|4294901760:d},r.prototype.readInt32LE=function(h,c){return h=h>>>0,c||oe(h,4,this.length),this[h]|this[h+1]<<8|this[h+2]<<16|this[h+3]<<24},r.prototype.readInt32BE=function(h,c){return h=h>>>0,c||oe(h,4,this.length),this[h]<<24|this[h+1]<<16|this[h+2]<<8|this[h+3]},r.prototype.readBigInt64LE=Q(function(h){h=h>>>0,X(h,"offset");let c=this[h],d=this[h+7];(c===void 0||d===void 0)&&ye(h,this.length-8);let y=this[h+4]+this[h+5]*2**8+this[h+6]*2**16+(d<<24);return(BigInt(y)<<BigInt(32))+BigInt(c+this[++h]*2**8+this[++h]*2**16+this[++h]*2**24)}),r.prototype.readBigInt64BE=Q(function(h){h=h>>>0,X(h,"offset");let c=this[h],d=this[h+7];(c===void 0||d===void 0)&&ye(h,this.length-8);let y=(c<<24)+this[++h]*2**16+this[++h]*2**8+this[++h];return(BigInt(y)<<BigInt(32))+BigInt(this[++h]*2**24+this[++h]*2**16+this[++h]*2**8+d)}),r.prototype.readFloatLE=function(h,c){return h=h>>>0,c||oe(h,4,this.length),n.read(this,h,!0,23,4)},r.prototype.readFloatBE=function(h,c){return h=h>>>0,c||oe(h,4,this.length),n.read(this,h,!1,23,4)},r.prototype.readDoubleLE=function(h,c){return h=h>>>0,c||oe(h,8,this.length),n.read(this,h,!0,52,8)},r.prototype.readDoubleBE=function(h,c){return h=h>>>0,c||oe(h,8,this.length),n.read(this,h,!1,52,8)};function we(h,c,d,y,k,K){if(!r.isBuffer(h))throw new TypeError('"buffer" argument must be a Buffer instance');if(c>k||c<K)throw new RangeError('"value" argument is out of bounds');if(d+y>h.length)throw new RangeError("Index out of range")}r.prototype.writeUintLE=r.prototype.writeUIntLE=function(h,c,d,y){if(h=+h,c=c>>>0,d=d>>>0,!y){let ee=Math.pow(2,8*d)-1;we(this,h,c,d,ee,0)}let k=1,K=0;for(this[c]=h&255;++K<d&&(k*=256);)this[c+K]=h/k&255;return c+d},r.prototype.writeUintBE=r.prototype.writeUIntBE=function(h,c,d,y){if(h=+h,c=c>>>0,d=d>>>0,!y){let ee=Math.pow(2,8*d)-1;we(this,h,c,d,ee,0)}let k=d-1,K=1;for(this[c+k]=h&255;--k>=0&&(K*=256);)this[c+k]=h/K&255;return c+d},r.prototype.writeUint8=r.prototype.writeUInt8=function(h,c,d){return h=+h,c=c>>>0,d||we(this,h,c,1,255,0),this[c]=h&255,c+1},r.prototype.writeUint16LE=r.prototype.writeUInt16LE=function(h,c,d){return h=+h,c=c>>>0,d||we(this,h,c,2,65535,0),this[c]=h&255,this[c+1]=h>>>8,c+2},r.prototype.writeUint16BE=r.prototype.writeUInt16BE=function(h,c,d){return h=+h,c=c>>>0,d||we(this,h,c,2,65535,0),this[c]=h>>>8,this[c+1]=h&255,c+2},r.prototype.writeUint32LE=r.prototype.writeUInt32LE=function(h,c,d){return h=+h,c=c>>>0,d||we(this,h,c,4,4294967295,0),this[c+3]=h>>>24,this[c+2]=h>>>16,this[c+1]=h>>>8,this[c]=h&255,c+4},r.prototype.writeUint32BE=r.prototype.writeUInt32BE=function(h,c,d){return h=+h,c=c>>>0,d||we(this,h,c,4,4294967295,0),this[c]=h>>>24,this[c+1]=h>>>16,this[c+2]=h>>>8,this[c+3]=h&255,c+4};function w(h,c,d,y,k){re(c,y,k,h,d,7);let K=Number(c&BigInt(4294967295));h[d++]=K,K=K>>8,h[d++]=K,K=K>>8,h[d++]=K,K=K>>8,h[d++]=K;let ee=Number(c>>BigInt(32)&BigInt(4294967295));return h[d++]=ee,ee=ee>>8,h[d++]=ee,ee=ee>>8,h[d++]=ee,ee=ee>>8,h[d++]=ee,d}function G(h,c,d,y,k){re(c,y,k,h,d,7);let K=Number(c&BigInt(4294967295));h[d+7]=K,K=K>>8,h[d+6]=K,K=K>>8,h[d+5]=K,K=K>>8,h[d+4]=K;let ee=Number(c>>BigInt(32)&BigInt(4294967295));return h[d+3]=ee,ee=ee>>8,h[d+2]=ee,ee=ee>>8,h[d+1]=ee,ee=ee>>8,h[d]=ee,d+8}r.prototype.writeBigUInt64LE=Q(function(h,c=0){return w(this,h,c,BigInt(0),BigInt("0xffffffffffffffff"))}),r.prototype.writeBigUInt64BE=Q(function(h,c=0){return G(this,h,c,BigInt(0),BigInt("0xffffffffffffffff"))}),r.prototype.writeIntLE=function(h,c,d,y){if(h=+h,c=c>>>0,!y){let Ie=Math.pow(2,8*d-1);we(this,h,c,d,Ie-1,-Ie)}let k=0,K=1,ee=0;for(this[c]=h&255;++k<d&&(K*=256);)h<0&&ee===0&&this[c+k-1]!==0&&(ee=1),this[c+k]=(h/K>>0)-ee&255;return c+d},r.prototype.writeIntBE=function(h,c,d,y){if(h=+h,c=c>>>0,!y){let Ie=Math.pow(2,8*d-1);we(this,h,c,d,Ie-1,-Ie)}let k=d-1,K=1,ee=0;for(this[c+k]=h&255;--k>=0&&(K*=256);)h<0&&ee===0&&this[c+k+1]!==0&&(ee=1),this[c+k]=(h/K>>0)-ee&255;return c+d},r.prototype.writeInt8=function(h,c,d){return h=+h,c=c>>>0,d||we(this,h,c,1,127,-128),h<0&&(h=255+h+1),this[c]=h&255,c+1},r.prototype.writeInt16LE=function(h,c,d){return h=+h,c=c>>>0,d||we(this,h,c,2,32767,-32768),this[c]=h&255,this[c+1]=h>>>8,c+2},r.prototype.writeInt16BE=function(h,c,d){return h=+h,c=c>>>0,d||we(this,h,c,2,32767,-32768),this[c]=h>>>8,this[c+1]=h&255,c+2},r.prototype.writeInt32LE=function(h,c,d){return h=+h,c=c>>>0,d||we(this,h,c,4,2147483647,-2147483648),this[c]=h&255,this[c+1]=h>>>8,this[c+2]=h>>>16,this[c+3]=h>>>24,c+4},r.prototype.writeInt32BE=function(h,c,d){return h=+h,c=c>>>0,d||we(this,h,c,4,2147483647,-2147483648),h<0&&(h=4294967295+h+1),this[c]=h>>>24,this[c+1]=h>>>16,this[c+2]=h>>>8,this[c+3]=h&255,c+4},r.prototype.writeBigInt64LE=Q(function(h,c=0){return w(this,h,c,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),r.prototype.writeBigInt64BE=Q(function(h,c=0){return G(this,h,c,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function de(h,c,d,y,k,K){if(d+y>h.length)throw new RangeError("Index out of range");if(d<0)throw new RangeError("Index out of range")}function ve(h,c,d,y,k){return c=+c,d=d>>>0,k||de(h,c,d,4),n.write(h,c,d,y,23,4),d+4}r.prototype.writeFloatLE=function(h,c,d){return ve(this,h,c,!0,d)},r.prototype.writeFloatBE=function(h,c,d){return ve(this,h,c,!1,d)};function he(h,c,d,y,k){return c=+c,d=d>>>0,k||de(h,c,d,8),n.write(h,c,d,y,52,8),d+8}r.prototype.writeDoubleLE=function(h,c,d){return he(this,h,c,!0,d)},r.prototype.writeDoubleBE=function(h,c,d){return he(this,h,c,!1,d)},r.prototype.copy=function(h,c,d,y){if(!r.isBuffer(h))throw new TypeError("argument should be a Buffer");if(d||(d=0),!y&&y!==0&&(y=this.length),c>=h.length&&(c=h.length),c||(c=0),y>0&&y<d&&(y=d),y===d||h.length===0||this.length===0)return 0;if(c<0)throw new RangeError("targetStart out of bounds");if(d<0||d>=this.length)throw new RangeError("Index out of range");if(y<0)throw new RangeError("sourceEnd out of bounds");y>this.length&&(y=this.length),h.length-c<y-d&&(y=h.length-c+d);let k=y-d;return this===h&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(c,d,y):Uint8Array.prototype.set.call(h,this.subarray(d,y),c),k},r.prototype.fill=function(h,c,d,y){if(typeof h=="string"){if(typeof c=="string"?(y=c,c=0,d=this.length):typeof d=="string"&&(y=d,d=this.length),y!==void 0&&typeof y!="string")throw new TypeError("encoding must be a string");if(typeof y=="string"&&!r.isEncoding(y))throw new TypeError("Unknown encoding: "+y);if(h.length===1){let K=h.charCodeAt(0);(y==="utf8"&&K<128||y==="latin1")&&(h=K)}}else typeof h=="number"?h=h&255:typeof h=="boolean"&&(h=Number(h));if(c<0||this.length<c||this.length<d)throw new RangeError("Out of range index");if(d<=c)return this;c=c>>>0,d=d===void 0?this.length:d>>>0,h||(h=0);let k;if(typeof h=="number")for(k=c;k<d;++k)this[k]=h;else{let K=r.isBuffer(h)?h:r.from(h,y),ee=K.length;if(ee===0)throw new TypeError('The value "'+h+'" is invalid for argument "value"');for(k=0;k<d-c;++k)this[k+c]=K[k%ee]}return this};let M={};function S(h,c,d){M[h]=class extends d{constructor(){super(),Object.defineProperty(this,"message",{value:c.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${h}]`,this.stack,delete this.name}get code(){return h}set code(y){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:y,writable:!0})}toString(){return`${this.name} [${h}]: ${this.message}`}}}S("ERR_BUFFER_OUT_OF_BOUNDS",function(h){return h?`${h} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),S("ERR_INVALID_ARG_TYPE",function(h,c){return`The "${h}" argument must be of type number. Received type ${typeof c}`},TypeError),S("ERR_OUT_OF_RANGE",function(h,c,d){let y=`The value of "${h}" is out of range.`,k=d;return Number.isInteger(d)&&Math.abs(d)>2**32?k=z(String(d)):typeof d=="bigint"&&(k=String(d),(d>BigInt(2)**BigInt(32)||d<-(BigInt(2)**BigInt(32)))&&(k=z(k)),k+="n"),y+=` It must be ${c}. Received ${k}`,y},RangeError);function z(h){let c="",d=h.length,y=h[0]==="-"?1:0;for(;d>=y+4;d-=3)c=`_${h.slice(d-3,d)}${c}`;return`${h.slice(0,d)}${c}`}function fe(h,c,d){X(c,"offset"),(h[c]===void 0||h[c+d]===void 0)&&ye(c,h.length-(d+1))}function re(h,c,d,y,k,K){if(h>d||h<c){let ee=typeof c=="bigint"?"n":"",Ie;throw c===0||c===BigInt(0)?Ie=`>= 0${ee} and < 2${ee} ** ${(K+1)*8}${ee}`:Ie=`>= -(2${ee} ** ${(K+1)*8-1}${ee}) and < 2 ** ${(K+1)*8-1}${ee}`,new M.ERR_OUT_OF_RANGE("value",Ie,h)}fe(y,k,K)}function X(h,c){if(typeof h!="number")throw new M.ERR_INVALID_ARG_TYPE(c,"number",h)}function ye(h,c,d){throw Math.floor(h)!==h?(X(h,d),new M.ERR_OUT_OF_RANGE("offset","an integer",h)):c<0?new M.ERR_BUFFER_OUT_OF_BOUNDS:new M.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${c}`,h)}let ge=/[^+/0-9A-Za-z-_]/g;function P(h){if(h=h.split("=")[0],h=h.trim().replace(ge,""),h.length<2)return"";for(;h.length%4!==0;)h=h+"=";return h}function j(h,c){c=c||1/0;let d,y=h.length,k=null,K=[];for(let ee=0;ee<y;++ee){if(d=h.charCodeAt(ee),d>55295&&d<57344){if(!k){if(d>56319){(c-=3)>-1&&K.push(239,191,189);continue}else if(ee+1===y){(c-=3)>-1&&K.push(239,191,189);continue}k=d;continue}if(d<56320){(c-=3)>-1&&K.push(239,191,189),k=d;continue}d=(k-55296<<10|d-56320)+65536}else k&&(c-=3)>-1&&K.push(239,191,189);if(k=null,d<128){if((c-=1)<0)break;K.push(d)}else if(d<2048){if((c-=2)<0)break;K.push(d>>6|192,d&63|128)}else if(d<65536){if((c-=3)<0)break;K.push(d>>12|224,d>>6&63|128,d&63|128)}else if(d<1114112){if((c-=4)<0)break;K.push(d>>18|240,d>>12&63|128,d>>6&63|128,d&63|128)}else throw new Error("Invalid code point")}return K}function V(h){let c=[];for(let d=0;d<h.length;++d)c.push(h.charCodeAt(d)&255);return c}function ie(h,c){let d,y,k,K=[];for(let ee=0;ee<h.length&&!((c-=2)<0);++ee)d=h.charCodeAt(ee),y=d>>8,k=d%256,K.push(k),K.push(y);return K}function Z(h){return e.toByteArray(P(h))}function D(h,c,d,y){let k;for(k=0;k<y&&!(k+d>=c.length||k>=h.length);++k)c[k+d]=h[k];return k}function $(h,c){return h instanceof c||h!=null&&h.constructor!=null&&h.constructor.name!=null&&h.constructor.name===c.name}function O(h){return h!==h}let N=function(){let h="0123456789abcdef",c=new Array(256);for(let d=0;d<16;++d){let y=d*16;for(let k=0;k<16;++k)c[y+k]=h[d]+h[k]}return c}();function Q(h){return typeof BigInt>"u"?ce:h}function ce(){throw new Error("BigInt not supported")}return Ot}var er,si,ur,ai,Ot,li,bt,wr,Ro,Mo,Ze=Ge(()=>{ae(),ue(),le(),er={},si=!1,ur={},ai=!1,Ot={},li=!1,bt=gu(),bt.Buffer,bt.SlowBuffer,bt.INSPECT_MAX_BYTES,bt.kMaxLength,wr=bt.Buffer,Ro=bt.INSPECT_MAX_BYTES,Mo=bt.kMaxLength}),ue=Ge(()=>{Ze()}),mu=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"__esModule",{value:!0});var n=class{constructor(t){this.aliasToTopic={},this.max=t}put(t,a){return a===0||a>this.max?!1:(this.aliasToTopic[a]=t,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(t){return this.aliasToTopic[t]}clear(){this.aliasToTopic={}}};e.default=n}),qe=Ae((e,n)=>{ae(),ue(),le(),n.exports={ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,a){return t.includes(a)},ArrayPrototypeIndexOf(t,a){return t.indexOf(a)},ArrayPrototypeJoin(t,a){return t.join(a)},ArrayPrototypeMap(t,a){return t.map(a)},ArrayPrototypePop(t,a){return t.pop(a)},ArrayPrototypePush(t,a){return t.push(a)},ArrayPrototypeSlice(t,a,u){return t.slice(a,u)},Error,FunctionPrototypeCall(t,a,...u){return t.call(a,...u)},FunctionPrototypeSymbolHasInstance(t,a){return Function.prototype[Symbol.hasInstance].call(t,a)},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(t,a){return Object.defineProperties(t,a)},ObjectDefineProperty(t,a,u){return Object.defineProperty(t,a,u)},ObjectGetOwnPropertyDescriptor(t,a){return Object.getOwnPropertyDescriptor(t,a)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,a){return Object.setPrototypeOf(t,a)},Promise,PromisePrototypeCatch(t,a){return t.catch(a)},PromisePrototypeThen(t,a,u){return t.then(a,u)},PromiseReject(t){return Promise.reject(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,a){return t.test(a)},SafeSet:Set,String,StringPrototypeSlice(t,a,u){return t.slice(a,u)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,TypedArrayPrototypeSet(t,a,u){return t.set(a,u)},Uint8Array}}),yt=Ae((e,n)=>{ae(),ue(),le();var t=(Ze(),Ue(Je)),a=Object.getPrototypeOf(async function(){}).constructor,u=globalThis.Blob||t.Blob,i=typeof u<"u"?function(s){return s instanceof u}:function(s){return!1},r=class extends Error{constructor(s){if(!Array.isArray(s))throw new TypeError(`Expected input to be an Array, got ${typeof s}`);let o="";for(let l=0;l<s.length;l++)o+=` ${s[l].stack}
|
|
3
|
-
`;super(o),this.name="AggregateError",this.errors=s}};n.exports={AggregateError:r,kEmptyObject:Object.freeze({}),once(s){let o=!1;return function(...l){o||(o=!0,s.apply(this,l))}},createDeferredPromise:function(){let s,o;return{promise:new Promise((l,f)=>{s=l,o=f}),resolve:s,reject:o}},promisify(s){return new Promise((o,l)=>{s((f,...p)=>f?l(f):o(...p))})},debuglog(){return function(){}},format(s,...o){return s.replace(/%([sdifj])/g,function(...[l,f]){let p=o.shift();return f==="f"?p.toFixed(6):f==="j"?JSON.stringify(p):f==="s"&&typeof p=="object"?`${p.constructor!==Object?p.constructor.name:""} {}`.trim():p.toString()})},inspect(s){switch(typeof s){case"string":if(s.includes("'"))if(s.includes('"')){if(!s.includes("`")&&!s.includes("${"))return`\`${s}\``}else return`"${s}"`;return`'${s}'`;case"number":return isNaN(s)?"NaN":Object.is(s,-0)?String(s):s;case"bigint":return`${String(s)}n`;case"boolean":case"undefined":return String(s);case"object":return"{}"}},types:{isAsyncFunction(s){return s instanceof a},isArrayBufferView(s){return ArrayBuffer.isView(s)}},isBlob:i},n.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),ui=Ae((e,n)=>{ae(),ue(),le();var{AbortController:t,AbortSignal:a}=typeof self<"u"?self:typeof window<"u"?window:void 0;n.exports=t,n.exports.AbortSignal=a,n.exports.default=t}),rt=Ae((e,n)=>{ae(),ue(),le();var{format:t,inspect:a,AggregateError:u}=yt(),i=globalThis.AggregateError||u,r=Symbol("kIsNodeError"),s=["string","function","number","object","Function","Object","boolean","bigint","symbol"],o=/^([A-Z][a-z0-9]*)+$/,l="__node_internal_",f={};function p(I,E){if(!I)throw new f.ERR_INTERNAL_ASSERTION(E)}function g(I){let E="",L=I.length,F=I[0]==="-"?1:0;for(;L>=F+4;L-=3)E=`_${I.slice(L-3,L)}${E}`;return`${I.slice(0,L)}${E}`}function m(I,E,L){if(typeof E=="function")return p(E.length<=L.length,`Code: ${I}; The provided arguments length (${L.length}) does not match the required ones (${E.length}).`),E(...L);let F=(E.match(/%[dfijoOs]/g)||[]).length;return p(F===L.length,`Code: ${I}; The provided arguments length (${L.length}) does not match the required ones (${F}).`),L.length===0?E:t(E,...L)}function A(I,E,L){L||(L=Error);class F extends L{constructor(...T){super(m(I,E,T))}toString(){return`${this.name} [${I}]: ${this.message}`}}Object.defineProperties(F.prototype,{name:{value:L.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${I}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),F.prototype.code=I,F.prototype[r]=!0,f[I]=F}function b(I){let E=l+I.name;return Object.defineProperty(I,"name",{value:E}),I}function _(I,E){if(I&&E&&I!==E){if(Array.isArray(E.errors))return E.errors.push(I),E;let L=new i([E,I],E.message);return L.code=E.code,L}return I||E}var x=class extends Error{constructor(I="The operation was aborted",E=void 0){if(E!==void 0&&typeof E!="object")throw new f.ERR_INVALID_ARG_TYPE("options","Object",E);super(I,E),this.code="ABORT_ERR",this.name="AbortError"}};A("ERR_ASSERTION","%s",Error),A("ERR_INVALID_ARG_TYPE",(I,E,L)=>{p(typeof I=="string","'name' must be a string"),Array.isArray(E)||(E=[E]);let F="The ";I.endsWith(" argument")?F+=`${I} `:F+=`"${I}" ${I.includes(".")?"property":"argument"} `,F+="must be ";let B=[],T=[],U=[];for(let J of E)p(typeof J=="string","All expected entries have to be of type string"),s.includes(J)?B.push(J.toLowerCase()):o.test(J)?T.push(J):(p(J!=="object",'The value "object" should be written as "Object"'),U.push(J));if(T.length>0){let J=B.indexOf("object");J!==-1&&(B.splice(B,J,1),T.push("Object"))}if(B.length>0){switch(B.length){case 1:F+=`of type ${B[0]}`;break;case 2:F+=`one of type ${B[0]} or ${B[1]}`;break;default:{let J=B.pop();F+=`one of type ${B.join(", ")}, or ${J}`}}(T.length>0||U.length>0)&&(F+=" or ")}if(T.length>0){switch(T.length){case 1:F+=`an instance of ${T[0]}`;break;case 2:F+=`an instance of ${T[0]} or ${T[1]}`;break;default:{let J=T.pop();F+=`an instance of ${T.join(", ")}, or ${J}`}}U.length>0&&(F+=" or ")}switch(U.length){case 0:break;case 1:U[0].toLowerCase()!==U[0]&&(F+="an "),F+=`${U[0]}`;break;case 2:F+=`one of ${U[0]} or ${U[1]}`;break;default:{let J=U.pop();F+=`one of ${U.join(", ")}, or ${J}`}}if(L==null)F+=`. Received ${L}`;else if(typeof L=="function"&&L.name)F+=`. Received function ${L.name}`;else if(typeof L=="object"){var W;if((W=L.constructor)!==null&&W!==void 0&&W.name)F+=`. Received an instance of ${L.constructor.name}`;else{let J=a(L,{depth:-1});F+=`. Received ${J}`}}else{let J=a(L,{colors:!1});J.length>25&&(J=`${J.slice(0,25)}...`),F+=`. Received type ${typeof L} (${J})`}return F},TypeError),A("ERR_INVALID_ARG_VALUE",(I,E,L="is invalid")=>{let F=a(E);return F.length>128&&(F=F.slice(0,128)+"..."),`The ${I.includes(".")?"property":"argument"} '${I}' ${L}. Received ${F}`},TypeError),A("ERR_INVALID_RETURN_VALUE",(I,E,L)=>{var F;let B=L!=null&&(F=L.constructor)!==null&&F!==void 0&&F.name?`instance of ${L.constructor.name}`:`type ${typeof L}`;return`Expected ${I} to be returned from the "${E}" function but got ${B}.`},TypeError),A("ERR_MISSING_ARGS",(...I)=>{p(I.length>0,"At least one arg needs to be specified");let E,L=I.length;switch(I=(Array.isArray(I)?I:[I]).map(F=>`"${F}"`).join(" or "),L){case 1:E+=`The ${I[0]} argument`;break;case 2:E+=`The ${I[0]} and ${I[1]} arguments`;break;default:{let F=I.pop();E+=`The ${I.join(", ")}, and ${F} arguments`}break}return`${E} must be specified`},TypeError),A("ERR_OUT_OF_RANGE",(I,E,L)=>{p(E,'Missing "range" argument');let F;return Number.isInteger(L)&&Math.abs(L)>2**32?F=g(String(L)):typeof L=="bigint"?(F=String(L),(L>2n**32n||L<-(2n**32n))&&(F=g(F)),F+="n"):F=a(L),`The value of "${I}" is out of range. It must be ${E}. Received ${F}`},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),n.exports={AbortError:x,aggregateTwoErrors:b(_),hideStackFrames:b,codes:f}}),vr=Ae((e,n)=>{ae(),ue(),le();var{ArrayIsArray:t,ArrayPrototypeIncludes:a,ArrayPrototypeJoin:u,ArrayPrototypeMap:i,NumberIsInteger:r,NumberIsNaN:s,NumberMAX_SAFE_INTEGER:o,NumberMIN_SAFE_INTEGER:l,NumberParseInt:f,ObjectPrototypeHasOwnProperty:p,RegExpPrototypeExec:g,String:m,StringPrototypeToUpperCase:A,StringPrototypeTrim:b}=qe(),{hideStackFrames:_,codes:{ERR_SOCKET_BAD_PORT:x,ERR_INVALID_ARG_TYPE:I,ERR_INVALID_ARG_VALUE:E,ERR_OUT_OF_RANGE:L,ERR_UNKNOWN_SIGNAL:F}}=rt(),{normalizeEncoding:B}=yt(),{isAsyncFunction:T,isArrayBufferView:U}=yt().types,W={};function J(D){return D===(D|0)}function ne(D){return D===D>>>0}var C=/^[0-7]+$/,q="must be a 32-bit unsigned integer or an octal string";function te(D,$,O){if(typeof D>"u"&&(D=O),typeof D=="string"){if(g(C,D)===null)throw new E($,D,q);D=f(D,8)}return se(D,$),D}var Y=_((D,$,O=l,N=o)=>{if(typeof D!="number")throw new I($,"number",D);if(!r(D))throw new L($,"an integer",D);if(D<O||D>N)throw new L($,`>= ${O} && <= ${N}`,D)}),me=_((D,$,O=-2147483648,N=2147483647)=>{if(typeof D!="number")throw new I($,"number",D);if(!r(D))throw new L($,"an integer",D);if(D<O||D>N)throw new L($,`>= ${O} && <= ${N}`,D)}),se=_((D,$,O=!1)=>{if(typeof D!="number")throw new I($,"number",D);if(!r(D))throw new L($,"an integer",D);let N=O?1:0,Q=4294967295;if(D<N||D>Q)throw new L($,`>= ${N} && <= ${Q}`,D)});function H(D,$){if(typeof D!="string")throw new I($,"string",D)}function be(D,$,O=void 0,N){if(typeof D!="number")throw new I($,"number",D);if(O!=null&&D<O||N!=null&&D>N||(O!=null||N!=null)&&s(D))throw new L($,`${O!=null?`>= ${O}`:""}${O!=null&&N!=null?" && ":""}${N!=null?`<= ${N}`:""}`,D)}var oe=_((D,$,O)=>{if(!a(O,D)){let N="must be one of: "+u(i(O,Q=>typeof Q=="string"?`'${Q}'`:m(Q)),", ");throw new E($,D,N)}});function we(D,$){if(typeof D!="boolean")throw new I($,"boolean",D)}function w(D,$,O){return D==null||!p(D,$)?O:D[$]}var G=_((D,$,O=null)=>{let N=w(O,"allowArray",!1),Q=w(O,"allowFunction",!1);if(!w(O,"nullable",!1)&&D===null||!N&&t(D)||typeof D!="object"&&(!Q||typeof D!="function"))throw new I($,"Object",D)}),de=_((D,$)=>{if(D!=null&&typeof D!="object"&&typeof D!="function")throw new I($,"a dictionary",D)}),ve=_((D,$,O=0)=>{if(!t(D))throw new I($,"Array",D);if(D.length<O){let N=`must be longer than ${O}`;throw new E($,D,N)}});function he(D,$){ve(D,$);for(let O=0;O<D.length;O++)H(D[O],`${$}[${O}]`)}function M(D,$){ve(D,$);for(let O=0;O<D.length;O++)we(D[O],`${$}[${O}]`)}function S(D,$="signal"){if(H(D,$),W[D]===void 0)throw W[A(D)]!==void 0?new F(D+" (signals must use all capital letters)"):new F(D)}var z=_((D,$="buffer")=>{if(!U(D))throw new I($,["Buffer","TypedArray","DataView"],D)});function fe(D,$){let O=B($),N=D.length;if(O==="hex"&&N%2!==0)throw new E("encoding",$,`is invalid for data of length ${N}`)}function re(D,$="Port",O=!0){if(typeof D!="number"&&typeof D!="string"||typeof D=="string"&&b(D).length===0||+D!==+D>>>0||D>65535||D===0&&!O)throw new x($,D,O);return D|0}var X=_((D,$)=>{if(D!==void 0&&(D===null||typeof D!="object"||!("aborted"in D)))throw new I($,"AbortSignal",D)}),ye=_((D,$)=>{if(typeof D!="function")throw new I($,"Function",D)}),ge=_((D,$)=>{if(typeof D!="function"||T(D))throw new I($,"Function",D)}),P=_((D,$)=>{if(D!==void 0)throw new I($,"undefined",D)});function j(D,$,O){if(!a(O,D))throw new I($,`('${u(O,"|")}')`,D)}var V=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function ie(D,$){if(typeof D>"u"||!g(V,D))throw new E($,D,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Z(D){if(typeof D=="string")return ie(D,"hints"),D;if(t(D)){let $=D.length,O="";if($===0)return O;for(let N=0;N<$;N++){let Q=D[N];ie(Q,"hints"),O+=Q,N!==$-1&&(O+=", ")}return O}throw new E("hints",D,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}n.exports={isInt32:J,isUint32:ne,parseFileMode:te,validateArray:ve,validateStringArray:he,validateBooleanArray:M,validateBoolean:we,validateBuffer:z,validateDictionary:de,validateEncoding:fe,validateFunction:ye,validateInt32:me,validateInteger:Y,validateNumber:be,validateObject:G,validateOneOf:oe,validatePlainFunction:ge,validatePort:re,validateSignalName:S,validateString:H,validateUint32:se,validateUndefined:P,validateUnion:j,validateAbortSignal:X,validateLinkHeaderValue:Z}}),Nt=Ae((e,n)=>{ae(),ue(),le();var t=n.exports={},a,u;function i(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?a=setTimeout:a=i}catch{a=i}try{typeof clearTimeout=="function"?u=clearTimeout:u=r}catch{u=r}})();function s(x){if(a===setTimeout)return setTimeout(x,0);if((a===i||!a)&&setTimeout)return a=setTimeout,setTimeout(x,0);try{return a(x,0)}catch{try{return a.call(null,x,0)}catch{return a.call(this,x,0)}}}function o(x){if(u===clearTimeout)return clearTimeout(x);if((u===r||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(x);try{return u(x)}catch{try{return u.call(null,x)}catch{return u.call(this,x)}}}var l=[],f=!1,p,g=-1;function m(){!f||!p||(f=!1,p.length?l=p.concat(l):g=-1,l.length&&A())}function A(){if(!f){var x=s(m);f=!0;for(var I=l.length;I;){for(p=l,l=[];++g<I;)p&&p[g].run();g=-1,I=l.length}p=null,f=!1,o(x)}}t.nextTick=function(x){var I=new Array(arguments.length-1);if(arguments.length>1)for(var E=1;E<arguments.length;E++)I[E-1]=arguments[E];l.push(new b(x,I)),l.length===1&&!f&&s(A)};function b(x,I){this.fun=x,this.array=I}b.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function _(){}t.on=_,t.addListener=_,t.once=_,t.off=_,t.removeListener=_,t.removeAllListeners=_,t.emit=_,t.prependListener=_,t.prependOnceListener=_,t.listeners=function(x){return[]},t.binding=function(x){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(x){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}}),wt=Ae((e,n)=>{ae(),ue(),le();var{Symbol:t,SymbolAsyncIterator:a,SymbolIterator:u,SymbolFor:i}=qe(),r=t("kDestroyed"),s=t("kIsErrored"),o=t("kIsReadable"),l=t("kIsDisturbed"),f=i("nodejs.webstream.isClosedPromise"),p=i("nodejs.webstream.controllerErrorFunction");function g(w,G=!1){var de;return!!(w&&typeof w.pipe=="function"&&typeof w.on=="function"&&(!G||typeof w.pause=="function"&&typeof w.resume=="function")&&(!w._writableState||((de=w._readableState)===null||de===void 0?void 0:de.readable)!==!1)&&(!w._writableState||w._readableState))}function m(w){var G;return!!(w&&typeof w.write=="function"&&typeof w.on=="function"&&(!w._readableState||((G=w._writableState)===null||G===void 0?void 0:G.writable)!==!1))}function A(w){return!!(w&&typeof w.pipe=="function"&&w._readableState&&typeof w.on=="function"&&typeof w.write=="function")}function b(w){return w&&(w._readableState||w._writableState||typeof w.write=="function"&&typeof w.on=="function"||typeof w.pipe=="function"&&typeof w.on=="function")}function _(w){return!!(w&&!b(w)&&typeof w.pipeThrough=="function"&&typeof w.getReader=="function"&&typeof w.cancel=="function")}function x(w){return!!(w&&!b(w)&&typeof w.getWriter=="function"&&typeof w.abort=="function")}function I(w){return!!(w&&!b(w)&&typeof w.readable=="object"&&typeof w.writable=="object")}function E(w){return _(w)||x(w)||I(w)}function L(w,G){return w==null?!1:G===!0?typeof w[a]=="function":G===!1?typeof w[u]=="function":typeof w[a]=="function"||typeof w[u]=="function"}function F(w){if(!b(w))return null;let G=w._writableState,de=w._readableState,ve=G||de;return!!(w.destroyed||w[r]||ve!=null&&ve.destroyed)}function B(w){if(!m(w))return null;if(w.writableEnded===!0)return!0;let G=w._writableState;return G!=null&&G.errored?!1:typeof(G==null?void 0:G.ended)!="boolean"?null:G.ended}function T(w,G){if(!m(w))return null;if(w.writableFinished===!0)return!0;let de=w._writableState;return de!=null&&de.errored?!1:typeof(de==null?void 0:de.finished)!="boolean"?null:!!(de.finished||G===!1&&de.ended===!0&&de.length===0)}function U(w){if(!g(w))return null;if(w.readableEnded===!0)return!0;let G=w._readableState;return!G||G.errored?!1:typeof(G==null?void 0:G.ended)!="boolean"?null:G.ended}function W(w,G){if(!g(w))return null;let de=w._readableState;return de!=null&&de.errored?!1:typeof(de==null?void 0:de.endEmitted)!="boolean"?null:!!(de.endEmitted||G===!1&&de.ended===!0&&de.length===0)}function J(w){return w&&w[o]!=null?w[o]:typeof(w==null?void 0:w.readable)!="boolean"?null:F(w)?!1:g(w)&&w.readable&&!W(w)}function ne(w){return typeof(w==null?void 0:w.writable)!="boolean"?null:F(w)?!1:m(w)&&w.writable&&!B(w)}function C(w,G){return b(w)?F(w)?!0:!((G==null?void 0:G.readable)!==!1&&J(w)||(G==null?void 0:G.writable)!==!1&&ne(w)):null}function q(w){var G,de;return b(w)?w.writableErrored?w.writableErrored:(G=(de=w._writableState)===null||de===void 0?void 0:de.errored)!==null&&G!==void 0?G:null:null}function te(w){var G,de;return b(w)?w.readableErrored?w.readableErrored:(G=(de=w._readableState)===null||de===void 0?void 0:de.errored)!==null&&G!==void 0?G:null:null}function Y(w){if(!b(w))return null;if(typeof w.closed=="boolean")return w.closed;let G=w._writableState,de=w._readableState;return typeof(G==null?void 0:G.closed)=="boolean"||typeof(de==null?void 0:de.closed)=="boolean"?(G==null?void 0:G.closed)||(de==null?void 0:de.closed):typeof w._closed=="boolean"&&me(w)?w._closed:null}function me(w){return typeof w._closed=="boolean"&&typeof w._defaultKeepAlive=="boolean"&&typeof w._removedConnection=="boolean"&&typeof w._removedContLen=="boolean"}function se(w){return typeof w._sent100=="boolean"&&me(w)}function H(w){var G;return typeof w._consuming=="boolean"&&typeof w._dumped=="boolean"&&((G=w.req)===null||G===void 0?void 0:G.upgradeOrConnect)===void 0}function be(w){if(!b(w))return null;let G=w._writableState,de=w._readableState,ve=G||de;return!ve&&se(w)||!!(ve&&ve.autoDestroy&&ve.emitClose&&ve.closed===!1)}function oe(w){var G;return!!(w&&((G=w[l])!==null&&G!==void 0?G:w.readableDidRead||w.readableAborted))}function we(w){var G,de,ve,he,M,S,z,fe,re,X;return!!(w&&((G=(de=(ve=(he=(M=(S=w[s])!==null&&S!==void 0?S:w.readableErrored)!==null&&M!==void 0?M:w.writableErrored)!==null&&he!==void 0?he:(z=w._readableState)===null||z===void 0?void 0:z.errorEmitted)!==null&&ve!==void 0?ve:(fe=w._writableState)===null||fe===void 0?void 0:fe.errorEmitted)!==null&&de!==void 0?de:(re=w._readableState)===null||re===void 0?void 0:re.errored)!==null&&G!==void 0?G:!((X=w._writableState)===null||X===void 0)&&X.errored))}n.exports={kDestroyed:r,isDisturbed:oe,kIsDisturbed:l,isErrored:we,kIsErrored:s,isReadable:J,kIsReadable:o,kIsClosedPromise:f,kControllerErrorFunction:p,isClosed:Y,isDestroyed:F,isDuplexNodeStream:A,isFinished:C,isIterable:L,isReadableNodeStream:g,isReadableStream:_,isReadableEnded:U,isReadableFinished:W,isReadableErrored:te,isNodeStream:b,isWebStream:E,isWritable:ne,isWritableNodeStream:m,isWritableStream:x,isWritableEnded:B,isWritableFinished:T,isWritableErrored:q,isServerRequest:H,isServerResponse:se,willEmitClose:be,isTransformStream:I}}),Pt=Ae((e,n)=>{ae(),ue(),le();var t=Nt(),{AbortError:a,codes:u}=rt(),{ERR_INVALID_ARG_TYPE:i,ERR_STREAM_PREMATURE_CLOSE:r}=u,{kEmptyObject:s,once:o}=yt(),{validateAbortSignal:l,validateFunction:f,validateObject:p,validateBoolean:g}=vr(),{Promise:m,PromisePrototypeThen:A}=qe(),{isClosed:b,isReadable:_,isReadableNodeStream:x,isReadableStream:I,isReadableFinished:E,isReadableErrored:L,isWritable:F,isWritableNodeStream:B,isWritableStream:T,isWritableFinished:U,isWritableErrored:W,isNodeStream:J,willEmitClose:ne,kIsClosedPromise:C}=wt();function q(H){return H.setHeader&&typeof H.abort=="function"}var te=()=>{};function Y(H,be,oe){var we,w;if(arguments.length===2?(oe=be,be=s):be==null?be=s:p(be,"options"),f(oe,"callback"),l(be.signal,"options.signal"),oe=o(oe),I(H)||T(H))return me(H,be,oe);if(!J(H))throw new i("stream",["ReadableStream","WritableStream","Stream"],H);let G=(we=be.readable)!==null&&we!==void 0?we:x(H),de=(w=be.writable)!==null&&w!==void 0?w:B(H),ve=H._writableState,he=H._readableState,M=()=>{H.writable||fe()},S=ne(H)&&x(H)===G&&B(H)===de,z=U(H,!1),fe=()=>{z=!0,H.destroyed&&(S=!1),!(S&&(!H.readable||G))&&(!G||re)&&oe.call(H)},re=E(H,!1),X=()=>{re=!0,H.destroyed&&(S=!1),!(S&&(!H.writable||de))&&(!de||z)&&oe.call(H)},ye=Z=>{oe.call(H,Z)},ge=b(H),P=()=>{ge=!0;let Z=W(H)||L(H);if(Z&&typeof Z!="boolean")return oe.call(H,Z);if(G&&!re&&x(H,!0)&&!E(H,!1))return oe.call(H,new r);if(de&&!z&&!U(H,!1))return oe.call(H,new r);oe.call(H)},j=()=>{ge=!0;let Z=W(H)||L(H);if(Z&&typeof Z!="boolean")return oe.call(H,Z);oe.call(H)},V=()=>{H.req.on("finish",fe)};q(H)?(H.on("complete",fe),S||H.on("abort",P),H.req?V():H.on("request",V)):de&&!ve&&(H.on("end",M),H.on("close",M)),!S&&typeof H.aborted=="boolean"&&H.on("aborted",P),H.on("end",X),H.on("finish",fe),be.error!==!1&&H.on("error",ye),H.on("close",P),ge?t.nextTick(P):ve!=null&&ve.errorEmitted||he!=null&&he.errorEmitted?S||t.nextTick(j):(!G&&(!S||_(H))&&(z||F(H)===!1)||!de&&(!S||F(H))&&(re||_(H)===!1)||he&&H.req&&H.aborted)&&t.nextTick(j);let ie=()=>{oe=te,H.removeListener("aborted",P),H.removeListener("complete",fe),H.removeListener("abort",P),H.removeListener("request",V),H.req&&H.req.removeListener("finish",fe),H.removeListener("end",M),H.removeListener("close",M),H.removeListener("finish",fe),H.removeListener("end",X),H.removeListener("error",ye),H.removeListener("close",P)};if(be.signal&&!ge){let Z=()=>{let D=oe;ie(),D.call(H,new a(void 0,{cause:be.signal.reason}))};if(be.signal.aborted)t.nextTick(Z);else{let D=oe;oe=o((...$)=>{be.signal.removeEventListener("abort",Z),D.apply(H,$)}),be.signal.addEventListener("abort",Z)}}return ie}function me(H,be,oe){let we=!1,w=te;if(be.signal)if(w=()=>{we=!0,oe.call(H,new a(void 0,{cause:be.signal.reason}))},be.signal.aborted)t.nextTick(w);else{let de=oe;oe=o((...ve)=>{be.signal.removeEventListener("abort",w),de.apply(H,ve)}),be.signal.addEventListener("abort",w)}let G=(...de)=>{we||t.nextTick(()=>oe.apply(H,de))};return A(H[C].promise,G,G),te}function se(H,be){var oe;let we=!1;return be===null&&(be=s),(oe=be)!==null&&oe!==void 0&&oe.cleanup&&(g(be.cleanup,"cleanup"),we=be.cleanup),new m((w,G)=>{let de=Y(H,be,ve=>{we&&de(),ve?G(ve):w()})})}n.exports=Y,n.exports.finished=se}),tr=Ae((e,n)=>{ae(),ue(),le();var t=Nt(),{aggregateTwoErrors:a,codes:{ERR_MULTIPLE_CALLBACK:u},AbortError:i}=rt(),{Symbol:r}=qe(),{kDestroyed:s,isDestroyed:o,isFinished:l,isServerRequest:f}=wt(),p=r("kDestroy"),g=r("kConstruct");function m(C,q,te){C&&(C.stack,q&&!q.errored&&(q.errored=C),te&&!te.errored&&(te.errored=C))}function A(C,q){let te=this._readableState,Y=this._writableState,me=Y||te;return Y!=null&&Y.destroyed||te!=null&&te.destroyed?(typeof q=="function"&&q(),this):(m(C,Y,te),Y&&(Y.destroyed=!0),te&&(te.destroyed=!0),me.constructed?b(this,C,q):this.once(p,function(se){b(this,a(se,C),q)}),this)}function b(C,q,te){let Y=!1;function me(se){if(Y)return;Y=!0;let H=C._readableState,be=C._writableState;m(se,be,H),be&&(be.closed=!0),H&&(H.closed=!0),typeof te=="function"&&te(se),se?t.nextTick(_,C,se):t.nextTick(x,C)}try{C._destroy(q||null,me)}catch(se){me(se)}}function _(C,q){I(C,q),x(C)}function x(C){let q=C._readableState,te=C._writableState;te&&(te.closeEmitted=!0),q&&(q.closeEmitted=!0),(te!=null&&te.emitClose||q!=null&&q.emitClose)&&C.emit("close")}function I(C,q){let te=C._readableState,Y=C._writableState;Y!=null&&Y.errorEmitted||te!=null&&te.errorEmitted||(Y&&(Y.errorEmitted=!0),te&&(te.errorEmitted=!0),C.emit("error",q))}function E(){let C=this._readableState,q=this._writableState;C&&(C.constructed=!0,C.closed=!1,C.closeEmitted=!1,C.destroyed=!1,C.errored=null,C.errorEmitted=!1,C.reading=!1,C.ended=C.readable===!1,C.endEmitted=C.readable===!1),q&&(q.constructed=!0,q.destroyed=!1,q.closed=!1,q.closeEmitted=!1,q.errored=null,q.errorEmitted=!1,q.finalCalled=!1,q.prefinished=!1,q.ended=q.writable===!1,q.ending=q.writable===!1,q.finished=q.writable===!1)}function L(C,q,te){let Y=C._readableState,me=C._writableState;if(me!=null&&me.destroyed||Y!=null&&Y.destroyed)return this;Y!=null&&Y.autoDestroy||me!=null&&me.autoDestroy?C.destroy(q):q&&(q.stack,me&&!me.errored&&(me.errored=q),Y&&!Y.errored&&(Y.errored=q),te?t.nextTick(I,C,q):I(C,q))}function F(C,q){if(typeof C._construct!="function")return;let te=C._readableState,Y=C._writableState;te&&(te.constructed=!1),Y&&(Y.constructed=!1),C.once(g,q),!(C.listenerCount(g)>1)&&t.nextTick(B,C)}function B(C){let q=!1;function te(Y){if(q){L(C,Y??new u);return}q=!0;let me=C._readableState,se=C._writableState,H=se||me;me&&(me.constructed=!0),se&&(se.constructed=!0),H.destroyed?C.emit(p,Y):Y?L(C,Y,!0):t.nextTick(T,C)}try{C._construct(Y=>{t.nextTick(te,Y)})}catch(Y){t.nextTick(te,Y)}}function T(C){C.emit(g)}function U(C){return(C==null?void 0:C.setHeader)&&typeof C.abort=="function"}function W(C){C.emit("close")}function J(C,q){C.emit("error",q),t.nextTick(W,C)}function ne(C,q){!C||o(C)||(!q&&!l(C)&&(q=new i),f(C)?(C.socket=null,C.destroy(q)):U(C)?C.abort():U(C.req)?C.req.abort():typeof C.destroy=="function"?C.destroy(q):typeof C.close=="function"?C.close():q?t.nextTick(J,C,q):t.nextTick(W,C),C.destroyed||(C[s]=!0))}n.exports={construct:F,destroyer:ne,destroy:A,undestroy:E,errorOrDestroy:L}});function Re(){Re.init.call(this)}function _r(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function Uo(e){return e._maxListeners===void 0?Re.defaultMaxListeners:e._maxListeners}function Do(e,n,t,a){var u,i,r,s;if(_r(t),(i=e._events)===void 0?(i=e._events=Object.create(null),e._eventsCount=0):(i.newListener!==void 0&&(e.emit("newListener",n,t.listener?t.listener:t),i=e._events),r=i[n]),r===void 0)r=i[n]=t,++e._eventsCount;else if(typeof r=="function"?r=i[n]=a?[t,r]:[r,t]:a?r.unshift(t):r.push(t),(u=Uo(e))>0&&r.length>u&&!r.warned){r.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+r.length+" "+String(n)+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=e,o.type=n,o.count=r.length,s=o,console&&console.warn&&console.warn(s)}return e}function Au(){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 Lo(e,n,t){var a={fired:!1,wrapFn:void 0,target:e,type:n,listener:t},u=Au.bind(a);return u.listener=t,a.wrapFn=u,u}function No(e,n,t){var a=e._events;if(a===void 0)return[];var u=a[n];return u===void 0?[]:typeof u=="function"?t?[u.listener||u]:[u]:t?function(i){for(var r=new Array(i.length),s=0;s<r.length;++s)r[s]=i[s].listener||i[s];return r}(u):jo(u,u.length)}function Fo(e){var n=this._events;if(n!==void 0){var t=n[e];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}function jo(e,n){for(var t=new Array(n),a=0;a<n;++a)t[a]=e[a];return t}var Vo,Ko,Ft,ci,hi,fi,it,Wo=Ge(()=>{ae(),ue(),le(),Ft=typeof Reflect=="object"?Reflect:null,ci=Ft&&typeof Ft.apply=="function"?Ft.apply:function(e,n,t){return Function.prototype.apply.call(e,n,t)},Ko=Ft&&typeof Ft.ownKeys=="function"?Ft.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)},hi=Number.isNaN||function(e){return e!=e},Vo=Re,Re.EventEmitter=Re,Re.prototype._events=void 0,Re.prototype._eventsCount=0,Re.prototype._maxListeners=void 0,fi=10,Object.defineProperty(Re,"defaultMaxListeners",{enumerable:!0,get:function(){return fi},set:function(e){if(typeof e!="number"||e<0||hi(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");fi=e}}),Re.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},Re.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||hi(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},Re.prototype.getMaxListeners=function(){return Uo(this)},Re.prototype.emit=function(e){for(var n=[],t=1;t<arguments.length;t++)n.push(arguments[t]);var a=e==="error",u=this._events;if(u!==void 0)a=a&&u.error===void 0;else if(!a)return!1;if(a){var i;if(n.length>0&&(i=n[0]),i instanceof Error)throw i;var r=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw r.context=i,r}var s=u[e];if(s===void 0)return!1;if(typeof s=="function")ci(s,this,n);else{var o=s.length,l=jo(s,o);for(t=0;t<o;++t)ci(l[t],this,n)}return!0},Re.prototype.addListener=function(e,n){return Do(this,e,n,!1)},Re.prototype.on=Re.prototype.addListener,Re.prototype.prependListener=function(e,n){return Do(this,e,n,!0)},Re.prototype.once=function(e,n){return _r(n),this.on(e,Lo(this,e,n)),this},Re.prototype.prependOnceListener=function(e,n){return _r(n),this.prependListener(e,Lo(this,e,n)),this},Re.prototype.removeListener=function(e,n){var t,a,u,i,r;if(_r(n),(a=this._events)===void 0)return this;if((t=a[e])===void 0)return this;if(t===n||t.listener===n)--this._eventsCount==0?this._events=Object.create(null):(delete a[e],a.removeListener&&this.emit("removeListener",e,t.listener||n));else if(typeof t!="function"){for(u=-1,i=t.length-1;i>=0;i--)if(t[i]===n||t[i].listener===n){r=t[i].listener,u=i;break}if(u<0)return this;u===0?t.shift():function(s,o){for(;o+1<s.length;o++)s[o]=s[o+1];s.pop()}(t,u),t.length===1&&(a[e]=t[0]),a.removeListener!==void 0&&this.emit("removeListener",e,r||n)}return this},Re.prototype.off=Re.prototype.removeListener,Re.prototype.removeAllListeners=function(e){var n,t,a;if((t=this._events)===void 0)return this;if(t.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):t[e]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete t[e]),this;if(arguments.length===0){var u,i=Object.keys(t);for(a=0;a<i.length;++a)(u=i[a])!=="removeListener"&&this.removeAllListeners(u);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(n=t[e])=="function")this.removeListener(e,n);else if(n!==void 0)for(a=n.length-1;a>=0;a--)this.removeListener(e,n[a]);return this},Re.prototype.listeners=function(e){return No(this,e,!0)},Re.prototype.rawListeners=function(e){return No(this,e,!1)},Re.listenerCount=function(e,n){return typeof e.listenerCount=="function"?e.listenerCount(n):Fo.call(e,n)},Re.prototype.listenerCount=Fo,Re.prototype.eventNames=function(){return this._eventsCount>0?Ko(this._events):[]},it=Vo,it.EventEmitter,it.defaultMaxListeners,it.init,it.listenerCount,it.EventEmitter,it.defaultMaxListeners,it.init,it.listenerCount}),jt={};Ut(jt,{EventEmitter:()=>Qo,default:()=>it,defaultMaxListeners:()=>Ho,init:()=>qo,listenerCount:()=>$o,on:()=>zo,once:()=>Yo});var Qo,Ho,qo,$o,zo,Yo,rr=Ge(()=>{ae(),ue(),le(),Wo(),Wo(),it.once=function(e,n){return new Promise((t,a)=>{function u(...r){i!==void 0&&e.removeListener("error",i),t(r)}let i;n!=="error"&&(i=r=>{e.removeListener(name,u),a(r)},e.once("error",i)),e.once(n,u)})},it.on=function(e,n){let t=[],a=[],u=null,i=!1,r={async next(){let l=t.shift();if(l)return createIterResult(l,!1);if(u){let f=Promise.reject(u);return u=null,f}return i?createIterResult(void 0,!0):new Promise((f,p)=>a.push({resolve:f,reject:p}))},async return(){e.removeListener(n,s),e.removeListener("error",o),i=!0;for(let l of a)l.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(l){u=l,e.removeListener(n,s),e.removeListener("error",o)},[Symbol.asyncIterator](){return this}};return e.on(n,s),e.on("error",o),r;function s(...l){let f=a.shift();f?f.resolve(createIterResult(l,!1)):t.push(l)}function o(l){i=!0;let f=a.shift();f?f.reject(l):u=l,r.return()}},{EventEmitter:Qo,defaultMaxListeners:Ho,init:qo,listenerCount:$o,on:zo,once:Yo}=it}),di=Ae((e,n)=>{ae(),ue(),le();var{ArrayIsArray:t,ObjectSetPrototypeOf:a}=qe(),{EventEmitter:u}=(rr(),Ue(jt));function i(s){u.call(this,s)}a(i.prototype,u.prototype),a(i,u),i.prototype.pipe=function(s,o){let l=this;function f(x){s.writable&&s.write(x)===!1&&l.pause&&l.pause()}l.on("data",f);function p(){l.readable&&l.resume&&l.resume()}s.on("drain",p),!s._isStdio&&(!o||o.end!==!1)&&(l.on("end",m),l.on("close",A));let g=!1;function m(){g||(g=!0,s.end())}function A(){g||(g=!0,typeof s.destroy=="function"&&s.destroy())}function b(x){_(),u.listenerCount(this,"error")===0&&this.emit("error",x)}r(l,"error",b),r(s,"error",b);function _(){l.removeListener("data",f),s.removeListener("drain",p),l.removeListener("end",m),l.removeListener("close",A),l.removeListener("error",b),s.removeListener("error",b),l.removeListener("end",_),l.removeListener("close",_),s.removeListener("close",_)}return l.on("end",_),l.on("close",_),s.on("close",_),s.emit("pipe",l),s};function r(s,o,l){if(typeof s.prependListener=="function")return s.prependListener(o,l);!s._events||!s._events[o]?s.on(o,l):t(s._events[o])?s._events[o].unshift(l):s._events[o]=[l,s._events[o]]}n.exports={Stream:i,prependListener:r}}),Er=Ae((e,n)=>{ae(),ue(),le();var{AbortError:t,codes:a}=rt(),{isNodeStream:u,isWebStream:i,kControllerErrorFunction:r}=wt(),s=Pt(),{ERR_INVALID_ARG_TYPE:o}=a,l=(f,p)=>{if(typeof f!="object"||!("aborted"in f))throw new o(p,"AbortSignal",f)};n.exports.addAbortSignal=function(f,p){if(l(f,"signal"),!u(p)&&!i(p))throw new o("stream",["ReadableStream","WritableStream","Stream"],p);return n.exports.addAbortSignalNoValidate(f,p)},n.exports.addAbortSignalNoValidate=function(f,p){if(typeof f!="object"||!("aborted"in f))return p;let g=u(p)?()=>{p.destroy(new t(void 0,{cause:f.reason}))}:()=>{p[r](new t(void 0,{cause:f.reason}))};return f.aborted?g():(f.addEventListener("abort",g),s(p,()=>f.removeEventListener("abort",g))),p}}),bu=Ae((e,n)=>{ae(),ue(),le();var{StringPrototypeSlice:t,SymbolIterator:a,TypedArrayPrototypeSet:u,Uint8Array:i}=qe(),{Buffer:r}=(Ze(),Ue(Je)),{inspect:s}=yt();n.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(o){let l={data:o,next:null};this.length>0?this.tail.next=l:this.head=l,this.tail=l,++this.length}unshift(o){let l={data:o,next:this.head};this.length===0&&(this.tail=l),this.head=l,++this.length}shift(){if(this.length===0)return;let o=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,o}clear(){this.head=this.tail=null,this.length=0}join(o){if(this.length===0)return"";let l=this.head,f=""+l.data;for(;(l=l.next)!==null;)f+=o+l.data;return f}concat(o){if(this.length===0)return r.alloc(0);let l=r.allocUnsafe(o>>>0),f=this.head,p=0;for(;f;)u(l,f.data,p),p+=f.data.length,f=f.next;return l}consume(o,l){let f=this.head.data;if(o<f.length){let p=f.slice(0,o);return this.head.data=f.slice(o),p}return o===f.length?this.shift():l?this._getString(o):this._getBuffer(o)}first(){return this.head.data}*[a](){for(let o=this.head;o;o=o.next)yield o.data}_getString(o){let l="",f=this.head,p=0;do{let g=f.data;if(o>g.length)l+=g,o-=g.length;else{o===g.length?(l+=g,++p,f.next?this.head=f.next:this.head=this.tail=null):(l+=t(g,0,o),this.head=f,f.data=t(g,o));break}++p}while((f=f.next)!==null);return this.length-=p,l}_getBuffer(o){let l=r.allocUnsafe(o),f=o,p=this.head,g=0;do{let m=p.data;if(o>m.length)u(l,m,f-o),o-=m.length;else{o===m.length?(u(l,m,f-o),++g,p.next?this.head=p.next:this.head=this.tail=null):(u(l,new i(m.buffer,m.byteOffset,o),f-o),this.head=p,p.data=m.slice(o));break}++g}while((p=p.next)!==null);return this.length-=g,l}[Symbol.for("nodejs.util.inspect.custom")](o,l){return s(this,{...l,depth:0,customInspect:!1})}}}),pi=Ae((e,n)=>{ae(),ue(),le();var{MathFloor:t,NumberIsInteger:a}=qe(),{ERR_INVALID_ARG_VALUE:u}=rt().codes;function i(o,l,f){return o.highWaterMark!=null?o.highWaterMark:l?o[f]:null}function r(o){return o?16:16*1024}function s(o,l,f,p){let g=i(l,p,f);if(g!=null){if(!a(g)||g<0){let m=p?`options.${f}`:"options.highWaterMark";throw new u(m,g)}return t(g)}return r(o.objectMode)}n.exports={getHighWaterMark:s,getDefaultHighWaterMark:r}});function Go(e){var n=e.length;if(n%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");return t===-1&&(t=n),[t,t===n?0:4-t%4]}function yu(e,n,t){for(var a,u,i=[],r=n;r<t;r+=3)a=(e[r]<<16&16711680)+(e[r+1]<<8&65280)+(255&e[r+2]),i.push(at[(u=a)>>18&63]+at[u>>12&63]+at[u>>6&63]+at[63&u]);return i.join("")}function vt(e){if(e>2147483647)throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=new Uint8Array(e);return Object.setPrototypeOf(n,pe.prototype),n}function pe(e,n,t){if(typeof e=="number"){if(typeof n=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return gi(e)}return Jo(e,n,t)}function Jo(e,n,t){if(typeof e=="string")return function(i,r){if(typeof r=="string"&&r!==""||(r="utf8"),!pe.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var s=0|Xo(i,r),o=vt(s),l=o.write(i,r);return l!==s&&(o=o.slice(0,l)),o}(e,n);if(ArrayBuffer.isView(e))return mi(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(_t(e,ArrayBuffer)||e&&_t(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(_t(e,SharedArrayBuffer)||e&&_t(e.buffer,SharedArrayBuffer)))return wu(e,n,t);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var a=e.valueOf&&e.valueOf();if(a!=null&&a!==e)return pe.from(a,n,t);var u=function(i){if(pe.isBuffer(i)){var r=0|Ai(i.length),s=vt(r);return s.length===0||i.copy(s,0,0,r),s}if(i.length!==void 0)return typeof i.length!="number"||yi(i.length)?vt(0):mi(i);if(i.type==="Buffer"&&Array.isArray(i.data))return mi(i.data)}(e);if(u)return u;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return pe.from(e[Symbol.toPrimitive]("string"),n,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function Zo(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function gi(e){return Zo(e),vt(e<0?0:0|Ai(e))}function mi(e){for(var n=e.length<0?0:0|Ai(e.length),t=vt(n),a=0;a<n;a+=1)t[a]=255&e[a];return t}function wu(e,n,t){if(n<0||e.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<n+(t||0))throw new RangeError('"length" is outside of buffer bounds');var a;return a=n===void 0&&t===void 0?new Uint8Array(e):t===void 0?new Uint8Array(e,n):new Uint8Array(e,n,t),Object.setPrototypeOf(a,pe.prototype),a}function Ai(e){if(e>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function Xo(e,n){if(pe.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||_t(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var t=e.length,a=arguments.length>2&&arguments[2]===!0;if(!a&&t===0)return 0;for(var u=!1;;)switch(n){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return bi(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t;case"hex":return t>>>1;case"base64":return as(e).length;default:if(u)return a?-1:bi(e).length;n=(""+n).toLowerCase(),u=!0}}function vu(e,n,t){var a=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0)<=(n>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return Ou(this,n,t);case"utf8":case"utf-8":return ns(this,n,t);case"ascii":return Tu(this,n,t);case"latin1":case"binary":return Bu(this,n,t);case"base64":return ku(this,n,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pu(this,n,t);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function Vt(e,n,t){var a=e[n];e[n]=e[t],e[t]=a}function es(e,n,t,a,u){if(e.length===0)return-1;if(typeof t=="string"?(a=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),yi(t=+t)&&(t=u?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(u)return-1;t=e.length-1}else if(t<0){if(!u)return-1;t=0}if(typeof n=="string"&&(n=pe.from(n,a)),pe.isBuffer(n))return n.length===0?-1:ts(e,n,t,a,u);if(typeof n=="number")return n&=255,typeof Uint8Array.prototype.indexOf=="function"?u?Uint8Array.prototype.indexOf.call(e,n,t):Uint8Array.prototype.lastIndexOf.call(e,n,t):ts(e,[n],t,a,u);throw new TypeError("val must be string, number or Buffer")}function ts(e,n,t,a,u){var i,r=1,s=e.length,o=n.length;if(a!==void 0&&((a=String(a).toLowerCase())==="ucs2"||a==="ucs-2"||a==="utf16le"||a==="utf-16le")){if(e.length<2||n.length<2)return-1;r=2,s/=2,o/=2,t/=2}function l(m,A){return r===1?m[A]:m.readUInt16BE(A*r)}if(u){var f=-1;for(i=t;i<s;i++)if(l(e,i)===l(n,f===-1?0:i-f)){if(f===-1&&(f=i),i-f+1===o)return f*r}else f!==-1&&(i-=i-f),f=-1}else for(t+o>s&&(t=s-o),i=t;i>=0;i--){for(var p=!0,g=0;g<o;g++)if(l(e,i+g)!==l(n,g)){p=!1;break}if(p)return i}return-1}function _u(e,n,t,a){t=Number(t)||0;var u=e.length-t;a?(a=Number(a))>u&&(a=u):a=u;var i=n.length;a>i/2&&(a=i/2);for(var r=0;r<a;++r){var s=parseInt(n.substr(2*r,2),16);if(yi(s))return r;e[t+r]=s}return r}function Eu(e,n,t,a){return Sr(bi(n,e.length-t),e,t,a)}function rs(e,n,t,a){return Sr(function(u){for(var i=[],r=0;r<u.length;++r)i.push(255&u.charCodeAt(r));return i}(n),e,t,a)}function Su(e,n,t,a){return rs(e,n,t,a)}function Cu(e,n,t,a){return Sr(as(n),e,t,a)}function Iu(e,n,t,a){return Sr(function(u,i){for(var r,s,o,l=[],f=0;f<u.length&&!((i-=2)<0);++f)r=u.charCodeAt(f),s=r>>8,o=r%256,l.push(o),l.push(s);return l}(n,e.length-t),e,t,a)}function ku(e,n,t){return n===0&&t===e.length?Ir.fromByteArray(e):Ir.fromByteArray(e.slice(n,t))}function ns(e,n,t){t=Math.min(e.length,t);for(var a=[],u=n;u<t;){var i,r,s,o,l=e[u],f=null,p=l>239?4:l>223?3:l>191?2:1;if(u+p<=t)switch(p){case 1:l<128&&(f=l);break;case 2:(192&(i=e[u+1]))==128&&(o=(31&l)<<6|63&i)>127&&(f=o);break;case 3:i=e[u+1],r=e[u+2],(192&i)==128&&(192&r)==128&&(o=(15&l)<<12|(63&i)<<6|63&r)>2047&&(o<55296||o>57343)&&(f=o);break;case 4:i=e[u+1],r=e[u+2],s=e[u+3],(192&i)==128&&(192&r)==128&&(192&s)==128&&(o=(15&l)<<18|(63&i)<<12|(63&r)<<6|63&s)>65535&&o<1114112&&(f=o)}f===null?(f=65533,p=1):f>65535&&(f-=65536,a.push(f>>>10&1023|55296),f=56320|1023&f),a.push(f),u+=p}return function(g){var m=g.length;if(m<=4096)return String.fromCharCode.apply(String,g);for(var A="",b=0;b<m;)A+=String.fromCharCode.apply(String,g.slice(b,b+=4096));return A}(a)}function Tu(e,n,t){var a="";t=Math.min(e.length,t);for(var u=n;u<t;++u)a+=String.fromCharCode(127&e[u]);return a}function Bu(e,n,t){var a="";t=Math.min(e.length,t);for(var u=n;u<t;++u)a+=String.fromCharCode(e[u]);return a}function Ou(e,n,t){var a=e.length;(!n||n<0)&&(n=0),(!t||t<0||t>a)&&(t=a);for(var u="",i=n;i<t;++i)u+=ps[e[i]];return u}function Pu(e,n,t){for(var a=e.slice(n,t),u="",i=0;i<a.length;i+=2)u+=String.fromCharCode(a[i]+256*a[i+1]);return u}function $e(e,n,t){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+n>t)throw new RangeError("Trying to access beyond buffer length")}function nt(e,n,t,a,u,i){if(!pe.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>u||n<i)throw new RangeError('"value" argument is out of bounds');if(t+a>e.length)throw new RangeError("Index out of range")}function is(e,n,t,a,u,i){if(t+a>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function os(e,n,t,a,u){return n=+n,t>>>=0,u||is(e,0,t,4),Qt.write(e,n,t,a,23,4),t+4}function ss(e,n,t,a,u){return n=+n,t>>>=0,u||is(e,0,t,8),Qt.write(e,n,t,a,52,8),t+8}function bi(e,n){var t;n=n||1/0;for(var a=e.length,u=null,i=[],r=0;r<a;++r){if((t=e.charCodeAt(r))>55295&&t<57344){if(!u){if(t>56319){(n-=3)>-1&&i.push(239,191,189);continue}if(r+1===a){(n-=3)>-1&&i.push(239,191,189);continue}u=t;continue}if(t<56320){(n-=3)>-1&&i.push(239,191,189),u=t;continue}t=65536+(u-55296<<10|t-56320)}else u&&(n-=3)>-1&&i.push(239,191,189);if(u=null,t<128){if((n-=1)<0)break;i.push(t)}else if(t<2048){if((n-=2)<0)break;i.push(t>>6|192,63&t|128)}else if(t<65536){if((n-=3)<0)break;i.push(t>>12|224,t>>6&63|128,63&t|128)}else{if(!(t<1114112))throw new Error("Invalid code point");if((n-=4)<0)break;i.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}}return i}function as(e){return Ir.toByteArray(function(n){if((n=(n=n.split("=")[0]).trim().replace(ds,"")).length<2)return"";for(;n.length%4!=0;)n+="=";return n}(e))}function Sr(e,n,t,a){for(var u=0;u<a&&!(u+t>=n.length||u>=e.length);++u)n[u+t]=e[u];return u}function _t(e,n){return e instanceof n||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===n.name}function yi(e){return e!=e}function ls(e,n){for(var t in e)n[t]=e[t]}function Kt(e,n,t){return lt(e,n,t)}function cr(e){var n;switch(this.encoding=function(t){var a=function(u){if(!u)return"utf8";for(var i;;)switch(u){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 u;default:if(i)return;u=(""+u).toLowerCase(),i=!0}}(t);if(typeof a!="string"&&(kr.isEncoding===_i||!_i(t)))throw new Error("Unknown encoding: "+t);return a||t}(e),this.encoding){case"utf16le":this.text=Ru,this.end=Mu,n=4;break;case"utf8":this.fillLast=xu,n=4;break;case"base64":this.text=Uu,this.end=Du,n=3;break;default:return this.write=Lu,this.end=Nu,void 0}this.lastNeed=0,this.lastTotal=0,this.lastChar=kr.allocUnsafe(n)}function wi(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function xu(e){var n=this.lastTotal-this.lastNeed,t=function(a,u,i){if((192&u[0])!=128)return a.lastNeed=0,"�";if(a.lastNeed>1&&u.length>1){if((192&u[1])!=128)return a.lastNeed=1,"�";if(a.lastNeed>2&&u.length>2&&(192&u[2])!=128)return a.lastNeed=2,"�"}}(this,e);return t!==void 0?t:this.lastNeed<=e.length?(e.copy(this.lastChar,n,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,n,0,e.length),this.lastNeed-=e.length,void 0)}function Ru(e,n){if((e.length-n)%2==0){var t=e.toString("utf16le",n);if(t){var a=t.charCodeAt(t.length-1);if(a>=55296&&a<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",n,e.length-1)}function Mu(e){var n=e&&e.length?this.write(e):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return n+this.lastChar.toString("utf16le",0,t)}return n}function Uu(e,n){var t=(e.length-n)%3;return t===0?e.toString("base64",n):(this.lastNeed=3-t,this.lastTotal=3,t===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",n,e.length-t))}function Du(e){var n=e&&e.length?this.write(e):"";return this.lastNeed?n+this.lastChar.toString("base64",0,3-this.lastNeed):n}function Lu(e){return e.toString(this.encoding)}function Nu(e){return e&&e.length?this.write(e):""}var us,at,ot,cs,Cr,Wt,hs,fs,ft,Ir,Qt,vi,ds,ps,hr,fr,lt,gs,nr,kr,_i,ms=Ge(()=>{for(ae(),ue(),le(),us={byteLength:function(e){var n=Go(e),t=n[0],a=n[1];return 3*(t+a)/4-a},toByteArray:function(e){var n,t,a=Go(e),u=a[0],i=a[1],r=new cs(function(l,f,p){return 3*(f+p)/4-p}(0,u,i)),s=0,o=i>0?u-4:u;for(t=0;t<o;t+=4)n=ot[e.charCodeAt(t)]<<18|ot[e.charCodeAt(t+1)]<<12|ot[e.charCodeAt(t+2)]<<6|ot[e.charCodeAt(t+3)],r[s++]=n>>16&255,r[s++]=n>>8&255,r[s++]=255&n;return i===2&&(n=ot[e.charCodeAt(t)]<<2|ot[e.charCodeAt(t+1)]>>4,r[s++]=255&n),i===1&&(n=ot[e.charCodeAt(t)]<<10|ot[e.charCodeAt(t+1)]<<4|ot[e.charCodeAt(t+2)]>>2,r[s++]=n>>8&255,r[s++]=255&n),r},fromByteArray:function(e){for(var n,t=e.length,a=t%3,u=[],i=0,r=t-a;i<r;i+=16383)u.push(yu(e,i,i+16383>r?r:i+16383));return a===1?(n=e[t-1],u.push(at[n>>2]+at[n<<4&63]+"==")):a===2&&(n=(e[t-2]<<8)+e[t-1],u.push(at[n>>10]+at[n>>4&63]+at[n<<2&63]+"=")),u.join("")}},at=[],ot=[],cs=typeof Uint8Array<"u"?Uint8Array:Array,Cr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wt=0,hs=Cr.length;Wt<hs;++Wt)at[Wt]=Cr[Wt],ot[Cr.charCodeAt(Wt)]=Wt;ot[45]=62,ot[95]=63,fs={read:function(e,n,t,a,u){var i,r,s=8*u-a-1,o=(1<<s)-1,l=o>>1,f=-7,p=t?u-1:0,g=t?-1:1,m=e[n+p];for(p+=g,i=m&(1<<-f)-1,m>>=-f,f+=s;f>0;i=256*i+e[n+p],p+=g,f-=8);for(r=i&(1<<-f)-1,i>>=-f,f+=a;f>0;r=256*r+e[n+p],p+=g,f-=8);if(i===0)i=1-l;else{if(i===o)return r?NaN:1/0*(m?-1:1);r+=Math.pow(2,a),i-=l}return(m?-1:1)*r*Math.pow(2,i-a)},write:function(e,n,t,a,u,i){var r,s,o,l=8*i-u-1,f=(1<<l)-1,p=f>>1,g=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=a?0:i-1,A=a?1:-1,b=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(s=isNaN(n)?1:0,r=f):(r=Math.floor(Math.log(n)/Math.LN2),n*(o=Math.pow(2,-r))<1&&(r--,o*=2),(n+=r+p>=1?g/o:g*Math.pow(2,1-p))*o>=2&&(r++,o/=2),r+p>=f?(s=0,r=f):r+p>=1?(s=(n*o-1)*Math.pow(2,u),r+=p):(s=n*Math.pow(2,p-1)*Math.pow(2,u),r=0));u>=8;e[t+m]=255&s,m+=A,s/=256,u-=8);for(r=r<<u|s,l+=u;l>0;e[t+m]=255&r,m+=A,r/=256,l-=8);e[t+m-A]|=128*b}},ft={},Ir=us,Qt=fs,vi=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null,ft.Buffer=pe,ft.SlowBuffer=function(e){return+e!=e&&(e=0),pe.alloc(+e)},ft.INSPECT_MAX_BYTES=50,ft.kMaxLength=2147483647,pe.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),n={foo:function(){return 42}};return Object.setPrototypeOf(n,Uint8Array.prototype),Object.setPrototypeOf(e,n),e.foo()===42}catch{return!1}}(),pe.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."),Object.defineProperty(pe.prototype,"parent",{enumerable:!0,get:function(){if(pe.isBuffer(this))return this.buffer}}),Object.defineProperty(pe.prototype,"offset",{enumerable:!0,get:function(){if(pe.isBuffer(this))return this.byteOffset}}),pe.poolSize=8192,pe.from=function(e,n,t){return Jo(e,n,t)},Object.setPrototypeOf(pe.prototype,Uint8Array.prototype),Object.setPrototypeOf(pe,Uint8Array),pe.alloc=function(e,n,t){return function(a,u,i){return Zo(a),a<=0?vt(a):u!==void 0?typeof i=="string"?vt(a).fill(u,i):vt(a).fill(u):vt(a)}(e,n,t)},pe.allocUnsafe=function(e){return gi(e)},pe.allocUnsafeSlow=function(e){return gi(e)},pe.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==pe.prototype},pe.compare=function(e,n){if(_t(e,Uint8Array)&&(e=pe.from(e,e.offset,e.byteLength)),_t(n,Uint8Array)&&(n=pe.from(n,n.offset,n.byteLength)),!pe.isBuffer(e)||!pe.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===n)return 0;for(var t=e.length,a=n.length,u=0,i=Math.min(t,a);u<i;++u)if(e[u]!==n[u]){t=e[u],a=n[u];break}return t<a?-1:a<t?1:0},pe.isEncoding=function(e){switch(String(e).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}},pe.concat=function(e,n){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return pe.alloc(0);var t;if(n===void 0)for(n=0,t=0;t<e.length;++t)n+=e[t].length;var a=pe.allocUnsafe(n),u=0;for(t=0;t<e.length;++t){var i=e[t];if(_t(i,Uint8Array)&&(i=pe.from(i)),!pe.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(a,u),u+=i.length}return a},pe.byteLength=Xo,pe.prototype._isBuffer=!0,pe.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<e;n+=2)Vt(this,n,n+1);return this},pe.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<e;n+=4)Vt(this,n,n+3),Vt(this,n+1,n+2);return this},pe.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<e;n+=8)Vt(this,n,n+7),Vt(this,n+1,n+6),Vt(this,n+2,n+5),Vt(this,n+3,n+4);return this},pe.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?ns(this,0,e):vu.apply(this,arguments)},pe.prototype.toLocaleString=pe.prototype.toString,pe.prototype.equals=function(e){if(!pe.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||pe.compare(this,e)===0},pe.prototype.inspect=function(){var e="",n=ft.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},vi&&(pe.prototype[vi]=pe.prototype.inspect),pe.prototype.compare=function(e,n,t,a,u){if(_t(e,Uint8Array)&&(e=pe.from(e,e.offset,e.byteLength)),!pe.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(n===void 0&&(n=0),t===void 0&&(t=e?e.length:0),a===void 0&&(a=0),u===void 0&&(u=this.length),n<0||t>e.length||a<0||u>this.length)throw new RangeError("out of range index");if(a>=u&&n>=t)return 0;if(a>=u)return-1;if(n>=t)return 1;if(this===e)return 0;for(var i=(u>>>=0)-(a>>>=0),r=(t>>>=0)-(n>>>=0),s=Math.min(i,r),o=this.slice(a,u),l=e.slice(n,t),f=0;f<s;++f)if(o[f]!==l[f]){i=o[f],r=l[f];break}return i<r?-1:r<i?1:0},pe.prototype.includes=function(e,n,t){return this.indexOf(e,n,t)!==-1},pe.prototype.indexOf=function(e,n,t){return es(this,e,n,t,!0)},pe.prototype.lastIndexOf=function(e,n,t){return es(this,e,n,t,!1)},pe.prototype.write=function(e,n,t,a){if(n===void 0)a="utf8",t=this.length,n=0;else if(t===void 0&&typeof n=="string")a=n,t=this.length,n=0;else{if(!isFinite(n))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");n>>>=0,isFinite(t)?(t>>>=0,a===void 0&&(a="utf8")):(a=t,t=void 0)}var u=this.length-n;if((t===void 0||t>u)&&(t=u),e.length>0&&(t<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var i=!1;;)switch(a){case"hex":return _u(this,e,n,t);case"utf8":case"utf-8":return Eu(this,e,n,t);case"ascii":return rs(this,e,n,t);case"latin1":case"binary":return Su(this,e,n,t);case"base64":return Cu(this,e,n,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Iu(this,e,n,t);default:if(i)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),i=!0}},pe.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},pe.prototype.slice=function(e,n){var t=this.length;(e=~~e)<0?(e+=t)<0&&(e=0):e>t&&(e=t),(n=n===void 0?t:~~n)<0?(n+=t)<0&&(n=0):n>t&&(n=t),n<e&&(n=e);var a=this.subarray(e,n);return Object.setPrototypeOf(a,pe.prototype),a},pe.prototype.readUIntLE=function(e,n,t){e>>>=0,n>>>=0,t||$e(e,n,this.length);for(var a=this[e],u=1,i=0;++i<n&&(u*=256);)a+=this[e+i]*u;return a},pe.prototype.readUIntBE=function(e,n,t){e>>>=0,n>>>=0,t||$e(e,n,this.length);for(var a=this[e+--n],u=1;n>0&&(u*=256);)a+=this[e+--n]*u;return a},pe.prototype.readUInt8=function(e,n){return e>>>=0,n||$e(e,1,this.length),this[e]},pe.prototype.readUInt16LE=function(e,n){return e>>>=0,n||$e(e,2,this.length),this[e]|this[e+1]<<8},pe.prototype.readUInt16BE=function(e,n){return e>>>=0,n||$e(e,2,this.length),this[e]<<8|this[e+1]},pe.prototype.readUInt32LE=function(e,n){return e>>>=0,n||$e(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},pe.prototype.readUInt32BE=function(e,n){return e>>>=0,n||$e(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},pe.prototype.readIntLE=function(e,n,t){e>>>=0,n>>>=0,t||$e(e,n,this.length);for(var a=this[e],u=1,i=0;++i<n&&(u*=256);)a+=this[e+i]*u;return a>=(u*=128)&&(a-=Math.pow(2,8*n)),a},pe.prototype.readIntBE=function(e,n,t){e>>>=0,n>>>=0,t||$e(e,n,this.length);for(var a=n,u=1,i=this[e+--a];a>0&&(u*=256);)i+=this[e+--a]*u;return i>=(u*=128)&&(i-=Math.pow(2,8*n)),i},pe.prototype.readInt8=function(e,n){return e>>>=0,n||$e(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},pe.prototype.readInt16LE=function(e,n){e>>>=0,n||$e(e,2,this.length);var t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},pe.prototype.readInt16BE=function(e,n){e>>>=0,n||$e(e,2,this.length);var t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},pe.prototype.readInt32LE=function(e,n){return e>>>=0,n||$e(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},pe.prototype.readInt32BE=function(e,n){return e>>>=0,n||$e(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},pe.prototype.readFloatLE=function(e,n){return e>>>=0,n||$e(e,4,this.length),Qt.read(this,e,!0,23,4)},pe.prototype.readFloatBE=function(e,n){return e>>>=0,n||$e(e,4,this.length),Qt.read(this,e,!1,23,4)},pe.prototype.readDoubleLE=function(e,n){return e>>>=0,n||$e(e,8,this.length),Qt.read(this,e,!0,52,8)},pe.prototype.readDoubleBE=function(e,n){return e>>>=0,n||$e(e,8,this.length),Qt.read(this,e,!1,52,8)},pe.prototype.writeUIntLE=function(e,n,t,a){e=+e,n>>>=0,t>>>=0,a||nt(this,e,n,t,Math.pow(2,8*t)-1,0);var u=1,i=0;for(this[n]=255&e;++i<t&&(u*=256);)this[n+i]=e/u&255;return n+t},pe.prototype.writeUIntBE=function(e,n,t,a){e=+e,n>>>=0,t>>>=0,a||nt(this,e,n,t,Math.pow(2,8*t)-1,0);var u=t-1,i=1;for(this[n+u]=255&e;--u>=0&&(i*=256);)this[n+u]=e/i&255;return n+t},pe.prototype.writeUInt8=function(e,n,t){return e=+e,n>>>=0,t||nt(this,e,n,1,255,0),this[n]=255&e,n+1},pe.prototype.writeUInt16LE=function(e,n,t){return e=+e,n>>>=0,t||nt(this,e,n,2,65535,0),this[n]=255&e,this[n+1]=e>>>8,n+2},pe.prototype.writeUInt16BE=function(e,n,t){return e=+e,n>>>=0,t||nt(this,e,n,2,65535,0),this[n]=e>>>8,this[n+1]=255&e,n+2},pe.prototype.writeUInt32LE=function(e,n,t){return e=+e,n>>>=0,t||nt(this,e,n,4,4294967295,0),this[n+3]=e>>>24,this[n+2]=e>>>16,this[n+1]=e>>>8,this[n]=255&e,n+4},pe.prototype.writeUInt32BE=function(e,n,t){return e=+e,n>>>=0,t||nt(this,e,n,4,4294967295,0),this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=255&e,n+4},pe.prototype.writeIntLE=function(e,n,t,a){if(e=+e,n>>>=0,!a){var u=Math.pow(2,8*t-1);nt(this,e,n,t,u-1,-u)}var i=0,r=1,s=0;for(this[n]=255&e;++i<t&&(r*=256);)e<0&&s===0&&this[n+i-1]!==0&&(s=1),this[n+i]=(e/r>>0)-s&255;return n+t},pe.prototype.writeIntBE=function(e,n,t,a){if(e=+e,n>>>=0,!a){var u=Math.pow(2,8*t-1);nt(this,e,n,t,u-1,-u)}var i=t-1,r=1,s=0;for(this[n+i]=255&e;--i>=0&&(r*=256);)e<0&&s===0&&this[n+i+1]!==0&&(s=1),this[n+i]=(e/r>>0)-s&255;return n+t},pe.prototype.writeInt8=function(e,n,t){return e=+e,n>>>=0,t||nt(this,e,n,1,127,-128),e<0&&(e=255+e+1),this[n]=255&e,n+1},pe.prototype.writeInt16LE=function(e,n,t){return e=+e,n>>>=0,t||nt(this,e,n,2,32767,-32768),this[n]=255&e,this[n+1]=e>>>8,n+2},pe.prototype.writeInt16BE=function(e,n,t){return e=+e,n>>>=0,t||nt(this,e,n,2,32767,-32768),this[n]=e>>>8,this[n+1]=255&e,n+2},pe.prototype.writeInt32LE=function(e,n,t){return e=+e,n>>>=0,t||nt(this,e,n,4,2147483647,-2147483648),this[n]=255&e,this[n+1]=e>>>8,this[n+2]=e>>>16,this[n+3]=e>>>24,n+4},pe.prototype.writeInt32BE=function(e,n,t){return e=+e,n>>>=0,t||nt(this,e,n,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=255&e,n+4},pe.prototype.writeFloatLE=function(e,n,t){return os(this,e,n,!0,t)},pe.prototype.writeFloatBE=function(e,n,t){return os(this,e,n,!1,t)},pe.prototype.writeDoubleLE=function(e,n,t){return ss(this,e,n,!0,t)},pe.prototype.writeDoubleBE=function(e,n,t){return ss(this,e,n,!1,t)},pe.prototype.copy=function(e,n,t,a){if(!pe.isBuffer(e))throw new TypeError("argument should be a Buffer");if(t||(t=0),a||a===0||(a=this.length),n>=e.length&&(n=e.length),n||(n=0),a>0&&a<t&&(a=t),a===t||e.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(t<0||t>=this.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-n<a-t&&(a=e.length-n+t);var u=a-t;if(this===e&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(n,t,a);else if(this===e&&t<n&&n<a)for(var i=u-1;i>=0;--i)e[i+n]=this[i+t];else Uint8Array.prototype.set.call(e,this.subarray(t,a),n);return u},pe.prototype.fill=function(e,n,t,a){if(typeof e=="string"){if(typeof n=="string"?(a=n,n=0,t=this.length):typeof t=="string"&&(a=t,t=this.length),a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!pe.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(e.length===1){var u=e.charCodeAt(0);(a==="utf8"&&u<128||a==="latin1")&&(e=u)}}else typeof e=="number"?e&=255:typeof e=="boolean"&&(e=Number(e));if(n<0||this.length<n||this.length<t)throw new RangeError("Out of range index");if(t<=n)return this;var i;if(n>>>=0,t=t===void 0?this.length:t>>>0,e||(e=0),typeof e=="number")for(i=n;i<t;++i)this[i]=e;else{var r=pe.isBuffer(e)?e:pe.from(e,a),s=r.length;if(s===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<t-n;++i)this[i+n]=r[i%s]}return this},ds=/[^+/0-9A-Za-z-_]/g,ps=function(){for(var e=new Array(256),n=0;n<16;++n)for(var t=16*n,a=0;a<16;++a)e[t+a]="0123456789abcdef"[n]+"0123456789abcdef"[a];return e}(),ft.Buffer,ft.INSPECT_MAX_BYTES,ft.kMaxLength,hr={},fr=ft,lt=fr.Buffer,lt.from&<.alloc&<.allocUnsafe&<.allocUnsafeSlow?hr=fr:(ls(fr,hr),hr.Buffer=Kt),Kt.prototype=Object.create(lt.prototype),ls(lt,Kt),Kt.from=function(e,n,t){if(typeof e=="number")throw new TypeError("Argument must not be a number");return lt(e,n,t)},Kt.alloc=function(e,n,t){if(typeof e!="number")throw new TypeError("Argument must be a number");var a=lt(e);return n!==void 0?typeof t=="string"?a.fill(n,t):a.fill(n):a.fill(0),a},Kt.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return lt(e)},Kt.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return fr.SlowBuffer(e)},gs=hr,nr={},kr=gs.Buffer,_i=kr.isEncoding||function(e){switch((e=""+e)&&e.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}},nr.StringDecoder=cr,cr.prototype.write=function(e){if(e.length===0)return"";var n,t;if(this.lastNeed){if((n=this.fillLast(e))===void 0)return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t<e.length?n?n+this.text(e,t):this.text(e,t):n||""},cr.prototype.end=function(e){var n=e&&e.length?this.write(e):"";return this.lastNeed?n+"�":n},cr.prototype.text=function(e,n){var t=function(u,i,r){var s=i.length-1;if(s<r)return 0;var o=wi(i[s]);return o>=0?(o>0&&(u.lastNeed=o-1),o):--s<r||o===-2?0:(o=wi(i[s]))>=0?(o>0&&(u.lastNeed=o-2),o):--s<r||o===-2?0:(o=wi(i[s]))>=0?(o>0&&(o===2?o=0:u.lastNeed=o-3),o):0}(this,e,n);if(!this.lastNeed)return e.toString("utf8",n);this.lastTotal=t;var a=e.length-(t-this.lastNeed);return e.copy(this.lastChar,0,a),e.toString("utf8",n,a)},cr.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length},nr.StringDecoder,nr.StringDecoder}),As={};Ut(As,{StringDecoder:()=>bs,default:()=>nr});var bs,Fu=Ge(()=>{ae(),ue(),le(),ms(),ms(),bs=nr.StringDecoder}),ys=Ae((e,n)=>{ae(),ue(),le();var t=Nt(),{PromisePrototypeThen:a,SymbolAsyncIterator:u,SymbolIterator:i}=qe(),{Buffer:r}=(Ze(),Ue(Je)),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_NULL_VALUES:o}=rt().codes;function l(f,p,g){let m;if(typeof p=="string"||p instanceof r)return new f({objectMode:!0,...g,read(){this.push(p),this.push(null)}});let A;if(p&&p[u])A=!0,m=p[u]();else if(p&&p[i])A=!1,m=p[i]();else throw new s("iterable",["Iterable"],p);let b=new f({objectMode:!0,highWaterMark:1,...g}),_=!1;b._read=function(){_||(_=!0,I())},b._destroy=function(E,L){a(x(E),()=>t.nextTick(L,E),F=>t.nextTick(L,F||E))};async function x(E){let L=E!=null,F=typeof m.throw=="function";if(L&&F){let{value:B,done:T}=await m.throw(E);if(await B,T)return}if(typeof m.return=="function"){let{value:B}=await m.return();await B}}async function I(){for(;;){try{let{value:E,done:L}=A?await m.next():m.next();if(L)b.push(null);else{let F=E&&typeof E.then=="function"?await E:E;if(F===null)throw _=!1,new o;if(b.push(F))continue;_=!1}}catch(E){b.destroy(E)}break}}return b}n.exports=l}),Tr=Ae((e,n)=>{ae(),ue(),le();var t=Nt(),{ArrayPrototypeIndexOf:a,NumberIsInteger:u,NumberIsNaN:i,NumberParseInt:r,ObjectDefineProperties:s,ObjectKeys:o,ObjectSetPrototypeOf:l,Promise:f,SafeSet:p,SymbolAsyncIterator:g,Symbol:m}=qe();n.exports=w,w.ReadableState=we;var{EventEmitter:A}=(rr(),Ue(jt)),{Stream:b,prependListener:_}=di(),{Buffer:x}=(Ze(),Ue(Je)),{addAbortSignal:I}=Er(),E=Pt(),L=yt().debuglog("stream",c=>{L=c}),F=bu(),B=tr(),{getHighWaterMark:T,getDefaultHighWaterMark:U}=pi(),{aggregateTwoErrors:W,codes:{ERR_INVALID_ARG_TYPE:J,ERR_METHOD_NOT_IMPLEMENTED:ne,ERR_OUT_OF_RANGE:C,ERR_STREAM_PUSH_AFTER_EOF:q,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:te}}=rt(),{validateObject:Y}=vr(),me=m("kPaused"),{StringDecoder:se}=(Fu(),Ue(As)),H=ys();l(w.prototype,b.prototype),l(w,b);var be=()=>{},{errorOrDestroy:oe}=B;function we(c,d,y){typeof y!="boolean"&&(y=d instanceof Et()),this.objectMode=!!(c&&c.objectMode),y&&(this.objectMode=this.objectMode||!!(c&&c.readableObjectMode)),this.highWaterMark=c?T(this,c,"readableHighWaterMark",y):U(!1),this.buffer=new F,this.length=0,this.pipes=[],this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.constructed=!0,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this[me]=null,this.errorEmitted=!1,this.emitClose=!c||c.emitClose!==!1,this.autoDestroy=!c||c.autoDestroy!==!1,this.destroyed=!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this.defaultEncoding=c&&c.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.multiAwaitDrain=!1,this.readingMore=!1,this.dataEmitted=!1,this.decoder=null,this.encoding=null,c&&c.encoding&&(this.decoder=new se(c.encoding),this.encoding=c.encoding)}function w(c){if(!(this instanceof w))return new w(c);let d=this instanceof Et();this._readableState=new we(c,this,d),c&&(typeof c.read=="function"&&(this._read=c.read),typeof c.destroy=="function"&&(this._destroy=c.destroy),typeof c.construct=="function"&&(this._construct=c.construct),c.signal&&!d&&I(c.signal,this)),b.call(this,c),B.construct(this,()=>{this._readableState.needReadable&&re(this,this._readableState)})}w.prototype.destroy=B.destroy,w.prototype._undestroy=B.undestroy,w.prototype._destroy=function(c,d){d(c)},w.prototype[A.captureRejectionSymbol]=function(c){this.destroy(c)},w.prototype.push=function(c,d){return G(this,c,d,!1)},w.prototype.unshift=function(c,d){return G(this,c,d,!0)};function G(c,d,y,k){L("readableAddChunk",d);let K=c._readableState,ee;if(K.objectMode||(typeof d=="string"?(y=y||K.defaultEncoding,K.encoding!==y&&(k&&K.encoding?d=x.from(d,y).toString(K.encoding):(d=x.from(d,y),y=""))):d instanceof x?y="":b._isUint8Array(d)?(d=b._uint8ArrayToBuffer(d),y=""):d!=null&&(ee=new J("chunk",["string","Buffer","Uint8Array"],d))),ee)oe(c,ee);else if(d===null)K.reading=!1,S(c,K);else if(K.objectMode||d&&d.length>0)if(k)if(K.endEmitted)oe(c,new te);else{if(K.destroyed||K.errored)return!1;de(c,K,d,!0)}else if(K.ended)oe(c,new q);else{if(K.destroyed||K.errored)return!1;K.reading=!1,K.decoder&&!y?(d=K.decoder.write(d),K.objectMode||d.length!==0?de(c,K,d,!1):re(c,K)):de(c,K,d,!1)}else k||(K.reading=!1,re(c,K));return!K.ended&&(K.length<K.highWaterMark||K.length===0)}function de(c,d,y,k){d.flowing&&d.length===0&&!d.sync&&c.listenerCount("data")>0?(d.multiAwaitDrain?d.awaitDrainWriters.clear():d.awaitDrainWriters=null,d.dataEmitted=!0,c.emit("data",y)):(d.length+=d.objectMode?1:y.length,k?d.buffer.unshift(y):d.buffer.push(y),d.needReadable&&z(c)),re(c,d)}w.prototype.isPaused=function(){let c=this._readableState;return c[me]===!0||c.flowing===!1},w.prototype.setEncoding=function(c){let d=new se(c);this._readableState.decoder=d,this._readableState.encoding=this._readableState.decoder.encoding;let y=this._readableState.buffer,k="";for(let K of y)k+=d.write(K);return y.clear(),k!==""&&y.push(k),this._readableState.length=k.length,this};var ve=1073741824;function he(c){if(c>ve)throw new C("size","<= 1GiB",c);return c--,c|=c>>>1,c|=c>>>2,c|=c>>>4,c|=c>>>8,c|=c>>>16,c++,c}function M(c,d){return c<=0||d.length===0&&d.ended?0:d.objectMode?1:i(c)?d.flowing&&d.length?d.buffer.first().length:d.length:c<=d.length?c:d.ended?d.length:0}w.prototype.read=function(c){L("read",c),c===void 0?c=NaN:u(c)||(c=r(c,10));let d=this._readableState,y=c;if(c>d.highWaterMark&&(d.highWaterMark=he(c)),c!==0&&(d.emittedReadable=!1),c===0&&d.needReadable&&((d.highWaterMark!==0?d.length>=d.highWaterMark:d.length>0)||d.ended))return L("read: emitReadable",d.length,d.ended),d.length===0&&d.ended?O(this):z(this),null;if(c=M(c,d),c===0&&d.ended)return d.length===0&&O(this),null;let k=d.needReadable;if(L("need readable",k),(d.length===0||d.length-c<d.highWaterMark)&&(k=!0,L("length less than watermark",k)),d.ended||d.reading||d.destroyed||d.errored||!d.constructed)k=!1,L("reading, ended or constructing",k);else if(k){L("do read"),d.reading=!0,d.sync=!0,d.length===0&&(d.needReadable=!0);try{this._read(d.highWaterMark)}catch(ee){oe(this,ee)}d.sync=!1,d.reading||(c=M(y,d))}let K;return c>0?K=$(c,d):K=null,K===null?(d.needReadable=d.length<=d.highWaterMark,c=0):(d.length-=c,d.multiAwaitDrain?d.awaitDrainWriters.clear():d.awaitDrainWriters=null),d.length===0&&(d.ended||(d.needReadable=!0),y!==c&&d.ended&&O(this)),K!==null&&!d.errorEmitted&&!d.closeEmitted&&(d.dataEmitted=!0,this.emit("data",K)),K};function S(c,d){if(L("onEofChunk"),!d.ended){if(d.decoder){let y=d.decoder.end();y&&y.length&&(d.buffer.push(y),d.length+=d.objectMode?1:y.length)}d.ended=!0,d.sync?z(c):(d.needReadable=!1,d.emittedReadable=!0,fe(c))}}function z(c){let d=c._readableState;L("emitReadable",d.needReadable,d.emittedReadable),d.needReadable=!1,d.emittedReadable||(L("emitReadable",d.flowing),d.emittedReadable=!0,t.nextTick(fe,c))}function fe(c){let d=c._readableState;L("emitReadable_",d.destroyed,d.length,d.ended),!d.destroyed&&!d.errored&&(d.length||d.ended)&&(c.emit("readable"),d.emittedReadable=!1),d.needReadable=!d.flowing&&!d.ended&&d.length<=d.highWaterMark,ie(c)}function re(c,d){!d.readingMore&&d.constructed&&(d.readingMore=!0,t.nextTick(X,c,d))}function X(c,d){for(;!d.reading&&!d.ended&&(d.length<d.highWaterMark||d.flowing&&d.length===0);){let y=d.length;if(L("maybeReadMore read 0"),c.read(0),y===d.length)break}d.readingMore=!1}w.prototype._read=function(c){throw new ne("_read()")},w.prototype.pipe=function(c,d){let y=this,k=this._readableState;k.pipes.length===1&&(k.multiAwaitDrain||(k.multiAwaitDrain=!0,k.awaitDrainWriters=new p(k.awaitDrainWriters?[k.awaitDrainWriters]:[]))),k.pipes.push(c),L("pipe count=%d opts=%j",k.pipes.length,d);let K=(!d||d.end!==!1)&&c!==t.stdout&&c!==t.stderr?Ie:Xe;k.endEmitted?t.nextTick(K):y.once("end",K),c.on("unpipe",ee);function ee(tt,Ye){L("onunpipe"),tt===y&&Ye&&Ye.hasUnpiped===!1&&(Ye.hasUnpiped=!0,Se())}function Ie(){L("onend"),c.end()}let Be,Oe=!1;function Se(){L("cleanup"),c.removeListener("close",ze),c.removeListener("finish",Qe),Be&&c.removeListener("drain",Be),c.removeListener("error",De),c.removeListener("unpipe",ee),y.removeListener("end",Ie),y.removeListener("end",Xe),y.removeListener("data",ke),Oe=!0,Be&&k.awaitDrainWriters&&(!c._writableState||c._writableState.needDrain)&&Be()}function Te(){Oe||(k.pipes.length===1&&k.pipes[0]===c?(L("false write response, pause",0),k.awaitDrainWriters=c,k.multiAwaitDrain=!1):k.pipes.length>1&&k.pipes.includes(c)&&(L("false write response, pause",k.awaitDrainWriters.size),k.awaitDrainWriters.add(c)),y.pause()),Be||(Be=ye(y,c),c.on("drain",Be))}y.on("data",ke);function ke(tt){L("ondata");let Ye=c.write(tt);L("dest.write",Ye),Ye===!1&&Te()}function De(tt){if(L("onerror",tt),Xe(),c.removeListener("error",De),c.listenerCount("error")===0){let Ye=c._writableState||c._readableState;Ye&&!Ye.errorEmitted?oe(c,tt):c.emit("error",tt)}}_(c,"error",De);function ze(){c.removeListener("finish",Qe),Xe()}c.once("close",ze);function Qe(){L("onfinish"),c.removeListener("close",ze),Xe()}c.once("finish",Qe);function Xe(){L("unpipe"),y.unpipe(c)}return c.emit("pipe",y),c.writableNeedDrain===!0?k.flowing&&Te():k.flowing||(L("pipe resume"),y.resume()),c};function ye(c,d){return function(){let y=c._readableState;y.awaitDrainWriters===d?(L("pipeOnDrain",1),y.awaitDrainWriters=null):y.multiAwaitDrain&&(L("pipeOnDrain",y.awaitDrainWriters.size),y.awaitDrainWriters.delete(d)),(!y.awaitDrainWriters||y.awaitDrainWriters.size===0)&&c.listenerCount("data")&&c.resume()}}w.prototype.unpipe=function(c){let d=this._readableState,y={hasUnpiped:!1};if(d.pipes.length===0)return this;if(!c){let K=d.pipes;d.pipes=[],this.pause();for(let ee=0;ee<K.length;ee++)K[ee].emit("unpipe",this,{hasUnpiped:!1});return this}let k=a(d.pipes,c);return k===-1?this:(d.pipes.splice(k,1),d.pipes.length===0&&this.pause(),c.emit("unpipe",this,y),this)},w.prototype.on=function(c,d){let y=b.prototype.on.call(this,c,d),k=this._readableState;return c==="data"?(k.readableListening=this.listenerCount("readable")>0,k.flowing!==!1&&this.resume()):c==="readable"&&!k.endEmitted&&!k.readableListening&&(k.readableListening=k.needReadable=!0,k.flowing=!1,k.emittedReadable=!1,L("on readable",k.length,k.reading),k.length?z(this):k.reading||t.nextTick(P,this)),y},w.prototype.addListener=w.prototype.on,w.prototype.removeListener=function(c,d){let y=b.prototype.removeListener.call(this,c,d);return c==="readable"&&t.nextTick(ge,this),y},w.prototype.off=w.prototype.removeListener,w.prototype.removeAllListeners=function(c){let d=b.prototype.removeAllListeners.apply(this,arguments);return(c==="readable"||c===void 0)&&t.nextTick(ge,this),d};function ge(c){let d=c._readableState;d.readableListening=c.listenerCount("readable")>0,d.resumeScheduled&&d[me]===!1?d.flowing=!0:c.listenerCount("data")>0?c.resume():d.readableListening||(d.flowing=null)}function P(c){L("readable nexttick read 0"),c.read(0)}w.prototype.resume=function(){let c=this._readableState;return c.flowing||(L("resume"),c.flowing=!c.readableListening,j(this,c)),c[me]=!1,this};function j(c,d){d.resumeScheduled||(d.resumeScheduled=!0,t.nextTick(V,c,d))}function V(c,d){L("resume",d.reading),d.reading||c.read(0),d.resumeScheduled=!1,c.emit("resume"),ie(c),d.flowing&&!d.reading&&c.read(0)}w.prototype.pause=function(){return L("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(L("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[me]=!0,this};function ie(c){let d=c._readableState;for(L("flow",d.flowing);d.flowing&&c.read()!==null;);}w.prototype.wrap=function(c){let d=!1;c.on("data",k=>{!this.push(k)&&c.pause&&(d=!0,c.pause())}),c.on("end",()=>{this.push(null)}),c.on("error",k=>{oe(this,k)}),c.on("close",()=>{this.destroy()}),c.on("destroy",()=>{this.destroy()}),this._read=()=>{d&&c.resume&&(d=!1,c.resume())};let y=o(c);for(let k=1;k<y.length;k++){let K=y[k];this[K]===void 0&&typeof c[K]=="function"&&(this[K]=c[K].bind(c))}return this},w.prototype[g]=function(){return Z(this)},w.prototype.iterator=function(c){return c!==void 0&&Y(c,"options"),Z(this,c)};function Z(c,d){typeof c.read!="function"&&(c=w.wrap(c,{objectMode:!0}));let y=D(c,d);return y.stream=c,y}async function*D(c,d){let y=be;function k(Ie){this===c?(y(),y=be):y=Ie}c.on("readable",k);let K,ee=E(c,{writable:!1},Ie=>{K=Ie?W(K,Ie):null,y(),y=be});try{for(;;){let Ie=c.destroyed?null:c.read();if(Ie!==null)yield Ie;else{if(K)throw K;if(K===null)return;await new f(k)}}}catch(Ie){throw K=W(K,Ie),K}finally{(K||(d==null?void 0:d.destroyOnReturn)!==!1)&&(K===void 0||c._readableState.autoDestroy)?B.destroyer(c,null):(c.off("readable",k),ee())}}s(w.prototype,{readable:{__proto__:null,get(){let c=this._readableState;return!!c&&c.readable!==!1&&!c.destroyed&&!c.errorEmitted&&!c.endEmitted},set(c){this._readableState&&(this._readableState.readable=!!c)}},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(c){this._readableState&&(this._readableState.flowing=c)}},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(c){this._readableState&&(this._readableState.destroyed=c)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),s(we.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[me]!==!1},set(c){this[me]=!!c}}}),w._fromList=$;function $(c,d){if(d.length===0)return null;let y;return d.objectMode?y=d.buffer.shift():!c||c>=d.length?(d.decoder?y=d.buffer.join(""):d.buffer.length===1?y=d.buffer.first():y=d.buffer.concat(d.length),d.buffer.clear()):y=d.buffer.consume(c,d.decoder),y}function O(c){let d=c._readableState;L("endReadable",d.endEmitted),d.endEmitted||(d.ended=!0,t.nextTick(N,d,c))}function N(c,d){if(L("endReadableNT",c.endEmitted,c.length),!c.errored&&!c.closeEmitted&&!c.endEmitted&&c.length===0){if(c.endEmitted=!0,d.emit("end"),d.writable&&d.allowHalfOpen===!1)t.nextTick(Q,d);else if(c.autoDestroy){let y=d._writableState;(!y||y.autoDestroy&&(y.finished||y.writable===!1))&&d.destroy()}}}function Q(c){c.writable&&!c.writableEnded&&!c.destroyed&&c.end()}w.from=function(c,d){return H(w,c,d)};var ce;function h(){return ce===void 0&&(ce={}),ce}w.fromWeb=function(c,d){return h().newStreamReadableFromReadableStream(c,d)},w.toWeb=function(c,d){return h().newReadableStreamFromStreamReadable(c,d)},w.wrap=function(c,d){var y,k;return new w({objectMode:(y=(k=c.readableObjectMode)!==null&&k!==void 0?k:c.objectMode)!==null&&y!==void 0?y:!0,...d,destroy(K,ee){B.destroyer(c,K),ee(K)}}).wrap(c)}}),ws=Ae((e,n)=>{ae(),ue(),le();var t=Nt(),{ArrayPrototypeSlice:a,Error:u,FunctionPrototypeSymbolHasInstance:i,ObjectDefineProperty:r,ObjectDefineProperties:s,ObjectSetPrototypeOf:o,StringPrototypeToLowerCase:l,Symbol:f,SymbolHasInstance:p}=qe();n.exports=se,se.WritableState=Y;var{EventEmitter:g}=(rr(),Ue(jt)),m=di().Stream,{Buffer:A}=(Ze(),Ue(Je)),b=tr(),{addAbortSignal:_}=Er(),{getHighWaterMark:x,getDefaultHighWaterMark:I}=pi(),{ERR_INVALID_ARG_TYPE:E,ERR_METHOD_NOT_IMPLEMENTED:L,ERR_MULTIPLE_CALLBACK:F,ERR_STREAM_CANNOT_PIPE:B,ERR_STREAM_DESTROYED:T,ERR_STREAM_ALREADY_FINISHED:U,ERR_STREAM_NULL_VALUES:W,ERR_STREAM_WRITE_AFTER_END:J,ERR_UNKNOWN_ENCODING:ne}=rt().codes,{errorOrDestroy:C}=b;o(se.prototype,m.prototype),o(se,m);function q(){}var te=f("kOnFinished");function Y(P,j,V){typeof V!="boolean"&&(V=j instanceof Et()),this.objectMode=!!(P&&P.objectMode),V&&(this.objectMode=this.objectMode||!!(P&&P.writableObjectMode)),this.highWaterMark=P?x(this,P,"writableHighWaterMark",V):I(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let ie=!!(P&&P.decodeStrings===!1);this.decodeStrings=!ie,this.defaultEncoding=P&&P.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=w.bind(void 0,j),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[te]=[]}function me(P){P.buffered=[],P.bufferedIndex=0,P.allBuffers=!0,P.allNoop=!0}Y.prototype.getBuffer=function(){return a(this.buffered,this.bufferedIndex)},r(Y.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function se(P){let j=this instanceof Et();if(!j&&!i(se,this))return new se(P);this._writableState=new Y(P,this,j),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&&_(P.signal,this)),m.call(this,P),b.construct(this,()=>{let V=this._writableState;V.writing||he(this,V),fe(this,V)})}r(se,p,{__proto__:null,value:function(P){return i(this,P)?!0:this!==se?!1:P&&P._writableState instanceof Y}}),se.prototype.pipe=function(){C(this,new B)};function H(P,j,V,ie){let Z=P._writableState;if(typeof V=="function")ie=V,V=Z.defaultEncoding;else{if(!V)V=Z.defaultEncoding;else if(V!=="buffer"&&!A.isEncoding(V))throw new ne(V);typeof ie!="function"&&(ie=q)}if(j===null)throw new W;if(!Z.objectMode)if(typeof j=="string")Z.decodeStrings!==!1&&(j=A.from(j,V),V="buffer");else if(j instanceof A)V="buffer";else if(m._isUint8Array(j))j=m._uint8ArrayToBuffer(j),V="buffer";else throw new E("chunk",["string","Buffer","Uint8Array"],j);let D;return Z.ending?D=new J:Z.destroyed&&(D=new T("write")),D?(t.nextTick(ie,D),C(P,D,!0),D):(Z.pendingcb++,be(P,Z,j,V,ie))}se.prototype.write=function(P,j,V){return H(this,P,j,V)===!0},se.prototype.cork=function(){this._writableState.corked++},se.prototype.uncork=function(){let P=this._writableState;P.corked&&(P.corked--,P.writing||he(this,P))},se.prototype.setDefaultEncoding=function(P){if(typeof P=="string"&&(P=l(P)),!A.isEncoding(P))throw new ne(P);return this._writableState.defaultEncoding=P,this};function be(P,j,V,ie,Z){let D=j.objectMode?1:V.length;j.length+=D;let $=j.length<j.highWaterMark;return $||(j.needDrain=!0),j.writing||j.corked||j.errored||!j.constructed?(j.buffered.push({chunk:V,encoding:ie,callback:Z}),j.allBuffers&&ie!=="buffer"&&(j.allBuffers=!1),j.allNoop&&Z!==q&&(j.allNoop=!1)):(j.writelen=D,j.writecb=Z,j.writing=!0,j.sync=!0,P._write(V,ie,j.onwrite),j.sync=!1),$&&!j.errored&&!j.destroyed}function oe(P,j,V,ie,Z,D,$){j.writelen=ie,j.writecb=$,j.writing=!0,j.sync=!0,j.destroyed?j.onwrite(new T("write")):V?P._writev(Z,j.onwrite):P._write(Z,D,j.onwrite),j.sync=!1}function we(P,j,V,ie){--j.pendingcb,ie(V),ve(j),C(P,V)}function w(P,j){let V=P._writableState,ie=V.sync,Z=V.writecb;if(typeof Z!="function"){C(P,new F);return}V.writing=!1,V.writecb=null,V.length-=V.writelen,V.writelen=0,j?(j.stack,V.errored||(V.errored=j),P._readableState&&!P._readableState.errored&&(P._readableState.errored=j),ie?t.nextTick(we,P,V,j,Z):we(P,V,j,Z)):(V.buffered.length>V.bufferedIndex&&he(P,V),ie?V.afterWriteTickInfo!==null&&V.afterWriteTickInfo.cb===Z?V.afterWriteTickInfo.count++:(V.afterWriteTickInfo={count:1,cb:Z,stream:P,state:V},t.nextTick(G,V.afterWriteTickInfo)):de(P,V,1,Z))}function G({stream:P,state:j,count:V,cb:ie}){return j.afterWriteTickInfo=null,de(P,j,V,ie)}function de(P,j,V,ie){for(!j.ending&&!P.destroyed&&j.length===0&&j.needDrain&&(j.needDrain=!1,P.emit("drain"));V-- >0;)j.pendingcb--,ie();j.destroyed&&ve(j),fe(P,j)}function ve(P){if(P.writing)return;for(let Z=P.bufferedIndex;Z<P.buffered.length;++Z){var j;let{chunk:D,callback:$}=P.buffered[Z],O=P.objectMode?1:D.length;P.length-=O,$((j=P.errored)!==null&&j!==void 0?j:new T("write"))}let V=P[te].splice(0);for(let Z=0;Z<V.length;Z++){var ie;V[Z]((ie=P.errored)!==null&&ie!==void 0?ie:new T("end"))}me(P)}function he(P,j){if(j.corked||j.bufferProcessing||j.destroyed||!j.constructed)return;let{buffered:V,bufferedIndex:ie,objectMode:Z}=j,D=V.length-ie;if(!D)return;let $=ie;if(j.bufferProcessing=!0,D>1&&P._writev){j.pendingcb-=D-1;let O=j.allNoop?q:Q=>{for(let ce=$;ce<V.length;++ce)V[ce].callback(Q)},N=j.allNoop&&$===0?V:a(V,$);N.allBuffers=j.allBuffers,oe(P,j,!0,j.length,N,"",O),me(j)}else{do{let{chunk:O,encoding:N,callback:Q}=V[$];V[$++]=null;let ce=Z?1:O.length;oe(P,j,!1,ce,O,N,Q)}while($<V.length&&!j.writing);$===V.length?me(j):$>256?(V.splice(0,$),j.bufferedIndex=0):j.bufferedIndex=$}j.bufferProcessing=!1}se.prototype._write=function(P,j,V){if(this._writev)this._writev([{chunk:P,encoding:j}],V);else throw new L("_write()")},se.prototype._writev=null,se.prototype.end=function(P,j,V){let ie=this._writableState;typeof P=="function"?(V=P,P=null,j=null):typeof j=="function"&&(V=j,j=null);let Z;if(P!=null){let D=H(this,P,j);D instanceof u&&(Z=D)}return ie.corked&&(ie.corked=1,this.uncork()),Z||(!ie.errored&&!ie.ending?(ie.ending=!0,fe(this,ie,!0),ie.ended=!0):ie.finished?Z=new U("end"):ie.destroyed&&(Z=new T("end"))),typeof V=="function"&&(Z||ie.finished?t.nextTick(V,Z):ie[te].push(V)),this};function M(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 S(P,j){let V=!1;function ie(Z){if(V){C(P,Z??F());return}if(V=!0,j.pendingcb--,Z){let D=j[te].splice(0);for(let $=0;$<D.length;$++)D[$](Z);C(P,Z,j.sync)}else M(j)&&(j.prefinished=!0,P.emit("prefinish"),j.pendingcb++,t.nextTick(re,P,j))}j.sync=!0,j.pendingcb++;try{P._final(ie)}catch(Z){ie(Z)}j.sync=!1}function z(P,j){!j.prefinished&&!j.finalCalled&&(typeof P._final=="function"&&!j.destroyed?(j.finalCalled=!0,S(P,j)):(j.prefinished=!0,P.emit("prefinish")))}function fe(P,j,V){M(j)&&(z(P,j),j.pendingcb===0&&(V?(j.pendingcb++,t.nextTick((ie,Z)=>{M(Z)?re(ie,Z):Z.pendingcb--},P,j)):M(j)&&(j.pendingcb++,re(P,j))))}function re(P,j){j.pendingcb--,j.finished=!0;let V=j[te].splice(0);for(let ie=0;ie<V.length;ie++)V[ie]();if(P.emit("finish"),j.autoDestroy){let ie=P._readableState;(!ie||ie.autoDestroy&&(ie.endEmitted||ie.readable===!1))&&P.destroy()}}s(se.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 X=b.destroy;se.prototype.destroy=function(P,j){let V=this._writableState;return!V.destroyed&&(V.bufferedIndex<V.buffered.length||V[te].length)&&t.nextTick(ve,V),X.call(this,P,j),this},se.prototype._undestroy=b.undestroy,se.prototype._destroy=function(P,j){j(P)},se.prototype[g.captureRejectionSymbol]=function(P){this.destroy(P)};var ye;function ge(){return ye===void 0&&(ye={}),ye}se.fromWeb=function(P,j){return ge().newStreamWritableFromWritableStream(P,j)},se.toWeb=function(P){return ge().newWritableStreamFromStreamWritable(P)}}),ju=Ae((e,n)=>{ae(),ue(),le();var t=Nt(),a=(Ze(),Ue(Je)),{isReadable:u,isWritable:i,isIterable:r,isNodeStream:s,isReadableNodeStream:o,isWritableNodeStream:l,isDuplexNodeStream:f}=wt(),p=Pt(),{AbortError:g,codes:{ERR_INVALID_ARG_TYPE:m,ERR_INVALID_RETURN_VALUE:A}}=rt(),{destroyer:b}=tr(),_=Et(),x=Tr(),{createDeferredPromise:I}=yt(),E=ys(),L=globalThis.Blob||a.Blob,F=typeof L<"u"?function(ne){return ne instanceof L}:function(ne){return!1},B=globalThis.AbortController||ui().AbortController,{FunctionPrototypeCall:T}=qe(),U=class extends _{constructor(ne){super(ne),(ne==null?void 0:ne.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(ne==null?void 0:ne.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};n.exports=function ne(C,q){if(f(C))return C;if(o(C))return J({readable:C});if(l(C))return J({writable:C});if(s(C))return J({writable:!1,readable:!1});if(typeof C=="function"){let{value:Y,write:me,final:se,destroy:H}=W(C);if(r(Y))return E(U,Y,{objectMode:!0,write:me,final:se,destroy:H});let be=Y==null?void 0:Y.then;if(typeof be=="function"){let oe,we=T(be,Y,w=>{if(w!=null)throw new A("nully","body",w)},w=>{b(oe,w)});return oe=new U({objectMode:!0,readable:!1,write:me,final(w){se(async()=>{try{await we,t.nextTick(w,null)}catch(G){t.nextTick(w,G)}})},destroy:H})}throw new A("Iterable, AsyncIterable or AsyncFunction",q,Y)}if(F(C))return ne(C.arrayBuffer());if(r(C))return E(U,C,{objectMode:!0,writable:!1});if(typeof(C==null?void 0:C.writable)=="object"||typeof(C==null?void 0:C.readable)=="object"){let Y=C!=null&&C.readable?o(C==null?void 0:C.readable)?C==null?void 0:C.readable:ne(C.readable):void 0,me=C!=null&&C.writable?l(C==null?void 0:C.writable)?C==null?void 0:C.writable:ne(C.writable):void 0;return J({readable:Y,writable:me})}let te=C==null?void 0:C.then;if(typeof te=="function"){let Y;return T(te,C,me=>{me!=null&&Y.push(me),Y.push(null)},me=>{b(Y,me)}),Y=new U({objectMode:!0,writable:!1,read(){}})}throw new m(q,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],C)};function W(ne){let{promise:C,resolve:q}=I(),te=new B,Y=te.signal;return{value:ne(async function*(){for(;;){let me=C;C=null;let{chunk:se,done:H,cb:be}=await me;if(t.nextTick(be),H)return;if(Y.aborted)throw new g(void 0,{cause:Y.reason});({promise:C,resolve:q}=I()),yield se}}(),{signal:Y}),write(me,se,H){let be=q;q=null,be({chunk:me,done:!1,cb:H})},final(me){let se=q;q=null,se({done:!0,cb:me})},destroy(me,se){te.abort(),se(me)}}}function J(ne){let C=ne.readable&&typeof ne.readable.read!="function"?x.wrap(ne.readable):ne.readable,q=ne.writable,te=!!u(C),Y=!!i(q),me,se,H,be,oe;function we(w){let G=be;be=null,G?G(w):w&&oe.destroy(w)}return oe=new U({readableObjectMode:!!(C!=null&&C.readableObjectMode),writableObjectMode:!!(q!=null&&q.writableObjectMode),readable:te,writable:Y}),Y&&(p(q,w=>{Y=!1,w&&b(C,w),we(w)}),oe._write=function(w,G,de){q.write(w,G)?de():me=de},oe._final=function(w){q.end(),se=w},q.on("drain",function(){if(me){let w=me;me=null,w()}}),q.on("finish",function(){if(se){let w=se;se=null,w()}})),te&&(p(C,w=>{te=!1,w&&b(C,w),we(w)}),C.on("readable",function(){if(H){let w=H;H=null,w()}}),C.on("end",function(){oe.push(null)}),oe._read=function(){for(;;){let w=C.read();if(w===null){H=oe._read;return}if(!oe.push(w))return}}),oe._destroy=function(w,G){!w&&be!==null&&(w=new g),H=null,me=null,se=null,be===null?G(w):(be=G,b(q,w),b(C,w))},oe}}),Et=Ae((e,n)=>{ae(),ue(),le();var{ObjectDefineProperties:t,ObjectGetOwnPropertyDescriptor:a,ObjectKeys:u,ObjectSetPrototypeOf:i}=qe();n.exports=o;var r=Tr(),s=ws();i(o.prototype,r.prototype),i(o,r);{let g=u(s.prototype);for(let m=0;m<g.length;m++){let A=g[m];o.prototype[A]||(o.prototype[A]=s.prototype[A])}}function o(g){if(!(this instanceof o))return new o(g);r.call(this,g),s.call(this,g),g?(this.allowHalfOpen=g.allowHalfOpen!==!1,g.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),g.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}t(o.prototype,{writable:{__proto__:null,...a(s.prototype,"writable")},writableHighWaterMark:{__proto__:null,...a(s.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...a(s.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...a(s.prototype,"writableBuffer")},writableLength:{__proto__:null,...a(s.prototype,"writableLength")},writableFinished:{__proto__:null,...a(s.prototype,"writableFinished")},writableCorked:{__proto__:null,...a(s.prototype,"writableCorked")},writableEnded:{__proto__:null,...a(s.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...a(s.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(g){this._readableState&&this._writableState&&(this._readableState.destroyed=g,this._writableState.destroyed=g)}}});var l;function f(){return l===void 0&&(l={}),l}o.fromWeb=function(g,m){return f().newStreamDuplexFromReadableWritablePair(g,m)},o.toWeb=function(g){return f().newReadableWritablePairFromDuplex(g)};var p;o.from=function(g){return p||(p=ju()),p(g,"body")}}),vs=Ae((e,n)=>{ae(),ue(),le();var{ObjectSetPrototypeOf:t,Symbol:a}=qe();n.exports=o;var{ERR_METHOD_NOT_IMPLEMENTED:u}=rt().codes,i=Et(),{getHighWaterMark:r}=pi();t(o.prototype,i.prototype),t(o,i);var s=a("kCallback");function o(p){if(!(this instanceof o))return new o(p);let g=p?r(this,p,"readableHighWaterMark",!0):null;g===0&&(p={...p,highWaterMark:null,readableHighWaterMark:g,writableHighWaterMark:p.writableHighWaterMark||0}),i.call(this,p),this._readableState.sync=!1,this[s]=null,p&&(typeof p.transform=="function"&&(this._transform=p.transform),typeof p.flush=="function"&&(this._flush=p.flush)),this.on("prefinish",f)}function l(p){typeof this._flush=="function"&&!this.destroyed?this._flush((g,m)=>{if(g){p?p(g):this.destroy(g);return}m!=null&&this.push(m),this.push(null),p&&p()}):(this.push(null),p&&p())}function f(){this._final!==l&&l.call(this)}o.prototype._final=l,o.prototype._transform=function(p,g,m){throw new u("_transform()")},o.prototype._write=function(p,g,m){let A=this._readableState,b=this._writableState,_=A.length;this._transform(p,g,(x,I)=>{if(x){m(x);return}I!=null&&this.push(I),b.ended||_===A.length||A.length<A.highWaterMark?m():this[s]=m})},o.prototype._read=function(){if(this[s]){let p=this[s];this[s]=null,p()}}}),_s=Ae((e,n)=>{ae(),ue(),le();var{ObjectSetPrototypeOf:t}=qe();n.exports=u;var a=vs();t(u.prototype,a.prototype),t(u,a);function u(i){if(!(this instanceof u))return new u(i);a.call(this,i)}u.prototype._transform=function(i,r,s){s(null,i)}}),Ei=Ae((e,n)=>{ae(),ue(),le();var t=Nt(),{ArrayIsArray:a,Promise:u,SymbolAsyncIterator:i}=qe(),r=Pt(),{once:s}=yt(),o=tr(),l=Et(),{aggregateTwoErrors:f,codes:{ERR_INVALID_ARG_TYPE:p,ERR_INVALID_RETURN_VALUE:g,ERR_MISSING_ARGS:m,ERR_STREAM_DESTROYED:A,ERR_STREAM_PREMATURE_CLOSE:b},AbortError:_}=rt(),{validateFunction:x,validateAbortSignal:I}=vr(),{isIterable:E,isReadable:L,isReadableNodeStream:F,isNodeStream:B,isTransformStream:T,isWebStream:U,isReadableStream:W,isReadableEnded:J}=wt(),ne=globalThis.AbortController||ui().AbortController,C,q;function te(G,de,ve){let he=!1;G.on("close",()=>{he=!0});let M=r(G,{readable:de,writable:ve},S=>{he=!S});return{destroy:S=>{he||(he=!0,o.destroyer(G,S||new A("pipe")))},cleanup:M}}function Y(G){return x(G[G.length-1],"streams[stream.length - 1]"),G.pop()}function me(G){if(E(G))return G;if(F(G))return se(G);throw new p("val",["Readable","Iterable","AsyncIterable"],G)}async function*se(G){q||(q=Tr()),yield*q.prototype[i].call(G)}async function H(G,de,ve,{end:he}){let M,S=null,z=X=>{if(X&&(M=X),S){let ye=S;S=null,ye()}},fe=()=>new u((X,ye)=>{M?ye(M):S=()=>{M?ye(M):X()}});de.on("drain",z);let re=r(de,{readable:!1},z);try{de.writableNeedDrain&&await fe();for await(let X of G)de.write(X)||await fe();he&&de.end(),await fe(),ve()}catch(X){ve(M!==X?f(M,X):X)}finally{re(),de.off("drain",z)}}async function be(G,de,ve,{end:he}){T(de)&&(de=de.writable);let M=de.getWriter();try{for await(let S of G)await M.ready,M.write(S).catch(()=>{});await M.ready,he&&await M.close(),ve()}catch(S){try{await M.abort(S),ve(S)}catch(z){ve(z)}}}function oe(...G){return we(G,s(Y(G)))}function we(G,de,ve){if(G.length===1&&a(G[0])&&(G=G[0]),G.length<2)throw new m("streams");let he=new ne,M=he.signal,S=ve==null?void 0:ve.signal,z=[];I(S,"options.signal");function fe(){j(new _)}S==null||S.addEventListener("abort",fe);let re,X,ye=[],ge=0;function P(D){j(D,--ge===0)}function j(D,$){if(D&&(!re||re.code==="ERR_STREAM_PREMATURE_CLOSE")&&(re=D),!(!re&&!$)){for(;ye.length;)ye.shift()(re);S==null||S.removeEventListener("abort",fe),he.abort(),$&&(re||z.forEach(O=>O()),t.nextTick(de,re,X))}}let V;for(let D=0;D<G.length;D++){let $=G[D],O=D<G.length-1,N=D>0,Q=O||(ve==null?void 0:ve.end)!==!1,ce=D===G.length-1;if(B($)){let h=function(c){c&&c.name!=="AbortError"&&c.code!=="ERR_STREAM_PREMATURE_CLOSE"&&P(c)};if(Q){let{destroy:c,cleanup:d}=te($,O,N);ye.push(c),L($)&&ce&&z.push(d)}$.on("error",h),L($)&&ce&&z.push(()=>{$.removeListener("error",h)})}if(D===0)if(typeof $=="function"){if(V=$({signal:M}),!E(V))throw new g("Iterable, AsyncIterable or Stream","source",V)}else E($)||F($)||T($)?V=$:V=l.from($);else if(typeof $=="function"){if(T(V)){var ie;V=me((ie=V)===null||ie===void 0?void 0:ie.readable)}else V=me(V);if(V=$(V,{signal:M}),O){if(!E(V,!0))throw new g("AsyncIterable",`transform[${D-1}]`,V)}else{var Z;C||(C=_s());let h=new C({objectMode:!0}),c=(Z=V)===null||Z===void 0?void 0:Z.then;if(typeof c=="function")ge++,c.call(V,k=>{X=k,k!=null&&h.write(k),Q&&h.end(),t.nextTick(P)},k=>{h.destroy(k),t.nextTick(P,k)});else if(E(V,!0))ge++,H(V,h,P,{end:Q});else if(W(V)||T(V)){let k=V.readable||V;ge++,H(k,h,P,{end:Q})}else throw new g("AsyncIterable or Promise","destination",V);V=h;let{destroy:d,cleanup:y}=te(V,!1,!0);ye.push(d),ce&&z.push(y)}}else if(B($)){if(F(V)){ge+=2;let h=w(V,$,P,{end:Q});L($)&&ce&&z.push(h)}else if(T(V)||W(V)){let h=V.readable||V;ge++,H(h,$,P,{end:Q})}else if(E(V))ge++,H(V,$,P,{end:Q});else throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],V);V=$}else if(U($)){if(F(V))ge++,be(me(V),$,P,{end:Q});else if(W(V)||E(V))ge++,be(V,$,P,{end:Q});else if(T(V))ge++,be(V.readable,$,P,{end:Q});else throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],V);V=$}else V=l.from($)}return(M!=null&&M.aborted||S!=null&&S.aborted)&&t.nextTick(fe),V}function w(G,de,ve,{end:he}){let M=!1;if(de.on("close",()=>{M||ve(new b)}),G.pipe(de,{end:!1}),he){let S=function(){M=!0,de.end()};J(G)?t.nextTick(S):G.once("end",S)}else ve();return r(G,{readable:!0,writable:!1},S=>{let z=G._readableState;S&&S.code==="ERR_STREAM_PREMATURE_CLOSE"&&z&&z.ended&&!z.errored&&!z.errorEmitted?G.once("end",ve).once("error",ve):ve(S)}),r(de,{readable:!1,writable:!0},ve)}n.exports={pipelineImpl:we,pipeline:oe}}),Es=Ae((e,n)=>{ae(),ue(),le();var{pipeline:t}=Ei(),a=Et(),{destroyer:u}=tr(),{isNodeStream:i,isReadable:r,isWritable:s,isWebStream:o,isTransformStream:l,isWritableStream:f,isReadableStream:p}=wt(),{AbortError:g,codes:{ERR_INVALID_ARG_VALUE:m,ERR_MISSING_ARGS:A}}=rt(),b=Pt();n.exports=function(..._){if(_.length===0)throw new A("streams");if(_.length===1)return a.from(_[0]);let x=[..._];if(typeof _[0]=="function"&&(_[0]=a.from(_[0])),typeof _[_.length-1]=="function"){let C=_.length-1;_[C]=a.from(_[C])}for(let C=0;C<_.length;++C)if(!(!i(_[C])&&!o(_[C]))){if(C<_.length-1&&!(r(_[C])||p(_[C])||l(_[C])))throw new m(`streams[${C}]`,x[C],"must be readable");if(C>0&&!(s(_[C])||f(_[C])||l(_[C])))throw new m(`streams[${C}]`,x[C],"must be writable")}let I,E,L,F,B;function T(C){let q=F;F=null,q?q(C):C?B.destroy(C):!ne&&!J&&B.destroy()}let U=_[0],W=t(_,T),J=!!(s(U)||f(U)||l(U)),ne=!!(r(W)||p(W)||l(W));if(B=new a({writableObjectMode:!!(U!=null&&U.writableObjectMode),readableObjectMode:!!(W!=null&&W.writableObjectMode),writable:J,readable:ne}),J){if(i(U))B._write=function(q,te,Y){U.write(q,te)?Y():I=Y},B._final=function(q){U.end(),E=q},U.on("drain",function(){if(I){let q=I;I=null,q()}});else if(o(U)){let q=(l(U)?U.writable:U).getWriter();B._write=async function(te,Y,me){try{await q.ready,q.write(te).catch(()=>{}),me()}catch(se){me(se)}},B._final=async function(te){try{await q.ready,q.close().catch(()=>{}),E=te}catch(Y){te(Y)}}}let C=l(W)?W.readable:W;b(C,()=>{if(E){let q=E;E=null,q()}})}if(ne){if(i(W))W.on("readable",function(){if(L){let C=L;L=null,C()}}),W.on("end",function(){B.push(null)}),B._read=function(){for(;;){let C=W.read();if(C===null){L=B._read;return}if(!B.push(C))return}};else if(o(W)){let C=(l(W)?W.readable:W).getReader();B._read=async function(){for(;;)try{let{value:q,done:te}=await C.read();if(!B.push(q))return;if(te){B.push(null);return}}catch{return}}}}return B._destroy=function(C,q){!C&&F!==null&&(C=new g),L=null,I=null,E=null,F===null?q(C):(F=q,i(W)&&u(W,C))},B}}),Vu=Ae((e,n)=>{ae(),ue(),le();var t=globalThis.AbortController||ui().AbortController,{codes:{ERR_INVALID_ARG_VALUE:a,ERR_INVALID_ARG_TYPE:u,ERR_MISSING_ARGS:i,ERR_OUT_OF_RANGE:r},AbortError:s}=rt(),{validateAbortSignal:o,validateInteger:l,validateObject:f}=vr(),p=qe().Symbol("kWeak"),{finished:g}=Pt(),m=Es(),{addAbortSignalNoValidate:A}=Er(),{isWritable:b,isNodeStream:_}=wt(),{ArrayPrototypePush:x,MathFloor:I,Number:E,NumberIsNaN:L,Promise:F,PromiseReject:B,PromisePrototypeThen:T,Symbol:U}=qe(),W=U("kEmpty"),J=U("kEof");function ne(he,M){if(M!=null&&f(M,"options"),(M==null?void 0:M.signal)!=null&&o(M.signal,"options.signal"),_(he)&&!b(he))throw new a("stream",he,"must be writable");let S=m(this,he);return M!=null&&M.signal&&A(M.signal,S),S}function C(he,M){if(typeof he!="function")throw new u("fn",["Function","AsyncFunction"],he);M!=null&&f(M,"options"),(M==null?void 0:M.signal)!=null&&o(M.signal,"options.signal");let S=1;return(M==null?void 0:M.concurrency)!=null&&(S=I(M.concurrency)),l(S,"concurrency",1),(async function*(){var z,fe;let re=new t,X=this,ye=[],ge=re.signal,P={signal:ge},j=()=>re.abort();M!=null&&(z=M.signal)!==null&&z!==void 0&&z.aborted&&j(),M==null||(fe=M.signal)===null||fe===void 0||fe.addEventListener("abort",j);let V,ie,Z=!1;function D(){Z=!0}async function $(){try{for await(let Q of X){var O;if(Z)return;if(ge.aborted)throw new s;try{Q=he(Q,P)}catch(ce){Q=B(ce)}Q!==W&&(typeof((O=Q)===null||O===void 0?void 0:O.catch)=="function"&&Q.catch(D),ye.push(Q),V&&(V(),V=null),!Z&&ye.length&&ye.length>=S&&await new F(ce=>{ie=ce}))}ye.push(J)}catch(Q){let ce=B(Q);T(ce,void 0,D),ye.push(ce)}finally{var N;Z=!0,V&&(V(),V=null),M==null||(N=M.signal)===null||N===void 0||N.removeEventListener("abort",j)}}$();try{for(;;){for(;ye.length>0;){let O=await ye[0];if(O===J)return;if(ge.aborted)throw new s;O!==W&&(yield O),ye.shift(),ie&&(ie(),ie=null)}await new F(O=>{V=O})}}finally{re.abort(),Z=!0,ie&&(ie(),ie=null)}}).call(this)}function q(he=void 0){return he!=null&&f(he,"options"),(he==null?void 0:he.signal)!=null&&o(he.signal,"options.signal"),(async function*(){let M=0;for await(let z of this){var S;if(he!=null&&(S=he.signal)!==null&&S!==void 0&&S.aborted)throw new s({cause:he.signal.reason});yield[M++,z]}}).call(this)}async function te(he,M=void 0){for await(let S of H.call(this,he,M))return!0;return!1}async function Y(he,M=void 0){if(typeof he!="function")throw new u("fn",["Function","AsyncFunction"],he);return!await te.call(this,async(...S)=>!await he(...S),M)}async function me(he,M){for await(let S of H.call(this,he,M))return S}async function se(he,M){if(typeof he!="function")throw new u("fn",["Function","AsyncFunction"],he);async function S(z,fe){return await he(z,fe),W}for await(let z of C.call(this,S,M));}function H(he,M){if(typeof he!="function")throw new u("fn",["Function","AsyncFunction"],he);async function S(z,fe){return await he(z,fe)?z:W}return C.call(this,S,M)}var be=class extends i{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function oe(he,M,S){var z;if(typeof he!="function")throw new u("reducer",["Function","AsyncFunction"],he);S!=null&&f(S,"options"),(S==null?void 0:S.signal)!=null&&o(S.signal,"options.signal");let fe=arguments.length>1;if(S!=null&&(z=S.signal)!==null&&z!==void 0&&z.aborted){let P=new s(void 0,{cause:S.signal.reason});throw this.once("error",()=>{}),await g(this.destroy(P)),P}let re=new t,X=re.signal;if(S!=null&&S.signal){let P={once:!0,[p]:this};S.signal.addEventListener("abort",()=>re.abort(),P)}let ye=!1;try{for await(let P of this){var ge;if(ye=!0,S!=null&&(ge=S.signal)!==null&&ge!==void 0&&ge.aborted)throw new s;fe?M=await he(M,P,{signal:X}):(M=P,fe=!0)}if(!ye&&!fe)throw new be}finally{re.abort()}return M}async function we(he){he!=null&&f(he,"options"),(he==null?void 0:he.signal)!=null&&o(he.signal,"options.signal");let M=[];for await(let z of this){var S;if(he!=null&&(S=he.signal)!==null&&S!==void 0&&S.aborted)throw new s(void 0,{cause:he.signal.reason});x(M,z)}return M}function w(he,M){let S=C.call(this,he,M);return(async function*(){for await(let z of S)yield*z}).call(this)}function G(he){if(he=E(he),L(he))return 0;if(he<0)throw new r("number",">= 0",he);return he}function de(he,M=void 0){return M!=null&&f(M,"options"),(M==null?void 0:M.signal)!=null&&o(M.signal,"options.signal"),he=G(he),(async function*(){var S;if(M!=null&&(S=M.signal)!==null&&S!==void 0&&S.aborted)throw new s;for await(let fe of this){var z;if(M!=null&&(z=M.signal)!==null&&z!==void 0&&z.aborted)throw new s;he--<=0&&(yield fe)}}).call(this)}function ve(he,M=void 0){return M!=null&&f(M,"options"),(M==null?void 0:M.signal)!=null&&o(M.signal,"options.signal"),he=G(he),(async function*(){var S;if(M!=null&&(S=M.signal)!==null&&S!==void 0&&S.aborted)throw new s;for await(let fe of this){var z;if(M!=null&&(z=M.signal)!==null&&z!==void 0&&z.aborted)throw new s;if(he-- >0)yield fe;else return}}).call(this)}n.exports.streamReturningOperators={asIndexedPairs:q,drop:de,filter:H,flatMap:w,map:C,take:ve,compose:ne},n.exports.promiseReturningOperators={every:Y,forEach:se,reduce:oe,toArray:we,some:te,find:me}}),Ss=Ae((e,n)=>{ae(),ue(),le();var{ArrayPrototypePop:t,Promise:a}=qe(),{isIterable:u,isNodeStream:i,isWebStream:r}=wt(),{pipelineImpl:s}=Ei(),{finished:o}=Pt();Cs();function l(...f){return new a((p,g)=>{let m,A,b=f[f.length-1];if(b&&typeof b=="object"&&!i(b)&&!u(b)&&!r(b)){let _=t(f);m=_.signal,A=_.end}s(f,(_,x)=>{_?g(_):p(x)},{signal:m,end:A})})}n.exports={finished:o,pipeline:l}}),Cs=Ae((e,n)=>{ae(),ue(),le();var{Buffer:t}=(Ze(),Ue(Je)),{ObjectDefineProperty:a,ObjectKeys:u,ReflectApply:i}=qe(),{promisify:{custom:r}}=yt(),{streamReturningOperators:s,promiseReturningOperators:o}=Vu(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:l}}=rt(),f=Es(),{pipeline:p}=Ei(),{destroyer:g}=tr(),m=Pt(),A=Ss(),b=wt(),_=n.exports=di().Stream;_.isDisturbed=b.isDisturbed,_.isErrored=b.isErrored,_.isReadable=b.isReadable,_.Readable=Tr();for(let I of u(s)){let E=function(...F){if(new.target)throw l();return _.Readable.from(i(L,this,F))},L=s[I];a(E,"name",{__proto__:null,value:L.name}),a(E,"length",{__proto__:null,value:L.length}),a(_.Readable.prototype,I,{__proto__:null,value:E,enumerable:!1,configurable:!0,writable:!0})}for(let I of u(o)){let E=function(...F){if(new.target)throw l();return i(L,this,F)},L=o[I];a(E,"name",{__proto__:null,value:L.name}),a(E,"length",{__proto__:null,value:L.length}),a(_.Readable.prototype,I,{__proto__:null,value:E,enumerable:!1,configurable:!0,writable:!0})}_.Writable=ws(),_.Duplex=Et(),_.Transform=vs(),_.PassThrough=_s(),_.pipeline=p;var{addAbortSignal:x}=Er();_.addAbortSignal=x,_.finished=m,_.destroy=g,_.compose=f,a(_,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return A}}),a(p,r,{__proto__:null,enumerable:!0,get(){return A.pipeline}}),a(m,r,{__proto__:null,enumerable:!0,get(){return A.finished}}),_.Stream=_,_._isUint8Array=function(I){return I instanceof Uint8Array},_._uint8ArrayToBuffer=function(I){return t.from(I.buffer,I.byteOffset,I.byteLength)}}),Ht=Ae((e,n)=>{ae(),ue(),le();var t=Cs(),a=Ss(),u=t.Readable.destroy;n.exports=t.Readable,n.exports._uint8ArrayToBuffer=t._uint8ArrayToBuffer,n.exports._isUint8Array=t._isUint8Array,n.exports.isDisturbed=t.isDisturbed,n.exports.isErrored=t.isErrored,n.exports.isReadable=t.isReadable,n.exports.Readable=t.Readable,n.exports.Writable=t.Writable,n.exports.Duplex=t.Duplex,n.exports.Transform=t.Transform,n.exports.PassThrough=t.PassThrough,n.exports.addAbortSignal=t.addAbortSignal,n.exports.finished=t.finished,n.exports.destroy=t.destroy,n.exports.destroy=u,n.exports.pipeline=t.pipeline,n.exports.compose=t.compose,Object.defineProperty(t,"promises",{configurable:!0,enumerable:!0,get(){return a}}),n.exports.Stream=t.Stream,n.exports.default=n.exports}),Ku=Ae((e,n)=>{ae(),ue(),le(),typeof Object.create=="function"?n.exports=function(t,a){a&&(t.super_=a,t.prototype=Object.create(a.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:n.exports=function(t,a){if(a){t.super_=a;var u=function(){};u.prototype=a.prototype,t.prototype=new u,t.prototype.constructor=t}}}),Wu=Ae((e,n)=>{ae(),ue(),le();var{Buffer:t}=(Ze(),Ue(Je)),a=Symbol.for("BufferList");function u(i){if(!(this instanceof u))return new u(i);u._init.call(this,i)}u._init=function(i){Object.defineProperty(this,a,{value:!0}),this._bufs=[],this.length=0,i&&this.append(i)},u.prototype._new=function(i){return new u(i)},u.prototype._offset=function(i){if(i===0)return[0,0];let r=0;for(let s=0;s<this._bufs.length;s++){let o=r+this._bufs[s].length;if(i<o||s===this._bufs.length-1)return[s,i-r];r=o}},u.prototype._reverseOffset=function(i){let r=i[0],s=i[1];for(let o=0;o<r;o++)s+=this._bufs[o].length;return s},u.prototype.get=function(i){if(i>this.length||i<0)return;let r=this._offset(i);return this._bufs[r[0]][r[1]]},u.prototype.slice=function(i,r){return typeof i=="number"&&i<0&&(i+=this.length),typeof r=="number"&&r<0&&(r+=this.length),this.copy(null,0,i,r)},u.prototype.copy=function(i,r,s,o){if((typeof s!="number"||s<0)&&(s=0),(typeof o!="number"||o>this.length)&&(o=this.length),s>=this.length||o<=0)return i||t.alloc(0);let l=!!i,f=this._offset(s),p=o-s,g=p,m=l&&r||0,A=f[1];if(s===0&&o===this.length){if(!l)return this._bufs.length===1?this._bufs[0]:t.concat(this._bufs,this.length);for(let b=0;b<this._bufs.length;b++)this._bufs[b].copy(i,m),m+=this._bufs[b].length;return i}if(g<=this._bufs[f[0]].length-A)return l?this._bufs[f[0]].copy(i,r,A,A+g):this._bufs[f[0]].slice(A,A+g);l||(i=t.allocUnsafe(p));for(let b=f[0];b<this._bufs.length;b++){let _=this._bufs[b].length-A;if(g>_)this._bufs[b].copy(i,m,A),m+=_;else{this._bufs[b].copy(i,m,A,A+g),m+=_;break}g-=_,A&&(A=0)}return i.length>m?i.slice(0,m):i},u.prototype.shallowSlice=function(i,r){if(i=i||0,r=typeof r!="number"?this.length:r,i<0&&(i+=this.length),r<0&&(r+=this.length),i===r)return this._new();let s=this._offset(i),o=this._offset(r),l=this._bufs.slice(s[0],o[0]+1);return o[1]===0?l.pop():l[l.length-1]=l[l.length-1].slice(0,o[1]),s[1]!==0&&(l[0]=l[0].slice(s[1])),this._new(l)},u.prototype.toString=function(i,r,s){return this.slice(r,s).toString(i)},u.prototype.consume=function(i){if(i=Math.trunc(i),Number.isNaN(i)||i<=0)return this;for(;this._bufs.length;)if(i>=this._bufs[0].length)i-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(i),this.length-=i;break}return this},u.prototype.duplicate=function(){let i=this._new();for(let r=0;r<this._bufs.length;r++)i.append(this._bufs[r]);return i},u.prototype.append=function(i){if(i==null)return this;if(i.buffer)this._appendBuffer(t.from(i.buffer,i.byteOffset,i.byteLength));else if(Array.isArray(i))for(let r=0;r<i.length;r++)this.append(i[r]);else if(this._isBufferList(i))for(let r=0;r<i._bufs.length;r++)this.append(i._bufs[r]);else typeof i=="number"&&(i=i.toString()),this._appendBuffer(t.from(i));return this},u.prototype._appendBuffer=function(i){this._bufs.push(i),this.length+=i.length},u.prototype.indexOf=function(i,r,s){if(s===void 0&&typeof r=="string"&&(s=r,r=void 0),typeof i=="function"||Array.isArray(i))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof i=="number"?i=t.from([i]):typeof i=="string"?i=t.from(i,s):this._isBufferList(i)?i=i.slice():Array.isArray(i.buffer)?i=t.from(i.buffer,i.byteOffset,i.byteLength):t.isBuffer(i)||(i=t.from(i)),r=Number(r||0),isNaN(r)&&(r=0),r<0&&(r=this.length+r),r<0&&(r=0),i.length===0)return r>this.length?this.length:r;let o=this._offset(r),l=o[0],f=o[1];for(;l<this._bufs.length;l++){let p=this._bufs[l];for(;f<p.length;)if(p.length-f>=i.length){let g=p.indexOf(i,f);if(g!==-1)return this._reverseOffset([l,g]);f=p.length-i.length+1}else{let g=this._reverseOffset([l,f]);if(this._match(g,i))return g;f++}f=0}return-1},u.prototype._match=function(i,r){if(this.length-i<r.length)return!1;for(let s=0;s<r.length;s++)if(this.get(i+s)!==r[s])return!1;return!0},function(){let i={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 r in i)(function(s){i[s]===null?u.prototype[s]=function(o,l){return this.slice(o,o+l)[s](0,l)}:u.prototype[s]=function(o=0){return this.slice(o,o+i[s])[s](0)}})(r)}(),u.prototype._isBufferList=function(i){return i instanceof u||u.isBufferList(i)},u.isBufferList=function(i){return i!=null&&i[a]},n.exports=u}),Qu=Ae((e,n)=>{ae(),ue(),le();var t=Ht().Duplex,a=Ku(),u=Wu();function i(r){if(!(this instanceof i))return new i(r);if(typeof r=="function"){this._callback=r;let s=(function(o){this._callback&&(this._callback(o),this._callback=null)}).bind(this);this.on("pipe",function(o){o.on("error",s)}),this.on("unpipe",function(o){o.removeListener("error",s)}),r=null}u._init.call(this,r),t.call(this)}a(i,t),Object.assign(i.prototype,u.prototype),i.prototype._new=function(r){return new i(r)},i.prototype._write=function(r,s,o){this._appendBuffer(r),typeof o=="function"&&o()},i.prototype._read=function(r){if(!this.length)return this.push(null);r=Math.min(r,this.length),this.push(this.slice(0,r)),this.consume(r)},i.prototype.end=function(r){t.prototype.end.call(this,r),this._callback&&(this._callback(null,this.slice()),this._callback=null)},i.prototype._destroy=function(r,s){this._bufs.length=0,this.length=0,s(r)},i.prototype._isBufferList=function(r){return r instanceof i||r instanceof u||i.isBufferList(r)},i.isBufferList=u.isBufferList,n.exports=i,n.exports.BufferListStream=i,n.exports.BufferList=u}),Hu=Ae((e,n)=>{ae(),ue(),le();var t=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}};n.exports=t}),Is=Ae((e,n)=>{ae(),ue(),le();var t=n.exports,{Buffer:a}=(Ze(),Ue(Je));t.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"},t.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},t.requiredHeaderFlagsErrors={};for(let i in t.requiredHeaderFlags){let r=t.requiredHeaderFlags[i];t.requiredHeaderFlagsErrors[i]="Invalid header flag bits, must be 0x"+r.toString(16)+" for "+t.types[i]+" packet"}t.codes={};for(let i in t.types){let r=t.types[i];t.codes[r]=i}t.CMD_SHIFT=4,t.CMD_MASK=240,t.DUP_MASK=8,t.QOS_MASK=3,t.QOS_SHIFT=1,t.RETAIN_MASK=1,t.VARBYTEINT_MASK=127,t.VARBYTEINT_FIN_MASK=128,t.VARBYTEINT_MAX=268435455,t.SESSIONPRESENT_MASK=1,t.SESSIONPRESENT_HEADER=a.from([t.SESSIONPRESENT_MASK]),t.CONNACK_HEADER=a.from([t.codes.connack<<t.CMD_SHIFT]),t.USERNAME_MASK=128,t.PASSWORD_MASK=64,t.WILL_RETAIN_MASK=32,t.WILL_QOS_MASK=24,t.WILL_QOS_SHIFT=3,t.WILL_FLAG_MASK=4,t.CLEAN_SESSION_MASK=2,t.CONNECT_HEADER=a.from([t.codes.connect<<t.CMD_SHIFT]),t.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},t.propertiesCodes={};for(let i in t.properties){let r=t.properties[i];t.propertiesCodes[r]=i}t.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 u(i){return[0,1,2].map(r=>[0,1].map(s=>[0,1].map(o=>{let l=a.alloc(1);return l.writeUInt8(t.codes[i]<<t.CMD_SHIFT|(s?t.DUP_MASK:0)|r<<t.QOS_SHIFT|o,0,!0),l})))}t.PUBLISH_HEADER=u("publish"),t.SUBSCRIBE_HEADER=u("subscribe"),t.SUBSCRIBE_OPTIONS_QOS_MASK=3,t.SUBSCRIBE_OPTIONS_NL_MASK=1,t.SUBSCRIBE_OPTIONS_NL_SHIFT=2,t.SUBSCRIBE_OPTIONS_RAP_MASK=1,t.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,t.SUBSCRIBE_OPTIONS_RH_MASK=3,t.SUBSCRIBE_OPTIONS_RH_SHIFT=4,t.SUBSCRIBE_OPTIONS_RH=[0,16,32],t.SUBSCRIBE_OPTIONS_NL=4,t.SUBSCRIBE_OPTIONS_RAP=8,t.SUBSCRIBE_OPTIONS_QOS=[0,1,2],t.UNSUBSCRIBE_HEADER=u("unsubscribe"),t.ACKS={unsuback:u("unsuback"),puback:u("puback"),pubcomp:u("pubcomp"),pubrel:u("pubrel"),pubrec:u("pubrec")},t.SUBACK_HEADER=a.from([t.codes.suback<<t.CMD_SHIFT]),t.VERSION3=a.from([3]),t.VERSION4=a.from([4]),t.VERSION5=a.from([5]),t.VERSION131=a.from([131]),t.VERSION132=a.from([132]),t.QOS=[0,1,2].map(i=>a.from([i])),t.EMPTY={pingreq:a.from([t.codes.pingreq<<4,0]),pingresp:a.from([t.codes.pingresp<<4,0]),disconnect:a.from([t.codes.disconnect<<4,0])},t.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"},t.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},t.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"},t.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"},t.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"},t.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}}),qu=Ae((e,n)=>{ae(),ue(),le();var t=1e3,a=t*60,u=a*60,i=u*24,r=i*7,s=i*365.25;n.exports=function(g,m){m=m||{};var A=typeof g;if(A==="string"&&g.length>0)return o(g);if(A==="number"&&isFinite(g))return m.long?f(g):l(g);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(g))};function o(g){if(g=String(g),!(g.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(g);if(m){var A=parseFloat(m[1]),b=(m[2]||"ms").toLowerCase();switch(b){case"years":case"year":case"yrs":case"yr":case"y":return A*s;case"weeks":case"week":case"w":return A*r;case"days":case"day":case"d":return A*i;case"hours":case"hour":case"hrs":case"hr":case"h":return A*u;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*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return A;default:return}}}}function l(g){var m=Math.abs(g);return m>=i?Math.round(g/i)+"d":m>=u?Math.round(g/u)+"h":m>=a?Math.round(g/a)+"m":m>=t?Math.round(g/t)+"s":g+"ms"}function f(g){var m=Math.abs(g);return m>=i?p(g,m,i,"day"):m>=u?p(g,m,u,"hour"):m>=a?p(g,m,a,"minute"):m>=t?p(g,m,t,"second"):g+" ms"}function p(g,m,A,b){var _=m>=A*1.5;return Math.round(g/A)+" "+b+(_?"s":"")}}),$u=Ae((e,n)=>{ae(),ue(),le();function t(a){i.debug=i,i.default=i,i.coerce=p,i.disable=o,i.enable=s,i.enabled=l,i.humanize=qu(),i.destroy=g,Object.keys(a).forEach(m=>{i[m]=a[m]}),i.names=[],i.skips=[],i.formatters={};function u(m){let A=0;for(let b=0;b<m.length;b++)A=(A<<5)-A+m.charCodeAt(b),A|=0;return i.colors[Math.abs(A)%i.colors.length]}i.selectColor=u;function i(m){let A,b=null,_,x;function I(...E){if(!I.enabled)return;let L=I,F=Number(new Date),B=F-(A||F);L.diff=B,L.prev=A,L.curr=F,A=F,E[0]=i.coerce(E[0]),typeof E[0]!="string"&&E.unshift("%O");let T=0;E[0]=E[0].replace(/%([a-zA-Z%])/g,(U,W)=>{if(U==="%%")return"%";T++;let J=i.formatters[W];if(typeof J=="function"){let ne=E[T];U=J.call(L,ne),E.splice(T,1),T--}return U}),i.formatArgs.call(L,E),(L.log||i.log).apply(L,E)}return I.namespace=m,I.useColors=i.useColors(),I.color=i.selectColor(m),I.extend=r,I.destroy=i.destroy,Object.defineProperty(I,"enabled",{enumerable:!0,configurable:!1,get:()=>b!==null?b:(_!==i.namespaces&&(_=i.namespaces,x=i.enabled(m)),x),set:E=>{b=E}}),typeof i.init=="function"&&i.init(I),I}function r(m,A){let b=i(this.namespace+(typeof A>"u"?":":A)+m);return b.log=this.log,b}function s(m){i.save(m),i.namespaces=m,i.names=[],i.skips=[];let A,b=(typeof m=="string"?m:"").split(/[\s,]+/),_=b.length;for(A=0;A<_;A++)b[A]&&(m=b[A].replace(/\*/g,".*?"),m[0]==="-"?i.skips.push(new RegExp("^"+m.slice(1)+"$")):i.names.push(new RegExp("^"+m+"$")))}function o(){let m=[...i.names.map(f),...i.skips.map(f).map(A=>"-"+A)].join(",");return i.enable(""),m}function l(m){if(m[m.length-1]==="*")return!0;let A,b;for(A=0,b=i.skips.length;A<b;A++)if(i.skips[A].test(m))return!1;for(A=0,b=i.names.length;A<b;A++)if(i.names[A].test(m))return!0;return!1}function f(m){return m.toString().substring(2,m.toString().length-2).replace(/\.\*\?$/,"*")}function p(m){return m instanceof Error?m.stack||m.message:m}function g(){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 i.enable(i.load()),i}n.exports=t}),St=Ae((e,n)=>{ae(),ue(),le(),e.formatArgs=a,e.save=u,e.load=i,e.useColors=t,e.storage=r(),e.destroy=(()=>{let o=!1;return()=>{o||(o=!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`."))}})(),e.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 t(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1: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&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(o){if(o[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+o[0]+(this.useColors?"%c ":" ")+"+"+n.exports.humanize(this.diff),!this.useColors)return;let l="color: "+this.color;o.splice(1,0,l,"color: inherit");let f=0,p=0;o[0].replace(/%[a-zA-Z%]/g,g=>{g!=="%%"&&(f++,g==="%c"&&(p=f))}),o.splice(p,0,l)}e.log=console.debug||console.log||(()=>{});function u(o){try{o?e.storage.setItem("debug",o):e.storage.removeItem("debug")}catch{}}function i(){let o;try{o=e.storage.getItem("debug")}catch{}return!o&&typeof xe<"u"&&"env"in xe&&(o=xe.env.DEBUG),o}function r(){try{return localStorage}catch{}}n.exports=$u()(e);var{formatters:s}=n.exports;s.j=function(o){try{return JSON.stringify(o)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}}),zu=Ae((e,n)=>{ae(),ue(),le();var t=Qu(),{EventEmitter:a}=(rr(),Ue(jt)),u=Hu(),i=Is(),r=St()("mqtt-packet:parser"),s=class Wi extends a{constructor(){super(),this.parser=this.constructor.parser}static parser(l){return this instanceof Wi?(this.settings=l||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new Wi().parser(l)}_resetState(){r("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new u,this.error=null,this._list=t(),this._stateCounter=0}parse(l){for(this.error&&this._resetState(),this._list.append(l),r("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++,r("parse: state complete. _stateCounter is now: %d",this._stateCounter),r("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return r("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let l=this._list.readUInt8(0),f=l>>i.CMD_SHIFT;this.packet.cmd=i.types[f];let p=l&15,g=i.requiredHeaderFlags[f];return g!=null&&p!==g?this._emitError(new Error(i.requiredHeaderFlagsErrors[f])):(this.packet.retain=(l&i.RETAIN_MASK)!==0,this.packet.qos=l>>i.QOS_SHIFT&i.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(l&i.DUP_MASK)!==0,r("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){let l=this._parseVarByteNum(!0);return l&&(this.packet.length=l.value,this._list.consume(l.bytes)),r("_parseLength %d",l.value),!!l}_parsePayload(){r("_parsePayload: payload %O",this._list);let l=!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"))}l=!0}return r("_parsePayload complete result: %s",l),l}_parseConnect(){r("_parseConnect");let l,f,p,g,m={},A=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(A.protocolId=b,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)&i.USERNAME_MASK,m.password=this._list.readUInt8(this._pos)&i.PASSWORD_MASK,m.will=this._list.readUInt8(this._pos)&i.WILL_FLAG_MASK;let _=!!(this._list.readUInt8(this._pos)&i.WILL_RETAIN_MASK),x=(this._list.readUInt8(this._pos)&i.WILL_QOS_MASK)>>i.WILL_QOS_SHIFT;if(m.will)A.will={},A.will.retain=_,A.will.qos=x;else{if(_)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(x)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)&i.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 E=this._parseProperties();Object.getOwnPropertyNames(E).length&&(A.properties=E)}let I=this._parseString();if(I===null)return this._emitError(new Error("Packet too short"));if(A.clientId=I,r("_parseConnect: packet.clientId: %s",A.clientId),m.will){if(A.protocolVersion===5){let E=this._parseProperties();Object.getOwnPropertyNames(E).length&&(A.will.properties=E)}if(l=this._parseString(),l===null)return this._emitError(new Error("Cannot parse will topic"));if(A.will.topic=l,r("_parseConnect: packet.will.topic: %s",A.will.topic),f=this._parseBuffer(),f===null)return this._emitError(new Error("Cannot parse will payload"));A.will.payload=f,r("_parseConnect: packet.will.paylaod: %s",A.will.payload)}if(m.username){if(g=this._parseString(),g===null)return this._emitError(new Error("Cannot parse username"));A.username=g,r("_parseConnect: packet.username: %s",A.username)}if(m.password){if(p=this._parseBuffer(),p===null)return this._emitError(new Error("Cannot parse password"));A.password=p}return this.settings=A,r("_parseConnect: complete"),A}_parseConnack(){r("_parseConnack");let l=this.packet;if(this._list.length<1)return null;let f=this._list.readUInt8(this._pos++);if(f>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(l.sessionPresent=!!(f&i.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?l.reasonCode=this._list.readUInt8(this._pos++):l.reasonCode=0;else{if(this._list.length<2)return null;l.returnCode=this._list.readUInt8(this._pos++)}if(l.returnCode===-1||l.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){let p=this._parseProperties();Object.getOwnPropertyNames(p).length&&(l.properties=p)}r("_parseConnack: complete")}_parsePublish(){r("_parsePublish");let l=this.packet;if(l.topic=this._parseString(),l.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(l.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){let f=this._parseProperties();Object.getOwnPropertyNames(f).length&&(l.properties=f)}l.payload=this._list.slice(this._pos,l.length),r("_parsePublish: payload from buffer list: %o",l.payload)}}_parseSubscribe(){r("_parseSubscribe");let l=this.packet,f,p,g,m,A,b,_;if(l.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let x=this._parseProperties();Object.getOwnPropertyNames(x).length&&(l.properties=x)}if(l.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<l.length;){if(f=this._parseString(),f===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=l.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(p=this._parseByte(),this.settings.protocolVersion===5){if(p&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(p&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(g=p&i.SUBSCRIBE_OPTIONS_QOS_MASK,g>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(b=(p>>i.SUBSCRIBE_OPTIONS_NL_SHIFT&i.SUBSCRIBE_OPTIONS_NL_MASK)!==0,A=(p>>i.SUBSCRIBE_OPTIONS_RAP_SHIFT&i.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,m=p>>i.SUBSCRIBE_OPTIONS_RH_SHIFT&i.SUBSCRIBE_OPTIONS_RH_MASK,m>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));_={topic:f,qos:g},this.settings.protocolVersion===5?(_.nl=b,_.rap=A,_.rh=m):this.settings.bridgeMode&&(_.rh=0,_.rap=!0,_.nl=!0),r("_parseSubscribe: push subscription `%s` to subscription",_),l.subscriptions.push(_)}}}_parseSuback(){r("_parseSuback");let l=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let f=this._parseProperties();Object.getOwnPropertyNames(f).length&&(l.properties=f)}if(l.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let f=this._list.readUInt8(this._pos++);if(this.settings.protocolVersion===5){if(!i.MQTT5_SUBACK_CODES[f])return this._emitError(new Error("Invalid suback code"))}else if(f>2&&f!==128)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(f)}}}_parseUnsubscribe(){r("_parseUnsubscribe");let l=this.packet;if(l.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let f=this._parseProperties();Object.getOwnPropertyNames(f).length&&(l.properties=f)}if(l.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<l.length;){let f=this._parseString();if(f===null)return this._emitError(new Error("Cannot parse topic"));r("_parseUnsubscribe: push topic `%s` to unsubscriptions",f),l.unsubscriptions.push(f)}}}_parseUnsuback(){r("_parseUnsuback");let l=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((this.settings.protocolVersion===3||this.settings.protocolVersion===4)&&l.length!==2)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(l.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(this.settings.protocolVersion===5){let f=this._parseProperties();for(Object.getOwnPropertyNames(f).length&&(l.properties=f),l.granted=[];this._pos<this.packet.length;){let p=this._list.readUInt8(this._pos++);if(!i.MQTT5_UNSUBACK_CODES[p])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(p)}}}_parseConfirmation(){r("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let l=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5){if(l.length>2){switch(l.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!i.MQTT5_PUBACK_PUBREC_CODES[l.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!i.MQTT5_PUBREL_PUBCOMP_CODES[l.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}r("_parseConfirmation: packet.reasonCode `%d`",l.reasonCode)}else l.reasonCode=0;if(l.length>3){let f=this._parseProperties();Object.getOwnPropertyNames(f).length&&(l.properties=f)}}return!0}_parseDisconnect(){let l=this.packet;if(r("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(l.reasonCode=this._parseByte(),i.MQTT5_DISCONNECT_CODES[l.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):l.reasonCode=0;let f=this._parseProperties();Object.getOwnPropertyNames(f).length&&(l.properties=f)}return r("_parseDisconnect result: true"),!0}_parseAuth(){r("_parseAuth");let l=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(l.reasonCode=this._parseByte(),!i.MQTT5_AUTH_CODES[l.reasonCode])return this._emitError(new Error("Invalid auth reason code"));let f=this._parseProperties();return Object.getOwnPropertyNames(f).length&&(l.properties=f),r("_parseAuth: result: true"),!0}_parseMessageId(){let l=this.packet;return l.messageId=this._parseNum(),l.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(r("_parseMessageId: packet.messageId %d",l.messageId),!0)}_parseString(l){let f=this._parseNum(),p=f+this._pos;if(f===-1||p>this._list.length||p>this.packet.length)return null;let g=this._list.toString("utf8",this._pos,p);return this._pos+=f,r("_parseString: result: %s",g),g}_parseStringPair(){return r("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let l=this._parseNum(),f=l+this._pos;if(l===-1||f>this._list.length||f>this.packet.length)return null;let p=this._list.slice(this._pos,f);return this._pos+=l,r("_parseBuffer: result: %o",p),p}_parseNum(){if(this._list.length-this._pos<2)return-1;let l=this._list.readUInt16BE(this._pos);return this._pos+=2,r("_parseNum: result: %s",l),l}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;let l=this._list.readUInt32BE(this._pos);return this._pos+=4,r("_parse4ByteNum: result: %s",l),l}_parseVarByteNum(l){r("_parseVarByteNum");let f=4,p=0,g=1,m=0,A=!1,b,_=this._pos?this._pos:0;for(;p<f&&_+p<this._list.length;){if(b=this._list.readUInt8(_+p++),m+=g*(b&i.VARBYTEINT_MASK),g*=128,!(b&i.VARBYTEINT_FIN_MASK)){A=!0;break}if(this._list.length<=p)break}return!A&&p===f&&this._list.length>=p&&this._emitError(new Error("Invalid variable byte integer")),_&&(this._pos+=p),A?l?A={bytes:p,value:m}:A=m:A=!1,r("_parseVarByteNum: result: %o",A),A}_parseByte(){let l;return this._pos<this._list.length&&(l=this._list.readUInt8(this._pos),this._pos++),r("_parseByte: result: %o",l),l}_parseByType(l){switch(r("_parseByType: type: %s",l),l){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(){r("_parseProperties");let l=this._parseVarByteNum(),f=this._pos+l,p={};for(;this._pos<f;){let g=this._parseByte();if(!g)return this._emitError(new Error("Cannot parse property code type")),!1;let m=i.propertiesCodes[g];if(!m)return this._emitError(new Error("Unknown property")),!1;if(m==="userProperties"){p[m]||(p[m]=Object.create(null));let A=this._parseByType(i.propertiesTypes[m]);if(p[m][A.name])if(Array.isArray(p[m][A.name]))p[m][A.name].push(A.value);else{let b=p[m][A.name];p[m][A.name]=[b],p[m][A.name].push(A.value)}else p[m][A.name]=A.value;continue}p[m]?Array.isArray(p[m])?p[m].push(this._parseByType(i.propertiesTypes[m])):(p[m]=[p[m]],p[m].push(this._parseByType(i.propertiesTypes[m]))):p[m]=this._parseByType(i.propertiesTypes[m])}return p}_newPacket(){return r("_newPacket"),this.packet&&(this._list.consume(this.packet.length),r("_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)),r("_newPacket: new packet"),this.packet=new u,this._pos=0,!0}_emitError(l){r("_emitError",l),this.error=l,this.emit("error",l)}};n.exports=s}),Yu=Ae((e,n)=>{ae(),ue(),le();var{Buffer:t}=(Ze(),Ue(Je)),a=65536,u={},i=t.isBuffer(t.from([1,2]).subarray(0,1));function r(f){let p=t.allocUnsafe(2);return p.writeUInt8(f>>8,0),p.writeUInt8(f&255,1),p}function s(){for(let f=0;f<a;f++)u[f]=r(f)}function o(f){let p=0,g=0,m=t.allocUnsafe(4);do p=f%128|0,f=f/128|0,f>0&&(p=p|128),m.writeUInt8(p,g++);while(f>0&&g<4);return f>0&&(g=0),i?m.subarray(0,g):m.slice(0,g)}function l(f){let p=t.allocUnsafe(4);return p.writeUInt32BE(f,0),p}n.exports={cache:u,generateCache:s,generateNumber:r,genBufVariableByteInt:o,generate4ByteBuffer:l}}),Gu=Ae((e,n)=>{ae(),ue(),le(),typeof xe>"u"||!xe.version||xe.version.indexOf("v0.")===0||xe.version.indexOf("v1.")===0&&xe.version.indexOf("v1.8.")!==0?n.exports={nextTick:t}:n.exports=xe;function t(a,u,i,r){if(typeof a!="function")throw new TypeError('"callback" argument must be a function');var s=arguments.length,o,l;switch(s){case 0:case 1:return xe.nextTick(a);case 2:return xe.nextTick(function(){a.call(null,u)});case 3:return xe.nextTick(function(){a.call(null,u,i)});case 4:return xe.nextTick(function(){a.call(null,u,i,r)});default:for(o=new Array(s-1),l=0;l<o.length;)o[l++]=arguments[l];return xe.nextTick(function(){a.apply(null,o)})}}}),ks=Ae((e,n)=>{ae(),ue(),le();var t=Is(),{Buffer:a}=(Ze(),Ue(Je)),u=a.allocUnsafe(0),i=a.from([0]),r=Yu(),s=Gu().nextTick,o=St()("mqtt-packet:writeToStream"),l=r.cache,f=r.generateNumber,p=r.generateCache,g=r.genBufVariableByteInt,m=r.generate4ByteBuffer,A=se,b=!0;function _(M,S,z){switch(o("generate called"),S.cork&&(S.cork(),s(x,S)),b&&(b=!1,p()),o("generate: packet.cmd: %s",M.cmd),M.cmd){case"connect":return I(M,S);case"connack":return E(M,S,z);case"publish":return L(M,S,z);case"puback":case"pubrec":case"pubrel":case"pubcomp":return F(M,S,z);case"subscribe":return B(M,S,z);case"suback":return T(M,S,z);case"unsubscribe":return U(M,S,z);case"unsuback":return W(M,S,z);case"pingreq":case"pingresp":return J(M,S);case"disconnect":return ne(M,S,z);case"auth":return C(M,S,z);default:return S.destroy(new Error("Unknown command")),!1}}Object.defineProperty(_,"cacheNumbers",{get(){return A===se},set(M){M?((!l||Object.keys(l).length===0)&&(b=!0),A=se):(b=!1,A=H)}});function x(M){M.uncork()}function I(M,S,z){let fe=M||{},re=fe.protocolId||"MQTT",X=fe.protocolVersion||4,ye=fe.will,ge=fe.clean,P=fe.keepalive||0,j=fe.clientId||"",V=fe.username,ie=fe.password,Z=fe.properties;ge===void 0&&(ge=!0);let D=0;if(typeof re!="string"&&!a.isBuffer(re))return S.destroy(new Error("Invalid protocolId")),!1;if(D+=re.length+2,X!==3&&X!==4&&X!==5)return S.destroy(new Error("Invalid protocol version")),!1;if(D+=1,(typeof j=="string"||a.isBuffer(j))&&(j||X>=4)&&(j||ge))D+=a.byteLength(j)+2;else{if(X<4)return S.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(ge*1===0)return S.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 S.destroy(new Error("Invalid keepalive")),!1;D+=2,D+=1;let $,O;if(X===5){if($=we(S,Z),!$)return!1;D+=$.length}if(ye){if(typeof ye!="object")return S.destroy(new Error("Invalid will")),!1;if(!ye.topic||typeof ye.topic!="string")return S.destroy(new Error("Invalid will topic")),!1;if(D+=a.byteLength(ye.topic)+2,D+=2,ye.payload)if(ye.payload.length>=0)typeof ye.payload=="string"?D+=a.byteLength(ye.payload):D+=ye.payload.length;else return S.destroy(new Error("Invalid will payload")),!1;if(O={},X===5){if(O=we(S,ye.properties),!O)return!1;D+=O.length}}let N=!1;if(V!=null)if(he(V))N=!0,D+=a.byteLength(V)+2;else return S.destroy(new Error("Invalid username")),!1;if(ie!=null){if(!N)return S.destroy(new Error("Username is required to use password")),!1;if(he(ie))D+=ve(ie)+2;else return S.destroy(new Error("Invalid password")),!1}S.write(t.CONNECT_HEADER),te(S,D),oe(S,re),fe.bridgeMode&&(X+=128),S.write(X===131?t.VERSION131:X===132?t.VERSION132:X===4?t.VERSION4:X===5?t.VERSION5:t.VERSION3);let Q=0;return Q|=V!=null?t.USERNAME_MASK:0,Q|=ie!=null?t.PASSWORD_MASK:0,Q|=ye&&ye.retain?t.WILL_RETAIN_MASK:0,Q|=ye&&ye.qos?ye.qos<<t.WILL_QOS_SHIFT:0,Q|=ye?t.WILL_FLAG_MASK:0,Q|=ge?t.CLEAN_SESSION_MASK:0,S.write(a.from([Q])),A(S,P),X===5&&$.write(),oe(S,j),ye&&(X===5&&O.write(),Y(S,ye.topic),oe(S,ye.payload)),V!=null&&oe(S,V),ie!=null&&oe(S,ie),!0}function E(M,S,z){let fe=z?z.protocolVersion:4,re=M||{},X=fe===5?re.reasonCode:re.returnCode,ye=re.properties,ge=2;if(typeof X!="number")return S.destroy(new Error("Invalid return code")),!1;let P=null;if(fe===5){if(P=we(S,ye),!P)return!1;ge+=P.length}return S.write(t.CONNACK_HEADER),te(S,ge),S.write(re.sessionPresent?t.SESSIONPRESENT_HEADER:i),S.write(a.from([X])),P==null||P.write(),!0}function L(M,S,z){o("publish: packet: %o",M);let fe=z?z.protocolVersion:4,re=M||{},X=re.qos||0,ye=re.retain?t.RETAIN_MASK:0,ge=re.topic,P=re.payload||u,j=re.messageId,V=re.properties,ie=0;if(typeof ge=="string")ie+=a.byteLength(ge)+2;else if(a.isBuffer(ge))ie+=ge.length+2;else return S.destroy(new Error("Invalid topic")),!1;if(a.isBuffer(P)?ie+=P.length:ie+=a.byteLength(P),X&&typeof j!="number")return S.destroy(new Error("Invalid messageId")),!1;X&&(ie+=2);let Z=null;if(fe===5){if(Z=we(S,V),!Z)return!1;ie+=Z.length}return S.write(t.PUBLISH_HEADER[X][re.dup?1:0][ye?1:0]),te(S,ie),A(S,ve(ge)),S.write(ge),X>0&&A(S,j),Z==null||Z.write(),o("publish: payload: %o",P),S.write(P)}function F(M,S,z){let fe=z?z.protocolVersion:4,re=M||{},X=re.cmd||"puback",ye=re.messageId,ge=re.dup&&X==="pubrel"?t.DUP_MASK:0,P=0,j=re.reasonCode,V=re.properties,ie=fe===5?3:2;if(X==="pubrel"&&(P=1),typeof ye!="number")return S.destroy(new Error("Invalid messageId")),!1;let Z=null;if(fe===5&&typeof V=="object"){if(Z=w(S,V,z,ie),!Z)return!1;ie+=Z.length}return S.write(t.ACKS[X][P][ge][0]),ie===3&&(ie+=j!==0?1:-1),te(S,ie),A(S,ye),fe===5&&ie!==2&&S.write(a.from([j])),Z!==null?Z.write():ie===4&&S.write(a.from([0])),!0}function B(M,S,z){o("subscribe: packet: ");let fe=z?z.protocolVersion:4,re=M||{},X=re.dup?t.DUP_MASK:0,ye=re.messageId,ge=re.subscriptions,P=re.properties,j=0;if(typeof ye!="number")return S.destroy(new Error("Invalid messageId")),!1;j+=2;let V=null;if(fe===5){if(V=we(S,P),!V)return!1;j+=V.length}if(typeof ge=="object"&&ge.length)for(let Z=0;Z<ge.length;Z+=1){let D=ge[Z].topic,$=ge[Z].qos;if(typeof D!="string")return S.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof $!="number")return S.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(fe===5){if(typeof(ge[Z].nl||!1)!="boolean")return S.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(ge[Z].rap||!1)!="boolean")return S.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let O=ge[Z].rh||0;if(typeof O!="number"||O>2)return S.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}j+=a.byteLength(D)+2+1}else return S.destroy(new Error("Invalid subscriptions")),!1;o("subscribe: writing to stream: %o",t.SUBSCRIBE_HEADER),S.write(t.SUBSCRIBE_HEADER[1][X?1:0][0]),te(S,j),A(S,ye),V!==null&&V.write();let ie=!0;for(let Z of ge){let D=Z.topic,$=Z.qos,O=+Z.nl,N=+Z.rap,Q=Z.rh,ce;Y(S,D),ce=t.SUBSCRIBE_OPTIONS_QOS[$],fe===5&&(ce|=O?t.SUBSCRIBE_OPTIONS_NL:0,ce|=N?t.SUBSCRIBE_OPTIONS_RAP:0,ce|=Q?t.SUBSCRIBE_OPTIONS_RH[Q]:0),ie=S.write(a.from([ce]))}return ie}function T(M,S,z){let fe=z?z.protocolVersion:4,re=M||{},X=re.messageId,ye=re.granted,ge=re.properties,P=0;if(typeof X!="number")return S.destroy(new Error("Invalid messageId")),!1;if(P+=2,typeof ye=="object"&&ye.length)for(let V=0;V<ye.length;V+=1){if(typeof ye[V]!="number")return S.destroy(new Error("Invalid qos vector")),!1;P+=1}else return S.destroy(new Error("Invalid qos vector")),!1;let j=null;if(fe===5){if(j=w(S,ge,z,P),!j)return!1;P+=j.length}return S.write(t.SUBACK_HEADER),te(S,P),A(S,X),j!==null&&j.write(),S.write(a.from(ye))}function U(M,S,z){let fe=z?z.protocolVersion:4,re=M||{},X=re.messageId,ye=re.dup?t.DUP_MASK:0,ge=re.unsubscriptions,P=re.properties,j=0;if(typeof X!="number")return S.destroy(new Error("Invalid messageId")),!1;if(j+=2,typeof ge=="object"&&ge.length)for(let Z=0;Z<ge.length;Z+=1){if(typeof ge[Z]!="string")return S.destroy(new Error("Invalid unsubscriptions")),!1;j+=a.byteLength(ge[Z])+2}else return S.destroy(new Error("Invalid unsubscriptions")),!1;let V=null;if(fe===5){if(V=we(S,P),!V)return!1;j+=V.length}S.write(t.UNSUBSCRIBE_HEADER[1][ye?1:0][0]),te(S,j),A(S,X),V!==null&&V.write();let ie=!0;for(let Z=0;Z<ge.length;Z++)ie=Y(S,ge[Z]);return ie}function W(M,S,z){let fe=z?z.protocolVersion:4,re=M||{},X=re.messageId,ye=re.dup?t.DUP_MASK:0,ge=re.granted,P=re.properties,j=re.cmd,V=0,ie=2;if(typeof X!="number")return S.destroy(new Error("Invalid messageId")),!1;if(fe===5)if(typeof ge=="object"&&ge.length)for(let D=0;D<ge.length;D+=1){if(typeof ge[D]!="number")return S.destroy(new Error("Invalid qos vector")),!1;ie+=1}else return S.destroy(new Error("Invalid qos vector")),!1;let Z=null;if(fe===5){if(Z=w(S,P,z,ie),!Z)return!1;ie+=Z.length}return S.write(t.ACKS[j][V][ye][0]),te(S,ie),A(S,X),Z!==null&&Z.write(),fe===5&&S.write(a.from(ge)),!0}function J(M,S,z){return S.write(t.EMPTY[M.cmd])}function ne(M,S,z){let fe=z?z.protocolVersion:4,re=M||{},X=re.reasonCode,ye=re.properties,ge=fe===5?1:0,P=null;if(fe===5){if(P=w(S,ye,z,ge),!P)return!1;ge+=P.length}return S.write(a.from([t.codes.disconnect<<4])),te(S,ge),fe===5&&S.write(a.from([X])),P!==null&&P.write(),!0}function C(M,S,z){let fe=z?z.protocolVersion:4,re=M||{},X=re.reasonCode,ye=re.properties,ge=fe===5?1:0;fe!==5&&S.destroy(new Error("Invalid mqtt version for auth packet"));let P=w(S,ye,z,ge);return P?(ge+=P.length,S.write(a.from([t.codes.auth<<4])),te(S,ge),S.write(a.from([X])),P!==null&&P.write(),!0):!1}var q={};function te(M,S){if(S>t.VARBYTEINT_MAX)return M.destroy(new Error(`Invalid variable byte integer: ${S}`)),!1;let z=q[S];return z||(z=g(S),S<16384&&(q[S]=z)),o("writeVarByteInt: writing to stream: %o",z),M.write(z)}function Y(M,S){let z=a.byteLength(S);return A(M,z),o("writeString: %s",S),M.write(S,"utf8")}function me(M,S,z){Y(M,S),Y(M,z)}function se(M,S){return o("writeNumberCached: number: %d",S),o("writeNumberCached: %o",l[S]),M.write(l[S])}function H(M,S){let z=f(S);return o("writeNumberGenerated: %o",z),M.write(z)}function be(M,S){let z=m(S);return o("write4ByteNumber: %o",z),M.write(z)}function oe(M,S){typeof S=="string"?Y(M,S):S?(A(M,S.length),M.write(S)):A(M,0)}function we(M,S){if(typeof S!="object"||S.length!=null)return{length:1,write(){de(M,{},0)}};let z=0;function fe(re,X){let ye=t.propertiesTypes[re],ge=0;switch(ye){case"byte":{if(typeof X!="boolean")return M.destroy(new Error(`Invalid ${re}: ${X}`)),!1;ge+=2;break}case"int8":{if(typeof X!="number"||X<0||X>255)return M.destroy(new Error(`Invalid ${re}: ${X}`)),!1;ge+=2;break}case"binary":{if(X&&X===null)return M.destroy(new Error(`Invalid ${re}: ${X}`)),!1;ge+=1+a.byteLength(X)+2;break}case"int16":{if(typeof X!="number"||X<0||X>65535)return M.destroy(new Error(`Invalid ${re}: ${X}`)),!1;ge+=3;break}case"int32":{if(typeof X!="number"||X<0||X>4294967295)return M.destroy(new Error(`Invalid ${re}: ${X}`)),!1;ge+=5;break}case"var":{if(typeof X!="number"||X<0||X>268435455)return M.destroy(new Error(`Invalid ${re}: ${X}`)),!1;ge+=1+a.byteLength(g(X));break}case"string":{if(typeof X!="string")return M.destroy(new Error(`Invalid ${re}: ${X}`)),!1;ge+=3+a.byteLength(X.toString());break}case"pair":{if(typeof X!="object")return M.destroy(new Error(`Invalid ${re}: ${X}`)),!1;ge+=Object.getOwnPropertyNames(X).reduce((P,j)=>{let V=X[j];return Array.isArray(V)?P+=V.reduce((ie,Z)=>(ie+=3+a.byteLength(j.toString())+2+a.byteLength(Z.toString()),ie),0):P+=3+a.byteLength(j.toString())+2+a.byteLength(X[j].toString()),P},0);break}default:return M.destroy(new Error(`Invalid property ${re}: ${X}`)),!1}return ge}if(S)for(let re in S){let X=0,ye=0,ge=S[re];if(Array.isArray(ge))for(let P=0;P<ge.length;P++){if(ye=fe(re,ge[P]),!ye)return!1;X+=ye}else{if(ye=fe(re,ge),!ye)return!1;X=ye}if(!X)return!1;z+=X}return{length:a.byteLength(g(z))+z,write(){de(M,S,z)}}}function w(M,S,z,fe){let re=["reasonString","userProperties"],X=z&&z.properties&&z.properties.maximumPacketSize?z.properties.maximumPacketSize:0,ye=we(M,S);if(X)for(;fe+ye.length>X;){let ge=re.shift();if(ge&&S[ge])delete S[ge],ye=we(M,S);else return!1}return ye}function G(M,S,z){switch(t.propertiesTypes[S]){case"byte":{M.write(a.from([t.properties[S]])),M.write(a.from([+z]));break}case"int8":{M.write(a.from([t.properties[S]])),M.write(a.from([z]));break}case"binary":{M.write(a.from([t.properties[S]])),oe(M,z);break}case"int16":{M.write(a.from([t.properties[S]])),A(M,z);break}case"int32":{M.write(a.from([t.properties[S]])),be(M,z);break}case"var":{M.write(a.from([t.properties[S]])),te(M,z);break}case"string":{M.write(a.from([t.properties[S]])),Y(M,z);break}case"pair":{Object.getOwnPropertyNames(z).forEach(fe=>{let re=z[fe];Array.isArray(re)?re.forEach(X=>{M.write(a.from([t.properties[S]])),me(M,fe.toString(),X.toString())}):(M.write(a.from([t.properties[S]])),me(M,fe.toString(),re.toString()))});break}default:return M.destroy(new Error(`Invalid property ${S} value: ${z}`)),!1}}function de(M,S,z){te(M,z);for(let fe in S)if(Object.prototype.hasOwnProperty.call(S,fe)&&S[fe]!==null){let re=S[fe];if(Array.isArray(re))for(let X=0;X<re.length;X++)G(M,fe,re[X]);else G(M,fe,re)}}function ve(M){return M?M instanceof a?M.length:a.byteLength(M):0}function he(M){return typeof M=="string"||M instanceof a}n.exports=_}),Ju=Ae((e,n)=>{ae(),ue(),le();var t=ks(),{EventEmitter:a}=(rr(),Ue(jt)),{Buffer:u}=(Ze(),Ue(Je));function i(s,o){let l=new r;return t(s,l,o),l.concat()}var r=class extends a{constructor(){super(),this._array=new Array(20),this._i=0}write(s){return this._array[this._i++]=s,!0}concat(){let s=0,o=new Array(this._array.length),l=this._array,f=0,p;for(p=0;p<l.length&&l[p]!==void 0;p++)typeof l[p]!="string"?o[p]=l[p].length:o[p]=u.byteLength(l[p]),s+=o[p];let g=u.allocUnsafe(s);for(p=0;p<l.length&&l[p]!==void 0;p++)typeof l[p]!="string"?(l[p].copy(g,f),f+=o[p]):(g.write(l[p],f),f+=o[p]);return g}destroy(s){s&&this.emit("error",s)}};n.exports=i}),Zu=Ae(e=>{ae(),ue(),le(),e.parser=zu().parser,e.generate=Ju(),e.writeToStream=ks()}),Ts=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"__esModule",{value:!0});var n=class{constructor(){this.nextId=Math.max(1,Math.floor(Math.random()*65535))}allocate(){let t=this.nextId++;return this.nextId===65536&&(this.nextId=1),t}getLastAllocated(){return this.nextId===1?65535:this.nextId-1}register(t){return!0}deallocate(t){}clear(){}};e.default=n}),Xu=Ae((e,n)=>{ae(),ue(),le(),n.exports=a;function t(i){return i instanceof wr?wr.from(i):new i.constructor(i.buffer.slice(),i.byteOffset,i.length)}function a(i){if(i=i||{},i.circles)return u(i);return i.proto?o:s;function r(l,f){for(var p=Object.keys(l),g=new Array(p.length),m=0;m<p.length;m++){var A=p[m],b=l[A];typeof b!="object"||b===null?g[A]=b:b instanceof Date?g[A]=new Date(b):ArrayBuffer.isView(b)?g[A]=t(b):g[A]=f(b)}return g}function s(l){if(typeof l!="object"||l===null)return l;if(l instanceof Date)return new Date(l);if(Array.isArray(l))return r(l,s);if(l instanceof Map)return new Map(r(Array.from(l),s));if(l instanceof Set)return new Set(r(Array.from(l),s));var f={};for(var p in l)if(Object.hasOwnProperty.call(l,p)!==!1){var g=l[p];typeof g!="object"||g===null?f[p]=g:g instanceof Date?f[p]=new Date(g):g instanceof Map?f[p]=new Map(r(Array.from(g),s)):g instanceof Set?f[p]=new Set(r(Array.from(g),s)):ArrayBuffer.isView(g)?f[p]=t(g):f[p]=s(g)}return f}function o(l){if(typeof l!="object"||l===null)return l;if(l instanceof Date)return new Date(l);if(Array.isArray(l))return r(l,o);if(l instanceof Map)return new Map(r(Array.from(l),o));if(l instanceof Set)return new Set(r(Array.from(l),o));var f={};for(var p in l){var g=l[p];typeof g!="object"||g===null?f[p]=g:g instanceof Date?f[p]=new Date(g):g instanceof Map?f[p]=new Map(r(Array.from(g),o)):g instanceof Set?f[p]=new Set(r(Array.from(g),o)):ArrayBuffer.isView(g)?f[p]=t(g):f[p]=o(g)}return f}}function u(i){var r=[],s=[];return i.proto?f:l;function o(p,g){for(var m=Object.keys(p),A=new Array(m.length),b=0;b<m.length;b++){var _=m[b],x=p[_];if(typeof x!="object"||x===null)A[_]=x;else if(x instanceof Date)A[_]=new Date(x);else if(ArrayBuffer.isView(x))A[_]=t(x);else{var I=r.indexOf(x);I!==-1?A[_]=s[I]:A[_]=g(x)}}return A}function l(p){if(typeof p!="object"||p===null)return p;if(p instanceof Date)return new Date(p);if(Array.isArray(p))return o(p,l);if(p instanceof Map)return new Map(o(Array.from(p),l));if(p instanceof Set)return new Set(o(Array.from(p),l));var g={};r.push(p),s.push(g);for(var m in p)if(Object.hasOwnProperty.call(p,m)!==!1){var A=p[m];if(typeof A!="object"||A===null)g[m]=A;else if(A instanceof Date)g[m]=new Date(A);else if(A instanceof Map)g[m]=new Map(o(Array.from(A),l));else if(A instanceof Set)g[m]=new Set(o(Array.from(A),l));else if(ArrayBuffer.isView(A))g[m]=t(A);else{var b=r.indexOf(A);b!==-1?g[m]=s[b]:g[m]=l(A)}}return r.pop(),s.pop(),g}function f(p){if(typeof p!="object"||p===null)return p;if(p instanceof Date)return new Date(p);if(Array.isArray(p))return o(p,f);if(p instanceof Map)return new Map(o(Array.from(p),f));if(p instanceof Set)return new Set(o(Array.from(p),f));var g={};r.push(p),s.push(g);for(var m in p){var A=p[m];if(typeof A!="object"||A===null)g[m]=A;else if(A instanceof Date)g[m]=new Date(A);else if(A instanceof Map)g[m]=new Map(o(Array.from(A),f));else if(A instanceof Set)g[m]=new Set(o(Array.from(A),f));else if(ArrayBuffer.isView(A))g[m]=t(A);else{var b=r.indexOf(A);b!==-1?g[m]=s[b]:g[m]=f(A)}}return r.pop(),s.pop(),g}}}),ec=Ae((e,n)=>{ae(),ue(),le(),n.exports=Xu()()}),tc=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"__esModule",{value:!0}),e.validateTopics=e.validateTopic=void 0;function n(a){let u=a.split("/");for(let i=0;i<u.length;i++)if(u[i]!=="+"){if(u[i]==="#")return i===u.length-1;if(u[i].indexOf("+")!==-1||u[i].indexOf("#")!==-1)return!1}return!0}e.validateTopic=n;function t(a){if(a.length===0)return"empty_topic_list";for(let u=0;u<a.length;u++)if(!n(a[u]))return a[u];return null}e.validateTopics=t}),Bs=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"__esModule",{value:!0});var n=Ht(),t={objectMode:!0},a={clean:!0},u=class{constructor(i){this.options=i||{},this.options=Object.assign(Object.assign({},a),i),this._inflights=new Map}put(i,r){return this._inflights.set(i.messageId,i),r&&r(),this}createStream(){let i=new n.Readable(t),r=[],s=!1,o=0;return this._inflights.forEach((l,f)=>{r.push(l)}),i._read=()=>{!s&&o<r.length?i.push(r[o++]):i.push(null)},i.destroy=l=>{if(!s)return s=!0,setTimeout(()=>{i.emit("close")},0),i},i}del(i,r){let s=this._inflights.get(i.messageId);return s?(this._inflights.delete(i.messageId),r(null,s)):r&&r(new Error("missing packet")),this}get(i,r){let s=this._inflights.get(i.messageId);return s?r(null,s):r&&r(new Error("missing packet")),this}close(i){this.options.clean&&(this._inflights=null),i&&i()}};e.default=u}),rc=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"__esModule",{value:!0});var n=[0,16,128,131,135,144,145,151,153],t=(a,u,i)=>{a.log("handlePublish: packet %o",u),i=typeof i<"u"?i:a.noop;let r=u.topic.toString(),s=u.payload,{qos:o}=u,{messageId:l}=u,{options:f}=a;if(a.options.protocolVersion===5){let p;if(u.properties&&(p=u.properties.topicAlias),typeof p<"u")if(r.length===0)if(p>0&&p<=65535){let g=a.topicAliasRecv.getTopicByAlias(p);if(g)r=g,a.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",r,p);else{a.log("handlePublish :: unregistered topic alias. alias: %d",p),a.emit("error",new Error("Received unregistered Topic Alias"));return}}else{a.log("handlePublish :: topic alias out of range. alias: %d",p),a.emit("error",new Error("Received Topic Alias is out of range"));return}else if(a.topicAliasRecv.put(r,p))a.log("handlePublish :: registered topic: %s - alias: %d",r,p);else{a.log("handlePublish :: topic alias out of range. alias: %d",p),a.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(a.log("handlePublish: qos %d",o),o){case 2:{f.customHandleAcks(r,s,u,(p,g)=>{if(typeof p=="number"&&(g=p,p=null),p)return a.emit("error",p);if(n.indexOf(g)===-1)return a.emit("error",new Error("Wrong reason code for pubrec"));g?a._sendPacket({cmd:"pubrec",messageId:l,reasonCode:g},i):a.incomingStore.put(u,()=>{a._sendPacket({cmd:"pubrec",messageId:l},i)})});break}case 1:{f.customHandleAcks(r,s,u,(p,g)=>{if(typeof p=="number"&&(g=p,p=null),p)return a.emit("error",p);if(n.indexOf(g)===-1)return a.emit("error",new Error("Wrong reason code for puback"));g||a.emit("message",r,s,u),a.handleMessage(u,m=>{if(m)return i&&i(m);a._sendPacket({cmd:"puback",messageId:l,reasonCode:g},i)})});break}case 0:a.emit("message",r,s,u),a.handleMessage(u,i);break;default:a.log("handlePublish: unknown QoS. Doing nothing.");break}};e.default=t}),nc=Ae((e,n)=>{n.exports={version:"5.10.3"}}),ir=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"__esModule",{value:!0}),e.MQTTJS_VERSION=e.nextTick=e.applyMixin=e.ErrorWithReasonCode=void 0;var n=class qa extends Error{constructor(u,i){super(u),this.code=i,Object.setPrototypeOf(this,qa.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};e.ErrorWithReasonCode=n;function t(a,u,i=!1){var r;let s=[u];for(;;){let o=s[0],l=Object.getPrototypeOf(o);if(l!=null&&l.prototype)s.unshift(l);else break}for(let o of s)for(let l of Object.getOwnPropertyNames(o.prototype))(i||l!=="constructor")&&Object.defineProperty(a.prototype,l,(r=Object.getOwnPropertyDescriptor(o.prototype,l))!==null&&r!==void 0?r:Object.create(null))}e.applyMixin=t,e.nextTick=typeof(xe==null?void 0:xe.nextTick)=="function"?xe.nextTick:a=>{setTimeout(a,0)},e.MQTTJS_VERSION=nc().version}),Br=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"__esModule",{value:!0}),e.ReasonCodes=void 0;var n=ir();e.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 t=(a,u)=>{let{messageId:i}=u,r=u.cmd,s=null,o=a.outgoing[i]?a.outgoing[i].cb:null,l=null;if(!o){a.log("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(a.log("_handleAck :: packet type",r),r){case"pubcomp":case"puback":{let f=u.reasonCode;f&&f>0&&f!==16?(l=new n.ErrorWithReasonCode(`Publish error: ${e.ReasonCodes[f]}`,f),a._removeOutgoingAndStoreMessage(i,()=>{o(l,u)})):a._removeOutgoingAndStoreMessage(i,o);break}case"pubrec":{s={cmd:"pubrel",qos:2,messageId:i};let f=u.reasonCode;f&&f>0&&f!==16?(l=new n.ErrorWithReasonCode(`Publish error: ${e.ReasonCodes[f]}`,f),a._removeOutgoingAndStoreMessage(i,()=>{o(l,u)})):a._sendPacket(s);break}case"suback":{delete a.outgoing[i],a.messageIdProvider.deallocate(i);let f=u.granted;for(let p=0;p<f.length;p++){let g=f[p];if(g&128){l=new Error(`Subscribe error: ${e.ReasonCodes[g]}`),l.code=g;let m=a.messageIdToTopic[i];m&&m.forEach(A=>{delete a._resubscribeTopics[A]})}}delete a.messageIdToTopic[i],a._invokeStoreProcessingQueue(),o(l,u);break}case"unsuback":{delete a.outgoing[i],a.messageIdProvider.deallocate(i),a._invokeStoreProcessingQueue(),o(null,u);break}default:a.emit("error",new Error("unrecognized packet type"))}a.disconnecting&&Object.keys(a.outgoing).length===0&&a.emit("outgoingEmpty")};e.default=t}),ic=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"__esModule",{value:!0});var n=ir(),t=Br(),a=(u,i)=>{let{options:r}=u,s=r.protocolVersion,o=s===5?i.reasonCode:i.returnCode;if(s!==5){let l=new n.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${s}`,o);u.emit("error",l);return}u.handleAuth(i,(l,f)=>{if(l){u.emit("error",l);return}if(o===24)u.reconnecting=!1,u._sendPacket(f);else{let p=new n.ErrorWithReasonCode(`Connection refused: ${t.ReasonCodes[o]}`,o);u.emit("error",p)}})};e.default=a}),oc=Ae(e=>{var m,A,b,_,x,I,E,L,F,B,T,U,W,J,ne,C,q,te,Y,me,se,H,be,oe,we,w,Qi,de,ve,he,M,$a,z,fe,re,Rt,Mt,Hi,Kr,Wr,Fe,qi,gr,D;ae(),ue(),le(),Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=void 0;var n=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,t=new Set,a=typeof xe=="object"&&xe?xe:{},u=($,O,N,Q)=>{typeof a.emitWarning=="function"?a.emitWarning($,O,N,Q):console.error(`[${N}] ${O}: ${$}`)},i=globalThis.AbortController,r=globalThis.AbortSignal;if(typeof i>"u"){r=class{constructor(){Ve(this,"onabort");Ve(this,"_onabort",[]);Ve(this,"reason");Ve(this,"aborted",!1)}addEventListener(N,Q){this._onabort.push(Q)}},i=class{constructor(){Ve(this,"signal",new r);O()}abort(N){var Q,ce;if(!this.signal.aborted){this.signal.reason=N,this.signal.aborted=!0;for(let h of this.signal._onabort)h(N);(ce=(Q=this.signal).onabort)==null||ce.call(Q,N)}}};let $=((m=a.env)==null?void 0:m.LRU_CACHE_IGNORE_AC_WARNING)!=="1",O=()=>{$&&($=!1,u("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",O))}}var s=$=>!t.has($),o=$=>$&&$===Math.floor($)&&$>0&&isFinite($),l=$=>o($)?$<=Math.pow(2,8)?Uint8Array:$<=Math.pow(2,16)?Uint16Array:$<=Math.pow(2,32)?Uint32Array:$<=Number.MAX_SAFE_INTEGER?f:null:null,f=class extends Array{constructor($){super($),this.fill(0)}},p=(A=class{constructor(O,N){Ve(this,"heap");Ve(this,"length");if(!R(A,b))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new N(O),this.length=0}static create(O){let N=l(O);if(!N)return[];Ce(A,b,!0);let Q=new A(O,N);return Ce(A,b,!1),Q}push(O){this.heap[this.length++]=O}pop(){return this.heap[--this.length]}},b=new WeakMap,Pe(A,b,!1),A),g=(D=class{constructor(O){Pe(this,w);Pe(this,_);Pe(this,x);Pe(this,I);Pe(this,E);Pe(this,L);Ve(this,"ttl");Ve(this,"ttlResolution");Ve(this,"ttlAutopurge");Ve(this,"updateAgeOnGet");Ve(this,"updateAgeOnHas");Ve(this,"allowStale");Ve(this,"noDisposeOnSet");Ve(this,"noUpdateTTL");Ve(this,"maxEntrySize");Ve(this,"sizeCalculation");Ve(this,"noDeleteOnFetchRejection");Ve(this,"noDeleteOnStaleGet");Ve(this,"allowStaleOnFetchAbort");Ve(this,"allowStaleOnFetchRejection");Ve(this,"ignoreFetchAbort");Pe(this,F);Pe(this,B);Pe(this,T);Pe(this,U);Pe(this,W);Pe(this,J);Pe(this,ne);Pe(this,C);Pe(this,q);Pe(this,te);Pe(this,Y);Pe(this,me);Pe(this,se);Pe(this,H);Pe(this,be);Pe(this,oe);Pe(this,we);Pe(this,de,()=>{});Pe(this,ve,()=>{});Pe(this,he,()=>{});Pe(this,M,()=>!1);Pe(this,z,O=>{});Pe(this,fe,(O,N,Q)=>{});Pe(this,re,(O,N,Q,ce)=>{if(Q||ce)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});let{max:N=0,ttl:Q,ttlResolution:ce=1,ttlAutopurge:h,updateAgeOnGet:c,updateAgeOnHas:d,allowStale:y,dispose:k,disposeAfter:K,noDisposeOnSet:ee,noUpdateTTL:Ie,maxSize:Be=0,maxEntrySize:Oe=0,sizeCalculation:Se,fetchMethod:Te,noDeleteOnFetchRejection:ke,noDeleteOnStaleGet:De,allowStaleOnFetchRejection:ze,allowStaleOnFetchAbort:Qe,ignoreFetchAbort:Xe}=O;if(N!==0&&!o(N))throw new TypeError("max option must be a nonnegative integer");let tt=N?l(N):Array;if(!tt)throw new Error("invalid max value: "+N);if(Ce(this,_,N),Ce(this,x,Be),this.maxEntrySize=Oe||R(this,x),this.sizeCalculation=Se,this.sizeCalculation){if(!R(this,x)&&!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(Te!==void 0&&typeof Te!="function")throw new TypeError("fetchMethod must be a function if specified");if(Ce(this,L,Te),Ce(this,oe,!!Te),Ce(this,T,new Map),Ce(this,U,new Array(N).fill(void 0)),Ce(this,W,new Array(N).fill(void 0)),Ce(this,J,new tt(N)),Ce(this,ne,new tt(N)),Ce(this,C,0),Ce(this,q,0),Ce(this,te,p.create(N)),Ce(this,F,0),Ce(this,B,0),typeof k=="function"&&Ce(this,I,k),typeof K=="function"?(Ce(this,E,K),Ce(this,Y,[])):(Ce(this,E,void 0),Ce(this,Y,void 0)),Ce(this,be,!!R(this,I)),Ce(this,we,!!R(this,E)),this.noDisposeOnSet=!!ee,this.noUpdateTTL=!!Ie,this.noDeleteOnFetchRejection=!!ke,this.allowStaleOnFetchRejection=!!ze,this.allowStaleOnFetchAbort=!!Qe,this.ignoreFetchAbort=!!Xe,this.maxEntrySize!==0){if(R(this,x)!==0&&!o(R(this,x)))throw new TypeError("maxSize must be a positive integer if specified");if(!o(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");Ee(this,w,$a).call(this)}if(this.allowStale=!!y,this.noDeleteOnStaleGet=!!De,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!d,this.ttlResolution=o(ce)||ce===0?ce:1,this.ttlAutopurge=!!h,this.ttl=Q||0,this.ttl){if(!o(this.ttl))throw new TypeError("ttl must be a positive integer if specified");Ee(this,w,Qi).call(this)}if(R(this,_)===0&&this.ttl===0&&R(this,x)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!R(this,_)&&!R(this,x)){let Ye="LRU_CACHE_UNBOUNDED";s(Ye)&&(t.add(Ye),u("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Ye,D))}}static unsafeExposeInternals(O){return{starts:R(O,se),ttls:R(O,H),sizes:R(O,me),keyMap:R(O,T),keyList:R(O,U),valList:R(O,W),next:R(O,J),prev:R(O,ne),get head(){return R(O,C)},get tail(){return R(O,q)},free:R(O,te),isBackgroundFetch:N=>{var Q;return Ee(Q=O,w,Fe).call(Q,N)},backgroundFetch:(N,Q,ce,h)=>{var c;return Ee(c=O,w,Wr).call(c,N,Q,ce,h)},moveToTail:N=>{var Q;return Ee(Q=O,w,gr).call(Q,N)},indexes:N=>{var Q;return Ee(Q=O,w,Rt).call(Q,N)},rindexes:N=>{var Q;return Ee(Q=O,w,Mt).call(Q,N)},isStale:N=>{var Q;return R(Q=O,M).call(Q,N)}}}get max(){return R(this,_)}get maxSize(){return R(this,x)}get calculatedSize(){return R(this,B)}get size(){return R(this,F)}get fetchMethod(){return R(this,L)}get dispose(){return R(this,I)}get disposeAfter(){return R(this,E)}getRemainingTTL(O){return R(this,T).has(O)?1/0:0}*entries(){for(let O of Ee(this,w,Rt).call(this))R(this,W)[O]!==void 0&&R(this,U)[O]!==void 0&&!Ee(this,w,Fe).call(this,R(this,W)[O])&&(yield[R(this,U)[O],R(this,W)[O]])}*rentries(){for(let O of Ee(this,w,Mt).call(this))R(this,W)[O]!==void 0&&R(this,U)[O]!==void 0&&!Ee(this,w,Fe).call(this,R(this,W)[O])&&(yield[R(this,U)[O],R(this,W)[O]])}*keys(){for(let O of Ee(this,w,Rt).call(this)){let N=R(this,U)[O];N!==void 0&&!Ee(this,w,Fe).call(this,R(this,W)[O])&&(yield N)}}*rkeys(){for(let O of Ee(this,w,Mt).call(this)){let N=R(this,U)[O];N!==void 0&&!Ee(this,w,Fe).call(this,R(this,W)[O])&&(yield N)}}*values(){for(let O of Ee(this,w,Rt).call(this))R(this,W)[O]!==void 0&&!Ee(this,w,Fe).call(this,R(this,W)[O])&&(yield R(this,W)[O])}*rvalues(){for(let O of Ee(this,w,Mt).call(this))R(this,W)[O]!==void 0&&!Ee(this,w,Fe).call(this,R(this,W)[O])&&(yield R(this,W)[O])}[Symbol.iterator](){return this.entries()}find(O,N={}){for(let Q of Ee(this,w,Rt).call(this)){let ce=R(this,W)[Q],h=Ee(this,w,Fe).call(this,ce)?ce.__staleWhileFetching:ce;if(h!==void 0&&O(h,R(this,U)[Q],this))return this.get(R(this,U)[Q],N)}}forEach(O,N=this){for(let Q of Ee(this,w,Rt).call(this)){let ce=R(this,W)[Q],h=Ee(this,w,Fe).call(this,ce)?ce.__staleWhileFetching:ce;h!==void 0&&O.call(N,h,R(this,U)[Q],this)}}rforEach(O,N=this){for(let Q of Ee(this,w,Mt).call(this)){let ce=R(this,W)[Q],h=Ee(this,w,Fe).call(this,ce)?ce.__staleWhileFetching:ce;h!==void 0&&O.call(N,h,R(this,U)[Q],this)}}purgeStale(){let O=!1;for(let N of Ee(this,w,Mt).call(this,{allowStale:!0}))R(this,M).call(this,N)&&(this.delete(R(this,U)[N]),O=!0);return O}dump(){let O=[];for(let N of Ee(this,w,Rt).call(this,{allowStale:!0})){let Q=R(this,U)[N],ce=R(this,W)[N],h=Ee(this,w,Fe).call(this,ce)?ce.__staleWhileFetching:ce;if(h===void 0||Q===void 0)continue;let c={value:h};if(R(this,H)&&R(this,se)){c.ttl=R(this,H)[N];let d=n.now()-R(this,se)[N];c.start=Math.floor(Date.now()-d)}R(this,me)&&(c.size=R(this,me)[N]),O.unshift([Q,c])}return O}load(O){this.clear();for(let[N,Q]of O){if(Q.start){let ce=Date.now()-Q.start;Q.start=n.now()-ce}this.set(N,Q.value,Q)}}set(O,N,Q={}){var Ie,Be,Oe,Se,Te;if(N===void 0)return this.delete(O),this;let{ttl:ce=this.ttl,start:h,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:d=this.sizeCalculation,status:y}=Q,{noUpdateTTL:k=this.noUpdateTTL}=Q,K=R(this,re).call(this,O,N,Q.size||0,d);if(this.maxEntrySize&&K>this.maxEntrySize)return y&&(y.set="miss",y.maxEntrySizeExceeded=!0),this.delete(O),this;let ee=R(this,F)===0?void 0:R(this,T).get(O);if(ee===void 0)ee=R(this,F)===0?R(this,q):R(this,te).length!==0?R(this,te).pop():R(this,F)===R(this,_)?Ee(this,w,Kr).call(this,!1):R(this,F),R(this,U)[ee]=O,R(this,W)[ee]=N,R(this,T).set(O,ee),R(this,J)[R(this,q)]=ee,R(this,ne)[ee]=R(this,q),Ce(this,q,ee),Vr(this,F)._++,R(this,fe).call(this,ee,K,y),y&&(y.set="add"),k=!1;else{Ee(this,w,gr).call(this,ee);let ke=R(this,W)[ee];if(N!==ke){if(R(this,oe)&&Ee(this,w,Fe).call(this,ke)){ke.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:De}=ke;De!==void 0&&!c&&(R(this,be)&&((Ie=R(this,I))==null||Ie.call(this,De,O,"set")),R(this,we)&&((Be=R(this,Y))==null||Be.push([De,O,"set"])))}else c||(R(this,be)&&((Oe=R(this,I))==null||Oe.call(this,ke,O,"set")),R(this,we)&&((Se=R(this,Y))==null||Se.push([ke,O,"set"])));if(R(this,z).call(this,ee),R(this,fe).call(this,ee,K,y),R(this,W)[ee]=N,y){y.set="replace";let De=ke&&Ee(this,w,Fe).call(this,ke)?ke.__staleWhileFetching:ke;De!==void 0&&(y.oldValue=De)}}else y&&(y.set="update")}if(ce!==0&&!R(this,H)&&Ee(this,w,Qi).call(this),R(this,H)&&(k||R(this,he).call(this,ee,ce,h),y&&R(this,ve).call(this,y,ee)),!c&&R(this,we)&&R(this,Y)){let ke=R(this,Y),De;for(;De=ke==null?void 0:ke.shift();)(Te=R(this,E))==null||Te.call(this,...De)}return this}pop(){var O;try{for(;R(this,F);){let N=R(this,W)[R(this,C)];if(Ee(this,w,Kr).call(this,!0),Ee(this,w,Fe).call(this,N)){if(N.__staleWhileFetching)return N.__staleWhileFetching}else if(N!==void 0)return N}}finally{if(R(this,we)&&R(this,Y)){let N=R(this,Y),Q;for(;Q=N==null?void 0:N.shift();)(O=R(this,E))==null||O.call(this,...Q)}}}has(O,N={}){let{updateAgeOnHas:Q=this.updateAgeOnHas,status:ce}=N,h=R(this,T).get(O);if(h!==void 0){let c=R(this,W)[h];if(Ee(this,w,Fe).call(this,c)&&c.__staleWhileFetching===void 0)return!1;if(R(this,M).call(this,h))ce&&(ce.has="stale",R(this,ve).call(this,ce,h));else return Q&&R(this,de).call(this,h),ce&&(ce.has="hit",R(this,ve).call(this,ce,h)),!0}else ce&&(ce.has="miss");return!1}peek(O,N={}){let{allowStale:Q=this.allowStale}=N,ce=R(this,T).get(O);if(ce!==void 0&&(Q||!R(this,M).call(this,ce))){let h=R(this,W)[ce];return Ee(this,w,Fe).call(this,h)?h.__staleWhileFetching:h}}async fetch(O,N={}){let{allowStale:Q=this.allowStale,updateAgeOnGet:ce=this.updateAgeOnGet,noDeleteOnStaleGet:h=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:d=this.noDisposeOnSet,size:y=0,sizeCalculation:k=this.sizeCalculation,noUpdateTTL:K=this.noUpdateTTL,noDeleteOnFetchRejection:ee=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:Ie=this.allowStaleOnFetchRejection,ignoreFetchAbort:Be=this.ignoreFetchAbort,allowStaleOnFetchAbort:Oe=this.allowStaleOnFetchAbort,context:Se,forceRefresh:Te=!1,status:ke,signal:De}=N;if(!R(this,oe))return ke&&(ke.fetch="get"),this.get(O,{allowStale:Q,updateAgeOnGet:ce,noDeleteOnStaleGet:h,status:ke});let ze={allowStale:Q,updateAgeOnGet:ce,noDeleteOnStaleGet:h,ttl:c,noDisposeOnSet:d,size:y,sizeCalculation:k,noUpdateTTL:K,noDeleteOnFetchRejection:ee,allowStaleOnFetchRejection:Ie,allowStaleOnFetchAbort:Oe,ignoreFetchAbort:Be,status:ke,signal:De},Qe=R(this,T).get(O);if(Qe===void 0){ke&&(ke.fetch="miss");let Xe=Ee(this,w,Wr).call(this,O,Qe,ze,Se);return Xe.__returned=Xe}else{let Xe=R(this,W)[Qe];if(Ee(this,w,Fe).call(this,Xe)){let Qa=Q&&Xe.__staleWhileFetching!==void 0;return ke&&(ke.fetch="inflight",Qa&&(ke.returnedStale=!0)),Qa?Xe.__staleWhileFetching:Xe.__returned=Xe}let tt=R(this,M).call(this,Qe);if(!Te&&!tt)return ke&&(ke.fetch="hit"),Ee(this,w,gr).call(this,Qe),ce&&R(this,de).call(this,Qe),ke&&R(this,ve).call(this,ke,Qe),Xe;let Ye=Ee(this,w,Wr).call(this,O,Qe,ze,Se),Wa=Ye.__staleWhileFetching!==void 0&&Q;return ke&&(ke.fetch=tt?"stale":"refresh",Wa&&tt&&(ke.returnedStale=!0)),Wa?Ye.__staleWhileFetching:Ye.__returned=Ye}}get(O,N={}){let{allowStale:Q=this.allowStale,updateAgeOnGet:ce=this.updateAgeOnGet,noDeleteOnStaleGet:h=this.noDeleteOnStaleGet,status:c}=N,d=R(this,T).get(O);if(d!==void 0){let y=R(this,W)[d],k=Ee(this,w,Fe).call(this,y);return c&&R(this,ve).call(this,c,d),R(this,M).call(this,d)?(c&&(c.get="stale"),k?(c&&Q&&y.__staleWhileFetching!==void 0&&(c.returnedStale=!0),Q?y.__staleWhileFetching:void 0):(h||this.delete(O),c&&Q&&(c.returnedStale=!0),Q?y:void 0)):(c&&(c.get="hit"),k?y.__staleWhileFetching:(Ee(this,w,gr).call(this,d),ce&&R(this,de).call(this,d),y))}else c&&(c.get="miss")}delete(O){var Q,ce,h,c;let N=!1;if(R(this,F)!==0){let d=R(this,T).get(O);if(d!==void 0)if(N=!0,R(this,F)===1)this.clear();else{R(this,z).call(this,d);let y=R(this,W)[d];Ee(this,w,Fe).call(this,y)?y.__abortController.abort(new Error("deleted")):(R(this,be)||R(this,we))&&(R(this,be)&&((Q=R(this,I))==null||Q.call(this,y,O,"delete")),R(this,we)&&((ce=R(this,Y))==null||ce.push([y,O,"delete"]))),R(this,T).delete(O),R(this,U)[d]=void 0,R(this,W)[d]=void 0,d===R(this,q)?Ce(this,q,R(this,ne)[d]):d===R(this,C)?Ce(this,C,R(this,J)[d]):(R(this,J)[R(this,ne)[d]]=R(this,J)[d],R(this,ne)[R(this,J)[d]]=R(this,ne)[d]),Vr(this,F)._--,R(this,te).push(d)}}if(R(this,we)&&((h=R(this,Y))!=null&&h.length)){let d=R(this,Y),y;for(;y=d==null?void 0:d.shift();)(c=R(this,E))==null||c.call(this,...y)}return N}clear(){var O,N,Q;for(let ce of Ee(this,w,Mt).call(this,{allowStale:!0})){let h=R(this,W)[ce];if(Ee(this,w,Fe).call(this,h))h.__abortController.abort(new Error("deleted"));else{let c=R(this,U)[ce];R(this,be)&&((O=R(this,I))==null||O.call(this,h,c,"delete")),R(this,we)&&((N=R(this,Y))==null||N.push([h,c,"delete"]))}}if(R(this,T).clear(),R(this,W).fill(void 0),R(this,U).fill(void 0),R(this,H)&&R(this,se)&&(R(this,H).fill(0),R(this,se).fill(0)),R(this,me)&&R(this,me).fill(0),Ce(this,C,0),Ce(this,q,0),R(this,te).length=0,Ce(this,B,0),Ce(this,F,0),R(this,we)&&R(this,Y)){let ce=R(this,Y),h;for(;h=ce==null?void 0:ce.shift();)(Q=R(this,E))==null||Q.call(this,...h)}}},_=new WeakMap,x=new WeakMap,I=new WeakMap,E=new WeakMap,L=new WeakMap,F=new WeakMap,B=new WeakMap,T=new WeakMap,U=new WeakMap,W=new WeakMap,J=new WeakMap,ne=new WeakMap,C=new WeakMap,q=new WeakMap,te=new WeakMap,Y=new WeakMap,me=new WeakMap,se=new WeakMap,H=new WeakMap,be=new WeakMap,oe=new WeakMap,we=new WeakMap,w=new WeakSet,Qi=function(){let O=new f(R(this,_)),N=new f(R(this,_));Ce(this,H,O),Ce(this,se,N),Ce(this,he,(h,c,d=n.now())=>{if(N[h]=c!==0?d:0,O[h]=c,c!==0&&this.ttlAutopurge){let y=setTimeout(()=>{R(this,M).call(this,h)&&this.delete(R(this,U)[h])},c+1);y.unref&&y.unref()}}),Ce(this,de,h=>{N[h]=O[h]!==0?n.now():0}),Ce(this,ve,(h,c)=>{if(O[c]){let d=O[c],y=N[c];h.ttl=d,h.start=y,h.now=Q||ce();let k=h.now-y;h.remainingTTL=d-k}});let Q=0,ce=()=>{let h=n.now();if(this.ttlResolution>0){Q=h;let c=setTimeout(()=>Q=0,this.ttlResolution);c.unref&&c.unref()}return h};this.getRemainingTTL=h=>{let c=R(this,T).get(h);if(c===void 0)return 0;let d=O[c],y=N[c];if(d===0||y===0)return 1/0;let k=(Q||ce())-y;return d-k},Ce(this,M,h=>O[h]!==0&&N[h]!==0&&(Q||ce())-N[h]>O[h])},de=new WeakMap,ve=new WeakMap,he=new WeakMap,M=new WeakMap,$a=function(){let O=new f(R(this,_));Ce(this,B,0),Ce(this,me,O),Ce(this,z,N=>{Ce(this,B,R(this,B)-O[N]),O[N]=0}),Ce(this,re,(N,Q,ce,h)=>{if(Ee(this,w,Fe).call(this,Q))return 0;if(!o(ce))if(h){if(typeof h!="function")throw new TypeError("sizeCalculation must be a function");if(ce=h(Q,N),!o(ce))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 ce}),Ce(this,fe,(N,Q,ce)=>{if(O[N]=Q,R(this,x)){let h=R(this,x)-O[N];for(;R(this,B)>h;)Ee(this,w,Kr).call(this,!0)}Ce(this,B,R(this,B)+O[N]),ce&&(ce.entrySize=Q,ce.totalCalculatedSize=R(this,B))})},z=new WeakMap,fe=new WeakMap,re=new WeakMap,Rt=function*({allowStale:O=this.allowStale}={}){if(R(this,F))for(let N=R(this,q);!(!Ee(this,w,Hi).call(this,N)||((O||!R(this,M).call(this,N))&&(yield N),N===R(this,C)));)N=R(this,ne)[N]},Mt=function*({allowStale:O=this.allowStale}={}){if(R(this,F))for(let N=R(this,C);!(!Ee(this,w,Hi).call(this,N)||((O||!R(this,M).call(this,N))&&(yield N),N===R(this,q)));)N=R(this,J)[N]},Hi=function(O){return O!==void 0&&R(this,T).get(R(this,U)[O])===O},Kr=function(O){var h,c;let N=R(this,C),Q=R(this,U)[N],ce=R(this,W)[N];return R(this,oe)&&Ee(this,w,Fe).call(this,ce)?ce.__abortController.abort(new Error("evicted")):(R(this,be)||R(this,we))&&(R(this,be)&&((h=R(this,I))==null||h.call(this,ce,Q,"evict")),R(this,we)&&((c=R(this,Y))==null||c.push([ce,Q,"evict"]))),R(this,z).call(this,N),O&&(R(this,U)[N]=void 0,R(this,W)[N]=void 0,R(this,te).push(N)),R(this,F)===1?(Ce(this,C,Ce(this,q,0)),R(this,te).length=0):Ce(this,C,R(this,J)[N]),R(this,T).delete(Q),Vr(this,F)._--,N},Wr=function(O,N,Q,ce){let h=N===void 0?void 0:R(this,W)[N];if(Ee(this,w,Fe).call(this,h))return h;let c=new i,{signal:d}=Q;d==null||d.addEventListener("abort",()=>c.abort(d.reason),{signal:c.signal});let y={signal:c.signal,options:Q,context:ce},k=(Se,Te=!1)=>{let{aborted:ke}=c.signal,De=Q.ignoreFetchAbort&&Se!==void 0;if(Q.status&&(ke&&!Te?(Q.status.fetchAborted=!0,Q.status.fetchError=c.signal.reason,De&&(Q.status.fetchAbortIgnored=!0)):Q.status.fetchResolved=!0),ke&&!De&&!Te)return ee(c.signal.reason);let ze=Be;return R(this,W)[N]===Be&&(Se===void 0?ze.__staleWhileFetching?R(this,W)[N]=ze.__staleWhileFetching:this.delete(O):(Q.status&&(Q.status.fetchUpdated=!0),this.set(O,Se,y.options))),Se},K=Se=>(Q.status&&(Q.status.fetchRejected=!0,Q.status.fetchError=Se),ee(Se)),ee=Se=>{let{aborted:Te}=c.signal,ke=Te&&Q.allowStaleOnFetchAbort,De=ke||Q.allowStaleOnFetchRejection,ze=De||Q.noDeleteOnFetchRejection,Qe=Be;if(R(this,W)[N]===Be&&(!ze||Qe.__staleWhileFetching===void 0?this.delete(O):ke||(R(this,W)[N]=Qe.__staleWhileFetching)),De)return Q.status&&Qe.__staleWhileFetching!==void 0&&(Q.status.returnedStale=!0),Qe.__staleWhileFetching;if(Qe.__returned===Qe)throw Se},Ie=(Se,Te)=>{var De;let ke=(De=R(this,L))==null?void 0:De.call(this,O,h,y);ke&&ke instanceof Promise&&ke.then(ze=>Se(ze===void 0?void 0:ze),Te),c.signal.addEventListener("abort",()=>{(!Q.ignoreFetchAbort||Q.allowStaleOnFetchAbort)&&(Se(void 0),Q.allowStaleOnFetchAbort&&(Se=ze=>k(ze,!0)))})};Q.status&&(Q.status.fetchDispatched=!0);let Be=new Promise(Ie).then(k,K),Oe=Object.assign(Be,{__abortController:c,__staleWhileFetching:h,__returned:void 0});return N===void 0?(this.set(O,Oe,{...y.options,status:void 0}),N=R(this,T).get(O)):R(this,W)[N]=Oe,Oe},Fe=function(O){if(!R(this,oe))return!1;let N=O;return!!N&&N instanceof Promise&&N.hasOwnProperty("__staleWhileFetching")&&N.__abortController instanceof i},qi=function(O,N){R(this,ne)[N]=O,R(this,J)[O]=N},gr=function(O){O!==R(this,q)&&(O===R(this,C)?Ce(this,C,R(this,J)[O]):Ee(this,w,qi).call(this,R(this,ne)[O],R(this,J)[O]),Ee(this,w,qi).call(this,R(this,q),O),Ce(this,q,O))},D);e.LRUCache=g}),Ct=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"t",{value:!0}),e.ContainerIterator=e.Container=e.Base=void 0;var n=class{constructor(u=0){this.iteratorType=u}equals(u){return this.o===u.o}};e.ContainerIterator=n;var t=class{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return this.i===0}};e.Base=t;var a=class extends t{};e.Container=a}),sc=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var n=Ct(),t=class extends n.Base{constructor(u=[]){super(),this.S=[];let i=this;u.forEach(function(r){i.push(r)})}clear(){this.i=0,this.S=[]}push(u){return this.S.push(u),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=t;e.default=a}),ac=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var n=Ct(),t=class extends n.Base{constructor(u=[]){super(),this.j=0,this.q=[];let i=this;u.forEach(function(r){i.push(r)})}clear(){this.q=[],this.i=this.j=0}push(u){let i=this.q.length;if(this.j/i>.5&&this.j+this.i>=i&&i>4096){let r=this.i;for(let s=0;s<r;++s)this.q[s]=this.q[this.j+s];this.j=0,this.q[this.i]=u}else this.q[this.j+this.i]=u;return++this.i}pop(){if(this.i===0)return;let u=this.q[this.j++];return this.i-=1,u}front(){if(this.i!==0)return this.q[this.j]}},a=t;e.default=a}),lc=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var n=Ct(),t=class extends n.Base{constructor(u=[],i=function(s,o){return s>o?-1:s<o?1:0},r=!0){if(super(),this.v=i,Array.isArray(u))this.C=r?[...u]:u;else{this.C=[];let o=this;u.forEach(function(l){o.C.push(l)})}this.i=this.C.length;let s=this.i>>1;for(let o=this.i-1>>1;o>=0;--o)this.k(o,s)}m(u){let i=this.C[u];for(;u>0;){let r=u-1>>1,s=this.C[r];if(this.v(s,i)<=0)break;this.C[u]=s,u=r}this.C[u]=i}k(u,i){let r=this.C[u];for(;u<i;){let s=u<<1|1,o=s+1,l=this.C[s];if(o<this.i&&this.v(l,this.C[o])>0&&(s=o,l=this.C[o]),this.v(l,r)>=0)break;this.C[u]=l,u=s}this.C[u]=r}clear(){this.i=0,this.C.length=0}push(u){this.C.push(u),this.m(this.i),this.i+=1}pop(){if(this.i===0)return;let u=this.C[0],i=this.C.pop();return this.i-=1,this.i&&(this.C[0]=i,this.k(0,this.i>>1)),u}top(){return this.C[0]}find(u){return this.C.indexOf(u)>=0}remove(u){let i=this.C.indexOf(u);return i<0?!1:(i===0?this.pop():i===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(i,1,this.C.pop()),this.i-=1,this.m(i),this.k(i,this.i>>1)),!0)}updateItem(u){let i=this.C.indexOf(u);return i<0?!1:(this.m(i),this.k(i,this.i>>1),!0)}toArray(){return[...this.C]}},a=t;e.default=a}),Si=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var n=Ct(),t=class extends n.Container{},a=t;e.default=a}),It=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"t",{value:!0}),e.throwIteratorAccessError=n;function n(){throw new RangeError("Iterator access denied!")}}),Os=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"t",{value:!0}),e.RandomIterator=void 0;var n=Ct(),t=It(),a=class extends n.ContainerIterator{constructor(u,i){super(i),this.o=u,this.iteratorType===0?(this.pre=function(){return this.o===0&&(0,t.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,t.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,t.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return this.o===-1&&(0,t.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(u){this.container.setElementByPos(this.o,u)}};e.RandomIterator=a}),uc=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var n=a(Si()),t=Os();function a(s){return s&&s.t?s:{default:s}}var u=class za extends t.RandomIterator{constructor(o,l,f){super(o,f),this.container=l}copy(){return new za(this.o,this.container,this.iteratorType)}},i=class extends n.default{constructor(s=[],o=!0){if(super(),Array.isArray(s))this.J=o?[...s]:s,this.i=s.length;else{this.J=[];let l=this;s.forEach(function(f){l.pushBack(f)})}}clear(){this.i=0,this.J.length=0}begin(){return new u(0,this)}end(){return new u(this.i,this)}rBegin(){return new u(this.i-1,this,1)}rEnd(){return new u(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(s){if(s<0||s>this.i-1)throw new RangeError;return this.J[s]}eraseElementByPos(s){if(s<0||s>this.i-1)throw new RangeError;return this.J.splice(s,1),this.i-=1,this.i}eraseElementByValue(s){let o=0;for(let l=0;l<this.i;++l)this.J[l]!==s&&(this.J[o++]=this.J[l]);return this.i=this.J.length=o,this.i}eraseElementByIterator(s){let o=s.o;return s=s.next(),this.eraseElementByPos(o),s}pushBack(s){return this.J.push(s),this.i+=1,this.i}popBack(){if(this.i!==0)return this.i-=1,this.J.pop()}setElementByPos(s,o){if(s<0||s>this.i-1)throw new RangeError;this.J[s]=o}insert(s,o,l=1){if(s<0||s>this.i)throw new RangeError;return this.J.splice(s,0,...new Array(l).fill(o)),this.i+=l,this.i}find(s){for(let o=0;o<this.i;++o)if(this.J[o]===s)return new u(o,this);return this.end()}reverse(){this.J.reverse()}unique(){let s=1;for(let o=1;o<this.i;++o)this.J[o]!==this.J[o-1]&&(this.J[s++]=this.J[o]);return this.i=this.J.length=s,this.i}sort(s){this.J.sort(s)}forEach(s){for(let o=0;o<this.i;++o)s(this.J[o],o,this)}[Symbol.iterator](){return(function*(){yield*this.J}).bind(this)()}},r=i;e.default=r}),cc=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var n=u(Si()),t=Ct(),a=It();function u(o){return o&&o.t?o:{default:o}}var i=class Ya extends t.ContainerIterator{constructor(l,f,p,g){super(g),this.o=l,this.h=f,this.container=p,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(l){this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o.l=l}copy(){return new Ya(this.o,this.h,this.container,this.iteratorType)}},r=class extends n.default{constructor(o=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;let l=this;o.forEach(function(f){l.pushBack(f)})}V(o){let{L:l,B:f}=o;l.B=f,f.L=l,o===this.p&&(this.p=f),o===this._&&(this._=l),this.i-=1}G(o,l){let f=l.B,p={l:o,L:l,B:f};l.B=p,f.L=p,l===this.h&&(this.p=p),f===this.h&&(this._=p),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}begin(){return new i(this.p,this.h,this)}end(){return new i(this.h,this.h,this)}rBegin(){return new i(this._,this.h,this,1)}rEnd(){return new i(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(o){if(o<0||o>this.i-1)throw new RangeError;let l=this.p;for(;o--;)l=l.B;return l.l}eraseElementByPos(o){if(o<0||o>this.i-1)throw new RangeError;let l=this.p;for(;o--;)l=l.B;return this.V(l),this.i}eraseElementByValue(o){let l=this.p;for(;l!==this.h;)l.l===o&&this.V(l),l=l.B;return this.i}eraseElementByIterator(o){let l=o.o;return l===this.h&&(0,a.throwIteratorAccessError)(),o=o.next(),this.V(l),o}pushBack(o){return this.G(o,this._),this.i}popBack(){if(this.i===0)return;let o=this._.l;return this.V(this._),o}pushFront(o){return this.G(o,this.h),this.i}popFront(){if(this.i===0)return;let o=this.p.l;return this.V(this.p),o}setElementByPos(o,l){if(o<0||o>this.i-1)throw new RangeError;let f=this.p;for(;o--;)f=f.B;f.l=l}insert(o,l,f=1){if(o<0||o>this.i)throw new RangeError;if(f<=0)return this.i;if(o===0)for(;f--;)this.pushFront(l);else if(o===this.i)for(;f--;)this.pushBack(l);else{let p=this.p;for(let m=1;m<o;++m)p=p.B;let g=p.B;for(this.i+=f;f--;)p.B={l,L:p},p.B.L=p,p=p.B;p.B=g,g.L=p}return this.i}find(o){let l=this.p;for(;l!==this.h;){if(l.l===o)return new i(l,this.h,this);l=l.B}return this.end()}reverse(){if(this.i<=1)return;let o=this.p,l=this._,f=0;for(;f<<1<this.i;){let p=o.l;o.l=l.l,l.l=p,o=o.B,l=l.L,f+=1}}unique(){if(this.i<=1)return this.i;let o=this.p;for(;o!==this.h;){let l=o;for(;l.B!==this.h&&l.l===l.B.l;)l=l.B,this.i-=1;o.B=l.B,o.B.L=o,o=o.B}return this.i}sort(o){if(this.i<=1)return;let l=[];this.forEach(function(p){l.push(p)}),l.sort(o);let f=this.p;l.forEach(function(p){f.l=p,f=f.B})}merge(o){let l=this;if(this.i===0)o.forEach(function(f){l.pushBack(f)});else{let f=this.p;o.forEach(function(p){for(;f!==l.h&&f.l<=p;)f=f.B;l.G(p,f.L)})}return this.i}forEach(o){let l=this.p,f=0;for(;l!==this.h;)o(l.l,f++,this),l=l.B}[Symbol.iterator](){return(function*(){if(this.i===0)return;let o=this.p;for(;o!==this.h;)yield o.l,o=o.B}).bind(this)()}},s=r;e.default=s}),hc=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var n=a(Si()),t=Os();function a(s){return s&&s.t?s:{default:s}}var u=class Ga extends t.RandomIterator{constructor(o,l,f){super(o,f),this.container=l}copy(){return new Ga(this.o,this.container,this.iteratorType)}},i=class extends n.default{constructor(s=[],o=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];let l=(()=>{if(typeof s.length=="number")return s.length;if(typeof s.size=="number")return s.size;if(typeof s.size=="function")return s.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=o,this.P=Math.max(Math.ceil(l/this.F),1);for(let g=0;g<this.P;++g)this.A.push(new Array(this.F));let f=Math.ceil(l/this.F);this.j=this.R=(this.P>>1)-(f>>1),this.D=this.N=this.F-l%this.F>>1;let p=this;s.forEach(function(g){p.pushBack(g)})}T(){let s=[],o=Math.max(this.P>>1,1);for(let l=0;l<o;++l)s[l]=new Array(this.F);for(let l=this.j;l<this.P;++l)s[s.length]=this.A[l];for(let l=0;l<this.R;++l)s[s.length]=this.A[l];s[s.length]=[...this.A[this.R]],this.j=o,this.R=s.length-1;for(let l=0;l<o;++l)s[s.length]=new Array(this.F);this.A=s,this.P=s.length}O(s){let o=this.D+s+1,l=o%this.F,f=l-1,p=this.j+(o-l)/this.F;return l===0&&(p-=1),p%=this.P,f<0&&(f+=this.F),{curNodeBucketIndex:p,curNodePointerIndex:f}}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 u(0,this)}end(){return new u(this.i,this)}rBegin(){return new u(this.i-1,this,1)}rEnd(){return new u(-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(s){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]=s,this.i}popBack(){if(this.i===0)return;let s=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,s}pushFront(s){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]=s,this.i}popFront(){if(this.i===0)return;let s=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,s}getElementByPos(s){if(s<0||s>this.i-1)throw new RangeError;let{curNodeBucketIndex:o,curNodePointerIndex:l}=this.O(s);return this.A[o][l]}setElementByPos(s,o){if(s<0||s>this.i-1)throw new RangeError;let{curNodeBucketIndex:l,curNodePointerIndex:f}=this.O(s);this.A[l][f]=o}insert(s,o,l=1){if(s<0||s>this.i)throw new RangeError;if(s===0)for(;l--;)this.pushFront(o);else if(s===this.i)for(;l--;)this.pushBack(o);else{let f=[];for(let p=s;p<this.i;++p)f.push(this.getElementByPos(p));this.cut(s-1);for(let p=0;p<l;++p)this.pushBack(o);for(let p=0;p<f.length;++p)this.pushBack(f[p])}return this.i}cut(s){if(s<0)return this.clear(),0;let{curNodeBucketIndex:o,curNodePointerIndex:l}=this.O(s);return this.R=o,this.N=l,this.i=s+1,this.i}eraseElementByPos(s){if(s<0||s>this.i-1)throw new RangeError;if(s===0)this.popFront();else if(s===this.i-1)this.popBack();else{let o=[];for(let f=s+1;f<this.i;++f)o.push(this.getElementByPos(f));this.cut(s),this.popBack();let l=this;o.forEach(function(f){l.pushBack(f)})}return this.i}eraseElementByValue(s){if(this.i===0)return 0;let o=[];for(let f=0;f<this.i;++f){let p=this.getElementByPos(f);p!==s&&o.push(p)}let l=o.length;for(let f=0;f<l;++f)this.setElementByPos(f,o[f]);return this.cut(l-1)}eraseElementByIterator(s){let o=s.o;return this.eraseElementByPos(o),s=s.next(),s}find(s){for(let o=0;o<this.i;++o)if(this.getElementByPos(o)===s)return new u(o,this);return this.end()}reverse(){let s=0,o=this.i-1;for(;s<o;){let l=this.getElementByPos(s);this.setElementByPos(s,this.getElementByPos(o)),this.setElementByPos(o,l),s+=1,o-=1}}unique(){if(this.i<=1)return this.i;let s=1,o=this.getElementByPos(0);for(let l=1;l<this.i;++l){let f=this.getElementByPos(l);f!==o&&(o=f,this.setElementByPos(s++,f))}for(;this.i>s;)this.popBack();return this.i}sort(s){let o=[];for(let l=0;l<this.i;++l)o.push(this.getElementByPos(l));o.sort(s);for(let l=0;l<this.i;++l)this.setElementByPos(l,o[l])}shrinkToFit(){if(this.i===0)return;let s=[];this.forEach(function(o){s.push(o)}),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 o=0;o<this.P;++o)this.A.push(new Array(this.F));for(let o=0;o<s.length;++o)this.pushBack(s[o])}forEach(s){for(let o=0;o<this.i;++o)s(this.getElementByPos(o),o,this)}[Symbol.iterator](){return(function*(){for(let s=0;s<this.i;++s)yield this.getElementByPos(s)}).bind(this)()}},r=i;e.default=r}),fc=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"t",{value:!0}),e.TreeNodeEnableIndex=e.TreeNode=void 0;var n=class{constructor(a,u){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=u}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 u=a.tt;for(;u.U===a;)a=u,u=a.tt;a=u}return a}B(){let a=this;if(a.W){for(a=a.W;a.U;)a=a.U;return a}else{let u=a.tt;for(;u.W===a;)a=u,u=a.tt;return a.W!==u?u:a}}te(){let a=this.tt,u=this.W,i=u.U;return a.tt===this?a.tt=u:a.U===this?a.U=u:a.W=u,u.tt=a,u.U=this,this.tt=u,this.W=i,i&&(i.tt=this),u}se(){let a=this.tt,u=this.U,i=u.W;return a.tt===this?a.tt=u:a.U===this?a.U=u:a.W=u,u.tt=a,u.W=this,this.tt=u,this.U=i,i&&(i.tt=this),u}};e.TreeNode=n;var t=class extends n{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)}};e.TreeNodeEnableIndex=t}),Ps=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var n=fc(),t=Ct(),a=It(),u=class extends t.Container{constructor(r=function(o,l){return o<l?-1:o>l?1:0},s=!1){super(),this.Y=void 0,this.v=r,s?(this.re=n.TreeNodeEnableIndex,this.M=function(o,l,f){let p=this.ne(o,l,f);if(p){let g=p.tt;for(;g!==this.h;)g.rt+=1,g=g.tt;let m=this.he(p);if(m){let{parentNode:A,grandParent:b,curNode:_}=m;A.ie(),b.ie(),_.ie()}}return this.i},this.V=function(o){let l=this.fe(o);for(;l!==this.h;)l.rt-=1,l=l.tt}):(this.re=n.TreeNode,this.M=function(o,l,f){let p=this.ne(o,l,f);return p&&this.he(p),this.i},this.V=this.fe),this.h=new this.re}X(r,s){let o=this.h;for(;r;){let l=this.v(r.u,s);if(l<0)r=r.W;else if(l>0)o=r,r=r.U;else return r}return o}Z(r,s){let o=this.h;for(;r;)this.v(r.u,s)<=0?r=r.W:(o=r,r=r.U);return o}$(r,s){let o=this.h;for(;r;){let l=this.v(r.u,s);if(l<0)o=r,r=r.W;else if(l>0)r=r.U;else return r}return o}rr(r,s){let o=this.h;for(;r;)this.v(r.u,s)<0?(o=r,r=r.W):r=r.U;return o}ue(r){for(;;){let s=r.tt;if(s===this.h)return;if(r.ee===1){r.ee=0;return}if(r===s.U){let o=s.W;if(o.ee===1)o.ee=0,s.ee=1,s===this.Y?this.Y=s.te():s.te();else if(o.W&&o.W.ee===1){o.ee=s.ee,s.ee=0,o.W.ee=0,s===this.Y?this.Y=s.te():s.te();return}else o.U&&o.U.ee===1?(o.ee=1,o.U.ee=0,o.se()):(o.ee=1,r=s)}else{let o=s.U;if(o.ee===1)o.ee=0,s.ee=1,s===this.Y?this.Y=s.se():s.se();else if(o.U&&o.U.ee===1){o.ee=s.ee,s.ee=0,o.U.ee=0,s===this.Y?this.Y=s.se():s.se();return}else o.W&&o.W.ee===1?(o.ee=1,o.W.ee=0,o.te()):(o.ee=1,r=s)}}}fe(r){if(this.i===1)return this.clear(),this.h;let s=r;for(;s.U||s.W;){if(s.W)for(s=s.W;s.U;)s=s.U;else s=s.U;[r.u,s.u]=[s.u,r.u],[r.l,s.l]=[s.l,r.l],r=s}this.h.U===s?this.h.U=s.tt:this.h.W===s&&(this.h.W=s.tt),this.ue(s);let o=s.tt;return s===o.U?o.U=void 0:o.W=void 0,this.i-=1,this.Y.ee=0,o}oe(r,s){return r===void 0?!1:this.oe(r.U,s)||s(r)?!0:this.oe(r.W,s)}he(r){for(;;){let s=r.tt;if(s.ee===0)return;let o=s.tt;if(s===o.U){let l=o.W;if(l&&l.ee===1){if(l.ee=s.ee=0,o===this.Y)return;o.ee=1,r=o;continue}else if(r===s.W){if(r.ee=0,r.U&&(r.U.tt=s),r.W&&(r.W.tt=o),s.W=r.U,o.U=r.W,r.U=s,r.W=o,o===this.Y)this.Y=r,this.h.tt=r;else{let f=o.tt;f.U===o?f.U=r:f.W=r}return r.tt=o.tt,s.tt=r,o.tt=r,o.ee=1,{parentNode:s,grandParent:o,curNode:r}}else s.ee=0,o===this.Y?this.Y=o.se():o.se(),o.ee=1}else{let l=o.U;if(l&&l.ee===1){if(l.ee=s.ee=0,o===this.Y)return;o.ee=1,r=o;continue}else if(r===s.U){if(r.ee=0,r.U&&(r.U.tt=o),r.W&&(r.W.tt=s),o.W=r.U,s.U=r.W,r.U=o,r.W=s,o===this.Y)this.Y=r,this.h.tt=r;else{let f=o.tt;f.U===o?f.U=r:f.W=r}return r.tt=o.tt,s.tt=r,o.tt=r,o.ee=1,{parentNode:s,grandParent:o,curNode:r}}else s.ee=0,o===this.Y?this.Y=o.te():o.te(),o.ee=1}return}}ne(r,s,o){if(this.Y===void 0){this.i+=1,this.Y=new this.re(r,s),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 l,f=this.h.U,p=this.v(f.u,r);if(p===0){f.l=s;return}else if(p>0)f.U=new this.re(r,s),f.U.tt=f,l=f.U,this.h.U=l;else{let g=this.h.W,m=this.v(g.u,r);if(m===0){g.l=s;return}else if(m<0)g.W=new this.re(r,s),g.W.tt=g,l=g.W,this.h.W=l;else{if(o!==void 0){let A=o.o;if(A!==this.h){let b=this.v(A.u,r);if(b===0){A.l=s;return}else if(b>0){let _=A.L(),x=this.v(_.u,r);if(x===0){_.l=s;return}else x<0&&(l=new this.re(r,s),_.W===void 0?(_.W=l,l.tt=_):(A.U=l,l.tt=A))}}}if(l===void 0)for(l=this.Y;;){let A=this.v(l.u,r);if(A>0){if(l.U===void 0){l.U=new this.re(r,s),l.U.tt=l,l=l.U;break}l=l.U}else if(A<0){if(l.W===void 0){l.W=new this.re(r,s),l.W.tt=l,l=l.W;break}l=l.W}else{l.l=s;return}}}}return this.i+=1,l}I(r,s){for(;r;){let o=this.v(r.u,s);if(o<0)r=r.W;else if(o>0)r=r.U;else return r}return r||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(r,s){let o=r.o;if(o===this.h&&(0,a.throwIteratorAccessError)(),this.i===1)return o.u=s,!0;if(o===this.h.U)return this.v(o.B().u,s)>0?(o.u=s,!0):!1;if(o===this.h.W)return this.v(o.L().u,s)<0?(o.u=s,!0):!1;let l=o.L().u;if(this.v(l,s)>=0)return!1;let f=o.B().u;return this.v(f,s)<=0?!1:(o.u=s,!0)}eraseElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let s=0,o=this;return this.oe(this.Y,function(l){return r===s?(o.V(l),!0):(s+=1,!1)}),this.i}eraseElementByKey(r){if(this.i===0)return!1;let s=this.I(this.Y,r);return s===this.h?!1:(this.V(s),!0)}eraseElementByIterator(r){let s=r.o;s===this.h&&(0,a.throwIteratorAccessError)();let o=s.W===void 0;return r.iteratorType===0?o&&r.next():(!o||s.U===void 0)&&r.next(),this.V(s),r}forEach(r){let s=0;for(let o of this)r(o,s++,this)}getElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let s,o=0;for(let l of this){if(o===r){s=l;break}o+=1}return s}getHeight(){if(this.i===0)return 0;let r=function(s){return s?Math.max(r(s.U),r(s.W))+1:0};return r(this.Y)}},i=u;e.default=i}),xs=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var n=Ct(),t=It(),a=class extends n.ContainerIterator{constructor(i,r,s){super(s),this.o=i,this.h=r,this.iteratorType===0?(this.pre=function(){return this.o===this.h.U&&(0,t.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,t.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,t.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,t.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let i=this.o,r=this.h.tt;if(i===this.h)return r?r.rt-1:0;let s=0;for(i.U&&(s+=i.U.rt);i!==r;){let o=i.tt;i===o.W&&(s+=1,o.U&&(s+=o.U.rt)),i=o}return s}},u=a;e.default=u}),dc=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var n=u(Ps()),t=u(xs()),a=It();function u(o){return o&&o.t?o:{default:o}}var i=class Ja extends t.default{constructor(l,f,p,g){super(l,f,g),this.container=p}get pointer(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o.u}copy(){return new Ja(this.o,this.h,this.container,this.iteratorType)}},r=class extends n.default{constructor(o=[],l,f){super(l,f);let p=this;o.forEach(function(g){p.insert(g)})}*K(o){o!==void 0&&(yield*this.K(o.U),yield o.u,yield*this.K(o.W))}begin(){return new i(this.h.U||this.h,this.h,this)}end(){return new i(this.h,this.h,this)}rBegin(){return new i(this.h.W||this.h,this.h,this,1)}rEnd(){return new i(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(o,l){return this.M(o,void 0,l)}find(o){let l=this.I(this.Y,o);return new i(l,this.h,this)}lowerBound(o){let l=this.X(this.Y,o);return new i(l,this.h,this)}upperBound(o){let l=this.Z(this.Y,o);return new i(l,this.h,this)}reverseLowerBound(o){let l=this.$(this.Y,o);return new i(l,this.h,this)}reverseUpperBound(o){let l=this.rr(this.Y,o);return new i(l,this.h,this)}union(o){let l=this;return o.forEach(function(f){l.insert(f)}),this.i}[Symbol.iterator](){return this.K(this.Y)}},s=r;e.default=s}),pc=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var n=u(Ps()),t=u(xs()),a=It();function u(o){return o&&o.t?o:{default:o}}var i=class Za extends t.default{constructor(l,f,p,g){super(l,f,g),this.container=p}get pointer(){this.o===this.h&&(0,a.throwIteratorAccessError)();let l=this;return new Proxy([],{get(f,p){if(p==="0")return l.o.u;if(p==="1")return l.o.l},set(f,p,g){if(p!=="1")throw new TypeError("props must be 1");return l.o.l=g,!0}})}copy(){return new Za(this.o,this.h,this.container,this.iteratorType)}},r=class extends n.default{constructor(o=[],l,f){super(l,f);let p=this;o.forEach(function(g){p.setElement(g[0],g[1])})}*K(o){o!==void 0&&(yield*this.K(o.U),yield[o.u,o.l],yield*this.K(o.W))}begin(){return new i(this.h.U||this.h,this.h,this)}end(){return new i(this.h,this.h,this)}rBegin(){return new i(this.h.W||this.h,this.h,this,1)}rEnd(){return new i(this.h,this.h,this,1)}front(){if(this.i===0)return;let o=this.h.U;return[o.u,o.l]}back(){if(this.i===0)return;let o=this.h.W;return[o.u,o.l]}lowerBound(o){let l=this.X(this.Y,o);return new i(l,this.h,this)}upperBound(o){let l=this.Z(this.Y,o);return new i(l,this.h,this)}reverseLowerBound(o){let l=this.$(this.Y,o);return new i(l,this.h,this)}reverseUpperBound(o){let l=this.rr(this.Y,o);return new i(l,this.h,this)}setElement(o,l,f){return this.M(o,l,f)}find(o){let l=this.I(this.Y,o);return new i(l,this.h,this)}getElementByKey(o){return this.I(this.Y,o).l}union(o){let l=this;return o.forEach(function(f){l.setElement(f[0],f[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}},s=r;e.default=s}),Rs=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=n;function n(t){let a=typeof t;return a==="object"&&t!==null||a==="function"}}),Ms=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"t",{value:!0}),e.HashContainerIterator=e.HashContainer=void 0;var n=Ct(),t=u(Rs()),a=It();function u(s){return s&&s.t?s:{default:s}}var i=class extends n.ContainerIterator{constructor(s,o,l){super(l),this.o=s,this.h=o,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})}};e.HashContainerIterator=i;var r=class extends n.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(s){let{L:o,B:l}=s;o.B=l,l.L=o,s===this.p&&(this.p=l),s===this._&&(this._=o),this.i-=1}M(s,o,l){l===void 0&&(l=(0,t.default)(s));let f;if(l){let p=s[this.HASH_TAG];if(p!==void 0)return this.H[p].l=o,this.i;Object.defineProperty(s,this.HASH_TAG,{value:this.H.length,configurable:!0}),f={u:s,l:o,L:this._,B:this.h},this.H.push(f)}else{let p=this.g[s];if(p)return p.l=o,this.i;f={u:s,l:o,L:this._,B:this.h},this.g[s]=f}return this.i===0?(this.p=f,this.h.B=f):this._.B=f,this._=f,this.h.L=f,++this.i}I(s,o){if(o===void 0&&(o=(0,t.default)(s)),o){let l=s[this.HASH_TAG];return l===void 0?this.h:this.H[l]}else return this.g[s]||this.h}clear(){let s=this.HASH_TAG;this.H.forEach(function(o){delete o.u[s]}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(s,o){let l;if(o===void 0&&(o=(0,t.default)(s)),o){let f=s[this.HASH_TAG];if(f===void 0)return!1;delete s[this.HASH_TAG],l=this.H[f],delete this.H[f]}else{if(l=this.g[s],l===void 0)return!1;delete this.g[s]}return this.V(l),!0}eraseElementByIterator(s){let o=s.o;return o===this.h&&(0,a.throwIteratorAccessError)(),this.V(o),s.next()}eraseElementByPos(s){if(s<0||s>this.i-1)throw new RangeError;let o=this.p;for(;s--;)o=o.B;return this.V(o),this.i}};e.HashContainer=r}),gc=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var n=Ms(),t=It(),a=class Xa extends n.HashContainerIterator{constructor(s,o,l,f){super(s,o,f),this.container=l}get pointer(){return this.o===this.h&&(0,t.throwIteratorAccessError)(),this.o.u}copy(){return new Xa(this.o,this.h,this.container,this.iteratorType)}},u=class extends n.HashContainer{constructor(r=[]){super();let s=this;r.forEach(function(o){s.insert(o)})}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(r,s){return this.M(r,void 0,s)}getElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let s=this.p;for(;r--;)s=s.B;return s.u}find(r,s){let o=this.I(r,s);return new a(o,this.h,this)}forEach(r){let s=0,o=this.p;for(;o!==this.h;)r(o.u,s++,this),o=o.B}[Symbol.iterator](){return(function*(){let r=this.p;for(;r!==this.h;)yield r.u,r=r.B}).bind(this)()}},i=u;e.default=i}),mc=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var n=Ms(),t=u(Rs()),a=It();function u(o){return o&&o.t?o:{default:o}}var i=class el extends n.HashContainerIterator{constructor(l,f,p,g){super(l,f,g),this.container=p}get pointer(){this.o===this.h&&(0,a.throwIteratorAccessError)();let l=this;return new Proxy([],{get(f,p){if(p==="0")return l.o.u;if(p==="1")return l.o.l},set(f,p,g){if(p!=="1")throw new TypeError("props must be 1");return l.o.l=g,!0}})}copy(){return new el(this.o,this.h,this.container,this.iteratorType)}},r=class extends n.HashContainer{constructor(o=[]){super();let l=this;o.forEach(function(f){l.setElement(f[0],f[1])})}begin(){return new i(this.p,this.h,this)}end(){return new i(this.h,this.h,this)}rBegin(){return new i(this._,this.h,this,1)}rEnd(){return new i(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(o,l,f){return this.M(o,l,f)}getElementByKey(o,l){if(l===void 0&&(l=(0,t.default)(o)),l){let p=o[this.HASH_TAG];return p!==void 0?this.H[p].l:void 0}let f=this.g[o];return f?f.l:void 0}getElementByPos(o){if(o<0||o>this.i-1)throw new RangeError;let l=this.p;for(;o--;)l=l.B;return[l.u,l.l]}find(o,l){let f=this.I(o,l);return new i(f,this.h,this)}forEach(o){let l=0,f=this.p;for(;f!==this.h;)o([f.u,f.l],l++,this),f=f.B}[Symbol.iterator](){return(function*(){let o=this.p;for(;o!==this.h;)yield[o.u,o.l],o=o.B}).bind(this)()}},s=r;e.default=s}),Ac=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"t",{value:!0}),Object.defineProperty(e,"Deque",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"HashMap",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"HashSet",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"LinkList",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"OrderedMap",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"OrderedSet",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"PriorityQueue",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"Queue",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"Stack",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"Vector",{enumerable:!0,get:function(){return u.default}});var n=p(sc()),t=p(ac()),a=p(lc()),u=p(uc()),i=p(cc()),r=p(hc()),s=p(dc()),o=p(pc()),l=p(gc()),f=p(mc());function p(g){return g&&g.t?g:{default:g}}}),bc=Ae((e,n)=>{ae(),ue(),le();var t=Ac().OrderedSet,a=St()("number-allocator:trace"),u=St()("number-allocator:error");function i(s,o){this.low=s,this.high=o}i.prototype.equals=function(s){return this.low===s.low&&this.high===s.high},i.prototype.compare=function(s){return this.low<s.low&&this.high<s.low?-1:s.low<this.low&&s.high<this.low?1:0};function r(s,o){if(!(this instanceof r))return new r(s,o);this.min=s,this.max=o,this.ss=new t([],(l,f)=>l.compare(f)),a("Create"),this.clear()}r.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},r.prototype.alloc=function(){if(this.ss.size()===0)return a("alloc():empty"),null;let s=this.ss.begin(),o=s.pointer.low,l=s.pointer.high,f=o;return f+1<=l?this.ss.updateKeyByIterator(s,new i(o+1,l)):this.ss.eraseElementByPos(0),a("alloc():"+f),f},r.prototype.use=function(s){let o=new i(s,s),l=this.ss.lowerBound(o);if(!l.equals(this.ss.end())){let f=l.pointer.low,p=l.pointer.high;return l.pointer.equals(o)?(this.ss.eraseElementByIterator(l),a("use():"+s),!0):f>s?!1:f===s?(this.ss.updateKeyByIterator(l,new i(f+1,p)),a("use():"+s),!0):p===s?(this.ss.updateKeyByIterator(l,new i(f,p-1)),a("use():"+s),!0):(this.ss.updateKeyByIterator(l,new i(s+1,p)),this.ss.insert(new i(f,s-1)),a("use():"+s),!0)}return a("use():failed"),!1},r.prototype.free=function(s){if(s<this.min||s>this.max){u("free():"+s+" is out of range");return}let o=new i(s,s),l=this.ss.upperBound(o);if(l.equals(this.ss.end())){if(l.equals(this.ss.begin())){this.ss.insert(o);return}l.pre();let f=l.pointer.high;l.pointer.high+1===s?this.ss.updateKeyByIterator(l,new i(f,s)):this.ss.insert(o)}else if(l.equals(this.ss.begin()))if(s+1===l.pointer.low){let f=l.pointer.high;this.ss.updateKeyByIterator(l,new i(s,f))}else this.ss.insert(o);else{let f=l.pointer.low,p=l.pointer.high;l.pre();let g=l.pointer.low;l.pointer.high+1===s?s+1===f?(this.ss.eraseElementByIterator(l),this.ss.updateKeyByIterator(l,new i(g,p))):this.ss.updateKeyByIterator(l,new i(g,s)):s+1===f?(this.ss.eraseElementByIterator(l.next()),this.ss.insert(new i(s,p))):this.ss.insert(o)}a("free():"+s)},r.prototype.clear=function(){a("clear()"),this.ss.clear(),this.ss.insert(new i(this.min,this.max))},r.prototype.intervalCount=function(){return this.ss.size()},r.prototype.dump=function(){console.log("length:"+this.ss.size());for(let s of this.ss)console.log(s)},n.exports=r}),Us=Ae((e,n)=>{ae(),ue(),le();var t=bc();n.exports.NumberAllocator=t}),yc=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"__esModule",{value:!0});var n=oc(),t=Us(),a=class{constructor(u){u>0&&(this.aliasToTopic=new n.LRUCache({max:u}),this.topicToAlias={},this.numberAllocator=new t.NumberAllocator(1,u),this.max=u,this.length=0)}put(u,i){if(i===0||i>this.max)return!1;let r=this.aliasToTopic.get(i);return r&&delete this.topicToAlias[r],this.aliasToTopic.set(i,u),this.topicToAlias[u]=i,this.numberAllocator.use(i),this.length=this.aliasToTopic.size,!0}getTopicByAlias(u){return this.aliasToTopic.get(u)}getAliasByTopic(u){let i=this.topicToAlias[u];return typeof i<"u"&&this.aliasToTopic.get(i),i}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){return this.numberAllocator.firstVacant()||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}};e.default=a}),wc=Ae(e=>{ae(),ue(),le();var n=e&&e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0});var t=Br(),a=n(yc()),u=ir(),i=(r,s)=>{r.log("_handleConnack");let{options:o}=r,l=o.protocolVersion===5?s.reasonCode:s.returnCode;if(clearTimeout(r.connackTimer),delete r.topicAliasSend,s.properties){if(s.properties.topicAliasMaximum){if(s.properties.topicAliasMaximum>65535){r.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}s.properties.topicAliasMaximum>0&&(r.topicAliasSend=new a.default(s.properties.topicAliasMaximum))}s.properties.serverKeepAlive&&o.keepalive&&(o.keepalive=s.properties.serverKeepAlive),s.properties.maximumPacketSize&&(o.properties||(o.properties={}),o.properties.maximumPacketSize=s.properties.maximumPacketSize)}if(l===0)r.reconnecting=!1,r._onConnect(s);else if(l>0){let f=new u.ErrorWithReasonCode(`Connection refused: ${t.ReasonCodes[l]}`,l);r.emit("error",f),r.options.reconnectOnConnackError&&r._cleanUp(!0)}};e.default=i}),vc=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"__esModule",{value:!0});var n=(t,a,u)=>{t.log("handling pubrel packet");let i=typeof u<"u"?u:t.noop,{messageId:r}=a,s={cmd:"pubcomp",messageId:r};t.incomingStore.get(a,(o,l)=>{o?t._sendPacket(s,i):(t.emit("message",l.topic,l.payload,l),t.handleMessage(l,f=>{if(f)return i(f);t.incomingStore.del(l,t.noop),t._sendPacket(s,i)}))})};e.default=n}),_c=Ae(e=>{ae(),ue(),le();var n=e&&e.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0});var t=n(rc()),a=n(ic()),u=n(wc()),i=n(Br()),r=n(vc()),s=(o,l,f)=>{let{options:p}=o;if(p.protocolVersion===5&&p.properties&&p.properties.maximumPacketSize&&p.properties.maximumPacketSize<l.length)return o.emit("error",new Error(`exceeding packets size ${l.cmd}`)),o.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),o;switch(o.log("_handlePacket :: emitting packetreceive"),o.emit("packetreceive",l),l.cmd){case"publish":(0,t.default)(o,l,f);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":o.reschedulePing(),(0,i.default)(o,l),f();break;case"pubrel":o.reschedulePing(),(0,r.default)(o,l,f);break;case"connack":(0,u.default)(o,l),f();break;case"auth":o.reschedulePing(),(0,a.default)(o,l),f();break;case"pingresp":o.log("_handlePacket :: received pingresp"),o.reschedulePing(!0),f();break;case"disconnect":o.emit("disconnect",l),f();break;default:o.log("_handlePacket :: unknown command"),f();break}};e.default=s}),Ec=Ae(e=>{ae(),ue(),le();var n=e&&e.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0}),e.TypedEventEmitter=void 0;var t=n((rr(),Ue(jt))),a=ir(),u=class{};e.TypedEventEmitter=u,(0,a.applyMixin)(u,t.default)}),Or=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"__esModule",{value:!0}),e.isReactNativeBrowser=e.isWebWorker=void 0;var n=()=>{var i;return typeof window<"u"?typeof navigator<"u"&&((i=navigator.userAgent)===null||i===void 0?void 0:i.toLowerCase().indexOf(" electron/"))>-1&&xe!=null&&xe.versions?!Object.prototype.hasOwnProperty.call(xe.versions,"electron"):typeof window.document<"u":!1},t=()=>{var i,r;return!!(typeof self=="object"&&!((r=(i=self==null?void 0:self.constructor)===null||i===void 0?void 0:i.name)===null||r===void 0)&&r.includes("WorkerGlobalScope"))},a=()=>typeof navigator<"u"&&navigator.product==="ReactNative",u=n()||t()||a();e.isWebWorker=t(),e.isReactNativeBrowser=a(),e.default=u}),Sc=Ae((e,n)=>{ae(),ue(),le(),function(t,a){typeof e=="object"&&typeof n<"u"?a(e):typeof define=="function"&&define.amd?define(["exports"],a):(t=typeof globalThis<"u"?globalThis:t||self,a(t.fastUniqueNumbers={}))}(e,function(t){var a=function(m){return function(A){var b=m(A);return A.add(b),b}},u=function(m){return function(A,b){return m.set(A,b),b}},i=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,r=536870912,s=r*2,o=function(m,A){return function(b){var _=A.get(b),x=_===void 0?b.size:_<s?_+1:0;if(!b.has(x))return m(b,x);if(b.size<r){for(;b.has(x);)x=Math.floor(Math.random()*s);return m(b,x)}if(b.size>i)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;b.has(x);)x=Math.floor(Math.random()*i);return m(b,x)}},l=new WeakMap,f=u(l),p=o(f,l),g=a(p);t.addUniqueNumber=g,t.generateUniqueNumber=p})}),Cc=Ae((e,n)=>{ae(),ue(),le(),function(t,a){typeof e=="object"&&typeof n<"u"?a(e,Sc()):typeof define=="function"&&define.amd?define(["exports","fast-unique-numbers"],a):(t=typeof globalThis<"u"?globalThis:t||self,a(t.workerTimersBroker={},t.fastUniqueNumbers))}(e,function(t,a){var u=function(s){return s.method!==void 0&&s.method==="call"},i=function(s){return s.error===null&&typeof s.id=="number"},r=function(s){var o=new Map([[0,function(){}]]),l=new Map([[0,function(){}]]),f=new Map,p=new Worker(s);p.addEventListener("message",function(_){var x=_.data;if(u(x)){var I=x.params,E=I.timerId,L=I.timerType;if(L==="interval"){var F=o.get(E);if(typeof F=="number"){var B=f.get(F);if(B===void 0||B.timerId!==E||B.timerType!==L)throw new Error("The timer is in an undefined state.")}else if(typeof F<"u")F();else throw new Error("The timer is in an undefined state.")}else if(L==="timeout"){var T=l.get(E);if(typeof T=="number"){var U=f.get(T);if(U===void 0||U.timerId!==E||U.timerType!==L)throw new Error("The timer is in an undefined state.")}else if(typeof T<"u")T(),l.delete(E);else throw new Error("The timer is in an undefined state.")}}else if(i(x)){var W=x.id,J=f.get(W);if(J===void 0)throw new Error("The timer is in an undefined state.");var ne=J.timerId,C=J.timerType;f.delete(W),C==="interval"?o.delete(ne):l.delete(ne)}else{var q=x.error.message;throw new Error(q)}});var g=function(_){var x=a.generateUniqueNumber(f);f.set(x,{timerId:_,timerType:"interval"}),o.set(_,x),p.postMessage({id:x,method:"clear",params:{timerId:_,timerType:"interval"}})},m=function(_){var x=a.generateUniqueNumber(f);f.set(x,{timerId:_,timerType:"timeout"}),l.set(_,x),p.postMessage({id:x,method:"clear",params:{timerId:_,timerType:"timeout"}})},A=function(_){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,I=a.generateUniqueNumber(o);return o.set(I,function(){_(),typeof o.get(I)=="function"&&p.postMessage({id:null,method:"set",params:{delay:x,now:performance.now(),timerId:I,timerType:"interval"}})}),p.postMessage({id:null,method:"set",params:{delay:x,now:performance.now(),timerId:I,timerType:"interval"}}),I},b=function(_){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,I=a.generateUniqueNumber(l);return l.set(I,_),p.postMessage({id:null,method:"set",params:{delay:x,now:performance.now(),timerId:I,timerType:"timeout"}}),I};return{clearInterval:g,clearTimeout:m,setInterval:A,setTimeout:b}};t.load=r})}),Ic=Ae((e,n)=>{ae(),ue(),le(),function(t,a){typeof e=="object"&&typeof n<"u"?a(e,Cc()):typeof define=="function"&&define.amd?define(["exports","worker-timers-broker"],a):(t=typeof globalThis<"u"?globalThis:t||self,a(t.workerTimers={},t.workerTimersBroker))}(e,function(t,a){var u=function(p,g){var m=null;return function(){if(m!==null)return m;var A=new Blob([g],{type:"application/javascript; charset=utf-8"}),b=URL.createObjectURL(A);return m=p(b),setTimeout(function(){return URL.revokeObjectURL(b)}),m}},i=`(()=>{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)})()})();`,r=u(a.load,i),s=function(p){return r().clearInterval(p)},o=function(p){return r().clearTimeout(p)},l=function(){var p;return(p=r()).setInterval.apply(p,arguments)},f=function(){var p;return(p=r()).setTimeout.apply(p,arguments)};t.clearInterval=s,t.clearTimeout=o,t.setInterval=l,t.setTimeout=f})}),kc=Ae(e=>{ae(),ue(),le();var n=e&&e.__createBinding||(Object.create?function(l,f,p,g){g===void 0&&(g=p);var m=Object.getOwnPropertyDescriptor(f,p);(!m||("get"in m?!f.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return f[p]}}),Object.defineProperty(l,g,m)}:function(l,f,p,g){g===void 0&&(g=p),l[g]=f[p]}),t=e&&e.__setModuleDefault||(Object.create?function(l,f){Object.defineProperty(l,"default",{enumerable:!0,value:f})}:function(l,f){l.default=f}),a=e&&e.__importStar||function(l){if(l&&l.__esModule)return l;var f={};if(l!=null)for(var p in l)p!=="default"&&Object.prototype.hasOwnProperty.call(l,p)&&n(f,l,p);return t(f,l),f};Object.defineProperty(e,"__esModule",{value:!0});var u=a(Or()),i=Ic(),r={set:i.setInterval,clear:i.clearInterval},s={set:(l,f)=>setInterval(l,f),clear:l=>clearInterval(l)},o=l=>{switch(l){case"native":return s;case"worker":return r;case"auto":default:return u.default&&!u.isWebWorker&&!u.isReactNativeBrowser?r:s}};e.default=o}),Ds=Ae(e=>{ae(),ue(),le();var n=e&&e.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0});var t=n(kc()),a=class{get keepaliveTimeoutTimestamp(){return this._keepaliveTimeoutTimestamp}get intervalEvery(){return this._intervalEvery}get keepalive(){return this._keepalive}constructor(u,i){this.destroyed=!1,this.client=u,this.timer=typeof i=="object"&&"set"in i&&"clear"in i?i:(0,t.default)(i),this.setKeepalive(u.options.keepalive)}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}setKeepalive(u){if(u*=1e3,isNaN(u)||u<=0||u>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${u}`);this._keepalive=u,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${u}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;let u=Math.ceil(this._keepalive*1.5);this._keepaliveTimeoutTimestamp=Date.now()+u,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)}};e.default=a}),Ci=Ae(e=>{ae(),ue(),le();var n=e&&e.__createBinding||(Object.create?function(F,B,T,U){U===void 0&&(U=T);var W=Object.getOwnPropertyDescriptor(B,T);(!W||("get"in W?!B.__esModule:W.writable||W.configurable))&&(W={enumerable:!0,get:function(){return B[T]}}),Object.defineProperty(F,U,W)}:function(F,B,T,U){U===void 0&&(U=T),F[U]=B[T]}),t=e&&e.__setModuleDefault||(Object.create?function(F,B){Object.defineProperty(F,"default",{enumerable:!0,value:B})}:function(F,B){F.default=B}),a=e&&e.__importStar||function(F){if(F&&F.__esModule)return F;var B={};if(F!=null)for(var T in F)T!=="default"&&Object.prototype.hasOwnProperty.call(F,T)&&n(B,F,T);return t(B,F),B},u=e&&e.__importDefault||function(F){return F&&F.__esModule?F:{default:F}};Object.defineProperty(e,"__esModule",{value:!0});var i=u(mu()),r=u(Zu()),s=u(Ts()),o=Ht(),l=u(ec()),f=a(tc()),p=u(St()),g=u(Bs()),m=u(_c()),A=ir(),b=Ec(),_=u(Ds()),x=a(Or()),I=globalThis.setImmediate||((...F)=>{let B=F.shift();(0,A.nextTick)(()=>{B(...F)})}),E={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,writeCache:!0,timerVariant:"auto"},L=class $i extends b.TypedEventEmitter{static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(B,T){super(),this.options=T||{};for(let U in E)typeof this.options[U]>"u"?this.options[U]=E[U]:this.options[U]=T[U];this.log=this.options.log||(0,p.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",$i.VERSION),x.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",x.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:$i.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||(r.default.writeToStream.cacheNumbers=!1),this.streamBuilder=B,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new s.default:this.options.messageIdProvider,this.outgoingStore=T.outgoingStore||new g.default,this.incomingStore=T.incomingStore||new g.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 i.default(T.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:U}=this,W=()=>{let J=U.shift();this.log("deliver :: entry %o",J);let ne=null;if(!J){this._resubscribe();return}ne=J.packet,this.log("deliver :: call _sendPacket for %o",ne);let C=!0;ne.messageId&&ne.messageId!==0&&(this.messageIdProvider.register(ne.messageId)||(C=!1)),C?this._sendPacket(ne,q=>{J.cb&&J.cb(q),W()}):(this.log("messageId: %d has already used. The message is skipped and removed.",ne.messageId),W())};this.log("connect :: sending queued packets"),W()}),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(B,T){T()}handleMessage(B,T){T()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var B;let T=new o.Writable,U=r.default.parser(this.options),W=null,J=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new g.default,this.outgoingStore=this.options.outgoingStore||new g.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",Y=>{this.log("parser :: on packet push to packets array."),J.push(Y)});let ne=()=>{this.log("work :: getting next packet in queue");let Y=J.shift();if(Y)this.log("work :: packet pulled from queue"),(0,m.default)(this,Y,C);else{this.log("work :: no packets in queue");let me=W;W=null,this.log("work :: done flag is %s",!!me),me&&me()}},C=()=>{if(J.length)(0,A.nextTick)(ne);else{let Y=W;W=null,Y()}};T._write=(Y,me,se)=>{W=se,this.log("writable stream :: parsing buffer"),U.parse(Y),ne()};let q=Y=>{this.log("streamErrorHandler :: error",Y.message),Y.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",Y)):this.noop(Y)};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(T),this.stream.on("error",q),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 te={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&&(te.will=Object.assign(Object.assign({},this.options.will),{payload:(B=this.options.will)===null||B===void 0?void 0:B.payload})),this.topicAliasRecv&&(te.properties||(te.properties={}),this.topicAliasRecv&&(te.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(te),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 Y=Object.assign({cmd:"auth",reasonCode:0},this.options.authPacket);this._writePacket(Y)}}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(B,T,U,W){this.log("publish :: message `%s` to topic `%s`",T,B);let{options:J}=this;typeof U=="function"&&(W=U,U=null),U=U||{},U=Object.assign(Object.assign({},{qos:0,retain:!1,dup:!1}),U);let{qos:ne,retain:C,dup:q,properties:te,cbStorePut:Y}=U;if(this._checkDisconnecting(W))return this;let me=()=>{let se=0;if((ne===1||ne===2)&&(se=this._nextId(),se===null))return this.log("No messageId left"),!1;let H={cmd:"publish",topic:B,payload:T,qos:ne,retain:C,messageId:se,dup:q};switch(J.protocolVersion===5&&(H.properties=te),this.log("publish :: qos",ne),ne){case 1:case 2:this.outgoing[H.messageId]={volatile:!1,cb:W||this.noop},this.log("MqttClient:publish: packet cmd: %s",H.cmd),this._sendPacket(H,void 0,Y);break;default:this.log("MqttClient:publish: packet cmd: %s",H.cmd),this._sendPacket(H,W,Y);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!me())&&this._storeProcessingQueue.push({invoke:me,cbStorePut:U.cbStorePut,callback:W}),this}publishAsync(B,T,U){return new Promise((W,J)=>{this.publish(B,T,U,(ne,C)=>{ne?J(ne):W(C)})})}subscribe(B,T,U){let W=this.options.protocolVersion;typeof T=="function"&&(U=T),U=U||this.noop;let J=!1,ne=[];typeof B=="string"?(B=[B],ne=B):Array.isArray(B)?ne=B:typeof B=="object"&&(J=B.resubscribe,delete B.resubscribe,ne=Object.keys(B));let C=f.validateTopics(ne);if(C!==null)return I(U,new Error(`Invalid topic ${C}`)),this;if(this._checkDisconnecting(U))return this.log("subscribe: discconecting true"),this;let q={qos:0};W===5&&(q.nl=!1,q.rap=!1,q.rh=0),T=Object.assign(Object.assign({},q),T);let te=T.properties,Y=[],me=(H,be)=>{if(be=be||T,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,H)||this._resubscribeTopics[H].qos<be.qos||J){let oe={topic:H,qos:be.qos};W===5&&(oe.nl=be.nl,oe.rap=be.rap,oe.rh=be.rh,oe.properties=te),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",oe.topic,oe.qos),Y.push(oe)}};if(Array.isArray(B)?B.forEach(H=>{this.log("subscribe: array topic %s",H),me(H)}):Object.keys(B).forEach(H=>{this.log("subscribe: object topic %s, %o",H,B[H]),me(H,B[H])}),!Y.length)return U(null,[]),this;let se=()=>{let H=this._nextId();if(H===null)return this.log("No messageId left"),!1;let be={cmd:"subscribe",subscriptions:Y,messageId:H};if(te&&(be.properties=te),this.options.resubscribe){this.log("subscribe :: resubscribe true");let oe=[];Y.forEach(we=>{if(this.options.reconnectPeriod>0){let w={qos:we.qos};W===5&&(w.nl=we.nl||!1,w.rap=we.rap||!1,w.rh=we.rh||0,w.properties=we.properties),this._resubscribeTopics[we.topic]=w,oe.push(we.topic)}}),this.messageIdToTopic[be.messageId]=oe}return this.outgoing[be.messageId]={volatile:!0,cb(oe,we){if(!oe){let{granted:w}=we;for(let G=0;G<w.length;G+=1)Y[G].qos=w[G]}U(oe,Y,we)}},this.log("subscribe :: call _sendPacket"),this._sendPacket(be),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!se())&&this._storeProcessingQueue.push({invoke:se,callback:U}),this}subscribeAsync(B,T){return new Promise((U,W)=>{this.subscribe(B,T,(J,ne)=>{J?W(J):U(ne)})})}unsubscribe(B,T,U){typeof B=="string"&&(B=[B]),typeof T=="function"&&(U=T),U=U||this.noop;let W=f.validateTopics(B);if(W!==null)return I(U,new Error(`Invalid topic ${W}`)),this;if(this._checkDisconnecting(U))return this;let J=()=>{let ne=this._nextId();if(ne===null)return this.log("No messageId left"),!1;let C={cmd:"unsubscribe",messageId:ne,unsubscriptions:[]};return typeof B=="string"?C.unsubscriptions=[B]:Array.isArray(B)&&(C.unsubscriptions=B),this.options.resubscribe&&C.unsubscriptions.forEach(q=>{delete this._resubscribeTopics[q]}),typeof T=="object"&&T.properties&&(C.properties=T.properties),this.outgoing[C.messageId]={volatile:!0,cb:U},this.log("unsubscribe: call _sendPacket"),this._sendPacket(C),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!J())&&this._storeProcessingQueue.push({invoke:J,callback:U}),this}unsubscribeAsync(B,T){return new Promise((U,W)=>{this.unsubscribe(B,T,(J,ne)=>{J?W(J):U(ne)})})}end(B,T,U){this.log("end :: (%s)",this.options.clientId),(B==null||typeof B!="boolean")&&(U=U||T,T=B,B=!1),typeof T!="object"&&(U=U||T,T=null),this.log("end :: cb? %s",!!U),(!U||typeof U!="function")&&(U=this.noop);let W=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close(ne=>{this.outgoingStore.close(C=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),U){let q=ne||C;this.log("end :: closeStores: invoking callback with args"),U(q)}})}),this._deferredReconnect?this._deferredReconnect():(this.options.reconnectPeriod===0||this.options.manualConnect)&&(this.disconnecting=!1)},J=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,B),this._cleanUp(B,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,A.nextTick)(W)},T)};return this.disconnecting?(U(),this):(this._clearReconnect(),this.disconnecting=!0,!B&&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,J,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),J()),this)}endAsync(B,T){return new Promise((U,W)=>{this.end(B,T,J=>{J?W(J):U()})})}removeOutgoingMessage(B){if(this.outgoing[B]){let{cb:T}=this.outgoing[B];this._removeOutgoingAndStoreMessage(B,()=>{T(new Error("Message removed"))})}return this}reconnect(B){this.log("client reconnect");let T=()=>{B?(this.options.incomingStore=B.incomingStore,this.options.outgoingStore=B.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new g.default,this.outgoingStore=this.options.outgoingStore||new g.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(B=>{this.outgoing[B].volatile&&typeof this.outgoing[B].cb=="function"&&(this.outgoing[B].cb(new Error("Connection closed")),delete this.outgoing[B])}))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(B=>{typeof this.outgoing[B].cb=="function"&&(this.outgoing[B].cb(new Error("Connection closed")),delete this.outgoing[B])}))}_removeTopicAliasAndRecoverTopicName(B){let T;B.properties&&(T=B.properties.topicAlias);let U=B.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");B.topic=U}T&&delete B.properties.topicAlias}_checkDisconnecting(B){return this.disconnecting&&(B&&B!==this.noop?B(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(B,T,U={}){if(T&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",T)),this.log("_cleanUp :: forced? %s",B),B)this.options.reconnectPeriod===0&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let W=Object.assign({cmd:"disconnect"},U);this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(W,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),I(()=>{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(B,T,U){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",B.cmd);let W=B,J;if(W.cmd==="publish"&&(W=(0,l.default)(B),J=this._removeTopicAliasAndRecoverTopicName(W),J))return T&&T(J);this.outgoingStore.put(W,ne=>{if(ne)return T&&T(ne);U(),this._writePacket(B,T)})}_applyTopicAlias(B){if(this.options.protocolVersion===5&&B.cmd==="publish"){let T;B.properties&&(T=B.properties.topicAlias);let U=B.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?(B.topic="",B.properties=Object.assign(Object.assign({},B.properties),{topicAlias:T}),this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",U,T)):(T=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(U,T),B.properties=Object.assign(Object.assign({},B.properties),{topicAlias:T}),this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",U,T))):this.options.autoUseTopicAlias&&(T=this.topicAliasSend.getAliasByTopic(U),T&&(B.topic="",B.properties=Object.assign(Object.assign({},B.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(B){this.log("noop ::",B)}_writePacket(B,T){this.log("_writePacket :: packet: %O",B),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",B),this.log("_writePacket :: writing to stream");let U=r.default.writeToStream(B,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(B,T,U,W){this.log("_sendPacket :: (%s) :: start",this.options.clientId),U=U||this.noop,T=T||this.noop;let J=this._applyTopicAlias(B);if(J){T(J);return}if(!this.connected){if(B.cmd==="auth"){this._writePacket(B,T);return}this.log("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(B,T,U);return}if(W){this._writePacket(B,T);return}switch(B.cmd){case"publish":break;case"pubrel":this._storeAndSend(B,T,U);return;default:this._writePacket(B,T);return}switch(B.qos){case 2:case 1:this._storeAndSend(B,T,U);break;case 0:default:this._writePacket(B,T);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}_storePacket(B,T,U){this.log("_storePacket :: packet: %o",B),this.log("_storePacket :: cb? %s",!!T),U=U||this.noop;let W=B;if(W.cmd==="publish"){W=(0,l.default)(B);let ne=this._removeTopicAliasAndRecoverTopicName(W);if(ne)return T&&T(ne)}let J=W.qos||0;J===0&&this.queueQoSZero||W.cmd!=="publish"?this.queue.push({packet:W,cb:T}):J>0?(T=this.outgoing[W.messageId]?this.outgoing[W.messageId].cb:null,this.outgoingStore.put(W,ne=>{if(ne)return T&&T(ne);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 _.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(B=!1){this.keepaliveManager&&this.options.keepalive&&(B||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 B=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&B.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){this.log("_resubscribe: protocolVersion 5");for(let T=0;T<B.length;T++){let U={};U[B[T]]=this._resubscribeTopics[B[T]],U.resubscribe=!0,this.subscribe(U,{properties:U[B[T]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(B){if(this.disconnected){this.emit("connect",B);return}this.connackPacket=B,this.messageIdProvider.clear(),this._setupKeepaliveManager(),this.connected=!0;let T=()=>{let U=this.outgoingStore.createStream(),W=()=>{U.destroy(),U=null,this._flushStoreProcessingQueue(),J()},J=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",W),U.on("error",C=>{J(),this._flushStoreProcessingQueue(),this.removeListener("close",W),this.emit("error",C)});let ne=()=>{if(!U)return;let C=U.read(1),q;if(!C){U.once("readable",ne);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[C.messageId]){ne();return}!this.disconnecting&&!this.reconnectTimer?(q=this.outgoing[C.messageId]?this.outgoing[C.messageId].cb:null,this.outgoing[C.messageId]={volatile:!1,cb(te,Y){q&&q(te,Y),ne()}},this._packetIdsDuringStoreProcessing[C.messageId]=!0,this.messageIdProvider.register(C.messageId)?this._sendPacket(C,void 0,void 0,!0):this.log("messageId: %d has already used.",C.messageId)):U.destroy&&U.destroy()};U.on("end",()=>{let C=!0;for(let q in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[q]){C=!1;break}this.removeListener("close",W),C?(J(),this._invokeAllStoreProcessingQueue(),this.emit("connect",B)):T()}),ne()};T()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){let B=this._storeProcessingQueue[0];if(B&&B.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(let B of this._storeProcessingQueue)B.cbStorePut&&B.cbStorePut(new Error("Connection closed")),B.callback&&B.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(B,T){delete this.outgoing[B],this.outgoingStore.del({messageId:B},(U,W)=>{T(U,W),this.messageIdProvider.deallocate(B),this._invokeStoreProcessingQueue()})}};L.VERSION=A.MQTTJS_VERSION,e.default=L}),Tc=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"__esModule",{value:!0});var n=Us(),t=class{constructor(){this.numberAllocator=new n.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()}};e.default=t});function qt(e){throw new RangeError(Ks[e])}function Ls(e,n){let t=e.split("@"),a="";t.length>1&&(a=t[0]+"@",e=t[1]);let u=function(i,r){let s=[],o=i.length;for(;o--;)s[o]=r(i[o]);return s}((e=e.replace(Vs,".")).split("."),n).join(".");return a+u}function Ns(e){let n=[],t=0,a=e.length;for(;t<a;){let u=e.charCodeAt(t++);if(u>=55296&&u<=56319&&t<a){let i=e.charCodeAt(t++);(64512&i)==56320?n.push(((1023&u)<<10)+(1023&i)+65536):(n.push(u),t--)}else n.push(u)}return n}var Fs,js,Vs,Ks,ut,Pr,Ii,ki,Ti,Bi,xt,Bc=Ge(()=>{ae(),ue(),le(),Fs=/^xn--/,js=/[^\0-\x7E]/,Vs=/[\x2E\u3002\uFF0E\uFF61]/g,Ks={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ut=Math.floor,Pr=String.fromCharCode,Ii=function(e,n){return e+22+75*(e<26)-((n!=0)<<5)},ki=function(e,n,t){let a=0;for(e=t?ut(e/700):e>>1,e+=ut(e/n);e>455;a+=36)e=ut(e/35);return ut(a+36*e/(e+38))},Ti=function(e){let n=[],t=e.length,a=0,u=128,i=72,r=e.lastIndexOf("-");r<0&&(r=0);for(let o=0;o<r;++o)e.charCodeAt(o)>=128&&qt("not-basic"),n.push(e.charCodeAt(o));for(let o=r>0?r+1:0;o<t;){let l=a;for(let p=1,g=36;;g+=36){o>=t&&qt("invalid-input");let m=(s=e.charCodeAt(o++))-48<10?s-22:s-65<26?s-65:s-97<26?s-97:36;(m>=36||m>ut((2147483647-a)/p))&&qt("overflow"),a+=m*p;let A=g<=i?1:g>=i+26?26:g-i;if(m<A)break;let b=36-A;p>ut(2147483647/b)&&qt("overflow"),p*=b}let f=n.length+1;i=ki(a-l,f,l==0),ut(a/f)>2147483647-u&&qt("overflow"),u+=ut(a/f),a%=f,n.splice(a++,0,u)}var s;return String.fromCodePoint(...n)},Bi=function(e){let n=[],t=(e=Ns(e)).length,a=128,u=0,i=72;for(let o of e)o<128&&n.push(Pr(o));let r=n.length,s=r;for(r&&n.push("-");s<t;){let o=2147483647;for(let f of e)f>=a&&f<o&&(o=f);let l=s+1;o-a>ut((2147483647-u)/l)&&qt("overflow"),u+=(o-a)*l,a=o;for(let f of e)if(f<a&&++u>2147483647&&qt("overflow"),f==a){let p=u;for(let g=36;;g+=36){let m=g<=i?1:g>=i+26?26:g-i;if(p<m)break;let A=p-m,b=36-m;n.push(Pr(Ii(m+A%b,0))),p=ut(A/b)}n.push(Pr(Ii(p,0))),i=ki(u,l,s==r),u=0,++s}++u,++a}return n.join("")},xt={version:"2.1.0",ucs2:{decode:Ns,encode:e=>String.fromCodePoint(...e)},decode:Ti,encode:Bi,toASCII:function(e){return Ls(e,function(n){return js.test(n)?"xn--"+Bi(n):n})},toUnicode:function(e){return Ls(e,function(n){return Fs.test(n)?Ti(n.slice(4).toLowerCase()):n})}},xt.decode,xt.encode,xt.toASCII,xt.toUnicode,xt.ucs2,xt.version});function Oc(e,n){return Object.prototype.hasOwnProperty.call(e,n)}var Ws,or,Qs,dt,Pc=Ge(()=>{ae(),ue(),le(),Ws=function(e,n,t,a){n=n||"&",t=t||"=";var u={};if(typeof e!="string"||e.length===0)return u;var i=/\+/g;e=e.split(n);var r=1e3;a&&typeof a.maxKeys=="number"&&(r=a.maxKeys);var s=e.length;r>0&&s>r&&(s=r);for(var o=0;o<s;++o){var l,f,p,g,m=e[o].replace(i,"%20"),A=m.indexOf(t);A>=0?(l=m.substr(0,A),f=m.substr(A+1)):(l=m,f=""),p=decodeURIComponent(l),g=decodeURIComponent(f),Oc(u,p)?Array.isArray(u[p])?u[p].push(g):u[p]=[u[p],g]:u[p]=g}return u},or=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},Qs=function(e,n,t,a){return n=n||"&",t=t||"=",e===null&&(e=void 0),typeof e=="object"?Object.keys(e).map(function(u){var i=encodeURIComponent(or(u))+t;return Array.isArray(e[u])?e[u].map(function(r){return i+encodeURIComponent(or(r))}).join(n):i+encodeURIComponent(or(e[u]))}).join(n):a?encodeURIComponent(or(a))+t+encodeURIComponent(or(e)):""},dt={},dt.decode=dt.parse=Ws,dt.encode=dt.stringify=Qs,dt.decode,dt.encode,dt.parse,dt.stringify});function Oi(){throw new Error("setTimeout has not been defined")}function Pi(){throw new Error("clearTimeout has not been defined")}function Hs(e){if(Tt===setTimeout)return setTimeout(e,0);if((Tt===Oi||!Tt)&&setTimeout)return Tt=setTimeout,setTimeout(e,0);try{return Tt(e,0)}catch{try{return Tt.call(null,e,0)}catch{return Tt.call(this||$t,e,0)}}}function xc(){Yt&&zt&&(Yt=!1,zt.length?pt=zt.concat(pt):dr=-1,pt.length&&qs())}function qs(){if(!Yt){var e=Hs(xc);Yt=!0;for(var n=pt.length;n;){for(zt=pt,pt=[];++dr<n;)zt&&zt[dr].run();dr=-1,n=pt.length}zt=null,Yt=!1,function(t){if(Bt===clearTimeout)return clearTimeout(t);if((Bt===Pi||!Bt)&&clearTimeout)return Bt=clearTimeout,clearTimeout(t);try{Bt(t)}catch{try{return Bt.call(null,t)}catch{return Bt.call(this||$t,t)}}}(e)}}function $s(e,n){(this||$t).fun=e,(this||$t).array=n}function kt(){}var zs,Tt,Bt,$t,We,zt,pt,Yt,dr,je,Rc=Ge(()=>{ae(),ue(),le(),$t=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,We=zs={},function(){try{Tt=typeof setTimeout=="function"?setTimeout:Oi}catch{Tt=Oi}try{Bt=typeof clearTimeout=="function"?clearTimeout:Pi}catch{Bt=Pi}}(),pt=[],Yt=!1,dr=-1,We.nextTick=function(e){var n=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)n[t-1]=arguments[t];pt.push(new $s(e,n)),pt.length!==1||Yt||Hs(qs)},$s.prototype.run=function(){(this||$t).fun.apply(null,(this||$t).array)},We.title="browser",We.browser=!0,We.env={},We.argv=[],We.version="",We.versions={},We.on=kt,We.addListener=kt,We.once=kt,We.off=kt,We.removeListener=kt,We.removeAllListeners=kt,We.emit=kt,We.prependListener=kt,We.prependOnceListener=kt,We.listeners=function(e){return[]},We.binding=function(e){throw new Error("process.binding is not supported")},We.cwd=function(){return"/"},We.chdir=function(e){throw new Error("process.chdir is not supported")},We.umask=function(){return 0},je=zs,je.addListener,je.argv,je.binding,je.browser,je.chdir,je.cwd,je.emit,je.env,je.listeners,je.nextTick,je.off,je.on,je.once,je.prependListener,je.prependOnceListener,je.removeAllListeners,je.removeListener,je.title,je.umask,je.version,je.versions});function Mc(){if(xi)return xr;xi=!0;var e=xr={},n,t;function a(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?n=setTimeout:n=a}catch{n=a}try{typeof clearTimeout=="function"?t=clearTimeout:t=u}catch{t=u}})();function i(b){if(n===setTimeout)return setTimeout(b,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(b,0);try{return n(b,0)}catch{try{return n.call(null,b,0)}catch{return n.call(this||Gt,b,0)}}}function r(b){if(t===clearTimeout)return clearTimeout(b);if((t===u||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(b);try{return t(b)}catch{try{return t.call(null,b)}catch{return t.call(this||Gt,b)}}}var s=[],o=!1,l,f=-1;function p(){!o||!l||(o=!1,l.length?s=l.concat(s):f=-1,s.length&&g())}function g(){if(!o){var b=i(p);o=!0;for(var _=s.length;_;){for(l=s,s=[];++f<_;)l&&l[f].run();f=-1,_=s.length}l=null,o=!1,r(b)}}e.nextTick=function(b){var _=new Array(arguments.length-1);if(arguments.length>1)for(var x=1;x<arguments.length;x++)_[x-1]=arguments[x];s.push(new m(b,_)),s.length===1&&!o&&i(g)};function m(b,_){(this||Gt).fun=b,(this||Gt).array=_}m.prototype.run=function(){(this||Gt).fun.apply(null,(this||Gt).array)},e.title="browser",e.browser=!0,e.env={},e.argv=[],e.version="",e.versions={};function A(){}return e.on=A,e.addListener=A,e.once=A,e.off=A,e.removeListener=A,e.removeAllListeners=A,e.emit=A,e.prependListener=A,e.prependOnceListener=A,e.listeners=function(b){return[]},e.binding=function(b){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(b){throw new Error("process.chdir is not supported")},e.umask=function(){return 0},xr}var xr,xi,Gt,Le,Ys=Ge(()=>{ae(),ue(),le(),xr={},xi=!1,Gt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Le=Mc(),Le.platform="browser",Le.addListener,Le.argv,Le.binding,Le.browser,Le.chdir,Le.cwd,Le.emit,Le.env,Le.listeners,Le.nextTick,Le.off,Le.on,Le.once,Le.prependListener,Le.prependOnceListener,Le.removeAllListeners,Le.removeListener,Le.title,Le.umask,Le.version,Le.versions});function Uc(){if(Ri)return Rr;Ri=!0;var e=Le;function n(i){if(typeof i!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(i))}function t(i,r){for(var s="",o=0,l=-1,f=0,p,g=0;g<=i.length;++g){if(g<i.length)p=i.charCodeAt(g);else{if(p===47)break;p=47}if(p===47){if(!(l===g-1||f===1))if(l!==g-1&&f===2){if(s.length<2||o!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var m=s.lastIndexOf("/");if(m!==s.length-1){m===-1?(s="",o=0):(s=s.slice(0,m),o=s.length-1-s.lastIndexOf("/")),l=g,f=0;continue}}else if(s.length===2||s.length===1){s="",o=0,l=g,f=0;continue}}r&&(s.length>0?s+="/..":s="..",o=2)}else s.length>0?s+="/"+i.slice(l+1,g):s=i.slice(l+1,g),o=g-l-1;l=g,f=0}else p===46&&f!==-1?++f:f=-1}return s}function a(i,r){var s=r.dir||r.root,o=r.base||(r.name||"")+(r.ext||"");return s?s===r.root?s+o:s+i+o:o}var u={resolve:function(){for(var i="",r=!1,s,o=arguments.length-1;o>=-1&&!r;o--){var l;o>=0?l=arguments[o]:(s===void 0&&(s=e.cwd()),l=s),n(l),l.length!==0&&(i=l+"/"+i,r=l.charCodeAt(0)===47)}return i=t(i,!r),r?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(i){if(n(i),i.length===0)return".";var r=i.charCodeAt(0)===47,s=i.charCodeAt(i.length-1)===47;return i=t(i,!r),i.length===0&&!r&&(i="."),i.length>0&&s&&(i+="/"),r?"/"+i:i},isAbsolute:function(i){return n(i),i.length>0&&i.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var i,r=0;r<arguments.length;++r){var s=arguments[r];n(s),s.length>0&&(i===void 0?i=s:i+="/"+s)}return i===void 0?".":u.normalize(i)},relative:function(i,r){if(n(i),n(r),i===r||(i=u.resolve(i),r=u.resolve(r),i===r))return"";for(var s=1;s<i.length&&i.charCodeAt(s)===47;++s);for(var o=i.length,l=o-s,f=1;f<r.length&&r.charCodeAt(f)===47;++f);for(var p=r.length,g=p-f,m=l<g?l:g,A=-1,b=0;b<=m;++b){if(b===m){if(g>m){if(r.charCodeAt(f+b)===47)return r.slice(f+b+1);if(b===0)return r.slice(f+b)}else l>m&&(i.charCodeAt(s+b)===47?A=b:b===0&&(A=0));break}var _=i.charCodeAt(s+b),x=r.charCodeAt(f+b);if(_!==x)break;_===47&&(A=b)}var I="";for(b=s+A+1;b<=o;++b)(b===o||i.charCodeAt(b)===47)&&(I.length===0?I+="..":I+="/..");return I.length>0?I+r.slice(f+A):(f+=A,r.charCodeAt(f)===47&&++f,r.slice(f))},_makeLong:function(i){return i},dirname:function(i){if(n(i),i.length===0)return".";for(var r=i.charCodeAt(0),s=r===47,o=-1,l=!0,f=i.length-1;f>=1;--f)if(r=i.charCodeAt(f),r===47){if(!l){o=f;break}}else l=!1;return o===-1?s?"/":".":s&&o===1?"//":i.slice(0,o)},basename:function(i,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');n(i);var s=0,o=-1,l=!0,f;if(r!==void 0&&r.length>0&&r.length<=i.length){if(r.length===i.length&&r===i)return"";var p=r.length-1,g=-1;for(f=i.length-1;f>=0;--f){var m=i.charCodeAt(f);if(m===47){if(!l){s=f+1;break}}else g===-1&&(l=!1,g=f+1),p>=0&&(m===r.charCodeAt(p)?--p===-1&&(o=f):(p=-1,o=g))}return s===o?o=g:o===-1&&(o=i.length),i.slice(s,o)}else{for(f=i.length-1;f>=0;--f)if(i.charCodeAt(f)===47){if(!l){s=f+1;break}}else o===-1&&(l=!1,o=f+1);return o===-1?"":i.slice(s,o)}},extname:function(i){n(i);for(var r=-1,s=0,o=-1,l=!0,f=0,p=i.length-1;p>=0;--p){var g=i.charCodeAt(p);if(g===47){if(!l){s=p+1;break}continue}o===-1&&(l=!1,o=p+1),g===46?r===-1?r=p:f!==1&&(f=1):r!==-1&&(f=-1)}return r===-1||o===-1||f===0||f===1&&r===o-1&&r===s+1?"":i.slice(r,o)},format:function(i){if(i===null||typeof i!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof i);return a("/",i)},parse:function(i){n(i);var r={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return r;var s=i.charCodeAt(0),o=s===47,l;o?(r.root="/",l=1):l=0;for(var f=-1,p=0,g=-1,m=!0,A=i.length-1,b=0;A>=l;--A){if(s=i.charCodeAt(A),s===47){if(!m){p=A+1;break}continue}g===-1&&(m=!1,g=A+1),s===46?f===-1?f=A:b!==1&&(b=1):f!==-1&&(b=-1)}return f===-1||g===-1||b===0||b===1&&f===g-1&&f===p+1?g!==-1&&(p===0&&o?r.base=r.name=i.slice(1,g):r.base=r.name=i.slice(p,g)):(p===0&&o?(r.name=i.slice(1,f),r.base=i.slice(1,g)):(r.name=i.slice(p,f),r.base=i.slice(p,g)),r.ext=i.slice(f,g)),p>0?r.dir=i.slice(0,p-1):o&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return u.posix=u,Rr=u,Rr}var Rr,Ri,Mi,Dc=Ge(()=>{ae(),ue(),le(),Ys(),Rr={},Ri=!1,Mi=Uc()}),Gs={};Ut(Gs,{URL:()=>Ea,Url:()=>ba,default:()=>Me,fileURLToPath:()=>Js,format:()=>ya,parse:()=>_a,pathToFileURL:()=>Zs,resolve:()=>wa,resolveObject:()=>va});function st(){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 pr(e,n,t){if(e&&ct.isObject(e)&&e instanceof st)return e;var a=new st;return a.parse(e,n,t),a}function Lc(){if(Ni)return Lr;Ni=!0;var e=je;function n(i){if(typeof i!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(i))}function t(i,r){for(var s="",o=0,l=-1,f=0,p,g=0;g<=i.length;++g){if(g<i.length)p=i.charCodeAt(g);else{if(p===47)break;p=47}if(p===47){if(!(l===g-1||f===1))if(l!==g-1&&f===2){if(s.length<2||o!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var m=s.lastIndexOf("/");if(m!==s.length-1){m===-1?(s="",o=0):(s=s.slice(0,m),o=s.length-1-s.lastIndexOf("/")),l=g,f=0;continue}}else if(s.length===2||s.length===1){s="",o=0,l=g,f=0;continue}}r&&(s.length>0?s+="/..":s="..",o=2)}else s.length>0?s+="/"+i.slice(l+1,g):s=i.slice(l+1,g),o=g-l-1;l=g,f=0}else p===46&&f!==-1?++f:f=-1}return s}function a(i,r){var s=r.dir||r.root,o=r.base||(r.name||"")+(r.ext||"");return s?s===r.root?s+o:s+i+o:o}var u={resolve:function(){for(var i="",r=!1,s,o=arguments.length-1;o>=-1&&!r;o--){var l;o>=0?l=arguments[o]:(s===void 0&&(s=e.cwd()),l=s),n(l),l.length!==0&&(i=l+"/"+i,r=l.charCodeAt(0)===47)}return i=t(i,!r),r?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(i){if(n(i),i.length===0)return".";var r=i.charCodeAt(0)===47,s=i.charCodeAt(i.length-1)===47;return i=t(i,!r),i.length===0&&!r&&(i="."),i.length>0&&s&&(i+="/"),r?"/"+i:i},isAbsolute:function(i){return n(i),i.length>0&&i.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var i,r=0;r<arguments.length;++r){var s=arguments[r];n(s),s.length>0&&(i===void 0?i=s:i+="/"+s)}return i===void 0?".":u.normalize(i)},relative:function(i,r){if(n(i),n(r),i===r||(i=u.resolve(i),r=u.resolve(r),i===r))return"";for(var s=1;s<i.length&&i.charCodeAt(s)===47;++s);for(var o=i.length,l=o-s,f=1;f<r.length&&r.charCodeAt(f)===47;++f);for(var p=r.length,g=p-f,m=l<g?l:g,A=-1,b=0;b<=m;++b){if(b===m){if(g>m){if(r.charCodeAt(f+b)===47)return r.slice(f+b+1);if(b===0)return r.slice(f+b)}else l>m&&(i.charCodeAt(s+b)===47?A=b:b===0&&(A=0));break}var _=i.charCodeAt(s+b),x=r.charCodeAt(f+b);if(_!==x)break;_===47&&(A=b)}var I="";for(b=s+A+1;b<=o;++b)(b===o||i.charCodeAt(b)===47)&&(I.length===0?I+="..":I+="/..");return I.length>0?I+r.slice(f+A):(f+=A,r.charCodeAt(f)===47&&++f,r.slice(f))},_makeLong:function(i){return i},dirname:function(i){if(n(i),i.length===0)return".";for(var r=i.charCodeAt(0),s=r===47,o=-1,l=!0,f=i.length-1;f>=1;--f)if(r=i.charCodeAt(f),r===47){if(!l){o=f;break}}else l=!1;return o===-1?s?"/":".":s&&o===1?"//":i.slice(0,o)},basename:function(i,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');n(i);var s=0,o=-1,l=!0,f;if(r!==void 0&&r.length>0&&r.length<=i.length){if(r.length===i.length&&r===i)return"";var p=r.length-1,g=-1;for(f=i.length-1;f>=0;--f){var m=i.charCodeAt(f);if(m===47){if(!l){s=f+1;break}}else g===-1&&(l=!1,g=f+1),p>=0&&(m===r.charCodeAt(p)?--p===-1&&(o=f):(p=-1,o=g))}return s===o?o=g:o===-1&&(o=i.length),i.slice(s,o)}else{for(f=i.length-1;f>=0;--f)if(i.charCodeAt(f)===47){if(!l){s=f+1;break}}else o===-1&&(l=!1,o=f+1);return o===-1?"":i.slice(s,o)}},extname:function(i){n(i);for(var r=-1,s=0,o=-1,l=!0,f=0,p=i.length-1;p>=0;--p){var g=i.charCodeAt(p);if(g===47){if(!l){s=p+1;break}continue}o===-1&&(l=!1,o=p+1),g===46?r===-1?r=p:f!==1&&(f=1):r!==-1&&(f=-1)}return r===-1||o===-1||f===0||f===1&&r===o-1&&r===s+1?"":i.slice(r,o)},format:function(i){if(i===null||typeof i!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof i);return a("/",i)},parse:function(i){n(i);var r={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return r;var s=i.charCodeAt(0),o=s===47,l;o?(r.root="/",l=1):l=0;for(var f=-1,p=0,g=-1,m=!0,A=i.length-1,b=0;A>=l;--A){if(s=i.charCodeAt(A),s===47){if(!m){p=A+1;break}continue}g===-1&&(m=!1,g=A+1),s===46?f===-1?f=A:b!==1&&(b=1):f!==-1&&(b=-1)}return f===-1||g===-1||b===0||b===1&&f===g-1&&f===p+1?g!==-1&&(p===0&&o?r.base=r.name=i.slice(1,g):r.base=r.name=i.slice(p,g)):(p===0&&o?(r.name=i.slice(1,f),r.base=i.slice(1,g)):(r.name=i.slice(p,f),r.base=i.slice(p,g)),r.ext=i.slice(f,g)),p>0?r.dir=i.slice(0,p-1):o&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return u.posix=u,Lr=u,Lr}function Nc(e){if(typeof e=="string")e=new URL(e);else if(!(e instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(e.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return Nr?Fc(e):jc(e)}function Fc(e){let n=e.hostname,t=e.pathname;for(let a=0;a<t.length;a++)if(t[a]==="%"){let u=t.codePointAt(a+2)||32;if(t[a+1]==="2"&&u===102||t[a+1]==="5"&&u===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(t=t.replace(ha,"\\"),t=decodeURIComponent(t),n!=="")return`\\\\${n}${t}`;{let a=t.codePointAt(1)|32,u=t[2];if(a<ua||a>ca||u!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return t.slice(1)}}function jc(e){if(e.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let n=e.pathname;for(let t=0;t<n.length;t++)if(n[t]==="%"){let a=n.codePointAt(t+2)||32;if(n[t+1]==="2"&&a===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(n)}function Vc(e){let n=Fi.resolve(e),t=e.charCodeAt(e.length-1);(t===la||Nr&&t===aa)&&n[n.length-1]!==Fi.sep&&(n+="/");let a=new URL("file://");return n.includes("%")&&(n=n.replace(fa,"%25")),!Nr&&n.includes("\\")&&(n=n.replace(da,"%5C")),n.includes(`
|
|
4
|
-
`)&&(
|
|
5
|
-
`)&&(
|
|
6
|
-
`," "]),Mr=["'"].concat(na),Ui=["%","/","?",";","#"].concat(Mr),Di=["/","?","#"],Li=/^[+a-z0-9A-Z_-]{0,63}$/,ia=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,oa={javascript:!0,"javascript:":!0},Ur={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},Dr=dt,st.prototype.parse=function(e,n,t){if(!ct.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var a=e.indexOf("?"),u=a!==-1&&a<e.indexOf("#")?"?":"#",i=e.split(u);i[0]=i[0].replace(/\\/g,"/");var r=e=i.join(u);if(r=r.trim(),!t&&e.split("#").length===1){var s=ra.exec(r);if(s)return this.path=r,this.href=r,this.pathname=s[1],s[2]?(this.search=s[2],this.query=n?Dr.parse(this.search.substr(1)):this.search.substr(1)):n&&(this.search="",this.query={}),this}var o=ea.exec(r);if(o){var l=(o=o[0]).toLowerCase();this.protocol=l,r=r.substr(o.length)}if(t||o||r.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=r.substr(0,2)==="//";!f||o&&Ur[o]||(r=r.substr(2),this.slashes=!0)}if(!Ur[o]&&(f||o&&!Jt[o])){for(var p,g,m=-1,A=0;A<Di.length;A++)(b=r.indexOf(Di[A]))!==-1&&(m===-1||b<m)&&(m=b);for((g=m===-1?r.lastIndexOf("@"):r.lastIndexOf("@",m))!==-1&&(p=r.slice(0,g),r=r.slice(g+1),this.auth=decodeURIComponent(p)),m=-1,A=0;A<Ui.length;A++){var b;(b=r.indexOf(Ui[A]))!==-1&&(m===-1||b<m)&&(m=b)}m===-1&&(m=r.length),this.host=r.slice(0,m),r=r.slice(m),this.parseHost(),this.hostname=this.hostname||"";var _=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!_)for(var x=this.hostname.split(/\./),I=(A=0,x.length);A<I;A++){var E=x[A];if(E&&!E.match(Li)){for(var L="",F=0,B=E.length;F<B;F++)E.charCodeAt(F)>127?L+="x":L+=E[F];if(!L.match(Li)){var T=x.slice(0,A),U=x.slice(A+1),W=E.match(ia);W&&(T.push(W[1]),U.unshift(W[2])),U.length&&(r="/"+U.join(".")+r),this.hostname=T.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),_||(this.hostname=Xs.toASCII(this.hostname));var J=this.port?":"+this.port:"",ne=this.hostname||"";this.host=ne+J,this.href+=this.host,_&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),r[0]!=="/"&&(r="/"+r))}if(!oa[l])for(A=0,I=Mr.length;A<I;A++){var C=Mr[A];if(r.indexOf(C)!==-1){var q=encodeURIComponent(C);q===C&&(q=escape(C)),r=r.split(C).join(q)}}var te=r.indexOf("#");te!==-1&&(this.hash=r.substr(te),r=r.slice(0,te));var Y=r.indexOf("?");if(Y!==-1?(this.search=r.substr(Y),this.query=r.substr(Y+1),n&&(this.query=Dr.parse(this.query)),r=r.slice(0,Y)):n&&(this.search="",this.query={}),r&&(this.pathname=r),Jt[l]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){J=this.pathname||"";var me=this.search||"";this.path=J+me}return this.href=this.format(),this},st.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var n=this.protocol||"",t=this.pathname||"",a=this.hash||"",u=!1,i="";this.host?u=e+this.host:this.hostname&&(u=e+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(u+=":"+this.port)),this.query&&ct.isObject(this.query)&&Object.keys(this.query).length&&(i=Dr.stringify(this.query));var r=this.search||i&&"?"+i||"";return n&&n.substr(-1)!==":"&&(n+=":"),this.slashes||(!n||Jt[n])&&u!==!1?(u="//"+(u||""),t&&t.charAt(0)!=="/"&&(t="/"+t)):u||(u=""),a&&a.charAt(0)!=="#"&&(a="#"+a),r&&r.charAt(0)!=="?"&&(r="?"+r),n+u+(t=t.replace(/[?#]/g,function(s){return encodeURIComponent(s)}))+(r=r.replace("#","%23"))+a},st.prototype.resolve=function(e){return this.resolveObject(pr(e,!1,!0)).format()},st.prototype.resolveObject=function(e){if(ct.isString(e)){var n=new st;n.parse(e,!1,!0),e=n}for(var t=new st,a=Object.keys(this),u=0;u<a.length;u++){var i=a[u];t[i]=this[i]}if(t.hash=e.hash,e.href==="")return t.href=t.format(),t;if(e.slashes&&!e.protocol){for(var r=Object.keys(e),s=0;s<r.length;s++){var o=r[s];o!=="protocol"&&(t[o]=e[o])}return Jt[t.protocol]&&t.hostname&&!t.pathname&&(t.path=t.pathname="/"),t.href=t.format(),t}if(e.protocol&&e.protocol!==t.protocol){if(!Jt[e.protocol]){for(var l=Object.keys(e),f=0;f<l.length;f++){var p=l[f];t[p]=e[p]}return t.href=t.format(),t}if(t.protocol=e.protocol,e.host||Ur[e.protocol])t.pathname=e.pathname;else{for(var g=(e.pathname||"").split("/");g.length&&!(e.host=g.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),g[0]!==""&&g.unshift(""),g.length<2&&g.unshift(""),t.pathname=g.join("/")}if(t.search=e.search,t.query=e.query,t.host=e.host||"",t.auth=e.auth,t.hostname=e.hostname||e.host,t.port=e.port,t.pathname||t.search){var m=t.pathname||"",A=t.search||"";t.path=m+A}return t.slashes=t.slashes||e.slashes,t.href=t.format(),t}var b=t.pathname&&t.pathname.charAt(0)==="/",_=e.host||e.pathname&&e.pathname.charAt(0)==="/",x=_||b||t.host&&e.pathname,I=x,E=t.pathname&&t.pathname.split("/")||[],L=(g=e.pathname&&e.pathname.split("/")||[],t.protocol&&!Jt[t.protocol]);if(L&&(t.hostname="",t.port=null,t.host&&(E[0]===""?E[0]=t.host:E.unshift(t.host)),t.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(g[0]===""?g[0]=e.host:g.unshift(e.host)),e.host=null),x=x&&(g[0]===""||E[0]==="")),_)t.host=e.host||e.host===""?e.host:t.host,t.hostname=e.hostname||e.hostname===""?e.hostname:t.hostname,t.search=e.search,t.query=e.query,E=g;else if(g.length)E||(E=[]),E.pop(),E=E.concat(g),t.search=e.search,t.query=e.query;else if(!ct.isNullOrUndefined(e.search))return L&&(t.hostname=t.host=E.shift(),(W=!!(t.host&&t.host.indexOf("@")>0)&&t.host.split("@"))&&(t.auth=W.shift(),t.host=t.hostname=W.shift())),t.search=e.search,t.query=e.query,ct.isNull(t.pathname)&&ct.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=t.format(),t;if(!E.length)return t.pathname=null,t.search?t.path="/"+t.search:t.path=null,t.href=t.format(),t;for(var F=E.slice(-1)[0],B=(t.host||e.host||E.length>1)&&(F==="."||F==="..")||F==="",T=0,U=E.length;U>=0;U--)(F=E[U])==="."?E.splice(U,1):F===".."?(E.splice(U,1),T++):T&&(E.splice(U,1),T--);if(!x&&!I)for(;T--;T)E.unshift("..");!x||E[0]===""||E[0]&&E[0].charAt(0)==="/"||E.unshift(""),B&&E.join("/").substr(-1)!=="/"&&E.push("");var W,J=E[0]===""||E[0]&&E[0].charAt(0)==="/";return L&&(t.hostname=t.host=J?"":E.length?E.shift():"",(W=!!(t.host&&t.host.indexOf("@")>0)&&t.host.split("@"))&&(t.auth=W.shift(),t.host=t.hostname=W.shift())),(x=x||t.host&&E.length)&&!J&&E.unshift(""),E.length?t.pathname=E.join("/"):(t.pathname=null,t.path=null),ct.isNull(t.pathname)&&ct.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.auth=e.auth||t.auth,t.slashes=t.slashes||e.slashes,t.href=t.format(),t},st.prototype.parseHost=function(){var e=this.host,n=ta.exec(e);n&&((n=n[0])!==":"&&(this.port=n.substr(1)),e=e.substr(0,e.length-n.length)),e&&(this.hostname=e)},Me.Url,Me.format,Me.resolve,Me.resolveObject,Lr={},Ni=!1,Fi=Lc(),sa=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0,Me.URL=typeof URL<"u"?URL:null,Me.pathToFileURL=Vc,Me.fileURLToPath=Nc,Me.Url,Me.format,Me.resolve,Me.resolveObject,Me.URL,aa=92,la=47,ua=97,ca=122,Nr=sa==="win32",ha=/\//g,fa=/%/g,da=/\\/g,pa=/\n/g,ga=/\r/g,ma=/\t/g,Aa=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0,Me.URL=typeof URL<"u"?URL:null,Me.pathToFileURL=Zs,Me.fileURLToPath=Js,ba=Me.Url,ya=Me.format,wa=Me.resolve,va=Me.resolveObject,_a=Me.parse,Ea=Me.URL,Sa=92,Ca=47,Ia=97,ka=122,Fr=Aa==="win32",Ta=/\//g,Ba=/%/g,Oa=/\\/g,Pa=/\n/g,xa=/\r/g,Ra=/\t/g}),Hc=Ae((e,n)=>{ae(),ue(),le(),n.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}),ji=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"__esModule",{value:!0}),e.BufferedDuplex=e.writev=void 0;var n=Ht(),t=(Ze(),Ue(Je));function a(i,r){let s=new Array(i.length);for(let o=0;o<i.length;o++)typeof i[o].chunk=="string"?s[o]=t.Buffer.from(i[o].chunk,"utf8"):s[o]=i[o].chunk;this._write(t.Buffer.concat(s),"binary",r)}e.writev=a;var u=class extends n.Duplex{constructor(i,r,s){super({objectMode:!0}),this.proxy=r,this.socket=s,this.writeQueue=[],i.objectMode||(this._writev=a.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",o=>{this.destroyed||this.push(o)})}_read(i){this.proxy.read(i)}_write(i,r,s){this.isSocketOpen?this.writeToProxy(i,r,s):this.writeQueue.push({chunk:i,encoding:r,cb:s})}_final(i){this.writeQueue=[],this.proxy.end(i)}_destroy(i,r){this.writeQueue=[],this.proxy.destroy(),r(i)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(i,r,s){this.proxy.write(i,r)===!1?this.proxy.once("drain",s):s()}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:i,encoding:r,cb:s}=this.writeQueue.shift();this.writeToProxy(i,r,s)}}};e.BufferedDuplex=u}),jr=Ae(e=>{ae(),ue(),le();var n=e&&e.__importDefault||function(x){return x&&x.__esModule?x:{default:x}};Object.defineProperty(e,"__esModule",{value:!0}),e.streamBuilder=e.browserStreamBuilder=void 0;var t=(Ze(),Ue(Je)),a=n(Hc()),u=n(St()),i=Ht(),r=n(Or()),s=ji(),o=(0,u.default)("mqttjs:ws"),l=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function f(x,I){let E=`${x.protocol}://${x.hostname}:${x.port}${x.path}`;return typeof x.transformWsUrl=="function"&&(E=x.transformWsUrl(E,x,I)),E}function p(x){let I=x;return x.port||(x.protocol==="wss"?I.port=443:I.port=80),x.path||(I.path="/"),x.wsOptions||(I.wsOptions={}),!r.default&&!x.forceNativeWebSocket&&x.protocol==="wss"&&l.forEach(E=>{Object.prototype.hasOwnProperty.call(x,E)&&!Object.prototype.hasOwnProperty.call(x.wsOptions,E)&&(I.wsOptions[E]=x[E])}),I}function g(x){let I=p(x);if(I.hostname||(I.hostname=I.host),!I.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let E=new URL(document.URL);I.hostname=E.hostname,I.port||(I.port=Number(E.port))}return I.objectMode===void 0&&(I.objectMode=!(I.binary===!0||I.binary===void 0)),I}function m(x,I,E){o("createWebSocket"),o(`protocol: ${E.protocolId} ${E.protocolVersion}`);let L=E.protocolId==="MQIsdp"&&E.protocolVersion===3?"mqttv3.1":"mqtt";o(`creating new Websocket for url: ${I} and protocol: ${L}`);let F;return E.createWebsocket?F=E.createWebsocket(I,[L],E):F=new a.default(I,[L],E.wsOptions),F}function A(x,I){let E=I.protocolId==="MQIsdp"&&I.protocolVersion===3?"mqttv3.1":"mqtt",L=f(I,x),F;return I.createWebsocket?F=I.createWebsocket(L,[E],I):F=new WebSocket(L,[E]),F.binaryType="arraybuffer",F}var b=(x,I)=>{o("streamBuilder");let E=p(I);E.hostname=E.hostname||E.host||"localhost";let L=f(E,x),F=m(x,L,E),B=a.default.createWebSocketStream(F,E.wsOptions);return B.url=L,F.on("close",()=>{B.destroy()}),B};e.streamBuilder=b;var _=(x,I)=>{o("browserStreamBuilder");let E,L=g(I).browserBufferSize||1024*512,F=I.browserBufferTimeout||1e3,B=!I.objectMode,T=A(x,I),U=J(I,Y,me);I.objectMode||(U._writev=s.writev.bind(U)),U.on("close",()=>{T.close()});let W=typeof T.addEventListener<"u";T.readyState===T.OPEN?(E=U,E.socket=T):(E=new s.BufferedDuplex(I,U,T),W?T.addEventListener("open",ne):T.onopen=ne),W?(T.addEventListener("close",C),T.addEventListener("error",q),T.addEventListener("message",te)):(T.onclose=C,T.onerror=q,T.onmessage=te);function J(se,H,be){let oe=new i.Transform({objectMode:se.objectMode});return oe._write=H,oe._flush=be,oe}function ne(){o("WebSocket onOpen"),E instanceof s.BufferedDuplex&&E.socketReady()}function C(se){o("WebSocket onClose",se),E.end(),E.destroy()}function q(se){o("WebSocket onError",se);let H=new Error("WebSocket error");H.event=se,E.destroy(H)}async function te(se){let{data:H}=se;H instanceof ArrayBuffer?H=t.Buffer.from(H):H instanceof Blob?H=t.Buffer.from(await new Response(H).arrayBuffer()):H=t.Buffer.from(H,"utf8"),U&&!U.destroyed&&U.push(H)}function Y(se,H,be){if(T.bufferedAmount>L){setTimeout(Y,F,se,H,be);return}B&&typeof se=="string"&&(se=t.Buffer.from(se,"utf8"));try{T.send(se)}catch(oe){return be(oe)}be()}function me(se){T.close(),se()}return E};e.browserStreamBuilder=_}),Vi={};Ut(Vi,{Server:()=>Ne,Socket:()=>Ne,Stream:()=>Ne,_createServerHandle:()=>Ne,_normalizeArgs:()=>Ne,_setSimultaneousAccepts:()=>Ne,connect:()=>Ne,createConnection:()=>Ne,createServer:()=>Ne,default:()=>Ma,isIP:()=>Ne,isIPv4:()=>Ne,isIPv6:()=>Ne});function Ne(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}var Ma,Ua=Ge(()=>{ae(),ue(),le(),Ma={_createServerHandle:Ne,_normalizeArgs:Ne,_setSimultaneousAccepts:Ne,connect:Ne,createConnection:Ne,createServer:Ne,isIP:Ne,isIPv4:Ne,isIPv6:Ne,Server:Ne,Socket:Ne,Stream:Ne}}),Da=Ae(e=>{ae(),ue(),le();var n=e&&e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0});var t=n((Ua(),Ue(Vi))),a=n(St()),u=(0,a.default)("mqttjs:tcp"),i=(r,s)=>{s.port=s.port||1883,s.hostname=s.hostname||s.host||"localhost";let{port:o,path:l}=s,f=s.hostname;return u("port %d and host %s",o,f),t.default.createConnection({port:o,host:f,path:l})};e.default=i}),La={};Ut(La,{default:()=>Na});var Na,qc=Ge(()=>{ae(),ue(),le(),Na={}}),Fa=Ae(e=>{ae(),ue(),le();var n=e&&e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});var t=n((qc(),Ue(La))),a=n((Ua(),Ue(Vi))),u=n(St()),i=(0,u.default)("mqttjs:tls"),r=(s,o)=>{o.port=o.port||8883,o.host=o.hostname||o.host||"localhost",a.default.isIP(o.host)===0&&(o.servername=o.host),o.rejectUnauthorized=o.rejectUnauthorized!==!1,delete o.path,i("port %d host %s rejectUnauthorized %b",o.port,o.host,o.rejectUnauthorized);let l=t.default.connect(o);l.on("secureConnect",()=>{o.rejectUnauthorized&&!l.authorized?l.emit("error",new Error("TLS not authorized")):l.removeListener("error",f)});function f(p){o.rejectUnauthorized&&s.emit("error",p),l.end()}return l.on("error",f),l};e.default=r}),ja=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"__esModule",{value:!0});var n=(Ze(),Ue(Je)),t=Ht(),a=ji(),u,i,r;function s(){let g=new t.Transform;return g._write=(m,A,b)=>{u.send({data:m.buffer,success(){b()},fail(_){b(new Error(_))}})},g._flush=m=>{u.close({success(){m()}})},g}function o(g){g.hostname||(g.hostname="localhost"),g.path||(g.path="/"),g.wsOptions||(g.wsOptions={})}function l(g,m){let A=g.protocol==="wxs"?"wss":"ws",b=`${A}://${g.hostname}${g.path}`;return g.port&&g.port!==80&&g.port!==443&&(b=`${A}://${g.hostname}:${g.port}${g.path}`),typeof g.transformWsUrl=="function"&&(b=g.transformWsUrl(b,g,m)),b}function f(){u.onOpen(()=>{r.socketReady()}),u.onMessage(g=>{let{data:m}=g;m instanceof ArrayBuffer?m=n.Buffer.from(m):m=n.Buffer.from(m,"utf8"),i.push(m)}),u.onClose(()=>{r.emit("close"),r.end(),r.destroy()}),u.onError(g=>{let m=new Error(g.errMsg);r.destroy(m)})}var p=(g,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";o(m);let b=l(m,g);u=wx.connectSocket({url:b,protocols:[A]}),i=s(),r=new a.BufferedDuplex(m,i,u),r._destroy=(x,I)=>{u.close({success(){I&&I(x)}})};let _=r.destroy;return r.destroy=(x,I)=>(r.destroy=_,setTimeout(()=>{u.close({fail(){r._destroy(x,I)}})},0),r),f(),r};e.default=p}),Va=Ae(e=>{ae(),ue(),le(),Object.defineProperty(e,"__esModule",{value:!0});var n=(Ze(),Ue(Je)),t=Ht(),a=ji(),u,i,r,s=!1;function o(){let m=new t.Transform;return m._write=(A,b,_)=>{u.sendSocketMessage({data:A.buffer,success(){_()},fail(){_(new Error)}})},m._flush=A=>{u.closeSocket({success(){A()}})},m}function l(m){m.hostname||(m.hostname="localhost"),m.path||(m.path="/"),m.wsOptions||(m.wsOptions={})}function f(m,A){let b=m.protocol==="alis"?"wss":"ws",_=`${b}://${m.hostname}${m.path}`;return m.port&&m.port!==80&&m.port!==443&&(_=`${b}://${m.hostname}:${m.port}${m.path}`),typeof m.transformWsUrl=="function"&&(_=m.transformWsUrl(_,m,A)),_}function p(){s||(s=!0,u.onSocketOpen(()=>{r.socketReady()}),u.onSocketMessage(m=>{if(typeof m.data=="string"){let A=n.Buffer.from(m.data,"base64");i.push(A)}else{let A=new FileReader;A.addEventListener("load",()=>{let b=A.result;b instanceof ArrayBuffer?b=n.Buffer.from(b):b=n.Buffer.from(b,"utf8"),i.push(b)}),A.readAsArrayBuffer(m.data)}}),u.onSocketClose(()=>{r.end(),r.destroy()}),u.onSocketError(m=>{r.destroy(m)}))}var g=(m,A)=>{if(A.hostname=A.hostname||A.host,!A.hostname)throw new Error("Could not determine host. Specify host manually.");let b=A.protocolId==="MQIsdp"&&A.protocolVersion===3?"mqttv3.1":"mqtt";l(A);let _=f(A,m);return u=A.my,u.connectSocket({url:_,protocols:b}),i=o(),r=new a.BufferedDuplex(A,i,u),p(),r};e.default=g}),$c=Ae(e=>{ae(),ue(),le();var n=e&&e.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.connectAsync=void 0;var t=n(St()),a=n((Qc(),Ue(Gs))),u=n(Ci()),i=n(Or());typeof(xe==null?void 0:xe.nextTick)!="function"&&(xe.nextTick=setImmediate);var r=(0,t.default)("mqttjs"),s=null;function o(p){let g;p.auth&&(g=p.auth.match(/^(.+):(.+)$/),g?(p.username=g[1],p.password=g[2]):p.username=p.auth)}function l(p,g){var m,A,b,_;if(r("connecting to an MQTT broker..."),typeof p=="object"&&!g&&(g=p,p=""),g=g||{},p&&typeof p=="string"){let E=a.default.parse(p,!0),L={};if(E.port!=null&&(L.port=Number(E.port)),L.host=E.hostname,L.query=E.query,L.auth=E.auth,L.protocol=E.protocol,L.path=E.path,L.protocol=(m=L.protocol)===null||m===void 0?void 0:m.replace(/:$/,""),g=Object.assign(Object.assign({},L),g),!g.protocol)throw new Error("Missing protocol")}if(g.unixSocket=g.unixSocket||((A=g.protocol)===null||A===void 0?void 0:A.includes("+unix")),g.unixSocket?g.protocol=g.protocol.replace("+unix",""):!(!((b=g.protocol)===null||b===void 0)&&b.startsWith("ws"))&&!(!((_=g.protocol)===null||_===void 0)&&_.startsWith("wx"))&&delete g.path,o(g),g.query&&typeof g.query.clientId=="string"&&(g.clientId=g.query.clientId),g.cert&&g.key)if(g.protocol){if(["mqtts","wss","wxs","alis"].indexOf(g.protocol)===-1)switch(g.protocol){case"mqtt":g.protocol="mqtts";break;case"ws":g.protocol="wss";break;case"wx":g.protocol="wxs";break;case"ali":g.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${g.protocol}"!`)}}else throw new Error("Missing secure protocol key");if(s||(s={},!i.default&&!g.forceNativeWebSocket?(s.ws=jr().streamBuilder,s.wss=jr().streamBuilder,s.mqtt=Da().default,s.tcp=Da().default,s.ssl=Fa().default,s.tls=s.ssl,s.mqtts=Fa().default):(s.ws=jr().browserStreamBuilder,s.wss=jr().browserStreamBuilder,s.wx=ja().default,s.wxs=ja().default,s.ali=Va().default,s.alis=Va().default)),!s[g.protocol]){let E=["mqtts","wss"].indexOf(g.protocol)!==-1;g.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((L,F)=>E&&F%2===0?!1:typeof s[L]=="function")[0]}if(g.clean===!1&&!g.clientId)throw new Error("Missing clientId for unclean clients");g.protocol&&(g.defaultProtocol=g.protocol);function x(E){return g.servers&&((!E._reconnectCount||E._reconnectCount===g.servers.length)&&(E._reconnectCount=0),g.host=g.servers[E._reconnectCount].host,g.port=g.servers[E._reconnectCount].port,g.protocol=g.servers[E._reconnectCount].protocol?g.servers[E._reconnectCount].protocol:g.defaultProtocol,g.hostname=g.host,E._reconnectCount++),r("calling streambuilder for",g.protocol),s[g.protocol](E,g)}let I=new u.default(x,g);return I.on("error",()=>{}),I}function f(p,g,m=!0){return new Promise((A,b)=>{let _=l(p,g),x={connect:E=>{I(),A(_)},end:()=>{I(),A(_)},error:E=>{I(),_.end(),b(E)}};m===!1&&(x.close=()=>{x.error(new Error("Couldn't connect to server"))});function I(){Object.keys(x).forEach(E=>{_.off(E,x[E])})}Object.keys(x).forEach(E=>{_.on(E,x[E])})})}e.connectAsync=f,e.default=l}),Ka=Ae(e=>{ae(),ue(),le();var n=e&&e.__createBinding||(Object.create?function(m,A,b,_){_===void 0&&(_=b);var x=Object.getOwnPropertyDescriptor(A,b);(!x||("get"in x?!A.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return A[b]}}),Object.defineProperty(m,_,x)}:function(m,A,b,_){_===void 0&&(_=b),m[_]=A[b]}),t=e&&e.__setModuleDefault||(Object.create?function(m,A){Object.defineProperty(m,"default",{enumerable:!0,value:A})}:function(m,A){m.default=A}),a=e&&e.__importStar||function(m){if(m&&m.__esModule)return m;var A={};if(m!=null)for(var b in m)b!=="default"&&Object.prototype.hasOwnProperty.call(m,b)&&n(A,m,b);return t(A,m),A},u=e&&e.__exportStar||function(m,A){for(var b in m)b!=="default"&&!Object.prototype.hasOwnProperty.call(A,b)&&n(A,m,b)},i=e&&e.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(e,"__esModule",{value:!0}),e.ReasonCodes=e.KeepaliveManager=e.UniqueMessageIdProvider=e.DefaultMessageIdProvider=e.Store=e.MqttClient=e.connectAsync=e.connect=e.Client=void 0;var r=i(Ci());e.MqttClient=r.default;var s=i(Ts());e.DefaultMessageIdProvider=s.default;var o=i(Tc());e.UniqueMessageIdProvider=o.default;var l=i(Bs());e.Store=l.default;var f=a($c());e.connect=f.default,Object.defineProperty(e,"connectAsync",{enumerable:!0,get:function(){return f.connectAsync}});var p=i(Ds());e.KeepaliveManager=p.default,e.Client=r.default,u(Ci(),e),u(ir(),e);var g=Br();Object.defineProperty(e,"ReasonCodes",{enumerable:!0,get:function(){return g.ReasonCodes}})}),zc=Ae(e=>{ae(),ue(),le();var n=e&&e.__createBinding||(Object.create?function(r,s,o,l){l===void 0&&(l=o);var f=Object.getOwnPropertyDescriptor(s,o);(!f||("get"in f?!s.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(r,l,f)}:function(r,s,o,l){l===void 0&&(l=o),r[l]=s[o]}),t=e&&e.__setModuleDefault||(Object.create?function(r,s){Object.defineProperty(r,"default",{enumerable:!0,value:s})}:function(r,s){r.default=s}),a=e&&e.__importStar||function(r){if(r&&r.__esModule)return r;var s={};if(r!=null)for(var o in r)o!=="default"&&Object.prototype.hasOwnProperty.call(r,o)&&n(s,r,o);return t(s,r),s},u=e&&e.__exportStar||function(r,s){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&n(s,r,o)};Object.defineProperty(e,"__esModule",{value:!0});var i=a(Ka());e.default=i,u(Ka(),e)});const Yc=zc();/*! Bundled license information:
|
|
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-ec1a0218]{font-size:1.3125rem;color:var(--sc-primary-text-color)}.beam_item-count span[data-v-ec1a0218]{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:{},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(()=>h.value===o.denominator),a=e=>{const n=Number(e.target.innerHTML)||0;h.value=Math.min(n,o.denominator)},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-ec1a0218"]]),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:
|
|
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
|
+
safe-buffer/index.js:
|
|
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"})});
|
|
11
14
|
//# sourceMappingURL=beam.umd.cjs.map
|