@dbt-tools/web 0.6.4 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -2
- package/README.md +1 -1
- package/dist/assets/analysis.worker-FSoJQ6o2.js +112 -0
- package/dist/assets/index-8iC40E8n.js +90 -0
- package/dist/assets/index-BGYJHoWz.css +1 -0
- package/dist/assets/react-vendor-HrA5Qiu9.js +9 -0
- package/dist/assets/results-query.worker-CMxak4Ts.js +112 -0
- package/dist/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/dist/assets/tanstack-virtual-vendor-DXt6i1QQ.js +4 -0
- package/dist/index.html +5 -5
- package/dist-serve/server/cli.js +71 -56
- package/package.json +5 -5
- package/dist/assets/analysis.worker-43rj6paY.js +0 -1
- package/dist/assets/index-CQwlMVeT.js +0 -36
- package/dist/assets/index-CwTPzuXv.css +0 -1
- package/dist/assets/react-vendor-DBiqvVPF.js +0 -9
- package/dist/assets/results-query.worker-CM0N9VyM.js +0 -1
- package/dist/assets/rolldown-runtime-Dw2cE7zH.js +0 -1
- package/dist/assets/tanstack-virtual-vendor-BfMyFx37.js +0 -4
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
(function(){var e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),t=(/* @__PURE__ */ e(((e,t)=>{var n=typeof Reflect==`object`?Reflect:null,r=n&&typeof n.apply==`function`?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},i=n&&typeof n.ownKeys==`function`?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};function a(e){console&&console.warn&&console.warn(e)}var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}t.exports=s,t.exports.once=te,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);c=e}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this};function u(e){return e._maxListeners===void 0?s.defaultMaxListeners:e._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e===`error`,a=this._events;if(a!==void 0)i&&=a.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=/* @__PURE__ */ Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=a[e];if(c===void 0)return!1;if(typeof c==`function`)r(c,this,t);else for(var l=c.length,u=g(c,l),n=0;n<l;++n)r(u[n],this,t);return!0};function d(e,t,n,r){var i,o,s;if(l(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),s=o[t]),s===void 0)s=o[t]=n,++e._eventsCount;else if(typeof s==`function`?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=u(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=/* @__PURE__ */ Error(`Possible EventEmitter memory leak detected. `+s.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);c.name=`MaxListenersExceededWarning`,c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}s.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),r=this._events,r===void 0||(n=r[e],n===void 0))return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():_(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n=this._events,r;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(r=0;r<i.length;++r)a=i[r],a!==`removeListener`&&this.removeAllListeners(a);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?ee(i):g(i,i.length)}s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h;function h(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function _(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function ee(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function te(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}y(e,t,a,{once:!0}),t!==`error`&&v(e,i,{once:!0})})}function v(e,t,n){typeof e.on==`function`&&y(e,`error`,t,n)}function y(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener==`function`)e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e)}})))();function n(){let e=arguments[0];for(let t=1,n=arguments.length;t<n;t++)if(arguments[t])for(let n in arguments[t])e[n]=arguments[t][n];return e}let r=n;typeof Object.assign==`function`&&(r=Object.assign);function i(e,t,n,r){let i=e._nodes.get(t),a=null;return i&&(a=r===`mixed`?i.out&&i.out[n]||i.undirected&&i.undirected[n]:r===`directed`?i.out&&i.out[n]:i.undirected&&i.undirected[n]),a}function a(e){return typeof e==`object`&&!!e}function o(e){let t;for(t in e)return!1;return!0}function s(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!0,value:n})}function c(e,t,n){let r={enumerable:!0,configurable:!0};typeof n==`function`?r.get=n:(r.value=n,r.writable=!1),Object.defineProperty(e,t,r)}function l(e){return!(!a(e)||e.attributes&&!Array.isArray(e.attributes))}function u(){let e=Math.floor(Math.random()*256)&255;return()=>e++}function d(){let e=arguments,t=null,n=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(r=t.next(),r.done)t=null;else break}while(1);return r}}}function f(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}var p=class extends Error{constructor(e){super(),this.name=`GraphError`,this.message=e}},m=class e extends p{constructor(t){super(t),this.name=`InvalidArgumentsGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}},h=class e extends p{constructor(t){super(t),this.name=`NotFoundGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}},g=class e extends p{constructor(t){super(t),this.name=`UsageGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}};function _(e,t){this.key=e,this.attributes=t,this.clear()}_.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function ee(e,t){this.key=e,this.attributes=t,this.clear()}ee.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function te(e,t){this.key=e,this.attributes=t,this.clear()}te.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function v(e,t,n,r,i){this.key=t,this.attributes=i,this.undirected=e,this.source=n,this.target=r}v.prototype.attach=function(){let e=`out`,t=`in`;this.undirected&&(e=t=`undirected`);let n=this.source.key,r=this.target.key;this.source[e][r]=this,this.undirected&&n===r||(this.target[t][n]=this)},v.prototype.attachMulti=function(){let e=`out`,t=`in`,n=this.source.key,r=this.target.key;this.undirected&&(e=t=`undirected`);let i=this.source[e],a=i[r];a===void 0?(i[r]=this,this.undirected&&n===r||(this.target[t][n]=this)):(a.previous=this,this.next=a,i[r]=this,this.target[t][n]=this)},v.prototype.detach=function(){let e=this.source.key,t=this.target.key,n=`out`,r=`in`;this.undirected&&(n=r=`undirected`),delete this.source[n][t],delete this.target[r][e]},v.prototype.detachMulti=function(){let e=this.source.key,t=this.target.key,n=`out`,r=`in`;this.undirected&&(n=r=`undirected`),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};function y(e,t,n,r,i,a,o){let s,c,l,u;if(r=``+r,n===0){if(s=e._nodes.get(r),!s)throw new h(`Graph.${t}: could not find the "${r}" node in the graph.`);l=i,u=a}else if(n===3){if(i=``+i,c=e._edges.get(i),!c)throw new h(`Graph.${t}: could not find the "${i}" edge in the graph.`);let n=c.source.key,d=c.target.key;if(r===n)s=c.target;else if(r===d)s=c.source;else throw new h(`Graph.${t}: the "${r}" node is not attached to the "${i}" edge (${n}, ${d}).`);l=a,u=o}else{if(c=e._edges.get(r),!c)throw new h(`Graph.${t}: could not find the "${r}" edge in the graph.`);s=n===1?c.source:c.target,l=i,u=a}return[s,l,u]}function ne(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=y(this,t,n,e,r,i);return a.attributes[o]}}function re(e,t,n){e.prototype[t]=function(e,r){let[i]=y(this,t,n,e,r);return i.attributes}}function ie(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=y(this,t,n,e,r,i);return a.attributes.hasOwnProperty(o)}}function ae(e,t,n){e.prototype[t]=function(e,r,i,a){let[o,s,c]=y(this,t,n,e,r,i,a);return o.attributes[s]=c,this.emit(`nodeAttributesUpdated`,{key:o.key,type:`set`,attributes:o.attributes,name:s}),this}}function oe(e,t,n){e.prototype[t]=function(e,r,i,a){let[o,s,c]=y(this,t,n,e,r,i,a);if(typeof c!=`function`)throw new m(`Graph.${t}: updater should be a function.`);let l=o.attributes;return l[s]=c(l[s]),this.emit(`nodeAttributesUpdated`,{key:o.key,type:`set`,attributes:o.attributes,name:s}),this}}function se(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=y(this,t,n,e,r,i);return delete a.attributes[o],this.emit(`nodeAttributesUpdated`,{key:a.key,type:`remove`,attributes:a.attributes,name:o}),this}}function ce(e,t,n){e.prototype[t]=function(e,r,i){let[o,s]=y(this,t,n,e,r,i);if(!a(s))throw new m(`Graph.${t}: provided attributes are not a plain object.`);return o.attributes=s,this.emit(`nodeAttributesUpdated`,{key:o.key,type:`replace`,attributes:o.attributes}),this}}function le(e,t,n){e.prototype[t]=function(e,i,o){let[s,c]=y(this,t,n,e,i,o);if(!a(c))throw new m(`Graph.${t}: provided attributes are not a plain object.`);return r(s.attributes,c),this.emit(`nodeAttributesUpdated`,{key:s.key,type:`merge`,attributes:s.attributes,data:c}),this}}function ue(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=y(this,t,n,e,r,i);if(typeof o!=`function`)throw new m(`Graph.${t}: provided updater is not a function.`);return a.attributes=o(a.attributes),this.emit(`nodeAttributesUpdated`,{key:a.key,type:`update`,attributes:a.attributes}),this}}let de=[{name:e=>`get${e}Attribute`,attacher:ne},{name:e=>`get${e}Attributes`,attacher:re},{name:e=>`has${e}Attribute`,attacher:ie},{name:e=>`set${e}Attribute`,attacher:ae},{name:e=>`update${e}Attribute`,attacher:oe},{name:e=>`remove${e}Attribute`,attacher:se},{name:e=>`replace${e}Attributes`,attacher:ce},{name:e=>`merge${e}Attributes`,attacher:le},{name:e=>`update${e}Attributes`,attacher:ue}];function fe(e){de.forEach(function({name:t,attacher:n}){n(e,t(`Node`),0),n(e,t(`Source`),1),n(e,t(`Target`),2),n(e,t(`Opposite`),3)})}function pe(e,t,n){e.prototype[t]=function(e,r){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new g(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new g(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=``+e,s=``+r;if(r=arguments[2],a=i(this,o,s,n),!a)throw new h(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new g(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,a=this._edges.get(e),!a)throw new h(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return a.attributes[r]}}function me(e,t,n){e.prototype[t]=function(e){let r;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new g(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new g(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+arguments[1];if(r=i(this,a,o,n),!r)throw new h(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new g(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,r=this._edges.get(e),!r)throw new h(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return r.attributes}}function he(e,t,n){e.prototype[t]=function(e,r){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new g(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new g(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=``+e,s=``+r;if(r=arguments[2],a=i(this,o,s,n),!a)throw new h(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new g(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,a=this._edges.get(e),!a)throw new h(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return a.attributes.hasOwnProperty(r)}}function ge(e,t,n){e.prototype[t]=function(e,r,a){let o;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new g(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new g(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let s=``+e,c=``+r;if(r=arguments[2],a=arguments[3],o=i(this,s,c,n),!o)throw new h(`Graph.${t}: could not find an edge for the given path ("${s}" - "${c}").`)}else{if(n!==`mixed`)throw new g(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,o=this._edges.get(e),!o)throw new h(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return o.attributes[r]=a,this.emit(`edgeAttributesUpdated`,{key:o.key,type:`set`,attributes:o.attributes,name:r}),this}}function _e(e,t,n){e.prototype[t]=function(e,r,a){let o;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new g(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new g(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let s=``+e,c=``+r;if(r=arguments[2],a=arguments[3],o=i(this,s,c,n),!o)throw new h(`Graph.${t}: could not find an edge for the given path ("${s}" - "${c}").`)}else{if(n!==`mixed`)throw new g(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,o=this._edges.get(e),!o)throw new h(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(typeof a!=`function`)throw new m(`Graph.${t}: updater should be a function.`);return o.attributes[r]=a(o.attributes[r]),this.emit(`edgeAttributesUpdated`,{key:o.key,type:`set`,attributes:o.attributes,name:r}),this}}function ve(e,t,n){e.prototype[t]=function(e,r){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new g(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new g(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=``+e,s=``+r;if(r=arguments[2],a=i(this,o,s,n),!a)throw new h(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new g(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,a=this._edges.get(e),!a)throw new h(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return delete a.attributes[r],this.emit(`edgeAttributesUpdated`,{key:a.key,type:`remove`,attributes:a.attributes,name:r}),this}}function ye(e,t,n){e.prototype[t]=function(e,r){let o;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new g(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new g(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,s=``+r;if(r=arguments[2],o=i(this,a,s,n),!o)throw new h(`Graph.${t}: could not find an edge for the given path ("${a}" - "${s}").`)}else{if(n!==`mixed`)throw new g(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,o=this._edges.get(e),!o)throw new h(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(!a(r))throw new m(`Graph.${t}: provided attributes are not a plain object.`);return o.attributes=r,this.emit(`edgeAttributesUpdated`,{key:o.key,type:`replace`,attributes:o.attributes}),this}}function be(e,t,n){e.prototype[t]=function(e,o){let s;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new g(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new g(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let r=``+e,a=``+o;if(o=arguments[2],s=i(this,r,a,n),!s)throw new h(`Graph.${t}: could not find an edge for the given path ("${r}" - "${a}").`)}else{if(n!==`mixed`)throw new g(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,s=this._edges.get(e),!s)throw new h(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(!a(o))throw new m(`Graph.${t}: provided attributes are not a plain object.`);return r(s.attributes,o),this.emit(`edgeAttributesUpdated`,{key:s.key,type:`merge`,attributes:s.attributes,data:o}),this}}function xe(e,t,n){e.prototype[t]=function(e,r){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new g(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new g(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=``+e,s=``+r;if(r=arguments[2],a=i(this,o,s,n),!a)throw new h(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new g(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,a=this._edges.get(e),!a)throw new h(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(typeof r!=`function`)throw new m(`Graph.${t}: provided updater is not a function.`);return a.attributes=r(a.attributes),this.emit(`edgeAttributesUpdated`,{key:a.key,type:`update`,attributes:a.attributes}),this}}let Se=[{name:e=>`get${e}Attribute`,attacher:pe},{name:e=>`get${e}Attributes`,attacher:me},{name:e=>`has${e}Attribute`,attacher:he},{name:e=>`set${e}Attribute`,attacher:ge},{name:e=>`update${e}Attribute`,attacher:_e},{name:e=>`remove${e}Attribute`,attacher:ve},{name:e=>`replace${e}Attributes`,attacher:ye},{name:e=>`merge${e}Attributes`,attacher:be},{name:e=>`update${e}Attributes`,attacher:xe}];function Ce(e){Se.forEach(function({name:t,attacher:n}){n(e,t(`Edge`),`mixed`),n(e,t(`DirectedEdge`),`directed`),n(e,t(`UndirectedEdge`),`undirected`)})}let we=[{name:`edges`,type:`mixed`},{name:`inEdges`,type:`directed`,direction:`in`},{name:`outEdges`,type:`directed`,direction:`out`},{name:`inboundEdges`,type:`mixed`,direction:`in`},{name:`outboundEdges`,type:`mixed`,direction:`out`},{name:`directedEdges`,type:`directed`},{name:`undirectedEdges`,type:`undirected`}];function Te(e,t,n,r){let i=!1;for(let a in t){if(a===r)continue;let o=t[a];if(i=n(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),e&&i)return o.key}}function Ee(e,t,n,r){let i,a,o,s=!1;for(let c in t)if(c!==r){i=t[c];do{if(a=i.source,o=i.target,s=n(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected),e&&s)return i.key;i=i.next}while(i!==void 0)}}function De(e,t){let n=Object.keys(e),r=n.length,i,a=0;return{[Symbol.iterator](){return this},next(){do if(i)i=i.next;else{if(a>=r)return{done:!0};let o=n[a++];if(o===t){i=void 0;continue}i=e[o]}while(!i);return{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected}}}}}function Oe(e,t,n,r){let i=t[n];if(!i)return;let a=i.source,o=i.target;if(r(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected)&&e)return i.key}function ke(e,t,n,r){let i=t[n];if(!i)return;let a=!1;do{if(a=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),e&&a)return i.key;i=i.next}while(i!==void 0)}function Ae(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};let e={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:e}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})}}}function je(e,t){if(e.size===0)return[];if(t===`mixed`||t===e.type)return Array.from(e._edges.keys());let n=t===`undirected`?e.undirectedSize:e.directedSize,r=Array(n),i=t===`undirected`,a=e._edges.values(),o=0,s,c;for(;s=a.next(),s.done!==!0;)c=s.value,c.undirected===i&&(r[o++]=c.key);return r}function Me(e,t,n,r){if(t.size===0)return;let i=n!==`mixed`&&n!==t.type,a=n===`undirected`,o,s,c=!1,l=t._edges.values();for(;o=l.next(),o.done!==!0;){if(s=o.value,i&&s.undirected!==a)continue;let{key:t,attributes:n,source:l,target:u}=s;if(c=r(t,n,l.key,u.key,l.attributes,u.attributes,s.undirected),e&&c)return t}}function Ne(e,t){if(e.size===0)return f();let n=t!==`mixed`&&t!==e.type,r=t===`undirected`,i=e._edges.values();return{[Symbol.iterator](){return this},next(){let e,t;for(;;){if(e=i.next(),e.done)return e;if(t=e.value,!(n&&t.undirected!==r))break}return{value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected},done:!1}}}}function Pe(e,t,n,r,i,a){let o=t?Ee:Te,s;if(n!==`undirected`&&(r!==`out`&&(s=o(e,i.in,a),e&&s)||r!==`in`&&(s=o(e,i.out,a,r?void 0:i.key),e&&s))||n!==`directed`&&(s=o(e,i.undirected,a),e&&s))return s}function Fe(e,t,n,r){let i=[];return Pe(!1,e,t,n,r,function(e){i.push(e)}),i}function Ie(e,t,n){let r=f();return e!==`undirected`&&(t!==`out`&&n.in!==void 0&&(r=d(r,De(n.in))),t!==`in`&&n.out!==void 0&&(r=d(r,De(n.out,t?void 0:n.key)))),e!==`directed`&&n.undirected!==void 0&&(r=d(r,De(n.undirected))),r}function Le(e,t,n,r,i,a,o){let s=n?ke:Oe,c;if(t!==`undirected`&&(i.in!==void 0&&r!==`out`&&(c=s(e,i.in,a,o),e&&c)||i.out!==void 0&&r!==`in`&&(r||i.key!==a)&&(c=s(e,i.out,a,o),e&&c))||t!==`directed`&&i.undirected!==void 0&&(c=s(e,i.undirected,a,o),e&&c))return c}function Re(e,t,n,r,i){let a=[];return Le(!1,e,t,n,r,i,function(e){a.push(e)}),a}function ze(e,t,n,r){let i=f();return e!==`undirected`&&(n.in!==void 0&&t!==`out`&&r in n.in&&(i=d(i,Ae(n.in,r))),n.out!==void 0&&t!==`in`&&r in n.out&&(t||n.key!==r)&&(i=d(i,Ae(n.out,r)))),e!==`directed`&&n.undirected!==void 0&&r in n.undirected&&(i=d(i,Ae(n.undirected,r))),i}function Be(e,t){let{name:n,type:r,direction:i}=t;e.prototype[n]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return[];if(!arguments.length)return je(this,r);if(arguments.length===1){e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new h(`Graph.${n}: could not find the "${e}" node in the graph.`);return Fe(this.multi,r===`mixed`?this.type:r,i,t)}if(arguments.length===2){e=``+e,t=``+t;let a=this._nodes.get(e);if(!a)throw new h(`Graph.${n}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new h(`Graph.${n}: could not find the "${t}" target node in the graph.`);return Re(r,this.multi,i,a,t)}throw new m(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function Ve(e,t){let{name:n,type:r,direction:i}=t,a=`forEach`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t,n){if(r===`mixed`||this.type===`mixed`||r===this.type){if(arguments.length===1)return n=e,Me(!1,this,r,n);if(arguments.length===2){e=``+e,n=t;let o=this._nodes.get(e);if(o===void 0)throw new h(`Graph.${a}: could not find the "${e}" node in the graph.`);return Pe(!1,this.multi,r===`mixed`?this.type:r,i,o,n)}if(arguments.length===3){e=``+e,t=``+t;let o=this._nodes.get(e);if(!o)throw new h(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new h(`Graph.${a}: could not find the "${t}" target node in the graph.`);return Le(!1,r,this.multi,i,o,t,n)}throw new m(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};let o=`map`+n[0].toUpperCase()+n.slice(1);e.prototype[o]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop(),n;if(e.length===0){let i=0;r!==`directed`&&(i+=this.undirectedSize),r!==`undirected`&&(i+=this.directedSize),n=Array(i);let a=0;e.push((e,r,i,o,s,c,l)=>{n[a++]=t(e,r,i,o,s,c,l)})}else n=[],e.push((e,r,i,a,o,s,c)=>{n.push(t(e,r,i,a,o,s,c))});return this[a].apply(this,e),n};let s=`filter`+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop(),n=[];return e.push((e,r,i,a,o,s,c)=>{t(e,r,i,a,o,s,c)&&n.push(e)}),this[a].apply(this,e),n};let c=`reduce`+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(){let e=Array.prototype.slice.call(arguments);if(e.length<2||e.length>4)throw new m(`Graph.${c}: invalid number of arguments (expecting 2, 3 or 4 and got ${e.length}).`);if(typeof e[e.length-1]==`function`&&typeof e[e.length-2]!=`function`)throw new m(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let t,n;e.length===2?(t=e[0],n=e[1],e=[]):e.length===3?(t=e[1],n=e[2],e=[e[0]]):e.length===4&&(t=e[2],n=e[3],e=[e[0],e[1]]);let r=n;return e.push((e,n,i,a,o,s,c)=>{r=t(r,e,n,i,a,o,s,c)}),this[a].apply(this,e),r}}function He(e,t){let{name:n,type:r,direction:i}=t,a=`find`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t,n){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return!1;if(arguments.length===1)return n=e,Me(!0,this,r,n);if(arguments.length===2){e=``+e,n=t;let o=this._nodes.get(e);if(o===void 0)throw new h(`Graph.${a}: could not find the "${e}" node in the graph.`);return Pe(!0,this.multi,r===`mixed`?this.type:r,i,o,n)}if(arguments.length===3){e=``+e,t=``+t;let o=this._nodes.get(e);if(!o)throw new h(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new h(`Graph.${a}: could not find the "${t}" target node in the graph.`);return Le(!0,r,this.multi,i,o,t,n)}throw new m(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};let o=`some`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((e,n,r,i,a,o,s)=>t(e,n,r,i,a,o,s)),!!this[a].apply(this,e)};let s=`every`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((e,n,r,i,a,o,s)=>!t(e,n,r,i,a,o,s)),!this[a].apply(this,e)}}function Ue(e,t){let{name:n,type:r,direction:i}=t,a=n.slice(0,-1)+`Entries`;e.prototype[a]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return f();if(!arguments.length)return Ne(this,r);if(arguments.length===1){e=``+e;let t=this._nodes.get(e);if(!t)throw new h(`Graph.${a}: could not find the "${e}" node in the graph.`);return Ie(r,i,t)}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new h(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new h(`Graph.${a}: could not find the "${t}" target node in the graph.`);return ze(r,i,n,t)}throw new m(`Graph.${a}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function We(e){we.forEach(t=>{Be(e,t),Ve(e,t),He(e,t),Ue(e,t)})}let Ge=[{name:`neighbors`,type:`mixed`},{name:`inNeighbors`,type:`directed`,direction:`in`},{name:`outNeighbors`,type:`directed`,direction:`out`},{name:`inboundNeighbors`,type:`mixed`,direction:`in`},{name:`outboundNeighbors`,type:`mixed`,direction:`out`},{name:`directedNeighbors`,type:`directed`},{name:`undirectedNeighbors`,type:`undirected`}];function Ke(){this.A=null,this.B=null}Ke.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)},Ke.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function qe(e,t,n,r,i){for(let a in r){let o=r[a],s=o.source,c=o.target,l=s===n?c:s;if(t&&t.has(l.key))continue;let u=i(l.key,l.attributes);if(e&&u)return l.key}}function Je(e,t,n,r,i){if(t!==`mixed`){if(t===`undirected`)return qe(e,null,r,r.undirected,i);if(typeof n==`string`)return qe(e,null,r,r[n],i)}let a=new Ke,o;if(t!==`undirected`){if(n!==`out`){if(o=qe(e,null,r,r.in,i),e&&o)return o;a.wrap(r.in)}if(n!==`in`){if(o=qe(e,a,r,r.out,i),e&&o)return o;a.wrap(r.out)}}if(t!==`directed`&&(o=qe(e,a,r,r.undirected,i),e&&o))return o}function Ye(e,t,n){if(e!==`mixed`){if(e===`undirected`)return Object.keys(n.undirected);if(typeof t==`string`)return Object.keys(n[t])}let r=[];return Je(!1,e,t,n,function(e){r.push(e)}),r}function Xe(e,t,n){let r=Object.keys(n),i=r.length,a=0;return{[Symbol.iterator](){return this},next(){let o=null;do{if(a>=i)return e&&e.wrap(n),{done:!0};let s=n[r[a++]],c=s.source,l=s.target;o=c===t?l:c,e&&e.has(o.key)&&(o=null)}while(o===null);return{done:!1,value:{neighbor:o.key,attributes:o.attributes}}}}}function Ze(e,t,n){if(e!==`mixed`){if(e===`undirected`)return Xe(null,n,n.undirected);if(typeof t==`string`)return Xe(null,n,n[t])}let r=f(),i=new Ke;return e!==`undirected`&&(t!==`out`&&(r=d(r,Xe(i,n,n.in))),t!==`in`&&(r=d(r,Xe(i,n,n.out)))),e!==`directed`&&(r=d(r,Xe(i,n,n.undirected))),r}function Qe(e,t){let{name:n,type:r,direction:i}=t;e.prototype[n]=function(e){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return[];e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new h(`Graph.${n}: could not find the "${e}" node in the graph.`);return Ye(r===`mixed`?this.type:r,i,t)}}function $e(e,t){let{name:n,type:r,direction:i}=t,a=`forEach`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return;e=``+e;let n=this._nodes.get(e);if(n===void 0)throw new h(`Graph.${a}: could not find the "${e}" node in the graph.`);Je(!1,r===`mixed`?this.type:r,i,n,t)};let o=`map`+n[0].toUpperCase()+n.slice(1);e.prototype[o]=function(e,t){let n=[];return this[a](e,(e,r)=>{n.push(t(e,r))}),n};let s=`filter`+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(e,t){let n=[];return this[a](e,(e,r)=>{t(e,r)&&n.push(e)}),n};let c=`reduce`+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(e,t,n){if(arguments.length<3)throw new m(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let r=n;return this[a](e,(e,n)=>{r=t(r,e,n)}),r}}function et(e,t){let{name:n,type:r,direction:i}=t,a=n[0].toUpperCase()+n.slice(1,-1),o=`find`+a;e.prototype[o]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return;e=``+e;let n=this._nodes.get(e);if(n===void 0)throw new h(`Graph.${o}: could not find the "${e}" node in the graph.`);return Je(!0,r===`mixed`?this.type:r,i,n,t)};let s=`some`+a;e.prototype[s]=function(e,t){return!!this[o](e,t)};let c=`every`+a;e.prototype[c]=function(e,t){return!this[o](e,(e,n)=>!t(e,n))}}function tt(e,t){let{name:n,type:r,direction:i}=t,a=n.slice(0,-1)+`Entries`;e.prototype[a]=function(e){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return f();e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new h(`Graph.${a}: could not find the "${e}" node in the graph.`);return Ze(r===`mixed`?this.type:r,i,t)}}function nt(e){Ge.forEach(t=>{Qe(e,t),$e(e,t),et(e,t),tt(e,t)})}function rt(e,t,n,r,i){let a=r._nodes.values(),o=r.type,s,c,l,u,d,f,p;for(;s=a.next(),s.done!==!0;){let r=!1;if(c=s.value,o!==`undirected`)for(l in u=c.out,u){d=u[l];do{if(f=d.target,r=!0,p=i(c.key,f.key,c.attributes,f.attributes,d.key,d.attributes,d.undirected),e&&p)return d;d=d.next}while(d)}if(o!==`directed`){for(l in u=c.undirected,u)if(!(t&&c.key>l)){d=u[l];do{if(f=d.target,f.key!==l&&(f=d.source),r=!0,p=i(c.key,f.key,c.attributes,f.attributes,d.key,d.attributes,d.undirected),e&&p)return d;d=d.next}while(d)}}if(n&&!r&&(p=i(c.key,null,c.attributes,null,null,null,null),e&&p))return null}}function it(e,t){let n={key:e};return o(t.attributes)||(n.attributes=r({},t.attributes)),n}function at(e,t,n){let i={key:t,source:n.source.key,target:n.target.key};return o(n.attributes)||(i.attributes=r({},n.attributes)),e===`mixed`&&n.undirected&&(i.undirected=!0),i}function ot(e){if(!a(e))throw new m(`Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.`);if(!(`key`in e))throw new m(`Graph.import: serialized node is missing its key.`);if(`attributes`in e&&(!a(e.attributes)||e.attributes===null))throw new m(`Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.`)}function st(e){if(!a(e))throw new m(`Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.`);if(!(`source`in e))throw new m(`Graph.import: serialized edge is missing its source.`);if(!(`target`in e))throw new m(`Graph.import: serialized edge is missing its target.`);if(`attributes`in e&&(!a(e.attributes)||e.attributes===null))throw new m(`Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.`);if(`undirected`in e&&typeof e.undirected!=`boolean`)throw new m(`Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.`)}let ct=u(),lt=/* @__PURE__ */ new Set([`directed`,`undirected`,`mixed`]),ut=/* @__PURE__ */ new Set([`domain`,`_events`,`_eventsCount`,`_maxListeners`]),dt=[{name:e=>`${e}Edge`,generateKey:!0},{name:e=>`${e}DirectedEdge`,generateKey:!0,type:`directed`},{name:e=>`${e}UndirectedEdge`,generateKey:!0,type:`undirected`},{name:e=>`${e}EdgeWithKey`},{name:e=>`${e}DirectedEdgeWithKey`,type:`directed`},{name:e=>`${e}UndirectedEdgeWithKey`,type:`undirected`}],ft={allowSelfLoops:!0,multi:!1,type:`mixed`};function pt(e,t,n){if(n&&!a(n))throw new m(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=``+t,n||={},e._nodes.has(t))throw new g(`Graph.addNode: the "${t}" node already exist in the graph.`);let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit(`nodeAdded`,{key:t,attributes:n}),r}function mt(e,t,n){let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit(`nodeAdded`,{key:t,attributes:n}),r}function ht(e,t,n,r,i,o,s,c){if(!r&&e.type===`undirected`)throw new g(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&e.type===`directed`)throw new g(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(c&&!a(c))throw new m(`Graph.${t}: invalid attributes. Expecting an object but got "${c}"`);if(o=``+o,s=``+s,c||={},!e.allowSelfLoops&&o===s)throw new g(`Graph.${t}: source & target are the same ("${o}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let l=e._nodes.get(o),u=e._nodes.get(s);if(!l)throw new h(`Graph.${t}: source node "${o}" not found.`);if(!u)throw new h(`Graph.${t}: target node "${s}" not found.`);let d={key:null,undirected:r,source:o,target:s,attributes:c};if(n)i=e._edgeKeyGenerator();else if(i=``+i,e._edges.has(i))throw new g(`Graph.${t}: the "${i}" edge already exists in the graph.`);if(!e.multi&&(r?l.undirected[s]!==void 0:l.out[s]!==void 0))throw new g(`Graph.${t}: an edge linking "${o}" to "${s}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);let f=new v(r,i,l,u,c);e._edges.set(i,f);let p=o===s;return r?(l.undirectedDegree++,u.undirectedDegree++,p&&(l.undirectedLoops++,e._undirectedSelfLoopCount++)):(l.outDegree++,u.inDegree++,p&&(l.directedLoops++,e._directedSelfLoopCount++)),e.multi?f.attachMulti():f.attach(),r?e._undirectedSize++:e._directedSize++,d.key=i,e.emit(`edgeAdded`,d),i}function gt(e,t,n,i,o,s,c,l,u){if(!i&&e.type===`undirected`)throw new g(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(i&&e.type===`directed`)throw new g(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(l){if(u){if(typeof l!=`function`)throw new m(`Graph.${t}: invalid updater function. Expecting a function but got "${l}"`)}else if(!a(l))throw new m(`Graph.${t}: invalid attributes. Expecting an object but got "${l}"`)}s=``+s,c=``+c;let d;if(u&&(d=l,l=void 0),!e.allowSelfLoops&&s===c)throw new g(`Graph.${t}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let f=e._nodes.get(s),p=e._nodes.get(c),h,_;if(!n&&(h=e._edges.get(o),h)){if((h.source.key!==s||h.target.key!==c)&&(!i||h.source.key!==c||h.target.key!==s))throw new g(`Graph.${t}: inconsistency detected when attempting to merge the "${o}" edge with "${s}" source & "${c}" target vs. ("${h.source.key}", "${h.target.key}").`);_=h}if(!_&&!e.multi&&f&&(_=i?f.undirected[c]:f.out[c]),_){let t=[_.key,!1,!1,!1];if(u?!d:!l)return t;if(u){let t=_.attributes;_.attributes=d(t),e.emit(`edgeAttributesUpdated`,{type:`replace`,key:_.key,attributes:_.attributes})}else r(_.attributes,l),e.emit(`edgeAttributesUpdated`,{type:`merge`,key:_.key,attributes:_.attributes,data:l});return t}l||={},u&&d&&(l=d(l));let ee={key:null,undirected:i,source:s,target:c,attributes:l};if(n)o=e._edgeKeyGenerator();else if(o=``+o,e._edges.has(o))throw new g(`Graph.${t}: the "${o}" edge already exists in the graph.`);let te=!1,y=!1;f||(f=mt(e,s,{}),te=!0,s===c&&(p=f,y=!0)),p||(p=mt(e,c,{}),y=!0),h=new v(i,o,f,p,l),e._edges.set(o,h);let ne=s===c;return i?(f.undirectedDegree++,p.undirectedDegree++,ne&&(f.undirectedLoops++,e._undirectedSelfLoopCount++)):(f.outDegree++,p.inDegree++,ne&&(f.directedLoops++,e._directedSelfLoopCount++)),e.multi?h.attachMulti():h.attach(),i?e._undirectedSize++:e._directedSize++,ee.key=o,e.emit(`edgeAdded`,ee),[o,!0,te,y]}function b(e,t){e._edges.delete(t.key);let{source:n,target:r,attributes:i}=t,a=t.undirected,o=n===r;a?(n.undirectedDegree--,r.undirectedDegree--,o&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,o&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),a?e._undirectedSize--:e._directedSize--,e.emit(`edgeDropped`,{key:t.key,attributes:i,source:n.key,target:r.key,undirected:a})}var x=class e extends t.EventEmitter{constructor(e){if(super(),e=r({},ft,e),typeof e.multi!=`boolean`)throw new m(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!lt.has(e.type))throw new m(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!=`boolean`)throw new m(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);let t=e.type===`mixed`?_:e.type===`directed`?ee:te;s(this,`NodeDataClass`,t);let n=`geid_`+ct()+`_`,i=0;s(this,`_attributes`,{}),s(this,`_nodes`,/* @__PURE__ */ new Map),s(this,`_edges`,/* @__PURE__ */ new Map),s(this,`_directedSize`,0),s(this,`_undirectedSize`,0),s(this,`_directedSelfLoopCount`,0),s(this,`_undirectedSelfLoopCount`,0),s(this,`_edgeKeyGenerator`,()=>{let e;do e=n+i++;while(this._edges.has(e));return e}),s(this,`_options`,e),ut.forEach(e=>s(this,e,this[e])),c(this,`order`,()=>this._nodes.size),c(this,`size`,()=>this._edges.size),c(this,`directedSize`,()=>this._directedSize),c(this,`undirectedSize`,()=>this._undirectedSize),c(this,`selfLoopCount`,()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),c(this,`directedSelfLoopCount`,()=>this._directedSelfLoopCount),c(this,`undirectedSelfLoopCount`,()=>this._undirectedSelfLoopCount),c(this,`multi`,this._options.multi),c(this,`type`,this._options.type),c(this,`allowSelfLoops`,this._options.allowSelfLoops),c(this,`implementation`,()=>`graphology`)}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(``+e)}hasDirectedEdge(e,t){if(this.type===`undirected`)return!1;if(arguments.length===1){let t=``+e,n=this._edges.get(t);return!!n&&!n.undirected}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.out.hasOwnProperty(t):!1}throw new m(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,t){if(this.type===`directed`)return!1;if(arguments.length===1){let t=``+e,n=this._edges.get(t);return!!n&&n.undirected}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.undirected.hasOwnProperty(t):!1}throw new m(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,t){if(arguments.length===1){let t=``+e;return this._edges.has(t)}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.out!==void 0&&n.out.hasOwnProperty(t)||n.undirected!==void 0&&n.undirected.hasOwnProperty(t):!1}throw new m(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,t){if(this.type===`undirected`)return;if(e=``+e,t=``+t,this.multi)throw new g(`Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.`);let n=this._nodes.get(e);if(!n)throw new h(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new h(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);let r=n.out&&n.out[t]||void 0;if(r)return r.key}undirectedEdge(e,t){if(this.type===`directed`)return;if(e=``+e,t=``+t,this.multi)throw new g(`Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.`);let n=this._nodes.get(e);if(!n)throw new h(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new h(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);let r=n.undirected&&n.undirected[t]||void 0;if(r)return r.key}edge(e,t){if(this.multi)throw new g(`Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.`);e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new h(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new h(`Graph.edge: could not find the "${t}" target node in the graph.`);let r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key}areDirectedNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new h(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type===`undirected`?!1:t in n.in||t in n.out}areOutNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new h(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.out}areInNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new h(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.in}areUndirectedNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new h(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`directed`&&t in n.undirected}areNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new h(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&(t in n.in||t in n.out)||this.type!==`directed`&&t in n.undirected}areInboundNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new h(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.in||this.type!==`directed`&&t in n.undirected}areOutboundNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new h(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.out||this.type!==`directed`&&t in n.undirected}inDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new h(`Graph.inDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree}outDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new h(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.outDegree}directedDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new h(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree+t.outDegree}undirectedDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new h(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type===`directed`?0:t.undirectedDegree}inboundDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new h(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.inDegree),n}outboundDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new h(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.outDegree),n}degree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new h(`Graph.degree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.inDegree+t.outDegree),n}inDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new h(`Graph.inDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new h(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new h(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new h(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`directed`?0:t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new h(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.inDegree,r+=t.directedLoops),n-r}outboundDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new h(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.outDegree,r+=t.directedLoops),n-r}degreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new h(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.inDegree+t.outDegree,r+=t.directedLoops*2),n-r}source(e){e=``+e;let t=this._edges.get(e);if(!t)throw new h(`Graph.source: could not find the "${e}" edge in the graph.`);return t.source.key}target(e){e=``+e;let t=this._edges.get(e);if(!t)throw new h(`Graph.target: could not find the "${e}" edge in the graph.`);return t.target.key}extremities(e){e=``+e;let t=this._edges.get(e);if(!t)throw new h(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(e,t){e=``+e,t=``+t;let n=this._edges.get(t);if(!n)throw new h(`Graph.opposite: could not find the "${t}" edge in the graph.`);let r=n.source.key,i=n.target.key;if(e===r)return i;if(e===i)return r;throw new h(`Graph.opposite: the "${e}" node is not attached to the "${t}" edge (${r}, ${i}).`)}hasExtremity(e,t){e=``+e,t=``+t;let n=this._edges.get(e);if(!n)throw new h(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return n.source.key===t||n.target.key===t}isUndirected(e){e=``+e;let t=this._edges.get(e);if(!t)throw new h(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return t.undirected}isDirected(e){e=``+e;let t=this._edges.get(e);if(!t)throw new h(`Graph.isDirected: could not find the "${e}" edge in the graph.`);return!t.undirected}isSelfLoop(e){e=``+e;let t=this._edges.get(e);if(!t)throw new h(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return t.source===t.target}addNode(e,t){return pt(this,e,t).key}mergeNode(e,t){if(t&&!a(t))throw new m(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);e=``+e,t||={};let n=this._nodes.get(e);return n?(t&&(r(n.attributes,t),this.emit(`nodeAttributesUpdated`,{type:`merge`,key:e,attributes:n.attributes,data:t})),[e,!1]):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit(`nodeAdded`,{key:e,attributes:t}),[e,!0])}updateNode(e,t){if(t&&typeof t!=`function`)throw new m(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);e=``+e;let n=this._nodes.get(e);if(n){if(t){let r=n.attributes;n.attributes=t(r),this.emit(`nodeAttributesUpdated`,{type:`replace`,key:e,attributes:n.attributes})}return[e,!1]}let r=t?t({}):{};return n=new this.NodeDataClass(e,r),this._nodes.set(e,n),this.emit(`nodeAdded`,{key:e,attributes:r}),[e,!0]}dropNode(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new h(`Graph.dropNode: could not find the "${e}" node in the graph.`);let n;if(this.type!==`undirected`){for(let e in t.out){n=t.out[e];do b(this,n),n=n.next;while(n)}for(let e in t.in){n=t.in[e];do b(this,n),n=n.next;while(n)}}if(this.type!==`directed`)for(let e in t.undirected){n=t.undirected[e];do b(this,n),n=n.next;while(n)}this._nodes.delete(e),this.emit(`nodeDropped`,{key:e,attributes:t.attributes})}dropEdge(e){let t;if(arguments.length>1){let e=``+arguments[0],n=``+arguments[1];if(t=i(this,e,n,this.type),!t)throw new h(`Graph.dropEdge: could not find the "${e}" -> "${n}" edge in the graph.`)}else if(e=``+e,t=this._edges.get(e),!t)throw new h(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return b(this,t),this}dropDirectedEdge(e,t){if(arguments.length<2)throw new g(`Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.`);if(this.multi)throw new g(`Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.`);e=``+e,t=``+t;let n=i(this,e,t,`directed`);if(!n)throw new h(`Graph.dropDirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return b(this,n),this}dropUndirectedEdge(e,t){if(arguments.length<2)throw new g(`Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.`);if(this.multi)throw new g(`Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.`);let n=i(this,e,t,`undirected`);if(!n)throw new h(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return b(this,n),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit(`cleared`)}clearEdges(){let e=this._nodes.values(),t;for(;t=e.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit(`edgesCleared`)}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,t){return this._attributes[e]=t,this.emit(`attributesUpdated`,{type:`set`,attributes:this._attributes,name:e}),this}updateAttribute(e,t){if(typeof t!=`function`)throw new m(`Graph.updateAttribute: updater should be a function.`);let n=this._attributes[e];return this._attributes[e]=t(n),this.emit(`attributesUpdated`,{type:`set`,attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit(`attributesUpdated`,{type:`remove`,attributes:this._attributes,name:e}),this}replaceAttributes(e){if(!a(e))throw new m(`Graph.replaceAttributes: provided attributes are not a plain object.`);return this._attributes=e,this.emit(`attributesUpdated`,{type:`replace`,attributes:this._attributes}),this}mergeAttributes(e){if(!a(e))throw new m(`Graph.mergeAttributes: provided attributes are not a plain object.`);return r(this._attributes,e),this.emit(`attributesUpdated`,{type:`merge`,attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!=`function`)throw new m(`Graph.updateAttributes: provided updater is not a function.`);return this._attributes=e(this._attributes),this.emit(`attributesUpdated`,{type:`update`,attributes:this._attributes}),this}updateEachNodeAttributes(e,t){if(typeof e!=`function`)throw new m(`Graph.updateEachNodeAttributes: expecting an updater function.`);if(t&&!l(t))throw new m(`Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}`);let n=this._nodes.values(),r,i;for(;r=n.next(),r.done!==!0;)i=r.value,i.attributes=e(i.key,i.attributes);this.emit(`eachNodeAttributesUpdated`,{hints:t||null})}updateEachEdgeAttributes(e,t){if(typeof e!=`function`)throw new m(`Graph.updateEachEdgeAttributes: expecting an updater function.`);if(t&&!l(t))throw new m(`Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}`);let n=this._edges.values(),r,i,a,o;for(;r=n.next(),r.done!==!0;)i=r.value,a=i.source,o=i.target,i.attributes=e(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected);this.emit(`eachEdgeAttributesUpdated`,{hints:t||null})}forEachAdjacencyEntry(e){if(typeof e!=`function`)throw new m(`Graph.forEachAdjacencyEntry: expecting a callback.`);rt(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!=`function`)throw new m(`Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.`);rt(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!=`function`)throw new m(`Graph.forEachAssymetricAdjacencyEntry: expecting a callback.`);rt(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!=`function`)throw new m(`Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.`);rt(!1,!0,!0,this,e)}nodes(){return Array.from(this._nodes.keys())}forEachNode(e){if(typeof e!=`function`)throw new m(`Graph.forEachNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)}findNode(e){if(typeof e!=`function`)throw new m(`Graph.findNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return r.key}mapNodes(e){if(typeof e!=`function`)throw new m(`Graph.mapNode: expecting a callback.`);let t=this._nodes.values(),n,r,i=Array(this.order),a=0;for(;n=t.next(),n.done!==!0;)r=n.value,i[a++]=e(r.key,r.attributes);return i}someNode(e){if(typeof e!=`function`)throw new m(`Graph.someNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return!0;return!1}everyNode(e){if(typeof e!=`function`)throw new m(`Graph.everyNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,!e(r.key,r.attributes))return!1;return!0}filterNodes(e){if(typeof e!=`function`)throw new m(`Graph.filterNodes: expecting a callback.`);let t=this._nodes.values(),n,r,i=[];for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)&&i.push(r.key);return i}reduceNodes(e,t){if(typeof e!=`function`)throw new m(`Graph.reduceNodes: expecting a callback.`);if(arguments.length<2)throw new m(`Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let n=t,r=this._nodes.values(),i,a;for(;i=r.next(),i.done!==!0;)a=i.value,n=e(n,a.key,a.attributes);return n}nodeEntries(){let e=this._nodes.values();return{[Symbol.iterator](){return this},next(){let t=e.next();if(t.done)return t;let n=t.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}}}export(){let e=Array(this._nodes.size),t=0;this._nodes.forEach((n,r)=>{e[t++]=it(r,n)});let n=Array(this._edges.size);return t=0,this._edges.forEach((e,r)=>{n[t++]=at(this.type,r,e)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:n}}import(t,n=!1){if(t instanceof e)return t.forEachNode((e,t)=>{n?this.mergeNode(e,t):this.addNode(e,t)}),t.forEachEdge((e,t,r,i,a,o,s)=>{n?s?this.mergeUndirectedEdgeWithKey(e,r,i,t):this.mergeDirectedEdgeWithKey(e,r,i,t):s?this.addUndirectedEdgeWithKey(e,r,i,t):this.addDirectedEdgeWithKey(e,r,i,t)}),this;if(!a(t))throw new m(`Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.`);if(t.attributes){if(!a(t.attributes))throw new m(`Graph.import: invalid attributes. Expecting a plain object.`);n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let r,i,o,s,c;if(t.nodes){if(o=t.nodes,!Array.isArray(o))throw new m(`Graph.import: invalid nodes. Expecting an array.`);for(r=0,i=o.length;r<i;r++){s=o[r],ot(s);let{key:e,attributes:t}=s;n?this.mergeNode(e,t):this.addNode(e,t)}}if(t.edges){let e=!1;if(this.type===`undirected`&&(e=!0),o=t.edges,!Array.isArray(o))throw new m(`Graph.import: invalid edges. Expecting an array.`);for(r=0,i=o.length;r<i;r++){c=o[r],st(c);let{source:t,target:i,attributes:a,undirected:s=e}=c,l;`key`in c?(l=n?s?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:s?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,l.call(this,c.key,t,i,a)):(l=n?s?this.mergeUndirectedEdge:this.mergeDirectedEdge:s?this.addUndirectedEdge:this.addDirectedEdge,l.call(this,t,i,a))}}return this}nullCopy(t){let n=new e(r({},this._options,t));return n.replaceAttributes(r({},this.getAttributes())),n}emptyCopy(e){let t=this.nullCopy(e);return this._nodes.forEach((e,n)=>{let i=r({},e.attributes);e=new t.NodeDataClass(n,i),t._nodes.set(n,e)}),t}copy(e){if(e||={},typeof e.type==`string`&&e.type!==this.type&&e.type!==`mixed`)throw new g(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean losing information about the current graph.`);if(typeof e.multi==`boolean`&&e.multi!==this.multi&&e.multi!==!0)throw new g(`Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.`);if(typeof e.allowSelfLoops==`boolean`&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new g(`Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.`);let t=this.emptyCopy(e),n=this._edges.values(),i,a;for(;i=n.next(),i.done!==!0;)a=i.value,ht(t,`copy`,!1,a.undirected,a.key,a.source.key,a.target.key,r({},a.attributes));return t}toJSON(){return this.export()}toString(){return`[object Graph]`}inspect(){let e={};this._nodes.forEach((t,n)=>{e[n]=t.attributes});let t={},n={};this._edges.forEach((e,r)=>{let i=e.undirected?`--`:`->`,a=``,o=e.source.key,s=e.target.key,c;e.undirected&&o>s&&(c=o,o=s,s=c);let l=`(${o})${i}(${s})`;r.startsWith(`geid_`)?this.multi&&(n[l]===void 0?n[l]=0:n[l]++,a+=`${n[l]}. `):a+=`[${r}]: `,a+=l,t[a]=e.attributes});let r={};for(let e in this)this.hasOwnProperty(e)&&!ut.has(e)&&typeof this[e]!=`function`&&typeof e!=`symbol`&&(r[e]=this[e]);return r.attributes=this._attributes,r.nodes=e,r.edges=t,s(r,`constructor`,this.constructor),r}};typeof Symbol<`u`&&(x.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=x.prototype.inspect),dt.forEach(e=>{[`add`,`merge`,`update`].forEach(t=>{let n=e.name(t),r=t===`add`?ht:gt;e.generateKey?x.prototype[n]=function(i,a,o){return r(this,n,!0,(e.type||this.type)===`undirected`,null,i,a,o,t===`update`)}:x.prototype[n]=function(i,a,o,s){return r(this,n,!1,(e.type||this.type)===`undirected`,i,a,o,s,t===`update`)}})}),fe(x),Ce(x),We(x),nt(x);var _t=class extends x{constructor(e){let t=r({type:`directed`},e);if(`multi`in t&&t.multi!==!1)throw new m(`DirectedGraph.from: inconsistent indication that the graph should be multi in given options!`);if(t.type!==`directed`)throw new m(`DirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},vt=class extends x{constructor(e){let t=r({type:`undirected`},e);if(`multi`in t&&t.multi!==!1)throw new m(`UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!`);if(t.type!==`undirected`)throw new m(`UndirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},yt=class extends x{constructor(e){let t=r({multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new m(`MultiGraph.from: inconsistent indication that the graph should be simple in given options!`);super(t)}},bt=class extends x{constructor(e){let t=r({type:`directed`,multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new m(`MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!`);if(t.type!==`directed`)throw new m(`MultiDirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},xt=class extends x{constructor(e){let t=r({type:`undirected`,multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new m(`MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!`);if(t.type!==`undirected`)throw new m(`MultiUndirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}};function St(e){e.from=function(t,n){let i=new e(r({},t.options,n));return i.import(t),i}}St(x),St(_t),St(vt),St(yt),St(bt),St(xt),x.Graph=x,x.DirectedGraph=_t,x.UndirectedGraph=vt,x.MultiGraph=yt,x.MultiDirectedGraph=bt,x.MultiUndirectedGraph=xt,x.InvalidArgumentsGraphError=m,x.NotFoundGraphError=h,x.UsageGraphError=g;var Ct=/* @__PURE__ */ e(((e,t)=>{t.exports=function(e){return typeof e==`object`&&!!e&&typeof e.addUndirectedEdgeWithKey==`function`&&typeof e.dropNode==`function`&&typeof e.multi==`boolean`}})),wt=/* @__PURE__ */ e(((e,t)=>{let n=Ct();t.exports=function(e){if(!n(e))throw Error(`graphology-dag/has-cycle: the given graph is not a valid graphology instance.`);if(e.size===0)return!1;if(e.selfLoopCount!==0)return!0;let t={},r=[];function i(e){let n=t[e];if(n===void 0)r.push(e);else if(n===0)return!0;return!1}return e.someNode(n=>{if(t[n]===1)return!1;for(r.push(n);r.length!==0;){let n=r[r.length-1],a=t[n];if(a!==0){if(t[n]=0,e.someOutboundNeighbor(n,i))return!0}else a===0&&(r.pop(),t[n]=1)}return!1})}})),Tt=/* @__PURE__ */ e(((e,t)=>{let n=Ct();t.exports=function(e,t,r){if(!n(e))throw Error(`graphology-dag/will-create-cycle: the given graph is not a valid graphology instance.`);if(t=``+t,r=``+r,t===r)return!0;if(!e.hasNode(t)||!e.hasNode(r)||e.hasDirectedEdge(t,r))return!1;if(e.hasDirectedEdge(r,t))return!0;let i=e.outNeighbors(r);function a(e){i.push(e)}for(;i.length!==0;){let n=i.pop();if(n===t)return!0;e.forEachOutNeighbor(n,a)}return!1}})),Et=/* @__PURE__ */ e((e=>{e.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<`u`,e.SYMBOL_SUPPORT=typeof Symbol<`u`})),Dt=/* @__PURE__ */ e(((e,t)=>{var n=Et(),r=n.ARRAY_BUFFER_SUPPORT,i=n.SYMBOL_SUPPORT;t.exports=function(e,t){var n,a,o,s,c;if(!e)throw Error(`obliterator/forEach: invalid iterable.`);if(typeof t!=`function`)throw Error(`obliterator/forEach: expecting a callback.`);if(Array.isArray(e)||r&&ArrayBuffer.isView(e)||typeof e==`string`||e.toString()===`[object Arguments]`)for(o=0,s=e.length;o<s;o++)t(e[o],o);else if(typeof e.forEach==`function`)e.forEach(t);else if(i&&Symbol.iterator in e&&typeof e.next!=`function`&&(e=e[Symbol.iterator]()),typeof e.next==`function`)for(n=e,o=0;c=n.next(),c.done!==!0;)t(c.value,o),o++;else for(a in e)e.hasOwnProperty(a)&&t(e[a],a)}})),Ot=/* @__PURE__ */ e((e=>{var t=2**16-1,n=2**32-1,r=127,i=2**15-1,a=2**31-1;e.getPointerArray=function(e){var r=e-1;if(r<=255)return Uint8Array;if(r<=t)return Uint16Array;if(r<=n)return Uint32Array;throw Error(`mnemonist: Pointer Array of size > 4294967295 is not supported.`)},e.getSignedPointerArray=function(e){var t=e-1;return t<=r?Int8Array:t<=i?Int16Array:t<=a?Int32Array:Float64Array},e.getNumberType=function(e){return e===(e|0)?Math.sign(e)===-1?e<=127&&e>=-128?Int8Array:e<=32767&&e>=-32768?Int16Array:Int32Array:e<=255?Uint8Array:e<=65535?Uint16Array:Uint32Array:Float64Array};var o={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};e.getMinimalRepresentation=function(t,n){for(var r=null,i=0,a,s,c,l=0,u=t.length;l<u;l++)c=n?n(t[l]):t[l],s=e.getNumberType(c),a=o[s.name],a>i&&(i=a,r=s);return r},e.isTypedArray=function(e){return typeof ArrayBuffer<`u`&&ArrayBuffer.isView(e)},e.concat=function(){for(var e=0,t=0,n,r=arguments.length;t<r;t++)e+=arguments[t].length;var i=new arguments[0].constructor(e);for(t=0,n=0;t<r;t++)i.set(arguments[t],n),n+=arguments[t].length;return i},e.indices=function(t){for(var n=new(e.getPointerArray(t))(t),r=0;r<t;r++)n[r]=r;return n}})),kt=/* @__PURE__ */ e((e=>{var t=Dt(),n=Ot();function r(e){return Array.isArray(e)||n.isTypedArray(e)}function i(e){if(typeof e.length==`number`)return e.length;if(typeof e.size==`number`)return e.size}function a(e){var n=i(e),r=typeof n==`number`?Array(n):[],a=0;return t(e,function(e){r[a++]=e}),r}function o(e){var r=i(e),a=typeof r==`number`?n.getPointerArray(r):Array,o=typeof r==`number`?Array(r):[],s=typeof r==`number`?new a(r):[],c=0;return t(e,function(e){o[c]=e,s[c]=c++}),[o,s]}e.isArrayLike=r,e.guessLength=i,e.toArray=a,e.toArrayWithIndices=o})),At=/* @__PURE__ */ e(((e,t)=>{function n(e){if(typeof e!=`function`)throw Error(`obliterator/iterator: expecting a function!`);this.next=e}typeof Symbol<`u`&&(n.prototype[Symbol.iterator]=function(){return this}),n.of=function(){var e=arguments,t=e.length,r=0;return new n(function(){return r>=t?{done:!0}:{done:!1,value:e[r++]}})},n.empty=function(){return new n(function(){return{done:!0}})},n.fromSequence=function(e){var t=0,r=e.length;return new n(function(){return t>=r?{done:!0}:{done:!1,value:e[t++]}})},n.is=function(e){return e instanceof n||typeof e==`object`&&!!e&&typeof e.next==`function`},t.exports=n})),jt=/* @__PURE__ */ e(((e,t)=>{var n=kt(),r=At();function i(e,t){if(arguments.length<2)throw Error(`mnemonist/fixed-deque: expecting an Array class and a capacity.`);if(typeof t!=`number`||t<=0)throw Error("mnemonist/fixed-deque: `capacity` should be a positive number.");this.ArrayClass=e,this.capacity=t,this.items=new e(this.capacity),this.clear()}i.prototype.clear=function(){this.start=0,this.size=0},i.prototype.push=function(e){if(this.size===this.capacity)throw Error(`mnemonist/fixed-deque.push: deque capacity (`+this.capacity+`) exceeded!`);var t=this.start+this.size;return t>=this.capacity&&(t-=this.capacity),this.items[t]=e,++this.size},i.prototype.unshift=function(e){if(this.size===this.capacity)throw Error(`mnemonist/fixed-deque.unshift: deque capacity (`+this.capacity+`) exceeded!`);var t=this.start-1;return this.start===0&&(t=this.capacity-1),this.items[t]=e,this.start=t,++this.size},i.prototype.pop=function(){if(this.size!==0){this.size--;var e=this.start+this.size;return e>=this.capacity&&(e-=this.capacity),this.items[e]}},i.prototype.shift=function(){if(this.size!==0){var e=this.start;return this.size--,this.start++,this.start===this.capacity&&(this.start=0),this.items[e]}},i.prototype.peekFirst=function(){if(this.size!==0)return this.items[this.start]},i.prototype.peekLast=function(){if(this.size!==0){var e=this.start+this.size-1;return e>=this.capacity&&(e-=this.capacity),this.items[e]}},i.prototype.get=function(e){if(!(this.size===0||e>=this.capacity))return e=this.start+e,e>=this.capacity&&(e-=this.capacity),this.items[e]},i.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=this.capacity,r=this.size,i=this.start,a=0;a<r;)e.call(t,this.items[i],a,this),i++,a++,i===n&&(i=0)},i.prototype.toArray=function(){var e=this.start+this.size;if(e<this.capacity)return this.items.slice(this.start,e);for(var t=new this.ArrayClass(this.size),n=this.capacity,r=this.size,i=this.start,a=0;a<r;)t[a]=this.items[i],i++,a++,i===n&&(i=0);return t},i.prototype.values=function(){var e=this.items,t=this.capacity,n=this.size,i=this.start,a=0;return new r(function(){if(a>=n)return{done:!0};var r=e[i];return i++,a++,i===t&&(i=0),{value:r,done:!1}})},i.prototype.entries=function(){var e=this.items,t=this.capacity,n=this.size,i=this.start,a=0;return new r(function(){if(a>=n)return{done:!0};var r=e[i];return i++,i===t&&(i=0),{value:[a++,r],done:!1}})},typeof Symbol<`u`&&(i.prototype[Symbol.iterator]=i.prototype.values),i.prototype.inspect=function(){var e=this.toArray();return e.type=this.ArrayClass.name,e.capacity=this.capacity,Object.defineProperty(e,"constructor",{value:i,enumerable:!1}),e},typeof Symbol<`u`&&(i.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=i.prototype.inspect),i.from=function(e,t,r){if(arguments.length<3&&(r=n.guessLength(e),typeof r!=`number`))throw Error(`mnemonist/fixed-deque.from: could not guess iterable length. Please provide desired capacity as last argument.`);var a=new i(t,r);if(n.isArrayLike(e)){for(var o=0,s=e.length;o<s;o++)a.items[o]=e[o];return a.size=s,a}return n.forEach(e,function(e){a.push(e)}),a},t.exports=i})),Mt=/* @__PURE__ */ e((e=>{let t=Ct(),n=jt();function r(e,t){let n=0;return e.forEachInNeighbor(t,()=>{n++}),n}function i(e,i){if(!t(e))throw Error(`graphology-dag/topological-sort: the given graph is not a valid graphology instance.`);if(e.type===`undirected`||e.undirectedSize!==0)throw Error(`graphology-dag/topological-sort: cannot work if graph is not directed.`);if(e.order===0)return;let a=new n(Array,e.order),o={},s=0;e.forEachNode((t,n)=>{let i=e.multi?r(e,t):e.inDegree(t);i===0?a.push([t,n,0]):(o[t]=i,s+=i)});let c=0;function l(e,t){let n=--o[e];s--,n===0&&a.push([e,t,c+1]),o[e]=n}for(;a.size!==0;){let[t,n,r]=a.shift();c=r,i(t,n,r),e.forEachOutNeighbor(t,l)}if(s!==0)throw Error(`graphology-dag/topological-sort: given graph is not acyclic.`)}function a(e){if(!t(e))throw Error(`graphology-dag/topological-sort: the given graph is not a valid graphology instance.`);let n=Array(e.order),r=0;return i(e,e=>{n[r++]=e}),n}function o(e,n){if(!t(e))throw Error(`graphology-dag/topological-generations: the given graph is not a valid graphology instance.`);if(e.order===0)return;let r=0,a=[];i(e,(e,t,i)=>{i>r&&(n(a),r=i,a=[]),a.push(e)}),n(a)}function s(e){if(!t(e))throw Error(`graphology-dag/topological-generations: the given graph is not a valid graphology instance.`);let n=[];return o(e,e=>{n.push(e)}),n}e.topologicalSort=a,e.forEachNodeInTopologicalOrder=i,e.topologicalGenerations=s,e.forEachTopologicalGeneration=o}));(/* @__PURE__ */ e((e=>{e.hasCycle=wt(),e.willCreateCycle=Tt();let t=Mt();e.forEachNodeInTopologicalOrder=t.forEachNodeInTopologicalOrder,e.topologicalSort=t.topologicalSort,e.topologicalGenerations=t.topologicalGenerations,e.forEachTopologicalGeneration=t.forEachTopologicalGeneration})))();function Nt(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return Object.getOwnPropertyDescriptor(e,t)?.value}function S(e,t){let n=Nt(e,t);if(typeof n==`number`&&Number.isFinite(n))return n;if(typeof n==`string`&&n.trim()!==``){let e=Number(n);if(Number.isFinite(e))return e}}function C(e,t){let n=Nt(e,t);if(typeof n==`string`&&n.trim()!==``)return n}function w(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Pt(e){if(!w(e))return{};let t=S(e,`bytes_processed`),n=S(e,`bytes_billed`),r=S(e,`slot_ms`),i=S(e,`rows_affected`),a=C(e,`code`),o=C(e,`_message`),s=C(e,`query_id`)??C(e,`job_id`),c=C(e,`project_id`),l=C(e,`location`);return{...t===void 0?{}:{bytesProcessed:t},...n===void 0?{}:{bytesBilled:n},...r===void 0?{}:{slotMs:r},...i===void 0?{}:{rowsAffected:i},...a===void 0?{}:{adapterCode:a},...o===void 0?{}:{adapterMessage:o},...s===void 0?{}:{queryId:s},...c===void 0?{}:{projectId:c},...l===void 0?{}:{location:l}}}function T(e,t){if(!w(e))return{rawKeys:[]};let n=Object.keys(e).filter(e=>typeof e==`string`);return{...Pt(e),...t,rawKeys:n}}let Ft={name:`generic`,parse(e){return T(e,{})}},It={name:`athena`,parse(e){if(!w(e))return{rawKeys:[]};let t=S(e,`data_scanned_in_bytes`);return T(e,{...t===void 0?{}:{bytesProcessed:t}})},canParse(e){return w(e)?`data_scanned_in_bytes`in e:!1}},Lt={name:`bigquery`,parse(e){if(!w(e))return{rawKeys:[]};let t=S(e,`bytes_processed`),n=S(e,`bytes_billed`),r=S(e,`slot_ms`),i=C(e,`project_id`),a=C(e,`location`),o=C(e,`query_id`)??C(e,`job_id`);return T(e,{...t===void 0?{}:{bytesProcessed:t},...n===void 0?{}:{bytesBilled:n},...r===void 0?{}:{slotMs:r},...o===void 0?{}:{queryId:o},...i===void 0?{}:{projectId:i},...a===void 0?{}:{location:a}})},canParse(e){return w(e)?`bytes_processed`in e||`bytes_billed`in e||`slot_ms`in e||`job_id`in e||`location`in e:!1}},Rt={name:`postgres`,parse(e){return T(e,{})}},zt={name:`redshift`,parse(e){return T(e,{})}},Bt={name:`snowflake`,parse(e){if(!w(e))return{rawKeys:[]};let t=S(e,`rows_inserted`),n=S(e,`rows_deleted`),r=S(e,`rows_updated`),i=S(e,`rows_duplicates`);return T(e,{...t===void 0?{}:{rowsInserted:t},...n===void 0?{}:{rowsDeleted:n},...r===void 0?{}:{rowsUpdated:r},...i===void 0?{}:{rowsDuplicated:i}})},canParse(e){return w(e)?`rows_inserted`in e||`rows_deleted`in e||`rows_updated`in e||`rows_duplicates`in e:!1}},Vt=/* @__PURE__ */ new Map([[`athena`,It],[`bigquery`,Lt],[`postgres`,Rt],[`redshift`,zt],[`snowflake`,Bt],[`spark`,{name:`spark`,parse(e){return T(e,{})}}]]),Ht=[Lt,Bt,It];new class{selectParser(e,t){if(e&&typeof e==`string`){let n=e.toLowerCase().trim(),r=Vt.get(n);if(r&&(!r.canParse||r.canParse(t)))return r}for(let e of Ht)if(e.canParse&&e.canParse(t))return e;return Ft}},new Map([`bytes_processed`,`bytes_billed`,`slot_ms`,`rows_affected`,`rows_inserted`,`rows_updated`,`rows_deleted`,`rows_duplicated`].map(e=>[`${e}_desc`,e]));let Ut=[{key:`queryId`,label:`Query ID`,shortLabel:`Query ID`,kind:`string`,humanSortKey:`query_id`},{key:`adapterCode`,label:`Adapter code`,shortLabel:`Code`,kind:`string`,humanSortKey:`adapter_code`},{key:`adapterMessage`,label:`Adapter message`,shortLabel:`Message`,kind:`string`,humanSortKey:`adapter_message`},{key:`bytesProcessed`,label:`Bytes processed`,shortLabel:`Bytes processed`,kind:`number`,humanSortKey:`bytes_processed`,summaryTotalKey:`totalBytesProcessed`},{key:`bytesBilled`,label:`Bytes billed`,shortLabel:`Bytes billed`,kind:`number`,humanSortKey:`bytes_billed`,summaryTotalKey:`totalBytesBilled`},{key:`slotMs`,label:`Slot ms`,shortLabel:`Slot ms`,kind:`number`,humanSortKey:`slot_ms`,summaryTotalKey:`totalSlotMs`},{key:`rowsAffected`,label:`Rows affected`,shortLabel:`Rows`,kind:`number`,humanSortKey:`rows_affected`,summaryTotalKey:`totalRowsAffected`},{key:`projectId`,label:`Project ID`,shortLabel:`Project`,kind:`string`,humanSortKey:`project_id`},{key:`location`,label:`Location`,shortLabel:`Location`,kind:`string`,humanSortKey:`location`},{key:`rowsInserted`,label:`Rows inserted`,shortLabel:`Inserted`,kind:`number`,humanSortKey:`rows_inserted`,summaryTotalKey:`totalRowsInserted`},{key:`rowsUpdated`,label:`Rows updated`,shortLabel:`Updated`,kind:`number`,humanSortKey:`rows_updated`,summaryTotalKey:`totalRowsUpdated`},{key:`rowsDeleted`,label:`Rows deleted`,shortLabel:`Deleted`,kind:`number`,humanSortKey:`rows_deleted`,summaryTotalKey:`totalRowsDeleted`},{key:`rowsDuplicated`,label:`Rows duplicated`,shortLabel:`Duplicated`,kind:`number`,humanSortKey:`rows_duplicated`,summaryTotalKey:`totalRowsDuplicated`}];function Wt(e,t){if(e!=null)return Nt(e,t)}function Gt(e,t){return t===void 0?`—`:e.kind===`number`&&typeof t==`number`?t.toLocaleString(`en-US`):String(t)}function Kt(e){return Ut.filter(t=>e.some(e=>Wt(e,t.key)!==void 0))}function qt(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Jt(e,t=`|`){return e.map(e=>hn(e)).join(t)}function Yt(e,t){return typeof t==`bigint`?t.toString():t}var Xt=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function Zt(e){return new Xt(e)}function Qt(e){return e==null}function $t(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function en(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function E(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function tn(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function D(e){return tn(e._zod.def)??e._zod.def.shape}function nn(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return E(this,t,e),e},enumerable:!0,configurable:!0})}function rn(e,t,n){t in e?E(e,t,n):e[t]=n}function O(e,t,n,r){let i=D(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?nn(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):rn(e,a,r?r(n.value,a):n.value))}}function an(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?nn(e,n,()=>t[n]):rn(e,n,r.value))}}function k(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function on(e){return JSON.stringify(e)}function sn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}let cn=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ln(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}let un=/* @__PURE__*/ Zt(()=>{if(z.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function dn(e){if(ln(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return ln(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function fn(e){return dn(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let pn=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function mn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function A(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function j(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function hn(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function gn(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}let _n={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},vn={int64:[/* @__PURE__*/ BigInt(`-9223372036854775808`),/* @__PURE__*/ BigInt(`9223372036854775807`)],uint64:[/* @__PURE__*/ BigInt(0),/* @__PURE__*/ BigInt(`18446744073709551615`)]};function yn(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return O(i,e,bn(e,t)),A(e,k(n,{shape:i,checks:[]}))}function bn(e,t){let n=D(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function xn(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(bn(e,t)),a={};return O(a,e,Reflect.ownKeys(D(e)).filter(e=>!i.has(e))),A(e,k(n,{shape:a,checks:[]}))}function Sn(e,t){if(!dn(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=D(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return A(e,k(e._zod.def,{shape:Cn(e,t)}))}function Cn(e,t){let n={};return O(n,e,Reflect.ownKeys(D(e))),an(n,t),n}function wn(e,t){if(!dn(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return A(e,k(e._zod.def,{shape:Cn(e,t)}))}function Tn(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return O(n,e,Reflect.ownKeys(D(e))),O(n,t,Reflect.ownKeys(D(t))),A(e,k(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function En(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(bn(t,n)):void 0,o={};return O(o,t,Reflect.ownKeys(D(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),A(t,k(t._zod.def,{shape:o,checks:[]}))}function Dn(e,t,n){let r=n?new Set(bn(t,n)):void 0,i={};return O(i,t,Reflect.ownKeys(D(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),A(t,k(t._zod.def,{shape:i}))}function M(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function On(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function kn(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function An(e){return typeof e==`string`?e:e?.message}function jn(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Mn(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function N(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:An(e.inst?._zod.def?.error?.(e))??An(a?.(e))??An(t?.error?.(e))??An(n.customError?.(e))??An(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}let Nn=/[\uD800-\uDBFF]/;function Pn(e){let t=e.length;if(!Nn.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Fn(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function In(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Ln(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Rn(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Vn(e,n,r.value)}}function P(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function zn(e,t,n){return P(e,t,n,!1)}/* @__NO_SIDE_EFFECTS__ */
|
|
2
|
+
function Bn(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return P(this,n,r(this))},set(e){P(this,n,e)}})}return t}function Vn(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:P(this,t,n.bind(this))},set(e){P(this,t,e)}})}function Hn(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}let Un,F=!1,Wn={configurable:!0,get(){F=!0}};function I(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&Un!==e._zod?Un=void 0:(Un=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Wn);let e=F;F=!1;try{let r=n(this);return F?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),F||=e,r}catch(n){throw delete this[t],F||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function Gn(e,t,n,r){let i=Hn(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}function Kn(e){let t=()=>e;return t[`~constantCatch`]=!0,t}var qn;let Jn={value:void 0,enumerable:!1},Yn=`captureStackTrace`in Error?Error:null;function Xn(e){let t=Yn;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Yn=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}/* @__NO_SIDE_EFFECTS__ */
|
|
3
|
+
function L(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=/* @__PURE__ */ new Set}a.prototype=i;let o=n,s=o&&/* @__PURE__ */ new WeakSet;function c(n,r){if(!n._zod){Jn.value=new a(r);try{Object.defineProperty(n,"_zod",Jn)}finally{Jn.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Rn(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Xn(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var R=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Zn=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(qn=globalThis).__zod_globalConfig??(qn.__zod_globalConfig={});let z=globalThis.__zod_globalConfig;function B(e){return e&&Object.assign(z,e),z}function Qn(){let e=this._zod;return e.message??=JSON.stringify(e.def,Yt,2),e.message}function $n(e){this._zod.message=e}let er={get:Qn,set:$n,enumerable:!0,configurable:!0},tr={value:void 0,enumerable:!1},nr=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),rr=/* @__PURE__ */ L(`$ZodError`,(e,t)=>{e.name=`$ZodError`,tr.value=t,Object.defineProperty(e,"issues",tr),tr.value=void 0,Object.defineProperty(e,"message",er);let n=Object.getPrototypeOf(e);nr.has(n)||(nr.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function ir(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function ar(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?ir(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function or(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function sr(e,t){return{callee:t?.callee??e,Err:t?.Err}}let cr=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new R;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>N(e,o,B())));throw cn(n,a?.callee??t),n}return s.value};return t},lr=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>N(e,o,B())));throw cn(n,a?.callee??t),n}return s.value};return t},ur=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new R;return a.issues.length?dr(e,a.issues,i):{success:!0,data:a.value}};function dr(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>N(e,n,B()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}let fr=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?dr(e,a.issues,i):{success:!0,data:a.value}},pr=/* @__PURE__ */ Symbol.for(`zod.compile.invalid`),mr=/* @__PURE__ */ Symbol.for(`zod.compile.fallback`),hr=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==pr)return!0;if(r.definite===!0&&n===void 0)return!1}return gr(e,t,n)});function gr(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[mr]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new R;return a.issues.length===0}let _r=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},vr=e=>{let t=cr(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,sr(n,a))};return n},yr=e=>{let t=cr(e),n=(e,r,i,a)=>t(e,r,i,sr(n,a));return n},br=e=>{let t=lr(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,sr(n,a))};return n},xr=e=>{let t=lr(e),n=async(e,r,i,a)=>await t(e,r,i,sr(n,a));return n},Sr=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ur(e)(t,n,i)},Cr=e=>(t,n,r)=>ur(e)(t,n,r),wr=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return fr(e)(t,n,i)},Tr=e=>async(t,n,r)=>fr(e)(t,n,r),Er=/^[cC][0-9a-z]{6,}$/,Dr=/^[0-9a-z]+$/,Or=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,kr=/^[0-9a-vA-V]{20}$/,Ar=/^[A-Za-z0-9]{27}$/,jr=/^[a-zA-Z0-9_-]{21}$/;function Mr(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}let Nr=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Pr=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Fr=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ir=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function Lr(){return/* @__PURE__ */ RegExp(`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,`u`)}let Rr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,zr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Br=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Vr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Hr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ur=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Wr=/^https?$/,Gr=/^\+[1-9]\d{6,14}$/,Kr=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function qr(e){return RegExp(`^${e}$`)}let Jr=/*@__PURE__*/ qr(Kr);function Yr(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Xr(e){return RegExp(`^${Yr(e)}$`)}function Zr(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Yr({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Yr({precision:e.precision})}`:n;return RegExp(`^${Kr}T(?:${r})$`)}let Qr=/^[\s\S]{0,}$/,$r=/^-?\d+(?:\.\d+)?$/,ei=/^[^A-Z]*$/,ti=/^[^a-z]*$/,V=/*@__PURE__*/ L(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ni=e=>{let t=e.value;return!Qt(t)&&t.length!==void 0},ri={number:`number`,bigint:`bigint`,object:`date`},ii=/*@__PURE__*/ L(`$ZodCheckLessThan`,(e,t)=>{V.init(e,t);let n=ri[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:ri[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ai=/*@__PURE__*/ L(`$ZodCheckGreaterThan`,(e,t)=>{V.init(e,t);let n=ri[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:ri[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),oi=/*@__PURE__*/ L(`$ZodCheckMultipleOf`,(e,t)=>{V.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):en(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),si=/*@__PURE__*/ L(`$ZodCheckNumberFormat`,(e,t)=>{V.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=_n[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),ci=/*@__PURE__*/ L(`$ZodCheckMaxLength`,(e,t)=>{var n;V.init(e,t),(n=e._zod.def).when??(n.when=ni),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Pn(r):i)<=t.maximum)return;let a=Fn(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),li=/*@__PURE__*/ L(`$ZodCheckMinLength`,(e,t)=>{var n;V.init(e,t),(n=e._zod.def).when??(n.when=ni),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Pn(r):i)>=t.minimum)return;let a=Fn(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ui=/*@__PURE__*/ L(`$ZodCheckLengthEquals`,(e,t)=>{var n;V.init(e,t),(n=e._zod.def).when??(n.when=ni),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Pn(r):i;if(a===t.length)return;let o=Fn(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),di=/*@__PURE__*/ L(`$ZodCheckStringFormat`,(e,t)=>{var n,r;V.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),fi=/*@__PURE__*/ L(`$ZodCheckRegex`,(e,t)=>{di.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),pi=/*@__PURE__*/ L(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=ei,di.init(e,t)}),mi=/*@__PURE__*/ L(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=ti,di.init(e,t)}),hi=/*@__PURE__*/ L(`$ZodCheckIncludes`,(e,t)=>{V.init(e,t);let n=mn(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),gi=/*@__PURE__*/ L(`$ZodCheckStartsWith`,(e,t)=>{V.init(e,t);let n=RegExp(`^${mn(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),_i=/*@__PURE__*/ L(`$ZodCheckEndsWith`,(e,t)=>{V.init(e,t);let n=RegExp(`.*${mn(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),vi=/*@__PURE__*/ L(`$ZodCheckOverwrite`,(e,t)=>{V.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var yi=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
4
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
5
|
+
`)}\n};`)(...Object.values(this.closed))}};let bi={major:4,minor:6,patch:7},H=/*@__PURE__*/ L(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=bi;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=M(t),a;for(let o of n){if(o._zod.def.when){if(On(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new R;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Mn(t.issues,n,e),i||=M(t,n))});else{if(t.issues.length===n)continue;Mn(t.issues,n,e),i||=M(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(M(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new R;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new R;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return zn(this,`~standard`,Ci(this))},set"~standard"(e){P(this,`~standard`,e)}}),xi=(e,t)=>e.issues.length?{issues:e.issues.map(e=>N(e,t,B()))}:{value:e.value};async function Si(e,t){let n={async:!0};return xi(await e._zod.run({value:t,issues:[]},n),n)}function Ci(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return xi(r,n)}catch{}return Si(e,t)},vendor:`zod`,version:1}}let wi=/*@__PURE__*/ L(`$ZodString`,(e,t)=>{H.init(e,t),e._zod.pattern=t.pattern??Qr,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),U=/*@__PURE__*/ L(`$ZodStringFormat`,(e,t)=>{di.init(e,t),wi.init(e,t)}),Ti=/*@__PURE__*/ L(`$ZodGUID`,(e,t)=>{t.pattern??=Pr,U.init(e,t)}),Ei=/*@__PURE__*/ L(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Fr(e)}else t.pattern??=Fr();U.init(e,t)}),Di=/*@__PURE__*/ L(`$ZodEmail`,(e,t)=>{t.pattern??=Ir,U.init(e,t)});function Oi(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function ki(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?Oi(e)||2:Ai(e,t)}function Ai(e,t){if(!t.normalize&&t.protocol?.source===Wr.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}let ji=/[\t\n\r]/g;function Mi(e){return e.replace(ji,``)}function Ni(e,t){return t.lastIndex=0,t.test(e.hostname)}function Pi(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}let Fi=/*@__PURE__*/ L(`$ZodURL`,(e,t)=>{U.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=ki(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=Mi(r);return}t.hostname&&!Ni(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Pi(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Mi(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Ii=/*@__PURE__*/ L(`$ZodEmoji`,(e,t)=>{t.pattern??=Lr(),U.init(e,t)}),Li=/*@__PURE__*/ L(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?jr:Mr(t.length),U.init(e,t)}),Ri=/*@__PURE__*/ L(`$ZodCUID`,(e,t)=>{t.pattern??=Er,U.init(e,t)}),zi=/*@__PURE__*/ L(`$ZodCUID2`,(e,t)=>{t.pattern??=Dr,U.init(e,t)}),Bi=/*@__PURE__*/ L(`$ZodULID`,(e,t)=>{t.pattern??=Or,U.init(e,t)}),Vi=/*@__PURE__*/ L(`$ZodXID`,(e,t)=>{t.pattern??=kr,U.init(e,t)}),Hi=/*@__PURE__*/ L(`$ZodKSUID`,(e,t)=>{t.pattern??=Ar,U.init(e,t)}),Ui=/*@__PURE__*/ L(`$ZodISODateTime`,(e,t)=>{t.pattern??=Zr(t),U.init(e,t)}),Wi=/*@__PURE__*/ L(`$ZodISODate`,(e,t)=>{t.pattern??=Jr,U.init(e,t)}),Gi=/*@__PURE__*/ L(`$ZodISOTime`,(e,t)=>{t.pattern??=Xr(t),U.init(e,t)}),Ki=/*@__PURE__*/ L(`$ZodISODuration`,(e,t)=>{t.pattern??=Nr,U.init(e,t)}),qi=/*@__PURE__*/ L(`$ZodIPv4`,(e,t)=>{t.pattern??=Rr,U.init(e,t)}),Ji=/^[0-9a-fA-F:.]+$/;function Yi(e){return Ji.test(e)?Oi(`http://[${e}]`):!1}let Xi=/*@__PURE__*/ L(`$ZodIPv6`,(e,t)=>{t.pattern??=zr,U.init(e,t),e._zod.check=n=>{Yi(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Zi=/*@__PURE__*/ L(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Br,U.init(e,t)});function Qi(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Yi(n)}let $i=/*@__PURE__*/ L(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Vr,U.init(e,t),e._zod.check=n=>{Qi(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function ea(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let ta=/^[0-9a-zA-Z+/]*={0,2}$/,na=/*@__PURE__*/ L(`$ZodBase64`,(e,t)=>{t.pattern??=ta,U.init(e,t),e._zod.check=n=>{ea(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),ra=/^[A-Za-z0-9_-]*$/;function ia(e){if(!ra.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return ea(t.padEnd(Math.ceil(t.length/4)*4,`=`))}let aa=/*@__PURE__*/ L(`$ZodBase64URL`,(e,t)=>{t.pattern??=ra,U.init(e,t),e._zod.check=n=>{ia(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),oa=/*@__PURE__*/ L(`$ZodE164`,(e,t)=>{t.pattern??=Gr,U.init(e,t)});function sa(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}let ca=/*@__PURE__*/ L(`$ZodJWT`,(e,t)=>{U.init(e,t),e._zod.check=n=>{sa(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),la=/*@__PURE__*/ L(`$ZodNumber`,(e,t)=>{H.init(e,t),e._zod.pattern=$r,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),ua=/*@__PURE__*/ L(`$ZodNumberFormat`,(e,t)=>{si.init(e,t),la.init(e,t)}),da=/*@__PURE__*/ L(`$ZodUnknown`,(e,t)=>{H.init(e,t),e._zod.parse=e=>e}),fa=/*@__PURE__*/ L(`$ZodNever`,(e,t)=>{H.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function pa(e,t){let n=jn(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of jn(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,Mn(n.issues,t,e),n}}return i(n,a)}}let ma=e=>Array.isArray(e)?e.length:-1;function ha(e,t,n){e.issues.length&&t.issues.push(...kn(n,e.issues)),t.value[n]=e.value}let ga=/*@__PURE__*/ L(`$ZodArray`,(e,t)=>{H.init(e,t);let n=z.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>ha(t,r,e)));else if(ha(c,r,e),s&&c.issues.length!==0&&M(c))break}return o.length?Promise.all(o).then(()=>r):r},pa(e,ma)});function _a(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...kn(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}let va=[];function ya(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:va,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=gn(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function ba(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(M(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>_a(e,n,i,t,d,f))):_a(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}let xa=/*@__PURE__*/ L(`$ZodObject`,(e,t)=>{H.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=Zt(()=>ya(t));I(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||E(n,e,/* @__PURE__ */ new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=ln,o=t.catchall,s,c=z.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(M(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>_a(n,t,e,r,a,o))):_a(s,t,e,r,a,o)}return o?ba(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),Sa=/*@__PURE__*/ L(`$ZodObjectJIT`,(e,t)=>{xa.init(e,t);let n=e._zod.parse,r=Zt(()=>ya(t)),i=z.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new yi([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
6
|
+
let ${e}_ab = false;
|
|
7
|
+
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
8
|
+
const iss = ${e}.issues[i];
|
|
9
|
+
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
10
|
+
payload.issues.push(iss);
|
|
11
|
+
if (iss.continue !== true) ${e}_ab = true;
|
|
12
|
+
}
|
|
13
|
+
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
14
|
+
payload.value = newResult;
|
|
15
|
+
return payload;
|
|
16
|
+
}`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:on(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
|
|
17
|
+
const ${n}_present = ${i};
|
|
18
|
+
if (!${n}.issues.length || ${n}_present) {
|
|
19
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (${e}) {
|
|
23
|
+
newResult[${r}] = ${n}.value;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
`)}else f?(o.write(`
|
|
28
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
29
|
+
}
|
|
30
|
+
`),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
|
|
31
|
+
if (${n}.value !== undefined || ${i}) {
|
|
32
|
+
newResult[${r}] = ${n}.value;
|
|
33
|
+
}
|
|
34
|
+
`)):o.write(`
|
|
35
|
+
const ${n}_present = ${i};
|
|
36
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
37
|
+
}
|
|
38
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
39
|
+
payload.issues.push({
|
|
40
|
+
code: "invalid_type",
|
|
41
|
+
expected: "nonoptional",
|
|
42
|
+
input: undefined,
|
|
43
|
+
path: [${r}]
|
|
44
|
+
});
|
|
45
|
+
if (ctx && ctx.abortEarly) {
|
|
46
|
+
payload.value = newResult;
|
|
47
|
+
return payload;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (${n}_present) {
|
|
52
|
+
newResult[${r}] = ${n}.value;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=ln,c=!z.jitless,l=c&&un.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?ba([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Ca(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!M(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>N(e,r,B())))}),t)}let wa=/*@__PURE__*/ L(`$ZodUnion`,(e,t)=>{H.init(e,t),I(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),I(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),I(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),I(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>$t(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Ca(t,r,e,i)):Ca(o,r,e,i)}}),Ta=/*@__PURE__*/ L(`$ZodIntersection`,(e,t)=>{H.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Da(e,t,n)):Da(e,i,a)}});function Ea(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(dn(e)&&dn(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Ea(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Ea(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Da(e,t,n){let r=/* @__PURE__ */ new Map,i,a=/* @__PURE__ */ new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Ea(t.value,n.value);if(!c.valid){if(M(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}let Oa=/*@__PURE__*/ L(`$ZodEnum`,(e,t)=>{H.init(e,t);let n=qt(t.entries),r=new Set(n);e._zod.values=r,I(e,`pattern`,e=>{let t=qt(e.def.entries).filter(e=>pn.has(typeof e));return RegExp(t.length?`^(${t.map(e=>mn(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),ka=/*@__PURE__*/ L(`$ZodTransform`,(e,t)=>{H.init(e,t),e._zod.optin=`optional`,z.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Zn(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new R;return n.value=i,n}});function Aa(e,t){return e.value=t.issues.length?void 0:t.value,e}let ja=/*@__PURE__*/ L(`$ZodOptional`,(e,t)=>{H.init(e,t),I(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,I(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),I(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${$t(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Aa(e,t)):Aa(e,r)}return t.innerType._zod.run(e,n)}}),Ma=/*@__PURE__*/ L(`$ZodExactOptional`,(e,t)=>{ja.init(e,t),I(e,`values`,e=>e.def.innerType._zod.values),I(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Na=/*@__PURE__*/ L(`$ZodNullable`,(e,t)=>{H.init(e,t),I(e,`optin`,e=>e.def.innerType._zod.optin),I(e,`optout`,e=>e.def.innerType._zod.optout),I(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${$t(t.source)}|null)$`):void 0}),I(e,`values`,e=>e.def.innerType._zod.values?/* @__PURE__ */ new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Pa=/*@__PURE__*/ L(`$ZodDefault`,(e,t)=>{H.init(e,t),e._zod.optin=`defaulted`,I(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Fa(e,t)):Fa(r,t)}});function Fa(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}let Ia=/*@__PURE__*/ L(`$ZodPrefault`,(e,t)=>{H.init(e,t),e._zod.optin=`defaulted`,I(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),La=/*@__PURE__*/ L(`$ZodNonOptional`,(e,t)=>{H.init(e,t),I(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Ra(t,e)):Ra(i,e)}});function Ra(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function za(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>N(e,r,B()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}let Ba=/*@__PURE__*/ L(`$ZodCatch`,(e,t)=>{H.init(e,t),I(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),I(e,`optout`,e=>e.def.innerType._zod.optout),I(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>za(e,r,t,n)):za(e,r,t,n)}}),Va=/*@__PURE__*/ L(`$ZodPipe`,(e,t)=>{H.init(e,t),I(e,`values`,e=>e.def.in._zod.values),I(e,`optin`,e=>e.def.in._zod.optin),I(e,`optout`,e=>e.def.out._zod.optout),I(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Ha(e,t.in,n)):Ha(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Ha(e,t.out,n)):Ha(r,t.out,n)}});function Ha(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}let Ua=/*@__PURE__*/ L(`$ZodReadonly`,(e,t)=>{H.init(e,t),I(e,`propValues`,e=>e.def.innerType._zod.propValues),I(e,`values`,e=>e.def.innerType._zod.values),I(e,`optin`,e=>e.def.innerType?._zod?.optin),I(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Wa):Wa(r)}});function Wa(e){return e.memo||(e.value=Object.freeze(e.value)),e}let Ga=/*@__PURE__*/ L(`$ZodCustom`,(e,t)=>{V.init(e,t),H.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Ka(t,n,r,e));Ka(i,n,r,e)}});function Ka(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Ln(e))}}var qa=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}};let Ja=`~memo`,Ya=[];function Xa(e){return typeof e==`object`&&!!e}function Za(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let Qa=/*@__PURE__*/ new WeakMap;function $a(e,t,n){let r=Qa.get(e);if(r!==void 0)return r?2:0;if(t.has(e))return 2;t.add(e);let i=0,a=e=>{if(i!==2&&e?._zod){let r=$a(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=0;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?1:o.value?._zod?$a(o.value,t,n):0;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=tn(c);s(e?o(e,!0):1),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?$a(r,t,!1):1);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),eo(e,i)}function eo(e,t){return t!==1&&Qa.set(e,t===2),t}function to(e,t){let n=e.buckets.get(t);return n||(n=/* @__PURE__ */ new WeakMap,e.buckets.set(t,n)),n}let no,ro=[],io={alloc(e,t,n){let r=no;if(!r)return n;no=void 0;let i={value:n,issues:null};return r.set(t.value,i),ro.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&oo(n,e.value))throw new qa;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=$a(e,/* @__PURE__ */ new Set,!1);if(i===0)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===2||r?n=!0:r=!0}let l=s.value;if(!Xa(l))return t(s,c);let u=c[Ja];u||(u={buckets:/* @__PURE__ */ new WeakMap,backEdges:void 0},c[Ja]=u);let d;i===c?d=a:(d=to(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...Za(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=/* @__PURE__ */ new WeakSet),u.backEdges.add(f.value)),s;no=d;let p=ro.length,m=t(s,c);no=void 0;let h=ro.length>p?ro.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Za(e.issues):Ya),e)):(h&&(h.issues=m.issues.length?Za(m.issues):Ya),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function ao(){return io}function oo(e,t){let n=e[Ja]?.backEdges;return n!==void 0&&Xa(t)&&n.has(t)}let so=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(In(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${hn(e.values[0])}`:`Invalid option: expected one of ${Jt(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${Jt(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function co(){return{localeError:so()}}var lo,uo=class{constructor(){this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function fo(){return new uo}(lo=globalThis).__zod_globalRegistry??(lo.__zod_globalRegistry=fo());let po=globalThis.__zod_globalRegistry;function mo(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
|
|
56
|
+
function ho(e,t){return new e(mo({type:`string`,...j(t)}))}// @__NO_SIDE_EFFECTS__
|
|
57
|
+
function go(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
58
|
+
function _o(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
59
|
+
function vo(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
60
|
+
function yo(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
61
|
+
function bo(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
62
|
+
function xo(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
63
|
+
function So(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
64
|
+
function Co(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
65
|
+
function wo(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
66
|
+
function To(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
67
|
+
function Eo(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
68
|
+
function Do(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
69
|
+
function Oo(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
70
|
+
function ko(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
71
|
+
function Ao(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
72
|
+
function jo(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
73
|
+
function Mo(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
74
|
+
function No(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
75
|
+
function Po(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
76
|
+
function Fo(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
77
|
+
function Io(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
78
|
+
function Lo(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
79
|
+
function Ro(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
80
|
+
function zo(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
81
|
+
function Bo(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
82
|
+
function Vo(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
83
|
+
function Ho(e,t){return new e(mo({type:`number`,checks:[],...j(t)}))}// @__NO_SIDE_EFFECTS__
|
|
84
|
+
function Uo(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
85
|
+
function Wo(e){return new e({type:`unknown`})}// @__NO_SIDE_EFFECTS__
|
|
86
|
+
function Go(e,t){return new e({type:`never`,...j(t)})}// @__NO_SIDE_EFFECTS__
|
|
87
|
+
function Ko(e,t){return new ii({check:`less_than`,...j(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
|
|
88
|
+
function qo(e,t){return new ii({check:`less_than`,...j(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
|
|
89
|
+
function Jo(e,t){return new ai({check:`greater_than`,...j(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
|
|
90
|
+
function Yo(e,t){return new ai({check:`greater_than`,...j(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
|
|
91
|
+
function Xo(e,t){return new oi({check:`multiple_of`,...j(t),value:e})}// @__NO_SIDE_EFFECTS__
|
|
92
|
+
function Zo(e,t){return new ci({check:`max_length`,...j(t),maximum:e})}// @__NO_SIDE_EFFECTS__
|
|
93
|
+
function Qo(e,t){return new li({check:`min_length`,...j(t),minimum:e})}// @__NO_SIDE_EFFECTS__
|
|
94
|
+
function $o(e,t){return new ui({check:`length_equals`,...j(t),length:e})}// @__NO_SIDE_EFFECTS__
|
|
95
|
+
function es(e,t){return new fi({check:`string_format`,format:`regex`,...j(t),pattern:e})}// @__NO_SIDE_EFFECTS__
|
|
96
|
+
function ts(e){return new pi({check:`string_format`,format:`lowercase`,...j(e)})}// @__NO_SIDE_EFFECTS__
|
|
97
|
+
function ns(e){return new mi({check:`string_format`,format:`uppercase`,...j(e)})}// @__NO_SIDE_EFFECTS__
|
|
98
|
+
function rs(e,t){return new hi({check:`string_format`,format:`includes`,...j(t),includes:e})}// @__NO_SIDE_EFFECTS__
|
|
99
|
+
function is(e,t){return new gi({check:`string_format`,format:`starts_with`,...j(t),prefix:e})}// @__NO_SIDE_EFFECTS__
|
|
100
|
+
function as(e,t){return new _i({check:`string_format`,format:`ends_with`,...j(t),suffix:e})}// @__NO_SIDE_EFFECTS__
|
|
101
|
+
function os(e){return new vi({check:`overwrite`,tx:e})}// @__NO_SIDE_EFFECTS__
|
|
102
|
+
function ss(e){return/* @__PURE__ */ os(t=>t.normalize(e))}// @__NO_SIDE_EFFECTS__
|
|
103
|
+
function cs(){return/* @__PURE__ */ os(e=>e.trim())}// @__NO_SIDE_EFFECTS__
|
|
104
|
+
function ls(){return/* @__PURE__ */ os(e=>e.toLowerCase())}// @__NO_SIDE_EFFECTS__
|
|
105
|
+
function us(){return/* @__PURE__ */ os(e=>e.toUpperCase())}// @__NO_SIDE_EFFECTS__
|
|
106
|
+
function ds(){return/* @__PURE__ */ os(e=>sn(e))}// @__NO_SIDE_EFFECTS__
|
|
107
|
+
function fs(e,t,n){return new e({type:`array`,element:t,...j(n)})}// @__NO_SIDE_EFFECTS__
|
|
108
|
+
function ps(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...j(n)})}// @__NO_SIDE_EFFECTS__
|
|
109
|
+
function ms(e,t){let n=/* @__PURE__ */ hs(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Ln(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Ln(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
|
|
110
|
+
function hs(e,t){let n=new V({check:`custom`,...j(t)});return n._zod.check=e,n}function gs(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&E(e,t,n[t]);return e}function _s(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??po,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:/* @__PURE__ */ new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function vs(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function W(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,W(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&gs(o.schema,c),t.io===`input`&&G(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function ys(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function bs(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=/* @__PURE__ */ new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${ys(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+ys(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
111
|
+
|
|
112
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function xs(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;xs(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}let Ss=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),Cs=[`oneOf`,`anyOf`];function ws(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Ts(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Ss.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??ws(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}E(n,r,e.length===1?e[0]:Ts(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=ws(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Es(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Ss)if(t in e)return;let n=t.filter(e=>Cs.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Ts(t);else{let e=n[0],i=Cs.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Ts([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,gs(e,r))}function Ds(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):gs(i,s),gs(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())xs(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Es(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}gs(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,E(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:ks(t,`input`,e.processors),output:ks(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function G(e,t){let n=t??{seen:/* @__PURE__ */ new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return G(r.element,n);if(r.type===`set`)return G(r.valueType,n);if(r.type===`lazy`)return G(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return G(r.innerType,n);if(r.type===`intersection`)return G(r.left,n)||G(r.right,n);if(r.type===`record`||r.type===`map`)return G(r.keyType,n)||G(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:G(r.in,n)||G(r.out,n);if(r.type===`object`){for(let e in r.shape)if(G(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(G(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(G(e,n))return!0;return!!(r.rest&&G(r.rest,n))}return!1}let Os=(e,t={})=>n=>{let r=_s({...n,processors:t});return W(e,r),bs(r,e),Ds(r,e)},ks=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=_s({...i??{},target:a,io:t,processors:n});return W(e,o),bs(o,e),Ds(o,e)},As=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},js=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Ms=(e,t)=>{As(e,`minimum`,t),js(e,`maximum`,t)},Ns=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Ps=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},Fs=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Is=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Ls=(e,t)=>As(e,`minimum`,t.minimum),Rs=(e,t)=>js(e,`maximum`,t.maximum),zs=e=>(t,n)=>{Is(t,n.format);let[r,i]=e[n.format];As(t,`minimum`,r),js(t,`maximum`,i)},Bs={greater_than:(e,t)=>As(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>js(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Ns(e,t.value),number_format:zs(_n),bigint_format:zs(vn),min_length:Ls,max_length:Rs,length_equals:(e,t)=>Ms(e,t.length),min_size:Ls,max_size:Rs,size_equals:(e,t)=>Ms(e,t.size),string_format:(e,t)=>{Is(e,t.format),t.pattern&&Ps(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Fs(e,t.mime)};function K(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Bs[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&As(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&As(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&js(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&js(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Ns(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Fs(t,i.mime);for(let e of i.patterns??[])Ps(t,e);return t}let Vs={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Hs=/* @__PURE__ */ new Map([[ta,Hr],[ra,Ur]]),Us=e=>Hs.get(e)??e,Ws=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=K(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Vs[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Us);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Gs=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=K(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=/* @__PURE__ */ new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):vs(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Ks=(e,t,n,r)=>{n.not={}},qs=(e,t,n,r)=>{let i=e._zod.def,a=qt(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},Js=(e,t,n,r)=>{vs(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Ys=(e,t,n,r)=>{vs(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Xs=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=K(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=W(a.element,t,{...r,path:[...r.path,`items`]})};function Zs(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Zs(t.out):t.type===`catch`?Zs(t.innerType):e._zod.optin}let Qs=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&vs(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)E(i.properties,e,W(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Zs(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=W(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},$s=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>W(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},ec=(e,t,n,r)=>{let i=e._zod.def,a=W(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=W(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},tc=(e,t,n,r)=>{let i=e._zod.def,a=W(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},nc=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},rc=Symbol();function ic(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(vs(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),rc):JSON.parse(o)}let ac=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=ic(i.defaultValue,e,t,n,r);o!==rc&&(n.default=o)},oc=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=ic(i.defaultValue,e,t,n,r);o!==rc&&(n._prefault=o)},sc=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{vs(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},cc=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;W(o,t,r);let s=t.seen.get(e);s.ref=o},lc=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},uc=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},dc=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function fc(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}let q=/*@__PURE__*/ L(`ZodError`,(e,t)=>{rr.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);dc.has(n)||(dc.add(n),fc(n,`format`,e=>t=>or(e,t)),fc(n,`flatten`,e=>t=>ar(e,t)),fc(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Yt,2)}),fc(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Yt,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),pc=/* @__PURE__ */ cr(q),mc=/* @__PURE__ */ lr(q),hc=/* @__PURE__ */ ur(q),gc=/* @__PURE__ */ fr(q),_c=/* @__PURE__ */ vr(q),vc=/* @__PURE__ */ yr(q),yc=/* @__PURE__ */ br(q),bc=/* @__PURE__ */ xr(q),xc=/* @__PURE__ */ Sr(q),Sc=/* @__PURE__ */ Cr(q),Cc=/* @__PURE__ */ wr(q),wc=/* @__PURE__ */ Tr(q);function Tc(){z.localeError||B(co())}function Ec(){z.memoizer||B({memoizer:ao()})}let J=/*@__PURE__*/ L(`ZodType`,(e,t)=>(Tc(),H.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(k(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return A(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Rl(e,t))},superRefine(e,t){return this.check(zl(e,t))},overwrite(e){return this.check(/* @__PURE__ */ os(e))},optional(){return bl(this)},exactOptional(){return Sl(this)},nullable(){return wl(this)},nullish(){return bl(wl(this))},nonoptional(e){return Al(this,e)},array(){return cl(this)},or(e){return fl([this,e])},and(e){return ml(this,e)},transform(e){return Pl(this,vl(e))},default(e){return El(this,e)},prefault(e){return Ol(this,e)},catch(e){return Ml(this,e)},pipe(e){return Pl(this,e)},readonly(){return Il(this)},describe(e){let t=this.clone();return po.add(t,{description:e}),t},meta(...e){if(e.length===0)return po.get(this);let t=this.clone();return po.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return zn(this,`~standard`,{...Ci(this),jsonSchema:{input:ks(this,`input`),output:ks(this,`output`)}})},set"~standard"(e){P(this,`~standard`,e)},parse:function e(t,n){return pc(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await mc(this,t,n,{callee:e})},safeParse(e,t){return hc(this,e,t)},async safeParseAsync(e,t){return gc(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){P(this,`spa`,e)},validate(e,t){return hr(this,e,t)},validateAsync(e,t){return _r(this,e,t)},encode:function e(t,n){return _c(this,t,n,{callee:e})},decode:function e(t,n){return vc(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await yc(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await bc(this,t,n,{callee:e})},safeEncode(e,t){return xc(this,e,t)},safeDecode(e,t){return Sc(this,e,t)},async safeEncodeAsync(e,t){return Cc(this,e,t)},async safeDecodeAsync(e,t){return wc(this,e,t)},toJSONSchema(e){return Os(this,{})(e)},get description(){return po.get(this)?.description},get _def(){return this._zod.def}}),Dc=/*@__PURE__*/ L(`_ZodString`,(e,t)=>{wi.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ws(e,t,n,r)},/*@__PURE__*/ Bn({format:e=>K(e).format??null,minLength:e=>K(e).minimum??null,maxLength:e=>K(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ es(...e))},includes(...e){return this.check(/* @__PURE__ */ rs(...e))},startsWith(...e){return this.check(/* @__PURE__ */ is(...e))},endsWith(...e){return this.check(/* @__PURE__ */ as(...e))},min(...e){return this.check(/* @__PURE__ */ Qo(...e))},max(...e){return this.check(/* @__PURE__ */ Zo(...e))},length(...e){return this.check(/* @__PURE__ */ $o(...e))},nonempty(...e){return this.check(/* @__PURE__ */ Qo(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ ts(e))},uppercase(e){return this.check(/* @__PURE__ */ ns(e))},trim(){return this.check(/* @__PURE__ */ cs())},normalize(...e){return this.check(/* @__PURE__ */ ss(...e))},toLowerCase(){return this.check(/* @__PURE__ */ ls())},toUpperCase(){return this.check(/* @__PURE__ */ us())},slugify(){return this.check(/* @__PURE__ */ ds())}})),Oc=/*@__PURE__*/ L(`ZodString`,(e,t)=>{wi.init(e,t),Dc.init(e,t)},{email(e){return this.check(/* @__PURE__ */ go(Pc,e))},url(e){return this.check(/* @__PURE__ */ So(Lc,e))},jwt(e){return this.check(/* @__PURE__ */ Lo(Qc,e))},emoji(e){return this.check(/* @__PURE__ */ Co(Rc,e))},guid(e){return this.check(/* @__PURE__ */ _o(Fc,e))},uuid(e){return this.check(/* @__PURE__ */ vo(Ic,e))},uuidv4(e){return this.check(/* @__PURE__ */ yo(Ic,e))},uuidv6(e){return this.check(/* @__PURE__ */ bo(Ic,e))},uuidv7(e){return this.check(/* @__PURE__ */ xo(Ic,e))},nanoid(e){return this.check(/* @__PURE__ */ wo(zc,e))},cuid(e){return this.check(/* @__PURE__ */ To(Bc,e))},cuid2(e){return this.check(/* @__PURE__ */ Eo(Vc,e))},ulid(e){return this.check(/* @__PURE__ */ Do(Hc,e))},base64(e){return this.check(/* @__PURE__ */ Po(Yc,e))},base64url(e){return this.check(/* @__PURE__ */ Fo(Xc,e))},xid(e){return this.check(/* @__PURE__ */ Oo(Uc,e))},ksuid(e){return this.check(/* @__PURE__ */ ko(Wc,e))},ipv4(e){return this.check(/* @__PURE__ */ Ao(Gc,e))},ipv6(e){return this.check(/* @__PURE__ */ jo(Kc,e))},cidrv4(e){return this.check(/* @__PURE__ */ Mo(qc,e))},cidrv6(e){return this.check(/* @__PURE__ */ No(Jc,e))},e164(e){return this.check(/* @__PURE__ */ Io(Zc,e))},datetime(e){return this.check(/* @__PURE__ */ Ro(Ac,e))},date(e){return this.check(/* @__PURE__ */ zo(jc,e))},time(e){return this.check(/* @__PURE__ */ Bo(Mc,e))},duration(e){return this.check(/* @__PURE__ */ Vo(Nc,e))}});function kc(e){return/* @__PURE__ */ ho(Oc,e)}let Y=/*@__PURE__*/ L(`ZodStringFormat`,(e,t)=>{U.init(e,t),Dc.init(e,t)}),Ac=/*@__PURE__*/ L(`ZodISODateTime`,(e,t)=>{Ui.init(e,t),Y.init(e,t)}),jc=/*@__PURE__*/ L(`ZodISODate`,(e,t)=>{Wi.init(e,t),Y.init(e,t)}),Mc=/*@__PURE__*/ L(`ZodISOTime`,(e,t)=>{Gi.init(e,t),Y.init(e,t)}),Nc=/*@__PURE__*/ L(`ZodISODuration`,(e,t)=>{Ki.init(e,t),Y.init(e,t)}),Pc=/*@__PURE__*/ L(`ZodEmail`,(e,t)=>{Di.init(e,t),Y.init(e,t)}),Fc=/*@__PURE__*/ L(`ZodGUID`,(e,t)=>{Ti.init(e,t),Y.init(e,t)}),Ic=/*@__PURE__*/ L(`ZodUUID`,(e,t)=>{Ei.init(e,t),Y.init(e,t)}),Lc=/*@__PURE__*/ L(`ZodURL`,(e,t)=>{Fi.init(e,t),Y.init(e,t)}),Rc=/*@__PURE__*/ L(`ZodEmoji`,(e,t)=>{Ii.init(e,t),Y.init(e,t)}),zc=/*@__PURE__*/ L(`ZodNanoID`,(e,t)=>{Li.init(e,t),Y.init(e,t)}),Bc=/*@__PURE__*/ L(`ZodCUID`,(e,t)=>{Ri.init(e,t),Y.init(e,t)}),Vc=/*@__PURE__*/ L(`ZodCUID2`,(e,t)=>{zi.init(e,t),Y.init(e,t)}),Hc=/*@__PURE__*/ L(`ZodULID`,(e,t)=>{Bi.init(e,t),Y.init(e,t)}),Uc=/*@__PURE__*/ L(`ZodXID`,(e,t)=>{Vi.init(e,t),Y.init(e,t)}),Wc=/*@__PURE__*/ L(`ZodKSUID`,(e,t)=>{Hi.init(e,t),Y.init(e,t)}),Gc=/*@__PURE__*/ L(`ZodIPv4`,(e,t)=>{qi.init(e,t),Y.init(e,t)}),Kc=/*@__PURE__*/ L(`ZodIPv6`,(e,t)=>{Xi.init(e,t),Y.init(e,t)}),qc=/*@__PURE__*/ L(`ZodCIDRv4`,(e,t)=>{Zi.init(e,t),Y.init(e,t)}),Jc=/*@__PURE__*/ L(`ZodCIDRv6`,(e,t)=>{$i.init(e,t),Y.init(e,t)}),Yc=/*@__PURE__*/ L(`ZodBase64`,(e,t)=>{na.init(e,t),Y.init(e,t)}),Xc=/*@__PURE__*/ L(`ZodBase64URL`,(e,t)=>{aa.init(e,t),Y.init(e,t)}),Zc=/*@__PURE__*/ L(`ZodE164`,(e,t)=>{oa.init(e,t),Y.init(e,t)}),Qc=/*@__PURE__*/ L(`ZodJWT`,(e,t)=>{ca.init(e,t),Y.init(e,t)}),$c=/*@__PURE__*/ L(`ZodNumber`,(e,t)=>{la.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gs(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ Bn({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=K(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=K(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=K(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>K(e).format??null},{gt(e,t){return this.check(/* @__PURE__ */ Jo(e,t))},gte(e,t){return this.check(/* @__PURE__ */ Yo(e,t))},min(e,t){return this.check(/* @__PURE__ */ Yo(e,t))},lt(e,t){return this.check(/* @__PURE__ */ Ko(e,t))},lte(e,t){return this.check(/* @__PURE__ */ qo(e,t))},max(e,t){return this.check(/* @__PURE__ */ qo(e,t))},int(e){return this.check(nl(e))},safe(e){return this.check(nl(e))},positive(e){return this.check(/* @__PURE__ */ Jo(0,e))},nonnegative(e){return this.check(/* @__PURE__ */ Yo(0,e))},negative(e){return this.check(/* @__PURE__ */ Ko(0,e))},nonpositive(e){return this.check(/* @__PURE__ */ qo(0,e))},multipleOf(e,t){return this.check(/* @__PURE__ */ Xo(e,t))},step(e,t){return this.check(/* @__PURE__ */ Xo(e,t))},finite(){return this}}));function el(e){return/* @__PURE__ */ Ho($c,e)}let tl=/*@__PURE__*/ L(`ZodNumberFormat`,(e,t)=>{ua.init(e,t),$c.init(e,t)});function nl(e){return/* @__PURE__ */ Uo(tl,e)}let rl=/*@__PURE__*/ L(`ZodUnknown`,(e,t)=>{da.init(e,t),J.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function il(){return/* @__PURE__ */ Wo(rl)}let al=/*@__PURE__*/ L(`ZodNever`,(e,t)=>{fa.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ks(e,t,n,r)});function ol(e){return/* @__PURE__ */ Go(al,e)}let sl=/*@__PURE__*/ L(`ZodArray`,(e,t)=>{Ec(),ga.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xs(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ Qo(e,t))},nonempty(e){return this.check(/* @__PURE__ */ Qo(1,e))},max(e,t){return this.check(/* @__PURE__ */ Zo(e,t))},length(e,t){return this.check(/* @__PURE__ */ $o(e,t))},unwrap(){return this.element}});function cl(e,t){return/* @__PURE__ */ fs(sl,e,t)}let ll=/*@__PURE__*/ L(`ZodObject`,(e,t)=>{Ec(),Sa.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qs(e,t,n,r),Gn(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return gl(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(k(this._zod.def,{catchall:e}))},passthrough(){return this.clone(k(this._zod.def,{catchall:il()}))},loose(){return this.clone(k(this._zod.def,{catchall:il()}))},strict(){return this.clone(k(this._zod.def,{catchall:ol()}))},strip(){return this.clone(k(this._zod.def,{catchall:void 0}))},extend(e){return Sn(this,e)},safeExtend(e){return wn(this,e)},merge(e){return Tn(this,e)},pick(e){return yn(this,e)},omit(e){return xn(this,e)},partial(...e){return En(yl,this,e[0])},exactPartial(...e){return En(xl,this,e[0],`exactPartial`)},required(...e){return Dn(kl,this,e[0])}});function ul(e,t){let n={type:`object`,shape:e??{},...j(t)};return new ll(n)}let dl=/*@__PURE__*/ L(`ZodUnion`,(e,t)=>{wa.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$s(e,t,n,r),e.options=t.options});function fl(e,t){return new dl({type:`union`,options:e,...j(t)})}let pl=/*@__PURE__*/ L(`ZodIntersection`,(e,t)=>{Ta.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ec(e,t,n,r)});function ml(e,t){return new pl({type:`intersection`,left:e,right:t})}let hl=/*@__PURE__*/ L(`ZodEnum`,(e,t)=>{Oa.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qs(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new hl({...t,checks:[],...j(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new hl({...t,checks:[],...j(r),entries:i})}});function gl(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new hl({type:`enum`,entries:n,...j(t)})}let _l=/*@__PURE__*/ L(`ZodTransform`,(e,t)=>{Ec(),ka.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ys(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Zn(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ln(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Ln(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function vl(e){return new _l({type:`transform`,transform:e})}let yl=/*@__PURE__*/ L(`ZodOptional`,(e,t)=>{ja.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bl(e){return new yl({type:`optional`,innerType:e})}let xl=/*@__PURE__*/ L(`ZodExactOptional`,(e,t)=>{Ma.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Sl(e){return new xl({type:`optional`,innerType:e})}let Cl=/*@__PURE__*/ L(`ZodNullable`,(e,t)=>{Na.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wl(e){return new Cl({type:`nullable`,innerType:e})}let Tl=/*@__PURE__*/ L(`ZodDefault`,(e,t)=>{Pa.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ac(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function El(e,t){return new Tl({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():fn(t)}})}let Dl=/*@__PURE__*/ L(`ZodPrefault`,(e,t)=>{Ia.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ol(e,t){return new Dl({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():fn(t)}})}let kl=/*@__PURE__*/ L(`ZodNonOptional`,(e,t)=>{La.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Al(e,t){return new kl({type:`nonoptional`,innerType:e,...j(t)})}let jl=/*@__PURE__*/ L(`ZodCatch`,(e,t)=>{Ba.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ml(e,t){return new jl({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Kn(t)})}let Nl=/*@__PURE__*/ L(`ZodPipe`,(e,t)=>{Va.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cc(e,t,n,r),e.in=t.in,e.out=t.out});function Pl(e,t){return new Nl({type:`pipe`,in:e,out:t})}let Fl=/*@__PURE__*/ L(`ZodReadonly`,(e,t)=>{Ua.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Il(e){return new Fl({type:`readonly`,innerType:e})}let Ll=/*@__PURE__*/ L(`ZodCustom`,(e,t)=>{Ga.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Js(e,t,n,r)});function Rl(e,t={}){return/* @__PURE__ */ ps(Ll,e,t)}function zl(e,t){return/* @__PURE__ */ ms(e,t)}ul({query:kc().optional(),type:kc().optional(),package:kc().optional(),tag:kc().optional(),path:kc().optional(),limit:el().int().min(1).max(200).optional(),offset:el().int().min(0).optional()});let X={accent:`#635BFF`,text:`#171C28`,textSoft:`#6B7385`,bg:`#F6F7FB`,bgSoft:`#FFFFFF`,borderDefault:`#D7DCE7`,borderSubtle:`#E6E9F0`,slate:`#64748B`,rose:`#C0352B`,mint:`#0F8A4B`,amber:`#A56315`},Z={accent:`#8A7CFF`,text:`#F3F6FC`,textSoft:`#98A3BC`,bg:`#0D1120`,bgSoft:`#151A2E`,borderDefault:`#313A58`,borderSubtle:`#262E47`,slate:`#8690AA`,rose:`#FF8D86`,mint:`#59D38C`,amber:`#F5B95C`};X.mint,X.rose,X.slate,X.rose,X.mint,X.rose,X.amber,X.slate,Z.mint,Z.rose,Z.slate,Z.rose,Z.mint,Z.rose,Z.amber,Z.slate,X.text,X.textSoft,X.slate,X.accent,Z.text,Z.textSoft,Z.slate,Z.accent;let Bl=/* @__PURE__ */ new Set([`model`,`seed`,`snapshot`,`source`,`source_freshness`,`test`,`unit_test`,`metric`,`semantic_model`]),Vl=/* @__PURE__ */ new Set([`test`,`unit_test`]);[...Bl].filter(e=>!Vl.has(e)).sort((e,t)=>e.localeCompare(t));function Hl(e){return e.slice(8)}function Ul(e){return e.startsWith(`adapter:`)}function Wl(e,t){let n=Kt([e.adapterMetrics]).find(e=>e.key===t),r=n?Wt(e.adapterMetrics,n.key):void 0;if(n!=null&&r!==void 0)return{displayValue:Gt(n,r),sortValue:typeof r==`number`||typeof r==`string`?r:void 0,isScalar:!0}}function Gl(e){if(Ul(e))return`desc`;switch(e){case`attention`:case`duration`:case`start`:return`desc`;default:return`asc`}}function Kl(e,t){return t===`all`?!0:t===`issues`?e.statusTone===`danger`||e.statusTone===`warning`:e.statusTone===t}function ql(){return{all:0,positive:0,warning:0,danger:0}}function Jl(){return{all:0,models:0,tests:0,seeds:0,snapshots:0,operations:0,healthy:0,warnings:0,errors:0,issues:0}}function Yl(e){let t=[...(e.adapterResponseFields??[]).flatMap(e=>[e.key,e.displayValue]),...e.adapterMetrics?[e.adapterMetrics.queryId??``,e.adapterMetrics.adapterCode??``,e.adapterMetrics.adapterMessage??``,e.adapterMetrics.projectId??``,e.adapterMetrics.location??``,e.adapterMetrics.rawKeys.join(` `)]:[]],n=e.semantics,r=n?[n.materialization,n.rawMaterialization??``,n.incrementalStrategy??``,n.relationName??``]:[];return[e.name,e.resourceType,e.packageName,e.path??``,e.uniqueId,e.status,e.threadId??``,...r,...t].join(` `).toLowerCase()}function Xl(e){return e.trim().toLowerCase()}function Zl(e,t){return Kl(e,t)}function Ql(e){return Vl.has(e.resourceType)?`tests`:e.resourceType===`seed`?`seeds`:e.resourceType===`snapshot`?`snapshots`:e.resourceType===`operation`||e.resourceType===`sql_operation`||e.resourceType===`macro`?`operations`:`models`}function $l(e,t){return t===`all`||Ql(e)===t}function eu(e,t){return t===`all`?!0:t===`fast`?e.executionTime<1:t===`medium`?e.executionTime>=1&&e.executionTime<5:e.executionTime>=5}let tu={positive:0,neutral:1,skipped:2,warning:3,danger:4};function nu(e,t){let n=tu[e.statusTone]-tu[t.statusTone];return n===0?e.executionTime-t.executionTime:n}function ru(e,t){let n=e===void 0,r=t===void 0;return n&&r?0:n?1:r?-1:typeof e==`number`&&typeof t==`number`?e-t:String(e).localeCompare(String(t),void 0,{numeric:!0,sensitivity:`base`})}function Q(e,t){return t===`asc`?e:-e}function iu(e,t,n,r,i){let a=e.localeCompare(t);return a===0?n.name.localeCompare(r.name):Q(a,i)}function au(e,t,n,r){if(!Ul(n))return Q(nu(e,t),r);let i=Hl(n),a=Wl(e,i),o=Wl(t,i);return!a?.isScalar&&!o?.isScalar?0:a?.isScalar?o?.isScalar?Q(ru(a.sortValue,o.sortValue),r):-1:1}function ou(e,t,n,r){switch(n){case`duration`:return Q(e.executionTime-t.executionTime,r);case`name`:return Q(e.name.localeCompare(t.name),r);case`status`:return Q(e.status.localeCompare(t.status),r);case`start`:return Q((e.start??0)-(t.start??0),r);case`materialization`:return iu(e.semantics?.materialization??`unknown`,t.semantics?.materialization??`unknown`,e,t,r);case`resourceType`:return iu(e.resourceType,t.resourceType,e,t,r);case`thread`:return iu(e.threadId??``,t.threadId??``,e,t,r);case`attention`:return Q(nu(e,t),r);default:return au(e,t,n,r)}}function su(e){let t=ql(),n=Jl(),r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map;t.all=e.length,n.all=e.length;for(let a of e){let{row:e}=a;e.statusTone===`positive`?(t.positive+=1,n.healthy+=1):e.statusTone===`warning`?(t.warning+=1,n.warnings+=1,n.issues+=1):e.statusTone===`danger`&&(t.danger+=1,n.errors+=1,n.issues+=1),n[Ql(e)]+=1,r.set(e.resourceType,(r.get(e.resourceType)??0)+1),e.threadId&&i.set(e.threadId,(i.get(e.threadId)??0)+1)}return{status:t,facets:n,resourceTypes:Object.fromEntries(r),threadIds:Object.fromEntries(i)}}function cu(e){let t=e.map(e=>({row:e,searchText:Yl(e)}));return{entries:t,summary:su(t)}}function lu(e,t){let n=Xl(t.query),r=new Set(t.resourceTypes),i=new Set(t.materializationKinds),a=new Set(t.threadIds),o=e.entries.filter(e=>{let{row:o}=e;if(!$l(o,t.kind)||!Zl(o,t.status)||n!==``&&!e.searchText.includes(n)||r.size>0&&!r.has(o.resourceType))return!1;if(i.size>0){let e=o.semantics?.materialization??`unknown`;if(!i.has(e))return!1}return!(a.size>0&&!a.has(o.threadId??``)||!eu(o,t.durationBand))}),s=t.sortBy??`attention`,c=t.sortDirection??Gl(s);return[...o].sort((e,t)=>ou(e.row,t.row,s,c))}function uu(e){let t=e.origin;if(t===``||t===`null`)return!0;try{return t===globalThis.location.origin}catch{return!1}}let du=null,fu=null,$=[];function pu(e){self.postMessage({type:`error`,message:e})}self.onmessage=e=>{if(!uu(e))return;let t=e.data;if(t.type===`init`){du=cu(t.rows),fu=null,$=[],self.postMessage({type:`ready`,summary:du.summary});return}if(du==null){pu(`Results worker queried before initialization.`);return}let n=[t.kind,t.status,t.query.trim().toLowerCase(),t.resourceTypes.sort().join(`,`),t.materializationKinds.sort().join(`,`),t.threadIds.sort().join(`,`),t.durationBand,t.sortBy,t.sortDirection].join(`::`);n!==fu&&($=lu(du,{kind:t.kind,status:t.status,query:t.query,resourceTypes:t.resourceTypes,materializationKinds:t.materializationKinds,threadIds:t.threadIds,durationBand:t.durationBand,sortBy:t.sortBy,sortDirection:t.sortDirection}),fu=n);let r=$.slice(0,t.limit);self.postMessage({type:`query-result`,requestId:t.requestId,rows:r.map(e=>e.row),totalMatches:$.length,summary:{status:{all:$.length,positive:$.filter(e=>e.row.statusTone===`positive`).length,warning:$.filter(e=>e.row.statusTone===`warning`).length,danger:$.filter(e=>e.row.statusTone===`danger`).length},facets:{all:$.length,models:$.filter(e=>{let t=e.row.resourceType;return t!==`test`&&t!==`unit_test`&&t!==`seed`&&t!==`snapshot`&&t!==`operation`&&t!==`sql_operation`&&t!==`macro`}).length,tests:$.filter(e=>e.row.resourceType===`test`||e.row.resourceType===`unit_test`).length,seeds:$.filter(e=>e.row.resourceType===`seed`).length,snapshots:$.filter(e=>e.row.resourceType===`snapshot`).length,operations:$.filter(e=>[`operation`,`sql_operation`,`macro`].includes(e.row.resourceType)).length,healthy:$.filter(e=>e.row.statusTone===`positive`).length,warnings:$.filter(e=>e.row.statusTone===`warning`).length,errors:$.filter(e=>e.row.statusTone===`danger`).length,issues:$.filter(e=>e.row.statusTone===`danger`||e.row.statusTone===`warning`).length},resourceTypes:Object.fromEntries(Object.entries(r.reduce((e,t)=>(e[t.row.resourceType]=(e[t.row.resourceType]??0)+1,e),{}))),threadIds:Object.fromEntries(Object.entries(r.reduce((e,t)=>(t.row.threadId&&(e[t.row.threadId]=(e[t.row.threadId]??0)+1),e),{})))}})}})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));export{s as n,l as r,o as t};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n}from"./react-vendor-HrA5Qiu9.js";var r=e(t(),1),i=n();function a(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o;n.key&&n.debug?.call(n)&&(o=Date.now());let s=e();if(!(s.length!==r.length||s.some((e,t)=>r[t]!==e)))return i;r=s;let c;if(n.key&&n.debug?.call(n)&&(c=Date.now()),i=t(...s),n.key&&n.debug?.call(n)){let e=Math.round((Date.now()-o)*100)/100,t=Math.round((Date.now()-c)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=` `+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`
|
|
2
|
+
font-size: .6rem;
|
|
3
|
+
font-weight: bold;
|
|
4
|
+
color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i}return o.updateDeps=e=>{r=e},o}function o(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var s=(e,t)=>Math.abs(e-t)<1.01,c=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},l=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},u=e=>e,d=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=n;e++)r.push(e);return r},f=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(l(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(l(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},p={passive:!0},m=typeof window>`u`||`onscrollend`in window,h=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=0,a=e.options.useScrollendEvent&&m?()=>void 0:c(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),o=r=>()=>{let{horizontal:o,isRtl:s}=e.options;i=o?n.scrollLeft*(s&&-1||1):n.scrollTop,a(),t(i,r)},s=o(!0),l=o(!1);n.addEventListener(`scroll`,s,p);let u=e.options.useScrollendEvent&&m;return u&&n.addEventListener(`scrollend`,l,p),()=>{n.removeEventListener(`scroll`,s),u&&n.removeEventListener(`scrollend`,l)}},g=(e,t,n)=>{if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},_=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;let o=e+t;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:o,behavior:n})},v=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);t.isConnected?this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this)):this.observer.unobserve(t)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,n])=>{n===void 0&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:u,rangeExtractor:d,onChange:()=>{},measureElement:g,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,...e}},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=a(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}this.scrollElement=e,this.targetWindow=this.scrollElement&&`ownerDocument`in this.scrollElement?this.scrollElement.ownerDocument.defaultView:this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=a(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,t,n,r,i,a,o)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o}),{key:!1}),this.getMeasurements=a(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o},s)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);let l=this.measurementsCache.slice(0,c),u=Array(a).fill(void 0);for(let e=0;e<c;e++){let t=l[e];t&&(u[t.lane]=e)}for(let i=c;i<e;i++){let e=r(i),a=this.laneAssignments.get(i),c,d,f=o===`estimate`||s.has(e);if(a!==void 0&&this.options.lanes>1){c=a;let e=u[c],r=e===void 0?void 0:l[e];d=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?l[i-1]:this.getFurthestMeasurement(l,i);d=e?e.end+this.options.gap:t+n,c=e?e.lane:i%this.options.lanes,this.options.lanes>1&&f&&this.laneAssignments.set(i,c)}let p=s.get(e),m=typeof p==`number`?p:this.options.estimateSize(i),h=d+m;l[i]={index:i,start:d,size:m,end:h,key:e,lane:c},u[c]=i}return this.measurementsCache=l,l},{key:!1,debug:()=>this.options.debug}),this.calculateRange=a(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?b({measurements:e,outerSize:t,scrollOffset:n,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=a(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{let n=this.measurementsCache[e];if(!n)return;let r=t-(this.itemSizeCache.get(n.key)??n.size);r!==0&&(this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?n.start<this.getScrollOffset()+this.scrollAdjustments:this.shouldAdjustScrollPositionOnItemSizeChange(n,r,this))&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,t)),this.notify(!1))},this.getVirtualItems=a(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length!==0)return o(t[y(0,t.length-1,e=>o(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`){if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t]}if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1)t=e[e.length-1]?.end??0;else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){this.targetWindow?this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}):this.scrollState=null}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&s(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.scrollState=null;return}}else this.scrollState.stableFrames=0,n&&(this.scrollState.lastTargetOffset=t,this.scrollState.behavior=`auto`,this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}));this.scheduleScrollReconcile()}},y=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function b({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){let i=e.length-1,a=t=>e[t].start;if(e.length<=r)return{startIndex:0,endIndex:i};let o=y(0,i,a,n),s=o;if(r===1)for(;s<i&&e[s].end<n+t;)s++;else if(r>1){let a=Array(r).fill(0);for(;s<i&&a.some(e=>e<n+t);){let t=e[s];a[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(i,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var x=typeof document<`u`?r.useLayoutEffect:r.useEffect;function S({useFlushSync:e=!0,...t}){let n=r.useReducer(()=>({}),{})[1],a={...t,onChange:(r,a)=>{var o;e&&a?(0,i.flushSync)(n):n(),(o=t.onChange)==null||o.call(t,r,a)}},[o]=r.useState(()=>new v(a));return o.setOptions(a),x(()=>o._didMount(),[]),x(()=>o._willUpdate()),o}function C(e){return S({observeElementRect:f,observeElementOffset:h,scrollToFn:_,...e})}export{C as t};
|
package/dist/index.html
CHANGED
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&family=Space+Grotesk:wght@500;600;700&display=swap"
|
|
12
12
|
rel="stylesheet"
|
|
13
13
|
/>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
15
|
-
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-
|
|
16
|
-
<link rel="modulepreload" crossorigin href="/assets/react-vendor-
|
|
17
|
-
<link rel="modulepreload" crossorigin href="/assets/tanstack-virtual-vendor-
|
|
18
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-8iC40E8n.js"></script>
|
|
15
|
+
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-XKyaHtl9.js">
|
|
16
|
+
<link rel="modulepreload" crossorigin href="/assets/react-vendor-HrA5Qiu9.js">
|
|
17
|
+
<link rel="modulepreload" crossorigin href="/assets/tanstack-virtual-vendor-DXt6i1QQ.js">
|
|
18
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BGYJHoWz.css">
|
|
19
19
|
</head>
|
|
20
20
|
<body>
|
|
21
21
|
<div id="root"></div>
|