@note3/utils 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/applog-collection.d.ts +49 -0
  2. package/dist/applog-collection.d.ts.map +1 -0
  3. package/dist/applog-collection.min.js +2 -0
  4. package/dist/applog-collection.min.js.map +1 -0
  5. package/dist/chunk-4ARVEMAY.min.js +2 -0
  6. package/dist/chunk-4ARVEMAY.min.js.map +1 -0
  7. package/dist/chunk-5TTMWYXD.min.js +3 -0
  8. package/dist/chunk-5TTMWYXD.min.js.map +1 -0
  9. package/dist/chunk-IFY2JCCQ.min.js +2 -0
  10. package/dist/chunk-IFY2JCCQ.min.js.map +1 -0
  11. package/dist/chunk-KFV32MHC.min.js +2 -0
  12. package/dist/chunk-KFV32MHC.min.js.map +1 -0
  13. package/dist/chunk-KHOUPFOL.min.js +1 -0
  14. package/dist/chunk-KHOUPFOL.min.js.map +1 -0
  15. package/dist/chunk-KY36PVHK.min.js +2 -0
  16. package/dist/chunk-KY36PVHK.min.js.map +1 -0
  17. package/dist/chunk-LDNVHZO7.min.js +2 -0
  18. package/dist/chunk-LDNVHZO7.min.js.map +1 -0
  19. package/dist/chunk-MXMMU6NF.min.js +2 -0
  20. package/dist/chunk-MXMMU6NF.min.js.map +1 -0
  21. package/dist/chunk-O72M27NE.min.js +2 -0
  22. package/dist/chunk-O72M27NE.min.js.map +1 -0
  23. package/dist/chunk-POX3PUJK.min.js +2 -0
  24. package/dist/chunk-POX3PUJK.min.js.map +1 -0
  25. package/dist/chunk-XL6QVLYO.min.js +2 -0
  26. package/dist/chunk-XL6QVLYO.min.js.map +1 -0
  27. package/dist/chunk-YXZYW2WJ.min.js +78 -0
  28. package/dist/chunk-YXZYW2WJ.min.js.map +1 -0
  29. package/dist/chunk-ZJUZ7RVG.min.js +2 -0
  30. package/dist/chunk-ZJUZ7RVG.min.js.map +1 -0
  31. package/dist/corejs.d.ts +19 -0
  32. package/dist/corejs.d.ts.map +1 -0
  33. package/dist/corejs.min.js +2 -0
  34. package/dist/corejs.min.js.map +1 -0
  35. package/dist/helpers.d.ts +7 -0
  36. package/dist/helpers.d.ts.map +1 -0
  37. package/dist/helpers.min.js +2 -0
  38. package/dist/helpers.min.js.map +1 -0
  39. package/dist/index.d.ts +11 -0
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/index.min.js +2 -0
  42. package/dist/index.min.js.map +1 -0
  43. package/dist/map.d.ts +5 -0
  44. package/dist/map.d.ts.map +1 -0
  45. package/dist/map.min.js +2 -0
  46. package/dist/map.min.js.map +1 -0
  47. package/dist/note3-regex-constants.d.ts +21 -0
  48. package/dist/note3-regex-constants.d.ts.map +1 -0
  49. package/dist/note3-regex-constants.min.js +2 -0
  50. package/dist/note3-regex-constants.min.js.map +1 -0
  51. package/dist/note3-utils-nodeps.d.ts +22 -0
  52. package/dist/note3-utils-nodeps.d.ts.map +1 -0
  53. package/dist/note3-utils-nodeps.min.js +2 -0
  54. package/dist/note3-utils-nodeps.min.js.map +1 -0
  55. package/dist/queries.d.ts +53 -0
  56. package/dist/queries.d.ts.map +1 -0
  57. package/dist/queries.min.js +2 -0
  58. package/dist/queries.min.js.map +1 -0
  59. package/dist/relation-ordering.d.ts +13 -0
  60. package/dist/relation-ordering.d.ts.map +1 -0
  61. package/dist/relation-ordering.min.js +2 -0
  62. package/dist/relation-ordering.min.js.map +1 -0
  63. package/dist/tree-builder.d.ts +117 -0
  64. package/dist/tree-builder.d.ts.map +1 -0
  65. package/dist/tree-builder.min.js +2 -0
  66. package/dist/tree-builder.min.js.map +1 -0
  67. package/dist/types.d.ts +20 -0
  68. package/dist/types.d.ts.map +1 -0
  69. package/dist/types.min.js +2 -0
  70. package/dist/types.min.js.map +1 -0
  71. package/dist/url-parsing.d.ts +138 -0
  72. package/dist/url-parsing.d.ts.map +1 -0
  73. package/dist/url-parsing.min.js +2 -0
  74. package/dist/url-parsing.min.js.map +1 -0
  75. package/package.json +2 -2
@@ -0,0 +1,78 @@
1
+ var Mf={0:"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'",1:function(t,n){return"Cannot apply '"+t+"' to '"+n.toString()+"': Field not found."},5:"'keys()' can only be used on observable objects, arrays, sets and maps",6:"'values()' can only be used on observable objects, arrays, sets and maps",7:"'entries()' can only be used on observable objects, arrays and maps",8:"'set()' can only be used on observable objects, arrays and maps",9:"'remove()' can only be used on observable objects, arrays and maps",10:"'has()' can only be used on observable objects, arrays and maps",11:"'get()' can only be used on observable objects, arrays and maps",12:"Invalid annotation",13:"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",14:"Intercept handlers should return nothing or a change object",15:"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",16:"Modification exception: the internal structure of an observable array was changed.",17:function(t,n){return"[mobx.array] Index out of bounds, "+t+" is larger than "+n},18:"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js",19:function(t){return"Cannot initialize from classes that inherit from Map: "+t.constructor.name},20:function(t){return"Cannot initialize map from "+t},21:function(t){return"Cannot convert to map from '"+t+"'"},22:"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js",23:"It is not possible to get index atoms from arrays",24:function(t){return"Cannot obtain administration from "+t},25:function(t,n){return"the entry '"+t+"' does not exist in the observable map '"+n+"'"},26:"please specify a property",27:function(t,n){return"no observable property '"+t.toString()+"' found on the observable object '"+n+"'"},28:function(t){return"Cannot obtain atom from "+t},29:"Expecting some object",30:"invalid action stack. did you forget to finish an action?",31:"missing option for computed: get",32:function(t,n){return"Cycle detected in computation "+t+": "+n},33:function(t){return"The setter of computed value '"+t+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"},34:function(t){return"[ComputedValue '"+t+"'] It is not possible to assign a new value to a computed value."},35:"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`",36:"isolateGlobalState should be called before MobX is running any reactions",37:function(t){return"[mobx] `observableArray."+t+"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice()."+t+"()` instead"},38:"'ownKeys()' can only be used on observable objects",39:"'defineProperty()' can only be used on observable objects"},Lf=Mf;function ae(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=typeof e=="string"?e:Lf[e];throw typeof i=="function"&&(i=i.apply(null,n)),new Error("[MobX] "+i)}var Df={};function ei(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:Df}var qs=Object.assign,zr=Object.getOwnPropertyDescriptor,Nt=Object.defineProperty,ur=Object.prototype,Wr=[];Object.freeze(Wr);var co={};Object.freeze(co);var Bf=typeof Proxy<"u",Ff=Object.toString();function Hs(){Bf||ae("`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`")}function ir(e){q.verifyProxies&&ae("MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to "+e)}function yt(){return++q.mobxGuid}function fo(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var Cn=function(){};function Re(e){return typeof e=="function"}function cn(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function ti(e){return e!==null&&typeof e=="object"}function At(e){if(!ti(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n.toString()===Ff}function Js(e){var t=e?.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function ni(e,t,n){Nt(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function Xs(e,t,n){Nt(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function Ht(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(r){return ti(r)&&r[n]===!0}}function Mn(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function kf(e){var t=Object.getPrototypeOf(e),n=Object.getPrototypeOf(t),r=Object.getPrototypeOf(n);return r===null}function Dt(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var Ys=typeof Object.getOwnPropertySymbols<"u";function Kf(e){var t=Object.keys(e);if(!Ys)return t;var n=Object.getOwnPropertySymbols(e);return n.length?[].concat(t,n.filter(function(r){return ur.propertyIsEnumerable.call(e,r)})):t}var ri=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Ys?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function Zi(e){return typeof e=="string"?e:typeof e=="symbol"?e.toString():new String(e).toString()}function Zs(e){return e===null?null:typeof e=="object"?""+e:e}function ft(e,t){return ur.hasOwnProperty.call(e,t)}var Gf=Object.getOwnPropertyDescriptors||function(t){var n={};return ri(t).forEach(function(r){n[r]=zr(t,r)}),n};function Ye(e,t){return!!(e&t)}function Ze(e,t,n){return n?e|=t:e&=~t,e}function $s(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Rs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,zf(r.key),r)}}function Ln(e,t,n){return t&&Rs(e.prototype,t),n&&Rs(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function xn(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=Wf(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kt(){return kt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kt.apply(null,arguments)}function Qs(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Qi(e,t)}function Qi(e,t){return Qi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Qi(e,t)}function Vf(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zf(e){var t=Vf(e,"string");return typeof t=="symbol"?t:t+""}function Wf(e,t){if(e){if(typeof e=="string")return $s(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$s(e,t):void 0}}var Je=Symbol("mobx-stored-annotations");function Ct(e){function t(n,r){if(fr(r))return e.decorate_20223_(n,r);cr(n,r,e)}return Object.assign(t,e)}function cr(e,t,n){if(ft(e,Je)||ni(e,Je,kt({},e[Je])),qr(n)&&!ft(e[Je],t)){var r=e.constructor.name+".prototype."+t.toString();ae("'"+r+"' is decorated with 'override', but no such decorated member was found on prototype.")}qf(e,n,t),qr(n)||(e[Je][t]=n)}function qf(e,t,n){if(!qr(t)&&ft(e[Je],n)){var r=e.constructor.name+".prototype."+n.toString(),i=e[Je][n].annotationType_,s=t.annotationType_;ae("Cannot apply '@"+s+"' to '"+r+"':"+(`
3
+ The field is already decorated with '@`+i+"'.")+`
4
+ Re-decorating fields is not allowed.
5
+ Use '@override' decorator for methods overridden by subclass.`)}}function Hf(e){return ft(e,Je)||ni(e,Je,kt({},e[Je])),e[Je]}function fr(e){return typeof e=="object"&&typeof e.kind=="string"}function ii(e,t){t.includes(e.kind)||ae("The decorator applied to '"+String(e.name)+"' cannot be used on a "+e.kind+" element")}var he=Symbol("mobx administration"),Jt=(function(){function e(n){n===void 0&&(n="Atom@"+yt()),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=_e.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=n}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},t.reportObserved=function(){return ma(this)},t.reportChanged=function(){at(),ba(this),ut()},t.toString=function(){return this.name_},Ln(e,[{key:"isBeingObserved",get:function(){return Ye(this.flags_,e.isBeingObservedMask_)},set:function(r){this.flags_=Ze(this.flags_,e.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return Ye(this.flags_,e.isPendingUnobservationMask_)},set:function(r){this.flags_=Ze(this.flags_,e.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return Ye(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=Ze(this.flags_,e.diffValueMask_,r===1)}}])})();Jt.isBeingObservedMask_=1;Jt.isPendingUnobservationMask_=2;Jt.diffValueMask_=4;var lo=Ht("Atom",Jt);function ea(e,t,n){t===void 0&&(t=Cn),n===void 0&&(n=Cn);var r=new Jt(e);return t!==Cn&&ci(r,t),n!==Cn&&hn(r,n),r}function Jf(e,t){return e===t}function Xf(e,t){return To(e,t)}function Yf(e,t){return To(e,t,1)}function Zf(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var qe={identity:Jf,structural:Xf,default:Zf,shallow:Yf};function fn(e,t,n){return jn(e)?e:Array.isArray(e)?Pe.array(e,{name:n}):At(e)?Pe.object(e,void 0,{name:n}):Mn(e)?Pe.map(e,{name:n}):Dt(e)?Pe.set(e,{name:n}):typeof e=="function"&&!qt(e)&&!ar(e)?Js(e)?Un(e):sr(n,e):e}function Qf(e,t,n){if(e==null||pn(e)||Fn(e)||xt(e)||_t(e))return e;if(Array.isArray(e))return Pe.array(e,{name:n,deep:!1});if(At(e))return Pe.object(e,void 0,{name:n,deep:!1});if(Mn(e))return Pe.map(e,{name:n,deep:!1});if(Dt(e))return Pe.set(e,{name:n,deep:!1});ae("The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets")}function oi(e){return e}function el(e,t){return jn(e)&&ae("observable.struct should not be used with observable values"),To(e,t)?t:e}var tl="override";function qr(e){return e.annotationType_===tl}function lr(e,t){return{annotationType_:e,options_:t,make_:nl,extend_:rl,decorate_20223_:il}}function nl(e,t,n,r){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(e,t,n,!1)===null?0:1;if(r===e.target_)return this.extend_(e,t,n,!1)===null?0:2;if(qt(n.value))return 1;var s=ta(e,this,t,n,!1);return Nt(r,t,s),2}function rl(e,t,n,r){var i=ta(e,this,t,n);return e.defineProperty_(t,i,r)}function il(e,t){ii(t,["method","field"]);var n=t.kind,r=t.name,i=t.addInitializer,s=this,o=function(c){var h,m,M,S;return ln((h=(m=s.options_)==null?void 0:m.name)!=null?h:r.toString(),c,(M=(S=s.options_)==null?void 0:S.autoAction)!=null?M:!1)};if(n=="field")return function(f){var c,h=f;return qt(h)||(h=o(h)),(c=s.options_)!=null&&c.bound&&(h=h.bind(this),h.isMobxAction=!0),h};if(n=="method"){var u;return qt(e)||(e=o(e)),(u=this.options_)!=null&&u.bound&&i(function(){var f=this,c=f[r].bind(f);c.isMobxAction=!0,f[r]=c}),e}ae("Cannot apply '"+s.annotationType_+"' to '"+String(r)+"' (kind: "+n+"):"+(`
6
+ '`+s.annotationType_+"' can only be used on properties with a function value."))}function ol(e,t,n,r){var i=t.annotationType_,s=r.value;Re(s)||ae("Cannot apply '"+i+"' to '"+e.name_+"."+n.toString()+"':"+(`
7
+ '`+i+"' can only be used on properties with a function value."))}function ta(e,t,n,r,i){var s,o,u,f,c,h,m;i===void 0&&(i=q.safeDescriptors),ol(e,t,n,r);var M=r.value;if((s=t.options_)!=null&&s.bound){var S;M=M.bind((S=e.proxy_)!=null?S:e.target_)}return{value:ln((o=(u=t.options_)==null?void 0:u.name)!=null?o:n.toString(),M,(f=(c=t.options_)==null?void 0:c.autoAction)!=null?f:!1,(h=t.options_)!=null&&h.bound?(m=e.proxy_)!=null?m:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function na(e,t){return{annotationType_:e,options_:t,make_:sl,extend_:al,decorate_20223_:ul}}function sl(e,t,n,r){var i;if(r===e.target_)return this.extend_(e,t,n,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!ft(e.target_,t)||!ar(e.target_[t]))&&this.extend_(e,t,n,!1)===null)return 0;if(ar(n.value))return 1;var s=ra(e,this,t,n,!1,!1);return Nt(r,t,s),2}function al(e,t,n,r){var i,s=ra(e,this,t,n,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,s,r)}function ul(e,t){var n;ii(t,["method"]);var r=t.name,i=t.addInitializer;return ar(e)||(e=Un(e)),(n=this.options_)!=null&&n.bound&&i(function(){var s=this,o=s[r].bind(s);o.isMobXFlow=!0,s[r]=o}),e}function cl(e,t,n,r){var i=t.annotationType_,s=r.value;Re(s)||ae("Cannot apply '"+i+"' to '"+e.name_+"."+n.toString()+"':"+(`
8
+ '`+i+"' can only be used on properties with a generator function value."))}function ra(e,t,n,r,i,s){s===void 0&&(s=q.safeDescriptors),cl(e,t,n,r);var o=r.value;if(ar(o)||(o=Un(o)),i){var u;o=o.bind((u=e.proxy_)!=null?u:e.target_),o.isMobXFlow=!0}return{value:o,configurable:s?e.isPlainObject_:!0,enumerable:!1,writable:!s}}function po(e,t){return{annotationType_:e,options_:t,make_:fl,extend_:ll,decorate_20223_:dl}}function fl(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function ll(e,t,n,r){return pl(e,this,t,n),e.defineComputedProperty_(t,kt({},this.options_,{get:n.get,set:n.set}),r)}function dl(e,t){ii(t,["getter"]);var n=this,r=t.name,i=t.addInitializer;return i(function(){var s=kn(this)[he],o=kt({},n.options_,{get:e,context:this});o.name||(o.name=s.name_+"."+r.toString()),s.values_.set(r,new dt(o))}),function(){return this[he].getObservablePropValue_(r)}}function pl(e,t,n,r){var i=t.annotationType_,s=r.get;s||ae("Cannot apply '"+i+"' to '"+e.name_+"."+n.toString()+"':"+(`
9
+ '`+i+"' can only be used on getter(+setter) properties."))}function si(e,t){return{annotationType_:e,options_:t,make_:yl,extend_:hl,decorate_20223_:gl}}function yl(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function hl(e,t,n,r){var i,s;return ml(e,this,t,n),e.defineObservableProperty_(t,n.value,(i=(s=this.options_)==null?void 0:s.enhancer)!=null?i:fn,r)}function gl(e,t){if(t.kind==="field")throw ae("Please use `@observable accessor "+String(t.name)+"` instead of `@observable "+String(t.name)+"`");ii(t,["accessor"]);var n=this,r=t.kind,i=t.name,s=new WeakSet;function o(u,f){var c,h,m=kn(u)[he],M=new Wt(f,(c=(h=n.options_)==null?void 0:h.enhancer)!=null?c:fn,m.name_+"."+i.toString(),!1);m.values_.set(i,M),s.add(u)}if(r=="accessor")return{get:function(){return s.has(this)||o(this,e.get.call(this)),this[he].getObservablePropValue_(i)},set:function(f){return s.has(this)||o(this,f),this[he].setObservablePropValue_(i,f)},init:function(f){return s.has(this)||o(this,f),f}}}function ml(e,t,n,r){var i=t.annotationType_;"value"in r||ae("Cannot apply '"+i+"' to '"+e.name_+"."+n.toString()+"':"+(`
10
+ '`+i+"' cannot be used on getter/setter properties"))}var bl="true",vl=ia();function ia(e){return{annotationType_:bl,options_:e,make_:_l,extend_:Tl,decorate_20223_:wl}}function _l(e,t,n,r){var i,s;if(n.get)return ht.make_(e,t,n,r);if(n.set){var o=ln(t.toString(),n.set);return r===e.target_?e.defineProperty_(t,{configurable:q.safeDescriptors?e.isPlainObject_:!0,set:o})===null?0:2:(Nt(r,t,{configurable:!0,set:o}),2)}if(r!==e.target_&&typeof n.value=="function"){var u;if(Js(n.value)){var f,c=(f=this.options_)!=null&&f.autoBind?Un.bound:Un;return c.make_(e,t,n,r)}var h=(u=this.options_)!=null&&u.autoBind?sr.bound:sr;return h.make_(e,t,n,r)}var m=((i=this.options_)==null?void 0:i.deep)===!1?Pe.ref:Pe;if(typeof n.value=="function"&&(s=this.options_)!=null&&s.autoBind){var M;n.value=n.value.bind((M=e.proxy_)!=null?M:e.target_)}return m.make_(e,t,n,r)}function Tl(e,t,n,r){var i,s;if(n.get)return ht.extend_(e,t,n,r);if(n.set)return e.defineProperty_(t,{configurable:q.safeDescriptors?e.isPlainObject_:!0,set:ln(t.toString(),n.set)},r);if(typeof n.value=="function"&&(i=this.options_)!=null&&i.autoBind){var o;n.value=n.value.bind((o=e.proxy_)!=null?o:e.target_)}var u=((s=this.options_)==null?void 0:s.deep)===!1?Pe.ref:Pe;return u.extend_(e,t,n,r)}function wl(e,t){ae("'"+this.annotationType_+"' cannot be used as a decorator")}var Ol="observable",Al="observable.ref",Il="observable.shallow",El="observable.struct",oa={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(oa);function Dr(e){return e||oa}var eo=si(Ol),Sl=si(Al,{enhancer:oi}),Pl=si(Il,{enhancer:Qf}),$l=si(El,{enhancer:el}),sa=Ct(eo);function Br(e){return e.deep===!0?fn:e.deep===!1?oi:Nl(e.defaultDecorator)}function Rl(e){var t;return e?(t=e.defaultDecorator)!=null?t:ia(e):void 0}function Nl(e){var t,n;return e&&(t=(n=e.options_)==null?void 0:n.enhancer)!=null?t:fn}function aa(e,t,n){if(fr(t))return eo.decorate_20223_(e,t);if(cn(t)){cr(e,t,eo);return}return jn(e)?e:At(e)?Pe.object(e,t,n):Array.isArray(e)?Pe.array(e,t):Mn(e)?Pe.map(e,t):Dt(e)?Pe.set(e,t):typeof e=="object"&&e!==null?e:Pe.box(e,t)}qs(aa,sa);var Cl={box:function(t,n){var r=Dr(n);return new Wt(t,Br(r),r.name,!0,r.equals)},array:function(t,n){var r=Dr(n);return(q.useProxies===!1||r.proxy===!1?Cd:wd)(t,Br(r),r.name)},map:function(t,n){var r=Dr(n);return new xa(t,Br(r),r.name)},set:function(t,n){var r=Dr(n);return new Ua(t,Br(r),r.name)},object:function(t,n,r){return gn(function(){return ld(q.useProxies===!1||r?.proxy===!1?kn({},r):vd({},r),t,n)})},ref:Ct(Sl),shallow:Ct(Pl),deep:sa,struct:Ct($l)},Pe=qs(aa,Cl),ua="computed",xl="computed.struct",to=po(ua),Ul=po(xl,{equals:qe.structural}),ht=function(t,n){if(fr(n))return to.decorate_20223_(t,n);if(cn(n))return cr(t,n,to);if(At(t))return Ct(po(ua,t));Re(t)||ae("First argument to `computed` should be an expression."),Re(n)&&ae("A setter as second argument is no longer supported, use `{ set: fn }` option instead");var r=At(n)?n:{};return r.get=t,r.name||(r.name=t.name||""),new dt(r)};Object.assign(ht,to);ht.struct=Ct(Ul);var Ns,Cs,Hr=0,jl=1,Ml=(Ns=(Cs=zr(function(){},"name"))==null?void 0:Cs.configurable)!=null?Ns:!1,xs={value:"action",configurable:!0,writable:!1,enumerable:!1};function ln(e,t,n,r){n===void 0&&(n=!1),Re(t)||ae("`action` can only be invoked on functions"),(typeof e!="string"||!e)&&ae("actions should have valid names, got: '"+e+"'");function i(){return ca(e,n,t,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},Ml&&(xs.value=e,Nt(i,"name",xs)),i}function ca(e,t,n,r,i){var s=Ll(e,t,r,i);try{return n.apply(r,i)}catch(o){throw s.error_=o,o}finally{Dl(s)}}function Ll(e,t,n,r){var i=Fe()&&!!e,s=0;if(i){s=Date.now();var o=r?Array.from(r):Wr;Qe({type:ho,name:e,object:n,arguments:o})}var u=q.trackingDerivation,f=!t||!u;at();var c=q.allowStateChanges;f&&(yn(),c=ai(!0));var h=yo(!0),m={runAsAction_:f,prevDerivation_:u,prevAllowStateChanges_:c,prevAllowStateReads_:h,notifySpy_:i,startTime_:s,actionId_:jl++,parentActionId_:Hr};return Hr=m.actionId_,m}function Dl(e){Hr!==e.actionId_&&ae(30),Hr=e.parentActionId_,e.error_!==void 0&&(q.suppressReactionErrors=!0),ui(e.prevAllowStateChanges_),or(e.prevAllowStateReads_),ut(),e.runAsAction_&&Ft(e.prevDerivation_),e.notifySpy_&&et({time:Date.now()-e.startTime_}),q.suppressReactionErrors=!1}function Bl(e,t){var n=ai(e);try{return t()}finally{ui(n)}}function ai(e){var t=q.allowStateChanges;return q.allowStateChanges=e,t}function ui(e){q.allowStateChanges=e}var Fl="create",Wt=(function(e){function t(r,i,s,o,u){var f;return s===void 0&&(s="ObservableValue@"+yt()),o===void 0&&(o=!0),u===void 0&&(u=qe.default),f=e.call(this,s)||this,f.enhancer=void 0,f.name_=void 0,f.equals=void 0,f.hasUnreportedChange_=!1,f.interceptors_=void 0,f.changeListeners_=void 0,f.value_=void 0,f.dehancer=void 0,f.enhancer=i,f.name_=s,f.equals=u,f.value_=i(r,void 0,s),o&&Fe()&&dn({type:Fl,object:f,observableKind:"value",debugObjectName:f.name_,newValue:""+f.value_}),f}Qs(t,e);var n=t.prototype;return n.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},n.set=function(i){var s=this.value_;if(i=this.prepareNewValue_(i),i!==q.UNCHANGED){var o=Fe();o&&Qe({type:Tt,object:this,observableKind:"value",debugObjectName:this.name_,newValue:i,oldValue:s}),this.setNewValue_(i),o&&et()}},n.prepareNewValue_=function(i){if(Rt(this),ot(this)){var s=st(this,{object:this,type:Tt,newValue:i});if(!s)return q.UNCHANGED;i=s.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?q.UNCHANGED:i},n.setNewValue_=function(i){var s=this.value_;this.value_=i,this.reportChanged(),wt(this)&&Ot(this,{type:Tt,object:this,newValue:i,oldValue:s})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(i){return hr(this,i)},n.observe_=function(i,s){return s&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:Tt,newValue:this.value_,oldValue:void 0}),gr(this,i)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return Zs(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},t})(Jt),kl=Ht("ObservableValue",Wt),dt=(function(){function e(n){this.dependenciesState_=_e.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=_e.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new Jr(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=lt.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,n.get||ae(31),this.derivation=n.get,this.name_=n.name||"ComputedValue@"+yt(),n.set&&(this.setter_=ln(this.name_+"-setter",n.set)),this.equals_=n.equals||(n.compareStructural||n.struct?qe.structural:qe.default),this.scope_=n.context,this.requiresReaction_=n.requiresReaction,this.keepAlive_=!!n.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){Xl(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},t.get=function(){if(this.isComputing&&ae(32,this.name_,this.derivation),q.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)no(this)&&(this.warnAboutUntrackedRead_(),at(),this.value_=this.computeValue_(!1),ut());else if(ma(this),no(this)){var r=q.trackingContext;this.keepAlive_&&!r&&(q.trackingContext=this),this.trackAndCompute()&&Jl(this),q.trackingContext=r}var i=this.value_;if(Kr(i))throw i.cause;return i},t.set=function(r){if(this.setter_){this.isRunningSetter&&ae(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,r)}finally{this.isRunningSetter=!1}}else ae(34,this.name_)},t.trackAndCompute=function(){var r=this.value_,i=this.dependenciesState_===_e.NOT_TRACKING_,s=this.computeValue_(!0),o=i||Kr(r)||Kr(s)||!this.equals_(r,s);return o&&(this.value_=s,Fe()&&dn({observableKind:"computed",debugObjectName:this.name_,object:this.scope_,type:"update",oldValue:r,newValue:s})),o},t.computeValue_=function(r){this.isComputing=!0;var i=ai(!1),s;if(r)s=la(this,this.derivation,this.scope_);else if(q.disableErrorBoundaries===!0)s=this.derivation.call(this.scope_);else try{s=this.derivation.call(this.scope_)}catch(o){s=new Jr(o)}return ui(i),this.isComputing=!1,s},t.suspend_=function(){this.keepAlive_||(ro(this),this.value_=void 0,this.isTracing_!==lt.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' was suspended and it will recompute on the next access."))},t.observe_=function(r,i){var s=this,o=!0,u=void 0;return go(function(){var f=s.get();if(!o||i){var c=yn();r({observableKind:"computed",debugObjectName:s.name_,type:Tt,object:s,newValue:f,oldValue:u}),Ft(c)}o=!1,u=f})},t.warnAboutUntrackedRead_=function(){this.isTracing_!==lt.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' is being read outside a reactive context. Doing a full recompute."),(typeof this.requiresReaction_=="boolean"?this.requiresReaction_:q.computedRequiresReaction)&&console.warn("[mobx] Computed value '"+this.name_+"' is being read outside a reactive context. Doing a full recompute.")},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return Zs(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},Ln(e,[{key:"isComputing",get:function(){return Ye(this.flags_,e.isComputingMask_)},set:function(r){this.flags_=Ze(this.flags_,e.isComputingMask_,r)}},{key:"isRunningSetter",get:function(){return Ye(this.flags_,e.isRunningSetterMask_)},set:function(r){this.flags_=Ze(this.flags_,e.isRunningSetterMask_,r)}},{key:"isBeingObserved",get:function(){return Ye(this.flags_,e.isBeingObservedMask_)},set:function(r){this.flags_=Ze(this.flags_,e.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return Ye(this.flags_,e.isPendingUnobservationMask_)},set:function(r){this.flags_=Ze(this.flags_,e.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return Ye(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=Ze(this.flags_,e.diffValueMask_,r===1)}}])})();dt.isComputingMask_=1;dt.isRunningSetterMask_=2;dt.isBeingObservedMask_=4;dt.isPendingUnobservationMask_=8;dt.diffValueMask_=16;var dr=Ht("ComputedValue",dt),_e;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(_e||(_e={}));var lt;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(lt||(lt={}));var Jr=function(t){this.cause=void 0,this.cause=t};function Kr(e){return e instanceof Jr}function no(e){switch(e.dependenciesState_){case _e.UP_TO_DATE_:return!1;case _e.NOT_TRACKING_:case _e.STALE_:return!0;case _e.POSSIBLY_STALE_:{for(var t=yo(!0),n=yn(),r=e.observing_,i=r.length,s=0;s<i;s++){var o=r[s];if(dr(o)){if(q.disableErrorBoundaries)o.get();else try{o.get()}catch{return Ft(n),or(t),!0}if(e.dependenciesState_===_e.STALE_)return Ft(n),or(t),!0}}return da(e),Ft(n),or(t),!1}}}function fa(){return q.trackingDerivation!==null}function Rt(e){var t=e.observers_.size>0;!q.allowStateChanges&&(t||q.enforceActions==="always")&&console.warn("[MobX] "+(q.enforceActions?"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: ":"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: ")+e.name_)}function Kl(e){!q.allowStateReads&&q.observableRequiresReaction&&console.warn("[mobx] Observable '"+e.name_+"' being read outside a reactive context.")}function la(e,t,n){var r=yo(!0);da(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++q.runId;var i=q.trackingDerivation;q.trackingDerivation=e,q.inBatch++;var s;if(q.disableErrorBoundaries===!0)s=t.call(n);else try{s=t.call(n)}catch(o){s=new Jr(o)}return q.inBatch--,q.trackingDerivation=i,Vl(e),Gl(e),or(r),s}function Gl(e){e.observing_.length===0&&(typeof e.requiresObservable_=="boolean"?e.requiresObservable_:q.reactionRequiresObservable)&&console.warn("[mobx] Derivation '"+e.name_+"' is created/updated without reading any observable value.")}function Vl(e){for(var t=e.observing_,n=e.observing_=e.newObserving_,r=_e.UP_TO_DATE_,i=0,s=e.unboundDepsCount_,o=0;o<s;o++){var u=n[o];u.diffValue===0&&(u.diffValue=1,i!==o&&(n[i]=u),i++),u.dependenciesState_>r&&(r=u.dependenciesState_)}for(n.length=i,e.newObserving_=null,s=t.length;s--;){var f=t[s];f.diffValue===0&&ha(f,e),f.diffValue=0}for(;i--;){var c=n[i];c.diffValue===1&&(c.diffValue=0,Hl(c,e))}r!==_e.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}function ro(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)ha(t[n],e);e.dependenciesState_=_e.NOT_TRACKING_}function Ne(e){var t=yn();try{return e()}finally{Ft(t)}}function yn(){var e=q.trackingDerivation;return q.trackingDerivation=null,e}function Ft(e){q.trackingDerivation=e}function yo(e){var t=q.allowStateReads;return q.allowStateReads=e,t}function or(e){q.allowStateReads=e}function da(e){if(e.dependenciesState_!==_e.UP_TO_DATE_){e.dependenciesState_=_e.UP_TO_DATE_;for(var t=e.observing_,n=t.length;n--;)t[n].lowestObserverState_=_e.UP_TO_DATE_}}var Gr=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},Vr=!0,pa=!1,q=(function(){var e=ei();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Vr=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new Gr().version&&(Vr=!1),Vr?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Gr):(setTimeout(function(){pa||ae(35)},1),new Gr)})();function zl(){if((q.pendingReactions.length||q.inBatch||q.isRunningReactions)&&ae(36),pa=!0,Vr){var e=ei();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),q=new Gr}}function ya(){return q}function Wl(e){return e.observers_&&e.observers_.size>0}function ql(e){return e.observers_}function Hl(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function ha(e,t){e.observers_.delete(t),e.observers_.size===0&&ga(e)}function ga(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,q.pendingUnobservations.push(e))}function at(){q.inBatch++}function ut(){if(--q.inBatch===0){Ta();for(var e=q.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,n.observers_.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBUO()),n instanceof dt&&n.suspend_())}q.pendingUnobservations=[]}}function ma(e){Kl(e);var t=q.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&q.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&q.inBatch>0&&ga(e),!1)}function ba(e){e.lowestObserverState_!==_e.STALE_&&(e.lowestObserverState_=_e.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===_e.UP_TO_DATE_&&(t.isTracing_!==lt.NONE&&va(t,e),t.onBecomeStale_()),t.dependenciesState_=_e.STALE_}))}function Jl(e){e.lowestObserverState_!==_e.STALE_&&(e.lowestObserverState_=_e.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===_e.POSSIBLY_STALE_?(t.dependenciesState_=_e.STALE_,t.isTracing_!==lt.NONE&&va(t,e)):t.dependenciesState_===_e.UP_TO_DATE_&&(e.lowestObserverState_=_e.UP_TO_DATE_)}))}function Xl(e){e.lowestObserverState_===_e.UP_TO_DATE_&&(e.lowestObserverState_=_e.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===_e.UP_TO_DATE_&&(t.dependenciesState_=_e.POSSIBLY_STALE_,t.onBecomeStale_())}))}function va(e,t){if(console.log("[mobx.trace] '"+e.name_+"' is invalidated due to a change in: '"+t.name_+"'"),e.isTracing_===lt.BREAK){var n=[];_a(pr(e),n,1),new Function(`debugger;
11
+ /*
12
+ Tracing '`+e.name_+`'
13
+
14
+ You are entering this break point because derivation '`+e.name_+"' is being traced and '"+t.name_+`' is now forcing it to update.
15
+ Just follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update
16
+ The stackframe you are looking for is at least ~6-8 stack-frames up.
17
+
18
+ `+(e instanceof dt?e.derivation.toString().replace(/[*]\//g,"/"):"")+`
19
+
20
+ The dependencies for this derivation are:
21
+
22
+ `+n.join(`
23
+ `)+`
24
+ */
25
+ `)()}}function _a(e,t,n){if(t.length>=1e3){t.push("(and many more)");return}t.push(""+" ".repeat(n-1)+e.name),e.dependencies&&e.dependencies.forEach(function(r){return _a(r,t,n+1)})}var It=(function(){function e(n,r,i,s){n===void 0&&(n="Reaction@"+yt()),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=_e.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=lt.NONE,this.name_=n,this.onInvalidate_=r,this.errorHandler_=i,this.requiresObservable_=s}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,q.pendingReactions.push(this),Ta())},t.runReaction_=function(){if(!this.isDisposed){at(),this.isScheduled=!1;var r=q.trackingContext;if(q.trackingContext=this,no(this)){this.isTrackPending=!0;try{this.onInvalidate_(),this.isTrackPending&&Fe()&&dn({name:this.name_,type:"scheduled-reaction"})}catch(i){this.reportExceptionInDerivation_(i)}}q.trackingContext=r,ut()}},t.track=function(r){if(!this.isDisposed){at();var i=Fe(),s;i&&(s=Date.now(),Qe({name:this.name_,type:"reaction"})),this.isRunning=!0;var o=q.trackingContext;q.trackingContext=this;var u=la(this,r,void 0);q.trackingContext=o,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&ro(this),Kr(u)&&this.reportExceptionInDerivation_(u.cause),i&&et({time:Date.now()-s}),ut()}},t.reportExceptionInDerivation_=function(r){var i=this;if(this.errorHandler_){this.errorHandler_(r,this);return}if(q.disableErrorBoundaries)throw r;var s="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";q.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name_+"' suppressed, fix error of causing action below)"):console.error(s,r),Fe()&&dn({type:"error",name:this.name_,message:s,error:""+r}),q.globalReactionErrorHandlers.forEach(function(o){return o(r,i)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(at(),ro(this),ut()))},t.getDisposer_=function(r){var i=this,s=function o(){i.dispose(),r==null||r.removeEventListener==null||r.removeEventListener("abort",o)};return r==null||r.addEventListener==null||r.addEventListener("abort",s),s[he]=this,s},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(r){r===void 0&&(r=!1),mo(this,r)},Ln(e,[{key:"isDisposed",get:function(){return Ye(this.flags_,e.isDisposedMask_)},set:function(r){this.flags_=Ze(this.flags_,e.isDisposedMask_,r)}},{key:"isScheduled",get:function(){return Ye(this.flags_,e.isScheduledMask_)},set:function(r){this.flags_=Ze(this.flags_,e.isScheduledMask_,r)}},{key:"isTrackPending",get:function(){return Ye(this.flags_,e.isTrackPendingMask_)},set:function(r){this.flags_=Ze(this.flags_,e.isTrackPendingMask_,r)}},{key:"isRunning",get:function(){return Ye(this.flags_,e.isRunningMask_)},set:function(r){this.flags_=Ze(this.flags_,e.isRunningMask_,r)}},{key:"diffValue",get:function(){return Ye(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=Ze(this.flags_,e.diffValueMask_,r===1)}}])})();It.isDisposedMask_=1;It.isScheduledMask_=2;It.isTrackPendingMask_=4;It.isRunningMask_=8;It.diffValueMask_=16;var Us=100,io=function(t){return t()};function Ta(){q.inBatch>0||q.isRunningReactions||io(Yl)}function Yl(){q.isRunningReactions=!0;for(var e=q.pendingReactions,t=0;e.length>0;){++t===Us&&(console.error("Reaction doesn't converge to a stable state after "+Us+" iterations."+(" Probably there is a cycle in the reactive function: "+e[0])),e.splice(0));for(var n=e.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction_()}q.isRunningReactions=!1}var Xr=Ht("Reaction",It);function Zl(e){var t=io;io=function(r){return e(function(){return t(r)})}}function Fe(){return!!q.spyListeners.length}function dn(e){if(q.spyListeners.length)for(var t=q.spyListeners,n=0,r=t.length;n<r;n++)t[n](e)}function Qe(e){var t=kt({},e,{spyReportStart:!0});dn(t)}var Ql={type:"report-end",spyReportEnd:!0};function et(e){dn(e?kt({},e,{type:"report-end",spyReportEnd:!0}):Ql)}function ed(e){return q.spyListeners.push(e),fo(function(){q.spyListeners=q.spyListeners.filter(function(t){return t!==e})})}var ho="action",td="action.bound",wa="autoAction",nd="autoAction.bound",Oa="<unnamed action>",oo=lr(ho),rd=lr(td,{bound:!0}),so=lr(wa,{autoAction:!0}),id=lr(nd,{autoAction:!0,bound:!0});function Aa(e){var t=function(r,i){if(Re(r))return ln(r.name||Oa,r,e);if(Re(i))return ln(r,i,e);if(fr(i))return(e?so:oo).decorate_20223_(r,i);if(cn(i))return cr(r,i,e?so:oo);if(cn(r))return Ct(lr(e?wa:ho,{name:r,autoAction:e}));ae("Invalid arguments for `action`")};return t}var ct=Aa(!1);Object.assign(ct,oo);var sr=Aa(!0);Object.assign(sr,so);ct.bound=Ct(rd);sr.bound=Ct(id);function Dn(e){return ca(e.name||Oa,!1,e,this,void 0)}function qt(e){return Re(e)&&e.isMobxAction===!0}function go(e,t){var n,r,i,s;t===void 0&&(t=co),Re(e)||ae("Autorun expects a function as first argument"),qt(e)&&ae("Autorun does not accept actions since actions are untrackable");var o=(n=(r=t)==null?void 0:r.name)!=null?n:e.name||"Autorun@"+yt(),u=!t.scheduler&&!t.delay,f;if(u)f=new It(o,function(){this.track(m)},t.onError,t.requiresObservable);else{var c=Ia(t),h=!1;f=new It(o,function(){h||(h=!0,c(function(){h=!1,f.isDisposed||f.track(m)}))},t.onError,t.requiresObservable)}function m(){e(f)}return(i=t)!=null&&(i=i.signal)!=null&&i.aborted||f.schedule_(),f.getDisposer_((s=t)==null?void 0:s.signal)}var od=function(t){return t()};function Ia(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:od}function Ea(e,t,n){var r,i,s;n===void 0&&(n=co),(!Re(e)||!Re(t))&&ae("First and second argument to reaction should be functions"),At(n)||ae("Third argument of reactions should be an object");var o=(r=n.name)!=null?r:"Reaction@"+yt(),u=ct(o,n.onError?sd(n.onError,t):t),f=!n.scheduler&&!n.delay,c=Ia(n),h=!0,m=!1,M,S=n.compareStructural?qe.structural:n.equals||qe.default,D=new It(o,function(){h||f?H():m||(m=!0,c(H))},n.onError,n.requiresObservable);function H(){if(m=!1,!D.isDisposed){var Q=!1,K=M;D.track(function(){var B=Bl(!1,function(){return e(D)});Q=h||!S(M,B),M=B}),(h&&n.fireImmediately||!h&&Q)&&u(M,K,D),h=!1}}return(i=n)!=null&&(i=i.signal)!=null&&i.aborted||D.schedule_(),D.getDisposer_((s=n)==null?void 0:s.signal)}function sd(e,t){return function(){try{return t.apply(this,arguments)}catch(n){e.call(this,n)}}}var ad="onBO",ud="onBUO";function ci(e,t,n){return Sa(ad,e,t,n)}function hn(e,t,n){return Sa(ud,e,t,n)}function Sa(e,t,n,r){var i=typeof r=="function"?pt(t,n):pt(t),s=Re(r)?r:n,o=e+"L";return i[o]?i[o].add(s):i[o]=new Set([s]),function(){var u=i[o];u&&(u.delete(s),u.size===0&&delete i[o])}}var cd="never",Fr="always",fd="observed";function Pa(e){e.isolateGlobalState===!0&&zl();var t=e.useProxies,n=e.enforceActions;if(t!==void 0&&(q.useProxies=t===Fr?!0:t===cd?!1:typeof Proxy<"u"),t==="ifavailable"&&(q.verifyProxies=!0),n!==void 0){var r=n===Fr?Fr:n===fd;q.enforceActions=r,q.allowStateChanges=!(r===!0||r===Fr)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(q[i]=!!e[i])}),q.allowStateReads=!q.observableRequiresReaction,q.disableErrorBoundaries===!0&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),e.reactionScheduler&&Zl(e.reactionScheduler)}function ld(e,t,n,r){arguments.length>4&&ae("'extendObservable' expected 2-4 arguments"),typeof e!="object"&&ae("'extendObservable' expects an object as first argument"),xt(e)&&ae("'extendObservable' should not be used on maps, use map.merge instead"),At(t)||ae("'extendObservable' only accepts plain objects as second argument"),(jn(t)||jn(n))&&ae("Extending an object with another observable (object) is not supported");var i=Gf(t);return gn(function(){var s=kn(e,r)[he];ri(i).forEach(function(o){s.extend_(o,i[o],n&&o in n?n[o]:!0)})}),e}function pr(e,t){return $a(pt(e,t))}function $a(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=dd(e.observing_).map($a)),t}function yr(e,t){return Ra(pt(e,t))}function Ra(e){var t={name:e.name_};return Wl(e)&&(t.observers=Array.from(ql(e)).map(Ra)),t}function dd(e){return Array.from(new Set(e))}var pd=0;function Na(){this.message="FLOW_CANCELLED"}Na.prototype=Object.create(Error.prototype);var Xi=na("flow"),yd=na("flow.bound",{bound:!0}),Un=Object.assign(function(t,n){if(fr(n))return Xi.decorate_20223_(t,n);if(cn(n))return cr(t,n,Xi);arguments.length!==1&&ae("Flow expects single argument with generator function");var r=t,i=r.name||"<unnamed flow>",s=function(){var u=this,f=arguments,c=++pd,h=ct(i+" - runid: "+c+" - init",r).apply(u,f),m,M=void 0,S=new Promise(function(D,H){var Q=0;m=H;function K(W){M=void 0;var F;try{F=ct(i+" - runid: "+c+" - yield "+Q++,h.next).call(h,W)}catch(ee){return H(ee)}V(F)}function B(W){M=void 0;var F;try{F=ct(i+" - runid: "+c+" - yield "+Q++,h.throw).call(h,W)}catch(ee){return H(ee)}V(F)}function V(W){if(Re(W?.then)){W.then(V,H);return}return W.done?D(W.value):(M=Promise.resolve(W.value),M.then(K,B))}K(void 0)});return S.cancel=ct(i+" - runid: "+c+" - cancel",function(){try{M&&js(M);var D=h.return(void 0),H=Promise.resolve(D.value);H.then(Cn,Cn),js(H),m(new Na)}catch(Q){m(Q)}}),S};return s.isMobXFlow=!0,s},Xi);Un.bound=Ct(yd);function js(e){Re(e.cancel)&&e.cancel()}function ar(e){return e?.isMobXFlow===!0}function hd(e,t){return e?t!==void 0?xt(e)||Fn(e)?ae("isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead."):pn(e)?e[he].values_.has(t):!1:pn(e)||!!e[he]||lo(e)||Xr(e)||dr(e):!1}function jn(e){return arguments.length!==1&&ae("isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),hd(e)}function gd(e){if(pn(e))return e[he].ownKeys_();ae(38)}function kr(e,t,n){return e.set(t,n),n}function Nn(e,t){if(e==null||typeof e!="object"||e instanceof Date||!jn(e))return e;if(kl(e)||dr(e))return Nn(e.get(),t);if(t.has(e))return t.get(e);if(Fn(e)){var n=kr(t,e,new Array(e.length));return e.forEach(function(o,u){n[u]=Nn(o,t)}),n}if(_t(e)){var r=kr(t,e,new Set);return e.forEach(function(o){r.add(Nn(o,t))}),r}if(xt(e)){var i=kr(t,e,new Map);return e.forEach(function(o,u){i.set(u,Nn(o,t))}),i}else{var s=kr(t,e,{});return gd(e).forEach(function(o){ur.propertyIsEnumerable.call(e,o)&&(s[o]=Nn(e[o],t))}),s}}function Bn(e,t){return t&&ae("toJS no longer supports options"),Nn(e,new Map)}function mo(){for(var e=!1,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];typeof n[n.length-1]=="boolean"&&(e=n.pop());var i=md(n);if(!i)return ae("'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");i.isTracing_===lt.NONE&&console.log("[mobx.trace] '"+i.name_+"' tracing enabled"),i.isTracing_=e?lt.BREAK:lt.LOG}function md(e){switch(e.length){case 0:return q.trackingDerivation;case 1:return pt(e[0]);case 2:return pt(e[0],e[1])}}function Bt(e,t){t===void 0&&(t=void 0),at();try{return e.apply(t)}finally{ut()}}function un(e){return e[he]}var bd={has:function(t,n){return q.trackingDerivation&&ir("detect new properties using the 'in' operator. Use 'has' from 'mobx' instead."),un(t).has_(n)},get:function(t,n){return un(t).get_(n)},set:function(t,n,r){var i;return cn(n)?(un(t).values_.has(n)||ir("add a new observable property through direct assignment. Use 'set' from 'mobx' instead."),(i=un(t).set_(n,r,!0))!=null?i:!0):!1},deleteProperty:function(t,n){var r;return ir("delete properties from an observable object. Use 'remove' from 'mobx' instead."),cn(n)?(r=un(t).delete_(n,!0))!=null?r:!0:!1},defineProperty:function(t,n,r){var i;return ir("define property on an observable object. Use 'defineProperty' from 'mobx' instead."),(i=un(t).defineProperty_(n,r))!=null?i:!0},ownKeys:function(t){return q.trackingDerivation&&ir("iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead."),un(t).ownKeys_()},preventExtensions:function(t){ae(13)}};function vd(e,t){var n,r;return Hs(),e=kn(e,t),(r=(n=e[he]).proxy_)!=null?r:n.proxy_=new Proxy(e,bd)}function ot(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function hr(e,t){var n=e.interceptors_||(e.interceptors_=[]);return n.push(t),fo(function(){var r=n.indexOf(t);r!==-1&&n.splice(r,1)})}function st(e,t){var n=yn();try{for(var r=[].concat(e.interceptors_||[]),i=0,s=r.length;i<s&&(t=r[i](t),t&&!t.type&&ae(14),!!t);i++);return t}finally{Ft(n)}}function wt(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function gr(e,t){var n=e.changeListeners_||(e.changeListeners_=[]);return n.push(t),fo(function(){var r=n.indexOf(t);r!==-1&&n.splice(r,1)})}function Ot(e,t){var n=yn(),r=e.changeListeners_;if(r){r=r.slice();for(var i=0,s=r.length;i<s;i++)r[i](t);Ft(n)}}function mr(e,t,n){return gn(function(){var r,i=kn(e,n)[he];t&&e[Je]&&ae("makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported."),(r=t)!=null||(t=Hf(e)),ri(t).forEach(function(s){return i.make_(s,t[s])})}),e}var Ms="splice",Tt="update",_d=1e4,Td={get:function(t,n){var r=t[he];return n===he?r:n==="length"?r.getArrayLength_():typeof n=="string"&&!isNaN(n)?r.get_(parseInt(n)):ft(Yr,n)?Yr[n]:t[n]},set:function(t,n,r){var i=t[he];return n==="length"&&i.setArrayLength_(r),typeof n=="symbol"||isNaN(n)?t[n]=r:i.set_(parseInt(n),r),!0},preventExtensions:function(){ae(15)}},bo=(function(){function e(n,r,i,s){n===void 0&&(n="ObservableArray@"+yt()),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=i,this.legacyMode_=s,this.atom_=new Jt(n),this.enhancer_=function(o,u){return r(o,u,n+"[..]")}}var t=e.prototype;return t.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},t.dehanceValues_=function(r){return this.dehancer!==void 0&&r.length>0?r.map(this.dehancer):r},t.intercept_=function(r){return hr(this,r)},t.observe_=function(r,i){return i===void 0&&(i=!1),i&&r({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),gr(this,r)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(r){(typeof r!="number"||isNaN(r)||r<0)&&ae("Out of range: "+r);var i=this.values_.length;if(r!==i)if(r>i){for(var s=new Array(r-i),o=0;o<r-i;o++)s[o]=void 0;this.spliceWithArray_(i,0,s)}else this.spliceWithArray_(r,i-r)},t.updateArrayLength_=function(r,i){r!==this.lastKnownLength_&&ae(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&La(r+i+1)},t.spliceWithArray_=function(r,i,s){var o=this;Rt(this.atom_);var u=this.values_.length;if(r===void 0?r=0:r>u?r=u:r<0&&(r=Math.max(0,u+r)),arguments.length===1?i=u-r:i==null?i=0:i=Math.max(0,Math.min(i,u-r)),s===void 0&&(s=Wr),ot(this)){var f=st(this,{object:this.proxy_,type:Ms,index:r,removedCount:i,added:s});if(!f)return Wr;i=f.removedCount,s=f.added}s=s.length===0?s:s.map(function(m){return o.enhancer_(m,void 0)}),this.legacyMode_;var c=s.length-i;this.updateArrayLength_(u,c);var h=this.spliceItemsIntoValues_(r,i,s);return(i!==0||s.length!==0)&&this.notifyArraySplice_(r,s,h),this.dehanceValues_(h)},t.spliceItemsIntoValues_=function(r,i,s){if(s.length<_d){var o;return(o=this.values_).splice.apply(o,[r,i].concat(s))}else{var u=this.values_.slice(r,r+i),f=this.values_.slice(r+i);this.values_.length+=s.length-i;for(var c=0;c<s.length;c++)this.values_[r+c]=s[c];for(var h=0;h<f.length;h++)this.values_[r+s.length+h]=f[h];return u}},t.notifyArrayChildUpdate_=function(r,i,s){var o=!this.owned_&&Fe(),u=wt(this),f=u||o?{observableKind:"array",object:this.proxy_,type:Tt,debugObjectName:this.atom_.name_,index:r,newValue:i,oldValue:s}:null;o&&Qe(f),this.atom_.reportChanged(),u&&Ot(this,f),o&&et()},t.notifyArraySplice_=function(r,i,s){var o=!this.owned_&&Fe(),u=wt(this),f=u||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:Ms,index:r,removed:s,added:i,removedCount:s.length,addedCount:i.length}:null;o&&Qe(f),this.atom_.reportChanged(),u&&Ot(this,f),o&&et()},t.get_=function(r){if(this.legacyMode_&&r>=this.values_.length){console.warn("[mobx.array] Attempt to read an array index ("+r+") that is out of bounds ("+this.values_.length+"). Please check length first. Out of bound indices will not be tracked by MobX");return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[r])},t.set_=function(r,i){var s=this.values_;if(this.legacyMode_&&r>s.length&&ae(17,r,s.length),r<s.length){Rt(this.atom_);var o=s[r];if(ot(this)){var u=st(this,{type:Tt,object:this.proxy_,index:r,newValue:i});if(!u)return;i=u.newValue}i=this.enhancer_(i,o);var f=i!==o;f&&(s[r]=i,this.notifyArrayChildUpdate_(r,i,o))}else{for(var c=new Array(r+1-s.length),h=0;h<c.length-1;h++)c[h]=void 0;c[c.length-1]=i,this.spliceWithArray_(s.length,0,c)}},e})();function wd(e,t,n,r){return n===void 0&&(n="ObservableArray@"+yt()),r===void 0&&(r=!1),Hs(),gn(function(){var i=new bo(n,t,r,!1);Xs(i.values_,he,i);var s=new Proxy(i.values_,Td);return i.proxy_=s,e&&e.length&&i.spliceWithArray_(0,0,e),s})}var Yr={clear:function(){return this.splice(0)},replace:function(t){var n=this[he];return n.spliceWithArray_(0,n.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];var o=this[he];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(t);case 2:return o.spliceWithArray_(t,n)}return o.spliceWithArray_(t,n,i)},spliceWithArray:function(t,n,r){return this[he].spliceWithArray_(t,n,r)},push:function(){for(var t=this[he],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.spliceWithArray_(t.values_.length,0,r),t.values_.length},pop:function(){return this.splice(Math.max(this[he].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[he],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.spliceWithArray_(0,0,r),t.values_.length},reverse:function(){return q.trackingDerivation&&ae(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){q.trackingDerivation&&ae(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var n=this[he],r=n.dehanceValues_(n.values_).indexOf(t);return r>-1?(this.splice(r,1),!0):!1}};Ie("at",tt);Ie("concat",tt);Ie("flat",tt);Ie("includes",tt);Ie("indexOf",tt);Ie("join",tt);Ie("lastIndexOf",tt);Ie("slice",tt);Ie("toString",tt);Ie("toLocaleString",tt);Ie("toSorted",tt);Ie("toSpliced",tt);Ie("with",tt);Ie("every",Et);Ie("filter",Et);Ie("find",Et);Ie("findIndex",Et);Ie("findLast",Et);Ie("findLastIndex",Et);Ie("flatMap",Et);Ie("forEach",Et);Ie("map",Et);Ie("some",Et);Ie("toReversed",Et);Ie("reduce",Ca);Ie("reduceRight",Ca);function Ie(e,t){typeof Array.prototype[e]=="function"&&(Yr[e]=t(e))}function tt(e){return function(){var t=this[he];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_);return n[e].apply(n,arguments)}}function Et(e){return function(t,n){var r=this,i=this[he];i.atom_.reportObserved();var s=i.dehanceValues_(i.values_);return s[e](function(o,u){return t.call(n,o,u,r)})}}function Ca(e){return function(){var t=this,n=this[he];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),i=arguments[0];return arguments[0]=function(s,o,u){return i(s,o,u,t)},r[e].apply(r,arguments)}}var Od=Ht("ObservableArrayAdministration",bo);function Fn(e){return ti(e)&&Od(e[he])}var Ad={},zt="add",Zr="delete",xa=(function(){function e(n,r,i){var s=this;r===void 0&&(r=fn),i===void 0&&(i="ObservableMap@"+yt()),this.enhancer_=void 0,this.name_=void 0,this[he]=Ad,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=r,this.name_=i,Re(Map)||ae(18),gn(function(){s.keysAtom_=ea(s.name_+".keys()"),s.data_=new Map,s.hasMap_=new Map,n&&s.merge(n)})}var t=e.prototype;return t.has_=function(r){return this.data_.has(r)},t.has=function(r){var i=this;if(!q.trackingDerivation)return this.has_(r);var s=this.hasMap_.get(r);if(!s){var o=s=new Wt(this.has_(r),oi,this.name_+"."+Zi(r)+"?",!1);this.hasMap_.set(r,o),hn(o,function(){return i.hasMap_.delete(r)})}return s.get()},t.set=function(r,i){var s=this.has_(r);if(ot(this)){var o=st(this,{type:s?Tt:zt,object:this,newValue:i,name:r});if(!o)return this;i=o.newValue}return s?this.updateValue_(r,i):this.addValue_(r,i),this},t.delete=function(r){var i=this;if(Rt(this.keysAtom_),ot(this)){var s=st(this,{type:Zr,object:this,name:r});if(!s)return!1}if(this.has_(r)){var o=Fe(),u=wt(this),f=u||o?{observableKind:"map",debugObjectName:this.name_,type:Zr,object:this,oldValue:this.data_.get(r).value_,name:r}:null;return o&&Qe(f),Bt(function(){var c;i.keysAtom_.reportChanged(),(c=i.hasMap_.get(r))==null||c.setNewValue_(!1);var h=i.data_.get(r);h.setNewValue_(void 0),i.data_.delete(r)}),u&&Ot(this,f),o&&et(),!0}return!1},t.updateValue_=function(r,i){var s=this.data_.get(r);if(i=s.prepareNewValue_(i),i!==q.UNCHANGED){var o=Fe(),u=wt(this),f=u||o?{observableKind:"map",debugObjectName:this.name_,type:Tt,object:this,oldValue:s.value_,name:r,newValue:i}:null;o&&Qe(f),s.setNewValue_(i),u&&Ot(this,f),o&&et()}},t.addValue_=function(r,i){var s=this;Rt(this.keysAtom_),Bt(function(){var c,h=new Wt(i,s.enhancer_,s.name_+"."+Zi(r),!1);s.data_.set(r,h),i=h.value_,(c=s.hasMap_.get(r))==null||c.setNewValue_(!0),s.keysAtom_.reportChanged()});var o=Fe(),u=wt(this),f=u||o?{observableKind:"map",debugObjectName:this.name_,type:zt,object:this,name:r,newValue:i}:null;o&&Qe(f),u&&Ot(this,f),o&&et()},t.get=function(r){return this.has(r)?this.dehanceValue_(this.data_.get(r).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var r=this,i=this.keys();return Ls({next:function(){var o=i.next(),u=o.done,f=o.value;return{done:u,value:u?void 0:r.get(f)}}})},t.entries=function(){var r=this,i=this.keys();return Ls({next:function(){var o=i.next(),u=o.done,f=o.value;return{done:u,value:u?void 0:[f,r.get(f)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(r,i){for(var s=xn(this),o;!(o=s()).done;){var u=o.value,f=u[0],c=u[1];r.call(i,c,f,this)}},t.merge=function(r){var i=this;return xt(r)&&(r=new Map(r)),Bt(function(){At(r)?Kf(r).forEach(function(s){return i.set(s,r[s])}):Array.isArray(r)?r.forEach(function(s){var o=s[0],u=s[1];return i.set(o,u)}):Mn(r)?(kf(r)||ae(19,r),r.forEach(function(s,o){return i.set(o,s)})):r!=null&&ae(20,r)}),this},t.clear=function(){var r=this;Bt(function(){Ne(function(){for(var i=xn(r.keys()),s;!(s=i()).done;){var o=s.value;r.delete(o)}})})},t.replace=function(r){var i=this;return Bt(function(){for(var s=Id(r),o=new Map,u=!1,f=xn(i.data_.keys()),c;!(c=f()).done;){var h=c.value;if(!s.has(h)){var m=i.delete(h);if(m)u=!0;else{var M=i.data_.get(h);o.set(h,M)}}}for(var S=xn(s.entries()),D;!(D=S()).done;){var H=D.value,Q=H[0],K=H[1],B=i.data_.has(Q);if(i.set(Q,K),i.data_.has(Q)){var V=i.data_.get(Q);o.set(Q,V),B||(u=!0)}}if(!u)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var W=i.data_.keys(),F=o.keys(),ee=W.next(),z=F.next();!ee.done;){if(ee.value!==z.value){i.keysAtom_.reportChanged();break}ee=W.next(),z=F.next()}i.data_=o}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(r,i){return i===!0&&ae("`observe` doesn't support fireImmediately=true in combination with maps."),gr(this,r)},t.intercept_=function(r){return hr(this,r)},Ln(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])})(),xt=Ht("ObservableMap",xa);function Ls(e){return e[Symbol.toStringTag]="MapIterator",wo(e)}function Id(e){if(Mn(e)||xt(e))return e;if(Array.isArray(e))return new Map(e);if(At(e)){var t=new Map;for(var n in e)t.set(n,e[n]);return t}else return ae(21,e)}var Ed={},Ua=(function(){function e(n,r,i){var s=this;r===void 0&&(r=fn),i===void 0&&(i="ObservableSet@"+yt()),this.name_=void 0,this[he]=Ed,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=i,Re(Set)||ae(22),this.enhancer_=function(o,u){return r(o,u,i)},gn(function(){s.atom_=ea(s.name_),n&&s.replace(n)})}var t=e.prototype;return t.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},t.clear=function(){var r=this;Bt(function(){Ne(function(){for(var i=xn(r.data_.values()),s;!(s=i()).done;){var o=s.value;r.delete(o)}})})},t.forEach=function(r,i){for(var s=xn(this),o;!(o=s()).done;){var u=o.value;r.call(i,u,u,this)}},t.add=function(r){var i=this;if(Rt(this.atom_),ot(this)){var s=st(this,{type:zt,object:this,newValue:r});if(!s)return this;r=s.newValue}if(!this.has(r)){Bt(function(){i.data_.add(i.enhancer_(r,void 0)),i.atom_.reportChanged()});var o=Fe(),u=wt(this),f=u||o?{observableKind:"set",debugObjectName:this.name_,type:zt,object:this,newValue:r}:null;o&&Qe(f),u&&Ot(this,f),o&&et()}return this},t.delete=function(r){var i=this;if(ot(this)){var s=st(this,{type:Zr,object:this,oldValue:r});if(!s)return!1}if(this.has(r)){var o=Fe(),u=wt(this),f=u||o?{observableKind:"set",debugObjectName:this.name_,type:Zr,object:this,oldValue:r}:null;return o&&Qe(f),Bt(function(){i.atom_.reportChanged(),i.data_.delete(r)}),u&&Ot(this,f),o&&et(),!0}return!1},t.has=function(r){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(r))},t.entries=function(){var r=this.values();return Ds({next:function(){var s=r.next(),o=s.value,u=s.done;return u?{value:void 0,done:u}:{value:[o,o],done:u}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var r=this,i=this.data_.values();return Ds({next:function(){var o=i.next(),u=o.value,f=o.done;return f?{value:void 0,done:f}:{value:r.dehanceValue_(u),done:f}}})},t.intersection=function(r){if(Dt(r)&&!_t(r))return r.intersection(this);var i=new Set(this);return i.intersection(r)},t.union=function(r){if(Dt(r)&&!_t(r))return r.union(this);var i=new Set(this);return i.union(r)},t.difference=function(r){return new Set(this).difference(r)},t.symmetricDifference=function(r){if(Dt(r)&&!_t(r))return r.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(r)},t.isSubsetOf=function(r){return new Set(this).isSubsetOf(r)},t.isSupersetOf=function(r){return new Set(this).isSupersetOf(r)},t.isDisjointFrom=function(r){if(Dt(r)&&!_t(r))return r.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(r)},t.replace=function(r){var i=this;return _t(r)&&(r=new Set(r)),Bt(function(){Array.isArray(r)?(i.clear(),r.forEach(function(s){return i.add(s)})):Dt(r)?(i.clear(),r.forEach(function(s){return i.add(s)})):r!=null&&ae("Cannot initialize set from "+r)}),this},t.observe_=function(r,i){return i===!0&&ae("`observe` doesn't support fireImmediately=true in combination with sets."),gr(this,r)},t.intercept_=function(r){return hr(this,r)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Symbol.iterator]=function(){return this.values()},Ln(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])})(),_t=Ht("ObservableSet",Ua);function Ds(e){return e[Symbol.toStringTag]="SetIterator",wo(e)}var Bs=Object.create(null),Fs="remove",ao=(function(){function e(n,r,i,s){r===void 0&&(r=new Map),s===void 0&&(s=vl),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=n,this.values_=r,this.name_=i,this.defaultAnnotation_=s,this.keysAtom_=new Jt(this.name_+".keys"),this.isPlainObject_=At(this.target_),Da(this.defaultAnnotation_)||ae("defaultAnnotation must be valid annotation"),this.appliedAnnotations_={}}var t=e.prototype;return t.getObservablePropValue_=function(r){return this.values_.get(r).get()},t.setObservablePropValue_=function(r,i){var s=this.values_.get(r);if(s instanceof dt)return s.set(i),!0;if(ot(this)){var o=st(this,{type:Tt,object:this.proxy_||this.target_,name:r,newValue:i});if(!o)return null;i=o.newValue}if(i=s.prepareNewValue_(i),i!==q.UNCHANGED){var u=wt(this),f=Fe(),c=u||f?{type:Tt,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:s.value_,name:r,newValue:i}:null;f&&Qe(c),s.setNewValue_(i),u&&Ot(this,c),f&&et()}return!0},t.get_=function(r){return q.trackingDerivation&&!ft(this.target_,r)&&this.has_(r),this.target_[r]},t.set_=function(r,i,s){return s===void 0&&(s=!1),ft(this.target_,r)?this.values_.has(r)?this.setObservablePropValue_(r,i):s?Reflect.set(this.target_,r,i):(this.target_[r]=i,!0):this.extend_(r,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,s)},t.has_=function(r){if(!q.trackingDerivation)return r in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(r);return i||(i=new Wt(r in this.target_,oi,this.name_+"."+Zi(r)+"?",!1),this.pendingKeys_.set(r,i)),i.get()},t.make_=function(r,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(Gs(this,i,r),!(r in this.target_)){var s;if((s=this.target_[Je])!=null&&s[r])return;ae(1,i.annotationType_,this.name_+"."+r.toString())}for(var o=this.target_;o&&o!==ur;){var u=zr(o,r);if(u){var f=i.make_(this,r,u,o);if(f===0)return;if(f===1)break}o=Object.getPrototypeOf(o)}Ks(this,i,r)}},t.extend_=function(r,i,s,o){if(o===void 0&&(o=!1),s===!0&&(s=this.defaultAnnotation_),s===!1)return this.defineProperty_(r,i,o);Gs(this,s,r);var u=s.extend_(this,r,i,o);return u&&Ks(this,s,r),u},t.defineProperty_=function(r,i,s){s===void 0&&(s=!1),Rt(this.keysAtom_);try{at();var o=this.delete_(r);if(!o)return o;if(ot(this)){var u=st(this,{object:this.proxy_||this.target_,name:r,type:zt,newValue:i.value});if(!u)return null;var f=u.newValue;i.value!==f&&(i=kt({},i,{value:f}))}if(s){if(!Reflect.defineProperty(this.target_,r,i))return!1}else Nt(this.target_,r,i);this.notifyPropertyAddition_(r,i.value)}finally{ut()}return!0},t.defineObservableProperty_=function(r,i,s,o){o===void 0&&(o=!1),Rt(this.keysAtom_);try{at();var u=this.delete_(r);if(!u)return u;if(ot(this)){var f=st(this,{object:this.proxy_||this.target_,name:r,type:zt,newValue:i});if(!f)return null;i=f.newValue}var c=ks(r),h={configurable:q.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:c.get,set:c.set};if(o){if(!Reflect.defineProperty(this.target_,r,h))return!1}else Nt(this.target_,r,h);var m=new Wt(i,s,this.name_+"."+r.toString(),!1);this.values_.set(r,m),this.notifyPropertyAddition_(r,m.value_)}finally{ut()}return!0},t.defineComputedProperty_=function(r,i,s){s===void 0&&(s=!1),Rt(this.keysAtom_);try{at();var o=this.delete_(r);if(!o)return o;if(ot(this)){var u=st(this,{object:this.proxy_||this.target_,name:r,type:zt,newValue:void 0});if(!u)return null}i.name||(i.name=this.name_+"."+r.toString()),i.context=this.proxy_||this.target_;var f=ks(r),c={configurable:q.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:f.get,set:f.set};if(s){if(!Reflect.defineProperty(this.target_,r,c))return!1}else Nt(this.target_,r,c);this.values_.set(r,new dt(i)),this.notifyPropertyAddition_(r,void 0)}finally{ut()}return!0},t.delete_=function(r,i){if(i===void 0&&(i=!1),Rt(this.keysAtom_),!ft(this.target_,r))return!0;if(ot(this)){var s=st(this,{object:this.proxy_||this.target_,name:r,type:Fs});if(!s)return null}try{var o;at();var u=wt(this),f=Fe(),c=this.values_.get(r),h=void 0;if(!c&&(u||f)){var m;h=(m=zr(this.target_,r))==null?void 0:m.value}if(i){if(!Reflect.deleteProperty(this.target_,r))return!1}else delete this.target_[r];if(delete this.appliedAnnotations_[r],c&&(this.values_.delete(r),c instanceof Wt&&(h=c.value_),ba(c)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(o=o.get(r))==null||o.set(r in this.target_),u||f){var M={type:Fs,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:h,name:r};f&&Qe(M),u&&Ot(this,M),f&&et()}}finally{ut()}return!0},t.observe_=function(r,i){return i===!0&&ae("`observe` doesn't support the fire immediately property for observable objects."),gr(this,r)},t.intercept_=function(r){return hr(this,r)},t.notifyPropertyAddition_=function(r,i){var s,o=wt(this),u=Fe();if(o||u){var f=o||u?{type:zt,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:r,newValue:i}:null;u&&Qe(f),o&&Ot(this,f),u&&et()}(s=this.pendingKeys_)==null||(s=s.get(r))==null||s.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),ri(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e})();function kn(e,t){var n;if(t&&pn(e)&&ae("Options can't be provided for already observable objects."),ft(e,he))return _o(e)instanceof ao||ae("Cannot convert '"+Qr(e)+`' into observable object:
26
+ The target is already observable of different type.
27
+ Extending builtins is not supported.`),e;Object.isExtensible(e)||ae("Cannot make the designated object observable; it is not extensible");var r=(n=t?.name)!=null?n:(At(e)?"ObservableObject":e.constructor.name)+"@"+yt(),i=new ao(e,new Map,String(r),Rl(t));return ni(e,he,i),e}var Sd=Ht("ObservableObjectAdministration",ao);function ks(e){return Bs[e]||(Bs[e]={get:function(){return this[he].getObservablePropValue_(e)},set:function(n){return this[he].setObservablePropValue_(e,n)}})}function pn(e){return ti(e)?Sd(e[he]):!1}function Ks(e,t,n){var r;e.appliedAnnotations_[n]=t,(r=e.target_[Je])==null||delete r[n]}function Gs(e,t,n){if(Da(t)||ae("Cannot annotate '"+e.name_+"."+n.toString()+"': Invalid annotation."),!qr(t)&&ft(e.appliedAnnotations_,n)){var r=e.name_+"."+n.toString(),i=e.appliedAnnotations_[n].annotationType_,s=t.annotationType_;ae("Cannot apply '"+s+"' to '"+r+"':"+(`
28
+ The field is already annotated with '`+i+"'.")+`
29
+ Re-annotating fields is not allowed.
30
+ Use 'override' annotation for methods overridden by subclass.`)}}var Pd=Ma(0),$d=(function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1})(),Yi=0,ja=function(){};function Rd(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}Rd(ja,Array.prototype);var vo=(function(e){function t(r,i,s,o){var u;return s===void 0&&(s="ObservableArray@"+yt()),o===void 0&&(o=!1),u=e.call(this)||this,gn(function(){var f=new bo(s,i,o,!0);f.proxy_=u,Xs(u,he,f),r&&r.length&&u.spliceWithArray(0,0,r),$d&&Object.defineProperty(u,"0",Pd)}),u}Qs(t,e);var n=t.prototype;return n.concat=function(){this[he].atom_.reportObserved();for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return Array.prototype.concat.apply(this.slice(),s.map(function(u){return Fn(u)?u.slice():u}))},n[Symbol.iterator]=function(){var r=this,i=0;return wo({next:function(){return i<r.length?{value:r[i++],done:!1}:{done:!0,value:void 0}}})},Ln(t,[{key:"length",get:function(){return this[he].getArrayLength_()},set:function(i){this[he].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])})(ja);Object.entries(Yr).forEach(function(e){var t=e[0],n=e[1];t!=="concat"&&ni(vo.prototype,t,n)});function Ma(e){return{enumerable:!1,configurable:!0,get:function(){return this[he].get_(e)},set:function(n){this[he].set_(e,n)}}}function Nd(e){Nt(vo.prototype,""+e,Ma(e))}function La(e){if(e>Yi){for(var t=Yi;t<e+100;t++)Nd(t);Yi=e}}La(1e3);function Cd(e,t,n){return new vo(e,t,n)}function pt(e,t){if(typeof e=="object"&&e!==null){if(Fn(e))return t!==void 0&&ae(23),e[he].atom_;if(_t(e))return e.atom_;if(xt(e)){if(t===void 0)return e.keysAtom_;var n=e.data_.get(t)||e.hasMap_.get(t);return n||ae(25,t,Qr(e)),n}if(pn(e)){if(!t)return ae(26);var r=e[he].values_.get(t);return r||ae(27,t,Qr(e)),r}if(lo(e)||dr(e)||Xr(e))return e}else if(Re(e)&&Xr(e[he]))return e[he];ae(28)}function _o(e,t){if(e||ae(29),t!==void 0)return _o(pt(e,t));if(lo(e)||dr(e)||Xr(e)||xt(e)||_t(e))return e;if(e[he])return e[he];ae(24,e)}function Qr(e,t){var n;if(t!==void 0)n=pt(e,t);else{if(qt(e))return e.name;pn(e)||xt(e)||_t(e)?n=_o(e):n=pt(e)}return n.name_}function gn(e){var t=yn(),n=ai(!0);at();try{return e()}finally{ut(),ui(n),Ft(t)}}var Vs=ur.toString;function To(e,t,n){return n===void 0&&(n=-1),uo(e,t,n)}function uo(e,t,n,r,i){if(e===t)return e!==0||1/e===1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var s=typeof e;if(s!=="function"&&s!=="object"&&typeof t!="object")return!1;var o=Vs.call(e);if(o!==Vs.call(t))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:+e==0?1/+e===1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":n>=0&&n++;break}e=zs(e),t=zs(t);var u=o==="[object Array]";if(!u){if(typeof e!="object"||typeof t!="object")return!1;var f=e.constructor,c=t.constructor;if(f!==c&&!(Re(f)&&f instanceof f&&Re(c)&&c instanceof c)&&"constructor"in e&&"constructor"in t)return!1}if(n===0)return!1;n<0&&(n=-1),r=r||[],i=i||[];for(var h=r.length;h--;)if(r[h]===e)return i[h]===t;if(r.push(e),i.push(t),u){if(h=e.length,h!==t.length)return!1;for(;h--;)if(!uo(e[h],t[h],n-1,r,i))return!1}else{var m=Object.keys(e),M=m.length;if(Object.keys(t).length!==M)return!1;for(var S=0;S<M;S++){var D=m[S];if(!(ft(t,D)&&uo(e[D],t[D],n-1,r,i)))return!1}}return r.pop(),i.pop(),!0}function zs(e){return Fn(e)?e.slice():Mn(e)||xt(e)||Dt(e)||_t(e)?Array.from(e.entries()):e}var Ws,xd=((Ws=ei().Iterator)==null?void 0:Ws.prototype)||{};function wo(e){return e[Symbol.iterator]=Ud,Object.assign(Object.create(xd),e)}function Ud(){return this}function Da(e){return e instanceof Object&&typeof e.annotationType_=="string"&&Re(e.make_)&&Re(e.extend_)}["Symbol","Map","Set"].forEach(function(e){var t=ei();typeof t[e]>"u"&&ae("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:ed,extras:{getDebugName:Qr},$mobx:he});var jd=Object.create,Oo=Object.defineProperty,Md=Object.getOwnPropertyDescriptor,Ba=Object.getOwnPropertyNames,Ld=Object.getPrototypeOf,Dd=Object.prototype.hasOwnProperty,ke=(e,t)=>function(){return t||(0,e[Ba(e)[0]])((t={exports:{}}).exports,t),t.exports},Ao=(e,t)=>{for(var n in t)Oo(e,n,{get:t[n],enumerable:!0})},Bd=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ba(t))!Dd.call(e,i)&&i!==n&&Oo(e,i,{get:()=>t[i],enumerable:!(r=Md(t,i))||r.enumerable});return e},Xt=(e,t,n)=>(n=e!=null?jd(Ld(e)):{},Bd(t||!e||!e.__esModule?Oo(n,"default",{value:e,enumerable:!0}):n,e));var Kt=ke({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/typebox.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Type=e.JsonType=e.JavaScriptTypeBuilder=e.JsonTypeBuilder=e.TypeBuilder=e.TypeBuilderError=e.TransformEncodeBuilder=e.TransformDecodeBuilder=e.TemplateLiteralDslParser=e.TemplateLiteralGenerator=e.TemplateLiteralGeneratorError=e.TemplateLiteralFinite=e.TemplateLiteralFiniteError=e.TemplateLiteralParser=e.TemplateLiteralParserError=e.TemplateLiteralResolver=e.TemplateLiteralPattern=e.TemplateLiteralPatternError=e.UnionResolver=e.KeyArrayResolver=e.KeyArrayResolverError=e.KeyResolver=e.ObjectMap=e.Intrinsic=e.IndexedAccessor=e.TypeClone=e.TypeExtends=e.TypeExtendsResult=e.TypeExtendsError=e.ExtendsUndefined=e.TypeGuard=e.TypeGuardUnknownTypeError=e.ValueGuard=e.FormatRegistry=e.TypeBoxError=e.TypeRegistry=e.PatternStringExact=e.PatternNumberExact=e.PatternBooleanExact=e.PatternString=e.PatternNumber=e.PatternBoolean=e.Kind=e.Hint=e.Optional=e.Readonly=e.Transform=void 0,e.Transform=Symbol.for("TypeBox.Transform"),e.Readonly=Symbol.for("TypeBox.Readonly"),e.Optional=Symbol.for("TypeBox.Optional"),e.Hint=Symbol.for("TypeBox.Hint"),e.Kind=Symbol.for("TypeBox.Kind"),e.PatternBoolean="(true|false)",e.PatternNumber="(0|[1-9][0-9]*)",e.PatternString="(.*)",e.PatternBooleanExact=`^${e.PatternBoolean}$`,e.PatternNumberExact=`^${e.PatternNumber}$`,e.PatternStringExact=`^${e.PatternString}$`;var t;(function(l){let _=new Map;function I(){return new Map(_)}l.Entries=I;function C(){return _.clear()}l.Clear=C;function R(T){return _.delete(T)}l.Delete=R;function E(T){return _.has(T)}l.Has=E;function y(T,a){_.set(T,a)}l.Set=y;function w(T){return _.get(T)}l.Get=w})(t||(e.TypeRegistry=t={}));var n=class extends Error{constructor(l){super(l)}};e.TypeBoxError=n;var r;(function(l){let _=new Map;function I(){return new Map(_)}l.Entries=I;function C(){return _.clear()}l.Clear=C;function R(T){return _.delete(T)}l.Delete=R;function E(T){return _.has(T)}l.Has=E;function y(T,a){_.set(T,a)}l.Set=y;function w(T){return _.get(T)}l.Get=w})(r||(e.FormatRegistry=r={}));var i;(function(l){function _(v){return Array.isArray(v)}l.IsArray=_;function I(v){return typeof v=="bigint"}l.IsBigInt=I;function C(v){return typeof v=="boolean"}l.IsBoolean=C;function R(v){return v instanceof globalThis.Date}l.IsDate=R;function E(v){return v===null}l.IsNull=E;function y(v){return typeof v=="number"}l.IsNumber=y;function w(v){return typeof v=="object"&&v!==null}l.IsObject=w;function T(v){return typeof v=="string"}l.IsString=T;function a(v){return v instanceof globalThis.Uint8Array}l.IsUint8Array=a;function O(v){return v===void 0}l.IsUndefined=O})(i||(e.ValueGuard=i={}));var s=class extends n{};e.TypeGuardUnknownTypeError=s;var o;(function(l){function _(g){try{return new RegExp(g),!0}catch{return!1}}function I(g){if(!i.IsString(g))return!1;for(let Ae=0;Ae<g.length;Ae++){let it=g.charCodeAt(Ae);if(it>=7&&it<=13||it===27||it===127)return!1}return!0}function C(g){return y(g)||Me(g)}function R(g){return i.IsUndefined(g)||i.IsBigInt(g)}function E(g){return i.IsUndefined(g)||i.IsNumber(g)}function y(g){return i.IsUndefined(g)||i.IsBoolean(g)}function w(g){return i.IsUndefined(g)||i.IsString(g)}function T(g){return i.IsUndefined(g)||i.IsString(g)&&I(g)&&_(g)}function a(g){return i.IsUndefined(g)||i.IsString(g)&&I(g)}function O(g){return i.IsUndefined(g)||Me(g)}function v(g){return me(g,"Any")&&w(g.$id)}l.TAny=v;function b(g){return me(g,"Array")&&g.type==="array"&&w(g.$id)&&Me(g.items)&&E(g.minItems)&&E(g.maxItems)&&y(g.uniqueItems)&&O(g.contains)&&E(g.minContains)&&E(g.maxContains)}l.TArray=b;function P(g){return me(g,"AsyncIterator")&&g.type==="AsyncIterator"&&w(g.$id)&&Me(g.items)}l.TAsyncIterator=P;function k(g){return me(g,"BigInt")&&g.type==="bigint"&&w(g.$id)&&R(g.exclusiveMaximum)&&R(g.exclusiveMinimum)&&R(g.maximum)&&R(g.minimum)&&R(g.multipleOf)}l.TBigInt=k;function Z(g){return me(g,"Boolean")&&g.type==="boolean"&&w(g.$id)}l.TBoolean=Z;function te(g){return me(g,"Constructor")&&g.type==="Constructor"&&w(g.$id)&&i.IsArray(g.parameters)&&g.parameters.every(Ae=>Me(Ae))&&Me(g.returns)}l.TConstructor=te;function pe(g){return me(g,"Date")&&g.type==="Date"&&w(g.$id)&&E(g.exclusiveMaximumTimestamp)&&E(g.exclusiveMinimumTimestamp)&&E(g.maximumTimestamp)&&E(g.minimumTimestamp)&&E(g.multipleOfTimestamp)}l.TDate=pe;function ge(g){return me(g,"Function")&&g.type==="Function"&&w(g.$id)&&i.IsArray(g.parameters)&&g.parameters.every(Ae=>Me(Ae))&&Me(g.returns)}l.TFunction=ge;function Ee(g){return me(g,"Integer")&&g.type==="integer"&&w(g.$id)&&E(g.exclusiveMaximum)&&E(g.exclusiveMinimum)&&E(g.maximum)&&E(g.minimum)&&E(g.multipleOf)}l.TInteger=Ee;function Ce(g){return me(g,"Intersect")&&!(i.IsString(g.type)&&g.type!=="object")&&i.IsArray(g.allOf)&&g.allOf.every(Ae=>Me(Ae)&&!nr(Ae))&&w(g.type)&&(y(g.unevaluatedProperties)||O(g.unevaluatedProperties))&&w(g.$id)}l.TIntersect=Ce;function rn(g){return me(g,"Iterator")&&g.type==="Iterator"&&w(g.$id)&&Me(g.items)}l.TIterator=rn;function me(g,Ae){return Vt(g)&&g[e.Kind]===Ae}l.TKindOf=me;function Vt(g){return i.IsObject(g)&&e.Kind in g&&i.IsString(g[e.Kind])}l.TKind=Vt;function on(g){return $(g)&&i.IsString(g.const)}l.TLiteralString=on;function A(g){return $(g)&&i.IsNumber(g.const)}l.TLiteralNumber=A;function ue(g){return $(g)&&i.IsBoolean(g.const)}l.TLiteralBoolean=ue;function $(g){return me(g,"Literal")&&w(g.$id)&&(i.IsBoolean(g.const)||i.IsNumber(g.const)||i.IsString(g.const))}l.TLiteral=$;function ye(g){return me(g,"Never")&&i.IsObject(g.not)&&Object.getOwnPropertyNames(g.not).length===0}l.TNever=ye;function ne(g){return me(g,"Not")&&Me(g.not)}l.TNot=ne;function ce(g){return me(g,"Null")&&g.type==="null"&&w(g.$id)}l.TNull=ce;function we(g){return me(g,"Number")&&g.type==="number"&&w(g.$id)&&E(g.exclusiveMaximum)&&E(g.exclusiveMinimum)&&E(g.maximum)&&E(g.minimum)&&E(g.multipleOf)}l.TNumber=we;function $e(g){return me(g,"Object")&&g.type==="object"&&w(g.$id)&&i.IsObject(g.properties)&&C(g.additionalProperties)&&E(g.minProperties)&&E(g.maxProperties)&&Object.entries(g.properties).every(([Ae,it])=>I(Ae)&&Me(it))}l.TObject=$e;function ze(g){return me(g,"Promise")&&g.type==="Promise"&&w(g.$id)&&Me(g.item)}l.TPromise=ze;function Ge(g){return me(g,"Record")&&g.type==="object"&&w(g.$id)&&C(g.additionalProperties)&&i.IsObject(g.patternProperties)&&(Ae=>{let it=Object.getOwnPropertyNames(Ae.patternProperties);return it.length===1&&_(it[0])&&i.IsObject(Ae.patternProperties)&&Me(Ae.patternProperties[it[0]])})(g)}l.TRecord=Ge;function He(g){return i.IsObject(g)&&e.Hint in g&&g[e.Hint]==="Recursive"}l.TRecursive=He;function Lt(g){return me(g,"Ref")&&w(g.$id)&&i.IsString(g.$ref)}l.TRef=Lt;function Pn(g){return me(g,"String")&&g.type==="string"&&w(g.$id)&&E(g.minLength)&&E(g.maxLength)&&T(g.pattern)&&a(g.format)}l.TString=Pn;function $n(g){return me(g,"Symbol")&&g.type==="symbol"&&w(g.$id)}l.TSymbol=$n;function sn(g){return me(g,"TemplateLiteral")&&g.type==="string"&&i.IsString(g.pattern)&&g.pattern[0]==="^"&&g.pattern[g.pattern.length-1]==="$"}l.TTemplateLiteral=sn;function jr(g){return me(g,"This")&&w(g.$id)&&i.IsString(g.$ref)}l.TThis=jr;function nr(g){return i.IsObject(g)&&e.Transform in g}l.TTransform=nr;function je(g){return me(g,"Tuple")&&g.type==="array"&&w(g.$id)&&i.IsNumber(g.minItems)&&i.IsNumber(g.maxItems)&&g.minItems===g.maxItems&&(i.IsUndefined(g.items)&&i.IsUndefined(g.additionalItems)&&g.minItems===0||i.IsArray(g.items)&&g.items.every(Ae=>Me(Ae)))}l.TTuple=je;function Mr(g){return me(g,"Undefined")&&g.type==="undefined"&&w(g.$id)}l.TUndefined=Mr;function Wi(g){return an(g)&&g.anyOf.every(Ae=>on(Ae)||A(Ae))}l.TUnionLiteral=Wi;function an(g){return me(g,"Union")&&w(g.$id)&&i.IsObject(g)&&i.IsArray(g.anyOf)&&g.anyOf.every(Ae=>Me(Ae))}l.TUnion=an;function Rn(g){return me(g,"Uint8Array")&&g.type==="Uint8Array"&&w(g.$id)&&E(g.minByteLength)&&E(g.maxByteLength)}l.TUint8Array=Rn;function We(g){return me(g,"Unknown")&&w(g.$id)}l.TUnknown=We;function Lr(g){return me(g,"Unsafe")}l.TUnsafe=Lr;function rr(g){return me(g,"Void")&&g.type==="void"&&w(g.$id)}l.TVoid=rr;function qi(g){return i.IsObject(g)&&g[e.Readonly]==="Readonly"}l.TReadonly=qi;function Hi(g){return i.IsObject(g)&&g[e.Optional]==="Optional"}l.TOptional=Hi;function Me(g){return i.IsObject(g)&&(v(g)||b(g)||Z(g)||k(g)||P(g)||te(g)||pe(g)||ge(g)||Ee(g)||Ce(g)||rn(g)||$(g)||ye(g)||ne(g)||ce(g)||we(g)||$e(g)||ze(g)||Ge(g)||Lt(g)||Pn(g)||$n(g)||sn(g)||jr(g)||je(g)||Mr(g)||an(g)||Rn(g)||We(g)||Lr(g)||rr(g)||Vt(g)&&t.Has(g[e.Kind]))}l.TSchema=Me})(o||(e.TypeGuard=o={}));var u;(function(l){function _(I){return I[e.Kind]==="Intersect"?I.allOf.every(C=>_(C)):I[e.Kind]==="Union"?I.anyOf.some(C=>_(C)):I[e.Kind]==="Undefined"?!0:I[e.Kind]==="Not"?!_(I.not):!1}l.Check=_})(u||(e.ExtendsUndefined=u={}));var f=class extends n{};e.TypeExtendsError=f;var c;(function(l){l[l.Union=0]="Union",l[l.True=1]="True",l[l.False=2]="False"})(c||(e.TypeExtendsResult=c={}));var h;(function(l){function _(d){return d===c.False?d:c.True}function I(d){throw new f(d)}function C(d){return o.TNever(d)||o.TIntersect(d)||o.TUnion(d)||o.TUnknown(d)||o.TAny(d)}function R(d,p){return o.TNever(p)?me(d,p):o.TIntersect(p)?ge(d,p):o.TUnion(p)?Ji(d,p):o.TUnknown(p)?Ps(d,p):o.TAny(p)?E(d,p):I("StructuralRight")}function E(d,p){return c.True}function y(d,p){return o.TIntersect(p)?ge(d,p):o.TUnion(p)&&p.anyOf.some(ve=>o.TAny(ve)||o.TUnknown(ve))?c.True:o.TUnion(p)?c.Union:o.TUnknown(p)||o.TAny(p)?c.True:c.Union}function w(d,p){return o.TUnknown(d)?c.False:o.TAny(d)?c.Union:o.TNever(d)?c.True:c.False}function T(d,p){return o.TObject(p)&&sn(p)?c.True:C(p)?R(d,p):o.TArray(p)?_(Oe(d.items,p.items)):c.False}function a(d,p){return C(p)?R(d,p):o.TAsyncIterator(p)?_(Oe(d.items,p.items)):c.False}function O(d,p){return C(p)?R(d,p):o.TObject(p)?je(d,p):o.TRecord(p)?We(d,p):o.TBigInt(p)?c.True:c.False}function v(d,p){return o.TLiteral(d)&&i.IsBoolean(d.const)||o.TBoolean(d)?c.True:c.False}function b(d,p){return C(p)?R(d,p):o.TObject(p)?je(d,p):o.TRecord(p)?We(d,p):o.TBoolean(p)?c.True:c.False}function P(d,p){return C(p)?R(d,p):o.TObject(p)?je(d,p):o.TConstructor(p)?d.parameters.length>p.parameters.length?c.False:d.parameters.every((ve,vt)=>_(Oe(p.parameters[vt],ve))===c.True)?_(Oe(d.returns,p.returns)):c.False:c.False}function k(d,p){return C(p)?R(d,p):o.TObject(p)?je(d,p):o.TRecord(p)?We(d,p):o.TDate(p)?c.True:c.False}function Z(d,p){return C(p)?R(d,p):o.TObject(p)?je(d,p):o.TFunction(p)?d.parameters.length>p.parameters.length?c.False:d.parameters.every((ve,vt)=>_(Oe(p.parameters[vt],ve))===c.True)?_(Oe(d.returns,p.returns)):c.False:c.False}function te(d,p){return o.TLiteral(d)&&i.IsNumber(d.const)||o.TNumber(d)||o.TInteger(d)?c.True:c.False}function pe(d,p){return o.TInteger(p)||o.TNumber(p)?c.True:C(p)?R(d,p):o.TObject(p)?je(d,p):o.TRecord(p)?We(d,p):c.False}function ge(d,p){return p.allOf.every(ve=>Oe(d,ve)===c.True)?c.True:c.False}function Ee(d,p){return d.allOf.some(ve=>Oe(ve,p)===c.True)?c.True:c.False}function Ce(d,p){return C(p)?R(d,p):o.TIterator(p)?_(Oe(d.items,p.items)):c.False}function rn(d,p){return o.TLiteral(p)&&p.const===d.const?c.True:C(p)?R(d,p):o.TObject(p)?je(d,p):o.TRecord(p)?We(d,p):o.TString(p)?rr(d,p):o.TNumber(p)?$(d,p):o.TInteger(p)?te(d,p):o.TBoolean(p)?v(d,p):c.False}function me(d,p){return c.False}function Vt(d,p){return c.True}function on(d){let[p,ve]=[d,0];for(;o.TNot(p);)p=p.not,ve+=1;return ve%2===0?p:e.Type.Unknown()}function A(d,p){return o.TNot(d)?Oe(on(d),p):o.TNot(p)?Oe(d,on(p)):I("Invalid fallthrough for Not")}function ue(d,p){return C(p)?R(d,p):o.TObject(p)?je(d,p):o.TRecord(p)?We(d,p):o.TNull(p)?c.True:c.False}function $(d,p){return o.TLiteralNumber(d)||o.TNumber(d)||o.TInteger(d)?c.True:c.False}function ye(d,p){return C(p)?R(d,p):o.TObject(p)?je(d,p):o.TRecord(p)?We(d,p):o.TInteger(p)||o.TNumber(p)?c.True:c.False}function ne(d,p){return Object.getOwnPropertyNames(d.properties).length===p}function ce(d){return sn(d)}function we(d){return ne(d,0)||ne(d,1)&&"description"in d.properties&&o.TUnion(d.properties.description)&&d.properties.description.anyOf.length===2&&(o.TString(d.properties.description.anyOf[0])&&o.TUndefined(d.properties.description.anyOf[1])||o.TString(d.properties.description.anyOf[1])&&o.TUndefined(d.properties.description.anyOf[0]))}function $e(d){return ne(d,0)}function ze(d){return ne(d,0)}function Ge(d){return ne(d,0)}function He(d){return ne(d,0)}function Lt(d){return sn(d)}function Pn(d){let p=e.Type.Number();return ne(d,0)||ne(d,1)&&"length"in d.properties&&_(Oe(d.properties.length,p))===c.True}function $n(d){return ne(d,0)}function sn(d){let p=e.Type.Number();return ne(d,0)||ne(d,1)&&"length"in d.properties&&_(Oe(d.properties.length,p))===c.True}function jr(d){let p=e.Type.Function([e.Type.Any()],e.Type.Any());return ne(d,0)||ne(d,1)&&"then"in d.properties&&_(Oe(d.properties.then,p))===c.True}function nr(d,p){return Oe(d,p)===c.False||o.TOptional(d)&&!o.TOptional(p)?c.False:c.True}function je(d,p){return o.TUnknown(d)?c.False:o.TAny(d)?c.Union:o.TNever(d)||o.TLiteralString(d)&&ce(p)||o.TLiteralNumber(d)&&$e(p)||o.TLiteralBoolean(d)&&ze(p)||o.TSymbol(d)&&we(p)||o.TBigInt(d)&&Ge(p)||o.TString(d)&&ce(p)||o.TSymbol(d)&&we(p)||o.TNumber(d)&&$e(p)||o.TInteger(d)&&$e(p)||o.TBoolean(d)&&ze(p)||o.TUint8Array(d)&&Lt(p)||o.TDate(d)&&He(p)||o.TConstructor(d)&&$n(p)||o.TFunction(d)&&Pn(p)?c.True:o.TRecord(d)&&o.TString(an(d))?p[e.Hint]==="Record"?c.True:c.False:o.TRecord(d)&&o.TNumber(an(d))?ne(p,0)?c.True:c.False:c.False}function Mr(d,p){return C(p)?R(d,p):o.TRecord(p)?We(d,p):o.TObject(p)?(()=>{for(let ve of Object.getOwnPropertyNames(p.properties)){if(!(ve in d.properties)&&!o.TOptional(p.properties[ve]))return c.False;if(o.TOptional(p.properties[ve]))return c.True;if(nr(d.properties[ve],p.properties[ve])===c.False)return c.False}return c.True})():c.False}function Wi(d,p){return C(p)?R(d,p):o.TObject(p)&&jr(p)?c.True:o.TPromise(p)?_(Oe(d.item,p.item)):c.False}function an(d){return e.PatternNumberExact in d.patternProperties?e.Type.Number():e.PatternStringExact in d.patternProperties?e.Type.String():I("Unknown record key pattern")}function Rn(d){return e.PatternNumberExact in d.patternProperties?d.patternProperties[e.PatternNumberExact]:e.PatternStringExact in d.patternProperties?d.patternProperties[e.PatternStringExact]:I("Unable to get record value schema")}function We(d,p){let[ve,vt]=[an(p),Rn(p)];return o.TLiteralString(d)&&o.TNumber(ve)&&_(Oe(d,vt))===c.True?c.True:o.TUint8Array(d)&&o.TNumber(ve)||o.TString(d)&&o.TNumber(ve)||o.TArray(d)&&o.TNumber(ve)?Oe(d,vt):o.TObject(d)?(()=>{for(let jf of Object.getOwnPropertyNames(d.properties))if(nr(vt,d.properties[jf])===c.False)return c.False;return c.True})():c.False}function Lr(d,p){return C(p)?R(d,p):o.TObject(p)?je(d,p):o.TRecord(p)?Oe(Rn(d),Rn(p)):c.False}function rr(d,p){return o.TLiteral(d)&&i.IsString(d.const)||o.TString(d)?c.True:c.False}function qi(d,p){return C(p)?R(d,p):o.TObject(p)?je(d,p):o.TRecord(p)?We(d,p):o.TString(p)?c.True:c.False}function Hi(d,p){return C(p)?R(d,p):o.TObject(p)?je(d,p):o.TRecord(p)?We(d,p):o.TSymbol(p)?c.True:c.False}function Me(d,p){return o.TTemplateLiteral(d)?Oe(F.Resolve(d),p):o.TTemplateLiteral(p)?Oe(d,F.Resolve(p)):I("Invalid fallthrough for TemplateLiteral")}function g(d,p){return o.TArray(p)&&d.items!==void 0&&d.items.every(ve=>Oe(ve,p.items)===c.True)}function Ae(d,p){return o.TNever(d)?c.True:o.TUnknown(d)?c.False:o.TAny(d)?c.Union:c.False}function it(d,p){return C(p)?R(d,p):o.TObject(p)&&sn(p)||o.TArray(p)&&g(d,p)?c.True:o.TTuple(p)?i.IsUndefined(d.items)&&!i.IsUndefined(p.items)||!i.IsUndefined(d.items)&&i.IsUndefined(p.items)?c.False:i.IsUndefined(d.items)&&!i.IsUndefined(p.items)||d.items.every((ve,vt)=>Oe(ve,p.items[vt])===c.True)?c.True:c.False:c.False}function Pf(d,p){return C(p)?R(d,p):o.TObject(p)?je(d,p):o.TRecord(p)?We(d,p):o.TUint8Array(p)?c.True:c.False}function $f(d,p){return C(p)?R(d,p):o.TObject(p)?je(d,p):o.TRecord(p)?We(d,p):o.TVoid(p)?Cf(d,p):o.TUndefined(p)?c.True:c.False}function Ji(d,p){return p.anyOf.some(ve=>Oe(d,ve)===c.True)?c.True:c.False}function Rf(d,p){return d.anyOf.every(ve=>Oe(ve,p)===c.True)?c.True:c.False}function Ps(d,p){return c.True}function Nf(d,p){return o.TNever(p)?me(d,p):o.TIntersect(p)?ge(d,p):o.TUnion(p)?Ji(d,p):o.TAny(p)?E(d,p):o.TString(p)?rr(d,p):o.TNumber(p)?$(d,p):o.TInteger(p)?te(d,p):o.TBoolean(p)?v(d,p):o.TArray(p)?w(d,p):o.TTuple(p)?Ae(d,p):o.TObject(p)?je(d,p):o.TUnknown(p)?c.True:c.False}function Cf(d,p){return o.TUndefined(d)||o.TUndefined(d)?c.True:c.False}function xf(d,p){return o.TIntersect(p)?ge(d,p):o.TUnion(p)?Ji(d,p):o.TUnknown(p)?Ps(d,p):o.TAny(p)?E(d,p):o.TObject(p)?je(d,p):o.TVoid(p)?c.True:c.False}function Oe(d,p){return o.TTemplateLiteral(d)||o.TTemplateLiteral(p)?Me(d,p):o.TNot(d)||o.TNot(p)?A(d,p):o.TAny(d)?y(d,p):o.TArray(d)?T(d,p):o.TBigInt(d)?O(d,p):o.TBoolean(d)?b(d,p):o.TAsyncIterator(d)?a(d,p):o.TConstructor(d)?P(d,p):o.TDate(d)?k(d,p):o.TFunction(d)?Z(d,p):o.TInteger(d)?pe(d,p):o.TIntersect(d)?Ee(d,p):o.TIterator(d)?Ce(d,p):o.TLiteral(d)?rn(d,p):o.TNever(d)?Vt(d,p):o.TNull(d)?ue(d,p):o.TNumber(d)?ye(d,p):o.TObject(d)?Mr(d,p):o.TRecord(d)?Lr(d,p):o.TString(d)?qi(d,p):o.TSymbol(d)?Hi(d,p):o.TTuple(d)?it(d,p):o.TPromise(d)?Wi(d,p):o.TUint8Array(d)?Pf(d,p):o.TUndefined(d)?$f(d,p):o.TUnion(d)?Rf(d,p):o.TUnknown(d)?Nf(d,p):o.TVoid(d)?xf(d,p):I(`Unknown left type operand '${d[e.Kind]}'`)}function Uf(d,p){return Oe(d,p)}l.Extends=Uf})(h||(e.TypeExtends=h={}));var m;(function(l){function _(T){return T.map(a=>E(a))}function I(T){return new Date(T.getTime())}function C(T){return new Uint8Array(T)}function R(T){let a=Object.getOwnPropertyNames(T).reduce((v,b)=>({...v,[b]:E(T[b])}),{}),O=Object.getOwnPropertySymbols(T).reduce((v,b)=>({...v,[b]:E(T[b])}),{});return{...a,...O}}function E(T){return i.IsArray(T)?_(T):i.IsDate(T)?I(T):i.IsUint8Array(T)?C(T):i.IsObject(T)?R(T):T}function y(T){return T.map(a=>w(a))}l.Rest=y;function w(T,a={}){return{...E(T),...a}}l.Type=w})(m||(e.TypeClone=m={}));var M;(function(l){function _(P){return P.map(k=>{let{[e.Optional]:Z,...te}=m.Type(k);return te})}function I(P){return P.every(k=>o.TOptional(k))}function C(P){return P.some(k=>o.TOptional(k))}function R(P){return I(P.allOf)?e.Type.Optional(e.Type.Intersect(_(P.allOf))):P}function E(P){return C(P.anyOf)?e.Type.Optional(e.Type.Union(_(P.anyOf))):P}function y(P){return P[e.Kind]==="Intersect"?R(P):P[e.Kind]==="Union"?E(P):P}function w(P,k){let Z=P.allOf.reduce((te,pe)=>{let ge=v(pe,k);return ge[e.Kind]==="Never"?te:[...te,ge]},[]);return y(e.Type.Intersect(Z))}function T(P,k){let Z=P.anyOf.map(te=>v(te,k));return y(e.Type.Union(Z))}function a(P,k){let Z=P.properties[k];return i.IsUndefined(Z)?e.Type.Never():e.Type.Union([Z])}function O(P,k){let Z=P.items;if(i.IsUndefined(Z))return e.Type.Never();let te=Z[k];return i.IsUndefined(te)?e.Type.Never():te}function v(P,k){return P[e.Kind]==="Intersect"?w(P,k):P[e.Kind]==="Union"?T(P,k):P[e.Kind]==="Object"?a(P,k):P[e.Kind]==="Tuple"?O(P,k):e.Type.Never()}function b(P,k,Z={}){let te=k.map(pe=>v(P,pe.toString()));return y(e.Type.Union(te,Z))}l.Resolve=b})(M||(e.IndexedAccessor=M={}));var S;(function(l){function _(O){let[v,b]=[O.slice(0,1),O.slice(1)];return`${v.toLowerCase()}${b}`}function I(O){let[v,b]=[O.slice(0,1),O.slice(1)];return`${v.toUpperCase()}${b}`}function C(O){return O.toUpperCase()}function R(O){return O.toLowerCase()}function E(O,v){let b=z.ParseExact(O.pattern);if(!N.Check(b))return{...O,pattern:y(O.pattern,v)};let Z=[...L.Generate(b)].map(ge=>e.Type.Literal(ge)),te=w(Z,v),pe=e.Type.Union(te);return e.Type.TemplateLiteral([pe])}function y(O,v){return typeof O=="string"?v==="Uncapitalize"?_(O):v==="Capitalize"?I(O):v==="Uppercase"?C(O):v==="Lowercase"?R(O):O:O.toString()}function w(O,v){if(O.length===0)return[];let[b,...P]=O;return[a(b,v),...w(P,v)]}function T(O,v){return o.TTemplateLiteral(O)?E(O,v):o.TUnion(O)?e.Type.Union(w(O.anyOf,v)):o.TLiteral(O)?e.Type.Literal(y(O.const,v)):O}function a(O,v){return T(O,v)}l.Map=a})(S||(e.Intrinsic=S={}));var D;(function(l){function _(y,w){return e.Type.Intersect(y.allOf.map(T=>R(T,w)),{...y})}function I(y,w){return e.Type.Union(y.anyOf.map(T=>R(T,w)),{...y})}function C(y,w){return w(y)}function R(y,w){return y[e.Kind]==="Intersect"?_(y,w):y[e.Kind]==="Union"?I(y,w):y[e.Kind]==="Object"?C(y,w):y}function E(y,w,T){return{...R(m.Type(y),w),...T}}l.Map=E})(D||(e.ObjectMap=D={}));var H;(function(l){function _(a){return a[0]==="^"&&a[a.length-1]==="$"?a.slice(1,a.length-1):a}function I(a,O){return a.allOf.reduce((v,b)=>[...v,...y(b,O)],[])}function C(a,O){let v=a.anyOf.map(b=>y(b,O));return[...v.reduce((b,P)=>P.map(k=>v.every(Z=>Z.includes(k))?b.add(k):b)[0],new Set)]}function R(a,O){return Object.getOwnPropertyNames(a.properties)}function E(a,O){return O.includePatterns?Object.getOwnPropertyNames(a.patternProperties):[]}function y(a,O){return o.TIntersect(a)?I(a,O):o.TUnion(a)?C(a,O):o.TObject(a)?R(a,O):o.TRecord(a)?E(a,O):[]}function w(a,O){return[...new Set(y(a,O))]}l.ResolveKeys=w;function T(a){return`^(${w(a,{includePatterns:!0}).map(b=>`(${_(b)})`).join("|")})$`}l.ResolvePattern=T})(H||(e.KeyResolver=H={}));var Q=class extends n{};e.KeyArrayResolverError=Q;var K;(function(l){function _(I){return Array.isArray(I)?I:o.TUnionLiteral(I)?I.anyOf.map(C=>C.const.toString()):o.TLiteral(I)?[I.const]:o.TTemplateLiteral(I)?(()=>{let C=z.ParseExact(I.pattern);if(!N.Check(C))throw new Q("Cannot resolve keys from infinite template expression");return[...L.Generate(C)]})():[]}l.Resolve=_})(K||(e.KeyArrayResolver=K={}));var B;(function(l){function*_(C){for(let R of C.anyOf)R[e.Kind]==="Union"?yield*_(R):yield R}function I(C){return e.Type.Union([..._(C)],{...C})}l.Resolve=I})(B||(e.UnionResolver=B={}));var V=class extends n{};e.TemplateLiteralPatternError=V;var W;(function(l){function _(E){throw new V(E)}function I(E){return E.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function C(E,y){return o.TTemplateLiteral(E)?E.pattern.slice(1,E.pattern.length-1):o.TUnion(E)?`(${E.anyOf.map(w=>C(w,y)).join("|")})`:o.TNumber(E)?`${y}${e.PatternNumber}`:o.TInteger(E)?`${y}${e.PatternNumber}`:o.TBigInt(E)?`${y}${e.PatternNumber}`:o.TString(E)?`${y}${e.PatternString}`:o.TLiteral(E)?`${y}${I(E.const.toString())}`:o.TBoolean(E)?`${y}${e.PatternBoolean}`:_(`Unexpected Kind '${E[e.Kind]}'`)}function R(E){return`^${E.map(y=>C(y,"")).join("")}$`}l.Create=R})(W||(e.TemplateLiteralPattern=W={}));var F;(function(l){function _(I){let C=z.ParseExact(I.pattern);if(!N.Check(C))return e.Type.String();let R=[...L.Generate(C)].map(E=>e.Type.Literal(E));return e.Type.Union(R)}l.Resolve=_})(F||(e.TemplateLiteralResolver=F={}));var ee=class extends n{};e.TemplateLiteralParserError=ee;var z;(function(l){function _(P,k,Z){return P[k]===Z&&P.charCodeAt(k-1)!==92}function I(P,k){return _(P,k,"(")}function C(P,k){return _(P,k,")")}function R(P,k){return _(P,k,"|")}function E(P){if(!(I(P,0)&&C(P,P.length-1)))return!1;let k=0;for(let Z=0;Z<P.length;Z++)if(I(P,Z)&&(k+=1),C(P,Z)&&(k-=1),k===0&&Z!==P.length-1)return!1;return!0}function y(P){return P.slice(1,P.length-1)}function w(P){let k=0;for(let Z=0;Z<P.length;Z++)if(I(P,Z)&&(k+=1),C(P,Z)&&(k-=1),R(P,Z)&&k===0)return!0;return!1}function T(P){for(let k=0;k<P.length;k++)if(I(P,k))return!0;return!1}function a(P){let[k,Z]=[0,0],te=[];for(let ge=0;ge<P.length;ge++)if(I(P,ge)&&(k+=1),C(P,ge)&&(k-=1),R(P,ge)&&k===0){let Ee=P.slice(Z,ge);Ee.length>0&&te.push(v(Ee)),Z=ge+1}let pe=P.slice(Z);return pe.length>0&&te.push(v(pe)),te.length===0?{type:"const",const:""}:te.length===1?te[0]:{type:"or",expr:te}}function O(P){function k(pe,ge){if(!I(pe,ge))throw new ee("TemplateLiteralParser: Index must point to open parens");let Ee=0;for(let Ce=ge;Ce<pe.length;Ce++)if(I(pe,Ce)&&(Ee+=1),C(pe,Ce)&&(Ee-=1),Ee===0)return[ge,Ce];throw new ee("TemplateLiteralParser: Unclosed group parens in expression")}function Z(pe,ge){for(let Ee=ge;Ee<pe.length;Ee++)if(I(pe,Ee))return[ge,Ee];return[ge,pe.length]}let te=[];for(let pe=0;pe<P.length;pe++)if(I(P,pe)){let[ge,Ee]=k(P,pe),Ce=P.slice(ge,Ee+1);te.push(v(Ce)),pe=Ee}else{let[ge,Ee]=Z(P,pe),Ce=P.slice(ge,Ee);Ce.length>0&&te.push(v(Ce)),pe=Ee-1}return te.length===0?{type:"const",const:""}:te.length===1?te[0]:{type:"and",expr:te}}function v(P){return E(P)?v(y(P)):w(P)?a(P):T(P)?O(P):{type:"const",const:P}}l.Parse=v;function b(P){return v(P.slice(1,P.length-1))}l.ParseExact=b})(z||(e.TemplateLiteralParser=z={}));var fe=class extends n{};e.TemplateLiteralFiniteError=fe;var N;(function(l){function _(y){throw new fe(y)}function I(y){return y.type==="or"&&y.expr.length===2&&y.expr[0].type==="const"&&y.expr[0].const==="0"&&y.expr[1].type==="const"&&y.expr[1].const==="[1-9][0-9]*"}function C(y){return y.type==="or"&&y.expr.length===2&&y.expr[0].type==="const"&&y.expr[0].const==="true"&&y.expr[1].type==="const"&&y.expr[1].const==="false"}function R(y){return y.type==="const"&&y.const===".*"}function E(y){return C(y)?!0:I(y)||R(y)?!1:y.type==="and"?y.expr.every(w=>E(w)):y.type==="or"?y.expr.every(w=>E(w)):y.type==="const"?!0:_("Unknown expression type")}l.Check=E})(N||(e.TemplateLiteralFinite=N={}));var x=class extends n{};e.TemplateLiteralGeneratorError=x;var L;(function(l){function*_(y){if(y.length===1)return yield*y[0];for(let w of y[0])for(let T of _(y.slice(1)))yield`${w}${T}`}function*I(y){return yield*_(y.expr.map(w=>[...E(w)]))}function*C(y){for(let w of y.expr)yield*E(w)}function*R(y){return yield y.const}function*E(y){return y.type==="and"?yield*I(y):y.type==="or"?yield*C(y):y.type==="const"?yield*R(y):(()=>{throw new x("Unknown expression")})()}l.Generate=E})(L||(e.TemplateLiteralGenerator=L={}));var Y;(function(l){function*_(E){let y=E.trim().replace(/"|'/g,"");return y==="boolean"?yield e.Type.Boolean():y==="number"?yield e.Type.Number():y==="bigint"?yield e.Type.BigInt():y==="string"?yield e.Type.String():yield(()=>{let w=y.split("|").map(T=>e.Type.Literal(T.trim()));return w.length===0?e.Type.Never():w.length===1?w[0]:e.Type.Union(w)})()}function*I(E){if(E[1]!=="{"){let y=e.Type.Literal("$"),w=C(E.slice(1));return yield*[y,...w]}for(let y=2;y<E.length;y++)if(E[y]==="}"){let w=_(E.slice(2,y)),T=C(E.slice(y+1));return yield*[...w,...T]}yield e.Type.Literal(E)}function*C(E){for(let y=0;y<E.length;y++)if(E[y]==="$"){let w=e.Type.Literal(E.slice(0,y)),T=I(E.slice(y));return yield*[w,...T]}yield e.Type.Literal(E)}function R(E){return[...C(E)]}l.Parse=R})(Y||(e.TemplateLiteralDslParser=Y={}));var ie=class{constructor(l){this.schema=l}Decode(l){return new X(this.schema,l)}};e.TransformDecodeBuilder=ie;var X=class{constructor(l,_){this.schema=l,this.decode=_}Encode(l){let _=m.Type(this.schema);return o.TTransform(_)?(()=>{let R={Encode:E=>_[e.Transform].Encode(l(E)),Decode:E=>this.decode(_[e.Transform].Decode(E))};return{..._,[e.Transform]:R}})():(()=>{let I={Decode:this.decode,Encode:l};return{..._,[e.Transform]:I}})()}};e.TransformEncodeBuilder=X;var se=0,j=class extends n{};e.TypeBuilderError=j;var G=class{Create(l){return l}Throw(l){throw new j(l)}Discard(l,_){return _.reduce((I,C)=>{let{[C]:R,...E}=I;return E},l)}Strict(l){return JSON.parse(JSON.stringify(l))}};e.TypeBuilder=G;var J=class extends G{ReadonlyOptional(l){return this.Readonly(this.Optional(l))}Readonly(l){return{...m.Type(l),[e.Readonly]:"Readonly"}}Optional(l){return{...m.Type(l),[e.Optional]:"Optional"}}Any(l={}){return this.Create({...l,[e.Kind]:"Any"})}Array(l,_={}){return this.Create({..._,[e.Kind]:"Array",type:"array",items:m.Type(l)})}Boolean(l={}){return this.Create({...l,[e.Kind]:"Boolean",type:"boolean"})}Capitalize(l,_={}){return{...S.Map(m.Type(l),"Capitalize"),..._}}Composite(l,_){let I=e.Type.Intersect(l,{}),R=H.ResolveKeys(I,{includePatterns:!1}).reduce((E,y)=>({...E,[y]:e.Type.Index(I,[y])}),{});return e.Type.Object(R,_)}Enum(l,_={}){if(i.IsUndefined(l))return this.Throw("Enum undefined or empty");let I=Object.getOwnPropertyNames(l).filter(E=>isNaN(E)).map(E=>l[E]),R=[...new Set(I)].map(E=>e.Type.Literal(E));return this.Union(R,{..._,[e.Hint]:"Enum"})}Extends(l,_,I,C,R={}){switch(h.Extends(l,_)){case c.Union:return this.Union([m.Type(I,R),m.Type(C,R)]);case c.True:return m.Type(I,R);case c.False:return m.Type(C,R)}}Exclude(l,_,I={}){return o.TTemplateLiteral(l)?this.Exclude(F.Resolve(l),_,I):o.TTemplateLiteral(_)?this.Exclude(l,F.Resolve(_),I):o.TUnion(l)?(()=>{let C=l.anyOf.filter(R=>h.Extends(R,_)===c.False);return C.length===1?m.Type(C[0],I):this.Union(C,I)})():h.Extends(l,_)!==c.False?this.Never(I):m.Type(l,I)}Extract(l,_,I={}){return o.TTemplateLiteral(l)?this.Extract(F.Resolve(l),_,I):o.TTemplateLiteral(_)?this.Extract(l,F.Resolve(_),I):o.TUnion(l)?(()=>{let C=l.anyOf.filter(R=>h.Extends(R,_)!==c.False);return C.length===1?m.Type(C[0],I):this.Union(C,I)})():h.Extends(l,_)!==c.False?m.Type(l,I):this.Never(I)}Index(l,_,I={}){return o.TArray(l)&&o.TNumber(_)?m.Type(l.items,I):o.TTuple(l)&&o.TNumber(_)?(()=>{let R=(i.IsUndefined(l.items)?[]:l.items).map(E=>m.Type(E));return this.Union(R,I)})():(()=>{let C=K.Resolve(_),R=m.Type(l);return M.Resolve(R,C,I)})()}Integer(l={}){return this.Create({...l,[e.Kind]:"Integer",type:"integer"})}Intersect(l,_={}){if(l.length===0)return e.Type.Never();if(l.length===1)return m.Type(l[0],_);l.some(E=>o.TTransform(E))&&this.Throw("Cannot intersect transform types");let I=l.every(E=>o.TObject(E)),C=m.Rest(l),R=o.TSchema(_.unevaluatedProperties)?{unevaluatedProperties:m.Type(_.unevaluatedProperties)}:{};return _.unevaluatedProperties===!1||o.TSchema(_.unevaluatedProperties)||I?this.Create({..._,...R,[e.Kind]:"Intersect",type:"object",allOf:C}):this.Create({..._,...R,[e.Kind]:"Intersect",allOf:C})}KeyOf(l,_={}){return o.TRecord(l)?(()=>{let I=Object.getOwnPropertyNames(l.patternProperties)[0];return I===e.PatternNumberExact?this.Number(_):I===e.PatternStringExact?this.String(_):this.Throw("Unable to resolve key type from Record key pattern")})():o.TTuple(l)?(()=>{let C=(i.IsUndefined(l.items)?[]:l.items).map((R,E)=>e.Type.Literal(E.toString()));return this.Union(C,_)})():o.TArray(l)?this.Number(_):(()=>{let I=H.ResolveKeys(l,{includePatterns:!1});if(I.length===0)return this.Never(_);let C=I.map(R=>this.Literal(R));return this.Union(C,_)})()}Literal(l,_={}){return this.Create({..._,[e.Kind]:"Literal",const:l,type:typeof l})}Lowercase(l,_={}){return{...S.Map(m.Type(l),"Lowercase"),..._}}Never(l={}){return this.Create({...l,[e.Kind]:"Never",not:{}})}Not(l,_){return this.Create({..._,[e.Kind]:"Not",not:m.Type(l)})}Null(l={}){return this.Create({...l,[e.Kind]:"Null",type:"null"})}Number(l={}){return this.Create({...l,[e.Kind]:"Number",type:"number"})}Object(l,_={}){let I=Object.getOwnPropertyNames(l),C=I.filter(w=>o.TOptional(l[w])),R=I.filter(w=>!C.includes(w)),E=o.TSchema(_.additionalProperties)?{additionalProperties:m.Type(_.additionalProperties)}:{},y=I.reduce((w,T)=>({...w,[T]:m.Type(l[T])}),{});return R.length>0?this.Create({..._,...E,[e.Kind]:"Object",type:"object",properties:y,required:R}):this.Create({..._,...E,[e.Kind]:"Object",type:"object",properties:y})}Omit(l,_,I={}){let C=K.Resolve(_);return D.Map(this.Discard(m.Type(l),["$id",e.Transform]),R=>{i.IsArray(R.required)&&(R.required=R.required.filter(E=>!C.includes(E)),R.required.length===0&&delete R.required);for(let E of Object.getOwnPropertyNames(R.properties))C.includes(E)&&delete R.properties[E];return this.Create(R)},I)}Partial(l,_={}){return D.Map(this.Discard(m.Type(l),["$id",e.Transform]),I=>{let C=Object.getOwnPropertyNames(I.properties).reduce((R,E)=>({...R,[E]:this.Optional(I.properties[E])}),{});return this.Object(C,this.Discard(I,["required"]))},_)}Pick(l,_,I={}){let C=K.Resolve(_);return D.Map(this.Discard(m.Type(l),["$id",e.Transform]),R=>{i.IsArray(R.required)&&(R.required=R.required.filter(E=>C.includes(E)),R.required.length===0&&delete R.required);for(let E of Object.getOwnPropertyNames(R.properties))C.includes(E)||delete R.properties[E];return this.Create(R)},I)}Record(l,_,I={}){return o.TTemplateLiteral(l)?(()=>{let C=z.ParseExact(l.pattern);return N.Check(C)?this.Object([...L.Generate(C)].reduce((R,E)=>({...R,[E]:m.Type(_)}),{}),I):this.Create({...I,[e.Kind]:"Record",type:"object",patternProperties:{[l.pattern]:m.Type(_)}})})():o.TUnion(l)?(()=>{let C=B.Resolve(l);if(o.TUnionLiteral(C)){let R=C.anyOf.reduce((E,y)=>({...E,[y.const]:m.Type(_)}),{});return this.Object(R,{...I,[e.Hint]:"Record"})}else this.Throw("Record key of type union contains non-literal types")})():o.TLiteral(l)?i.IsString(l.const)||i.IsNumber(l.const)?this.Object({[l.const]:m.Type(_)},I):this.Throw("Record key of type literal is not of type string or number"):o.TInteger(l)||o.TNumber(l)?this.Create({...I,[e.Kind]:"Record",type:"object",patternProperties:{[e.PatternNumberExact]:m.Type(_)}}):o.TString(l)?(()=>{let C=i.IsUndefined(l.pattern)?e.PatternStringExact:l.pattern;return this.Create({...I,[e.Kind]:"Record",type:"object",patternProperties:{[C]:m.Type(_)}})})():this.Never()}Recursive(l,_={}){i.IsUndefined(_.$id)&&(_.$id=`T${se++}`);let I=l({[e.Kind]:"This",$ref:`${_.$id}`});return I.$id=_.$id,this.Create({..._,[e.Hint]:"Recursive",...I})}Ref(l,_={}){return i.IsString(l)?this.Create({..._,[e.Kind]:"Ref",$ref:l}):(i.IsUndefined(l.$id)&&this.Throw("Reference target type must specify an $id"),this.Create({..._,[e.Kind]:"Ref",$ref:l.$id}))}Required(l,_={}){return D.Map(this.Discard(m.Type(l),["$id",e.Transform]),I=>{let C=Object.getOwnPropertyNames(I.properties).reduce((R,E)=>({...R,[E]:this.Discard(I.properties[E],[e.Optional])}),{});return this.Object(C,I)},_)}Rest(l){return o.TTuple(l)&&!i.IsUndefined(l.items)?m.Rest(l.items):o.TIntersect(l)?m.Rest(l.allOf):o.TUnion(l)?m.Rest(l.anyOf):[]}String(l={}){return this.Create({...l,[e.Kind]:"String",type:"string"})}TemplateLiteral(l,_={}){let I=i.IsString(l)?W.Create(Y.Parse(l)):W.Create(l);return this.Create({..._,[e.Kind]:"TemplateLiteral",type:"string",pattern:I})}Transform(l){return new ie(l)}Tuple(l,_={}){let[I,C,R]=[!1,l.length,l.length],E=m.Rest(l),y=l.length>0?{..._,[e.Kind]:"Tuple",type:"array",items:E,additionalItems:I,minItems:C,maxItems:R}:{..._,[e.Kind]:"Tuple",type:"array",minItems:C,maxItems:R};return this.Create(y)}Uncapitalize(l,_={}){return{...S.Map(m.Type(l),"Uncapitalize"),..._}}Union(l,_={}){return o.TTemplateLiteral(l)?F.Resolve(l):(()=>{let I=l;if(I.length===0)return this.Never(_);if(I.length===1)return this.Create(m.Type(I[0],_));let C=m.Rest(I);return this.Create({..._,[e.Kind]:"Union",anyOf:C})})()}Unknown(l={}){return this.Create({...l,[e.Kind]:"Unknown"})}Unsafe(l={}){return this.Create({...l,[e.Kind]:l[e.Kind]||"Unsafe"})}Uppercase(l,_={}){return{...S.Map(m.Type(l),"Uppercase"),..._}}};e.JsonTypeBuilder=J;var le=class extends J{AsyncIterator(l,_={}){return this.Create({..._,[e.Kind]:"AsyncIterator",type:"AsyncIterator",items:m.Type(l)})}Awaited(l,_={}){let I=C=>C.length>0?(()=>{let[R,...E]=C;return[this.Awaited(R),...I(E)]})():C;return o.TIntersect(l)?e.Type.Intersect(I(l.allOf)):o.TUnion(l)?e.Type.Union(I(l.anyOf)):o.TPromise(l)?this.Awaited(l.item):m.Type(l,_)}BigInt(l={}){return this.Create({...l,[e.Kind]:"BigInt",type:"bigint"})}ConstructorParameters(l,_={}){return this.Tuple([...l.parameters],{..._})}Constructor(l,_,I){let[C,R]=[m.Rest(l),m.Type(_)];return this.Create({...I,[e.Kind]:"Constructor",type:"Constructor",parameters:C,returns:R})}Date(l={}){return this.Create({...l,[e.Kind]:"Date",type:"Date"})}Function(l,_,I){let[C,R]=[m.Rest(l),m.Type(_)];return this.Create({...I,[e.Kind]:"Function",type:"Function",parameters:C,returns:R})}InstanceType(l,_={}){return m.Type(l.returns,_)}Iterator(l,_={}){return this.Create({..._,[e.Kind]:"Iterator",type:"Iterator",items:m.Type(l)})}Parameters(l,_={}){return this.Tuple(l.parameters,{..._})}Promise(l,_={}){return this.Create({..._,[e.Kind]:"Promise",type:"Promise",item:m.Type(l)})}RegExp(l,_={}){let I=i.IsString(l)?l:l.source;return this.Create({..._,[e.Kind]:"String",type:"string",pattern:I})}RegEx(l,_={}){return this.RegExp(l,_)}ReturnType(l,_={}){return m.Type(l.returns,_)}Symbol(l){return this.Create({...l,[e.Kind]:"Symbol",type:"symbol"})}Undefined(l={}){return this.Create({...l,[e.Kind]:"Undefined",type:"undefined"})}Uint8Array(l={}){return this.Create({...l,[e.Kind]:"Uint8Array",type:"Uint8Array"})}Void(l={}){return this.Create({...l,[e.Kind]:"Void",type:"void"})}};e.JavaScriptTypeBuilder=le,e.JsonType=new J,e.Type=new le}}),Kn=Xt(Kt(),1),{String:Fd,Optional:kd,Boolean:Kd,Object:Gd,Number:Vd}=Kn.Type,zd=Fd.bind(Kn.Type),Wd=Vd.bind(Kn.Type),wO=Gd.bind(Kn.Type),OO=kd.bind(Kn.Type),qd=Kd.bind(Kn.Type),AO=zd(),IO=Wd(),EO=qd();function Fa(e){return Array.isArray(e)?e:[e]}var Hd=ke({"../../../node_modules/.pnpm/browser-or-node@2.1.1/node_modules/browser-or-node/lib/index.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},n=typeof window<"u"&&typeof window.document<"u",r=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,i=(typeof self>"u"?"undefined":t(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",s=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),o=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";e.isBrowser=n,e.isWebWorker=i,e.isNode=r,e.isJsDom=s,e.isDeno=o}}),Jd=ke({"../../../node_modules/.pnpm/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js"(e,t){"use strict";t.exports=function(n,r){r||(r={}),typeof r=="function"&&(r={cmp:r});var i=typeof r.cycles=="boolean"?r.cycles:!1,s=r.cmp&&(function(u){return function(f){return function(c,h){var m={key:c,value:f[c]},M={key:h,value:f[h]};return u(m,M)}}})(r.cmp),o=[];return(function u(f){if(f&&f.toJSON&&typeof f.toJSON=="function"&&(f=f.toJSON()),f!==void 0){if(typeof f=="number")return isFinite(f)?""+f:"null";if(typeof f!="object")return JSON.stringify(f);var c,h;if(Array.isArray(f)){for(h="[",c=0;c<f.length;c++)c&&(h+=","),h+=u(f[c])||"null";return h+"]"}if(f===null)return"null";if(o.indexOf(f)!==-1){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var m=o.push(f)-1,M=Object.keys(f).sort(s&&s(f));for(h="",c=0;c<M.length;c++){var S=M[c],D=u(f[S]);D&&(h&&(h+=","),h+=JSON.stringify(S)+":"+D)}return o.splice(m,1),"{"+h+"}"}})(n)}}}),Xd=ke({"../../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js"(e,t){"use strict";var{hasOwnProperty:n}=Object.prototype,r=K();r.configure=K,r.stringify=r,r.default=r,e.stringify=r,e.configure=K,t.exports=r;var i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function s(B){return B.length<5e3&&!i.test(B)?`"${B}"`:JSON.stringify(B)}function o(B,V){if(B.length>200||V)return B.sort(V);for(let W=1;W<B.length;W++){let F=B[W],ee=W;for(;ee!==0&&B[ee-1]>F;)B[ee]=B[ee-1],ee--;B[ee]=F}return B}var u=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function f(B){return u.call(B)!==void 0&&B.length!==0}function c(B,V,W){B.length<W&&(W=B.length);let F=V===","?"":" ",ee=`"0":${F}${B[0]}`;for(let z=1;z<W;z++)ee+=`${V}"${z}":${F}${B[z]}`;return ee}function h(B){if(n.call(B,"circularValue")){let V=B.circularValue;if(typeof V=="string")return`"${V}"`;if(V==null)return V;if(V===Error||V===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function m(B){let V;if(n.call(B,"deterministic")&&(V=B.deterministic,typeof V!="boolean"&&typeof V!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return V===void 0?!0:V}function M(B,V){let W;if(n.call(B,V)&&(W=B[V],typeof W!="boolean"))throw new TypeError(`The "${V}" argument must be of type boolean`);return W===void 0?!0:W}function S(B,V){let W;if(n.call(B,V)){if(W=B[V],typeof W!="number")throw new TypeError(`The "${V}" argument must be of type number`);if(!Number.isInteger(W))throw new TypeError(`The "${V}" argument must be an integer`);if(W<1)throw new RangeError(`The "${V}" argument must be >= 1`)}return W===void 0?1/0:W}function D(B){return B===1?"1 item":`${B} items`}function H(B){let V=new Set;for(let W of B)(typeof W=="string"||typeof W=="number")&&V.add(String(W));return V}function Q(B){if(n.call(B,"strict")){let V=B.strict;if(typeof V!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(V)return W=>{let F=`Object can not safely be stringified. Received type ${typeof W}`;throw typeof W!="function"&&(F+=` (${W.toString()})`),new Error(F)}}}function K(B){B={...B};let V=Q(B);V&&(B.bigint===void 0&&(B.bigint=!1),"circularValue"in B||(B.circularValue=Error));let W=h(B),F=M(B,"bigint"),ee=m(B),z=typeof ee=="function"?ee:void 0,fe=S(B,"maximumDepth"),N=S(B,"maximumBreadth");function x(se,j,G,J,le,l){let _=j[se];switch(typeof _=="object"&&_!==null&&typeof _.toJSON=="function"&&(_=_.toJSON(se)),_=J.call(j,se,_),typeof _){case"string":return s(_);case"object":{if(_===null)return"null";if(G.indexOf(_)!==-1)return W;let I="",C=",",R=l;if(Array.isArray(_)){if(_.length===0)return"[]";if(fe<G.length+1)return'"[Array]"';G.push(_),le!==""&&(l+=le,I+=`
31
+ ${l}`,C=`,
32
+ ${l}`);let O=Math.min(_.length,N),v=0;for(;v<O-1;v++){let P=x(String(v),_,G,J,le,l);I+=P!==void 0?P:"null",I+=C}let b=x(String(v),_,G,J,le,l);if(I+=b!==void 0?b:"null",_.length-1>N){let P=_.length-N-1;I+=`${C}"... ${D(P)} not stringified"`}return le!==""&&(I+=`
33
+ ${R}`),G.pop(),`[${I}]`}let E=Object.keys(_),y=E.length;if(y===0)return"{}";if(fe<G.length+1)return'"[Object]"';let w="",T="";le!==""&&(l+=le,C=`,
34
+ ${l}`,w=" ");let a=Math.min(y,N);ee&&!f(_)&&(E=o(E,z)),G.push(_);for(let O=0;O<a;O++){let v=E[O],b=x(v,_,G,J,le,l);b!==void 0&&(I+=`${T}${s(v)}:${w}${b}`,T=C)}if(y>N){let O=y-N;I+=`${T}"...":${w}"${D(O)} not stringified"`,T=C}return le!==""&&T.length>1&&(I=`
35
+ ${l}${I}
36
+ ${R}`),G.pop(),`{${I}}`}case"number":return isFinite(_)?String(_):V?V(_):"null";case"boolean":return _===!0?"true":"false";case"undefined":return;case"bigint":if(F)return String(_);default:return V?V(_):void 0}}function L(se,j,G,J,le,l){switch(typeof j=="object"&&j!==null&&typeof j.toJSON=="function"&&(j=j.toJSON(se)),typeof j){case"string":return s(j);case"object":{if(j===null)return"null";if(G.indexOf(j)!==-1)return W;let _=l,I="",C=",";if(Array.isArray(j)){if(j.length===0)return"[]";if(fe<G.length+1)return'"[Array]"';G.push(j),le!==""&&(l+=le,I+=`
37
+ ${l}`,C=`,
38
+ ${l}`);let y=Math.min(j.length,N),w=0;for(;w<y-1;w++){let a=L(String(w),j[w],G,J,le,l);I+=a!==void 0?a:"null",I+=C}let T=L(String(w),j[w],G,J,le,l);if(I+=T!==void 0?T:"null",j.length-1>N){let a=j.length-N-1;I+=`${C}"... ${D(a)} not stringified"`}return le!==""&&(I+=`
39
+ ${_}`),G.pop(),`[${I}]`}G.push(j);let R="";le!==""&&(l+=le,C=`,
40
+ ${l}`,R=" ");let E="";for(let y of J){let w=L(y,j[y],G,J,le,l);w!==void 0&&(I+=`${E}${s(y)}:${R}${w}`,E=C)}return le!==""&&E.length>1&&(I=`
41
+ ${l}${I}
42
+ ${_}`),G.pop(),`{${I}}`}case"number":return isFinite(j)?String(j):V?V(j):"null";case"boolean":return j===!0?"true":"false";case"undefined":return;case"bigint":if(F)return String(j);default:return V?V(j):void 0}}function Y(se,j,G,J,le){switch(typeof j){case"string":return s(j);case"object":{if(j===null)return"null";if(typeof j.toJSON=="function"){if(j=j.toJSON(se),typeof j!="object")return Y(se,j,G,J,le);if(j===null)return"null"}if(G.indexOf(j)!==-1)return W;let l=le;if(Array.isArray(j)){if(j.length===0)return"[]";if(fe<G.length+1)return'"[Array]"';G.push(j),le+=J;let w=`
43
+ ${le}`,T=`,
44
+ ${le}`,a=Math.min(j.length,N),O=0;for(;O<a-1;O++){let b=Y(String(O),j[O],G,J,le);w+=b!==void 0?b:"null",w+=T}let v=Y(String(O),j[O],G,J,le);if(w+=v!==void 0?v:"null",j.length-1>N){let b=j.length-N-1;w+=`${T}"... ${D(b)} not stringified"`}return w+=`
45
+ ${l}`,G.pop(),`[${w}]`}let _=Object.keys(j),I=_.length;if(I===0)return"{}";if(fe<G.length+1)return'"[Object]"';le+=J;let C=`,
46
+ ${le}`,R="",E="",y=Math.min(I,N);f(j)&&(R+=c(j,C,N),_=_.slice(j.length),y-=j.length,E=C),ee&&(_=o(_,z)),G.push(j);for(let w=0;w<y;w++){let T=_[w],a=Y(T,j[T],G,J,le);a!==void 0&&(R+=`${E}${s(T)}: ${a}`,E=C)}if(I>N){let w=I-N;R+=`${E}"...": "${D(w)} not stringified"`,E=C}return E!==""&&(R=`
47
+ ${le}${R}
48
+ ${l}`),G.pop(),`{${R}}`}case"number":return isFinite(j)?String(j):V?V(j):"null";case"boolean":return j===!0?"true":"false";case"undefined":return;case"bigint":if(F)return String(j);default:return V?V(j):void 0}}function ie(se,j,G){switch(typeof j){case"string":return s(j);case"object":{if(j===null)return"null";if(typeof j.toJSON=="function"){if(j=j.toJSON(se),typeof j!="object")return ie(se,j,G);if(j===null)return"null"}if(G.indexOf(j)!==-1)return W;let J="",le=j.length!==void 0;if(le&&Array.isArray(j)){if(j.length===0)return"[]";if(fe<G.length+1)return'"[Array]"';G.push(j);let R=Math.min(j.length,N),E=0;for(;E<R-1;E++){let w=ie(String(E),j[E],G);J+=w!==void 0?w:"null",J+=","}let y=ie(String(E),j[E],G);if(J+=y!==void 0?y:"null",j.length-1>N){let w=j.length-N-1;J+=`,"... ${D(w)} not stringified"`}return G.pop(),`[${J}]`}let l=Object.keys(j),_=l.length;if(_===0)return"{}";if(fe<G.length+1)return'"[Object]"';let I="",C=Math.min(_,N);le&&f(j)&&(J+=c(j,",",N),l=l.slice(j.length),C-=j.length,I=","),ee&&(l=o(l,z)),G.push(j);for(let R=0;R<C;R++){let E=l[R],y=ie(E,j[E],G);y!==void 0&&(J+=`${I}${s(E)}:${y}`,I=",")}if(_>N){let R=_-N;J+=`${I}"...":"${D(R)} not stringified"`}return G.pop(),`{${J}}`}case"number":return isFinite(j)?String(j):V?V(j):"null";case"boolean":return j===!0?"true":"false";case"undefined":return;case"bigint":if(F)return String(j);default:return V?V(j):void 0}}function X(se,j,G){if(arguments.length>1){let J="";if(typeof G=="number"?J=" ".repeat(Math.min(G,10)):typeof G=="string"&&(J=G.slice(0,10)),j!=null){if(typeof j=="function")return x("",{"":se},[],j,J,"");if(Array.isArray(j))return L("",se,[],H(j),J,"")}if(J.length!==0)return Y("",se,[],J,"")}return ie("",se,[])}return X}}}),Wn=ke({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/guard.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IsValueType=e.IsSymbol=e.IsFunction=e.IsString=e.IsBigInt=e.IsInteger=e.IsNumber=e.IsBoolean=e.IsNull=e.IsUndefined=e.IsArray=e.IsObject=e.IsPlainObject=e.HasPropertyKey=e.IsDate=e.IsUint8Array=e.IsPromise=e.IsTypedArray=e.IsIterator=e.IsAsyncIterator=void 0;function t(F){return c(F)&&Symbol.asyncIterator in F}e.IsAsyncIterator=t;function n(F){return c(F)&&Symbol.iterator in F}e.IsIterator=n;function r(F){return ArrayBuffer.isView(F)}e.IsTypedArray=r;function i(F){return F instanceof Promise}e.IsPromise=i;function s(F){return F instanceof Uint8Array}e.IsUint8Array=s;function o(F){return F instanceof Date&&Number.isFinite(F.getTime())}e.IsDate=o;function u(F,ee){return ee in F}e.HasPropertyKey=u;function f(F){return c(F)&&B(F.constructor)&&F.constructor.name==="Object"}e.IsPlainObject=f;function c(F){return F!==null&&typeof F=="object"}e.IsObject=c;function h(F){return Array.isArray(F)&&!ArrayBuffer.isView(F)}e.IsArray=h;function m(F){return F===void 0}e.IsUndefined=m;function M(F){return F===null}e.IsNull=M;function S(F){return typeof F=="boolean"}e.IsBoolean=S;function D(F){return typeof F=="number"}e.IsNumber=D;function H(F){return D(F)&&Number.isInteger(F)}e.IsInteger=H;function Q(F){return typeof F=="bigint"}e.IsBigInt=Q;function K(F){return typeof F=="string"}e.IsString=K;function B(F){return typeof F=="function"}e.IsFunction=B;function V(F){return typeof F=="symbol"}e.IsSymbol=V;function W(F){return Q(F)||S(F)||M(F)||D(F)||K(F)||V(F)||m(F)}e.IsValueType=W}}),Yu=ke({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/system/system.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DefaultErrorFunction=e.TypeSystemPolicy=e.TypeSystemErrorFunction=e.TypeSystem=e.TypeSystemDuplicateFormat=e.TypeSystemDuplicateTypeKind=void 0;var t=Wn(),n=xi(),r=Kt(),i=class extends r.TypeBoxError{constructor(h){super(`Duplicate type kind '${h}' detected`)}};e.TypeSystemDuplicateTypeKind=i;var s=class extends r.TypeBoxError{constructor(h){super(`Duplicate string format '${h}' detected`)}};e.TypeSystemDuplicateFormat=s;var o;(function(h){function m(S,D){if(r.TypeRegistry.Has(S))throw new i(S);return r.TypeRegistry.Set(S,D),(H={})=>r.Type.Unsafe({...H,[r.Kind]:S})}h.Type=m;function M(S,D){if(r.FormatRegistry.Has(S))throw new s(S);return r.FormatRegistry.Set(S,D),S}h.Format=M})(o||(e.TypeSystem=o={}));var u;(function(h){let m=c;function M(){m=c}h.Reset=M;function S(H){m=H}h.Set=S;function D(){return m}h.Get=D})(u||(e.TypeSystemErrorFunction=u={}));var f;(function(h){h.ExactOptionalPropertyTypes=!1,h.AllowArrayObject=!1,h.AllowNaN=!1,h.AllowNullVoid=!1;function m(Q,K){return h.ExactOptionalPropertyTypes?K in Q:Q[K]!==void 0}h.IsExactOptionalProperty=m;function M(Q){let K=(0,t.IsObject)(Q);return h.AllowArrayObject?K:K&&!(0,t.IsArray)(Q)}h.IsObjectLike=M;function S(Q){return M(Q)&&!(Q instanceof Date)&&!(Q instanceof Uint8Array)}h.IsRecordLike=S;function D(Q){let K=(0,t.IsNumber)(Q);return h.AllowNaN?K:K&&Number.isFinite(Q)}h.IsNumberLike=D;function H(Q){let K=(0,t.IsUndefined)(Q);return h.AllowNullVoid?K||Q===null:K}h.IsVoidLike=H})(f||(e.TypeSystemPolicy=f={}));function c(h,m){switch(m){case n.ValueErrorType.ArrayContains:return"Expected array to contain at least one matching value";case n.ValueErrorType.ArrayMaxContains:return`Expected array to contain no more than ${h.maxContains} matching values`;case n.ValueErrorType.ArrayMinContains:return`Expected array to contain at least ${h.minContains} matching values`;case n.ValueErrorType.ArrayMaxItems:return`Expected array length to be less or equal to ${h.maxItems}`;case n.ValueErrorType.ArrayMinItems:return`Expected array length to be greater or equal to ${h.minItems}`;case n.ValueErrorType.ArrayUniqueItems:return"Expected array elements to be unique";case n.ValueErrorType.Array:return"Expected array";case n.ValueErrorType.AsyncIterator:return"Expected AsyncIterator";case n.ValueErrorType.BigIntExclusiveMaximum:return`Expected bigint to be less than ${h.exclusiveMaximum}`;case n.ValueErrorType.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${h.exclusiveMinimum}`;case n.ValueErrorType.BigIntMaximum:return`Expected bigint to be less or equal to ${h.maximum}`;case n.ValueErrorType.BigIntMinimum:return`Expected bigint to be greater or equal to ${h.minimum}`;case n.ValueErrorType.BigIntMultipleOf:return`Expected bigint to be a multiple of ${h.multipleOf}`;case n.ValueErrorType.BigInt:return"Expected bigint";case n.ValueErrorType.Boolean:return"Expected boolean";case n.ValueErrorType.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${h.exclusiveMinimumTimestamp}`;case n.ValueErrorType.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${h.exclusiveMaximumTimestamp}`;case n.ValueErrorType.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${h.minimumTimestamp}`;case n.ValueErrorType.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${h.maximumTimestamp}`;case n.ValueErrorType.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${h.multipleOfTimestamp}`;case n.ValueErrorType.Date:return"Expected Date";case n.ValueErrorType.Function:return"Expected function";case n.ValueErrorType.IntegerExclusiveMaximum:return`Expected integer to be less than ${h.exclusiveMaximum}`;case n.ValueErrorType.IntegerExclusiveMinimum:return`Expected integer to be greater than ${h.exclusiveMinimum}`;case n.ValueErrorType.IntegerMaximum:return`Expected integer to be less or equal to ${h.maximum}`;case n.ValueErrorType.IntegerMinimum:return`Expected integer to be greater or equal to ${h.minimum}`;case n.ValueErrorType.IntegerMultipleOf:return`Expected integer to be a multiple of ${h.multipleOf}`;case n.ValueErrorType.Integer:return"Expected integer";case n.ValueErrorType.IntersectUnevaluatedProperties:return"Unexpected property";case n.ValueErrorType.Intersect:return"Expected all values to match";case n.ValueErrorType.Iterator:return"Expected Iterator";case n.ValueErrorType.Literal:return`Expected ${typeof h.const=="string"?`'${h.const}'`:h.const}`;case n.ValueErrorType.Never:return"Never";case n.ValueErrorType.Not:return"Value should not match";case n.ValueErrorType.Null:return"Expected null";case n.ValueErrorType.NumberExclusiveMaximum:return`Expected number to be less than ${h.exclusiveMaximum}`;case n.ValueErrorType.NumberExclusiveMinimum:return`Expected number to be greater than ${h.exclusiveMinimum}`;case n.ValueErrorType.NumberMaximum:return`Expected number to be less or equal to ${h.maximum}`;case n.ValueErrorType.NumberMinimum:return`Expected number to be greater or equal to ${h.minimum}`;case n.ValueErrorType.NumberMultipleOf:return`Expected number to be a multiple of ${h.multipleOf}`;case n.ValueErrorType.Number:return"Expected number";case n.ValueErrorType.Object:return"Expected object";case n.ValueErrorType.ObjectAdditionalProperties:return"Unexpected property";case n.ValueErrorType.ObjectMaxProperties:return`Expected object to have no more than ${h.maxProperties} properties`;case n.ValueErrorType.ObjectMinProperties:return`Expected object to have at least ${h.minProperties} properties`;case n.ValueErrorType.ObjectRequiredProperty:return"Required property";case n.ValueErrorType.Promise:return"Expected Promise";case n.ValueErrorType.StringFormatUnknown:return`Unknown format '${h.format}'`;case n.ValueErrorType.StringFormat:return`Expected string to match '${h.format}' format`;case n.ValueErrorType.StringMaxLength:return`Expected string length less or equal to ${h.maxLength}`;case n.ValueErrorType.StringMinLength:return`Expected string length greater or equal to ${h.minLength}`;case n.ValueErrorType.StringPattern:return`Expected string to match '${h.pattern}'`;case n.ValueErrorType.String:return"Expected string";case n.ValueErrorType.Symbol:return"Expected symbol";case n.ValueErrorType.TupleLength:return`Expected tuple to have ${h.maxItems||0} elements`;case n.ValueErrorType.Tuple:return"Expected tuple";case n.ValueErrorType.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${h.maxByteLength}`;case n.ValueErrorType.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${h.minByteLength}`;case n.ValueErrorType.Uint8Array:return"Expected Uint8Array";case n.ValueErrorType.Undefined:return"Expected undefined";case n.ValueErrorType.Union:return"Expected union value";case n.ValueErrorType.Void:return"Expected void";case n.ValueErrorType.Kind:return`Expected kind '${h[r.Kind]}'`;default:return"Unknown error type"}}e.DefaultErrorFunction=c}}),Ci=ke({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/deref.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Deref=e.TypeDereferenceError=void 0;var t=Kt(),n=class extends t.TypeBoxError{constructor(i){super(`Unable to dereference schema with $id '${i.$id}'`),this.schema=i}};e.TypeDereferenceError=n;function r(i,s){let o=s.findIndex(u=>u.$id===i.$ref);if(o===-1)throw new n(i);return s[o]}e.Deref=r}}),Jo=ke({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/hash.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Hash=e.ByteMarker=e.ValueHashError=void 0;var t=Wn(),n=class extends Error{constructor(x){super("Unable to hash value"),this.value=x}};e.ValueHashError=n;var r;(function(x){x[x.Undefined=0]="Undefined",x[x.Null=1]="Null",x[x.Boolean=2]="Boolean",x[x.Number=3]="Number",x[x.String=4]="String",x[x.Object=5]="Object",x[x.Array=6]="Array",x[x.Date=7]="Date",x[x.Uint8Array=8]="Uint8Array",x[x.Symbol=9]="Symbol",x[x.BigInt=10]="BigInt"})(r||(e.ByteMarker=r={}));var i=BigInt("14695981039346656037"),[s,o]=[BigInt("1099511628211"),BigInt("2")**BigInt("64")],u=Array.from({length:256}).map((x,L)=>BigInt(L)),f=new Float64Array(1),c=new DataView(f.buffer),h=new Uint8Array(f.buffer);function*m(x){let L=x===0?1:Math.ceil(Math.floor(Math.log2(x)+1)/8);for(let Y=0;Y<L;Y++)yield x>>8*(L-1-Y)&255}function M(x){fe(r.Array);for(let L of x)z(L)}function S(x){fe(r.Boolean),fe(x?1:0)}function D(x){fe(r.BigInt),c.setBigInt64(0,x);for(let L of h)fe(L)}function H(x){fe(r.Date),z(x.getTime())}function Q(x){fe(r.Null)}function K(x){fe(r.Number),c.setFloat64(0,x);for(let L of h)fe(L)}function B(x){fe(r.Object);for(let L of globalThis.Object.keys(x).sort())z(L),z(x[L])}function V(x){fe(r.String);for(let L=0;L<x.length;L++)for(let Y of m(x.charCodeAt(L)))fe(Y)}function W(x){fe(r.Symbol),z(x.description)}function F(x){fe(r.Uint8Array);for(let L=0;L<x.length;L++)fe(x[L])}function ee(x){return fe(r.Undefined)}function z(x){if((0,t.IsArray)(x))return M(x);if((0,t.IsBoolean)(x))return S(x);if((0,t.IsBigInt)(x))return D(x);if((0,t.IsDate)(x))return H(x);if((0,t.IsNull)(x))return Q(x);if((0,t.IsNumber)(x))return K(x);if((0,t.IsPlainObject)(x))return B(x);if((0,t.IsString)(x))return V(x);if((0,t.IsSymbol)(x))return W(x);if((0,t.IsUint8Array)(x))return F(x);if((0,t.IsUndefined)(x))return ee(x);throw new n(x)}function fe(x){i=i^u[x],i=i*s%o}function N(x){return i=BigInt("14695981039346656037"),z(x),i}e.Hash=N}}),xi=ke({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/errors/errors.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Errors=e.ValueErrorIterator=e.EscapeKey=e.ValueErrorsUnknownTypeError=e.ValueErrorType=void 0;var t=Wn(),n=Yu(),r=Ci(),i=Jo(),s=Kt(),o;(function(a){a[a.ArrayContains=0]="ArrayContains",a[a.ArrayMaxContains=1]="ArrayMaxContains",a[a.ArrayMaxItems=2]="ArrayMaxItems",a[a.ArrayMinContains=3]="ArrayMinContains",a[a.ArrayMinItems=4]="ArrayMinItems",a[a.ArrayUniqueItems=5]="ArrayUniqueItems",a[a.Array=6]="Array",a[a.AsyncIterator=7]="AsyncIterator",a[a.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",a[a.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",a[a.BigIntMaximum=10]="BigIntMaximum",a[a.BigIntMinimum=11]="BigIntMinimum",a[a.BigIntMultipleOf=12]="BigIntMultipleOf",a[a.BigInt=13]="BigInt",a[a.Boolean=14]="Boolean",a[a.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",a[a.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",a[a.DateMaximumTimestamp=17]="DateMaximumTimestamp",a[a.DateMinimumTimestamp=18]="DateMinimumTimestamp",a[a.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",a[a.Date=20]="Date",a[a.Function=21]="Function",a[a.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",a[a.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",a[a.IntegerMaximum=24]="IntegerMaximum",a[a.IntegerMinimum=25]="IntegerMinimum",a[a.IntegerMultipleOf=26]="IntegerMultipleOf",a[a.Integer=27]="Integer",a[a.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",a[a.Intersect=29]="Intersect",a[a.Iterator=30]="Iterator",a[a.Kind=31]="Kind",a[a.Literal=32]="Literal",a[a.Never=33]="Never",a[a.Not=34]="Not",a[a.Null=35]="Null",a[a.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",a[a.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",a[a.NumberMaximum=38]="NumberMaximum",a[a.NumberMinimum=39]="NumberMinimum",a[a.NumberMultipleOf=40]="NumberMultipleOf",a[a.Number=41]="Number",a[a.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",a[a.ObjectMaxProperties=43]="ObjectMaxProperties",a[a.ObjectMinProperties=44]="ObjectMinProperties",a[a.ObjectRequiredProperty=45]="ObjectRequiredProperty",a[a.Object=46]="Object",a[a.Promise=47]="Promise",a[a.StringFormatUnknown=48]="StringFormatUnknown",a[a.StringFormat=49]="StringFormat",a[a.StringMaxLength=50]="StringMaxLength",a[a.StringMinLength=51]="StringMinLength",a[a.StringPattern=52]="StringPattern",a[a.String=53]="String",a[a.Symbol=54]="Symbol",a[a.TupleLength=55]="TupleLength",a[a.Tuple=56]="Tuple",a[a.Uint8ArrayMaxByteLength=57]="Uint8ArrayMaxByteLength",a[a.Uint8ArrayMinByteLength=58]="Uint8ArrayMinByteLength",a[a.Uint8Array=59]="Uint8Array",a[a.Undefined=60]="Undefined",a[a.Union=61]="Union",a[a.Void=62]="Void"})(o||(e.ValueErrorType=o={}));var u=class extends s.TypeBoxError{constructor(a){super("Unknown type"),this.schema=a}};e.ValueErrorsUnknownTypeError=u;function f(a){return a.replace(/~/g,"~0").replace(/\//g,"~1")}e.EscapeKey=f;function c(a){return a!==void 0}var h=class{constructor(a){this.iterator=a}[Symbol.iterator](){return this.iterator}First(){let a=this.iterator.next();return a.done?void 0:a.value}};e.ValueErrorIterator=h;function m(a,O,v,b){return{type:a,schema:O,path:v,value:b,message:n.TypeSystemErrorFunction.Get()(O,a)}}function*M(a,O,v,b){}function*S(a,O,v,b){if(!(0,t.IsArray)(b))return yield m(o.Array,a,v,b);c(a.minItems)&&!(b.length>=a.minItems)&&(yield m(o.ArrayMinItems,a,v,b)),c(a.maxItems)&&!(b.length<=a.maxItems)&&(yield m(o.ArrayMaxItems,a,v,b));for(let Z=0;Z<b.length;Z++)yield*w(a.items,O,`${v}/${Z}`,b[Z]);if(a.uniqueItems===!0&&!(function(){let Z=new Set;for(let te of b){let pe=(0,i.Hash)(te);if(Z.has(pe))return!1;Z.add(pe)}return!0})()&&(yield m(o.ArrayUniqueItems,a,v,b)),!(c(a.contains)||c(a.minContains)||c(a.maxContains)))return;let P=c(a.contains)?a.contains:s.Type.Never(),k=b.reduce((Z,te,pe)=>w(P,O,`${v}${pe}`,te).next().done===!0?Z+1:Z,0);k===0&&(yield m(o.ArrayContains,a,v,b)),(0,t.IsNumber)(a.minContains)&&k<a.minContains&&(yield m(o.ArrayMinContains,a,v,b)),(0,t.IsNumber)(a.maxContains)&&k>a.maxContains&&(yield m(o.ArrayMaxContains,a,v,b))}function*D(a,O,v,b){(0,t.IsAsyncIterator)(b)||(yield m(o.AsyncIterator,a,v,b))}function*H(a,O,v,b){if(!(0,t.IsBigInt)(b))return yield m(o.BigInt,a,v,b);c(a.exclusiveMaximum)&&!(b<a.exclusiveMaximum)&&(yield m(o.BigIntExclusiveMaximum,a,v,b)),c(a.exclusiveMinimum)&&!(b>a.exclusiveMinimum)&&(yield m(o.BigIntExclusiveMinimum,a,v,b)),c(a.maximum)&&!(b<=a.maximum)&&(yield m(o.BigIntMaximum,a,v,b)),c(a.minimum)&&!(b>=a.minimum)&&(yield m(o.BigIntMinimum,a,v,b)),c(a.multipleOf)&&b%a.multipleOf!==BigInt(0)&&(yield m(o.BigIntMultipleOf,a,v,b))}function*Q(a,O,v,b){(0,t.IsBoolean)(b)||(yield m(o.Boolean,a,v,b))}function*K(a,O,v,b){yield*w(a.returns,O,v,b.prototype)}function*B(a,O,v,b){if(!(0,t.IsDate)(b))return yield m(o.Date,a,v,b);c(a.exclusiveMaximumTimestamp)&&!(b.getTime()<a.exclusiveMaximumTimestamp)&&(yield m(o.DateExclusiveMaximumTimestamp,a,v,b)),c(a.exclusiveMinimumTimestamp)&&!(b.getTime()>a.exclusiveMinimumTimestamp)&&(yield m(o.DateExclusiveMinimumTimestamp,a,v,b)),c(a.maximumTimestamp)&&!(b.getTime()<=a.maximumTimestamp)&&(yield m(o.DateMaximumTimestamp,a,v,b)),c(a.minimumTimestamp)&&!(b.getTime()>=a.minimumTimestamp)&&(yield m(o.DateMinimumTimestamp,a,v,b)),c(a.multipleOfTimestamp)&&b.getTime()%a.multipleOfTimestamp!==0&&(yield m(o.DateMultipleOfTimestamp,a,v,b))}function*V(a,O,v,b){(0,t.IsFunction)(b)||(yield m(o.Function,a,v,b))}function*W(a,O,v,b){if(!(0,t.IsInteger)(b))return yield m(o.Integer,a,v,b);c(a.exclusiveMaximum)&&!(b<a.exclusiveMaximum)&&(yield m(o.IntegerExclusiveMaximum,a,v,b)),c(a.exclusiveMinimum)&&!(b>a.exclusiveMinimum)&&(yield m(o.IntegerExclusiveMinimum,a,v,b)),c(a.maximum)&&!(b<=a.maximum)&&(yield m(o.IntegerMaximum,a,v,b)),c(a.minimum)&&!(b>=a.minimum)&&(yield m(o.IntegerMinimum,a,v,b)),c(a.multipleOf)&&b%a.multipleOf!==0&&(yield m(o.IntegerMultipleOf,a,v,b))}function*F(a,O,v,b){for(let P of a.allOf){let k=w(P,O,v,b).next();k.done||(yield m(o.Intersect,a,v,b),yield k.value)}if(a.unevaluatedProperties===!1){let P=new RegExp(s.KeyResolver.ResolvePattern(a));for(let k of Object.getOwnPropertyNames(b))P.test(k)||(yield m(o.IntersectUnevaluatedProperties,a,`${v}/${k}`,b))}if(typeof a.unevaluatedProperties=="object"){let P=new RegExp(s.KeyResolver.ResolvePattern(a));for(let k of Object.getOwnPropertyNames(b))if(!P.test(k)){let Z=w(a.unevaluatedProperties,O,`${v}/${k}`,b[k]).next();Z.done||(yield Z.value)}}}function*ee(a,O,v,b){(0,t.IsIterator)(b)||(yield m(o.Iterator,a,v,b))}function*z(a,O,v,b){b!==a.const&&(yield m(o.Literal,a,v,b))}function*fe(a,O,v,b){yield m(o.Never,a,v,b)}function*N(a,O,v,b){w(a.not,O,v,b).next().done===!0&&(yield m(o.Not,a,v,b))}function*x(a,O,v,b){(0,t.IsNull)(b)||(yield m(o.Null,a,v,b))}function*L(a,O,v,b){if(!n.TypeSystemPolicy.IsNumberLike(b))return yield m(o.Number,a,v,b);c(a.exclusiveMaximum)&&!(b<a.exclusiveMaximum)&&(yield m(o.NumberExclusiveMaximum,a,v,b)),c(a.exclusiveMinimum)&&!(b>a.exclusiveMinimum)&&(yield m(o.NumberExclusiveMinimum,a,v,b)),c(a.maximum)&&!(b<=a.maximum)&&(yield m(o.NumberMaximum,a,v,b)),c(a.minimum)&&!(b>=a.minimum)&&(yield m(o.NumberMinimum,a,v,b)),c(a.multipleOf)&&b%a.multipleOf!==0&&(yield m(o.NumberMultipleOf,a,v,b))}function*Y(a,O,v,b){if(!n.TypeSystemPolicy.IsObjectLike(b))return yield m(o.Object,a,v,b);c(a.minProperties)&&!(Object.getOwnPropertyNames(b).length>=a.minProperties)&&(yield m(o.ObjectMinProperties,a,v,b)),c(a.maxProperties)&&!(Object.getOwnPropertyNames(b).length<=a.maxProperties)&&(yield m(o.ObjectMaxProperties,a,v,b));let P=Array.isArray(a.required)?a.required:[],k=Object.getOwnPropertyNames(a.properties),Z=Object.getOwnPropertyNames(b);for(let te of P)Z.includes(te)||(yield m(o.ObjectRequiredProperty,a.properties[te],`${v}/${f(te)}`,void 0));if(a.additionalProperties===!1)for(let te of Z)k.includes(te)||(yield m(o.ObjectAdditionalProperties,a,`${v}/${f(te)}`,b[te]));if(typeof a.additionalProperties=="object")for(let te of Z)k.includes(te)||(yield*w(a.additionalProperties,O,`${v}/${f(te)}`,b[te]));for(let te of k){let pe=a.properties[te];a.required&&a.required.includes(te)?(yield*w(pe,O,`${v}/${f(te)}`,b[te]),s.ExtendsUndefined.Check(a)&&!(te in b)&&(yield m(o.ObjectRequiredProperty,pe,`${v}/${f(te)}`,void 0))):n.TypeSystemPolicy.IsExactOptionalProperty(b,te)&&(yield*w(pe,O,`${v}/${f(te)}`,b[te]))}}function*ie(a,O,v,b){(0,t.IsPromise)(b)||(yield m(o.Promise,a,v,b))}function*X(a,O,v,b){if(!n.TypeSystemPolicy.IsRecordLike(b))return yield m(o.Object,a,v,b);c(a.minProperties)&&!(Object.getOwnPropertyNames(b).length>=a.minProperties)&&(yield m(o.ObjectMinProperties,a,v,b)),c(a.maxProperties)&&!(Object.getOwnPropertyNames(b).length<=a.maxProperties)&&(yield m(o.ObjectMaxProperties,a,v,b));let[P,k]=Object.entries(a.patternProperties)[0],Z=new RegExp(P);for(let[te,pe]of Object.entries(b))Z.test(te)&&(yield*w(k,O,`${v}/${f(te)}`,pe));if(typeof a.additionalProperties=="object")for(let[te,pe]of Object.entries(b))Z.test(te)||(yield*w(a.additionalProperties,O,`${v}/${f(te)}`,pe));if(a.additionalProperties===!1){for(let[te,pe]of Object.entries(b))if(!Z.test(te))return yield m(o.ObjectAdditionalProperties,a,`${v}/${f(te)}`,pe)}}function*se(a,O,v,b){yield*w((0,r.Deref)(a,O),O,v,b)}function*j(a,O,v,b){if(!(0,t.IsString)(b))return yield m(o.String,a,v,b);c(a.minLength)&&!(b.length>=a.minLength)&&(yield m(o.StringMinLength,a,v,b)),c(a.maxLength)&&!(b.length<=a.maxLength)&&(yield m(o.StringMaxLength,a,v,b)),(0,t.IsString)(a.pattern)&&(new RegExp(a.pattern).test(b)||(yield m(o.StringPattern,a,v,b))),(0,t.IsString)(a.format)&&(s.FormatRegistry.Has(a.format)?s.FormatRegistry.Get(a.format)(b)||(yield m(o.StringFormat,a,v,b)):yield m(o.StringFormatUnknown,a,v,b))}function*G(a,O,v,b){(0,t.IsSymbol)(b)||(yield m(o.Symbol,a,v,b))}function*J(a,O,v,b){if(!(0,t.IsString)(b))return yield m(o.String,a,v,b);new RegExp(a.pattern).test(b)||(yield m(o.StringPattern,a,v,b))}function*le(a,O,v,b){yield*w((0,r.Deref)(a,O),O,v,b)}function*l(a,O,v,b){if(!(0,t.IsArray)(b))return yield m(o.Tuple,a,v,b);if(a.items===void 0&&b.length!==0)return yield m(o.TupleLength,a,v,b);if(b.length!==a.maxItems)return yield m(o.TupleLength,a,v,b);if(a.items)for(let P=0;P<a.items.length;P++)yield*w(a.items[P],O,`${v}/${P}`,b[P])}function*_(a,O,v,b){(0,t.IsUndefined)(b)||(yield m(o.Undefined,a,v,b))}function*I(a,O,v,b){let P=0;for(let k of a.anyOf){let Z=[...w(k,O,v,b)];if(Z.length===0)return;P+=Z.length}P>0&&(yield m(o.Union,a,v,b))}function*C(a,O,v,b){if(!(0,t.IsUint8Array)(b))return yield m(o.Uint8Array,a,v,b);c(a.maxByteLength)&&!(b.length<=a.maxByteLength)&&(yield m(o.Uint8ArrayMaxByteLength,a,v,b)),c(a.minByteLength)&&!(b.length>=a.minByteLength)&&(yield m(o.Uint8ArrayMinByteLength,a,v,b))}function*R(a,O,v,b){}function*E(a,O,v,b){n.TypeSystemPolicy.IsVoidLike(b)||(yield m(o.Void,a,v,b))}function*y(a,O,v,b){s.TypeRegistry.Get(a[s.Kind])(a,b)||(yield m(o.Kind,a,v,b))}function*w(a,O,v,b){let P=c(a.$id)?[...O,a]:O,k=a;switch(k[s.Kind]){case"Any":return yield*M(k,P,v,b);case"Array":return yield*S(k,P,v,b);case"AsyncIterator":return yield*D(k,P,v,b);case"BigInt":return yield*H(k,P,v,b);case"Boolean":return yield*Q(k,P,v,b);case"Constructor":return yield*K(k,P,v,b);case"Date":return yield*B(k,P,v,b);case"Function":return yield*V(k,P,v,b);case"Integer":return yield*W(k,P,v,b);case"Intersect":return yield*F(k,P,v,b);case"Iterator":return yield*ee(k,P,v,b);case"Literal":return yield*z(k,P,v,b);case"Never":return yield*fe(k,P,v,b);case"Not":return yield*N(k,P,v,b);case"Null":return yield*x(k,P,v,b);case"Number":return yield*L(k,P,v,b);case"Object":return yield*Y(k,P,v,b);case"Promise":return yield*ie(k,P,v,b);case"Record":return yield*X(k,P,v,b);case"Ref":return yield*se(k,P,v,b);case"String":return yield*j(k,P,v,b);case"Symbol":return yield*G(k,P,v,b);case"TemplateLiteral":return yield*J(k,P,v,b);case"This":return yield*le(k,P,v,b);case"Tuple":return yield*l(k,P,v,b);case"Undefined":return yield*_(k,P,v,b);case"Union":return yield*I(k,P,v,b);case"Uint8Array":return yield*C(k,P,v,b);case"Unknown":return yield*R(k,P,v,b);case"Void":return yield*E(k,P,v,b);default:if(!s.TypeRegistry.Has(k[s.Kind]))throw new u(a);return yield*y(k,P,v,b)}}function T(...a){let O=a.length===3?w(a[0],a[1],"",a[2]):w(a[0],[],"",a[1]);return new h(O)}e.Errors=T}}),Yd=ke({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/errors/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?(function(r,i,s,o){o===void 0&&(o=s);var u=Object.getOwnPropertyDescriptor(i,s);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(r,o,u)}):(function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]})),n=e&&e.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,r,s)};Object.defineProperty(e,"__esModule",{value:!0}),n(xi(),e)}}),Zu=ke({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/system/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?(function(i,s,o,u){u===void 0&&(u=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(i,u,f)}):(function(i,s,o,u){u===void 0&&(u=o),i[u]=s[o]})),n=e&&e.__exportStar||function(i,s){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&t(s,i,o)};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueErrorType=void 0;var r=xi();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return r.ValueErrorType}}),n(Yu(),e)}}),Zd=ke({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/check.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Check=e.ValueCheckUnknownTypeError=void 0;var t=Wn(),n=Zu(),r=Ci(),i=Jo(),s=Kt(),o=class extends s.TypeBoxError{constructor(y){super("Unknown type"),this.schema=y}};e.ValueCheckUnknownTypeError=o;function u(y){return y[s.Kind]==="Any"||y[s.Kind]==="Unknown"}function f(y){return y!==void 0}function c(y,w,T){return!0}function h(y,w,T){if(!(0,t.IsArray)(T)||f(y.minItems)&&!(T.length>=y.minItems)||f(y.maxItems)&&!(T.length<=y.maxItems)||!T.every(v=>R(y.items,w,v))||y.uniqueItems===!0&&!(function(){let v=new Set;for(let b of T){let P=(0,i.Hash)(b);if(v.has(P))return!1;v.add(P)}return!0})())return!1;if(!(f(y.contains)||(0,t.IsNumber)(y.minContains)||(0,t.IsNumber)(y.maxContains)))return!0;let a=f(y.contains)?y.contains:s.Type.Never(),O=T.reduce((v,b)=>R(a,w,b)?v+1:v,0);return!(O===0||(0,t.IsNumber)(y.minContains)&&O<y.minContains||(0,t.IsNumber)(y.maxContains)&&O>y.maxContains)}function m(y,w,T){return(0,t.IsAsyncIterator)(T)}function M(y,w,T){return!(!(0,t.IsBigInt)(T)||f(y.exclusiveMaximum)&&!(T<y.exclusiveMaximum)||f(y.exclusiveMinimum)&&!(T>y.exclusiveMinimum)||f(y.maximum)&&!(T<=y.maximum)||f(y.minimum)&&!(T>=y.minimum)||f(y.multipleOf)&&T%y.multipleOf!==BigInt(0))}function S(y,w,T){return(0,t.IsBoolean)(T)}function D(y,w,T){return R(y.returns,w,T.prototype)}function H(y,w,T){return!(!(0,t.IsDate)(T)||f(y.exclusiveMaximumTimestamp)&&!(T.getTime()<y.exclusiveMaximumTimestamp)||f(y.exclusiveMinimumTimestamp)&&!(T.getTime()>y.exclusiveMinimumTimestamp)||f(y.maximumTimestamp)&&!(T.getTime()<=y.maximumTimestamp)||f(y.minimumTimestamp)&&!(T.getTime()>=y.minimumTimestamp)||f(y.multipleOfTimestamp)&&T.getTime()%y.multipleOfTimestamp!==0)}function Q(y,w,T){return(0,t.IsFunction)(T)}function K(y,w,T){return!(!(0,t.IsInteger)(T)||f(y.exclusiveMaximum)&&!(T<y.exclusiveMaximum)||f(y.exclusiveMinimum)&&!(T>y.exclusiveMinimum)||f(y.maximum)&&!(T<=y.maximum)||f(y.minimum)&&!(T>=y.minimum)||f(y.multipleOf)&&T%y.multipleOf!==0)}function B(y,w,T){let a=y.allOf.every(O=>R(O,w,T));if(y.unevaluatedProperties===!1){let O=new RegExp(s.KeyResolver.ResolvePattern(y)),v=Object.getOwnPropertyNames(T).every(b=>O.test(b));return a&&v}else if(s.TypeGuard.TSchema(y.unevaluatedProperties)){let O=new RegExp(s.KeyResolver.ResolvePattern(y)),v=Object.getOwnPropertyNames(T).every(b=>O.test(b)||R(y.unevaluatedProperties,w,T[b]));return a&&v}else return a}function V(y,w,T){return(0,t.IsIterator)(T)}function W(y,w,T){return T===y.const}function F(y,w,T){return!1}function ee(y,w,T){return!R(y.not,w,T)}function z(y,w,T){return(0,t.IsNull)(T)}function fe(y,w,T){return!(!n.TypeSystemPolicy.IsNumberLike(T)||f(y.exclusiveMaximum)&&!(T<y.exclusiveMaximum)||f(y.exclusiveMinimum)&&!(T>y.exclusiveMinimum)||f(y.minimum)&&!(T>=y.minimum)||f(y.maximum)&&!(T<=y.maximum)||f(y.multipleOf)&&T%y.multipleOf!==0)}function N(y,w,T){if(!n.TypeSystemPolicy.IsObjectLike(T)||f(y.minProperties)&&!(Object.getOwnPropertyNames(T).length>=y.minProperties)||f(y.maxProperties)&&!(Object.getOwnPropertyNames(T).length<=y.maxProperties))return!1;let a=Object.getOwnPropertyNames(y.properties);for(let O of a){let v=y.properties[O];if(y.required&&y.required.includes(O)){if(!R(v,w,T[O])||(s.ExtendsUndefined.Check(v)||u(v))&&!(O in T))return!1}else if(n.TypeSystemPolicy.IsExactOptionalProperty(T,O)&&!R(v,w,T[O]))return!1}if(y.additionalProperties===!1){let O=Object.getOwnPropertyNames(T);return y.required&&y.required.length===a.length&&O.length===a.length?!0:O.every(v=>a.includes(v))}else return typeof y.additionalProperties=="object"?Object.getOwnPropertyNames(T).every(v=>a.includes(v)||R(y.additionalProperties,w,T[v])):!0}function x(y,w,T){return(0,t.IsPromise)(T)}function L(y,w,T){if(!n.TypeSystemPolicy.IsRecordLike(T)||f(y.minProperties)&&!(Object.getOwnPropertyNames(T).length>=y.minProperties)||f(y.maxProperties)&&!(Object.getOwnPropertyNames(T).length<=y.maxProperties))return!1;let[a,O]=Object.entries(y.patternProperties)[0],v=new RegExp(a),b=Object.entries(T).every(([Z,te])=>v.test(Z)?R(O,w,te):!0),P=typeof y.additionalProperties=="object"?Object.entries(T).every(([Z,te])=>v.test(Z)?!0:R(y.additionalProperties,w,te)):!0,k=y.additionalProperties===!1?Object.getOwnPropertyNames(T).every(Z=>v.test(Z)):!0;return b&&P&&k}function Y(y,w,T){return R((0,r.Deref)(y,w),w,T)}function ie(y,w,T){return!(0,t.IsString)(T)||f(y.minLength)&&!(T.length>=y.minLength)||f(y.maxLength)&&!(T.length<=y.maxLength)||f(y.pattern)&&!new RegExp(y.pattern).test(T)?!1:f(y.format)?s.FormatRegistry.Has(y.format)?s.FormatRegistry.Get(y.format)(T):!1:!0}function X(y,w,T){return(0,t.IsSymbol)(T)}function se(y,w,T){return(0,t.IsString)(T)&&new RegExp(y.pattern).test(T)}function j(y,w,T){return R((0,r.Deref)(y,w),w,T)}function G(y,w,T){if(!(0,t.IsArray)(T)||y.items===void 0&&T.length!==0||T.length!==y.maxItems)return!1;if(!y.items)return!0;for(let a=0;a<y.items.length;a++)if(!R(y.items[a],w,T[a]))return!1;return!0}function J(y,w,T){return(0,t.IsUndefined)(T)}function le(y,w,T){return y.anyOf.some(a=>R(a,w,T))}function l(y,w,T){return!(!(0,t.IsUint8Array)(T)||f(y.maxByteLength)&&!(T.length<=y.maxByteLength)||f(y.minByteLength)&&!(T.length>=y.minByteLength))}function _(y,w,T){return!0}function I(y,w,T){return n.TypeSystemPolicy.IsVoidLike(T)}function C(y,w,T){return s.TypeRegistry.Has(y[s.Kind])?s.TypeRegistry.Get(y[s.Kind])(y,T):!1}function R(y,w,T){let a=f(y.$id)?[...w,y]:w,O=y;switch(O[s.Kind]){case"Any":return c(O,a,T);case"Array":return h(O,a,T);case"AsyncIterator":return m(O,a,T);case"BigInt":return M(O,a,T);case"Boolean":return S(O,a,T);case"Constructor":return D(O,a,T);case"Date":return H(O,a,T);case"Function":return Q(O,a,T);case"Integer":return K(O,a,T);case"Intersect":return B(O,a,T);case"Iterator":return V(O,a,T);case"Literal":return W(O,a,T);case"Never":return F(O,a,T);case"Not":return ee(O,a,T);case"Null":return z(O,a,T);case"Number":return fe(O,a,T);case"Object":return N(O,a,T);case"Promise":return x(O,a,T);case"Record":return L(O,a,T);case"Ref":return Y(O,a,T);case"String":return ie(O,a,T);case"Symbol":return X(O,a,T);case"TemplateLiteral":return se(O,a,T);case"This":return j(O,a,T);case"Tuple":return G(O,a,T);case"Undefined":return J(O,a,T);case"Union":return le(O,a,T);case"Uint8Array":return l(O,a,T);case"Unknown":return _(O,a,T);case"Void":return I(O,a,T);default:if(!s.TypeRegistry.Has(O[s.Kind]))throw new o(O);return C(O,a,T)}}function E(...y){return y.length===3?R(y[0],y[1],y[2]):R(y[0],[],y[1])}e.Check=E}}),Qd=ke({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/transform.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EncodeTransform=e.DecodeTransform=e.HasTransform=e.TransformEncodeError=e.TransformDecodeError=e.TransformEncodeCheckError=e.TransformDecodeCheckError=void 0;var t=Wn(),n=Ci(),r=Zd(),i=Kt(),s=class extends i.TypeBoxError{constructor(M,S,D){super("Unable to decode due to invalid value"),this.schema=M,this.value=S,this.error=D}};e.TransformDecodeCheckError=s;var o=class extends i.TypeBoxError{constructor(M,S,D){super("Unable to encode due to invalid value"),this.schema=M,this.value=S,this.error=D}};e.TransformEncodeCheckError=o;var u=class extends i.TypeBoxError{constructor(M,S,D){super(`${D instanceof Error?D.message:"Unknown error"}`),this.schema=M,this.value=S}};e.TransformDecodeError=u;var f=class extends i.TypeBoxError{constructor(M,S,D){super(`${D instanceof Error?D.message:"Unknown error"}`),this.schema=M,this.value=S}};e.TransformEncodeError=f;var c;(function(M){function S(X,se){return i.TypeGuard.TTransform(X)||L(X.items,se)}function D(X,se){return i.TypeGuard.TTransform(X)||L(X.items,se)}function H(X,se){return i.TypeGuard.TTransform(X)||L(X.returns,se)||X.parameters.some(j=>L(j,se))}function Q(X,se){return i.TypeGuard.TTransform(X)||L(X.returns,se)||X.parameters.some(j=>L(j,se))}function K(X,se){return i.TypeGuard.TTransform(X)||i.TypeGuard.TTransform(X.unevaluatedProperties)||X.allOf.some(j=>L(j,se))}function B(X,se){return i.TypeGuard.TTransform(X)||L(X.items,se)}function V(X,se){return i.TypeGuard.TTransform(X)||L(X.not,se)}function W(X,se){return i.TypeGuard.TTransform(X)||Object.values(X.properties).some(j=>L(j,se))||i.TypeGuard.TSchema(X.additionalProperties)&&L(X.additionalProperties,se)}function F(X,se){return i.TypeGuard.TTransform(X)||L(X.item,se)}function ee(X,se){let j=Object.getOwnPropertyNames(X.patternProperties)[0],G=X.patternProperties[j];return i.TypeGuard.TTransform(X)||L(G,se)||i.TypeGuard.TSchema(X.additionalProperties)&&i.TypeGuard.TTransform(X.additionalProperties)}function z(X,se){return i.TypeGuard.TTransform(X)?!0:L((0,n.Deref)(X,se),se)}function fe(X,se){return i.TypeGuard.TTransform(X)?!0:L((0,n.Deref)(X,se),se)}function N(X,se){return i.TypeGuard.TTransform(X)||!(0,t.IsUndefined)(X.items)&&X.items.some(j=>L(j,se))}function x(X,se){return i.TypeGuard.TTransform(X)||X.anyOf.some(j=>L(j,se))}function L(X,se){let j=(0,t.IsString)(X.$id)?[...se,X]:se,G=X;if(X.$id&&Y.has(X.$id))return!1;switch(X.$id&&Y.add(X.$id),X[i.Kind]){case"Array":return S(G,j);case"AsyncIterator":return D(G,j);case"Constructor":return H(G,j);case"Function":return Q(G,j);case"Intersect":return K(G,j);case"Iterator":return B(G,j);case"Not":return V(G,j);case"Object":return W(G,j);case"Promise":return F(G,j);case"Record":return ee(G,j);case"Ref":return z(G,j);case"This":return fe(G,j);case"Tuple":return N(G,j);case"Union":return x(G,j);default:return i.TypeGuard.TTransform(X)}}let Y=new Set;function ie(X,se){return Y.clear(),L(X,se)}M.Has=ie})(c||(e.HasTransform=c={}));var h;(function(M){function S(N,x){try{return i.TypeGuard.TTransform(N)?N[i.Transform].Decode(x):x}catch(L){throw new u(N,x,L)}}function D(N,x,L){return(0,t.IsArray)(L)?S(N,L.map(Y=>z(N.items,x,Y))):S(N,L)}function H(N,x,L){if(!(0,t.IsPlainObject)(L)||(0,t.IsValueType)(L))return S(N,L);let Y=i.KeyResolver.ResolveKeys(N,{includePatterns:!1}),ie=Y.reduce((G,J)=>J in G?{...G,[J]:z(i.IndexedAccessor.Resolve(N,[J]),x,G[J])}:G,L);if(!i.TypeGuard.TTransform(N.unevaluatedProperties))return S(N,ie);let X=Object.getOwnPropertyNames(ie),se=N.unevaluatedProperties,j=X.reduce((G,J)=>Y.includes(J)?G:{...G,[J]:S(se,G[J])},ie);return S(N,j)}function Q(N,x,L){return S(N,z(N.not,x,L))}function K(N,x,L){if(!(0,t.IsPlainObject)(L))return S(N,L);let Y=i.KeyResolver.ResolveKeys(N,{includePatterns:!1}),ie=Y.reduce((G,J)=>J in G?{...G,[J]:z(N.properties[J],x,G[J])}:G,L);if(!i.TypeGuard.TSchema(N.additionalProperties))return S(N,ie);let X=Object.getOwnPropertyNames(ie),se=N.additionalProperties,j=X.reduce((G,J)=>Y.includes(J)?G:{...G,[J]:S(se,G[J])},ie);return S(N,j)}function B(N,x,L){if(!(0,t.IsPlainObject)(L))return S(N,L);let Y=Object.getOwnPropertyNames(N.patternProperties)[0],ie=new RegExp(Y),X=Object.getOwnPropertyNames(L).reduce((J,le)=>ie.test(le)?{...J,[le]:z(N.patternProperties[Y],x,J[le])}:J,L);if(!i.TypeGuard.TSchema(N.additionalProperties))return S(N,X);let se=Object.getOwnPropertyNames(X),j=N.additionalProperties,G=se.reduce((J,le)=>ie.test(le)?J:{...J,[le]:S(j,J[le])},X);return S(N,G)}function V(N,x,L){let Y=(0,n.Deref)(N,x);return S(N,z(Y,x,L))}function W(N,x,L){let Y=(0,n.Deref)(N,x);return S(N,z(Y,x,L))}function F(N,x,L){return(0,t.IsArray)(L)&&(0,t.IsArray)(N.items)?S(N,N.items.map((Y,ie)=>z(Y,x,L[ie]))):S(N,L)}function ee(N,x,L){let Y=S(N,L);for(let ie of N.anyOf)if((0,r.Check)(ie,x,Y))return z(ie,x,Y);return Y}function z(N,x,L){let Y=typeof N.$id=="string"?[...x,N]:x,ie=N;switch(N[i.Kind]){case"Array":return D(ie,Y,L);case"Intersect":return H(ie,Y,L);case"Not":return Q(ie,Y,L);case"Object":return K(ie,Y,L);case"Record":return B(ie,Y,L);case"Ref":return V(ie,Y,L);case"Symbol":return S(ie,L);case"This":return W(ie,Y,L);case"Tuple":return F(ie,Y,L);case"Union":return ee(ie,Y,L);default:return S(ie,L)}}function fe(N,x,L){return z(N,x,L)}M.Decode=fe})(h||(e.DecodeTransform=h={}));var m;(function(M){function S(N,x){try{return i.TypeGuard.TTransform(N)?N[i.Transform].Encode(x):x}catch(L){throw new f(N,x,L)}}function D(N,x,L){let Y=S(N,L);return(0,t.IsArray)(Y)?Y.map(ie=>z(N.items,x,ie)):Y}function H(N,x,L){let Y=S(N,L);if(!(0,t.IsPlainObject)(L)||(0,t.IsValueType)(L))return Y;let ie=i.KeyResolver.ResolveKeys(N,{includePatterns:!1}),X=ie.reduce((G,J)=>J in Y?{...G,[J]:z(i.IndexedAccessor.Resolve(N,[J]),x,G[J])}:G,Y);if(!i.TypeGuard.TTransform(N.unevaluatedProperties))return S(N,X);let se=Object.getOwnPropertyNames(X),j=N.unevaluatedProperties;return se.reduce((G,J)=>ie.includes(J)?G:{...G,[J]:S(j,G[J])},X)}function Q(N,x,L){return S(N.not,S(N,L))}function K(N,x,L){let Y=S(N,L);if(!(0,t.IsPlainObject)(L))return Y;let ie=i.KeyResolver.ResolveKeys(N,{includePatterns:!1}),X=ie.reduce((G,J)=>J in G?{...G,[J]:z(N.properties[J],x,G[J])}:G,Y);if(!i.TypeGuard.TSchema(N.additionalProperties))return X;let se=Object.getOwnPropertyNames(X),j=N.additionalProperties;return se.reduce((G,J)=>ie.includes(J)?G:{...G,[J]:S(j,G[J])},X)}function B(N,x,L){let Y=S(N,L);if(!(0,t.IsPlainObject)(L))return Y;let ie=Object.getOwnPropertyNames(N.patternProperties)[0],X=new RegExp(ie),se=Object.getOwnPropertyNames(L).reduce((J,le)=>X.test(le)?{...J,[le]:z(N.patternProperties[ie],x,J[le])}:J,Y);if(!i.TypeGuard.TSchema(N.additionalProperties))return S(N,se);let j=Object.getOwnPropertyNames(se),G=N.additionalProperties;return j.reduce((J,le)=>X.test(le)?J:{...J,[le]:S(G,J[le])},se)}function V(N,x,L){let Y=(0,n.Deref)(N,x),ie=z(Y,x,L);return S(N,ie)}function W(N,x,L){let Y=(0,n.Deref)(N,x),ie=z(Y,x,L);return S(N,ie)}function F(N,x,L){let Y=S(N,L);return(0,t.IsArray)(N.items)?N.items.map((ie,X)=>z(ie,x,Y[X])):[]}function ee(N,x,L){for(let Y of N.anyOf){if(!(0,r.Check)(Y,x,L))continue;let ie=z(Y,x,L);return S(N,ie)}for(let Y of N.anyOf){let ie=z(Y,x,L);if((0,r.Check)(N,x,ie))return S(N,ie)}return S(N,L)}function z(N,x,L){let Y=typeof N.$id=="string"?[...x,N]:x,ie=N;switch(N[i.Kind]){case"Array":return D(ie,Y,L);case"Intersect":return H(ie,Y,L);case"Not":return Q(ie,Y,L);case"Object":return K(ie,Y,L);case"Record":return B(ie,Y,L);case"Ref":return V(ie,Y,L);case"This":return W(ie,Y,L);case"Tuple":return F(ie,Y,L);case"Union":return ee(ie,Y,L);default:return S(ie,L)}}function fe(N,x,L){return z(N,x,L)}M.Encode=fe})(m||(e.EncodeTransform=m={}))}}),ep=ke({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/compiler/compiler.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeCompiler=e.Policy=e.TypeCompilerTypeGuardError=e.TypeCompilerUnknownTypeError=e.TypeCheck=void 0;var t=Qd(),n=Wn(),r=xi(),i=Zu(),s=Ci(),o=Jo(),u=Kt(),f=class{constructor(K,B,V,W){this.schema=K,this.references=B,this.checkFunc=V,this.code=W,this.hasTransform=t.HasTransform.Has(K,B)}Code(){return this.code}Errors(K){return(0,r.Errors)(this.schema,this.references,K)}Check(K){return this.checkFunc(K)}Decode(K){if(!this.checkFunc(K))throw new t.TransformDecodeCheckError(this.schema,K,this.Errors(K).First());return this.hasTransform?t.DecodeTransform.Decode(this.schema,this.references,K):K}Encode(K){let B=this.hasTransform?t.EncodeTransform.Encode(this.schema,this.references,K):K;if(!this.checkFunc(B))throw new t.TransformEncodeCheckError(this.schema,K,this.Errors(K).First());return B}};e.TypeCheck=f;var c;(function(K){function B(ee){return ee===36}K.DollarSign=B;function V(ee){return ee===95}K.IsUnderscore=V;function W(ee){return ee>=65&&ee<=90||ee>=97&&ee<=122}K.IsAlpha=W;function F(ee){return ee>=48&&ee<=57}K.IsNumeric=F})(c||(c={}));var h;(function(K){function B(ee){return ee.length===0?!1:c.IsNumeric(ee.charCodeAt(0))}function V(ee){if(B(ee))return!1;for(let z=0;z<ee.length;z++){let fe=ee.charCodeAt(z);if(!(c.IsAlpha(fe)||c.IsNumeric(fe)||c.DollarSign(fe)||c.IsUnderscore(fe)))return!1}return!0}function W(ee){return ee.replace(/'/g,"\\'")}function F(ee,z){return V(z)?`${ee}.${z}`:`${ee}['${W(z)}']`}K.Encode=F})(h||(h={}));var m;(function(K){function B(V){let W=[];for(let F=0;F<V.length;F++){let ee=V.charCodeAt(F);c.IsNumeric(ee)||c.IsAlpha(ee)?W.push(V.charAt(F)):W.push(`_${ee}_`)}return W.join("").replace(/__/g,"_")}K.Encode=B})(m||(m={}));var M;(function(K){function B(V){return V.replace(/'/g,"\\'")}K.Escape=B})(M||(M={}));var S=class extends u.TypeBoxError{constructor(K){super("Unknown type"),this.schema=K}};e.TypeCompilerUnknownTypeError=S;var D=class extends u.TypeBoxError{constructor(K){super("Preflight validation check failed to guard for the given schema"),this.schema=K}};e.TypeCompilerTypeGuardError=D;var H;(function(K){function B(z,fe,N){return i.TypeSystemPolicy.ExactOptionalPropertyTypes?`('${fe}' in ${z} ? ${N} : true)`:`(${h.Encode(z,fe)} !== undefined ? ${N} : true)`}K.IsExactOptionalProperty=B;function V(z){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${z} === 'object' && ${z} !== null)`:`(typeof ${z} === 'object' && ${z} !== null && !Array.isArray(${z}))`}K.IsObjectLike=V;function W(z){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${z} === 'object' && ${z} !== null && !(${z} instanceof Date) && !(${z} instanceof Uint8Array))`:`(typeof ${z} === 'object' && ${z} !== null && !Array.isArray(${z}) && !(${z} instanceof Date) && !(${z} instanceof Uint8Array))`}K.IsRecordLike=W;function F(z){return i.TypeSystemPolicy.AllowNaN?`typeof ${z} === 'number'`:`(typeof ${z} === 'number' && Number.isFinite(${z}))`}K.IsNumberLike=F;function ee(z){return i.TypeSystemPolicy.AllowNullVoid?`(${z} === undefined || ${z} === null)`:`${z} === undefined`}K.IsVoidLike=ee})(H||(e.Policy=H={}));var Q;(function(K){function B(A){return A[u.Kind]==="Any"||A[u.Kind]==="Unknown"}function*V(A,ue,$){yield"true"}function*W(A,ue,$){yield`Array.isArray(${$})`;let[ye,ne]=[Ce("value","any"),Ce("acc","number")];(0,n.IsNumber)(A.maxItems)&&(yield`${$}.length <= ${A.maxItems}`),(0,n.IsNumber)(A.minItems)&&(yield`${$}.length >= ${A.minItems}`);let ce=te(A.items,ue,"value");if(yield`${$}.every((${ye}) => ${ce})`,u.TypeGuard.TSchema(A.contains)||(0,n.IsNumber)(A.minContains)||(0,n.IsNumber)(A.maxContains)){let we=u.TypeGuard.TSchema(A.contains)?A.contains:u.Type.Never(),$e=te(we,ue,"value"),ze=(0,n.IsNumber)(A.minContains)?[`(count >= ${A.minContains})`]:[],Ge=(0,n.IsNumber)(A.maxContains)?[`(count <= ${A.maxContains})`]:[],He=`const count = value.reduce((${ne}, ${ye}) => ${$e} ? acc + 1 : acc, 0)`,Lt=["(count > 0)",...ze,...Ge].join(" && ");yield`((${ye}) => { ${He}; return ${Lt}})(${$})`}A.uniqueItems===!0&&(yield`((${ye}) => { const set = new Set(); for(const element of value) { const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true } )(${$})`)}function*F(A,ue,$){yield`(typeof value === 'object' && Symbol.asyncIterator in ${$})`}function*ee(A,ue,$){yield`(typeof ${$} === 'bigint')`,(0,n.IsBigInt)(A.exclusiveMaximum)&&(yield`${$} < BigInt(${A.exclusiveMaximum})`),(0,n.IsBigInt)(A.exclusiveMinimum)&&(yield`${$} > BigInt(${A.exclusiveMinimum})`),(0,n.IsBigInt)(A.maximum)&&(yield`${$} <= BigInt(${A.maximum})`),(0,n.IsBigInt)(A.minimum)&&(yield`${$} >= BigInt(${A.minimum})`),(0,n.IsBigInt)(A.multipleOf)&&(yield`(${$} % BigInt(${A.multipleOf})) === 0`)}function*z(A,ue,$){yield`(typeof ${$} === 'boolean')`}function*fe(A,ue,$){yield*k(A.returns,ue,`${$}.prototype`)}function*N(A,ue,$){yield`(${$} instanceof Date) && Number.isFinite(${$}.getTime())`,(0,n.IsNumber)(A.exclusiveMaximumTimestamp)&&(yield`${$}.getTime() < ${A.exclusiveMaximumTimestamp}`),(0,n.IsNumber)(A.exclusiveMinimumTimestamp)&&(yield`${$}.getTime() > ${A.exclusiveMinimumTimestamp}`),(0,n.IsNumber)(A.maximumTimestamp)&&(yield`${$}.getTime() <= ${A.maximumTimestamp}`),(0,n.IsNumber)(A.minimumTimestamp)&&(yield`${$}.getTime() >= ${A.minimumTimestamp}`),(0,n.IsNumber)(A.multipleOfTimestamp)&&(yield`(${$}.getTime() % ${A.multipleOfTimestamp}) === 0`)}function*x(A,ue,$){yield`(typeof ${$} === 'function')`}function*L(A,ue,$){yield`(typeof ${$} === 'number' && Number.isInteger(${$}))`,(0,n.IsNumber)(A.exclusiveMaximum)&&(yield`${$} < ${A.exclusiveMaximum}`),(0,n.IsNumber)(A.exclusiveMinimum)&&(yield`${$} > ${A.exclusiveMinimum}`),(0,n.IsNumber)(A.maximum)&&(yield`${$} <= ${A.maximum}`),(0,n.IsNumber)(A.minimum)&&(yield`${$} >= ${A.minimum}`),(0,n.IsNumber)(A.multipleOf)&&(yield`(${$} % ${A.multipleOf}) === 0`)}function*Y(A,ue,$){let ye=A.allOf.map(ne=>te(ne,ue,$)).join(" && ");if(A.unevaluatedProperties===!1){let ne=ge(`${new RegExp(u.KeyResolver.ResolvePattern(A))};`),ce=`Object.getOwnPropertyNames(${$}).every(key => ${ne}.test(key))`;yield`(${ye} && ${ce})`}else if(u.TypeGuard.TSchema(A.unevaluatedProperties)){let ne=ge(`${new RegExp(u.KeyResolver.ResolvePattern(A))};`),ce=`Object.getOwnPropertyNames(${$}).every(key => ${ne}.test(key) || ${te(A.unevaluatedProperties,ue,`${$}[key]`)})`;yield`(${ye} && ${ce})`}else yield`(${ye})`}function*ie(A,ue,$){yield`(typeof value === 'object' && Symbol.iterator in ${$})`}function*X(A,ue,$){typeof A.const=="number"||typeof A.const=="boolean"?yield`(${$} === ${A.const})`:yield`(${$} === '${M.Escape(A.const)}')`}function*se(A,ue,$){yield"false"}function*j(A,ue,$){yield`(!${te(A.not,ue,$)})`}function*G(A,ue,$){yield`(${$} === null)`}function*J(A,ue,$){yield H.IsNumberLike($),(0,n.IsNumber)(A.exclusiveMaximum)&&(yield`${$} < ${A.exclusiveMaximum}`),(0,n.IsNumber)(A.exclusiveMinimum)&&(yield`${$} > ${A.exclusiveMinimum}`),(0,n.IsNumber)(A.maximum)&&(yield`${$} <= ${A.maximum}`),(0,n.IsNumber)(A.minimum)&&(yield`${$} >= ${A.minimum}`),(0,n.IsNumber)(A.multipleOf)&&(yield`(${$} % ${A.multipleOf}) === 0`)}function*le(A,ue,$){yield H.IsObjectLike($),(0,n.IsNumber)(A.minProperties)&&(yield`Object.getOwnPropertyNames(${$}).length >= ${A.minProperties}`),(0,n.IsNumber)(A.maxProperties)&&(yield`Object.getOwnPropertyNames(${$}).length <= ${A.maxProperties}`);let ye=Object.getOwnPropertyNames(A.properties);for(let ne of ye){let ce=h.Encode($,ne),we=A.properties[ne];if(A.required&&A.required.includes(ne))yield*k(we,ue,ce),(u.ExtendsUndefined.Check(we)||B(we))&&(yield`('${ne}' in ${$})`);else{let $e=te(we,ue,ce);yield H.IsExactOptionalProperty($,ne,$e)}}if(A.additionalProperties===!1)if(A.required&&A.required.length===ye.length)yield`Object.getOwnPropertyNames(${$}).length === ${ye.length}`;else{let ne=`[${ye.map(ce=>`'${ce}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${$}).every(key => ${ne}.includes(key))`}if(typeof A.additionalProperties=="object"){let ne=te(A.additionalProperties,ue,`${$}[key]`),ce=`[${ye.map(we=>`'${we}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${$}).every(key => ${ce}.includes(key) || ${ne}))`}}function*l(A,ue,$){yield`(typeof value === 'object' && typeof ${$}.then === 'function')`}function*_(A,ue,$){yield H.IsRecordLike($),(0,n.IsNumber)(A.minProperties)&&(yield`Object.getOwnPropertyNames(${$}).length >= ${A.minProperties}`),(0,n.IsNumber)(A.maxProperties)&&(yield`Object.getOwnPropertyNames(${$}).length <= ${A.maxProperties}`);let[ye,ne]=Object.entries(A.patternProperties)[0],ce=ge(`${new RegExp(ye)}`),we=te(ne,ue,"value"),$e=u.TypeGuard.TSchema(A.additionalProperties)?te(A.additionalProperties,ue,$):A.additionalProperties===!1?"false":"true",ze=`(${ce}.test(key) ? ${we} : ${$e})`;yield`(Object.entries(${$}).every(([key, value]) => ${ze}))`}function*I(A,ue,$){let ye=(0,s.Deref)(A,ue);if(Z.functions.has(A.$ref))return yield`${pe(A.$ref)}(${$})`;yield*k(ye,ue,$)}function*C(A,ue,$){yield`(typeof ${$} === 'string')`,(0,n.IsNumber)(A.maxLength)&&(yield`${$}.length <= ${A.maxLength}`),(0,n.IsNumber)(A.minLength)&&(yield`${$}.length >= ${A.minLength}`),A.pattern!==void 0&&(yield`${ge(`${new RegExp(A.pattern)};`)}.test(${$})`),A.format!==void 0&&(yield`format('${A.format}', ${$})`)}function*R(A,ue,$){yield`(typeof ${$} === 'symbol')`}function*E(A,ue,$){yield`(typeof ${$} === 'string')`,yield`${ge(`${new RegExp(A.pattern)};`)}.test(${$})`}function*y(A,ue,$){yield`${pe(A.$ref)}(${$})`}function*w(A,ue,$){if(yield`Array.isArray(${$})`,A.items===void 0)return yield`${$}.length === 0`;yield`(${$}.length === ${A.maxItems})`;for(let ye=0;ye<A.items.length;ye++)yield`${te(A.items[ye],ue,`${$}[${ye}]`)}`}function*T(A,ue,$){yield`${$} === undefined`}function*a(A,ue,$){yield`(${A.anyOf.map(ne=>te(ne,ue,$)).join(" || ")})`}function*O(A,ue,$){yield`${$} instanceof Uint8Array`,(0,n.IsNumber)(A.maxByteLength)&&(yield`(${$}.length <= ${A.maxByteLength})`),(0,n.IsNumber)(A.minByteLength)&&(yield`(${$}.length >= ${A.minByteLength})`)}function*v(A,ue,$){yield"true"}function*b(A,ue,$){yield H.IsVoidLike($)}function*P(A,ue,$){let ye=Z.instances.size;Z.instances.set(ye,A),yield`kind('${A[u.Kind]}', ${ye}, ${$})`}function*k(A,ue,$,ye=!0){let ne=(0,n.IsString)(A.$id)?[...ue,A]:ue,ce=A;if(ye&&(0,n.IsString)(A.$id)){let we=pe(A.$id);if(Z.functions.has(we))return yield`${we}(${$})`;{let $e=Ee(we,A,ue,"value",!1);return Z.functions.set(we,$e),yield`${we}(${$})`}}switch(ce[u.Kind]){case"Any":return yield*V(ce,ne,$);case"Array":return yield*W(ce,ne,$);case"AsyncIterator":return yield*F(ce,ne,$);case"BigInt":return yield*ee(ce,ne,$);case"Boolean":return yield*z(ce,ne,$);case"Constructor":return yield*fe(ce,ne,$);case"Date":return yield*N(ce,ne,$);case"Function":return yield*x(ce,ne,$);case"Integer":return yield*L(ce,ne,$);case"Intersect":return yield*Y(ce,ne,$);case"Iterator":return yield*ie(ce,ne,$);case"Literal":return yield*X(ce,ne,$);case"Never":return yield*se(ce,ne,$);case"Not":return yield*j(ce,ne,$);case"Null":return yield*G(ce,ne,$);case"Number":return yield*J(ce,ne,$);case"Object":return yield*le(ce,ne,$);case"Promise":return yield*l(ce,ne,$);case"Record":return yield*_(ce,ne,$);case"Ref":return yield*I(ce,ne,$);case"String":return yield*C(ce,ne,$);case"Symbol":return yield*R(ce,ne,$);case"TemplateLiteral":return yield*E(ce,ne,$);case"This":return yield*y(ce,ne,$);case"Tuple":return yield*w(ce,ne,$);case"Undefined":return yield*T(ce,ne,$);case"Union":return yield*a(ce,ne,$);case"Uint8Array":return yield*O(ce,ne,$);case"Unknown":return yield*v(ce,ne,$);case"Void":return yield*b(ce,ne,$);default:if(!u.TypeRegistry.Has(ce[u.Kind]))throw new S(A);return yield*P(ce,ne,$)}}let Z={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function te(A,ue,$,ye=!0){return`(${[...k(A,ue,$,ye)].join(" && ")})`}function pe(A){return`check_${m.Encode(A)}`}function ge(A){let ue=`local_${Z.variables.size}`;return Z.variables.set(ue,`const ${ue} = ${A}`),ue}function Ee(A,ue,$,ye,ne=!0){let[ce,we]=[`
49
+ `,He=>"".padStart(He," ")],$e=Ce("value","any"),ze=rn("boolean"),Ge=[...k(ue,$,ye,ne)].map(He=>`${we(4)}${He}`).join(` &&${ce}`);return`function ${A}(${$e})${ze} {${ce}${we(2)}return (${ce}${Ge}${ce}${we(2)})
50
+ }`}function Ce(A,ue){let $=Z.language==="typescript"?`: ${ue}`:"";return`${A}${$}`}function rn(A){return Z.language==="typescript"?`: ${A}`:""}function me(A,ue,$){let ye=Ee("check",A,ue,"value"),ne=Ce("value","any"),ce=rn("boolean"),we=[...Z.functions.values()],$e=[...Z.variables.values()],ze=(0,n.IsString)(A.$id)?`return function check(${ne})${ce} {
51
+ return ${pe(A.$id)}(value)
52
+ }`:`return ${ye}`;return[...$e,...we,ze].join(`
53
+ `)}function Vt(...A){let ue={language:"javascript"},[$,ye,ne]=A.length===2&&(0,n.IsArray)(A[1])?[A[0],A[1],ue]:A.length===2&&!(0,n.IsArray)(A[1])?[A[0],[],A[1]]:A.length===3?[A[0],A[1],A[2]]:A.length===1?[A[0],[],ue]:[null,[],ue];if(Z.language=ne.language,Z.variables.clear(),Z.functions.clear(),Z.instances.clear(),!u.TypeGuard.TSchema($))throw new D($);for(let ce of ye)if(!u.TypeGuard.TSchema(ce))throw new D(ce);return me($,ye,ne)}K.Code=Vt;function on(A,ue=[]){let $=Vt(A,ue,{language:"javascript"}),ye=globalThis.Function("kind","format","hash",$),ne=new Map(Z.instances);function ce(Ge,He,Lt){if(!u.TypeRegistry.Has(Ge)||!ne.has(He))return!1;let Pn=u.TypeRegistry.Get(Ge),$n=ne.get(He);return Pn($n,Lt)}function we(Ge,He){return u.FormatRegistry.Has(Ge)?u.FormatRegistry.Get(Ge)(He):!1}function $e(Ge){return(0,o.Hash)(Ge)}let ze=ye(ce,we,$e);return new f(A,ue,ze,$)}K.Compile=on})(Q||(e.TypeCompiler=Q={}))}}),tp=ke({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/compiler/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?(function(i,s,o,u){u===void 0&&(u=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(i,u,f)}):(function(i,s,o,u){u===void 0&&(u=o),i[u]=s[o]})),n=e&&e.__exportStar||function(i,s){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&t(s,i,o)};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueErrorIterator=e.ValueErrorType=void 0;var r=Yd();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return r.ValueErrorType}}),Object.defineProperty(e,"ValueErrorIterator",{enumerable:!0,get:function(){return r.ValueErrorIterator}}),n(ep(),e)}}),gi=Xt(Hd(),1),np=Xt(Jd(),1),Qu=!1,ec=!1;gi.isNode&&(process?.env?.LOGGER_TIME_PREFIX&&(Qu=process?.env?.LOGGER_TIME_PREFIX==="true"),process?.env?.LOGGER_PERF_PREFIX&&(ec=process?.env?.LOGGER_PERF_PREFIX==="true"));var rp={prefix:void 0,time:Qu,delta:ec,dimDebugOnServer:!0,printOriginOnServer:!0,serverInspectOptions:{},customFormattersOnServer:!0,printStackLinesOnServer:!1,dim:!0},Io=[],tc=class{sinceFirst=0;sinceLast=0;time=!1;delta=!1;constructor(e,t,n,r){Object.assign(this,{sinceFirst:e,sinceLast:t,time:n,delta:r})}toString(){let e=this.sinceFirst*.001,t=e.toFixed(e<5?2:1),n=this.sinceLast<1e3?`${this.sinceLast.toFixed(0)}`.padStart(5," "):`${`${(this.sinceLast*.001).toFixed(this.sinceLast<1e4?1:0)}`.padStart(4," ")}s`;return`[${[this.time?t:null,this.delta?n:null].filter(r=>r!=null).join(",")}]`}},nc=class{constructor(e,t){Object.assign(this,{style:e,string:t})}},Tr=!1,De=class Xe{static ERROR=2;static WARN=4;static INFO=6;static LOG=6;static DEBUG=8;static VERBOSE=10;static firstLog=0;static lastLog=0;static setup(t=Xe.INFO,n={}){n=Object.assign({},rp,n),t>10&&console.debug("setup logger",{config:n});let r=this.wrapLog(console.debug,{...n,dim:n.dimDebugOnServer}),i=(...f)=>{typeof window<"u"&&window?.FORCE_DISABLE_LOGLEVEL&&r(...f)};i.isDisabled=!0,i.isEnabled=!1;let s=this.wrapLog(console.groupCollapsed,n),o=(f,c)=>{function h(...M){let S=M[M.length-1];return S===i?S():(s(...M.slice(0,-1)),(async()=>{try{let D=S();return D instanceof Promise?await D:D}finally{console.groupEnd()}})())}let m=Object.assign(c.bind({}),{isEnabled:f,isDisabled:!f,group:h,force:c});return f?m:Object.assign(i.bind({}),{isEnabled:f,isDisabled:!f,group:h,force:m})},u=o(t>=Xe.ERROR,this.wrapLog(console.error,n));return{ERROR:(...f)=>(u(...f),new Error(f.map(c=>typeof c=="string"?c:(0,np.default)(c)).join(" "))),WARN:o(t>=Xe.WARN,this.wrapLog(console.warn,n)),LOG:o(t>=Xe.INFO,this.wrapLog(console.log,n)),DEBUG:o(t>=Xe.DEBUG,this.wrapLog(console.log,{...n,dim:n.dimDebugOnServer})),VERBOSE:o(t>=Xe.VERBOSE,this.wrapLog(console.debug,{...n,dim:n.dimDebugOnServer}))}}static wrapLog(t,n){if(gi.isNode)return t.bind(console);{let r=[];if(n.time||n.delta){let i=gi.isBrowser&&navigator.userAgent.includes("Chrome")?["",Xe.timeStr(!!n.time,!!n.delta)]:[];r.push(...i)}return n.prefix&&(Tr?r.push(new nc("dim",n.prefix)):r.push(n.prefix)),t.bind(console,...r)}}static timeStr(t,n,r=0){if(!performance.now)return;let i=performance.now();Xe.firstLog||(Xe.firstLog=i,Xe.lastLog=i);let s=new tc(i-Xe.firstLog,i-Xe.lastLog,t,n);return Xe.lastLog=i,r?s.toString():s}static getOriginFromStack(t){let n=!1;for(let r of t.split(`
54
+ `)){let i=r.match(/^\s+at\s+(.*)/);if(i){if(n)return i[1].trim().replace(__dirname,"");n=!0}}}};gi.isBrowser&&(window.devtoolsFormatters=window.devtoolsFormatters??[],window.devtoolsFormatters.push({header:e=>{if(Io&&Io.length){for(let t of Io)if(t.match(e))return["span",{},t.format(e)]}return null},hasBody:()=>!0},{header:e=>{if(!(e instanceof tc))return null;Tr||(Tr=!0);let t=De.timeStr(e.time,e.delta);return["span",{style:"font-weight: light; color: grey"},t?.toString()]},hasBody:()=>!1},{header:e=>e instanceof nc?(Tr||(Tr=!0),["span",{style:"font-weight: light; color: grey; "},e.string]):null,hasBody:()=>!1}));var ip=typeof global=="object"&&global&&global.Object===Object&&global,rc=ip,op=typeof self=="object"&&self&&self.Object===Object&&self,sp=rc||op||Function("return this")(),nt=sp,ap=nt.Symbol,jt=ap,ic=Object.prototype,up=ic.hasOwnProperty,cp=ic.toString,br=jt?jt.toStringTag:void 0;function fp(e){var t=up.call(e,br),n=e[br];try{e[br]=void 0;var r=!0}catch{}var i=cp.call(e);return r&&(t?e[br]=n:delete e[br]),i}var lp=fp,dp=Object.prototype,pp=dp.toString;function yp(e){return pp.call(e)}var hp=yp,gp="[object Null]",mp="[object Undefined]",ka=jt?jt.toStringTag:void 0;function bp(e){return e==null?e===void 0?mp:gp:ka&&ka in Object(e)?lp(e):hp(e)}var qn=bp;function vp(e){return e!=null&&typeof e=="object"}var tn=vp,_p="[object Symbol]";function Tp(e){return typeof e=="symbol"||tn(e)&&qn(e)==_p}var Vn=Tp;function wp(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var oc=wp,Op=Array.isArray,$t=Op,Ap=1/0,Ka=jt?jt.prototype:void 0,Ga=Ka?Ka.toString:void 0;function sc(e){if(typeof e=="string")return e;if($t(e))return oc(e,sc)+"";if(Vn(e))return Ga?Ga.call(e):"";var t=e+"";return t=="0"&&1/e==-Ap?"-0":t}var Ip=sc,Ep=/\s/;function Sp(e){for(var t=e.length;t--&&Ep.test(e.charAt(t)););return t}var Pp=Sp,$p=/^\s+/;function Rp(e){return e&&e.slice(0,Pp(e)+1).replace($p,"")}var Np=Rp;function Cp(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Gt=Cp,Va=NaN,xp=/^[-+]0x[0-9a-f]+$/i,Up=/^0b[01]+$/i,jp=/^0o[0-7]+$/i,Mp=parseInt;function Lp(e){if(typeof e=="number")return e;if(Vn(e))return Va;if(Gt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Gt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Np(e);var n=Up.test(e);return n||jp.test(e)?Mp(e.slice(2),n?2:8):xp.test(e)?Va:+e}var Dp=Lp,za=1/0,Bp=17976931348623157e292;function Fp(e){if(!e)return e===0?e:0;if(e=Dp(e),e===za||e===-za){var t=e<0?-1:1;return t*Bp}return e===e?e:0}var kp=Fp;function Kp(e){var t=kp(e),n=t%1;return t===t?n?t-n:t:0}var Wa=Kp;function Gp(e){return e}var Ui=Gp,Vp="[object AsyncFunction]",zp="[object Function]",Wp="[object GeneratorFunction]",qp="[object Proxy]";function Hp(e){if(!Gt(e))return!1;var t=qn(e);return t==zp||t==Wp||t==Vp||t==qp}var ac=Hp,Jp=nt["__core-js_shared__"],Eo=Jp,qa=(function(){var e=/[^.]+$/.exec(Eo&&Eo.keys&&Eo.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function Xp(e){return!!qa&&qa in e}var Yp=Xp,Zp=Function.prototype,Qp=Zp.toString;function ey(e){if(e!=null){try{return Qp.call(e)}catch{}try{return e+""}catch{}}return""}var Tn=ey,ty=/[\\^$.*+?()[\]{}|]/g,ny=/^\[object .+?Constructor\]$/,ry=Function.prototype,iy=Object.prototype,oy=ry.toString,sy=iy.hasOwnProperty,ay=RegExp("^"+oy.call(sy).replace(ty,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function uy(e){if(!Gt(e)||Yp(e))return!1;var t=ac(e)?ay:ny;return t.test(Tn(e))}var cy=uy;function fy(e,t){return e?.[t]}var ly=fy;function dy(e,t){var n=ly(e,t);return cy(n)?n:void 0}var wn=dy,py=wn(nt,"WeakMap"),Or=py,yy=Or&&new Or,mi=yy,hy=mi?function(e,t){return mi.set(e,t),e}:Ui,uc=hy,Ha=Object.create,gy=(function(){function e(){}return function(t){if(!Gt(t))return{};if(Ha)return Ha(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})(),Xo=gy;function my(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Xo(e.prototype),r=e.apply(n,t);return Gt(r)?r:n}}var Ar=my,by=1;function vy(e,t,n){var r=t&by,i=Ar(e);function s(){var o=this&&this!==nt&&this instanceof s?i:e;return o.apply(r?n:this,arguments)}return s}var _y=vy;function Ty(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Yo=Ty,wy=Math.max;function Oy(e,t,n,r){for(var i=-1,s=e.length,o=n.length,u=-1,f=t.length,c=wy(s-o,0),h=Array(f+c),m=!r;++u<f;)h[u]=t[u];for(;++i<o;)(m||i<s)&&(h[n[i]]=e[i]);for(;c--;)h[u++]=e[i++];return h}var cc=Oy,Ay=Math.max;function Iy(e,t,n,r){for(var i=-1,s=e.length,o=-1,u=n.length,f=-1,c=t.length,h=Ay(s-u,0),m=Array(h+c),M=!r;++i<h;)m[i]=e[i];for(var S=i;++f<c;)m[S+f]=t[f];for(;++o<u;)(M||i<s)&&(m[S+n[o]]=e[i++]);return m}var fc=Iy;function Ey(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Sy=Ey;function Py(){}var Zo=Py,$y=4294967295;function bi(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=$y,this.__views__=[]}bi.prototype=Xo(Zo.prototype);bi.prototype.constructor=bi;var Qo=bi;function Ry(){}var lc=Ry,Ny=mi?function(e){return mi.get(e)}:lc,dc=Ny,Cy={},Ja=Cy,xy=Object.prototype,Uy=xy.hasOwnProperty;function jy(e){for(var t=e.name+"",n=Ja[t],r=Uy.call(Ja,t)?n.length:0;r--;){var i=n[r],s=i.func;if(s==null||s==e)return i.name}return t}var My=jy;function vi(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}vi.prototype=Xo(Zo.prototype);vi.prototype.constructor=vi;var Do=vi;function Ly(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var pc=Ly;function Dy(e){if(e instanceof Qo)return e.clone();var t=new Do(e.__wrapped__,e.__chain__);return t.__actions__=pc(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var By=Dy,Fy=Object.prototype,ky=Fy.hasOwnProperty;function _i(e){if(tn(e)&&!$t(e)&&!(e instanceof Qo)){if(e instanceof Do)return e;if(ky.call(e,"__wrapped__"))return By(e)}return new Do(e)}_i.prototype=Zo.prototype;_i.prototype.constructor=_i;var Ky=_i;function Gy(e){var t=My(e),n=Ky[t];if(typeof n!="function"||!(t in Qo.prototype))return!1;if(e===n)return!0;var r=dc(n);return!!r&&e===r[0]}var Vy=Gy,zy=800,Wy=16,qy=Date.now;function Hy(e){var t=0,n=0;return function(){var r=qy(),i=Wy-(r-n);if(n=r,i>0){if(++t>=zy)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var yc=Hy,Jy=yc(uc),hc=Jy,Xy=/\{\n\/\* \[wrapped with (.+)\] \*/,Yy=/,? & /;function Zy(e){var t=e.match(Xy);return t?t[1].split(Yy):[]}var Qy=Zy,eh=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function th(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(eh,`{
55
+ /* [wrapped with `+t+`] */
56
+ `)}var nh=th;function rh(e){return function(){return e}}var ih=rh,oh=(function(){try{var e=wn(Object,"defineProperty");return e({},"",{}),e}catch{}})(),Ti=oh,sh=Ti?function(e,t){return Ti(e,"toString",{configurable:!0,enumerable:!1,value:ih(t),writable:!0})}:Ui,ah=sh,uh=yc(ah),es=uh;function ch(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var fh=ch;function lh(e,t,n,r){for(var i=e.length,s=n+(r?1:-1);r?s--:++s<i;)if(t(e[s],s,e))return s;return-1}var dh=lh;function ph(e){return e!==e}var yh=ph;function hh(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var gh=hh;function mh(e,t,n){return t===t?gh(e,t,n):dh(e,yh,n)}var bh=mh;function vh(e,t){var n=e==null?0:e.length;return!!n&&bh(e,t,0)>-1}var gc=vh,_h=1,Th=2,wh=8,Oh=16,Ah=32,Ih=64,Eh=128,Sh=256,Ph=512,$h=[["ary",Eh],["bind",_h],["bindKey",Th],["curry",wh],["curryRight",Oh],["flip",Ph],["partial",Ah],["partialRight",Ih],["rearg",Sh]];function Rh(e,t){return fh($h,function(n){var r="_."+n[0];t&n[1]&&!gc(e,r)&&e.push(r)}),e.sort()}var Nh=Rh;function Ch(e,t,n){var r=t+"";return es(e,nh(r,Nh(Qy(r),n)))}var mc=Ch,xh=1,Uh=2,jh=4,Mh=8,Xa=32,Ya=64;function Lh(e,t,n,r,i,s,o,u,f,c){var h=t&Mh,m=h?o:void 0,M=h?void 0:o,S=h?s:void 0,D=h?void 0:s;t|=h?Xa:Ya,t&=~(h?Ya:Xa),t&jh||(t&=~(xh|Uh));var H=[e,t,i,S,m,D,M,u,f,c],Q=n.apply(void 0,H);return Vy(e)&&hc(Q,H),Q.placeholder=r,mc(Q,e,t)}var bc=Lh;function Dh(e){var t=e;return t.placeholder}var ts=Dh,Bh=9007199254740991,Fh=/^(?:0|[1-9]\d*)$/;function kh(e,t){var n=typeof e;return t=t??Bh,!!t&&(n=="number"||n!="symbol"&&Fh.test(e))&&e>-1&&e%1==0&&e<t}var ji=kh,Kh=Math.min;function Gh(e,t){for(var n=e.length,r=Kh(t.length,n),i=pc(e);r--;){var s=t[r];e[r]=ji(s,n)?i[s]:void 0}return e}var Vh=Gh,Za="__lodash_placeholder__";function zh(e,t){for(var n=-1,r=e.length,i=0,s=[];++n<r;){var o=e[n];(o===t||o===Za)&&(e[n]=Za,s[i++]=n)}return s}var Ir=zh,Wh=1,qh=2,Hh=8,Jh=16,Xh=128,Yh=512;function vc(e,t,n,r,i,s,o,u,f,c){var h=t&Xh,m=t&Wh,M=t&qh,S=t&(Hh|Jh),D=t&Yh,H=M?void 0:Ar(e);function Q(){for(var K=arguments.length,B=Array(K),V=K;V--;)B[V]=arguments[V];if(S)var W=ts(Q),F=Sy(B,W);if(r&&(B=cc(B,r,i,S)),s&&(B=fc(B,s,o,S)),K-=F,S&&K<c){var ee=Ir(B,W);return bc(e,t,vc,Q.placeholder,n,B,ee,u,f,c-K)}var z=m?n:this,fe=M?z[e]:e;return K=B.length,u?B=Vh(B,u):D&&K>1&&B.reverse(),h&&f<K&&(B.length=f),this&&this!==nt&&this instanceof Q&&(fe=H||Ar(fe)),fe.apply(z,B)}return Q}var _c=vc;function Zh(e,t,n){var r=Ar(e);function i(){for(var s=arguments.length,o=Array(s),u=s,f=ts(i);u--;)o[u]=arguments[u];var c=s<3&&o[0]!==f&&o[s-1]!==f?[]:Ir(o,f);if(s-=c.length,s<n)return bc(e,t,_c,i.placeholder,void 0,o,c,void 0,void 0,n-s);var h=this&&this!==nt&&this instanceof i?r:e;return Yo(h,this,o)}return i}var Qh=Zh,eg=1;function tg(e,t,n,r){var i=t&eg,s=Ar(e);function o(){for(var u=-1,f=arguments.length,c=-1,h=r.length,m=Array(h+f),M=this&&this!==nt&&this instanceof o?s:e;++c<h;)m[c]=r[c];for(;f--;)m[c++]=arguments[++u];return Yo(M,i?n:this,m)}return o}var ng=tg,Qa="__lodash_placeholder__",So=1,rg=2,ig=4,eu=8,vr=128,tu=256,og=Math.min;function sg(e,t){var n=e[1],r=t[1],i=n|r,s=i<(So|rg|vr),o=r==vr&&n==eu||r==vr&&n==tu&&e[7].length<=t[8]||r==(vr|tu)&&t[7].length<=t[8]&&n==eu;if(!(s||o))return e;r&So&&(e[2]=t[2],i|=n&So?0:ig);var u=t[3];if(u){var f=e[3];e[3]=f?cc(f,u,t[4]):u,e[4]=f?Ir(e[3],Qa):t[4]}return u=t[5],u&&(f=e[5],e[5]=f?fc(f,u,t[6]):u,e[6]=f?Ir(e[5],Qa):t[6]),u=t[7],u&&(e[7]=u),r&vr&&(e[8]=e[8]==null?t[8]:og(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e}var ag=sg,ug="Expected a function",nu=1,cg=2,Po=8,$o=16,Ro=32,ru=64,iu=Math.max;function fg(e,t,n,r,i,s,o,u){var f=t&cg;if(!f&&typeof e!="function")throw new TypeError(ug);var c=r?r.length:0;if(c||(t&=~(Ro|ru),r=i=void 0),o=o===void 0?o:iu(Wa(o),0),u=u===void 0?u:Wa(u),c-=i?i.length:0,t&ru){var h=r,m=i;r=i=void 0}var M=f?void 0:dc(e),S=[e,t,n,r,i,h,m,s,o,u];if(M&&ag(S,M),e=S[0],t=S[1],n=S[2],r=S[3],i=S[4],u=S[9]=S[9]===void 0?f?0:e.length:iu(S[9]-c,0),!u&&t&(Po|$o)&&(t&=~(Po|$o)),!t||t==nu)var D=_y(e,t,n);else t==Po||t==$o?D=Qh(e,t,u):(t==Ro||t==(nu|Ro))&&!i.length?D=ng(e,t,n,r):D=_c.apply(void 0,S);var H=M?uc:hc;return mc(H(D,S),e,t)}var lg=fg;function dg(e,t,n){t=="__proto__"&&Ti?Ti(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var pg=dg;function yg(e,t){return e===t||e!==e&&t!==t}var ns=yg,hg=Object.prototype,gg=hg.hasOwnProperty;function mg(e,t,n){var r=e[t];(!(gg.call(e,t)&&ns(r,n))||n===void 0&&!(t in e))&&pg(e,t,n)}var bg=mg,ou=Math.max;function vg(e,t,n){return t=ou(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=ou(r.length-t,0),o=Array(s);++i<s;)o[i]=r[t+i];i=-1;for(var u=Array(t+1);++i<t;)u[i]=r[i];return u[t]=n(o),Yo(e,this,u)}}var Tc=vg;function _g(e,t){return es(Tc(e,t,Ui),e+"")}var wc=_g,Tg=9007199254740991;function wg(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Tg}var rs=wg;function Og(e){return e!=null&&rs(e.length)&&!ac(e)}var Oc=Og,Ag=Object.prototype;function Ig(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Ag;return e===n}var Eg=Ig;function Sg(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Pg=Sg,$g="[object Arguments]";function Rg(e){return tn(e)&&qn(e)==$g}var su=Rg,Ac=Object.prototype,Ng=Ac.hasOwnProperty,Cg=Ac.propertyIsEnumerable,xg=su((function(){return arguments})())?su:function(e){return tn(e)&&Ng.call(e,"callee")&&!Cg.call(e,"callee")},is=xg;function Ug(){return!1}var jg=Ug,Ic=typeof exports=="object"&&exports&&!exports.nodeType&&exports,au=Ic&&typeof module=="object"&&module&&!module.nodeType&&module,Mg=au&&au.exports===Ic,uu=Mg?nt.Buffer:void 0,Lg=uu?uu.isBuffer:void 0,Dg=Lg||jg,Bo=Dg,Bg="[object Arguments]",Fg="[object Array]",kg="[object Boolean]",Kg="[object Date]",Gg="[object Error]",Vg="[object Function]",zg="[object Map]",Wg="[object Number]",qg="[object Object]",Hg="[object RegExp]",Jg="[object Set]",Xg="[object String]",Yg="[object WeakMap]",Zg="[object ArrayBuffer]",Qg="[object DataView]",em="[object Float32Array]",tm="[object Float64Array]",nm="[object Int8Array]",rm="[object Int16Array]",im="[object Int32Array]",om="[object Uint8Array]",sm="[object Uint8ClampedArray]",am="[object Uint16Array]",um="[object Uint32Array]",Se={};Se[em]=Se[tm]=Se[nm]=Se[rm]=Se[im]=Se[om]=Se[sm]=Se[am]=Se[um]=!0;Se[Bg]=Se[Fg]=Se[Zg]=Se[kg]=Se[Qg]=Se[Kg]=Se[Gg]=Se[Vg]=Se[zg]=Se[Wg]=Se[qg]=Se[Hg]=Se[Jg]=Se[Xg]=Se[Yg]=!1;function cm(e){return tn(e)&&rs(e.length)&&!!Se[qn(e)]}var fm=cm;function lm(e){return function(t){return e(t)}}var Ec=lm,Sc=typeof exports=="object"&&exports&&!exports.nodeType&&exports,wr=Sc&&typeof module=="object"&&module&&!module.nodeType&&module,dm=wr&&wr.exports===Sc,No=dm&&rc.process,pm=(function(){try{var e=wr&&wr.require&&wr.require("util").types;return e||No&&No.binding&&No.binding("util")}catch{}})(),cu=pm,fu=cu&&cu.isTypedArray,ym=fu?Ec(fu):fm,Pc=ym,hm=Object.prototype,gm=hm.hasOwnProperty;function mm(e,t){var n=$t(e),r=!n&&is(e),i=!n&&!r&&Bo(e),s=!n&&!r&&!i&&Pc(e),o=n||r||i||s,u=o?Pg(e.length,String):[],f=u.length;for(var c in e)(t||gm.call(e,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||ji(c,f)))&&u.push(c);return u}var bm=mm;function vm(e,t){return function(n){return e(t(n))}}var _m=vm,Tm=_m(Object.keys,Object),wm=Tm,Om=Object.prototype,Am=Om.hasOwnProperty;function Im(e){if(!Eg(e))return wm(e);var t=[];for(var n in Object(e))Am.call(e,n)&&n!="constructor"&&t.push(n);return t}var Em=Im;function Sm(e){return Oc(e)?bm(e):Em(e)}var $c=Sm,Pm=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$m=/^\w*$/;function Rm(e,t){if($t(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Vn(e)?!0:$m.test(e)||!Pm.test(e)||t!=null&&e in Object(t)}var os=Rm,Nm=wn(Object,"create"),Er=Nm;function Cm(){this.__data__=Er?Er(null):{},this.size=0}var xm=Cm;function Um(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var jm=Um,Mm="__lodash_hash_undefined__",Lm=Object.prototype,Dm=Lm.hasOwnProperty;function Bm(e){var t=this.__data__;if(Er){var n=t[e];return n===Mm?void 0:n}return Dm.call(t,e)?t[e]:void 0}var Fm=Bm,km=Object.prototype,Km=km.hasOwnProperty;function Gm(e){var t=this.__data__;return Er?t[e]!==void 0:Km.call(t,e)}var Vm=Gm,zm="__lodash_hash_undefined__";function Wm(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Er&&t===void 0?zm:t,this}var qm=Wm;function Hn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Hn.prototype.clear=xm;Hn.prototype.delete=jm;Hn.prototype.get=Fm;Hn.prototype.has=Vm;Hn.prototype.set=qm;var lu=Hn;function Hm(){this.__data__=[],this.size=0}var Jm=Hm;function Xm(e,t){for(var n=e.length;n--;)if(ns(e[n][0],t))return n;return-1}var Mi=Xm,Ym=Array.prototype,Zm=Ym.splice;function Qm(e){var t=this.__data__,n=Mi(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Zm.call(t,n,1),--this.size,!0}var eb=Qm;function tb(e){var t=this.__data__,n=Mi(t,e);return n<0?void 0:t[n][1]}var nb=tb;function rb(e){return Mi(this.__data__,e)>-1}var ib=rb;function ob(e,t){var n=this.__data__,r=Mi(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var sb=ob;function Jn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Jn.prototype.clear=Jm;Jn.prototype.delete=eb;Jn.prototype.get=nb;Jn.prototype.has=ib;Jn.prototype.set=sb;var Li=Jn,ab=wn(nt,"Map"),Sr=ab;function ub(){this.size=0,this.__data__={hash:new lu,map:new(Sr||Li),string:new lu}}var cb=ub;function fb(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var lb=fb;function db(e,t){var n=e.__data__;return lb(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Di=db;function pb(e){var t=Di(this,e).delete(e);return this.size-=t?1:0,t}var yb=pb;function hb(e){return Di(this,e).get(e)}var gb=hb;function mb(e){return Di(this,e).has(e)}var bb=mb;function vb(e,t){var n=Di(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var _b=vb;function Xn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Xn.prototype.clear=cb;Xn.prototype.delete=yb;Xn.prototype.get=gb;Xn.prototype.has=bb;Xn.prototype.set=_b;var Bi=Xn,Tb="Expected a function";function ss(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Tb);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=e.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(ss.Cache||Bi),n}ss.Cache=Bi;var wb=ss,Ob=500;function Ab(e){var t=wb(e,function(r){return n.size===Ob&&n.clear(),r}),n=t.cache;return t}var Ib=Ab,Eb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Sb=/\\(\\)?/g,Pb=Ib(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Eb,function(n,r,i,s){t.push(i?s.replace(Sb,"$1"):r||n)}),t}),$b=Pb;function Rb(e){return e==null?"":Ip(e)}var Nb=Rb;function Cb(e,t){return $t(e)?e:os(e,t)?[e]:$b(Nb(e))}var Fi=Cb,xb=1/0;function Ub(e){if(typeof e=="string"||Vn(e))return e;var t=e+"";return t=="0"&&1/e==-xb?"-0":t}var Nr=Ub;function jb(e,t){t=Fi(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Nr(t[n++])];return n&&n==r?e:void 0}var as=jb;function Mb(e,t,n){var r=e==null?void 0:as(e,t);return r===void 0?n:r}var Lb=Mb;function Db(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var Rc=Db,du=jt?jt.isConcatSpreadable:void 0;function Bb(e){return $t(e)||is(e)||!!(du&&e&&e[du])}var Fb=Bb;function Nc(e,t,n,r,i){var s=-1,o=e.length;for(n||(n=Fb),i||(i=[]);++s<o;){var u=e[s];t>0&&n(u)?t>1?Nc(u,t-1,n,r,i):Rc(i,u):r||(i[i.length]=u)}return i}var kb=Nc;function Kb(e){var t=e==null?0:e.length;return t?kb(e,1):[]}var Gb=Kb;function Vb(e){return es(Tc(e,void 0,Gb),e+"")}var zb=Vb;function Wb(){this.__data__=new Li,this.size=0}var qb=Wb;function Hb(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var Jb=Hb;function Xb(e){return this.__data__.get(e)}var Yb=Xb;function Zb(e){return this.__data__.has(e)}var Qb=Zb,ev=200;function tv(e,t){var n=this.__data__;if(n instanceof Li){var r=n.__data__;if(!Sr||r.length<ev-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Bi(r)}return n.set(e,t),this.size=n.size,this}var nv=tv;function Yn(e){var t=this.__data__=new Li(e);this.size=t.size}Yn.prototype.clear=qb;Yn.prototype.delete=Jb;Yn.prototype.get=Yb;Yn.prototype.has=Qb;Yn.prototype.set=nv;var li=Yn;function rv(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var o=e[n];t(o,n,e)&&(s[i++]=o)}return s}var iv=rv;function ov(){return[]}var sv=ov,av=Object.prototype,uv=av.propertyIsEnumerable,pu=Object.getOwnPropertySymbols,cv=pu?function(e){return e==null?[]:(e=Object(e),iv(pu(e),function(t){return uv.call(e,t)}))}:sv,fv=cv;function lv(e,t,n){var r=t(e);return $t(e)?r:Rc(r,n(e))}var dv=lv;function pv(e){return dv(e,$c,fv)}var yu=pv,yv=wn(nt,"DataView"),Fo=yv,hv=wn(nt,"Promise"),ko=hv,gv=wn(nt,"Set"),Gn=gv,hu="[object Map]",mv="[object Object]",gu="[object Promise]",mu="[object Set]",bu="[object WeakMap]",vu="[object DataView]",bv=Tn(Fo),vv=Tn(Sr),_v=Tn(ko),Tv=Tn(Gn),wv=Tn(Or),vn=qn;(Fo&&vn(new Fo(new ArrayBuffer(1)))!=vu||Sr&&vn(new Sr)!=hu||ko&&vn(ko.resolve())!=gu||Gn&&vn(new Gn)!=mu||Or&&vn(new Or)!=bu)&&(vn=function(e){var t=qn(e),n=t==mv?e.constructor:void 0,r=n?Tn(n):"";if(r)switch(r){case bv:return vu;case vv:return hu;case _v:return gu;case Tv:return mu;case wv:return bu}return t});var _u=vn,Ov=nt.Uint8Array,Tu=Ov,Av="__lodash_hash_undefined__";function Iv(e){return this.__data__.set(e,Av),this}var Ev=Iv;function Sv(e){return this.__data__.has(e)}var Pv=Sv;function wi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Bi;++t<n;)this.add(e[t])}wi.prototype.add=wi.prototype.push=Ev;wi.prototype.has=Pv;var Cc=wi;function $v(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Rv=$v;function Nv(e,t){return e.has(t)}var xc=Nv,Cv=1,xv=2;function Uv(e,t,n,r,i,s){var o=n&Cv,u=e.length,f=t.length;if(u!=f&&!(o&&f>u))return!1;var c=s.get(e),h=s.get(t);if(c&&h)return c==t&&h==e;var m=-1,M=!0,S=n&xv?new Cc:void 0;for(s.set(e,t),s.set(t,e);++m<u;){var D=e[m],H=t[m];if(r)var Q=o?r(H,D,m,t,e,s):r(D,H,m,e,t,s);if(Q!==void 0){if(Q)continue;M=!1;break}if(S){if(!Rv(t,function(K,B){if(!xc(S,B)&&(D===K||i(D,K,n,r,s)))return S.push(B)})){M=!1;break}}else if(!(D===H||i(D,H,n,r,s))){M=!1;break}}return s.delete(e),s.delete(t),M}var Uc=Uv;function jv(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var Mv=jv;function Lv(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var jc=Lv,Dv=1,Bv=2,Fv="[object Boolean]",kv="[object Date]",Kv="[object Error]",Gv="[object Map]",Vv="[object Number]",zv="[object RegExp]",Wv="[object Set]",qv="[object String]",Hv="[object Symbol]",Jv="[object ArrayBuffer]",Xv="[object DataView]",wu=jt?jt.prototype:void 0,Co=wu?wu.valueOf:void 0;function Yv(e,t,n,r,i,s,o){switch(n){case Xv:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Jv:return!(e.byteLength!=t.byteLength||!s(new Tu(e),new Tu(t)));case Fv:case kv:case Vv:return ns(+e,+t);case Kv:return e.name==t.name&&e.message==t.message;case zv:case qv:return e==t+"";case Gv:var u=Mv;case Wv:var f=r&Dv;if(u||(u=jc),e.size!=t.size&&!f)return!1;var c=o.get(e);if(c)return c==t;r|=Bv,o.set(e,t);var h=Uc(u(e),u(t),r,i,s,o);return o.delete(e),h;case Hv:if(Co)return Co.call(e)==Co.call(t)}return!1}var Zv=Yv,Qv=1,e_=Object.prototype,t_=e_.hasOwnProperty;function n_(e,t,n,r,i,s){var o=n&Qv,u=yu(e),f=u.length,c=yu(t),h=c.length;if(f!=h&&!o)return!1;for(var m=f;m--;){var M=u[m];if(!(o?M in t:t_.call(t,M)))return!1}var S=s.get(e),D=s.get(t);if(S&&D)return S==t&&D==e;var H=!0;s.set(e,t),s.set(t,e);for(var Q=o;++m<f;){M=u[m];var K=e[M],B=t[M];if(r)var V=o?r(B,K,M,t,e,s):r(K,B,M,e,t,s);if(!(V===void 0?K===B||i(K,B,n,r,s):V)){H=!1;break}Q||(Q=M=="constructor")}if(H&&!Q){var W=e.constructor,F=t.constructor;W!=F&&"constructor"in e&&"constructor"in t&&!(typeof W=="function"&&W instanceof W&&typeof F=="function"&&F instanceof F)&&(H=!1)}return s.delete(e),s.delete(t),H}var r_=n_,i_=1,Ou="[object Arguments]",Au="[object Array]",fi="[object Object]",o_=Object.prototype,Iu=o_.hasOwnProperty;function s_(e,t,n,r,i,s){var o=$t(e),u=$t(t),f=o?Au:_u(e),c=u?Au:_u(t);f=f==Ou?fi:f,c=c==Ou?fi:c;var h=f==fi,m=c==fi,M=f==c;if(M&&Bo(e)){if(!Bo(t))return!1;o=!0,h=!1}if(M&&!h)return s||(s=new li),o||Pc(e)?Uc(e,t,n,r,i,s):Zv(e,t,f,n,r,i,s);if(!(n&i_)){var S=h&&Iu.call(e,"__wrapped__"),D=m&&Iu.call(t,"__wrapped__");if(S||D){var H=S?e.value():e,Q=D?t.value():t;return s||(s=new li),i(H,Q,n,r,s)}}return M?(s||(s=new li),r_(e,t,n,r,i,s)):!1}var a_=s_;function Mc(e,t,n,r,i){return e===t?!0:e==null||t==null||!tn(e)&&!tn(t)?e!==e&&t!==t:a_(e,t,n,r,Mc,i)}var Lc=Mc,u_=1,c_=2;function f_(e,t,n,r){var i=n.length,s=i,o=!r;if(e==null)return!s;for(e=Object(e);i--;){var u=n[i];if(o&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++i<s;){u=n[i];var f=u[0],c=e[f],h=u[1];if(o&&u[2]){if(c===void 0&&!(f in e))return!1}else{var m=new li;if(r)var M=r(c,h,f,e,t,m);if(!(M===void 0?Lc(h,c,u_|c_,r,m):M))return!1}}return!0}var l_=f_;function d_(e){return e===e&&!Gt(e)}var Dc=d_;function p_(e){for(var t=$c(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Dc(i)]}return t}var y_=p_;function h_(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var Bc=h_;function g_(e){var t=y_(e);return t.length==1&&t[0][2]?Bc(t[0][0],t[0][1]):function(n){return n===e||l_(n,e,t)}}var m_=g_;function b_(e,t){return e!=null&&t in Object(e)}var v_=b_;function __(e,t,n){t=Fi(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var o=Nr(t[r]);if(!(s=e!=null&&n(e,o)))break;e=e[o]}return s||++r!=i?s:(i=e==null?0:e.length,!!i&&rs(i)&&ji(o,i)&&($t(e)||is(e)))}var T_=__;function w_(e,t){return e!=null&&T_(e,t,v_)}var Fc=w_,O_=1,A_=2;function I_(e,t){return os(e)&&Dc(t)?Bc(Nr(e),t):function(n){var r=Lb(n,e);return r===void 0&&r===t?Fc(n,e):Lc(t,r,O_|A_)}}var E_=I_;function S_(e){return function(t){return t?.[e]}}var P_=S_;function $_(e){return function(t){return as(t,e)}}var R_=$_;function N_(e){return os(e)?P_(Nr(e)):R_(e)}var C_=N_;function x_(e){return typeof e=="function"?e:e==null?Ui:typeof e=="object"?$t(e)?E_(e[0],e[1]):m_(e):C_(e)}var U_=x_;function j_(e){return tn(e)&&Oc(e)}var M_=j_;function L_(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var D_=L_,B_=200;function F_(e,t,n,r){var i=-1,s=gc,o=!0,u=e.length,f=[],c=t.length;if(!u)return f;n&&(t=oc(t,Ec(n))),r?(s=D_,o=!1):t.length>=B_&&(s=xc,o=!1,t=new Cc(t));e:for(;++i<u;){var h=e[i],m=n==null?h:n(h);if(h=r||h!==0?h:0,o&&m===m){for(var M=c;M--;)if(t[M]===m)continue e;f.push(h)}else s(t,m,r)||f.push(h)}return f}var k_=F_;function K_(e,t,n,r){if(!Gt(e))return e;t=Fi(t,e);for(var i=-1,s=t.length,o=s-1,u=e;u!=null&&++i<s;){var f=Nr(t[i]),c=n;if(f==="__proto__"||f==="constructor"||f==="prototype")return e;if(i!=o){var h=u[f];c=r?r(h,f,u):void 0,c===void 0&&(c=Gt(h)?h:ji(t[i+1])?[]:{})}bg(u,f,c),u=u[f]}return e}var G_=K_;function V_(e,t,n){for(var r=-1,i=t.length,s={};++r<i;){var o=t[r],u=as(e,o);n(u,o)&&G_(s,Fi(o,e),u)}return s}var z_=V_,W_=32,us=wc(function(e,t){var n=Ir(t,ts(us));return lg(e,W_,void 0,t,n)});us.placeholder={};var q_=us;function H_(e,t){return z_(e,t,function(n,r){return Fc(e,r)})}var J_=H_,X_=zb(function(e,t){return e==null?{}:J_(e,t)}),Eu=X_,Y_=4294967295,Z_=Y_-1,Q_=Math.floor,eT=Math.min;function tT(e,t,n,r){var i=0,s=e==null?0:e.length;if(s===0)return 0;t=n(t);for(var o=t!==t,u=t===null,f=Vn(t),c=t===void 0;i<s;){var h=Q_((i+s)/2),m=n(e[h]),M=m!==void 0,S=m===null,D=m===m,H=Vn(m);if(o)var Q=r||D;else c?Q=D&&(r||M):u?Q=D&&M&&(r||!S):f?Q=D&&M&&!S&&(r||!H):S||H?Q=!1:Q=r?m<=t:m<t;Q?i=h+1:s=h}return eT(s,Z_)}var nT=tT;function rT(e,t,n){return nT(e,t,U_(n,2))}var iT=rT,oT=1/0,zO=Gn&&1/jc(new Gn([,-0]))[1]==oT?function(e){return new Gn(e)}:lc;var sT=wc(function(e,t){return M_(e)?k_(e,t):[]}),Su=sT,kc=Xt(Xd(),1),WO=kc.default.configure,Oi=kc.default,xo=100,{WARN:aT,LOG:qO,DEBUG:Le,VERBOSE:be,ERROR:HO}=De.setup(De.INFO),Ai=Pe.set();Pa({enforceActions:"always"});if(!new class{xyz}().hasOwnProperty("xyz"))throw new Error("Transpiler is not configured correctly");var Kc=({caller:e,thread:t,pattern:n,args:r})=>Ne(()=>(r=r||n,`${!Array.isArray(t)&&t?.name?t.name+" | ":""}${e??"caller?"}${r?`{${typeof r=="string"?r:Oi(r)}}`:""}`));function JO(e,t){return Ne(()=>qe.structural(e.get(),t.get()))}function cs(e,t){return qe.shallow(e.applogs,t.applogs)}function XO(e,t){if(e.size!==t.size)return!1;for(let n=0;n<e.size;n++){let r=e.nodes[n],i=t.nodes[n];if(be.isEnabled&&be("queryNodesComparer",n,r,i),!qe.structural(r.variables,i.variables))return be.isEnabled&&be("[queryNodesComparer] changed vars:",n,r,i),!1;if(!cs(r.logsOfThisNode,i.logsOfThisNode))return be.isEnabled&&be("[queryNodesComparer] changed logsOfThisNode:",n,r,i),!1}return be.isEnabled&&be("[queryNodesComparer] equal:",{a:e,b:t}),!0}var uT=0;function YO(e,{name:t,equals:n}={}){let r=`observableArrayMap@${++uT}{${t}}`;be.isEnabled&&be(`[${r}] create`,{fnname:e.name,fn:e,name:t,equals:n});let i,s=Gc(e,u=>{i?Ne(()=>(n??qe.structural)(i,u))?Le.isEnabled&&Le(`[${r}] update skipped`,{updatedItems:u,observableArr:i}):(i.replace(u),Le.isEnabled&&Le(`[${r}] updated`,{updatedItems:u,observableArr:i})):i=Pe.array(u,{deep:!1,name:t,equals:n})},{name:r});if(r.includes("useRoots")){var o=pt(i);Le(`[${r}] deps`,{disposeAutorun:s,rootsAtom:o,observableArr:i,observers:yr(i)}),Dn(()=>Ai.add(o))}return be.isEnabled&&ci(i,()=>{be(`[${r}] observed`,yr(i),{rootsAtom:o,observableArr:i})}),hn(i,()=>{be.isEnabled&&be(`[${r}] dispose`),o&&Dn(()=>Ai.delete(o)),s()}),i}var cT=0;function ZO(e,{name:t}={}){let n=`observableSetMap@${++cT}{${t}}`;be.isEnabled&&be(`[${n}] create`,{fnname:e.name,fn:e,name:t});let r,i=Gc(e,o=>{if(!r)r=Pe.set(o,{deep:!1,name:t});else{let{deleted:u,added:f}=Ne(()=>{let c=new Set(r.values()),h=new Set;for(let m of o)r.has(m)?(be.isEnabled&&be(`[${n}] unchanged`,m,{updatedItems:o,observableSet:r}),c.delete(m)):h.add(m);return Le.isEnabled&&Le(`[${n}] updated:`,{unseen:c,added:h,updatedItems:o,observableSet:r}),{added:h,deleted:c}});for(let c of u)r.delete(c);for(let c of f)r.add(c)}},{name:n});if(n.includes("useRoots")){var s=pt(r);Le.isEnabled&&Le(`[${n}] deps`,{disposeAutorun:i,rootsAtom:s,observableSet:r,observers:yr(r)}),Dn(()=>Ai.add(s))}return be.isEnabled&&ci(r,()=>{be(`[${n}] observed`,yr(r),{rootsAtom:s,observableSet:r})}),hn(r,()=>{be.isEnabled&&be(`[${n}] dispose`),s&&Dn(()=>Ai.delete(s)),i()}),r}function Gc(e,t=null,{name:n}={}){Le.isEnabled&&Le("[autorunButAlsoImmediately] create",{fnname:e.name,fn:e,name:n});let r=`${n}.autorunImm`,i,s=new It(r,function(...c){Le.isEnabled&&Le(`[${r}] reaction.invalidate`,c),o()});function o(){s.track(function(){let c=xo&&performance.now();Le.isEnabled&&Le(`[${r}] runAndTrack:`,{name:n??e.name,fn:e}),i=e(),Le.isEnabled&&Le(`[${r}] runAndTrack =>`,i),Dn(()=>{t?.(i)}),xo&&performance.now()-c>xo&&aT(`[${r}] took ${performance.now()-c}ms`)})}return o(),Le.isEnabled&&Le(`[${r}] deps of reaction`,{reaction:s,result:i,deps:pr(s)}),()=>{be.isEnabled&&be(`[${r}] dispose`),setTimeout(()=>s.dispose())}}function fs(e,t,n=!1){if(qt(t))throw new Error("computedFnDeepCompare shouldn't be used on actions");let r=!1,i=0,s=typeof n=="boolean"?{keepAlive:n}:n,o=new Map;return function(...u){let f,c=Ne(()=>{let S=u;for(let D=0;D<u.length;D++)u[D]instanceof zn&&u===S&&(S=u.slice());return S}),h=`computedFnDeepCompare(${e||t.name}#${++i})${s.argsDebugName?`{${s.argsDebugName(...u)}}`:""}`;for(let[S,D]of o.entries())if(lT(S,c)){f=D;break}else if(be.isEnabled)for(let H=0;H<S.length;H++)S[H]instanceof zn&&S[H].name===u[H].name&&qe.structural(Su(S,S[H]),Su(c,c[H]))&&be.force(`[${h}] threadState mismatch => cachebust`,{diffFields:Object.keys(S[H]).filter(Q=>!qe.structural(S[H][Q],u[H][Q])),cacheArg:S[H],freshArg:u[H]});if(f){let S=f.get();return be.isEnabled&&be(`[${h}] cache hit`,{untrackedArgs:c,cachedResult:S}),S}if(!s.keepAlive&&!fa())return!r&&ya().computedRequiresReaction&&(console.warn("invoking a computedFn from outside an reactive context won't be memoized, unless keepAlive is set"),r=!0),t.apply(this,u);be.isEnabled&&be(`[${h}] new computation`,{untrackedArgs:c});let m,M=ht(()=>(be.isEnabled&&be(`[${h}] update->rerun`,Ne(()=>({args:u})),t),be.isEnabled&&mo(),m=t.apply(this,u)),{...s,name:h});if(be.isEnabled&&be(`[${h}] deps`,pr(M),{untrackedArgs:c}),o.set(c,M),!s.keepAlive){let S=hn(M,()=>{be.isEnabled&&be(`[${h}] dispose`,M),S(),o.delete(c),s.onCleanup&&s.onCleanup(m,...u),m=void 0})}return M.get()}}function fT(e){let t=0,n="",r=0;for(let i=0;i<e.length;i++){let s=e[i];s==="("?n+=s+`
57
+ `+" ".repeat(++t):s===")"?n+=`
58
+ `+" ".repeat(--t)+s:s===","&&r===0?n+=s+`
59
+ `+" ".repeat(t):s==="{"&&r===0?(r++,n+=s+`
60
+ `+" ".repeat(t+1)):s==="}"&&r===1?(r--,n+=`
61
+ `+" ".repeat(t)+s):s==="{"&&r>0?(r++,n+=s):(s==="}"&&r>1&&r--,n+=s)}return n}function lT(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]instanceof zn){if(t[n]!==e[n])return!1}else if(!qe.structural(e[n],t[n]))return!1;return!0}var{WARN:Pu,LOG:QO,DEBUG:dT,VERBOSE:eA,ERROR:mn}=De.setup(De.INFO,{prefix:"[thread]"});function Pr(e){return e.init!==void 0}var zn=class{constructor(e,t,n,r=[],i={}){this.name=e,this._applogs=r,this.parents=t===null?null:Fa(t),this.filters=n,Ne(()=>this.parents?.length===0)&&Pu("[Thread] empty parents array",e),i.skipObservable||mr(this,{applogsCids:ht,applogsByCid:ht,insert:ct,size:ht,isEmpty:ht,firstLog:ht,latestLog:ht},{name:`Thread{${e}}`})}filters;parents;_subscribers=[];get readOnly(){return this.parents.length!==1?!0:this.parents[0].readOnly}insert(e){if(this.readOnly)throw mn("[Thread] insert() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw mn("[Thread] insert() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw mn("[Thread] insert() called on thread with multiple parents:",this.nameAndSizeUntracked);return this.parents[0].insert(e)}insertRaw(e){if(this.readOnly)throw mn("[Thread] insertRaw() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw mn("[Thread] insertRaw() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw mn("[Thread] insertRaw() called on thread with multiple parents:",this.nameAndSizeUntracked);return this.parents[0].insertRaw(e)}subscribe(e){return this._subscribers.push(e),this.unsubscribe.bind(this,e)}unsubscribe(e){let t=this._subscribers.indexOf(e);t!==-1?this._subscribers.splice(t,1):Pu("unsubscribe called for non-existent",e)}notifySubscribers(e){dT(`[thread: ${this.name}] notifying`,this._subscribers.length,"subscribers of",{...e,subs:this._subscribers});for(let t of this._subscribers)t(e)}get applogs(){return this._applogs}get applogsCids(){return this._applogs.map(e=>e.cid)}map(e){return this.applogs.map(e)}get findLast(){return this.applogs.findLast.bind(this.applogs)}get findFirst(){return this.applogs.find.bind(this.applogs)}get firstLog(){return this.applogs[0]}get latestLog(){return this.applogs[this.applogs.length-1]}hasApplog(e,t){if(t)return this.applogs.includes(e);if(!e.cid)throw mn("[hasApplogs] applog without CID:",e);return this.hasApplogCid(e.cid)}hasApplogCid(e){return this.applogsCids.includes(e.toString())}get applogsByCid(){return new Map(this.applogs.map(e=>[e.cid,e]))}getApplog(e){return this.applogsByCid.get(e.toString())}hasApplogWithDiffTs(e){return this.applogs.find(t=>t.en===e.en&&t.at===e.at&&t.vl===e.vl&&t.ag===e.ag)}get isEmpty(){return this.size===0}get size(){return this.applogs.length}get length(){return this.applogs.length}get untrackedSize(){return Ne(()=>this.size)}get nameAndSizeUntracked(){return Ne(()=>`${this.name} (${this.size})`)}get prettyName(){return fT(this.name)}get hasParents(){return!!this.parents?.length}};var tA=class Vc extends zn{static fromArray(t,n){return new Vc(n||"static",null,[],t)}constructor(t,n,r,i){super(t,n,r,i,{skipObservable:!0})}get readOnly(){return!0}},pT={};Ao(pT,{code:()=>lf,decode:()=>df,encode:()=>Is,format:()=>Bu,name:()=>A0,parse:()=>E0,stringify:()=>Bu});var yT=["string","number","bigint","symbol"],hT=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function gT(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(yT.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(mT(e))return"Buffer";let n=bT(e);return n||"Object"}function mT(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function bT(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(hT.includes(t))return t}var U=class{constructor(e,t,n){this.major=e,this.majorEncoded=e<<5,this.name=t,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}};U.uint=new U(0,"uint",!0);U.negint=new U(1,"negint",!0);U.bytes=new U(2,"bytes",!0);U.string=new U(3,"string",!0);U.array=new U(4,"array",!1);U.map=new U(5,"map",!1);U.tag=new U(6,"tag",!1);U.float=new U(7,"float",!0);U.false=new U(7,"false",!0);U.true=new U(7,"true",!0);U.null=new U(7,"null",!0);U.undefined=new U(7,"undefined",!0);U.break=new U(7,"break",!0);var re=class{constructor(e,t,n){this.type=e,this.value=t,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}},Zn=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",vT=new TextDecoder,_T=new TextEncoder;function Ii(e){return Zn&&globalThis.Buffer.isBuffer(e)}function ls(e){return e instanceof Uint8Array?Ii(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var TT=Zn?((e,t,n)=>n-t>64?globalThis.Buffer.from(e.subarray(t,n)).toString("utf8"):Ru(e,t,n)):((e,t,n)=>n-t>64?vT.decode(e.subarray(t,n)):Ru(e,t,n)),zc=Zn?(e=>e.length>64?globalThis.Buffer.from(e):$u(e)):(e=>e.length>64?_T.encode(e):$u(e)),ds=Zn?((e,t,n)=>Ii(e)?new Uint8Array(e.subarray(t,n)):e.slice(t,n)):((e,t,n)=>e.slice(t,n)),wT=Zn?((e,t)=>(e=e.map(n=>n instanceof Uint8Array?n:globalThis.Buffer.from(n)),ls(globalThis.Buffer.concat(e,t)))):((e,t)=>{let n=new Uint8Array(t),r=0;for(let i of e)r+i.length>n.length&&(i=i.subarray(0,n.length-r)),n.set(i,r),r+=i.length;return n}),OT=Zn?(e=>globalThis.Buffer.allocUnsafe(e)):(e=>new Uint8Array(e));function AT(e,t){if(Ii(e)&&Ii(t))return e.compare(t);for(let n=0;n<e.length;n++)if(e[n]!==t[n])return e[n]<t[n]?-1:1;return 0}function $u(e){let t=[],n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)===55296&&r+1<e.length&&(e.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++r)&1023),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128)}return t}function Ru(e,t,n){let r=[];for(;t<n;){let i=e[t],s=null,o=i>239?4:i>223?3:i>191?2:1;if(t+o<=n){let u,f,c,h;switch(o){case 1:i<128&&(s=i);break;case 2:u=e[t+1],(u&192)===128&&(h=(i&31)<<6|u&63,h>127&&(s=h));break;case 3:u=e[t+1],f=e[t+2],(u&192)===128&&(f&192)===128&&(h=(i&15)<<12|(u&63)<<6|f&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:u=e[t+1],f=e[t+2],c=e[t+3],(u&192)===128&&(f&192)===128&&(c&192)===128&&(h=(i&15)<<18|(u&63)<<12|(f&63)<<6|c&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,o=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|s&1023),r.push(s),t+=o}return Wc(r)}var Nu=4096;function Wc(e){let t=e.length;if(t<=Nu)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=Nu));return n}var IT=256,qc=class{constructor(e=IT){this.chunkSize=e,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),this._initReuseChunk!==null&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}push(e){let t=this.chunks[this.chunks.length-1];if(this.cursor+e.length<=this.maxCursor+1){let r=t.length-(this.maxCursor-this.cursor)-1;t.set(e,r)}else{if(t){let r=t.length-(this.maxCursor-this.cursor)-1;r<t.length&&(this.chunks[this.chunks.length-1]=t.subarray(0,r),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(t=OT(this.chunkSize),this.chunks.push(t),this.maxCursor+=t.length,this._initReuseChunk===null&&(this._initReuseChunk=t),t.set(e,0)):(this.chunks.push(e),this.maxCursor+=e.length)}this.cursor+=e.length}toBytes(e=!1){let t;if(this.chunks.length===1){let n=this.chunks[0];e&&this.cursor>n.length/2?(t=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):t=ds(n,0,this.cursor)}else t=wT(this.chunks,this.cursor);return e&&this.reset(),t}},de="CBOR decode error:",_n="CBOR encode error:",Cr=[];Cr[23]=1;Cr[24]=2;Cr[25]=3;Cr[26]=5;Cr[27]=9;function Qn(e,t,n){if(e.length-t<n)throw new Error(`${de} not enough data for type`)}var Ke=[24,256,65536,4294967296,BigInt("18446744073709551616")];function On(e,t,n){Qn(e,t,1);let r=e[t];if(n.strict===!0&&r<Ke[0])throw new Error(`${de} integer encoded in more bytes than necessary (strict decode)`);return r}function An(e,t,n){Qn(e,t,2);let r=e[t]<<8|e[t+1];if(n.strict===!0&&r<Ke[1])throw new Error(`${de} integer encoded in more bytes than necessary (strict decode)`);return r}function In(e,t,n){Qn(e,t,4);let r=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(n.strict===!0&&r<Ke[2])throw new Error(`${de} integer encoded in more bytes than necessary (strict decode)`);return r}function En(e,t,n){Qn(e,t,8);let r=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],i=e[t+4]*16777216+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],s=(BigInt(r)<<BigInt(32))+BigInt(i);if(n.strict===!0&&s<Ke[3])throw new Error(`${de} integer encoded in more bytes than necessary (strict decode)`);if(s<=Number.MAX_SAFE_INTEGER)return Number(s);if(n.allowBigInt===!0)return s;throw new Error(`${de} integers outside of the safe integer range are not supported`)}function ET(e,t,n,r){return new re(U.uint,On(e,t+1,r),2)}function ST(e,t,n,r){return new re(U.uint,An(e,t+1,r),3)}function PT(e,t,n,r){return new re(U.uint,In(e,t+1,r),5)}function $T(e,t,n,r){return new re(U.uint,En(e,t+1,r),9)}function Sn(e,t){return bt(e,0,t.value)}function bt(e,t,n){if(n<Ke[0]){let r=Number(n);e.push([t|r])}else if(n<Ke[1]){let r=Number(n);e.push([t|24,r])}else if(n<Ke[2]){let r=Number(n);e.push([t|25,r>>>8,r&255])}else if(n<Ke[3]){let r=Number(n);e.push([t|26,r>>>24&255,r>>>16&255,r>>>8&255,r&255])}else{let r=BigInt(n);if(r<Ke[4]){let i=[t|27,0,0,0,0,0,0,0],s=Number(r&BigInt(4294967295)),o=Number(r>>BigInt(32)&BigInt(4294967295));i[8]=s&255,s=s>>8,i[7]=s&255,s=s>>8,i[6]=s&255,s=s>>8,i[5]=s&255,i[4]=o&255,o=o>>8,i[3]=o&255,o=o>>8,i[2]=o&255,o=o>>8,i[1]=o&255,e.push(i)}else throw new Error(`${de} encountered BigInt larger than allowable range`)}}Sn.encodedSize=function(t){return bt.encodedSize(t.value)};bt.encodedSize=function(t){return t<Ke[0]?1:t<Ke[1]?2:t<Ke[2]?3:t<Ke[3]?5:9};Sn.compareTokens=function(t,n){return t.value<n.value?-1:t.value>n.value?1:0};function RT(e,t,n,r){return new re(U.negint,-1-On(e,t+1,r),2)}function NT(e,t,n,r){return new re(U.negint,-1-An(e,t+1,r),3)}function CT(e,t,n,r){return new re(U.negint,-1-In(e,t+1,r),5)}var ps=BigInt(-1),Hc=BigInt(1);function xT(e,t,n,r){let i=En(e,t+1,r);if(typeof i!="bigint"){let s=-1-i;if(s>=Number.MIN_SAFE_INTEGER)return new re(U.negint,s,9)}if(r.allowBigInt!==!0)throw new Error(`${de} integers outside of the safe integer range are not supported`);return new re(U.negint,ps-BigInt(i),9)}function ys(e,t){let n=t.value,r=typeof n=="bigint"?n*ps-Hc:n*-1-1;bt(e,t.type.majorEncoded,r)}ys.encodedSize=function(t){let n=t.value,r=typeof n=="bigint"?n*ps-Hc:n*-1-1;return r<Ke[0]?1:r<Ke[1]?2:r<Ke[2]?3:r<Ke[3]?5:9};ys.compareTokens=function(t,n){return t.value<n.value?1:t.value>n.value?-1:0};function xr(e,t,n,r){Qn(e,t,n+r);let i=ds(e,t+n,t+n+r);return new re(U.bytes,i,n+r)}function UT(e,t,n,r){return xr(e,t,1,n)}function jT(e,t,n,r){return xr(e,t,2,On(e,t+1,r))}function MT(e,t,n,r){return xr(e,t,3,An(e,t+1,r))}function LT(e,t,n,r){return xr(e,t,5,In(e,t+1,r))}function DT(e,t,n,r){let i=En(e,t+1,r);if(typeof i=="bigint")throw new Error(`${de} 64-bit integer bytes lengths not supported`);return xr(e,t,9,i)}function Ei(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===U.string?zc(e.value):e.value),e.encodedBytes}function ki(e,t){let n=Ei(t);bt(e,t.type.majorEncoded,n.length),e.push(n)}ki.encodedSize=function(t){let n=Ei(t);return bt.encodedSize(n.length)+n.length};ki.compareTokens=function(t,n){return BT(Ei(t),Ei(n))};function BT(e,t){return e.length<t.length?-1:e.length>t.length?1:AT(e,t)}function Ur(e,t,n,r,i){let s=n+r;Qn(e,t,s);let o=new re(U.string,TT(e,t+n,t+s),s);return i.retainStringBytes===!0&&(o.byteValue=ds(e,t+n,t+s)),o}function FT(e,t,n,r){return Ur(e,t,1,n,r)}function kT(e,t,n,r){return Ur(e,t,2,On(e,t+1,r),r)}function KT(e,t,n,r){return Ur(e,t,3,An(e,t+1,r),r)}function GT(e,t,n,r){return Ur(e,t,5,In(e,t+1,r),r)}function VT(e,t,n,r){let i=En(e,t+1,r);if(typeof i=="bigint")throw new Error(`${de} 64-bit integer string lengths not supported`);return Ur(e,t,9,i,r)}var zT=ki;function er(e,t,n,r){return new re(U.array,r,n)}function WT(e,t,n,r){return er(e,t,1,n)}function qT(e,t,n,r){return er(e,t,2,On(e,t+1,r))}function HT(e,t,n,r){return er(e,t,3,An(e,t+1,r))}function JT(e,t,n,r){return er(e,t,5,In(e,t+1,r))}function XT(e,t,n,r){let i=En(e,t+1,r);if(typeof i=="bigint")throw new Error(`${de} 64-bit integer array lengths not supported`);return er(e,t,9,i)}function YT(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${de} indefinite length items not allowed`);return er(e,t,1,1/0)}function hs(e,t){bt(e,U.array.majorEncoded,t.value)}hs.compareTokens=Sn.compareTokens;hs.encodedSize=function(t){return bt.encodedSize(t.value)};function tr(e,t,n,r){return new re(U.map,r,n)}function ZT(e,t,n,r){return tr(e,t,1,n)}function QT(e,t,n,r){return tr(e,t,2,On(e,t+1,r))}function ew(e,t,n,r){return tr(e,t,3,An(e,t+1,r))}function tw(e,t,n,r){return tr(e,t,5,In(e,t+1,r))}function nw(e,t,n,r){let i=En(e,t+1,r);if(typeof i=="bigint")throw new Error(`${de} 64-bit integer map lengths not supported`);return tr(e,t,9,i)}function rw(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${de} indefinite length items not allowed`);return tr(e,t,1,1/0)}function gs(e,t){bt(e,U.map.majorEncoded,t.value)}gs.compareTokens=Sn.compareTokens;gs.encodedSize=function(t){return bt.encodedSize(t.value)};function iw(e,t,n,r){return new re(U.tag,n,1)}function ow(e,t,n,r){return new re(U.tag,On(e,t+1,r),2)}function sw(e,t,n,r){return new re(U.tag,An(e,t+1,r),3)}function aw(e,t,n,r){return new re(U.tag,In(e,t+1,r),5)}function uw(e,t,n,r){return new re(U.tag,En(e,t+1,r),9)}function ms(e,t){bt(e,U.tag.majorEncoded,t.value)}ms.compareTokens=Sn.compareTokens;ms.encodedSize=function(t){return bt.encodedSize(t.value)};var cw=20,fw=21,lw=22,dw=23;function pw(e,t,n,r){if(r.allowUndefined===!1)throw new Error(`${de} undefined values are not supported`);return r.coerceUndefinedToNull===!0?new re(U.null,null,1):new re(U.undefined,void 0,1)}function yw(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${de} indefinite length items not allowed`);return new re(U.break,void 0,1)}function bs(e,t,n){if(n){if(n.allowNaN===!1&&Number.isNaN(e))throw new Error(`${de} NaN values are not supported`);if(n.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${de} Infinity values are not supported`)}return new re(U.float,e,t)}function hw(e,t,n,r){return bs(_s(e,t+1),3,r)}function gw(e,t,n,r){return bs(Ts(e,t+1),5,r)}function mw(e,t,n,r){return bs(Zc(e,t+1),9,r)}function vs(e,t,n){let r=t.value;if(r===!1)e.push([U.float.majorEncoded|cw]);else if(r===!0)e.push([U.float.majorEncoded|fw]);else if(r===null)e.push([U.float.majorEncoded|lw]);else if(r===void 0)e.push([U.float.majorEncoded|dw]);else{let i,s=!1;(!n||n.float64!==!0)&&(Xc(r),i=_s(Pt,1),r===i||Number.isNaN(r)?(Pt[0]=249,e.push(Pt.slice(0,3)),s=!0):(Yc(r),i=Ts(Pt,1),r===i&&(Pt[0]=250,e.push(Pt.slice(0,5)),s=!0))),s||(bw(r),i=Zc(Pt,1),Pt[0]=251,e.push(Pt.slice(0,9)))}}vs.encodedSize=function(t,n){let r=t.value;if(r===!1||r===!0||r===null||r===void 0)return 1;if(!n||n.float64!==!0){Xc(r);let i=_s(Pt,1);if(r===i||Number.isNaN(r))return 3;if(Yc(r),i=Ts(Pt,1),r===i)return 5}return 9};var Jc=new ArrayBuffer(9),gt=new DataView(Jc,1),Pt=new Uint8Array(Jc,0);function Xc(e){if(e===1/0)gt.setUint16(0,31744,!1);else if(e===-1/0)gt.setUint16(0,64512,!1);else if(Number.isNaN(e))gt.setUint16(0,32256,!1);else{gt.setFloat32(0,e);let t=gt.getUint32(0),n=(t&2139095040)>>23,r=t&8388607;if(n===255)gt.setUint16(0,31744,!1);else if(n===0)gt.setUint16(0,(e&2147483648)>>16|r>>13,!1);else{let i=n-127;i<-24?gt.setUint16(0,0):i<-14?gt.setUint16(0,(t&2147483648)>>16|1<<24+i,!1):gt.setUint16(0,(t&2147483648)>>16|i+15<<10|r>>13,!1)}}}function _s(e,t){if(e.length-t<2)throw new Error(`${de} not enough data for float16`);let n=(e[t]<<8)+e[t+1];if(n===31744)return 1/0;if(n===64512)return-1/0;if(n===32256)return NaN;let r=n>>10&31,i=n&1023,s;return r===0?s=i*2**-24:r!==31?s=(i+1024)*2**(r-25):s=i===0?1/0:NaN,n&32768?-s:s}function Yc(e){gt.setFloat32(0,e,!1)}function Ts(e,t){if(e.length-t<4)throw new Error(`${de} not enough data for float32`);let n=(e.byteOffset||0)+t;return new DataView(e.buffer,n,4).getFloat32(0,!1)}function bw(e){gt.setFloat64(0,e,!1)}function Zc(e,t){if(e.length-t<8)throw new Error(`${de} not enough data for float64`);let n=(e.byteOffset||0)+t;return new DataView(e.buffer,n,8).getFloat64(0,!1)}vs.compareTokens=Sn.compareTokens;function Te(e,t,n){throw new Error(`${de} encountered invalid minor (${n}) for major ${e[t]>>>5}`)}function Ki(e){return()=>{throw new Error(`${de} ${e}`)}}var oe=[];for(let e=0;e<=23;e++)oe[e]=Te;oe[24]=ET;oe[25]=ST;oe[26]=PT;oe[27]=$T;oe[28]=Te;oe[29]=Te;oe[30]=Te;oe[31]=Te;for(let e=32;e<=55;e++)oe[e]=Te;oe[56]=RT;oe[57]=NT;oe[58]=CT;oe[59]=xT;oe[60]=Te;oe[61]=Te;oe[62]=Te;oe[63]=Te;for(let e=64;e<=87;e++)oe[e]=UT;oe[88]=jT;oe[89]=MT;oe[90]=LT;oe[91]=DT;oe[92]=Te;oe[93]=Te;oe[94]=Te;oe[95]=Ki("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)oe[e]=FT;oe[120]=kT;oe[121]=KT;oe[122]=GT;oe[123]=VT;oe[124]=Te;oe[125]=Te;oe[126]=Te;oe[127]=Ki("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)oe[e]=WT;oe[152]=qT;oe[153]=HT;oe[154]=JT;oe[155]=XT;oe[156]=Te;oe[157]=Te;oe[158]=Te;oe[159]=YT;for(let e=160;e<=183;e++)oe[e]=ZT;oe[184]=QT;oe[185]=ew;oe[186]=tw;oe[187]=nw;oe[188]=Te;oe[189]=Te;oe[190]=Te;oe[191]=rw;for(let e=192;e<=215;e++)oe[e]=iw;oe[216]=ow;oe[217]=sw;oe[218]=aw;oe[219]=uw;oe[220]=Te;oe[221]=Te;oe[222]=Te;oe[223]=Te;for(let e=224;e<=243;e++)oe[e]=Ki("simple values are not supported");oe[244]=Te;oe[245]=Te;oe[246]=Te;oe[247]=pw;oe[248]=Ki("simple values are not supported");oe[249]=hw;oe[250]=gw;oe[251]=mw;oe[252]=Te;oe[253]=Te;oe[254]=Te;oe[255]=yw;var Mt=[];for(let e=0;e<24;e++)Mt[e]=new re(U.uint,e,1);for(let e=-1;e>=-24;e--)Mt[31-e]=new re(U.negint,e,1);Mt[64]=new re(U.bytes,new Uint8Array(0),1);Mt[96]=new re(U.string,"",1);Mt[128]=new re(U.array,0,1);Mt[160]=new re(U.map,0,1);Mt[244]=new re(U.false,!1,1);Mt[245]=new re(U.true,!0,1);Mt[246]=new re(U.null,null,1);function vw(){let e=[];return e[U.uint.major]=Sn,e[U.negint.major]=ys,e[U.bytes.major]=ki,e[U.string.major]=zT,e[U.array.major]=hs,e[U.map.major]=gs,e[U.tag.major]=ms,e[U.float.major]=vs,e}var nA=vw(),Uo=new qc,Cu=class Qc{constructor(t,n){this.obj=t,this.parent=n}includes(t){let n=this;do if(n.obj===t)return!0;while(n=n.parent);return!1}static createCheck(t,n){if(t&&t.includes(n))throw new Error(`${_n} object contains circular references`);return new Qc(n,t)}},Yt={null:new re(U.null,null),undefined:new re(U.undefined,void 0),true:new re(U.true,!0),false:new re(U.false,!1),emptyArray:new re(U.array,0),emptyMap:new re(U.map,0)},nn={number(e,t,n,r){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new re(U.float,e):e>=0?new re(U.uint,e):new re(U.negint,e)},bigint(e,t,n,r){return e>=BigInt(0)?new re(U.uint,e):new re(U.negint,e)},Uint8Array(e,t,n,r){return new re(U.bytes,e)},string(e,t,n,r){return new re(U.string,e)},boolean(e,t,n,r){return e?Yt.true:Yt.false},null(e,t,n,r){return Yt.null},undefined(e,t,n,r){return Yt.undefined},ArrayBuffer(e,t,n,r){return new re(U.bytes,new Uint8Array(e))},DataView(e,t,n,r){return new re(U.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,n,r){if(!e.length)return n.addBreakTokens===!0?[Yt.emptyArray,new re(U.break)]:Yt.emptyArray;r=Cu.createCheck(r,e);let i=[],s=0;for(let o of e)i[s++]=di(o,n,r);return n.addBreakTokens?[new re(U.array,e.length),i,new re(U.break)]:[new re(U.array,e.length),i]},Object(e,t,n,r){let i=t!=="Object",s=i?e.keys():Object.keys(e),o=i?e.size:s.length;if(!o)return n.addBreakTokens===!0?[Yt.emptyMap,new re(U.break)]:Yt.emptyMap;r=Cu.createCheck(r,e);let u=[],f=0;for(let c of s)u[f++]=[di(c,n,r),di(i?e.get(c):e[c],n,r)];return _w(u,n),n.addBreakTokens?[new re(U.map,o),u,new re(U.break)]:[new re(U.map,o),u]}};nn.Map=nn.Object;nn.Buffer=nn.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))nn[`${e}Array`]=nn.DataView;function di(e,t={},n){let r=gT(e),i=t&&t.typeEncoders&&t.typeEncoders[r]||nn[r];if(typeof i=="function"){let o=i(e,r,t,n);if(o!=null)return o}let s=nn[r];if(!s)throw new Error(`${_n} unsupported type: ${r}`);return s(e,r,t,n)}function _w(e,t){t.mapSorter&&e.sort(t.mapSorter)}function ef(e,t,n,r){if(Array.isArray(t))for(let i of t)ef(e,i,n,r);else n[t.type.major](e,t,r)}function Tw(e,t,n){let r=di(e,n);if(!Array.isArray(r)&&n.quickEncodeToken){let i=n.quickEncodeToken(r);if(i)return i;let s=t[r.type.major];if(s.encodedSize){let o=s.encodedSize(r,n),u=new qc(o);if(s(u,r,n),u.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${r} was wrong`);return ls(u.chunks[0])}}return Uo.reset(),ef(Uo,r,t,n),Uo.toBytes(!0)}var ww={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Ow=class{constructor(e,t={}){this._pos=0,this.data=e,this.options=t}pos(){return this._pos}done(){return this._pos>=this.data.length}next(){let e=this.data[this._pos],t=Mt[e];if(t===void 0){let n=oe[e];if(!n)throw new Error(`${de} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);let r=e&31;t=n(this.data,this._pos,r,this.options)}return this._pos+=t.encodedLength,t}},$r=Symbol.for("DONE"),Gi=Symbol.for("BREAK");function Aw(e,t,n){let r=[];for(let i=0;i<e.value;i++){let s=Rr(t,n);if(s===Gi){if(e.value===1/0)break;throw new Error(`${de} got unexpected break to lengthed array`)}if(s===$r)throw new Error(`${de} found array but not enough entries (got ${i}, expected ${e.value})`);r[i]=s}return r}function Iw(e,t,n){let r=n.useMaps===!0,i=r?void 0:{},s=r?new Map:void 0;for(let o=0;o<e.value;o++){let u=Rr(t,n);if(u===Gi){if(e.value===1/0)break;throw new Error(`${de} got unexpected break to lengthed map`)}if(u===$r)throw new Error(`${de} found map but not enough entries (got ${o} [no key], expected ${e.value})`);if(r!==!0&&typeof u!="string")throw new Error(`${de} non-string keys not supported (got ${typeof u})`);if(n.rejectDuplicateMapKeys===!0&&(r&&s.has(u)||!r&&u in i))throw new Error(`${de} found repeat map key "${u}"`);let f=Rr(t,n);if(f===$r)throw new Error(`${de} found map but not enough entries (got ${o} [no value], expected ${e.value})`);r?s.set(u,f):i[u]=f}return r?s:i}function Rr(e,t){if(e.done())return $r;let n=e.next();if(n.type===U.break)return Gi;if(n.type.terminal)return n.value;if(n.type===U.array)return Aw(n,e,t);if(n.type===U.map)return Iw(n,e,t);if(n.type===U.tag){if(t.tags&&typeof t.tags[n.value]=="function"){let r=Rr(e,t);return t.tags[n.value](r)}throw new Error(`${de} tag not supported (${n.value})`)}throw new Error("unsupported")}function Ew(e,t){if(!(e instanceof Uint8Array))throw new Error(`${de} data to decode must be a Uint8Array`);t=Object.assign({},ww,t);let n=t.tokenizer||new Ow(e,t),r=Rr(n,t);if(r===$r)throw new Error(`${de} did not find any content to decode`);if(r===Gi)throw new Error(`${de} got unexpected break`);return[r,e.subarray(n.pos())]}function Sw(e,t){let[n,r]=Ew(e,t);if(r.length>0)throw new Error(`${de} too many terminals, data makes no sense`);return n}var Pw=class extends Array{constructor(){super(),this.inRecursive=[]}prefix(e){let t=this.inRecursive[this.inRecursive.length-1];t&&(t.type===U.array&&(t.elements++,t.elements!==1&&e.push([44])),t.type===U.map&&(t.elements++,t.elements!==1&&(t.elements%2===1?e.push([44]):e.push([58]))))}[U.uint.major](e,t){this.prefix(e);let n=String(t.value),r=[];for(let i=0;i<n.length;i++)r[i]=n.charCodeAt(i);e.push(r)}[U.negint.major](e,t){this[U.uint.major](e,t)}[U.bytes.major](e,t){throw new Error(`${_n} unsupported type: Uint8Array`)}[U.string.major](e,t){this.prefix(e);let n=zc(JSON.stringify(t.value));e.push(n.length>32?ls(n):n)}[U.array.major](e,t){this.prefix(e),this.inRecursive.push({type:U.array,elements:0}),e.push([91])}[U.map.major](e,t){this.prefix(e),this.inRecursive.push({type:U.map,elements:0}),e.push([123])}[U.tag.major](e,t){}[U.float.major](e,t){if(t.type.name==="break"){let s=this.inRecursive.pop();if(s){if(s.type===U.array)e.push([93]);else if(s.type===U.map)e.push([125]);else throw new Error("Unexpected recursive type; this should not happen!");return}throw new Error("Unexpected break; this should not happen!")}if(t.value===void 0)throw new Error(`${_n} unsupported type: undefined`);if(this.prefix(e),t.type.name==="true"){e.push([116,114,117,101]);return}else if(t.type.name==="false"){e.push([102,97,108,115,101]);return}else if(t.type.name==="null"){e.push([110,117,108,108]);return}let n=String(t.value),r=[],i=!1;for(let s=0;s<n.length;s++)r[s]=n.charCodeAt(s),!i&&(r[s]===46||r[s]===101||r[s]===69)&&(i=!0);i||(r.push(46),r.push(48)),e.push(r)}};function $w(e,t){if(Array.isArray(e[0])||Array.isArray(t[0]))throw new Error(`${_n} complex map keys are not supported`);let n=e[0],r=t[0];if(n.type!==U.string||r.type!==U.string)throw new Error(`${_n} non-string map keys are not supported`);if(n<r)return-1;if(n>r)return 1;throw new Error(`${_n} unexpected duplicate map keys, this is not supported`)}var Rw={addBreakTokens:!0,mapSorter:$w};function Nw(e,t){return t=Object.assign({},Rw,t),Tw(e,new Pw,t)}var tf=class{constructor(e,t={}){this._pos=0,this.data=e,this.options=t,this.modeStack=["value"],this.lastToken=""}pos(){return this._pos}done(){return this._pos>=this.data.length}ch(){return this.data[this._pos]}currentMode(){return this.modeStack[this.modeStack.length-1]}skipWhitespace(){let e=this.ch();for(;e===32||e===9||e===13||e===10;)e=this.data[++this._pos]}expect(e){if(this.data.length-this._pos<e.length)throw new Error(`${de} unexpected end of input at position ${this._pos}`);for(let t=0;t<e.length;t++)if(this.data[this._pos++]!==e[t])throw new Error(`${de} unexpected token at position ${this._pos}, expected to find '${String.fromCharCode(...e)}'`)}parseNumber(){let e=this._pos,t=!1,n=!1,r=o=>{for(;!this.done();){let u=this.ch();if(o.includes(u))this._pos++;else break}};if(this.ch()===45&&(t=!0,this._pos++),this.ch()===48)if(this._pos++,this.ch()===46)this._pos++,n=!0;else return new re(U.uint,0,this._pos-e);if(r([48,49,50,51,52,53,54,55,56,57]),t&&this._pos===e+1)throw new Error(`${de} unexpected token at position ${this._pos}`);if(!this.done()&&this.ch()===46){if(n)throw new Error(`${de} unexpected token at position ${this._pos}`);n=!0,this._pos++,r([48,49,50,51,52,53,54,55,56,57])}!this.done()&&(this.ch()===101||this.ch()===69)&&(n=!0,this._pos++,!this.done()&&(this.ch()===43||this.ch()===45)&&this._pos++,r([48,49,50,51,52,53,54,55,56,57]));let i=String.fromCharCode.apply(null,this.data.subarray(e,this._pos)),s=parseFloat(i);return n?new re(U.float,s,this._pos-e):this.options.allowBigInt!==!0||Number.isSafeInteger(s)?new re(s>=0?U.uint:U.negint,s,this._pos-e):new re(s>=0?U.uint:U.negint,BigInt(i),this._pos-e)}parseString(){if(this.ch()!==34)throw new Error(`${de} unexpected character at position ${this._pos}; this shouldn't happen`);this._pos++;for(let i=this._pos,s=0;i<this.data.length&&s<65536;i++,s++){let o=this.data[i];if(o===92||o<32||o>=128)break;if(o===34){let u=String.fromCharCode.apply(null,this.data.subarray(this._pos,i));return this._pos=i+1,new re(U.string,u,s)}}let e=this._pos,t=[],n=()=>{if(this._pos+4>=this.data.length)throw new Error(`${de} unexpected end of unicode escape sequence at position ${this._pos}`);let i=0;for(let s=0;s<4;s++){let o=this.ch();if(o>=48&&o<=57)o-=48;else if(o>=97&&o<=102)o=o-97+10;else if(o>=65&&o<=70)o=o-65+10;else throw new Error(`${de} unexpected unicode escape character at position ${this._pos}`);i=i*16+o,this._pos++}return i},r=()=>{let i=this.ch(),s=null,o=i>239?4:i>223?3:i>191?2:1;if(this._pos+o>this.data.length)throw new Error(`${de} unexpected unicode sequence at position ${this._pos}`);let u,f,c,h;switch(o){case 1:i<128&&(s=i);break;case 2:u=this.data[this._pos+1],(u&192)===128&&(h=(i&31)<<6|u&63,h>127&&(s=h));break;case 3:u=this.data[this._pos+1],f=this.data[this._pos+2],(u&192)===128&&(f&192)===128&&(h=(i&15)<<12|(u&63)<<6|f&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:u=this.data[this._pos+1],f=this.data[this._pos+2],c=this.data[this._pos+3],(u&192)===128&&(f&192)===128&&(c&192)===128&&(h=(i&15)<<18|(u&63)<<12|(f&63)<<6|c&63,h>65535&&h<1114112&&(s=h))}s===null?(s=65533,o=1):s>65535&&(s-=65536,t.push(s>>>10&1023|55296),s=56320|s&1023),t.push(s),this._pos+=o};for(;!this.done();){let i=this.ch(),s;switch(i){case 92:if(this._pos++,this.done())throw new Error(`${de} unexpected string termination at position ${this._pos}`);switch(s=this.ch(),this._pos++,s){case 34:case 39:case 92:case 47:t.push(s);break;case 98:t.push(8);break;case 116:t.push(9);break;case 110:t.push(10);break;case 102:t.push(12);break;case 114:t.push(13);break;case 117:t.push(n());break;default:throw new Error(`${de} unexpected string escape character at position ${this._pos}`)}break;case 34:return this._pos++,new re(U.string,Wc(t),this._pos-e);default:if(i<32)throw new Error(`${de} invalid control character at position ${this._pos}`);i<128?(t.push(i),this._pos++):r()}}throw new Error(`${de} unexpected end of string at position ${this._pos}`)}parseValue(){switch(this.ch()){case 123:return this.modeStack.push("obj-start"),this._pos++,new re(U.map,1/0,1);case 91:return this.modeStack.push("array-start"),this._pos++,new re(U.array,1/0,1);case 34:return this.parseString();case 110:return this.expect([110,117,108,108]),new re(U.null,null,4);case 102:return this.expect([102,97,108,115,101]),new re(U.false,!1,5);case 116:return this.expect([116,114,117,101]),new re(U.true,!0,4);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.parseNumber();default:throw new Error(`${de} unexpected character at position ${this._pos}`)}}next(){switch(this.skipWhitespace(),this.currentMode()){case"value":return this.modeStack.pop(),this.parseValue();case"array-value":{if(this.modeStack.pop(),this.ch()===93)return this._pos++,this.skipWhitespace(),new re(U.break,void 0,1);if(this.ch()!==44)throw new Error(`${de} unexpected character at position ${this._pos}, was expecting array delimiter but found '${String.fromCharCode(this.ch())}'`);return this._pos++,this.modeStack.push("array-value"),this.skipWhitespace(),this.parseValue()}case"array-start":return this.modeStack.pop(),this.ch()===93?(this._pos++,this.skipWhitespace(),new re(U.break,void 0,1)):(this.modeStack.push("array-value"),this.skipWhitespace(),this.parseValue());case"obj-key":if(this.ch()===125)return this.modeStack.pop(),this._pos++,this.skipWhitespace(),new re(U.break,void 0,1);if(this.ch()!==44)throw new Error(`${de} unexpected character at position ${this._pos}, was expecting object delimiter but found '${String.fromCharCode(this.ch())}'`);this._pos++,this.skipWhitespace();case"obj-start":{if(this.modeStack.pop(),this.ch()===125)return this._pos++,this.skipWhitespace(),new re(U.break,void 0,1);let e=this.parseString();if(this.skipWhitespace(),this.ch()!==58)throw new Error(`${de} unexpected character at position ${this._pos}, was expecting key/value delimiter ':' but found '${String.fromCharCode(this.ch())}'`);return this._pos++,this.modeStack.push("obj-value"),e}case"obj-value":return this.modeStack.pop(),this.modeStack.push("obj-key"),this.skipWhitespace(),this.parseValue();default:throw new Error(`${de} unexpected parse state at position ${this._pos}; this shouldn't happen`)}}};function Cw(e,t){return t=Object.assign({tokenizer:new tf(e,t)},t),Sw(e,t)}var rA=new Uint8Array(0);function xw(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0}function ws(e){if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")}function Uw(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<e.length;i++){var s=e.charAt(i),o=s.charCodeAt(0);if(n[o]!==255)throw new TypeError(s+" is ambiguous");n[o]=i}var u=e.length,f=e.charAt(0),c=Math.log(u)/Math.log(256),h=Math.log(256)/Math.log(u);function m(D){if(D instanceof Uint8Array||(ArrayBuffer.isView(D)?D=new Uint8Array(D.buffer,D.byteOffset,D.byteLength):Array.isArray(D)&&(D=Uint8Array.from(D))),!(D instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(D.length===0)return"";for(var H=0,Q=0,K=0,B=D.length;K!==B&&D[K]===0;)K++,H++;for(var V=(B-K)*h+1>>>0,W=new Uint8Array(V);K!==B;){for(var F=D[K],ee=0,z=V-1;(F!==0||ee<Q)&&z!==-1;z--,ee++)F+=256*W[z]>>>0,W[z]=F%u>>>0,F=F/u>>>0;if(F!==0)throw new Error("Non-zero carry");Q=ee,K++}for(var fe=V-Q;fe!==V&&W[fe]===0;)fe++;for(var N=f.repeat(H);fe<V;++fe)N+=e.charAt(W[fe]);return N}function M(D){if(typeof D!="string")throw new TypeError("Expected String");if(D.length===0)return new Uint8Array;var H=0;if(D[H]!==" "){for(var Q=0,K=0;D[H]===f;)Q++,H++;for(var B=(D.length-H)*c+1>>>0,V=new Uint8Array(B);D[H];){var W=n[D.charCodeAt(H)];if(W===255)return;for(var F=0,ee=B-1;(W!==0||F<K)&&ee!==-1;ee--,F++)W+=u*V[ee]>>>0,V[ee]=W%256>>>0,W=W/256>>>0;if(W!==0)throw new Error("Non-zero carry");K=F,H++}if(D[H]!==" "){for(var z=B-K;z!==B&&V[z]===0;)z++;for(var fe=new Uint8Array(Q+(B-z)),N=Q;z!==B;)fe[N++]=V[z++];return fe}}}function S(D){var H=M(D);if(H)return H;throw new Error(`Non-${t} character`)}return{encode:m,decodeUnsafe:M,decode:S}}var jw=Uw,Mw=jw,Lw=Mw,Dw=class{name;prefix;baseEncode;constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Bw=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,n){this.name=e,this.prefix=t;let r=t.codePointAt(0);if(r===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r,this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return nf(this,e)}},Fw=class{decoders;constructor(e){this.decoders=e}or(e){return nf(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n!=null)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function nf(e,t){return new Fw({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var kw=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,n,r){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=r,this.encoder=new Dw(e,t,n),this.decoder=new Bw(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function rf({name:e,prefix:t,encode:n,decode:r}){return new kw(e,t,n,r)}function Vi({name:e,prefix:t,alphabet:n}){let{encode:r,decode:i}=Lw(n,e);return rf({prefix:t,name:e,encode:r,decode:s=>ws(i(s))})}function Kw(e,t,n,r){let i=e.length;for(;e[i-1]==="=";)--i;let s=new Uint8Array(i*n/8|0),o=0,u=0,f=0;for(let c=0;c<i;++c){let h=t[e[c]];if(h===void 0)throw new SyntaxError(`Non-${r} character`);u=u<<n|h,o+=n,o>=8&&(o-=8,s[f++]=255&u>>o)}if(o>=n||(255&u<<8-o)!==0)throw new SyntaxError("Unexpected end of data");return s}function Gw(e,t,n){let r=t[t.length-1]==="=",i=(1<<n)-1,s="",o=0,u=0;for(let f=0;f<e.length;++f)for(u=u<<8|e[f],o+=8;o>n;)o-=n,s+=t[i&u>>o];if(o!==0&&(s+=t[i&u<<n-o]),r)for(;(s.length*n&7)!==0;)s+="=";return s}function Vw(e){let t={};for(let n=0;n<e.length;++n)t[e[n]]=n;return t}function rt({name:e,prefix:t,bitsPerChar:n,alphabet:r}){let i=Vw(r);return rf({prefix:t,name:e,encode(s){return Gw(s,r,n)},decode(s){return Kw(s,i,n,e)}})}var pi=rt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),iA=rt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),oA=rt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),sA=rt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),aA=rt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),uA=rt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),cA=rt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),fA=rt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),lA=rt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),jo=Vi({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),dA=Vi({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),en=Vi({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),pA=Vi({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),of={};Ao(of,{Digest:()=>zi,create:()=>Os,decode:()=>af,equals:()=>uf,hasCode:()=>c0});var zw=sf,xu=128,Ww=127,qw=~Ww,Hw=Math.pow(2,31);function sf(e,t,n){t=t||[],n=n||0;for(var r=n;e>=Hw;)t[n++]=e&255|xu,e/=128;for(;e&qw;)t[n++]=e&255|xu,e>>>=7;return t[n]=e|0,sf.bytes=n-r+1,t}var Jw=Ko,Xw=128,Uu=127;function Ko(e,r){var n=0,r=r||0,i=0,s=r,o,u=e.length;do{if(s>=u)throw Ko.bytes=0,new RangeError("Could not decode varint");o=e[s++],n+=i<28?(o&Uu)<<i:(o&Uu)*Math.pow(2,i),i+=7}while(o>=Xw);return Ko.bytes=s-r,n}var Yw=Math.pow(2,7),Zw=Math.pow(2,14),Qw=Math.pow(2,21),e0=Math.pow(2,28),t0=Math.pow(2,35),n0=Math.pow(2,42),r0=Math.pow(2,49),i0=Math.pow(2,56),o0=Math.pow(2,63),s0=function(e){return e<Yw?1:e<Zw?2:e<Qw?3:e<e0?4:e<t0?5:e<n0?6:e<r0?7:e<i0?8:e<o0?9:10},a0={encode:zw,decode:Jw,encodingLength:s0},u0=a0,Si=u0;function Go(e,t=0){return[Si.decode(e,t),Si.decode.bytes]}function Pi(e,t,n=0){return Si.encode(e,t,n),t}function $i(e){return Si.encodingLength(e)}function Os(e,t){let n=t.byteLength,r=$i(e),i=r+$i(n),s=new Uint8Array(i+n);return Pi(e,s,0),Pi(n,s,r),s.set(t,i),new zi(e,n,t,s)}function af(e){let t=ws(e),[n,r]=Go(t),[i,s]=Go(t.subarray(r)),o=t.subarray(r+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new zi(n,i,o,t)}function uf(e,t){if(e===t)return!0;{let n=t;return e.code===n.code&&e.size===n.size&&n.bytes instanceof Uint8Array&&xw(e.bytes,n.bytes)}}var zi=class{code;size;digest;bytes;constructor(e,t,n,r){this.code=e,this.size=t,this.digest=n,this.bytes=r}};function c0(e,t){return e.code===t}function ju(e,t){let{bytes:n,version:r}=e;switch(r){case 0:return l0(n,Vo(e),t??en.encoder);default:return d0(n,Vo(e),t??pi.encoder)}}var Mu=new WeakMap;function Vo(e){let t=Mu.get(e);if(t==null){let n=new Map;return Mu.set(e,n),n}return t}var As=class Ve{code;version;multihash;bytes;"/";constructor(t,n,r,i){this.code=n,this.version=t,this.multihash=r,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:n}=this;if(t!==_r)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(n.code!==p0)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Ve.createV0(n)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:n}=this.multihash,r=Os(t,n);return Ve.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return Ve.equals(this,t)}static equals(t,n){let r=n;return r!=null&&t.code===r.code&&t.version===r.version&&uf(t.multihash,r.multihash)}toString(t){return ju(this,t)}toJSON(){return{"/":ju(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let n=t;if(n instanceof Ve)return n;if(n["/"]!=null&&n["/"]===n.bytes||n.asCID===n){let{version:r,code:i,multihash:s,bytes:o}=n;return new Ve(r,i,s,o??Lu(r,i,s.bytes))}else if(n[y0]===!0){let{version:r,multihash:i,code:s}=n,o=af(i);return Ve.create(r,s,o)}else return null}static create(t,n,r){if(typeof n!="number")throw new Error("String codecs are no longer supported");if(!(r.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(n!==_r)throw new Error(`Version 0 CID must use dag-pb (code: ${_r}) block encoding`);return new Ve(t,n,r,r.bytes)}case 1:{let i=Lu(t,n,r.bytes);return new Ve(t,n,r,i)}default:throw new Error("Invalid version")}}static createV0(t){return Ve.create(0,_r,t)}static createV1(t,n){return Ve.create(1,t,n)}static decode(t){let[n,r]=Ve.decodeFirst(t);if(r.length!==0)throw new Error("Incorrect length");return n}static decodeFirst(t){let n=Ve.inspectBytes(t),r=n.size-n.multihashSize,i=ws(t.subarray(r,r+n.multihashSize));if(i.byteLength!==n.multihashSize)throw new Error("Incorrect length");let s=i.subarray(n.multihashSize-n.digestSize),o=new zi(n.multihashCode,n.digestSize,s,i);return[n.version===0?Ve.createV0(o):Ve.createV1(n.codec,o),t.subarray(n.size)]}static inspectBytes(t){let n=0,r=()=>{let[m,M]=Go(t.subarray(n));return n+=M,m},i=r(),s=_r;if(i===18?(i=0,n=0):s=r(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=n,u=r(),f=r(),c=n+f,h=c-o;return{version:i,codec:s,multihashCode:u,digestSize:f,multihashSize:h,size:c}}static parse(t,n){let[r,i]=f0(t,n),s=Ve.decode(i);if(s.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Vo(s).set(r,t),s}};function f0(e,t){switch(e[0]){case"Q":{let n=t??en;return[en.prefix,n.decode(`${en.prefix}${e}`)]}case en.prefix:{let n=t??en;return[en.prefix,n.decode(e)]}case pi.prefix:{let n=t??pi;return[pi.prefix,n.decode(e)]}case jo.prefix:{let n=t??jo;return[jo.prefix,n.decode(e)]}default:{if(t==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}}function l0(e,t,n){let{prefix:r}=n;if(r!==en.prefix)throw Error(`Cannot string encode V0 in ${n.name} encoding`);let i=t.get(r);if(i==null){let s=n.encode(e).slice(1);return t.set(r,s),s}else return i}function d0(e,t,n){let{prefix:r}=n,i=t.get(r);if(i==null){let s=n.encode(e);return t.set(r,s),s}else return i}var _r=112,p0=18;function Lu(e,t,n){let r=$i(e),i=r+$i(t),s=new Uint8Array(i+n.byteLength);return Pi(e,s,0),Pi(t,s,r),s.set(n,i),s}var y0=Symbol.for("@ipld/js-cid/CID"),h0=20;function cf({name:e,code:t,encode:n,minDigestLength:r,maxDigestLength:i}){return new g0(e,t,n,r,i)}var g0=class{name;code;encode;minDigestLength;maxDigestLength;constructor(e,t,n,r,i){this.name=e,this.code=t,this.encode=n,this.minDigestLength=r??h0,this.maxDigestLength=i}digest(e,t){if(t?.truncate!=null){if(t.truncate<this.minDigestLength)throw new Error(`Invalid truncate option, must be greater than or equal to ${this.minDigestLength}`);if(this.maxDigestLength!=null&&t.truncate>this.maxDigestLength)throw new Error(`Invalid truncate option, must be less than or equal to ${this.maxDigestLength}`)}if(e instanceof Uint8Array){let n=this.encode(e);return n instanceof Uint8Array?Du(n,this.code,t?.truncate):n.then(r=>Du(r,this.code,t?.truncate))}else throw Error("Unknown type, must be binary type")}};function Du(e,t,n){if(n!=null&&n!==e.byteLength){if(n>e.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${e.byteLength}`);e=e.subarray(0,n)}return Os(t,e)}var ff=rt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),yA=rt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),hA=rt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),gA=rt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});function m0(e){return e instanceof ArrayBuffer?new Uint8Array(e,0,e.byteLength):e}function b0(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=As.asCID(e);if(!t)return null;let n=t.toString();return[new re(U.map,1/0,1),new re(U.string,"/",1),new re(U.string,n,n.length),new re(U.break,void 0,1)]}function Ri(e){let t=ff.encode(e).slice(1);return[new re(U.map,1/0,1),new re(U.string,"/",1),new re(U.map,1/0,1),new re(U.string,"bytes",5),new re(U.string,t,t.length),new re(U.break,void 0,1),new re(U.break,void 0,1)]}function St(e){return Ri(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function v0(e){return Ri(new Uint8Array(e))}function _0(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function T0(e){if(Number.isNaN(e))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(e===1/0||e===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}var w0={typeEncoders:{Object:b0,Buffer:Ri,Uint8Array:Ri,Int8Array:St,Uint16Array:St,Int16Array:St,Uint32Array:St,Int32Array:St,Float32Array:St,Float64Array:St,Uint8ClampedArray:St,BigInt64Array:St,BigUint64Array:St,DataView:St,ArrayBuffer:v0,undefined:_0,number:T0}},O0=class extends tf{constructor(e,t){super(e,t),this.tokenBuffer=[]}done(){return this.tokenBuffer.length===0&&super.done()}_next(){return this.tokenBuffer.length>0?this.tokenBuffer.pop():super.next()}next(){let e=this._next();if(e.type===U.map){let t=this._next();if(t.type===U.string&&t.value==="/"){let n=this._next();if(n.type===U.string){if(this._next().type!==U.break)throw new Error("Invalid encoded CID form");return this.tokenBuffer.push(n),new re(U.tag,42,0)}if(n.type===U.map){let r=this._next();if(r.type===U.string&&r.value==="bytes"){let i=this._next();if(i.type===U.string){for(let o=0;o<2;o++)if(this._next().type!==U.break)throw new Error("Invalid encoded Bytes form");let s=ff.decode(`m${i.value}`);return new re(U.bytes,s,i.value.length)}this.tokenBuffer.push(i)}this.tokenBuffer.push(r)}this.tokenBuffer.push(n)}this.tokenBuffer.push(t)}return e}},zo={allowIndefinite:!1,allowUndefined:!1,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};zo.tags[42]=As.parse;var A0="dag-json",lf=297,Is=e=>Nw(e,w0),df=e=>{let t=m0(e),n=Object.assign(zo,{tokenizer:new O0(t,zo)});return Cw(t,n)},Bu=e=>I0.decode(Is(e)),I0=new TextDecoder,E0=e=>df(S0.encode(e)),S0=new TextEncoder;function P0(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function pf(e,t,n=""){let r=P0(e),i=e?.length,s=t!==void 0;if(!r||s&&i!==t){let o=n&&`"${n}" `,u=s?` of length ${t}`:"",f=r?`length=${i}`:`type=${typeof e}`;throw new Error(o+"expected Uint8Array"+u+", got "+f)}return e}function Fu(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function $0(e,t){pf(e,void 0,"digestInto() output");let n=t.outputLen;if(e.length<n)throw new Error('"digestInto() output" expected to be of length >='+n)}function Wo(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Mo(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Ut(e,t){return e<<32-t|e>>>t}function R0(e,t={}){let n=(i,s)=>e(s).update(i).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.create=i=>e(i),Object.assign(n,t),Object.freeze(n)}var N0=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function C0(e,t,n){return e&t^~e&n}function x0(e,t,n){return e&t^e&n^t&n}var U0=class{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,n,r){this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=Mo(this.buffer)}update(e){Fu(this),pf(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let s=0;s<i;){let o=Math.min(r-this.pos,i-s);if(o===r){let u=Mo(e);for(;r<=i-s;s+=r)this.process(u,s);continue}n.set(e.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Fu(this),$0(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:s}=this;t[s++]=128,Wo(this.buffer.subarray(s)),this.padOffset>r-s&&(this.process(n,0),s=0);for(let h=s;h<r;h++)t[h]=0;n.setBigUint64(r-8,BigInt(this.length*8),i),this.process(n,0);let o=Mo(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen must be aligned to 32bit");let f=u/4,c=this.get();if(f>c.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h<f;h++)o.setUint32(4*h,c[h],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:s,pos:o}=this;return e.destroyed=s,e.finished=i,e.length=r,e.pos=o,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}},Zt=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),j0=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Qt=new Uint32Array(64),M0=class extends U0{constructor(e){super(64,e,8,!1)}get(){let{A:e,B:t,C:n,D:r,E:i,F:s,G:o,H:u}=this;return[e,t,n,r,i,s,o,u]}set(e,t,n,r,i,s,o,u){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=s|0,this.G=o|0,this.H=u|0}process(e,t){for(let h=0;h<16;h++,t+=4)Qt[h]=e.getUint32(t,!1);for(let h=16;h<64;h++){let m=Qt[h-15],M=Qt[h-2],S=Ut(m,7)^Ut(m,18)^m>>>3,D=Ut(M,17)^Ut(M,19)^M>>>10;Qt[h]=D+Qt[h-7]+S+Qt[h-16]|0}let{A:n,B:r,C:i,D:s,E:o,F:u,G:f,H:c}=this;for(let h=0;h<64;h++){let m=Ut(o,6)^Ut(o,11)^Ut(o,25),M=c+m+C0(o,u,f)+j0[h]+Qt[h]|0,D=(Ut(n,2)^Ut(n,13)^Ut(n,22))+x0(n,r,i)|0;c=f,f=u,u=o,o=s+M|0,s=i,i=r,r=n,n=M+D|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,s=s+this.D|0,o=o+this.E|0,u=u+this.F|0,f=f+this.G|0,c=c+this.H|0,this.set(n,r,i,s,o,u,f,c)}roundClean(){Wo(Qt)}destroy(){this.set(0,0,0,0,0,0,0,0),Wo(this.buffer)}},L0=class extends M0{A=Zt[0]|0;B=Zt[1]|0;C=Zt[2]|0;D=Zt[3]|0;E=Zt[4]|0;F=Zt[5]|0;G=Zt[6]|0;H=Zt[7]|0;constructor(){super(32)}},D0=R0(()=>new L0,N0(1));var Be=Xt(Kt(),1),yf=Xt(tp(),1),ku=e=>Be.Type.Union([e,Be.Type.Null()]);var hf=/^(k51qz|baguq)[0-9a-z]{56,57}$/,B0=/^[0-9A-Fa-f]{7,8}$/g;Be.FormatRegistry.Set("EntityID",e=>!!e.match(B0)||!!e.match(hf));var F0=Be.Type.String(),k0=e=>e?.enc instanceof Uint8Array;Be.FormatRegistry.Set("CID",e=>!!e.match(hf));var gf=Be.Type.String({format:"CID"}),K0=/^http([s]?):\/\/.*\..*/;Be.FormatRegistry.Set("URL",e=>!!e.match(K0));var mA=Be.Type.String({format:"URL"}),mf=Be.Type.Object({en:F0,at:Be.Type.String(),vl:ku(Be.Type.Union([Be.Type.String(),Be.Type.Boolean(),Be.Type.Number()])),ts:Be.Type.String(),ag:Be.Type.String(),pv:ku(gf)}),Ku=yf.TypeCompiler.Compile(mf);var bA=Ku.Check.bind(Ku),G0=Be.Type.Composite([Be.Type.Object({cid:gf}),mf]),qo=yf.TypeCompiler.Compile(G0),V0=e=>Array.from(qo.Errors(e)),bf=qo.Check.bind(qo);function vf(e){return async t=>new Uint8Array(await crypto.subtle.digest(e,t))}var z0=cf({name:"sha2-256",code:18,encode:vf("SHA-256")}),vA=cf({name:"sha2-512",code:19,encode:vf("SHA-512")}),{WARN:Gu,LOG:_A,DEBUG:W0,VERBOSE:_f,ERROR:q0}=De.setup(De.INFO);function H0(e,t=["cid"]){if(!e)throw q0("falsy log",e);let n=e.cid;if(k0(e))return n||(n=Es(Tf(e).bytes).toString()),Gu("preparing an encrypted applog - really?"),{log:e,cid:n};let r={};for(let[i,s]of Object.entries(e))s===void 0&&(Gu(`log.${i} is undefined, which is not allowed - encoding as null`,e),s=null),t.includes(i)?_f("excluding app log",{key:i,val:s}):r[i]=s;return{log:r,cid:n}}function J0(e){return Es(X0(e).bytes)}function X0(e){return Tf(H0(e)?.log)}function Es(e){let t=D0(e),n=of.create(z0.code,t),r=As.create(1,lf,n);return _f("[getCidSync]",{bytes:e,hash:t,digest:n,cid:r}),r}function Tf(e){W0("[encodeBlock]",e);let t=Is(e);return{bytes:t,cid:Es(t)}}function Vu(e){let t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Y0(e,t){let n=Vu(e),r=Vu(t);return+n<+r}var{WARN:TA,LOG:wA,DEBUG:OA,VERBOSE:Z0,ERROR:zu}=De.setup(De.INFO),Q0=(e,t,n="asc")=>n==="asc"?e.localeCompare(t,"en-US"):t.localeCompare(e,"en-US"),wf=(e,t,n)=>qe.structural(Eu(t,e),Eu(n,e)),eO=(e,t,n="asc")=>Q0(e.ts,t.ts,n),AA=q_(wf,["en","at"]);function Ho(e,t="asc"){return e.sort((n,r)=>eO(n,r,t))}var tO=(e,t)=>Y0(new Date(e.ts),new Date(t.ts));var Of=e=>{let t=new Map;for(let n of e){if(!n)throw zu("falsy entry in applogs",e),new Error("falsy entry in applogs");if(!n.cid)throw zu("applog with missing CID",n),new Error("applog with missing CID");let r=n.cid;t.has(r)?Z0("Skipping duplicate applog:",[t.get(r),n]):t.set(r,n)}return Array.from(t.values())},IA=(e,t=8)=>oO(Oi(e),31,t);function nO(e){return typeof e=="string"&&e.startsWith("?")}function rO(e){return e.slice(1)}function EA(e,t){let n={},r={};for(let[i,s]of Object.entries(e))if(nO(s)){let o=rO(s),u=t[o];u?r[i]=u:n[i]=o}else r[i]=s;return[r,n]}function iO(e,t,n){let r;if(t){let i=typeof t;i==="string"?r=t===n:i==="function"?r=t(n):typeof t.has=="function"?r=t.has(n):Array.isArray(t)&&!Array.isArray(n)?r=t.includes(n):r=t===n}else r=t===n;return e.charAt(0)==="!"?!r:r}var Af=function(t){for(var n=0,r=0,i=t.length;r<i;r++)n+=t[r];return n},Wu=function(t){return Af(t)/t.length},mt={max:function(e){return Math.max.apply(null,e)},min:function(e){return Math.min.apply(null,e)},range:function(e){return mt.max(e)-mt.min(e)},midrange:function(e){return mt.range(e)/2},sum:Af,mean:Wu,average:Wu,median:function(e){e.sort(function(n,r){return n-r});var t=e.length/2;return t%1?e[t-.5]:(e[t-1]+e[t])/2},modes:function(e){if(!e.length)return[];var t={},n=0,r=[];return e.forEach(function(i){t[i]?t[i]++:t[i]=1,t[i]>n?(r=[i],n=t[i]):t[i]===n&&(r.push(i),n=t[i])}),r},variance:function(e){var t=mt.mean(e);return mt.mean(e.map(function(n){return Math.pow(n-t,2)}))},standardDeviation:function(e){return Math.sqrt(mt.variance(e))},meanAbsoluteDeviation:function(e){var t=mt.mean(e);return mt.mean(e.map(function(n){return Math.abs(n-t)}))},zScores:function(e){var t=mt.mean(e),n=mt.standardDeviation(e);return e.map(function(r){return(r-t)/n})}};mt.average=mt.mean;var oO=function(e,t=13,n){if(!e?.length)throw new Error(`Empty string: ${e}`);let r=3735928559^t,i=1103547991^t;for(let o=0,u;o<e.length;o++)u=e.charCodeAt(o),r=Math.imul(r^u,2654435761),i=Math.imul(i^u,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),(4294967296*(2097151&i)+(r>>>0)).toString(16).slice(-n).padStart(n,"0")};function If(){return new Date().toISOString()}var{WARN:sO,LOG:SA,DEBUG:Ue,VERBOSE:PA,ERROR:Ni}=De.setup(De.INFO);function aO(e,t){Ue(`[ensureTsPvAndFinalizeApplogs] ENTER - ${e.length} applogs, thread size=${t.size}`);let n=If(),r=t;Ue("[ensureTsPvAndFinalizeApplogs] About to map over applogs");let i=e.map((s,o)=>{Ue(`[ensureTsPvAndFinalizeApplogs] Processing applog ${o+1}/${e.length}`);let u=uO(s,{ts:n,threadForPv:r});return Ue(`[ensureTsPvAndFinalizeApplogs] Finalized applog ${o+1}/${e.length}`),u});return Ue(`[ensureTsPvAndFinalizeApplogs] EXIT - mapped ${i.length} applogs`),i}function uO(e,{ts:t,threadForPv:n}={}){Ue(`[finalizeApplogForInsert] ENTER - en=${e.en}, at=${e.at}`),Ue("[finalizeApplogForInsert] About to call withTs");let r=lO(e,t??If());Ue(`[finalizeApplogForInsert] About to call withPvFrom (thread size=${n?.size??"null"})`);let i=dO(r,n);Ue("[finalizeApplogForInsert] About to call encodeApplogAndGetCid");let s=J0(i).toString();Ue(`[finalizeApplogForInsert] CID created: ${s}`),e.cid&&e.cid!==s&&sO("[finalizeApplogForInsert] overwriting wrong CID",{log:e,cid:s,logWithPv:i});let o={...i,cid:s};if(Ue("[finalizeApplogForInsert] About to validate applog"),!bf(o))throw Ni(`Bogus Applog ${JSON.stringify(o)}`,V0(o));return Ue(`[finalizeApplogForInsert] EXIT - CID=${s}`),Object.freeze(o)}function cO(e){return!!e.ts}function fO(e){return!!e.pv}function lO(e,t){return cO(e)?e:{...e,ts:t}}function dO(e,t){if(Ue(`[withPvFrom] ENTER - en=${e.en}, at=${e.at}, hasPv=${e.pv!==void 0}`),e.pv!==void 0)return Ue("[withPvFrom] EXIT early - pv already set"),e;if(t){let{en:n,at:r}=e;Ue(`[withPvFrom] About to call thread.findLast for en=${n}, at=${r}, thread.size=${t.size}`);let i=t.findLast(o=>o.en==n&&o.at==r);if(Ue(`[withPvFrom] findLast completed, found=${!!i}`),Ue("[withPvFrom] About to check equality"),wf(["en","at","vl","ts","ag"],e,i))throw Ni("[withPvFrom] Same as previous:",{log:e,pv:i,thread:t});let s=(e.pv!==void 0?e.pv:i?.cid)??null;return Ue(`[withPvFrom] EXIT - prevLogCid=${s}`),{...e,pv:s}}else{if(!fO(e))throw Ni("[withPvFrom] no thread and no pv:",e);return Ue("[withPvFrom] EXIT - no thread, returning log with existing pv"),e}}function $A(e){let t=()=>(Ne(()=>e.length<2&&Ue(`joinThreads with count=${e.length}`)),Ho(Of(e.flatMap(i=>{let s=i.applogs;if(!s)throw Ni("falsy applogs of thread",i),new Error("falsy applogs of thread");return s})))),n=Ne(()=>t()),r=ct(function(i,s){return Pr(i)?{init:Ne(()=>t())}:{added:i.added.filter(o=>!this.hasApplog(o,!0)),removed:i.removed?.filter(o=>!!this.parents.some(f=>f===s?!1:f.hasApplog(o,!0)))}});return new Ss(Ne(()=>`join(~ ${e.map(i=>i.name).join(", ")})`),e,["?"],n,r)}var{WARN:qu,LOG:RA,DEBUG:Hu,VERBOSE:bn,ERROR:Ju}=De.setup(De.INFO),Ss=class Ef extends zn{constructor(t,n,r,i,s,o=null){super(t,n,r,s?Pe.array([...i],{deep:!1,name:`${t}.array`}):i),this.name=t,this._initialLogs=i,this._eventMapper=s,this._writeMapper=o,mr(this,{onParentUpdate:ct}),s&&this.subscribeToParents()}static mapWrites(t,n,r){return new Ef(`${n}<${t.nameAndSizeUntracked}>`,t,t.filters,t._applogs,null,r)}_parentSubscriptions=null;insert(t){let n=this._writeMapper?this._writeMapper(t):t;if(!(this._writeMapper&&!n))return this.parents.forEach(r=>r.insert(n))}insertRaw(t){let n=this._writeMapper?this._writeMapper(t):t;if(!(this._writeMapper&&!n))return this.parents.forEach(r=>r.insertRaw(n))}subscribeToParents(){this._parentSubscriptions=new Map;let t=go(()=>{this.parents.length||qu("MappedThread has no parents",this),bn(`[MappedThread: ${this.name}] subscribing to parents:`,this.parents.map(r=>r.name));let n=new Set([...this._parentSubscriptions.keys()]);for(let r of this.parents){n.delete(r)&&bn(`[MappedThread: ${this.name}] Skipping re-sub to parent`,r.nameAndSizeUntracked),bn(`[MappedThread: ${this.name}] sub to new parent`,r.nameAndSizeUntracked);let s=this.onParentUpdate.bind(this,r),o=r.subscribe(s);this._parentSubscriptions.set(r,o)}for(let r of n)bn(`[MappedThread: ${this.name}] un-subscribing from old parent`,r.nameAndSizeUntracked),this._parentSubscriptions.get(r)(),this._parentSubscriptions.delete(r)})}subscribe(t){return this._parentSubscriptions||this.subscribeToParents(),super.subscribe(t)}triggerRemap(){if(!this._eventMapper)throw Ju("triggerRemap on a thread that is not actually mapping?!",this.nameAndSizeUntracked);Hu(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap`),this.parents.length!==1&&qu(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap with parentCount=${this.parents.length} - not meant for this`),this.parents.forEach(t=>{this.onParentUpdate(t,{init:Ne(()=>Bn(t.applogs))})})}onParentUpdate(t,n){bn(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate`,n);let r=this._eventMapper?this._eventMapper(n,t):n;if(this._eventMapper)if(bn(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => mapped`,r),Pr(r))this._applogs.replace([...r.init]);else{for(let i of r.added)this._applogs.splice(iT(this._applogs,i,"ts"),0,i);if(r.removed){for(let i of r.removed)if(!this._applogs.remove(i))if(!Pr(n)&&n.removed?.includes(i))Hu("Ignoring remove event for non-existent because it was part of parent event's removed",i,n);else throw Ju(`MappedThread{${this.name}} toRemove contained log that doesn't exist`,i,{thread:this,event:n,mapResult:r})}}bn(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => deps?`,pr(this._applogs)),this.notifySubscribers(r)}get readOnly(){return!1}},{WARN:NA,LOG:CA,DEBUG:xA,VERBOSE:Lo,ERROR:pO}=De.setup(De.INFO),UA=fs("rollingFilter",function(t,n,r={}){let i=yO(n),s=Xu(i),o=Pe.array(Ne(function(){return s(t.applogs)}),{deep:!1,name:`${t.name} | ${r.name||`rollingFilter.array{${Oi(i)}}`}`}),u=m=>{let M;return Pr(m)?M={init:s(m.init)}:M={added:s(m.added),removed:m.removed},Lo(`rollingFilter{${t.nameAndSizeUntracked} | ${r.name?` '${r.name}'}`:""} parentUpdate`,i,m,"=>",M),M},f=new Ss(`${t.name} | ${r.name||`rollingFilter{${Oi(i)}}`}`,t,[...t.filters,...r.extraFilterName?[r.extraFilterName]:[]],o,u),c=Ea(()=>Bn(n),m=>{Lo(`rollingFilter<${t.nameAndSizeUntracked}>${r.name?` '${r.name}'`:""} patternUpdate`,i,"=>",m),i=m,s=Xu(i),f.triggerRemap()}),h=hn(o,()=>{Lo(`rollingFilter<${Ne(()=>t.name)}>${r.name?` '${r.name}'`:""} unobserve`,i),c(),h()});return f},{equals:cs,argsDebugName:(e,t,n)=>Kc({caller:"rollingFilter",thread:e,pattern:t,args:n})}),jA=fs("rollingMapper",function(t,n,r={}){let i=Ne(()=>n.call(null,{init:t.applogs},t));if(!Pr(i))throw pO("Initial run must return init event");let s=i.init;return new Ss(`${t.name} | ${r.name||"rollingMapper"}`,t,[...t.filters,...r.extraFilterName?[r.extraFilterName]:[]],s,n)},{equals:cs,argsDebugName:(e,t,n)=>Kc({caller:"rollingMapper",thread:e,args:n})}),MA=fs("rollingAcc",function(t,n,r,i={}){let s=ct(r);return s({init:t.applogs},n),t.subscribe(o=>{s(o,n)}),n},{argsDebugName:(e,t,n,r)=>`rollingAcc{${e.nameAndSizeUntracked}${r?.name?` | ${r?.name}`:""}}`}),yO=function(t){let n=Ne(function(){return Object.fromEntries(Object.entries(Bn(t)).map(([i,s])=>[Bn(i),Bn(s)]))});if(!Object.entries(n).length)throw new Error("Pattern is empty");return n};function Xu(e){return function(n){return n.filter(function(i){for(let s of Object.keys(e)){let o=e[s];if(o===void 0)continue;let u=i[s.startsWith("!")?s.slice(1):s];if(!iO(s,o,u))return!1}return!0})}}var{WARN:hO,LOG:gO,DEBUG:xe,VERBOSE:Sf,ERROR:yi}=De.setup(De.INFO),mO=class extends zn{constructor(e,t=[],n){super(e,null,n,t),mr(this,{})}purge(e){let t=this.applogs.length;return this._applogs=this.applogs.filter(n=>!e.includes(n.cid)),t-this.applogs.length}insert(e){xe(`[WriteableThread.insert] ENTER - ${e.length} applogs for thread "${this.name}"`),xe("[WriteableThread.insert] About to call ensureTsPvAndFinalizeApplogs");let t=aO(e,this);xe(`[WriteableThread.insert] ensureTsPvAndFinalizeApplogs completed, mapped=${t.length} applogs`),xe("[WriteableThread.insert] About to call insertRaw");let n=this.insertRaw(t);return xe("[WriteableThread.insert] insertRaw completed"),n}insertMissing(e,t=!1){let n=e.filter(r=>!this.hasApplog(r,t));return n.length===0?(Sf("[insertMissing] no missing applogs"),[]):this.insertRaw(n)??[]}insertRaw(e){xe(`[WriteableThread.insertRaw] ENTER - ${e.length} applogs for thread "${this.name}"`),xe("[WriteableThread.insertRaw] About to deduplicate");let t=Of(e);if(t.length!==e.length)throw yi(`[insertRaw] duplicate applogs passed: ${e.length-t.length}`,{appLogsToInsert:e,deduplicated:t});xe("[WriteableThread.insertRaw] Deduplication done"),xe("[WriteableThread.insertRaw] About to validate");let n=e.filter(s=>!bf(s));if(n.length)throw yi(`[insertRaw] bogus applogs passed: ${n.length}`,{bogus:n});xe("[WriteableThread.insertRaw] Validation done"),xe("[WriteableThread.insertRaw] About to check for existing");let r=e.filter(s=>this.hasApplog(s,!1));if(r.length)throw yi(`[insertRaw] already existing applogs passed: ${r.length}`,{existing:r});if(xe("[WriteableThread.insertRaw] Existing check done"),!e.length){hO("[insertRaw] skipping empty insert empty logs array");return}(!this.hasParents&&!(this instanceof bO)?gO:xe)("Inserting:",e.length===1?e[0]:e,{ds:this}),xe("[WriteableThread.insertRaw] About to sort applogs"),Ho(e);let i=this._applogs.length&&tO(e[0],this._applogs[this._applogs.length-1]);return xe("[WriteableThread.insertRaw] About to push to _applogs array"),this._applogs.push(...e),i&&(xe("[WriteableThread.insertRaw] About to sort _applogs (sortNeeded=true)"),Ho(this._applogs)),xe("[WriteableThread.insertRaw] About to notify subscribers"),this.notifySubscribers({added:e,removed:null}),xe("[WriteableThread.insertRaw] Subscribers notified"),xe("[WriteableThread.insertRaw] About to call persist (void - not awaited)"),this.persist(e),xe(`[WriteableThread.insertRaw] EXIT - returning ${e.length} applogs`),e}get readOnly(){return!1}},bO=class hi extends mO{constructor(t,n,r,i){super(t,n,r),this._readOnly=i,mr(this,{_applogs:Pe.shallow})}static empty(t){return hi.fromArray([],t??"empty in-memory",!1)}static fromArray(t,n,r=!1){return new hi(n??"in-memory",t,[],r)}static fromReadOnlyArray(t,n){return new hi(n??"in-memory",t,[],!0)}get readOnly(){return this._readOnly}async persist(t){if(Sf("[InMem.persist] no persist for",t),this.readOnly)throw yi("[persist] called for readOnly thread")}},{WARN:LA,LOG:DA,DEBUG:BA,VERBOSE:FA,ERROR:kA}=De.setup(De.INFO);export{qe as a,Pe as b,ht as c,Ne as d,ct as e,go as f,ci as g,Bn as h,mr as i,De as j,Oi as k,Kc as l,JO as m,cs as n,XO as o,YO as p,ZO as q,fs as r,Pr as s,tA as t,Ho as u,IA as v,EA as w,If as x,$A as y,UA as z,jA as A,bO as B};
62
+ /*! Bundled license information:
63
+
64
+ lodash-es/lodash.js:
65
+ (**
66
+ * @license
67
+ * Lodash (Custom Build) <https://lodash.com/>
68
+ * Build: `lodash modularize exports="es" -o ./`
69
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
70
+ * Released under MIT license <https://lodash.com/license>
71
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
72
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
73
+ *)
74
+
75
+ @noble/hashes/utils.js:
76
+ (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
77
+ */
78
+ //# sourceMappingURL=chunk-YXZYW2WJ.min.js.map